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.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Wed Jan 22 12:03:46 CET 2014 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
345 useversionedarchname=''
351 initialinstalllocation=''
380 d_attribute_deprecated=''
381 d_attribute_format=''
382 d_attribute_malloc=''
383 d_attribute_nonnull=''
384 d_attribute_noreturn=''
386 d_attribute_unused=''
387 d_attribute_warn_unused_result=''
388 d_printf_format_null=''
391 d_builtin_choose_expr=''
394 d_c99_variadic_macros=''
441 endhostent_r_proto=''
447 endprotoent_r_proto=''
453 endservent_r_proto=''
506 gethostbyaddr_r_proto=''
508 gethostbyname_r_proto=''
510 gethostent_r_proto=''
523 getnetbyaddr_r_proto=''
525 getnetbyname_r_proto=''
539 d_getprotobyname_r=''
540 getprotobyname_r_proto=''
541 d_getprotobynumber_r=''
542 getprotobynumber_r_proto=''
544 getprotoent_r_proto=''
556 getservbyname_r_proto=''
558 getservbyport_r_proto=''
560 getservent_r_proto=''
587 d_libm_lib_version=''
590 d_localtime_r_needs_tzset=''
601 d_malloc_good_size=''
645 d_old_pthread_create_joinable=''
646 old_pthread_create_joinable=''
648 d_pthread_attr_setscope=''
687 sethostent_r_proto=''
704 setprotoent_r_proto=''
716 setservent_r_proto=''
738 d_ipv6_mreq_source=''
755 d_sprintf_returns_strlen=''
767 perl_static_inline=''
772 d_stdio_ptr_lval_nochange_cnt=''
773 d_stdio_ptr_lval_sets_cnt=''
918 d_gdbm_ndbm_h_uses_prototypes=''
919 d_gdbmndbm_h_uses_prototypes=''
921 d_ndbm_h_uses_prototypes=''
995 d_inc_version_list=''
997 inc_version_list_init=''
1001 installusrbinperl=''
1017 ignore_versioned_solibs=''
1081 d_perl_otherlibdirs=''
1089 api_versionstring=''
1095 version_patchlevel_string=''
1099 d_nv_preserves_uv=''
1100 d_nv_zero_is_allbits_zero=''
1111 nv_overflows_integers_at=''
1112 nv_preserves_uv_bits=''
1184 installsitehtml1dir=''
1187 installsitehtml3dir=''
1194 installsiteman1dir=''
1197 installsiteman3dir=''
1202 installsitescript=''
1220 d_stdio_stream_array=''
1221 stdio_stream_array=''
1238 usekernprocpathname=''
1239 ccflags_uselargefiles=''
1240 ldflags_uselargefiles=''
1241 libswanted_uselargefiles=''
1250 usensgetexecutablepath=''
1263 installvendorarch=''
1270 installvendorhtml1dir=''
1272 vendorhtml1direxp=''
1273 installvendorhtml3dir=''
1275 vendorhtml3direxp=''
1281 installvendorman1dir=''
1284 installvendorman3dir=''
1291 installvendorscript=''
1302 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1305 : We must find out about Eunice early
1307 if test -f /etc/unixtovms; then
1308 eunicefix=/etc/unixtovms
1310 if test -f /etc/unixtovms.exe; then
1311 eunicefix=/etc/unixtovms.exe
1314 : Set executable suffix now -- needed before hints available
1315 if test -f "/libs/version.library"; then
1318 elif test -f "/system/gnu_library/bin/ar.pm"; then
1321 elif test -n "$DJGPP"; then
1324 elif test -f /kern/cookiejar; then
1327 elif test -d c:/. -o -n "$is_os2" ; then
1334 : Trailing extension. Override this in a hint file, if needed.
1335 : Extra object files, if any, needed on this platform.
1338 : Possible local include directories to search.
1339 : Set locincpth to "" in a hint file to defeat local include searches.
1340 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1341 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1343 : no include file wanted by default
1346 : Enable -DEBUGGING and -DDEBUGGING from the command line
1351 : change the next line if compiling for Xenix/286 on Xenix/386
1352 xlibpth='/usr/lib/386 /lib/386'
1353 : Possible local library directories to search.
1354 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1355 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1357 : general looking path for locating libraries
1358 glibpth="/lib /usr/lib $xlibpth"
1359 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1360 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1361 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1362 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1364 : Private path used by Configure to find libraries. Its value
1365 : is prepended to libpth. This variable takes care of special
1366 : machines, like the mips. Usually, it should be empty.
1369 : default library list
1371 : some systems want to use only the non-versioned libso:s
1372 ignore_versioned_solibs=''
1373 : set usethreads on the Configure command line to enable threads.
1374 usereentrant='undef'
1378 : set useposix=false in your hint file to disable the POSIX extension.
1380 : set useopcode=false in your hint file to disable the Opcode extension.
1383 ccflags_uselargefiles=''
1384 ldflags_uselargefiles=''
1385 libswanted_uselargefiles=''
1386 : set usemultiplicity on the Configure command line to enable multiplicity.
1387 : set usesocks on the Configure command line to enable socks.
1388 : List of libraries we want.
1389 : If anyone needs extra -lxxx, put those in a hint file.
1390 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1391 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1392 : We probably want to search /usr/shlib before most other libraries.
1393 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1394 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1395 glibpth="/usr/shlib $glibpth"
1396 : Do not use vfork unless overridden by a hint file.
1399 : Find the basic shell for Bourne shell scripts
1403 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1406 if test -f "$xxx"; then
1409 : Build up a list and do a single loop so we can 'break' out.
1410 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1411 for xxx in sh bash ksh pdksh ash; do
1413 try="$try ${p}/${xxx}"
1417 if test -f "$xxx"; then
1420 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1423 elif test -f "$xxx.exe"; then
1434 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1436 Usually it's in /bin/sh. How did you even get this far?
1437 Please contact me (Perl Maintainers) at perlbug@perl.org and
1438 we'll try to straighten this all out.
1444 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1445 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1448 : see if sh knows # comments
1449 if `$sh -c '#' >/dev/null 2>&1`; then
1453 test -f $xcat$_exe || xcat=/usr/bin/cat
1454 if test ! -f $xcat$_exe; then
1455 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1456 if test -f $p/cat$_exe; then
1461 if test ! -f $xcat$_exe; then
1462 echo "Can't find cat anywhere!"
1466 echo "#!$xcat" >sharp
1469 ./sharp > today 2>/dev/null
1470 if test -s today; then
1473 echo "#! $xcat" > sharp
1476 ./sharp > today 2>/dev/null
1477 if test -s today; then
1485 echo "Your $sh doesn't grok # comments--I will strip them later on."
1488 echo "exec grep -v '^[ ]*#'" >spitshell
1490 $eunicefix spitshell
1491 spitshell=`pwd`/spitshell
1493 echo "I presume that if # doesn't work, #! won't work either!"
1498 : figure out how to guarantee sh startup
1500 '') startsh=${sharpbang}${sh} ;;
1512 : echo "Yup, it does."
1514 echo "Hmm... '$startsh' does not guarantee sh startup..."
1515 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1519 : Save command line options in file UU/cmdline.opt for later use in
1520 : generating config.sh.
1521 cat > cmdline.opt <<EOSH
1522 : Configure command line arguments.
1531 cat >>cmdline.opt <<EOSH
1532 config_arg$argn='$arg'
1534 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1537 arg_exp=`cat cmdl.opt`
1538 args_exp="$args_exp$args_sep'$arg_exp'"
1539 argn=`expr $argn + 1`
1544 : produce awk script to parse command line options
1545 cat >options.awk <<'EOF'
1547 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1549 len = length(optstr);
1550 for (i = 1; i <= len; i++) {
1551 c = substr(optstr, i, 1);
1552 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1563 if (substr(str, 1, 1) != "-") {
1564 printf("'%s'\n", str);
1568 for (i = 2; i <= len; i++) {
1569 c = substr(str, i, 1);
1571 printf("-%s\n", substr(str, i));
1577 printf("'%s'\n", substr(str, i + 1));
1590 : process the command line options
1591 set X `for arg in "$@"; do echo "X$arg"; done |
1592 sed -e s/X// | awk -f options.awk`
1597 : set up default values
1607 rm -f optdef.sh posthint.sh
1608 cat >optdef.sh <<EOS
1614 while test $# -gt 0; do
1616 -d) shift; fastread=yes;;
1617 -e) shift; alldone=cont;;
1621 if test -r "$1"; then
1624 echo "$me: cannot read config file $1." >&2
1630 -h) shift; error=true;;
1631 -r) shift; reuseval=true;;
1632 -s) shift; silent=true; realsilent=true;;
1633 -E) shift; alldone=exit;;
1634 -K) shift; knowitall=true;;
1635 -O) shift; override=true;;
1636 -S) shift; silent=true; extractsh=true;;
1641 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1642 echo "$me: ignoring -D $1" >&2
1645 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1646 *) echo "$1='define'" >> optdef.sh;;
1653 *=) echo "$1" >> optdef.sh;;
1655 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1656 echo "$me: ignoring -U $1" >&2
1658 *) echo "$1='undef'" >> optdef.sh;;
1669 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1673 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1674 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1680 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1681 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1682 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1683 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1684 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1685 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1691 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1693 echo "$yyy=''" >> posthint.sh ;;
1698 echo "$yyy='$zzz'" >> posthint.sh ;;
1700 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1702 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1707 echo "$yyy=$zzz" >> posthint.sh ;;
1708 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1712 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1715 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1723 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1724 [-U symbol] [-U symbol=] [-A command:symbol...]
1725 -d : use defaults for all answers.
1726 -e : go on without questioning past the production of config.sh.
1727 -f : specify an alternate default configuration file.
1728 -h : print this help message and exit (with an error status).
1729 -r : reuse C symbols value if possible (skips costly nm extraction).
1730 -s : silent mode, only echoes questions and essential information.
1731 -D : define symbol to have some value:
1732 -D symbol symbol gets the value 'define'
1733 -D symbol=value symbol gets the value 'value'
1734 common used examples (see INSTALL for more info):
1735 -Duse64bitint use 64bit integers
1736 -Duse64bitall use 64bit integers and pointers
1737 -Dusethreads use thread support
1738 -Dinc_version_list=none do not include older perl trees in @INC
1739 -DEBUGGING=none DEBUGGING options
1740 -Dcc=gcc choose your compiler
1741 -Dprefix=/opt/perl5 choose your destination
1742 -E : stop at the end of questions, after having produced config.sh.
1743 -K : do not use unless you know what you are doing.
1744 -O : let -D and -U override definitions from loaded configuration file.
1745 -S : perform variable substitutions on all .SH files (can mix with -f)
1746 -U : undefine symbol:
1747 -U symbol symbol gets the value 'undef'
1748 -U symbol= symbol gets completely empty
1750 -A : manipulate symbol after the platform specific hints have been applied:
1751 -A append:symbol=value append value to symbol
1752 -A symbol=value like append:, but with a separating space
1753 -A define:symbol=value define symbol to have value
1754 -A clear:symbol define symbol to be ''
1755 -A define:symbol define symbol to be 'define'
1756 -A eval:symbol=value define symbol to be eval of value
1757 -A prepend:symbol=value prepend value to symbol
1758 -A undef:symbol define symbol to be 'undef'
1759 -A undef:symbol= define symbol to be ''
1760 e.g.: -A prepend:libswanted='cl pthread '
1761 -A ccflags=-DSOME_MACRO
1762 -V : print version number and exit (with a zero status).
1769 case "$fastread$alldone" in
1772 case "$extractsh" in
1775 if test ! -t 0; then
1776 echo "Say 'sh Configure', not 'sh <Configure'"
1786 true) exec 1>/dev/null;;
1789 : run the defines and the undefines, if any, but leave the file out there...
1792 : create the posthint manipulation script and leave the file out there...
1797 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1798 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1799 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1800 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1801 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1804 : Some greps do not return status, grrr.
1805 echo "grimblepritz" >grimble
1806 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1808 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1814 : the following should work in any shell
1818 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1819 cat >contains <<'EOSS'
1820 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1825 : Find the path to the source tree
1828 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1832 *) src=`cd ../$src && pwd` ;;
1845 if test -f $rsrc/Configure && \
1846 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1848 : found it, so we are ok.
1851 for src in . .. ../.. ../../.. ../../../..; do
1852 if test -f ../$src/Configure && \
1853 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1864 Sorry, I can't seem to locate the source dir for $package. Please start
1865 Configure with an explicit path -- i.e. /some/path/Configure.
1873 echo "Sources for $package found in \"$src\"." >&4
1877 : script used to extract .SH files with variable substitutions
1878 cat >extract <<'EOS'
1880 echo "Doing variable substitutions on .SH files..."
1881 if test -f MANIFEST; then
1882 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1884 echo "(Looking for .SH files under the source directory.)"
1885 set x `(cd "$src"; find . -name "*.SH" -print)`
1889 0) set x `(cd "$src"; echo *.SH)`; shift;;
1891 if test ! -f "$src/$1"; then
1897 while test $name; do
1898 if test ! -d "$name"; then
1899 create="$name $create";
1900 name=`echo $name | sed -e "s|^[^/]*$||"`;
1901 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1906 for file in $create; do
1915 dir=`expr X$file : 'X\(.*\)/'`
1916 file=`expr X$file : 'X.*/\(.*\)'`
1917 (cd "$dir" && . ./$file)
1927 dir=`expr X$file : 'X\(.*\)/'`
1928 file=`expr X$file : 'X.*/\(.*\)'`
1929 (set x $dir; shift; eval $mkdir_p)
1930 sh <"$src/$dir/$file"
1939 if test -f "$src/config_h.SH"; then
1940 if test ! -f config.h; then
1941 : oops, they left it out of MANIFEST, probably, so do it anyway.
1942 . "$src/config_h.SH"
1947 : extract files and exit if asked to do so
1948 case "$extractsh" in
1950 case "$realsilent" in
1954 case "$config_sh" in
1955 '') config_sh='config.sh';;
1958 echo "Fetching answers from $config_sh..."
1961 test "$override" && . ./optdef.sh
1965 echo "Extraction done."
1970 : Eunice requires " " instead of "", can you believe it
1973 echo "Beginning of configuration questions for $package."
1975 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1977 : first determine how to suppress newline on echo command
1979 echo "Checking echo to see how to suppress newlines..."
1980 (echo "hi there\c" ; echo " ") >.echotmp
1981 if $contains c .echotmp >/dev/null 2>&1 ; then
1992 echo $n "The star should be here-->$c"
1996 : Now test for existence of everything in MANIFEST
1998 if test -f "$rsrc/MANIFEST"; then
1999 echo "First let's make sure your kit is complete. Checking..." >&4
2000 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2001 (split -l 50 2>/dev/null || split -50)
2004 for filelist in x??; do
2005 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2006 >/dev/null 2>>"$tmppwd/missing")
2008 if test -s missing; then
2012 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2014 You have the option of continuing the configuration process, despite the
2015 distinct possibility that your kit is damaged, by typing 'y'es. If you
2016 do, don't blame me if something goes wrong. I advise you to type 'n'o
2017 and contact the author (perlbug@perl.org).
2020 echo $n "Continue? [n] $c" >&4
2024 echo "Continuing..." >&4
2028 echo "ABORTING..." >&4
2033 echo "Looks good..."
2036 echo "There is no MANIFEST file. I hope your kit is complete !"
2040 : Find the appropriate value for a newline for tr
2042 if test -n "$DJGPP"; then
2045 if test X"$trnl" = X; then
2046 case "`echo foo|tr '\n' x 2>/dev/null`" in
2050 if test X"$trnl" = X; then
2051 case "`echo foo|tr '\012' x 2>/dev/null`" in
2052 foox) trnl='\012' ;;
2055 if test X"$trnl" = X; then
2056 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2057 fooxy) trnl='\n\r' ;;
2060 if test X"$trnl" = X; then
2063 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2069 : compute the number of columns on the terminal for proper question formatting
2074 : set up the echo used in my read
2075 myecho="case \"\$xxxm\" in
2076 '') echo $n \"\$rp $c\" >&4;;
2078 '') echo $n \"[\$xxxm] $c\";;
2080 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2082 echo $n \"[\$xxxm] $c\" >&4
2084 echo $n \"\$rp [\$xxxm] $c\" >&4
2090 : now set up to do reads with possible shell escape and default assignment
2096 case "\$fastread" in
2097 yes) case "\$dflt" in
2100 case "\$silent-\$rp" in
2105 *) case "\$silent" in
2106 true) case "\$rp" in
2111 while expr "X\$ans" : "X!" >/dev/null; do
2115 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2123 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2132 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2137 echo "(OK, I'll run with -d after this question.)" >&4
2140 echo "*** Sorry, \$1 not supported yet." >&4
2150 echo "*** Substitution done -- please confirm."
2152 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2157 echo "*** Error -- try again."
2164 case "\$ans\$xxxm\$nostick" in
2176 : create .config dir to save info across Configure sessions
2177 test -d ../.config || mkdir ../.config
2178 cat >../.config/README <<EOF
2179 This directory created by Configure to save information that should
2180 persist across sessions for $package.
2182 You may safely delete it if you wish.
2185 : See if we are using a devel version and want that
2186 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2189 usedevel="$define" ;;
2190 *) case "$xversion" in
2193 *** WHOA THERE!!! ***
2195 This is an UNSTABLE DEVELOPMENT release.
2196 The version of this $package distribution is $xversion, that is, odd,
2197 (as opposed to even) and that signifies a development release.
2198 If you want a maintenance release, you want an even-numbered version.
2200 Do ***NOT*** install this into production use.
2201 Data corruption and crashes are possible.
2203 It is most seriously suggested that you do not continue any further
2204 unless you want to help in developing and debugging Perl.
2206 If you *still* want to build perl, you can answer 'y' now,
2207 or pass -Dusedevel to Configure.
2210 rp='Do you really want to continue?'
2214 [yY]) echo >&4 "Okay, continuing."
2215 usedevel="$define" ;;
2216 *) echo >&4 "Okay, bye."
2227 case "$versiononly" in
2228 '') versiononly="$define" ;;
2230 case "$installusrbinperl" in
2231 '') installusrbinperl="$undef" ;;
2236 : general instructions
2239 user=`(logname) 2>/dev/null`
2241 '') user=`whoami 2>&1`;;
2243 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2246 rp='Would you like to see the instructions?'
2257 This installation shell script will examine your system and ask you questions
2258 to determine how the perl5 package should be installed. If you get
2259 stuck on a question, you may use a ! shell escape to start a subshell or
2260 execute a command. Many of the questions will have default answers in square
2261 brackets; typing carriage return will give you the default.
2263 On some of the questions which ask for file or directory names you are allowed
2264 to use the ~name construct to specify the login directory belonging to "name",
2265 even if you don't have a shell which knows about that. Questions where this is
2266 allowed will be marked "(~name ok)".
2270 dflt='Type carriage return to continue'
2274 The prompter used in this script allows you to use shell variables and
2275 backticks in your answers. You may use $1, $2, etc... to refer to the words
2276 in the default answer, as if the default line was a set of arguments given to a
2277 script shell. This means you may also use $* to repeat the whole default line,
2278 so you do not have to re-type everything to add something to the default.
2280 Every time there is a substitution, you will have to confirm. If there is an
2281 error (e.g. an unmatched backtick), the default answer will remain unchanged
2282 and you will be prompted again.
2284 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2285 the questions and use the computed defaults (or the previous answers if there
2286 was already a config.sh file). Type 'Configure -h' for a list of options.
2287 You may also start interactively and then answer '& -d' at any prompt to turn
2288 on the non-interactive behaviour for the remainder of the execution.
2294 Much effort has been expended to ensure that this shell script will run on any
2295 Unix system. If despite that it blows up on yours, your best bet is to edit
2296 Configure and run it again. If you can't run Configure for some reason,
2297 you'll have to generate a config.sh file by hand. Whatever problems you
2298 have, let me (perlbug@perl.org) know how I blew it.
2300 This installation script affects things in two ways:
2302 1) it may do direct variable substitutions on some of the files included
2304 2) it builds a config.h file for inclusion in C programs. You may edit
2305 any of these files as the need arises after running this script.
2307 If you make a mistake on a question, there is no easy way to back up to it
2308 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2309 files. Configure will offer to let you do this before it runs the SH files.
2312 dflt='Type carriage return to continue'
2314 case "$firsttime" in
2315 true) echo $user >>../.config/instruct;;
2319 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2320 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2321 if test "X$sysroot" = X; then
2326 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2327 # _sysroot is used in places where we need --sysroot=foo
2328 # but using the rest of the flags could cause issues.
2329 _sysroot="--sysroot=$sysroot";
2333 ccflags="$ccflags $_sysroot"
2338 ldflags="$ldflags $_sysroot"
2343 cppflags="$cppflags $_sysroot"
2345 # lddlflags updated below in lddlflags section;
2346 # same with cccdlflags
2350 # Adjust some defaults to also use $sysroot
2351 for var in xlibpth loclibpth locincpth glibpth; do
2354 for path in $xxx; do
2355 eval $var=\"\$$var $sysroot$path\"
2361 : find out where common programs are
2363 echo "Locating common programs..." >&4
2376 if test -d \$dir/\$thing; then
2382 for thisthing in \$dir/\$thing; do
2383 : just loop through to pick last item
2385 if test -f \$thisthing; then
2388 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2391 elif test -f \$dir/\$thing.exe; then
2392 if test -n "$DJGPP"; then
2393 echo \$dir/\$thing.exe
2394 elif test "$eunicefix" != ":"; then
2395 : on Eunice apparently
2448 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2449 pth="$pth $sysroot/lib $sysroot/usr/lib"
2450 for file in $loclist; do
2454 if test -f "$xxx"; then
2457 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2458 xxx=`./loc $file $file $pth`
2461 '') xxx=`./loc $file $file $pth`;;
2462 *) xxx=`./loc $xxx $xxx $pth`;;
2464 eval $file=$xxx$_exe
2468 echo $file is in $xxx.
2471 echo $file is in $xxx.
2474 echo "I don't know where '$file' is, and my life depends on it." >&4
2475 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2481 echo "Don't worry if any of the following aren't found..."
2483 for file in $trylist; do
2487 if test -f "$xxx"; then
2490 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2491 xxx=`./loc $file $file $pth`
2494 '') xxx=`./loc $file $file $pth`;;
2495 *) xxx=`./loc $xxx $xxx $pth`;;
2497 eval $file=$xxx$_exe
2501 echo $file is in $xxx.
2504 echo $file is in $xxx.
2507 echo "I don't see $file out there, $say."
2514 echo "Substituting grep for egrep."
2521 *) if $less -R </dev/null >/dev/null; then
2522 echo "Substituting less -R for less."
2530 echo "Substituting cp for ln."
2539 echo "I can't find make or gmake, and my life depends on it." >&4
2540 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2548 *) # We can't have osname yet.
2549 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2550 # Assume that gmake, if found, is definitely GNU make
2551 # and prefer it over the system make.
2552 echo "Substituting gmake for make."
2560 echo "Hopefully test is built into your sh."
2563 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2564 echo "Using the test built into your sh."
2572 echo "Hopefully echo is built into your sh."
2577 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2578 $echo $n "hi there$c" >foo1
2579 echo $n "hi there$c" >foo2
2580 if cmp foo1 foo2 >/dev/null 2>&1; then
2581 echo "They are compatible. In fact, they may be identical."
2588 They are not compatible! You are probably running ksh on a non-USG system.
2589 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2590 have echo built in and we may have to run some Bourne shell scripts. That
2591 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2594 $echo $n "The star should be here-->$c"
2601 # This question was auctioned at YAPC::Europe-2007 in Vienna
2602 # I never promised you could answer it. I only auctioned the question.
2604 The following message is sponsored by
2606 Dresden.pm<--The stars should be here.
2608 Dear Perl user, system administrator or package
2609 maintainer, the Perl community sends greetings to
2610 you. Do you (emblematical) greet back [Y/n]? n
2614 : Check what type of C compiler we use
2618 cat <<'EOSC' >>trygcc
2623 int main(int argc, char *argv[]) {
2627 if $cc -o try $ccflags $ldflags try.c; then
2630 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2636 # Skip this test because it gives a false match on output like:
2637 # ./trygcc: line 23: cc: command not found
2638 # case "`$cc -v -c try.c 2>&1`" in
2639 # *gcc*) trygcc=no ;;
2641 if $test X"$trygcc" = Xyes; then
2642 if gcc -o try -c try.c; then
2644 echo "You seem to have a working gcc, though." >&4
2645 # Switching compilers may undo the work of hints files.
2646 # The most common problem is -D_REENTRANT for threads.
2647 # This heuristic catches that case, but gets false positives
2648 # if -Dusethreads was not actually specified. Better to
2649 # bail out here with a useful message than fail
2650 # mysteriously later. Should we perhaps just try to
2651 # re-invoke Configure -Dcc=gcc config_args ?
2652 if $test -f usethreads.cbu; then
2655 *** However, any setting of the C compiler flags (e.g. for thread support)
2656 *** will be lost. It may be necessary for you to restart Configure and
2657 *** add -Dcc=gcc to your Configure command line.
2660 rp="Would you like to go ahead and try gcc anyway?"
2663 rp="Would you like to use it?"
2666 if $test -f myread; then
2669 if $test -f UU/myread; then
2672 echo "Cannot find myread, sorry. Aborting." >&2
2677 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2690 cat <<'EOSC' >>checkcc
2695 int main(int argc, char *argv[]) {
2699 if $cc -o try $ccflags $ldflags try.c; then
2702 if $test X"$despair" = Xyes; then
2703 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2706 You need to find a working C compiler.
2707 Either (purchase and) install the C compiler supplied by your OS vendor,
2708 or for a free C compiler try http://gcc.gnu.org/
2709 I cannot continue any further, aborting.
2718 : determine whether symbolic links are supported
2721 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2722 echo "Symbolic links are supported." >&4
2725 echo "Symbolic links are NOT supported." >&4
2730 : determine whether symbolic links are supported
2734 echo "Checking how to test for symbolic links..." >&4
2736 if $test "X$issymlink" = X; then
2738 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2739 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2741 if test $? = 0; then
2744 echo "Your builtin 'test -h' may be broken." >&4
2747 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2750 if test -f "$p/$test"; then
2759 echo "Trying external '$test -h'." >&4
2760 issymlink="$test -h"
2761 if $test ! -h sym >/dev/null 2>&1; then
2762 echo "External '$test -h' is broken, too." >&4
2770 if $test "X$issymlink" = X; then
2771 if $test -L sym 2>/dev/null; then
2772 issymlink="$test -L"
2773 echo "The builtin '$test -L' worked." >&4
2776 if $test "X$issymlink" != X; then
2777 echo "You can test for symbolic links with '$issymlink'." >&4
2779 echo "I do not know how you can test for symbolic links." >&4
2783 *) echo "No symbolic links, so not testing for their testing..." >&4
2788 : Make symlinks util
2789 case "$mksymlinks" in
2792 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2795 *) case "$lns:$issymlink" in
2796 *"ln"*" -s:"*"test -"?)
2797 echo "Creating the symbolic links..." >&4
2798 echo "(First creating the subdirectories...)" >&4
2800 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2802 test -z "$directory" && break
2806 if test ! -d t/base; then
2807 echo "Failed to create the subdirectories. Aborting." >&4
2810 echo "(Then creating the symlinks...)" >&4
2811 awk '{print $1}' $src/MANIFEST | while true; do
2813 test -z "$filename" && break
2814 if test -f $filename; then
2815 if $issymlink $filename; then
2819 if test -f $filename; then
2820 echo "$filename already exists, not symlinking."
2822 ln -s $src/$filename $filename
2826 if test ! -f t/base/lex.t; then
2827 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2832 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2840 : Check for Cross-Compilation
2841 if $test "X$targethost" = "X"; then
2844 case "$usecrosscompile" in
2846 $echo "Cross-compiling..."
2849 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2850 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2851 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2852 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2853 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2854 # leave out ld, choosing it is more complex
2855 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2856 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2857 # We are in a weird spot. Just before us, some values
2858 # were 'saved', to be restored after the hints are
2859 # run. This means that the changes we made to ar,
2860 # nm and ranlib will get reverted.
2861 # To avoid that, we hijack the saving mechanism and
2862 # have it save our new values.
2863 for file in ar nm ranlib; do
2865 eval $file=$xxx$_exe
2870 case "$targetarch" in
2871 '') echo "Targetarch not defined." >&4; croak=y ;;
2872 *) echo "Using targetarch $targetarch." >&4 ;;
2874 case "$targethost" in
2875 '') echo "Targethost not defined." >&4; croak=y ;;
2876 *) echo "Using targethost $targethost." >&4
2881 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2883 : compile a host miniperl and generate_uudmap, unless we got passed them
2884 if $test "X$hostperl" = X; then
2885 echo "Building host miniperl and generate_uudmap binaries" >&4
2890 test -d $src/host || mkdir $src/host
2891 cd $src/host && rm -rf ./*
2892 $src/Configure -des -Dusedevel -Dmksymlinks
2894 case "$hostgenerate" in
2895 '') $make generate_uudmap
2896 hostgenerate=$src/host/generate_uudmap
2898 "$undef") hostgenerate=''
2901 hostperl=$src/host/miniperl
2904 hostosname=`$hostperl -le 'print $^O'`
2907 usecrosscompile="$undef"
2911 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2912 case "$targethost" in
2913 '') echo "Checking for cross-compile" >&4
2914 case "$usecrosscompile$multiarch" in
2915 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2916 if [ -f Makefile ]; then
2918 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2920 echo "Configure done."
2924 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2931 *) echo "Using targethost $targethost." >&4
2933 /*) run=$src/Cross/run
2934 targetmkdir=$src/Cross/mkdir
2936 from=$src/Cross/from
2938 *) pwd=`$test -f ../Configure & cd ..; pwd`
2940 targetmkdir=$pwd/Cross/mkdir
2942 from=$pwd/Cross/from
2945 case "$targetrun" in
2946 '') targetrun=ssh ;;
2951 case "$targetfrom" in
2952 '') targetfrom=scp ;;
2956 from=$from-$targetfrom
2957 case "$targetdir" in
2959 echo "Guessing targetdir $targetdir." >&4
2962 case "$targetuser" in
2964 echo "Guessing targetuser $targetuser." >&4
2967 case "$targetport" in
2969 echo "Guessing targetport $targetport." >&4
2972 case "$targetfrom" in
2976 case "$targetrun" in
2996 '') cwd=$targetdir ;;
3001 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3007 *) echo "Unknown targetrun '$targetrun'" >&4
3011 case "$targetmkdir" in
3013 cat >$targetmkdir <<EOF
3015 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3017 $chmod a+rx $targetmkdir
3019 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3031 $targetmkdir \`dirname \$f\`
3032 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f || exit 1
3035 $targetmkdir $targetdir/\`dirname \$f\`
3036 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3049 $mkdir -p $targetdir/\`dirname \$f\`
3050 $cp \$f $targetdir/\$f || exit 1
3053 $targetmkdir $targetdir/\`dirname \$f\`
3054 $cp \$f $targetdir/\$f || exit 1
3061 *) echo "Unknown targetto '$targetto'" >&4
3065 case "$targetfrom" in
3072 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3077 cp) cat >$from <<EOF
3082 cp $targetdir/\$f . || exit 1
3087 *) echo "Unknown targetfrom '$targetfrom'" >&4
3091 if $test ! -f $run; then
3092 echo "Target 'run' script '$run' not found." >&4
3096 if $test ! -f $to; then
3097 echo "Target 'to' script '$to' not found." >&4
3101 if $test ! -f $from; then
3102 echo "Target 'from' script '$from' not found." >&4
3106 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3110 Using '$run' for remote execution,
3111 and '$from' and '$to'
3112 for remote file transfer.
3118 usecrosscompile="$undef"
3123 : see whether [:lower:] and [:upper:] are supported character classes
3125 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3127 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3131 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3132 # (0xd9 and 0xe2), therefore that is a nice testing point.
3133 if test "X$up" = X -o "X$low" = X; then
3134 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3140 if test "X$up" = X -o "X$low" = X; then
3141 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3147 if test "X$up" = X -o "X$low" = X; then
3148 case "`echo RS | od -x 2>/dev/null`" in
3150 echo "Hey, this might be EBCDIC." >&4
3151 if test "X$up" = X -o "X$low" = X; then
3152 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3153 rs) up='[A-IJ-RS-Z]'
3158 if test "X$up" = X -o "X$low" = X; then
3159 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3169 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3171 echo "Using $up and $low to convert case." >&4
3174 echo "I don't know how to translate letters from upper to lower case." >&4
3175 echo "Your tr is not acting any way I know of." >&4
3179 : set up the translation script tr, must be called with ./tr of course
3183 '[A-Z][a-z]') exec $tr '$up' '$low';;
3184 '[a-z][A-Z]') exec $tr '$low' '$up';;
3191 : Try to determine whether config.sh was made on this system
3192 case "$config_sh" in
3194 myuname=`$uname -a 2>/dev/null`
3195 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3196 # Downcase everything to avoid ambiguity.
3197 # Remove slashes and single quotes so we can use parts of this in
3198 # directory and file names.
3199 # Remove newlines so myuname is sane to use elsewhere.
3200 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3201 # because the A-Z/a-z are not consecutive.
3202 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3203 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3204 newmyuname="$myuname"
3206 case "$knowitall" in
3208 if test -f ../config.sh; then
3209 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3210 eval "`grep myuname= ../config.sh`"
3212 if test "X$myuname" = "X$newmyuname"; then
3220 : Get old answers from old config file if Configure was run on the
3221 : same system, otherwise use the hints.
3224 if test -f config.sh; then
3226 rp="I see a config.sh file. Shall I use it to set the defaults?"
3229 n*|N*) echo "OK, I'll ignore it."
3230 mv config.sh config.sh.old
3231 myuname="$newmyuname"
3233 *) echo "Fetching default answers from your old config.sh file..." >&4
3241 : Older versions did not always set $sh. Catch re-use of such
3251 if test ! -f config.sh; then
3254 First time through, eh? I have some defaults handy for some systems
3255 that need some extra help getting the Configure answers right:
3258 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3260 : Half the following guesses are probably wrong... If you have better
3261 : tests or hints, please send them to perlbug@perl.org
3262 : The metaconfig authors would also appreciate a copy...
3263 $test -f /irix && osname=irix
3264 $test -f /xenix && osname=sco_xenix
3265 $test -f /dynix && osname=dynix
3266 $test -f /dnix && osname=dnix
3267 $test -f /lynx.os && osname=lynxos
3268 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3269 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3270 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3271 $test -f /bin/mips && /bin/mips && osname=mips
3272 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3273 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3274 $test -d /usr/apollo/bin && osname=apollo
3275 $test -f /etc/saf/_sactab && osname=svr4
3276 $test -d /usr/include/minix && osname=minix
3277 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3278 if $test -d /MachTen -o -d /MachTen_Folder; then
3280 if $test -x /sbin/version; then
3281 osvers=`/sbin/version | $awk '{print $2}' |
3282 $sed -e 's/[A-Za-z]$//'`
3283 elif $test -x /usr/etc/version; then
3284 osvers=`/usr/etc/version | $awk '{print $2}' |
3285 $sed -e 's/[A-Za-z]$//'`
3291 $test -f /sys/posix.dll &&
3292 $test -f /usr/bin/what &&
3293 set X `/usr/bin/what /sys/posix.dll` &&
3294 $test "$3" = UWIN &&
3298 if $test -f $uname; then
3306 umips) osname=umips ;;
3309 [23]100) osname=mips ;;
3310 next*) osname=next ;;
3312 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3313 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3316 elif $test -f /etc/kconfig; then
3318 if test "$lns" = "$ln -s"; then
3320 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3322 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3329 if test -n "$DJGPP"; then
3338 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3340 # oslevel can fail with:
3341 # oslevel: Unable to acquire lock.
3342 *not\ found) osvers="$4"."$3" ;;
3343 '<3240'|'<>3240') osvers=3.2.0 ;;
3344 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3345 '=3250'|'>3250') osvers=3.2.5 ;;
3349 bitrig) osname=bitrig
3352 bsd386) osname=bsd386
3355 cygwin*) osname=cygwin
3358 *dc.osx) osname=dcosx
3364 domainos) osname=apollo
3370 dragonfly) osname=dragonfly
3373 dynixptx*) osname=dynixptx
3374 osvers=`echo "$4"|sed 's/^v//'`
3376 freebsd) osname=freebsd
3378 genix) osname=genix ;;
3382 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3395 $test -f /system/lib/libandroid.so && osname=linux-android
3399 netbsd*) osname=netbsd
3402 news-os) osvers="$3"
3404 4*) osname=newsos4 ;;
3408 next*) osname=next ;;
3409 nonstop-ux) osname=nonstopux ;;
3410 openbsd) osname=openbsd
3416 POSIX-BC | posix-bc ) osname=posix-bc
3419 powerux | power_ux | powermax_os | powermaxos | \
3420 powerunix | power_unix) osname=powerux
3426 solaris) osname=solaris
3428 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3435 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3439 titanos) osname=titanos
3448 ultrix) osname=ultrix
3451 osf1|mls+) case "$5" in
3454 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3457 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3460 hp*) osname=hp_osf1 ;;
3461 mips) osname=mips_osf1 ;;
3464 # UnixWare 7.1.2 is known as Open UNIX 8
3465 openunix|unixware) osname=svr5
3473 $2) case "$osname" in
3477 : svr4.x or possibly later
3487 if test -f /stand/boot ; then
3488 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3489 if test -n "$INITPROG" -a -f "$INITPROG"; then
3490 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3491 if test -n "$isesix"; then
3499 *) if test -f /etc/systemid; then
3501 set `echo $3 | $sed 's/\./ /g'` $4
3502 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3504 elif $test -f $src/hints/sco_$1_$2.sh; then
3506 elif $test -f $src/hints/sco_$1.sh; then
3511 '') : Still unknown. Probably a generic Sys V.
3520 *) case "$osname" in
3521 '') : Still unknown. Probably a generic BSD.
3529 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3530 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3531 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3534 $rm -f UU/kernel.what
3535 elif test -d c:/. -o -n "$is_os2" ; then
3542 case "$targetarch" in
3545 case "$targetarch" in
3547 # Will load qnx.sh, which should change osname to nto
3552 # Catch arm-linux-androideabi, mipsel-linux-android,
3553 # and i686-linux-android
3554 osname=linux-android
3558 # Something like arm-linux-gnueabihf is really just
3565 # XXX perhaps we should just assume
3566 # osvers to be 2, or maybe take the value
3567 # from targetarch. Using $run before the
3568 # hints are run is somewhat icky.
3569 set X `$run $uname -a 2>/dev/null`
3572 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3577 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3584 : Now look for a hint file osname_osvers, unless one has been
3585 : specified already.
3588 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3589 : Also try without trailing minor version numbers.
3590 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3591 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3592 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3593 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3596 *) case "$osvers" in
3599 *) if $test -f $src/hints/$file.sh ; then
3601 elif $test -f $src/hints/$xfile.sh ; then
3603 elif $test -f $src/hints/$xxfile.sh ; then
3605 elif $test -f $src/hints/$xxxfile.sh ; then
3607 elif $test -f $src/hints/$xxxxfile.sh ; then
3609 elif $test -f "$src/hints/${osname}.sh" ; then
3618 if $test -f Policy.sh ; then
3621 none) dflt="Policy" ;;
3622 *) dflt="Policy $dflt" ;;
3627 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3631 if $test -f Policy.sh ; then
3634 There's also a Policy hint file available, which should make the
3635 site-specific (policy) questions easier to answer.
3642 You may give one or more space-separated answers, or "none" if appropriate.
3643 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3644 previous run of Configure, you may specify it as well as or instead of
3645 OS-specific hints. If hints are provided for your OS, you should use them:
3646 although Perl can probably be built without hints on many platforms, using
3647 hints often improve performance and may enable features that Configure can't
3648 set up on its own. If there are no hints that match your OS, specify "none";
3649 DO NOT give a wrong version or a wrong OS.
3653 rp="Which of these apply, if any?"
3656 for file in $tans; do
3657 if $test X$file = XPolicy -a -f Policy.sh; then
3659 $cat Policy.sh >> UU/config.sh
3660 elif $test -f $src/hints/$file.sh; then
3661 . $src/hints/$file.sh
3662 $cat $src/hints/$file.sh >> UU/config.sh
3663 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3666 : Give one chance to correct a possible typo.
3667 echo "$file.sh does not exist"
3669 rp="hint to use instead?"
3671 for file in $ans; do
3672 if $test -f "$src/hints/$file.sh"; then
3673 . $src/hints/$file.sh
3674 $cat $src/hints/$file.sh >> UU/config.sh
3675 elif $test X$ans = X -o X$ans = Xnone ; then
3678 echo "$file.sh does not exist -- ignored."
3685 : Remember our hint file for later.
3686 if $test -f "$src/hints/$file.sh" ; then
3696 echo "Fetching default answers from $config_sh..." >&4
3700 cp $config_sh config.sh 2>/dev/null
3710 test "$override" && . ./optdef.sh
3712 : Restore computed paths
3713 for file in $loclist $trylist; do
3714 eval $file="\$_$file"
3719 Configure uses the operating system name and version to set some defaults.
3720 The default value is probably right if the name rings a bell. Otherwise,
3721 since spelling matters for me, either accept the default or answer "none"
3728 ''|' '|none) dflt=none ;;
3729 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3732 *) dflt="$osname" ;;
3734 rp="Operating system name?"
3738 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3744 ''|' '|none) dflt=none ;;
3745 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3746 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3748 ''|' ') dflt=none ;;
3753 *) dflt="$osvers" ;;
3755 rp="Operating system version?"
3765 : who configured the system
3766 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3769 cf_by=`(logname) 2>/dev/null`
3772 cf_by=`(whoami) 2>/dev/null`
3774 "") cf_by=unknown ;;
3779 : decide how portable to be. Allow command line overrides.
3780 case "$d_portable" in
3782 *) d_portable="$define" ;;
3785 : set up shell script to do ~ expansion
3791 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3794 if $test -f /bin/csh; then
3795 /bin/csh -f -c "glob \$1"
3800 name=\`$expr x\$1 : '..\([^/]*\)'\`
3801 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3802 if $test ! -d "\$dir"; then
3804 echo "\$me: can't locate home directory for: \$name" >&2
3809 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3825 : now set up to get a file name
3829 cat <<'EOSC' >>getfile
3845 : getfile will accept an answer from the comma-separated list
3846 : enclosed in parentheses even if it does not meet other criteria.
3847 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3848 fn=`echo $fn | sed 's/(.*)//'`
3854 loc_file=`expr $fn : '.*:\(.*\)'`
3855 fn=`expr $fn : '\(.*\):.*'`
3863 */*) fullpath=true;;
3872 *e*) exp_file=true;;
3875 *p*) nopath_ok=true;;
3880 *d*) type='Directory';;
3881 *l*) type='Locate';;
3886 Locate) what='File';;
3891 case "$d_portable" in
3899 while test "$type"; do
3904 true) rp="$rp (~name ok)";;
3907 if test -f UU/getfile.ok && \
3908 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3927 value=`UU/filexp $ans`
3930 if test "$ans" != "$value"; then
3931 echo "(That expands to $value on this system.)"
3945 /*) value="$ansexp" ;;
3946 [a-zA-Z]:/*) value="$ansexp" ;;
3951 echo "I shall only accept a full path name, as in /bin/ls." >&4
3952 echo "Use a ! shell escape if you wish to check pathnames." >&4
3955 echo "Please give a full path name, starting with slash." >&4
3958 echo "Note that using ~name is ok provided it expands well." >&4
3971 for fp in $gfpth; do
3972 if test "X$fp" = X.; then
3977 if test -f "$pf"; then
3979 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3981 echo "($value is not a plain file, but that's ok.)"
3984 if test X"$type" = X; then
3991 for fp in $gfpth; do
3992 if test "X$fp" = X.; then
3997 direxp="$fp/$ansexp"
3999 if test -d "$direxp"; then
4007 if test -d "$ansexp"; then
4008 echo "(Looking for $loc_file in directory $value.)"
4009 value="$value/$loc_file"
4010 ansexp="$ansexp/$loc_file"
4012 if test -f "$ansexp"; then
4015 case "$nopath_ok" in
4016 true) case "$value" in
4018 *) echo "Assuming $value will be in people's path."
4034 if test "$fastread" = yes; then
4039 rp="$what $value doesn't exist. Use that name anyway?"
4058 test "X$gfpthkeep" != Xy && gfpth=""
4061 : determine root of directory hierarchy where package will be installed.
4064 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4067 dflt=`echo "$prefix" | sed 's/.$//'`
4075 By default, $package will be installed in $dflt/bin, manual pages
4076 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4077 installation directories. Typically this is something like /usr/local.
4078 If you wish to have binaries under /usr/bin but other parts of the
4079 installation under /usr/local, that's ok: you will be prompted
4080 separately for each of the installation directories, the prefix being
4081 only used to set the defaults.
4085 rp='Installation prefix to use?'
4093 *) oldprefix="$prefix";;
4100 : allow them to override the AFS root
4103 *) afsroot=$afsroot ;;
4109 $define|true) afs=true ;;
4110 $undef|false) afs=false ;;
4111 *) if $test -d $afsroot; then
4119 echo "AFS may be running... I'll be extra cautious then..." >&4
4121 echo "AFS does not seem to be running..." >&4
4124 : determine installation prefix for where package is to be installed.
4128 Since you are running AFS, I need to distinguish the directory in which
4129 files will reside from the directory in which they are installed (and from
4130 which they are presumably copied to the former directory by occult means).
4133 case "$installprefix" in
4134 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4135 *) dflt="$installprefix";;
4140 In some special cases, particularly when building $package for distribution,
4141 it is convenient to distinguish the directory in which files should be
4142 installed from the directory ($prefix) in which they will
4143 eventually reside. For most users, these two directories are the same.
4146 case "$installprefix" in
4148 *) dflt=$installprefix;;
4152 rp='What installation prefix should I use for installing files?'
4154 installprefix="$ans"
4155 installprefixexp="$ansexp"
4157 : Perform the prefixexp/installprefixexp correction if necessary
4158 cat <<EOS >installprefix
4161 cat <<'EOSC' >>installprefix
4162 : Change installation prefix, if necessary.
4163 if $test X"$prefix" != X"$installprefix"; then
4164 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4166 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4169 chmod +x installprefix
4170 $eunicefix installprefix
4172 : Set variables such as privlib and privlibexp from the output of ./getfile
4173 : performing the prefixexp/installprefixexp correction if necessary.
4174 cat <<EOS >setprefixvar
4177 cat <<'EOSC' >>setprefixvar
4178 eval "${prefixvar}=\"\$ans\""
4179 eval "${prefixvar}exp=\"\$ansexp\""
4182 chmod +x setprefixvar
4183 $eunicefix setprefixvar
4185 : set up the script used to warn in case of inconsistency
4194 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4196 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4197 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4202 echo "*** WHOA THERE!!! ***" >&4
4203 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4206 rp=" Keep the $hint value?"
4209 y) td=$was; tu=$was;;
4213 : function used to set '$1' to '$val'
4214 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4216 $define$undef) . ./whoa; eval "$var=\$td";;
4217 $undef$define) . ./whoa; eval "$var=\$tu";;
4218 *) eval "$var=$val";;
4221 : get the patchlevel
4223 echo "Getting the current patchlevel..." >&4
4224 if $test -r $rsrc/patchlevel.h;then
4225 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4226 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4227 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4228 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4229 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4230 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4231 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4240 $echo "(You do not have patchlevel.h. Eek.)"
4242 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4243 version_patchlevel_string="version $patchlevel subversion $subversion"
4244 case "$perl_patchlevel" in
4246 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4247 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4251 $echo "(You have $package $version_patchlevel_string.)"
4255 : XXX Should be a Configure test for double-dots in filenames.
4256 version=`echo $revision $patchlevel $subversion | \
4257 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4258 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4259 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4262 version=`echo $revision $patchlevel $subversion | \
4263 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4264 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4265 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4268 : Special case the 5.005_xx maintenance series, which used 5.005
4269 : without any subversion label as a subdirectory in $sitelib
4270 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4271 api_versionstring='5.005'
4274 : Do we want threads support and if so, what type
4275 case "$usethreads" in
4276 $define|true|[yY]*) dflt='y';;
4277 *) # Catch case where user specified ithreads or 5005threads but
4278 # forgot -Dusethreads (A.D. 4/2002)
4279 case "$useithreads$use5005threads" in
4280 *$define*) dflt='y';;
4287 Perl can be built to offer a form of threading support on some systems
4288 To do so, Configure can be run with -Dusethreads.
4290 Note that Perl built with threading support runs slightly slower
4291 and uses slightly more memory than plain Perl.
4293 If this doesn't make any sense to you, just accept the default '$dflt'.
4295 rp='Build a threading Perl?'
4298 y|Y) val="$define" ;;
4304 if $test $patchlevel -lt 9; then
4305 case "$usethreads" in
4307 : Default to ithreads unless overridden on command line or with
4310 case "$use5005threads" in
4312 echo "5.005 threads are no longer supported"
4316 case "$useithreads" in
4317 $undef|false|[nN]*) dflt='n';;
4319 rp='Use the newer interpreter-based ithreads?'
4322 y|Y) val="$define" ;;
4327 : Now set use5005threads to the opposite value.
4328 case "$useithreads" in
4329 $define) val="$undef" ;;
4336 useithreads="$undef"
4337 use5005threads="$undef"
4341 case "$useithreads$use5005threads" in
4345 You cannot have both the ithreads and the 5.005 threads enabled
4346 at the same time. Disabling the 5.005 threads since they are
4347 much less stable than the ithreads.
4350 use5005threads="$undef"
4355 : perl-5.9.x and later
4357 if test X"$usethreads" = "X$define"; then
4358 case "$use5005threads" in
4362 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4369 use5005threads="$undef"
4370 useithreads="$usethreads"
4373 case "$d_oldpthreads" in
4374 '') : Configure tests would be welcome here. For now, assume undef.
4376 *) val="$d_oldpthreads" ;;
4382 : Look for a hint-file generated 'call-back-unit'. If the
4383 : user has specified that a threading perl is to be built,
4384 : we may need to set or change some other defaults.
4385 if $test -f usethreads.cbu; then
4386 echo "Your platform has some specific hints regarding threaded builds, using them..."
4389 case "$usethreads" in
4390 "$define"|true|[yY]*)
4392 (Your platform does not have any specific hints for threaded builds.
4393 Assuming POSIX threads, then.)
4399 : Check if multiplicity is required
4402 Perl can be built so that multiple Perl interpreters can coexist
4403 within the same Perl executable.
4406 case "$useithreads" in
4409 This multiple interpreter support is required for interpreter-based threads.
4413 *) case "$usemultiplicity" in
4414 $define|true|[yY]*) dflt='y';;
4418 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4419 rp='Build Perl for multiplicity?'
4422 y|Y) val="$define" ;;
4430 : Check if morebits is requested
4431 case "$usemorebits" in
4432 "$define"|true|[yY]*)
4433 use64bitint="$define"
4434 uselongdouble="$define"
4435 usemorebits="$define"
4437 *) usemorebits="$undef"
4441 : Determine the C compiler to be used
4447 rp="Use which C compiler?"
4451 : See whether they have no cc but they do have gcc
4453 if $test -f cc.cbu; then
4458 : make some quick guesses about what we are up against
4460 $echo $n "Hmm... $c"
4470 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4471 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4473 echo "Looks kind of like an OSF/1 system, but we'll see..."
4475 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4476 xxx=`./loc addbib blurfl $pth`
4477 if $test -f $xxx; then
4478 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4482 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4483 echo "Looks kind of like an extended USG system, but we'll see..."
4485 echo "Looks kind of like a USG system, but we'll see..."
4489 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4490 echo "Looks kind of like a BSD system, but we'll see..."
4494 echo "Looks kind of like a Version 7 system, but we'll see..."
4497 case "$eunicefix" in
4500 There is, however, a strange, musty smell in the air that reminds me of
4501 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4505 : it so happens the Eunice I know will not run shell scripts in Unix format
4509 echo "Congratulations. You aren't running Eunice."
4513 : Detect OS2. The p_ variable is set above in the Head.U unit.
4514 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4515 : semicolon as a patch separator
4520 I have the feeling something is not exactly right, however...don't tell me...
4521 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4522 (Or you may be running DOS with DJGPP.)
4527 if test -f /xenix; then
4528 echo "Actually, this looks more like a XENIX system..."
4533 echo "It's not Xenix..."
4538 if test -f /venix; then
4539 echo "Actually, this looks more like a VENIX system..."
4546 echo "Nor is it Venix..."
4549 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4550 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4553 : Check if we are using GNU gcc and what its version is
4555 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4559 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4561 printf("%s\n", __VERSION__);
4563 printf("%s\n", "1");
4569 if $cc -o try $ccflags $ldflags try.c; then
4570 gccversion=`$run ./try`
4571 case "$gccversion" in
4572 '') echo "You are not using GNU cc." ;;
4573 *) echo "You are using GNU cc $gccversion."
4579 echo "*** WHOA THERE!!! ***" >&4
4580 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4581 case "$knowitall" in
4583 echo " You'd better start hunting for one and let me know about it." >&4
4589 case "$gccversion" in
4590 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4592 case "$gccversion" in
4593 '') gccosandvers='' ;;
4594 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4595 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4597 case "$gccosandvers" in
4598 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4599 $osname$osvers) ;; # looking good
4600 $osname*) cat <<EOM >&4
4602 *** WHOA THERE!!! ***
4604 Your gcc has not been compiled for the exact release of
4605 your operating system ($gccosandvers versus $osname$osvers).
4607 In general it is a good idea to keep gcc synchronized with
4608 the operating system because otherwise serious problems
4609 may ensue when trying to compile software, like Perl.
4611 I'm trying to be optimistic here, though, and will continue.
4612 If later during the configuration and build icky compilation
4613 problems appear (headerfile conflicts being the most common
4614 manifestation), I suggest reinstalling the gcc to match
4615 your operating system release.
4619 *) gccosandvers='' ;; # failed to parse, better be silent
4627 # gcc 3.* complain about adding -Idirectories that they already know about,
4628 # so we will take those off from locincpth.
4629 case "$gccversion" in
4631 echo "main(){}">try.c
4632 for incdir in $locincpth; do
4633 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4634 grep '^c[cp]p*[01]: warning: changing search order '`
4635 if test "X$warn" != X; then
4636 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4642 : What should the include directory be ?
4643 : Use sysroot if set, so findhdr looks in the right place.
4645 $echo $n "Hmm... $c"
4646 dflt="$sysroot/usr/include"
4649 if $test -f /bin/mips && /bin/mips; then
4650 echo "Looks like a MIPS system..."
4651 $cat >usr.c <<'EOCP'
4652 #ifdef SYSTYPE_BSD43
4656 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4657 dflt='/bsd43/usr/include'
4661 mips_type='System V'
4663 $rm -f usr.c usr.out
4664 echo "and you're compiling with the $mips_type compiler and libraries."
4668 echo "Doesn't look like a MIPS system."
4678 case "$xxx_prompt" in
4681 rp='Where are the include files you want to use?'
4689 : see how we invoke the C preprocessor
4691 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4692 cat <<'EOT' >testcpp.c
4698 if test ! -f cppstdin; then
4699 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4700 # AIX cc -E doesn't show the absolute headerfile
4701 # locations but we'll cheat by using the -M flag.
4702 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
4704 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4707 echo "Keeping your $hint cppstdin wrapper."
4710 wrapper=`pwd`/cppstdin
4714 if $test "X$cppstdin" != "X" && \
4715 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4716 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4718 echo "You used to use $cppstdin $cppminus so we'll use that again."
4720 '') echo "But let's see if we can live without a wrapper..." ;;
4722 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4723 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4725 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4728 echo "(However, $cpprun $cpplast does not work, let's see...)"
4736 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4743 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4744 $cc -E <testcpp.c >testcpp.out 2>&1; \
4745 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4746 echo "Yup, it does."
4747 x_cpp="$cc $cppflags -E"
4749 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4750 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4751 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4752 echo "Yup, it does."
4753 x_cpp="$cc $cppflags -E"
4755 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4756 $cc -P <testcpp.c >testcpp.out 2>&1; \
4757 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4758 echo "Yipee, that works!"
4759 x_cpp="$cc $cppflags -P"
4761 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4762 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4763 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4764 echo "At long last!"
4765 x_cpp="$cc $cppflags -P"
4767 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4768 $cpp <testcpp.c >testcpp.out 2>&1; \
4769 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4771 x_cpp="$cpp $cppflags"
4773 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4774 $cpp - <testcpp.c >testcpp.out 2>&1; \
4775 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4776 echo "Hooray, it works! I was beginning to wonder."
4777 x_cpp="$cpp $cppflags"
4779 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4780 $wrapper <testcpp.c >testcpp.out 2>&1; \
4781 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4787 rp="No dice. I can't find a C preprocessor. Name one:"
4791 $x_cpp <testcpp.c >testcpp.out 2>&1
4792 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4793 echo "OK, that will do." >&4
4795 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4810 echo "Perhaps can we force $cc -E using a wrapper..."
4811 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4812 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4818 echo "Nope, we'll have to live without it..."
4832 "$wrapper"|'cppstdin') ;;
4833 *) $rm -f $wrapper;;
4835 $rm -f testcpp.c testcpp.out
4837 : Adjust cppfilter for path component separator
4839 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4840 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4844 : Use gcc to determine libpth and incpth
4845 # If using gcc or clang, we can get better values for libpth, incpth
4846 # and usrinc directly from the compiler.
4847 # Note that ccname for clang is also gcc.
4850 $echo 'extern int foo;' > try.c
4851 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4853 if $test $# -gt 0; then
4855 incpth="`$echo $incpth|$sed 's/^ //'`"
4857 j="`$echo $i|$sed 's,/include$,/lib,'`"
4858 if $test -d $j; then
4862 libpth="`$echo $libpth|$sed 's/^ //'`"
4863 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4864 if $test -d $xxx; then
4867 *) libpth="$libpth $xxx";;
4874 '') for i in $incpth; do
4875 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4883 case "$usecrosscompile" in
4886 '') echo "Incpth not defined." >&4; croak=y ;;
4887 *) echo "Using incpth '$incpth'." >&4 ;;
4890 '') echo "Libpth not defined." >&4; croak=y ;;
4891 *) echo "Using libpth '$libpth'." >&4 ;;
4894 '') echo "Usrinc not defined." >&4; croak=y ;;
4895 *) echo "Using usrinc $usrinc." >&4 ;;
4899 if test "X$sysroot" = X; then
4900 echo "Cannot continue, aborting." >&4; exit 1
4902 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4911 : Default value for incpth is just usrinc
4913 '') incpth="$usrinc";;
4916 : Set private lib path
4919 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4924 '') dlist="$loclibpth $plibpth $glibpth";;
4925 *) dlist="$libpth";;
4928 : Now check and see which directories actually exist, avoiding duplicates
4931 if $test -d $xxx; then
4934 *) libpth="$libpth $xxx";;
4940 Some systems have incompatible or broken versions of libraries. Among
4941 the directories listed in the question below, please remove any you
4942 know not to be holding relevant libraries, and add any that are needed.
4943 Say "none" for none.
4947 if test "X$sysroot" != X; then
4949 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4962 rp="Directories to use for library searches?"
4969 : compute shared library extension
4972 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4982 On some systems, shared libraries may be available. Answer 'none' if
4983 you want to suppress searching of shared libraries for the remainder
4984 of this configuration.
4987 rp='What is the file extension used for shared libraries?'
4991 : Does target system insist that shared library basenames are unique
4994 Some dynamic loaders assume that the *basename* of shared library filenames
4995 are globally unique. We'll default this to undef as we assume your system
4996 is not this weird. Set to defined if you're on one of them.
5001 rp='Make shared library basenames unique?'
5004 y|Y) val="$define" ;;
5007 set d_libname_unique
5010 : Define several unixisms.
5011 : Hints files or command line option can be used to override them.
5012 : The convoluted testing is in case hints files set either the old
5015 '') case "$exe_ext" in
5017 *) _exe="$exe_ext" ;;
5022 '') case "$lib_ext" in
5029 '') case "$obj_ext" in
5036 '') case "$path_sep" in
5047 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5049 : Which makefile gets called first. This is used by make depend.
5050 case "$firstmakefile" in
5051 '') firstmakefile='makefile';;
5054 : Check is we will use socks
5056 $define|true|[yY]*) dflt='y';;
5061 Perl can be built to use the SOCKS proxy protocol library. To do so,
5062 Configure must be run with -Dusesocks. If you use SOCKS you also need
5063 to use the PerlIO abstraction layer, this will be implicitly selected.
5065 If this doesn't make any sense to you, just accept the default '$dflt'.
5067 rp='Build Perl for SOCKS?'
5070 y|Y) val="$define" ;;
5076 : Check for uselongdouble support
5078 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5081 case "$uselongdouble" in
5082 $define|true|[yY]*) dflt='y';;
5087 Perl can be built to take advantage of long doubles which
5088 (if available) may give more accuracy and range for floating point numbers.
5090 If this doesn't make any sense to you, just accept the default '$dflt'.
5092 rp='Try to use long doubles if available?'
5095 y|Y) val="$define" ;;
5101 case "$uselongdouble" in
5102 true|[yY]*) uselongdouble="$define" ;;
5105 : Look for a hint-file generated 'call-back-unit'. If the
5106 : user has specified that long doubles should be used,
5107 : we may need to set or change some other defaults.
5108 if $test -f uselongdouble.cbu; then
5109 echo "Your platform has some specific hints regarding long doubles, using them..."
5110 . ./uselongdouble.cbu
5112 case "$uselongdouble" in
5115 (Your platform does not have any specific hints for long doubles.)
5121 : Looking for optional libraries
5123 echo "Checking for optional libraries..." >&4
5128 case "$libswanted" in
5129 '') libswanted='c_s';;
5132 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5138 for thisdir in $libpth $xlibpth; do
5139 test -d $thisdir && libspath="$libspath $thisdir"
5141 for thislib in $libswanted; do
5142 for thisdir in $libspath; do
5144 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5145 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5146 $test -f "$xxx" && eval $libscheck
5147 $test -f "$xxx" && libstyle=shared
5149 if test ! -f "$xxx"; then
5150 xxx=$thisdir/lib$thislib.$so
5151 $test -f "$xxx" && eval $libscheck
5152 $test -f "$xxx" && libstyle=shared
5154 if test ! -f "$xxx"; then
5155 xxx=$thisdir/lib$thislib$_a
5156 $test -f "$xxx" && eval $libscheck
5157 $test -f "$xxx" && libstyle=static
5159 if test ! -f "$xxx"; then
5160 xxx=$thisdir/$thislib$_a
5161 $test -f "$xxx" && eval $libscheck
5162 $test -f "$xxx" && libstyle=static
5164 if test ! -f "$xxx"; then
5165 xxx=$thisdir/lib${thislib}_s$_a
5166 $test -f "$xxx" && eval $libscheck
5167 $test -f "$xxx" && libstyle=static
5168 $test -f "$xxx" && thislib=${thislib}_s
5170 if test ! -f "$xxx"; then
5171 xxx=$thisdir/Slib$thislib$_a
5172 $test -f "$xxx" && eval $libscheck
5173 $test -f "$xxx" && libstyle=static
5175 if $test -f "$xxx"; then
5177 shared) echo "Found -l$thislib (shared)." ;;
5178 static) echo "Found -l$thislib." ;;
5179 *) echo "Found -l$thislib ($libstyle)." ;;
5183 *) dflt="$dflt -l$thislib"
5184 libsfound="$libsfound $xxx"
5186 libsfiles="$libsfiles $yyy"
5187 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5188 case " $libsdirs " in
5190 *) libsdirs="$libsdirs $yyy" ;;
5197 if $test ! -f "$xxx"; then
5198 echo "No -l$thislib."
5209 ' '|'') dflt='none';;
5214 In order to compile $package on your machine, a number of libraries
5215 are usually needed. Include any other special libraries here as well.
5216 Say "none" for none. The default list is almost always right.
5220 rp="What libraries to use?"
5227 : determine optimization, if desired, or use for debug flag also
5229 ' '|$undef) dflt='none';;
5231 *) dflt="$optimize";;
5235 By default, $package compiles with the -O flag to use the optimizer.
5236 Alternately, you might want to use the symbolic debugger, which uses
5237 the -g flag (on traditional Unix systems). Either flag can be
5238 specified here. To use neither flag, specify the word "none".
5241 rp="What optimizer/debugger flag should be used?"
5245 'none') optimize=" ";;
5248 : Check what DEBUGGING is required from the command line
5249 : -DEBUGGING or -DDEBUGGING or
5250 : -DEBUGGING=both = -g + -DDEBUGGING
5251 : -DEBUGGING=-g or -Doptimize=-g = -g
5252 : -DEBUGGING=none or -UDEBUGGING =
5253 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5256 *) DEBUGGING=$EBUGGING ;;
5259 case "$DEBUGGING" in
5263 *) optimize="$optimize -g" ;;
5267 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5275 case "$DEBUGGING" in
5276 both|$define) dflt='-DDEBUGGING'
5279 : argument order is deliberate, as the flag will start with - which set could
5280 : think is an option
5281 checkccflag='check=$1; flag=$2; callback=$3;
5283 echo "Checking if your compiler accepts $flag" 2>&1;
5284 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5285 echo "int main(void) { return 0; }" > gcctest.c;
5286 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5287 echo "Yes, it does." 2>&1;
5288 if $test -s gcctest.out ; then
5289 echo "But your platform does not like it:";
5294 echo "Leaving current flags $ccflags alone." 2>&1
5296 *) dflt="$dflt $flag";
5302 echo "Nope, it does not, but that is ok." 2>&1;
5306 : We will not override a previous value, but we might want to
5307 : augment a hint file
5309 default|recommended)
5310 case "$gccversion" in
5311 1*) dflt="$dflt -fpcc-struct-return" ;;
5313 case "$optimize:$DEBUGGING" in
5314 *-g*:old) dflt="$dflt -DDEBUGGING";;
5316 case "$gccversion" in
5317 2*) if $test -d /etc/conf/kconfig.d &&
5318 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5320 # Interactive Systems (ISC) POSIX mode.
5325 case "$gccversion" in
5328 ?*) set strict-aliasing -fno-strict-aliasing
5332 # For gcc, adding -pipe speeds up compilations for some, but apparently
5333 # some assemblers can't read from stdin. (It also slows down compilations
5334 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5335 case "$gccversion" in
5341 # on x86_64 (at least) we require an extra library (libssp) in the
5342 # link command line. This library is not named, so I infer that it is
5343 # an implementation detail that may change. Hence the safest approach
5344 # is to add the flag to the flags passed to the compiler at link time,
5345 # as that way the compiler can do the right implementation dependant
5347 case "$gccversion" in
5348 ?*) set stack-protector -fstack-protector
5355 case "$mips_type" in
5356 *BSD*|'') inclwanted="$locincpth $usrinc";;
5357 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5359 for thisincl in $inclwanted; do
5360 if $test -d $thisincl; then
5361 if $test x$thisincl != x$usrinc; then
5363 *" -I$thisincl "*);;
5364 *) dflt="$dflt -I$thisincl ";;
5370 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5372 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5380 *) dflt="$dflt -D$2";;
5384 set signal.h LANGUAGE_C; eval $inctest
5388 ccflags="$ccflags -DSOCKS"
5393 default|recommended) dflt="$ccflags $dflt" ;;
5394 *) dflt="$ccflags";;
5403 Your C compiler may want other flags. For this question you should include
5404 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5405 but you should NOT include libraries or ld flags like -lwhatever. If you
5406 want $package to honor its debug switch, you should include -DDEBUGGING here.
5407 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5409 To use no flags, specify the word "none".
5415 rp="Any additional cc flags?"
5422 : the following weeds options from ccflags that are of no interest to cpp
5424 '') cppflags="$ccflags" ;;
5425 *) cppflags="$cppflags $ccflags" ;;
5427 case "$gccversion" in
5428 1*) cppflags="$cppflags -D__GNUC__"
5430 case "$mips_type" in
5432 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5438 echo "Let me guess what the preprocessor flags are..." >&4
5452 *) ftry="$previous $flag";;
5454 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5455 >cpp1.out 2>/dev/null && \
5456 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5457 >cpp2.out 2>/dev/null && \
5458 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5459 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5461 cppflags="$cppflags $ftry"
5471 *-*) echo "They appear to be: $cppflags";;
5473 $rm -f cpp.c cpp?.out
5477 : flags used in final linking phase
5479 '') if ./venix; then
5485 *-posix*) dflt="$dflt -posix" ;;
5488 *) dflt="$ldflags";;
5490 # See note above about -fstack-protector
5492 *-fstack-protector*)
5494 *-fstack-protector*) ;; # Don't add it again
5495 *) dflt="$dflt -fstack-protector" ;;
5500 : Try to guess additional flags to pick up local libraries.
5501 for thislibdir in $libpth; do
5502 case " $loclibpth " in
5505 *"-L$thislibdir "*) ;;
5506 *) dflt="$dflt -L$thislibdir" ;;
5518 Your C linker may need flags. For this question you should
5519 include -L/whatever and any other flags used by the C linker, but you
5520 should NOT include libraries like -lwhatever.
5522 Make sure you include the appropriate -L/path flags if your C linker
5523 does not normally search all of the directories you specified above,
5526 To use no flags, specify the word "none".
5530 rp="Any additional ld flags (NOT including libraries)?"
5536 rmlist="$rmlist pdp11"
5540 echo "Checking your choice of C compiler and flags for coherency..." >&4
5541 $cat > try.c <<'EOF'
5543 int main() { printf("Ok\n"); return(0); }
5545 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5547 $cat >try.msg <<'EOM'
5548 I've tried to compile and run the following simple program:
5551 $cat try.c >> try.msg
5553 $cat >> try.msg <<EOM
5560 and I got the following output:
5564 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5565 if $sh -c "$run ./try " >>try.msg 2>&1; then
5569 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5572 echo "The program compiled OK, but exited with status $?." >>try.msg
5573 rp="You have a problem. Shall I abort Configure"
5577 echo "I can't compile the test program." >>try.msg
5578 rp="You have a BIG problem. Shall I abort Configure"
5584 case "$knowitall" in
5586 echo "(The supplied flags or libraries might be incorrect.)"
5594 *) echo "Ok. Stopping Configure." >&4
5599 n) echo "OK, that should do.";;
5601 $rm_try gcctest gcctest.out
5603 : define a shorthand compile call
5607 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5608 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5612 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5613 : define a shorthand compile call for compilations that should be ok.
5617 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5619 : determine filename position in cpp output
5621 echo "Computing filename position in cpp output for #include directives..." >&4
5623 vos) testaccess=-e ;;
5626 echo '#include <stdio.h>' > foo.c
5629 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5630 $grep '^[ ]*#.*stdio\.h' | \
5631 while read cline; do
5634 while $test \$# -gt 0; do
5635 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5640 pos=\`expr \$pos + 1\`
5652 *) pos="${fieldn}th";;
5654 echo "Your cpp writes the filename in the $pos field of the line."
5656 : locate header file
5661 for usrincdir in $incpth
5663 if test -f \$usrincdir/\$wanted; then
5664 echo "\$usrincdir/\$wanted"
5668 awkprg='{ print \$$fieldn }'
5669 echo "#include <\$wanted>" > foo\$\$.c
5670 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5671 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5672 while read cline; do
5673 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5675 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5676 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5681 # status = 0: grep returned 0 lines, case statement not executed
5682 # status = 1: headerfile found
5683 # status = 2: while loop executed, no headerfile found
5687 if test \$status -eq 1; then
5694 : define an alternate in-header-list? function
5695 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5696 cont=true; xxf="echo \"<\$1> found.\" >&4";
5697 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5698 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5700 case $# in 4) instead=instead;; *) instead="at last";; esac;
5701 while $test "$cont"; do
5703 var=$2; eval "was=\$$2";
5704 if $test "$xxx" && $test -r "$xxx";
5706 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5709 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5710 set $yyy; shift; shift; yyy=$@;
5711 case $# in 0) cont="";;
5712 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5713 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5714 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5715 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5719 do set $yyy; var=$2; eval "was=\$$2";
5720 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5721 set $yyy; shift; shift; yyy=$@;
5724 : see if stdlib is available
5725 set stdlib.h i_stdlib
5728 : check for lengths of integral types
5732 echo "Checking to see how big your integers are..." >&4
5741 printf("intsize=%d;\n", (int)sizeof(int));
5742 printf("longsize=%d;\n", (int)sizeof(long));
5743 printf("shortsize=%d;\n", (int)sizeof(short));
5748 if eval $compile_ok && $run ./try > /dev/null; then
5750 echo "Your integers are $intsize bytes long."
5751 echo "Your long integers are $longsize bytes long."
5752 echo "Your short integers are $shortsize bytes long."
5756 Help! I can't compile and run the intsize test program: please enlighten me!
5757 (This is probably a misconfiguration in your system or libraries, and
5758 you really ought to fix it. Still, I'll try anyway.)
5762 rp="What is the size of an integer (in bytes)?"
5766 rp="What is the size of a long integer (in bytes)?"
5770 rp="What is the size of a short integer (in bytes)?"
5778 : check for long long
5780 echo "Checking to see if you have long long..." >&4
5781 echo 'int main() { long long x = 7; return 0; }' > try.c
5783 if eval $compile; then
5785 echo "You have long long."
5788 echo "You do not have long long."
5794 : check for length of long long
5795 case "${d_longlong}${longlongsize}" in
5798 echo "Checking to see how big your long longs are..." >&4
5799 $cat >try.c <<'EOCP'
5803 printf("%d\n", (int)sizeof(long long));
5808 if eval $compile_ok; then
5809 longlongsize=`$run ./try`
5810 echo "Your long longs are $longlongsize bytes long."
5814 echo "(I can't seem to compile the test program. Guessing...)"
5815 rp="What is the size of a long long (in bytes)?"
5819 if $test "X$longsize" = "X$longlongsize"; then
5820 echo "(That isn't any different from an ordinary long.)"
5826 : see if inttypes.h is available
5827 : we want a real compile instead of Inhdr because some systems
5828 : have an inttypes.h which includes non-existent headers
5831 #include <inttypes.h>
5833 static int32_t foo32 = 0x12345678;
5837 if eval $compile; then
5838 echo "<inttypes.h> found." >&4
5841 echo "<inttypes.h> NOT found." >&4
5850 echo "Checking to see if you have int64_t..." >&4
5852 #include <sys/types.h>
5853 #$i_inttypes I_INTTYPES
5855 #include <inttypes.h>
5857 int main() { int64_t x = 7; }
5860 if eval $compile; then
5862 echo "You have int64_t."
5865 echo "You do not have int64_t."
5871 : Check if 64bit ints have a quad type
5873 echo "Checking which 64-bit integer type we could use..." >&4
5879 val='"unsigned int"'
5884 *) case "$longsize" in
5888 val='"unsigned long"'
5893 *) case "$d_longlong:$longlongsize" in
5898 val='"unsigned long long"'
5903 *) case "$d_int64_t" in
5922 '') echo "Alas, no 64-bit integer types in sight." >&4
5925 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5930 : Do we want 64bit support
5931 case "$uselonglong" in
5932 "$define"|true|[yY]*)
5935 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5937 use64bitint="$define"
5940 case "$use64bits" in
5941 "$define"|true|[yY]*)
5944 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5946 use64bitint="$define"
5949 case "$use64bitints" in
5950 "$define"|true|[yY]*)
5953 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5955 use64bitint="$define"
5958 case "$use64bitsint" in
5959 "$define"|true|[yY]*)
5962 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5964 use64bitint="$define"
5967 case "$uselonglongs" in
5968 "$define"|true|[yY]*)
5971 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5973 use64bitint="$define"
5976 case "$use64bitsall" in
5977 "$define"|true|[yY]*)
5980 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5982 use64bitall="$define"
5987 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5989 case "$use64bitall" in
5990 "$define"|true|[yY]*) use64bitint="$define" ;;
5996 You have natively 64-bit long integers.
6000 *) case "$use64bitint" in
6001 "$define"|true|[yY]*) dflt='y';;
6010 Perl can be built to take advantage of 64-bit integer types
6011 on some systems. To do so, Configure can be run with -Duse64bitint.
6012 Choosing this option will most probably introduce binary incompatibilities.
6014 If this doesn't make any sense to you, just accept the default '$dflt'.
6015 (The default has been chosen based on your configuration.)
6017 rp='Try to use 64-bit integers, if available?'
6020 [yY]*) val="$define" ;;
6028 case "$use64bitall" in
6029 "$define"|true|[yY]*) dflt='y' ;;
6030 *) case "$longsize" in
6038 You may also choose to try maximal 64-bitness. It means using as much
6039 64-bitness as possible on the platform. This in turn means even more
6040 binary incompatibilities. On the other hand, your platform may not
6041 have any more 64-bitness available than what you already have chosen.
6043 If this doesn't make any sense to you, just accept the default '$dflt'.
6044 (The default has been chosen based on your configuration.)
6046 rp='Try to use maximal 64-bit support, if available?'
6049 [yY]*) val="$define" ;;
6054 case "$use64bitall" in
6056 case "$use64bitint" in
6060 Since you have chosen a maximally 64-bit build, I'm also turning on
6061 the use of 64-bit integers.
6063 use64bitint="$define" ;;
6068 : Look for a hint-file generated 'call-back-unit'. If the
6069 : user has specified that a 64-bit perl is to be built,
6070 : we may need to set or change some other defaults.
6071 if $test -f use64bitint.cbu; then
6072 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6075 case "$use64bitint" in
6076 "$define"|true|[yY]*)
6077 : This test was common to all the OpenBSD forks, and seems harmless for
6080 echo "Checking if your C library has broken 64-bit functions..." >&4
6083 typedef $uquadtype myULL;
6090 {4294967303.15, 4294967303ULL},
6091 {4294967294.2, 4294967294ULL},
6092 {4294967295.7, 4294967295ULL},
6095 for (p = test; p->u; p++) {
6096 myULL x = (myULL)p->d;
6107 if eval $compile_ok; then
6108 libcquad=`$run ./try`
6109 echo "Your C library's 64-bit functions are $libcquad."
6111 echo "(I can't seem to compile the test program.)"
6112 echo "Assuming that your C library's 64-bit functions are ok."
6121 *** You have a C library with broken 64-bit functions.
6122 *** 64-bit support does not work reliably in this configuration.
6123 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6124 *** Cannot continue, aborting.
6131 4) case "$archname64" in
6132 '') archname64=64int ;;
6139 : Look for a hint-file generated 'call-back-unit'. If the
6140 : user has specified that a maximally 64-bit perl is to be built,
6141 : we may need to set or change some other defaults.
6142 if $test -f use64bitall.cbu; then
6143 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6146 case "$use64bitall" in
6147 "$define"|true|[yY]*)
6149 4) case "$archname64" in
6150 ''|64int) archname64=64all ;;
6157 case "$d_quad:$use64bitint" in
6161 *** You have chosen to use 64-bit integers,
6162 *** but none can be found.
6163 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6164 *** Cannot continue, aborting.
6171 : check for length of double
6173 case "$doublesize" in
6175 echo "Checking to see how big your double precision numbers are..." >&4
6184 printf("%d\n", (int)sizeof(double));
6189 if eval $compile_ok; then
6190 doublesize=`$run ./try`
6191 echo "Your double is $doublesize bytes long."
6194 echo "(I can't seem to compile the test program. Guessing...)"
6195 rp="What is the size of a double precision number (in bytes)?"
6203 : check for long doubles
6205 echo "Checking to see if you have long double..." >&4
6206 echo 'int main() { long double x = 7.0; }' > try.c
6208 if eval $compile; then
6210 echo "You have long double."
6213 echo "You do not have long double."
6219 : check for length of long double
6220 case "${d_longdbl}${longdblsize}" in
6223 echo "Checking to see how big your long doubles are..." >&4
6224 $cat >try.c <<'EOCP'
6228 printf("%d\n", sizeof(long double));
6233 if eval $compile; then
6234 longdblsize=`$run ./try`
6235 echo "Your long doubles are $longdblsize bytes long."
6239 echo "(I can't seem to compile the test program. Guessing...)" >&4
6240 rp="What is the size of a long double (in bytes)?"
6244 if $test "X$doublesize" = "X$longdblsize"; then
6245 echo "That isn't any different from an ordinary double."
6246 echo "I'll keep your setting anyway, but you may see some"
6247 echo "harmless compilation warnings."
6253 : determine the architecture name
6255 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6256 tarch=`arch`"-$osname"
6257 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6258 if uname -m > tmparch 2>&1 ; then
6259 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6260 -e 's/$/'"-$osname/" tmparch`
6268 case "$myarchname" in
6271 echo "(Your architecture name used to be $myarchname.)"
6275 case "$targetarch" in
6277 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6282 *) dflt="$archname";;
6284 rp='What is your architecture name'
6288 : optionally add API version to the architecture for versioned archlibs
6289 case "$useversionedarchname" in
6290 $define|true|[yY]*) dflt='y';;
6293 rp='Add the Perl API version to your archname?'
6296 y|Y) useversionedarchname="$define" ;;
6297 *) useversionedarchname="$undef" ;;
6299 case "$useversionedarchname" in
6302 *-$api_versionstring)
6303 echo "...and architecture name already has -$api_versionstring" >&4
6306 archname="$archname-$api_versionstring"
6307 echo "...setting architecture name to $archname." >&4
6313 case "$usethreads" in
6315 echo "Threads selected." >&4
6317 *-thread*) echo "...and architecture name already has -thread." >&4
6319 *) archname="$archname-thread"
6320 echo "...setting architecture name to $archname." >&4
6325 case "$usemultiplicity" in
6327 echo "Multiplicity selected." >&4
6329 *-multi*) echo "...and architecture name already has -multi." >&4
6331 *) archname="$archname-multi"
6332 echo "...setting architecture name to $archname." >&4
6337 case "$use64bitint$use64bitall" in
6339 case "$archname64" in
6341 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6344 case "$use64bitint" in
6345 "$define") echo "64 bit integers selected." >&4 ;;
6347 case "$use64bitall" in
6348 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6351 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6353 *) archname="$archname-$archname64"
6354 echo "...setting architecture name to $archname." >&4
6360 case "$uselongdouble" in
6362 echo "Long doubles selected." >&4
6363 case "$longdblsize" in
6365 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6369 *-ld*) echo "...and architecture name already has -ld." >&4
6371 *) archname="$archname-ld"
6372 echo "...setting architecture name to $archname." >&4
6379 if $test -f archname.cbu; then
6380 echo "Your platform has some specific hints for architecture name, using them..."
6384 : set the prefixit variable, to compute a suitable default value
6385 prefixit='case "$3" in
6387 case "$oldprefix" in
6388 "") eval "$1=\"\$$2\"";;
6395 ""|" ") eval "$1=\"\$$2\"";;
6401 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6403 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6404 /*-$oldprefix/*|\~*-$oldprefix/*)
6405 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6406 *) eval "$1=\"\$$2\"";;
6410 : determine installation style
6411 : For now, try to deduce it from prefix unless it is already set.
6412 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6413 case "$installstyle" in
6414 '') case "$prefix" in
6415 *perl*) dflt='lib';;
6416 *) dflt='lib/perl5' ;;
6419 *) dflt="$installstyle" ;;
6421 : Probably not worth prompting for this since we prompt for all
6422 : the directories individually, and the prompt would be too long and
6426 : determine where public executables go
6431 rp='Pathname where the public executables will reside?'
6433 if $test "X$ansexp" != "X$binexp"; then
6437 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6438 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6439 : this via initialinstalllocation
6442 case "$userelocatableinc" in
6443 $define|true|[yY]*) dflt='y' ;;
6448 Would you like to build Perl so that the installation is relocatable, so that
6449 library paths in @INC are determined relative to the path of the perl binary?
6450 This is not advised for system Perl installs, or if you need to run setid
6451 scripts or scripts under taint mode.
6453 If this doesn't make any sense to you, just accept the default '$dflt'.
6455 rp='Use relocatable @INC?'
6458 y|Y) val="$define" ;;
6461 set userelocatableinc
6464 initialinstalllocation="$binexp"
6465 : Default prefix is now "up one level from where the binaries are"
6466 case "$userelocatableinc" in
6472 installprefixexp=".../.."
6476 : determine where private library files go
6477 : Usual default is /usr/local/lib/perl5/$version.
6478 : Also allow things like /opt/perl/lib/$version, since
6479 : /opt/perl/lib/perl5... would be redundant.
6480 : The default "style" setting is made in installstyle.U
6481 case "$installstyle" in
6482 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6483 *) set dflt privlib lib/$version ;;
6488 There are some auxiliary files for $package that need to be put into a
6489 private library directory that is accessible by everyone.
6494 rp='Pathname where the private library files will reside?'
6499 : set the prefixup variable, to restore leading tilda escape
6500 prefixup='case "$prefixexp" in
6502 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6505 : determine where public architecture dependent libraries go
6508 : privlib default is /usr/local/lib/$package/$version
6509 : archlib default is /usr/local/lib/$package/$version/$archname
6510 : privlib may have an optional trailing /share.
6511 tdflt=`echo $privlib | $sed 's,/share$,,'`
6512 tdflt=$tdflt/$archname
6521 $spackage contains architecture-dependent library files. If you are
6522 sharing libraries in a heterogeneous environment, you might store
6523 these files in a separate location. Otherwise, you can just include
6524 them with the rest of the public library files.
6529 rp='Where do you want to put the public architecture-dependent libraries?'
6533 if $test X"$archlib" = X"$privlib"; then
6539 : see if setuid scripts can be secure
6542 Some kernels have a bug that prevents setuid #! scripts from being
6543 secure. Some sites have disabled setuid #! scripts because of this.
6545 First let's decide if your kernel supports secure setuid #! scripts.
6546 (If setuid #! scripts would be secure but have been disabled anyway,
6547 don't say that they are secure if asked.)
6552 if $test -d /dev/fd; then
6553 echo "#!$ls" >reflect
6554 chmod +x,u+s reflect
6555 ./reflect >flect 2>&1
6556 if $contains "/dev/fd" flect >/dev/null; then
6557 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6561 If you are not sure if they are secure, I can check but I'll need a
6562 username and password different from the one you are using right now.
6563 If you don't have such a username or don't want me to test, simply
6567 rp='Other username to test security of setuid scripts with?'
6572 case "$d_suidsafe" in
6573 '') echo "I'll assume setuid scripts are *not* secure." >&4
6576 echo "Well, the $hint value is *not* secure." >&4
6578 *) echo "Well, the $hint value *is* secure." >&4
6583 $rm -f reflect flect
6584 echo "#!$ls" >reflect
6585 chmod +x,u+s reflect
6588 echo '"su" will (probably) prompt you for '"$ans's password."
6589 su $ans -c './reflect >flect'
6590 if $contains "/dev/fd" flect >/dev/null; then
6591 echo "Okay, it looks like setuid scripts are secure." >&4
6594 echo "I don't think setuid scripts are secure." >&4
6599 rp='Does your kernel have *secure* setuid scripts?'
6602 [yY]*) val="$define";;
6607 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6608 echo "(That's for file descriptors, not floppy disks.)"
6614 $rm -f reflect flect
6616 : now see if they want to do setuid emulation
6617 if $test $patchlevel -lt 11; then
6620 case "$d_suidsafe" in
6623 echo "No need to emulate SUID scripts since they are secure here." >&4
6627 Some systems have disabled setuid scripts, especially systems where
6628 setuid scripts cannot be secure. On systems where setuid scripts have
6629 been disabled, the setuid/setgid bits on scripts are currently
6630 useless. It is possible for $package to detect those bits and emulate
6631 setuid/setgid in a secure fashion. This emulation will only work if
6632 setuid scripts have been disabled in your kernel.
6636 "$define") dflt=y ;;
6639 rp="Do you want to do setuid/setgid emulation?"
6642 [yY]*) val="$define";;
6654 SUID emulation has been removed for 5.12
6655 Please re-run Configure without -Dd_dosuid
6664 : Find perl5.005 or later.
6665 echo "Looking for a previously installed perl5.005 or later... "
6667 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6668 : Check if this perl is recent and can load a simple module
6669 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6672 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6682 '') echo "None found. That's ok.";;
6683 *) echo "Using $perl5." ;;
6686 : Set the siteprefix variables
6689 After $package is installed, you may wish to install various
6690 add-on modules and utilities. Typically, these add-ons will
6691 be installed under $prefix with the rest
6692 of this package. However, you may wish to install such add-ons
6693 elsewhere under a different prefix.
6695 If you do not wish to put everything under a single prefix, that's
6696 ok. You will be prompted for the individual locations; this siteprefix
6697 is only used to suggest the defaults.
6699 The default should be fine for most people.
6703 rp='Installation prefix to use for add-on modules and utilities?'
6704 : XXX Here might be another good place for an installstyle setting.
6705 case "$siteprefix" in
6707 *) dflt=$siteprefix ;;
6710 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6712 case "$siteprefix" in
6716 *) oldsiteprefix="$prefix";;
6721 siteprefixexp="$ansexp"
6723 : determine where site specific libraries go.
6724 : Usual default is /usr/local/lib/perl5/site_perl/$version
6725 : The default "style" setting is made in installstyle.U
6726 : XXX No longer works with Prefixit stuff.
6727 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6729 '') case "$installstyle" in
6730 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6731 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6739 The installation process will create a directory for
6740 site-specific extensions and modules. Most users find it convenient
6741 to place all site-specific files in this directory rather than in the
6742 main distribution directory.
6746 rp='Pathname for the site-specific library files?'
6750 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6752 : Determine list of previous versions to include in @INC
6753 $cat > getverlist <<EOPL
6756 \$api_versionstring = "$api_versionstring";
6757 \$version = "$version";
6758 \$stem = "$sitelib_stem";
6759 \$archname = "$archname";
6761 $cat >> getverlist <<'EOPL'
6762 # The list found is store twice for each entry: the original name, and
6763 # the binary broken down version as pack "sss", so sorting is easy and
6764 # unambiguous. This will work for all versions that have a maximum of
6765 # three digit groups, separate by '.'s or '_'s. Names are extended with
6766 # ".0.0" to ensure at least three elements for the pack.
6767 # -- H.Merijn Brand (m)'06 23-10-2006
6769 # Can't have leading @ because metaconfig interprets it as a command!
6770 ;@inc_version_list=();
6771 # XXX Redo to do opendir/readdir?
6774 ;@candidates = map {
6775 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6776 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6782 ($pversion, $aversion, $vsn5005) = map {
6783 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6784 foreach $d (@candidates) {
6785 if ($d->[1] lt $pversion) {
6786 if ($d->[1] ge $aversion) {
6787 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6789 elsif ($d->[1] ge $vsn5005) {
6790 unshift(@inc_version_list, grep { -d } $d->[0]);
6794 # Skip newer version. I.e. don't look in
6795 # 5.7.0 if we're installing 5.6.1.
6799 if (@inc_version_list) {
6800 print join(' ', @inc_version_list);
6803 # Blank space to preserve value for next Configure run.
6808 case "$inc_version_list" in
6809 '') if test -x "$perl5$exe_ext"; then
6810 dflt=`$perl5 getverlist`
6815 $undef) dflt='none' ;;
6816 *) eval dflt=\"$inc_version_list\" ;;
6819 ''|' ') dflt=none ;;
6826 In order to ease the process of upgrading, this version of perl
6827 can be configured to use modules built and installed with earlier
6828 versions of perl that were installed under $prefix. Specify here
6829 the list of earlier versions that this version of perl should check.
6830 If Configure detected no earlier versions of perl installed under
6831 $prefix, then the list will be empty. Answer 'none' to tell perl
6832 to not search earlier versions.
6834 The default should almost always be sensible, so if you're not sure,
6835 just accept the default.
6838 rp='List of earlier versions to include in @INC?'
6841 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6842 *) inc_version_list="$ans" ;;
6844 case "$inc_version_list" in
6846 inc_version_list_init='0'
6847 d_inc_version_list="$undef"
6849 *) inc_version_list_init=`echo $inc_version_list |
6850 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6851 d_inc_version_list="$define"
6856 : see if malloc/malloc.h has to be included
6857 set malloc/malloc.h i_mallocmalloc
6860 : see if this is a malloc.h system
6861 : we want a real compile instead of Inhdr because some systems have a
6862 : malloc.h that just gives a compile error saying to use stdlib.h instead
6867 #$i_mallocmalloc I_MALLOCMALLOC
6868 #ifdef I_MALLOCMALLOC
6869 # include <malloc/malloc.h>
6872 int main () { return 0; }
6875 if eval $compile; then
6876 echo "<malloc.h> found." >&4
6879 echo "<malloc.h> NOT found." >&4
6886 : check for length of pointer
6890 echo "Checking to see how big your pointers are..." >&4
6899 printf("%d\n", (int)sizeof(void *));
6904 if eval $compile_ok; then
6905 ptrsize=`$run ./try`
6906 echo "Your pointers are $ptrsize bytes long."
6909 echo "(I can't seem to compile the test program. Guessing...)" >&4
6910 rp="What is the size of a pointer (in bytes)?"
6917 case "$use64bitall" in
6918 "$define"|true|[yY]*)
6922 *** You have chosen a maximally 64-bit build,
6923 *** but your pointers are only 4 bytes wide.
6924 *** Please rerun Configure without -Duse64bitall.
6929 *** Since you have quads, you could possibly try with -Duse64bitint.
6934 *** Cannot continue, aborting.
6945 : determine whether to use malloc wrapping
6947 case "$usemallocwrap" in
6948 [yY]*|true|$define) dflt='y' ;;
6949 [nN]*|false|$undef) dflt='n' ;;
6950 *) case "$usedevel" in
6951 [yY]*|true|$define) dflt='y' ;;
6956 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6958 usemallocwrap="$ans"
6961 usemallocwrap="$define" ;;
6963 usemallocwrap="$undef" ;;
6966 : determine which malloc to compile in
6968 case "$usemymalloc" in
6969 [yY]*|true|$define) dflt='y' ;;
6970 [nN]*|false|$undef) dflt='n' ;;
6971 *) case "$ptrsize" in
6975 if test "$useithreads" = "$define"; then dflt='n'; fi
6978 rp="Do you wish to attempt to use the malloc that comes with $package?"
6984 mallocsrc='malloc.c'
6985 mallocobj="malloc$_o"
6986 d_mymalloc="$define"
6989 : Remove malloc from list of libraries to use
6990 echo "Removing unneeded -lmalloc from library list" >&4
6991 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6994 echo "libs = $libs" >&4
7006 : compute the return types of malloc and free
7008 $cat >malloc.c <<END
7012 #include <sys/types.h>
7026 case "$malloctype" in
7028 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7035 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7039 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7046 echo "Your system uses $freetype free(), it would seem." >&4
7048 : determine where site specific architecture-dependent libraries go.
7049 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7050 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7051 : sitelib may have an optional trailing /share.
7053 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7054 dflt="$dflt/$archname"
7059 set sitearch sitearch none
7063 The installation process will also create a directory for
7064 architecture-dependent site-specific extensions and modules.
7068 rp='Pathname for the site-specific architecture-dependent library files?'
7072 if $test X"$sitearch" = X"$sitelib"; then
7075 d_sitearch="$define"
7078 : Set the vendorprefix variables
7081 The installation process will also create a directory for
7082 vendor-supplied add-ons. Vendors who supply perl with their system
7083 may find it convenient to place all vendor-supplied files in this
7084 directory rather than in the main distribution directory. This will
7085 ease upgrades between binary-compatible maintenance versions of perl.
7087 Of course you may also use these directories in whatever way you see
7088 fit. For example, you might use them to access modules shared over a
7089 company-wide network.
7091 The default answer should be fine for most people.
7092 This causes further questions about vendor add-ons to be skipped
7093 and no vendor-specific directories will be configured for perl.
7096 rp='Do you want to configure vendor-specific add-on directories?'
7097 case "$usevendorprefix" in
7098 define|true|[yY]*) dflt=y ;;
7099 *) : User may have set vendorprefix directly on Configure command line.
7100 case "$vendorprefix" in
7109 rp='Installation prefix to use for vendor-supplied add-ons?'
7110 case "$vendorprefix" in
7111 '') dflt="$prefix" ;;
7112 *) dflt=$vendorprefix ;;
7115 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7117 case "$vendorprefix" in
7121 *) oldvendorprefix="$prefix";;
7125 usevendorprefix="$define"
7127 vendorprefixexp="$ansexp"
7129 *) usevendorprefix="$undef"
7135 : Set the vendorlib variables
7136 case "$vendorprefix" in
7137 '') d_vendorlib="$undef"
7141 *) d_vendorlib="$define"
7142 : determine where vendor-supplied modules go.
7143 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7144 case "$vendorlib" in
7146 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7147 case "$installstyle" in
7148 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7149 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7152 *) dflt="$vendorlib"
7156 rp='Pathname for the vendor-supplied library files?'
7159 vendorlibexp="$ansexp"
7162 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7166 : Set the vendorarch variables
7167 case "$vendorprefix" in
7168 '') d_vendorarch="$undef"
7172 *) d_vendorarch="$define"
7173 : determine where vendor-supplied architecture-dependent libraries go.
7174 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7175 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7176 : vendorlib may have an optional trailing /share.
7177 case "$vendorarch" in
7178 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7179 dflt="$dflt/$archname"
7181 *) dflt="$vendorarch" ;;
7184 rp='Pathname for vendor-supplied architecture-dependent files?'
7187 vendorarchexp="$ansexp"
7190 prefixvar=vendorarch
7192 if $test X"$vendorarch" = X"$vendorlib"; then
7193 d_vendorarch="$undef"
7195 d_vendorarch="$define"
7198 : Final catch-all directories to search
7201 Lastly, you can have perl look in other directories for extensions and
7202 modules in addition to those already specified.
7203 These directories will be searched after
7207 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7208 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7210 case "$otherlibdirs" in
7211 ''|' ') dflt='none' ;;
7212 *) dflt="$otherlibdirs" ;;
7215 Enter a colon-separated set of extra paths to include in perl's @INC
7216 search path, or enter 'none' for no extra paths.
7220 rp='Colon-separated list of additional directories for perl to search?'
7223 ' '|''|none) otherlibdirs=' ' ;;
7224 *) otherlibdirs="$ans" ;;
7226 case "$otherlibdirs" in
7230 set d_perl_otherlibdirs
7233 : Cruising for prototypes
7235 echo "Checking out function prototypes..." >&4
7236 $cat >prototype.c <<EOCP
7241 int main(int argc, char *argv[]) {
7244 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7245 echo "Your C compiler appears to support function prototypes."
7248 echo "Your C compiler doesn't seem to understand function prototypes."
7255 : Check if ansi2knr is required
7256 case "$prototype" in
7258 *) ansi2knr='ansi2knr'
7263 This version of $package can only be compiled by a compiler that
7264 understands function prototypes. Unfortunately, your C compiler
7266 doesn't seem to understand them. Sorry about that.
7268 If GNU cc is available for your system, perhaps you could try that instead.
7270 Eventually, we hope to support building Perl with pre-ANSI compilers.
7271 If you would like to help in that effort, please contact <perlbug@perl.org>.
7273 Aborting Configure now.
7280 dflt_dtrace='/usr/sbin/dtrace'
7281 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7285 Perl can be built to support DTrace on platforms that support it.
7286 DTrace is a diagnosis and performance analysis tool from Sun.
7288 If this doesn't make any sense to you, just accept the default '$dflt'.
7292 case "$usedtrace" in
7298 dflt_dtrace=$usedtrace
7305 rp='Support DTrace if available?'
7308 y|Y) val="$define" ;;
7314 test "X$usedtrace" != "X$define" && break
7317 rp='Where is the dtrace executable?'
7326 if $dtrace -h -s ../perldtrace.d \
7327 -o perldtrace.tmp >/dev/null 2>&1 \
7328 && rm -f perldtrace.tmp
7331 echo "Good: your $dtrace knows about the -h flag."
7335 *** $me: Fatal Error: $dtrace doesn't support -h flag
7337 *** Your installed dtrace doesn't support the -h switch to compile a D
7338 *** program into a C header. Can't continue.
7350 *** $me: Fatal Error: $dtrace not found.
7357 echo "*** $dtrace was not found."
7363 : See if we want extra modules installed
7370 Perl can be built with extra modules or bundles of modules which
7371 will be fetched from the CPAN and installed alongside Perl.
7373 Notice that you will need access to the CPAN; either via the Internet,
7374 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7375 be asked later to configure the CPAN.pm module which will in turn do
7376 the installation of the rest of the extra modules or bundles.)
7378 Notice also that if the modules require any external software such as
7379 libraries and headers (the libz library and the zlib.h header for the
7380 Compress::Zlib module, for example) you MUST have any such software
7381 already installed, this configuration process will NOT install such
7384 If this doesn't make any sense to you, just accept the default '$dflt'.
7386 rp='Install any extra modules (y or n)?'
7392 Please list any extra modules or bundles to be installed from CPAN,
7393 with spaces between the names. The names can be in any format the
7394 'install' command of CPAN.pm will understand. (Answer 'none',
7395 without the quotes, to install no extra modules or bundles.)
7405 $rm -f ../extras.lst
7407 *) echo "(Saving the list of extras for later...)"
7408 echo "$extras" > ../extras.lst
7416 : determine where html pages for programs go
7417 set html1dir html1dir none
7421 If you wish to install html files for programs in $spackage, indicate
7422 the appropriate directory here. To skip installing html files,
7426 ''|none|$undef|' ') dflt=none ;;
7427 *) dflt=$html1dir ;;
7430 rp="Directory for the main $spackage html pages?"
7434 : Use ' ' for none so value is preserved next time through Configure
7435 $test X"$html1dir" = "X" && html1dir=' '
7437 : determine where html pages for libraries and modules go
7438 set html3dir html3dir none
7442 If you wish to install html files for modules associated with $spackage,
7443 indicate the appropriate directory here. To skip installing html files,
7446 : There is no obvious default. If they have specified html1dir, then
7447 : try to key off that, possibly changing .../html1 into .../html3.
7449 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7450 *) dflt=$html3dir ;;
7453 rp="Directory for the $spackage module html pages?"
7457 : Use ' ' for none so value is preserved next time through Configure
7458 $test X"$html3dir" = "X" && html3dir=' '
7460 : determine whether to install perl also as /usr/bin/perl
7463 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7465 Many scripts expect perl to be installed as /usr/bin/perl.
7467 If you want to, I can install the perl you are about to compile
7468 as /usr/bin/perl (in addition to $bin/perl).
7470 if test -f /usr/bin/perl; then
7473 However, please note that because you already have a /usr/bin/perl,
7474 overwriting that with a new Perl would very probably cause problems.
7475 Therefore I'm assuming you don't want to do that (unless you insist).
7478 case "$installusrbinperl" in
7479 "$define"|[yY]*) dflt='y';;
7485 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7488 case "$installusrbinperl" in
7489 "$undef"|[nN]*) dflt='n';;
7493 rp="Do you want to install perl as /usr/bin/perl?"
7496 [yY]*) val="$define";;
7502 set installusrbinperl
7505 : Check if we are using the GNU C library
7507 echo "Checking for GNU C Library..." >&4
7509 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7510 alone are insufficient to distinguish different versions, such as
7511 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7512 libc version 2.1.0. A. Dougherty, June 3, 2002.
7518 # ifdef __GLIBC_MINOR__
7519 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7520 # include <gnu/libc-version.h>
7521 printf("%s\n", gnu_get_libc_version());
7523 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7526 printf("%d\n", __GLIBC__);
7535 if eval $compile_ok && $run ./try > glibc.ver; then
7537 gnulibc_version=`$cat glibc.ver`
7538 echo "You are using the GNU C Library version $gnulibc_version"
7542 echo "You are not using the GNU C Library"
7548 : see if nm is to be used to determine whether a symbol is defined or not
7552 case "$d_gnulibc" in
7555 echo "nm probably won't work on the GNU C Library." >&4
7561 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7563 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7564 echo "'nm' won't be sufficient on this system." >&4
7570 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7571 if $test $dflt -gt 20; then
7581 true|$define) dflt=y;;
7588 I can use $nm to extract the symbols from your C libraries. This
7589 is a time consuming task which may generate huge output on the disk (up
7590 to 3 megabytes) but that should make the symbols extraction faster. The
7591 alternative is to skip the 'nm' extraction part and to compile a small
7592 test program instead to determine whether each symbol is present. If
7593 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7594 this may be the best solution.
7596 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7599 rp="Shall I use $nm to extract C symbols from the libraries?"
7602 [Nn]*) usenm=false;;
7611 : nm options which may be necessary
7613 '') if $test -f /mach_boot; then
7615 elif $test -d /usr/ccs/lib; then
7616 nm_opt='-p' # Solaris (and SunOS?)
7617 elif $test -f /dgux; then
7619 elif $test -f /lib64/rld; then
7620 nm_opt='-p' # 64-bit Irix
7626 : nm options which may be necessary for shared libraries but illegal
7627 : for archive libraries. Thank you, Linux.
7628 case "$nm_so_opt" in
7629 '') case "$myuname" in
7631 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7632 nm_so_opt='--dynamic'
7639 : Figure out where the libc is located
7642 : get list of predefined functions in a handy place
7647 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7653 *) for thislib in $libs; do
7656 : Handle C library specially below.
7659 thislib=`echo $thislib | $sed -e 's/^-l//'`
7660 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7662 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7664 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7666 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7668 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7670 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7672 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7677 libnames="$libnames $try"
7679 *) libnames="$libnames $thislib" ;;
7688 for xxx in $libpth; do
7689 $test -r $1 || set $xxx/libc.$so
7690 : The messy sed command sorts on library version numbers.
7692 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7693 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7695 s/[0-9][0-9]*/0000&/g
7696 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7699 $sort | $sed -e 's/^.* //'`
7702 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7703 $test -r $1 || set $sysroot/lib/libsys_s$_a
7709 if $test -r "$1"; then
7710 echo "Your (shared) C library seems to be in $1."
7712 elif $test -r /lib/libc && $test -r /lib/clib; then
7713 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7715 libc='/lib/clib /lib/libc'
7716 if $test -r /lib/syslib; then
7717 echo "(Your math library is in /lib/syslib.)"
7718 libc="$libc /lib/syslib"
7720 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7721 echo "Your C library seems to be in $libc, as you said before."
7722 elif $test -r $incpath/usr/lib/libc$_a; then
7723 libc=$incpath/usr/lib/libc$_a;
7724 echo "Your C library seems to be in $libc. That's fine."
7725 elif $test -r /lib/libc$_a; then
7727 echo "Your C library seems to be in $libc. You're normal."
7729 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7731 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7732 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7733 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7735 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7737 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7740 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7742 if $test -r "$tans"; then
7743 echo "Your C library seems to be in $tans, of all places."
7749 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7753 If the guess above is wrong (which it might be if you're using a strange
7754 compiler, or your machine supports multiple models), you can override it here.
7759 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7761 I can't seem to find your C library. I've looked in the following places:
7764 $sed 's/^/ /' libpath
7767 None of these seems to contain your C library. I need to get its name...
7772 rp='Where is your C library?'
7777 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7778 set X `cat libnames`
7781 case $# in 1) xxx=file; esac
7782 echo "Extracting names from the following $xxx for later perusal:" >&4
7784 $sed 's/^/ /' libnames >&4
7786 $echo $n "This may take a while...$c" >&4
7790 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7791 *) $nm $nm_opt $file 2>/dev/null;;
7796 $grep fprintf libc.tmp > libc.ptf
7797 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7798 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7800 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7802 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7804 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7806 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7808 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7810 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7812 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7814 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7816 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7818 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7820 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7822 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7824 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7825 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7827 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7829 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7831 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7833 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7835 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7837 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7839 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7841 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7843 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7845 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7847 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7849 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7851 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7853 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7855 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7858 $nm -p $* 2>/dev/null >libc.tmp
7859 $grep fprintf libc.tmp > libc.ptf
7860 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7861 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7867 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7869 if $ar t $libc > libc.tmp && \
7870 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7872 for thisname in $libnames $libc; do
7873 $ar t $thisname >>libc.tmp
7875 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7877 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7878 for thisname in $libnames $libc; do
7879 $ar tv $thisname >>libc.tmp
7880 emximp -o tmp.imp $thisname \
7882 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7883 < tmp.imp >>libc.tmp
7886 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7889 echo "$ar didn't seem to work right." >&4
7890 echo "Maybe this is a Cray...trying bld instead..." >&4
7892 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7895 for thisname in $libnames; do
7897 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7898 $ar t $thisname >>libc.tmp
7902 echo "That didn't work either. Giving up." >&4
7912 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7913 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7915 *) if $test -f /lib/syscalls.exp; then
7917 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7918 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7919 /lib/syscalls.exp >>libc.list
7925 $rm -f libnames libpath
7927 : Check if we are using C++
7929 echo "Checking for C++..." >&4
7930 $cat >try.c <<'EOCP'
7942 if eval $compile_ok && $run ./try; then
7944 echo "You are using a C++ compiler."
7947 echo "You are not using a C++ compiler."
7953 : is a C symbol defined?
7956 -v) tf=libc.tmp; tdc="";;
7957 -a) tf=libc.tmp; tdc="[]";;
7958 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7960 case "$d_cplusplus" in
7961 $define) extern_C="extern \"C\"" ;;
7962 *) extern_C="extern" ;;
7965 case "$reuseval-$4" in
7967 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7972 if $test "$runnm" = true; then
7973 if $contains $tlook $tf >/dev/null 2>&1; then
7975 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7976 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7977 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7978 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7982 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7983 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7989 $define) tval=true;;
7996 : define an is-in-libc? function
7997 inlibc='echo " "; td=$define; tu=$undef;
7998 sym=$1; var=$2; eval "was=\$$2";
8000 case "$reuseval$was" in
8010 echo "$sym() found." >&4;
8011 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8013 echo "$sym() NOT found." >&4;
8014 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8018 $define) echo "$sym() found." >&4;;
8019 *) echo "$sym() NOT found." >&4;;
8023 : see if dlopen exists
8025 xxx_ccflags="$ccflags"
8027 : with g++ one needs -shared to get is-in-libc to work for dlopen
8028 case "$gccversion" in
8030 *) case "$d_cplusplus" in
8031 "$define") ccflags="$ccflags -shared" ;;
8038 ccflags="$xxx_ccflags"
8040 : see if this is a unistd.h system
8041 set unistd.h i_unistd
8044 : determine which dynamic loading, if any, to compile in
8046 dldir="ext/DynaLoader"
8059 $define) dflt='y' ;;
8061 : Does a dl_xxx.xs file exist for this operating system
8062 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8065 rp="Do you wish to use dynamic loading?"
8072 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8073 dflt="$dldir/dl_${osname}.xs"
8074 elif $test "$d_dlopen" = "$define" ; then
8075 dflt="$dldir/dl_dlopen.xs"
8080 *) dflt="$dldir/$dlsrc"
8083 echo "The following dynamic loading files are available:"
8084 : Can not go over to $dldir because getfile has path hard-coded in.
8085 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8086 rp="Source file to use for dynamic loading"
8092 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8096 Some systems may require passing special flags to $cc -c to
8097 compile modules that will be used to create a shared library.
8098 To use no flags, say "none".
8101 case "$cccdlflags" in
8102 '') case "$gccversion" in
8103 '') case "$osname" in
8105 next) dflt='none' ;;
8106 irix*) dflt='-KPIC' ;;
8107 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8108 sunos) dflt='-pic' ;;
8112 *) case "$osname" in
8113 darwin) dflt='none' ;;
8114 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8119 *) dflt="$cccdlflags" ;;
8126 # If -Dsysroot was specified, now's the time to add it
8128 if test "X$sysroot" != X; then
8129 case "$gccversion" in
8134 dflt="$dflt --sysroot=$sysroot" ;;
8144 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8147 none) cccdlflags=' ' ;;
8148 *) cccdlflags="$ans" ;;
8153 Some systems use ld to create libraries that can be dynamically loaded,
8154 while other systems (such as those using ELF) use $cc.
8158 : Determine if this is ELF
8160 /* Test for whether ELF binaries are produced */
8172 int i = open("a.out",O_RDONLY);
8175 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8176 exit(0); /* succeed (yes, it is ELF) */
8180 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8186 '') if $test $bin_ELF = "$define"; then
8188 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8192 echo "I'll use ld to build dynamic libraries."
8200 rp="What command should be used to create dynamic libraries?"
8206 Some systems may require passing special flags to $ld to create a
8207 library that can be dynamically loaded. If your ld flags include
8208 -L/other/path options to locate libraries outside your loader's normal
8209 search path, you may need to specify those -L options here as well. To
8210 use no flags, say "none".
8213 case "$lddlflags" in
8214 '') case "$osname" in
8215 haiku) dflt='-shared' ;;
8217 case "$gccversion" in
8218 '') dflt="$dflt +vnocompatwarnings" ;;
8221 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8222 next) dflt='none' ;;
8223 solaris) # See [perl #66604].
8224 # On Solaris 11, gcc -m64 on amd64
8225 # appears not to understand -G. gcc versions at
8226 # least as old as 3.4.3 support -shared, so just
8227 # use that with Solaris 11 and later, but keep
8228 # the old behavior for older Solaris versions.
8229 case "$gccversion" in
8231 *) case "$osvers" in
8232 2.?|2.10) dflt='-G' ;;
8233 *) dflt='-shared' ;;
8238 sunos) dflt='-assert nodefinitions' ;;
8239 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8243 *) dflt="$lddlflags" ;;
8246 : Only do this for gcc, since, for example, qcc has no concept
8248 if $test "X$sysroot" != X; then
8249 case "$gccversion" in
8251 *) dflt="$dflt --sysroot $sysroot" ;;
8255 : Try to guess additional flags to pick up local libraries.
8256 : Be careful not to append to a plain 'none'
8260 for thisflag in $ldflags; do
8265 *) dflt="$dflt $thisflag" ;;
8272 ''|' ') dflt='none' ;;
8276 *-fstack-protector*)
8278 *-fstack-protector*) ;; # Don't add it again
8279 *) dflt="$dflt -fstack-protector" ;;
8284 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8287 none) lddlflags=' ' ;;
8288 *) lddlflags="$ans" ;;
8293 Some systems may require passing special flags to $cc to indicate that
8294 the resulting executable will use dynamic linking. To use no flags,
8298 case "$ccdlflags" in
8299 '') case "$osname" in
8300 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8301 next|sunos) dflt='none' ;;
8305 *) dflt="$ccdlflags" ;;
8307 rp="Any special flags to pass to $cc to use dynamic linking?"
8310 none) ccdlflags=' ' ;;
8311 *) ccdlflags="$ans" ;;
8323 ld_can_script="$undef"
8324 case "$bin_ELF$usedl" in
8326 # Abuse try.h and a.out names for neat cleanup
8338 if $cc $cccdlflags $ccdlflags $ccflags \
8339 $ldflags $lddlflags -o a.out try.c \
8340 -Wl,--version-script=try.h >/dev/null 2>&1 \
8341 && $test -s a.out ; then
8342 echo "ld supports scripting" >&4
8343 ld_can_script="$define"
8345 echo "ld does not support scripting" >&4
8351 : Do we want a shared libperl?
8355 # No dynamic loading being used, so don't bother even to prompt.
8358 *) case "$useshrplib" in
8359 '') case "$osname" in
8360 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8362 also='Building a shared libperl is required for dynamic loading to work on your system.'
8367 also='Building a shared libperl is needed for MAB support.'
8385 The perl executable is normally obtained by linking perlmain.c with
8386 libperl${_a}, any static extensions (usually just DynaLoader), and
8387 any other libraries needed on this system (such as -lm, etc.). Since
8388 your system supports dynamic loading, it is probably possible to build
8389 a shared libperl.$so. If you will have more than one executable linked
8390 to libperl.$so, this will significantly reduce the size of each
8391 executable, but it may have a noticeable effect on performance. The
8392 default is probably sensible for your system.
8396 rp="Build a shared libperl.$so (y/n)"
8400 useshrplib='true' ;;
8401 *) useshrplib='false' ;;
8406 case "$useshrplib" in
8408 case "$userelocatableinc" in
8410 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8411 echo "See INSTALL for an explanation why that won't work." >&4
8417 # Figure out a good name for libperl.so. Since it gets stored in
8418 # a version-specific architecture-dependent library, the version
8419 # number isn't really that important, except for making cc/ld happy.
8421 # A name such as libperl.so.10.1
8422 majmin="libperl.$so.$patchlevel.$subversion"
8423 # A name such as libperl.so.100
8424 majonly=`echo $patchlevel $subversion |
8425 $awk '{printf "%d%02d", $1, $2}'`
8426 majonly=libperl.$so.$majonly
8427 # I'd prefer to keep the os-specific stuff here to a minimum, and
8428 # rely on figuring it out from the naming of libc.
8429 case "${osname}${osvers}" in
8432 # XXX How handle the --version stuff for MAB?
8434 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8437 cygwin*) # ld links now against the dll directly
8438 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8439 majonly=`echo $patchlevel $subversion |
8440 $awk '{printf "%03d%03d", $1, $2}'`
8441 majonly=cygperl5.$majonly.$so
8444 *) # Try to guess based on whether libc has major.minor.
8446 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8447 *libc.$so.[0-9]*) dflt=$majonly ;;
8448 *) dflt=libperl.$so ;;
8458 I need to select a good name for the shared libperl. If your system uses
8459 library names with major and minor numbers, then you might want something
8460 like $majmin. Alternatively, if your system uses a single version
8461 number for shared libraries, then you might want to use $majonly.
8462 Or, your system might be quite happy with a simple libperl.$so.
8464 Since the shared libperl will get installed into a version-specific
8465 architecture-dependent directory, the version number of the shared perl
8466 library probably isn't important, so the default should be o.k.
8469 rp='What name do you want to give to the shared libperl?'
8472 echo "Ok, I'll use $libperl"
8475 libperl="libperl${_a}"
8479 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8483 WARNING: Use of the shrpdir variable for the installation location of
8484 the shared $libperl is not supported. It was never documented and
8485 will not work in this version. Let me (perlbug@perl.org)
8486 know of any problems this may cause.
8492 But your current setting of $shrpdir is
8493 the default anyway, so it's harmless.
8498 Further, your current attempted setting of $shrpdir
8499 conflicts with the value of $archlibexp/CORE
8500 that installperl will use.
8507 # How will the perl executable find the installed shared $libperl?
8508 # Add $xxx to ccdlflags.
8509 # If we can't figure out a command-line option, use $shrpenv to
8510 # set env LD_RUN_PATH. The main perl makefile uses this.
8511 shrpdir=$archlibexp/CORE
8514 if "$useshrplib"; then
8517 # We'll set it in Makefile.SH...
8522 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8523 xxx="-Wl,-R$shrpdir"
8525 bsdos|linux|irix*|dec_osf|gnu*)
8526 xxx="-Wl,-rpath,$shrpdir"
8529 # next doesn't like the default...
8532 # Haiku doesn't like the default, either.
8535 # hpux doesn't like the default, either.
8536 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8539 # cygwin needs only ldlibpth
8542 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8548 # Only add $xxx if it isn't already in ccdlflags.
8549 case " $ccdlflags " in
8551 *) ccdlflags="$ccdlflags $xxx"
8554 Adding $xxx to the flags
8555 passed to $ld so that the perl executable will find the
8556 installed shared $libperl.
8564 # Fix ccdlflags in AIX for building external extensions.
8565 # (For building Perl itself bare -bE:perl.exp is needed,
8566 # Makefile.SH takes care of this.)
8568 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8570 # Respect a hint or command-line value.
8572 '') shrpenv="$tmp_shrpenv" ;;
8574 case "$ldlibpthname" in
8575 '') ldlibpthname=LD_LIBRARY_PATH ;;
8576 none) ldlibpthname='' ;;
8579 : determine where manual pages are on this system
8583 syspath='/usr/share/man/man1 /usr/man/man1'
8584 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8585 syspath="$syspath /usr/man/u_man/man1"
8586 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8587 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8588 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8589 sysman=`./loc . /usr/man/man1 $syspath`
8592 if $test -d "$sysman"; then
8593 echo "System manual is in $sysman." >&4
8595 echo "Could not find manual pages in source form." >&4
8598 : determine where manual pages go
8599 set man1dir man1dir none
8603 $spackage has manual pages available in source form.
8607 echo "However, you don't have nroff, so they're probably useless to you."
8609 '') man1dir="none";;
8612 echo "If you don't want the manual sources installed, answer 'none'."
8617 lookpath="$prefixexp/share/man/man1"
8618 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8619 lookpath="$lookpath $prefixexp/man/p_man/man1"
8620 lookpath="$lookpath $prefixexp/man/u_man/man1"
8621 lookpath="$lookpath $prefixexp/man/man.1"
8623 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8624 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8634 rp="Where do the main $spackage manual pages (source) go?"
8636 if $test "X$man1direxp" != "X$ansexp"; then
8647 : What suffix to use on installed man pages
8654 rp="What suffix should be used for the main $spackage man pages?"
8656 '') case "$man1dir" in
8670 *) dflt="$man1ext";;
8677 : see if we can have long filenames
8679 first=123456789abcdef
8681 if (echo hi >$first) 2>/dev/null; then
8682 if $test -f 123456789abcde; then
8683 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8686 echo 'You can have filenames longer than 14 characters.'>&4
8691 You can't have filenames longer than 14 chars.
8692 You can't even think about them!
8698 $rm -rf 123456789abcde*
8700 : determine where library module manual pages go
8701 set man3dir man3dir none
8705 $spackage has manual pages for many of the library modules.
8711 However, you don't have nroff, so they're probably useless to you.
8714 '') man3dir="none";;
8718 case "$d_flexfnam" in
8721 However, your system can't handle the long file names like File::Basename.3.
8724 '') man3dir="none";;
8728 echo "If you don't want the manual sources installed, answer 'none'."
8729 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8731 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8732 if $test -d "$privlib/man/man3"; then
8735 WARNING: Previous versions of perl installed man3 pages into
8736 $privlib/man/man3. This version will suggest a
8737 new default of $dflt.
8741 rp='Do you wish to preserve the old behavior?(y/n)'
8744 y*) dflt="$privlib/man/man3" ;;
8749 *) dflt="$man3dir" ;;
8756 rp="Where do the $package library man pages (source) go?"
8766 : What suffix to use on installed man pages
8772 rp="What suffix should be used for the $package library man pages?"
8774 '') case "$man3dir" in
8788 *) dflt="$man3ext";;
8795 : see if we have to deal with yellow pages, now NIS.
8796 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8797 if $test -f /usr/etc/nibindd; then
8799 echo "I'm fairly confident you're on a NeXT."
8801 rp='Do you get the hosts file via NetInfo?'
8810 y*) hostcat='nidump hosts .';;
8811 *) case "$hostcat" in
8812 nidump*) hostcat='';;
8822 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8830 rp='Are you getting the hosts file via yellow pages?'
8833 y*) hostcat='ypcat hosts';;
8834 *) hostcat='cat /etc/hosts';;
8840 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8843 '') test -f /etc/group && groupcat='cat /etc/group';;
8846 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8849 : now get the host name
8851 echo "Figuring out host name..." >&4
8852 case "$myhostname" in
8854 echo 'Maybe "hostname" will work...'
8855 if tans=`sh -c hostname 2>&1` ; then
8863 if $test "$cont"; then
8865 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8866 if tans=`cat /etc/systemid 2>&1` ; then
8868 phostname='cat /etc/systemid'
8869 echo "Whadyaknow. Xenix always was a bit strange..."
8872 elif $test -r /etc/systemid; then
8873 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8876 if $test "$cont"; then
8877 echo 'No, maybe "uuname -l" will work...'
8878 if tans=`sh -c 'uuname -l' 2>&1` ; then
8880 phostname='uuname -l'
8882 echo 'Strange. Maybe "uname -n" will work...'
8883 if tans=`sh -c 'uname -n' 2>&1` ; then
8885 phostname='uname -n'
8887 echo 'Oh well, maybe I can mine it out of whoami.h...'
8888 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8889 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8890 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8892 case "$myhostname" in
8893 '') echo "Does this machine have an identity crisis or something?"
8896 echo "Well, you said $myhostname before..."
8897 phostname='echo $myhostname';;
8903 case "$myhostname" in
8904 '') myhostname=noname ;;
8906 : you do not want to know about this
8911 if $test "$myhostname" ; then
8913 rp='Your host name appears to be "'$myhostname'".'" Right?"
8921 : bad guess or no guess
8922 while $test "X$myhostname" = X ; do
8924 rp="Please type the (one word) name of your host:"
8929 : translate upper to lower if necessary
8930 case "$myhostname" in
8932 echo "(Normalizing case in your host name)"
8933 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8937 case "$myhostname" in
8939 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8940 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8941 echo "(Trimming domain name from host name--host name is now $myhostname)"
8943 *) case "$mydomain" in
8946 test "X$hostcat" = "Xypcat hosts" &&
8947 ypmatch "$myhostname" hosts 2>/dev/null |\
8948 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8951 test "X$hostcat" != "X" &&
8952 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8953 /[ ]$myhostname[ . ]/p" > hosts
8956 if $test -f hosts; then
8957 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8958 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8959 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8960 hosts | $sort | $uniq | \
8961 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8962 case `$echo X$dflt` in
8963 X*\ *) echo "(Several hosts in the database matched hostname)"
8966 X.) echo "(You do not have fully-qualified names in the hosts database)"
8970 echo "(I cannot locate a hosts database anywhere)"
8975 tans=`./loc resolv.conf X /etc /usr/etc`
8976 if $test -f "$tans"; then
8977 echo "(Attempting domain name extraction from $tans)"
8978 dflt=.`$sed -n -e 's/ / /g' \
8979 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8982 .) dflt=.`$sed -n -e 's/ / /g' \
8983 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8991 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8992 dflt=.`sh -c domainname 2>/dev/null`
8995 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8999 case "$dflt$osname" in
9000 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9001 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9005 .) echo "(Lost all hope -- silly guess then)"
9011 *) dflt="$mydomain";;
9015 rp="What is your domain name?"
9025 : translate upper to lower if necessary
9028 echo "(Normalizing case in your domain name)"
9029 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9033 : a little sanity check here
9034 case "$phostname" in
9037 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9038 $myhostname$mydomain|$myhostname) ;;
9040 case "$phostname" in
9042 echo "(That doesn't agree with your whoami.h file, by the way.)"
9045 echo "(That doesn't agree with your $phostname command, by the way.)"
9053 : determine the e-mail address of the user who is running us
9056 I need to get your e-mail address in Internet format if possible, i.e.
9057 something like user@host.domain. Please answer accurately since I have
9058 no easy means to double check it. The default value provided below
9059 is most probably close to reality but may not be valid from outside
9060 your organization...
9064 while test "$cont"; do
9065 case "$MAILDOMAIN" in
9067 if $test -s /etc/mailname; then
9068 maildomain=`$cat /etc/mailname`
9070 maildomain="$myhostname$mydomain"
9073 *) maildomain="$MAILDOMAIN";;
9076 '') dflt="$cf_by@$maildomain";;
9077 *) dflt="$cf_email";;
9079 rp='What is your e-mail address?'
9085 rp='Address does not look like an Internet one. Use it anyway?'
9099 : Ask e-mail of administrator
9102 If you or somebody else will be maintaining perl at your site, please
9103 fill in the correct e-mail address here so that they may be contacted
9104 if necessary. Currently, the "perlbug" program included with perl
9105 will send mail to this address in addition to perlbug@perl.org. You may
9106 enter "none" for no administrator.
9109 case "$perladmin" in
9110 '') dflt="$cf_email";;
9111 *) dflt="$perladmin";;
9113 rp='Perl administrator e-mail address'
9117 : determine whether to only install version-specific parts.
9120 Do you want to install only the version-specific parts of the perl
9121 distribution? Usually you do *not* want to do this.
9123 case "$versiononly" in
9124 "$define"|[Yy]*|true) dflt='y' ;;
9127 rp="Do you want to install only the version-specific parts of perl?"
9130 [yY]*) val="$define";;
9136 case "$versiononly" in
9137 "$define") inc_version_list=''
9138 inc_version_list_init=0
9142 : figure out how to guarantee perl startup
9143 : XXX Note that this currently takes advantage of the bug that binexp ignores
9144 : the Configure -Dinstallprefix setting, which in turn means that under
9145 : relocatable @INC, initialinstalllocation is what binexp started as.
9146 case "$startperl" in
9148 case "$sharpbang" in
9152 I can use the #! construct to start perl on your system. This will
9153 make startup of perl scripts faster, but may cause problems if you
9154 want to share those scripts and perl is not in a standard place
9155 ($initialinstalllocation/perl) on all your platforms. The alternative
9156 is to force a shell by starting the script with a single ':' character.
9159 case "$versiononly" in
9160 "$define") dflt="$initialinstalllocation/perl$version";;
9161 *) dflt="$initialinstalllocation/perl";;
9163 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9166 none) startperl=": # use perl";;
9167 *) startperl="#!$ans"
9168 if $test 30 -lt `echo "$ans" | wc -c`; then
9171 WARNING: Some systems limit the #! command to 32 characters.
9172 If you experience difficulty running Perl scripts with #!, try
9173 installing Perl in a directory with a shorter pathname.
9179 *) startperl=": # use perl"
9184 echo "I'll use $startperl to start perl scripts."
9186 : figure best path for perl in scripts
9189 case "$versiononly" in
9190 "$define") perlpath="$initialinstalllocation/perl$version";;
9191 *) perlpath="$initialinstalllocation/perl";;
9193 case "$startperl" in
9198 I will use the "eval 'exec'" idiom to start Perl on your system.
9199 I can use the full path of your Perl binary for this purpose, but
9200 doing so may cause problems if you want to share those scripts and
9201 Perl is not always in a standard place ($initialinstalllocation/perl).
9204 dflt="$initialinstalllocation/perl"
9205 rp="What path shall I use in \"eval 'exec'\"?"
9212 case "$startperl" in
9214 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9217 : determine where public executable scripts go
9218 set scriptdir scriptdir
9220 case "$scriptdir" in
9223 : guess some guesses
9224 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9225 $test -d /usr/share/bin && dflt=/usr/share/bin
9226 $test -d /usr/local/script && dflt=/usr/local/script
9227 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9228 $test -d $prefixexp/script && dflt=$prefixexp/script
9232 *) dflt="$scriptdir"
9237 Some installations have a separate directory just for executable scripts so
9238 that they can mount it across multiple architectures but keep the scripts in
9239 one spot. You might, for example, have a subdirectory of /usr/share for this.
9240 Or you might just lump your scripts in with all your other executables.
9244 rp='Where do you keep publicly executable scripts?'
9246 if $test "X$ansexp" != "X$scriptdirexp"; then
9252 : A little fix up for an irregularly named variable.
9253 installscript="$installscriptdir"
9255 : determine where add-on public executables go
9257 '') dflt=$siteprefix/bin ;;
9261 rp='Pathname where the add-on public executables should be installed?'
9266 : determine where add-on html pages go
9267 : There is no standard location, so try to copy the previously-selected
9268 : directory structure for the core html pages.
9269 case "$sitehtml1dir" in
9270 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9271 *) dflt=$sitehtml1dir ;;
9274 ''|' ') dflt=none ;;
9277 rp='Pathname where the site-specific html pages should be installed?'
9279 prefixvar=sitehtml1dir
9282 : determine where add-on library html pages go
9283 : There is no standard location, so try to copy the previously-selected
9284 : directory structure for the core html pages.
9285 case "$sitehtml3dir" in
9286 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9287 *) dflt=$sitehtml3dir ;;
9290 ''|' ') dflt=none ;;
9293 rp='Pathname where the site-specific library html pages should be installed?'
9295 prefixvar=sitehtml3dir
9298 : determine where add-on manual pages go
9299 case "$siteman1dir" in
9300 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9301 *) dflt=$siteman1dir ;;
9304 ''|' ') dflt=none ;;
9307 rp='Pathname where the site-specific manual pages should be installed?'
9309 prefixvar=siteman1dir
9312 : determine where add-on library man pages go
9313 case "$siteman3dir" in
9314 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9315 *) dflt=$siteman3dir ;;
9318 ''|' ') dflt=none ;;
9321 rp='Pathname where the site-specific library manual pages should be installed?'
9323 prefixvar=siteman3dir
9326 : determine where add-on public executable scripts go
9327 case "$sitescript" in
9328 '') dflt=$siteprefix/script
9329 $test -d $dflt || dflt=$sitebin ;;
9330 *) dflt="$sitescript" ;;
9333 rp='Pathname where add-on public executable scripts should be installed?'
9335 prefixvar=sitescript
9338 : Check if faststdio is requested and available
9339 case "$usefaststdio" in
9340 $define|true|[yY]*|'')
9341 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9351 Perl can be built to use 'fast stdio', which means using the stdio
9352 library but also directly manipulating the stdio buffers to enable
9353 faster I/O. Using stdio is better for backward compatibility (especially
9354 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9355 interface has been preferred instead of stdio.
9357 If this doesn't make any sense to you, just accept the default '$dflt'.
9359 rp='Use the "fast stdio" if available?'
9362 y|Y) val="$define" ;;
9369 : define an is-a-typedef? function
9370 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9372 "") inclist="sys/types.h";;
9374 eval "varval=\$$var";
9378 for inc in $inclist; do
9379 echo "#include <$inc>" >>temp.c;
9381 echo "#ifdef $type" >> temp.c;
9382 echo "printf(\"We have $type\");" >> temp.c;
9383 echo "#endif" >> temp.c;
9384 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9385 if $contains $type temp.E >/dev/null 2>&1; then
9391 *) eval "$var=\$varval";;
9394 : define an is-a-typedef? function that prompts if the type is not available.
9395 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9397 "") inclist="sys/types.h";;
9399 eval "varval=\$$var";
9403 for inc in $inclist; do
9404 echo "#include <$inc>" >>temp.c;
9406 echo "#ifdef $type" >> temp.c;
9407 echo "printf(\"We have $type\");" >> temp.c;
9408 echo "#endif" >> temp.c;
9409 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9411 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9412 if $contains $type temp.E >/dev/null 2>&1; then
9413 echo "$type found." >&4;
9416 echo "$type NOT found." >&4;
9422 *) eval "$var=\$varval";;
9425 : see what type lseek is declared as in the kernel
9426 rp="What is the type used for lseek's offset on this system?"
9427 set off_t lseektype long stdio.h sys/types.h
9431 echo "Checking to see how big your file offsets are..." >&4
9433 #include <sys/types.h>
9437 printf("%d\n", (int)sizeof($lseektype));
9442 if eval $compile_ok; then
9443 lseeksize=`$run ./try`
9444 echo "Your file offsets are $lseeksize bytes long."
9448 echo "(I can't seem to compile the test program. Guessing...)"
9449 rp="What is the size of your file offsets (in bytes)?"
9455 : see what type file positions are declared as in the library
9456 rp="What is the type for file position used by fsetpos()?"
9457 set fpos_t fpostype long stdio.h sys/types.h
9460 : Check size for Fpos_t
9463 *_t) zzz="$fpostype" ;;
9466 echo "Checking the size of $zzz..." >&4
9468 #include <sys/types.h>
9475 printf("%d\n", (int)sizeof($fpostype));
9480 if eval $compile_ok; then
9484 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9487 echo "Your $zzz is $fpossize bytes long."
9493 echo "(I can't compile the test program. Guessing...)" >&4
9494 rp="What is the size of your file positions (in bytes)?"
9499 : Check for large file support
9500 # Backward compatibility (uselfs is deprecated).
9502 "$define"|true|[yY]*)
9505 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9507 uselargefiles="$define"
9511 case "$lseeksize:$fpossize" in
9514 You can have files larger than 2 gigabytes.
9517 *) case "$uselargefiles" in
9518 "$undef"|false|[nN]*) dflt='n' ;;
9523 Perl can be built to understand large files (files larger than 2 gigabytes)
9524 on some systems. To do so, Configure can be run with -Duselargefiles.
9526 If this doesn't make any sense to you, just accept the default '$dflt'.
9528 rp='Try to understand large files, if available?'
9531 y|Y) val="$define" ;;
9538 : Look for a hint-file generated 'call-back-unit'. If the
9539 : user has specified that a large files perl is to be built,
9540 : we may need to set or change some other defaults.
9541 if $test -f uselargefiles.cbu; then
9542 echo "Your platform has some specific hints regarding large file builds, using them..."
9543 . ./uselargefiles.cbu
9545 case "$uselargefiles" in
9547 if $test -f uselargefiles.cbu; then
9549 echo "Rechecking to see how big your file offsets are..." >&4
9551 #include <sys/types.h>
9555 printf("%d\n", (int)sizeof($lseektype));
9560 if eval $compile_ok; then
9561 lseeksize=`$run ./try`
9562 $echo "Your file offsets are now $lseeksize bytes long."
9566 echo "(I can't seem to compile the test program. Guessing...)"
9567 rp="What is the size of your file offsets (in bytes)?"
9572 *_t) zzz="$fpostype" ;;
9575 $echo $n "Rechecking the size of $zzz...$c" >&4
9577 #include <sys/types.h>
9584 printf("%d\n", (int)sizeof($fpostype));
9589 if eval $compile_ok; then
9594 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9597 echo " $fpossize bytes." >&4
9603 echo "(I can't compile the test program. Guessing...)" >&4
9604 rp="What is the size of your file positions (in bytes)?"
9613 : Check if we want perlio
9616 : Set the vendorbin variables
9617 case "$vendorprefix" in
9618 '') d_vendorbin="$undef"
9622 *) d_vendorbin="$define"
9623 : determine where vendor-supplied executables go.
9624 case "$vendorbin" in
9625 '') dflt=$vendorprefix/bin ;;
9626 *) dflt="$vendorbin" ;;
9629 rp='Pathname for the vendor-supplied executables directory?'
9632 vendorbinexp="$ansexp"
9638 : Set the vendorhtml1dir variables
9639 case "$vendorprefix" in
9640 '') vendorhtml1dir=''
9641 vendorhtml1direxp=''
9643 *) : determine where vendor-supplied html pages go.
9644 : There is no standard location, so try to copy the previously-selected
9645 : directory structure for the core html pages.
9646 : XXX Better default suggestions would be welcome.
9647 case "$vendorhtml1dir" in
9648 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9649 *) dflt=$vendorhtml1dir ;;
9652 ''|' ') dflt=none ;;
9655 rp='Pathname for the vendor-supplied html pages?'
9657 vendorhtml1dir="$ans"
9658 vendorhtml1direxp="$ansexp"
9661 : Use ' ' for none so value is preserved next time through Configure
9662 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9663 prefixvar=vendorhtml1dir
9666 : Set the vendorhtml3dir variables
9667 case "$vendorprefix" in
9668 '') vendorhtml3dir=''
9669 vendorhtml3direxp=''
9671 *) : determine where vendor-supplied module html pages go.
9672 : There is no standard location, so try to copy the previously-selected
9673 : directory structure for the core html pages.
9674 : XXX Better default suggestions would be welcome.
9675 case "$vendorhtml3dir" in
9676 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9677 *) dflt=$vendorhtml3dir ;;
9680 ''|' ') dflt=none ;;
9683 rp='Pathname for the vendor-supplied html pages?'
9685 vendorhtml3dir="$ans"
9686 vendorhtml3direxp="$ansexp"
9689 : Use ' ' for none so value is preserved next time through Configure
9690 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9691 prefixvar=vendorhtml3dir
9694 : Set the vendorman1dir variables
9695 case "$vendorprefix" in
9696 '') vendorman1dir=''
9699 *) : determine where vendor-supplied manual pages go.
9700 case "$vendorman1dir" in
9701 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9702 *) dflt=$vendorman1dir ;;
9705 ''|' ') dflt=none ;;
9708 rp='Pathname for the vendor-supplied manual section 1 pages?'
9710 vendorman1dir="$ans"
9711 vendorman1direxp="$ansexp"
9714 : Use ' ' for none so value is preserved next time through Configure
9715 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9716 prefixvar=vendorman1dir
9719 : Set the vendorman3dir variables
9720 case "$vendorprefix" in
9721 '') vendorman3dir=''
9724 *) : determine where vendor-supplied module manual pages go.
9725 case "$vendorman3dir" in
9726 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9727 *) dflt=$vendorman3dir ;;
9730 ''|' ') dflt=none ;;
9733 rp='Pathname for the vendor-supplied manual section 3 pages?'
9735 vendorman3dir="$ans"
9736 vendorman3direxp="$ansexp"
9739 : Use ' ' for none so value is preserved next time through Configure
9740 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9741 prefixvar=vendorman3dir
9744 : Set the vendorscript variables
9745 case "$vendorprefix" in
9746 '') d_vendorscript="$undef"
9750 *) d_vendorscript="$define"
9751 : determine where vendor-supplied scripts go.
9752 case "$vendorscript" in
9753 '') dflt=$vendorprefix/script
9754 $test -d $dflt || dflt=$vendorbin ;;
9755 *) dflt="$vendorscript" ;;
9759 The installation process will create a directory for
9760 vendor-supplied scripts.
9764 rp='Pathname for the vendor-supplied scripts directory?'
9767 vendorscriptexp="$ansexp"
9770 prefixvar=vendorscript
9773 : script used to emit important warnings
9776 if test \$# -gt 0; then
9781 echo "*** WARNING:" >&4
9782 sed -e 's/^/*** /' <msg >&4
9784 cat msg >>config.msg
9785 echo " " >>config.msg
9791 : see which of string.h or strings.h is needed
9793 strings=`./findhdr string.h`
9794 if $test "$strings" && $test -r "$strings"; then
9795 echo "Using <string.h> instead of <strings.h>." >&4
9799 strings=`./findhdr strings.h`
9800 if $test "$strings" && $test -r "$strings"; then
9801 echo "Using <strings.h> instead of <string.h>." >&4
9803 ./warn "No string header found -- You'll surely have problems."
9809 "$undef") strings=`./findhdr strings.h`;;
9810 *) strings=`./findhdr string.h`;;
9813 : see if qgcvt exists
9817 : Check print/scan long double stuff
9820 if $test X"$d_longdbl" = X"$define"; then
9822 echo "Checking how to print long doubles..." >&4
9824 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9825 $cat >try.c <<'EOCP'
9826 #include <sys/types.h>
9830 printf("%.3f\n", d);
9834 if eval $compile; then
9838 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9839 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9840 echo "We will use %f."
9846 if $test X"$sPRIfldbl" = X; then
9847 $cat >try.c <<'EOCP'
9848 #include <sys/types.h>
9851 long double d = 123.456;
9852 printf("%.3Lf\n", d);
9856 if eval $compile; then
9860 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9861 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9862 echo "We will use %Lf."
9868 if $test X"$sPRIfldbl" = X; then
9869 $cat >try.c <<'EOCP'
9870 #include <sys/types.h>
9873 long double d = 123.456;
9874 printf("%.3llf\n", d);
9878 if eval $compile; then
9882 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9883 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9884 echo "We will use %llf."
9890 if $test X"$sPRIfldbl" = X; then
9891 $cat >try.c <<'EOCP'
9892 #include <sys/types.h>
9895 long double d = 123.456;
9896 printf("%.3lf\n", d);
9900 if eval $compile; then
9904 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9905 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9906 echo "We will use %lf."
9912 if $test X"$sPRIfldbl" = X; then
9913 echo "Cannot figure out how to print long doubles." >&4
9915 sSCNfldbl=$sPRIfldbl # expect consistency
9922 case "$sPRIfldbl" in
9923 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9924 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9925 d_SCNfldbl="$undef";
9927 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9928 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9929 d_SCNfldbl="$define";
9933 : Check how to convert floats to strings.
9935 if test "X$d_Gconvert" = X; then
9938 echo "Checking for an efficient way to convert floats to strings."
9940 case "$uselongdouble" in
9941 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9943 case "$d_longdbl" in
9944 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9946 case "$d_PRIgldbl" in
9947 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9951 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9952 char *myname = "gconvert";
9955 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9956 char *myname = "gcvt";
9959 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9960 char *myname = "qgcvt";
9961 #define DOUBLETYPE long double
9964 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9966 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9968 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9971 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9973 char *myname = "sprintf";
9977 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9978 #define DOUBLETYPE long double
9980 #define DOUBLETYPE double
9992 # include <string.h>
9994 # include <strings.h>
9997 int checkit(char *expect, char *got)
9999 if (strcmp(expect, got)) {
10000 printf("%s oddity: Expected %s, got %s\n",
10001 myname, expect, got);
10011 /* This must be 1st test on (which?) platform */
10012 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10013 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10014 checkit("0.1", buf);
10016 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10017 checkit("0.01", buf);
10019 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10020 checkit("0.001", buf);
10022 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10023 checkit("0.0001", buf);
10025 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10026 if (strlen(buf) > 5)
10027 checkit("9e-005", buf); /* for Microsoft ?? */
10029 checkit("9e-05", buf);
10031 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10034 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10035 checkit("1.1", buf);
10037 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10038 checkit("1.01", buf);
10040 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10041 checkit("1.001", buf);
10043 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10044 checkit("1.0001", buf);
10046 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10047 checkit("1.00001", buf);
10049 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10050 checkit("1.000001", buf);
10052 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10055 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10056 checkit("-1", buf);
10058 /* Some Linux gcvt's give 1.e+5 here. */
10059 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10060 checkit("100000", buf);
10062 /* Some Linux gcvt's give -1.e+5 here. */
10063 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10064 checkit("-100000", buf);
10066 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10067 checkit("123.456", buf);
10069 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10070 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10071 /* 34 should be enough to scare even long double
10072 * places into using the e notation. */
10073 if (strlen(buf) > 5)
10074 checkit("1e+034", buf); /* for Microsoft */
10076 checkit("1e+34", buf);
10078 /* For Perl, if you add additional tests here, also add them to
10079 * t/base/num.t for benefit of platforms not using Configure or
10080 * overriding d_Gconvert */
10085 : first add preferred functions to our list
10087 for xxx_convert in $gconvert_preference; do
10088 case $xxx_convert in
10089 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10090 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10093 : then add any others
10094 for xxx_convert in gconvert gcvt sprintf; do
10095 case "$xxx_list" in
10097 *) xxx_list="$xxx_list $xxx_convert" ;;
10101 case "$d_longdbl$uselongdouble" in
10103 : again, add preferred functions to our list first
10105 for xxx_convert in $gconvert_ld_preference; do
10106 case $xxx_convert in
10107 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10108 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10111 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10112 for xxx_convert in qgcvt sprintf $xxx_list; do
10113 case "$xxx_ld_list" in
10114 $xxx_convert*|*" $xxx_convert"*) ;;
10115 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10118 : if sprintf cannot do long doubles, move it to the end
10119 if test "$d_PRIgldbl" != "$define"; then
10120 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10122 : if no qgcvt, remove it
10123 if test "$d_qgcvt" != "$define"; then
10124 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10127 xxx_list="$xxx_ld_list"
10131 for xxx_convert in $xxx_list; do
10132 echo "Trying $xxx_convert..."
10133 $rm -f try try$_o core
10134 set try -DTRY_$xxx_convert
10135 if eval $compile; then
10136 echo "$xxx_convert() found." >&4
10137 if $run ./try; then
10138 echo "I'll use $xxx_convert to convert floats into a string." >&4
10141 echo "...But $xxx_convert didn't work as I expected."
10145 echo "$xxx_convert NOT found." >&4
10149 if test X$xxx_convert = X; then
10150 echo "*** WHOA THERE!!! ***" >&4
10151 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10152 xxx_convert=sprintf
10155 case "$xxx_convert" in
10156 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10157 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10158 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10159 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10160 "$define$define$define")
10161 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10162 "$define$define$undef")
10163 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10164 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10172 : see if _fwalk exists
10176 : Initialize h_fcntl
10179 : Initialize h_sysfile
10182 : access call always available on UNIX
10183 set access d_access
10186 : locate the flags for 'access()'
10187 case "$d_access" in
10190 $cat >access.c <<EOCP
10191 #include <sys/types.h>
10196 #include <sys/file.h>
10199 #include <unistd.h>
10201 #$i_stdlib I_STDLIB
10203 #include <stdlib.h>
10209 : check sys/file.h first, no particular reason here
10210 if $test `./findhdr sys/file.h` && \
10211 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10213 echo "<sys/file.h> defines the *_OK access constants." >&4
10214 elif $test `./findhdr fcntl.h` && \
10215 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10217 echo "<fcntl.h> defines the *_OK access constants." >&4
10218 elif $test `./findhdr unistd.h` && \
10219 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10220 echo "<unistd.h> defines the *_OK access constants." >&4
10222 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10228 : see if accessx exists
10229 set accessx d_accessx
10232 : see if aintl exists
10236 : see if alarm exists
10240 : see if 64bit time functions exists
10242 set ctime64 d_ctime64
10245 set localtime64 d_localtime64
10248 set gmtime64 d_gmtime64
10251 set mktime64 d_mktime64
10254 set difftime64 d_difftime64
10257 set asctime64 d_asctime64
10260 : see if POSIX threads are available
10261 set pthread.h i_pthread
10264 : define a function to check prototypes
10265 $cat > protochk <<EOSH
10268 optimize="$optimize"
10270 prototype="$prototype"
10273 usethreads=$usethreads
10274 i_pthread=$i_pthread
10275 pthread_h_first=$pthread_h_first
10278 $cat >> protochk <<'EOSH'
10283 while test $# -ge 2; do
10285 $define) echo "#include <$2>" >> try.c ;;
10286 literal) echo "$2" >> try.c ;;
10288 # Extra magic for the benefit of systems that need pthread.h
10289 # to be included early to correctly detect threadsafe functions.
10290 # Such functions must guarantee themselves, though, that the usethreads
10291 # and i_pthread have been defined, before calling protochk.
10292 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10293 echo "#include <pthread.h>" >> try.c
10298 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10299 cat >> try.c <<'EOCP'
10300 #ifdef CAN_PROTOTYPE
10301 #define _(args) args
10306 echo "$foo" >> try.c
10307 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10308 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10314 $eunicefix protochk
10316 : Define hasproto macro for Configure internal use
10317 hasproto='varname=$1; func=$2; shift; shift;
10318 while $test $# -ge 2; do
10320 $define) echo "#include <$2>";;
10324 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10325 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10326 echo "$func() prototype found.";
10329 echo "$func() prototype NOT found.";
10336 : see if sys/types.h has to be included
10337 set sys/types.h i_systypes
10340 : see if sys/select.h has to be included
10341 set sys/select.h i_sysselct
10344 : Define hasfield macro for Configure internal use
10345 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10346 while $test $# -ge 2; do
10348 $define) echo "#include <$2>";;
10352 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10354 if eval $compile; then
10363 : see if we should include time.h, sys/time.h, or both
10365 if test "X$timeincl" = X; then
10366 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10367 $echo $n "I'm now running the test program...$c"
10369 #include <sys/types.h>
10374 #ifdef SYSTIMEKERNEL
10377 #include <sys/time.h>
10380 #include <sys/select.h>
10382 #$i_stdlib I_STDLIB
10384 #include <stdlib.h>
10390 struct timeval bar;
10393 struct timezone tzp;
10395 if (foo.tm_sec == foo.tm_sec)
10398 if (bar.tv_sec == bar.tv_sec)
10405 for s_timezone in '-DS_TIMEZONE' ''; do
10407 for s_timeval in '-DS_TIMEVAL' ''; do
10408 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10409 for i_time in '' '-DI_TIME'; do
10410 for i_systime in '-DI_SYSTIME' ''; do
10413 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10414 if eval $compile; then
10415 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10419 $echo $n "Succeeded with $flags$c"
10431 *SYSTIMEKERNEL*) i_systimek="$define"
10432 timeincl=`./findhdr sys/time.h`
10433 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10434 *) i_systimek="$undef";;
10437 *I_TIME*) i_time="$define"
10438 timeincl=`./findhdr time.h`" $timeincl"
10439 echo "We'll include <time.h>." >&4;;
10440 *) i_time="$undef";;
10443 *I_SYSTIME*) i_systime="$define"
10444 timeincl=`./findhdr sys/time.h`" $timeincl"
10445 echo "We'll include <sys/time.h>." >&4;;
10446 *) i_systime="$undef";;
10450 : see if struct tm knows about tm_zone
10451 case "$i_systime$i_time" in
10454 echo "Checking to see if your struct tm has tm_zone field..." >&4
10455 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10463 case "$d_tm_tm_zone" in
10464 "$define") echo "Yes, it does." ;;
10465 *) echo "No, it doesn't." ;;
10467 : see if struct tm knows about tm_gmtoff
10468 case "$i_systime$i_time" in
10471 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10472 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10480 case "$d_tm_tm_gmtoff" in
10481 "$define") echo "Yes, it does." ;;
10482 *) echo "No, it doesn't." ;;
10485 : see if asctime_r exists
10486 set asctime_r d_asctime_r
10488 case "$d_asctime_r" in
10490 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10491 case "$d_asctime_r_proto:$usethreads" in
10492 ":define") d_asctime_r_proto=define
10493 set d_asctime_r_proto asctime_r $hdrs
10497 case "$d_asctime_r_proto" in
10499 case "$asctime_r_proto" in
10500 ''|0) try='char* asctime_r(const struct tm*, char*);'
10501 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10503 case "$asctime_r_proto" in
10504 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10505 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10507 case "$asctime_r_proto" in
10508 ''|0) try='int asctime_r(const struct tm*, char*);'
10509 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10511 case "$asctime_r_proto" in
10512 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10513 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10515 case "$asctime_r_proto" in
10516 ''|0) d_asctime_r=undef
10518 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10519 * ) case "$asctime_r_proto" in
10520 REENTRANT_PROTO*) ;;
10521 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10523 echo "Prototype: $try" ;;
10526 *) case "$usethreads" in
10527 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10534 *) asctime_r_proto=0
10538 : see if atolf exists
10542 : see if atoll exists
10546 : Look for GCC-style attribute format
10547 case "$d_attribute_format" in
10550 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10551 $cat >attrib.c <<'EOCP'
10553 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10555 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10556 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10557 echo "Your C compiler doesn't support __attribute__((format))."
10560 echo "Your C compiler supports __attribute__((format))."
10564 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10568 *) val="$d_attribute_format" ;;
10570 set d_attribute_format
10574 : Look for GCC-style attribute format with null format allowed
10575 case "$d_printf_format_null" in
10576 '') case "$d_attribute_format" in
10579 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10580 $cat >attrib.c <<EOCP
10582 #$i_stdlib I_STDLIB
10584 #include <stdlib.h>
10586 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10587 int null_printf (char* pat,...) { return (int)pat; }
10588 int main () { exit(null_printf(NULL)); }
10590 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10591 : run the executable in case it produces a run-time warning
10592 if $run ./attrib >>attrib.out 2>&1; then
10593 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10594 echo "Your C compiler doesn't allow __printf__ format to be null."
10597 echo "Your C compiler allows __printf__ format to be null."
10601 echo "Your C compiler executable failed with __printf__ format null."
10605 echo "Your C compiler fails with __printf__ format null."
10612 *) val="$d_printf_format_null" ;;
10614 set d_printf_format_null
10618 : Look for GCC-style attribute malloc
10619 case "$d_attribute_malloc" in
10622 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10623 $cat >attrib.c <<'EOCP'
10625 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10627 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10628 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10629 echo "Your C compiler doesn't support __attribute__((malloc))."
10632 echo "Your C compiler supports __attribute__((malloc))."
10636 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10640 *) val="$d_attribute_malloc" ;;
10642 set d_attribute_malloc
10646 : Look for GCC-style attribute nonnull
10647 case "$d_attribute_nonnull" in
10650 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10651 $cat >attrib.c <<'EOCP'
10653 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10655 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10656 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10657 echo "Your C compiler doesn't support __attribute__((nonnull))."
10660 echo "Your C compiler supports __attribute__((nonnull))."
10664 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10668 *) val="$d_attribute_nonnull" ;;
10670 set d_attribute_nonnull
10674 : Look for GCC-style attribute noreturn
10675 case "$d_attribute_noreturn" in
10678 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10679 $cat >attrib.c <<'EOCP'
10681 void fall_over_dead( void ) __attribute__((noreturn));
10683 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10684 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10685 echo "Your C compiler doesn't support __attribute__((noreturn))."
10688 echo "Your C compiler supports __attribute__((noreturn))."
10692 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10696 *) val="$d_attribute_noreturn" ;;
10698 set d_attribute_noreturn
10702 : Look for GCC-style attribute pure
10703 case "$d_attribute_pure" in
10706 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10707 $cat >attrib.c <<'EOCP'
10709 int square( int n ) __attribute__((pure));
10711 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10712 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10713 echo "Your C compiler doesn't support __attribute__((pure))."
10716 echo "Your C compiler supports __attribute__((pure))."
10720 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10724 *) val="$d_attribute_pure" ;;
10726 set d_attribute_pure
10730 : Look for GCC-style attribute unused
10731 case "$d_attribute_unused" in
10734 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10735 $cat >attrib.c <<'EOCP'
10737 int do_something( int dummy __attribute__((unused)), int n );
10739 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10740 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10741 echo "Your C compiler doesn't support __attribute__((unused))."
10744 echo "Your C compiler supports __attribute__((unused))."
10748 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10752 *) val="$d_attribute_unused" ;;
10754 set d_attribute_unused
10758 : Look for GCC-style attribute deprecated
10759 case "$d_attribute_deprecated" in
10762 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10763 $cat >attrib.c <<'EOCP'
10765 int I_am_deprecated(void) __attribute__((deprecated));
10767 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10768 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10769 echo "Your C compiler doesn't support __attribute__((deprecated))."
10772 echo "Your C compiler supports __attribute__((deprecated))."
10776 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10780 *) val="$d_attribute_deprecated" ;;
10782 set d_attribute_deprecated
10786 : Look for GCC-style attribute warn_unused_result
10787 case "$d_attribute_warn_unused_result" in
10790 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10791 $cat >attrib.c <<'EOCP'
10793 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10795 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10796 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10797 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10800 echo "Your C compiler supports __attribute__((warn_unused_result))."
10804 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10808 *) val="$d_attribute_warn_unused_result" ;;
10810 set d_attribute_warn_unused_result
10814 : see if bcmp exists
10818 : see if bcopy exists
10822 : see if getpgrp exists
10823 set getpgrp d_getpgrp
10826 case "$d_getpgrp" in
10829 echo "Checking to see which flavor of getpgrp is in use..."
10831 #$i_unistd I_UNISTD
10832 #include <sys/types.h>
10834 # include <unistd.h>
10836 #$i_stdlib I_STDLIB
10838 #include <stdlib.h>
10842 if (getuid() == 0) {
10843 printf("(I see you are running Configure as super-user...)\n");
10846 #ifdef TRY_BSD_PGRP
10847 if (getpgrp(1) == 0)
10856 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10857 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10859 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10860 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10863 echo "I can't seem to compile and run the test program."
10865 xxx="a USG one, i.e. you use getpgrp()."
10867 # SVR4 systems can appear rather BSD-ish.
10868 case "$i_unistd" in
10870 xxx="a BSD one, i.e. you use getpgrp(pid)."
10874 xxx="probably a USG one, i.e. you use getpgrp()."
10879 echo "Assuming your getpgrp is $xxx" >&4
10888 : see if setpgrp exists
10889 set setpgrp d_setpgrp
10892 case "$d_setpgrp" in
10895 echo "Checking to see which flavor of setpgrp is in use..."
10897 #$i_unistd I_UNISTD
10898 #include <sys/types.h>
10900 # include <unistd.h>
10902 #$i_stdlib I_STDLIB
10904 #include <stdlib.h>
10908 if (getuid() == 0) {
10909 printf("(I see you are running Configure as super-user...)\n");
10912 #ifdef TRY_BSD_PGRP
10913 if (-1 == setpgrp(1, 1))
10916 if (setpgrp() != -1)
10922 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10923 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10925 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10926 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10929 echo "(I can't seem to compile and run the test program.)"
10931 xxx="a USG one, i.e. you use setpgrp()."
10933 # SVR4 systems can appear rather BSD-ish.
10934 case "$i_unistd" in
10936 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10940 xxx="probably a USG one, i.e. you use setpgrp()."
10945 echo "Assuming your setpgrp is $xxx" >&4
10954 : Look for GCC-style __builtin_choose_expr
10955 case "$d_builtin_choose_expr" in
10958 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10959 $cat >try.c <<'EOCP'
10960 #include <assert.h>
10961 #include <stdlib.h>
10964 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10967 assert( SYRINX(1) == 2112 );
10968 assert( SYRINX(1) != 5150 );
10969 assert( SYRINX(0) == 5150 );
10970 assert( SYRINX(0) != 2112 );
10971 puts( "All good!" );
10977 if eval $compile && $run ./try; then
10978 echo "Your C compiler supports __builtin_choose_expr."
10981 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10985 *) val="$d_builtin_choose_expr" ;;
10988 set d_builtin_choose_expr
10992 : Look for GCC-style __builtin_expect
10993 case "$d_builtin_expect" in
10996 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10997 $cat >try.c <<'EOCP'
11000 if ( __builtin_expect(n, 0) ) n = 1;
11001 /* Remember shell exit code truth is 0, C truth is non-zero */
11006 if eval $compile && $run ./try; then
11007 echo "Your C compiler supports __builtin_expect."
11010 echo "Your C compiler doesn't seem to understand __builtin_expect."
11014 *) val="$d_builtin_expect" ;;
11017 set d_builtin_expect
11021 : see if bzero exists
11025 : see if stdarg is available
11027 if $test `./findhdr stdarg.h`; then
11028 echo "<stdarg.h> found." >&4
11031 echo "<stdarg.h> NOT found." >&4
11035 : see if varargs is available
11037 if $test `./findhdr varargs.h`; then
11038 echo "<varargs.h> found." >&4
11040 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11043 : set up the varargs testing programs
11044 $cat > varargs.c <<EOP
11046 #include <stdarg.h>
11049 #include <varargs.h>
11053 int f(char *p, ...)
11067 p = va_arg(ap, char *);
11073 $cat > varargs <<EOP
11075 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11084 : now check which varargs header should be included
11090 if `./varargs I_STDARG`; then
11092 elif `./varargs I_VARARGS`; then
11097 if `./varargs I_VARARGS`; then
11105 echo "*** WHOA THERE!!! ***" >&4
11106 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11107 case "$knowitall" in
11109 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11113 echo "I could not find the definition for va_dcl... You have problems..." >&4
11114 val="$undef"; set i_stdarg; eval $setvar
11115 val="$undef"; set i_varargs; eval $setvar
11120 case "$i_varhdr" in
11122 val="$define"; set i_stdarg; eval $setvar
11123 val="$undef"; set i_varargs; eval $setvar
11126 val="$undef"; set i_stdarg; eval $setvar
11127 val="$define"; set i_varargs; eval $setvar
11130 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11134 : see if the Compiler supports C99 variadic macros
11135 case "$i_stdarg$i_stdlib" in
11137 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11140 #include <stdarg.h>
11142 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11146 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11152 if eval $compile && $run ./try 2>&1 >/dev/null; then
11153 case "`$run ./try`" in
11155 echo "You have C99 variadic macros." >&4
11156 d_c99_variadic_macros="$define"
11159 echo "You don't have functional C99 variadic macros." >&4
11160 d_c99_variadic_macros="$undef"
11164 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11165 d_c99_variadic_macros="$undef"
11170 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11171 d_c99_variadic_macros="$undef"
11175 : see if signal is declared as pointer to function returning int or void
11177 xxx=`./findhdr signal.h`
11178 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11179 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11180 echo "You have int (*signal())() instead of void." >&4
11182 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11183 echo "You have void (*signal())()." >&4
11185 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11186 echo "You have int (*signal())() instead of void." >&4
11188 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11189 echo "You have void (*signal())()." >&4
11192 case "$d_voidsig" in
11194 echo "I can't determine whether signal handler returns void or int..." >&4
11196 rp="What type does your signal handler return?"
11199 v*) val="$define";;
11203 echo "As you already told me, signal handler returns void." >&4
11206 *) echo "As you already told me, signal handler returns int." >&4
11213 case "$d_voidsig" in
11214 "$define") signal_t="void";;
11215 *) signal_t="int";;
11219 : check for ability to cast large floats to 32-bit ints.
11221 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11222 if $test "$intsize" -ge 4; then
11229 #$i_stdlib I_STDLIB
11231 #include <stdlib.h>
11233 #include <sys/types.h>
11234 #include <signal.h>
11235 $signal_t blech(int s) { exit(3); }
11242 signal(SIGFPE, blech);
11244 /* Don't let compiler optimize the test away. Store the number
11245 in a writable string for gcc to pass to sscanf under HP-UX.
11247 sprintf(str, "2147483647");
11248 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11252 /* x86 processors will probably give 0x8000 0000, which is a
11253 sign change. We don't want that. We want to mimic SPARC
11254 behavior here, which is to preserve the sign and give
11257 if (i32 != ($xxx) f)
11263 if eval $compile_ok; then
11267 echo "(I can't seem to compile the test program--assuming it can't)"
11272 echo "Yup, it can."
11275 echo "Nope, it can't."
11282 : check for ability to cast negative floats to unsigned
11284 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11287 #$i_stdlib I_STDLIB
11289 #include <stdlib.h>
11291 #include <sys/types.h>
11292 #include <signal.h>
11293 $signal_t blech(int s) { exit(7); }
11294 $signal_t blech_in_list(int s) { exit(4); }
11295 unsigned long dummy_long(unsigned long p) { return p; }
11296 unsigned int dummy_int(unsigned int p) { return p; }
11297 unsigned short dummy_short(unsigned short p) { return p; }
11301 unsigned long along;
11303 unsigned short ashort;
11307 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11308 a direct f = -123. assignment. gcc-2.8.0 reportedly
11309 optimized the whole file away
11311 /* Store the number in a writable string for gcc to pass to
11312 sscanf under HP-UX.
11314 sprintf(str, "-123");
11315 sscanf(str, "%lf", &f); /* f = -123.; */
11317 signal(SIGFPE, blech);
11318 along = (unsigned long)f;
11319 aint = (unsigned int)f;
11320 ashort = (unsigned short)f;
11321 if (along != (unsigned long)-123)
11323 if (aint != (unsigned int)-123)
11325 if (ashort != (unsigned short)-123)
11327 sprintf(str, "1073741824.");
11328 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11331 along = (unsigned long)f;
11332 if (along != 0x80000000)
11336 along = (unsigned long)f;
11337 if (along != 0x7fffffff)
11341 along = (unsigned long)f;
11342 if (along != 0x80000001)
11346 signal(SIGFPE, blech_in_list);
11347 sprintf(str, "123.");
11348 sscanf(str, "%lf", &f); /* f = 123.; */
11349 along = dummy_long((unsigned long)f);
11350 aint = dummy_int((unsigned int)f);
11351 ashort = dummy_short((unsigned short)f);
11352 if (along != (unsigned long)123)
11354 if (aint != (unsigned int)123)
11356 if (ashort != (unsigned short)123)
11363 if eval $compile_ok; then
11367 echo "(I can't seem to compile the test program--assuming it can't)"
11370 case "$castflags" in
11372 echo "Yup, it can."
11375 echo "Nope, it can't."
11382 : see if vprintf exists
11384 if set vprintf val -f d_vprintf; eval $csym; $val; then
11385 echo 'vprintf() found.' >&4
11388 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11389 #$i_varargs I_VARARGS
11391 #$i_stdlib I_STDLIB
11392 #$i_unistd I_UNISTD
11395 # include <stdarg.h>
11396 #else /* I_VARARGS */
11397 # include <varargs.h>
11401 # include <unistd.h>
11405 # include <stdlib.h>
11408 #include <stdio.h> /* vsprintf prototype */
11411 void xxx(int n, ...)
11416 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11418 int main() { xxx(1, "foo"); }
11420 #else /* I_VARARGS */
11428 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11430 int main() { xxx("foo"); }
11436 if eval $compile_ok; then
11437 if $run ./try; then
11438 echo "Your vsprintf() returns (int)." >&4
11441 echo "Your vsprintf() returns (char*)." >&4
11445 echo 'I am unable to compile the vsprintf() test program.' >&4
11446 # We shouldn't get here. If we do, assume the standard signature,
11447 # not the old BSD one.
11448 echo 'Guessing that vsprintf() returns (int).' >&4
11452 echo 'vprintf() NOT found.' >&4
11463 : see if chown exists
11467 : see if chroot exists
11468 set chroot d_chroot
11471 : see if chsize exists
11472 set chsize d_chsize
11475 : see if class exists
11479 : see if clearenv exists
11480 set clearenv d_clearenv
11483 : Define hasstruct macro for Configure internal use
11484 hasstruct='varname=$1; struct=$2; shift; shift;
11485 while $test $# -ge 2; do
11487 $define) echo "#include <$2>";;
11491 echo "int main () { struct $struct foo; }" >> try.c;
11493 if eval $compile; then
11502 : see whether socket exists
11506 $echo $n "Hmm... $c" >&4
11507 if set socket val -f d_socket; eval $csym; $val; then
11508 echo "Looks like you have Berkeley networking support." >&4
11510 if set setsockopt val -f; eval $csym; $val; then
11513 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11514 d_oldsock="$define"
11517 if $contains socklib libc.list >/dev/null 2>&1; then
11518 echo "Looks like you have Berkeley networking support." >&4
11520 : we will have to assume that it supports the 4.2 BSD interface
11523 echo "You don't have Berkeley networking in libc$_a..." >&4
11524 if test "X$d_socket" = "X$define"; then
11525 echo "...but you seem to believe that you have sockets." >&4
11527 for net in net socket
11529 if test -f $sysroot/usr/lib/lib$net$_a; then
11530 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11531 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11532 if $contains socket libc.list >/dev/null 2>&1; then
11537 echo "...but the Wollongong group seems to have hacked it in." >&4
11538 sockethdr="-I$sysroot/usr/netinclude"
11541 echo "Found Berkeley sockets interface in lib$net." >&4
11542 if $contains setsockopt libc.list >/dev/null 2>&1; then
11545 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11546 d_oldsock="$define"
11552 if test "X$d_socket" != "X$define"; then
11553 echo "or anywhere else I see." >&4
11561 : see if socketpair exists
11562 set socketpair d_sockpair
11567 echo "Checking the availability sa_len in the sock struct ..." >&4
11569 #include <sys/types.h>
11570 #include <sys/socket.h>
11572 struct sockaddr sa;
11573 return (sa.sa_len);
11577 set try; if eval $compile; then
11580 set d_sockaddr_sa_len; eval $setvar
11584 echo "Checking the availability struct sockaddr_in6 ..." >&4
11586 #include <sys/types.h>
11587 #include <sys/socket.h>
11588 #include <netinet/in.h>
11590 struct sockaddr_in6 sin6;
11591 return (sin6.sin6_family);
11595 set try; if eval $compile; then
11598 set d_sockaddr_in6; eval $setvar
11602 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11604 #include <sys/types.h>
11605 #include <sys/socket.h>
11606 #include <netinet/in.h>
11608 struct sockaddr_in6 sin6;
11609 return (sin6.sin6_scope_id);
11613 set try; if eval $compile; then
11616 set d_sin6_scope_id; eval $setvar
11620 echo "Checking the availability struct ip_mreq ..." >&4
11622 #include <sys/types.h>
11623 #include <sys/socket.h>
11624 #include <netinet/in.h>
11626 struct ip_mreq mreq;
11627 return (mreq.imr_multiaddr.s_addr);
11631 set try; if eval $compile; then
11634 set d_ip_mreq; eval $setvar
11638 echo "Checking the availability struct ip_mreq_source ..." >&4
11640 #include <sys/types.h>
11641 #include <sys/socket.h>
11642 #include <netinet/in.h>
11644 struct ip_mreq_source mreq;
11645 return (mreq.imr_multiaddr.s_addr);
11649 set try; if eval $compile; then
11652 set d_ip_mreq_source; eval $setvar
11656 echo "Checking the availability struct ipv6_mreq ..." >&4
11658 #include <sys/types.h>
11659 #include <sys/socket.h>
11660 #include <netinet/in.h>
11662 struct ipv6_mreq mreq;
11663 return (mreq.ipv6mr_interface);
11667 set try; if eval $compile; then
11670 set d_ipv6_mreq; eval $setvar
11674 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11676 #include <sys/types.h>
11677 #include <sys/socket.h>
11678 #include <netinet/in.h>
11680 struct ipv6_mreq_source mreq;
11681 return (mreq.imr_multiaddr.s_addr);
11685 set try; if eval $compile; then
11688 set d_ipv6_mreq_source; eval $setvar
11692 echo "Checking the availability of certain socket constants..." >&4
11693 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11694 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11696 #include <sys/types.h>
11697 #include <sys/socket.h>
11703 set try; if eval $compile; then
11706 set d_${enum}; eval $setvar
11710 : see if this is a sys/uio.h system
11711 set sys/uio.h i_sysuio
11714 : Check for cmsghdr support
11716 echo "Checking to see if your system supports struct cmsghdr..." >&4
11717 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11719 case "$d_cmsghdr_s" in
11720 "$define") echo "Yes, it does." ;;
11721 *) echo "No, it doesn't." ;;
11725 : check for const keyword
11727 echo 'Checking to see if your C compiler knows about "const"...' >&4
11728 $cat >const.c <<'EOCP'
11729 typedef struct spug { int drokk; } spug;
11733 const spug y = { 0 };
11736 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11738 echo "Yup, it does."
11741 echo "Nope, it doesn't."
11746 : see if copysignl exists
11747 set copysignl d_copysignl
11750 : see if crypt exists
11755 $define) cryptlib='' ;;
11756 *) if set crypt val -f d_crypt; eval $csym; $val; then
11757 echo 'crypt() found.' >&4
11761 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11762 if $test -z "$cryptlib"; then
11763 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11767 if $test -z "$cryptlib"; then
11768 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11772 if $test -z "$cryptlib"; then
11773 cryptlib=`./loc libcrypt$_a "" $libpth`
11777 if $test -z "$cryptlib"; then
11778 echo 'crypt() NOT found.' >&4
11789 : see if this is a crypt.h system
11790 set crypt.h i_crypt
11793 : see if crypt_r exists
11794 set crypt_r d_crypt_r
11796 case "$d_crypt_r" in
11798 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11799 case "$d_crypt_r_proto:$usethreads" in
11800 ":define") d_crypt_r_proto=define
11801 set d_crypt_r_proto crypt_r $hdrs
11805 case "$d_crypt_r_proto" in
11807 case "$crypt_r_proto" in
11808 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11809 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11811 case "$crypt_r_proto" in
11812 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11813 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11815 case "$crypt_r_proto" in
11816 ''|0) d_crypt_r=undef
11818 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11819 * ) case "$crypt_r_proto" in
11820 REENTRANT_PROTO*) ;;
11821 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11823 echo "Prototype: $try" ;;
11826 *) case "$usethreads" in
11827 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11838 : get csh whereabouts
11840 'csh') val="$undef" ;;
11841 *) val="$define" ;;
11845 : Respect a hint or command line value for full_csh.
11846 case "$full_csh" in
11847 '') full_csh=$csh ;;
11850 : see if ctermid exists
11851 set ctermid d_ctermid
11854 : see if ctermid_r exists
11855 set ctermid_r d_ctermid_r
11857 case "$d_ctermid_r" in
11859 hdrs="$i_systypes sys/types.h define stdio.h "
11860 case "$d_ctermid_r_proto:$usethreads" in
11861 ":define") d_ctermid_r_proto=define
11862 set d_ctermid_r_proto ctermid_r $hdrs
11866 case "$d_ctermid_r_proto" in
11868 case "$ctermid_r_proto" in
11869 ''|0) try='char* ctermid_r(char*);'
11870 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11872 case "$ctermid_r_proto" in
11873 ''|0) d_ctermid_r=undef
11875 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11876 * ) case "$ctermid_r_proto" in
11877 REENTRANT_PROTO*) ;;
11878 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11880 echo "Prototype: $try" ;;
11883 *) case "$usethreads" in
11884 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11891 *) ctermid_r_proto=0
11895 : see if ctime_r exists
11896 set ctime_r d_ctime_r
11898 case "$d_ctime_r" in
11900 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11901 case "$d_ctime_r_proto:$usethreads" in
11902 ":define") d_ctime_r_proto=define
11903 set d_ctime_r_proto ctime_r $hdrs
11907 case "$d_ctime_r_proto" in
11909 case "$ctime_r_proto" in
11910 ''|0) try='char* ctime_r(const time_t*, char*);'
11911 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11913 case "$ctime_r_proto" in
11914 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11915 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11917 case "$ctime_r_proto" in
11918 ''|0) try='int ctime_r(const time_t*, char*);'
11919 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11921 case "$ctime_r_proto" in
11922 ''|0) try='int ctime_r(const time_t*, char*, int);'
11923 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11925 case "$ctime_r_proto" in
11926 ''|0) d_ctime_r=undef
11928 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11929 * ) case "$ctime_r_proto" in
11930 REENTRANT_PROTO*) ;;
11931 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11933 echo "Prototype: $try" ;;
11936 *) case "$usethreads" in
11937 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11948 : see if cuserid exists
11949 set cuserid d_cuserid
11952 : see if this is a limits.h system
11953 set limits.h i_limits
11956 : see if this is a float.h system
11957 set float.h i_float
11960 : See if number of significant digits in a double precision number is known
11962 $cat >dbl_dig.c <<EOM
11963 #$i_limits I_LIMITS
11966 #include <limits.h>
11972 printf("Contains DBL_DIG");
11975 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11976 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11977 echo "DBL_DIG found." >&4
11980 echo "DBL_DIG NOT found." >&4
11987 : see if dbm.h is available
11988 : see if dbmclose exists
11989 set dbmclose d_dbmclose
11992 case "$d_dbmclose" in
12002 *) set rpcsvc/dbm.h i_rpcsvcdbm
12007 *) echo "We won't be including <dbm.h>"
12017 : see if prototype for dbminit is available
12019 set d_dbminitproto dbminit $i_dbm dbm.h
12022 : see if difftime exists
12023 set difftime d_difftime
12026 : see if this is a dirent system
12028 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12030 echo "<dirent.h> found." >&4
12033 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12034 echo "<sys/dir.h> found." >&4
12037 xinc=`./findhdr sys/ndir.h`
12039 echo "<dirent.h> NOT found." >&4
12044 : Look for type of directory structure.
12046 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12048 case "$direntrytype" in
12050 case "$i_dirent" in
12051 $define) guess1='struct dirent' ;;
12052 *) guess1='struct direct' ;;
12055 *) guess1="$direntrytype"
12060 'struct dirent') guess2='struct direct' ;;
12061 *) guess2='struct dirent' ;;
12064 if $contains "$guess1" try.c >/dev/null 2>&1; then
12065 direntrytype="$guess1"
12066 echo "Your directory entries are $direntrytype." >&4
12067 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12068 direntrytype="$guess2"
12069 echo "Your directory entries seem to be $direntrytype." >&4
12071 echo "I don't recognize your system's directory entries." >&4
12072 rp="What type is used for directory entries on this system?"
12075 direntrytype="$ans"
12079 : see if the directory entry stores field length
12081 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12082 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12083 echo "Good, your directory entry keeps length information in d_namlen." >&4
12086 echo "Your directory entry does not know about the d_namlen field." >&4
12093 : Look for DIR.dd_fd
12094 case "$i_dirent" in
12096 echo "Checking to see if DIR has a dd_fd member variable" >&4
12098 #$i_stdlib I_STDLIB
12100 #include <stdlib.h>
12102 #include <dirent.h>
12112 if eval $compile; then
12113 echo "Yes, it does."
12116 echo "No, it does not."
12121 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12129 : see if this is an sysdir system
12130 set sys/dir.h i_sysdir
12133 : see if this is an sysndir system
12134 set sys/ndir.h i_sysndir
12139 $cat >dirfd.c <<EOM
12141 #$i_stdlib I_STDLIB
12143 #include <stdlib.h>
12145 #$i_dirent I_DIRENT /**/
12146 #$i_sysdir I_SYS_DIR /**/
12147 #$i_sysndir I_SYS_NDIR /**/
12148 #$i_systypes I_SYS_TYPES /**/
12149 #if defined(I_SYS_TYPES)
12150 #include <sys/types.h>
12152 #if defined(I_DIRENT)
12153 #include <dirent.h>
12154 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12155 #include <sys/dir.h>
12159 #include <sys/ndir.h>
12163 #include <ndir.h> /* may be wrong in the future */
12165 #include <sys/dir.h>
12171 DIR *dirp = opendir(".");
12172 if (dirfd(dirp) >= 0)
12180 if eval $compile; then
12184 $define) echo "dirfd() found." >&4 ;;
12185 *) echo "dirfd() NOT found." >&4 ;;
12191 : see if dlerror exists
12194 set dlerror d_dlerror
12198 : see if dlfcn is available
12199 set dlfcn.h i_dlfcn
12202 : Check what extension to use for shared libs
12207 On a few systems, the dynamically loaded modules that perl generates and uses
12208 will need a different extension than shared libs. The default will probably
12214 *) dflt="$dlext" ;;
12216 rp='What is the extension of dynamically loaded modules'
12225 : Check if dlsym need a leading underscore
12231 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12232 $cat >dyna.c <<'EOM'
12239 #$i_stdlib I_STDLIB
12241 #include <stdlib.h>
12245 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12247 #include <sys/types.h>
12252 extern int fred() ;
12261 int mode = RTLD_LAZY ;
12263 handle = dlopen("./dyna.$dlext", mode) ;
12264 if (handle == NULL) {
12269 symbol = dlsym(handle, "fred") ;
12270 if (symbol == NULL) {
12271 /* try putting a leading underscore */
12272 symbol = dlsym(handle, "_fred") ;
12273 if (symbol == NULL) {
12286 : Call the object file tmp-dyna.o in case dlext=o.
12287 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12288 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12289 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12290 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12293 1) echo "Test program failed using dlopen." >&4
12294 echo "Perhaps you should not use dynamic loading." >&4;;
12295 2) echo "Test program failed using dlsym." >&4
12296 echo "Perhaps you should not use dynamic loading." >&4;;
12297 3) echo "dlsym needs a leading underscore" >&4
12299 4) echo "dlsym doesn't need a leading underscore." >&4;;
12302 echo "I can't compile and run the test program." >&4
12303 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12308 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12313 : see if drand48_r exists
12314 set drand48_r d_drand48_r
12316 case "$d_drand48_r" in
12318 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12319 case "$d_drand48_r_proto:$usethreads" in
12320 ":define") d_drand48_r_proto=define
12321 set d_drand48_r_proto drand48_r $hdrs
12325 case "$d_drand48_r_proto" in
12327 case "$drand48_r_proto" in
12328 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12329 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12331 case "$drand48_r_proto" in
12332 ''|0) d_drand48_r=undef
12334 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12335 * ) case "$drand48_r_proto" in
12336 REENTRANT_PROTO*) ;;
12337 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12339 echo "Prototype: $try" ;;
12342 *) case "$usethreads" in
12343 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12350 *) drand48_r_proto=0
12354 : see if prototype for drand48 is available
12356 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12359 : see if dup2 exists
12363 : see if eaccess exists
12364 set eaccess d_eaccess
12367 : see if endgrent exists
12368 set endgrent d_endgrent
12371 : see if this is an grp system
12377 xxx=`./findhdr grp.h`
12378 $cppstdin $cppflags $cppminus < $xxx >$$.h
12380 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12392 set d_grpasswd; eval $setvar
12396 : see if endgrent_r exists
12397 set endgrent_r d_endgrent_r
12399 case "$d_endgrent_r" in
12401 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12402 case "$d_endgrent_r_proto:$usethreads" in
12403 ":define") d_endgrent_r_proto=define
12404 set d_endgrent_r_proto endgrent_r $hdrs
12408 case "$d_endgrent_r_proto" in
12410 case "$endgrent_r_proto" in
12411 ''|0) try='int endgrent_r(FILE**);'
12412 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12414 case "$endgrent_r_proto" in
12415 ''|0) try='void endgrent_r(FILE**);'
12416 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12418 case "$endgrent_r_proto" in
12419 ''|0) d_endgrent_r=undef
12421 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12422 * ) case "$endgrent_r_proto" in
12423 REENTRANT_PROTO*) ;;
12424 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12426 echo "Prototype: $try" ;;
12429 *) case "$usethreads" in
12430 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12437 *) endgrent_r_proto=0
12441 : see if endhostent exists
12442 set endhostent d_endhent
12445 : see if this is a netdb.h system
12446 set netdb.h i_netdb
12449 : see if endhostent_r exists
12450 set endhostent_r d_endhostent_r
12452 case "$d_endhostent_r" in
12454 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12455 case "$d_endhostent_r_proto:$usethreads" in
12456 ":define") d_endhostent_r_proto=define
12457 set d_endhostent_r_proto endhostent_r $hdrs
12461 case "$d_endhostent_r_proto" in
12463 case "$endhostent_r_proto" in
12464 ''|0) try='int endhostent_r(struct hostent_data*);'
12465 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12467 case "$endhostent_r_proto" in
12468 ''|0) try='void endhostent_r(struct hostent_data*);'
12469 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12471 case "$endhostent_r_proto" in
12472 ''|0) d_endhostent_r=undef
12473 endhostent_r_proto=0
12474 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12475 * ) case "$endhostent_r_proto" in
12476 REENTRANT_PROTO*) ;;
12477 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12479 echo "Prototype: $try" ;;
12482 *) case "$usethreads" in
12483 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12485 d_endhostent_r=undef
12486 endhostent_r_proto=0
12490 *) endhostent_r_proto=0
12494 : see if endnetent exists
12495 set endnetent d_endnent
12498 : see if endnetent_r exists
12499 set endnetent_r d_endnetent_r
12501 case "$d_endnetent_r" in
12503 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12504 case "$d_endnetent_r_proto:$usethreads" in
12505 ":define") d_endnetent_r_proto=define
12506 set d_endnetent_r_proto endnetent_r $hdrs
12510 case "$d_endnetent_r_proto" in
12512 case "$endnetent_r_proto" in
12513 ''|0) try='int endnetent_r(struct netent_data*);'
12514 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12516 case "$endnetent_r_proto" in
12517 ''|0) try='void endnetent_r(struct netent_data*);'
12518 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12520 case "$endnetent_r_proto" in
12521 ''|0) d_endnetent_r=undef
12522 endnetent_r_proto=0
12523 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12524 * ) case "$endnetent_r_proto" in
12525 REENTRANT_PROTO*) ;;
12526 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12528 echo "Prototype: $try" ;;
12531 *) case "$usethreads" in
12532 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12534 d_endnetent_r=undef
12535 endnetent_r_proto=0
12539 *) endnetent_r_proto=0
12543 : see if endprotoent exists
12544 set endprotoent d_endpent
12547 : see if endprotoent_r exists
12548 set endprotoent_r d_endprotoent_r
12550 case "$d_endprotoent_r" in
12552 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12553 case "$d_endprotoent_r_proto:$usethreads" in
12554 ":define") d_endprotoent_r_proto=define
12555 set d_endprotoent_r_proto endprotoent_r $hdrs
12559 case "$d_endprotoent_r_proto" in
12561 case "$endprotoent_r_proto" in
12562 ''|0) try='int endprotoent_r(struct protoent_data*);'
12563 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12565 case "$endprotoent_r_proto" in
12566 ''|0) try='void endprotoent_r(struct protoent_data*);'
12567 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12569 case "$endprotoent_r_proto" in
12570 ''|0) d_endprotoent_r=undef
12571 endprotoent_r_proto=0
12572 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12573 * ) case "$endprotoent_r_proto" in
12574 REENTRANT_PROTO*) ;;
12575 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12577 echo "Prototype: $try" ;;
12580 *) case "$usethreads" in
12581 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12583 d_endprotoent_r=undef
12584 endprotoent_r_proto=0
12588 *) endprotoent_r_proto=0
12592 : see if endpwent exists
12593 set endpwent d_endpwent
12596 : see if this is a pwd.h system
12602 xxx=`./findhdr pwd.h`
12603 $cppstdin $cppflags $cppminus < $xxx >$$.h
12605 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12613 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12621 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12629 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12637 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12645 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12653 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12661 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12673 set d_pwquota; eval $setvar
12674 set d_pwage; eval $setvar
12675 set d_pwchange; eval $setvar
12676 set d_pwclass; eval $setvar
12677 set d_pwexpire; eval $setvar
12678 set d_pwcomment; eval $setvar
12679 set d_pwgecos; eval $setvar
12680 set d_pwpasswd; eval $setvar
12684 : see if endpwent_r exists
12685 set endpwent_r d_endpwent_r
12687 case "$d_endpwent_r" in
12689 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12690 case "$d_endpwent_r_proto:$usethreads" in
12691 ":define") d_endpwent_r_proto=define
12692 set d_endpwent_r_proto endpwent_r $hdrs
12696 case "$d_endpwent_r_proto" in
12698 case "$endpwent_r_proto" in
12699 ''|0) try='int endpwent_r(FILE**);'
12700 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12702 case "$endpwent_r_proto" in
12703 ''|0) try='void endpwent_r(FILE**);'
12704 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12706 case "$endpwent_r_proto" in
12707 ''|0) d_endpwent_r=undef
12709 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12710 * ) case "$endpwent_r_proto" in
12711 REENTRANT_PROTO*) ;;
12712 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12714 echo "Prototype: $try" ;;
12717 *) case "$usethreads" in
12718 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12725 *) endpwent_r_proto=0
12729 : see if endservent exists
12730 set endservent d_endsent
12733 : see if endservent_r exists
12734 set endservent_r d_endservent_r
12736 case "$d_endservent_r" in
12738 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12739 case "$d_endservent_r_proto:$usethreads" in
12740 ":define") d_endservent_r_proto=define
12741 set d_endservent_r_proto endservent_r $hdrs
12745 case "$d_endservent_r_proto" in
12747 case "$endservent_r_proto" in
12748 ''|0) try='int endservent_r(struct servent_data*);'
12749 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12751 case "$endservent_r_proto" in
12752 ''|0) try='void endservent_r(struct servent_data*);'
12753 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12755 case "$endservent_r_proto" in
12756 ''|0) d_endservent_r=undef
12757 endservent_r_proto=0
12758 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12759 * ) case "$endservent_r_proto" in
12760 REENTRANT_PROTO*) ;;
12761 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12763 echo "Prototype: $try" ;;
12766 *) case "$usethreads" in
12767 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12769 d_endservent_r=undef
12770 endservent_r_proto=0
12774 *) endservent_r_proto=0
12778 : Locate the flags for 'open()'
12781 #include <sys/types.h>
12786 #include <sys/file.h>
12788 #$i_stdlib I_STDLIB
12790 #include <stdlib.h>
12801 : check sys/file.h first to get FREAD on Sun
12802 if $test `./findhdr sys/file.h` && \
12803 set try -DI_SYS_FILE && eval $compile; then
12805 echo "<sys/file.h> defines the O_* constants..." >&4
12806 if $run ./try; then
12807 echo "and you have the 3 argument form of open()." >&4
12810 echo "but not the 3 argument form of open(). Oh, well." >&4
12813 elif $test `./findhdr fcntl.h` && \
12814 set try -DI_FCNTL && eval $compile; then
12816 echo "<fcntl.h> defines the O_* constants..." >&4
12817 if $run ./try; then
12818 echo "and you have the 3 argument form of open()." >&4
12821 echo "but not the 3 argument form of open(). Oh, well." >&4
12826 echo "I can't find the O_* constant definitions! You got problems." >&4
12832 : see if this is a sys/file.h system
12837 : do we need to include sys/file.h ?
12841 if $h_sysfile; then
12843 echo "We'll be including <sys/file.h>." >&4
12846 echo "We won't be including <sys/file.h>." >&4
12856 : see if fcntl.h is there
12861 : see if we can include fcntl.h
12867 echo "We'll be including <fcntl.h>." >&4
12870 if $h_sysfile; then
12871 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12873 echo "We won't be including <fcntl.h>." >&4
12885 : see if fork exists
12889 : see if pipe exists
12893 : check for non-blocking I/O stuff
12894 case "$h_sysfile" in
12895 true) echo "#include <sys/file.h>" > head.c;;
12898 true) echo "#include <fcntl.h>" > head.c;;
12899 *) echo "#include <sys/fcntl.h>" > head.c;;
12904 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12905 case "$o_nonblock" in
12907 $cat head.c > try.c
12908 $cat >>try.c <<EOCP
12910 #$i_stdlib I_STDLIB
12912 #include <stdlib.h>
12920 printf("O_NONBLOCK\n");
12924 printf("O_NDELAY\n");
12928 printf("FNDELAY\n");
12935 if eval $compile_ok; then
12936 o_nonblock=`$run ./try`
12937 case "$o_nonblock" in
12938 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12939 *) echo "Seems like we can use $o_nonblock.";;
12942 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12945 *) echo "Using $hint value $o_nonblock.";;
12950 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12953 case "$d_fork:$d_pipe" in
12955 $cat head.c > try.c
12956 $cat >>try.c <<EOCP
12958 #include <sys/types.h>
12959 #include <signal.h>
12961 #$i_stdlib I_STDLIB
12963 #include <stdlib.h>
12969 #define MY_O_NONBLOCK $o_nonblock
12970 #ifndef errno /* XXX need better Configure test */
12973 #$i_unistd I_UNISTD
12975 #include <unistd.h>
12977 #$i_string I_STRING
12979 #include <string.h>
12981 #include <strings.h>
12983 $signal_t blech(int x) { exit(3); }
12985 $cat >> try.c <<'EOCP'
12993 pipe(pd); /* Down: child -> parent */
12994 pipe(pu); /* Up: parent -> child */
12997 close(pd[1]); /* Parent reads from pd[0] */
12998 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13000 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13005 signal(SIGALRM, blech);
13007 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13009 sprintf(string, "%d\n", ret);
13010 write(2, string, strlen(string));
13013 if (errno == EAGAIN) {
13014 printf("EAGAIN\n");
13019 if (errno == EWOULDBLOCK)
13020 printf("EWOULDBLOCK\n");
13023 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13024 sleep(2); /* Give it time to close our pipe */
13026 ret = read(pd[0], buf, 1); /* Should read EOF */
13028 sprintf(string, "%d\n", ret);
13029 write(4, string, strlen(string));
13033 close(pd[0]); /* We write to pd[1] */
13034 close(pu[1]); /* We read from pu[0] */
13035 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13036 close(pd[1]); /* Pipe pd is now fully closed! */
13037 exit(0); /* Bye bye, thank you for playing! */
13041 if eval $compile_ok; then
13042 echo "$startsh" >mtry
13043 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13045 $run ./mtry >/dev/null 2>&1
13047 0) eagain=`$cat try.out`;;
13048 1) echo "Could not perform non-blocking setting!";;
13049 2) echo "I did a successful read() for something that was not there!";;
13050 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13051 4) echo "Could not find F_SETFL!";;
13052 *) echo "Something terribly wrong happened during testing.";;
13054 rd_nodata=`$cat try.ret`
13055 echo "A read() system call with no data present returns $rd_nodata."
13056 case "$rd_nodata" in
13059 echo "(That's peculiar, fixing that to be -1.)"
13065 echo "Forcing errno EAGAIN on read() with no data available."
13069 echo "Your read() sets errno to $eagain when no data is available."
13072 status=`$cat try.err`
13074 0) echo "And it correctly returns 0 to signal EOF.";;
13075 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13076 *) echo "However, your read() returns '$status' on EOF??";;
13079 if test "$status" = "$rd_nodata"; then
13080 echo "WARNING: you can't distinguish between EOF and no data!"
13084 echo "I can't compile the test program--assuming errno EAGAIN will do."
13088 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13097 echo "Using $hint value $eagain."
13098 echo "Your read() returns $rd_nodata when no data is present."
13099 case "$d_eofnblk" in
13100 "$define") echo "And you can see EOF because read() returns 0.";;
13101 "$undef") echo "But you can't see EOF status from read() returned value.";;
13103 echo "(Assuming you can't see EOF status from read anyway.)"
13109 $rm_try head.c mtry
13111 : see if _ptr and _cnt from stdio act std
13114 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13115 echo "(Looks like you have stdio.h from BSD.)"
13116 case "$stdio_ptr" in
13117 '') stdio_ptr='((fp)->_p)'
13120 *) ptr_lval=$d_stdio_ptr_lval;;
13122 case "$stdio_cnt" in
13123 '') stdio_cnt='((fp)->_r)'
13126 *) cnt_lval=$d_stdio_cnt_lval;;
13128 case "$stdio_base" in
13129 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13131 case "$stdio_bufsiz" in
13132 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13134 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13135 echo "(Looks like you have stdio.h from Linux.)"
13136 case "$stdio_ptr" in
13137 '') stdio_ptr='((fp)->_IO_read_ptr)'
13140 *) ptr_lval=$d_stdio_ptr_lval;;
13142 case "$stdio_cnt" in
13143 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13146 *) cnt_lval=$d_stdio_cnt_lval;;
13148 case "$stdio_base" in
13149 '') stdio_base='((fp)->_IO_read_base)';;
13151 case "$stdio_bufsiz" in
13152 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13155 case "$stdio_ptr" in
13156 '') stdio_ptr='((fp)->_ptr)'
13159 *) ptr_lval=$d_stdio_ptr_lval;;
13161 case "$stdio_cnt" in
13162 '') stdio_cnt='((fp)->_cnt)'
13165 *) cnt_lval=$d_stdio_cnt_lval;;
13167 case "$stdio_base" in
13168 '') stdio_base='((fp)->_base)';;
13170 case "$stdio_bufsiz" in
13171 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13175 : test whether _ptr and _cnt really work
13176 echo "Checking how std your stdio is..." >&4
13179 #$i_stdlib I_STDLIB
13181 #include <stdlib.h>
13183 #define FILE_ptr(fp) $stdio_ptr
13184 #define FILE_cnt(fp) $stdio_cnt
13186 FILE *fp = fopen("try.c", "r");
13189 18 <= FILE_cnt(fp) &&
13190 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13198 if eval $compile && $to try.c; then
13199 if $run ./try; then
13200 echo "Your stdio acts pretty std."
13203 echo "Your stdio isn't very std."
13206 echo "Your stdio doesn't appear very std."
13210 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13211 # direct buffer manipulation no longer works. The Configure tests
13212 # should be changed to correctly detect this, but until then,
13213 # the following check should at least let perl compile and run.
13214 # (This quick fix should be updated before 5.8.1.)
13215 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13216 # A. Dougherty, June 3, 2002.
13217 case "$d_gnulibc" in
13219 case "$gnulibc_version" in
13223 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13232 : Can _ptr be used as an lvalue?
13233 case "$d_stdstdio$ptr_lval" in
13234 $define$define) val=$define ;;
13237 set d_stdio_ptr_lval
13240 : Can _cnt be used as an lvalue?
13241 case "$d_stdstdio$cnt_lval" in
13242 $define$define) val=$define ;;
13245 set d_stdio_cnt_lval
13249 : test whether setting _ptr sets _cnt as a side effect
13250 d_stdio_ptr_lval_sets_cnt="$undef"
13251 d_stdio_ptr_lval_nochange_cnt="$undef"
13252 case "$d_stdio_ptr_lval$d_stdstdio" in
13254 echo "Checking to see what happens if we set the stdio ptr..." >&4
13257 /* Can we scream? */
13258 /* Eat dust sed :-) */
13259 /* In the buffer space, no one can hear you scream. */
13260 #$i_stdlib I_STDLIB
13262 #include <stdlib.h>
13264 #define FILE_ptr(fp) $stdio_ptr
13265 #define FILE_cnt(fp) $stdio_cnt
13266 #include <sys/types.h>
13268 FILE *fp = fopen("try.c", "r");
13273 puts("Fail even to read");
13276 c = getc(fp); /* Read away the first # */
13278 puts("Fail even to read");
13282 18 <= FILE_cnt(fp) &&
13283 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13285 puts("Fail even to read");
13288 ptr = (char*) FILE_ptr(fp);
13289 cnt = (size_t)FILE_cnt(fp);
13291 FILE_ptr(fp) += 42;
13293 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13294 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13297 if (FILE_cnt(fp) <= 20) {
13298 printf ("Fail (<20 chars to test)");
13301 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13302 puts("Fail compare");
13305 if (cnt == FILE_cnt(fp)) {
13306 puts("Pass_unchanged");
13309 if (FILE_cnt(fp) == (cnt - 42)) {
13310 puts("Pass_changed");
13313 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13319 if eval $compile && $to try.c; then
13320 case `$run ./try` in
13322 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13323 d_stdio_ptr_lval_sets_cnt="$define" ;;
13325 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13326 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13328 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13330 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13333 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13339 : see if _base is also standard
13341 case "$d_stdstdio" in
13345 #$i_stdlib I_STDLIB
13347 #include <stdlib.h>
13349 #define FILE_base(fp) $stdio_base
13350 #define FILE_bufsiz(fp) $stdio_bufsiz
13352 FILE *fp = fopen("try.c", "r");
13355 19 <= FILE_bufsiz(fp) &&
13356 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13363 if eval $compile && $to try.c; then
13364 if $run ./try; then
13365 echo "And its _base field acts std."
13368 echo "But its _base field isn't std."
13371 echo "However, it seems to be lacking the _base field."
13379 : see if fast_stdio exists
13381 case "$d_stdstdio:$d_stdio_ptr_lval" in
13383 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13385 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13396 : see if fchdir exists
13397 set fchdir d_fchdir
13400 : see if fchmod exists
13401 set fchmod d_fchmod
13404 : see if fchown exists
13405 set fchown d_fchown
13408 : see if this is an fcntl system
13412 : See if fcntl-based locking works.
13415 #$i_stdlib I_STDLIB
13417 #include <stdlib.h>
13419 #include <unistd.h>
13421 #include <signal.h>
13422 $signal_t blech(int x) { exit(3); }
13424 #if defined(F_SETLK) && defined(F_SETLKW)
13425 struct flock flock;
13427 fd = open("try.c", O_RDONLY);
13428 flock.l_type = F_RDLCK;
13429 flock.l_whence = SEEK_SET;
13430 flock.l_start = flock.l_len = 0;
13431 signal(SIGALRM, blech);
13433 retval = fcntl(fd, F_SETLK, &flock);
13435 (retval < 0 ? exit(2) : exit(0));
13441 echo "Checking if fcntl-based file locking works... "
13445 if eval $compile_ok; then
13446 if $run ./try; then
13447 echo "Yes, it seems to work."
13450 echo "Nope, it didn't work."
13455 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13456 *** This is (almost) impossible.
13457 *** If your NFS lock daemons are not feeling well, something like
13458 *** this may happen, please investigate. Cannot continue, aborting.
13466 echo "I'm unable to compile the test program, so I'll assume not."
13471 echo "Nope, since you don't even have fcntl()."
13474 set d_fcntl_can_lock
13478 : check for fd_set items
13481 Checking to see how well your C compiler handles fd_set and friends ...
13484 #$i_stdlib I_STDLIB
13486 #include <stdlib.h>
13488 #$i_systime I_SYS_TIME
13489 #$i_sysselct I_SYS_SELECT
13490 #$d_socket HAS_SOCKET
13491 #include <sys/types.h>
13493 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13496 #include <sys/time.h>
13498 #ifdef I_SYS_SELECT
13499 #include <sys/select.h>
13508 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13516 if eval $compile; then
13517 d_fds_bits="$define"
13519 echo "Well, your system knows about the normal fd_set typedef..." >&4
13520 if $run ./try; then
13521 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13522 d_fd_macros="$define"
13525 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13527 d_fd_macros="$undef"
13531 Hmm, your compiler has some difficulty with fd_set. Checking further...
13534 if eval $compile; then
13535 d_fds_bits="$undef"
13537 echo "Well, your system has some sort of fd_set available..." >&4
13538 if $run ./try; then
13539 echo "and you have the normal fd_set macros." >&4
13540 d_fd_macros="$define"
13543 but not the normal fd_set macros! Gross! More work for me...
13545 d_fd_macros="$undef"
13548 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13550 d_fds_bits="$undef"
13551 d_fd_macros="$undef"
13556 : see if fgetpos exists
13557 set fgetpos d_fgetpos
13560 : see if finite exists
13561 set finite d_finite
13564 : see if finitel exists
13565 set finitel d_finitel
13568 : see if flock exists
13572 : see if prototype for flock is available
13574 set d_flockproto flock $i_sysfile sys/file.h
13577 : see if fp_class exists
13578 set fp_class d_fp_class
13581 : see if pathconf exists
13582 set pathconf d_pathconf
13585 : see if fpathconf exists
13586 set fpathconf d_fpathconf
13589 : see if fpclass exists
13590 set fpclass d_fpclass
13593 : see if fpclassify exists
13594 set fpclassify d_fpclassify
13597 : see if fpclassl exists
13598 set fpclassl d_fpclassl
13601 : check for fpos64_t
13603 echo "Checking to see if you have fpos64_t..." >&4
13606 int main() { fpos64_t x = 7; }
13609 if eval $compile; then
13611 echo "You have fpos64_t."
13614 echo "You do not have fpos64_t."
13615 case "$fpossize" in
13616 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13623 : see if frexpl exists
13624 set frexpl d_frexpl
13627 : see if this is a sys/param system
13628 set sys/param.h i_sysparam
13631 : see if this is a sys/mount.h system
13632 set sys/mount.h i_sysmount
13635 : Check for fs_data_s
13637 echo "Checking to see if your system supports struct fs_data..." >&4
13638 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13640 case "$d_fs_data_s" in
13641 "$define") echo "Yes, it does." ;;
13642 *) echo "No, it doesn't." ;;
13645 : see if fseeko exists
13646 set fseeko d_fseeko
13648 case "$longsize" in
13649 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13652 : see if fsetpos exists
13653 set fsetpos d_fsetpos
13656 : see if fstatfs exists
13657 set fstatfs d_fstatfs
13660 : see if statvfs exists
13661 set statvfs d_statvfs
13664 : see if fstatvfs exists
13665 set fstatvfs d_fstatvfs
13669 : see if fsync exists
13673 : see if ftello exists
13674 set ftello d_ftello
13676 case "$longsize" in
13677 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13680 : check for a working futimes
13683 echo "Checking if you have a working futimes()" >&4
13686 #include <sys/time.h>
13693 fd = open ("try.c", O_RDWR);
13694 if (-1 == fd) exit (1);
13695 rv = futimes (fd, NULL);
13696 exit (rv == -1 ? errno : 0);
13700 if eval $compile; then
13704 0) echo "Yes, you have" >&4
13705 d_futimes="$define"
13707 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13711 echo "No, it does not (probably harmless)" >&4
13715 : see if ndbm.h is available
13718 : Compatibility location for RedHat 7.1
13719 set gdbm/ndbm.h i_gdbmndbm
13721 : Compatibility location for Debian 4.0
13722 set gdbm-ndbm.h i_gdbm_ndbm
13726 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13727 : see if dbm_open exists
13728 set dbm_open d_dbm_open
13730 case "$d_dbm_open" in
13733 i_gdbmndbm="$undef"
13734 i_gdbm_ndbm="$undef"
13735 echo "We won't be including <ndbm.h>"
13745 ndbm_hdr_protochk='name=$1; hdr=$2;
13746 eval "ihdr=\$""i_$name";
13748 if $test "$ihdr" = "$define"; then
13749 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13750 case "$d_cplusplus" in
13751 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13752 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13755 $define) $echo "Your <$hdr> seems to have prototypes";;
13756 *) $echo "Your <$hdr> does not seem to have prototypes";;
13759 set "d_${name}_h_uses_prototypes";
13763 eval $ndbm_hdr_protochk
13764 set gdbmndbm gdbm/ndbm.h
13765 eval $ndbm_hdr_protochk
13766 set gdbm_ndbm gdbm-ndbm.h
13767 eval $ndbm_hdr_protochk
13769 : see if getaddrinfo exists
13770 set getaddrinfo d_getaddrinfo
13773 : see if getcwd exists
13774 set getcwd d_getcwd
13777 : see if getespwnam exists
13778 set getespwnam d_getespwnam
13781 : see if getfsstat exists
13782 set getfsstat d_getfsstat
13785 : see if getgrent exists
13786 set getgrent d_getgrent
13789 : see if getgrent_r exists
13790 set getgrent_r d_getgrent_r
13792 case "$d_getgrent_r" in
13794 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13795 case "$d_getgrent_r_proto:$usethreads" in
13796 ":define") d_getgrent_r_proto=define
13797 set d_getgrent_r_proto getgrent_r $hdrs
13801 case "$d_getgrent_r_proto" in
13803 case "$getgrent_r_proto" in
13804 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13805 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13807 case "$getgrent_r_proto" in
13808 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13809 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13811 case "$getgrent_r_proto" in
13812 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13813 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13815 case "$getgrent_r_proto" in
13816 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13817 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13819 case "$getgrent_r_proto" in
13820 ''|0) try='int getgrent_r(struct group*, char*, int);'
13821 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13823 case "$getgrent_r_proto" in
13824 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13825 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13827 case "$getgrent_r_proto" in
13828 ''|0) d_getgrent_r=undef
13830 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13831 * ) case "$getgrent_r_proto" in
13832 REENTRANT_PROTO*) ;;
13833 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13835 echo "Prototype: $try" ;;
13838 *) case "$usethreads" in
13839 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13846 *) getgrent_r_proto=0
13850 : see if getgrgid_r exists
13851 set getgrgid_r d_getgrgid_r
13853 case "$d_getgrgid_r" in
13855 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13856 case "$d_getgrgid_r_proto:$usethreads" in
13857 ":define") d_getgrgid_r_proto=define
13858 set d_getgrgid_r_proto getgrgid_r $hdrs
13862 case "$d_getgrgid_r_proto" in
13864 case "$getgrgid_r_proto" in
13865 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13866 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13868 case "$getgrgid_r_proto" in
13869 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13870 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13872 case "$getgrgid_r_proto" in
13873 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13874 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13876 case "$getgrgid_r_proto" in
13877 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13878 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13880 case "$getgrgid_r_proto" in
13881 ''|0) d_getgrgid_r=undef
13883 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13884 * ) case "$getgrgid_r_proto" in
13885 REENTRANT_PROTO*) ;;
13886 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13888 echo "Prototype: $try" ;;
13891 *) case "$usethreads" in
13892 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13899 *) getgrgid_r_proto=0
13903 : see if getgrnam_r exists
13904 set getgrnam_r d_getgrnam_r
13906 case "$d_getgrnam_r" in
13908 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13909 case "$d_getgrnam_r_proto:$usethreads" in
13910 ":define") d_getgrnam_r_proto=define
13911 set d_getgrnam_r_proto getgrnam_r $hdrs
13915 case "$d_getgrnam_r_proto" in
13917 case "$getgrnam_r_proto" in
13918 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13919 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13921 case "$getgrnam_r_proto" in
13922 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13923 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13925 case "$getgrnam_r_proto" in
13926 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13927 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13929 case "$getgrnam_r_proto" in
13930 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13931 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13933 case "$getgrnam_r_proto" in
13934 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13935 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13937 case "$getgrnam_r_proto" in
13938 ''|0) d_getgrnam_r=undef
13940 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13941 * ) case "$getgrnam_r_proto" in
13942 REENTRANT_PROTO*) ;;
13943 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13945 echo "Prototype: $try" ;;
13948 *) case "$usethreads" in
13949 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13956 *) getgrnam_r_proto=0
13960 : see if gethostbyaddr exists
13961 set gethostbyaddr d_gethbyaddr
13964 : see if gethostbyname exists
13965 set gethostbyname d_gethbyname
13968 : see if gethostent exists
13969 set gethostent d_gethent
13972 : see how we will look up host name
13975 if set gethostname val -f d_gethname; eval $csym; $val; then
13976 echo 'gethostname() found.' >&4
13977 d_gethname="$define"
13980 if set uname val -f d_uname; eval $csym; $val; then
13983 uname() was found, but you're running xenix, and older versions of xenix
13984 have a broken uname(). If you don't really know whether your xenix is old
13985 enough to have a broken system call, use the default answer.
13990 "$define") dflt=n;;
13992 rp='Is your uname() broken?'
13995 n*) d_uname="$define"; call=uname;;
13998 echo 'uname() found.' >&4
14005 case "$d_gethname" in
14006 '') d_gethname="$undef";;
14009 '') d_uname="$undef";;
14011 case "$d_uname$d_gethname" in
14016 Every now and then someone has a $call() that lies about the hostname
14017 but can't be fixed for political or economic reasons. If you wish, I can
14018 pretend $call() isn't there and maybe compute hostname at run-time
14019 thanks to the '$phostname' command.
14022 rp="Shall I ignore $call() from now on?"
14025 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14028 case "$phostname" in
14029 '') aphostname='';;
14030 *) case "$aphostname" in
14032 *) set X $phostname
14036 file=`./loc $file $file $pth`
14037 aphostname=`echo $file $*`
14042 case "$d_uname$d_gethname" in
14045 case "$phostname" in
14047 echo "There will be no way for $package to get your hostname." >&4;;
14049 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14053 case "$d_phostname" in
14054 '') d_phostname="$undef";;
14057 : see if gethostbyaddr_r exists
14058 set gethostbyaddr_r d_gethostbyaddr_r
14060 case "$d_gethostbyaddr_r" in
14062 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14063 case "$d_gethostbyaddr_r_proto:$usethreads" in
14064 ":define") d_gethostbyaddr_r_proto=define
14065 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14069 case "$d_gethostbyaddr_r_proto" in
14071 case "$gethostbyaddr_r_proto" in
14072 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14073 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14075 case "$gethostbyaddr_r_proto" in
14076 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14077 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14079 case "$gethostbyaddr_r_proto" in
14080 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14081 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14083 case "$gethostbyaddr_r_proto" in
14084 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14085 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14087 case "$gethostbyaddr_r_proto" in
14088 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14089 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14091 case "$gethostbyaddr_r_proto" in
14092 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14093 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14095 case "$gethostbyaddr_r_proto" in
14096 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14097 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14099 case "$gethostbyaddr_r_proto" in
14100 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14101 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14103 case "$gethostbyaddr_r_proto" in
14104 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14105 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14107 case "$gethostbyaddr_r_proto" in
14108 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14109 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14111 case "$gethostbyaddr_r_proto" in
14112 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14113 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14115 case "$gethostbyaddr_r_proto" in
14116 ''|0) d_gethostbyaddr_r=undef
14117 gethostbyaddr_r_proto=0
14118 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14119 * ) case "$gethostbyaddr_r_proto" in
14120 REENTRANT_PROTO*) ;;
14121 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14123 echo "Prototype: $try" ;;
14126 *) case "$usethreads" in
14127 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14129 d_gethostbyaddr_r=undef
14130 gethostbyaddr_r_proto=0
14134 *) gethostbyaddr_r_proto=0
14138 : see if gethostbyname_r exists
14139 set gethostbyname_r d_gethostbyname_r
14141 case "$d_gethostbyname_r" in
14143 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14144 case "$d_gethostbyname_r_proto:$usethreads" in
14145 ":define") d_gethostbyname_r_proto=define
14146 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14150 case "$d_gethostbyname_r_proto" in
14152 case "$gethostbyname_r_proto" in
14153 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14154 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14156 case "$gethostbyname_r_proto" in
14157 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14158 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14160 case "$gethostbyname_r_proto" in
14161 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14162 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14164 case "$gethostbyname_r_proto" in
14165 ''|0) d_gethostbyname_r=undef
14166 gethostbyname_r_proto=0
14167 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14168 * ) case "$gethostbyname_r_proto" in
14169 REENTRANT_PROTO*) ;;
14170 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14172 echo "Prototype: $try" ;;
14175 *) case "$usethreads" in
14176 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14178 d_gethostbyname_r=undef
14179 gethostbyname_r_proto=0
14183 *) gethostbyname_r_proto=0
14187 : see if gethostent_r exists
14188 set gethostent_r d_gethostent_r
14190 case "$d_gethostent_r" in
14192 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14193 case "$d_gethostent_r_proto:$usethreads" in
14194 ":define") d_gethostent_r_proto=define
14195 set d_gethostent_r_proto gethostent_r $hdrs
14199 case "$d_gethostent_r_proto" in
14201 case "$gethostent_r_proto" in
14202 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14203 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14205 case "$gethostent_r_proto" in
14206 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14207 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14209 case "$gethostent_r_proto" in
14210 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14211 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14213 case "$gethostent_r_proto" in
14214 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14215 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14217 case "$gethostent_r_proto" in
14218 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14219 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14221 case "$gethostent_r_proto" in
14222 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14223 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14225 case "$gethostent_r_proto" in
14226 ''|0) d_gethostent_r=undef
14227 gethostent_r_proto=0
14228 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14229 * ) case "$gethostent_r_proto" in
14230 REENTRANT_PROTO*) ;;
14231 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14233 echo "Prototype: $try" ;;
14236 *) case "$usethreads" in
14237 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14239 d_gethostent_r=undef
14240 gethostent_r_proto=0
14244 *) gethostent_r_proto=0
14248 : see if prototypes for various gethostxxx netdb.h functions are available
14250 set d_gethostprotos gethostent $i_netdb netdb.h
14253 : see if getitimer exists
14254 set getitimer d_getitimer
14257 : see if getlogin exists
14258 set getlogin d_getlogin
14261 : see if getlogin_r exists
14262 set getlogin_r d_getlogin_r
14264 case "$d_getlogin_r" in
14266 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14267 case "$d_getlogin_r_proto:$usethreads" in
14268 ":define") d_getlogin_r_proto=define
14269 set d_getlogin_r_proto getlogin_r $hdrs
14273 case "$d_getlogin_r_proto" in
14275 case "$getlogin_r_proto" in
14276 ''|0) try='int getlogin_r(char*, size_t);'
14277 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14279 case "$getlogin_r_proto" in
14280 ''|0) try='int getlogin_r(char*, int);'
14281 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14283 case "$getlogin_r_proto" in
14284 ''|0) try='char* getlogin_r(char*, size_t);'
14285 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14287 case "$getlogin_r_proto" in
14288 ''|0) try='char* getlogin_r(char*, int);'
14289 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14291 case "$getlogin_r_proto" in
14292 ''|0) d_getlogin_r=undef
14294 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14295 * ) case "$getlogin_r_proto" in
14296 REENTRANT_PROTO*) ;;
14297 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14299 echo "Prototype: $try" ;;
14302 *) case "$usethreads" in
14303 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14310 *) getlogin_r_proto=0
14314 : see if getmnt exists
14315 set getmnt d_getmnt
14318 : see if getmntent exists
14319 set getmntent d_getmntent
14322 : see if getnameinfo exists
14323 set getnameinfo d_getnameinfo
14326 : see if getnetbyaddr exists
14327 set getnetbyaddr d_getnbyaddr
14330 : see if getnetbyname exists
14331 set getnetbyname d_getnbyname
14334 : see if getnetent exists
14335 set getnetent d_getnent
14338 : see if getnetbyaddr_r exists
14339 set getnetbyaddr_r d_getnetbyaddr_r
14341 case "$d_getnetbyaddr_r" in
14343 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14344 case "$d_getnetbyaddr_r_proto:$usethreads" in
14345 ":define") d_getnetbyaddr_r_proto=define
14346 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14350 case "$d_getnetbyaddr_r_proto" in
14352 case "$getnetbyaddr_r_proto" in
14353 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14354 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14356 case "$getnetbyaddr_r_proto" in
14357 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14358 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14360 case "$getnetbyaddr_r_proto" in
14361 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14364 case "$getnetbyaddr_r_proto" in
14365 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14366 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14368 case "$getnetbyaddr_r_proto" in
14369 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14370 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14372 case "$getnetbyaddr_r_proto" in
14373 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14374 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14376 case "$getnetbyaddr_r_proto" in
14377 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14378 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14380 case "$getnetbyaddr_r_proto" in
14381 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14382 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14384 case "$getnetbyaddr_r_proto" in
14385 ''|0) d_getnetbyaddr_r=undef
14386 getnetbyaddr_r_proto=0
14387 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14388 * ) case "$getnetbyaddr_r_proto" in
14389 REENTRANT_PROTO*) ;;
14390 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14392 echo "Prototype: $try" ;;
14395 *) case "$usethreads" in
14396 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14398 d_getnetbyaddr_r=undef
14399 getnetbyaddr_r_proto=0
14403 *) getnetbyaddr_r_proto=0
14407 : see if getnetbyname_r exists
14408 set getnetbyname_r d_getnetbyname_r
14410 case "$d_getnetbyname_r" in
14412 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14413 case "$d_getnetbyname_r_proto:$usethreads" in
14414 ":define") d_getnetbyname_r_proto=define
14415 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14419 case "$d_getnetbyname_r_proto" in
14421 case "$getnetbyname_r_proto" in
14422 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14423 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14425 case "$getnetbyname_r_proto" in
14426 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14427 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14429 case "$getnetbyname_r_proto" in
14430 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14431 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14433 case "$getnetbyname_r_proto" in
14434 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14435 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14437 case "$getnetbyname_r_proto" in
14438 ''|0) d_getnetbyname_r=undef
14439 getnetbyname_r_proto=0
14440 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14441 * ) case "$getnetbyname_r_proto" in
14442 REENTRANT_PROTO*) ;;
14443 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14445 echo "Prototype: $try" ;;
14448 *) case "$usethreads" in
14449 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14451 d_getnetbyname_r=undef
14452 getnetbyname_r_proto=0
14456 *) getnetbyname_r_proto=0
14460 : see if getnetent_r exists
14461 set getnetent_r d_getnetent_r
14463 case "$d_getnetent_r" in
14465 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14466 case "$d_getnetent_r_proto:$usethreads" in
14467 ":define") d_getnetent_r_proto=define
14468 set d_getnetent_r_proto getnetent_r $hdrs
14472 case "$d_getnetent_r_proto" in
14474 case "$getnetent_r_proto" in
14475 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14476 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14478 case "$getnetent_r_proto" in
14479 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14480 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14482 case "$getnetent_r_proto" in
14483 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14484 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14486 case "$getnetent_r_proto" in
14487 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14488 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14490 case "$getnetent_r_proto" in
14491 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14492 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14494 case "$getnetent_r_proto" in
14495 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14496 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14498 case "$getnetent_r_proto" in
14499 ''|0) d_getnetent_r=undef
14500 getnetent_r_proto=0
14501 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14502 * ) case "$getnetent_r_proto" in
14503 REENTRANT_PROTO*) ;;
14504 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14506 echo "Prototype: $try" ;;
14509 *) case "$usethreads" in
14510 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14512 d_getnetent_r=undef
14513 getnetent_r_proto=0
14517 *) getnetent_r_proto=0
14521 : see if prototypes for various getnetxxx netdb.h functions are available
14523 set d_getnetprotos getnetent $i_netdb netdb.h
14526 : see if getpagesize exists
14527 set getpagesize d_getpagsz
14530 : Optional checks for getprotobyname and getprotobynumber
14532 : see if getprotobyname exists
14533 set getprotobyname d_getpbyname
14536 : see if getprotobynumber exists
14537 set getprotobynumber d_getpbynumber
14540 : see if getprotoent exists
14541 set getprotoent d_getpent
14544 : see if getpgid exists
14545 set getpgid d_getpgid
14548 : see if getpgrp2 exists
14549 set getpgrp2 d_getpgrp2
14552 : see if getppid exists
14553 set getppid d_getppid
14556 : see if getpriority exists
14557 set getpriority d_getprior
14560 : see if getprotobyname_r exists
14561 set getprotobyname_r d_getprotobyname_r
14563 case "$d_getprotobyname_r" in
14565 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14566 case "$d_getprotobyname_r_proto:$usethreads" in
14567 ":define") d_getprotobyname_r_proto=define
14568 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14572 case "$d_getprotobyname_r_proto" in
14574 case "$getprotobyname_r_proto" in
14575 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14576 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14578 case "$getprotobyname_r_proto" in
14579 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14580 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14582 case "$getprotobyname_r_proto" in
14583 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14584 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14586 case "$getprotobyname_r_proto" in
14587 ''|0) d_getprotobyname_r=undef
14588 getprotobyname_r_proto=0
14589 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14590 * ) case "$getprotobyname_r_proto" in
14591 REENTRANT_PROTO*) ;;
14592 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14594 echo "Prototype: $try" ;;
14597 *) case "$usethreads" in
14598 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14600 d_getprotobyname_r=undef
14601 getprotobyname_r_proto=0
14605 *) getprotobyname_r_proto=0
14609 : see if getprotobynumber_r exists
14610 set getprotobynumber_r d_getprotobynumber_r
14612 case "$d_getprotobynumber_r" in
14614 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14615 case "$d_getprotobynumber_r_proto:$usethreads" in
14616 ":define") d_getprotobynumber_r_proto=define
14617 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14621 case "$d_getprotobynumber_r_proto" in
14623 case "$getprotobynumber_r_proto" in
14624 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14625 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14627 case "$getprotobynumber_r_proto" in
14628 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14629 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14631 case "$getprotobynumber_r_proto" in
14632 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14633 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14635 case "$getprotobynumber_r_proto" in
14636 ''|0) d_getprotobynumber_r=undef
14637 getprotobynumber_r_proto=0
14638 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14639 * ) case "$getprotobynumber_r_proto" in
14640 REENTRANT_PROTO*) ;;
14641 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14643 echo "Prototype: $try" ;;
14646 *) case "$usethreads" in
14647 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14649 d_getprotobynumber_r=undef
14650 getprotobynumber_r_proto=0
14654 *) getprotobynumber_r_proto=0
14658 : see if getprotoent_r exists
14659 set getprotoent_r d_getprotoent_r
14661 case "$d_getprotoent_r" in
14663 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14664 case "$d_getprotoent_r_proto:$usethreads" in
14665 ":define") d_getprotoent_r_proto=define
14666 set d_getprotoent_r_proto getprotoent_r $hdrs
14670 case "$d_getprotoent_r_proto" in
14672 case "$getprotoent_r_proto" in
14673 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14674 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14676 case "$getprotoent_r_proto" in
14677 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14678 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14680 case "$getprotoent_r_proto" in
14681 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14682 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14684 case "$getprotoent_r_proto" in
14685 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14686 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14688 case "$getprotoent_r_proto" in
14689 ''|0) d_getprotoent_r=undef
14690 getprotoent_r_proto=0
14691 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14692 * ) case "$getprotoent_r_proto" in
14693 REENTRANT_PROTO*) ;;
14694 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14696 echo "Prototype: $try" ;;
14699 *) case "$usethreads" in
14700 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14702 d_getprotoent_r=undef
14703 getprotoent_r_proto=0
14707 *) getprotoent_r_proto=0
14711 : see if prototypes for various getprotoxxx netdb.h functions are available
14713 set d_getprotoprotos getprotoent $i_netdb netdb.h
14716 : see if getprpwnam exists
14717 set getprpwnam d_getprpwnam
14720 : see if getpwent exists
14721 set getpwent d_getpwent
14724 : see if getpwent_r exists
14725 set getpwent_r d_getpwent_r
14727 case "$d_getpwent_r" in
14729 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14730 case "$d_getpwent_r_proto:$usethreads" in
14731 ":define") d_getpwent_r_proto=define
14732 set d_getpwent_r_proto getpwent_r $hdrs
14736 case "$d_getpwent_r_proto" in
14738 case "$getpwent_r_proto" in
14739 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14740 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14742 case "$getpwent_r_proto" in
14743 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14744 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14746 case "$getpwent_r_proto" in
14747 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14748 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14750 case "$getpwent_r_proto" in
14751 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14752 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14754 case "$getpwent_r_proto" in
14755 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14756 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14758 case "$getpwent_r_proto" in
14759 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14760 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14762 case "$getpwent_r_proto" in
14763 ''|0) d_getpwent_r=undef
14765 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14766 * ) case "$getpwent_r_proto" in
14767 REENTRANT_PROTO*) ;;
14768 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14770 echo "Prototype: $try" ;;
14773 *) case "$usethreads" in
14774 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14781 *) getpwent_r_proto=0
14785 : see if getpwnam_r exists
14786 set getpwnam_r d_getpwnam_r
14788 case "$d_getpwnam_r" in
14790 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14791 case "$d_getpwnam_r_proto:$usethreads" in
14792 ":define") d_getpwnam_r_proto=define
14793 set d_getpwnam_r_proto getpwnam_r $hdrs
14797 case "$d_getpwnam_r_proto" in
14799 case "$getpwnam_r_proto" in
14800 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14801 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14803 case "$getpwnam_r_proto" in
14804 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14805 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14807 case "$getpwnam_r_proto" in
14808 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14809 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14811 case "$getpwnam_r_proto" in
14812 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14813 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14815 case "$getpwnam_r_proto" in
14816 ''|0) d_getpwnam_r=undef
14818 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14819 * ) case "$getpwnam_r_proto" in
14820 REENTRANT_PROTO*) ;;
14821 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14823 echo "Prototype: $try" ;;
14826 *) case "$usethreads" in
14827 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14834 *) getpwnam_r_proto=0
14838 : see if getpwuid_r exists
14839 set getpwuid_r d_getpwuid_r
14841 case "$d_getpwuid_r" in
14843 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14844 case "$d_getpwuid_r_proto:$usethreads" in
14845 ":define") d_getpwuid_r_proto=define
14846 set d_getpwuid_r_proto getpwuid_r $hdrs
14850 case "$d_getpwuid_r_proto" in
14852 case "$getpwuid_r_proto" in
14853 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14854 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14856 case "$getpwuid_r_proto" in
14857 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14858 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14860 case "$getpwuid_r_proto" in
14861 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14862 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14864 case "$getpwuid_r_proto" in
14865 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14866 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14868 case "$getpwuid_r_proto" in
14869 ''|0) d_getpwuid_r=undef
14871 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14872 * ) case "$getpwuid_r_proto" in
14873 REENTRANT_PROTO*) ;;
14874 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14876 echo "Prototype: $try" ;;
14879 *) case "$usethreads" in
14880 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14887 *) getpwuid_r_proto=0
14891 : Optional checks for getsbyname and getsbyport
14893 : see if getservbyname exists
14894 set getservbyname d_getsbyname
14897 : see if getservbyport exists
14898 set getservbyport d_getsbyport
14901 : see if getservent exists
14902 set getservent d_getsent
14905 : see if getservbyname_r exists
14906 set getservbyname_r d_getservbyname_r
14908 case "$d_getservbyname_r" in
14910 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14911 case "$d_getservbyname_r_proto:$usethreads" in
14912 ":define") d_getservbyname_r_proto=define
14913 set d_getservbyname_r_proto getservbyname_r $hdrs
14917 case "$d_getservbyname_r_proto" in
14919 case "$getservbyname_r_proto" in
14920 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14921 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14923 case "$getservbyname_r_proto" in
14924 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14925 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14927 case "$getservbyname_r_proto" in
14928 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14929 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14931 case "$getservbyname_r_proto" in
14932 ''|0) d_getservbyname_r=undef
14933 getservbyname_r_proto=0
14934 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14935 * ) case "$getservbyname_r_proto" in
14936 REENTRANT_PROTO*) ;;
14937 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14939 echo "Prototype: $try" ;;
14942 *) case "$usethreads" in
14943 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14945 d_getservbyname_r=undef
14946 getservbyname_r_proto=0
14950 *) getservbyname_r_proto=0
14954 : see if getservbyport_r exists
14955 set getservbyport_r d_getservbyport_r
14957 case "$d_getservbyport_r" in
14959 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14960 case "$d_getservbyport_r_proto:$usethreads" in
14961 ":define") d_getservbyport_r_proto=define
14962 set d_getservbyport_r_proto getservbyport_r $hdrs
14966 case "$d_getservbyport_r_proto" in
14968 case "$getservbyport_r_proto" in
14969 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14970 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14972 case "$getservbyport_r_proto" in
14973 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14974 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14976 case "$getservbyport_r_proto" in
14977 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14978 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14980 case "$getservbyport_r_proto" in
14981 ''|0) d_getservbyport_r=undef
14982 getservbyport_r_proto=0
14983 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14984 * ) case "$getservbyport_r_proto" in
14985 REENTRANT_PROTO*) ;;
14986 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14988 echo "Prototype: $try" ;;
14991 *) case "$usethreads" in
14992 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14994 d_getservbyport_r=undef
14995 getservbyport_r_proto=0
14999 *) getservbyport_r_proto=0
15003 : see if getservent_r exists
15004 set getservent_r d_getservent_r
15006 case "$d_getservent_r" in
15008 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15009 case "$d_getservent_r_proto:$usethreads" in
15010 ":define") d_getservent_r_proto=define
15011 set d_getservent_r_proto getservent_r $hdrs
15015 case "$d_getservent_r_proto" in
15017 case "$getservent_r_proto" in
15018 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15019 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15021 case "$getservent_r_proto" in
15022 ''|0) try='int getservent_r(struct servent*, char*, int);'
15023 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15025 case "$getservent_r_proto" in
15026 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15027 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15029 case "$getservent_r_proto" in
15030 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15031 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15033 case "$getservent_r_proto" in
15034 ''|0) d_getservent_r=undef
15035 getservent_r_proto=0
15036 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15037 * ) case "$getservent_r_proto" in
15038 REENTRANT_PROTO*) ;;
15039 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15041 echo "Prototype: $try" ;;
15044 *) case "$usethreads" in
15045 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15047 d_getservent_r=undef
15048 getservent_r_proto=0
15052 *) getservent_r_proto=0
15056 : see if prototypes for various getservxxx netdb.h functions are available
15058 set d_getservprotos getservent $i_netdb netdb.h
15061 : see if getspnam exists
15062 set getspnam d_getspnam
15065 : see if this is a shadow.h system
15066 set shadow.h i_shadow
15069 : see if getspnam_r exists
15070 set getspnam_r d_getspnam_r
15072 case "$d_getspnam_r" in
15074 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15075 case "$d_getspnam_r_proto:$usethreads" in
15076 ":define") d_getspnam_r_proto=define
15077 set d_getspnam_r_proto getspnam_r $hdrs
15081 case "$d_getspnam_r_proto" in
15083 case "$getspnam_r_proto" in
15084 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15085 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15087 case "$getspnam_r_proto" in
15088 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15089 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15091 case "$getspnam_r_proto" in
15092 ''|0) d_getspnam_r=undef
15094 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15095 * ) case "$getspnam_r_proto" in
15096 REENTRANT_PROTO*) ;;
15097 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15099 echo "Prototype: $try" ;;
15102 *) case "$usethreads" in
15103 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15110 *) getspnam_r_proto=0
15114 : see if gettimeofday or ftime exists
15115 set gettimeofday d_gettimeod
15117 case "$d_gettimeod" in
15123 val="$undef"; set d_ftime; eval $setvar
15126 case "$d_gettimeod$d_ftime" in
15129 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15133 : see if gmtime_r exists
15134 set gmtime_r d_gmtime_r
15136 case "$d_gmtime_r" in
15138 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15139 case "$d_gmtime_r_proto:$usethreads" in
15140 ":define") d_gmtime_r_proto=define
15141 set d_gmtime_r_proto gmtime_r $hdrs
15145 case "$d_gmtime_r_proto" in
15147 case "$gmtime_r_proto" in
15148 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15149 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15151 case "$gmtime_r_proto" in
15152 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15153 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15155 case "$gmtime_r_proto" in
15156 ''|0) d_gmtime_r=undef
15158 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15159 * ) case "$gmtime_r_proto" in
15160 REENTRANT_PROTO*) ;;
15161 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15163 echo "Prototype: $try" ;;
15166 *) case "$usethreads" in
15167 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15174 *) gmtime_r_proto=0
15178 : see if hasmntopt exists
15179 set hasmntopt d_hasmntopt
15182 : see if this is a netinet/in.h or sys/in.h system
15183 set netinet/in.h i_niin sys/in.h i_sysin
15186 : see if arpa/inet.h has to be included
15187 set arpa/inet.h i_arpainet
15190 : see if htonl --and friends-- exists
15195 : Maybe they are macros.
15198 $cat >htonl.c <<EOM
15200 #include <sys/types.h>
15201 #$i_niin I_NETINET_IN
15203 #$i_arpainet I_ARPA_INET
15204 #ifdef I_NETINET_IN
15205 #include <netinet/in.h>
15208 #include <sys/in.h>
15211 #include <arpa/inet.h>
15214 printf("Defined as a macro.");
15217 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15218 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15220 echo "But it seems to be defined as a macro." >&4
15228 : see if ilogbl exists
15229 set ilogbl d_ilogbl
15234 if set index val -f; eval $csym; $val; then
15235 if set strchr val -f d_strchr; eval $csym; $val; then
15236 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15239 echo "strchr() found." >&4
15243 echo "index() found." >&4
15248 echo "index() found." >&4
15251 if set strchr val -f d_strchr; eval $csym; $val; then
15254 echo "strchr() found." >&4
15256 echo "No index() or strchr() found!" >&4
15261 set d_strchr; eval $setvar
15263 set d_index; eval $setvar
15265 : check whether inet_aton exists
15266 set inet_aton d_inetaton
15269 : see if inet_ntop exists
15270 set inet_ntop d_inetntop
15273 : see if inet_pton exists
15274 set inet_pton d_inetpton
15279 $cat >isascii.c <<EOCP
15282 #$i_stdlib I_STDLIB
15284 #include <stdlib.h>
15295 if eval $compile; then
15296 echo "isascii() found." >&4
15299 echo "isascii() NOT found." >&4
15308 $cat >isblank.c <<'EOCP'
15319 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15320 echo "isblank() found." >&4
15323 echo "isblank() NOT found." >&4
15330 : see if isfinite exists
15331 set isfinite d_isfinite
15334 : see if isinf exists
15338 : see if isnan exists
15342 : see if isnanl exists
15343 set isnanl d_isnanl
15346 : see if killpg exists
15347 set killpg d_killpg
15350 : see if lchown exists
15352 $cat > try.c <<'EOCP'
15353 /* System header to define __stub macros and hopefully few prototypes,
15354 which can conflict with char lchown(); below. */
15355 #include <assert.h>
15356 /* Override any gcc2 internal prototype to avoid an error. */
15357 /* We use char because int might match the return type of a gcc2
15358 builtin and then its argument prototype would still apply. */
15361 /* The GNU C library defines this for functions which it implements
15362 to always fail with ENOSYS. Some functions are actually named
15363 something starting with __ and the normal name is an alias. */
15364 #if defined (__stub_lchown) || defined (__stub___lchown)
15372 if eval $compile; then
15373 $echo "lchown() found." >&4
15376 $echo "lchown() NOT found." >&4
15382 : See if number of significant digits in a double precision number is known
15384 $cat >ldbl_dig.c <<EOM
15385 #$i_limits I_LIMITS
15388 #include <limits.h>
15394 printf("Contains LDBL_DIG");
15397 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15398 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15399 echo "LDBL_DIG found." >&4
15402 echo "LDBL_DIG NOT found." >&4
15409 : see if this is a math.h system
15413 : check to see if math.h defines _LIB_VERSION
15414 d_libm_lib_version="$undef"
15418 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15420 #include <unistd.h>
15422 int main (int argc, char *argv[])
15424 printf ("%d\n", _LIB_VERSION);
15429 if eval $compile; then
15431 echo "Yes, it does ($foo)" >&4
15432 d_libm_lib_version="$define"
15434 echo "No, it does not (probably harmless)" >&4
15441 : see if link exists
15445 : see if localtime_r exists
15446 set localtime_r d_localtime_r
15448 case "$d_localtime_r" in
15450 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15451 case "$d_localtime_r_proto:$usethreads" in
15452 ":define") d_localtime_r_proto=define
15453 set d_localtime_r_proto localtime_r $hdrs
15457 case "$d_localtime_r_proto" in
15459 case "$localtime_r_proto" in
15460 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15461 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15463 case "$localtime_r_proto" in
15464 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15465 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15467 case "$localtime_r_proto" in
15468 ''|0) d_localtime_r=undef
15469 localtime_r_proto=0
15470 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15471 * ) case "$localtime_r_proto" in
15472 REENTRANT_PROTO*) ;;
15473 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15475 echo "Prototype: $try" ;;
15478 *) case "$usethreads" in
15479 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15481 d_localtime_r=undef
15482 localtime_r_proto=0
15486 *) localtime_r_proto=0
15490 : see if localtime_r calls tzset
15491 case "$localtime_r_proto" in
15494 /* Does our libc's localtime_r call tzset ?
15495 * return 0 if so, 1 otherwise.
15497 #$i_systypes I_SYS_TYPES
15498 #$i_unistd I_UNISTD
15500 #$i_stdlib I_STDLIB
15501 #$i_string I_STRING
15502 #$i_malloc I_MALLOC
15504 # include <sys/types.h>
15507 # include <unistd.h>
15513 #include <stdlib.h>
15516 # include <string.h>
15518 # include <strings.h>
15521 # include <malloc.h>
15525 time_t t = time(0L);
15526 char w_tz[]="TZ" "=GMT+5",
15527 e_tz[]="TZ" "=GMT-5",
15528 *tz_e = (char*)malloc(16),
15529 *tz_w = (char*)malloc(16);
15530 struct tm tm_e, tm_w;
15531 memset(&tm_e,'\0',sizeof(struct tm));
15532 memset(&tm_w,'\0',sizeof(struct tm));
15537 localtime_r(&t, &tm_e);
15540 localtime_r(&t, &tm_w);
15542 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15548 if eval $compile; then
15549 if $run ./try; then
15550 d_localtime_r_needs_tzset=undef;
15552 d_localtime_r_needs_tzset=define;
15555 d_localtime_r_needs_tzset=undef;
15559 d_localtime_r_needs_tzset=undef;
15564 : see if localeconv exists
15565 set localeconv d_locconv
15568 : see if lockf exists
15572 : see if prototype for lseek is available
15574 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15577 : see if lstat exists
15581 : see if madvise exists
15582 set madvise d_madvise
15585 : see if malloc_size exists
15586 set malloc_size d_malloc_size
15589 : see if malloc_size_good exists
15590 set malloc_good_size d_malloc_good_size
15593 : see if mblen exists
15597 : see if mbstowcs exists
15598 set mbstowcs d_mbstowcs
15601 : see if mbtowc exists
15602 set mbtowc d_mbtowc
15605 : see if memchr exists
15606 set memchr d_memchr
15609 : see if memcmp exists
15610 set memcmp d_memcmp
15613 : see if memcpy exists
15614 set memcpy d_memcpy
15617 : see if memmove exists
15618 set memmove d_memmove
15621 : see if memset exists
15622 set memset d_memset
15625 : see if mkdir exists
15629 : see if mkdtemp exists
15630 set mkdtemp d_mkdtemp
15633 : see if mkfifo exists
15634 set mkfifo d_mkfifo
15637 : see if mkstemp exists
15638 set mkstemp d_mkstemp
15641 : see if mkstemps exists
15642 set mkstemps d_mkstemps
15645 : see if mktime exists
15646 set mktime d_mktime
15649 : see if this is a sys/mman.h system
15650 set sys/mman.h i_sysmman
15653 : see if mmap exists
15656 : see what shmat returns
15657 : default to something harmless
15659 case "$i_sysmman$d_mmap" in
15661 $cat >mmap.c <<'END'
15662 #include <sys/mman.h>
15665 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15670 echo "and it returns ($mmaptype)." >&4
15676 : see if sqrtl exists
15680 : see if scalbnl exists
15681 set scalbnl d_scalbnl
15684 : see if modfl exists
15688 : see if prototype for modfl is available
15690 set d_modflproto modfl $i_math math.h
15693 d_modfl_pow32_bug="$undef"
15695 case "$d_longdbl$d_modfl" in
15698 Checking to see whether your modfl() is okay for large values...
15704 if $test "X$d_modflproto" != "X$define"; then
15705 $cat >>try.c <<EOCP
15706 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15707 long double modfl (long double, long double *);
15710 $cat >>try.c <<EOCP
15712 long double nv = 4294967303.15;
15718 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15722 case "$osname:$gccversion" in
15723 aix:) saveccflags="$ccflags"
15724 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15727 if eval $compile; then
15730 *" 4294967303.150000 1.150000 4294967302.000000")
15731 echo >&4 "Your modfl() is broken for large values."
15732 d_modfl_pow32_bug="$define"
15734 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15738 *" 4294967303.150000 0.150000 4294967303.000000")
15739 echo >&4 "Your modfl() seems okay for large values."
15741 *) echo >&4 "I don't understand your modfl() at all."
15747 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15750 case "$osname:$gccversion" in
15751 aix:) ccflags="$saveccflags" ;; # restore
15756 if $test "$uselongdouble" = "$define"; then
15758 if $test "$d_sqrtl" != "$define"; then
15759 message="$message sqrtl"
15761 if $test "$d_modfl" != "$define"; then
15762 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15763 echo "You have both aintl and copysignl, so I can emulate modfl."
15765 message="$message modfl"
15768 if $test "$d_frexpl" != "$define"; then
15769 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15770 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15772 message="$message frexpl"
15776 if $test "$message" != ""; then
15779 *** You requested the use of long doubles but you do not seem to have
15780 *** the following mathematical functions needed for long double support:
15782 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15783 *** Cannot continue, aborting.
15791 : see if mprotect exists
15792 set mprotect d_mprotect
15795 : see if msgctl exists
15796 set msgctl d_msgctl
15799 : see if msgget exists
15800 set msgget d_msgget
15803 : see if msgsnd exists
15804 set msgsnd d_msgsnd
15807 : see if msgrcv exists
15808 set msgrcv d_msgrcv
15811 : see how much of the 'msg*(2)' library is present.
15814 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15815 *"$undef"*) h_msg=false;;
15819 case "`ipcs 2>&1`" in
15820 "SVID messages"*"not configured"*)
15821 echo "Your $osname does not have the msg*(2) configured." >&4
15824 set msgctl d_msgctl
15826 set msgget d_msgget
15828 set msgsnd d_msgsnd
15830 set msgrcv d_msgrcv
15836 : we could also check for sys/ipc.h ...
15837 if $h_msg && $test `./findhdr sys/msg.h`; then
15838 echo "You have the full msg*(2) library." >&4
15841 echo "You don't have the full msg*(2) library." >&4
15847 : Check for msghdr_s
15849 echo "Checking to see if your system supports struct msghdr..." >&4
15850 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15852 case "$d_msghdr_s" in
15853 "$define") echo "Yes, it does." ;;
15854 *) echo "No, it doesn't." ;;
15858 : see if msync exists
15862 : see if munmap exists
15863 set munmap d_munmap
15866 : see if nice exists
15870 : see if this is a langinfo.h system
15871 set langinfo.h i_langinfo
15874 : see if nl_langinfo exists
15875 set nl_langinfo d_nl_langinfo
15878 : check for volatile keyword
15880 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15881 $cat >try.c <<'EOCP'
15884 typedef struct _goo_struct goo_struct;
15885 goo_struct * volatile goo = ((goo_struct *)0);
15886 struct _goo_struct {
15891 typedef unsigned short foo_t;
15892 char *volatile foo;
15894 volatile foo_t blech;
15898 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15900 echo "Yup, it does."
15903 echo "Nope, it doesn't."
15909 : Check basic sizes
15911 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15913 case "$use64bitint:$d_quad:$quadtype" in
15916 uvtype="$uquadtype"
15921 uvtype="unsigned long"
15927 case "$uselongdouble:$d_longdbl" in
15929 nvtype="long double"
15930 nvsize=$longdblsize
15937 $echo "(IV will be "$ivtype", $ivsize bytes)"
15938 $echo "(UV will be "$uvtype", $uvsize bytes)"
15939 $echo "(NV will be "$nvtype", $nvsize bytes)"
15942 #$i_inttypes I_INTTYPES
15944 #include <inttypes.h>
15949 int8_t i = INT8_MAX;
15950 uint8_t u = UINT8_MAX;
15951 printf("int8_t\n");
15954 int16_t i = INT16_MAX;
15955 uint16_t u = UINT16_MAX;
15956 printf("int16_t\n");
15959 int32_t i = INT32_MAX;
15960 uint32_t u = UINT32_MAX;
15961 printf("int32_t\n");
15966 i8type="signed char"
15967 u8type="unsigned char"
15972 '') case "$shortsize" in
15974 u16type="unsigned short"
15982 '') set try -DINT16
15983 if eval $compile; then
15984 case "`$run ./try`" in
15996 '') if $test $shortsize -ge 2; then
15998 u16type="unsigned short"
16006 '') case "$longsize" in
16008 u32type="unsigned long"
16012 *) case "$intsize" in
16014 u32type="unsigned int"
16024 '') set try -DINT32
16025 if eval $compile; then
16026 case "`$run ./try`" in
16038 '') if $test $intsize -ge 4; then
16040 u32type="unsigned int"
16048 '') case "$d_quad:$quadtype" in
16050 i64type="$quadtype"
16051 u64type="$uquadtype"
16059 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16060 : volatile so that the compiler has to store it out to memory.
16061 if test X"$d_volatile" = X"$define"; then
16066 #$i_stdlib I_STDLIB
16068 #include <stdlib.h>
16070 #include <sys/types.h>
16071 #include <signal.h>
16073 $volatile int bletched = 0;
16074 $signal_t blech(int s) { bletched = 1; }
16079 int n = 8 * $uvsize;
16082 signal(SIGFPE, blech);
16085 for (i = 0; i < n; i++) {
16086 u = u << 1 | ($uvtype)1;
16088 if (($uvtype)d != u)
16092 d = ($nvtype)(u - 1);
16093 if (($uvtype)d != (u - 1))
16100 printf("%d\n", ((i == n) ? -n : i));
16106 d_nv_preserves_uv="$undef"
16107 if eval $compile; then
16108 nv_preserves_uv_bits="`$run ./try`"
16110 case "$nv_preserves_uv_bits" in
16112 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16113 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16114 d_nv_preserves_uv="$define"
16116 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16117 d_nv_preserves_uv="$undef" ;;
16118 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16119 nv_preserves_uv_bits="0" ;;
16123 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16124 : volatile so that the compiler has to store it out to memory.
16125 if test X"$d_volatile" = X"$define"; then
16131 typedef $nvtype NV;
16138 while(count < 256) {
16139 $volatile NV up = value + 1.0;
16140 $volatile NV negated = -value;
16141 $volatile NV down = negated - 1.0;
16142 $volatile NV got_up = up - value;
16143 int up_good = got_up == 1.0;
16144 int got_down = down - negated;
16145 int down_good = got_down == -1.0;
16147 if (down_good != up_good) {
16149 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16150 up_good, (double) got_up, down_good, (double) got_down,
16151 count, (double) value);
16158 fputs("256.0", stdout);
16161 fputs("2.0", stdout);
16167 fputs("*", stdout);
16173 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16174 count, (double) value);
16180 nv_overflows_integers_at='0'
16181 if eval $compile; then
16187 The largest integer your NVs can preserve is equal to $xxx
16189 nv_overflows_integers_at="$xxx"
16192 Cannot determine the largest integer value your NVs can hold, unexpected output
16199 Cannot determine the largest integer value your NVs can hold
16206 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16207 : volatile so that the compiler has to store it out to memory.
16208 if test X"$d_volatile" = X"$define"; then
16213 #$i_stdlib I_STDLIB
16215 #include <stdlib.h>
16217 #$i_string I_STRING
16219 # include <string.h>
16221 # include <strings.h>
16223 #include <sys/types.h>
16224 #include <signal.h>
16226 $volatile int bletched = 0;
16227 $signal_t blech(int s) { bletched = 1; }
16230 int checkit($nvtype d, char *where) {
16231 unsigned char *p = (char *)&d;
16232 unsigned char *end = p + sizeof(d);
16242 printf("No - %s: 0x", where);
16244 printf ("%02X", *p++);
16249 int main(int argc, char **argv) {
16252 fail += checkit(d, "0.0");
16254 /* The compiler shouldn't be assuming that bletched is 0 */
16257 fail += checkit(d, "bleched");
16260 signal(SIGFPE, blech);
16263 /* Paranoia - the compiler should have no way of knowing that ANSI says
16264 that argv[argc] will always be NULL. Actually, if it did assume this it
16265 would be buggy, as this is C and main() can be called from elsewhere in
16267 d = argv[argc] ? 1 : 0;
16270 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16273 fail += checkit(d, "ternary");
16275 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16278 printf("No - memset doesn't give 0.0\n");
16279 /* This might just blow up: */
16280 printf("(gives %g)\n", d);
16286 printf("No - something bleched\n");
16291 printf("No - %d fail(s)\n", fail);
16300 d_nv_zero_is_allbits_zero="$undef"
16301 if eval $compile; then
16307 0.0 is represented as all bits zero in memory
16309 d_nv_zero_is_allbits_zero="$define"
16312 0.0 is not represented as all bits zero in memory
16314 d_nv_zero_is_allbits_zero="$undef"
16319 0.0 is not represented as all bits zero in memory
16321 d_nv_zero_is_allbits_zero="$undef"
16327 : check for off64_t
16329 echo "Checking to see if you have off64_t..." >&4
16331 #include <sys/types.h>
16332 #include <unistd.h>
16333 int main() { off64_t x = 7; }
16336 if eval $compile; then
16338 echo "You have off64_t."
16341 echo "You do not have off64_t."
16342 case "$lseeksize" in
16343 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16350 : how to create joinable pthreads
16351 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16353 echo "Checking what constant to use for creating joinable pthreads..." >&4
16354 $cat >try.c <<'EOCP'
16355 #include <pthread.h>
16357 int detachstate = JOINABLE;
16360 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16361 if eval $compile; then
16362 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16363 val="$undef" # Yes, undef.
16364 set d_old_pthread_create_joinable
16367 set old_pthread_create_joinable
16370 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16371 if eval $compile; then
16372 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16374 set d_old_pthread_create_joinable
16376 val=PTHREAD_CREATE_UNDETACHED
16377 set old_pthread_create_joinable
16380 set try -DJOINABLE=__UNDETACHED
16381 if eval $compile; then
16382 echo "You seem to use __UNDETACHED." >&4
16384 set d_old_pthread_create_joinable
16387 set old_pthread_create_joinable
16390 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16392 set d_old_pthread_create_joinable
16395 set old_pthread_create_joinable
16402 d_old_pthread_create_joinable="$undef"
16403 old_pthread_create_joinable=""
16406 : see if pause exists
16410 : see if poll exists
16414 : see if prctl exists
16418 : see if prctl supports PR_SET_NAME
16419 d_prctl_set_name=$undef
16423 #include <sys/prctl.h>
16425 int main (int argc, char *argv[])
16427 return (prctl (PR_SET_NAME, "Test"));
16431 if eval $compile_ok && $run ./try; then
16432 echo "Your prctl (PR_SET_NAME, ...) works"
16433 d_prctl_set_name=$define
16439 : see if readlink exists
16440 set readlink d_readlink
16443 : Check if exe is symlink to abs path of executing program
16447 case "$d_readlink" in
16449 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16450 : more tidy to avoid an extra level of symlink
16451 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16452 while test $# -gt 0; do
16455 if $issymlink $try; then
16456 $ls -l $try > reflect
16457 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16458 echo "You have $type-like $try."
16459 procselfexe='"'$try'"'
16461 : This will break out of the loop
16472 : backward compatibility for d_hvfork
16473 if test X$d_hvfork != X; then
16474 d_vfork="$d_hvfork"
16477 : see if there is a vfork
16482 d_pseudofork=$undef
16484 : Ok, but do we want to use it. vfork is reportedly unreliable in
16485 : perl on Solaris 2.x, and probably elsewhere.
16489 case "$usevfork" in
16495 Perl can only use a vfork() that doesn't suffer from strict
16496 restrictions on calling functions or modifying global data in
16497 the child. For example, glibc-2.1 contains such a vfork()
16498 that is unsuitable. If your system provides a proper fork()
16499 call, chances are that you do NOT want perl to use vfork().
16502 rp="Do you still want to use vfork()?"
16507 echo "Ok, we won't use vfork()."
16516 $define) usevfork='true';;
16517 *) usevfork='false';;
16520 : see whether the pthread_atfork exists
16522 #include <pthread.h>
16525 #ifdef PTHREAD_ATFORK
16526 pthread_atfork(NULL,NULL,NULL);
16531 : see if pthread_atfork exists
16532 set try -DPTHREAD_ATFORK
16533 if eval $compile; then
16538 case "$usethreads" in
16541 $define) echo 'pthread_atfork found.' >&4 ;;
16542 *) echo 'pthread_atfork NOT found.' >&4 ;;
16545 set d_pthread_atfork
16548 : see if pthread_attr_setscope exists
16549 set pthread_attr_setscope d_pthread_attr_setscope
16552 : see whether the various POSIXish _yields exist
16554 #include <pthread.h>
16560 #ifdef PTHREAD_YIELD
16563 #ifdef PTHREAD_YIELD_NULL
16564 pthread_yield(NULL);
16570 : see if sched_yield exists
16571 set try -DSCHED_YIELD
16572 if eval $compile; then
16574 sched_yield='sched_yield()'
16578 case "$usethreads" in
16581 $define) echo 'sched_yield() found.' >&4 ;;
16582 *) echo 'sched_yield() NOT found.' >&4 ;;
16588 : see if pthread_yield exists
16589 set try -DPTHREAD_YIELD
16590 if eval $compile; then
16592 case "$sched_yield" in
16593 '') sched_yield='pthread_yield()' ;;
16596 set try -DPTHREAD_YIELD_NULL
16597 if eval $compile; then
16599 case "$sched_yield" in
16600 '') sched_yield='pthread_yield(NULL)' ;;
16606 case "$usethreads" in
16609 $define) echo 'pthread_yield() found.' >&4 ;;
16610 *) echo 'pthread_yield() NOT found.' >&4 ;;
16614 set d_pthread_yield
16616 case "$sched_yield" in
16617 '') sched_yield=undef ;;
16621 : see if random_r exists
16622 set random_r d_random_r
16624 case "$d_random_r" in
16626 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16627 case "$d_random_r_proto:$usethreads" in
16628 ":define") d_random_r_proto=define
16629 set d_random_r_proto random_r $hdrs
16633 case "$d_random_r_proto" in
16635 case "$random_r_proto" in
16636 ''|0) try='int random_r(int*, struct random_data*);'
16637 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16639 case "$random_r_proto" in
16640 ''|0) try='int random_r(long*, struct random_data*);'
16641 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16643 case "$random_r_proto" in
16644 ''|0) try='int random_r(struct random_data*, int32_t*);'
16645 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16647 case "$random_r_proto" in
16648 ''|0) d_random_r=undef
16650 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16651 * ) case "$random_r_proto" in
16652 REENTRANT_PROTO*) ;;
16653 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16655 echo "Prototype: $try" ;;
16658 *) case "$usethreads" in
16659 define) echo "random_r has no prototype, not using it." >&4 ;;
16666 *) random_r_proto=0
16670 : see if readdir and friends exist
16671 set readdir d_readdir
16673 set seekdir d_seekdir
16675 set telldir d_telldir
16677 set rewinddir d_rewinddir
16680 : see if readdir64_r exists
16681 set readdir64_r d_readdir64_r
16683 case "$d_readdir64_r" in
16685 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16686 case "$d_readdir64_r_proto:$usethreads" in
16687 ":define") d_readdir64_r_proto=define
16688 set d_readdir64_r_proto readdir64_r $hdrs
16692 case "$d_readdir64_r_proto" in
16694 case "$readdir64_r_proto" in
16695 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16696 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16698 case "$readdir64_r_proto" in
16699 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16700 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16702 case "$readdir64_r_proto" in
16703 ''|0) d_readdir64_r=undef
16704 readdir64_r_proto=0
16705 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16706 * ) case "$readdir64_r_proto" in
16707 REENTRANT_PROTO*) ;;
16708 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16710 echo "Prototype: $try" ;;
16713 *) case "$usethreads" in
16714 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16716 d_readdir64_r=undef
16717 readdir64_r_proto=0
16721 *) readdir64_r_proto=0
16725 : see if readdir_r exists
16726 set readdir_r d_readdir_r
16728 case "$d_readdir_r" in
16730 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16731 case "$d_readdir_r_proto:$usethreads" in
16732 ":define") d_readdir_r_proto=define
16733 set d_readdir_r_proto readdir_r $hdrs
16737 case "$d_readdir_r_proto" in
16739 case "$readdir_r_proto" in
16740 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16741 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16743 case "$readdir_r_proto" in
16744 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16745 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16747 case "$readdir_r_proto" in
16748 ''|0) d_readdir_r=undef
16750 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16751 * ) case "$readdir_r_proto" in
16752 REENTRANT_PROTO*) ;;
16753 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16755 echo "Prototype: $try" ;;
16758 *) case "$usethreads" in
16759 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16766 *) readdir_r_proto=0
16770 : see if readv exists
16774 : see if recvmsg exists
16775 set recvmsg d_recvmsg
16778 : see if rename exists
16779 set rename d_rename
16782 : see if rmdir exists
16786 : see if memory.h is available.
16791 : See if it conflicts with string.h
16797 $cppstdin $cppflags $cppminus < $strings > mem.h
16798 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16800 echo "We won't be including <memory.h>."
16810 : can bcopy handle overlapping blocks?
16813 case "$d_memmove" in
16814 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16815 *) case "$d_bcopy" in
16817 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16819 #$i_memory I_MEMORY
16820 #$i_stdlib I_STDLIB
16821 #$i_string I_STRING
16822 #$i_unistd I_UNISTD
16824 $cat >>try.c <<'EOCP'
16827 # include <memory.h>
16830 # include <stdlib.h>
16833 # include <string.h>
16835 # include <strings.h>
16838 # include <unistd.h> /* Needed for NetBSD */
16842 char buf[128], abc[128];
16848 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16849 try to store the string in read-only memory. */
16850 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16852 for (align = 7; align >= 0; align--) {
16853 for (len = 36; len; len--) {
16855 bcopy(abc, b, len);
16856 for (off = 1; off <= len; off++) {
16857 bcopy(b, b+off, len);
16858 bcopy(b+off, b, len);
16859 if (bcmp(b, abc, len))
16868 if eval $compile_ok; then
16869 if $run ./try 2>/dev/null; then
16870 echo "Yes, it can."
16873 echo "It can't, sorry."
16876 echo "(I can't compile the test program, so we'll assume not...)"
16886 : can memcpy handle overlapping blocks?
16889 case "$d_memmove" in
16890 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16891 *) case "$d_memcpy" in
16893 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16895 #$i_memory I_MEMORY
16896 #$i_stdlib I_STDLIB
16897 #$i_string I_STRING
16898 #$i_unistd I_UNISTD
16900 $cat >>try.c <<'EOCP'
16903 # include <memory.h>
16906 # include <stdlib.h>
16909 # include <string.h>
16911 # include <strings.h>
16914 # include <unistd.h> /* Needed for NetBSD */
16918 char buf[128], abc[128];
16924 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16925 try to store the string in read-only memory. */
16926 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16928 for (align = 7; align >= 0; align--) {
16929 for (len = 36; len; len--) {
16931 memcpy(b, abc, len);
16932 for (off = 1; off <= len; off++) {
16933 memcpy(b+off, b, len);
16934 memcpy(b, b+off, len);
16935 if (memcmp(b, abc, len))
16944 if eval $compile_ok; then
16945 if $run ./try 2>/dev/null; then
16946 echo "Yes, it can."
16949 echo "It can't, sorry."
16952 echo "(I can't compile the test program, so we'll assume not...)"
16962 : can memcmp be trusted to compare relative magnitude?
16964 case "$d_memcmp" in
16967 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16969 #$i_memory I_MEMORY
16970 #$i_stdlib I_STDLIB
16971 #$i_string I_STRING
16972 #$i_unistd I_UNISTD
16974 $cat >>try.c <<'EOCP'
16977 # include <memory.h>
16980 # include <stdlib.h>
16983 # include <string.h>
16985 # include <strings.h>
16988 # include <unistd.h> /* Needed for NetBSD */
16994 if ((a < b) && memcmp(&a, &b, 1) < 0)
17000 if eval $compile_ok; then
17001 if $run ./try 2>/dev/null; then
17002 echo "Yes, it can."
17005 echo "No, it can't (it uses signed chars)."
17008 echo "(I can't compile the test program, so we'll assume not...)"
17016 : see if prototype for sbrk is available
17018 set d_sbrkproto sbrk $i_unistd unistd.h
17021 : see if select exists
17022 set select d_select
17025 : see if semctl exists
17026 set semctl d_semctl
17029 : see if semget exists
17030 set semget d_semget
17033 : see if semop exists
17037 : see how much of the 'sem*(2)' library is present.
17040 case "$d_semctl$d_semget$d_semop" in
17041 *"$undef"*) h_sem=false;;
17045 case "`ipcs 2>&1`" in
17046 "SVID messages"*"not configured"*)
17047 echo "Your $osname does not have the sem*(2) configured." >&4
17050 set semctl d_semctl
17052 set semget d_semget
17060 : we could also check for sys/ipc.h ...
17061 if $h_sem && $test `./findhdr sys/sem.h`; then
17062 echo "You have the full sem*(2) library." >&4
17065 echo "You don't have the full sem*(2) library." >&4
17071 : see whether sys/sem.h defines union semun
17073 $cat > try.c <<'END'
17074 #include <sys/types.h>
17075 #include <sys/ipc.h>
17076 #include <sys/sem.h>
17077 int main () { union semun semun; semun.buf = 0; }
17080 if eval $compile; then
17081 echo "You have union semun in <sys/sem.h>." >&4
17084 echo "You do not have union semun in <sys/sem.h>." >&4
17091 : see how to do semctl IPC_STAT
17095 $cat > tryh.h <<END
17098 # define S_IRUSR S_IREAD
17099 # define S_IWUSR S_IWRITE
17100 # define S_IXUSR S_IEXEC
17102 # define S_IRUSR 0400
17103 # define S_IWUSR 0200
17104 # define S_IXUSR 0100
17106 # define S_IRGRP (S_IRUSR>>3)
17107 # define S_IWGRP (S_IWUSR>>3)
17108 # define S_IXGRP (S_IXUSR>>3)
17109 # define S_IROTH (S_IRUSR>>6)
17110 # define S_IWOTH (S_IWUSR>>6)
17111 # define S_IXOTH (S_IXUSR>>6)
17114 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17115 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17116 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17119 : see whether semctl IPC_STAT can use union semun
17120 case "$d_semctl_semun" in
17124 #include <sys/types.h>
17125 #include <sys/ipc.h>
17126 #include <sys/sem.h>
17127 #include <sys/stat.h>
17134 #$d_union_semun HAS_UNION_SEMUN
17137 #ifndef HAS_UNION_SEMUN
17140 struct semid_ds *buf;
17141 unsigned short *array;
17147 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17148 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17150 struct semid_ds argbuf;
17153 st = semctl(sem, 0, IPC_STAT, arg);
17157 # endif /* IPC_STAT */
17158 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17160 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17161 # endif /* IPC_RMID */
17162 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17164 #endif /* IPC_PRIVATE && ... */
17165 printf("semget failed: errno = %d\n", errno);
17170 if eval $compile; then
17173 semun) val="$define" ;;
17181 case "$d_semctl_semun" in
17183 echo "You can use union semun for semctl IPC_STAT." >&4
17186 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17191 : see whether semctl IPC_STAT can use struct semid_ds pointer
17192 case "$d_semctl_semid_ds" in
17195 $cat > try.c <<'END'
17196 #include <sys/types.h>
17197 #include <sys/ipc.h>
17198 #include <sys/sem.h>
17199 #include <sys/stat.h>
17207 struct semid_ds arg;
17210 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17211 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17214 st = semctl(sem, 0, IPC_STAT, &arg);
17216 printf("semid_ds\n");
17218 # endif /* IPC_STAT */
17219 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17221 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17222 # endif /* IPC_RMID */
17223 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17225 #endif /* IPC_PRIVATE && ... */
17226 printf("semget failed: errno = %d\n", errno);
17232 if eval $compile; then
17235 semid_ds) val="$define" ;;
17239 set d_semctl_semid_ds
17243 case "$d_semctl_semid_ds" in
17245 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17247 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17253 # We do not have the full sem*(2) library, so assume we can not
17259 set d_semctl_semid_ds
17265 : see if sendmsg exists
17266 set sendmsg d_sendmsg
17269 : see if setegid exists
17270 set setegid d_setegid
17273 : see if seteuid exists
17274 set seteuid d_seteuid
17277 : see if setgrent exists
17278 set setgrent d_setgrent
17281 : see if setgrent_r exists
17282 set setgrent_r d_setgrent_r
17284 case "$d_setgrent_r" in
17286 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17287 case "$d_setgrent_r_proto:$usethreads" in
17288 ":define") d_setgrent_r_proto=define
17289 set d_setgrent_r_proto setgrent_r $hdrs
17293 case "$d_setgrent_r_proto" in
17295 case "$setgrent_r_proto" in
17296 ''|0) try='int setgrent_r(FILE**);'
17297 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17299 case "$setgrent_r_proto" in
17300 ''|0) try='void setgrent_r(FILE**);'
17301 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17303 case "$setgrent_r_proto" in
17304 ''|0) d_setgrent_r=undef
17306 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17307 * ) case "$setgrent_r_proto" in
17308 REENTRANT_PROTO*) ;;
17309 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17311 echo "Prototype: $try" ;;
17314 *) case "$usethreads" in
17315 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17322 *) setgrent_r_proto=0
17326 : see if sethostent exists
17327 set sethostent d_sethent
17330 : see if sethostent_r exists
17331 set sethostent_r d_sethostent_r
17333 case "$d_sethostent_r" in
17335 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17336 case "$d_sethostent_r_proto:$usethreads" in
17337 ":define") d_sethostent_r_proto=define
17338 set d_sethostent_r_proto sethostent_r $hdrs
17342 case "$d_sethostent_r_proto" in
17344 case "$sethostent_r_proto" in
17345 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17346 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17348 case "$sethostent_r_proto" in
17349 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17350 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17352 case "$sethostent_r_proto" in
17353 ''|0) d_sethostent_r=undef
17354 sethostent_r_proto=0
17355 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17356 * ) case "$sethostent_r_proto" in
17357 REENTRANT_PROTO*) ;;
17358 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17360 echo "Prototype: $try" ;;
17363 *) case "$usethreads" in
17364 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17366 d_sethostent_r=undef
17367 sethostent_r_proto=0
17371 *) sethostent_r_proto=0
17375 : see if setitimer exists
17376 set setitimer d_setitimer
17379 : see if setlinebuf exists
17380 set setlinebuf d_setlinebuf
17383 : see if setlocale exists
17384 set setlocale d_setlocale
17387 : see if locale.h is available
17388 set locale.h i_locale
17391 : see if setlocale_r exists
17392 set setlocale_r d_setlocale_r
17394 case "$d_setlocale_r" in
17396 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17397 case "$d_setlocale_r_proto:$usethreads" in
17398 ":define") d_setlocale_r_proto=define
17399 set d_setlocale_r_proto setlocale_r $hdrs
17403 case "$d_setlocale_r_proto" in
17405 case "$setlocale_r_proto" in
17406 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17407 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17409 case "$setlocale_r_proto" in
17410 ''|0) d_setlocale_r=undef
17411 setlocale_r_proto=0
17412 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17413 * ) case "$setlocale_r_proto" in
17414 REENTRANT_PROTO*) ;;
17415 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17417 echo "Prototype: $try" ;;
17420 *) case "$usethreads" in
17421 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17423 d_setlocale_r=undef
17424 setlocale_r_proto=0
17428 *) setlocale_r_proto=0
17432 : see if setnetent exists
17433 set setnetent d_setnent
17436 : see if setnetent_r exists
17437 set setnetent_r d_setnetent_r
17439 case "$d_setnetent_r" in
17441 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17442 case "$d_setnetent_r_proto:$usethreads" in
17443 ":define") d_setnetent_r_proto=define
17444 set d_setnetent_r_proto setnetent_r $hdrs
17448 case "$d_setnetent_r_proto" in
17450 case "$setnetent_r_proto" in
17451 ''|0) try='int setnetent_r(int, struct netent_data*);'
17452 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17454 case "$setnetent_r_proto" in
17455 ''|0) try='void setnetent_r(int, struct netent_data*);'
17456 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17458 case "$setnetent_r_proto" in
17459 ''|0) d_setnetent_r=undef
17460 setnetent_r_proto=0
17461 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17462 * ) case "$setnetent_r_proto" in
17463 REENTRANT_PROTO*) ;;
17464 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17466 echo "Prototype: $try" ;;
17469 *) case "$usethreads" in
17470 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17472 d_setnetent_r=undef
17473 setnetent_r_proto=0
17477 *) setnetent_r_proto=0
17481 : see if setprotoent exists
17482 set setprotoent d_setpent
17485 : see if setpgid exists
17486 set setpgid d_setpgid
17489 : see if setpgrp2 exists
17490 set setpgrp2 d_setpgrp2
17493 : see if setpriority exists
17494 set setpriority d_setprior
17497 : see if setproctitle exists
17498 set setproctitle d_setproctitle
17501 : see if setprotoent_r exists
17502 set setprotoent_r d_setprotoent_r
17504 case "$d_setprotoent_r" in
17506 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17507 case "$d_setprotoent_r_proto:$usethreads" in
17508 ":define") d_setprotoent_r_proto=define
17509 set d_setprotoent_r_proto setprotoent_r $hdrs
17513 case "$d_setprotoent_r_proto" in
17515 case "$setprotoent_r_proto" in
17516 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17517 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17519 case "$setprotoent_r_proto" in
17520 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17521 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17523 case "$setprotoent_r_proto" in
17524 ''|0) d_setprotoent_r=undef
17525 setprotoent_r_proto=0
17526 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17527 * ) case "$setprotoent_r_proto" in
17528 REENTRANT_PROTO*) ;;
17529 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17531 echo "Prototype: $try" ;;
17534 *) case "$usethreads" in
17535 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17537 d_setprotoent_r=undef
17538 setprotoent_r_proto=0
17542 *) setprotoent_r_proto=0
17546 : see if setpwent exists
17547 set setpwent d_setpwent
17550 : see if setpwent_r exists
17551 set setpwent_r d_setpwent_r
17553 case "$d_setpwent_r" in
17555 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17556 case "$d_setpwent_r_proto:$usethreads" in
17557 ":define") d_setpwent_r_proto=define
17558 set d_setpwent_r_proto setpwent_r $hdrs
17562 case "$d_setpwent_r_proto" in
17564 case "$setpwent_r_proto" in
17565 ''|0) try='int setpwent_r(FILE**);'
17566 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17568 case "$setpwent_r_proto" in
17569 ''|0) try='void setpwent_r(FILE**);'
17570 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17572 case "$setpwent_r_proto" in
17573 ''|0) d_setpwent_r=undef
17575 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17576 * ) case "$setpwent_r_proto" in
17577 REENTRANT_PROTO*) ;;
17578 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17580 echo "Prototype: $try" ;;
17583 *) case "$usethreads" in
17584 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17591 *) setpwent_r_proto=0
17595 : see if setregid exists
17596 set setregid d_setregid
17598 set setresgid d_setresgid
17601 : see if setreuid exists
17602 set setreuid d_setreuid
17604 set setresuid d_setresuid
17607 : see if setrgid exists
17608 set setrgid d_setrgid
17611 : see if setruid exists
17612 set setruid d_setruid
17615 : see if setservent exists
17616 set setservent d_setsent
17619 : see if setservent_r exists
17620 set setservent_r d_setservent_r
17622 case "$d_setservent_r" in
17624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17625 case "$d_setservent_r_proto:$usethreads" in
17626 ":define") d_setservent_r_proto=define
17627 set d_setservent_r_proto setservent_r $hdrs
17631 case "$d_setservent_r_proto" in
17633 case "$setservent_r_proto" in
17634 ''|0) try='int setservent_r(int, struct servent_data*);'
17635 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17637 case "$setservent_r_proto" in
17638 ''|0) try='void setservent_r(int, struct servent_data*);'
17639 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17641 case "$setservent_r_proto" in
17642 ''|0) d_setservent_r=undef
17643 setservent_r_proto=0
17644 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17645 * ) case "$setservent_r_proto" in
17646 REENTRANT_PROTO*) ;;
17647 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17649 echo "Prototype: $try" ;;
17652 *) case "$usethreads" in
17653 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17655 d_setservent_r=undef
17656 setservent_r_proto=0
17660 *) setservent_r_proto=0
17664 : see if setsid exists
17665 set setsid d_setsid
17668 : see if setvbuf exists
17669 set setvbuf d_setvbuf
17672 : see if shmctl exists
17673 set shmctl d_shmctl
17676 : see if shmget exists
17677 set shmget d_shmget
17680 : see if shmat exists
17683 : see what shmat returns
17686 $cat >shmat.c <<'END'
17687 #include <sys/shm.h>
17690 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17695 echo "and it returns ($shmattype)." >&4
17696 : see if a prototype for shmat is available
17697 xxx=`./findhdr sys/shm.h`
17698 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17699 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17710 set d_shmatprototype
17713 : see if shmdt exists
17717 : see how much of the 'shm*(2)' library is present.
17720 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17721 *"$undef"*) h_shm=false;;
17725 case "`ipcs 2>&1`" in
17726 "SVID shared memory"*"not configured"*)
17727 echo "Your $osname does not have the shm*(2) configured." >&4
17730 set shmctl d_shmctl
17732 set shmget d_shmget
17742 : we could also check for sys/ipc.h ...
17743 if $h_shm && $test `./findhdr sys/shm.h`; then
17744 echo "You have the full shm*(2) library." >&4
17747 echo "You don't have the full shm*(2) library." >&4
17753 : see if we have sigaction
17755 if set sigaction val -f d_sigaction; eval $csym; $val; then
17756 echo 'sigaction() found.' >&4
17759 #include <sys/types.h>
17760 #include <signal.h>
17761 #$i_stdlib I_STDLIB
17763 #include <stdlib.h>
17767 struct sigaction act, oact;
17769 oact.sa_handler = 0;
17770 /* so that act and oact are used */
17771 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17775 if eval $compile_ok; then
17778 echo "But you don't seem to have a usable struct sigaction." >&4
17782 echo 'sigaction NOT found.' >&4
17785 set d_sigaction; eval $setvar
17788 : see if this is a sunmath.h system
17789 set sunmath.h i_sunmath
17792 : see if signbit exists
17793 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17796 #$i_sunmath I_SUNMATH
17800 #ifdef I_SUNMATH /* Solaris special math library */
17801 # include <sunmath.h>
17804 int main(int argc, char **argv)
17808 if ((signbit(x) == 0) && (signbit(y) != 0))
17816 if eval $compile; then
17817 if $run ./try; then
17821 $echo "Signbit seems to be available, but doesn't work as I expected."
17822 $echo "I won't use it." >&4
17833 : see if sigprocmask exists
17834 set sigprocmask d_sigprocmask
17837 : see if sigsetjmp exists
17839 case "$d_sigsetjmp" in
17842 #include <setjmp.h>
17843 #$i_stdlib I_STDLIB
17845 #include <stdlib.h>
17851 if (sigsetjmp(env,1))
17854 siglongjmp(env, 1);
17859 if eval $compile; then
17860 if $run ./try >/dev/null 2>&1; then
17861 echo "POSIX sigsetjmp found." >&4
17865 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17871 echo "sigsetjmp not found." >&4
17875 *) val="$d_sigsetjmp"
17876 case "$d_sigsetjmp" in
17877 $define) echo "POSIX sigsetjmp found." >&4;;
17878 $undef) echo "sigsetjmp not found." >&4;;
17886 : see if snprintf exists
17887 set snprintf d_snprintf
17890 : see if vsnprintf exists
17891 set vsnprintf d_vsnprintf
17894 case "$d_snprintf-$d_vsnprintf" in
17897 Checking whether your snprintf() and vsnprintf() work okay...
17899 $cat >try.c <<'EOCP'
17900 /* v?snprintf testing logic courtesy of Russ Allbery.
17901 * According to C99:
17902 * - if the buffer is too short it still must be \0-terminated
17903 * - if the buffer is too short the potentially required length
17904 * must be returned and not -1
17905 * - if the buffer is NULL the potentially required length
17906 * must be returned and not -1 or core dump
17909 #include <stdarg.h>
17913 int test (char *format, ...)
17918 va_start (args, format);
17919 count = vsnprintf (buf, sizeof buf, format, args);
17926 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17927 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17931 if eval $compile; then
17934 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17936 Your snprintf() and snprintf() don't seem to be working okay.
17938 d_snprintf="$undef"
17939 d_vsnprintf="$undef"
17943 echo "(I can't seem to compile the test program--assuming they don't)"
17944 d_snprintf="$undef"
17945 d_vsnprintf="$undef"
17951 : see if sockatmark exists
17952 set sockatmark d_sockatmark
17955 : see if prototype for sockatmark is available
17957 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17960 : see if socks5_init exists
17961 set socks5_init d_socks5_init
17964 : see if sprintf returns the length of the string in the buffer as per ANSI
17965 $echo "Checking whether sprintf returns the length of the string..." >&4
17968 #$i_stdlib I_STDLIB
17970 #include <stdlib.h>
17972 #$i_string I_STRING
17974 # include <string.h>
17976 # include <strings.h>
17985 int check (size_t expect, int test) {
17986 size_t got = strlen(buffer);
17990 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17995 int main(int argc, char **argv) {
17998 check(sprintf(buffer, ""), ++test);
17999 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18000 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18007 if eval $compile; then
18011 sprintf returns the length of the string (as ANSI says it should)
18013 d_sprintf_returns_strlen="$define"
18016 sprintf does not return the length of the string (how old is this system?)
18018 d_sprintf_returns_strlen="$undef"
18022 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18023 d_sprintf_returns_strlen="$undef"
18027 : see if srand48_r exists
18028 set srand48_r d_srand48_r
18030 case "$d_srand48_r" in
18032 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18033 case "$d_srand48_r_proto:$usethreads" in
18034 ":define") d_srand48_r_proto=define
18035 set d_srand48_r_proto srand48_r $hdrs
18039 case "$d_srand48_r_proto" in
18041 case "$srand48_r_proto" in
18042 ''|0) try='int srand48_r(long, struct drand48_data*);'
18043 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18045 case "$srand48_r_proto" in
18046 ''|0) d_srand48_r=undef
18048 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18049 * ) case "$srand48_r_proto" in
18050 REENTRANT_PROTO*) ;;
18051 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18053 echo "Prototype: $try" ;;
18056 *) case "$usethreads" in
18057 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18064 *) srand48_r_proto=0
18068 : see if srandom_r exists
18069 set srandom_r d_srandom_r
18071 case "$d_srandom_r" in
18073 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18074 case "$d_srandom_r_proto:$usethreads" in
18075 ":define") d_srandom_r_proto=define
18076 set d_srandom_r_proto srandom_r $hdrs
18080 case "$d_srandom_r_proto" in
18082 case "$srandom_r_proto" in
18083 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18084 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18086 case "$srandom_r_proto" in
18087 ''|0) d_srandom_r=undef
18089 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18090 * ) case "$srandom_r_proto" in
18091 REENTRANT_PROTO*) ;;
18092 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18094 echo "Prototype: $try" ;;
18097 *) case "$usethreads" in
18098 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18105 *) srandom_r_proto=0
18109 : see if prototype for setresgid is available
18111 set d_sresgproto setresgid $i_unistd unistd.h
18114 : see if prototype for setresuid is available
18116 set d_sresuproto setresuid $i_unistd unistd.h
18119 : see if sys/stat.h is available
18120 set sys/stat.h i_sysstat
18123 : see if stat knows about block sizes
18125 echo "Checking to see if your struct stat has st_blocks field..." >&4
18126 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18129 : see if this is a sys/vfs.h system
18130 set sys/vfs.h i_sysvfs
18133 : see if this is a sys/statfs.h system
18134 set sys/statfs.h i_sysstatfs
18137 : Check for statfs_s
18139 echo "Checking to see if your system supports struct statfs..." >&4
18140 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
18142 case "$d_statfs_s" in
18143 "$define") echo "Yes, it does." ;;
18144 *) echo "No, it doesn't." ;;
18148 : see if struct statfs knows about f_flags
18149 case "$d_statfs_s" in
18152 echo "Checking to see if your struct statfs has f_flags field..." >&4
18153 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
18157 set d_statfs_f_flags
18161 case "$d_statfs_f_flags" in
18162 "$define") echo "Yes, it does." ;;
18163 *) echo "No, it doesn't." ;;
18166 : see what flavor, if any, of static inline is supported
18168 echo "Checking to see if your system supports static inline..."
18169 $cat > try.c <<'EOCP'
18170 #include <stdlib.h>
18171 extern int f_via_a(int x);
18172 extern int f_via_b(int x);
18173 int main(int argc, char **argv)
18182 return EXIT_SUCCESS;
18185 return EXIT_FAILURE;
18189 $cat > a.c <<'EOCP'
18190 static INLINE int f(int x) {
18201 $cat > b.c <<'EOCP'
18202 extern int f(int x);
18210 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18211 case "$perl_static_inline" in
18212 '') # Check the various possibilities, and break out on success.
18213 # For gcc, prefer __inline__, which will still permit
18214 # cflags.SH to add in -ansi.
18215 case "$gccversion" in
18216 '') xxx="inline __inline__ __inline _inline";;
18217 *) xxx="__inline__ inline __inline _inline";;
18219 for inline in $xxx; do
18220 set try -DINLINE=$inline a.c
18221 if eval $compile && $run ./try; then
18222 # Now make sure there is no external linkage of static
18224 set try -DINLINE=$inline -DUSE_B a.c b.c
18225 if eval $compile && $run ./try; then
18226 $echo "Your compiler supports static $inline, " >&4
18227 $echo "but it also creates an external definition," >&4
18228 $echo "so I won't use it." >&4
18231 $echo "Your compiler supports static $inline." >&4
18233 perl_static_inline="static $inline";
18237 $echo "Your compiler does NOT support static $inline." >&4
18242 *inline*) # Some variant of inline exists.
18243 echo "Keeping your $hint value of $perl_static_inline."
18246 static) # No inline capabilities
18247 echo "Keeping your $hint value of $perl_static_inline."
18250 *) # Unrecognized previous value -- blindly trust the supplied
18251 # value and hope it makes sense. Use old value for
18252 # d_static_inline, if there is one.
18253 echo "Keeping your $hint value of $perl_static_inline."
18254 case "$d_static_inline" in
18256 *) val=$d_static_inline ;;
18260 # Fallback to plain 'static' if nothing worked.
18261 case "$perl_static_inline" in
18263 perl_static_inline="static"
18267 set d_static_inline
18269 $rm -f a.[co] b.[co]
18272 : Check stream access
18274 Checking how to access stdio streams by file descriptor number...
18276 case "$stdio_stream_array" in
18277 '') $cat >try.c <<EOCP
18280 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18284 for s in _iob __iob __sF
18286 set try -DSTDIO_STREAM_ARRAY=$s
18287 if eval $compile; then
18288 case "`$run ./try`" in
18289 yes) stdio_stream_array=$s; break ;;
18295 case "$stdio_stream_array" in
18297 I can't figure out how to access stdio streams by file descriptor number.
18299 d_stdio_stream_array="$undef"
18302 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18304 d_stdio_stream_array="$define"
18308 : see if strcoll exists
18309 set strcoll d_strcoll
18312 : check for structure copying
18314 echo "Checking to see if your C compiler can copy structs..." >&4
18315 $cat >try.c <<'EOCP'
18325 if $cc -c try.c >/dev/null 2>&1 ; then
18327 echo "Yup, it can."
18330 echo "Nope, it can't."
18336 : see if strerror and/or sys_errlist[] exist
18338 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18339 if set strerror val -f d_strerror; eval $csym; $val; then
18340 echo 'strerror() found.' >&4
18341 d_strerror="$define"
18342 d_strerrm='strerror(e)'
18343 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18344 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18345 d_syserrlst="$define"
18347 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18348 d_syserrlst="$undef"
18350 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18351 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18352 echo 'strerror() found in string header.' >&4
18353 d_strerror="$define"
18354 d_strerrm='strerror(e)'
18355 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18356 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18357 d_syserrlst="$define"
18359 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18360 d_syserrlst="$undef"
18362 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18363 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18364 d_strerror="$undef"
18365 d_syserrlst="$define"
18366 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18368 echo 'strerror() and sys_errlist[] NOT found.' >&4
18369 d_strerror="$undef"
18370 d_syserrlst="$undef"
18371 d_strerrm='"unknown"'
18375 : see if strerror_r exists
18376 set strerror_r d_strerror_r
18378 case "$d_strerror_r" in
18380 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18381 case "$d_strerror_r_proto:$usethreads" in
18382 ":define") d_strerror_r_proto=define
18383 set d_strerror_r_proto strerror_r $hdrs
18387 case "$d_strerror_r_proto" in
18389 case "$strerror_r_proto" in
18390 ''|0) try='int strerror_r(int, char*, size_t);'
18391 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18393 case "$strerror_r_proto" in
18394 ''|0) try='int strerror_r(int, char*, int);'
18395 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18397 case "$strerror_r_proto" in
18398 ''|0) try='char* strerror_r(int, char*, size_t);'
18399 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18401 case "$strerror_r_proto" in
18402 ''|0) d_strerror_r=undef
18404 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18405 * ) case "$strerror_r_proto" in
18406 REENTRANT_PROTO*) ;;
18407 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18409 echo "Prototype: $try" ;;
18412 *) case "$usethreads" in
18413 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18420 *) strerror_r_proto=0
18424 : see if strftime exists
18425 set strftime d_strftime
18428 : see if strlcat exists
18429 set strlcat d_strlcat
18432 : see if strlcpy exists
18433 set strlcpy d_strlcpy
18436 : see if strtod exists
18437 set strtod d_strtod
18440 : see if strtol exists
18441 set strtol d_strtol
18444 : see if strtold exists
18445 set strtold d_strtold
18448 : see if strtoll exists
18449 set strtoll d_strtoll
18452 case "$d_longlong-$d_strtoll" in
18455 Checking whether your strtoll() works okay...
18457 $cat >try.c <<'EOCP'
18460 #define strtoll __strtoll
18463 #define strtoll _strtoll
18466 extern long long int strtoll(char *s, char **, int);
18467 static int bad = 0;
18468 int check(char *s, long long ell, int een) {
18471 gll = strtoll(s, 0, 10);
18472 if (!((gll == ell) && (errno == een)))
18476 check(" 1", 1LL, 0);
18477 check(" 0", 0LL, 0);
18478 check("-1", -1LL, 0);
18479 check("-9223372036854775808", -9223372036854775808LL, 0);
18480 check("-9223372036854775808", -9223372036854775808LL, 0);
18481 check(" 9223372036854775807", 9223372036854775807LL, 0);
18482 check("-9223372036854775808", -9223372036854775808LL, 0);
18483 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18484 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18490 if eval $compile; then
18493 ok) echo "Your strtoll() seems to be working okay." ;;
18495 Your strtoll() doesn't seem to be working okay.
18501 echo "(I can't seem to compile the test program--assuming it doesn't)"
18507 : see if strtoq exists
18508 set strtoq d_strtoq
18511 : see if strtoul exists
18512 set strtoul d_strtoul
18515 case "$d_strtoul" in
18518 Checking whether your strtoul() works okay...
18520 $cat >try.c <<'EOCP'
18523 extern unsigned long int strtoul(char *s, char **, int);
18524 static int bad = 0;
18525 void check(char *s, unsigned long eul, int een) {
18528 gul = strtoul(s, 0, 10);
18529 if (!((gul == eul) && (errno == een)))
18533 check(" 1", 1L, 0);
18534 check(" 0", 0L, 0);
18536 case "$longsize" in
18538 $cat >>try.c <<'EOCP'
18539 check("18446744073709551615", 18446744073709551615UL, 0);
18540 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18541 #if 0 /* strtoul() for /^-/ strings is undefined. */
18542 check("-1", 18446744073709551615UL, 0);
18543 check("-18446744073709551614", 2, 0);
18544 check("-18446744073709551615", 1, 0);
18545 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18546 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18551 $cat >>try.c <<'EOCP'
18552 check("4294967295", 4294967295UL, 0);
18553 check("4294967296", 4294967295UL, ERANGE);
18554 #if 0 /* strtoul() for /^-/ strings is undefined. */
18555 check("-1", 4294967295UL, 0);
18556 check("-4294967294", 2, 0);
18557 check("-4294967295", 1, 0);
18558 check("-4294967296", 4294967295UL, ERANGE);
18559 check("-4294967297", 4294967295UL, ERANGE);
18564 : Should we write these tests to be more portable by sprintf-ing
18565 : ~0 and then manipulating that char string as input for strtol?
18568 $cat >>try.c <<'EOCP'
18575 if eval $compile; then
18576 case "`$run ./try`" in
18577 ok) echo "Your strtoul() seems to be working okay." ;;
18579 Your strtoul() doesn't seem to be working okay.
18585 echo "(I can't seem to compile the test program--assuming it doesn't)"
18591 : see if strtoull exists
18592 set strtoull d_strtoull
18595 case "$d_longlong-$d_strtoull" in
18598 Checking whether your strtoull() works okay...
18600 $cat >try.c <<'EOCP'
18603 #define strtoull __strtoull
18606 extern unsigned long long int strtoull(char *s, char **, int);
18607 static int bad = 0;
18608 int check(char *s, long long eull, int een) {
18611 gull = strtoull(s, 0, 10);
18612 if (!((gull == eull) && (errno == een)))
18616 check(" 1", 1LL, 0);
18617 check(" 0", 0LL, 0);
18618 check("18446744073709551615", 18446744073709551615ULL, 0);
18619 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18620 #if 0 /* strtoull() for /^-/ strings is undefined. */
18621 check("-1", 18446744073709551615ULL, 0);
18622 check("-18446744073709551614", 2LL, 0);
18623 check("-18446744073709551615", 1LL, 0);
18624 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18625 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18632 if eval $compile; then
18633 case "`$run ./try`" in
18634 ok) echo "Your strtoull() seems to be working okay." ;;
18636 Your strtoull() doesn't seem to be working okay.
18638 d_strtoull="$undef"
18642 echo "(I can't seem to compile the test program--assuming it doesn't)"
18643 d_strtoull="$undef"
18648 : see if strtouq exists
18649 set strtouq d_strtouq
18652 case "$d_strtouq" in
18655 Checking whether your strtouq() works okay...
18657 $cat >try.c <<'EOCP'
18660 extern unsigned long long int strtouq(char *s, char **, int);
18661 static int bad = 0;
18662 void check(char *s, unsigned long long eull, int een) {
18663 unsigned long long gull;
18665 gull = strtouq(s, 0, 10);
18666 if (!((gull == eull) && (errno == een)))
18670 check(" 1", 1LL, 0);
18671 check(" 0", 0LL, 0);
18672 check("18446744073709551615", 18446744073709551615ULL, 0);
18673 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18674 #if 0 /* strtouq() for /^-/ strings is undefined. */
18675 check("-1", 18446744073709551615ULL, 0);
18676 check("-18446744073709551614", 2LL, 0);
18677 check("-18446744073709551615", 1LL, 0);
18678 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18679 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18687 if eval $compile; then
18688 case "`$run ./try`" in
18689 ok) echo "Your strtouq() seems to be working okay." ;;
18691 Your strtouq() doesn't seem to be working okay.
18697 echo "(I can't seem to compile the test program--assuming it doesn't)"
18703 : see if strxfrm exists
18704 set strxfrm d_strxfrm
18707 : see if symlink exists
18708 set symlink d_symlink
18711 : see if syscall exists
18712 set syscall d_syscall
18715 : see if prototype for syscall is available
18717 set d_syscallproto syscall $i_unistd unistd.h
18720 : see if sysconf exists
18721 set sysconf d_sysconf
18724 : see if system exists
18725 set system d_system
18728 : see if tcgetpgrp exists
18729 set tcgetpgrp d_tcgetpgrp
18732 : see if tcsetpgrp exists
18733 set tcsetpgrp d_tcsetpgrp
18736 : see if prototype for telldir is available
18738 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18741 : see if time exists
18743 if test "X$d_time" = X -o X"$timetype" = X; then
18744 if set time val -f d_time; eval $csym; $val; then
18745 echo 'time() found.' >&4
18747 rp="What is the type returned by time() on this system?"
18748 set time_t timetype long stdio.h sys/types.h
18751 echo 'time() not found, hope that will do.' >&4
18759 : see if timegm exists
18760 set timegm d_timegm
18763 : see if this is a sys/times.h system
18764 set sys/times.h i_systimes
18767 : see if times exists
18769 if set times val -f d_times; eval $csym; $val; then
18770 echo 'times() found.' >&4
18773 case "$i_systimes" in
18774 "$define") inc='sys/times.h';;
18776 rp="What is the type returned by times() on this system?"
18777 set clock_t clocktype long stdio.h sys/types.h $inc
18780 echo 'times() NOT found, hope that will do.' >&4
18785 : see if tmpnam_r exists
18786 set tmpnam_r d_tmpnam_r
18788 case "$d_tmpnam_r" in
18790 hdrs="$i_systypes sys/types.h define stdio.h "
18791 case "$d_tmpnam_r_proto:$usethreads" in
18792 ":define") d_tmpnam_r_proto=define
18793 set d_tmpnam_r_proto tmpnam_r $hdrs
18797 case "$d_tmpnam_r_proto" in
18799 case "$tmpnam_r_proto" in
18800 ''|0) try='char* tmpnam_r(char*);'
18801 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18803 case "$tmpnam_r_proto" in
18804 ''|0) d_tmpnam_r=undef
18806 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18807 * ) case "$tmpnam_r_proto" in
18808 REENTRANT_PROTO*) ;;
18809 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18811 echo "Prototype: $try" ;;
18814 *) case "$usethreads" in
18815 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18822 *) tmpnam_r_proto=0
18826 : see if truncate exists
18827 set truncate d_truncate
18830 : see if ttyname_r exists
18831 set ttyname_r d_ttyname_r
18833 case "$d_ttyname_r" in
18835 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18836 case "$d_ttyname_r_proto:$usethreads" in
18837 ":define") d_ttyname_r_proto=define
18838 set d_ttyname_r_proto ttyname_r $hdrs
18842 case "$d_ttyname_r_proto" in
18844 case "$ttyname_r_proto" in
18845 ''|0) try='int ttyname_r(int, char*, size_t);'
18846 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18848 case "$ttyname_r_proto" in
18849 ''|0) try='int ttyname_r(int, char*, int);'
18850 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18852 case "$ttyname_r_proto" in
18853 ''|0) try='char* ttyname_r(int, char*, int);'
18854 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18856 case "$ttyname_r_proto" in
18857 ''|0) d_ttyname_r=undef
18859 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18860 * ) case "$ttyname_r_proto" in
18861 REENTRANT_PROTO*) ;;
18862 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18864 echo "Prototype: $try" ;;
18867 *) case "$usethreads" in
18868 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18875 *) ttyname_r_proto=0
18879 : see if tzname[] exists
18881 if set tzname val -a d_tzname; eval $csym; $val; then
18883 echo 'tzname[] found.' >&4
18886 echo 'tzname[] NOT found.' >&4
18891 : Check if is a multiplatform env
18893 next|darwin) multiarch="$define" ;;
18895 case "$multiarch" in
18896 ''|[nN]*) multiarch="$undef" ;;
18899 : check for ordering of bytes in a UV
18901 case "$multiarch" in
18904 You seem to be doing a multiarchitecture build,
18905 skipping the byteorder check.
18911 case "$byteorder" in
18914 In the following, larger digits indicate more significance. A big-endian
18915 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18916 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18917 machines may have weird orders like 3412. A Cray will report 87654321,
18918 an Alpha will report 12345678. If the test program works the default is
18920 I'm now running the test program...
18924 #$i_stdlib I_STDLIB
18926 #include <stdlib.h>
18928 #include <sys/types.h>
18929 typedef $uvtype UV;
18939 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18941 u.l = (UV)0x04030201;
18942 for (i = 0; i < $uvsize; i++)
18943 printf("%c", u.c[i]+'0');
18950 if eval $compile && $run ./try > /dev/null; then
18953 [1-4][1-4][1-4][1-4]|12345678|87654321)
18954 echo "(The test program ran ok.)"
18955 echo "byteorder=$dflt"
18958 ????|????????) echo "(The test program ran ok.)" ;;
18959 *) echo "(The test program didn't run right for some reason.)" ;;
18964 (I can't seem to compile the test program. Guessing big-endian...)
18967 case "$xxx_prompt" in
18969 rp="What is the order of bytes in $uvtype?"
18982 : Checking 32bit alignedness
18985 Checking to see whether you can access character data unalignedly...
18987 case "$d_u32align" in
18988 '') $cat >try.c <<EOCP
18990 #$i_stdlib I_STDLIB
18992 #include <stdlib.h>
18994 #define U32 $u32type
18995 #define BYTEORDER 0x$byteorder
18997 #include <signal.h>
18999 $signal_t bletch(int s) { exit(4); }
19002 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19003 volatile U8 buf[8];
19007 if (sizeof(U32) != 4) {
19008 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19015 signal(SIGBUS, bletch);
19027 for (i = 0; i < 4; i++) {
19028 up = (U32*)(buf + i);
19029 if (! ((*up == 1 << (8*i)) || /* big-endian */
19030 (*up == 1 << (8*(3-i))) /* little-endian */
19034 printf("read failed (%x)\n", *up);
19040 for (i = 0; i < 4; i++) {
19041 up = (U32*)(buf + i);
19043 if (*up != 0xBeef) {
19044 printf("write failed (%x)\n", *up);
19058 if eval $compile_ok; then
19059 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19060 $run ./try 2>&1 >/dev/null
19063 You can access character data pretty unalignedly.
19065 d_u32align="$undef"
19068 It seems that you must access character data in an aligned manner.
19070 d_u32align="$define"
19074 rp='Can you access character data at unaligned addresses?'
19078 [yY]*) d_u32align="$undef" ;;
19079 *) d_u32align="$define" ;;
19086 : see if ualarm exists
19087 set ualarm d_ualarm
19090 : see if umask exists
19094 : see if unordered exists
19095 set unordered d_unordered
19098 : see if unsetenv exists
19099 set unsetenv d_unsetenv
19102 : see if usleep exists
19103 set usleep d_usleep
19106 : see if prototype for usleep is available
19108 set d_usleepproto usleep $i_unistd unistd.h
19111 : see if ustat exists
19115 : see if closedir exists
19116 set closedir d_closedir
19119 case "$d_closedir" in
19122 echo "Checking whether closedir() returns a status..." >&4
19124 #$i_dirent I_DIRENT /**/
19125 #$i_sysdir I_SYS_DIR /**/
19126 #$i_sysndir I_SYS_NDIR /**/
19127 #$i_systypes I_SYS_TYPES /**/
19129 #if defined(I_SYS_TYPES)
19130 #include <sys/types.h>
19132 #if defined(I_DIRENT)
19133 #include <dirent.h>
19134 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19135 #include <sys/dir.h>
19139 #include <sys/ndir.h>
19143 #include <ndir.h> /* may be wrong in the future */
19145 #include <sys/dir.h>
19150 int main() { return closedir(opendir(".")); }
19153 if eval $compile_ok; then
19154 if $run ./try > /dev/null 2>&1 ; then
19155 echo "Yes, it does."
19158 echo "No, it doesn't."
19162 echo "(I can't seem to compile the test program--assuming it doesn't)"
19170 set d_void_closedir
19174 : see if there is a wait4
19178 : see if waitpid exists
19179 set waitpid d_waitpid
19182 : see if wcstombs exists
19183 set wcstombs d_wcstombs
19186 : see if wctomb exists
19187 set wctomb d_wctomb
19190 : see if writev exists
19191 set writev d_writev
19194 : preserve RCS keywords in files with variable substitution, grrr
19199 Revision='$Revision'
19201 : check for alignment requirements
19203 case "$alignbytes" in
19204 '') echo "Checking alignment constraints..." >&4
19205 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19206 $cat >try.c <<'EOCP'
19207 typedef long double NV;
19210 $cat >try.c <<'EOCP'
19214 $cat >>try.c <<'EOCP'
19222 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19227 if eval $compile_ok; then
19231 echo "(I can't seem to compile the test program...)"
19233 case "$multiarch" in
19235 : The usual safe value is 8, but Darwin with -Duselongdouble
19236 : needs 16. Hence, we will take 8 as a minimum, but allow
19237 : Configure to pick a larger value if needed.
19238 if $test "$dflt" -lt 8; then
19240 echo "Setting alignment to 8 for multiarch support.">&4
19245 *) dflt="$alignbytes"
19248 rp="Doubles must be aligned on a how-many-byte boundary?"
19253 : set the base revision
19256 : Determine if this is an EBCDIC system
19258 echo "Determining whether or not we are on an EBCDIC system..." >&4
19259 $cat >try.c <<'EOM'
19262 if ('M'==0xd4) return 0;
19267 case "$BOOTSTRAP_CHARSET" in
19268 Y|y|define) bootstrap_charset=$define ;;
19269 *) bootstrap_charset=$undef ;;
19274 if eval $compile_ok; then
19275 if $run ./try; then
19276 echo "You seem to speak EBCDIC." >&4
19279 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19282 echo "I'm unable to compile the test program." >&4
19283 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19289 : length of character in bytes. Is always 1, otherwise it is not C
19290 : This used to be a test using sizeof
19293 : Check for the number of bits in a character
19294 case "$charbits" in
19295 '') echo "Checking how long a character is (in bits)..." >&4
19302 for (c = 1, n = 0; c; c <<= 1, n++) ;
19303 printf ("%d\n", n);
19308 if eval $compile_ok; then
19312 echo "(I can't seem to compile the test program. Guessing...)"
19319 rp="What is the length of a character (in bits)?"
19323 case "$charbits" in
19326 Your system has an unsigned character size of $charbits bits, which
19327 is rather unusual (normally it is 8 bits). Perl likely will not work
19328 correctly on your system, with subtle bugs in various places.
19330 rp='Do you really want to continue?'
19334 [yY]) echo >&4 "Okay, continuing." ;;
19339 : how do we concatenate cpp tokens here?
19341 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19342 $cat >cpp_stuff.c <<'EOCP'
19343 #define RCAT(a,b)a/**/b
19344 #define ACAT(a,b)a ## b
19348 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19349 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19350 echo "Oh! Smells like ANSI's been here." >&4
19351 echo "We can catify or stringify, separately or together!"
19353 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19354 echo "Ah, yes! The good old days!" >&4
19355 echo "However, in the good old days we don't know how to stringify and"
19356 echo "catify at the same time."
19360 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19361 You're going to have to edit the values of CAT[2-5] in config.h...
19363 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19367 : see if this is a db.h system
19373 : Check db version.
19375 echo "Checking Berkeley DB version ..." >&4
19381 #include <sys/types.h>
19383 #$i_stdlib I_STDLIB
19385 #include <stdlib.h>
19388 int main(int argc, char *argv[])
19390 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19391 int Major, Minor, Patch ;
19392 unsigned long Version ;
19393 (void)db_version(&Major, &Minor, &Patch) ;
19395 printf("%d %d %d %d %d %d\n",
19396 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19397 Major, Minor, Patch);
19400 printf("You have Berkeley DB Version 2 or greater.\n");
19402 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19403 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19404 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19405 Major, Minor, Patch) ;
19407 /* check that db.h & libdb are compatible */
19408 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19409 printf("db.h and libdb are incompatible.\n") ;
19413 printf("db.h and libdb are compatible.\n") ;
19415 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19416 + DB_VERSION_PATCH ;
19418 /* needs to be >= 2.3.4 */
19419 if (Version < 2003004) {
19420 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19421 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19427 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19432 printf("You have Berkeley DB Version 1.\n");
19433 exit(0); /* DB version < 2: the coast is clear. */
19435 exit(1); /* <db.h> not Berkeley DB? */
19441 if eval $compile_ok && $run ./try; then
19442 echo 'Looks OK.' >&4
19444 db_version_major=$1
19445 db_version_minor=$2
19446 db_version_patch=$3
19448 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19452 : Remove db from list of libraries to use
19453 echo "Removing unusable -ldb from library list" >&4
19454 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19457 echo "libs = $libs" >&4
19467 : Check the return type needed for hash
19469 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19475 #include <sys/types.h>
19478 #ifndef DB_VERSION_MAJOR
19479 u_int32_t hash_cb (ptr, size)
19487 info.hash = hash_cb;
19491 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19492 if $contains warning try.out >>/dev/null 2>&1 ; then
19495 db_hashtype='u_int32_t'
19498 : XXX Maybe we should just give up here.
19499 db_hashtype=u_int32_t
19501 echo "Help: I can't seem to compile the db test program." >&4
19502 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19505 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19507 *) db_hashtype=u_int32_t
19512 : Check the return type needed for prefix
19514 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19520 #include <sys/types.h>
19523 #ifndef DB_VERSION_MAJOR
19524 size_t prefix_cb (key1, key2)
19532 info.prefix = prefix_cb;
19536 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19537 if $contains warning try.out >>/dev/null 2>&1 ; then
19538 db_prefixtype='int'
19540 db_prefixtype='size_t'
19543 db_prefixtype='size_t'
19544 : XXX Maybe we should just give up here.
19546 echo "Help: I can't seem to compile the db test program." >&4
19547 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19550 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19552 *) db_prefixtype='size_t'
19556 : How can we generate normalized random numbers ?
19558 echo "Using our internal random number implementation..." >&4
19561 *-Dmy_rand=*|*-Dmy_srand=*)
19562 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19563 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19564 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19565 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19569 randfunc=Perl_drand48
19570 drand01="Perl_drand48()"
19571 seedfunc="Perl_drand48_init"
19575 : Check how to flush
19578 Checking how to flush all pending stdio output...
19580 # I only know how to find the first 32 possibly open files on SunOS.
19581 # See also hints/sunos_4_1.sh and util.c --AD
19583 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19585 $cat >>try.c <<EOCP
19587 #$i_stdlib I_STDLIB
19589 #include <stdlib.h>
19591 #$i_unistd I_UNISTD
19593 # include <unistd.h>
19595 #$d_sysconf HAS_SYSCONF
19596 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19597 #ifdef HAS_STDIO_STREAM_ARRAY
19598 # define STDIO_STREAM_ARRAY $stdio_stream_array
19603 p = fopen("try.out", "w");
19607 # ifdef TRY_FPRINTF
19611 #ifdef TRY_FFLUSH_NULL
19614 #ifdef TRY_FFLUSH_ALL
19616 long open_max = -1;
19617 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19618 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19620 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19621 open_max = sysconf(_SC_OPEN_MAX);
19624 open_max = FOPEN_MAX;
19627 open_max = OPEN_MAX;
19636 # ifdef HAS_STDIO_STREAM_ARRAY
19637 if (open_max > 0) {
19639 for (i = 0; i < open_max; i++)
19640 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19641 STDIO_STREAM_ARRAY[i]._file < open_max &&
19642 STDIO_STREAM_ARRAY[i]._flag)
19643 fflush(&STDIO_STREAM_ARRAY[i]);
19651 : first we have to find out how _not_ to flush
19653 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19655 set try -DTRY_FPUTC
19656 if eval $compile; then
19657 $run ./try 2>/dev/null
19660 if $test ! -s try.out -a "X$code" = X42; then
19666 set try -DTRY_FPRINTF
19667 if eval $compile; then
19668 $run ./try 2>/dev/null
19671 if $test ! -s try.out -a "X$code" = X42; then
19672 output=-DTRY_FPRINTF
19678 : check for fflush NULL behavior
19679 case "$fflushNULL" in
19680 '') set try -DTRY_FFLUSH_NULL $output
19681 if eval $compile; then
19682 $run ./try 2>/dev/null
19685 if $test -s try.out -a "X$code" = X42; then
19686 fflushNULL="`$cat try.out`"
19688 if $test "X$code" != X42; then
19690 (If this test failed, don't worry, we'll try another method shortly.)
19695 $rm -f core try.core core.try.*
19696 case "$fflushNULL" in
19698 Your fflush(NULL) works okay for output streams.
19699 Let's see if it clobbers input pipes...
19701 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19702 # bug that improperly flushes the input end of pipes. So we avoid the
19703 # autoflush on fork/system/exec support for now. :-(
19704 $cat >tryp.c <<EOCP
19707 main(int argc, char **argv)
19713 while ((i = getc(stdin)) != -1
19714 && (*bp++ = i) != '\n'
19715 && bp < &buf[1024])
19718 fprintf(stdout, "%s", buf);
19726 fflushNULL="$define"
19728 if eval $compile; then
19730 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19731 if $test "X$targethost" != X; then
19734 $run "cat tryp.c | ./tryp" 2>/dev/null > tryp.out
19736 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19738 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19740 fflush(NULL) seems to behave okay with input streams.
19742 fflushNULL="$define"
19745 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19747 fflushNULL="$undef"
19750 $rm -f core tryp.c tryp.core core.tryp.*
19753 Your fflush(NULL) isn't working (contrary to ANSI C).
19755 fflushNULL="$undef"
19758 Cannot figure out whether your fflush(NULL) works or not.
19759 I'm assuming it doesn't (contrary to ANSI C).
19761 fflushNULL="$undef"
19765 $define|true|[yY]*)
19766 fflushNULL="$define"
19769 fflushNULL="$undef"
19772 : check explicit looping only if NULL did not work, and if the pipe
19773 : bug does not show up on an explicit flush too
19774 case "$fflushNULL" in
19776 $cat >tryp.c <<EOCP
19779 main(int argc, char **argv)
19785 while ((i = getc(stdin)) != -1
19786 && (*bp++ = i) != '\n'
19787 && bp < &buf[1024])
19790 fprintf(stdout, "%s", buf);
19799 if eval $compile; then
19801 if $test "X$targethost" != X; then
19804 $run "cat tryp.c | ./tryp" 2>/dev/null > tryp.out
19806 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19808 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19810 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19812 : now check for fflushall behaviour
19813 case "$fflushall" in
19814 '') set try -DTRY_FFLUSH_ALL $output
19815 if eval $compile; then
19817 (Now testing the other method--but note that this also may fail.)
19819 $run ./try 2>/dev/null
19822 if $test -s try.out -a "X$code" = X42; then
19823 fflushall="`$cat try.out`"
19827 case "$fflushall" in
19829 Whew. Flushing explicitly all the stdio streams works.
19831 fflushall="$define"
19834 Sigh. Flushing explicitly all the stdio streams doesn't work.
19839 Cannot figure out whether flushing stdio streams explicitly works or not.
19840 I'm assuming it doesn't.
19846 "$define"|true|[yY]*)
19847 fflushall="$define"
19855 All is futile. Even fflush(stdin) clobbers input pipes!
19862 $rm -f core tryp.c tryp.core core.tryp.*
19864 *) fflushall="$undef"
19868 case "$fflushNULL$fflushall" in
19871 OK, I give up. I cannot figure out how to flush pending stdio output.
19872 We won't be flushing handles at all before fork/exec/popen.
19878 : Store the full pathname to the ar program for use in the C program
19879 : Respect a hint or command line value for full_ar.
19884 : Store the full pathname to the sed program for use in the C program
19887 : see what type gids are declared as in the kernel
19889 echo "Looking for the type for group ids returned by getgid()."
19890 set gid_t gidtype xxx stdio.h sys/types.h
19894 xxx=`./findhdr sys/user.h`
19895 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19897 unsigned) dflt="$1 $2" ;;
19901 *) dflt="$gidtype";;
19904 gid_t) echo "gid_t found." ;;
19905 *) rp="What is the type for group ids returned by getgid()?"
19911 : Check the size of GID
19914 *_t) zzz="$gidtype" ;;
19917 echo "Checking the size of $zzz..." >&4
19919 #include <sys/types.h>
19921 #$i_stdlib I_STDLIB
19923 #include <stdlib.h>
19926 printf("%d\n", (int)sizeof($gidtype));
19931 if eval $compile_ok; then
19935 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19938 echo "Your $zzz is $gidsize bytes long."
19943 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19947 : Check if GID is signed
19950 *_t) zzz="$gidtype" ;;
19953 echo "Checking the sign of $zzz..." >&4
19955 #include <sys/types.h>
19966 if eval $compile; then
19970 echo "(I can't execute the test program--guessing unsigned.)" >&4
19974 1) echo "Your $zzz is unsigned." ;;
19975 -1) echo "Your $zzz is signed." ;;
19981 echo "(I can't compile the test program--guessing unsigned.)" >&4
19985 : Check 64bit sizes
19988 if $test X"$quadtype" != X; then
19990 echo "Checking how to print 64-bit integers..." >&4
19992 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19993 $cat >try.c <<'EOCP'
19994 #include <sys/types.h>
19997 int q = 12345678901;
19998 printf("%ld\n", q);
20002 if eval $compile; then
20006 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20007 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20008 echo "We will use %d."
20014 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20015 $cat >try.c <<'EOCP'
20016 #include <sys/types.h>
20019 long q = 12345678901;
20020 printf("%ld\n", q);
20024 if eval $compile; then
20028 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20029 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20030 echo "We will use %ld."
20036 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20037 $cat >try.c <<'EOCP'
20038 #include <sys/types.h>
20039 #include <inttypes.h>
20042 int64_t q = 12345678901;
20043 printf("%" PRId64 "\n", q);
20047 if eval $compile; then
20051 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20052 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20053 echo "We will use the C9X style."
20059 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20061 #include <sys/types.h>
20064 $quadtype q = 12345678901;
20065 printf("%Ld\n", q);
20069 if eval $compile; then
20073 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20074 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20075 echo "We will use %Ld."
20081 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20082 $cat >try.c <<'EOCP'
20083 #include <sys/types.h>
20086 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20087 printf("%lld\n", q);
20091 if eval $compile; then
20095 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20096 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20097 echo "We will use the %lld style."
20103 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20105 #include <sys/types.h>
20108 $quadtype q = 12345678901;
20109 printf("%qd\n", q);
20113 if eval $compile; then
20117 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20118 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20119 echo "We will use %qd."
20125 if $test X"$sPRId64" = X; then
20126 echo "Cannot figure out how to print 64-bit integers." >&4
20133 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20134 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20136 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20137 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20141 : Check format strings for internal types
20143 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20145 if $test X"$ivsize" = X8; then
20146 ivdformat="$sPRId64"
20147 uvuformat="$sPRIu64"
20148 uvoformat="$sPRIo64"
20149 uvxformat="$sPRIx64"
20150 uvXUformat="$sPRIXU64"
20152 if $test X"$ivsize" = X"$longsize"; then
20159 if $test X"$ivsize" = X"$intsize"; then
20167 if $test X"$ivsize" = X"$shortsize"; then
20178 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20179 nveformat="$sPRIeldbl"
20180 nvfformat="$sPRIfldbl"
20181 nvgformat="$sPRIgldbl"
20182 nvEUformat="$sPRIEUldbl"
20183 nvFUformat="$sPRIFUldbl"
20184 nvGUformat="$sPRIGUldbl"
20194 case "$ivdformat" in
20195 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20200 : Check format string for GID
20203 $echo "Checking the format string to be used for gids..." >&4
20206 -1) if $test X"$gidsize" = X"$ivsize"; then
20207 gidformat="$ivdformat"
20209 if $test X"$gidsize" = X"$longsize"; then
20212 if $test X"$gidsize" = X"$intsize"; then
20215 if $test X"$gidsize" = X"$shortsize"; then
20222 *) if $test X"$gidsize" = X"$uvsize"; then
20223 gidformat="$uvuformat"
20225 if $test X"$gidsize" = X"$longsize"; then
20228 if $test X"$gidsize" = X"$intsize"; then
20231 if $test X"$gidsize" = X"$shortsize"; then
20240 : see if getgroups exists
20241 set getgroups d_getgrps
20244 : see if setgroups exists
20245 set setgroups d_setgrps
20248 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20250 case "$d_getgrps$d_setgrps" in
20252 case "$groupstype" in
20253 '') dflt="$gidtype" ;;
20254 *) dflt="$groupstype" ;;
20257 What type of pointer is the second argument to getgroups() and setgroups()?
20258 Usually this is the same as group ids, $gidtype, but not always.
20261 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20265 *) groupstype="$gidtype";;
20268 : MAD = Misc Attribute Definition
20270 if $test $patchlevel -lt 9; then
20271 : MAD is not available in 5.8.x or earlier.
20275 $define|true|[yY]*) dflt='y' ;;
20280 Would you like to build with Misc Attribute Decoration? This is development
20281 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20282 overhead on the interpreter.
20284 If this doesn't make any sense to you, just accept the default '$dflt'.
20286 rp='Build Perl with MAD?'
20291 madlyh='madly.h madly.act madly.tab'
20293 madlyobj="madly$_o" ;;
20302 : check whether make sets MAKE
20304 echo "Checking if your $make program sets \$(MAKE)..." >&4
20305 case "$make_set_make" in
20307 $sed 's/^X //' > testmake.mak << 'EOF'
20309 X @echo 'maketemp="$(MAKE)"'
20311 case "`$make -f testmake.mak 2>/dev/null`" in
20312 *maketemp=*) make_set_make='#' ;;
20313 *) make_set_make="MAKE=$make" ;;
20315 $rm -f testmake.mak
20318 case "$make_set_make" in
20319 '#') echo "Yup, it does.";;
20320 *) echo "Nope, it doesn't.";;
20323 : see what type is used for mode_t
20324 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20325 set mode_t modetype int stdio.h sys/types.h
20328 : see if we need va_copy
20330 case "$i_stdarg" in
20333 #include <stdarg.h>
20335 #$i_stdlib I_STDLIB
20337 #include <stdlib.h>
20339 #include <signal.h>
20342 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20344 return vfprintf(f, fmt, *valp);
20348 myvfprintf(FILE *f, const char *fmt, va_list val)
20350 return ivfprintf(f, fmt, &val);
20354 myprintf(char *fmt, ...)
20357 va_start(val, fmt);
20358 return myvfprintf(stdout, fmt, val);
20362 main(int ac, char **av)
20364 signal(SIGSEGV, exit);
20366 myprintf("%s%cs all right, then\n", "that", '\'');
20371 if eval $compile && $run ./try 2>&1 >/dev/null; then
20372 case "`$run ./try`" in
20373 "that's all right, then")
20379 yes) echo "It seems that you don't need va_copy()." >&4
20380 need_va_copy="$undef"
20382 *) echo "It seems that va_copy() or similar will be needed." >&4
20383 need_va_copy="$define"
20388 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20389 need_va_copy="$undef"
20393 : see what type is used for size_t
20394 rp="What is the type used for the length parameter for string functions?"
20395 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20398 : check for type of arguments to gethostbyaddr.
20399 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20400 case "$d_gethbyaddr" in
20404 Checking to see what type of arguments are accepted by gethostbyaddr().
20406 hdrs="$define sys/types.h
20407 $d_socket sys/socket.h
20408 $i_niin netinet/in.h
20410 $i_unistd unistd.h"
20411 : The first arg can 'char *' or 'void *'
20412 : The second arg is some of integral type
20413 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20414 for yyy in size_t long int; do
20415 case "$netdb_host_type" in
20416 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20417 if ./protochk "$try" $hdrs; then
20418 echo "Your system accepts $xxx for the first arg."
20419 echo "...and $yyy for the second arg."
20420 netdb_host_type="$xxx"
20421 netdb_hlen_type="$yyy"
20427 : In case none of those worked, prompt the user.
20428 case "$netdb_host_type" in
20429 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20432 netdb_host_type=$ans
20433 rp='What is the type for the 2nd argument to gethostbyaddr?'
20436 netdb_hlen_type=$ans
20440 *) : no gethostbyaddr, so pick harmless defaults
20441 netdb_host_type='char *'
20442 netdb_hlen_type="$sizetype"
20445 # Remove the "const" if needed. -- but then we'll have a
20447 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20450 : check for type of argument to gethostbyname.
20451 if test "X$netdb_name_type" = X ; then
20452 case "$d_gethbyname" in
20456 Checking to see what type of argument is accepted by gethostbyname().
20458 hdrs="$define sys/types.h
20459 $d_socket sys/socket.h
20460 $i_niin netinet/in.h
20462 $i_unistd unistd.h"
20463 for xxx in "const char *" "char *"; do
20464 case "$netdb_name_type" in
20465 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20466 if ./protochk "$try" $hdrs; then
20467 echo "Your system accepts $xxx."
20468 netdb_name_type="$xxx"
20473 : In case none of those worked, prompt the user.
20474 case "$netdb_name_type" in
20475 '') rp='What is the type for the 1st argument to gethostbyname?'
20478 netdb_name_type=$ans
20482 *) : no gethostbyname, so pick harmless default
20483 netdb_name_type='char *'
20488 : check for type of 1st argument to getnetbyaddr.
20489 if test "X$netdb_net_type" = X ; then
20490 case "$d_getnbyaddr" in
20494 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20496 hdrs="$define sys/types.h
20497 $d_socket sys/socket.h
20498 $i_niin netinet/in.h
20500 $i_unistd unistd.h"
20501 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20502 case "$netdb_net_type" in
20503 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20504 if ./protochk "$try" $hdrs; then
20505 echo "Your system accepts $xxx."
20506 netdb_net_type="$xxx"
20511 : In case none of those worked, prompt the user.
20512 case "$netdb_net_type" in
20513 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20516 netdb_net_type=$ans
20520 *) : no getnetbyaddr, so pick harmless default
20521 netdb_net_type='long'
20525 : locate the preferred pager for this system
20532 [a-zA-Z]:/*) dflt=$pg;;
20536 [a-zA-Z]:/*) dflt=$more;;
20540 [a-zA-Z]:/*) dflt=$less;;
20543 '') dflt=/usr/ucb/more;;
20551 rp='What pager is used on your system?'
20555 : see what type pids are declared as in the kernel
20556 rp="What is the type of process ids on this system?"
20557 set pid_t pidtype int stdio.h sys/types.h
20560 : see if ar generates random libraries by itself
20562 echo "Checking how to generate random libraries on your machine..." >&4
20563 echo 'int bar1() { return bar2(); }' > bar1.c
20564 echo 'int bar2() { return 2; }' > bar2.c
20566 #$i_stdlib I_STDLIB
20568 #include <stdlib.h>
20570 int main() { printf("%d\n", bar1()); exit(0); }
20572 $cc $ccflags -c bar1.c >/dev/null 2>&1
20573 $cc $ccflags -c bar2.c >/dev/null 2>&1
20574 $cc $ccflags -c foo.c >/dev/null 2>&1
20575 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20576 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20577 $run ./foobar >/dev/null 2>&1; then
20578 echo "$ar appears to generate random libraries itself."
20580 if [ "X$ranlib" = "X" ]; then
20583 elif $ar s bar$_a >/dev/null 2>&1 &&
20584 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20585 $run ./foobar >/dev/null 2>&1; then
20586 echo "a table of contents needs to be added with '$ar s'."
20589 elif $ar ts bar$_a >/dev/null 2>&1 &&
20590 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20591 $run ./foobar >/dev/null 2>&1; then
20592 echo "a table of contents needs to be added with '$ar ts'."
20599 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20600 $test -f $ranlib || ranlib=''
20603 if $test -n "$ranlib"; then
20604 echo "your system has '$ranlib'; we'll use that."
20607 echo "your system doesn't seem to support random libraries"
20608 echo "so we'll use lorder and tsort to order the libraries."
20615 : see if this is a values.h system
20616 set values.h i_values
20619 : Check the max offset that gmtime and localtime accept
20620 echo "Checking max offsets that gmtime () accepts"
20623 define) yyy="#include <values.h>" ;;
20627 case "$sGMTIME_min/$sGMTIME_max" in
20630 #include <sys/types.h>
20639 void gm_check (time_t t, int min_year, int max_year)
20642 if ( tmp == NULL ||
20643 /* Check tm_year overflow */
20644 tmp->tm_year < min_year || tmp->tm_year > max_year)
20655 gm_check (MAXLONG, 69, 0x7fffffff);
20657 if (tmp == NULL || tmp->tm_year < 0) {
20658 for (i = 63; i >= 0; i--) {
20659 time_t x = pt | ((time_t)1 << i);
20660 if (x < 0 || x < pt) continue;
20661 gm_check (x, 69, 0x7fffffff);
20664 printf ("sGMTIME_max=%ld\n", pt);
20673 gm_check (MINLONG, -1900, 70);
20676 for (i = 36; i >= 0; i--) {
20677 time_t x = pt - ((time_t)1 << i);
20678 if (x > 0) continue;
20679 gm_check (x, -1900, 70);
20682 printf ("sGMTIME_min=%ld\n", pt);
20686 int main (int argc, char *argv[])
20688 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20695 if eval $compile; then
20698 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20704 echo "Checking max offsets that localtime () accepts"
20706 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20709 #include <sys/types.h>
20718 void local_check (time_t t, int min_year, int max_year)
20720 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20723 tmp = localtime (&t);
20724 if ( tmp == NULL ||
20725 /* Check tm_year overflow */
20726 tmp->tm_year < min_year || tmp->tm_year > max_year)
20730 } /* local_check */
20737 local_check (MAXLONG, 69, 0x7fffffff);
20739 if (tmp == NULL || tmp->tm_year < 0) {
20740 for (i = 63; i >= 0; i--) {
20741 time_t x = pt | ((time_t)1 << i);
20742 if (x < 0 || x < pt) continue;
20743 local_check (x, 69, 0x7fffffff);
20746 printf ("sLOCALTIME_max=%ld\n", pt);
20755 local_check (MINLONG, -1900, 70);
20758 for (i = 36; i >= 0; i--) {
20759 time_t x = pt - ((time_t)1 << i);
20760 if (x > 0) continue;
20761 local_check (x, -1900, 70);
20764 printf ("sLOCALTIME_min=%ld\n", pt);
20768 int main (int argc, char *argv[])
20776 if eval $compile; then
20779 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20785 : check for type of arguments to select.
20786 case "$selecttype" in
20787 '') case "$d_select" in
20791 Checking to see what type of arguments are accepted by select().
20793 hdrs="$define sys/types.h
20794 $i_systime sys/time.h
20795 $i_sysselct sys/select.h
20796 $d_socket sys/socket.h"
20797 : The first arg can be int, unsigned, or size_t
20798 : The last arg may or may not be 'const'
20800 : void pointer has been seen but using that
20801 : breaks the selectminbits test
20802 for xxx in 'fd_set *' 'int *'; do
20803 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20804 for tmo in 'struct timeval *' 'const struct timeval *'; do
20806 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20807 if ./protochk "$try" $hdrs; then
20808 echo "Your system accepts $xxx."
20817 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20818 case "$d_fd_set" in
20819 $define) dflt="fd_set *" ;;
20828 *) : no select, so pick a harmless default
20835 : check for the select 'width'
20836 case "$selectminbits" in
20837 '') safebits=`expr $ptrsize \* 8`
20838 case "$d_select" in
20842 Checking to see on how many bits at a time your select() operates...
20845 #include <sys/types.h>
20847 #$i_systime I_SYS_TIME
20848 #$i_systimek I_SYS_TIME_KERNEL
20853 # ifdef I_SYS_TIME_KERNEL
20856 # include <sys/time.h>
20857 # ifdef I_SYS_TIME_KERNEL
20861 #$i_sysselct I_SYS_SELECT
20862 #ifdef I_SYS_SELECT
20863 #include <sys/select.h>
20865 #$d_socket HAS_SOCKET
20867 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20870 #$i_stdlib I_STDLIB
20872 #include <stdlib.h>
20875 #define S sizeof(*(b))
20877 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20878 #define NBITS (NBYTES * 8)
20880 char *s = (char *)malloc(NBYTES);
20889 fp = fopen("try.c", "r");
20895 b = ($selecttype)s;
20896 for (i = 0; i < NBITS; i++)
20900 select(fd + 1, b, 0, 0, &t);
20901 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20903 printf("%d\n", i + 1);
20908 if eval $compile_ok; then
20909 selectminbits=`$run ./try`
20910 case "$selectminbits" in
20912 Cannot figure out on how many bits at a time your select() operates.
20913 I'll play safe and guess it is $safebits bits.
20915 selectminbits=$safebits
20916 bits="$safebits bits"
20919 *) bits="$selectminbits bits" ;;
20921 echo "Your select() operates on $bits at a time." >&4
20923 rp='What is the minimum number of bits your select() operates on?'
20924 case "$byteorder" in
20925 12345678) dflt=64 ;;
20931 selectminbits="$val"
20935 *) : no select, so pick a harmless default
20936 selectminbits=$safebits
20942 : Trace out the files included by signal.h, then look for SIGxxx names.
20943 if [ "X$fieldn" = X ]; then
20944 : Just make some guesses. We check them later.
20945 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
20947 xxx=`echo '#include <signal.h>' |
20948 $cppstdin $cppminus $cppflags 2>/dev/null |
20949 $grep '^[ ]*#.*include' |
20950 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20951 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20954 for xx in $xxx /dev/null ; do
20955 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20957 case "$xxxfiles" in
20958 '') xxxfiles=`./findhdr signal.h` ;;
20961 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20962 print substr($2, 4, 20)
20964 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20965 print substr($3, 4, 20)
20967 : Append some common names just in case the awk scan failed.
20968 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20969 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20970 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20971 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20972 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20974 : generate a few handy files for later
20975 $cat > signal.c <<EOCP
20976 #include <sys/types.h>
20977 #include <signal.h>
20978 #$i_stdlib I_STDLIB
20980 #include <stdlib.h>
20985 /* Strange style to avoid deeply-nested #if/#else/#endif */
20988 # define NSIG (_NSIG)
20994 # define NSIG (SIGMAX+1)
21000 # define NSIG (SIG_MAX+1)
21006 # define NSIG (_SIG_MAX+1)
21012 # define NSIG (MAXSIG+1)
21018 # define NSIG (MAX_SIG+1)
21023 # ifdef SIGARRAYSIZE
21024 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21030 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21034 /* Default to some arbitrary number that's big enough to get most
21035 of the common signals.
21041 printf("NSIG %d\n", NSIG);
21047 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21049 printf "#ifdef SIG"; printf $1; printf "\n"
21050 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21051 printf $1; printf ");\n"
21055 printf "#endif /* JUST_NSIG */\n";
21056 printf "exit(0);\n}\n";
21059 $cat >signal.awk <<'EOP'
21060 BEGIN { ndups = 0 }
21061 $1 ~ /^NSIG$/ { nsig = $2 }
21062 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21063 if ($2 > maxsig) { maxsig = $2 }
21064 if (sig_name[$2]) {
21065 dup_name[ndups] = $1
21066 dup_num[ndups] = $2
21078 printf("NSIG %d\n", nsig);
21079 for (n = 1; n < nsig; n++) {
21081 printf("%s %d\n", sig_name[n], sig_num[n])
21084 printf("NUM%d %d\n", n, n)
21087 for (n = 0; n < ndups; n++) {
21088 printf("%s %d\n", dup_name[n], dup_num[n])
21092 $cat >signal_cmd <<EOS
21094 if $test -s signal.lst; then
21095 echo "Using your existing signal.lst file"
21100 $cat >>signal_cmd <<'EOS'
21103 if eval $compile_ok; then
21104 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21105 $uniq | $awk -f signal.awk >signal.lst
21107 echo "(I can't seem be able to compile the whole test program)" >&4
21108 echo "(I'll try it in little pieces.)" >&4
21109 set signal -DJUST_NSIG
21110 if eval $compile_ok; then
21111 $run ./signal$_exe > signal.nsg
21114 echo "I can't seem to figure out how many signals you have." >&4
21115 echo "Guessing 50." >&4
21116 echo 'NSIG 50' > signal.nsg
21118 : Now look at all the signal names, one at a time.
21119 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21120 $cat > signal.c <<EOCP
21121 #include <sys/types.h>
21122 #include <signal.h>
21125 printf("$xx %d\n", SIG${xx});
21130 if eval $compile; then
21131 echo "SIG${xx} found."
21132 $run ./signal$_exe >> signal.ls1
21134 echo "SIG${xx} NOT found."
21137 if $test -s signal.ls1; then
21138 $cat signal.nsg signal.ls1 |
21139 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21143 if $test -s signal.lst; then
21146 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21147 echo 'kill -l' >signal
21148 set X `csh -f <signal`
21152 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21154 echo $@ | $tr ' ' $trnl | \
21155 $awk '{ printf "%s %d\n", $1, ++s; }
21156 END { printf "NSIG %d\n", ++s }' >signal.lst
21158 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21160 chmod a+x signal_cmd
21161 $eunicefix signal_cmd
21163 : generate list of signal names
21165 case "$sig_name_init" in
21167 *) case "$sig_num_init" in
21168 ''|*,*) doinit=yes ;;
21173 echo "Generating a list of signal names and numbers..." >&4
21175 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21176 sig_name=`$awk 'BEGIN { printf "ZERO " }
21177 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21178 sig_num=`$awk 'BEGIN { printf "0 " }
21179 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21180 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21181 !/^NSIG/ { printf "\"%s\", ", $1 }
21182 END { printf "0\n" }' signal.lst`
21183 sig_num_init=`$awk 'BEGIN { printf "0, " }
21184 !/^NSIG/ { printf "%d, ", $2}
21185 END { printf "0\n"}' signal.lst`
21188 echo "The following $sig_count signals are available:"
21190 echo $sig_name | $awk \
21191 'BEGIN { linelen = 0 }
21193 for (i = 1; i <= NF; i++) {
21194 name = "SIG" $i " "
21195 linelen = linelen + length(name)
21196 if (linelen > 70) {
21198 linelen = length(name)
21204 sig_size=`echo $sig_name | awk '{print NF}'`
21205 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21207 : Check size of size
21209 case "$sizetype" in
21210 *_t) zzz="$sizetype" ;;
21211 *) zzz="filesize" ;;
21213 echo "Checking the size of $zzz..." >&4
21215 #include <sys/types.h>
21217 #$i_stdlib I_STDLIB
21219 #include <stdlib.h>
21222 printf("%d\n", (int)sizeof($sizetype));
21227 if eval $compile_ok; then
21231 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21234 echo "Your $zzz size is $sizesize bytes."
21239 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21243 : check for socklen_t
21245 echo "Checking to see if you have socklen_t..." >&4
21247 #include <sys/types.h>
21248 #$d_socket HAS_SOCKET
21250 #include <sys/socket.h>
21252 int main() { socklen_t x = 16; }
21255 if eval $compile; then
21257 echo "You have socklen_t."
21260 echo "You do not have socklen_t."
21261 case "$sizetype" in
21262 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21269 : see if this is a socks.h system
21270 set socks.h i_socks
21273 : check for type of the size argument to socket calls
21274 case "$d_socket" in
21278 Checking to see what type is the last argument of accept().
21281 case "$d_socklen_t" in
21282 "$define") yyy="$yyy socklen_t"
21284 yyy="$yyy $sizetype int long unsigned"
21285 for xxx in $yyy; do
21286 case "$socksizetype" in
21287 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21288 case "$usesocks" in
21290 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21291 echo "Your system accepts '$xxx *' for the last argument of accept()."
21292 socksizetype="$xxx"
21295 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21296 echo "Your system accepts '$xxx *' for the last argument of accept()."
21297 socksizetype="$xxx"
21304 : In case none of those worked, prompt the user.
21305 case "$socksizetype" in
21306 '') rp='What is the type for socket address structure sizes?'
21313 *) : no sockets, so pick relatively harmless default
21318 : see what type is used for signed size_t
21319 set ssize_t ssizetype int stdio.h sys/types.h
21324 #$i_stdlib I_STDLIB
21326 #include <stdlib.h>
21328 #include <sys/types.h>
21329 #define Size_t $sizetype
21330 #define SSize_t $dflt
21333 if (sizeof(Size_t) == sizeof(SSize_t))
21335 else if (sizeof(Size_t) == sizeof(int))
21344 if eval $compile_ok && $run ./try > /dev/null; then
21345 ssizetype=`$run ./try`
21346 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21349 Help! I can't compile and run the ssize_t test program: please enlighten me!
21350 (This is probably a misconfiguration in your system or libraries, and
21351 you really ought to fix it. Still, I'll try anyway.)
21353 I need a type that is the same size as $sizetype, but is guaranteed to
21354 be signed. Common values are ssize_t, int and long.
21357 rp="What signed type is the same size as $sizetype?"
21363 : Check the size of st_ino
21365 $echo "Checking the size of st_ino..." >&4
21366 $cat > try.c <<EOCP
21367 #include <sys/stat.h>
21369 #$i_stdlib I_STDLIB
21371 #include <stdlib.h>
21375 printf("%d\n", (int)sizeof(st.st_ino));
21380 if eval $compile_ok; then
21384 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21386 *) st_ino_size=$val
21387 $echo "Your st_ino is $st_ino_size bytes long."
21392 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21396 : Check if st_ino is signed
21398 $echo "Checking the sign of st_ino..." >&4
21399 $cat > try.c <<EOCP
21400 #include <sys/stat.h>
21405 if (foo.st_ino < 0)
21412 if eval $compile; then
21416 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21418 *) st_ino_sign=$val
21419 case "$st_ino_sign" in
21420 1) $echo "Your st_ino is unsigned." ;;
21421 -1) $echo "Your st_ino is signed." ;;
21427 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21431 : see what type of char stdio uses.
21433 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21434 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21435 echo "Your stdio uses unsigned chars." >&4
21436 stdchar="unsigned char"
21438 echo "Your stdio uses signed chars." >&4
21443 : see what type uids are declared as in the kernel
21445 echo "Looking for the type for user ids returned by getuid()."
21446 set uid_t uidtype xxx stdio.h sys/types.h
21450 xxx=`./findhdr sys/user.h`
21451 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21453 unsigned) dflt="$1 $2" ;;
21457 *) dflt="$uidtype";;
21460 uid_t) echo "uid_t found." ;;
21461 *) rp="What is the type for user ids returned by getuid()?"
21467 : Check size of UID
21470 *_t) zzz="$uidtype" ;;
21473 echo "Checking the size of $zzz..." >&4
21475 #include <sys/types.h>
21477 #$i_stdlib I_STDLIB
21479 #include <stdlib.h>
21482 printf("%d\n", (int)sizeof($uidtype));
21487 if eval $compile_ok; then
21491 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21494 echo "Your $zzz is $uidsize bytes long."
21499 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21502 : Check if UID is signed
21505 *_t) zzz="$uidtype" ;;
21508 echo "Checking the sign of $zzz..." >&4
21510 #include <sys/types.h>
21521 if eval $compile; then
21525 echo "(I can't execute the test program--guessing unsigned.)" >&4
21529 1) echo "Your $zzz is unsigned." ;;
21530 -1) echo "Your $zzz is signed." ;;
21536 echo "(I can't compile the test program--guessing unsigned.)" >&4
21540 : Check format string for UID
21542 $echo "Checking the format string to be used for uids..." >&4
21545 -1) if $test X"$uidsize" = X"$ivsize"; then
21546 uidformat="$ivdformat"
21548 if $test X"$uidsize" = X"$longsize"; then
21551 if $test X"$uidsize" = X"$intsize"; then
21554 if $test X"$uidsize" = X"$shortsize"; then
21561 *) if $test X"$uidsize" = X"$uvsize"; then
21562 uidformat="$uvuformat"
21564 if $test X"$uidsize" = X"$longsize"; then
21567 if $test X"$uidsize" = X"$intsize"; then
21570 if $test X"$uidsize" = X"$shortsize"; then
21579 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21581 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21582 $cat >try.c <<'EOM'
21583 /* Intentionally a long probe as I'd like to sanity check that the exact
21584 approach is going to work, as thinking it will work, but only having it
21585 part working at runtime is worse than not having it. */
21587 #include <sys/types.h>
21588 #include <sys/sysctl.h>
21589 #include <sys/param.h>
21591 #include <string.h>
21592 #include <stdlib.h>
21593 #include <unistd.h>
21596 main(int argc, char **argv) {
21598 char *argv_leaf = strrchr(argv[0], '/');
21604 mib[1] = KERN_PROC;
21605 mib[2] = KERN_PROC_PATHNAME;
21609 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21613 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21618 if (size < strlen(argv_leaf) + 1) {
21619 fprintf(stderr, "size %lu is too short for a path\n",
21620 (unsigned long) size);
21624 if (size > MAXPATHLEN * MAXPATHLEN) {
21625 fprintf(stderr, "size %lu is too long for a path\n",
21626 (unsigned long) size);
21630 buffer = malloc(size);
21636 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21641 if (strlen(buffer) + 1 != size) {
21642 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21643 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21648 if (*buffer != '/') {
21649 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21653 if (strstr(buffer, "/./")) {
21654 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21658 if (strstr(buffer, "/../")) {
21659 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21663 buffer_leaf = strrchr(buffer, '/');
21664 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21665 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21677 if eval $compile; then
21678 if $run ./try; then
21679 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21682 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21686 echo "I'm unable to compile the test program." >&4
21687 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21691 set usekernprocpathname
21694 : Determine if we can use _NSGetExecutablePath to find executing program
21696 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21697 $cat >try.c <<'EOM'
21698 /* Intentionally a long probe as I'd like to sanity check that the exact
21699 approach is going to work, as thinking it will work, but only having it
21700 part working at runtime is worse than not having it. */
21701 #include <mach-o/dyld.h>
21703 #include <stdlib.h>
21704 #include <sys/param.h>
21705 #include <string.h>
21708 main(int argc, char **argv) {
21710 uint32_t size = sizeof(buf);
21714 char *argv_leaf = strrchr(argv[0], '/');
21718 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21722 _NSGetExecutablePath(buf, &size);
21723 if (size > MAXPATHLEN * MAXPATHLEN) {
21724 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21725 (unsigned int) size);
21729 buffer = malloc(size);
21735 result = _NSGetExecutablePath(buffer, &size);
21737 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21738 result, (unsigned int) size);
21742 tidied = realpath(buffer, NULL);
21744 perror("realpath");
21750 if (*tidied != '/') {
21751 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21755 if (strstr(tidied, "/./")) {
21756 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21760 if (strstr(tidied, "/../")) {
21761 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21765 tidied_leaf = strrchr(tidied, '/');
21766 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21767 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21779 if eval $compile; then
21780 if $run ./try; then
21781 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21784 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21787 echo "I'm unable to compile the test program." >&4
21788 echo "I'll assume no _NSGetExecutablePath here." >&4
21791 set usensgetexecutablepath
21794 : Check if site customization support was requested
21795 case "$usesitecustomize" in
21796 $define|true|[Yy]*)
21797 usesitecustomize="$define"
21800 usesitecustomize="$undef"
21804 : see if prototypes support variable argument declarations
21806 case "$prototype$i_stdarg" in
21808 echo "It appears we'll be able to prototype varargs functions." >&4
21812 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21819 : determine compiler compiler
21828 if $test -f "$byacc$_exe"; then
21830 comp="byacc or $comp"
21832 if $test -f "$bison$_exe"; then
21833 comp="$comp or bison -y"
21835 rp="Which compiler compiler ($comp) shall I use?"
21844 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21850 : see if this is a assert.h system
21851 set assert.h i_assert
21854 : see if this is a fp.h system
21858 : see if this is a fp_class.h system
21859 set fp_class.h i_fp_class
21862 : see if gdbm.h is available
21867 : see if gdbm_open exists
21868 set gdbm_open d_gdbm_open
21870 case "$d_gdbm_open" in
21873 echo "We won't be including <gdbm.h>"
21882 : see if this is a ieeefp.h system
21883 case "$i_ieeefp" in
21884 '' ) set ieeefp.h i_ieeefp
21889 : see if this is a libutil.h system
21890 set libutil.h i_libutil
21893 : see if mach cthreads are available
21894 if test "X$usethreads" = "X$define"; then
21895 set mach/cthreads.h i_machcthr
21898 i_machcthr="$undef"
21901 : see if this is a mntent.h system
21902 set mntent.h i_mntent
21905 : see if net/errno.h is available
21907 set net/errno.h val
21910 : Unfortunately, it causes problems on some systems. Arrgh.
21913 cat > try.c <<'EOM'
21916 #include <net/errno.h>
21922 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21923 echo "We'll be including <net/errno.h>." >&4
21925 echo "We won't be including <net/errno.h>." >&4
21934 : see if netinet/tcp.h is available
21935 set netinet/tcp.h i_netinettcp
21938 : see if this is a poll.h system
21942 : see if this is a prot.h system
21946 : Preprocessor symbols
21948 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21949 $cat <<'EOSH' > Cppsym.know
21950 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21951 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21952 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21953 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21954 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21955 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21956 bull c cadmus clipper CMU COFF COMPILER_VERSION
21957 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21958 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21959 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21960 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21962 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21963 H3050R H3050RX hbullx20 hcx host_mips
21964 hp200 hp300 hp700 HP700 hp800 hp9000
21965 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21966 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21967 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21968 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21969 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21970 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21971 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21972 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21973 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21974 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21975 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21976 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21977 MATH_HAS_NO_SIDE_EFFECTS
21978 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21979 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21980 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21981 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21982 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21983 NetBSD news1500 news1700 news1800 news1900 news3700
21984 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21985 ns32016 ns32332 ns32k nsc32000
21986 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21987 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21988 pc532 pdp11 PGC PIC plexus PORTAR posix
21989 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21990 POSIX_C_SOURCE POSIX_SOURCE POWER
21991 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21992 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21993 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21994 sony sony_news sonyrisc sparc sparclite spectrum
21995 stardent stdc STDC_EXT stratos sun sun3 sun386
21996 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21997 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21998 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21999 sysV68 sysV88 Tek4132 Tek4300 titan
22000 TM3200 TM5400 TM5600
22001 tower tower32 tower32_200 tower32_600 tower32_700
22002 tower32_800 tower32_850 tss
22003 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22004 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22005 unix UNIX95 UNIX99 unixpc unos
22006 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22007 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22008 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22010 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22011 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22012 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22015 # Maybe put other stuff here too.
22016 cat <<EOSH >>Cppsym.know
22019 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22020 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22021 $cat Cppsym.know > Cppsym.c
22022 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22023 $rm -f Cppsym.a Cppsym.b Cppsym.c
22024 cat <<EOSH > Cppsym
22026 if $test \$# -gt 0; then
22027 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22028 if $test -s Cppsym.got; then
22035 $tr " " "$trnl" | ./Cppsym.try
22041 cat <<EOSH > Cppsym.try
22043 cat <<'EOCP' > try.c
22046 #define STRINGIFY(a) "a"
22048 #if cpp_stuff == 42
22049 #define StGiFy(a) #a
22050 #define STRINGIFY(a) StGiFy(a)
22052 #if $cpp_stuff != 1 && $cpp_stuff != 42
22053 # include "Bletch: How does this C preprocessor stringify macros?"
22059 cat <<'EOSH' >> Cppsym.try
22061 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22062 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22063 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22064 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22066 echo 'return 0;}' >> try.c
22068 cat <<EOSH >> Cppsym.try
22070 case "$osname-$gccversion" in
22071 irix-) ccflags="\$ccflags -woff 1178" ;;
22072 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22074 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22076 chmod +x Cppsym.try
22077 $eunicefix Cppsym.try
22078 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22079 : Add in any Linux cpp "predefined macros":
22080 case "$osname::$gccversion" in
22081 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22083 rm -f $tHdrH'.h' $tHdrH
22085 # Filter out macro arguments, such as Linux's __INT8_C(c)
22086 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22087 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22088 if [ -s $tHdrH'_cppsym.real' ]; then
22089 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22092 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22095 : now check the C compiler for additional symbols
22096 postprocess_cc_v=''
22098 aix) postprocess_cc_v="|$tr , ' '" ;;
22105 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22108 -D*) echo "\$i" | $sed 's/^-D//';;
22109 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22114 postprocess_cc_v=''
22117 ./ccsym > ccsym1.raw
22118 if $test -s ccsym1.raw; then
22119 $sort ccsym1.raw | $uniq >ccsym.raw
22121 mv ccsym1.raw ccsym.raw
22124 $awk '/\=/ { print $0; next }
22125 { print $0"=1" }' ccsym.raw >ccsym.list
22126 $comm -13 Cppsym.true ccsym.list >ccsym.own
22127 $comm -12 Cppsym.true ccsym.list >ccsym.com
22128 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22130 if $test -z ccsym.raw; then
22131 echo "Your C compiler doesn't seem to define any symbols!" >&4
22133 echo "However, your C preprocessor defines the following symbols:"
22136 cppsymbols=`$cat Cppsym.true`
22137 cppsymbols=`echo $cppsymbols`
22138 cppccsymbols="$cppsymbols"
22140 if $test -s ccsym.com; then
22141 echo "Your C compiler and pre-processor define these symbols:"
22142 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22145 cppccsymbols=`$cat ccsym.com`
22146 cppccsymbols=`echo $cppccsymbols`
22147 $test "$silent" || sleep 1
22149 if $test -s ccsym.cpp; then
22150 $test "$also" && echo " "
22151 echo "Your C pre-processor ${also}defines the following symbols:"
22152 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22154 cppsymbols=`$cat ccsym.cpp`
22155 cppsymbols=`echo $cppsymbols`
22156 $test "$silent" || sleep 1
22158 if $test -s ccsym.own; then
22159 $test "$also" && echo " "
22160 echo "Your C compiler ${also}defines the following cpp symbols:"
22161 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22162 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22163 ccsymbols=`$cat ccsym.own`
22164 ccsymbols=`echo $ccsymbols`
22165 $test "$silent" || sleep 1
22169 : see if this is a termio system
22173 if $test `./findhdr termios.h`; then
22174 set tcsetattr i_termios
22180 "$define") echo "You have POSIX termios.h... good!" >&4;;
22181 *) if ./Cppsym pyr; then
22182 case "`$run /bin/universe`" in
22183 ucb) if $test `./findhdr sgtty.h`; then
22185 echo "<sgtty.h> found." >&4
22187 echo "System is pyramid with BSD universe."
22188 ./warn "<sgtty.h> not found--you could have problems."
22190 *) if $test `./findhdr termio.h`; then
22192 echo "<termio.h> found." >&4
22194 echo "System is pyramid with USG universe."
22195 ./warn "<termio.h> not found--you could have problems."
22199 if $test `./findhdr termio.h`; then
22200 echo "<termio.h> found." >&4
22202 elif $test `./findhdr sgtty.h`; then
22203 echo "<sgtty.h> found." >&4
22206 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22209 if $test `./findhdr sgtty.h`; then
22210 echo "<sgtty.h> found." >&4
22212 elif $test `./findhdr termio.h`; then
22213 echo "<termio.h> found." >&4
22216 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22220 set i_termio; eval $setvar
22221 val=$val2; set i_sgtty; eval $setvar
22222 val=$val3; set i_termios; eval $setvar
22224 : see if stdbool is available
22225 : we want a real compile instead of Inhdr because some Solaris systems
22226 : have stdbool.h, but it can only be used if the compiler indicates it
22227 : is sufficiently c99-compliant.
22231 #include <stdbool.h>
22236 int main(int argc, char **argv)
22242 if eval $compile; then
22243 echo "<stdbool.h> found." >&4
22246 echo "<stdbool.h> NOT found." >&4
22253 : see if stddef is available
22254 set stddef.h i_stddef
22257 : see if sys/access.h is available
22258 set sys/access.h i_sysaccess
22261 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22262 set sys/filio.h i_sysfilio
22265 if $test `./findhdr sys/ioctl.h`; then
22267 echo '<sys/ioctl.h> found.' >&4
22270 if $test $i_sysfilio = "$define"; then
22271 echo '<sys/ioctl.h> NOT found.' >&4
22273 $test $i_sgtty = "$define" && xxx="sgtty.h"
22274 $test $i_termio = "$define" && xxx="termio.h"
22275 $test $i_termios = "$define" && xxx="termios.h"
22276 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22282 : see if socket ioctl defs are in sys/sockio.h
22284 xxx=`./findhdr sys/sockio.h`
22285 if $test "$xxx"; then
22286 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22288 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22291 echo "No socket ioctls found in <sys/sockio.h>." >&4
22296 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22302 : see if this is a syslog.h system
22303 set syslog.h i_syslog
22306 : see if this is a sys/mode.h system
22307 set sys/mode.h i_sysmode
22310 : see if there is a sys/poll.h file
22311 set sys/poll.h i_syspoll
22314 : see if sys/resource.h has to be included
22315 set sys/resource.h i_sysresrc
22318 : see if sys/security.h is available
22319 set sys/security.h i_syssecrt
22322 : see if this is a sys/statvfs.h system
22323 set sys/statvfs.h i_sysstatvfs
22326 : see if this is a sys/un.h system
22327 set sys/un.h i_sysun
22330 : see if this is a sys/utsname.h system
22331 set sys/utsname.h i_sysutsname
22334 : see if this is a syswait system
22335 set sys/wait.h i_syswait
22338 : see if this is a ustat.h system
22339 set ustat.h i_ustat
22342 : see if this is an utime system
22343 set utime.h i_utime
22346 : see if this is a vfork system
22349 set vfork.h i_vfork
22359 echo "Looking for extensions..." >&4
22360 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22361 : contain old or inaccurate or duplicate values.
22362 nonxs_extensions=''
22364 : We do not use find because it might not be available.
22365 : We do not just use MANIFEST because the user may have dropped
22366 : some additional extensions into the source tree and expect them
22369 : Function to recursively find available extensions, ignoring DynaLoader
22370 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22371 : In 5.10.1 and later, extensions are stored in directories
22372 : like File-Glob instead of the older File/Glob/.
22376 DynaLoader|dynaload) ;;
22378 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22379 case "$this_ext" in
22380 Scalar/List/Utils) this_ext="List/Util" ;;
22381 PathTools) this_ext="Cwd" ;;
22383 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22384 if $contains " $this_ext " $$.tmp; then
22386 echo "Duplicate directories detected for extension $xxx" >&4;
22387 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22388 case "$knowitall" in
22396 echo "Ok. Stopping Configure." >&4;
22397 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22400 echo "Ok. You will need to correct config.sh before running make." >&4;
22402 $ls -1 $xxx > $$.tmp;
22403 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22404 xs_extensions="$xs_extensions $this_ext";
22405 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22406 xs_extensions="$xs_extensions $this_ext";
22407 elif $test -d $xxx; then
22408 nonxs_extensions="$nonxs_extensions $this_ext";
22418 eval $find_extensions
22422 eval $find_extensions
22426 eval $find_extensions
22427 set X $xs_extensions
22429 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22430 set X $nonxs_extensions
22432 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22434 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22436 : Now see which are supported on this system.
22438 for xxx in $xs_extensions ; do
22442 $define) avail_ext="$avail_ext $xxx" ;;
22445 GDBM_File|gdbm_fil)
22447 $define) avail_ext="$avail_ext $xxx" ;;
22450 I18N/Langinfo|i18n_lan)
22451 case "$i_langinfo$d_nl_langinfo" in
22452 $define$define) avail_ext="$avail_ext $xxx" ;;
22456 : XXX Do we need a useipcsysv variable here
22457 case "${d_msg}${d_sem}${d_shm}" in
22458 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22461 NDBM_File|ndbm_fil)
22464 case "$osname-$use64bitint" in
22467 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22470 *) avail_ext="$avail_ext $xxx" ;;
22475 ODBM_File|odbm_fil)
22476 case "${i_dbm}${i_rpcsvcdbm}" in
22478 case "$d_cplusplus" in
22479 define) ;; # delete as a function name will not work
22480 *) case "$osname-$use64bitint" in
22483 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22486 *) avail_ext="$avail_ext $xxx" ;;
22494 case "$useopcode" in
22495 true|define|y) avail_ext="$avail_ext $xxx" ;;
22499 case "$useposix" in
22500 true|define|y) avail_ext="$avail_ext $xxx" ;;
22504 case "$d_socket" in
22505 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22508 Sys/Syslog|sys/syslog)
22509 : XXX syslog requires socket
22510 case "$d_socket" in
22511 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22515 case "$usethreads" in
22517 case "$use5005threads" in
22518 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22522 threads|threads/shared)
22523 # threads and threads::shared are special cases.
22524 # To stop people from asking "Perl 5.8.0 was supposed
22525 # to have this new fancy threads implementation but my
22526 # perl doesn't have it" and from people trying to
22527 # (re)install the threads module using CPAN.pm and
22528 # CPAN.pm then offering to reinstall Perl 5.8.0,
22529 # the threads.pm and threads/shared.pm will always be
22530 # there, croaking informatively ("you need to rebuild
22531 # all of Perl with threads, sorry") when threads haven't
22532 # been compiled in.
22534 avail_ext="$avail_ext $xxx"
22540 cygwin) avail_ext="$avail_ext $xxx" ;;
22543 XS/APItest|xs/apitest)
22544 # This is just for testing. Skip it unless we have dynamic loading.
22547 $define) avail_ext="$avail_ext $xxx" ;;
22550 XS/Typemap|xs/typemap)
22551 # This is just for testing. Skip it unless we have dynamic loading.
22553 $define) avail_ext="$avail_ext $xxx" ;;
22556 *) avail_ext="$avail_ext $xxx"
22565 case "$onlyextensions" in
22567 *) keepextensions=''
22568 echo "You have requested that only certain extensions be included..." >&4
22569 for i in $onlyextensions; do
22570 case " $avail_ext " in
22572 echo "Keeping extension $i."
22573 keepextensions="$keepextensions $i"
22575 *) echo "Ignoring extension $i." ;;
22578 avail_ext="$keepextensions"
22582 case "$noextensions" in
22584 *) keepextensions=''
22585 echo "You have requested that certain extensions be ignored..." >&4
22586 for i in $avail_ext; do
22587 case " $noextensions " in
22588 *" $i "*) echo "Ignoring extension $i." ;;
22589 *) echo "Keeping extension $i.";
22590 keepextensions="$keepextensions $i"
22594 avail_ext="$keepextensions"
22598 : Now see which nonxs extensions are supported on this system.
22599 : For now assume all are.
22601 for xxx in $nonxs_extensions ; do
22605 *) nonxs_ext="$nonxs_ext $xxx"
22617 A number of extensions are supplied with $package. You may choose to
22618 compile these extensions for dynamic loading (the default), compile
22619 them into the $package executable (static loading), or not include
22620 them at all. Answer "none" to include no extensions.
22621 Note that DynaLoader is always built and need not be mentioned here.
22624 case "$dynamic_ext" in
22626 : Exclude those listed in static_ext
22628 for xxx in $avail_ext; do
22629 case " $static_ext " in
22631 *) dflt="$dflt $xxx" ;;
22638 *) dflt="$dynamic_ext"
22639 # Perhaps we are reusing an old out-of-date config.sh.
22642 if test X"$dynamic_ext" != X"$avail_ext"; then
22644 NOTICE: Your previous config.sh list may be incorrect.
22645 The extensions now available to you are
22647 but the default list from your previous config.sh is
22659 rp="What extensions do you wish to load dynamically?"
22662 none) dynamic_ext=' ' ;;
22663 *) dynamic_ext="$ans" ;;
22666 case "$static_ext" in
22668 : Exclude those already listed in dynamic linking
22670 for xxx in $avail_ext; do
22671 case " $dynamic_ext " in
22673 *) dflt="$dflt $xxx" ;;
22680 *) dflt="$static_ext"
22687 rp="What extensions do you wish to load statically?"
22690 none) static_ext=' ' ;;
22691 *) static_ext="$ans" ;;
22696 A number of extensions are supplied with $package. Answer "none"
22697 to include no extensions.
22698 Note that DynaLoader is always built and need not be mentioned here.
22701 case "$static_ext" in
22702 '') dflt="$avail_ext" ;;
22703 *) dflt="$static_ext"
22704 # Perhaps we are reusing an old out-of-date config.sh.
22707 if test X"$static_ext" != X"$avail_ext"; then
22709 NOTICE: Your previous config.sh list may be incorrect.
22710 The extensions now available to you are
22712 but the default list from your previous config.sh is
22721 : Exclude those that are not xs extensions
22725 rp="What extensions do you wish to include?"
22728 none) static_ext=' ' ;;
22729 *) static_ext="$ans" ;;
22734 # Encode is a special case. If we are building Encode as a static
22735 # extension, we need to explicitly list its subextensions as well.
22736 # For other nested extensions, this is handled automatically by
22737 # the appropriate Makefile.PL.
22738 case " $static_ext " in
22739 *" Encode "*) # Add the subextensions of Encode
22741 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22742 static_ext="$static_ext Encode/$xxx"
22743 known_extensions="$known_extensions Encode/$xxx"
22749 set X $dynamic_ext $static_ext $nonxs_ext
22753 # Sanity check: We require an extension suitable for use with
22754 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22755 # should show up as failures in the test suite, but it's helpful to
22756 # catch them now.) The 'extensions' list is normally sorted
22757 # alphabetically, so we need to accept either
22758 # DB_File ... Fcntl ... IO ....
22759 # or something like
22760 # Fcntl ... NDBM_File ... IO ....
22761 case " $extensions" in
22762 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22763 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22764 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22765 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22766 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22770 : Remove libraries needed only for extensions
22771 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22772 : The exception is SunOS 4.x, which needs them.
22773 case "${osname}X${osvers}" in
22777 *) case "$usedl" in
22778 $define|true|[yY]*)
22779 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22783 *) perllibs="$libs"
22789 : Remove build directory name from cppstdin so it can be used from
22790 : either the present location or the final installed location.
22792 : Get out of the UU directory to get correct path name.
22794 case "$cppstdin" in
22796 echo "Stripping down cppstdin path name"
22802 : end of configuration questions
22804 echo "End of configuration questions."
22807 : back to where it started
22808 if test -d ../UU; then
22812 : configuration may be unconditionally patched via a 'config.arch' file
22813 if $test -f config.arch; then
22814 echo "I see a config.arch file, loading it." >&4
22818 : configuration may be patched via a 'config.over' file
22819 if $test -f config.over; then
22822 rp='I see a config.over file. Do you wish to load it?'
22825 n*) echo "OK, I'll ignore it.";;
22827 echo "Configuration override changes have been loaded."
22832 : in case they want portability, strip down executable paths
22833 case "$d_portable" in
22836 echo "Stripping down executable paths..." >&4
22837 for file in $loclist $trylist; do
22839 eval $file=`basename $temp`
22844 : create config.sh file
22846 echo "Creating config.sh..." >&4
22847 $spitshell <<EOT >config.sh
22850 # This file was produced by running the Configure script. It holds all the
22851 # definitions figured out by Configure. Should you modify one of these values,
22852 # do not forget to propagate your changes by running "Configure -der". You may
22853 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22856 # Package name : $package
22857 # Source directory : $src
22858 # Configuration time: $cf_time
22859 # Configured by : $cf_by
22860 # Target system : $myuname
22863 : Add in command line options if available
22864 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22866 $spitshell <<EOT >>config.sh
22875 Revision='$Revision'
22883 alignbytes='$alignbytes'
22884 ansi2knr='$ansi2knr'
22885 aphostname='$aphostname'
22886 api_revision='$api_revision'
22887 api_subversion='$api_subversion'
22888 api_version='$api_version'
22889 api_versionstring='$api_versionstring'
22892 archlibexp='$archlibexp'
22893 archname64='$archname64'
22894 archname='$archname'
22895 archobjs='$archobjs'
22896 asctime_r_proto='$asctime_r_proto'
22904 bootstrap_charset='$bootstrap_charset'
22906 byteorder='$byteorder'
22908 castflags='$castflags'
22911 cccdlflags='$cccdlflags'
22912 ccdlflags='$ccdlflags'
22914 ccflags_uselargefiles='$ccflags_uselargefiles'
22916 ccsymbols='$ccsymbols'
22917 ccversion='$ccversion'
22919 cf_email='$cf_email'
22921 charbits='$charbits'
22922 charsize='$charsize'
22926 clocktype='$clocktype'
22928 compress='$compress'
22929 contains='$contains'
22933 cpp_stuff='$cpp_stuff'
22934 cppccsymbols='$cppccsymbols'
22935 cppflags='$cppflags'
22937 cppminus='$cppminus'
22939 cppstdin='$cppstdin'
22940 cppsymbols='$cppsymbols'
22941 crypt_r_proto='$crypt_r_proto'
22942 cryptlib='$cryptlib'
22944 ctermid_r_proto='$ctermid_r_proto'
22945 ctime_r_proto='$ctime_r_proto'
22946 d_Gconvert='$d_Gconvert'
22947 d_PRIEUldbl='$d_PRIEUldbl'
22948 d_PRIFUldbl='$d_PRIFUldbl'
22949 d_PRIGUldbl='$d_PRIGUldbl'
22950 d_PRIXU64='$d_PRIXU64'
22951 d_PRId64='$d_PRId64'
22952 d_PRIeldbl='$d_PRIeldbl'
22953 d_PRIfldbl='$d_PRIfldbl'
22954 d_PRIgldbl='$d_PRIgldbl'
22955 d_PRIi64='$d_PRIi64'
22956 d_PRIo64='$d_PRIo64'
22957 d_PRIu64='$d_PRIu64'
22958 d_PRIx64='$d_PRIx64'
22959 d_SCNfldbl='$d_SCNfldbl'
22960 d__fwalk='$d__fwalk'
22961 d_access='$d_access'
22962 d_accessx='$d_accessx'
22965 d_archlib='$d_archlib'
22966 d_asctime64='$d_asctime64'
22967 d_asctime_r='$d_asctime_r'
22970 d_attribute_deprecated='$d_attribute_deprecated'
22971 d_attribute_format='$d_attribute_format'
22972 d_attribute_malloc='$d_attribute_malloc'
22973 d_attribute_nonnull='$d_attribute_nonnull'
22974 d_attribute_noreturn='$d_attribute_noreturn'
22975 d_attribute_pure='$d_attribute_pure'
22976 d_attribute_unused='$d_attribute_unused'
22977 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22981 d_bsdgetpgrp='$d_bsdgetpgrp'
22982 d_bsdsetpgrp='$d_bsdsetpgrp'
22983 d_builtin_choose_expr='$d_builtin_choose_expr'
22984 d_builtin_expect='$d_builtin_expect'
22986 d_c99_variadic_macros='$d_c99_variadic_macros'
22987 d_casti32='$d_casti32'
22988 d_castneg='$d_castneg'
22989 d_charvspr='$d_charvspr'
22991 d_chroot='$d_chroot'
22992 d_chsize='$d_chsize'
22994 d_clearenv='$d_clearenv'
22995 d_closedir='$d_closedir'
22996 d_cmsghdr_s='$d_cmsghdr_s'
22998 d_copysignl='$d_copysignl'
22999 d_cplusplus='$d_cplusplus'
23001 d_crypt_r='$d_crypt_r'
23003 d_ctermid='$d_ctermid'
23004 d_ctermid_r='$d_ctermid_r'
23005 d_ctime64='$d_ctime64'
23006 d_ctime_r='$d_ctime_r'
23007 d_cuserid='$d_cuserid'
23008 d_dbl_dig='$d_dbl_dig'
23009 d_dbminitproto='$d_dbminitproto'
23010 d_difftime64='$d_difftime64'
23011 d_difftime='$d_difftime'
23012 d_dir_dd_fd='$d_dir_dd_fd'
23014 d_dirnamlen='$d_dirnamlen'
23015 d_dlerror='$d_dlerror'
23016 d_dlopen='$d_dlopen'
23017 d_dlsymun='$d_dlsymun'
23018 d_dosuid='$d_dosuid'
23019 d_drand48_r='$d_drand48_r'
23020 d_drand48proto='$d_drand48proto'
23022 d_eaccess='$d_eaccess'
23023 d_endgrent='$d_endgrent'
23024 d_endgrent_r='$d_endgrent_r'
23025 d_endhent='$d_endhent'
23026 d_endhostent_r='$d_endhostent_r'
23027 d_endnent='$d_endnent'
23028 d_endnetent_r='$d_endnetent_r'
23029 d_endpent='$d_endpent'
23030 d_endprotoent_r='$d_endprotoent_r'
23031 d_endpwent='$d_endpwent'
23032 d_endpwent_r='$d_endpwent_r'
23033 d_endsent='$d_endsent'
23034 d_endservent_r='$d_endservent_r'
23035 d_eofnblk='$d_eofnblk'
23036 d_eunice='$d_eunice'
23037 d_faststdio='$d_faststdio'
23038 d_fchdir='$d_fchdir'
23039 d_fchmod='$d_fchmod'
23040 d_fchown='$d_fchown'
23042 d_fcntl_can_lock='$d_fcntl_can_lock'
23043 d_fd_macros='$d_fd_macros'
23044 d_fd_set='$d_fd_set'
23045 d_fds_bits='$d_fds_bits'
23046 d_fgetpos='$d_fgetpos'
23047 d_finite='$d_finite'
23048 d_finitel='$d_finitel'
23049 d_flexfnam='$d_flexfnam'
23051 d_flockproto='$d_flockproto'
23053 d_fp_class='$d_fp_class'
23054 d_fpathconf='$d_fpathconf'
23055 d_fpclass='$d_fpclass'
23056 d_fpclassify='$d_fpclassify'
23057 d_fpclassl='$d_fpclassl'
23058 d_fpos64_t='$d_fpos64_t'
23059 d_frexpl='$d_frexpl'
23060 d_fs_data_s='$d_fs_data_s'
23061 d_fseeko='$d_fseeko'
23062 d_fsetpos='$d_fsetpos'
23063 d_fstatfs='$d_fstatfs'
23064 d_fstatvfs='$d_fstatvfs'
23066 d_ftello='$d_ftello'
23068 d_futimes='$d_futimes'
23069 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23070 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23071 d_getaddrinfo='$d_getaddrinfo'
23072 d_getcwd='$d_getcwd'
23073 d_getespwnam='$d_getespwnam'
23074 d_getfsstat='$d_getfsstat'
23075 d_getgrent='$d_getgrent'
23076 d_getgrent_r='$d_getgrent_r'
23077 d_getgrgid_r='$d_getgrgid_r'
23078 d_getgrnam_r='$d_getgrnam_r'
23079 d_getgrps='$d_getgrps'
23080 d_gethbyaddr='$d_gethbyaddr'
23081 d_gethbyname='$d_gethbyname'
23082 d_gethent='$d_gethent'
23083 d_gethname='$d_gethname'
23084 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23085 d_gethostbyname_r='$d_gethostbyname_r'
23086 d_gethostent_r='$d_gethostent_r'
23087 d_gethostprotos='$d_gethostprotos'
23088 d_getitimer='$d_getitimer'
23089 d_getlogin='$d_getlogin'
23090 d_getlogin_r='$d_getlogin_r'
23091 d_getmnt='$d_getmnt'
23092 d_getmntent='$d_getmntent'
23093 d_getnameinfo='$d_getnameinfo'
23094 d_getnbyaddr='$d_getnbyaddr'
23095 d_getnbyname='$d_getnbyname'
23096 d_getnent='$d_getnent'
23097 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23098 d_getnetbyname_r='$d_getnetbyname_r'
23099 d_getnetent_r='$d_getnetent_r'
23100 d_getnetprotos='$d_getnetprotos'
23101 d_getpagsz='$d_getpagsz'
23102 d_getpbyname='$d_getpbyname'
23103 d_getpbynumber='$d_getpbynumber'
23104 d_getpent='$d_getpent'
23105 d_getpgid='$d_getpgid'
23106 d_getpgrp2='$d_getpgrp2'
23107 d_getpgrp='$d_getpgrp'
23108 d_getppid='$d_getppid'
23109 d_getprior='$d_getprior'
23110 d_getprotobyname_r='$d_getprotobyname_r'
23111 d_getprotobynumber_r='$d_getprotobynumber_r'
23112 d_getprotoent_r='$d_getprotoent_r'
23113 d_getprotoprotos='$d_getprotoprotos'
23114 d_getprpwnam='$d_getprpwnam'
23115 d_getpwent='$d_getpwent'
23116 d_getpwent_r='$d_getpwent_r'
23117 d_getpwnam_r='$d_getpwnam_r'
23118 d_getpwuid_r='$d_getpwuid_r'
23119 d_getsbyname='$d_getsbyname'
23120 d_getsbyport='$d_getsbyport'
23121 d_getsent='$d_getsent'
23122 d_getservbyname_r='$d_getservbyname_r'
23123 d_getservbyport_r='$d_getservbyport_r'
23124 d_getservent_r='$d_getservent_r'
23125 d_getservprotos='$d_getservprotos'
23126 d_getspnam='$d_getspnam'
23127 d_getspnam_r='$d_getspnam_r'
23128 d_gettimeod='$d_gettimeod'
23129 d_gmtime64='$d_gmtime64'
23130 d_gmtime_r='$d_gmtime_r'
23131 d_gnulibc='$d_gnulibc'
23132 d_grpasswd='$d_grpasswd'
23133 d_hasmntopt='$d_hasmntopt'
23135 d_ilogbl='$d_ilogbl'
23136 d_inc_version_list='$d_inc_version_list'
23138 d_inetaton='$d_inetaton'
23139 d_inetntop='$d_inetntop'
23140 d_inetpton='$d_inetpton'
23141 d_int64_t='$d_int64_t'
23142 d_ip_mreq='$d_ip_mreq'
23143 d_ip_mreq_source='$d_ip_mreq_source'
23144 d_ipv6_mreq='$d_ipv6_mreq'
23145 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23146 d_isascii='$d_isascii'
23147 d_isblank='$d_isblank'
23148 d_isfinite='$d_isfinite'
23151 d_isnanl='$d_isnanl'
23152 d_killpg='$d_killpg'
23153 d_lchown='$d_lchown'
23154 d_ldbl_dig='$d_ldbl_dig'
23155 d_libm_lib_version='$d_libm_lib_version'
23156 d_libname_unique='$d_libname_unique'
23158 d_localtime64='$d_localtime64'
23159 d_localtime_r='$d_localtime_r'
23160 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23161 d_locconv='$d_locconv'
23163 d_longdbl='$d_longdbl'
23164 d_longlong='$d_longlong'
23165 d_lseekproto='$d_lseekproto'
23167 d_madvise='$d_madvise'
23168 d_malloc_good_size='$d_malloc_good_size'
23169 d_malloc_size='$d_malloc_size'
23171 d_mbstowcs='$d_mbstowcs'
23172 d_mbtowc='$d_mbtowc'
23173 d_memchr='$d_memchr'
23174 d_memcmp='$d_memcmp'
23175 d_memcpy='$d_memcpy'
23176 d_memmove='$d_memmove'
23177 d_memset='$d_memset'
23179 d_mkdtemp='$d_mkdtemp'
23180 d_mkfifo='$d_mkfifo'
23181 d_mkstemp='$d_mkstemp'
23182 d_mkstemps='$d_mkstemps'
23183 d_mktime64='$d_mktime64'
23184 d_mktime='$d_mktime'
23187 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23188 d_modflproto='$d_modflproto'
23189 d_mprotect='$d_mprotect'
23191 d_msg_ctrunc='$d_msg_ctrunc'
23192 d_msg_dontroute='$d_msg_dontroute'
23193 d_msg_oob='$d_msg_oob'
23194 d_msg_peek='$d_msg_peek'
23195 d_msg_proxy='$d_msg_proxy'
23196 d_msgctl='$d_msgctl'
23197 d_msgget='$d_msgget'
23198 d_msghdr_s='$d_msghdr_s'
23199 d_msgrcv='$d_msgrcv'
23200 d_msgsnd='$d_msgsnd'
23202 d_munmap='$d_munmap'
23203 d_mymalloc='$d_mymalloc'
23205 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23207 d_nl_langinfo='$d_nl_langinfo'
23208 d_nv_preserves_uv='$d_nv_preserves_uv'
23209 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23210 d_off64_t='$d_off64_t'
23211 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23212 d_oldpthreads='$d_oldpthreads'
23213 d_oldsock='$d_oldsock'
23215 d_pathconf='$d_pathconf'
23217 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23218 d_phostname='$d_phostname'
23221 d_portable='$d_portable'
23223 d_prctl_set_name='$d_prctl_set_name'
23224 d_printf_format_null='$d_printf_format_null'
23225 d_procselfexe='$d_procselfexe'
23226 d_pseudofork='$d_pseudofork'
23227 d_pthread_atfork='$d_pthread_atfork'
23228 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23229 d_pthread_yield='$d_pthread_yield'
23231 d_pwchange='$d_pwchange'
23232 d_pwclass='$d_pwclass'
23233 d_pwcomment='$d_pwcomment'
23234 d_pwexpire='$d_pwexpire'
23235 d_pwgecos='$d_pwgecos'
23236 d_pwpasswd='$d_pwpasswd'
23237 d_pwquota='$d_pwquota'
23240 d_random_r='$d_random_r'
23241 d_readdir64_r='$d_readdir64_r'
23242 d_readdir='$d_readdir'
23243 d_readdir_r='$d_readdir_r'
23244 d_readlink='$d_readlink'
23246 d_recvmsg='$d_recvmsg'
23247 d_rename='$d_rename'
23248 d_rewinddir='$d_rewinddir'
23250 d_safebcpy='$d_safebcpy'
23251 d_safemcpy='$d_safemcpy'
23252 d_sanemcmp='$d_sanemcmp'
23253 d_sbrkproto='$d_sbrkproto'
23254 d_scalbnl='$d_scalbnl'
23255 d_sched_yield='$d_sched_yield'
23256 d_scm_rights='$d_scm_rights'
23257 d_seekdir='$d_seekdir'
23258 d_select='$d_select'
23260 d_semctl='$d_semctl'
23261 d_semctl_semid_ds='$d_semctl_semid_ds'
23262 d_semctl_semun='$d_semctl_semun'
23263 d_semget='$d_semget'
23265 d_sendmsg='$d_sendmsg'
23266 d_setegid='$d_setegid'
23267 d_seteuid='$d_seteuid'
23268 d_setgrent='$d_setgrent'
23269 d_setgrent_r='$d_setgrent_r'
23270 d_setgrps='$d_setgrps'
23271 d_sethent='$d_sethent'
23272 d_sethostent_r='$d_sethostent_r'
23273 d_setitimer='$d_setitimer'
23274 d_setlinebuf='$d_setlinebuf'
23275 d_setlocale='$d_setlocale'
23276 d_setlocale_r='$d_setlocale_r'
23277 d_setnent='$d_setnent'
23278 d_setnetent_r='$d_setnetent_r'
23279 d_setpent='$d_setpent'
23280 d_setpgid='$d_setpgid'
23281 d_setpgrp2='$d_setpgrp2'
23282 d_setpgrp='$d_setpgrp'
23283 d_setprior='$d_setprior'
23284 d_setproctitle='$d_setproctitle'
23285 d_setprotoent_r='$d_setprotoent_r'
23286 d_setpwent='$d_setpwent'
23287 d_setpwent_r='$d_setpwent_r'
23288 d_setregid='$d_setregid'
23289 d_setresgid='$d_setresgid'
23290 d_setresuid='$d_setresuid'
23291 d_setreuid='$d_setreuid'
23292 d_setrgid='$d_setrgid'
23293 d_setruid='$d_setruid'
23294 d_setsent='$d_setsent'
23295 d_setservent_r='$d_setservent_r'
23296 d_setsid='$d_setsid'
23297 d_setvbuf='$d_setvbuf'
23300 d_shmatprototype='$d_shmatprototype'
23301 d_shmctl='$d_shmctl'
23303 d_shmget='$d_shmget'
23304 d_sigaction='$d_sigaction'
23305 d_signbit='$d_signbit'
23306 d_sigprocmask='$d_sigprocmask'
23307 d_sigsetjmp='$d_sigsetjmp'
23308 d_sin6_scope_id='$d_sin6_scope_id'
23309 d_sitearch='$d_sitearch'
23310 d_snprintf='$d_snprintf'
23311 d_sockaddr_in6='$d_sockaddr_in6'
23312 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23313 d_sockatmark='$d_sockatmark'
23314 d_sockatmarkproto='$d_sockatmarkproto'
23315 d_socket='$d_socket'
23316 d_socklen_t='$d_socklen_t'
23317 d_sockpair='$d_sockpair'
23318 d_socks5_init='$d_socks5_init'
23319 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23321 d_srand48_r='$d_srand48_r'
23322 d_srandom_r='$d_srandom_r'
23323 d_sresgproto='$d_sresgproto'
23324 d_sresuproto='$d_sresuproto'
23325 d_statblks='$d_statblks'
23326 d_statfs_f_flags='$d_statfs_f_flags'
23327 d_statfs_s='$d_statfs_s'
23328 d_static_inline='$d_static_inline'
23329 d_statvfs='$d_statvfs'
23330 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23331 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23332 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23333 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23334 d_stdio_stream_array='$d_stdio_stream_array'
23335 d_stdiobase='$d_stdiobase'
23336 d_stdstdio='$d_stdstdio'
23337 d_strchr='$d_strchr'
23338 d_strcoll='$d_strcoll'
23339 d_strctcpy='$d_strctcpy'
23340 d_strerrm='$d_strerrm'
23341 d_strerror='$d_strerror'
23342 d_strerror_r='$d_strerror_r'
23343 d_strftime='$d_strftime'
23344 d_strlcat='$d_strlcat'
23345 d_strlcpy='$d_strlcpy'
23346 d_strtod='$d_strtod'
23347 d_strtol='$d_strtol'
23348 d_strtold='$d_strtold'
23349 d_strtoll='$d_strtoll'
23350 d_strtoq='$d_strtoq'
23351 d_strtoul='$d_strtoul'
23352 d_strtoull='$d_strtoull'
23353 d_strtouq='$d_strtouq'
23354 d_strxfrm='$d_strxfrm'
23355 d_suidsafe='$d_suidsafe'
23356 d_symlink='$d_symlink'
23357 d_syscall='$d_syscall'
23358 d_syscallproto='$d_syscallproto'
23359 d_sysconf='$d_sysconf'
23360 d_sysernlst='$d_sysernlst'
23361 d_syserrlst='$d_syserrlst'
23362 d_system='$d_system'
23363 d_tcgetpgrp='$d_tcgetpgrp'
23364 d_tcsetpgrp='$d_tcsetpgrp'
23365 d_telldir='$d_telldir'
23366 d_telldirproto='$d_telldirproto'
23368 d_timegm='$d_timegm'
23370 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23371 d_tm_tm_zone='$d_tm_tm_zone'
23372 d_tmpnam_r='$d_tmpnam_r'
23373 d_truncate='$d_truncate'
23374 d_ttyname_r='$d_ttyname_r'
23375 d_tzname='$d_tzname'
23376 d_u32align='$d_u32align'
23377 d_ualarm='$d_ualarm'
23380 d_union_semun='$d_union_semun'
23381 d_unordered='$d_unordered'
23382 d_unsetenv='$d_unsetenv'
23383 d_usleep='$d_usleep'
23384 d_usleepproto='$d_usleepproto'
23386 d_vendorarch='$d_vendorarch'
23387 d_vendorbin='$d_vendorbin'
23388 d_vendorlib='$d_vendorlib'
23389 d_vendorscript='$d_vendorscript'
23391 d_void_closedir='$d_void_closedir'
23392 d_voidsig='$d_voidsig'
23393 d_voidtty='$d_voidtty'
23394 d_volatile='$d_volatile'
23395 d_vprintf='$d_vprintf'
23396 d_vsnprintf='$d_vsnprintf'
23398 d_waitpid='$d_waitpid'
23399 d_wcstombs='$d_wcstombs'
23400 d_wctomb='$d_wctomb'
23401 d_writev='$d_writev'
23404 db_hashtype='$db_hashtype'
23405 db_prefixtype='$db_prefixtype'
23406 db_version_major='$db_version_major'
23407 db_version_minor='$db_version_minor'
23408 db_version_patch='$db_version_patch'
23409 direntrytype='$direntrytype'
23412 doublesize='$doublesize'
23414 drand48_r_proto='$drand48_r_proto'
23416 dynamic_ext='$dynamic_ext'
23422 endgrent_r_proto='$endgrent_r_proto'
23423 endhostent_r_proto='$endhostent_r_proto'
23424 endnetent_r_proto='$endnetent_r_proto'
23425 endprotoent_r_proto='$endprotoent_r_proto'
23426 endpwent_r_proto='$endpwent_r_proto'
23427 endservent_r_proto='$endservent_r_proto'
23428 eunicefix='$eunicefix'
23431 extensions='$extensions'
23432 extern_C='$extern_C'
23434 fflushNULL='$fflushNULL'
23435 fflushall='$fflushall'
23437 firstmakefile='$firstmakefile'
23439 fpossize='$fpossize'
23440 fpostype='$fpostype'
23441 freetype='$freetype'
23444 full_csh='$full_csh'
23445 full_sed='$full_sed'
23446 gccansipedantic='$gccansipedantic'
23447 gccosandvers='$gccosandvers'
23448 gccversion='$gccversion'
23449 getgrent_r_proto='$getgrent_r_proto'
23450 getgrgid_r_proto='$getgrgid_r_proto'
23451 getgrnam_r_proto='$getgrnam_r_proto'
23452 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23453 gethostbyname_r_proto='$gethostbyname_r_proto'
23454 gethostent_r_proto='$gethostent_r_proto'
23455 getlogin_r_proto='$getlogin_r_proto'
23456 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23457 getnetbyname_r_proto='$getnetbyname_r_proto'
23458 getnetent_r_proto='$getnetent_r_proto'
23459 getprotobyname_r_proto='$getprotobyname_r_proto'
23460 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23461 getprotoent_r_proto='$getprotoent_r_proto'
23462 getpwent_r_proto='$getpwent_r_proto'
23463 getpwnam_r_proto='$getpwnam_r_proto'
23464 getpwuid_r_proto='$getpwuid_r_proto'
23465 getservbyname_r_proto='$getservbyname_r_proto'
23466 getservbyport_r_proto='$getservbyport_r_proto'
23467 getservent_r_proto='$getservent_r_proto'
23468 getspnam_r_proto='$getspnam_r_proto'
23469 gidformat='$gidformat'
23475 gmtime_r_proto='$gmtime_r_proto'
23476 gnulibc_version='$gnulibc_version'
23478 groupcat='$groupcat'
23479 groupstype='$groupstype'
23482 h_sysfile='$h_sysfile'
23485 html1dir='$html1dir'
23486 html1direxp='$html1direxp'
23487 html3dir='$html3dir'
23488 html3direxp='$html3direxp'
23489 hostgenerate='$hostgenerate'
23490 hostperl='$hostperl'
23491 hostosname='$hostosname'
23500 i_arpainet='$i_arpainet'
23501 i_assert='$i_assert'
23502 i_bsdioctl='$i_bsdioctl'
23506 i_dirent='$i_dirent'
23511 i_fp_class='$i_fp_class'
23513 i_gdbm_ndbm='$i_gdbm_ndbm'
23514 i_gdbmndbm='$i_gdbmndbm'
23516 i_ieeefp='$i_ieeefp'
23517 i_inttypes='$i_inttypes'
23518 i_langinfo='$i_langinfo'
23519 i_libutil='$i_libutil'
23520 i_limits='$i_limits'
23521 i_locale='$i_locale'
23522 i_machcthr='$i_machcthr'
23523 i_malloc='$i_malloc'
23524 i_mallocmalloc='$i_mallocmalloc'
23526 i_memory='$i_memory'
23527 i_mntent='$i_mntent'
23530 i_neterrno='$i_neterrno'
23531 i_netinettcp='$i_netinettcp'
23535 i_pthread='$i_pthread'
23537 i_rpcsvcdbm='$i_rpcsvcdbm'
23539 i_shadow='$i_shadow'
23541 i_stdarg='$i_stdarg'
23542 i_stdbool='$i_stdbool'
23543 i_stddef='$i_stddef'
23544 i_stdlib='$i_stdlib'
23545 i_string='$i_string'
23546 i_sunmath='$i_sunmath'
23547 i_sysaccess='$i_sysaccess'
23548 i_sysdir='$i_sysdir'
23549 i_sysfile='$i_sysfile'
23550 i_sysfilio='$i_sysfilio'
23552 i_sysioctl='$i_sysioctl'
23553 i_syslog='$i_syslog'
23554 i_sysmman='$i_sysmman'
23555 i_sysmode='$i_sysmode'
23556 i_sysmount='$i_sysmount'
23557 i_sysndir='$i_sysndir'
23558 i_sysparam='$i_sysparam'
23559 i_syspoll='$i_syspoll'
23560 i_sysresrc='$i_sysresrc'
23561 i_syssecrt='$i_syssecrt'
23562 i_sysselct='$i_sysselct'
23563 i_syssockio='$i_syssockio'
23564 i_sysstat='$i_sysstat'
23565 i_sysstatfs='$i_sysstatfs'
23566 i_sysstatvfs='$i_sysstatvfs'
23567 i_systime='$i_systime'
23568 i_systimek='$i_systimek'
23569 i_systimes='$i_systimes'
23570 i_systypes='$i_systypes'
23571 i_sysuio='$i_sysuio'
23573 i_sysutsname='$i_sysutsname'
23574 i_sysvfs='$i_sysvfs'
23575 i_syswait='$i_syswait'
23576 i_termio='$i_termio'
23577 i_termios='$i_termios'
23579 i_unistd='$i_unistd'
23582 i_values='$i_values'
23583 i_varargs='$i_varargs'
23584 i_varhdr='$i_varhdr'
23586 ignore_versioned_solibs='$ignore_versioned_solibs'
23587 inc_version_list='$inc_version_list'
23588 inc_version_list_init='$inc_version_list_init'
23592 initialinstalllocation='$initialinstalllocation'
23593 installarchlib='$installarchlib'
23594 installbin='$installbin'
23595 installhtml1dir='$installhtml1dir'
23596 installhtml3dir='$installhtml3dir'
23597 installman1dir='$installman1dir'
23598 installman3dir='$installman3dir'
23599 installprefix='$installprefix'
23600 installprefixexp='$installprefixexp'
23601 installprivlib='$installprivlib'
23602 installscript='$installscript'
23603 installsitearch='$installsitearch'
23604 installsitebin='$installsitebin'
23605 installsitehtml1dir='$installsitehtml1dir'
23606 installsitehtml3dir='$installsitehtml3dir'
23607 installsitelib='$installsitelib'
23608 installsiteman1dir='$installsiteman1dir'
23609 installsiteman3dir='$installsiteman3dir'
23610 installsitescript='$installsitescript'
23611 installstyle='$installstyle'
23612 installusrbinperl='$installusrbinperl'
23613 installvendorarch='$installvendorarch'
23614 installvendorbin='$installvendorbin'
23615 installvendorhtml1dir='$installvendorhtml1dir'
23616 installvendorhtml3dir='$installvendorhtml3dir'
23617 installvendorlib='$installvendorlib'
23618 installvendorman1dir='$installvendorman1dir'
23619 installvendorman3dir='$installvendorman3dir'
23620 installvendorscript='$installvendorscript'
23622 issymlink='$issymlink'
23623 ivdformat='$ivdformat'
23626 known_extensions='$known_extensions'
23629 ld_can_script='$ld_can_script'
23630 lddlflags='$lddlflags'
23632 ldflags_uselargefiles='$ldflags_uselargefiles'
23633 ldlibpthname='$ldlibpthname'
23640 libsdirs='$libsdirs'
23641 libsfiles='$libsfiles'
23642 libsfound='$libsfound'
23643 libspath='$libspath'
23644 libswanted='$libswanted'
23645 libswanted_uselargefiles='$libswanted_uselargefiles'
23651 localtime_r_proto='$localtime_r_proto'
23652 locincpth='$locincpth'
23653 loclibpth='$loclibpth'
23654 longdblsize='$longdblsize'
23655 longlongsize='$longlongsize'
23656 longsize='$longsize'
23660 lseeksize='$lseeksize'
23661 lseektype='$lseektype'
23664 madlyobj='$madlyobj'
23665 madlysrc='$madlysrc'
23669 make_set_make='$make_set_make'
23670 mallocobj='$mallocobj'
23671 mallocsrc='$mallocsrc'
23672 malloctype='$malloctype'
23674 man1direxp='$man1direxp'
23677 man3direxp='$man3direxp'
23679 mips_type='$mips_type'
23680 mistrustnm='$mistrustnm'
23682 mmaptype='$mmaptype'
23683 modetype='$modetype'
23685 multiarch='$multiarch'
23687 myarchname='$myarchname'
23688 mydomain='$mydomain'
23689 myhostname='$myhostname'
23692 need_va_copy='$need_va_copy'
23693 netdb_hlen_type='$netdb_hlen_type'
23694 netdb_host_type='$netdb_host_type'
23695 netdb_name_type='$netdb_name_type'
23696 netdb_net_type='$netdb_net_type'
23699 nm_so_opt='$nm_so_opt'
23700 nonxs_ext='$nonxs_ext'
23702 nvEUformat='$nvEUformat'
23703 nvFUformat='$nvFUformat'
23704 nvGUformat='$nvGUformat'
23705 nv_overflows_integers_at='$nv_overflows_integers_at'
23706 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23707 nveformat='$nveformat'
23708 nvfformat='$nvfformat'
23709 nvgformat='$nvgformat'
23712 o_nonblock='$o_nonblock'
23714 old_pthread_create_joinable='$old_pthread_create_joinable'
23715 optimize='$optimize'
23716 orderlib='$orderlib'
23719 otherlibdirs='$otherlibdirs'
23723 patchlevel='$patchlevel'
23724 path_sep='$path_sep'
23727 perl_patchlevel='$perl_patchlevel'
23728 perl_static_inline='$perl_static_inline'
23729 perladmin='$perladmin'
23730 perllibs='$perllibs'
23731 perlpath='$perlpath'
23733 phostname='$phostname'
23739 prefixexp='$prefixexp'
23741 privlibexp='$privlibexp'
23742 procselfexe='$procselfexe'
23743 prototype='$prototype'
23745 quadkind='$quadkind'
23746 quadtype='$quadtype'
23747 randbits='$randbits'
23748 randfunc='$randfunc'
23749 random_r_proto='$random_r_proto'
23750 randseedtype='$randseedtype'
23752 rd_nodata='$rd_nodata'
23753 readdir64_r_proto='$readdir64_r_proto'
23754 readdir_r_proto='$readdir_r_proto'
23755 revision='$revision'
23761 sGMTIME_max='$sGMTIME_max'
23762 sGMTIME_min='$sGMTIME_min'
23763 sLOCALTIME_max='$sLOCALTIME_max'
23764 sLOCALTIME_min='$sLOCALTIME_min'
23765 sPRIEUldbl='$sPRIEUldbl'
23766 sPRIFUldbl='$sPRIFUldbl'
23767 sPRIGUldbl='$sPRIGUldbl'
23768 sPRIXU64='$sPRIXU64'
23770 sPRIeldbl='$sPRIeldbl'
23771 sPRIfldbl='$sPRIfldbl'
23772 sPRIgldbl='$sPRIgldbl'
23777 sSCNfldbl='$sSCNfldbl'
23778 sched_yield='$sched_yield'
23779 scriptdir='$scriptdir'
23780 scriptdirexp='$scriptdirexp'
23782 seedfunc='$seedfunc'
23783 selectminbits='$selectminbits'
23784 selecttype='$selecttype'
23785 sendmail='$sendmail'
23786 setgrent_r_proto='$setgrent_r_proto'
23787 sethostent_r_proto='$sethostent_r_proto'
23788 setlocale_r_proto='$setlocale_r_proto'
23789 setnetent_r_proto='$setnetent_r_proto'
23790 setprotoent_r_proto='$setprotoent_r_proto'
23791 setpwent_r_proto='$setpwent_r_proto'
23792 setservent_r_proto='$setservent_r_proto'
23795 sharpbang='$sharpbang'
23796 shmattype='$shmattype'
23797 shortsize='$shortsize'
23800 sig_count='$sig_count'
23801 sig_name='$sig_name'
23802 sig_name_init='$sig_name_init'
23804 sig_num_init='$sig_num_init'
23805 sig_size='$sig_size'
23806 signal_t='$signal_t'
23807 sitearch='$sitearch'
23808 sitearchexp='$sitearchexp'
23810 sitebinexp='$sitebinexp'
23811 sitehtml1dir='$sitehtml1dir'
23812 sitehtml1direxp='$sitehtml1direxp'
23813 sitehtml3dir='$sitehtml3dir'
23814 sitehtml3direxp='$sitehtml3direxp'
23816 sitelib_stem='$sitelib_stem'
23817 sitelibexp='$sitelibexp'
23818 siteman1dir='$siteman1dir'
23819 siteman1direxp='$siteman1direxp'
23820 siteman3dir='$siteman3dir'
23821 siteman3direxp='$siteman3direxp'
23822 siteprefix='$siteprefix'
23823 siteprefixexp='$siteprefixexp'
23824 sitescript='$sitescript'
23825 sitescriptexp='$sitescriptexp'
23826 sizesize='$sizesize'
23827 sizetype='$sizetype'
23831 sockethdr='$sockethdr'
23832 socketlib='$socketlib'
23833 socksizetype='$socksizetype'
23835 spackage='$spackage'
23836 spitshell='$spitshell'
23837 srand48_r_proto='$srand48_r_proto'
23838 srandom_r_proto='$srandom_r_proto'
23840 ssizetype='$ssizetype'
23841 st_ino_sign='$st_ino_sign'
23842 st_ino_size='$st_ino_size'
23843 startperl='$startperl'
23845 static_ext='$static_ext'
23847 stdio_base='$stdio_base'
23848 stdio_bufsiz='$stdio_bufsiz'
23849 stdio_cnt='$stdio_cnt'
23850 stdio_filbuf='$stdio_filbuf'
23851 stdio_ptr='$stdio_ptr'
23852 stdio_stream_array='$stdio_stream_array'
23853 strerror_r_proto='$strerror_r_proto'
23856 subversion='$subversion'
23861 targetarch='$targetarch'
23862 targetdir='$targetdir'
23863 targetenv='$targetenv'
23864 targethost='$targethost'
23865 targetmkdir='$targetmkdir'
23866 targetport='$targetport'
23867 targetsh='$targetsh'
23871 timeincl='$timeincl'
23872 timetype='$timetype'
23873 tmpnam_r_proto='$tmpnam_r_proto'
23879 ttyname_r_proto='$ttyname_r_proto'
23888 uidformat='$uidformat'
23894 uquadtype='$uquadtype'
23895 use5005threads='$use5005threads'
23896 use64bitall='$use64bitall'
23897 use64bitint='$use64bitint'
23898 usecrosscompile='$usecrosscompile'
23899 usedevel='$usedevel'
23901 usedtrace='$usedtrace'
23902 usefaststdio='$usefaststdio'
23903 useithreads='$useithreads'
23904 usekernprocpathname='$usekernprocpathname'
23905 uselargefiles='$uselargefiles'
23906 uselongdouble='$uselongdouble'
23907 usemallocwrap='$usemallocwrap'
23908 usemorebits='$usemorebits'
23909 usemultiplicity='$usemultiplicity'
23910 usemymalloc='$usemymalloc'
23912 usensgetexecutablepath='$usensgetexecutablepath'
23913 useopcode='$useopcode'
23914 useperlio='$useperlio'
23915 useposix='$useposix'
23916 usereentrant='$usereentrant'
23917 userelocatableinc='$userelocatableinc'
23918 useshrplib='$useshrplib'
23919 usesitecustomize='$usesitecustomize'
23920 usesocks='$usesocks'
23921 usethreads='$usethreads'
23922 usevendorprefix='$usevendorprefix'
23923 useversionedarchname='$useversionedarchname'
23924 usevfork='$usevfork'
23927 uvXUformat='$uvXUformat'
23928 uvoformat='$uvoformat'
23931 uvuformat='$uvuformat'
23932 uvxformat='$uvxformat'
23934 vendorarch='$vendorarch'
23935 vendorarchexp='$vendorarchexp'
23936 vendorbin='$vendorbin'
23937 vendorbinexp='$vendorbinexp'
23938 vendorhtml1dir='$vendorhtml1dir'
23939 vendorhtml1direxp='$vendorhtml1direxp'
23940 vendorhtml3dir='$vendorhtml3dir'
23941 vendorhtml3direxp='$vendorhtml3direxp'
23942 vendorlib='$vendorlib'
23943 vendorlib_stem='$vendorlib_stem'
23944 vendorlibexp='$vendorlibexp'
23945 vendorman1dir='$vendorman1dir'
23946 vendorman1direxp='$vendorman1direxp'
23947 vendorman3dir='$vendorman3dir'
23948 vendorman3direxp='$vendorman3direxp'
23949 vendorprefix='$vendorprefix'
23950 vendorprefixexp='$vendorprefixexp'
23951 vendorscript='$vendorscript'
23952 vendorscriptexp='$vendorscriptexp'
23954 version_patchlevel_string='$version_patchlevel_string'
23955 versiononly='$versiononly'
23959 yaccflags='$yaccflags'
23964 : add special variables
23965 $test -f $src/patchlevel.h && \
23966 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23967 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23968 echo "PERL_CONFIG_SH=true" >>config.sh
23970 : propagate old symbols
23971 if $test -f UU/config.sh; then
23972 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23973 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23974 config.sh config.sh UU/oldconfig.sh |\
23975 $sort | $uniq -u >UU/oldsyms
23976 set X `$cat UU/oldsyms`
23982 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23984 echo ": Variables propagated from previous config.sh file." >>config.sh
23985 for sym in `$cat UU/oldsyms`; do
23986 echo " Propagating $hint variable "'$'"$sym..."
23987 eval 'tmp="$'"${sym}"'"'
23989 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23995 : Finish up by extracting the .SH files
23999 echo "Extraction done."
24009 If you'd like to make any changes to the config.sh file before I begin
24010 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24013 rp="Press return or use a shell escape to edit config.sh:"
24018 *) : in case they cannot read
24019 sh 1>&4 -c "$ans";;
24024 : if this fails, just run all the .SH files by hand
24033 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24040 Now you need to generate make dependencies by running "$make depend".
24041 You might prefer to run it in background: "$make depend > makedepend.out &"
24042 It can take a while, so you might not want to run it right now.
24047 rp="Run $make depend now?"
24051 $make depend && echo "Now you must run '$make'."
24054 echo "You must run '$make depend' then '$make'."
24057 elif test -f [Mm]akefile; then
24059 echo "Now you must run a $make."
24061 echo "Configure done."
24064 if $test -f Policy.sh; then
24067 If you compile $package on a different machine or from a different object
24068 directory, copy the Policy.sh file from this object directory to the
24069 new one before you run Configure -- this will help you with most of
24070 the policy defaults.
24074 if $test -f config.msg; then
24075 echo "Hmm. I also noted the following information while running:"
24077 $cat config.msg >&4
24080 $rm -f kit*isdone ark*isdone