3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Wed Apr 2 20:45:31 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 'ldflags="$ldflags -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" ;;
5262 *) dflt="$ldflags";;
5265 : Try to guess additional flags to pick up local libraries.
5266 for thislibdir in $libpth; do
5267 case " $loclibpth " in
5270 *"-L$thislibdir "*) ;;
5271 *) dflt="$dflt -L$thislibdir" ;;
5283 Your C linker may need flags. For this question you should
5284 include -L/whatever and any other flags used by the C linker, but you
5285 should NOT include libraries like -lwhatever.
5287 Make sure you include the appropriate -L/path flags if your C linker
5288 does not normally search all of the directories you specified above,
5291 To use no flags, specify the word "none".
5295 rp="Any additional ld flags (NOT including libraries)?"
5301 rmlist="$rmlist pdp11"
5305 echo "Checking your choice of C compiler and flags for coherency..." >&4
5306 $cat > try.c <<'EOF'
5308 int main() { printf("Ok\n"); return(0); }
5310 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5312 $cat >try.msg <<'EOM'
5313 I've tried to compile and run the following simple program:
5316 $cat try.c >> try.msg
5318 $cat >> try.msg <<EOM
5325 and I got the following output:
5329 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5330 if $sh -c "$run ./try " >>try.msg 2>&1; then
5334 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5337 cat >> try.msg <<'EOQS'
5338 If $libs contains -lsfio, and sfio is mis-configured, then it
5339 sometimes (apparently) runs and exits with a 0 status, but with no
5340 output! It may have to do with sfio's use of _exit vs. exit.
5343 rp="You have a big problem. Shall I abort Configure"
5350 echo "The program compiled OK, but exited with status $?." >>try.msg
5351 rp="You have a problem. Shall I abort Configure"
5355 echo "I can't compile the test program." >>try.msg
5356 rp="You have a BIG problem. Shall I abort Configure"
5362 case "$knowitall" in
5364 echo "(The supplied flags or libraries might be incorrect.)"
5372 *) echo "Ok. Stopping Configure." >&4
5377 n) echo "OK, that should do.";;
5379 $rm_try gcctest gcctest.out
5381 : define a shorthand compile call
5385 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5386 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5390 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5391 : define a shorthand compile call for compilations that should be ok.
5395 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5397 : determine filename position in cpp output
5399 echo "Computing filename position in cpp output for #include directives..." >&4
5401 vos) testaccess=-e ;;
5404 echo '#include <stdio.h>' > foo.c
5407 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5408 $grep '^[ ]*#.*stdio\.h' | \
5409 while read cline; do
5412 while $test \$# -gt 0; do
5413 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5418 pos=\`expr \$pos + 1\`
5430 *) pos="${fieldn}th";;
5432 echo "Your cpp writes the filename in the $pos field of the line."
5435 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5436 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5439 : locate header file
5444 for usrincdir in $usrinc
5446 if test -f \$usrincdir/\$wanted; then
5447 echo "\$usrincdir/\$wanted"
5451 awkprg='{ print \$$fieldn }'
5452 echo "#include <\$wanted>" > foo\$\$.c
5453 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5454 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5455 while read cline; do
5456 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5458 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5459 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5464 # status = 0: grep returned 0 lines, case statement not executed
5465 # status = 1: headerfile found
5466 # status = 2: while loop executed, no headerfile found
5470 if test \$status -eq 1; then
5477 : define an alternate in-header-list? function
5478 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5479 cont=true; xxf="echo \"<\$1> found.\" >&4";
5480 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5481 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5483 case $# in 4) instead=instead;; *) instead="at last";; esac;
5484 while $test "$cont"; do
5486 var=$2; eval "was=\$$2";
5487 if $test "$xxx" && $test -r "$xxx";
5489 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5492 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5493 set $yyy; shift; shift; yyy=$@;
5494 case $# in 0) cont="";;
5495 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5496 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5497 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5498 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5502 do set $yyy; var=$2; eval "was=\$$2";
5503 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5504 set $yyy; shift; shift; yyy=$@;
5507 : see if stdlib is available
5508 set stdlib.h i_stdlib
5511 : check for lengths of integral types
5515 echo "Checking to see how big your integers are..." >&4
5524 printf("intsize=%d;\n", (int)sizeof(int));
5525 printf("longsize=%d;\n", (int)sizeof(long));
5526 printf("shortsize=%d;\n", (int)sizeof(short));
5531 if eval $compile_ok && $run ./try > /dev/null; then
5533 echo "Your integers are $intsize bytes long."
5534 echo "Your long integers are $longsize bytes long."
5535 echo "Your short integers are $shortsize bytes long."
5539 Help! I can't compile and run the intsize test program: please enlighten me!
5540 (This is probably a misconfiguration in your system or libraries, and
5541 you really ought to fix it. Still, I'll try anyway.)
5545 rp="What is the size of an integer (in bytes)?"
5549 rp="What is the size of a long integer (in bytes)?"
5553 rp="What is the size of a short integer (in bytes)?"
5561 : check for long long
5563 echo "Checking to see if you have long long..." >&4
5564 echo 'int main() { long long x = 7; return 0; }' > try.c
5566 if eval $compile; then
5568 echo "You have long long."
5571 echo "You do not have long long."
5577 : check for length of long long
5578 case "${d_longlong}${longlongsize}" in
5581 echo "Checking to see how big your long longs are..." >&4
5582 $cat >try.c <<'EOCP'
5586 printf("%d\n", (int)sizeof(long long));
5591 if eval $compile_ok; then
5592 longlongsize=`$run ./try`
5593 echo "Your long longs are $longlongsize bytes long."
5597 echo "(I can't seem to compile the test program. Guessing...)"
5598 rp="What is the size of a long long (in bytes)?"
5602 if $test "X$longsize" = "X$longlongsize"; then
5603 echo "(That isn't any different from an ordinary long.)"
5609 : see if inttypes.h is available
5610 : we want a real compile instead of Inhdr because some systems
5611 : have an inttypes.h which includes non-existent headers
5614 #include <inttypes.h>
5616 static int32_t foo32 = 0x12345678;
5620 if eval $compile; then
5621 echo "<inttypes.h> found." >&4
5624 echo "<inttypes.h> NOT found." >&4
5633 echo "Checking to see if you have int64_t..." >&4
5635 #include <sys/types.h>
5636 #$i_inttypes I_INTTYPES
5638 #include <inttypes.h>
5640 int main() { int64_t x = 7; }
5643 if eval $compile; then
5645 echo "You have int64_t."
5648 echo "You do not have int64_t."
5654 : Check if 64bit ints have a quad type
5656 echo "Checking which 64-bit integer type we could use..." >&4
5662 val='"unsigned int"'
5667 *) case "$longsize" in
5671 val='"unsigned long"'
5676 *) case "$d_longlong:$longlongsize" in
5681 val='"unsigned long long"'
5686 *) case "$d_int64_t" in
5705 '') echo "Alas, no 64-bit integer types in sight." >&4
5708 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5713 : Do we want 64bit support
5714 case "$uselonglong" in
5715 "$define"|true|[yY]*)
5718 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5720 use64bitint="$define"
5723 case "$use64bits" in
5724 "$define"|true|[yY]*)
5727 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5729 use64bitint="$define"
5732 case "$use64bitints" in
5733 "$define"|true|[yY]*)
5736 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5738 use64bitint="$define"
5741 case "$use64bitsint" in
5742 "$define"|true|[yY]*)
5745 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5747 use64bitint="$define"
5750 case "$uselonglongs" in
5751 "$define"|true|[yY]*)
5754 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5756 use64bitint="$define"
5759 case "$use64bitsall" in
5760 "$define"|true|[yY]*)
5763 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5765 use64bitall="$define"
5770 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5772 case "$use64bitall" in
5773 "$define"|true|[yY]*) use64bitint="$define" ;;
5779 You have natively 64-bit long integers.
5783 *) case "$use64bitint" in
5784 "$define"|true|[yY]*) dflt='y';;
5793 Perl can be built to take advantage of 64-bit integer types
5794 on some systems. To do so, Configure can be run with -Duse64bitint.
5795 Choosing this option will most probably introduce binary incompatibilities.
5797 If this doesn't make any sense to you, just accept the default '$dflt'.
5798 (The default has been chosen based on your configuration.)
5800 rp='Try to use 64-bit integers, if available?'
5803 [yY]*) val="$define" ;;
5811 case "$use64bitall" in
5812 "$define"|true|[yY]*) dflt='y' ;;
5813 *) case "$longsize" in
5821 You may also choose to try maximal 64-bitness. It means using as much
5822 64-bitness as possible on the platform. This in turn means even more
5823 binary incompatibilities. On the other hand, your platform may not
5824 have any more 64-bitness available than what you already have chosen.
5826 If this doesn't make any sense to you, just accept the default '$dflt'.
5827 (The default has been chosen based on your configuration.)
5829 rp='Try to use maximal 64-bit support, if available?'
5832 [yY]*) val="$define" ;;
5837 case "$use64bitall" in
5839 case "$use64bitint" in
5843 Since you have chosen a maximally 64-bit build, I'm also turning on
5844 the use of 64-bit integers.
5846 use64bitint="$define" ;;
5851 : Look for a hint-file generated 'call-back-unit'. If the
5852 : user has specified that a 64-bit perl is to be built,
5853 : we may need to set or change some other defaults.
5854 if $test -f use64bitint.cbu; then
5855 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5858 case "$use64bitint" in
5859 "$define"|true|[yY]*)
5861 4) case "$archname64" in
5862 '') archname64=64int ;;
5869 : Look for a hint-file generated 'call-back-unit'. If the
5870 : user has specified that a maximally 64-bit perl is to be built,
5871 : we may need to set or change some other defaults.
5872 if $test -f use64bitall.cbu; then
5873 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5876 case "$use64bitall" in
5877 "$define"|true|[yY]*)
5879 4) case "$archname64" in
5880 ''|64int) archname64=64all ;;
5887 case "$d_quad:$use64bitint" in
5891 *** You have chosen to use 64-bit integers,
5892 *** but none can be found.
5893 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5894 *** Cannot continue, aborting.
5901 : check for length of double
5903 case "$doublesize" in
5905 echo "Checking to see how big your double precision numbers are..." >&4
5914 printf("%d\n", (int)sizeof(double));
5919 if eval $compile_ok; then
5920 doublesize=`$run ./try`
5921 echo "Your double is $doublesize bytes long."
5924 echo "(I can't seem to compile the test program. Guessing...)"
5925 rp="What is the size of a double precision number (in bytes)?"
5933 : check for long doubles
5935 echo "Checking to see if you have long double..." >&4
5936 echo 'int main() { long double x = 7.0; }' > try.c
5938 if eval $compile; then
5940 echo "You have long double."
5943 echo "You do not have long double."
5949 : check for length of long double
5950 case "${d_longdbl}${longdblsize}" in
5953 echo "Checking to see how big your long doubles are..." >&4
5954 $cat >try.c <<'EOCP'
5958 printf("%d\n", sizeof(long double));
5963 if eval $compile; then
5964 longdblsize=`$run ./try`
5965 echo "Your long doubles are $longdblsize bytes long."
5969 echo "(I can't seem to compile the test program. Guessing...)" >&4
5970 rp="What is the size of a long double (in bytes)?"
5974 if $test "X$doublesize" = "X$longdblsize"; then
5975 echo "That isn't any different from an ordinary double."
5976 echo "I'll keep your setting anyway, but you may see some"
5977 echo "harmless compilation warnings."
5983 : determine the architecture name
5985 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5986 tarch=`arch`"-$osname"
5987 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5988 if uname -m > tmparch 2>&1 ; then
5989 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5990 -e 's/$/'"-$osname/" tmparch`
5998 case "$myarchname" in
6001 echo "(Your architecture name used to be $myarchname.)"
6005 case "$targetarch" in
6007 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6012 *) dflt="$archname";;
6014 rp='What is your architecture name'
6017 case "$usethreads" in
6019 echo "Threads selected." >&4
6021 *-thread*) echo "...and architecture name already has -thread." >&4
6023 *) archname="$archname-thread"
6024 echo "...setting architecture name to $archname." >&4
6029 case "$usemultiplicity" in
6031 echo "Multiplicity selected." >&4
6033 *-multi*) echo "...and architecture name already has -multi." >&4
6035 *) archname="$archname-multi"
6036 echo "...setting architecture name to $archname." >&4
6041 case "$use64bitint$use64bitall" in
6043 case "$archname64" in
6045 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6048 case "$use64bitint" in
6049 "$define") echo "64 bit integers selected." >&4 ;;
6051 case "$use64bitall" in
6052 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6055 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6057 *) archname="$archname-$archname64"
6058 echo "...setting architecture name to $archname." >&4
6064 case "$uselongdouble" in
6066 echo "Long doubles selected." >&4
6067 case "$longdblsize" in
6069 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6073 *-ld*) echo "...and architecture name already has -ld." >&4
6075 *) archname="$archname-ld"
6076 echo "...setting architecture name to $archname." >&4
6083 case "$useperlio" in
6085 echo "Perlio selected." >&4
6088 echo "Perlio not selected, using stdio." >&4
6090 *-stdio*) echo "...and architecture name already has -stdio." >&4
6092 *) archname="$archname-stdio"
6093 echo "...setting architecture name to $archname." >&4
6098 if $test -f archname.cbu; then
6099 echo "Your platform has some specific hints for architecture name, using them..."
6103 : set the prefixit variable, to compute a suitable default value
6104 prefixit='case "$3" in
6106 case "$oldprefix" in
6107 "") eval "$1=\"\$$2\"";;
6114 ""|" ") eval "$1=\"\$$2\"";;
6120 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6122 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6123 /*-$oldprefix/*|\~*-$oldprefix/*)
6124 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6125 *) eval "$1=\"\$$2\"";;
6129 : determine installation style
6130 : For now, try to deduce it from prefix unless it is already set.
6131 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6132 case "$installstyle" in
6133 '') case "$prefix" in
6134 *perl*) dflt='lib';;
6135 *) dflt='lib/perl5' ;;
6138 *) dflt="$installstyle" ;;
6140 : Probably not worth prompting for this since we prompt for all
6141 : the directories individually, and the prompt would be too long and
6145 : determine where public executables go
6150 rp='Pathname where the public executables will reside?'
6152 if $test "X$ansexp" != "X$binexp"; then
6156 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6157 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6158 : this via initialinstalllocation
6161 case "$userelocatableinc" in
6162 $define|true|[yY]*) dflt='y' ;;
6167 Would you like to build Perl so that the installation is relocatable, so that
6168 library paths in @INC are determined relative to the path of the perl binary?
6169 This is not advised for system Perl installs, or if you need to run setid
6170 scripts or scripts under taint mode.
6172 If this doesn't make any sense to you, just accept the default '$dflt'.
6174 rp='Use relocatable @INC?'
6177 y|Y) val="$define" ;;
6180 set userelocatableinc
6183 initialinstalllocation="$binexp"
6184 : Default prefix is now "up one level from where the binaries are"
6185 case "$userelocatableinc" in
6191 installprefixexp=".../.."
6195 : determine where private library files go
6196 : Usual default is /usr/local/lib/perl5/$version.
6197 : Also allow things like /opt/perl/lib/$version, since
6198 : /opt/perl/lib/perl5... would be redundant.
6199 : The default "style" setting is made in installstyle.U
6200 case "$installstyle" in
6201 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6202 *) set dflt privlib lib/$version ;;
6207 There are some auxiliary files for $package that need to be put into a
6208 private library directory that is accessible by everyone.
6213 rp='Pathname where the private library files will reside?'
6218 : set the prefixup variable, to restore leading tilda escape
6219 prefixup='case "$prefixexp" in
6221 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6224 : determine where public architecture dependent libraries go
6227 : privlib default is /usr/local/lib/$package/$version
6228 : archlib default is /usr/local/lib/$package/$version/$archname
6229 : privlib may have an optional trailing /share.
6230 tdflt=`echo $privlib | $sed 's,/share$,,'`
6231 tdflt=$tdflt/$archname
6240 $spackage contains architecture-dependent library files. If you are
6241 sharing libraries in a heterogeneous environment, you might store
6242 these files in a separate location. Otherwise, you can just include
6243 them with the rest of the public library files.
6248 rp='Where do you want to put the public architecture-dependent libraries?'
6252 if $test X"$archlib" = X"$privlib"; then
6258 : see if setuid scripts can be secure
6261 Some kernels have a bug that prevents setuid #! scripts from being
6262 secure. Some sites have disabled setuid #! scripts because of this.
6264 First let's decide if your kernel supports secure setuid #! scripts.
6265 (If setuid #! scripts would be secure but have been disabled anyway,
6266 don't say that they are secure if asked.)
6271 if $test -d /dev/fd; then
6272 echo "#!$ls" >reflect
6273 chmod +x,u+s reflect
6274 ./reflect >flect 2>&1
6275 if $contains "/dev/fd" flect >/dev/null; then
6276 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6280 If you are not sure if they are secure, I can check but I'll need a
6281 username and password different from the one you are using right now.
6282 If you don't have such a username or don't want me to test, simply
6286 rp='Other username to test security of setuid scripts with?'
6291 case "$d_suidsafe" in
6292 '') echo "I'll assume setuid scripts are *not* secure." >&4
6295 echo "Well, the $hint value is *not* secure." >&4
6297 *) echo "Well, the $hint value *is* secure." >&4
6302 $rm -f reflect flect
6303 echo "#!$ls" >reflect
6304 chmod +x,u+s reflect
6307 echo '"su" will (probably) prompt you for '"$ans's password."
6308 su $ans -c './reflect >flect'
6309 if $contains "/dev/fd" flect >/dev/null; then
6310 echo "Okay, it looks like setuid scripts are secure." >&4
6313 echo "I don't think setuid scripts are secure." >&4
6318 rp='Does your kernel have *secure* setuid scripts?'
6321 [yY]*) val="$define";;
6326 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6327 echo "(That's for file descriptors, not floppy disks.)"
6333 $rm -f reflect flect
6335 : now see if they want to do setuid emulation
6338 case "$d_suidsafe" in
6341 echo "No need to emulate SUID scripts since they are secure here." >&4
6345 Some systems have disabled setuid scripts, especially systems where
6346 setuid scripts cannot be secure. On systems where setuid scripts have
6347 been disabled, the setuid/setgid bits on scripts are currently
6348 useless. It is possible for $package to detect those bits and emulate
6349 setuid/setgid in a secure fashion. This emulation will only work if
6350 setuid scripts have been disabled in your kernel.
6354 "$define") dflt=y ;;
6357 rp="Do you want to do setuid/setgid emulation?"
6360 [yY]*) val="$define";;
6368 : Find perl5.005 or later.
6369 echo "Looking for a previously installed perl5.005 or later... "
6371 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6372 : Check if this perl is recent and can load a simple module
6373 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6376 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6386 '') echo "None found. That's ok.";;
6387 *) echo "Using $perl5." ;;
6390 : Set the siteprefix variables
6393 After $package is installed, you may wish to install various
6394 add-on modules and utilities. Typically, these add-ons will
6395 be installed under $prefix with the rest
6396 of this package. However, you may wish to install such add-ons
6397 elsewhere under a different prefix.
6399 If you do not wish to put everything under a single prefix, that's
6400 ok. You will be prompted for the individual locations; this siteprefix
6401 is only used to suggest the defaults.
6403 The default should be fine for most people.
6407 rp='Installation prefix to use for add-on modules and utilities?'
6408 : XXX Here might be another good place for an installstyle setting.
6409 case "$siteprefix" in
6411 *) dflt=$siteprefix ;;
6414 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6416 case "$siteprefix" in
6420 *) oldsiteprefix="$prefix";;
6425 siteprefixexp="$ansexp"
6427 : determine where site specific libraries go.
6428 : Usual default is /usr/local/lib/perl5/site_perl/$version
6429 : The default "style" setting is made in installstyle.U
6430 : XXX No longer works with Prefixit stuff.
6431 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6433 '') case "$installstyle" in
6434 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6435 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6443 The installation process will create a directory for
6444 site-specific extensions and modules. Most users find it convenient
6445 to place all site-specific files in this directory rather than in the
6446 main distribution directory.
6450 rp='Pathname for the site-specific library files?'
6454 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6456 : Determine list of previous versions to include in @INC
6457 $cat > getverlist <<EOPL
6460 \$api_versionstring = "$api_versionstring";
6461 \$version = "$version";
6462 \$stem = "$sitelib_stem";
6463 \$archname = "$archname";
6465 $cat >> getverlist <<'EOPL'
6466 # The list found is store twice for each entry: the original name, and
6467 # the binary broken down version as pack "sss", so sorting is easy and
6468 # unambiguous. This will work for all versions that have a maximum of
6469 # three digit groups, separate by '.'s or '_'s. Names are extended with
6470 # ".0.0" to ensure at least three elements for the pack.
6471 # -- H.Merijn Brand (m)'06 23-10-2006
6473 # Can't have leading @ because metaconfig interprets it as a command!
6474 ;@inc_version_list=();
6475 # XXX Redo to do opendir/readdir?
6478 ;@candidates = map {
6479 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6485 ($pversion, $aversion, $vsn5005) = map {
6486 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6487 foreach $d (@candidates) {
6488 if ($d->[1] lt $pversion) {
6489 if ($d->[1] ge $aversion) {
6490 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6492 elsif ($d->[1] ge $vsn5005) {
6493 unshift(@inc_version_list, grep { -d } $d->[0]);
6497 # Skip newer version. I.e. don't look in
6498 # 5.7.0 if we're installing 5.6.1.
6502 if (@inc_version_list) {
6503 print join(' ', @inc_version_list);
6506 # Blank space to preserve value for next Configure run.
6511 case "$inc_version_list" in
6512 '') if test -x "$perl5$exe_ext"; then
6513 dflt=`$perl5 getverlist`
6518 $undef) dflt='none' ;;
6519 *) eval dflt=\"$inc_version_list\" ;;
6522 ''|' ') dflt=none ;;
6529 In order to ease the process of upgrading, this version of perl
6530 can be configured to use modules built and installed with earlier
6531 versions of perl that were installed under $prefix. Specify here
6532 the list of earlier versions that this version of perl should check.
6533 If Configure detected no earlier versions of perl installed under
6534 $prefix, then the list will be empty. Answer 'none' to tell perl
6535 to not search earlier versions.
6537 The default should almost always be sensible, so if you're not sure,
6538 just accept the default.
6541 rp='List of earlier versions to include in @INC?'
6544 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6545 *) inc_version_list="$ans" ;;
6547 case "$inc_version_list" in
6549 inc_version_list_init='0'
6550 d_inc_version_list="$undef"
6552 *) inc_version_list_init=`echo $inc_version_list |
6553 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6554 d_inc_version_list="$define"
6559 : see if malloc/malloc.h has to be included
6560 set malloc/malloc.h i_mallocmalloc
6563 : see if this is a malloc.h system
6564 : we want a real compile instead of Inhdr because some systems have a
6565 : malloc.h that just gives a compile error saying to use stdlib.h instead
6570 #$i_mallocmalloc I_MALLOCMALLOC
6571 #ifdef I_MALLOCMALLOC
6572 # include <malloc/malloc.h>
6575 int main () { return 0; }
6578 if eval $compile; then
6579 echo "<malloc.h> found." >&4
6582 echo "<malloc.h> NOT found." >&4
6589 : check for void type
6591 echo "Checking to see how well your C compiler groks the void type..." >&4
6592 case "$voidflags" in
6604 extern void moo(); /* function returning void */
6605 void (*goo)(); /* ptr to func returning void */
6607 void *hue; /* generic ptr */
6620 int main() { sub(); }
6622 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6623 voidflags=$defvoidused
6624 echo "Good. It appears to support void to the level $package wants.">&4
6625 if $contains warning .out >/dev/null 2>&1; then
6626 echo "However, you might get some warnings that look like this:"
6630 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6631 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6632 echo "It supports 1..."
6633 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6634 echo "It also supports 2..."
6635 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6637 echo "And it supports 4 but not 8 definitely."
6639 echo "It doesn't support 4..."
6640 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6642 echo "But it supports 8."
6645 echo "Neither does it support 8."
6649 echo "It does not support 2..."
6650 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6652 echo "But it supports 4 and 8."
6654 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6656 echo "And it supports 4 but has not heard about 8."
6658 echo "However it supports 8 but not 4."
6663 echo "There is no support at all for void."
6668 case "$voidflags" in
6671 Support flag bits are:
6672 1: basic void declarations.
6673 2: arrays of pointers to functions returning void.
6674 4: operations between pointers to and addresses of void functions.
6675 8: generic void pointers.
6678 rp="Your void support flags add up to what?"
6685 : check for length of pointer
6689 echo "Checking to see how big your pointers are..." >&4
6690 if test "$voidflags" -gt 7; then
6691 echo '#define VOID_PTR char *' > try.c
6693 echo '#define VOID_PTR void *' > try.c
6703 printf("%d\n", (int)sizeof(VOID_PTR));
6708 if eval $compile_ok; then
6709 ptrsize=`$run ./try`
6710 echo "Your pointers are $ptrsize bytes long."
6713 echo "(I can't seem to compile the test program. Guessing...)" >&4
6714 rp="What is the size of a pointer (in bytes)?"
6721 case "$use64bitall" in
6722 "$define"|true|[yY]*)
6726 *** You have chosen a maximally 64-bit build,
6727 *** but your pointers are only 4 bytes wide.
6728 *** Please rerun Configure without -Duse64bitall.
6733 *** Since you have quads, you could possibly try with -Duse64bitint.
6738 *** Cannot continue, aborting.
6749 : determine whether to use malloc wrapping
6751 case "$usemallocwrap" in
6752 [yY]*|true|$define) dflt='y' ;;
6753 [nN]*|false|$undef) dflt='n' ;;
6754 *) case "$usedevel" in
6755 [yY]*|true|$define) dflt='y' ;;
6760 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6762 usemallocwrap="$ans"
6765 usemallocwrap="$define" ;;
6767 usemallocwrap="$undef" ;;
6770 : determine which malloc to compile in
6772 case "$usemymalloc" in
6773 [yY]*|true|$define) dflt='y' ;;
6774 [nN]*|false|$undef) dflt='n' ;;
6775 *) case "$ptrsize" in
6781 rp="Do you wish to attempt to use the malloc that comes with $package?"
6787 mallocsrc='malloc.c'
6788 mallocobj="malloc$_o"
6789 d_mymalloc="$define"
6792 : Remove malloc from list of libraries to use
6793 echo "Removing unneeded -lmalloc from library list" >&4
6794 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6797 echo "libs = $libs" >&4
6809 : compute the return types of malloc and free
6811 $cat >malloc.c <<END
6815 #include <sys/types.h>
6829 case "$malloctype" in
6831 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6838 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6842 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6849 echo "Your system uses $freetype free(), it would seem." >&4
6851 : determine where site specific architecture-dependent libraries go.
6852 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6853 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6854 : sitelib may have an optional trailing /share.
6856 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6857 dflt="$dflt/$archname"
6862 set sitearch sitearch none
6866 The installation process will also create a directory for
6867 architecture-dependent site-specific extensions and modules.
6871 rp='Pathname for the site-specific architecture-dependent library files?'
6875 if $test X"$sitearch" = X"$sitelib"; then
6878 d_sitearch="$define"
6881 : Set the vendorprefix variables
6884 The installation process will also create a directory for
6885 vendor-supplied add-ons. Vendors who supply perl with their system
6886 may find it convenient to place all vendor-supplied files in this
6887 directory rather than in the main distribution directory. This will
6888 ease upgrades between binary-compatible maintenance versions of perl.
6890 Of course you may also use these directories in whatever way you see
6891 fit. For example, you might use them to access modules shared over a
6892 company-wide network.
6894 The default answer should be fine for most people.
6895 This causes further questions about vendor add-ons to be skipped
6896 and no vendor-specific directories will be configured for perl.
6899 rp='Do you want to configure vendor-specific add-on directories?'
6900 case "$usevendorprefix" in
6901 define|true|[yY]*) dflt=y ;;
6902 *) : User may have set vendorprefix directly on Configure command line.
6903 case "$vendorprefix" in
6912 rp='Installation prefix to use for vendor-supplied add-ons?'
6913 case "$vendorprefix" in
6915 *) dflt=$vendorprefix ;;
6918 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6920 case "$vendorprefix" in
6924 *) oldvendorprefix="$prefix";;
6928 usevendorprefix="$define"
6930 vendorprefixexp="$ansexp"
6932 *) usevendorprefix="$undef"
6938 : Set the vendorlib variables
6939 case "$vendorprefix" in
6940 '') d_vendorlib="$undef"
6944 *) d_vendorlib="$define"
6945 : determine where vendor-supplied modules go.
6946 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6947 case "$vendorlib" in
6949 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6950 case "$installstyle" in
6951 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6952 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6955 *) dflt="$vendorlib"
6959 rp='Pathname for the vendor-supplied library files?'
6962 vendorlibexp="$ansexp"
6965 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6969 : Set the vendorarch variables
6970 case "$vendorprefix" in
6971 '') d_vendorarch="$undef"
6975 *) d_vendorarch="$define"
6976 : determine where vendor-supplied architecture-dependent libraries go.
6977 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6978 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6979 : vendorlib may have an optional trailing /share.
6980 case "$vendorarch" in
6981 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6982 dflt="$dflt/$archname"
6984 *) dflt="$vendorarch" ;;
6987 rp='Pathname for vendor-supplied architecture-dependent files?'
6990 vendorarchexp="$ansexp"
6993 prefixvar=vendorarch
6996 : Final catch-all directories to search
6999 Lastly, you can have perl look in other directories for extensions and
7000 modules in addition to those already specified.
7001 These directories will be searched after
7005 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7006 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7008 case "$otherlibdirs" in
7009 ''|' ') dflt='none' ;;
7010 *) dflt="$otherlibdirs" ;;
7013 Enter a colon-separated set of extra paths to include in perl's @INC
7014 search path, or enter 'none' for no extra paths.
7018 rp='Colon-separated list of additional directories for perl to search?'
7021 ' '|''|none) otherlibdirs=' ' ;;
7022 *) otherlibdirs="$ans" ;;
7024 case "$otherlibdirs" in
7028 set d_perl_otherlibdirs
7031 : Cruising for prototypes
7033 echo "Checking out function prototypes..." >&4
7034 $cat >prototype.c <<EOCP
7039 int main(int argc, char *argv[]) {
7042 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7043 echo "Your C compiler appears to support function prototypes."
7046 echo "Your C compiler doesn't seem to understand function prototypes."
7053 : Check if ansi2knr is required
7054 case "$prototype" in
7056 *) ansi2knr='ansi2knr'
7061 This version of $package can only be compiled by a compiler that
7062 understands function prototypes. Unfortunately, your C compiler
7064 doesn't seem to understand them. Sorry about that.
7066 If GNU cc is available for your system, perhaps you could try that instead.
7068 Eventually, we hope to support building Perl with pre-ANSI compilers.
7069 If you would like to help in that effort, please contact <perlbug@perl.org>.
7071 Aborting Configure now.
7078 dflt_dtrace='/usr/sbin/dtrace'
7081 Perl can be built to support DTrace on platforms that support it.
7082 DTrace is a diagnosis and performance analysis tool from Sun.
7084 If this doesn't make any sense to you, just accept the default '$dflt'.
7088 case "$usedtrace" in
7094 dflt_dtrace=$usedtrace
7101 rp='Support DTrace if available?'
7104 y|Y) val="$define" ;;
7110 test "X$usedtrace" != "X$define" && break
7113 rp='Where is the dtrace executable?'
7122 if $dtrace -h -s ../perldtrace.d \
7123 -o perldtrace.tmp >/dev/null 2>&1 \
7124 && rm -f perldtrace.tmp
7127 echo "Good: your $dtrace knows about the -h flag."
7131 *** $me: Fatal Error: $dtrace doesn't support -h flag
7133 *** Your installed dtrace doesn't support the -h switch to compile a D
7134 *** program into a C header. Can't continue.
7146 *** $me: Fatal Error: $dtrace not found.
7153 echo "*** $dtrace was not found."
7159 : See if we want extra modules installed
7166 Perl can be built with extra modules or bundles of modules which
7167 will be fetched from the CPAN and installed alongside Perl.
7169 Notice that you will need access to the CPAN; either via the Internet,
7170 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7171 be asked later to configure the CPAN.pm module which will in turn do
7172 the installation of the rest of the extra modules or bundles.)
7174 Notice also that if the modules require any external software such as
7175 libraries and headers (the libz library and the zlib.h header for the
7176 Compress::Zlib module, for example) you MUST have any such software
7177 already installed, this configuration process will NOT install such
7180 If this doesn't make any sense to you, just accept the default '$dflt'.
7182 rp='Install any extra modules (y or n)?'
7188 Please list any extra modules or bundles to be installed from CPAN,
7189 with spaces between the names. The names can be in any format the
7190 'install' command of CPAN.pm will understand. (Answer 'none',
7191 without the quotes, to install no extra modules or bundles.)
7201 $rm -f ../extras.lst
7203 *) echo "(Saving the list of extras for later...)"
7204 echo "$extras" > ../extras.lst
7212 : determine where html pages for programs go
7213 set html1dir html1dir none
7217 If you wish to install html files for programs in $spackage, indicate
7218 the appropriate directory here. To skip installing html files,
7222 ''|none|$undef|' ') dflt=none ;;
7223 *) dflt=$html1dir ;;
7226 rp="Directory for the main $spackage html pages?"
7230 : Use ' ' for none so value is preserved next time through Configure
7231 $test X"$html1dir" = "X" && html1dir=' '
7233 : determine where html pages for libraries and modules go
7234 set html3dir html3dir none
7238 If you wish to install html files for modules associated with $spackage,
7239 indicate the appropriate directory here. To skip installing html files,
7242 : There is no obvious default. If they have specified html1dir, then
7243 : try to key off that, possibly changing .../html1 into .../html3.
7245 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7246 *) dflt=$html3dir ;;
7249 rp="Directory for the $spackage module html pages?"
7253 : Use ' ' for none so value is preserved next time through Configure
7254 $test X"$html3dir" = "X" && html3dir=' '
7256 : determine whether to install perl also as /usr/bin/perl
7259 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7261 Many scripts expect perl to be installed as /usr/bin/perl.
7263 If you want to, I can install the perl you are about to compile
7264 as /usr/bin/perl (in addition to $bin/perl).
7266 if test -f /usr/bin/perl; then
7269 However, please note that because you already have a /usr/bin/perl,
7270 overwriting that with a new Perl would very probably cause problems.
7271 Therefore I'm assuming you don't want to do that (unless you insist).
7274 case "$installusrbinperl" in
7275 "$define"|[yY]*) dflt='y';;
7281 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7284 case "$installusrbinperl" in
7285 "$undef"|[nN]*) dflt='n';;
7289 rp="Do you want to install perl as /usr/bin/perl?"
7292 [yY]*) val="$define";;
7298 set installusrbinperl
7301 : Check if we are using the GNU C library
7303 echo "Checking for GNU C Library..." >&4
7305 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7306 alone are insufficient to distinguish different versions, such as
7307 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7308 libc version 2.1.0. A. Dougherty, June 3, 2002.
7314 # ifdef __GLIBC_MINOR__
7315 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7316 # include <gnu/libc-version.h>
7317 printf("%s\n", gnu_get_libc_version());
7319 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7322 printf("%d\n", __GLIBC__);
7331 if eval $compile_ok && $run ./try > glibc.ver; then
7333 gnulibc_version=`$cat glibc.ver`
7334 echo "You are using the GNU C Library version $gnulibc_version"
7338 echo "You are not using the GNU C Library"
7344 : see if nm is to be used to determine whether a symbol is defined or not
7348 case "$d_gnulibc" in
7351 echo "nm probably won't work on the GNU C Library." >&4
7357 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7359 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7360 echo "'nm' won't be sufficient on this sytem." >&4
7366 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7367 if $test $dflt -gt 20; then
7377 true|$define) dflt=y;;
7384 I can use $nm to extract the symbols from your C libraries. This
7385 is a time consuming task which may generate huge output on the disk (up
7386 to 3 megabytes) but that should make the symbols extraction faster. The
7387 alternative is to skip the 'nm' extraction part and to compile a small
7388 test program instead to determine whether each symbol is present. If
7389 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7390 this may be the best solution.
7392 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7395 rp="Shall I use $nm to extract C symbols from the libraries?"
7398 [Nn]*) usenm=false;;
7407 : nm options which may be necessary
7409 '') if $test -f /mach_boot; then
7411 elif $test -d /usr/ccs/lib; then
7412 nm_opt='-p' # Solaris (and SunOS?)
7413 elif $test -f /dgux; then
7415 elif $test -f /lib64/rld; then
7416 nm_opt='-p' # 64-bit Irix
7422 : nm options which may be necessary for shared libraries but illegal
7423 : for archive libraries. Thank you, Linux.
7424 case "$nm_so_opt" in
7425 '') case "$myuname" in
7427 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7428 nm_so_opt='--dynamic'
7435 : get list of predefined functions in a handy place
7442 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7448 *) for thislib in $libs; do
7451 : Handle C library specially below.
7454 thislib=`echo $thislib | $sed -e 's/^-l//'`
7455 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7457 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7459 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7461 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7463 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7465 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7467 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7472 libnames="$libnames $try"
7474 *) libnames="$libnames $thislib" ;;
7483 for xxx in $libpth; do
7484 $test -r $1 || set $xxx/libc.$so
7485 : The messy sed command sorts on library version numbers.
7487 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7488 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7490 s/[0-9][0-9]*/0000&/g
7491 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7494 $sort | $sed -e 's/^.* //'`
7497 $test -r $1 || set /usr/ccs/lib/libc.$so
7498 $test -r $1 || set /lib/libsys_s$_a
7504 if $test -r "$1"; then
7505 echo "Your (shared) C library seems to be in $1."
7507 elif $test -r /lib/libc && $test -r /lib/clib; then
7508 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7510 libc='/lib/clib /lib/libc'
7511 if $test -r /lib/syslib; then
7512 echo "(Your math library is in /lib/syslib.)"
7513 libc="$libc /lib/syslib"
7515 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7516 echo "Your C library seems to be in $libc, as you said before."
7517 elif $test -r $incpath/usr/lib/libc$_a; then
7518 libc=$incpath/usr/lib/libc$_a;
7519 echo "Your C library seems to be in $libc. That's fine."
7520 elif $test -r /lib/libc$_a; then
7522 echo "Your C library seems to be in $libc. You're normal."
7524 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7526 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7527 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7528 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7530 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7532 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7535 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7537 if $test -r "$tans"; then
7538 echo "Your C library seems to be in $tans, of all places."
7544 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7548 If the guess above is wrong (which it might be if you're using a strange
7549 compiler, or your machine supports multiple models), you can override it here.
7554 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7556 I can't seem to find your C library. I've looked in the following places:
7559 $sed 's/^/ /' libpath
7562 None of these seems to contain your C library. I need to get its name...
7567 rp='Where is your C library?'
7572 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7573 set X `cat libnames`
7576 case $# in 1) xxx=file; esac
7577 echo "Extracting names from the following $xxx for later perusal:" >&4
7579 $sed 's/^/ /' libnames >&4
7581 $echo $n "This may take a while...$c" >&4
7585 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7586 *) $nm $nm_opt $file 2>/dev/null;;
7591 $grep fprintf libc.tmp > libc.ptf
7592 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7593 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7595 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7599 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7607 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7611 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7620 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7653 $nm -p $* 2>/dev/null >libc.tmp
7654 $grep fprintf libc.tmp > libc.ptf
7655 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7656 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7662 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7664 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7665 for thisname in $libnames $libc; do
7666 $ar t $thisname >>libc.tmp
7668 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7670 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7671 # Repeat libc to extract forwarders to DLL entries too
7672 for thisname in $libnames $libc; do
7673 $ar tv $thisname >>libc.tmp
7674 # Revision 50 of EMX has bug in $ar.
7675 # it will not extract forwarders to DLL entries
7676 # Use emximp which will extract exactly them.
7677 emximp -o tmp.imp $thisname \
7679 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7680 < tmp.imp >>libc.tmp
7683 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7686 echo "$ar didn't seem to work right." >&4
7687 echo "Maybe this is a Cray...trying bld instead..." >&4
7688 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7690 for thisname in $libnames; do
7692 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7693 $ar t $thisname >>libc.tmp
7697 echo "That didn't work either. Giving up." >&4
7707 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7708 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7710 *) if $test -f /lib/syscalls.exp; then
7712 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7713 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7719 $rm -f libnames libpath
7721 : see if dld is available
7725 : Check if we are using C++
7727 echo "Checking for C++..." >&4
7728 $cat >try.c <<'EOCP'
7740 if eval $compile_ok && $run ./try; then
7742 echo "You are using a C++ compiler."
7745 echo "You are not using a C++ compiler."
7751 : is a C symbol defined?
7754 -v) tf=libc.tmp; tdc="";;
7755 -a) tf=libc.tmp; tdc="[]";;
7756 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7759 case "$reuseval-$4" in
7761 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7766 case "$d_cplusplus" in
7767 $define) extern_C=\"C\";;
7769 if $test "$runnm" = true; then
7770 if $contains $tlook $tf >/dev/null 2>&1; then
7772 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7773 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7774 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7775 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7779 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7780 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7786 $define) tval=true;;
7793 : define an is-in-libc? function
7794 inlibc='echo " "; td=$define; tu=$undef;
7795 sym=$1; var=$2; eval "was=\$$2";
7797 case "$reuseval$was" in
7807 echo "$sym() found." >&4;
7808 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7810 echo "$sym() NOT found." >&4;
7811 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7815 $define) echo "$sym() found." >&4;;
7816 *) echo "$sym() NOT found." >&4;;
7820 : see if dlopen exists
7822 xxx_ccflags="$ccflags"
7824 : with g++ one needs -shared to get is-in-libc to work for dlopen
7825 case "$gccversion" in
7827 *) case "$d_cplusplus" in
7828 "$define") ccflags="$ccflags -shared" ;;
7835 ccflags="$xxx_ccflags"
7837 : see if this is a unistd.h system
7838 set unistd.h i_unistd
7841 : determine which dynamic loading, if any, to compile in
7843 dldir="ext/DynaLoader"
7856 $define) dflt='y' ;;
7859 $define) dflt='y' ;;
7861 : Does a dl_xxx.xs file exist for this operating system
7862 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7865 rp="Do you wish to use dynamic loading?"
7872 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7873 dflt="$dldir/dl_${osname}.xs"
7874 elif $test "$d_dlopen" = "$define" ; then
7875 dflt="$dldir/dl_dlopen.xs"
7876 elif $test "$i_dld" = "$define" ; then
7877 dflt="$dldir/dl_dld.xs"
7882 *) dflt="$dldir/$dlsrc"
7885 echo "The following dynamic loading files are available:"
7886 : Can not go over to $dldir because getfile has path hard-coded in.
7887 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7888 rp="Source file to use for dynamic loading"
7894 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7898 Some systems may require passing special flags to $cc -c to
7899 compile modules that will be used to create a shared library.
7900 To use no flags, say "none".
7903 case "$cccdlflags" in
7904 '') case "$gccversion" in
7905 '') case "$osname" in
7907 next) dflt='none' ;;
7908 irix*) dflt='-KPIC' ;;
7909 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7910 sunos) dflt='-pic' ;;
7914 *) case "$osname" in
7915 darwin) dflt='none' ;;
7916 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7921 *) dflt="$cccdlflags" ;;
7923 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7926 none) cccdlflags=' ' ;;
7927 *) cccdlflags="$ans" ;;
7932 Some systems use ld to create libraries that can be dynamically loaded,
7933 while other systems (such as those using ELF) use $cc.
7937 '') $cat >try.c <<EOM
7938 /* Test for whether ELF binaries are produced */
7950 int i = open("a.out",O_RDONLY);
7953 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7954 exit(0); /* succeed (yes, it's ELF) */
7959 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7961 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7965 echo "I'll use ld to build dynamic libraries."
7974 rp="What command should be used to create dynamic libraries?"
7980 Some systems may require passing special flags to $ld to create a
7981 library that can be dynamically loaded. If your ld flags include
7982 -L/other/path options to locate libraries outside your loader's normal
7983 search path, you may need to specify those -L options here as well. To
7984 use no flags, say "none".
7987 case "$lddlflags" in
7988 '') case "$osname" in
7989 beos) dflt='-nostart' ;;
7991 case "$gccversion" in
7992 '') dflt="$dflt +vnocompatwarnings" ;;
7995 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7996 next) dflt='none' ;;
7997 solaris) dflt='-G' ;;
7998 sunos) dflt='-assert nodefinitions' ;;
7999 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8003 *) dflt="$lddlflags" ;;
8006 : Try to guess additional flags to pick up local libraries.
8007 : Be careful not to append to a plain 'none'
8011 for thisflag in $ldflags; do
8016 *) dflt="$dflt $thisflag" ;;
8023 ''|' ') dflt='none' ;;
8026 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8029 none) lddlflags=' ' ;;
8030 *) lddlflags="$ans" ;;
8035 Some systems may require passing special flags to $cc to indicate that
8036 the resulting executable will use dynamic linking. To use no flags,
8040 case "$ccdlflags" in
8041 '') case "$osname" in
8042 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8043 next|sunos) dflt='none' ;;
8047 *) dflt="$ccdlflags" ;;
8049 rp="Any special flags to pass to $cc to use dynamic linking?"
8052 none) ccdlflags=' ' ;;
8053 *) ccdlflags="$ans" ;;
8064 : Do we want a shared libperl?
8068 # No dynamic loading being used, so don't bother even to prompt.
8071 *) case "$useshrplib" in
8072 '') case "$osname" in
8073 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8075 also='Building a shared libperl is required for dynamic loading to work on your system.'
8080 also='Building a shared libperl is needed for MAB support.'
8098 The perl executable is normally obtained by linking perlmain.c with
8099 libperl${_a}, any static extensions (usually just DynaLoader), and
8100 any other libraries needed on this system (such as -lm, etc.). Since
8101 your system supports dynamic loading, it is probably possible to build
8102 a shared libperl.$so. If you will have more than one executable linked
8103 to libperl.$so, this will significantly reduce the size of each
8104 executable, but it may have a noticeable effect on performance. The
8105 default is probably sensible for your system.
8109 rp="Build a shared libperl.$so (y/n)"
8113 useshrplib='true' ;;
8114 *) useshrplib='false' ;;
8119 case "$useshrplib" in
8123 # Figure out a good name for libperl.so. Since it gets stored in
8124 # a version-specific architecture-dependent library, the version
8125 # number isn't really that important, except for making cc/ld happy.
8127 # A name such as libperl.so.3.1
8128 majmin="libperl.$so.$patchlevel.$subversion"
8129 # A name such as libperl.so.301
8130 majonly=`echo $patchlevel $subversion |
8131 $awk '{printf "%d%02d", $1, $2}'`
8132 majonly=libperl.$so.$majonly
8133 # I'd prefer to keep the os-specific stuff here to a minimum, and
8134 # rely on figuring it out from the naming of libc.
8135 case "${osname}${osvers}" in
8138 # XXX How handle the --version stuff for MAB?
8140 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8143 cygwin*) # ld links against an importlib
8144 dflt=libperl$lib_ext
8146 *) # Try to guess based on whether libc has major.minor.
8148 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8149 *libc.$so.[0-9]*) dflt=$majonly ;;
8150 *) dflt=libperl.$so ;;
8160 I need to select a good name for the shared libperl. If your system uses
8161 library names with major and minor numbers, then you might want something
8162 like $majmin. Alternatively, if your system uses a single version
8163 number for shared libraries, then you might want to use $majonly.
8164 Or, your system might be quite happy with a simple libperl.$so.
8166 Since the shared libperl will get installed into a version-specific
8167 architecture-dependent directory, the version number of the shared perl
8168 library probably isn't important, so the default should be o.k.
8171 rp='What name do you want to give to the shared libperl?'
8174 echo "Ok, I'll use $libperl"
8177 libperl="libperl${_a}"
8181 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8185 WARNING: Use of the shrpdir variable for the installation location of
8186 the shared $libperl is not supported. It was never documented and
8187 will not work in this version. Let me (perlbug@perl.org)
8188 know of any problems this may cause.
8194 But your current setting of $shrpdir is
8195 the default anyway, so it's harmless.
8200 Further, your current attempted setting of $shrpdir
8201 conflicts with the value of $archlibexp/CORE
8202 that installperl will use.
8209 # How will the perl executable find the installed shared $libperl?
8210 # Add $xxx to ccdlflags.
8211 # If we can't figure out a command-line option, use $shrpenv to
8212 # set env LD_RUN_PATH. The main perl makefile uses this.
8213 shrpdir=$archlibexp/CORE
8216 if "$useshrplib"; then
8219 # We'll set it in Makefile.SH...
8224 freebsd|netbsd|openbsd|interix|dragonfly)
8225 xxx="-Wl,-R$shrpdir"
8227 bsdos|linux|irix*|dec_osf|gnu*)
8228 xxx="-Wl,-rpath,$shrpdir"
8231 # next doesn't like the default...
8234 # beos doesn't like the default, either.
8237 # hpux doesn't like the default, either.
8238 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8241 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8247 # Only add $xxx if it isn't already in ccdlflags.
8248 case " $ccdlflags " in
8250 *) ccdlflags="$ccdlflags $xxx"
8253 Adding $xxx to the flags
8254 passed to $ld so that the perl executable will find the
8255 installed shared $libperl.
8263 # Fix ccdlflags in AIX for building external extensions.
8264 # (For building Perl itself bare -bE:perl.exp is needed,
8265 # Makefile.SH takes care of this.)
8267 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8269 # Respect a hint or command-line value.
8271 '') shrpenv="$tmp_shrpenv" ;;
8273 case "$ldlibpthname" in
8274 '') ldlibpthname=LD_LIBRARY_PATH ;;
8275 none) ldlibpthname='' ;;
8278 : determine where manual pages are on this system
8282 syspath='/usr/share/man/man1 /usr/man/man1'
8283 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8284 syspath="$syspath /usr/man/u_man/man1"
8285 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8286 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8287 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8288 sysman=`./loc . /usr/man/man1 $syspath`
8291 if $test -d "$sysman"; then
8292 echo "System manual is in $sysman." >&4
8294 echo "Could not find manual pages in source form." >&4
8297 : determine where manual pages go
8298 set man1dir man1dir none
8302 $spackage has manual pages available in source form.
8306 echo "However, you don't have nroff, so they're probably useless to you."
8308 '') man1dir="none";;
8311 echo "If you don't want the manual sources installed, answer 'none'."
8316 lookpath="$prefixexp/share/man/man1"
8317 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8318 lookpath="$lookpath $prefixexp/man/p_man/man1"
8319 lookpath="$lookpath $prefixexp/man/u_man/man1"
8320 lookpath="$lookpath $prefixexp/man/man.1"
8322 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8323 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8333 rp="Where do the main $spackage manual pages (source) go?"
8335 if $test "X$man1direxp" != "X$ansexp"; then
8346 : What suffix to use on installed man pages
8353 rp="What suffix should be used for the main $spackage man pages?"
8355 '') case "$man1dir" in
8369 *) dflt="$man1ext";;
8376 : see if we can have long filenames
8378 first=123456789abcdef
8380 if (echo hi >$first) 2>/dev/null; then
8381 if $test -f 123456789abcde; then
8382 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8385 echo 'You can have filenames longer than 14 characters.'>&4
8390 You can't have filenames longer than 14 chars.
8391 You can't even think about them!
8397 $rm -rf 123456789abcde*
8399 : determine where library module manual pages go
8400 set man3dir man3dir none
8404 $spackage has manual pages for many of the library modules.
8410 However, you don't have nroff, so they're probably useless to you.
8413 '') man3dir="none";;
8417 case "$d_flexfnam" in
8420 However, your system can't handle the long file names like File::Basename.3.
8423 '') man3dir="none";;
8427 echo "If you don't want the manual sources installed, answer 'none'."
8428 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8430 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8431 if $test -d "$privlib/man/man3"; then
8434 WARNING: Previous versions of perl installed man3 pages into
8435 $privlib/man/man3. This version will suggest a
8436 new default of $dflt.
8440 rp='Do you wish to preserve the old behavior?(y/n)'
8443 y*) dflt="$privlib/man/man3" ;;
8448 *) dflt="$man3dir" ;;
8455 rp="Where do the $package library man pages (source) go?"
8465 : What suffix to use on installed man pages
8471 rp="What suffix should be used for the $package library man pages?"
8473 '') case "$man3dir" in
8487 *) dflt="$man3ext";;
8494 : see if we have to deal with yellow pages, now NIS.
8495 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8496 if $test -f /usr/etc/nibindd; then
8498 echo "I'm fairly confident you're on a NeXT."
8500 rp='Do you get the hosts file via NetInfo?'
8509 y*) hostcat='nidump hosts .';;
8510 *) case "$hostcat" in
8511 nidump*) hostcat='';;
8521 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8529 rp='Are you getting the hosts file via yellow pages?'
8532 y*) hostcat='ypcat hosts';;
8533 *) hostcat='cat /etc/hosts';;
8539 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8542 '') test -f /etc/group && groupcat='cat /etc/group';;
8545 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8548 : now get the host name
8550 echo "Figuring out host name..." >&4
8551 case "$myhostname" in
8553 echo 'Maybe "hostname" will work...'
8554 if tans=`sh -c hostname 2>&1` ; then
8562 if $test "$cont"; then
8564 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8565 if tans=`cat /etc/systemid 2>&1` ; then
8567 phostname='cat /etc/systemid'
8568 echo "Whadyaknow. Xenix always was a bit strange..."
8571 elif $test -r /etc/systemid; then
8572 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8575 if $test "$cont"; then
8576 echo 'No, maybe "uuname -l" will work...'
8577 if tans=`sh -c 'uuname -l' 2>&1` ; then
8579 phostname='uuname -l'
8581 echo 'Strange. Maybe "uname -n" will work...'
8582 if tans=`sh -c 'uname -n' 2>&1` ; then
8584 phostname='uname -n'
8586 echo 'Oh well, maybe I can mine it out of whoami.h...'
8587 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8588 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8589 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8591 case "$myhostname" in
8592 '') echo "Does this machine have an identity crisis or something?"
8595 echo "Well, you said $myhostname before..."
8596 phostname='echo $myhostname';;
8602 case "$myhostname" in
8603 '') myhostname=noname ;;
8605 : you do not want to know about this
8610 if $test "$myhostname" ; then
8612 rp='Your host name appears to be "'$myhostname'".'" Right?"
8620 : bad guess or no guess
8621 while $test "X$myhostname" = X ; do
8623 rp="Please type the (one word) name of your host:"
8628 : translate upper to lower if necessary
8629 case "$myhostname" in
8631 echo "(Normalizing case in your host name)"
8632 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8636 case "$myhostname" in
8638 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8639 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8640 echo "(Trimming domain name from host name--host name is now $myhostname)"
8642 *) case "$mydomain" in
8645 test "X$hostcat" = "Xypcat hosts" &&
8646 ypmatch "$myhostname" hosts 2>/dev/null |\
8647 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8650 test "X$hostcat" != "X" &&
8651 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8652 /[ ]$myhostname[ . ]/p" > hosts
8655 if $test -f hosts; then
8656 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8657 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8658 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8659 hosts | $sort | $uniq | \
8660 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8661 case `$echo X$dflt` in
8662 X*\ *) echo "(Several hosts in the database matched hostname)"
8665 X.) echo "(You do not have fully-qualified names in the hosts database)"
8669 echo "(I cannot locate a hosts database anywhere)"
8674 tans=`./loc resolv.conf X /etc /usr/etc`
8675 if $test -f "$tans"; then
8676 echo "(Attempting domain name extraction from $tans)"
8677 dflt=.`$sed -n -e 's/ / /g' \
8678 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8679 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8681 .) dflt=.`$sed -n -e 's/ / /g' \
8682 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8683 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8690 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8691 dflt=.`sh -c domainname 2>/dev/null`
8694 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8698 case "$dflt$osname" in
8699 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8700 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8704 .) echo "(Lost all hope -- silly guess then)"
8710 *) dflt="$mydomain";;
8714 rp="What is your domain name?"
8724 : translate upper to lower if necessary
8727 echo "(Normalizing case in your domain name)"
8728 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8732 : a little sanity check here
8733 case "$phostname" in
8736 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8737 $myhostname$mydomain|$myhostname) ;;
8739 case "$phostname" in
8741 echo "(That doesn't agree with your whoami.h file, by the way.)"
8744 echo "(That doesn't agree with your $phostname command, by the way.)"
8752 : determine the e-mail address of the user who is running us
8755 I need to get your e-mail address in Internet format if possible, i.e.
8756 something like user@host.domain. Please answer accurately since I have
8757 no easy means to double check it. The default value provided below
8758 is most probably close to reality but may not be valid from outside
8759 your organization...
8763 while test "$cont"; do
8765 '') dflt="$cf_by@$myhostname$mydomain";;
8766 *) dflt="$cf_email";;
8768 rp='What is your e-mail address?'
8774 rp='Address does not look like an Internet one. Use it anyway?'
8788 : Ask e-mail of administrator
8791 If you or somebody else will be maintaining perl at your site, please
8792 fill in the correct e-mail address here so that they may be contacted
8793 if necessary. Currently, the "perlbug" program included with perl
8794 will send mail to this address in addition to perlbug@perl.org. You may
8795 enter "none" for no administrator.
8798 case "$perladmin" in
8799 '') dflt="$cf_email";;
8800 *) dflt="$perladmin";;
8802 rp='Perl administrator e-mail address'
8806 : determine whether to only install version-specific parts.
8809 Do you want to install only the version-specific parts of the perl
8810 distribution? Usually you do *not* want to do this.
8812 case "$versiononly" in
8813 "$define"|[Yy]*|true) dflt='y' ;;
8816 rp="Do you want to install only the version-specific parts of perl?"
8819 [yY]*) val="$define";;
8825 case "$versiononly" in
8826 "$define") inc_version_list=''
8827 inc_version_list_init=0
8831 : figure out how to guarantee perl startup
8832 : XXX Note that this currently takes advantage of the bug that binexp ignores
8833 : the Configure -Dinstallprefix setting, which in turn means that under
8834 : relocatable @INC, initialinstalllocation is what binexp started as.
8835 case "$startperl" in
8837 case "$sharpbang" in
8841 I can use the #! construct to start perl on your system. This will
8842 make startup of perl scripts faster, but may cause problems if you
8843 want to share those scripts and perl is not in a standard place
8844 ($initialinstalllocation/perl) on all your platforms. The alternative
8845 is to force a shell by starting the script with a single ':' character.
8848 case "$versiononly" in
8849 "$define") dflt="$initialinstalllocation/perl$version";;
8850 *) dflt="$initialinstalllocation/perl";;
8852 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8855 none) startperl=": # use perl";;
8856 *) startperl="#!$ans"
8857 if $test 30 -lt `echo "$ans" | wc -c`; then
8860 WARNING: Some systems limit the #! command to 32 characters.
8861 If you experience difficulty running Perl scripts with #!, try
8862 installing Perl in a directory with a shorter pathname.
8868 *) startperl=": # use perl"
8873 echo "I'll use $startperl to start perl scripts."
8875 : figure best path for perl in scripts
8878 case "$versiononly" in
8879 "$define") perlpath="$initialinstalllocation/perl$version";;
8880 *) perlpath="$initialinstalllocation/perl";;
8882 case "$startperl" in
8887 I will use the "eval 'exec'" idiom to start Perl on your system.
8888 I can use the full path of your Perl binary for this purpose, but
8889 doing so may cause problems if you want to share those scripts and
8890 Perl is not always in a standard place ($initialinstalllocation/perl).
8893 dflt="$initialinstalllocation/perl"
8894 rp="What path shall I use in \"eval 'exec'\"?"
8901 case "$startperl" in
8903 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8906 : determine where public executable scripts go
8907 set scriptdir scriptdir
8909 case "$scriptdir" in
8912 : guess some guesses
8913 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8914 $test -d /usr/share/bin && dflt=/usr/share/bin
8915 $test -d /usr/local/script && dflt=/usr/local/script
8916 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8917 $test -d $prefixexp/script && dflt=$prefixexp/script
8921 *) dflt="$scriptdir"
8926 Some installations have a separate directory just for executable scripts so
8927 that they can mount it across multiple architectures but keep the scripts in
8928 one spot. You might, for example, have a subdirectory of /usr/share for this.
8929 Or you might just lump your scripts in with all your other executables.
8933 rp='Where do you keep publicly executable scripts?'
8935 if $test "X$ansexp" != "X$scriptdirexp"; then
8941 : A little fix up for an irregularly named variable.
8942 installscript="$installscriptdir"
8944 : determine where add-on public executables go
8946 '') dflt=$siteprefix/bin ;;
8950 rp='Pathname where the add-on public executables should be installed?'
8955 : determine where add-on html pages go
8956 : There is no standard location, so try to copy the previously-selected
8957 : directory structure for the core html pages.
8958 case "$sitehtml1dir" in
8959 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8960 *) dflt=$sitehtml1dir ;;
8963 ''|' ') dflt=none ;;
8966 rp='Pathname where the site-specific html pages should be installed?'
8968 prefixvar=sitehtml1dir
8971 : determine where add-on library html pages go
8972 : There is no standard location, so try to copy the previously-selected
8973 : directory structure for the core html pages.
8974 case "$sitehtml3dir" in
8975 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8976 *) dflt=$sitehtml3dir ;;
8979 ''|' ') dflt=none ;;
8982 rp='Pathname where the site-specific library html pages should be installed?'
8984 prefixvar=sitehtml3dir
8987 : determine where add-on manual pages go
8988 case "$siteman1dir" in
8989 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8990 *) dflt=$siteman1dir ;;
8993 ''|' ') dflt=none ;;
8996 rp='Pathname where the site-specific manual pages should be installed?'
8998 prefixvar=siteman1dir
9001 : determine where add-on library man pages go
9002 case "$siteman3dir" in
9003 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9004 *) dflt=$siteman3dir ;;
9007 ''|' ') dflt=none ;;
9010 rp='Pathname where the site-specific library manual pages should be installed?'
9012 prefixvar=siteman3dir
9015 : determine where add-on public executable scripts go
9016 case "$sitescript" in
9017 '') dflt=$siteprefix/script
9018 $test -d $dflt || dflt=$sitebin ;;
9019 *) dflt="$sitescript" ;;
9022 rp='Pathname where add-on public executable scripts should be installed?'
9024 prefixvar=sitescript
9027 : Check if faststdio is requested and available
9028 case "$usefaststdio" in
9029 $define|true|[yY]*|'')
9030 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9040 Perl can be built to use 'fast stdio', which means using the stdio
9041 library but also directly manipulating the stdio buffers to enable
9042 faster I/O. Using stdio is better for backward compatibility (especially
9043 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9044 interface has been preferred instead of stdio.
9046 If this doesn't make any sense to you, just accept the default '$dflt'.
9048 rp='Use the "fast stdio" if available?'
9051 y|Y) val="$define" ;;
9058 : define an is-a-typedef? function
9059 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9061 "") inclist="sys/types.h";;
9063 eval "varval=\$$var";
9067 for inc in $inclist; do
9068 echo "#include <$inc>" >>temp.c;
9070 echo "#ifdef $type" >> temp.c;
9071 echo "printf(\"We have $type\");" >> temp.c;
9072 echo "#endif" >> temp.c;
9073 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9074 if $contains $type temp.E >/dev/null 2>&1; then
9080 *) eval "$var=\$varval";;
9083 : define an is-a-typedef? function that prompts if the type is not available.
9084 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9086 "") inclist="sys/types.h";;
9088 eval "varval=\$$var";
9092 for inc in $inclist; do
9093 echo "#include <$inc>" >>temp.c;
9095 echo "#ifdef $type" >> temp.c;
9096 echo "printf(\"We have $type\");" >> temp.c;
9097 echo "#endif" >> temp.c;
9098 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9100 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9101 if $contains $type temp.E >/dev/null 2>&1; then
9102 echo "$type found." >&4;
9105 echo "$type NOT found." >&4;
9111 *) eval "$var=\$varval";;
9114 : see what type lseek is declared as in the kernel
9115 rp="What is the type used for lseek's offset on this system?"
9116 set off_t lseektype long stdio.h sys/types.h
9120 echo "Checking to see how big your file offsets are..." >&4
9122 #include <sys/types.h>
9126 printf("%d\n", (int)sizeof($lseektype));
9131 if eval $compile_ok; then
9132 lseeksize=`$run ./try`
9133 echo "Your file offsets are $lseeksize bytes long."
9137 echo "(I can't seem to compile the test program. Guessing...)"
9138 rp="What is the size of your file offsets (in bytes)?"
9144 : see what type file positions are declared as in the library
9145 rp="What is the type for file position used by fsetpos()?"
9146 set fpos_t fpostype long stdio.h sys/types.h
9149 : Check size for Fpos_t
9152 *_t) zzz="$fpostype" ;;
9155 echo "Checking the size of $zzz..." >&4
9157 #include <sys/types.h>
9164 printf("%d\n", (int)sizeof($fpostype));
9169 if eval $compile_ok; then
9173 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9176 echo "Your $zzz is $fpossize bytes long."
9182 echo "(I can't compile the test program. Guessing...)" >&4
9183 rp="What is the size of your file positions (in bytes)?"
9188 : Check for large file support
9189 # Backward compatibility (uselfs is deprecated).
9191 "$define"|true|[yY]*)
9194 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9196 uselargefiles="$define"
9200 case "$lseeksize:$fpossize" in
9203 You can have files larger than 2 gigabytes.
9206 *) case "$uselargefiles" in
9207 "$undef"|false|[nN]*) dflt='n' ;;
9212 Perl can be built to understand large files (files larger than 2 gigabytes)
9213 on some systems. To do so, Configure can be run with -Duselargefiles.
9215 If this doesn't make any sense to you, just accept the default '$dflt'.
9217 rp='Try to understand large files, if available?'
9220 y|Y) val="$define" ;;
9227 : Look for a hint-file generated 'call-back-unit'. If the
9228 : user has specified that a large files perl is to be built,
9229 : we may need to set or change some other defaults.
9230 if $test -f uselargefiles.cbu; then
9231 echo "Your platform has some specific hints regarding large file builds, using them..."
9232 . ./uselargefiles.cbu
9234 case "$uselargefiles" in
9236 if $test -f uselargefiles.cbu; then
9238 echo "Rechecking to see how big your file offsets are..." >&4
9240 #include <sys/types.h>
9244 printf("%d\n", (int)sizeof($lseektype));
9249 if eval $compile_ok; then
9250 lseeksize=`$run ./try`
9251 $echo "Your file offsets are now $lseeksize bytes long."
9255 echo "(I can't seem to compile the test program. Guessing...)"
9256 rp="What is the size of your file offsets (in bytes)?"
9261 *_t) zzz="$fpostype" ;;
9264 $echo $n "Rechecking the size of $zzz...$c" >&4
9266 #include <sys/types.h>
9273 printf("%d\n", (int)sizeof($fpostype));
9278 if eval $compile_ok; then
9283 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9286 echo " $fpossize bytes." >&4
9292 echo "(I can't compile the test program. Guessing...)" >&4
9293 rp="What is the size of your file positions (in bytes)?"
9302 : Set the vendorbin variables
9303 case "$vendorprefix" in
9304 '') d_vendorbin="$undef"
9308 *) d_vendorbin="$define"
9309 : determine where vendor-supplied executables go.
9310 case "$vendorbin" in
9311 '') dflt=$vendorprefix/bin ;;
9312 *) dflt="$vendorbin" ;;
9315 rp='Pathname for the vendor-supplied executables directory?'
9318 vendorbinexp="$ansexp"
9324 : Set the vendorhtml1dir variables
9325 case "$vendorprefix" in
9326 '') vendorhtml1dir=''
9327 vendorhtml1direxp=''
9329 *) : determine where vendor-supplied html pages go.
9330 : There is no standard location, so try to copy the previously-selected
9331 : directory structure for the core html pages.
9332 : XXX Better default suggestions would be welcome.
9333 case "$vendorhtml1dir" in
9334 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9335 *) dflt=$vendorhtml1dir ;;
9338 ''|' ') dflt=none ;;
9341 rp='Pathname for the vendor-supplied html pages?'
9343 vendorhtml1dir="$ans"
9344 vendorhtml1direxp="$ansexp"
9347 : Use ' ' for none so value is preserved next time through Configure
9348 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9349 prefixvar=vendorhtml1dir
9352 : Set the vendorhtml3dir variables
9353 case "$vendorprefix" in
9354 '') vendorhtml3dir=''
9355 vendorhtml3direxp=''
9357 *) : determine where vendor-supplied module html pages go.
9358 : There is no standard location, so try to copy the previously-selected
9359 : directory structure for the core html pages.
9360 : XXX Better default suggestions would be welcome.
9361 case "$vendorhtml3dir" in
9362 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9363 *) dflt=$vendorhtml3dir ;;
9366 ''|' ') dflt=none ;;
9369 rp='Pathname for the vendor-supplied html pages?'
9371 vendorhtml3dir="$ans"
9372 vendorhtml3direxp="$ansexp"
9375 : Use ' ' for none so value is preserved next time through Configure
9376 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9377 prefixvar=vendorhtml3dir
9380 : Set the vendorman1dir variables
9381 case "$vendorprefix" in
9382 '') vendorman1dir=''
9385 *) : determine where vendor-supplied manual pages go.
9386 case "$vendorman1dir" in
9387 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9388 *) dflt=$vendorman1dir ;;
9391 ''|' ') dflt=none ;;
9394 rp='Pathname for the vendor-supplied manual section 1 pages?'
9396 vendorman1dir="$ans"
9397 vendorman1direxp="$ansexp"
9400 : Use ' ' for none so value is preserved next time through Configure
9401 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9402 prefixvar=vendorman1dir
9405 : Set the vendorman3dir variables
9406 case "$vendorprefix" in
9407 '') vendorman3dir=''
9410 *) : determine where vendor-supplied module manual pages go.
9411 case "$vendorman3dir" in
9412 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9413 *) dflt=$vendorman3dir ;;
9416 ''|' ') dflt=none ;;
9419 rp='Pathname for the vendor-supplied manual section 3 pages?'
9421 vendorman3dir="$ans"
9422 vendorman3direxp="$ansexp"
9425 : Use ' ' for none so value is preserved next time through Configure
9426 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9427 prefixvar=vendorman3dir
9430 : Set the vendorscript variables
9431 case "$vendorprefix" in
9432 '') d_vendorscript="$undef"
9436 *) d_vendorscript="$define"
9437 : determine where vendor-supplied scripts go.
9438 case "$vendorscript" in
9439 '') dflt=$vendorprefix/script
9440 $test -d $dflt || dflt=$vendorbin ;;
9441 *) dflt="$vendorscript" ;;
9445 The installation process will create a directory for
9446 vendor-supplied scripts.
9450 rp='Pathname for the vendor-supplied scripts directory?'
9453 vendorscriptexp="$ansexp"
9456 prefixvar=vendorscript
9459 : see if qgcvt exists
9463 : Check print/scan long double stuff
9466 if $test X"$d_longdbl" = X"$define"; then
9468 echo "Checking how to print long doubles..." >&4
9470 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9471 $cat >try.c <<'EOCP'
9472 #include <sys/types.h>
9476 printf("%.3f\n", d);
9480 if eval $compile; then
9484 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9485 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9486 echo "We will use %f."
9492 if $test X"$sPRIfldbl" = X; then
9493 $cat >try.c <<'EOCP'
9494 #include <sys/types.h>
9497 long double d = 123.456;
9498 printf("%.3Lf\n", d);
9502 if eval $compile; then
9506 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9507 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9508 echo "We will use %Lf."
9514 if $test X"$sPRIfldbl" = X; then
9515 $cat >try.c <<'EOCP'
9516 #include <sys/types.h>
9519 long double d = 123.456;
9520 printf("%.3llf\n", d);
9524 if eval $compile; then
9528 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9529 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9530 echo "We will use %llf."
9536 if $test X"$sPRIfldbl" = X; then
9537 $cat >try.c <<'EOCP'
9538 #include <sys/types.h>
9541 long double d = 123.456;
9542 printf("%.3lf\n", d);
9546 if eval $compile; then
9550 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9551 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9552 echo "We will use %lf."
9558 if $test X"$sPRIfldbl" = X; then
9559 echo "Cannot figure out how to print long doubles." >&4
9561 sSCNfldbl=$sPRIfldbl # expect consistency
9568 case "$sPRIfldbl" in
9569 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9570 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9571 d_SCNfldbl="$undef";
9573 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9574 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9575 d_SCNfldbl="$define";
9579 : Check how to convert floats to strings.
9581 if test "X$d_Gconvert" = X; then
9584 echo "Checking for an efficient way to convert floats to strings."
9586 case "$uselongdouble" in
9587 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9589 case "$d_longdbl" in
9590 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9592 case "$d_PRIgldbl" in
9593 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9597 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9598 char *myname = "gconvert";
9601 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9602 char *myname = "gcvt";
9605 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9606 char *myname = "qgcvt";
9607 #define DOUBLETYPE long double
9610 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9612 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9614 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9617 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9619 char *myname = "sprintf";
9623 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9624 #define DOUBLETYPE long double
9626 #define DOUBLETYPE double
9632 #define I_STDLIB $i_stdlib
9638 checkit(expect, got)
9642 if (strcmp(expect, got)) {
9643 printf("%s oddity: Expected %s, got %s\n",
9644 myname, expect, got);
9654 /* This must be 1st test on (which?) platform */
9655 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9656 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9657 checkit("0.1", buf);
9659 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9660 checkit("0.01", buf);
9662 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9663 checkit("0.001", buf);
9665 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9666 checkit("0.0001", buf);
9668 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9669 if (strlen(buf) > 5)
9670 checkit("9e-005", buf); /* for Microsoft ?? */
9672 checkit("9e-05", buf);
9674 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9677 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9678 checkit("1.1", buf);
9680 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9681 checkit("1.01", buf);
9683 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9684 checkit("1.001", buf);
9686 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9687 checkit("1.0001", buf);
9689 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9690 checkit("1.00001", buf);
9692 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9693 checkit("1.000001", buf);
9695 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9698 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9701 /* Some Linux gcvt's give 1.e+5 here. */
9702 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9703 checkit("100000", buf);
9705 /* Some Linux gcvt's give -1.e+5 here. */
9706 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9707 checkit("-100000", buf);
9709 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9710 checkit("123.456", buf);
9712 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9713 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9714 /* 34 should be enough to scare even long double
9715 * places into using the e notation. */
9716 if (strlen(buf) > 5)
9717 checkit("1e+034", buf); /* for Microsoft */
9719 checkit("1e+34", buf);
9721 /* For Perl, if you add additional tests here, also add them to
9722 * t/base/num.t for benefit of platforms not using Configure or
9723 * overriding d_Gconvert */
9728 : first add preferred functions to our list
9730 for xxx_convert in $gconvert_preference; do
9731 case $xxx_convert in
9732 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9733 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9736 : then add any others
9737 for xxx_convert in gconvert gcvt sprintf; do
9740 *) xxx_list="$xxx_list $xxx_convert" ;;
9744 case "$d_longdbl$uselongdouble" in
9746 : again, add prefered functions to our list first
9748 for xxx_convert in $gconvert_ld_preference; do
9749 case $xxx_convert in
9750 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9751 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9754 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9755 for xxx_convert in qgcvt sprintf $xxx_list; do
9756 case "$xxx_ld_list" in
9757 $xxx_convert*|*" $xxx_convert"*) ;;
9758 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9761 : if sprintf cannot do long doubles, move it to the end
9762 if test "$d_PRIgldbl" != "$define"; then
9763 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9765 : if no qgcvt, remove it
9766 if test "$d_qgcvt" != "$define"; then
9767 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9770 xxx_list="$xxx_ld_list"
9774 for xxx_convert in $xxx_list; do
9775 echo "Trying $xxx_convert..."
9776 $rm -f try try$_o core
9777 set try -DTRY_$xxx_convert
9778 if eval $compile; then
9779 echo "$xxx_convert() found." >&4
9781 echo "I'll use $xxx_convert to convert floats into a string." >&4
9784 echo "...But $xxx_convert didn't work as I expected."
9788 echo "$xxx_convert NOT found." >&4
9792 if test X$xxx_convert = X; then
9793 echo "*** WHOA THERE!!! ***" >&4
9794 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9798 case "$xxx_convert" in
9799 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9800 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9801 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9802 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9803 "$define$define$define")
9804 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9805 "$define$define$undef")
9806 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9807 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9815 : see if _fwalk exists
9819 : Initialize h_fcntl
9822 : Initialize h_sysfile
9825 : access call always available on UNIX
9829 : locate the flags for 'access()'
9833 $cat >access.c <<EOCP
9834 #include <sys/types.h>
9839 #include <sys/file.h>
9852 : check sys/file.h first, no particular reason here
9853 if $test `./findhdr sys/file.h` && \
9854 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9856 echo "<sys/file.h> defines the *_OK access constants." >&4
9857 elif $test `./findhdr fcntl.h` && \
9858 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9860 echo "<fcntl.h> defines the *_OK access constants." >&4
9861 elif $test `./findhdr unistd.h` && \
9862 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9863 echo "<unistd.h> defines the *_OK access constants." >&4
9865 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9871 : see if accessx exists
9872 set accessx d_accessx
9875 : see if aintl exists
9879 : see if alarm exists
9883 : see if POSIX threads are available
9884 set pthread.h i_pthread
9887 : define a fucntion to check prototypes
9888 $cat > protochk <<EOSH
9891 optimize="$optimize"
9893 prototype="$prototype"
9896 usethreads=$usethreads
9897 i_pthread=$i_pthread
9898 pthread_h_first=$pthread_h_first
9901 $cat >> protochk <<'EOSH'
9906 while test $# -ge 2; do
9908 $define) echo "#include <$2>" >> try.c ;;
9909 literal) echo "$2" >> try.c ;;
9911 # Extra magic for the benefit of systems that need pthread.h
9912 # to be included early to correctly detect threadsafe functions.
9913 # Such functions must guarantee themselves, though, that the usethreads
9914 # and i_pthread have been defined, before calling protochk.
9915 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9916 echo "#include <pthread.h>" >> try.c
9921 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9922 cat >> try.c <<'EOCP'
9923 #ifdef CAN_PROTOTYPE
9924 #define _(args) args
9929 echo "$foo" >> try.c
9930 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9931 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9939 : Define hasproto macro for Configure internal use
9940 hasproto='varname=$1; func=$2; shift; shift;
9941 while $test $# -ge 2; do
9943 $define) echo "#include <$2>";;
9947 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9948 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9949 echo "$func() prototype found.";
9952 echo "$func() prototype NOT found.";
9959 : see if sys/types.h has to be included
9960 set sys/types.h i_systypes
9963 : see if sys/select.h has to be included
9964 set sys/select.h i_sysselct
9967 : Define hasfield macro for Configure internal use
9968 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9969 while $test $# -ge 2; do
9971 $define) echo "#include <$2>";;
9975 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9977 if eval $compile; then
9986 : see if we should include time.h, sys/time.h, or both
9988 if test "X$timeincl" = X; then
9989 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9990 $echo $n "I'm now running the test program...$c"
9992 #include <sys/types.h>
9997 #ifdef SYSTIMEKERNEL
10000 #include <sys/time.h>
10003 #include <sys/select.h>
10005 #$i_stdlib I_STDLIB
10007 #include <stdlib.h>
10013 struct timeval bar;
10016 struct timezone tzp;
10018 if (foo.tm_sec == foo.tm_sec)
10021 if (bar.tv_sec == bar.tv_sec)
10028 for s_timezone in '-DS_TIMEZONE' ''; do
10030 for s_timeval in '-DS_TIMEVAL' ''; do
10031 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10032 for i_time in '' '-DI_TIME'; do
10033 for i_systime in '-DI_SYSTIME' ''; do
10036 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10037 if eval $compile; then
10038 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10042 $echo $n "Succeeded with $flags$c"
10054 *SYSTIMEKERNEL*) i_systimek="$define"
10055 timeincl=`./findhdr sys/time.h`
10056 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10057 *) i_systimek="$undef";;
10060 *I_TIME*) i_time="$define"
10061 timeincl=`./findhdr time.h`" $timeincl"
10062 echo "We'll include <time.h>." >&4;;
10063 *) i_time="$undef";;
10066 *I_SYSTIME*) i_systime="$define"
10067 timeincl=`./findhdr sys/time.h`" $timeincl"
10068 echo "We'll include <sys/time.h>." >&4;;
10069 *) i_systime="$undef";;
10073 : see if struct tm knows about tm_zone
10074 case "$i_systime$i_time" in
10077 echo "Checking to see if your struct tm has tm_zone field..." >&4
10078 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10086 case "$d_tm_tm_zone" in
10087 "$define") echo "Yes, it does." ;;
10088 *) echo "No, it doesn't." ;;
10090 : see if struct tm knows about tm_gmtoff
10091 case "$i_systime$i_time" in
10094 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10095 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10103 case "$d_tm_tm_gmtoff" in
10104 "$define") echo "Yes, it does." ;;
10105 *) echo "No, it doesn't." ;;
10108 : see if asctime_r exists
10109 set asctime_r d_asctime_r
10111 case "$d_asctime_r" in
10113 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10114 case "$d_asctime_r_proto:$usethreads" in
10115 ":define") d_asctime_r_proto=define
10116 set d_asctime_r_proto asctime_r $hdrs
10120 case "$d_asctime_r_proto" in
10122 case "$asctime_r_proto" in
10123 ''|0) try='char* asctime_r(const struct tm*, char*);'
10124 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10126 case "$asctime_r_proto" in
10127 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10128 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10130 case "$asctime_r_proto" in
10131 ''|0) try='int asctime_r(const struct tm*, char*);'
10132 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10134 case "$asctime_r_proto" in
10135 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10136 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10138 case "$asctime_r_proto" in
10139 ''|0) d_asctime_r=undef
10141 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10142 * ) case "$asctime_r_proto" in
10143 REENTRANT_PROTO*) ;;
10144 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10146 echo "Prototype: $try" ;;
10149 *) case "$usethreads" in
10150 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10157 *) asctime_r_proto=0
10161 : see if atolf exists
10165 : see if atoll exists
10169 : Look for GCC-style attribute format
10170 case "$d_attribute_format" in
10173 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10174 $cat >attrib.c <<'EOCP'
10176 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10178 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10179 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10180 echo "Your C compiler doesn't support __attribute__((format))."
10183 echo "Your C compiler supports __attribute__((format))."
10187 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10191 *) val="$d_attribute_format" ;;
10193 set d_attribute_format
10197 : Look for GCC-style attribute format with null format allowed
10198 case "$d_printf_format_null" in
10199 '') case "$d_attribute_format" in
10202 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10203 $cat >attrib.c <<EOCP
10205 #$i_stdlib I_STDLIB
10207 #include <stdlib.h>
10209 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10210 int null_printf (char* pat,...) { return (int)pat; }
10211 int main () { exit(null_printf(NULL)); }
10213 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10214 : run the executable in case it produces a run-time warning
10215 if $run ./attrib >>attrib.out 2>&1; then
10216 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10217 echo "Your C compiler doesn't allow __printf__ format to be null."
10220 echo "Your C compiler allows __printf__ format to be null."
10224 echo "Your C compiler executable failed with __printf__ format null."
10228 echo "Your C compiler fails with __printf__ format null."
10235 *) val="$d_printf_format_null" ;;
10237 set d_printf_format_null
10241 : Look for GCC-style attribute malloc
10242 case "$d_attribute_malloc" in
10245 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10246 $cat >attrib.c <<'EOCP'
10248 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10250 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10251 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10252 echo "Your C compiler doesn't support __attribute__((malloc))."
10255 echo "Your C compiler supports __attribute__((malloc))."
10259 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10263 *) val="$d_attribute_malloc" ;;
10265 set d_attribute_malloc
10269 : Look for GCC-style attribute nonnull
10270 case "$d_attribute_nonnull" in
10273 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10274 $cat >attrib.c <<'EOCP'
10276 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10278 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10279 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10280 echo "Your C compiler doesn't support __attribute__((nonnull))."
10283 echo "Your C compiler supports __attribute__((nonnull))."
10287 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10291 *) val="$d_attribute_nonnull" ;;
10293 set d_attribute_nonnull
10297 : Look for GCC-style attribute noreturn
10298 case "$d_attribute_noreturn" in
10301 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10302 $cat >attrib.c <<'EOCP'
10304 void fall_over_dead( void ) __attribute__((noreturn));
10306 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10307 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10308 echo "Your C compiler doesn't support __attribute__((noreturn))."
10311 echo "Your C compiler supports __attribute__((noreturn))."
10315 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10319 *) val="$d_attribute_noreturn" ;;
10321 set d_attribute_noreturn
10325 : Look for GCC-style attribute pure
10326 case "$d_attribute_pure" in
10329 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10330 $cat >attrib.c <<'EOCP'
10332 int square( int n ) __attribute__((pure));
10334 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10335 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10336 echo "Your C compiler doesn't support __attribute__((pure))."
10339 echo "Your C compiler supports __attribute__((pure))."
10343 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10347 *) val="$d_attribute_pure" ;;
10349 set d_attribute_pure
10353 : Look for GCC-style attribute unused
10354 case "$d_attribute_unused" in
10357 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10358 $cat >attrib.c <<'EOCP'
10360 int do_something( int dummy __attribute__((unused)), int n );
10362 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10363 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10364 echo "Your C compiler doesn't support __attribute__((unused))."
10367 echo "Your C compiler supports __attribute__((unused))."
10371 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10375 *) val="$d_attribute_unused" ;;
10377 set d_attribute_unused
10381 : Look for GCC-style attribute warn_unused_result
10382 case "$d_attribute_warn_unused_result" in
10385 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10386 $cat >attrib.c <<'EOCP'
10388 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10390 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10391 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10392 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10395 echo "Your C compiler supports __attribute__((warn_unused_result))."
10399 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10403 *) val="$d_attribute_warn_unused_result" ;;
10405 set d_attribute_warn_unused_result
10409 : see if bcmp exists
10413 : see if bcopy exists
10417 : see if getpgrp exists
10418 set getpgrp d_getpgrp
10421 case "$d_getpgrp" in
10424 echo "Checking to see which flavor of getpgrp is in use..."
10426 #$i_unistd I_UNISTD
10427 #include <sys/types.h>
10429 # include <unistd.h>
10431 #$i_stdlib I_STDLIB
10433 #include <stdlib.h>
10437 if (getuid() == 0) {
10438 printf("(I see you are running Configure as super-user...)\n");
10441 #ifdef TRY_BSD_PGRP
10442 if (getpgrp(1) == 0)
10451 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10452 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10454 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10455 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10458 echo "I can't seem to compile and run the test program."
10460 xxx="a USG one, i.e. you use getpgrp()."
10462 # SVR4 systems can appear rather BSD-ish.
10463 case "$i_unistd" in
10465 xxx="a BSD one, i.e. you use getpgrp(pid)."
10469 xxx="probably a USG one, i.e. you use getpgrp()."
10474 echo "Assuming your getpgrp is $xxx" >&4
10483 : see if setpgrp exists
10484 set setpgrp d_setpgrp
10487 case "$d_setpgrp" in
10490 echo "Checking to see which flavor of setpgrp is in use..."
10492 #$i_unistd I_UNISTD
10493 #include <sys/types.h>
10495 # include <unistd.h>
10497 #$i_stdlib I_STDLIB
10499 #include <stdlib.h>
10503 if (getuid() == 0) {
10504 printf("(I see you are running Configure as super-user...)\n");
10507 #ifdef TRY_BSD_PGRP
10508 if (-1 == setpgrp(1, 1))
10511 if (setpgrp() != -1)
10517 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10518 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10520 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10521 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10524 echo "(I can't seem to compile and run the test program.)"
10526 xxx="a USG one, i.e. you use setpgrp()."
10528 # SVR4 systems can appear rather BSD-ish.
10529 case "$i_unistd" in
10531 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10535 xxx="probably a USG one, i.e. you use setpgrp()."
10540 echo "Assuming your setpgrp is $xxx" >&4
10549 : Look for GCC-style __builtin_choose_expr
10550 case "$d_builtin_choose_expr" in
10553 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10554 $cat >try.c <<'EOCP'
10555 #include <assert.h>
10556 #include <stdlib.h>
10559 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10562 assert( SYRINX(1) == 2112 );
10563 assert( SYRINX(1) != 5150 );
10564 assert( SYRINX(0) == 5150 );
10565 assert( SYRINX(0) != 2112 );
10566 puts( "All good!" );
10572 if eval $compile && $run ./try; then
10573 echo "Your C compiler supports __builtin_choose_expr."
10576 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10580 *) val="$d_builtin_choose_expr" ;;
10583 set d_builtin_choose_expr
10587 : Look for GCC-style __builtin_expect
10588 case "$d_builtin_expect" in
10591 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10592 $cat >try.c <<'EOCP'
10595 if ( __builtin_expect(n, 0) ) n = 1;
10596 /* Remember shell exit code truth is 0, C truth is non-zero */
10601 if eval $compile && $run ./try; then
10602 echo "Your C compiler supports __builtin_expect."
10605 echo "Your C compiler doesn't seem to understand __builtin_expect."
10609 *) val="$d_builtin_expect" ;;
10612 set d_builtin_expect
10616 : see if bzero exists
10620 : see if stdarg is available
10622 if $test `./findhdr stdarg.h`; then
10623 echo "<stdarg.h> found." >&4
10626 echo "<stdarg.h> NOT found." >&4
10630 : see if varags is available
10632 if $test `./findhdr varargs.h`; then
10633 echo "<varargs.h> found." >&4
10635 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10638 : set up the varargs testing programs
10639 $cat > varargs.c <<EOP
10641 #include <stdarg.h>
10644 #include <varargs.h>
10648 int f(char *p, ...)
10662 p = va_arg(ap, char *);
10668 $cat > varargs <<EOP
10670 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10679 : now check which varargs header should be included
10684 if `./varargs I_STDARG`; then
10686 elif `./varargs I_VARARGS`; then
10691 if `./varargs I_VARARGS`; then
10698 echo "I could not find the definition for va_dcl... You have problems..." >&4
10699 val="$undef"; set i_stdarg; eval $setvar
10700 val="$undef"; set i_varargs; eval $setvar
10705 case "$i_varhdr" in
10707 val="$define"; set i_stdarg; eval $setvar
10708 val="$undef"; set i_varargs; eval $setvar
10711 val="$undef"; set i_stdarg; eval $setvar
10712 val="$define"; set i_varargs; eval $setvar
10715 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10719 : see if the Compiler supports C99 variadic macros
10720 case "$i_stdarg$i_stdlib" in
10722 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10725 #include <stdarg.h>
10727 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10731 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10737 if eval $compile && $run ./try 2>&1 >/dev/null; then
10738 case "`$run ./try`" in
10740 echo "You have C99 variadic macros." >&4
10741 d_c99_variadic_macros="$define"
10744 echo "You don't have functional C99 variadic macros." >&4
10745 d_c99_variadic_macros="$undef"
10749 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10750 d_c99_variadic_macros="$undef"
10755 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10756 d_c99_variadic_macros="$undef"
10760 : see if signal is declared as pointer to function returning int or void
10762 xxx=`./findhdr signal.h`
10763 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10764 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10765 echo "You have int (*signal())() instead of void." >&4
10767 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10768 echo "You have void (*signal())()." >&4
10770 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10771 echo "You have int (*signal())() instead of void." >&4
10773 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10774 echo "You have void (*signal())()." >&4
10777 case "$d_voidsig" in
10779 echo "I can't determine whether signal handler returns void or int..." >&4
10781 rp="What type does your signal handler return?"
10784 v*) val="$define";;
10788 echo "As you already told me, signal handler returns void." >&4
10791 *) echo "As you already told me, signal handler returns int." >&4
10798 case "$d_voidsig" in
10799 "$define") signal_t="void";;
10800 *) signal_t="int";;
10804 : check for ability to cast large floats to 32-bit ints.
10806 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10807 if $test "$intsize" -ge 4; then
10814 #$i_stdlib I_STDLIB
10816 #include <stdlib.h>
10818 #include <sys/types.h>
10819 #include <signal.h>
10820 $signal_t blech(int s) { exit(3); }
10827 signal(SIGFPE, blech);
10829 /* Don't let compiler optimize the test away. Store the number
10830 in a writable string for gcc to pass to sscanf under HP/UX.
10832 sprintf(str, "2147483647");
10833 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10837 /* x86 processors will probably give 0x8000 0000, which is a
10838 sign change. We don't want that. We want to mimic SPARC
10839 behavior here, which is to preserve the sign and give
10842 if (i32 != ($xxx) f)
10848 if eval $compile_ok; then
10852 echo "(I can't seem to compile the test program--assuming it can't)"
10857 echo "Yup, it can."
10860 echo "Nope, it can't."
10867 : check for ability to cast negative floats to unsigned
10869 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10872 #$i_stdlib I_STDLIB
10874 #include <stdlib.h>
10876 #include <sys/types.h>
10877 #include <signal.h>
10878 $signal_t blech(int s) { exit(7); }
10879 $signal_t blech_in_list(int s) { exit(4); }
10880 unsigned long dummy_long(unsigned long p) { return p; }
10881 unsigned int dummy_int(unsigned int p) { return p; }
10882 unsigned short dummy_short(unsigned short p) { return p; }
10886 unsigned long along;
10888 unsigned short ashort;
10892 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10893 a direct f = -123. assignment. gcc-2.8.0 reportedly
10894 optimized the whole file away
10896 /* Store the number in a writable string for gcc to pass to
10897 sscanf under HP/UX.
10899 sprintf(str, "-123");
10900 sscanf(str, "%lf", &f); /* f = -123.; */
10902 signal(SIGFPE, blech);
10903 along = (unsigned long)f;
10904 aint = (unsigned int)f;
10905 ashort = (unsigned short)f;
10906 if (along != (unsigned long)-123)
10908 if (aint != (unsigned int)-123)
10910 if (ashort != (unsigned short)-123)
10912 sprintf(str, "1073741824.");
10913 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10916 along = (unsigned long)f;
10917 if (along != 0x80000000)
10921 along = (unsigned long)f;
10922 if (along != 0x7fffffff)
10926 along = (unsigned long)f;
10927 if (along != 0x80000001)
10931 signal(SIGFPE, blech_in_list);
10932 sprintf(str, "123.");
10933 sscanf(str, "%lf", &f); /* f = 123.; */
10934 along = dummy_long((unsigned long)f);
10935 aint = dummy_int((unsigned int)f);
10936 ashort = dummy_short((unsigned short)f);
10937 if (along != (unsigned long)123)
10939 if (aint != (unsigned int)123)
10941 if (ashort != (unsigned short)123)
10948 if eval $compile_ok; then
10952 echo "(I can't seem to compile the test program--assuming it can't)"
10955 case "$castflags" in
10957 echo "Yup, it can."
10960 echo "Nope, it can't."
10967 : see if vprintf exists
10969 if set vprintf val -f d_vprintf; eval $csym; $val; then
10970 echo 'vprintf() found.' >&4
10973 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10974 #$i_varargs I_VARARGS
10976 #$i_stdlib I_STDLIB
10977 #$i_unistd I_UNISTD
10980 # include <stdarg.h>
10981 #else /* I_VARARGS */
10982 # include <varargs.h>
10986 # include <unistd.h>
10990 # include <stdlib.h>
10993 #include <stdio.h> /* vsprintf prototype */
10996 void xxx(int n, ...)
11001 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11003 int main() { xxx(1, "foo"); }
11005 #else /* I_VARARGS */
11013 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11015 int main() { xxx("foo"); }
11021 if eval $compile_ok; then
11022 if $run ./try; then
11023 echo "Your vsprintf() returns (int)." >&4
11026 echo "Your vsprintf() returns (char*)." >&4
11030 echo 'I am unable to compile the vsprintf() test program.' >&4
11031 # We shouldn't get here. If we do, assume the standard signature,
11032 # not the old BSD one.
11033 echo 'Guessing that vsprintf() returns (int).' >&4
11037 echo 'vprintf() NOT found.' >&4
11048 : see if chown exists
11052 : see if chroot exists
11053 set chroot d_chroot
11056 : see if chsize exists
11057 set chsize d_chsize
11060 : see if class exists
11064 : see if clearenv exists
11065 set clearenv d_clearenv
11068 : Define hasstruct macro for Configure internal use
11069 hasstruct='varname=$1; struct=$2; shift; shift;
11070 while $test $# -ge 2; do
11072 $define) echo "#include <$2>";;
11076 echo "int main () { struct $struct foo; }" >> try.c;
11078 if eval $compile; then
11087 : see whether socket exists
11091 $echo $n "Hmm... $c" >&4
11092 if set socket val -f d_socket; eval $csym; $val; then
11093 echo "Looks like you have Berkeley networking support." >&4
11095 if set setsockopt val -f; eval $csym; $val; then
11098 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11099 d_oldsock="$define"
11102 if $contains socklib libc.list >/dev/null 2>&1; then
11103 echo "Looks like you have Berkeley networking support." >&4
11105 : we will have to assume that it supports the 4.2 BSD interface
11108 echo "You don't have Berkeley networking in libc$_a..." >&4
11109 if test "X$d_socket" = "X$define"; then
11110 echo "...but you seem to believe that you have sockets." >&4
11112 for net in net socket
11114 if test -f /usr/lib/lib$net$_a; then
11115 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11116 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11117 if $contains socket libc.list >/dev/null 2>&1; then
11122 echo "...but the Wollongong group seems to have hacked it in." >&4
11123 sockethdr="-I/usr/netinclude"
11126 echo "Found Berkeley sockets interface in lib$net." >&4
11127 if $contains setsockopt libc.list >/dev/null 2>&1; then
11130 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11131 d_oldsock="$define"
11137 if test "X$d_socket" != "X$define"; then
11138 echo "or anywhere else I see." >&4
11146 : see if socketpair exists
11147 set socketpair d_sockpair
11152 echo "Checking the availability of certain socket constants..." >&4
11153 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11154 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11156 #include <sys/types.h>
11157 #include <sys/socket.h>
11163 set try; if eval $compile; then
11166 set d_${enum}; eval $setvar
11170 : see if this is a sys/uio.h system
11171 set sys/uio.h i_sysuio
11174 : Check for cmsghdr support
11176 echo "Checking to see if your system supports struct cmsghdr..." >&4
11177 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11179 case "$d_cmsghdr_s" in
11180 "$define") echo "Yes, it does." ;;
11181 *) echo "No, it doesn't." ;;
11185 : check for const keyword
11187 echo 'Checking to see if your C compiler knows about "const"...' >&4
11188 $cat >const.c <<'EOCP'
11189 typedef struct spug { int drokk; } spug;
11193 const spug y = { 0 };
11196 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11198 echo "Yup, it does."
11201 echo "Nope, it doesn't."
11206 : see if copysignl exists
11207 set copysignl d_copysignl
11210 : see if crypt exists
11215 $define) cryptlib='' ;;
11216 *) if set crypt val -f d_crypt; eval $csym; $val; then
11217 echo 'crypt() found.' >&4
11221 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11222 if $test -z "$cryptlib"; then
11223 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11227 if $test -z "$cryptlib"; then
11228 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11232 if $test -z "$cryptlib"; then
11233 cryptlib=`./loc libcrypt$_a "" $libpth`
11237 if $test -z "$cryptlib"; then
11238 echo 'crypt() NOT found.' >&4
11249 : see if this is a crypt.h system
11250 set crypt.h i_crypt
11253 : see if crypt_r exists
11254 set crypt_r d_crypt_r
11256 case "$d_crypt_r" in
11258 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11259 case "$d_crypt_r_proto:$usethreads" in
11260 ":define") d_crypt_r_proto=define
11261 set d_crypt_r_proto crypt_r $hdrs
11265 case "$d_crypt_r_proto" in
11267 case "$crypt_r_proto" in
11268 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11269 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11271 case "$crypt_r_proto" in
11272 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11273 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11275 case "$crypt_r_proto" in
11276 ''|0) d_crypt_r=undef
11278 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11279 * ) case "$crypt_r_proto" in
11280 REENTRANT_PROTO*) ;;
11281 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11283 echo "Prototype: $try" ;;
11286 *) case "$usethreads" in
11287 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11298 : get csh whereabouts
11300 'csh') val="$undef" ;;
11301 *) val="$define" ;;
11305 : Respect a hint or command line value for full_csh.
11306 case "$full_csh" in
11307 '') full_csh=$csh ;;
11310 : see if ctermid exists
11311 set ctermid d_ctermid
11314 : see if ctermid_r exists
11315 set ctermid_r d_ctermid_r
11317 case "$d_ctermid_r" in
11319 hdrs="$i_systypes sys/types.h define stdio.h "
11320 case "$d_ctermid_r_proto:$usethreads" in
11321 ":define") d_ctermid_r_proto=define
11322 set d_ctermid_r_proto ctermid_r $hdrs
11326 case "$d_ctermid_r_proto" in
11328 case "$ctermid_r_proto" in
11329 ''|0) try='char* ctermid_r(char*);'
11330 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11332 case "$ctermid_r_proto" in
11333 ''|0) d_ctermid_r=undef
11335 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11336 * ) case "$ctermid_r_proto" in
11337 REENTRANT_PROTO*) ;;
11338 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11340 echo "Prototype: $try" ;;
11343 *) case "$usethreads" in
11344 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11351 *) ctermid_r_proto=0
11355 : see if ctime_r exists
11356 set ctime_r d_ctime_r
11358 case "$d_ctime_r" in
11360 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11361 case "$d_ctime_r_proto:$usethreads" in
11362 ":define") d_ctime_r_proto=define
11363 set d_ctime_r_proto ctime_r $hdrs
11367 case "$d_ctime_r_proto" in
11369 case "$ctime_r_proto" in
11370 ''|0) try='char* ctime_r(const time_t*, char*);'
11371 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11373 case "$ctime_r_proto" in
11374 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11375 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11377 case "$ctime_r_proto" in
11378 ''|0) try='int ctime_r(const time_t*, char*);'
11379 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11381 case "$ctime_r_proto" in
11382 ''|0) try='int ctime_r(const time_t*, char*, int);'
11383 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11385 case "$ctime_r_proto" in
11386 ''|0) d_ctime_r=undef
11388 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11389 * ) case "$ctime_r_proto" in
11390 REENTRANT_PROTO*) ;;
11391 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11393 echo "Prototype: $try" ;;
11396 *) case "$usethreads" in
11397 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11408 : see if cuserid exists
11409 set cuserid d_cuserid
11412 : see if this is a limits.h system
11413 set limits.h i_limits
11416 : see if this is a float.h system
11417 set float.h i_float
11420 : See if number of significant digits in a double precision number is known
11422 $cat >dbl_dig.c <<EOM
11423 #$i_limits I_LIMITS
11426 #include <limits.h>
11432 printf("Contains DBL_DIG");
11435 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11436 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11437 echo "DBL_DIG found." >&4
11440 echo "DBL_DIG NOT found." >&4
11447 : see if dbm.h is available
11448 : see if dbmclose exists
11449 set dbmclose d_dbmclose
11452 case "$d_dbmclose" in
11462 *) set rpcsvc/dbm.h i_rpcsvcdbm
11467 *) echo "We won't be including <dbm.h>"
11477 : see if prototype for dbminit is available
11479 set d_dbminitproto dbminit $i_dbm dbm.h
11482 : see if difftime exists
11483 set difftime d_difftime
11486 : see if this is a dirent system
11488 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11490 echo "<dirent.h> found." >&4
11493 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11494 echo "<sys/dir.h> found." >&4
11497 xinc=`./findhdr sys/ndir.h`
11499 echo "<dirent.h> NOT found." >&4
11504 : Look for type of directory structure.
11506 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11508 case "$direntrytype" in
11510 case "$i_dirent" in
11511 $define) guess1='struct dirent' ;;
11512 *) guess1='struct direct' ;;
11515 *) guess1="$direntrytype"
11520 'struct dirent') guess2='struct direct' ;;
11521 *) guess2='struct dirent' ;;
11524 if $contains "$guess1" try.c >/dev/null 2>&1; then
11525 direntrytype="$guess1"
11526 echo "Your directory entries are $direntrytype." >&4
11527 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11528 direntrytype="$guess2"
11529 echo "Your directory entries seem to be $direntrytype." >&4
11531 echo "I don't recognize your system's directory entries." >&4
11532 rp="What type is used for directory entries on this system?"
11535 direntrytype="$ans"
11539 : see if the directory entry stores field length
11541 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11542 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11543 echo "Good, your directory entry keeps length information in d_namlen." >&4
11546 echo "Your directory entry does not know about the d_namlen field." >&4
11553 : Look for DIR.dd_fd
11554 case "$i_dirent" in
11556 echo "Checking to see if DIR has a dd_fd member variable" >&4
11558 #$i_stdlib I_STDLIB
11560 #include <stdlib.h>
11562 #include <dirent.h>
11572 if eval $compile; then
11573 echo "Yes, it does."
11576 echo "No, it does not."
11581 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11589 : see if this is an sysdir system
11590 set sys/dir.h i_sysdir
11593 : see if this is an sysndir system
11594 set sys/ndir.h i_sysndir
11599 $cat >dirfd.c <<EOM
11601 #$i_stdlib I_STDLIB
11603 #include <stdlib.h>
11605 #$i_dirent I_DIRENT /**/
11606 #$i_sysdir I_SYS_DIR /**/
11607 #$i_sysndir I_SYS_NDIR /**/
11608 #$i_systypes I_SYS_TYPES /**/
11609 #if defined(I_SYS_TYPES)
11610 #include <sys/types.h>
11612 #if defined(I_DIRENT)
11613 #include <dirent.h>
11614 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11615 #include <sys/dir.h>
11619 #include <sys/ndir.h>
11623 #include <ndir.h> /* may be wrong in the future */
11625 #include <sys/dir.h>
11631 DIR *dirp = opendir(".");
11632 if (dirfd(dirp) >= 0)
11640 if eval $compile; then
11644 $define) echo "dirfd() found." >&4 ;;
11645 *) echo "dirfd() NOT found." >&4 ;;
11651 : see if dlerror exists
11654 set dlerror d_dlerror
11658 : see if dlfcn is available
11659 set dlfcn.h i_dlfcn
11662 : Check what extension to use for shared libs
11667 On a few systems, the dynamically loaded modules that perl generates and uses
11668 will need a different extension than shared libs. The default will probably
11674 *) dflt="$dlext" ;;
11676 rp='What is the extension of dynamically loaded modules'
11685 : Check if dlsym need a leading underscore
11691 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11692 $cat >dyna.c <<'EOM'
11699 #$i_stdlib I_STDLIB
11701 #include <stdlib.h>
11705 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11707 #include <sys/types.h>
11712 extern int fred() ;
11721 int mode = RTLD_LAZY ;
11723 handle = dlopen("./dyna.$dlext", mode) ;
11724 if (handle == NULL) {
11729 symbol = dlsym(handle, "fred") ;
11730 if (symbol == NULL) {
11731 /* try putting a leading underscore */
11732 symbol = dlsym(handle, "_fred") ;
11733 if (symbol == NULL) {
11746 : Call the object file tmp-dyna.o in case dlext=o.
11747 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11748 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11749 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11750 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11753 1) echo "Test program failed using dlopen." >&4
11754 echo "Perhaps you should not use dynamic loading." >&4;;
11755 2) echo "Test program failed using dlsym." >&4
11756 echo "Perhaps you should not use dynamic loading." >&4;;
11757 3) echo "dlsym needs a leading underscore" >&4
11759 4) echo "dlsym doesn't need a leading underscore." >&4;;
11762 echo "I can't compile and run the test program." >&4
11763 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11768 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11773 : see if drand48_r exists
11774 set drand48_r d_drand48_r
11776 case "$d_drand48_r" in
11778 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11779 case "$d_drand48_r_proto:$usethreads" in
11780 ":define") d_drand48_r_proto=define
11781 set d_drand48_r_proto drand48_r $hdrs
11785 case "$d_drand48_r_proto" in
11787 case "$drand48_r_proto" in
11788 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11789 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11791 case "$drand48_r_proto" in
11792 ''|0) d_drand48_r=undef
11794 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11795 * ) case "$drand48_r_proto" in
11796 REENTRANT_PROTO*) ;;
11797 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11799 echo "Prototype: $try" ;;
11802 *) case "$usethreads" in
11803 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11810 *) drand48_r_proto=0
11814 : see if prototype for drand48 is available
11816 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11819 : see if dup2 exists
11823 : see if eaccess exists
11824 set eaccess d_eaccess
11827 : see if endgrent exists
11828 set endgrent d_endgrent
11831 : see if this is an grp system
11837 xxx=`./findhdr grp.h`
11838 $cppstdin $cppflags $cppminus < $xxx >$$.h
11840 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11852 set d_grpasswd; eval $setvar
11856 : see if endgrent_r exists
11857 set endgrent_r d_endgrent_r
11859 case "$d_endgrent_r" in
11861 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11862 case "$d_endgrent_r_proto:$usethreads" in
11863 ":define") d_endgrent_r_proto=define
11864 set d_endgrent_r_proto endgrent_r $hdrs
11868 case "$d_endgrent_r_proto" in
11870 case "$endgrent_r_proto" in
11871 ''|0) try='int endgrent_r(FILE**);'
11872 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11874 case "$endgrent_r_proto" in
11875 ''|0) try='void endgrent_r(FILE**);'
11876 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11878 case "$endgrent_r_proto" in
11879 ''|0) d_endgrent_r=undef
11881 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11882 * ) case "$endgrent_r_proto" in
11883 REENTRANT_PROTO*) ;;
11884 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11886 echo "Prototype: $try" ;;
11889 *) case "$usethreads" in
11890 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11897 *) endgrent_r_proto=0
11901 : see if endhostent exists
11902 set endhostent d_endhent
11905 : see if this is a netdb.h system
11906 set netdb.h i_netdb
11909 : see if endhostent_r exists
11910 set endhostent_r d_endhostent_r
11912 case "$d_endhostent_r" in
11914 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11915 case "$d_endhostent_r_proto:$usethreads" in
11916 ":define") d_endhostent_r_proto=define
11917 set d_endhostent_r_proto endhostent_r $hdrs
11921 case "$d_endhostent_r_proto" in
11923 case "$endhostent_r_proto" in
11924 ''|0) try='int endhostent_r(struct hostent_data*);'
11925 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11927 case "$endhostent_r_proto" in
11928 ''|0) try='void endhostent_r(struct hostent_data*);'
11929 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11931 case "$endhostent_r_proto" in
11932 ''|0) d_endhostent_r=undef
11933 endhostent_r_proto=0
11934 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11935 * ) case "$endhostent_r_proto" in
11936 REENTRANT_PROTO*) ;;
11937 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11939 echo "Prototype: $try" ;;
11942 *) case "$usethreads" in
11943 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11945 d_endhostent_r=undef
11946 endhostent_r_proto=0
11950 *) endhostent_r_proto=0
11954 : see if endnetent exists
11955 set endnetent d_endnent
11958 : see if endnetent_r exists
11959 set endnetent_r d_endnetent_r
11961 case "$d_endnetent_r" in
11963 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11964 case "$d_endnetent_r_proto:$usethreads" in
11965 ":define") d_endnetent_r_proto=define
11966 set d_endnetent_r_proto endnetent_r $hdrs
11970 case "$d_endnetent_r_proto" in
11972 case "$endnetent_r_proto" in
11973 ''|0) try='int endnetent_r(struct netent_data*);'
11974 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11976 case "$endnetent_r_proto" in
11977 ''|0) try='void endnetent_r(struct netent_data*);'
11978 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11980 case "$endnetent_r_proto" in
11981 ''|0) d_endnetent_r=undef
11982 endnetent_r_proto=0
11983 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11984 * ) case "$endnetent_r_proto" in
11985 REENTRANT_PROTO*) ;;
11986 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11988 echo "Prototype: $try" ;;
11991 *) case "$usethreads" in
11992 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11994 d_endnetent_r=undef
11995 endnetent_r_proto=0
11999 *) endnetent_r_proto=0
12003 : see if endprotoent exists
12004 set endprotoent d_endpent
12007 : see if endprotoent_r exists
12008 set endprotoent_r d_endprotoent_r
12010 case "$d_endprotoent_r" in
12012 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12013 case "$d_endprotoent_r_proto:$usethreads" in
12014 ":define") d_endprotoent_r_proto=define
12015 set d_endprotoent_r_proto endprotoent_r $hdrs
12019 case "$d_endprotoent_r_proto" in
12021 case "$endprotoent_r_proto" in
12022 ''|0) try='int endprotoent_r(struct protoent_data*);'
12023 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12025 case "$endprotoent_r_proto" in
12026 ''|0) try='void endprotoent_r(struct protoent_data*);'
12027 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12029 case "$endprotoent_r_proto" in
12030 ''|0) d_endprotoent_r=undef
12031 endprotoent_r_proto=0
12032 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12033 * ) case "$endprotoent_r_proto" in
12034 REENTRANT_PROTO*) ;;
12035 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12037 echo "Prototype: $try" ;;
12040 *) case "$usethreads" in
12041 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12043 d_endprotoent_r=undef
12044 endprotoent_r_proto=0
12048 *) endprotoent_r_proto=0
12052 : see if endpwent exists
12053 set endpwent d_endpwent
12056 : see if this is a pwd.h system
12062 xxx=`./findhdr pwd.h`
12063 $cppstdin $cppflags $cppminus < $xxx >$$.h
12065 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12073 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12081 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12089 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12097 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12105 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12113 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12121 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12133 set d_pwquota; eval $setvar
12134 set d_pwage; eval $setvar
12135 set d_pwchange; eval $setvar
12136 set d_pwclass; eval $setvar
12137 set d_pwexpire; eval $setvar
12138 set d_pwcomment; eval $setvar
12139 set d_pwgecos; eval $setvar
12140 set d_pwpasswd; eval $setvar
12144 : see if endpwent_r exists
12145 set endpwent_r d_endpwent_r
12147 case "$d_endpwent_r" in
12149 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12150 case "$d_endpwent_r_proto:$usethreads" in
12151 ":define") d_endpwent_r_proto=define
12152 set d_endpwent_r_proto endpwent_r $hdrs
12156 case "$d_endpwent_r_proto" in
12158 case "$endpwent_r_proto" in
12159 ''|0) try='int endpwent_r(FILE**);'
12160 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12162 case "$endpwent_r_proto" in
12163 ''|0) try='void endpwent_r(FILE**);'
12164 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12166 case "$endpwent_r_proto" in
12167 ''|0) d_endpwent_r=undef
12169 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12170 * ) case "$endpwent_r_proto" in
12171 REENTRANT_PROTO*) ;;
12172 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12174 echo "Prototype: $try" ;;
12177 *) case "$usethreads" in
12178 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12185 *) endpwent_r_proto=0
12189 : see if endservent exists
12190 set endservent d_endsent
12193 : see if endservent_r exists
12194 set endservent_r d_endservent_r
12196 case "$d_endservent_r" in
12198 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12199 case "$d_endservent_r_proto:$usethreads" in
12200 ":define") d_endservent_r_proto=define
12201 set d_endservent_r_proto endservent_r $hdrs
12205 case "$d_endservent_r_proto" in
12207 case "$endservent_r_proto" in
12208 ''|0) try='int endservent_r(struct servent_data*);'
12209 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12211 case "$endservent_r_proto" in
12212 ''|0) try='void endservent_r(struct servent_data*);'
12213 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12215 case "$endservent_r_proto" in
12216 ''|0) d_endservent_r=undef
12217 endservent_r_proto=0
12218 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12219 * ) case "$endservent_r_proto" in
12220 REENTRANT_PROTO*) ;;
12221 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12223 echo "Prototype: $try" ;;
12226 *) case "$usethreads" in
12227 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12229 d_endservent_r=undef
12230 endservent_r_proto=0
12234 *) endservent_r_proto=0
12238 : Locate the flags for 'open()'
12241 #include <sys/types.h>
12246 #include <sys/file.h>
12248 #$i_stdlib I_STDLIB
12250 #include <stdlib.h>
12261 : check sys/file.h first to get FREAD on Sun
12262 if $test `./findhdr sys/file.h` && \
12263 set try -DI_SYS_FILE && eval $compile; then
12265 echo "<sys/file.h> defines the O_* constants..." >&4
12266 if $run ./try; then
12267 echo "and you have the 3 argument form of open()." >&4
12270 echo "but not the 3 argument form of open(). Oh, well." >&4
12273 elif $test `./findhdr fcntl.h` && \
12274 set try -DI_FCNTL && eval $compile; then
12276 echo "<fcntl.h> defines the O_* constants..." >&4
12277 if $run ./try; then
12278 echo "and you have the 3 argument form of open()." >&4
12281 echo "but not the 3 argument form of open(). Oh, well." >&4
12286 echo "I can't find the O_* constant definitions! You got problems." >&4
12292 : script used to emit important warnings
12295 if test \$# -gt 0; then
12300 echo "*** WARNING:" >&4
12301 sed -e 's/^/*** /' <msg >&4
12303 cat msg >>config.msg
12304 echo " " >>config.msg
12310 : see which of string.h or strings.h is needed
12312 strings=`./findhdr string.h`
12313 if $test "$strings" && $test -r "$strings"; then
12314 echo "Using <string.h> instead of <strings.h>." >&4
12318 strings=`./findhdr strings.h`
12319 if $test "$strings" && $test -r "$strings"; then
12320 echo "Using <strings.h> instead of <string.h>." >&4
12322 ./warn "No string header found -- You'll surely have problems."
12327 case "$i_string" in
12328 "$undef") strings=`./findhdr strings.h`;;
12329 *) strings=`./findhdr string.h`;;
12332 : see if this is a sys/file.h system
12337 : do we need to include sys/file.h ?
12341 if $h_sysfile; then
12343 echo "We'll be including <sys/file.h>." >&4
12346 echo "We won't be including <sys/file.h>." >&4
12356 : see if fcntl.h is there
12361 : see if we can include fcntl.h
12367 echo "We'll be including <fcntl.h>." >&4
12370 if $h_sysfile; then
12371 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12373 echo "We won't be including <fcntl.h>." >&4
12385 : see if fork exists
12389 : see if pipe exists
12393 : check for non-blocking I/O stuff
12394 case "$h_sysfile" in
12395 true) echo "#include <sys/file.h>" > head.c;;
12398 true) echo "#include <fcntl.h>" > head.c;;
12399 *) echo "#include <sys/fcntl.h>" > head.c;;
12404 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12405 case "$o_nonblock" in
12407 $cat head.c > try.c
12408 $cat >>try.c <<EOCP
12410 #$i_stdlib I_STDLIB
12412 #include <stdlib.h>
12420 printf("O_NONBLOCK\n");
12424 printf("O_NDELAY\n");
12428 printf("FNDELAY\n");
12435 if eval $compile_ok; then
12436 o_nonblock=`$run ./try`
12437 case "$o_nonblock" in
12438 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12439 *) echo "Seems like we can use $o_nonblock.";;
12442 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12445 *) echo "Using $hint value $o_nonblock.";;
12450 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12453 case "$d_fork:$d_pipe" in
12455 $cat head.c > try.c
12456 $cat >>try.c <<EOCP
12458 #include <sys/types.h>
12459 #include <signal.h>
12461 #$i_stdlib I_STDLIB
12463 #include <stdlib.h>
12469 #define MY_O_NONBLOCK $o_nonblock
12470 #ifndef errno /* XXX need better Configure test */
12473 #$i_unistd I_UNISTD
12475 #include <unistd.h>
12477 #$i_string I_STRING
12479 #include <string.h>
12481 #include <strings.h>
12483 $signal_t blech(int x) { exit(3); }
12485 $cat >> try.c <<'EOCP'
12493 pipe(pd); /* Down: child -> parent */
12494 pipe(pu); /* Up: parent -> child */
12497 close(pd[1]); /* Parent reads from pd[0] */
12498 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12500 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12505 signal(SIGALRM, blech);
12507 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12509 sprintf(string, "%d\n", ret);
12510 write(2, string, strlen(string));
12513 if (errno == EAGAIN) {
12514 printf("EAGAIN\n");
12519 if (errno == EWOULDBLOCK)
12520 printf("EWOULDBLOCK\n");
12523 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12524 sleep(2); /* Give it time to close our pipe */
12526 ret = read(pd[0], buf, 1); /* Should read EOF */
12528 sprintf(string, "%d\n", ret);
12529 write(4, string, strlen(string));
12533 close(pd[0]); /* We write to pd[1] */
12534 close(pu[1]); /* We read from pu[0] */
12535 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12536 close(pd[1]); /* Pipe pd is now fully closed! */
12537 exit(0); /* Bye bye, thank you for playing! */
12541 if eval $compile_ok; then
12542 echo "$startsh" >mtry
12543 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12545 ./mtry >/dev/null 2>&1
12547 0) eagain=`$cat try.out`;;
12548 1) echo "Could not perform non-blocking setting!";;
12549 2) echo "I did a successful read() for something that was not there!";;
12550 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12551 4) echo "Could not find F_SETFL!";;
12552 *) echo "Something terribly wrong happened during testing.";;
12554 rd_nodata=`$cat try.ret`
12555 echo "A read() system call with no data present returns $rd_nodata."
12556 case "$rd_nodata" in
12559 echo "(That's peculiar, fixing that to be -1.)"
12565 echo "Forcing errno EAGAIN on read() with no data available."
12569 echo "Your read() sets errno to $eagain when no data is available."
12572 status=`$cat try.err`
12574 0) echo "And it correctly returns 0 to signal EOF.";;
12575 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12576 *) echo "However, your read() returns '$status' on EOF??";;
12579 if test "$status" = "$rd_nodata"; then
12580 echo "WARNING: you can't distinguish between EOF and no data!"
12584 echo "I can't compile the test program--assuming errno EAGAIN will do."
12588 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12597 echo "Using $hint value $eagain."
12598 echo "Your read() returns $rd_nodata when no data is present."
12599 case "$d_eofnblk" in
12600 "$define") echo "And you can see EOF because read() returns 0.";;
12601 "$undef") echo "But you can't see EOF status from read() returned value.";;
12603 echo "(Assuming you can't see EOF status from read anyway.)"
12609 $rm_try head.c mtry
12611 : see if _ptr and _cnt from stdio act std
12614 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12615 echo "(Looks like you have stdio.h from BSD.)"
12616 case "$stdio_ptr" in
12617 '') stdio_ptr='((fp)->_p)'
12620 *) ptr_lval=$d_stdio_ptr_lval;;
12622 case "$stdio_cnt" in
12623 '') stdio_cnt='((fp)->_r)'
12626 *) cnt_lval=$d_stdio_cnt_lval;;
12628 case "$stdio_base" in
12629 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12631 case "$stdio_bufsiz" in
12632 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12634 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12635 echo "(Looks like you have stdio.h from Linux.)"
12636 case "$stdio_ptr" in
12637 '') stdio_ptr='((fp)->_IO_read_ptr)'
12640 *) ptr_lval=$d_stdio_ptr_lval;;
12642 case "$stdio_cnt" in
12643 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12646 *) cnt_lval=$d_stdio_cnt_lval;;
12648 case "$stdio_base" in
12649 '') stdio_base='((fp)->_IO_read_base)';;
12651 case "$stdio_bufsiz" in
12652 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12655 case "$stdio_ptr" in
12656 '') stdio_ptr='((fp)->_ptr)'
12659 *) ptr_lval=$d_stdio_ptr_lval;;
12661 case "$stdio_cnt" in
12662 '') stdio_cnt='((fp)->_cnt)'
12665 *) cnt_lval=$d_stdio_cnt_lval;;
12667 case "$stdio_base" in
12668 '') stdio_base='((fp)->_base)';;
12670 case "$stdio_bufsiz" in
12671 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12675 : test whether _ptr and _cnt really work
12676 echo "Checking how std your stdio is..." >&4
12679 #$i_stdlib I_STDLIB
12681 #include <stdlib.h>
12683 #define FILE_ptr(fp) $stdio_ptr
12684 #define FILE_cnt(fp) $stdio_cnt
12686 FILE *fp = fopen("try.c", "r");
12689 18 <= FILE_cnt(fp) &&
12690 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12698 if eval $compile && $to try.c; then
12699 if $run ./try; then
12700 echo "Your stdio acts pretty std."
12703 echo "Your stdio isn't very std."
12706 echo "Your stdio doesn't appear very std."
12710 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12711 # direct buffer manipulation no longer works. The Configure tests
12712 # should be changed to correctly detect this, but until then,
12713 # the following check should at least let perl compile and run.
12714 # (This quick fix should be updated before 5.8.1.)
12715 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12716 # A. Dougherty, June 3, 2002.
12717 case "$d_gnulibc" in
12719 case "$gnulibc_version" in
12723 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12732 : Can _ptr be used as an lvalue?
12733 case "$d_stdstdio$ptr_lval" in
12734 $define$define) val=$define ;;
12737 set d_stdio_ptr_lval
12740 : Can _cnt be used as an lvalue?
12741 case "$d_stdstdio$cnt_lval" in
12742 $define$define) val=$define ;;
12745 set d_stdio_cnt_lval
12749 : test whether setting _ptr sets _cnt as a side effect
12750 d_stdio_ptr_lval_sets_cnt="$undef"
12751 d_stdio_ptr_lval_nochange_cnt="$undef"
12752 case "$d_stdio_ptr_lval$d_stdstdio" in
12754 echo "Checking to see what happens if we set the stdio ptr..." >&4
12757 /* Can we scream? */
12758 /* Eat dust sed :-) */
12759 /* In the buffer space, no one can hear you scream. */
12760 #$i_stdlib I_STDLIB
12762 #include <stdlib.h>
12764 #define FILE_ptr(fp) $stdio_ptr
12765 #define FILE_cnt(fp) $stdio_cnt
12766 #include <sys/types.h>
12768 FILE *fp = fopen("try.c", "r");
12773 puts("Fail even to read");
12776 c = getc(fp); /* Read away the first # */
12778 puts("Fail even to read");
12782 18 <= FILE_cnt(fp) &&
12783 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12785 puts("Fail even to read");
12788 ptr = (char*) FILE_ptr(fp);
12789 cnt = (size_t)FILE_cnt(fp);
12791 FILE_ptr(fp) += 42;
12793 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12794 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12797 if (FILE_cnt(fp) <= 20) {
12798 printf ("Fail (<20 chars to test)");
12801 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12802 puts("Fail compare");
12805 if (cnt == FILE_cnt(fp)) {
12806 puts("Pass_unchanged");
12809 if (FILE_cnt(fp) == (cnt - 42)) {
12810 puts("Pass_changed");
12813 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12819 if eval $compile && $to try.c; then
12820 case `$run ./try` in
12822 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12823 d_stdio_ptr_lval_sets_cnt="$define" ;;
12825 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12826 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12828 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12830 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12833 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12839 : see if _base is also standard
12841 case "$d_stdstdio" in
12845 #$i_stdlib I_STDLIB
12847 #include <stdlib.h>
12849 #define FILE_base(fp) $stdio_base
12850 #define FILE_bufsiz(fp) $stdio_bufsiz
12852 FILE *fp = fopen("try.c", "r");
12855 19 <= FILE_bufsiz(fp) &&
12856 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12863 if eval $compile && $to try.c; then
12864 if $run ./try; then
12865 echo "And its _base field acts std."
12868 echo "But its _base field isn't std."
12871 echo "However, it seems to be lacking the _base field."
12879 : see if fast_stdio exists
12881 case "$d_stdstdio:$d_stdio_ptr_lval" in
12883 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12885 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12896 : see if fchdir exists
12897 set fchdir d_fchdir
12900 : see if fchmod exists
12901 set fchmod d_fchmod
12904 : see if fchown exists
12905 set fchown d_fchown
12908 : see if this is an fcntl system
12912 : See if fcntl-based locking works.
12915 #$i_stdlib I_STDLIB
12917 #include <stdlib.h>
12919 #include <unistd.h>
12921 #include <signal.h>
12922 $signal_t blech(int x) { exit(3); }
12924 #if defined(F_SETLK) && defined(F_SETLKW)
12925 struct flock flock;
12927 fd = open("try.c", O_RDONLY);
12928 flock.l_type = F_RDLCK;
12929 flock.l_whence = SEEK_SET;
12930 flock.l_start = flock.l_len = 0;
12931 signal(SIGALRM, blech);
12933 retval = fcntl(fd, F_SETLK, &flock);
12935 (retval < 0 ? exit(2) : exit(0));
12941 echo "Checking if fcntl-based file locking works... "
12945 if eval $compile_ok; then
12946 if $run ./try; then
12947 echo "Yes, it seems to work."
12950 echo "Nope, it didn't work."
12955 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12956 *** This is (almost) impossible.
12957 *** If your NFS lock daemons are not feeling well, something like
12958 *** this may happen, please investigate. Cannot continue, aborting.
12966 echo "I'm unable to compile the test program, so I'll assume not."
12971 echo "Nope, since you don't even have fcntl()."
12974 set d_fcntl_can_lock
12978 : check for fd_set items
12981 Checking to see how well your C compiler handles fd_set and friends ...
12984 #$i_stdlib I_STDLIB
12986 #include <stdlib.h>
12988 #$i_systime I_SYS_TIME
12989 #$i_sysselct I_SYS_SELECT
12990 #$d_socket HAS_SOCKET
12991 #include <sys/types.h>
12993 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12996 #include <sys/time.h>
12998 #ifdef I_SYS_SELECT
12999 #include <sys/select.h>
13008 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13016 if eval $compile; then
13017 d_fds_bits="$define"
13019 echo "Well, your system knows about the normal fd_set typedef..." >&4
13020 if $run ./try; then
13021 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13022 d_fd_macros="$define"
13025 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13027 d_fd_macros="$undef"
13031 Hmm, your compiler has some difficulty with fd_set. Checking further...
13034 if eval $compile; then
13035 d_fds_bits="$undef"
13037 echo "Well, your system has some sort of fd_set available..." >&4
13038 if $run ./try; then
13039 echo "and you have the normal fd_set macros." >&4
13040 d_fd_macros="$define"
13043 but not the normal fd_set macros! Gross! More work for me...
13045 d_fd_macros="$undef"
13048 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13050 d_fds_bits="$undef"
13051 d_fd_macros="$undef"
13056 : see if fgetpos exists
13057 set fgetpos d_fgetpos
13060 : see if finite exists
13061 set finite d_finite
13064 : see if finitel exists
13065 set finitel d_finitel
13068 : see if flock exists
13072 : see if prototype for flock is available
13074 set d_flockproto flock $i_sysfile sys/file.h
13077 : see if fp_class exists
13078 set fp_class d_fp_class
13081 : see if pathconf exists
13082 set pathconf d_pathconf
13085 : see if fpathconf exists
13086 set fpathconf d_fpathconf
13089 : see if fpclass exists
13090 set fpclass d_fpclass
13093 : see if fpclassify exists
13094 set fpclassify d_fpclassify
13097 : see if fpclassl exists
13098 set fpclassl d_fpclassl
13101 : check for fpos64_t
13103 echo "Checking to see if you have fpos64_t..." >&4
13106 int main() { fpos64_t x = 7; }
13109 if eval $compile; then
13111 echo "You have fpos64_t."
13114 echo "You do not have fpos64_t."
13115 case "$fpossize" in
13116 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13123 : see if frexpl exists
13124 set frexpl d_frexpl
13127 : see if this is a sys/param system
13128 set sys/param.h i_sysparam
13131 : see if this is a sys/mount.h system
13132 set sys/mount.h i_sysmount
13135 : Check for fs_data_s
13137 echo "Checking to see if your system supports struct fs_data..." >&4
13138 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13140 case "$d_fs_data_s" in
13141 "$define") echo "Yes, it does." ;;
13142 *) echo "No, it doesn't." ;;
13145 : see if fseeko exists
13146 set fseeko d_fseeko
13148 case "$longsize" in
13149 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13152 : see if fsetpos exists
13153 set fsetpos d_fsetpos
13156 : see if fstatfs exists
13157 set fstatfs d_fstatfs
13160 : see if statvfs exists
13161 set statvfs d_statvfs
13164 : see if fstatvfs exists
13165 set fstatvfs d_fstatvfs
13169 : see if fsync exists
13173 : see if ftello exists
13174 set ftello d_ftello
13176 case "$longsize" in
13177 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13180 : check for a working futimes
13183 echo "Checking if you have a working futimes()" >&4
13186 #include <sys/time.h>
13193 fd = open ("try.c", O_RDWR);
13194 if (-1 == fd) exit (1);
13195 rv = futimes (fd, NULL);
13196 exit (rv == -1 ? errno : 0);
13200 if eval $compile; then
13204 0) echo "Yes, you have" >&4
13205 d_futimes="$define"
13207 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13211 echo "No, it does not (probably harmless)" >&4
13215 : see if getcwd exists
13216 set getcwd d_getcwd
13219 : see if getespwnam exists
13220 set getespwnam d_getespwnam
13223 : see if getfsstat exists
13224 set getfsstat d_getfsstat
13227 : see if getgrent exists
13228 set getgrent d_getgrent
13231 : see if getgrent_r exists
13232 set getgrent_r d_getgrent_r
13234 case "$d_getgrent_r" in
13236 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13237 case "$d_getgrent_r_proto:$usethreads" in
13238 ":define") d_getgrent_r_proto=define
13239 set d_getgrent_r_proto getgrent_r $hdrs
13243 case "$d_getgrent_r_proto" in
13245 case "$getgrent_r_proto" in
13246 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13247 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13249 case "$getgrent_r_proto" in
13250 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13251 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13253 case "$getgrent_r_proto" in
13254 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13255 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13257 case "$getgrent_r_proto" in
13258 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13259 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13261 case "$getgrent_r_proto" in
13262 ''|0) try='int getgrent_r(struct group*, char*, int);'
13263 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13265 case "$getgrent_r_proto" in
13266 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13267 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13269 case "$getgrent_r_proto" in
13270 ''|0) d_getgrent_r=undef
13272 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13273 * ) case "$getgrent_r_proto" in
13274 REENTRANT_PROTO*) ;;
13275 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13277 echo "Prototype: $try" ;;
13280 *) case "$usethreads" in
13281 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13288 *) getgrent_r_proto=0
13292 : see if getgrgid_r exists
13293 set getgrgid_r d_getgrgid_r
13295 case "$d_getgrgid_r" in
13297 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13298 case "$d_getgrgid_r_proto:$usethreads" in
13299 ":define") d_getgrgid_r_proto=define
13300 set d_getgrgid_r_proto getgrgid_r $hdrs
13304 case "$d_getgrgid_r_proto" in
13306 case "$getgrgid_r_proto" in
13307 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13308 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13310 case "$getgrgid_r_proto" in
13311 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13312 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13314 case "$getgrgid_r_proto" in
13315 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13316 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13318 case "$getgrgid_r_proto" in
13319 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13320 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13322 case "$getgrgid_r_proto" in
13323 ''|0) d_getgrgid_r=undef
13325 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13326 * ) case "$getgrgid_r_proto" in
13327 REENTRANT_PROTO*) ;;
13328 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13330 echo "Prototype: $try" ;;
13333 *) case "$usethreads" in
13334 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13341 *) getgrgid_r_proto=0
13345 : see if getgrnam_r exists
13346 set getgrnam_r d_getgrnam_r
13348 case "$d_getgrnam_r" in
13350 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13351 case "$d_getgrnam_r_proto:$usethreads" in
13352 ":define") d_getgrnam_r_proto=define
13353 set d_getgrnam_r_proto getgrnam_r $hdrs
13357 case "$d_getgrnam_r_proto" in
13359 case "$getgrnam_r_proto" in
13360 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13361 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13363 case "$getgrnam_r_proto" in
13364 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13365 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13367 case "$getgrnam_r_proto" in
13368 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13369 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13371 case "$getgrnam_r_proto" in
13372 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13373 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13375 case "$getgrnam_r_proto" in
13376 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13377 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13379 case "$getgrnam_r_proto" in
13380 ''|0) d_getgrnam_r=undef
13382 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13383 * ) case "$getgrnam_r_proto" in
13384 REENTRANT_PROTO*) ;;
13385 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13387 echo "Prototype: $try" ;;
13390 *) case "$usethreads" in
13391 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13398 *) getgrnam_r_proto=0
13402 : see if gethostbyaddr exists
13403 set gethostbyaddr d_gethbyaddr
13406 : see if gethostbyname exists
13407 set gethostbyname d_gethbyname
13410 : see if gethostent exists
13411 set gethostent d_gethent
13414 : see how we will look up host name
13417 if set gethostname val -f d_gethname; eval $csym; $val; then
13418 echo 'gethostname() found.' >&4
13419 d_gethname="$define"
13422 if set uname val -f d_uname; eval $csym; $val; then
13425 uname() was found, but you're running xenix, and older versions of xenix
13426 have a broken uname(). If you don't really know whether your xenix is old
13427 enough to have a broken system call, use the default answer.
13432 "$define") dflt=n;;
13434 rp='Is your uname() broken?'
13437 n*) d_uname="$define"; call=uname;;
13440 echo 'uname() found.' >&4
13447 case "$d_gethname" in
13448 '') d_gethname="$undef";;
13451 '') d_uname="$undef";;
13453 case "$d_uname$d_gethname" in
13458 Every now and then someone has a $call() that lies about the hostname
13459 but can't be fixed for political or economic reasons. If you wish, I can
13460 pretend $call() isn't there and maybe compute hostname at run-time
13461 thanks to the '$phostname' command.
13464 rp="Shall I ignore $call() from now on?"
13467 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13470 case "$phostname" in
13471 '') aphostname='';;
13472 *) case "$aphostname" in
13474 *) set X $phostname
13478 file=`./loc $file $file $pth`
13479 aphostname=`echo $file $*`
13484 case "$d_uname$d_gethname" in
13487 case "$phostname" in
13489 echo "There will be no way for $package to get your hostname." >&4;;
13491 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13495 case "$d_phostname" in
13496 '') d_phostname="$undef";;
13499 : see if gethostbyaddr_r exists
13500 set gethostbyaddr_r d_gethostbyaddr_r
13502 case "$d_gethostbyaddr_r" in
13504 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13505 case "$d_gethostbyaddr_r_proto:$usethreads" in
13506 ":define") d_gethostbyaddr_r_proto=define
13507 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13511 case "$d_gethostbyaddr_r_proto" in
13513 case "$gethostbyaddr_r_proto" in
13514 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13515 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13517 case "$gethostbyaddr_r_proto" in
13518 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13519 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13521 case "$gethostbyaddr_r_proto" in
13522 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13523 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13525 case "$gethostbyaddr_r_proto" in
13526 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13527 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13529 case "$gethostbyaddr_r_proto" in
13530 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13531 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13533 case "$gethostbyaddr_r_proto" in
13534 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13535 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13537 case "$gethostbyaddr_r_proto" in
13538 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13539 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13541 case "$gethostbyaddr_r_proto" in
13542 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13543 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13545 case "$gethostbyaddr_r_proto" in
13546 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13547 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13549 case "$gethostbyaddr_r_proto" in
13550 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13551 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13553 case "$gethostbyaddr_r_proto" in
13554 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13555 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13557 case "$gethostbyaddr_r_proto" in
13558 ''|0) d_gethostbyaddr_r=undef
13559 gethostbyaddr_r_proto=0
13560 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13561 * ) case "$gethostbyaddr_r_proto" in
13562 REENTRANT_PROTO*) ;;
13563 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13565 echo "Prototype: $try" ;;
13568 *) case "$usethreads" in
13569 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13571 d_gethostbyaddr_r=undef
13572 gethostbyaddr_r_proto=0
13576 *) gethostbyaddr_r_proto=0
13580 : see if gethostbyname_r exists
13581 set gethostbyname_r d_gethostbyname_r
13583 case "$d_gethostbyname_r" in
13585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13586 case "$d_gethostbyname_r_proto:$usethreads" in
13587 ":define") d_gethostbyname_r_proto=define
13588 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13592 case "$d_gethostbyname_r_proto" in
13594 case "$gethostbyname_r_proto" in
13595 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13596 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13598 case "$gethostbyname_r_proto" in
13599 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13600 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13602 case "$gethostbyname_r_proto" in
13603 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13604 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13606 case "$gethostbyname_r_proto" in
13607 ''|0) d_gethostbyname_r=undef
13608 gethostbyname_r_proto=0
13609 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13610 * ) case "$gethostbyname_r_proto" in
13611 REENTRANT_PROTO*) ;;
13612 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13614 echo "Prototype: $try" ;;
13617 *) case "$usethreads" in
13618 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13620 d_gethostbyname_r=undef
13621 gethostbyname_r_proto=0
13625 *) gethostbyname_r_proto=0
13629 : see if gethostent_r exists
13630 set gethostent_r d_gethostent_r
13632 case "$d_gethostent_r" in
13634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13635 case "$d_gethostent_r_proto:$usethreads" in
13636 ":define") d_gethostent_r_proto=define
13637 set d_gethostent_r_proto gethostent_r $hdrs
13641 case "$d_gethostent_r_proto" in
13643 case "$gethostent_r_proto" in
13644 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13645 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13647 case "$gethostent_r_proto" in
13648 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13649 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13651 case "$gethostent_r_proto" in
13652 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13653 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13655 case "$gethostent_r_proto" in
13656 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13657 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13659 case "$gethostent_r_proto" in
13660 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13661 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13663 case "$gethostent_r_proto" in
13664 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13665 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13667 case "$gethostent_r_proto" in
13668 ''|0) d_gethostent_r=undef
13669 gethostent_r_proto=0
13670 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13671 * ) case "$gethostent_r_proto" in
13672 REENTRANT_PROTO*) ;;
13673 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13675 echo "Prototype: $try" ;;
13678 *) case "$usethreads" in
13679 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13681 d_gethostent_r=undef
13682 gethostent_r_proto=0
13686 *) gethostent_r_proto=0
13690 : see if prototypes for various gethostxxx netdb.h functions are available
13692 set d_gethostprotos gethostent $i_netdb netdb.h
13695 : see if getitimer exists
13696 set getitimer d_getitimer
13699 : see if getlogin exists
13700 set getlogin d_getlogin
13703 : see if getlogin_r exists
13704 set getlogin_r d_getlogin_r
13706 case "$d_getlogin_r" in
13708 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13709 case "$d_getlogin_r_proto:$usethreads" in
13710 ":define") d_getlogin_r_proto=define
13711 set d_getlogin_r_proto getlogin_r $hdrs
13715 case "$d_getlogin_r_proto" in
13717 case "$getlogin_r_proto" in
13718 ''|0) try='int getlogin_r(char*, size_t);'
13719 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13721 case "$getlogin_r_proto" in
13722 ''|0) try='int getlogin_r(char*, int);'
13723 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13725 case "$getlogin_r_proto" in
13726 ''|0) try='char* getlogin_r(char*, size_t);'
13727 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13729 case "$getlogin_r_proto" in
13730 ''|0) try='char* getlogin_r(char*, int);'
13731 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13733 case "$getlogin_r_proto" in
13734 ''|0) d_getlogin_r=undef
13736 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13737 * ) case "$getlogin_r_proto" in
13738 REENTRANT_PROTO*) ;;
13739 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13741 echo "Prototype: $try" ;;
13744 *) case "$usethreads" in
13745 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13752 *) getlogin_r_proto=0
13756 : see if getmnt exists
13757 set getmnt d_getmnt
13760 : see if getmntent exists
13761 set getmntent d_getmntent
13764 : see if getnetbyaddr exists
13765 set getnetbyaddr d_getnbyaddr
13768 : see if getnetbyname exists
13769 set getnetbyname d_getnbyname
13772 : see if getnetent exists
13773 set getnetent d_getnent
13776 : see if getnetbyaddr_r exists
13777 set getnetbyaddr_r d_getnetbyaddr_r
13779 case "$d_getnetbyaddr_r" in
13781 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13782 case "$d_getnetbyaddr_r_proto:$usethreads" in
13783 ":define") d_getnetbyaddr_r_proto=define
13784 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13788 case "$d_getnetbyaddr_r_proto" in
13790 case "$getnetbyaddr_r_proto" in
13791 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13792 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13794 case "$getnetbyaddr_r_proto" in
13795 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13796 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13798 case "$getnetbyaddr_r_proto" in
13799 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13800 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13802 case "$getnetbyaddr_r_proto" in
13803 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13804 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13806 case "$getnetbyaddr_r_proto" in
13807 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13808 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13810 case "$getnetbyaddr_r_proto" in
13811 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13812 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13814 case "$getnetbyaddr_r_proto" in
13815 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13816 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13818 case "$getnetbyaddr_r_proto" in
13819 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13820 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13822 case "$getnetbyaddr_r_proto" in
13823 ''|0) d_getnetbyaddr_r=undef
13824 getnetbyaddr_r_proto=0
13825 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13826 * ) case "$getnetbyaddr_r_proto" in
13827 REENTRANT_PROTO*) ;;
13828 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13830 echo "Prototype: $try" ;;
13833 *) case "$usethreads" in
13834 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13836 d_getnetbyaddr_r=undef
13837 getnetbyaddr_r_proto=0
13841 *) getnetbyaddr_r_proto=0
13845 : see if getnetbyname_r exists
13846 set getnetbyname_r d_getnetbyname_r
13848 case "$d_getnetbyname_r" in
13850 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13851 case "$d_getnetbyname_r_proto:$usethreads" in
13852 ":define") d_getnetbyname_r_proto=define
13853 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13857 case "$d_getnetbyname_r_proto" in
13859 case "$getnetbyname_r_proto" in
13860 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13861 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13863 case "$getnetbyname_r_proto" in
13864 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13865 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13867 case "$getnetbyname_r_proto" in
13868 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13869 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13871 case "$getnetbyname_r_proto" in
13872 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13873 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13875 case "$getnetbyname_r_proto" in
13876 ''|0) d_getnetbyname_r=undef
13877 getnetbyname_r_proto=0
13878 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13879 * ) case "$getnetbyname_r_proto" in
13880 REENTRANT_PROTO*) ;;
13881 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13883 echo "Prototype: $try" ;;
13886 *) case "$usethreads" in
13887 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13889 d_getnetbyname_r=undef
13890 getnetbyname_r_proto=0
13894 *) getnetbyname_r_proto=0
13898 : see if getnetent_r exists
13899 set getnetent_r d_getnetent_r
13901 case "$d_getnetent_r" in
13903 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13904 case "$d_getnetent_r_proto:$usethreads" in
13905 ":define") d_getnetent_r_proto=define
13906 set d_getnetent_r_proto getnetent_r $hdrs
13910 case "$d_getnetent_r_proto" in
13912 case "$getnetent_r_proto" in
13913 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13914 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13916 case "$getnetent_r_proto" in
13917 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13918 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13920 case "$getnetent_r_proto" in
13921 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13922 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13924 case "$getnetent_r_proto" in
13925 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13926 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13928 case "$getnetent_r_proto" in
13929 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13930 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13932 case "$getnetent_r_proto" in
13933 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13934 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13936 case "$getnetent_r_proto" in
13937 ''|0) d_getnetent_r=undef
13938 getnetent_r_proto=0
13939 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13940 * ) case "$getnetent_r_proto" in
13941 REENTRANT_PROTO*) ;;
13942 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13944 echo "Prototype: $try" ;;
13947 *) case "$usethreads" in
13948 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13950 d_getnetent_r=undef
13951 getnetent_r_proto=0
13955 *) getnetent_r_proto=0
13959 : see if prototypes for various getnetxxx netdb.h functions are available
13961 set d_getnetprotos getnetent $i_netdb netdb.h
13964 : see if getpagesize exists
13965 set getpagesize d_getpagsz
13968 : Optional checks for getprotobyname and getprotobynumber
13970 : see if getprotobyname exists
13971 set getprotobyname d_getpbyname
13974 : see if getprotobynumber exists
13975 set getprotobynumber d_getpbynumber
13978 : see if getprotoent exists
13979 set getprotoent d_getpent
13982 : see if getpgid exists
13983 set getpgid d_getpgid
13986 : see if getpgrp2 exists
13987 set getpgrp2 d_getpgrp2
13990 : see if getppid exists
13991 set getppid d_getppid
13994 : see if getpriority exists
13995 set getpriority d_getprior
13998 : see if getprotobyname_r exists
13999 set getprotobyname_r d_getprotobyname_r
14001 case "$d_getprotobyname_r" in
14003 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14004 case "$d_getprotobyname_r_proto:$usethreads" in
14005 ":define") d_getprotobyname_r_proto=define
14006 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14010 case "$d_getprotobyname_r_proto" in
14012 case "$getprotobyname_r_proto" in
14013 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14014 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14016 case "$getprotobyname_r_proto" in
14017 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14018 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14020 case "$getprotobyname_r_proto" in
14021 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14022 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14024 case "$getprotobyname_r_proto" in
14025 ''|0) d_getprotobyname_r=undef
14026 getprotobyname_r_proto=0
14027 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14028 * ) case "$getprotobyname_r_proto" in
14029 REENTRANT_PROTO*) ;;
14030 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14032 echo "Prototype: $try" ;;
14035 *) case "$usethreads" in
14036 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14038 d_getprotobyname_r=undef
14039 getprotobyname_r_proto=0
14043 *) getprotobyname_r_proto=0
14047 : see if getprotobynumber_r exists
14048 set getprotobynumber_r d_getprotobynumber_r
14050 case "$d_getprotobynumber_r" in
14052 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14053 case "$d_getprotobynumber_r_proto:$usethreads" in
14054 ":define") d_getprotobynumber_r_proto=define
14055 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14059 case "$d_getprotobynumber_r_proto" in
14061 case "$getprotobynumber_r_proto" in
14062 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14063 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14065 case "$getprotobynumber_r_proto" in
14066 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14067 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14069 case "$getprotobynumber_r_proto" in
14070 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14071 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14073 case "$getprotobynumber_r_proto" in
14074 ''|0) d_getprotobynumber_r=undef
14075 getprotobynumber_r_proto=0
14076 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14077 * ) case "$getprotobynumber_r_proto" in
14078 REENTRANT_PROTO*) ;;
14079 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14081 echo "Prototype: $try" ;;
14084 *) case "$usethreads" in
14085 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14087 d_getprotobynumber_r=undef
14088 getprotobynumber_r_proto=0
14092 *) getprotobynumber_r_proto=0
14096 : see if getprotoent_r exists
14097 set getprotoent_r d_getprotoent_r
14099 case "$d_getprotoent_r" in
14101 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14102 case "$d_getprotoent_r_proto:$usethreads" in
14103 ":define") d_getprotoent_r_proto=define
14104 set d_getprotoent_r_proto getprotoent_r $hdrs
14108 case "$d_getprotoent_r_proto" in
14110 case "$getprotoent_r_proto" in
14111 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14112 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14114 case "$getprotoent_r_proto" in
14115 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14116 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14118 case "$getprotoent_r_proto" in
14119 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14120 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14122 case "$getprotoent_r_proto" in
14123 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14124 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14126 case "$getprotoent_r_proto" in
14127 ''|0) d_getprotoent_r=undef
14128 getprotoent_r_proto=0
14129 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14130 * ) case "$getprotoent_r_proto" in
14131 REENTRANT_PROTO*) ;;
14132 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14134 echo "Prototype: $try" ;;
14137 *) case "$usethreads" in
14138 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14140 d_getprotoent_r=undef
14141 getprotoent_r_proto=0
14145 *) getprotoent_r_proto=0
14149 : see if prototypes for various getprotoxxx netdb.h functions are available
14151 set d_getprotoprotos getprotoent $i_netdb netdb.h
14154 : see if getprpwnam exists
14155 set getprpwnam d_getprpwnam
14158 : see if getpwent exists
14159 set getpwent d_getpwent
14162 : see if getpwent_r exists
14163 set getpwent_r d_getpwent_r
14165 case "$d_getpwent_r" in
14167 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14168 case "$d_getpwent_r_proto:$usethreads" in
14169 ":define") d_getpwent_r_proto=define
14170 set d_getpwent_r_proto getpwent_r $hdrs
14174 case "$d_getpwent_r_proto" in
14176 case "$getpwent_r_proto" in
14177 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14178 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14180 case "$getpwent_r_proto" in
14181 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14182 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14184 case "$getpwent_r_proto" in
14185 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14186 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14188 case "$getpwent_r_proto" in
14189 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14190 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14192 case "$getpwent_r_proto" in
14193 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14194 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14196 case "$getpwent_r_proto" in
14197 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14198 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14200 case "$getpwent_r_proto" in
14201 ''|0) d_getpwent_r=undef
14203 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14204 * ) case "$getpwent_r_proto" in
14205 REENTRANT_PROTO*) ;;
14206 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14208 echo "Prototype: $try" ;;
14211 *) case "$usethreads" in
14212 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14219 *) getpwent_r_proto=0
14223 : see if getpwnam_r exists
14224 set getpwnam_r d_getpwnam_r
14226 case "$d_getpwnam_r" in
14228 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14229 case "$d_getpwnam_r_proto:$usethreads" in
14230 ":define") d_getpwnam_r_proto=define
14231 set d_getpwnam_r_proto getpwnam_r $hdrs
14235 case "$d_getpwnam_r_proto" in
14237 case "$getpwnam_r_proto" in
14238 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14239 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14241 case "$getpwnam_r_proto" in
14242 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14243 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14245 case "$getpwnam_r_proto" in
14246 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14247 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14249 case "$getpwnam_r_proto" in
14250 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14251 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14253 case "$getpwnam_r_proto" in
14254 ''|0) d_getpwnam_r=undef
14256 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14257 * ) case "$getpwnam_r_proto" in
14258 REENTRANT_PROTO*) ;;
14259 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14261 echo "Prototype: $try" ;;
14264 *) case "$usethreads" in
14265 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14272 *) getpwnam_r_proto=0
14276 : see if getpwuid_r exists
14277 set getpwuid_r d_getpwuid_r
14279 case "$d_getpwuid_r" in
14281 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14282 case "$d_getpwuid_r_proto:$usethreads" in
14283 ":define") d_getpwuid_r_proto=define
14284 set d_getpwuid_r_proto getpwuid_r $hdrs
14288 case "$d_getpwuid_r_proto" in
14290 case "$getpwuid_r_proto" in
14291 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14292 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14294 case "$getpwuid_r_proto" in
14295 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14296 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14298 case "$getpwuid_r_proto" in
14299 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14300 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14302 case "$getpwuid_r_proto" in
14303 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14304 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14306 case "$getpwuid_r_proto" in
14307 ''|0) d_getpwuid_r=undef
14309 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14310 * ) case "$getpwuid_r_proto" in
14311 REENTRANT_PROTO*) ;;
14312 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14314 echo "Prototype: $try" ;;
14317 *) case "$usethreads" in
14318 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14325 *) getpwuid_r_proto=0
14329 : Optional checks for getsbyname and getsbyport
14331 : see if getservbyname exists
14332 set getservbyname d_getsbyname
14335 : see if getservbyport exists
14336 set getservbyport d_getsbyport
14339 : see if getservent exists
14340 set getservent d_getsent
14343 : see if getservbyname_r exists
14344 set getservbyname_r d_getservbyname_r
14346 case "$d_getservbyname_r" in
14348 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14349 case "$d_getservbyname_r_proto:$usethreads" in
14350 ":define") d_getservbyname_r_proto=define
14351 set d_getservbyname_r_proto getservbyname_r $hdrs
14355 case "$d_getservbyname_r_proto" in
14357 case "$getservbyname_r_proto" in
14358 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14359 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14361 case "$getservbyname_r_proto" in
14362 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14363 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14365 case "$getservbyname_r_proto" in
14366 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14367 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14369 case "$getservbyname_r_proto" in
14370 ''|0) d_getservbyname_r=undef
14371 getservbyname_r_proto=0
14372 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14373 * ) case "$getservbyname_r_proto" in
14374 REENTRANT_PROTO*) ;;
14375 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14377 echo "Prototype: $try" ;;
14380 *) case "$usethreads" in
14381 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14383 d_getservbyname_r=undef
14384 getservbyname_r_proto=0
14388 *) getservbyname_r_proto=0
14392 : see if getservbyport_r exists
14393 set getservbyport_r d_getservbyport_r
14395 case "$d_getservbyport_r" in
14397 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14398 case "$d_getservbyport_r_proto:$usethreads" in
14399 ":define") d_getservbyport_r_proto=define
14400 set d_getservbyport_r_proto getservbyport_r $hdrs
14404 case "$d_getservbyport_r_proto" in
14406 case "$getservbyport_r_proto" in
14407 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14408 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14410 case "$getservbyport_r_proto" in
14411 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14412 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14414 case "$getservbyport_r_proto" in
14415 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14416 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14418 case "$getservbyport_r_proto" in
14419 ''|0) d_getservbyport_r=undef
14420 getservbyport_r_proto=0
14421 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14422 * ) case "$getservbyport_r_proto" in
14423 REENTRANT_PROTO*) ;;
14424 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14426 echo "Prototype: $try" ;;
14429 *) case "$usethreads" in
14430 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14432 d_getservbyport_r=undef
14433 getservbyport_r_proto=0
14437 *) getservbyport_r_proto=0
14441 : see if getservent_r exists
14442 set getservent_r d_getservent_r
14444 case "$d_getservent_r" in
14446 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14447 case "$d_getservent_r_proto:$usethreads" in
14448 ":define") d_getservent_r_proto=define
14449 set d_getservent_r_proto getservent_r $hdrs
14453 case "$d_getservent_r_proto" in
14455 case "$getservent_r_proto" in
14456 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14457 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14459 case "$getservent_r_proto" in
14460 ''|0) try='int getservent_r(struct servent*, char*, int);'
14461 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14463 case "$getservent_r_proto" in
14464 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14465 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14467 case "$getservent_r_proto" in
14468 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14469 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14471 case "$getservent_r_proto" in
14472 ''|0) d_getservent_r=undef
14473 getservent_r_proto=0
14474 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14475 * ) case "$getservent_r_proto" in
14476 REENTRANT_PROTO*) ;;
14477 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14479 echo "Prototype: $try" ;;
14482 *) case "$usethreads" in
14483 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14485 d_getservent_r=undef
14486 getservent_r_proto=0
14490 *) getservent_r_proto=0
14494 : see if prototypes for various getservxxx netdb.h functions are available
14496 set d_getservprotos getservent $i_netdb netdb.h
14499 : see if getspnam exists
14500 set getspnam d_getspnam
14503 : see if this is a shadow.h system
14504 set shadow.h i_shadow
14507 : see if getspnam_r exists
14508 set getspnam_r d_getspnam_r
14510 case "$d_getspnam_r" in
14512 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14513 case "$d_getspnam_r_proto:$usethreads" in
14514 ":define") d_getspnam_r_proto=define
14515 set d_getspnam_r_proto getspnam_r $hdrs
14519 case "$d_getspnam_r_proto" in
14521 case "$getspnam_r_proto" in
14522 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14523 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14525 case "$getspnam_r_proto" in
14526 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14527 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14529 case "$getspnam_r_proto" in
14530 ''|0) d_getspnam_r=undef
14532 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14533 * ) case "$getspnam_r_proto" in
14534 REENTRANT_PROTO*) ;;
14535 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14537 echo "Prototype: $try" ;;
14540 *) case "$usethreads" in
14541 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14548 *) getspnam_r_proto=0
14552 : see if gettimeofday or ftime exists
14553 set gettimeofday d_gettimeod
14555 case "$d_gettimeod" in
14561 val="$undef"; set d_ftime; eval $setvar
14564 case "$d_gettimeod$d_ftime" in
14567 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14571 : see if gmtime_r exists
14572 set gmtime_r d_gmtime_r
14574 case "$d_gmtime_r" in
14576 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14577 case "$d_gmtime_r_proto:$usethreads" in
14578 ":define") d_gmtime_r_proto=define
14579 set d_gmtime_r_proto gmtime_r $hdrs
14583 case "$d_gmtime_r_proto" in
14585 case "$gmtime_r_proto" in
14586 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14587 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14589 case "$gmtime_r_proto" in
14590 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14591 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14593 case "$gmtime_r_proto" in
14594 ''|0) d_gmtime_r=undef
14596 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14597 * ) case "$gmtime_r_proto" in
14598 REENTRANT_PROTO*) ;;
14599 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14601 echo "Prototype: $try" ;;
14604 *) case "$usethreads" in
14605 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14612 *) gmtime_r_proto=0
14616 : see if hasmntopt exists
14617 set hasmntopt d_hasmntopt
14620 : see if this is a netinet/in.h or sys/in.h system
14621 set netinet/in.h i_niin sys/in.h i_sysin
14624 : see if arpa/inet.h has to be included
14625 set arpa/inet.h i_arpainet
14628 : see if htonl --and friends-- exists
14633 : Maybe they are macros.
14636 $cat >htonl.c <<EOM
14638 #include <sys/types.h>
14639 #$i_niin I_NETINET_IN
14641 #$i_arpainet I_ARPA_INET
14642 #ifdef I_NETINET_IN
14643 #include <netinet/in.h>
14646 #include <sys/in.h>
14649 #include <arpa/inet.h>
14652 printf("Defined as a macro.");
14655 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14656 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14658 echo "But it seems to be defined as a macro." >&4
14666 : see if ilogbl exists
14667 set ilogbl d_ilogbl
14672 if set index val -f; eval $csym; $val; then
14673 if set strchr val -f d_strchr; eval $csym; $val; then
14674 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14677 echo "strchr() found." >&4
14681 echo "index() found." >&4
14686 echo "index() found." >&4
14689 if set strchr val -f d_strchr; eval $csym; $val; then
14692 echo "strchr() found." >&4
14694 echo "No index() or strchr() found!" >&4
14699 set d_strchr; eval $setvar
14701 set d_index; eval $setvar
14703 : check whether inet_aton exists
14704 set inet_aton d_inetaton
14709 $cat >isascii.c <<EOCP
14712 #$i_stdlib I_STDLIB
14714 #include <stdlib.h>
14725 if eval $compile; then
14726 echo "isascii() found." >&4
14729 echo "isascii() NOT found." >&4
14736 : see if isfinite exists
14737 set isfinite d_isfinite
14740 : see if isinf exists
14744 : see if isnan exists
14748 : see if isnanl exists
14749 set isnanl d_isnanl
14752 : see if killpg exists
14753 set killpg d_killpg
14756 : see if lchown exists
14758 $cat > try.c <<'EOCP'
14759 /* System header to define __stub macros and hopefully few prototypes,
14760 which can conflict with char lchown(); below. */
14761 #include <assert.h>
14762 /* Override any gcc2 internal prototype to avoid an error. */
14763 /* We use char because int might match the return type of a gcc2
14764 builtin and then its argument prototype would still apply. */
14767 /* The GNU C library defines this for functions which it implements
14768 to always fail with ENOSYS. Some functions are actually named
14769 something starting with __ and the normal name is an alias. */
14770 #if defined (__stub_lchown) || defined (__stub___lchown)
14778 if eval $compile; then
14779 $echo "lchown() found." >&4
14782 $echo "lchown() NOT found." >&4
14788 : See if number of significant digits in a double precision number is known
14790 $cat >ldbl_dig.c <<EOM
14791 #$i_limits I_LIMITS
14794 #include <limits.h>
14800 printf("Contains LDBL_DIG");
14803 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14804 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14805 echo "LDBL_DIG found." >&4
14808 echo "LDBL_DIG NOT found." >&4
14815 : see if this is a math.h system
14819 : check to see if math.h defines _LIB_VERSION
14820 d_libm_lib_version="$undef"
14824 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14826 #include <unistd.h>
14828 int main (int argc, char *argv[])
14830 printf ("%d\n", _LIB_VERSION);
14835 if eval $compile; then
14837 echo "Yes, it does ($foo)" >&4
14838 d_libm_lib_version="$define"
14840 echo "No, it does not (probably harmless)" >&4
14847 : see if link exists
14851 : see if localtime_r exists
14852 set localtime_r d_localtime_r
14854 case "$d_localtime_r" in
14856 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14857 case "$d_localtime_r_proto:$usethreads" in
14858 ":define") d_localtime_r_proto=define
14859 set d_localtime_r_proto localtime_r $hdrs
14863 case "$d_localtime_r_proto" in
14865 case "$localtime_r_proto" in
14866 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14867 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14869 case "$localtime_r_proto" in
14870 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14871 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14873 case "$localtime_r_proto" in
14874 ''|0) d_localtime_r=undef
14875 localtime_r_proto=0
14876 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14877 * ) case "$localtime_r_proto" in
14878 REENTRANT_PROTO*) ;;
14879 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14881 echo "Prototype: $try" ;;
14884 *) case "$usethreads" in
14885 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14887 d_localtime_r=undef
14888 localtime_r_proto=0
14892 *) localtime_r_proto=0
14896 : see if localtime_r calls tzset
14897 case "$localtime_r_proto" in
14900 /* Does our libc's localtime_r call tzset ?
14901 * return 0 if so, 1 otherwise.
14903 #include <sys/types.h>
14904 #include <unistd.h>
14906 #include <string.h>
14907 #include <malloc.h>
14910 time_t t = time(0L);
14911 char w_tz[]="TZ" "=GMT+5",
14912 e_tz[]="TZ" "=GMT-5",
14913 *tz_e = (char*)malloc(16),
14914 *tz_w = (char*)malloc(16);
14915 struct tm tm_e, tm_w;
14916 memset(&tm_e,'\0',sizeof(struct tm));
14917 memset(&tm_w,'\0',sizeof(struct tm));
14922 localtime_r(&t, &tm_e);
14925 localtime_r(&t, &tm_w);
14927 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14933 if eval $compile; then
14934 if $run ./try; then
14935 d_localtime_r_needs_tzset=undef;
14937 d_localtime_r_needs_tzset=define;
14940 d_localtime_r_needs_tzset=undef;
14944 d_localtime_r_needs_tzset=undef;
14949 : see if localeconv exists
14950 set localeconv d_locconv
14953 : see if lockf exists
14957 : see if prototype for lseek is available
14959 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14962 : see if lstat exists
14966 : see if madvise exists
14967 set madvise d_madvise
14970 : see if malloc_size exists
14971 set malloc_size d_malloc_size
14974 : see if malloc_size_good exists
14975 set malloc_good_size d_malloc_good_size
14978 : see if mblen exists
14982 : see if mbstowcs exists
14983 set mbstowcs d_mbstowcs
14986 : see if mbtowc exists
14987 set mbtowc d_mbtowc
14990 : see if memchr exists
14991 set memchr d_memchr
14994 : see if memcmp exists
14995 set memcmp d_memcmp
14998 : see if memcpy exists
14999 set memcpy d_memcpy
15002 : see if memmove exists
15003 set memmove d_memmove
15006 : see if memset exists
15007 set memset d_memset
15010 : see if mkdir exists
15014 : see if mkdtemp exists
15015 set mkdtemp d_mkdtemp
15018 : see if mkfifo exists
15019 set mkfifo d_mkfifo
15022 : see if mkstemp exists
15023 set mkstemp d_mkstemp
15026 : see if mkstemps exists
15027 set mkstemps d_mkstemps
15030 : see if mktime exists
15031 set mktime d_mktime
15034 : see if this is a sys/mman.h system
15035 set sys/mman.h i_sysmman
15038 : see if mmap exists
15041 : see what shmat returns
15042 : default to something harmless
15044 case "$i_sysmman$d_mmap" in
15046 $cat >mmap.c <<'END'
15047 #include <sys/mman.h>
15050 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15055 echo "and it returns ($mmaptype)." >&4
15061 : see if sqrtl exists
15065 : see if scalbnl exists
15066 set scalbnl d_scalbnl
15069 : see if modfl exists
15073 : see if prototype for modfl is available
15075 set d_modflproto modfl $i_math math.h
15078 d_modfl_pow32_bug="$undef"
15080 case "$d_longdbl$d_modfl" in
15083 Checking to see whether your modfl() is okay for large values...
15089 if $test "X$d_modflproto" != "X$define"; then
15090 $cat >>try.c <<EOCP
15091 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15092 long double modfl (long double, long double *);
15095 $cat >>try.c <<EOCP
15097 long double nv = 4294967303.15;
15103 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15107 case "$osname:$gccversion" in
15108 aix:) saveccflags="$ccflags"
15109 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15112 if eval $compile; then
15115 *" 4294967303.150000 1.150000 4294967302.000000")
15116 echo >&4 "Your modfl() is broken for large values."
15117 d_modfl_pow32_bug="$define"
15119 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15123 *" 4294967303.150000 0.150000 4294967303.000000")
15124 echo >&4 "Your modfl() seems okay for large values."
15126 *) echo >&4 "I don't understand your modfl() at all."
15132 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15135 case "$osname:$gccversion" in
15136 aix:) ccflags="$saveccflags" ;; # restore
15141 if $test "$uselongdouble" = "$define"; then
15143 if $test "$d_sqrtl" != "$define"; then
15144 message="$message sqrtl"
15146 if $test "$d_modfl" != "$define"; then
15147 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15148 echo "You have both aintl and copysignl, so I can emulate modfl."
15150 message="$message modfl"
15153 if $test "$d_frexpl" != "$define"; then
15154 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15155 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15157 message="$message frexpl"
15161 if $test "$message" != ""; then
15164 *** You requested the use of long doubles but you do not seem to have
15165 *** the following mathematical functions needed for long double support:
15167 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15168 *** Cannot continue, aborting.
15176 : see if mprotect exists
15177 set mprotect d_mprotect
15180 : see if msgctl exists
15181 set msgctl d_msgctl
15184 : see if msgget exists
15185 set msgget d_msgget
15188 : see if msgsnd exists
15189 set msgsnd d_msgsnd
15192 : see if msgrcv exists
15193 set msgrcv d_msgrcv
15196 : see how much of the 'msg*(2)' library is present.
15199 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15200 *"$undef"*) h_msg=false;;
15204 case "`ipcs 2>&1`" in
15205 "SVID messages"*"not configured"*)
15206 echo "Your $osname does not have the msg*(2) configured." >&4
15209 set msgctl d_msgctl
15211 set msgget d_msgget
15213 set msgsnd d_msgsnd
15215 set msgrcv d_msgrcv
15221 : we could also check for sys/ipc.h ...
15222 if $h_msg && $test `./findhdr sys/msg.h`; then
15223 echo "You have the full msg*(2) library." >&4
15226 echo "You don't have the full msg*(2) library." >&4
15232 : Check for msghdr_s
15234 echo "Checking to see if your system supports struct msghdr..." >&4
15235 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15237 case "$d_msghdr_s" in
15238 "$define") echo "Yes, it does." ;;
15239 *) echo "No, it doesn't." ;;
15243 : see if msync exists
15247 : see if munmap exists
15248 set munmap d_munmap
15251 : see if nice exists
15255 : see if this is a langinfo.h system
15256 set langinfo.h i_langinfo
15259 : see if nl_langinfo exists
15260 set nl_langinfo d_nl_langinfo
15263 : check for volatile keyword
15265 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15266 $cat >try.c <<'EOCP'
15269 typedef struct _goo_struct goo_struct;
15270 goo_struct * volatile goo = ((goo_struct *)0);
15271 struct _goo_struct {
15276 typedef unsigned short foo_t;
15277 char *volatile foo;
15279 volatile foo_t blech;
15283 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15285 echo "Yup, it does."
15288 echo "Nope, it doesn't."
15294 : Check basic sizes
15296 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15298 case "$use64bitint:$d_quad:$quadtype" in
15301 uvtype="$uquadtype"
15306 uvtype="unsigned long"
15312 case "$uselongdouble:$d_longdbl" in
15314 nvtype="long double"
15315 nvsize=$longdblsize
15322 $echo "(IV will be "$ivtype", $ivsize bytes)"
15323 $echo "(UV will be "$uvtype", $uvsize bytes)"
15324 $echo "(NV will be "$nvtype", $nvsize bytes)"
15327 #$i_inttypes I_INTTYPES
15329 #include <inttypes.h>
15334 int8_t i = INT8_MAX;
15335 uint8_t u = UINT8_MAX;
15336 printf("int8_t\n");
15339 int16_t i = INT16_MAX;
15340 uint16_t i = UINT16_MAX;
15341 printf("int16_t\n");
15344 int32_t i = INT32_MAX;
15345 uint32_t u = UINT32_MAX;
15346 printf("int32_t\n");
15351 i8type="signed char"
15352 u8type="unsigned char"
15357 '') case "$shortsize" in
15359 u16type="unsigned short"
15367 '') set try -DINT16
15368 if eval $compile; then
15369 case "`$run ./try`" in
15381 '') if $test $shortsize -ge 2; then
15383 u16type="unsigned short"
15391 '') case "$longsize" in
15393 u32type="unsigned long"
15397 *) case "$intsize" in
15399 u32type="unsigned int"
15409 '') set try -DINT32
15410 if eval $compile; then
15411 case "`$run ./try`" in
15423 '') if $test $intsize -ge 4; then
15425 u32type="unsigned int"
15433 '') case "$d_quad:$quadtype" in
15435 i64type="$quadtype"
15436 u64type="$uquadtype"
15444 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15445 : volatile so that the compiler has to store it out to memory.
15446 if test X"$d_volatile" = X"$define"; then
15451 #$i_stdlib I_STDLIB
15453 #include <stdlib.h>
15455 #include <sys/types.h>
15456 #include <signal.h>
15458 $volatile int bletched = 0;
15459 $signal_t blech(int s) { bletched = 1; }
15464 int n = 8 * $uvsize;
15467 signal(SIGFPE, blech);
15470 for (i = 0; i < n; i++) {
15471 u = u << 1 | ($uvtype)1;
15473 if (($uvtype)d != u)
15477 d = ($nvtype)(u - 1);
15478 if (($uvtype)d != (u - 1))
15485 printf("%d\n", ((i == n) ? -n : i));
15491 d_nv_preserves_uv="$undef"
15492 if eval $compile; then
15493 nv_preserves_uv_bits="`$run ./try`"
15495 case "$nv_preserves_uv_bits" in
15497 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15498 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15499 d_nv_preserves_uv="$define"
15501 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15502 d_nv_preserves_uv="$undef" ;;
15503 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15504 nv_preserves_uv_bits="0" ;;
15508 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15509 : volatile so that the compiler has to store it out to memory.
15510 if test X"$d_volatile" = X"$define"; then
15516 typedef $nvtype NV;
15523 while(count < 256) {
15524 $volatile NV up = value + 1.0;
15525 $volatile NV negated = -value;
15526 $volatile NV down = negated - 1.0;
15527 $volatile NV got_up = up - value;
15528 int up_good = got_up == 1.0;
15529 int got_down = down - negated;
15530 int down_good = got_down == -1.0;
15532 if (down_good != up_good) {
15534 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15535 up_good, (double) got_up, down_good, (double) got_down,
15536 count, (double) value);
15543 fputs("256.0", stdout);
15546 fputs("2.0", stdout);
15552 fputs("*", stdout);
15558 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15559 count, (double) value);
15565 nv_overflows_integers_at='0'
15566 if eval $compile; then
15572 The largest integer your NVs can preserve is equal to $xxx
15574 nv_overflows_integers_at="$xxx"
15577 Cannot determine the largest integer value your NVs can hold, unexpected output
15584 Cannot determine the largest integer value your NVs can hold
15591 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15592 : volatile so that the compiler has to store it out to memory.
15593 if test X"$d_volatile" = X"$define"; then
15598 #$i_stdlib I_STDLIB
15600 #include <stdlib.h>
15602 #$i_string I_STRING
15604 # include <string.h>
15606 # include <strings.h>
15608 #include <sys/types.h>
15609 #include <signal.h>
15611 $volatile int bletched = 0;
15612 $signal_t blech(int s) { bletched = 1; }
15615 int checkit($nvtype d, char *where) {
15616 unsigned char *p = (char *)&d;
15617 unsigned char *end = p + sizeof(d);
15627 printf("No - %s: 0x", where);
15629 printf ("%02X", *p++);
15634 int main(int argc, char **argv) {
15637 fail += checkit(d, "0.0");
15639 /* The compiler shouldn't be assuming that bletched is 0 */
15642 fail += checkit(d, "bleched");
15645 signal(SIGFPE, blech);
15648 /* Paranoia - the compiler should have no way of knowing that ANSI says
15649 that argv[argc] will always be NULL. Actually, if it did assume this it
15650 would be buggy, as this is C and main() can be called from elsewhere in
15652 d = argv[argc] ? 1 : 0;
15655 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15658 fail += checkit(d, "ternary");
15660 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15663 printf("No - memset doesn't give 0.0\n");
15664 /* This might just blow up: */
15665 printf("(gives %g)\n", d);
15671 printf("No - something bleched\n");
15676 printf("No - %d fail(s)\n", fail);
15685 d_nv_zero_is_allbits_zero="$undef"
15686 if eval $compile; then
15692 0.0 is represented as all bits zero in memory
15694 d_nv_zero_is_allbits_zero="$define"
15697 0.0 is not represented as all bits zero in memory
15699 d_nv_zero_is_allbits_zero="$undef"
15704 0.0 is not represented as all bits zero in memory
15706 d_nv_zero_is_allbits_zero="$undef"
15712 : check for off64_t
15714 echo "Checking to see if you have off64_t..." >&4
15716 #include <sys/types.h>
15717 #include <unistd.h>
15718 int main() { off64_t x = 7; }
15721 if eval $compile; then
15723 echo "You have off64_t."
15726 echo "You do not have off64_t."
15727 case "$lseeksize" in
15728 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15735 : how to create joinable pthreads
15736 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15738 echo "Checking what constant to use for creating joinable pthreads..." >&4
15739 $cat >try.c <<'EOCP'
15740 #include <pthread.h>
15742 int detachstate = JOINABLE;
15745 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15746 if eval $compile; then
15747 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15748 val="$undef" # Yes, undef.
15749 set d_old_pthread_create_joinable
15752 set old_pthread_create_joinable
15755 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15756 if eval $compile; then
15757 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15759 set d_old_pthread_create_joinable
15761 val=PTHREAD_CREATE_UNDETACHED
15762 set old_pthread_create_joinable
15765 set try -DJOINABLE=__UNDETACHED
15766 if eval $compile; then
15767 echo "You seem to use __UNDETACHED." >&4
15769 set d_old_pthread_create_joinable
15772 set old_pthread_create_joinable
15775 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15777 set d_old_pthread_create_joinable
15780 set old_pthread_create_joinable
15787 d_old_pthread_create_joinable="$undef"
15788 old_pthread_create_joinable=""
15791 : see if pause exists
15795 : see if poll exists
15799 : see if readlink exists
15800 set readlink d_readlink
15803 : Check if exe is symlink to abs path of executing program
15807 case "$d_readlink" in
15809 if $issymlink /proc/self/exe ; then
15810 $ls -l /proc/self/exe > reflect
15811 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15812 echo "You have Linux-like /proc/self/exe."
15813 procselfexe='"/proc/self/exe"'
15817 if $issymlink /proc/curproc/file ; then
15818 $ls -l /proc/curproc/file > reflect
15819 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15820 echo "You have BSD-like /proc/curproc/file."
15821 procselfexe='"/proc/curproc/file"'
15831 : backward compatibility for d_hvfork
15832 if test X$d_hvfork != X; then
15833 d_vfork="$d_hvfork"
15836 : see if there is a vfork
15841 d_pseudofork=$undef
15843 : Ok, but do we want to use it. vfork is reportedly unreliable in
15844 : perl on Solaris 2.x, and probably elsewhere.
15848 case "$usevfork" in
15854 Perl can only use a vfork() that doesn't suffer from strict
15855 restrictions on calling functions or modifying global data in
15856 the child. For example, glibc-2.1 contains such a vfork()
15857 that is unsuitable. If your system provides a proper fork()
15858 call, chances are that you do NOT want perl to use vfork().
15861 rp="Do you still want to use vfork()?"
15866 echo "Ok, we won't use vfork()."
15875 $define) usevfork='true';;
15876 *) usevfork='false';;
15879 : see whether the pthread_atfork exists
15881 #include <pthread.h>
15884 #ifdef PTHREAD_ATFORK
15885 pthread_atfork(NULL,NULL,NULL);
15890 : see if pthread_atfork exists
15891 set try -DPTHREAD_ATFORK
15892 if eval $compile; then
15897 case "$usethreads" in
15900 $define) echo 'pthread_atfork found.' >&4 ;;
15901 *) echo 'pthread_atfork NOT found.' >&4 ;;
15904 set d_pthread_atfork
15907 : see if pthread_attr_setscope exists
15908 set pthread_attr_setscope d_pthread_attr_setscope
15911 : see whether the various POSIXish _yields exist
15913 #include <pthread.h>
15919 #ifdef PTHREAD_YIELD
15922 #ifdef PTHREAD_YIELD_NULL
15923 pthread_yield(NULL);
15929 : see if sched_yield exists
15930 set try -DSCHED_YIELD
15931 if eval $compile; then
15933 sched_yield='sched_yield()'
15937 case "$usethreads" in
15940 $define) echo 'sched_yield() found.' >&4 ;;
15941 *) echo 'sched_yield() NOT found.' >&4 ;;
15947 : see if pthread_yield exists
15948 set try -DPTHREAD_YIELD
15949 if eval $compile; then
15951 case "$sched_yield" in
15952 '') sched_yield='pthread_yield()' ;;
15955 set try -DPTHREAD_YIELD_NULL
15956 if eval $compile; then
15958 case "$sched_yield" in
15959 '') sched_yield='pthread_yield(NULL)' ;;
15965 case "$usethreads" in
15968 $define) echo 'pthread_yield() found.' >&4 ;;
15969 *) echo 'pthread_yield() NOT found.' >&4 ;;
15973 set d_pthread_yield
15975 case "$sched_yield" in
15976 '') sched_yield=undef ;;
15980 : see if random_r exists
15981 set random_r d_random_r
15983 case "$d_random_r" in
15985 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15986 case "$d_random_r_proto:$usethreads" in
15987 ":define") d_random_r_proto=define
15988 set d_random_r_proto random_r $hdrs
15992 case "$d_random_r_proto" in
15994 case "$random_r_proto" in
15995 ''|0) try='int random_r(int*, struct random_data*);'
15996 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15998 case "$random_r_proto" in
15999 ''|0) try='int random_r(long*, struct random_data*);'
16000 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16002 case "$random_r_proto" in
16003 ''|0) try='int random_r(struct random_data*, int32_t*);'
16004 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16006 case "$random_r_proto" in
16007 ''|0) d_random_r=undef
16009 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16010 * ) case "$random_r_proto" in
16011 REENTRANT_PROTO*) ;;
16012 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16014 echo "Prototype: $try" ;;
16017 *) case "$usethreads" in
16018 define) echo "random_r has no prototype, not using it." >&4 ;;
16025 *) random_r_proto=0
16029 : see if readdir and friends exist
16030 set readdir d_readdir
16032 set seekdir d_seekdir
16034 set telldir d_telldir
16036 set rewinddir d_rewinddir
16039 : see if readdir64_r exists
16040 set readdir64_r d_readdir64_r
16042 case "$d_readdir64_r" in
16044 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16045 case "$d_readdir64_r_proto:$usethreads" in
16046 ":define") d_readdir64_r_proto=define
16047 set d_readdir64_r_proto readdir64_r $hdrs
16051 case "$d_readdir64_r_proto" in
16053 case "$readdir64_r_proto" in
16054 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16055 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16057 case "$readdir64_r_proto" in
16058 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16059 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16061 case "$readdir64_r_proto" in
16062 ''|0) d_readdir64_r=undef
16063 readdir64_r_proto=0
16064 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16065 * ) case "$readdir64_r_proto" in
16066 REENTRANT_PROTO*) ;;
16067 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16069 echo "Prototype: $try" ;;
16072 *) case "$usethreads" in
16073 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16075 d_readdir64_r=undef
16076 readdir64_r_proto=0
16080 *) readdir64_r_proto=0
16084 : see if readdir_r exists
16085 set readdir_r d_readdir_r
16087 case "$d_readdir_r" in
16089 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16090 case "$d_readdir_r_proto:$usethreads" in
16091 ":define") d_readdir_r_proto=define
16092 set d_readdir_r_proto readdir_r $hdrs
16096 case "$d_readdir_r_proto" in
16098 case "$readdir_r_proto" in
16099 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16100 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16102 case "$readdir_r_proto" in
16103 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16104 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16106 case "$readdir_r_proto" in
16107 ''|0) d_readdir_r=undef
16109 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16110 * ) case "$readdir_r_proto" in
16111 REENTRANT_PROTO*) ;;
16112 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16114 echo "Prototype: $try" ;;
16117 *) case "$usethreads" in
16118 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16125 *) readdir_r_proto=0
16129 : see if readv exists
16133 : see if recvmsg exists
16134 set recvmsg d_recvmsg
16137 : see if rename exists
16138 set rename d_rename
16141 : see if rmdir exists
16145 : see if memory.h is available.
16150 : See if it conflicts with string.h
16156 $cppstdin $cppflags $cppminus < $strings > mem.h
16157 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16159 echo "We won't be including <memory.h>."
16169 : can bcopy handle overlapping blocks?
16172 case "$d_memmove" in
16173 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16174 *) case "$d_bcopy" in
16176 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16178 #$i_memory I_MEMORY
16179 #$i_stdlib I_STDLIB
16180 #$i_string I_STRING
16181 #$i_unistd I_UNISTD
16183 $cat >>try.c <<'EOCP'
16186 # include <memory.h>
16189 # include <stdlib.h>
16192 # include <string.h>
16194 # include <strings.h>
16197 # include <unistd.h> /* Needed for NetBSD */
16201 char buf[128], abc[128];
16207 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16208 try to store the string in read-only memory. */
16209 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16211 for (align = 7; align >= 0; align--) {
16212 for (len = 36; len; len--) {
16214 bcopy(abc, b, len);
16215 for (off = 1; off <= len; off++) {
16216 bcopy(b, b+off, len);
16217 bcopy(b+off, b, len);
16218 if (bcmp(b, abc, len))
16227 if eval $compile_ok; then
16228 if $run ./try 2>/dev/null; then
16229 echo "Yes, it can."
16232 echo "It can't, sorry."
16235 echo "(I can't compile the test program, so we'll assume not...)"
16245 : can memcpy handle overlapping blocks?
16248 case "$d_memmove" in
16249 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16250 *) case "$d_memcpy" in
16252 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16254 #$i_memory I_MEMORY
16255 #$i_stdlib I_STDLIB
16256 #$i_string I_STRING
16257 #$i_unistd I_UNISTD
16259 $cat >>try.c <<'EOCP'
16262 # include <memory.h>
16265 # include <stdlib.h>
16268 # include <string.h>
16270 # include <strings.h>
16273 # include <unistd.h> /* Needed for NetBSD */
16277 char buf[128], abc[128];
16283 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16284 try to store the string in read-only memory. */
16285 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16287 for (align = 7; align >= 0; align--) {
16288 for (len = 36; len; len--) {
16290 memcpy(b, abc, len);
16291 for (off = 1; off <= len; off++) {
16292 memcpy(b+off, b, len);
16293 memcpy(b, b+off, len);
16294 if (memcmp(b, abc, len))
16303 if eval $compile_ok; then
16304 if $run ./try 2>/dev/null; then
16305 echo "Yes, it can."
16308 echo "It can't, sorry."
16311 echo "(I can't compile the test program, so we'll assume not...)"
16321 : can memcmp be trusted to compare relative magnitude?
16323 case "$d_memcmp" in
16326 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16328 #$i_memory I_MEMORY
16329 #$i_stdlib I_STDLIB
16330 #$i_string I_STRING
16331 #$i_unistd I_UNISTD
16333 $cat >>try.c <<'EOCP'
16336 # include <memory.h>
16339 # include <stdlib.h>
16342 # include <string.h>
16344 # include <strings.h>
16347 # include <unistd.h> /* Needed for NetBSD */
16353 if ((a < b) && memcmp(&a, &b, 1) < 0)
16359 if eval $compile_ok; then
16360 if $run ./try 2>/dev/null; then
16361 echo "Yes, it can."
16364 echo "No, it can't (it uses signed chars)."
16367 echo "(I can't compile the test program, so we'll assume not...)"
16375 : see if prototype for sbrk is available
16377 set d_sbrkproto sbrk $i_unistd unistd.h
16380 : see if select exists
16381 set select d_select
16384 : see if semctl exists
16385 set semctl d_semctl
16388 : see if semget exists
16389 set semget d_semget
16392 : see if semop exists
16396 : see how much of the 'sem*(2)' library is present.
16399 case "$d_semctl$d_semget$d_semop" in
16400 *"$undef"*) h_sem=false;;
16404 case "`ipcs 2>&1`" in
16405 "SVID messages"*"not configured"*)
16406 echo "Your $osname does not have the sem*(2) configured." >&4
16409 set semctl d_semctl
16411 set semget d_semget
16419 : we could also check for sys/ipc.h ...
16420 if $h_sem && $test `./findhdr sys/sem.h`; then
16421 echo "You have the full sem*(2) library." >&4
16424 echo "You don't have the full sem*(2) library." >&4
16430 : see whether sys/sem.h defines union semun
16432 $cat > try.c <<'END'
16433 #include <sys/types.h>
16434 #include <sys/ipc.h>
16435 #include <sys/sem.h>
16436 int main () { union semun semun; semun.buf = 0; }
16439 if eval $compile; then
16440 echo "You have union semun in <sys/sem.h>." >&4
16443 echo "You do not have union semun in <sys/sem.h>." >&4
16450 : see how to do semctl IPC_STAT
16454 $cat > tryh.h <<END
16457 # define S_IRUSR S_IREAD
16458 # define S_IWUSR S_IWRITE
16459 # define S_IXUSR S_IEXEC
16461 # define S_IRUSR 0400
16462 # define S_IWUSR 0200
16463 # define S_IXUSR 0100
16465 # define S_IRGRP (S_IRUSR>>3)
16466 # define S_IWGRP (S_IWUSR>>3)
16467 # define S_IXGRP (S_IXUSR>>3)
16468 # define S_IROTH (S_IRUSR>>6)
16469 # define S_IWOTH (S_IWUSR>>6)
16470 # define S_IXOTH (S_IXUSR>>6)
16473 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16474 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16475 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16478 : see whether semctl IPC_STAT can use union semun
16479 case "$d_semctl_semun" in
16483 #include <sys/types.h>
16484 #include <sys/ipc.h>
16485 #include <sys/sem.h>
16486 #include <sys/stat.h>
16493 #$d_union_semun HAS_UNION_SEMUN
16496 #ifndef HAS_UNION_SEMUN
16499 struct semid_ds *buf;
16500 unsigned short *array;
16506 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16507 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16509 struct semid_ds argbuf;
16512 st = semctl(sem, 0, IPC_STAT, arg);
16516 # endif /* IPC_STAT */
16517 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16519 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16520 # endif /* IPC_RMID */
16521 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16523 #endif /* IPC_PRIVATE && ... */
16524 printf("semget failed: errno = %d\n", errno);
16529 if eval $compile; then
16532 semun) val="$define" ;;
16540 case "$d_semctl_semun" in
16542 echo "You can use union semun for semctl IPC_STAT." >&4
16545 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16550 : see whether semctl IPC_STAT can use struct semid_ds pointer
16551 case "$d_semctl_semid_ds" in
16554 $cat > try.c <<'END'
16555 #include <sys/types.h>
16556 #include <sys/ipc.h>
16557 #include <sys/sem.h>
16558 #include <sys/stat.h>
16566 struct semid_ds arg;
16569 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16570 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16573 st = semctl(sem, 0, IPC_STAT, &arg);
16575 printf("semid_ds\n");
16577 # endif /* IPC_STAT */
16578 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16580 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16581 # endif /* IPC_RMID */
16582 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16584 #endif /* IPC_PRIVATE && ... */
16585 printf("semget failed: errno = %d\n", errno);
16591 if eval $compile; then
16594 semid_ds) val="$define" ;;
16598 set d_semctl_semid_ds
16602 case "$d_semctl_semid_ds" in
16604 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16606 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16612 # We do not have the full sem*(2) library, so assume we can not
16618 set d_semctl_semid_ds
16624 : see if sendmsg exists
16625 set sendmsg d_sendmsg
16628 : see if setegid exists
16629 set setegid d_setegid
16632 : see if seteuid exists
16633 set seteuid d_seteuid
16636 : see if setgrent exists
16637 set setgrent d_setgrent
16640 : see if setgrent_r exists
16641 set setgrent_r d_setgrent_r
16643 case "$d_setgrent_r" in
16645 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16646 case "$d_setgrent_r_proto:$usethreads" in
16647 ":define") d_setgrent_r_proto=define
16648 set d_setgrent_r_proto setgrent_r $hdrs
16652 case "$d_setgrent_r_proto" in
16654 case "$setgrent_r_proto" in
16655 ''|0) try='int setgrent_r(FILE**);'
16656 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16658 case "$setgrent_r_proto" in
16659 ''|0) try='void setgrent_r(FILE**);'
16660 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16662 case "$setgrent_r_proto" in
16663 ''|0) d_setgrent_r=undef
16665 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16666 * ) case "$setgrent_r_proto" in
16667 REENTRANT_PROTO*) ;;
16668 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16670 echo "Prototype: $try" ;;
16673 *) case "$usethreads" in
16674 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16681 *) setgrent_r_proto=0
16685 : see if sethostent exists
16686 set sethostent d_sethent
16689 : see if sethostent_r exists
16690 set sethostent_r d_sethostent_r
16692 case "$d_sethostent_r" in
16694 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16695 case "$d_sethostent_r_proto:$usethreads" in
16696 ":define") d_sethostent_r_proto=define
16697 set d_sethostent_r_proto sethostent_r $hdrs
16701 case "$d_sethostent_r_proto" in
16703 case "$sethostent_r_proto" in
16704 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16705 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16707 case "$sethostent_r_proto" in
16708 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16709 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16711 case "$sethostent_r_proto" in
16712 ''|0) d_sethostent_r=undef
16713 sethostent_r_proto=0
16714 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16715 * ) case "$sethostent_r_proto" in
16716 REENTRANT_PROTO*) ;;
16717 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16719 echo "Prototype: $try" ;;
16722 *) case "$usethreads" in
16723 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16725 d_sethostent_r=undef
16726 sethostent_r_proto=0
16730 *) sethostent_r_proto=0
16734 : see if setitimer exists
16735 set setitimer d_setitimer
16738 : see if setlinebuf exists
16739 set setlinebuf d_setlinebuf
16742 : see if setlocale exists
16743 set setlocale d_setlocale
16746 : see if locale.h is available
16747 set locale.h i_locale
16750 : see if setlocale_r exists
16751 set setlocale_r d_setlocale_r
16753 case "$d_setlocale_r" in
16755 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16756 case "$d_setlocale_r_proto:$usethreads" in
16757 ":define") d_setlocale_r_proto=define
16758 set d_setlocale_r_proto setlocale_r $hdrs
16762 case "$d_setlocale_r_proto" in
16764 case "$setlocale_r_proto" in
16765 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16766 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16768 case "$setlocale_r_proto" in
16769 ''|0) d_setlocale_r=undef
16770 setlocale_r_proto=0
16771 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16772 * ) case "$setlocale_r_proto" in
16773 REENTRANT_PROTO*) ;;
16774 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16776 echo "Prototype: $try" ;;
16779 *) case "$usethreads" in
16780 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16782 d_setlocale_r=undef
16783 setlocale_r_proto=0
16787 *) setlocale_r_proto=0
16791 : see if setnetent exists
16792 set setnetent d_setnent
16795 : see if setnetent_r exists
16796 set setnetent_r d_setnetent_r
16798 case "$d_setnetent_r" in
16800 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16801 case "$d_setnetent_r_proto:$usethreads" in
16802 ":define") d_setnetent_r_proto=define
16803 set d_setnetent_r_proto setnetent_r $hdrs
16807 case "$d_setnetent_r_proto" in
16809 case "$setnetent_r_proto" in
16810 ''|0) try='int setnetent_r(int, struct netent_data*);'
16811 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16813 case "$setnetent_r_proto" in
16814 ''|0) try='void setnetent_r(int, struct netent_data*);'
16815 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16817 case "$setnetent_r_proto" in
16818 ''|0) d_setnetent_r=undef
16819 setnetent_r_proto=0
16820 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16821 * ) case "$setnetent_r_proto" in
16822 REENTRANT_PROTO*) ;;
16823 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16825 echo "Prototype: $try" ;;
16828 *) case "$usethreads" in
16829 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16831 d_setnetent_r=undef
16832 setnetent_r_proto=0
16836 *) setnetent_r_proto=0
16840 : see if setprotoent exists
16841 set setprotoent d_setpent
16844 : see if setpgid exists
16845 set setpgid d_setpgid
16848 : see if setpgrp2 exists
16849 set setpgrp2 d_setpgrp2
16852 : see if setpriority exists
16853 set setpriority d_setprior
16856 : see if setproctitle exists
16857 set setproctitle d_setproctitle
16860 : see if setprotoent_r exists
16861 set setprotoent_r d_setprotoent_r
16863 case "$d_setprotoent_r" in
16865 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16866 case "$d_setprotoent_r_proto:$usethreads" in
16867 ":define") d_setprotoent_r_proto=define
16868 set d_setprotoent_r_proto setprotoent_r $hdrs
16872 case "$d_setprotoent_r_proto" in
16874 case "$setprotoent_r_proto" in
16875 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16876 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16878 case "$setprotoent_r_proto" in
16879 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16880 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16882 case "$setprotoent_r_proto" in
16883 ''|0) d_setprotoent_r=undef
16884 setprotoent_r_proto=0
16885 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16886 * ) case "$setprotoent_r_proto" in
16887 REENTRANT_PROTO*) ;;
16888 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16890 echo "Prototype: $try" ;;
16893 *) case "$usethreads" in
16894 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16896 d_setprotoent_r=undef
16897 setprotoent_r_proto=0
16901 *) setprotoent_r_proto=0
16905 : see if setpwent exists
16906 set setpwent d_setpwent
16909 : see if setpwent_r exists
16910 set setpwent_r d_setpwent_r
16912 case "$d_setpwent_r" in
16914 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16915 case "$d_setpwent_r_proto:$usethreads" in
16916 ":define") d_setpwent_r_proto=define
16917 set d_setpwent_r_proto setpwent_r $hdrs
16921 case "$d_setpwent_r_proto" in
16923 case "$setpwent_r_proto" in
16924 ''|0) try='int setpwent_r(FILE**);'
16925 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16927 case "$setpwent_r_proto" in
16928 ''|0) try='void setpwent_r(FILE**);'
16929 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16931 case "$setpwent_r_proto" in
16932 ''|0) d_setpwent_r=undef
16934 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16935 * ) case "$setpwent_r_proto" in
16936 REENTRANT_PROTO*) ;;
16937 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16939 echo "Prototype: $try" ;;
16942 *) case "$usethreads" in
16943 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16950 *) setpwent_r_proto=0
16954 : see if setregid exists
16955 set setregid d_setregid
16957 set setresgid d_setresgid
16960 : see if setreuid exists
16961 set setreuid d_setreuid
16963 set setresuid d_setresuid
16966 : see if setrgid exists
16967 set setrgid d_setrgid
16970 : see if setruid exists
16971 set setruid d_setruid
16974 : see if setservent exists
16975 set setservent d_setsent
16978 : see if setservent_r exists
16979 set setservent_r d_setservent_r
16981 case "$d_setservent_r" in
16983 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16984 case "$d_setservent_r_proto:$usethreads" in
16985 ":define") d_setservent_r_proto=define
16986 set d_setservent_r_proto setservent_r $hdrs
16990 case "$d_setservent_r_proto" in
16992 case "$setservent_r_proto" in
16993 ''|0) try='int setservent_r(int, struct servent_data*);'
16994 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16996 case "$setservent_r_proto" in
16997 ''|0) try='void setservent_r(int, struct servent_data*);'
16998 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17000 case "$setservent_r_proto" in
17001 ''|0) d_setservent_r=undef
17002 setservent_r_proto=0
17003 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17004 * ) case "$setservent_r_proto" in
17005 REENTRANT_PROTO*) ;;
17006 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17008 echo "Prototype: $try" ;;
17011 *) case "$usethreads" in
17012 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17014 d_setservent_r=undef
17015 setservent_r_proto=0
17019 *) setservent_r_proto=0
17023 : see if setsid exists
17024 set setsid d_setsid
17027 : see if setvbuf exists
17028 set setvbuf d_setvbuf
17031 : see if sfio.h is available
17035 : see if sfio library is available
17046 : Ok, but do we want to use it.
17050 true|$define|[yY]*) dflt='y';;
17053 echo "$package can use the sfio library, but it is experimental."
17054 case "$useperlio" in
17056 echo "For sfio also the PerlIO abstraction layer is needed."
17057 echo "Earlier you said you wouldn't want that."
17060 rp="You seem to have sfio available, do you want to try using it?"
17063 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17064 useperlio="$define"
17067 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17072 *) case "$usesfio" in
17073 true|$define|[yY]*)
17074 echo "Sorry, cannot find sfio on this machine." >&4
17075 echo "Ignoring your setting of usesfio=$usesfio." >&4
17084 $define) usesfio='true';;
17085 *) usesfio='false';;
17089 *) : Remove sfio from list of libraries to use
17092 echo "Removing unneeded -lsfio from library list" >&4
17093 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17096 echo "libs = $libs" >&4
17103 : see if shmctl exists
17104 set shmctl d_shmctl
17107 : see if shmget exists
17108 set shmget d_shmget
17111 : see if shmat exists
17114 : see what shmat returns
17117 $cat >shmat.c <<'END'
17118 #include <sys/shm.h>
17121 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17126 echo "and it returns ($shmattype)." >&4
17127 : see if a prototype for shmat is available
17128 xxx=`./findhdr sys/shm.h`
17129 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17130 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17141 set d_shmatprototype
17144 : see if shmdt exists
17148 : see how much of the 'shm*(2)' library is present.
17151 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17152 *"$undef"*) h_shm=false;;
17156 case "`ipcs 2>&1`" in
17157 "SVID shared memory"*"not configured"*)
17158 echo "Your $osname does not have the shm*(2) configured." >&4
17161 set shmctl d_shmctl
17163 set shmget d_shmget
17173 : we could also check for sys/ipc.h ...
17174 if $h_shm && $test `./findhdr sys/shm.h`; then
17175 echo "You have the full shm*(2) library." >&4
17178 echo "You don't have the full shm*(2) library." >&4
17184 : see if we have sigaction
17186 if set sigaction val -f d_sigaction; eval $csym; $val; then
17187 echo 'sigaction() found.' >&4
17190 #include <sys/types.h>
17191 #include <signal.h>
17192 #$i_stdlib I_STDLIB
17194 #include <stdlib.h>
17198 struct sigaction act, oact;
17200 oact.sa_handler = 0;
17201 /* so that act and oact are used */
17202 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17206 if eval $compile_ok; then
17209 echo "But you don't seem to have a useable struct sigaction." >&4
17213 echo 'sigaction NOT found.' >&4
17216 set d_sigaction; eval $setvar
17219 : see if this is a sunmath.h system
17220 set sunmath.h i_sunmath
17223 : see if signbit exists
17224 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17227 #$i_sunmath I_SUNMATH
17231 #ifdef I_SUNMATH /* Solaris special math library */
17232 # include <sunmath.h>
17235 int main(int argc, char **argv)
17239 if ((signbit(x) == 0) && (signbit(y) != 0))
17247 if eval $compile; then
17248 if $run ./try; then
17252 $echo "Signbit seems to be available, but doesn't work as I expected."
17253 $echo "I won't use it." >&4
17264 : see if sigprocmask exists
17265 set sigprocmask d_sigprocmask
17268 : see if sigsetjmp exists
17270 case "$d_sigsetjmp" in
17273 #include <setjmp.h>
17274 #$i_stdlib I_STDLIB
17276 #include <stdlib.h>
17282 if (sigsetjmp(env,1))
17285 siglongjmp(env, 1);
17290 if eval $compile; then
17291 if $run ./try >/dev/null 2>&1; then
17292 echo "POSIX sigsetjmp found." >&4
17296 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17302 echo "sigsetjmp not found." >&4
17306 *) val="$d_sigsetjmp"
17307 case "$d_sigsetjmp" in
17308 $define) echo "POSIX sigsetjmp found." >&4;;
17309 $undef) echo "sigsetjmp not found." >&4;;
17317 : see if snprintf exists
17318 set snprintf d_snprintf
17321 : see if vsnprintf exists
17322 set vsnprintf d_vsnprintf
17325 case "$d_snprintf-$d_vsnprintf" in
17328 Checking whether your snprintf() and vsnprintf() work okay...
17330 $cat >try.c <<'EOCP'
17331 /* v?snprintf testing logic courtesy of Russ Allbery.
17332 * According to C99:
17333 * - if the buffer is too short it still must be \0-terminated
17334 * - if the buffer is too short the potentially required length
17335 * must be returned and not -1
17336 * - if the buffer is NULL the potentially required length
17337 * must be returned and not -1 or core dump
17340 #include <stdarg.h>
17344 int test (char *format, ...)
17349 va_start (args, format);
17350 count = vsnprintf (buf, sizeof buf, format, args);
17357 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17358 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17362 if eval $compile; then
17365 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17367 Your snprintf() and snprintf() don't seem to be working okay.
17369 d_snprintf="$undef"
17370 d_vsnprintf="$undef"
17374 echo "(I can't seem to compile the test program--assuming they don't)"
17375 d_snprintf="$undef"
17376 d_vsnprintf="$undef"
17382 : see if sockatmark exists
17383 set sockatmark d_sockatmark
17386 : see if prototype for sockatmark is available
17388 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17391 : see if socks5_init exists
17392 set socks5_init d_socks5_init
17395 : see if sprintf returns the length of the string in the buffer as per ANSI
17396 $echo "Checking whether sprintf returns the length of the string..." >&4
17399 #$i_stdlib I_STDLIB
17401 #include <stdlib.h>
17403 #$i_string I_STRING
17405 # include <string.h>
17407 # include <strings.h>
17416 int check (size_t expect, int test) {
17417 size_t got = strlen(buffer);
17421 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17426 int main(int argc, char **argv) {
17429 check(sprintf(buffer, ""), ++test);
17430 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17431 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17438 d_sprintf_returns_strlen="$undef"
17439 if eval $compile; then
17443 sprintf returns the length of the string (as ANSI says it should)
17445 d_sprintf_returns_strlen="$define"
17448 sprintf does not return the length of the string (how old is this system?)
17450 d_sprintf_returns_strlen="$undef"
17456 : see if srand48_r exists
17457 set srand48_r d_srand48_r
17459 case "$d_srand48_r" in
17461 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17462 case "$d_srand48_r_proto:$usethreads" in
17463 ":define") d_srand48_r_proto=define
17464 set d_srand48_r_proto srand48_r $hdrs
17468 case "$d_srand48_r_proto" in
17470 case "$srand48_r_proto" in
17471 ''|0) try='int srand48_r(long, struct drand48_data*);'
17472 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17474 case "$srand48_r_proto" in
17475 ''|0) d_srand48_r=undef
17477 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17478 * ) case "$srand48_r_proto" in
17479 REENTRANT_PROTO*) ;;
17480 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17482 echo "Prototype: $try" ;;
17485 *) case "$usethreads" in
17486 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17493 *) srand48_r_proto=0
17497 : see if srandom_r exists
17498 set srandom_r d_srandom_r
17500 case "$d_srandom_r" in
17502 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17503 case "$d_srandom_r_proto:$usethreads" in
17504 ":define") d_srandom_r_proto=define
17505 set d_srandom_r_proto srandom_r $hdrs
17509 case "$d_srandom_r_proto" in
17511 case "$srandom_r_proto" in
17512 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17513 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17515 case "$srandom_r_proto" in
17516 ''|0) d_srandom_r=undef
17518 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17519 * ) case "$srandom_r_proto" in
17520 REENTRANT_PROTO*) ;;
17521 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17523 echo "Prototype: $try" ;;
17526 *) case "$usethreads" in
17527 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17534 *) srandom_r_proto=0
17538 : see if prototype for setresgid is available
17540 set d_sresgproto setresgid $i_unistd unistd.h
17543 : see if prototype for setresuid is available
17545 set d_sresuproto setresuid $i_unistd unistd.h
17548 : see if sys/stat.h is available
17549 set sys/stat.h i_sysstat
17552 : see if stat knows about block sizes
17554 echo "Checking to see if your struct stat has st_blocks field..." >&4
17555 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17558 : see if this is a sys/vfs.h system
17559 set sys/vfs.h i_sysvfs
17562 : see if this is a sys/statfs.h system
17563 set sys/statfs.h i_sysstatfs
17566 : Check for statfs_s
17568 echo "Checking to see if your system supports struct statfs..." >&4
17569 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
17571 case "$d_statfs_s" in
17572 "$define") echo "Yes, it does." ;;
17573 *) echo "No, it doesn't." ;;
17577 : see if struct statfs knows about f_flags
17578 case "$d_statfs_s" in
17581 echo "Checking to see if your struct statfs has f_flags field..." >&4
17582 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
17586 set d_statfs_f_flags
17590 case "$d_statfs_f_flags" in
17591 "$define") echo "Yes, it does." ;;
17592 *) echo "No, it doesn't." ;;
17595 : Check stream access
17597 Checking how to access stdio streams by file descriptor number...
17599 case "$stdio_stream_array" in
17600 '') $cat >try.c <<EOCP
17603 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17607 for s in _iob __iob __sF
17609 set try -DSTDIO_STREAM_ARRAY=$s
17610 if eval $compile; then
17611 case "`$run ./try`" in
17612 yes) stdio_stream_array=$s; break ;;
17618 case "$stdio_stream_array" in
17620 I can't figure out how to access stdio streams by file descriptor number.
17622 d_stdio_stream_array="$undef"
17625 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17627 d_stdio_stream_array="$define"
17631 : see if strcoll exists
17632 set strcoll d_strcoll
17635 : check for structure copying
17637 echo "Checking to see if your C compiler can copy structs..." >&4
17638 $cat >try.c <<'EOCP'
17648 if $cc -c try.c >/dev/null 2>&1 ; then
17650 echo "Yup, it can."
17653 echo "Nope, it can't."
17659 : see if strerror and/or sys_errlist[] exist
17661 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17662 if set strerror val -f d_strerror; eval $csym; $val; then
17663 echo 'strerror() found.' >&4
17664 d_strerror="$define"
17665 d_strerrm='strerror(e)'
17666 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17667 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17668 d_syserrlst="$define"
17670 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17671 d_syserrlst="$undef"
17673 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17674 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17675 echo 'strerror() found in string header.' >&4
17676 d_strerror="$define"
17677 d_strerrm='strerror(e)'
17678 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17679 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17680 d_syserrlst="$define"
17682 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17683 d_syserrlst="$undef"
17685 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17686 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17687 d_strerror="$undef"
17688 d_syserrlst="$define"
17689 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17691 echo 'strerror() and sys_errlist[] NOT found.' >&4
17692 d_strerror="$undef"
17693 d_syserrlst="$undef"
17694 d_strerrm='"unknown"'
17698 : see if strerror_r exists
17699 set strerror_r d_strerror_r
17701 case "$d_strerror_r" in
17703 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17704 case "$d_strerror_r_proto:$usethreads" in
17705 ":define") d_strerror_r_proto=define
17706 set d_strerror_r_proto strerror_r $hdrs
17710 case "$d_strerror_r_proto" in
17712 case "$strerror_r_proto" in
17713 ''|0) try='int strerror_r(int, char*, size_t);'
17714 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17716 case "$strerror_r_proto" in
17717 ''|0) try='int strerror_r(int, char*, int);'
17718 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17720 case "$strerror_r_proto" in
17721 ''|0) try='char* strerror_r(int, char*, size_t);'
17722 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17724 case "$strerror_r_proto" in
17725 ''|0) d_strerror_r=undef
17727 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17728 * ) case "$strerror_r_proto" in
17729 REENTRANT_PROTO*) ;;
17730 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17732 echo "Prototype: $try" ;;
17735 *) case "$usethreads" in
17736 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17743 *) strerror_r_proto=0
17747 : see if strftime exists
17748 set strftime d_strftime
17751 : see if strlcat exists
17752 set strlcat d_strlcat
17755 : see if strlcpy exists
17756 set strlcpy d_strlcpy
17759 : see if strtod exists
17760 set strtod d_strtod
17763 : see if strtol exists
17764 set strtol d_strtol
17767 : see if strtold exists
17768 set strtold d_strtold
17771 : see if strtoll exists
17772 set strtoll d_strtoll
17775 case "$d_longlong-$d_strtoll" in
17778 Checking whether your strtoll() works okay...
17780 $cat >try.c <<'EOCP'
17783 #define strtoll __strtoll
17786 #define strtoll _strtoll
17789 extern long long int strtoll(char *s, char **, int);
17790 static int bad = 0;
17791 int check(char *s, long long ell, int een) {
17794 gll = strtoll(s, 0, 10);
17795 if (!((gll == ell) && (errno == een)))
17799 check(" 1", 1LL, 0);
17800 check(" 0", 0LL, 0);
17801 check("-1", -1LL, 0);
17802 check("-9223372036854775808", -9223372036854775808LL, 0);
17803 check("-9223372036854775808", -9223372036854775808LL, 0);
17804 check(" 9223372036854775807", 9223372036854775807LL, 0);
17805 check("-9223372036854775808", -9223372036854775808LL, 0);
17806 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17807 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17813 if eval $compile; then
17816 ok) echo "Your strtoll() seems to be working okay." ;;
17818 Your strtoll() doesn't seem to be working okay.
17824 echo "(I can't seem to compile the test program--assuming it doesn't)"
17830 : see if strtoq exists
17831 set strtoq d_strtoq
17834 : see if strtoul exists
17835 set strtoul d_strtoul
17838 case "$d_strtoul" in
17841 Checking whether your strtoul() works okay...
17843 $cat >try.c <<'EOCP'
17846 extern unsigned long int strtoul(char *s, char **, int);
17847 static int bad = 0;
17848 void check(char *s, unsigned long eul, int een) {
17851 gul = strtoul(s, 0, 10);
17852 if (!((gul == eul) && (errno == een)))
17856 check(" 1", 1L, 0);
17857 check(" 0", 0L, 0);
17859 case "$longsize" in
17861 $cat >>try.c <<'EOCP'
17862 check("18446744073709551615", 18446744073709551615UL, 0);
17863 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17864 #if 0 /* strtoul() for /^-/ strings is undefined. */
17865 check("-1", 18446744073709551615UL, 0);
17866 check("-18446744073709551614", 2, 0);
17867 check("-18446744073709551615", 1, 0);
17868 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17869 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17874 $cat >>try.c <<'EOCP'
17875 check("4294967295", 4294967295UL, 0);
17876 check("4294967296", 4294967295UL, ERANGE);
17877 #if 0 /* strtoul() for /^-/ strings is undefined. */
17878 check("-1", 4294967295UL, 0);
17879 check("-4294967294", 2, 0);
17880 check("-4294967295", 1, 0);
17881 check("-4294967296", 4294967295UL, ERANGE);
17882 check("-4294967297", 4294967295UL, ERANGE);
17887 : Should we write these tests to be more portable by sprintf-ing
17888 : ~0 and then manipulating that char string as input for strtol?
17891 $cat >>try.c <<'EOCP'
17898 if eval $compile; then
17899 case "`$run ./try`" in
17900 ok) echo "Your strtoul() seems to be working okay." ;;
17902 Your strtoul() doesn't seem to be working okay.
17908 echo "(I can't seem to compile the test program--assuming it doesn't)"
17914 : see if strtoull exists
17915 set strtoull d_strtoull
17918 case "$d_longlong-$d_strtoull" in
17921 Checking whether your strtoull() works okay...
17923 $cat >try.c <<'EOCP'
17926 #define strtoull __strtoull
17929 extern unsigned long long int strtoull(char *s, char **, int);
17930 static int bad = 0;
17931 int check(char *s, long long eull, int een) {
17934 gull = strtoull(s, 0, 10);
17935 if (!((gull == eull) && (errno == een)))
17939 check(" 1", 1LL, 0);
17940 check(" 0", 0LL, 0);
17941 check("18446744073709551615", 18446744073709551615ULL, 0);
17942 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17943 #if 0 /* strtoull() for /^-/ strings is undefined. */
17944 check("-1", 18446744073709551615ULL, 0);
17945 check("-18446744073709551614", 2LL, 0);
17946 check("-18446744073709551615", 1LL, 0);
17947 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17948 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17955 if eval $compile; then
17956 case "`$run ./try`" in
17957 ok) echo "Your strtoull() seems to be working okay." ;;
17959 Your strtoull() doesn't seem to be working okay.
17961 d_strtoull="$undef"
17965 echo "(I can't seem to compile the test program--assuming it doesn't)"
17966 d_strtoull="$undef"
17971 : see if strtouq exists
17972 set strtouq d_strtouq
17975 case "$d_strtouq" in
17978 Checking whether your strtouq() works okay...
17980 $cat >try.c <<'EOCP'
17983 extern unsigned long long int strtouq(char *s, char **, int);
17984 static int bad = 0;
17985 void check(char *s, unsigned long long eull, int een) {
17986 unsigned long long gull;
17988 gull = strtouq(s, 0, 10);
17989 if (!((gull == eull) && (errno == een)))
17993 check(" 1", 1LL, 0);
17994 check(" 0", 0LL, 0);
17995 check("18446744073709551615", 18446744073709551615ULL, 0);
17996 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17997 #if 0 /* strtouq() for /^-/ strings is undefined. */
17998 check("-1", 18446744073709551615ULL, 0);
17999 check("-18446744073709551614", 2LL, 0);
18000 check("-18446744073709551615", 1LL, 0);
18001 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18002 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18010 if eval $compile; then
18011 case "`$run ./try`" in
18012 ok) echo "Your strtouq() seems to be working okay." ;;
18014 Your strtouq() doesn't seem to be working okay.
18020 echo "(I can't seem to compile the test program--assuming it doesn't)"
18026 : see if strxfrm exists
18027 set strxfrm d_strxfrm
18030 : see if symlink exists
18031 set symlink d_symlink
18034 : see if syscall exists
18035 set syscall d_syscall
18038 : see if prototype for syscall is available
18040 set d_syscallproto syscall $i_unistd unistd.h
18043 : see if sysconf exists
18044 set sysconf d_sysconf
18047 : see if system exists
18048 set system d_system
18051 : see if tcgetpgrp exists
18052 set tcgetpgrp d_tcgetpgrp
18055 : see if tcsetpgrp exists
18056 set tcsetpgrp d_tcsetpgrp
18059 : see if prototype for telldir is available
18061 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18064 : see if time exists
18066 if test "X$d_time" = X -o X"$timetype" = X; then
18067 if set time val -f d_time; eval $csym; $val; then
18068 echo 'time() found.' >&4
18070 rp="What is the type returned by time() on this system?"
18071 set time_t timetype long stdio.h sys/types.h
18074 echo 'time() not found, hope that will do.' >&4
18082 : see if this is a sys/times.h system
18083 set sys/times.h i_systimes
18086 : see if times exists
18088 if set times val -f d_times; eval $csym; $val; then
18089 echo 'times() found.' >&4
18092 case "$i_systimes" in
18093 "$define") inc='sys/times.h';;
18095 rp="What is the type returned by times() on this system?"
18096 set clock_t clocktype long stdio.h sys/types.h $inc
18099 echo 'times() NOT found, hope that will do.' >&4
18104 : see if tmpnam_r exists
18105 set tmpnam_r d_tmpnam_r
18107 case "$d_tmpnam_r" in
18109 hdrs="$i_systypes sys/types.h define stdio.h "
18110 case "$d_tmpnam_r_proto:$usethreads" in
18111 ":define") d_tmpnam_r_proto=define
18112 set d_tmpnam_r_proto tmpnam_r $hdrs
18116 case "$d_tmpnam_r_proto" in
18118 case "$tmpnam_r_proto" in
18119 ''|0) try='char* tmpnam_r(char*);'
18120 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18122 case "$tmpnam_r_proto" in
18123 ''|0) d_tmpnam_r=undef
18125 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18126 * ) case "$tmpnam_r_proto" in
18127 REENTRANT_PROTO*) ;;
18128 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18130 echo "Prototype: $try" ;;
18133 *) case "$usethreads" in
18134 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18141 *) tmpnam_r_proto=0
18145 : see if truncate exists
18146 set truncate d_truncate
18149 : see if ttyname_r exists
18150 set ttyname_r d_ttyname_r
18152 case "$d_ttyname_r" in
18154 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18155 case "$d_ttyname_r_proto:$usethreads" in
18156 ":define") d_ttyname_r_proto=define
18157 set d_ttyname_r_proto ttyname_r $hdrs
18161 case "$d_ttyname_r_proto" in
18163 case "$ttyname_r_proto" in
18164 ''|0) try='int ttyname_r(int, char*, size_t);'
18165 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18167 case "$ttyname_r_proto" in
18168 ''|0) try='int ttyname_r(int, char*, int);'
18169 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18171 case "$ttyname_r_proto" in
18172 ''|0) try='char* ttyname_r(int, char*, int);'
18173 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18175 case "$ttyname_r_proto" in
18176 ''|0) d_ttyname_r=undef
18178 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18179 * ) case "$ttyname_r_proto" in
18180 REENTRANT_PROTO*) ;;
18181 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18183 echo "Prototype: $try" ;;
18186 *) case "$usethreads" in
18187 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18194 *) ttyname_r_proto=0
18198 : see if tzname[] exists
18200 if set tzname val -a d_tzname; eval $csym; $val; then
18202 echo 'tzname[] found.' >&4
18205 echo 'tzname[] NOT found.' >&4
18210 : Check if is a multiplatform env
18212 next|rhapsody|darwin) multiarch="$define" ;;
18214 case "$multiarch" in
18215 ''|[nN]*) multiarch="$undef" ;;
18218 : check for ordering of bytes in a UV
18220 case "$usecrosscompile$multiarch" in
18223 You seem to be either cross-compiling or doing a multiarchitecture build,
18224 skipping the byteorder check.
18230 case "$byteorder" in
18233 In the following, larger digits indicate more significance. A big-endian
18234 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18235 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18236 machines may have weird orders like 3412. A Cray will report 87654321,
18237 an Alpha will report 12345678. If the test program works the default is
18239 I'm now running the test program...
18243 #$i_stdlib I_STDLIB
18245 #include <stdlib.h>
18247 #include <sys/types.h>
18248 typedef $uvtype UV;
18258 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18260 u.l = (UV)0x04030201;
18261 for (i = 0; i < $uvsize; i++)
18262 printf("%c", u.c[i]+'0');
18269 if eval $compile && $run ./try > /dev/null; then
18272 [1-4][1-4][1-4][1-4]|12345678|87654321)
18273 echo "(The test program ran ok.)"
18274 echo "byteorder=$dflt"
18277 ????|????????) echo "(The test program ran ok.)" ;;
18278 *) echo "(The test program didn't run right for some reason.)" ;;
18283 (I can't seem to compile the test program. Guessing big-endian...)
18286 case "$xxx_prompt" in
18288 rp="What is the order of bytes in $uvtype?"
18301 : Checking 32bit aligndness
18304 Checking to see whether you can access character data unalignedly...
18306 case "$d_u32align" in
18307 '') $cat >try.c <<EOCP
18309 #$i_stdlib I_STDLIB
18311 #include <stdlib.h>
18313 #define U32 $u32type
18314 #define BYTEORDER 0x$byteorder
18316 #include <signal.h>
18318 $signal_t bletch(int s) { exit(4); }
18321 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18326 if (sizeof(U32) != 4) {
18327 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18334 signal(SIGBUS, bletch);
18346 for (i = 0; i < 4; i++) {
18347 up = (U32*)(buf + i);
18348 if (! ((*up == 1 << (8*i)) || /* big-endian */
18349 (*up == 1 << (8*(3-i))) /* little-endian */
18353 printf("read failed (%x)\n", *up);
18359 for (i = 0; i < 4; i++) {
18360 up = (U32*)(buf + i);
18362 if (*up != 0xBeef) {
18363 printf("write failed (%x)\n", *up);
18377 if eval $compile_ok; then
18378 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18379 $run ./try 2>&1 >/dev/null
18382 You can access character data pretty unalignedly.
18384 d_u32align="$undef"
18387 It seems that you must access character data in an aligned manner.
18389 d_u32align="$define"
18393 rp='Can you access character data at unaligned addresses?'
18397 [yY]*) d_u32align="$undef" ;;
18398 *) d_u32align="$define" ;;
18405 : see if ualarm exists
18406 set ualarm d_ualarm
18409 : see if umask exists
18413 : see if unordered exists
18414 set unordered d_unordered
18417 : see if unsetenv exists
18418 set unsetenv d_unsetenv
18421 : see if usleep exists
18422 set usleep d_usleep
18425 : see if prototype for usleep is available
18427 set d_usleepproto usleep $i_unistd unistd.h
18430 : see if ustat exists
18434 : see if closedir exists
18435 set closedir d_closedir
18438 case "$d_closedir" in
18441 echo "Checking whether closedir() returns a status..." >&4
18443 #$i_dirent I_DIRENT /**/
18444 #$i_sysdir I_SYS_DIR /**/
18445 #$i_sysndir I_SYS_NDIR /**/
18446 #$i_systypes I_SYS_TYPES /**/
18448 #if defined(I_SYS_TYPES)
18449 #include <sys/types.h>
18451 #if defined(I_DIRENT)
18452 #include <dirent.h>
18453 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18454 #include <sys/dir.h>
18458 #include <sys/ndir.h>
18462 #include <ndir.h> /* may be wrong in the future */
18464 #include <sys/dir.h>
18469 int main() { return closedir(opendir(".")); }
18472 if eval $compile_ok; then
18473 if $run ./try > /dev/null 2>&1 ; then
18474 echo "Yes, it does."
18477 echo "No, it doesn't."
18481 echo "(I can't seem to compile the test program--assuming it doesn't)"
18489 set d_void_closedir
18493 : see if there is a wait4
18497 : see if waitpid exists
18498 set waitpid d_waitpid
18501 : see if wcstombs exists
18502 set wcstombs d_wcstombs
18505 : see if wctomb exists
18506 set wctomb d_wctomb
18509 : see if writev exists
18510 set writev d_writev
18513 : preserve RCS keywords in files with variable substitution, grrr
18518 Revision='$Revision'
18520 : check for alignment requirements
18522 case "$usecrosscompile$multiarch" in
18525 You seem to be either cross-compiling or doing a multiarchitecture build,
18526 skipping the memory alignment check.
18529 case "$alignbytes" in
18530 '') alignbytes=8 ;;
18534 case "$alignbytes" in
18535 '') echo "Checking alignment constraints..." >&4
18536 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18537 $cat >try.c <<'EOCP'
18538 typedef long double NV;
18541 $cat >try.c <<'EOCP'
18545 $cat >>try.c <<'EOCP'
18553 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18558 if eval $compile_ok; then
18562 echo "(I can't seem to compile the test program...)"
18565 *) dflt="$alignbytes"
18568 rp="Doubles must be aligned on a how-many-byte boundary?"
18576 : set the base revision
18579 : how do we concatenate cpp tokens here?
18581 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18582 $cat >cpp_stuff.c <<'EOCP'
18583 #define RCAT(a,b)a/**/b
18584 #define ACAT(a,b)a ## b
18588 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18589 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18590 echo "Oh! Smells like ANSI's been here." >&4
18591 echo "We can catify or stringify, separately or together!"
18593 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18594 echo "Ah, yes! The good old days!" >&4
18595 echo "However, in the good old days we don't know how to stringify and"
18596 echo "catify at the same time."
18600 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18601 You're going to have to edit the values of CAT[2-5] in config.h...
18603 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18607 : see if this is a db.h system
18613 : Check db version.
18615 echo "Checking Berkeley DB version ..." >&4
18621 #include <sys/types.h>
18623 #$i_stdlib I_STDLIB
18625 #include <stdlib.h>
18628 int main(int argc, char *argv[])
18630 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18631 int Major, Minor, Patch ;
18632 unsigned long Version ;
18633 (void)db_version(&Major, &Minor, &Patch) ;
18635 printf("%d %d %d %d %d %d\n",
18636 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18637 Major, Minor, Patch);
18640 printf("You have Berkeley DB Version 2 or greater.\n");
18642 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18643 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18644 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18645 Major, Minor, Patch) ;
18647 /* check that db.h & libdb are compatible */
18648 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18649 printf("db.h and libdb are incompatible.\n") ;
18653 printf("db.h and libdb are compatible.\n") ;
18655 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18656 + DB_VERSION_PATCH ;
18658 /* needs to be >= 2.3.4 */
18659 if (Version < 2003004) {
18660 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18661 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18667 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18672 printf("You have Berkeley DB Version 1.\n");
18673 exit(0); /* DB version < 2: the coast is clear. */
18675 exit(1); /* <db.h> not Berkeley DB? */
18681 if eval $compile_ok && $run ./try; then
18682 echo 'Looks OK.' >&4
18684 db_version_major=$1
18685 db_version_minor=$2
18686 db_version_patch=$3
18688 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18692 : Remove db from list of libraries to use
18693 echo "Removing unusable -ldb from library list" >&4
18694 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18697 echo "libs = $libs" >&4
18707 : Check the return type needed for hash
18709 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18715 #include <sys/types.h>
18718 #ifndef DB_VERSION_MAJOR
18719 u_int32_t hash_cb (ptr, size)
18727 info.hash = hash_cb;
18731 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18732 if $contains warning try.out >>/dev/null 2>&1 ; then
18735 db_hashtype='u_int32_t'
18738 : XXX Maybe we should just give up here.
18739 db_hashtype=u_int32_t
18741 echo "Help: I can't seem to compile the db test program." >&4
18742 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18745 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18747 *) db_hashtype=u_int32_t
18752 : Check the return type needed for prefix
18754 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18760 #include <sys/types.h>
18763 #ifndef DB_VERSION_MAJOR
18764 size_t prefix_cb (key1, key2)
18772 info.prefix = prefix_cb;
18776 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18777 if $contains warning try.out >>/dev/null 2>&1 ; then
18778 db_prefixtype='int'
18780 db_prefixtype='size_t'
18783 db_prefixtype='size_t'
18784 : XXX Maybe we should just give up here.
18786 echo "Help: I can't seem to compile the db test program." >&4
18787 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18790 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18792 *) db_prefixtype='size_t'
18796 : How can we generate normalized random numbers ?
18798 echo "Looking for a random number function..." >&4
18799 case "$randfunc" in
18801 if set drand48 val -f; eval $csym; $val; then
18803 echo "Good, found drand48()." >&4
18804 elif set random val -f; eval $csym; $val; then
18806 echo "OK, found random()." >&4
18809 echo "Yick, looks like I have to use rand()." >&4
18820 *-Dmy_rand=*|*-Dmy_srand=*)
18821 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18822 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18823 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18824 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18828 while $test "$cont"; do
18829 rp="Use which function to generate random numbers?"
18831 if $test "$ans" = "$dflt"; then
18837 if set $ans val -f; eval $csym; $val; then
18841 rp="I cannot find function $ans. Use that name anyway?"
18850 case "$randfunc" in
18852 drand01="drand48()"
18858 case "$randbits" in
18860 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18862 #$i_unistd I_UNISTD
18863 #$i_stdlib I_STDLIB
18866 # include <unistd.h>
18869 # include <stdlib.h>
18874 register unsigned long tmp;
18875 register unsigned long max = 0L;
18877 for (i = 1000; i; i--) {
18878 tmp = (unsigned long) $randfunc();
18879 if (tmp > max) max = tmp;
18881 for (i = 0; max; i++)
18887 if eval $compile_ok; then
18891 echo "(I can't seem to compile the test program...)"
18898 rp="How many bits does your $randfunc() function produce?"
18902 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18903 seedfunc="s$randfunc"
18904 randseedtype=unsigned
18908 rp="How many bits does your $randfunc() function produce?"
18911 seedfunc="s$randfunc"
18912 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18913 if set $seedfunc val -f; eval $csym; $val; then
18914 echo "(Using $seedfunc() to seed random generator)"
18916 echo "(Warning: no $seedfunc() to seed random generator)"
18919 randseedtype=unsigned
18926 : Determine if this is an EBCDIC system
18928 echo "Determining whether or not we are on an EBCDIC system..." >&4
18929 $cat >try.c <<'EOM'
18932 if ('M'==0xd4) return 0;
18939 if eval $compile_ok; then
18940 if $run ./try; then
18941 echo "You seem to speak EBCDIC." >&4
18944 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18947 echo "I'm unable to compile the test program." >&4
18948 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18954 : Check how to flush
18957 Checking how to flush all pending stdio output...
18959 # I only know how to find the first 32 possibly open files on SunOS.
18960 # See also hints/sunos_4_1.sh and util.c --AD
18962 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18964 $cat >>try.c <<EOCP
18966 #$i_stdlib I_STDLIB
18968 #include <stdlib.h>
18970 #$i_unistd I_UNISTD
18972 # include <unistd.h>
18974 #$d_sysconf HAS_SYSCONF
18975 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18976 #ifdef HAS_STDIO_STREAM_ARRAY
18977 # define STDIO_STREAM_ARRAY $stdio_stream_array
18982 p = fopen("try.out", "w");
18986 # ifdef TRY_FPRINTF
18990 #ifdef TRY_FFLUSH_NULL
18993 #ifdef TRY_FFLUSH_ALL
18995 long open_max = -1;
18996 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18997 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18999 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19000 open_max = sysconf(_SC_OPEN_MAX);
19003 open_max = FOPEN_MAX;
19006 open_max = OPEN_MAX;
19015 # ifdef HAS_STDIO_STREAM_ARRAY
19016 if (open_max > 0) {
19018 for (i = 0; i < open_max; i++)
19019 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19020 STDIO_STREAM_ARRAY[i]._file < open_max &&
19021 STDIO_STREAM_ARRAY[i]._flag)
19022 fflush(&STDIO_STREAM_ARRAY[i]);
19030 : first we have to find out how _not_ to flush
19032 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19034 set try -DTRY_FPUTC
19035 if eval $compile; then
19036 $run ./try 2>/dev/null
19039 if $test ! -s try.out -a "X$code" = X42; then
19045 set try -DTRY_FPRINTF
19046 if eval $compile; then
19047 $run ./try 2>/dev/null
19050 if $test ! -s try.out -a "X$code" = X42; then
19051 output=-DTRY_FPRINTF
19057 : check for fflush NULL behaviour
19058 case "$fflushNULL" in
19059 '') set try -DTRY_FFLUSH_NULL $output
19060 if eval $compile; then
19061 $run ./try 2>/dev/null
19064 if $test -s try.out -a "X$code" = X42; then
19065 fflushNULL="`$cat try.out`"
19067 if $test "X$code" != X42; then
19069 (If this test failed, don't worry, we'll try another method shortly.)
19075 case "$fflushNULL" in
19077 Your fflush(NULL) works okay for output streams.
19078 Let's see if it clobbers input pipes...
19080 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19081 # bug that improperly flushes the input end of pipes. So we avoid the
19082 # autoflush on fork/system/exec support for now. :-(
19083 $cat >tryp.c <<EOCP
19086 main(int argc, char **argv)
19092 while ((i = getc(stdin)) != -1
19093 && (*bp++ = i) != '\n'
19094 && bp < &buf[1024])
19097 fprintf(stdout, "%s", buf);
19105 fflushNULL="$define"
19107 if eval $compile; then
19109 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19110 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19112 fflush(NULL) seems to behave okay with input streams.
19114 fflushNULL="$define"
19117 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19119 fflushNULL="$undef"
19122 $rm -f core tryp.c tryp.core core.tryp.*
19125 Your fflush(NULL) isn't working (contrary to ANSI C).
19127 fflushNULL="$undef"
19130 Cannot figure out whether your fflush(NULL) works or not.
19131 I'm assuming it doesn't (contrary to ANSI C).
19133 fflushNULL="$undef"
19137 $define|true|[yY]*)
19138 fflushNULL="$define"
19141 fflushNULL="$undef"
19144 : check explicit looping only if NULL did not work, and if the pipe
19145 : bug does not show up on an explicit flush too
19146 case "$fflushNULL" in
19148 $cat >tryp.c <<EOCP
19151 main(int argc, char **argv)
19157 while ((i = getc(stdin)) != -1
19158 && (*bp++ = i) != '\n'
19159 && bp < &buf[1024])
19162 fprintf(stdout, "%s", buf);
19171 if eval $compile; then
19173 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19174 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19176 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19178 : now check for fflushall behaviour
19179 case "$fflushall" in
19180 '') set try -DTRY_FFLUSH_ALL $output
19181 if eval $compile; then
19183 (Now testing the other method--but note that this also may fail.)
19185 $run ./try 2>/dev/null
19188 if $test -s try.out -a "X$code" = X42; then
19189 fflushall="`$cat try.out`"
19193 case "$fflushall" in
19195 Whew. Flushing explicitly all the stdio streams works.
19197 fflushall="$define"
19200 Sigh. Flushing explicitly all the stdio streams doesn't work.
19205 Cannot figure out whether flushing stdio streams explicitly works or not.
19206 I'm assuming it doesn't.
19212 "$define"|true|[yY]*)
19213 fflushall="$define"
19221 All is futile. Even fflush(stdin) clobbers input pipes!
19228 $rm -f core tryp.c tryp.core core.tryp.*
19230 *) fflushall="$undef"
19234 case "$fflushNULL$fflushall" in
19237 OK, I give up. I cannot figure out how to flush pending stdio output.
19238 We won't be flushing handles at all before fork/exec/popen.
19244 : Store the full pathname to the ar program for use in the C program
19245 : Respect a hint or command line value for full_ar.
19250 : Store the full pathname to the sed program for use in the C program
19253 : see what type gids are declared as in the kernel
19255 echo "Looking for the type for group ids returned by getgid()."
19256 set gid_t gidtype xxx stdio.h sys/types.h
19260 xxx=`./findhdr sys/user.h`
19261 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19263 unsigned) dflt="$1 $2" ;;
19267 *) dflt="$gidtype";;
19270 gid_t) echo "gid_t found." ;;
19271 *) rp="What is the type for group ids returned by getgid()?"
19277 : Check the size of GID
19280 *_t) zzz="$gidtype" ;;
19283 echo "Checking the size of $zzz..." >&4
19285 #include <sys/types.h>
19287 #$i_stdlib I_STDLIB
19289 #include <stdlib.h>
19292 printf("%d\n", (int)sizeof($gidtype));
19297 if eval $compile_ok; then
19301 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19304 echo "Your $zzz is $gidsize bytes long."
19309 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19313 : Check if GID is signed
19316 *_t) zzz="$gidtype" ;;
19319 echo "Checking the sign of $zzz..." >&4
19321 #include <sys/types.h>
19332 if eval $compile; then
19336 echo "(I can't execute the test program--guessing unsigned.)" >&4
19340 1) echo "Your $zzz is unsigned." ;;
19341 -1) echo "Your $zzz is signed." ;;
19347 echo "(I can't compile the test program--guessing unsigned.)" >&4
19351 : Check 64bit sizes
19354 if $test X"$quadtype" != X; then
19356 echo "Checking how to print 64-bit integers..." >&4
19358 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19359 $cat >try.c <<'EOCP'
19360 #include <sys/types.h>
19363 int q = 12345678901;
19364 printf("%ld\n", q);
19368 if eval $compile; then
19372 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19373 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19374 echo "We will use %d."
19380 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19381 $cat >try.c <<'EOCP'
19382 #include <sys/types.h>
19385 long q = 12345678901;
19386 printf("%ld\n", q);
19390 if eval $compile; then
19394 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19395 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19396 echo "We will use %ld."
19402 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19403 $cat >try.c <<'EOCP'
19404 #include <sys/types.h>
19405 #include <inttypes.h>
19408 int64_t q = 12345678901;
19409 printf("%" PRId64 "\n", q);
19413 if eval $compile; then
19417 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19418 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19419 echo "We will use the C9X style."
19425 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19427 #include <sys/types.h>
19430 $quadtype q = 12345678901;
19431 printf("%Ld\n", q);
19435 if eval $compile; then
19439 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19440 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19441 echo "We will use %Ld."
19447 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19448 $cat >try.c <<'EOCP'
19449 #include <sys/types.h>
19452 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19453 printf("%lld\n", q);
19457 if eval $compile; then
19461 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19462 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19463 echo "We will use the %lld style."
19469 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19471 #include <sys/types.h>
19474 $quadtype q = 12345678901;
19475 printf("%qd\n", q);
19479 if eval $compile; then
19483 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19484 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19485 echo "We will use %qd."
19491 if $test X"$sPRId64" = X; then
19492 echo "Cannot figure out how to print 64-bit integers." >&4
19499 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19500 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19502 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19503 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19507 : Check format strings for internal types
19509 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19511 if $test X"$ivsize" = X8; then
19512 ivdformat="$sPRId64"
19513 uvuformat="$sPRIu64"
19514 uvoformat="$sPRIo64"
19515 uvxformat="$sPRIx64"
19516 uvXUformat="$sPRIXU64"
19518 if $test X"$ivsize" = X"$longsize"; then
19525 if $test X"$ivsize" = X"$intsize"; then
19533 if $test X"$ivsize" = X"$shortsize"; then
19544 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19545 nveformat="$sPRIeldbl"
19546 nvfformat="$sPRIfldbl"
19547 nvgformat="$sPRIgldbl"
19548 nvEUformat="$sPRIEUldbl"
19549 nvFUformat="$sPRIFUldbl"
19550 nvGUformat="$sPRIGUldbl"
19560 case "$ivdformat" in
19561 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19566 : Check format string for GID
19569 $echo "Checking the format string to be used for gids..." >&4
19572 -1) if $test X"$gidsize" = X"$ivsize"; then
19573 gidformat="$ivdformat"
19575 if $test X"$gidsize" = X"$longsize"; then
19578 if $test X"$gidsize" = X"$intsize"; then
19581 if $test X"$gidsize" = X"$shortsize"; then
19588 *) if $test X"$gidsize" = X"$uvsize"; then
19589 gidformat="$uvuformat"
19591 if $test X"$gidsize" = X"$longsize"; then
19594 if $test X"$gidsize" = X"$intsize"; then
19597 if $test X"$gidsize" = X"$shortsize"; then
19606 : see if getgroups exists
19607 set getgroups d_getgrps
19610 : see if setgroups exists
19611 set setgroups d_setgrps
19614 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19616 case "$d_getgrps$d_setgrps" in
19618 case "$groupstype" in
19619 '') dflt="$gidtype" ;;
19620 *) dflt="$groupstype" ;;
19623 What type of pointer is the second argument to getgroups() and setgroups()?
19624 Usually this is the same as group ids, $gidtype, but not always.
19627 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19631 *) groupstype="$gidtype";;
19634 : MAD = Misc Attribute Definition
19636 if $test $patchlevel -lt 9; then
19637 : MAD is not available in 5.8.x or earlier.
19641 $define|true|[yY]*) dflt='y' ;;
19646 Would you like to build with Misc Attribute Decoration? This is development
19647 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19648 overhead on the interpreter.
19650 If this doesn't make any sense to you, just accept the default '$dflt'.
19652 rp='Build Perl with MAD?'
19657 madlyh='madly.h madly.act madly.tab'
19659 madlyobj="madly$_o" ;;
19668 : check whether make sets MAKE
19670 echo "Checking if your $make program sets \$(MAKE)..." >&4
19671 case "$make_set_make" in
19673 $sed 's/^X //' > testmake.mak << 'EOF'
19675 X @echo 'maketemp="$(MAKE)"'
19677 case "`$make -f testmake.mak 2>/dev/null`" in
19678 *maketemp=*) make_set_make='#' ;;
19679 *) make_set_make="MAKE=$make" ;;
19681 $rm -f testmake.mak
19684 case "$make_set_make" in
19685 '#') echo "Yup, it does.";;
19686 *) echo "Nope, it doesn't.";;
19689 : see what type is used for mode_t
19690 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19691 set mode_t modetype int stdio.h sys/types.h
19694 : see if we need va_copy
19696 case "$i_stdarg" in
19699 #include <stdarg.h>
19701 #$i_stdlib I_STDLIB
19703 #include <stdlib.h>
19705 #include <signal.h>
19708 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19710 return vfprintf(f, fmt, *valp);
19714 myvfprintf(FILE *f, const char *fmt, va_list val)
19716 return ivfprintf(f, fmt, &val);
19720 myprintf(char *fmt, ...)
19723 va_start(val, fmt);
19724 return myvfprintf(stdout, fmt, val);
19728 main(int ac, char **av)
19730 signal(SIGSEGV, exit);
19732 myprintf("%s%cs all right, then\n", "that", '\'');
19737 if eval $compile && $run ./try 2>&1 >/dev/null; then
19738 case "`$run ./try`" in
19739 "that's all right, then")
19745 yes) echo "It seems that you don't need va_copy()." >&4
19746 need_va_copy="$undef"
19748 *) echo "It seems that va_copy() or similar will be needed." >&4
19749 need_va_copy="$define"
19754 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19758 : see what type is used for size_t
19759 rp="What is the type used for the length parameter for string functions?"
19760 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19763 : check for type of arguments to gethostbyaddr.
19764 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19765 case "$d_gethbyaddr" in
19769 Checking to see what type of arguments are accepted by gethostbyaddr().
19771 hdrs="$define sys/types.h
19772 $d_socket sys/socket.h
19773 $i_niin netinet/in.h
19775 $i_unistd unistd.h"
19776 : The first arg can 'char *' or 'void *'
19777 : The second arg is some of integral type
19778 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19779 for yyy in size_t long int; do
19780 case "$netdb_host_type" in
19781 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19782 if ./protochk "$try" $hdrs; then
19783 echo "Your system accepts $xxx for the first arg."
19784 echo "...and $yyy for the second arg."
19785 netdb_host_type="$xxx"
19786 netdb_hlen_type="$yyy"
19792 : In case none of those worked, prompt the user.
19793 case "$netdb_host_type" in
19794 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19797 netdb_host_type=$ans
19798 rp='What is the type for the 2nd argument to gethostbyaddr?'
19801 netdb_hlen_type=$ans
19805 *) : no gethostbyaddr, so pick harmless defaults
19806 netdb_host_type='char *'
19807 netdb_hlen_type="$sizetype"
19810 # Remove the "const" if needed. -- but then we'll have a
19812 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19815 : check for type of argument to gethostbyname.
19816 if test "X$netdb_name_type" = X ; then
19817 case "$d_gethbyname" in
19821 Checking to see what type of argument is accepted by gethostbyname().
19823 hdrs="$define sys/types.h
19824 $d_socket sys/socket.h
19825 $i_niin netinet/in.h
19827 $i_unistd unistd.h"
19828 for xxx in "const char *" "char *"; do
19829 case "$netdb_name_type" in
19830 '') try="extern struct hostent *gethostbyname($xxx);"
19831 if ./protochk "$try" $hdrs; then
19832 echo "Your system accepts $xxx."
19833 netdb_name_type="$xxx"
19838 : In case none of those worked, prompt the user.
19839 case "$netdb_name_type" in
19840 '') rp='What is the type for the 1st argument to gethostbyname?'
19843 netdb_name_type=$ans
19847 *) : no gethostbyname, so pick harmless default
19848 netdb_name_type='char *'
19853 : check for type of 1st argument to getnetbyaddr.
19854 if test "X$netdb_net_type" = X ; then
19855 case "$d_getnbyaddr" in
19859 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19861 hdrs="$define sys/types.h
19862 $d_socket sys/socket.h
19863 $i_niin netinet/in.h
19865 $i_unistd unistd.h"
19866 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19867 case "$netdb_net_type" in
19868 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19869 if ./protochk "$try" $hdrs; then
19870 echo "Your system accepts $xxx."
19871 netdb_net_type="$xxx"
19876 : In case none of those worked, prompt the user.
19877 case "$netdb_net_type" in
19878 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19881 netdb_net_type=$ans
19885 *) : no getnetbyaddr, so pick harmless default
19886 netdb_net_type='long'
19890 : locate the preferred pager for this system
19897 [a-zA-Z]:/*) dflt=$pg;;
19901 [a-zA-Z]:/*) dflt=$more;;
19905 [a-zA-Z]:/*) dflt=$less;;
19908 '') dflt=/usr/ucb/more;;
19912 : Instruct ./getfile to trust the hinted or previous pager value,
19913 : even if it does not begin with a slash. For example, on os2,
19914 : pager might be cmd /c more. See comments in UU/getfile.
19919 rp='What pager is used on your system?'
19923 : see what type pids are declared as in the kernel
19924 rp="What is the type of process ids on this system?"
19925 set pid_t pidtype int stdio.h sys/types.h
19928 : see if ar generates random libraries by itself
19930 echo "Checking how to generate random libraries on your machine..." >&4
19931 echo 'int bar1() { return bar2(); }' > bar1.c
19932 echo 'int bar2() { return 2; }' > bar2.c
19934 #$i_stdlib I_STDLIB
19936 #include <stdlib.h>
19938 int main() { printf("%d\n", bar1()); exit(0); }
19940 $cc $ccflags -c bar1.c >/dev/null 2>&1
19941 $cc $ccflags -c bar2.c >/dev/null 2>&1
19942 $cc $ccflags -c foo.c >/dev/null 2>&1
19943 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19944 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19945 $run ./foobar >/dev/null 2>&1; then
19946 echo "$ar appears to generate random libraries itself."
19948 if [ "X$ranlib" = "X" ]; then
19951 elif $ar s bar$_a >/dev/null 2>&1 &&
19952 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19953 $run ./foobar >/dev/null 2>&1; then
19954 echo "a table of contents needs to be added with '$ar s'."
19957 elif $ar ts bar$_a >/dev/null 2>&1 &&
19958 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19959 $run ./foobar >/dev/null 2>&1; then
19960 echo "a table of contents needs to be added with '$ar ts'."
19967 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19968 $test -f $ranlib || ranlib=''
19971 if $test -n "$ranlib"; then
19972 echo "your system has '$ranlib'; we'll use that."
19975 echo "your system doesn't seem to support random libraries"
19976 echo "so we'll use lorder and tsort to order the libraries."
19983 : check for type of arguments to select.
19984 case "$selecttype" in
19985 '') case "$d_select" in
19989 Checking to see what type of arguments are accepted by select().
19991 hdrs="$define sys/types.h
19992 $i_systime sys/time.h
19993 $i_sysselct sys/select.h
19994 $d_socket sys/socket.h"
19995 : The first arg can be int, unsigned, or size_t
19996 : The last arg may or may not be 'const'
19998 : void pointer has been seen but using that
19999 : breaks the selectminbits test
20000 for xxx in 'fd_set *' 'int *'; do
20001 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20002 for tmo in 'struct timeval *' 'const struct timeval *'; do
20004 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20005 if ./protochk "$try" $hdrs; then
20006 echo "Your system accepts $xxx."
20015 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20016 case "$d_fd_set" in
20017 $define) dflt="fd_set *" ;;
20026 *) : no select, so pick a harmless default
20033 : check for the select 'width'
20034 case "$selectminbits" in
20035 '') safebits=`expr $ptrsize \* 8`
20036 case "$d_select" in
20040 Checking to see on how many bits at a time your select() operates...
20043 #include <sys/types.h>
20045 #$i_systime I_SYS_TIME
20046 #$i_systimek I_SYS_TIME_KERNEL
20051 # ifdef I_SYS_TIME_KERNEL
20054 # include <sys/time.h>
20055 # ifdef I_SYS_TIME_KERNEL
20059 #$i_sysselct I_SYS_SELECT
20060 #ifdef I_SYS_SELECT
20061 #include <sys/select.h>
20063 #$d_socket HAS_SOCKET
20065 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20068 #$i_stdlib I_STDLIB
20070 #include <stdlib.h>
20073 #define S sizeof(*(b))
20075 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20076 #define NBITS (NBYTES * 8)
20078 char *s = (char *)malloc(NBYTES);
20087 fp = fopen("try.c", "r");
20093 b = ($selecttype)s;
20094 for (i = 0; i < NBITS; i++)
20098 select(fd + 1, b, 0, 0, &t);
20099 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20101 printf("%d\n", i + 1);
20106 if eval $compile_ok; then
20107 selectminbits=`$run ./try`
20108 case "$selectminbits" in
20110 Cannot figure out on how many bits at a time your select() operates.
20111 I'll play safe and guess it is $safebits bits.
20113 selectminbits=$safebits
20114 bits="$safebits bits"
20117 *) bits="$selectminbits bits" ;;
20119 echo "Your select() operates on $bits at a time." >&4
20121 rp='What is the minimum number of bits your select() operates on?'
20122 case "$byteorder" in
20123 12345678) dflt=64 ;;
20129 selectminbits="$val"
20133 *) : no select, so pick a harmless default
20134 selectminbits=$safebits
20140 : Trace out the files included by signal.h, then look for SIGxxx names.
20141 if [ "X$fieldn" = X ]; then
20142 : Just make some guesses. We check them later.
20143 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20145 xxx=`echo '#include <signal.h>' |
20146 $cppstdin $cppminus $cppflags 2>/dev/null |
20147 $grep '^[ ]*#.*include' |
20148 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20149 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20152 for xx in $xxx /dev/null ; do
20153 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20155 case "$xxxfiles" in
20156 '') xxxfiles=`./findhdr signal.h` ;;
20159 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20160 print substr($2, 4, 20)
20162 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20163 print substr($3, 4, 20)
20165 : Append some common names just in case the awk scan failed.
20166 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20167 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20168 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20169 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20170 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20172 : generate a few handy files for later
20173 $cat > signal.c <<EOCP
20174 #include <sys/types.h>
20175 #include <signal.h>
20176 #$i_stdlib I_STDLIB
20178 #include <stdlib.h>
20183 /* Strange style to avoid deeply-nested #if/#else/#endif */
20186 # define NSIG (_NSIG)
20192 # define NSIG (SIGMAX+1)
20198 # define NSIG (SIG_MAX+1)
20204 # define NSIG (_SIG_MAX+1)
20210 # define NSIG (MAXSIG+1)
20216 # define NSIG (MAX_SIG+1)
20221 # ifdef SIGARRAYSIZE
20222 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20228 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20232 /* Default to some arbitrary number that's big enough to get most
20233 of the common signals.
20239 printf("NSIG %d\n", NSIG);
20245 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20247 printf "#ifdef SIG"; printf $1; printf "\n"
20248 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20249 printf $1; printf ");\n"
20253 printf "#endif /* JUST_NSIG */\n";
20254 printf "exit(0);\n}\n";
20257 $cat >signal.awk <<'EOP'
20258 BEGIN { ndups = 0 }
20259 $1 ~ /^NSIG$/ { nsig = $2 }
20260 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20261 if ($2 > maxsig) { maxsig = $2 }
20262 if (sig_name[$2]) {
20263 dup_name[ndups] = $1
20264 dup_num[ndups] = $2
20276 printf("NSIG %d\n", nsig);
20277 for (n = 1; n < nsig; n++) {
20279 printf("%s %d\n", sig_name[n], sig_num[n])
20282 printf("NUM%d %d\n", n, n)
20285 for (n = 0; n < ndups; n++) {
20286 printf("%s %d\n", dup_name[n], dup_num[n])
20290 $cat >signal_cmd <<EOS
20292 if $test -s signal.lst; then
20293 echo "Using your existing signal.lst file"
20298 $cat >>signal_cmd <<'EOS'
20301 if eval $compile_ok; then
20302 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20303 $uniq | $awk -f signal.awk >signal.lst
20305 echo "(I can't seem be able to compile the whole test program)" >&4
20306 echo "(I'll try it in little pieces.)" >&4
20307 set signal -DJUST_NSIG
20308 if eval $compile_ok; then
20309 $run ./signal$_exe > signal.nsg
20312 echo "I can't seem to figure out how many signals you have." >&4
20313 echo "Guessing 50." >&4
20314 echo 'NSIG 50' > signal.nsg
20316 : Now look at all the signal names, one at a time.
20317 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20318 $cat > signal.c <<EOCP
20319 #include <sys/types.h>
20320 #include <signal.h>
20323 printf("$xx %d\n", SIG${xx});
20328 if eval $compile; then
20329 echo "SIG${xx} found."
20330 $run ./signal$_exe >> signal.ls1
20332 echo "SIG${xx} NOT found."
20335 if $test -s signal.ls1; then
20336 $cat signal.nsg signal.ls1 |
20337 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20341 if $test -s signal.lst; then
20344 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20345 echo 'kill -l' >signal
20346 set X `csh -f <signal`
20350 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20352 echo $@ | $tr ' ' $trnl | \
20353 $awk '{ printf "%s %d\n", $1, ++s; }
20354 END { printf "NSIG %d\n", ++s }' >signal.lst
20356 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20358 chmod a+x signal_cmd
20359 $eunicefix signal_cmd
20361 : generate list of signal names
20363 case "$sig_name_init" in
20365 *) case "$sig_num_init" in
20366 ''|*,*) doinit=yes ;;
20371 echo "Generating a list of signal names and numbers..." >&4
20373 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20374 sig_name=`$awk 'BEGIN { printf "ZERO " }
20375 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20376 sig_num=`$awk 'BEGIN { printf "0 " }
20377 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20378 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20379 !/^NSIG/ { printf "\"%s\", ", $1 }
20380 END { printf "0\n" }' signal.lst`
20381 sig_num_init=`$awk 'BEGIN { printf "0, " }
20382 !/^NSIG/ { printf "%d, ", $2}
20383 END { printf "0\n"}' signal.lst`
20386 echo "The following $sig_count signals are available:"
20388 echo $sig_name | $awk \
20389 'BEGIN { linelen = 0 }
20391 for (i = 1; i <= NF; i++) {
20392 name = "SIG" $i " "
20393 linelen = linelen + length(name)
20394 if (linelen > 70) {
20396 linelen = length(name)
20402 sig_size=`echo $sig_name | awk '{print NF}'`
20403 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20405 : Check size of size
20407 case "$sizetype" in
20408 *_t) zzz="$sizetype" ;;
20409 *) zzz="filesize" ;;
20411 echo "Checking the size of $zzz..." >&4
20413 #include <sys/types.h>
20415 #$i_stdlib I_STDLIB
20417 #include <stdlib.h>
20420 printf("%d\n", (int)sizeof($sizetype));
20425 if eval $compile_ok; then
20429 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20432 echo "Your $zzz size is $sizesize bytes."
20437 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20441 : check for socklen_t
20443 echo "Checking to see if you have socklen_t..." >&4
20445 #include <sys/types.h>
20446 #$d_socket HAS_SOCKET
20448 #include <sys/socket.h>
20450 int main() { socklen_t x = 16; }
20453 if eval $compile; then
20455 echo "You have socklen_t."
20458 echo "You do not have socklen_t."
20459 case "$sizetype" in
20460 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20467 : see if this is a socks.h system
20468 set socks.h i_socks
20471 : check for type of the size argument to socket calls
20472 case "$d_socket" in
20476 Checking to see what type is the last argument of accept().
20479 case "$d_socklen_t" in
20480 "$define") yyy="$yyy socklen_t"
20482 yyy="$yyy $sizetype int long unsigned"
20483 for xxx in $yyy; do
20484 case "$socksizetype" in
20485 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20486 case "$usesocks" in
20488 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20489 echo "Your system accepts '$xxx *' for the last argument of accept()."
20490 socksizetype="$xxx"
20493 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20494 echo "Your system accepts '$xxx *' for the last argument of accept()."
20495 socksizetype="$xxx"
20502 : In case none of those worked, prompt the user.
20503 case "$socksizetype" in
20504 '') rp='What is the type for socket address structure sizes?'
20511 *) : no sockets, so pick relatively harmless default
20516 : see what type is used for signed size_t
20517 set ssize_t ssizetype int stdio.h sys/types.h
20522 #$i_stdlib I_STDLIB
20524 #include <stdlib.h>
20526 #include <sys/types.h>
20527 #define Size_t $sizetype
20528 #define SSize_t $dflt
20531 if (sizeof(Size_t) == sizeof(SSize_t))
20533 else if (sizeof(Size_t) == sizeof(int))
20542 if eval $compile_ok && $run ./try > /dev/null; then
20543 ssizetype=`$run ./try`
20544 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20547 Help! I can't compile and run the ssize_t test program: please enlighten me!
20548 (This is probably a misconfiguration in your system or libraries, and
20549 you really ought to fix it. Still, I'll try anyway.)
20551 I need a type that is the same size as $sizetype, but is guaranteed to
20552 be signed. Common values are ssize_t, int and long.
20555 rp="What signed type is the same size as $sizetype?"
20561 : see what type of char stdio uses.
20563 echo '#include <stdio.h>' > stdio.c
20564 $cppstdin $cppminus < stdio.c > stdioh
20565 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20566 echo "Your stdio uses unsigned chars." >&4
20567 stdchar="unsigned char"
20569 echo "Your stdio uses signed chars." >&4
20572 $rm -f stdio.* stdioh
20574 : see what type uids are declared as in the kernel
20576 echo "Looking for the type for user ids returned by getuid()."
20577 set uid_t uidtype xxx stdio.h sys/types.h
20581 xxx=`./findhdr sys/user.h`
20582 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20584 unsigned) dflt="$1 $2" ;;
20588 *) dflt="$uidtype";;
20591 uid_t) echo "uid_t found." ;;
20592 *) rp="What is the type for user ids returned by getuid()?"
20598 : Check size of UID
20601 *_t) zzz="$uidtype" ;;
20604 echo "Checking the size of $zzz..." >&4
20606 #include <sys/types.h>
20608 #$i_stdlib I_STDLIB
20610 #include <stdlib.h>
20613 printf("%d\n", (int)sizeof($uidtype));
20618 if eval $compile_ok; then
20622 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20625 echo "Your $zzz is $uidsize bytes long."
20630 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20633 : Check if UID is signed
20636 *_t) zzz="$uidtype" ;;
20639 echo "Checking the sign of $zzz..." >&4
20641 #include <sys/types.h>
20652 if eval $compile; then
20656 echo "(I can't execute the test program--guessing unsigned.)" >&4
20660 1) echo "Your $zzz is unsigned." ;;
20661 -1) echo "Your $zzz is signed." ;;
20667 echo "(I can't compile the test program--guessing unsigned.)" >&4
20671 : Check format string for UID
20673 $echo "Checking the format string to be used for uids..." >&4
20676 -1) if $test X"$uidsize" = X"$ivsize"; then
20677 uidformat="$ivdformat"
20679 if $test X"$uidsize" = X"$longsize"; then
20682 if $test X"$uidsize" = X"$intsize"; then
20685 if $test X"$uidsize" = X"$shortsize"; then
20692 *) if $test X"$uidsize" = X"$uvsize"; then
20693 uidformat="$uvuformat"
20695 if $test X"$uidsize" = X"$longsize"; then
20698 if $test X"$uidsize" = X"$intsize"; then
20701 if $test X"$uidsize" = X"$shortsize"; then
20710 : Check if site customization support was requested
20711 case "$usesitecustomize" in
20712 $define|true|[Yy]*)
20713 usesitecustomize="$define"
20716 usesitecustomize="$undef"
20720 : determine compiler compiler
20729 if $test -f "$byacc$_exe"; then
20731 comp="byacc or $comp"
20733 if $test -f "$bison$_exe"; then
20734 comp="$comp or bison -y"
20736 rp="Which compiler compiler ($comp) shall I use?"
20745 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20751 : see if this is a assert.h system
20752 set assert.h i_assert
20755 : see if this is a fp.h system
20759 : see if this is a fp_class.h system
20760 set fp_class.h i_fp_class
20763 : see if gdbm.h is available
20768 : see if gdbm_open exists
20769 set gdbm_open d_gdbm_open
20771 case "$d_gdbm_open" in
20774 echo "We won't be including <gdbm.h>"
20783 : see if this is a ieeefp.h system
20784 case "$i_ieeefp" in
20785 '' ) set ieeefp.h i_ieeefp
20790 : see if this is a libutil.h system
20791 set libutil.h i_libutil
20794 : see if mach cthreads are available
20795 if test "X$usethreads" = "X$define"; then
20796 set mach/cthreads.h i_machcthr
20799 i_machcthr="$undef"
20802 : see if this is a mntent.h system
20803 set mntent.h i_mntent
20806 : see if ndbm.h is available
20812 # Some Linux distributions such as RedHat 7.1 put the
20813 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20814 if $test -f /usr/include/gdbm/ndbm.h; then
20815 echo '<gdbm/ndbm.h> found.'
20816 ccflags="$ccflags -I/usr/include/gdbm"
20817 cppflags="$cppflags -I/usr/include/gdbm"
20825 : see if dbm_open exists
20826 set dbm_open d_dbm_open
20828 case "$d_dbm_open" in
20831 echo "We won't be including <ndbm.h>"
20840 : see if net/errno.h is available
20842 set net/errno.h val
20845 : Unfortunately, it causes problems on some systems. Arrgh.
20848 cat > try.c <<'EOM'
20851 #include <net/errno.h>
20857 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20858 echo "We'll be including <net/errno.h>." >&4
20860 echo "We won't be including <net/errno.h>." >&4
20869 : see if netinet/tcp.h is available
20870 set netinet/tcp.h i_netinettcp
20873 : see if this is a poll.h system
20877 : see if this is a prot.h system
20881 : Preprocessor symbols
20883 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20884 $cat <<'EOSH' > Cppsym.know
20885 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20886 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20887 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20888 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20889 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20890 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20891 bull c cadmus clipper CMU COFF COMPILER_VERSION
20892 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20893 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20894 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20895 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20897 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20898 H3050R H3050RX hbullx20 hcx host_mips
20899 hp200 hp300 hp700 HP700 hp800 hp9000
20900 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20901 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20902 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20903 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20904 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20905 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20906 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20907 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20908 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20909 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20910 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20911 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20912 MATH_HAS_NO_SIDE_EFFECTS
20913 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20914 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20915 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20916 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20917 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20918 NetBSD news1500 news1700 news1800 news1900 news3700
20919 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20920 ns32016 ns32332 ns32k nsc32000
20921 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20922 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20923 pc532 pdp11 PGC PIC plexus PORTAR posix
20924 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20925 POSIX_C_SOURCE POSIX_SOURCE POWER
20926 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20927 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20928 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20929 sony sony_news sonyrisc sparc sparclite spectrum
20930 stardent stdc STDC_EXT stratos sun sun3 sun386
20931 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20932 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20933 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20934 sysV68 sysV88 Tek4132 Tek4300 titan
20935 TM3200 TM5400 TM5600
20936 tower tower32 tower32_200 tower32_600 tower32_700
20937 tower32_800 tower32_850 tss
20938 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20939 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20940 unix UNIX95 UNIX99 unixpc unos
20941 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20942 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20943 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20945 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20946 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20947 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20950 # Maybe put other stuff here too.
20951 cat <<EOSH >>Cppsym.know
20954 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20955 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20956 $cat Cppsym.know > Cppsym.c
20957 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20958 $rm -f Cppsym.a Cppsym.b Cppsym.c
20959 cat <<EOSH > Cppsym
20961 if $test \$# -gt 0; then
20962 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20963 if $test -s Cppsym.got; then
20970 $tr " " "$trnl" | ./Cppsym.try
20976 cat <<EOSH > Cppsym.try
20978 cat <<'EOCP' > try.c
20981 #define STRINGIFY(a) "a"
20983 #if cpp_stuff == 42
20984 #define StGiFy(a) #a
20985 #define STRINGIFY(a) StGiFy(a)
20987 #if $cpp_stuff != 1 && $cpp_stuff != 42
20988 # include "Bletch: How does this C preprocessor stringify macros?"
20994 cat <<'EOSH' >> Cppsym.try
20996 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20997 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20998 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20999 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21001 echo 'return 0;}' >> try.c
21003 cat <<EOSH >> Cppsym.try
21005 case "$osname-$gccversion" in
21006 irix-) ccflags="\$ccflags -woff 1178" ;;
21007 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21009 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21011 chmod +x Cppsym.try
21012 $eunicefix Cppsym.try
21013 ./Cppsym < Cppsym.know > Cppsym.true
21014 : Add in any linux cpp "predefined macros":
21015 case "$osname::$gccversion" in
21018 rm -f $tHdrH'.h' $tHdrH
21020 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21021 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21022 if [ -s $tHdrH'_cppsym.real' ]; then
21023 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21026 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21029 : now check the C compiler for additional symbols
21030 postprocess_cc_v=''
21032 aix) postprocess_cc_v="|$tr , ' '" ;;
21039 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21042 -D*) echo "\$i" | $sed 's/^-D//';;
21043 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21048 postprocess_cc_v=''
21051 ./ccsym > ccsym1.raw
21052 if $test -s ccsym1.raw; then
21053 $sort ccsym1.raw | $uniq >ccsym.raw
21055 mv ccsym1.raw ccsym.raw
21058 $awk '/\=/ { print $0; next }
21059 { print $0"=1" }' ccsym.raw >ccsym.list
21060 $comm -13 Cppsym.true ccsym.list >ccsym.own
21061 $comm -12 Cppsym.true ccsym.list >ccsym.com
21062 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21064 if $test -z ccsym.raw; then
21065 echo "Your C compiler doesn't seem to define any symbols!" >&4
21067 echo "However, your C preprocessor defines the following symbols:"
21070 cppsymbols=`$cat Cppsym.true`
21071 cppsymbols=`echo $cppsymbols`
21072 cppccsymbols="$cppsymbols"
21074 if $test -s ccsym.com; then
21075 echo "Your C compiler and pre-processor define these symbols:"
21076 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21079 cppccsymbols=`$cat ccsym.com`
21080 cppccsymbols=`echo $cppccsymbols`
21081 $test "$silent" || sleep 1
21083 if $test -s ccsym.cpp; then
21084 $test "$also" && echo " "
21085 echo "Your C pre-processor ${also}defines the following symbols:"
21086 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21088 cppsymbols=`$cat ccsym.cpp`
21089 cppsymbols=`echo $cppsymbols`
21090 $test "$silent" || sleep 1
21092 if $test -s ccsym.own; then
21093 $test "$also" && echo " "
21094 echo "Your C compiler ${also}defines the following cpp symbols:"
21095 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21096 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21097 ccsymbols=`$cat ccsym.own`
21098 ccsymbols=`echo $ccsymbols`
21099 $test "$silent" || sleep 1
21103 : see if this is a termio system
21107 if $test `./findhdr termios.h`; then
21108 set tcsetattr i_termios
21114 "$define") echo "You have POSIX termios.h... good!" >&4;;
21115 *) if ./Cppsym pyr; then
21116 case "`/bin/universe`" in
21117 ucb) if $test `./findhdr sgtty.h`; then
21119 echo "<sgtty.h> found." >&4
21121 echo "System is pyramid with BSD universe."
21122 ./warn "<sgtty.h> not found--you could have problems."
21124 *) if $test `./findhdr termio.h`; then
21126 echo "<termio.h> found." >&4
21128 echo "System is pyramid with USG universe."
21129 ./warn "<termio.h> not found--you could have problems."
21133 if $test `./findhdr termio.h`; then
21134 echo "<termio.h> found." >&4
21136 elif $test `./findhdr sgtty.h`; then
21137 echo "<sgtty.h> found." >&4
21140 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21143 if $test `./findhdr sgtty.h`; then
21144 echo "<sgtty.h> found." >&4
21146 elif $test `./findhdr termio.h`; then
21147 echo "<termio.h> found." >&4
21150 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21154 set i_termio; eval $setvar
21155 val=$val2; set i_sgtty; eval $setvar
21156 val=$val3; set i_termios; eval $setvar
21158 : see if stddef is available
21159 set stddef.h i_stddef
21162 : see if sys/access.h is available
21163 set sys/access.h i_sysaccess
21166 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21167 set sys/filio.h i_sysfilio
21170 if $test `./findhdr sys/ioctl.h`; then
21172 echo '<sys/ioctl.h> found.' >&4
21175 if $test $i_sysfilio = "$define"; then
21176 echo '<sys/ioctl.h> NOT found.' >&4
21178 $test $i_sgtty = "$define" && xxx="sgtty.h"
21179 $test $i_termio = "$define" && xxx="termio.h"
21180 $test $i_termios = "$define" && xxx="termios.h"
21181 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21187 : see if socket ioctl defs are in sys/sockio.h
21189 xxx=`./findhdr sys/sockio.h`
21190 if $test "$xxx"; then
21191 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21193 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21196 echo "No socket ioctls found in <sys/sockio.h>." >&4
21201 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21207 : see if this is a syslog.h system
21208 set syslog.h i_syslog
21211 : see if this is a sys/mode.h system
21212 set sys/mode.h i_sysmode
21215 : see if there is a sys/poll.h file
21216 set sys/poll.h i_syspoll
21219 : see if sys/resource.h has to be included
21220 set sys/resource.h i_sysresrc
21223 : see if sys/security.h is available
21224 set sys/security.h i_syssecrt
21227 : see if this is a sys/statvfs.h system
21228 set sys/statvfs.h i_sysstatvfs
21231 : see if this is a sys/un.h system
21232 set sys/un.h i_sysun
21235 : see if this is a sys/utsname.h system
21236 set sys/utsname.h i_sysutsname
21239 : see if this is a syswait system
21240 set sys/wait.h i_syswait
21243 : see if this is a ustat.h system
21244 set ustat.h i_ustat
21247 : see if this is an utime system
21248 set utime.h i_utime
21251 : see if this is a values.h system
21252 set values.h i_values
21255 : see if this is a vfork system
21258 set vfork.h i_vfork
21268 echo "Looking for extensions..." >&4
21269 : If we are using the old config.sh, known_extensions may contain
21270 : old or inaccurate or duplicate values.
21271 known_extensions=''
21272 nonxs_extensions=''
21273 : We do not use find because it might not be available.
21274 : We do not just use MANIFEST because the user may have dropped
21275 : some additional extensions into the source tree and expect them
21278 : Function to recursively find available extensions, ignoring DynaLoader
21279 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21283 DynaLoader|dynaload) ;;
21285 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21286 known_extensions="$known_extensions $1$xxx";
21287 elif $test -f $xxx/Makefile.PL; then
21288 nonxs_extensions="$nonxs_extensions $1$xxx";
21290 if $test -d $xxx -a $# -lt 10; then
21293 eval $find_extensions;
21305 eval $find_extensions
21306 # Special case: Add in modules that nest beyond the first level.
21307 # Currently threads/shared and Hash/Util/FieldHash, since they are
21308 # not picked up by the recursive find above (and adding in general
21309 # recursive finding breaks SDBM_File/sdbm).
21310 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21311 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21312 set X $known_extensions
21314 known_extensions="$*"
21315 set X $nonxs_extensions
21317 nonxs_extensions="$*"
21320 : Now see which are supported on this system.
21322 for xxx in $known_extensions ; do
21326 $define) avail_ext="$avail_ext $xxx" ;;
21329 GDBM_File|gdbm_fil)
21331 $define) avail_ext="$avail_ext $xxx" ;;
21334 I18N/Langinfo|i18n_lan)
21335 case "$i_langinfo$d_nl_langinfo" in
21336 $define$define) avail_ext="$avail_ext $xxx" ;;
21340 : XXX Do we need a useipcsysv variable here
21341 case "${d_msg}${d_sem}${d_shm}" in
21342 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21345 NDBM_File|ndbm_fil)
21348 case "$osname-$use64bitint" in
21351 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21354 *) avail_ext="$avail_ext $xxx" ;;
21359 ODBM_File|odbm_fil)
21360 case "${i_dbm}${i_rpcsvcdbm}" in
21362 case "$d_cplusplus" in
21363 define) ;; # delete as a function name will not work
21364 *) case "$osname-$use64bitint" in
21367 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21370 *) avail_ext="$avail_ext $xxx" ;;
21378 case "$useopcode" in
21379 true|define|y) avail_ext="$avail_ext $xxx" ;;
21383 case "$useposix" in
21384 true|define|y) avail_ext="$avail_ext $xxx" ;;
21388 case "$d_socket" in
21391 beos) ;; # not unless BONE
21392 *) avail_ext="$avail_ext $xxx" ;;
21397 Sys/Syslog|sys/syslog)
21398 : XXX syslog requires socket
21399 case "$d_socket" in
21400 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21404 case "$usethreads" in
21406 case "$use5005threads" in
21407 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21411 threads|threads/shared)
21412 # threads and threads::shared are special cases.
21413 # To stop people from asking "Perl 5.8.0 was supposed
21414 # to have this new fancy threads implementation but my
21415 # perl doesn't have it" and from people trying to
21416 # (re)install the threads module using CPAN.pm and
21417 # CPAN.pm then offering to reinstall Perl 5.8.0,
21418 # the threads.pm and threads/shared.pm will always be
21419 # there, croaking informatively ("you need to rebuild
21420 # all of Perl with threads, sorry") when threads haven't
21421 # been compiled in.
21423 avail_ext="$avail_ext $xxx"
21427 cygwin) avail_ext="$avail_ext $xxx" ;;
21430 XS/APItest|xs/apitest)
21431 # This is just for testing. Skip it unless we have dynamic loading.
21434 $define) avail_ext="$avail_ext $xxx" ;;
21437 XS/Typemap|xs/typemap)
21438 # This is just for testing. Skip it unless we have dynamic loading.
21440 $define) avail_ext="$avail_ext $xxx" ;;
21443 *) avail_ext="$avail_ext $xxx"
21452 case "$onlyextensions" in
21454 *) keepextensions=''
21455 echo "You have requested that only certains extensions be included..." >&4
21456 for i in $onlyextensions; do
21457 case " $avail_ext " in
21459 echo "Keeping extension $i."
21460 keepextensions="$keepextensions $i"
21462 *) echo "Ignoring extension $i." ;;
21465 avail_ext="$keepextensions"
21469 case "$noextensions" in
21471 *) keepextensions=''
21472 echo "You have requested that certain extensions be ignored..." >&4
21473 for i in $avail_ext; do
21474 case " $noextensions " in
21475 *" $i "*) echo "Ignoring extension $i." ;;
21476 *) echo "Keeping extension $i.";
21477 keepextensions="$keepextensions $i"
21481 avail_ext="$keepextensions"
21485 : Now see which nonxs extensions are supported on this system.
21486 : For now assume all are.
21488 for xxx in $nonxs_extensions ; do
21490 *) nonxs_ext="$nonxs_ext $xxx"
21502 A number of extensions are supplied with $package. You may choose to
21503 compile these extensions for dynamic loading (the default), compile
21504 them into the $package executable (static loading), or not include
21505 them at all. Answer "none" to include no extensions.
21506 Note that DynaLoader is always built and need not be mentioned here.
21509 case "$dynamic_ext" in
21511 : Exclude those listed in static_ext
21513 for xxx in $avail_ext; do
21514 case " $static_ext " in
21516 *) dflt="$dflt $xxx" ;;
21523 *) dflt="$dynamic_ext"
21524 # Perhaps we are reusing an old out-of-date config.sh.
21527 if test X"$dynamic_ext" != X"$avail_ext"; then
21529 NOTICE: Your previous config.sh list may be incorrect.
21530 The extensions now available to you are
21532 but the default list from your previous config.sh is
21544 rp="What extensions do you wish to load dynamically?"
21547 none) dynamic_ext=' ' ;;
21548 *) dynamic_ext="$ans" ;;
21551 case "$static_ext" in
21553 : Exclude those already listed in dynamic linking
21555 for xxx in $avail_ext; do
21556 case " $dynamic_ext " in
21558 *) dflt="$dflt $xxx" ;;
21565 *) dflt="$static_ext"
21572 rp="What extensions do you wish to load statically?"
21575 none) static_ext=' ' ;;
21576 *) static_ext="$ans" ;;
21581 A number of extensions are supplied with $package. Answer "none"
21582 to include no extensions.
21583 Note that DynaLoader is always built and need not be mentioned here.
21586 case "$static_ext" in
21587 '') dflt="$avail_ext" ;;
21588 *) dflt="$static_ext"
21589 # Perhaps we are reusing an old out-of-date config.sh.
21592 if test X"$static_ext" != X"$avail_ext"; then
21594 NOTICE: Your previous config.sh list may be incorrect.
21595 The extensions now available to you are
21597 but the default list from your previous config.sh is
21606 : Exclude those that are not xs extensions
21610 rp="What extensions do you wish to include?"
21613 none) static_ext=' ' ;;
21614 *) static_ext="$ans" ;;
21619 # Encode is a special case. If we are building Encode as a static
21620 # extension, we need to explicitly list its subextensions as well.
21621 # For other nested extensions, this is handled automatically by
21622 # the appropriate Makefile.PL.
21623 case " $static_ext " in
21624 *" Encode "*) # Add the subextensions of Encode
21626 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21627 static_ext="$static_ext Encode/$xxx"
21633 set X $dynamic_ext $static_ext $nonxs_ext
21637 # Sanity check: We require an extension suitable for use with
21638 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21639 # should show up as failures in the test suite, but it's helpful to
21640 # catch them now.) The 'extensions' list is normally sorted
21641 # alphabetically, so we need to accept either
21642 # DB_File ... Fcntl ... IO ....
21643 # or something like
21644 # Fcntl ... NDBM_File ... IO ....
21645 case " $extensions" in
21646 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21647 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21648 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21649 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21650 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21654 : Remove libraries needed only for extensions
21655 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21656 : The exception is SunOS 4.x, which needs them.
21657 case "${osname}X${osvers}" in
21661 *) case "$usedl" in
21662 $define|true|[yY]*)
21663 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21667 *) perllibs="$libs"
21673 : Remove build directory name from cppstdin so it can be used from
21674 : either the present location or the final installed location.
21676 : Get out of the UU directory to get correct path name.
21678 case "$cppstdin" in
21680 echo "Stripping down cppstdin path name"
21686 : end of configuration questions
21688 echo "End of configuration questions."
21691 : back to where it started
21692 if test -d ../UU; then
21696 : configuration may be unconditionally patched via a 'config.arch' file
21697 if $test -f config.arch; then
21698 echo "I see a config.arch file, loading it." >&4
21702 : configuration may be patched via a 'config.over' file
21703 if $test -f config.over; then
21706 rp='I see a config.over file. Do you wish to load it?'
21709 n*) echo "OK, I'll ignore it.";;
21711 echo "Configuration override changes have been loaded."
21716 : in case they want portability, strip down executable paths
21717 case "$d_portable" in
21720 echo "Stripping down executable paths..." >&4
21721 for file in $loclist $trylist; do
21723 eval $file=`basename $temp`
21728 : create config.sh file
21730 echo "Creating config.sh..." >&4
21731 $spitshell <<EOT >config.sh
21734 # This file was produced by running the Configure script. It holds all the
21735 # definitions figured out by Configure. Should you modify one of these values,
21736 # do not forget to propagate your changes by running "Configure -der". You may
21737 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21740 # Package name : $package
21741 # Source directory : $src
21742 # Configuration time: $cf_time
21743 # Configured by : $cf_by
21744 # Target system : $myuname
21747 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21748 $spitshell <<EOT >>config.sh
21757 Revision='$Revision'
21765 alignbytes='$alignbytes'
21766 ansi2knr='$ansi2knr'
21767 aphostname='$aphostname'
21768 api_revision='$api_revision'
21769 api_subversion='$api_subversion'
21770 api_version='$api_version'
21771 api_versionstring='$api_versionstring'
21774 archlibexp='$archlibexp'
21775 archname64='$archname64'
21776 archname='$archname'
21777 archobjs='$archobjs'
21778 asctime_r_proto='$asctime_r_proto'
21786 byteorder='$byteorder'
21788 castflags='$castflags'
21791 cccdlflags='$cccdlflags'
21792 ccdlflags='$ccdlflags'
21794 ccflags_uselargefiles='$ccflags_uselargefiles'
21796 ccsymbols='$ccsymbols'
21797 ccversion='$ccversion'
21799 cf_email='$cf_email'
21804 clocktype='$clocktype'
21806 compress='$compress'
21807 contains='$contains'
21811 cpp_stuff='$cpp_stuff'
21812 cppccsymbols='$cppccsymbols'
21813 cppflags='$cppflags'
21815 cppminus='$cppminus'
21817 cppstdin='$cppstdin'
21818 cppsymbols='$cppsymbols'
21819 crypt_r_proto='$crypt_r_proto'
21820 cryptlib='$cryptlib'
21822 ctermid_r_proto='$ctermid_r_proto'
21823 ctime_r_proto='$ctime_r_proto'
21824 d_Gconvert='$d_Gconvert'
21825 d_PRIEUldbl='$d_PRIEUldbl'
21826 d_PRIFUldbl='$d_PRIFUldbl'
21827 d_PRIGUldbl='$d_PRIGUldbl'
21828 d_PRIXU64='$d_PRIXU64'
21829 d_PRId64='$d_PRId64'
21830 d_PRIeldbl='$d_PRIeldbl'
21831 d_PRIfldbl='$d_PRIfldbl'
21832 d_PRIgldbl='$d_PRIgldbl'
21833 d_PRIi64='$d_PRIi64'
21834 d_PRIo64='$d_PRIo64'
21835 d_PRIu64='$d_PRIu64'
21836 d_PRIx64='$d_PRIx64'
21837 d_SCNfldbl='$d_SCNfldbl'
21838 d__fwalk='$d__fwalk'
21839 d_access='$d_access'
21840 d_accessx='$d_accessx'
21843 d_archlib='$d_archlib'
21844 d_asctime_r='$d_asctime_r'
21847 d_attribute_format='$d_attribute_format'
21848 d_attribute_malloc='$d_attribute_malloc'
21849 d_attribute_nonnull='$d_attribute_nonnull'
21850 d_attribute_noreturn='$d_attribute_noreturn'
21851 d_attribute_pure='$d_attribute_pure'
21852 d_attribute_unused='$d_attribute_unused'
21853 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21857 d_bsdgetpgrp='$d_bsdgetpgrp'
21858 d_bsdsetpgrp='$d_bsdsetpgrp'
21859 d_builtin_choose_expr='$d_builtin_choose_expr'
21860 d_builtin_expect='$d_builtin_expect'
21862 d_c99_variadic_macros='$d_c99_variadic_macros'
21863 d_casti32='$d_casti32'
21864 d_castneg='$d_castneg'
21865 d_charvspr='$d_charvspr'
21867 d_chroot='$d_chroot'
21868 d_chsize='$d_chsize'
21870 d_clearenv='$d_clearenv'
21871 d_closedir='$d_closedir'
21872 d_cmsghdr_s='$d_cmsghdr_s'
21874 d_copysignl='$d_copysignl'
21875 d_cplusplus='$d_cplusplus'
21877 d_crypt_r='$d_crypt_r'
21879 d_ctermid='$d_ctermid'
21880 d_ctermid_r='$d_ctermid_r'
21881 d_ctime_r='$d_ctime_r'
21882 d_cuserid='$d_cuserid'
21883 d_dbl_dig='$d_dbl_dig'
21884 d_dbminitproto='$d_dbminitproto'
21885 d_difftime='$d_difftime'
21886 d_dir_dd_fd='$d_dir_dd_fd'
21888 d_dirnamlen='$d_dirnamlen'
21889 d_dlerror='$d_dlerror'
21890 d_dlopen='$d_dlopen'
21891 d_dlsymun='$d_dlsymun'
21892 d_dosuid='$d_dosuid'
21893 d_drand48_r='$d_drand48_r'
21894 d_drand48proto='$d_drand48proto'
21896 d_eaccess='$d_eaccess'
21897 d_endgrent='$d_endgrent'
21898 d_endgrent_r='$d_endgrent_r'
21899 d_endhent='$d_endhent'
21900 d_endhostent_r='$d_endhostent_r'
21901 d_endnent='$d_endnent'
21902 d_endnetent_r='$d_endnetent_r'
21903 d_endpent='$d_endpent'
21904 d_endprotoent_r='$d_endprotoent_r'
21905 d_endpwent='$d_endpwent'
21906 d_endpwent_r='$d_endpwent_r'
21907 d_endsent='$d_endsent'
21908 d_endservent_r='$d_endservent_r'
21909 d_eofnblk='$d_eofnblk'
21910 d_eunice='$d_eunice'
21911 d_faststdio='$d_faststdio'
21912 d_fchdir='$d_fchdir'
21913 d_fchmod='$d_fchmod'
21914 d_fchown='$d_fchown'
21916 d_fcntl_can_lock='$d_fcntl_can_lock'
21917 d_fd_macros='$d_fd_macros'
21918 d_fd_set='$d_fd_set'
21919 d_fds_bits='$d_fds_bits'
21920 d_fgetpos='$d_fgetpos'
21921 d_finite='$d_finite'
21922 d_finitel='$d_finitel'
21923 d_flexfnam='$d_flexfnam'
21925 d_flockproto='$d_flockproto'
21927 d_fp_class='$d_fp_class'
21928 d_fpathconf='$d_fpathconf'
21929 d_fpclass='$d_fpclass'
21930 d_fpclassify='$d_fpclassify'
21931 d_fpclassl='$d_fpclassl'
21932 d_fpos64_t='$d_fpos64_t'
21933 d_frexpl='$d_frexpl'
21934 d_fs_data_s='$d_fs_data_s'
21935 d_fseeko='$d_fseeko'
21936 d_fsetpos='$d_fsetpos'
21937 d_fstatfs='$d_fstatfs'
21938 d_fstatvfs='$d_fstatvfs'
21940 d_ftello='$d_ftello'
21942 d_futimes='$d_futimes'
21943 d_getcwd='$d_getcwd'
21944 d_getespwnam='$d_getespwnam'
21945 d_getfsstat='$d_getfsstat'
21946 d_getgrent='$d_getgrent'
21947 d_getgrent_r='$d_getgrent_r'
21948 d_getgrgid_r='$d_getgrgid_r'
21949 d_getgrnam_r='$d_getgrnam_r'
21950 d_getgrps='$d_getgrps'
21951 d_gethbyaddr='$d_gethbyaddr'
21952 d_gethbyname='$d_gethbyname'
21953 d_gethent='$d_gethent'
21954 d_gethname='$d_gethname'
21955 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21956 d_gethostbyname_r='$d_gethostbyname_r'
21957 d_gethostent_r='$d_gethostent_r'
21958 d_gethostprotos='$d_gethostprotos'
21959 d_getitimer='$d_getitimer'
21960 d_getlogin='$d_getlogin'
21961 d_getlogin_r='$d_getlogin_r'
21962 d_getmnt='$d_getmnt'
21963 d_getmntent='$d_getmntent'
21964 d_getnbyaddr='$d_getnbyaddr'
21965 d_getnbyname='$d_getnbyname'
21966 d_getnent='$d_getnent'
21967 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21968 d_getnetbyname_r='$d_getnetbyname_r'
21969 d_getnetent_r='$d_getnetent_r'
21970 d_getnetprotos='$d_getnetprotos'
21971 d_getpagsz='$d_getpagsz'
21972 d_getpbyname='$d_getpbyname'
21973 d_getpbynumber='$d_getpbynumber'
21974 d_getpent='$d_getpent'
21975 d_getpgid='$d_getpgid'
21976 d_getpgrp2='$d_getpgrp2'
21977 d_getpgrp='$d_getpgrp'
21978 d_getppid='$d_getppid'
21979 d_getprior='$d_getprior'
21980 d_getprotobyname_r='$d_getprotobyname_r'
21981 d_getprotobynumber_r='$d_getprotobynumber_r'
21982 d_getprotoent_r='$d_getprotoent_r'
21983 d_getprotoprotos='$d_getprotoprotos'
21984 d_getprpwnam='$d_getprpwnam'
21985 d_getpwent='$d_getpwent'
21986 d_getpwent_r='$d_getpwent_r'
21987 d_getpwnam_r='$d_getpwnam_r'
21988 d_getpwuid_r='$d_getpwuid_r'
21989 d_getsbyname='$d_getsbyname'
21990 d_getsbyport='$d_getsbyport'
21991 d_getsent='$d_getsent'
21992 d_getservbyname_r='$d_getservbyname_r'
21993 d_getservbyport_r='$d_getservbyport_r'
21994 d_getservent_r='$d_getservent_r'
21995 d_getservprotos='$d_getservprotos'
21996 d_getspnam='$d_getspnam'
21997 d_getspnam_r='$d_getspnam_r'
21998 d_gettimeod='$d_gettimeod'
21999 d_gmtime_r='$d_gmtime_r'
22000 d_gnulibc='$d_gnulibc'
22001 d_grpasswd='$d_grpasswd'
22002 d_hasmntopt='$d_hasmntopt'
22004 d_ilogbl='$d_ilogbl'
22005 d_inc_version_list='$d_inc_version_list'
22007 d_inetaton='$d_inetaton'
22008 d_int64_t='$d_int64_t'
22009 d_isascii='$d_isascii'
22010 d_isfinite='$d_isfinite'
22013 d_isnanl='$d_isnanl'
22014 d_killpg='$d_killpg'
22015 d_lchown='$d_lchown'
22016 d_ldbl_dig='$d_ldbl_dig'
22017 d_libm_lib_version='$d_libm_lib_version'
22019 d_localtime_r='$d_localtime_r'
22020 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22021 d_locconv='$d_locconv'
22023 d_longdbl='$d_longdbl'
22024 d_longlong='$d_longlong'
22025 d_lseekproto='$d_lseekproto'
22027 d_madvise='$d_madvise'
22028 d_malloc_good_size='$d_malloc_good_size'
22029 d_malloc_size='$d_malloc_size'
22031 d_mbstowcs='$d_mbstowcs'
22032 d_mbtowc='$d_mbtowc'
22033 d_memchr='$d_memchr'
22034 d_memcmp='$d_memcmp'
22035 d_memcpy='$d_memcpy'
22036 d_memmove='$d_memmove'
22037 d_memset='$d_memset'
22039 d_mkdtemp='$d_mkdtemp'
22040 d_mkfifo='$d_mkfifo'
22041 d_mkstemp='$d_mkstemp'
22042 d_mkstemps='$d_mkstemps'
22043 d_mktime='$d_mktime'
22046 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22047 d_modflproto='$d_modflproto'
22048 d_mprotect='$d_mprotect'
22050 d_msg_ctrunc='$d_msg_ctrunc'
22051 d_msg_dontroute='$d_msg_dontroute'
22052 d_msg_oob='$d_msg_oob'
22053 d_msg_peek='$d_msg_peek'
22054 d_msg_proxy='$d_msg_proxy'
22055 d_msgctl='$d_msgctl'
22056 d_msgget='$d_msgget'
22057 d_msghdr_s='$d_msghdr_s'
22058 d_msgrcv='$d_msgrcv'
22059 d_msgsnd='$d_msgsnd'
22061 d_munmap='$d_munmap'
22062 d_mymalloc='$d_mymalloc'
22064 d_nl_langinfo='$d_nl_langinfo'
22065 d_nv_preserves_uv='$d_nv_preserves_uv'
22066 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22067 d_off64_t='$d_off64_t'
22068 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22069 d_oldpthreads='$d_oldpthreads'
22070 d_oldsock='$d_oldsock'
22072 d_pathconf='$d_pathconf'
22074 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22075 d_phostname='$d_phostname'
22078 d_portable='$d_portable'
22079 d_printf_format_null='$d_printf_format_null'
22080 d_procselfexe='$d_procselfexe'
22081 d_pseudofork='$d_pseudofork'
22082 d_pthread_atfork='$d_pthread_atfork'
22083 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22084 d_pthread_yield='$d_pthread_yield'
22086 d_pwchange='$d_pwchange'
22087 d_pwclass='$d_pwclass'
22088 d_pwcomment='$d_pwcomment'
22089 d_pwexpire='$d_pwexpire'
22090 d_pwgecos='$d_pwgecos'
22091 d_pwpasswd='$d_pwpasswd'
22092 d_pwquota='$d_pwquota'
22095 d_random_r='$d_random_r'
22096 d_readdir64_r='$d_readdir64_r'
22097 d_readdir='$d_readdir'
22098 d_readdir_r='$d_readdir_r'
22099 d_readlink='$d_readlink'
22101 d_recvmsg='$d_recvmsg'
22102 d_rename='$d_rename'
22103 d_rewinddir='$d_rewinddir'
22105 d_safebcpy='$d_safebcpy'
22106 d_safemcpy='$d_safemcpy'
22107 d_sanemcmp='$d_sanemcmp'
22108 d_sbrkproto='$d_sbrkproto'
22109 d_scalbnl='$d_scalbnl'
22110 d_sched_yield='$d_sched_yield'
22111 d_scm_rights='$d_scm_rights'
22112 d_seekdir='$d_seekdir'
22113 d_select='$d_select'
22115 d_semctl='$d_semctl'
22116 d_semctl_semid_ds='$d_semctl_semid_ds'
22117 d_semctl_semun='$d_semctl_semun'
22118 d_semget='$d_semget'
22120 d_sendmsg='$d_sendmsg'
22121 d_setegid='$d_setegid'
22122 d_seteuid='$d_seteuid'
22123 d_setgrent='$d_setgrent'
22124 d_setgrent_r='$d_setgrent_r'
22125 d_setgrps='$d_setgrps'
22126 d_sethent='$d_sethent'
22127 d_sethostent_r='$d_sethostent_r'
22128 d_setitimer='$d_setitimer'
22129 d_setlinebuf='$d_setlinebuf'
22130 d_setlocale='$d_setlocale'
22131 d_setlocale_r='$d_setlocale_r'
22132 d_setnent='$d_setnent'
22133 d_setnetent_r='$d_setnetent_r'
22134 d_setpent='$d_setpent'
22135 d_setpgid='$d_setpgid'
22136 d_setpgrp2='$d_setpgrp2'
22137 d_setpgrp='$d_setpgrp'
22138 d_setprior='$d_setprior'
22139 d_setproctitle='$d_setproctitle'
22140 d_setprotoent_r='$d_setprotoent_r'
22141 d_setpwent='$d_setpwent'
22142 d_setpwent_r='$d_setpwent_r'
22143 d_setregid='$d_setregid'
22144 d_setresgid='$d_setresgid'
22145 d_setresuid='$d_setresuid'
22146 d_setreuid='$d_setreuid'
22147 d_setrgid='$d_setrgid'
22148 d_setruid='$d_setruid'
22149 d_setsent='$d_setsent'
22150 d_setservent_r='$d_setservent_r'
22151 d_setsid='$d_setsid'
22152 d_setvbuf='$d_setvbuf'
22156 d_shmatprototype='$d_shmatprototype'
22157 d_shmctl='$d_shmctl'
22159 d_shmget='$d_shmget'
22160 d_sigaction='$d_sigaction'
22161 d_signbit='$d_signbit'
22162 d_sigprocmask='$d_sigprocmask'
22163 d_sigsetjmp='$d_sigsetjmp'
22164 d_sitearch='$d_sitearch'
22165 d_snprintf='$d_snprintf'
22166 d_sockatmark='$d_sockatmark'
22167 d_sockatmarkproto='$d_sockatmarkproto'
22168 d_socket='$d_socket'
22169 d_socklen_t='$d_socklen_t'
22170 d_sockpair='$d_sockpair'
22171 d_socks5_init='$d_socks5_init'
22172 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22174 d_srand48_r='$d_srand48_r'
22175 d_srandom_r='$d_srandom_r'
22176 d_sresgproto='$d_sresgproto'
22177 d_sresuproto='$d_sresuproto'
22178 d_statblks='$d_statblks'
22179 d_statfs_f_flags='$d_statfs_f_flags'
22180 d_statfs_s='$d_statfs_s'
22181 d_statvfs='$d_statvfs'
22182 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22183 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22184 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22185 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22186 d_stdio_stream_array='$d_stdio_stream_array'
22187 d_stdiobase='$d_stdiobase'
22188 d_stdstdio='$d_stdstdio'
22189 d_strchr='$d_strchr'
22190 d_strcoll='$d_strcoll'
22191 d_strctcpy='$d_strctcpy'
22192 d_strerrm='$d_strerrm'
22193 d_strerror='$d_strerror'
22194 d_strerror_r='$d_strerror_r'
22195 d_strftime='$d_strftime'
22196 d_strlcat='$d_strlcat'
22197 d_strlcpy='$d_strlcpy'
22198 d_strtod='$d_strtod'
22199 d_strtol='$d_strtol'
22200 d_strtold='$d_strtold'
22201 d_strtoll='$d_strtoll'
22202 d_strtoq='$d_strtoq'
22203 d_strtoul='$d_strtoul'
22204 d_strtoull='$d_strtoull'
22205 d_strtouq='$d_strtouq'
22206 d_strxfrm='$d_strxfrm'
22207 d_suidsafe='$d_suidsafe'
22208 d_symlink='$d_symlink'
22209 d_syscall='$d_syscall'
22210 d_syscallproto='$d_syscallproto'
22211 d_sysconf='$d_sysconf'
22212 d_sysernlst='$d_sysernlst'
22213 d_syserrlst='$d_syserrlst'
22214 d_system='$d_system'
22215 d_tcgetpgrp='$d_tcgetpgrp'
22216 d_tcsetpgrp='$d_tcsetpgrp'
22217 d_telldir='$d_telldir'
22218 d_telldirproto='$d_telldirproto'
22221 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22222 d_tm_tm_zone='$d_tm_tm_zone'
22223 d_tmpnam_r='$d_tmpnam_r'
22224 d_truncate='$d_truncate'
22225 d_ttyname_r='$d_ttyname_r'
22226 d_tzname='$d_tzname'
22227 d_u32align='$d_u32align'
22228 d_ualarm='$d_ualarm'
22231 d_union_semun='$d_union_semun'
22232 d_unordered='$d_unordered'
22233 d_unsetenv='$d_unsetenv'
22234 d_usleep='$d_usleep'
22235 d_usleepproto='$d_usleepproto'
22237 d_vendorarch='$d_vendorarch'
22238 d_vendorbin='$d_vendorbin'
22239 d_vendorlib='$d_vendorlib'
22240 d_vendorscript='$d_vendorscript'
22242 d_void_closedir='$d_void_closedir'
22243 d_voidsig='$d_voidsig'
22244 d_voidtty='$d_voidtty'
22245 d_volatile='$d_volatile'
22246 d_vprintf='$d_vprintf'
22247 d_vsnprintf='$d_vsnprintf'
22249 d_waitpid='$d_waitpid'
22250 d_wcstombs='$d_wcstombs'
22251 d_wctomb='$d_wctomb'
22252 d_writev='$d_writev'
22255 db_hashtype='$db_hashtype'
22256 db_prefixtype='$db_prefixtype'
22257 db_version_major='$db_version_major'
22258 db_version_minor='$db_version_minor'
22259 db_version_patch='$db_version_patch'
22260 defvoidused='$defvoidused'
22261 direntrytype='$direntrytype'
22264 doublesize='$doublesize'
22266 drand48_r_proto='$drand48_r_proto'
22268 dynamic_ext='$dynamic_ext'
22274 endgrent_r_proto='$endgrent_r_proto'
22275 endhostent_r_proto='$endhostent_r_proto'
22276 endnetent_r_proto='$endnetent_r_proto'
22277 endprotoent_r_proto='$endprotoent_r_proto'
22278 endpwent_r_proto='$endpwent_r_proto'
22279 endservent_r_proto='$endservent_r_proto'
22280 eunicefix='$eunicefix'
22283 extensions='$extensions'
22285 fflushNULL='$fflushNULL'
22286 fflushall='$fflushall'
22288 firstmakefile='$firstmakefile'
22290 fpossize='$fpossize'
22291 fpostype='$fpostype'
22292 freetype='$freetype'
22295 full_csh='$full_csh'
22296 full_sed='$full_sed'
22297 gccansipedantic='$gccansipedantic'
22298 gccosandvers='$gccosandvers'
22299 gccversion='$gccversion'
22300 getgrent_r_proto='$getgrent_r_proto'
22301 getgrgid_r_proto='$getgrgid_r_proto'
22302 getgrnam_r_proto='$getgrnam_r_proto'
22303 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22304 gethostbyname_r_proto='$gethostbyname_r_proto'
22305 gethostent_r_proto='$gethostent_r_proto'
22306 getlogin_r_proto='$getlogin_r_proto'
22307 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22308 getnetbyname_r_proto='$getnetbyname_r_proto'
22309 getnetent_r_proto='$getnetent_r_proto'
22310 getprotobyname_r_proto='$getprotobyname_r_proto'
22311 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22312 getprotoent_r_proto='$getprotoent_r_proto'
22313 getpwent_r_proto='$getpwent_r_proto'
22314 getpwnam_r_proto='$getpwnam_r_proto'
22315 getpwuid_r_proto='$getpwuid_r_proto'
22316 getservbyname_r_proto='$getservbyname_r_proto'
22317 getservbyport_r_proto='$getservbyport_r_proto'
22318 getservent_r_proto='$getservent_r_proto'
22319 getspnam_r_proto='$getspnam_r_proto'
22320 gidformat='$gidformat'
22326 gmtime_r_proto='$gmtime_r_proto'
22327 gnulibc_version='$gnulibc_version'
22329 groupcat='$groupcat'
22330 groupstype='$groupstype'
22333 h_sysfile='$h_sysfile'
22336 html1dir='$html1dir'
22337 html1direxp='$html1direxp'
22338 html3dir='$html3dir'
22339 html3direxp='$html3direxp'
22348 i_arpainet='$i_arpainet'
22349 i_assert='$i_assert'
22350 i_bsdioctl='$i_bsdioctl'
22354 i_dirent='$i_dirent'
22360 i_fp_class='$i_fp_class'
22363 i_ieeefp='$i_ieeefp'
22364 i_inttypes='$i_inttypes'
22365 i_langinfo='$i_langinfo'
22366 i_libutil='$i_libutil'
22367 i_limits='$i_limits'
22368 i_locale='$i_locale'
22369 i_machcthr='$i_machcthr'
22370 i_malloc='$i_malloc'
22371 i_mallocmalloc='$i_mallocmalloc'
22373 i_memory='$i_memory'
22374 i_mntent='$i_mntent'
22377 i_neterrno='$i_neterrno'
22378 i_netinettcp='$i_netinettcp'
22382 i_pthread='$i_pthread'
22384 i_rpcsvcdbm='$i_rpcsvcdbm'
22387 i_shadow='$i_shadow'
22389 i_stdarg='$i_stdarg'
22390 i_stddef='$i_stddef'
22391 i_stdlib='$i_stdlib'
22392 i_string='$i_string'
22393 i_sunmath='$i_sunmath'
22394 i_sysaccess='$i_sysaccess'
22395 i_sysdir='$i_sysdir'
22396 i_sysfile='$i_sysfile'
22397 i_sysfilio='$i_sysfilio'
22399 i_sysioctl='$i_sysioctl'
22400 i_syslog='$i_syslog'
22401 i_sysmman='$i_sysmman'
22402 i_sysmode='$i_sysmode'
22403 i_sysmount='$i_sysmount'
22404 i_sysndir='$i_sysndir'
22405 i_sysparam='$i_sysparam'
22406 i_syspoll='$i_syspoll'
22407 i_sysresrc='$i_sysresrc'
22408 i_syssecrt='$i_syssecrt'
22409 i_sysselct='$i_sysselct'
22410 i_syssockio='$i_syssockio'
22411 i_sysstat='$i_sysstat'
22412 i_sysstatfs='$i_sysstatfs'
22413 i_sysstatvfs='$i_sysstatvfs'
22414 i_systime='$i_systime'
22415 i_systimek='$i_systimek'
22416 i_systimes='$i_systimes'
22417 i_systypes='$i_systypes'
22418 i_sysuio='$i_sysuio'
22420 i_sysutsname='$i_sysutsname'
22421 i_sysvfs='$i_sysvfs'
22422 i_syswait='$i_syswait'
22423 i_termio='$i_termio'
22424 i_termios='$i_termios'
22426 i_unistd='$i_unistd'
22429 i_values='$i_values'
22430 i_varargs='$i_varargs'
22431 i_varhdr='$i_varhdr'
22433 ignore_versioned_solibs='$ignore_versioned_solibs'
22434 inc_version_list='$inc_version_list'
22435 inc_version_list_init='$inc_version_list_init'
22438 initialinstalllocation='$initialinstalllocation'
22439 installarchlib='$installarchlib'
22440 installbin='$installbin'
22441 installhtml1dir='$installhtml1dir'
22442 installhtml3dir='$installhtml3dir'
22443 installman1dir='$installman1dir'
22444 installman3dir='$installman3dir'
22445 installprefix='$installprefix'
22446 installprefixexp='$installprefixexp'
22447 installprivlib='$installprivlib'
22448 installscript='$installscript'
22449 installsitearch='$installsitearch'
22450 installsitebin='$installsitebin'
22451 installsitehtml1dir='$installsitehtml1dir'
22452 installsitehtml3dir='$installsitehtml3dir'
22453 installsitelib='$installsitelib'
22454 installsiteman1dir='$installsiteman1dir'
22455 installsiteman3dir='$installsiteman3dir'
22456 installsitescript='$installsitescript'
22457 installstyle='$installstyle'
22458 installusrbinperl='$installusrbinperl'
22459 installvendorarch='$installvendorarch'
22460 installvendorbin='$installvendorbin'
22461 installvendorhtml1dir='$installvendorhtml1dir'
22462 installvendorhtml3dir='$installvendorhtml3dir'
22463 installvendorlib='$installvendorlib'
22464 installvendorman1dir='$installvendorman1dir'
22465 installvendorman3dir='$installvendorman3dir'
22466 installvendorscript='$installvendorscript'
22468 issymlink='$issymlink'
22469 ivdformat='$ivdformat'
22472 known_extensions='$known_extensions'
22475 lddlflags='$lddlflags'
22477 ldflags_uselargefiles='$ldflags_uselargefiles'
22478 ldlibpthname='$ldlibpthname'
22485 libsdirs='$libsdirs'
22486 libsfiles='$libsfiles'
22487 libsfound='$libsfound'
22488 libspath='$libspath'
22489 libswanted='$libswanted'
22490 libswanted_uselargefiles='$libswanted_uselargefiles'
22496 localtime_r_proto='$localtime_r_proto'
22497 locincpth='$locincpth'
22498 loclibpth='$loclibpth'
22499 longdblsize='$longdblsize'
22500 longlongsize='$longlongsize'
22501 longsize='$longsize'
22505 lseeksize='$lseeksize'
22506 lseektype='$lseektype'
22509 madlyobj='$madlyobj'
22510 madlysrc='$madlysrc'
22514 make_set_make='$make_set_make'
22515 mallocobj='$mallocobj'
22516 mallocsrc='$mallocsrc'
22517 malloctype='$malloctype'
22519 man1direxp='$man1direxp'
22522 man3direxp='$man3direxp'
22524 mips_type='$mips_type'
22525 mistrustnm='$mistrustnm'
22527 mmaptype='$mmaptype'
22528 modetype='$modetype'
22530 multiarch='$multiarch'
22532 myarchname='$myarchname'
22533 mydomain='$mydomain'
22534 myhostname='$myhostname'
22537 need_va_copy='$need_va_copy'
22538 netdb_hlen_type='$netdb_hlen_type'
22539 netdb_host_type='$netdb_host_type'
22540 netdb_name_type='$netdb_name_type'
22541 netdb_net_type='$netdb_net_type'
22544 nm_so_opt='$nm_so_opt'
22545 nonxs_ext='$nonxs_ext'
22547 nvEUformat='$nvEUformat'
22548 nvFUformat='$nvFUformat'
22549 nvGUformat='$nvGUformat'
22550 nv_overflows_integers_at='$nv_overflows_integers_at'
22551 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22552 nveformat='$nveformat'
22553 nvfformat='$nvfformat'
22554 nvgformat='$nvgformat'
22557 o_nonblock='$o_nonblock'
22559 old_pthread_create_joinable='$old_pthread_create_joinable'
22560 optimize='$optimize'
22561 orderlib='$orderlib'
22564 otherlibdirs='$otherlibdirs'
22568 patchlevel='$patchlevel'
22569 path_sep='$path_sep'
22572 perl_patchlevel='$perl_patchlevel'
22573 perladmin='$perladmin'
22574 perllibs='$perllibs'
22575 perlpath='$perlpath'
22577 phostname='$phostname'
22583 prefixexp='$prefixexp'
22585 privlibexp='$privlibexp'
22586 procselfexe='$procselfexe'
22587 prototype='$prototype'
22589 quadkind='$quadkind'
22590 quadtype='$quadtype'
22591 randbits='$randbits'
22592 randfunc='$randfunc'
22593 random_r_proto='$random_r_proto'
22594 randseedtype='$randseedtype'
22596 rd_nodata='$rd_nodata'
22597 readdir64_r_proto='$readdir64_r_proto'
22598 readdir_r_proto='$readdir_r_proto'
22599 revision='$revision'
22605 sPRIEUldbl='$sPRIEUldbl'
22606 sPRIFUldbl='$sPRIFUldbl'
22607 sPRIGUldbl='$sPRIGUldbl'
22608 sPRIXU64='$sPRIXU64'
22610 sPRIeldbl='$sPRIeldbl'
22611 sPRIfldbl='$sPRIfldbl'
22612 sPRIgldbl='$sPRIgldbl'
22617 sSCNfldbl='$sSCNfldbl'
22618 sched_yield='$sched_yield'
22619 scriptdir='$scriptdir'
22620 scriptdirexp='$scriptdirexp'
22622 seedfunc='$seedfunc'
22623 selectminbits='$selectminbits'
22624 selecttype='$selecttype'
22625 sendmail='$sendmail'
22626 setgrent_r_proto='$setgrent_r_proto'
22627 sethostent_r_proto='$sethostent_r_proto'
22628 setlocale_r_proto='$setlocale_r_proto'
22629 setnetent_r_proto='$setnetent_r_proto'
22630 setprotoent_r_proto='$setprotoent_r_proto'
22631 setpwent_r_proto='$setpwent_r_proto'
22632 setservent_r_proto='$setservent_r_proto'
22635 sharpbang='$sharpbang'
22636 shmattype='$shmattype'
22637 shortsize='$shortsize'
22640 sig_count='$sig_count'
22641 sig_name='$sig_name'
22642 sig_name_init='$sig_name_init'
22644 sig_num_init='$sig_num_init'
22645 sig_size='$sig_size'
22646 signal_t='$signal_t'
22647 sitearch='$sitearch'
22648 sitearchexp='$sitearchexp'
22650 sitebinexp='$sitebinexp'
22651 sitehtml1dir='$sitehtml1dir'
22652 sitehtml1direxp='$sitehtml1direxp'
22653 sitehtml3dir='$sitehtml3dir'
22654 sitehtml3direxp='$sitehtml3direxp'
22656 sitelib_stem='$sitelib_stem'
22657 sitelibexp='$sitelibexp'
22658 siteman1dir='$siteman1dir'
22659 siteman1direxp='$siteman1direxp'
22660 siteman3dir='$siteman3dir'
22661 siteman3direxp='$siteman3direxp'
22662 siteprefix='$siteprefix'
22663 siteprefixexp='$siteprefixexp'
22664 sitescript='$sitescript'
22665 sitescriptexp='$sitescriptexp'
22666 sizesize='$sizesize'
22667 sizetype='$sizetype'
22671 sockethdr='$sockethdr'
22672 socketlib='$socketlib'
22673 socksizetype='$socksizetype'
22675 spackage='$spackage'
22676 spitshell='$spitshell'
22677 srand48_r_proto='$srand48_r_proto'
22678 srandom_r_proto='$srandom_r_proto'
22680 ssizetype='$ssizetype'
22681 startperl='$startperl'
22683 static_ext='$static_ext'
22685 stdio_base='$stdio_base'
22686 stdio_bufsiz='$stdio_bufsiz'
22687 stdio_cnt='$stdio_cnt'
22688 stdio_filbuf='$stdio_filbuf'
22689 stdio_ptr='$stdio_ptr'
22690 stdio_stream_array='$stdio_stream_array'
22691 strerror_r_proto='$strerror_r_proto'
22694 subversion='$subversion'
22698 targetarch='$targetarch'
22702 timeincl='$timeincl'
22703 timetype='$timetype'
22704 tmpnam_r_proto='$tmpnam_r_proto'
22710 ttyname_r_proto='$ttyname_r_proto'
22719 uidformat='$uidformat'
22725 uquadtype='$uquadtype'
22726 use5005threads='$use5005threads'
22727 use64bitall='$use64bitall'
22728 use64bitint='$use64bitint'
22729 usecrosscompile='$usecrosscompile'
22731 usedtrace='$usedtrace'
22732 usefaststdio='$usefaststdio'
22733 useithreads='$useithreads'
22734 uselargefiles='$uselargefiles'
22735 uselongdouble='$uselongdouble'
22736 usemallocwrap='$usemallocwrap'
22737 usemorebits='$usemorebits'
22738 usemultiplicity='$usemultiplicity'
22739 usemymalloc='$usemymalloc'
22741 useopcode='$useopcode'
22742 useperlio='$useperlio'
22743 useposix='$useposix'
22744 usereentrant='$usereentrant'
22745 userelocatableinc='$userelocatableinc'
22747 useshrplib='$useshrplib'
22748 usesitecustomize='$usesitecustomize'
22749 usesocks='$usesocks'
22750 usethreads='$usethreads'
22751 usevendorprefix='$usevendorprefix'
22752 usevfork='$usevfork'
22755 uvXUformat='$uvXUformat'
22756 uvoformat='$uvoformat'
22759 uvuformat='$uvuformat'
22760 uvxformat='$uvxformat'
22761 vendorarch='$vendorarch'
22762 vendorarchexp='$vendorarchexp'
22763 vendorbin='$vendorbin'
22764 vendorbinexp='$vendorbinexp'
22765 vendorhtml1dir='$vendorhtml1dir'
22766 vendorhtml1direxp='$vendorhtml1direxp'
22767 vendorhtml3dir='$vendorhtml3dir'
22768 vendorhtml3direxp='$vendorhtml3direxp'
22769 vendorlib='$vendorlib'
22770 vendorlib_stem='$vendorlib_stem'
22771 vendorlibexp='$vendorlibexp'
22772 vendorman1dir='$vendorman1dir'
22773 vendorman1direxp='$vendorman1direxp'
22774 vendorman3dir='$vendorman3dir'
22775 vendorman3direxp='$vendorman3direxp'
22776 vendorprefix='$vendorprefix'
22777 vendorprefixexp='$vendorprefixexp'
22778 vendorscript='$vendorscript'
22779 vendorscriptexp='$vendorscriptexp'
22781 version_patchlevel_string='$version_patchlevel_string'
22782 versiononly='$versiononly'
22784 voidflags='$voidflags'
22787 yaccflags='$yaccflags'
22792 : Add in command line options if available
22793 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22795 : add special variables
22796 $test -f $src/patchlevel.h && \
22797 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22798 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22799 echo "PERL_CONFIG_SH=true" >>config.sh
22801 : propagate old symbols
22802 if $test -f UU/config.sh; then
22803 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22804 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22805 config.sh config.sh UU/oldconfig.sh |\
22806 $sort | $uniq -u >UU/oldsyms
22807 set X `cat UU/oldsyms`
22813 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22815 echo ": Variables propagated from previous config.sh file." >>config.sh
22816 for sym in `cat UU/oldsyms`; do
22817 echo " Propagating $hint variable "'$'"$sym..."
22818 eval 'tmp="$'"${sym}"'"'
22820 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22826 : Finish up by extracting the .SH files
22830 echo "Extraction done."
22840 If you'd like to make any changes to the config.sh file before I begin
22841 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22844 rp="Press return or use a shell escape to edit config.sh:"
22849 *) : in case they cannot read
22850 sh 1>&4 -c "$ans";;
22855 : if this fails, just run all the .SH files by hand
22864 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22871 Now you need to generate make dependencies by running "$make depend".
22872 You might prefer to run it in background: "$make depend > makedepend.out &"
22873 It can take a while, so you might not want to run it right now.
22878 rp="Run $make depend now?"
22882 $make depend && echo "Now you must run '$make'."
22885 echo "You must run '$make depend' then '$make'."
22888 elif test -f [Mm]akefile; then
22890 echo "Now you must run a $make."
22892 echo "Configure done."
22895 if $test -f Policy.sh; then
22898 If you compile $package on a different machine or from a different object
22899 directory, copy the Policy.sh file from this object directory to the
22900 new one before you run Configure -- this will help you with most of
22901 the policy defaults.
22905 if $test -f config.msg; then
22906 echo "Hmm. I also noted the following information while running:"
22908 $cat config.msg >&4
22911 $rm -f kit*isdone ark*isdone