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 Sun Mar 16 09:41:42 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
344 useversionedarchname=''
350 initialinstalllocation=''
379 d_attribute_deprecated=''
380 d_attribute_format=''
381 d_attribute_malloc=''
382 d_attribute_nonnull=''
383 d_attribute_noreturn=''
385 d_attribute_unused=''
386 d_attribute_warn_unused_result=''
387 d_printf_format_null=''
390 d_builtin_choose_expr=''
393 d_c99_variadic_macros=''
440 endhostent_r_proto=''
446 endprotoent_r_proto=''
452 endservent_r_proto=''
505 gethostbyaddr_r_proto=''
507 gethostbyname_r_proto=''
509 gethostent_r_proto=''
522 getnetbyaddr_r_proto=''
524 getnetbyname_r_proto=''
538 d_getprotobyname_r=''
539 getprotobyname_r_proto=''
540 d_getprotobynumber_r=''
541 getprotobynumber_r_proto=''
543 getprotoent_r_proto=''
555 getservbyname_r_proto=''
557 getservbyport_r_proto=''
559 getservent_r_proto=''
586 d_libm_lib_version=''
589 d_localtime_r_needs_tzset=''
600 d_malloc_good_size=''
644 d_old_pthread_create_joinable=''
645 old_pthread_create_joinable=''
647 d_pthread_attr_setscope=''
686 sethostent_r_proto=''
703 setprotoent_r_proto=''
715 setservent_r_proto=''
737 d_ipv6_mreq_source=''
754 d_sprintf_returns_strlen=''
766 perl_static_inline=''
771 d_stdio_ptr_lval_nochange_cnt=''
772 d_stdio_ptr_lval_sets_cnt=''
917 d_gdbm_ndbm_h_uses_prototypes=''
918 d_gdbmndbm_h_uses_prototypes=''
920 d_ndbm_h_uses_prototypes=''
994 d_inc_version_list=''
996 inc_version_list_init=''
1000 installusrbinperl=''
1016 ignore_versioned_solibs=''
1080 d_perl_otherlibdirs=''
1088 api_versionstring=''
1094 version_patchlevel_string=''
1098 d_nv_preserves_uv=''
1099 d_nv_zero_is_allbits_zero=''
1110 nv_overflows_integers_at=''
1111 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 if $test "X$targetenv" = "X"; then
2847 case "$usecrosscompile" in
2849 $echo "Cross-compiling..."
2852 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2853 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2854 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2855 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2856 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2857 # leave out ld, choosing it is more complex
2858 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2859 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2860 # We are in a weird spot. Just before us, some values
2861 # were 'saved', to be restored after the hints are
2862 # run. This means that the changes we made to ar,
2863 # nm and ranlib will get reverted.
2864 # To avoid that, we hijack the saving mechanism and
2865 # have it save our new values.
2866 for file in ar nm ranlib; do
2868 eval $file=$xxx$_exe
2873 case "$targetarch" in
2874 '') echo "Targetarch not defined." >&4; croak=y ;;
2875 *) echo "Using targetarch $targetarch." >&4 ;;
2877 case "$targethost" in
2878 '') echo "Targethost not defined." >&4; croak=y ;;
2879 *) echo "Using targethost $targethost." >&4
2884 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2886 : compile a host miniperl and generate_uudmap, unless we got passed them
2887 if $test "X$hostperl" = X; then
2888 echo "Building host miniperl and generate_uudmap binaries" >&4
2896 $src/Configure -des -Dusedevel -Dmksymlinks
2898 case "$hostgenerate" in
2899 '') $make generate_uudmap
2900 hostgenerate=$src/host/generate_uudmap
2902 "$undef") hostgenerate=''
2905 hostperl=$src/host/miniperl
2908 hostosname=`$hostperl -le 'print $^O'`
2911 usecrosscompile="$undef"
2915 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2916 case "$targethost" in
2917 '') echo "Checking for cross-compile" >&4
2918 case "$usecrosscompile$multiarch" in
2919 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2920 if [ -f Makefile ]; then
2922 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2924 echo "Configure done."
2928 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2935 *) echo "Using targethost $targethost." >&4
2937 /*) run=$src/Cross/run
2938 targetmkdir=$src/Cross/mkdir
2940 from=$src/Cross/from
2942 *) pwd=`$test -f ../Configure & cd ..; pwd`
2944 targetmkdir=$pwd/Cross/mkdir
2946 from=$pwd/Cross/from
2949 case "$targetrun" in
2950 '') targetrun=ssh ;;
2955 case "$targetfrom" in
2956 '') targetfrom=scp ;;
2960 from=$from-$targetfrom
2961 case "$targetdir" in
2963 echo "Guessing targetdir $targetdir." >&4
2966 case "$targetuser" in
2968 echo "Guessing targetuser $targetuser." >&4
2971 case "$targetport" in
2973 echo "Guessing targetport $targetport." >&4
2976 case "$targetfrom" in
2980 case "$targetrun" in
3000 '') cwd=$targetdir ;;
3005 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3011 *) echo "Unknown targetrun '$targetrun'" >&4
3015 case "$targetmkdir" in
3017 cat >$targetmkdir <<EOF
3019 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3021 $chmod a+rx $targetmkdir
3023 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3035 $targetmkdir \`dirname \$f\`
3036 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3039 $targetmkdir $targetdir/\`dirname \$f\`
3040 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3053 $mkdir -p $targetdir/\`dirname \$f\`
3054 $cp \$f $targetdir/\$f || exit 1
3057 $targetmkdir $targetdir/\`dirname \$f\`
3058 $cp \$f $targetdir/\$f || exit 1
3065 *) echo "Unknown targetto '$targetto'" >&4
3069 case "$targetfrom" in
3076 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3081 cp) cat >$from <<EOF
3086 cp $targetdir/\$f . || exit 1
3091 *) echo "Unknown targetfrom '$targetfrom'" >&4
3095 if $test ! -f $run; then
3096 echo "Target 'run' script '$run' not found." >&4
3100 if $test ! -f $to; then
3101 echo "Target 'to' script '$to' not found." >&4
3105 if $test ! -f $from; then
3106 echo "Target 'from' script '$from' not found." >&4
3110 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3114 Using '$run' for remote execution,
3115 and '$from' and '$to'
3116 for remote file transfer.
3122 usecrosscompile="$undef"
3127 : see whether [:lower:] and [:upper:] are supported character classes
3129 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3131 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3135 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3136 # (0xd9 and 0xe2), therefore that is a nice testing point.
3137 if test "X$up" = X -o "X$low" = X; then
3138 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3144 if test "X$up" = X -o "X$low" = X; then
3145 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3151 if test "X$up" = X -o "X$low" = X; then
3152 case "`echo RS | od -x 2>/dev/null`" in
3154 echo "Hey, this might be EBCDIC." >&4
3155 if test "X$up" = X -o "X$low" = X; then
3156 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3157 rs) up='[A-IJ-RS-Z]'
3162 if test "X$up" = X -o "X$low" = X; then
3163 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3173 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3175 echo "Using $up and $low to convert case." >&4
3178 echo "I don't know how to translate letters from upper to lower case." >&4
3179 echo "Your tr is not acting any way I know of." >&4
3183 : set up the translation script tr, must be called with ./tr of course
3187 '[A-Z][a-z]') exec $tr '$up' '$low';;
3188 '[a-z][A-Z]') exec $tr '$low' '$up';;
3195 : Try to determine whether config.sh was made on this system
3196 case "$config_sh" in
3198 myuname=`$uname -a 2>/dev/null`
3199 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3200 # Downcase everything to avoid ambiguity.
3201 # Remove slashes and single quotes so we can use parts of this in
3202 # directory and file names.
3203 # Remove newlines so myuname is sane to use elsewhere.
3204 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3205 # because the A-Z/a-z are not consecutive.
3206 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3207 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3208 newmyuname="$myuname"
3210 case "$knowitall" in
3212 if test -f ../config.sh; then
3213 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3214 eval "`grep myuname= ../config.sh`"
3216 if test "X$myuname" = "X$newmyuname"; then
3224 : Get old answers from old config file if Configure was run on the
3225 : same system, otherwise use the hints.
3228 if test -f config.sh; then
3230 rp="I see a config.sh file. Shall I use it to set the defaults?"
3233 n*|N*) echo "OK, I'll ignore it."
3234 mv config.sh config.sh.old
3235 myuname="$newmyuname"
3237 *) echo "Fetching default answers from your old config.sh file..." >&4
3245 : Older versions did not always set $sh. Catch re-use of such
3255 if test ! -f config.sh; then
3258 First time through, eh? I have some defaults handy for some systems
3259 that need some extra help getting the Configure answers right:
3262 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3264 : Half the following guesses are probably wrong... If you have better
3265 : tests or hints, please send them to perlbug@perl.org
3266 : The metaconfig authors would also appreciate a copy...
3267 $test -f /irix && osname=irix
3268 $test -f /xenix && osname=sco_xenix
3269 $test -f /dynix && osname=dynix
3270 $test -f /dnix && osname=dnix
3271 $test -f /lynx.os && osname=lynxos
3272 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3273 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3274 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3275 $test -f /bin/mips && /bin/mips && osname=mips
3276 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3277 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3278 $test -d /usr/apollo/bin && osname=apollo
3279 $test -f /etc/saf/_sactab && osname=svr4
3280 $test -d /usr/include/minix && osname=minix
3281 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3282 if $test -d /MachTen -o -d /MachTen_Folder; then
3284 if $test -x /sbin/version; then
3285 osvers=`/sbin/version | $awk '{print $2}' |
3286 $sed -e 's/[A-Za-z]$//'`
3287 elif $test -x /usr/etc/version; then
3288 osvers=`/usr/etc/version | $awk '{print $2}' |
3289 $sed -e 's/[A-Za-z]$//'`
3295 $test -f /sys/posix.dll &&
3296 $test -f /usr/bin/what &&
3297 set X `/usr/bin/what /sys/posix.dll` &&
3298 $test "$3" = UWIN &&
3302 if $test -f $uname; then
3310 umips) osname=umips ;;
3313 [23]100) osname=mips ;;
3314 next*) osname=next ;;
3316 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3317 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3320 elif $test -f /etc/kconfig; then
3322 if test "$lns" = "$ln -s"; then
3324 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3326 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3333 if test -n "$DJGPP"; then
3342 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3344 # oslevel can fail with:
3345 # oslevel: Unable to acquire lock.
3346 *not\ found) osvers="$4"."$3" ;;
3347 '<3240'|'<>3240') osvers=3.2.0 ;;
3348 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3349 '=3250'|'>3250') osvers=3.2.5 ;;
3353 bitrig) osname=bitrig
3356 bsd386) osname=bsd386
3359 cygwin*) osname=cygwin
3362 *dc.osx) osname=dcosx
3368 domainos) osname=apollo
3374 dragonfly) osname=dragonfly
3377 dynixptx*) osname=dynixptx
3378 osvers=`echo "$4"|sed 's/^v//'`
3380 freebsd) osname=freebsd
3382 genix) osname=genix ;;
3386 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3399 $test -f /system/lib/libandroid.so && osname=linux-android
3403 netbsd*) osname=netbsd
3406 news-os) osvers="$3"
3408 4*) osname=newsos4 ;;
3412 next*) osname=next ;;
3413 nonstop-ux) osname=nonstopux ;;
3414 openbsd) osname=openbsd
3420 POSIX-BC | posix-bc ) osname=posix-bc
3423 powerux | power_ux | powermax_os | powermaxos | \
3424 powerunix | power_unix) osname=powerux
3430 solaris) osname=solaris
3432 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3439 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3443 titanos) osname=titanos
3452 ultrix) osname=ultrix
3455 osf1|mls+) case "$5" in
3458 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3461 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3464 hp*) osname=hp_osf1 ;;
3465 mips) osname=mips_osf1 ;;
3468 # UnixWare 7.1.2 is known as Open UNIX 8
3469 openunix|unixware) osname=svr5
3477 $2) case "$osname" in
3481 : svr4.x or possibly later
3491 if test -f /stand/boot ; then
3492 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3493 if test -n "$INITPROG" -a -f "$INITPROG"; then
3494 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3495 if test -n "$isesix"; then
3503 *) if test -f /etc/systemid; then
3505 set `echo $3 | $sed 's/\./ /g'` $4
3506 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3508 elif $test -f $src/hints/sco_$1_$2.sh; then
3510 elif $test -f $src/hints/sco_$1.sh; then
3515 '') : Still unknown. Probably a generic Sys V.
3524 *) case "$osname" in
3525 '') : Still unknown. Probably a generic BSD.
3533 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3534 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3535 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3538 $rm -f UU/kernel.what
3539 elif test -d c:/. -o -n "$is_os2" ; then
3546 case "$targetarch" in
3549 case "$targetarch" in
3551 # Will load qnx.sh, which should change osname to nto
3556 # Catch arm-linux-androideabi, mipsel-linux-android,
3557 # and i686-linux-android
3558 osname=linux-android
3562 # Something like arm-linux-gnueabihf is really just
3569 # XXX perhaps we should just assume
3570 # osvers to be 2, or maybe take the value
3571 # from targetarch. Using $run before the
3572 # hints are run is somewhat icky.
3573 set X `$run $uname -a 2>/dev/null`
3576 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3581 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3588 : Now look for a hint file osname_osvers, unless one has been
3589 : specified already.
3592 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3593 : Also try without trailing minor version numbers.
3594 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3595 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3596 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3597 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3600 *) case "$osvers" in
3603 *) if $test -f $src/hints/$file.sh ; then
3605 elif $test -f $src/hints/$xfile.sh ; then
3607 elif $test -f $src/hints/$xxfile.sh ; then
3609 elif $test -f $src/hints/$xxxfile.sh ; then
3611 elif $test -f $src/hints/$xxxxfile.sh ; then
3613 elif $test -f "$src/hints/${osname}.sh" ; then
3622 if $test -f Policy.sh ; then
3625 none) dflt="Policy" ;;
3626 *) dflt="Policy $dflt" ;;
3631 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3635 if $test -f Policy.sh ; then
3638 There's also a Policy hint file available, which should make the
3639 site-specific (policy) questions easier to answer.
3646 You may give one or more space-separated answers, or "none" if appropriate.
3647 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3648 previous run of Configure, you may specify it as well as or instead of
3649 OS-specific hints. If hints are provided for your OS, you should use them:
3650 although Perl can probably be built without hints on many platforms, using
3651 hints often improve performance and may enable features that Configure can't
3652 set up on its own. If there are no hints that match your OS, specify "none";
3653 DO NOT give a wrong version or a wrong OS.
3657 rp="Which of these apply, if any?"
3660 for file in $tans; do
3661 if $test X$file = XPolicy -a -f Policy.sh; then
3663 $cat Policy.sh >> UU/config.sh
3664 elif $test -f $src/hints/$file.sh; then
3665 . $src/hints/$file.sh
3666 $cat $src/hints/$file.sh >> UU/config.sh
3667 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3670 : Give one chance to correct a possible typo.
3671 echo "$file.sh does not exist"
3673 rp="hint to use instead?"
3675 for file in $ans; do
3676 if $test -f "$src/hints/$file.sh"; then
3677 . $src/hints/$file.sh
3678 $cat $src/hints/$file.sh >> UU/config.sh
3679 elif $test X$ans = X -o X$ans = Xnone ; then
3682 echo "$file.sh does not exist -- ignored."
3689 : Remember our hint file for later.
3690 if $test -f "$src/hints/$file.sh" ; then
3700 echo "Fetching default answers from $config_sh..." >&4
3704 cp $config_sh config.sh 2>/dev/null
3714 test "$override" && . ./optdef.sh
3716 : Restore computed paths
3717 for file in $loclist $trylist; do
3718 eval $file="\$_$file"
3723 Configure uses the operating system name and version to set some defaults.
3724 The default value is probably right if the name rings a bell. Otherwise,
3725 since spelling matters for me, either accept the default or answer "none"
3732 ''|' '|none) dflt=none ;;
3733 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3736 *) dflt="$osname" ;;
3738 rp="Operating system name?"
3742 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3748 ''|' '|none) dflt=none ;;
3749 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3750 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3752 ''|' ') dflt=none ;;
3757 *) dflt="$osvers" ;;
3759 rp="Operating system version?"
3769 : who configured the system
3770 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3773 cf_by=`(logname) 2>/dev/null`
3776 cf_by=`(whoami) 2>/dev/null`
3778 "") cf_by=unknown ;;
3783 : decide how portable to be. Allow command line overrides.
3784 case "$d_portable" in
3786 *) d_portable="$define" ;;
3789 : set up shell script to do ~ expansion
3795 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3798 if $test -f /bin/csh; then
3799 /bin/csh -f -c "glob \$1"
3804 name=\`$expr x\$1 : '..\([^/]*\)'\`
3805 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3806 if $test ! -d "\$dir"; then
3808 echo "\$me: can't locate home directory for: \$name" >&2
3813 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3829 : now set up to get a file name
3833 cat <<'EOSC' >>getfile
3849 : getfile will accept an answer from the comma-separated list
3850 : enclosed in parentheses even if it does not meet other criteria.
3851 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3852 fn=`echo $fn | sed 's/(.*)//'`
3858 loc_file=`expr $fn : '.*:\(.*\)'`
3859 fn=`expr $fn : '\(.*\):.*'`
3867 */*) fullpath=true;;
3876 *e*) exp_file=true;;
3879 *p*) nopath_ok=true;;
3884 *d*) type='Directory';;
3885 *l*) type='Locate';;
3890 Locate) what='File';;
3895 case "$d_portable" in
3903 while test "$type"; do
3908 true) rp="$rp (~name ok)";;
3911 if test -f UU/getfile.ok && \
3912 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3931 value=`UU/filexp $ans`
3934 if test "$ans" != "$value"; then
3935 echo "(That expands to $value on this system.)"
3949 /*) value="$ansexp" ;;
3950 [a-zA-Z]:/*) value="$ansexp" ;;
3955 echo "I shall only accept a full path name, as in /bin/ls." >&4
3956 echo "Use a ! shell escape if you wish to check pathnames." >&4
3959 echo "Please give a full path name, starting with slash." >&4
3962 echo "Note that using ~name is ok provided it expands well." >&4
3975 for fp in $gfpth; do
3976 if test "X$fp" = X.; then
3981 if test -f "$pf"; then
3983 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3985 echo "($value is not a plain file, but that's ok.)"
3988 if test X"$type" = X; then
3995 for fp in $gfpth; do
3996 if test "X$fp" = X.; then
4001 direxp="$fp/$ansexp"
4003 if test -d "$direxp"; then
4011 if test -d "$ansexp"; then
4012 echo "(Looking for $loc_file in directory $value.)"
4013 value="$value/$loc_file"
4014 ansexp="$ansexp/$loc_file"
4016 if test -f "$ansexp"; then
4019 case "$nopath_ok" in
4020 true) case "$value" in
4022 *) echo "Assuming $value will be in people's path."
4038 if test "$fastread" = yes; then
4043 rp="$what $value doesn't exist. Use that name anyway?"
4062 test "X$gfpthkeep" != Xy && gfpth=""
4065 : determine root of directory hierarchy where package will be installed.
4068 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4071 dflt=`echo "$prefix" | sed 's/.$//'`
4079 By default, $package will be installed in $dflt/bin, manual pages
4080 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4081 installation directories. Typically this is something like /usr/local.
4082 If you wish to have binaries under /usr/bin but other parts of the
4083 installation under /usr/local, that's ok: you will be prompted
4084 separately for each of the installation directories, the prefix being
4085 only used to set the defaults.
4089 rp='Installation prefix to use?'
4097 *) oldprefix="$prefix";;
4104 : allow them to override the AFS root
4107 *) afsroot=$afsroot ;;
4113 $define|true) afs=true ;;
4114 $undef|false) afs=false ;;
4115 *) if $test -d $afsroot; then
4123 echo "AFS may be running... I'll be extra cautious then..." >&4
4125 echo "AFS does not seem to be running..." >&4
4128 : determine installation prefix for where package is to be installed.
4132 Since you are running AFS, I need to distinguish the directory in which
4133 files will reside from the directory in which they are installed (and from
4134 which they are presumably copied to the former directory by occult means).
4137 case "$installprefix" in
4138 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4139 *) dflt="$installprefix";;
4144 In some special cases, particularly when building $package for distribution,
4145 it is convenient to distinguish the directory in which files should be
4146 installed from the directory ($prefix) in which they will
4147 eventually reside. For most users, these two directories are the same.
4150 case "$installprefix" in
4152 *) dflt=$installprefix;;
4156 rp='What installation prefix should I use for installing files?'
4158 installprefix="$ans"
4159 installprefixexp="$ansexp"
4161 : Perform the prefixexp/installprefixexp correction if necessary
4162 cat <<EOS >installprefix
4165 cat <<'EOSC' >>installprefix
4166 : Change installation prefix, if necessary.
4167 if $test X"$prefix" != X"$installprefix"; then
4168 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4170 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4173 chmod +x installprefix
4174 $eunicefix installprefix
4176 : Set variables such as privlib and privlibexp from the output of ./getfile
4177 : performing the prefixexp/installprefixexp correction if necessary.
4178 cat <<EOS >setprefixvar
4181 cat <<'EOSC' >>setprefixvar
4182 eval "${prefixvar}=\"\$ans\""
4183 eval "${prefixvar}exp=\"\$ansexp\""
4186 chmod +x setprefixvar
4187 $eunicefix setprefixvar
4189 : set up the script used to warn in case of inconsistency
4198 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4200 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4201 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4206 echo "*** WHOA THERE!!! ***" >&4
4207 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4210 rp=" Keep the $hint value?"
4213 y) td=$was; tu=$was;;
4217 : function used to set '$1' to '$val'
4218 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4220 $define$undef) . ./whoa; eval "$var=\$td";;
4221 $undef$define) . ./whoa; eval "$var=\$tu";;
4222 *) eval "$var=$val";;
4225 : get the patchlevel
4227 echo "Getting the current patchlevel..." >&4
4228 if $test -r $rsrc/patchlevel.h;then
4229 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4230 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4231 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4232 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4233 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4234 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4235 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4244 $echo "(You do not have patchlevel.h. Eek.)"
4246 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4247 version_patchlevel_string="version $patchlevel subversion $subversion"
4248 case "$perl_patchlevel" in
4250 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4251 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4255 $echo "(You have $package $version_patchlevel_string.)"
4259 : XXX Should be a Configure test for double-dots in filenames.
4260 version=`echo $revision $patchlevel $subversion | \
4261 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4262 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4263 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4266 version=`echo $revision $patchlevel $subversion | \
4267 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4268 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4269 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4272 : Special case the 5.005_xx maintenance series, which used 5.005
4273 : without any subversion label as a subdirectory in $sitelib
4274 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4275 api_versionstring='5.005'
4278 : Do we want threads support and if so, what type
4279 case "$usethreads" in
4280 $define|true|[yY]*) dflt='y';;
4281 *) # Catch case where user specified ithreads or 5005threads but
4282 # forgot -Dusethreads (A.D. 4/2002)
4283 case "$useithreads$use5005threads" in
4284 *$define*) dflt='y';;
4291 Perl can be built to offer a form of threading support on some systems
4292 To do so, Configure can be run with -Dusethreads.
4294 Note that Perl built with threading support runs slightly slower
4295 and uses slightly more memory than plain Perl.
4297 If this doesn't make any sense to you, just accept the default '$dflt'.
4299 rp='Build a threading Perl?'
4302 y|Y) val="$define" ;;
4308 if $test $patchlevel -lt 9; then
4309 case "$usethreads" in
4311 : Default to ithreads unless overridden on command line or with
4314 case "$use5005threads" in
4316 echo "5.005 threads are no longer supported"
4320 case "$useithreads" in
4321 $undef|false|[nN]*) dflt='n';;
4323 rp='Use the newer interpreter-based ithreads?'
4326 y|Y) val="$define" ;;
4331 : Now set use5005threads to the opposite value.
4332 case "$useithreads" in
4333 $define) val="$undef" ;;
4340 useithreads="$undef"
4341 use5005threads="$undef"
4345 case "$useithreads$use5005threads" in
4349 You cannot have both the ithreads and the 5.005 threads enabled
4350 at the same time. Disabling the 5.005 threads since they are
4351 much less stable than the ithreads.
4354 use5005threads="$undef"
4359 : perl-5.9.x and later
4361 if test X"$usethreads" = "X$define"; then
4362 case "$use5005threads" in
4366 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4373 use5005threads="$undef"
4374 useithreads="$usethreads"
4377 case "$d_oldpthreads" in
4378 '') : Configure tests would be welcome here. For now, assume undef.
4380 *) val="$d_oldpthreads" ;;
4386 : Look for a hint-file generated 'call-back-unit'. If the
4387 : user has specified that a threading perl is to be built,
4388 : we may need to set or change some other defaults.
4389 if $test -f usethreads.cbu; then
4390 echo "Your platform has some specific hints regarding threaded builds, using them..."
4393 case "$usethreads" in
4394 "$define"|true|[yY]*)
4396 (Your platform does not have any specific hints for threaded builds.
4397 Assuming POSIX threads, then.)
4403 : Check if multiplicity is required
4406 Perl can be built so that multiple Perl interpreters can coexist
4407 within the same Perl executable.
4410 case "$useithreads" in
4413 This multiple interpreter support is required for interpreter-based threads.
4417 *) case "$usemultiplicity" in
4418 $define|true|[yY]*) dflt='y';;
4422 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4423 rp='Build Perl for multiplicity?'
4426 y|Y) val="$define" ;;
4434 : Check if morebits is requested
4435 case "$usemorebits" in
4436 "$define"|true|[yY]*)
4437 use64bitint="$define"
4438 uselongdouble="$define"
4439 usemorebits="$define"
4441 *) usemorebits="$undef"
4445 : Determine the C compiler to be used
4451 rp="Use which C compiler?"
4455 : See whether they have no cc but they do have gcc
4457 if $test -f cc.cbu; then
4462 : make some quick guesses about what we are up against
4464 $echo $n "Hmm... $c"
4474 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4475 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4477 echo "Looks kind of like an OSF/1 system, but we'll see..."
4479 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4480 xxx=`./loc addbib blurfl $pth`
4481 if $test -f $xxx; then
4482 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4486 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4487 echo "Looks kind of like an extended USG system, but we'll see..."
4489 echo "Looks kind of like a USG system, but we'll see..."
4493 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4494 echo "Looks kind of like a BSD system, but we'll see..."
4498 echo "Looks kind of like a Version 7 system, but we'll see..."
4501 case "$eunicefix" in
4504 There is, however, a strange, musty smell in the air that reminds me of
4505 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4509 : it so happens the Eunice I know will not run shell scripts in Unix format
4513 echo "Congratulations. You aren't running Eunice."
4517 : Detect OS2. The p_ variable is set above in the Head.U unit.
4518 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4519 : semicolon as a patch separator
4524 I have the feeling something is not exactly right, however...don't tell me...
4525 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4526 (Or you may be running DOS with DJGPP.)
4531 if test -f /xenix; then
4532 echo "Actually, this looks more like a XENIX system..."
4537 echo "It's not Xenix..."
4542 if test -f /venix; then
4543 echo "Actually, this looks more like a VENIX system..."
4550 echo "Nor is it Venix..."
4553 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4554 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4557 : Check if we are using GNU gcc and what its version is
4559 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4563 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4565 printf("%s\n", __VERSION__);
4567 printf("%s\n", "1");
4573 if $cc -o try $ccflags $ldflags try.c; then
4574 gccversion=`$run ./try`
4575 case "$gccversion" in
4576 '') echo "You are not using GNU cc." ;;
4577 *) echo "You are using GNU cc $gccversion."
4583 echo "*** WHOA THERE!!! ***" >&4
4584 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4585 case "$knowitall" in
4587 echo " You'd better start hunting for one and let me know about it." >&4
4593 case "$gccversion" in
4594 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4596 case "$gccversion" in
4597 '') gccosandvers='' ;;
4598 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4599 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4601 case "$gccosandvers" in
4602 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4603 $osname$osvers) ;; # looking good
4604 $osname*) cat <<EOM >&4
4606 *** WHOA THERE!!! ***
4608 Your gcc has not been compiled for the exact release of
4609 your operating system ($gccosandvers versus $osname$osvers).
4611 In general it is a good idea to keep gcc synchronized with
4612 the operating system because otherwise serious problems
4613 may ensue when trying to compile software, like Perl.
4615 I'm trying to be optimistic here, though, and will continue.
4616 If later during the configuration and build icky compilation
4617 problems appear (headerfile conflicts being the most common
4618 manifestation), I suggest reinstalling the gcc to match
4619 your operating system release.
4623 *) gccosandvers='' ;; # failed to parse, better be silent
4631 # gcc 3.* complain about adding -Idirectories that they already know about,
4632 # so we will take those off from locincpth.
4633 case "$gccversion" in
4635 echo "main(){}">try.c
4636 for incdir in $locincpth; do
4637 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4638 grep '^c[cp]p*[01]: warning: changing search order '`
4639 if test "X$warn" != X; then
4640 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4646 : What should the include directory be ?
4647 : Use sysroot if set, so findhdr looks in the right place.
4649 $echo $n "Hmm... $c"
4650 dflt="$sysroot/usr/include"
4653 if $test -f /bin/mips && /bin/mips; then
4654 echo "Looks like a MIPS system..."
4655 $cat >usr.c <<'EOCP'
4656 #ifdef SYSTYPE_BSD43
4660 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4661 dflt='/bsd43/usr/include'
4665 mips_type='System V'
4667 $rm -f usr.c usr.out
4668 echo "and you're compiling with the $mips_type compiler and libraries."
4672 echo "Doesn't look like a MIPS system."
4682 case "$xxx_prompt" in
4685 rp='Where are the include files you want to use?'
4693 : see how we invoke the C preprocessor
4695 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4696 cat <<'EOT' >testcpp.c
4702 if test ! -f cppstdin; then
4703 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4704 # AIX cc -E doesn't show the absolute headerfile
4705 # locations but we'll cheat by using the -M flag.
4706 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
4708 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4711 echo "Keeping your $hint cppstdin wrapper."
4714 wrapper=`pwd`/cppstdin
4718 if $test "X$cppstdin" != "X" && \
4719 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4720 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4722 echo "You used to use $cppstdin $cppminus so we'll use that again."
4724 '') echo "But let's see if we can live without a wrapper..." ;;
4726 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4727 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4729 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4732 echo "(However, $cpprun $cpplast does not work, let's see...)"
4740 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4747 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4748 $cc -E <testcpp.c >testcpp.out 2>&1; \
4749 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4750 echo "Yup, it does."
4751 x_cpp="$cc $cppflags -E"
4753 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4754 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4755 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4756 echo "Yup, it does."
4757 x_cpp="$cc $cppflags -E"
4759 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4760 $cc -P <testcpp.c >testcpp.out 2>&1; \
4761 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4762 echo "Yipee, that works!"
4763 x_cpp="$cc $cppflags -P"
4765 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4766 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4767 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4768 echo "At long last!"
4769 x_cpp="$cc $cppflags -P"
4771 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4772 $cpp <testcpp.c >testcpp.out 2>&1; \
4773 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4775 x_cpp="$cpp $cppflags"
4777 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4778 $cpp - <testcpp.c >testcpp.out 2>&1; \
4779 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4780 echo "Hooray, it works! I was beginning to wonder."
4781 x_cpp="$cpp $cppflags"
4783 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4784 $wrapper <testcpp.c >testcpp.out 2>&1; \
4785 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4791 rp="No dice. I can't find a C preprocessor. Name one:"
4795 $x_cpp <testcpp.c >testcpp.out 2>&1
4796 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4797 echo "OK, that will do." >&4
4799 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4814 echo "Perhaps can we force $cc -E using a wrapper..."
4815 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4816 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4822 echo "Nope, we'll have to live without it..."
4836 "$wrapper"|'cppstdin') ;;
4837 *) $rm -f $wrapper;;
4839 $rm -f testcpp.c testcpp.out
4841 : Adjust cppfilter for path component separator
4843 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4844 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4848 : Use gcc to determine libpth and incpth
4849 # If using gcc or clang, we can get better values for libpth, incpth
4850 # and usrinc directly from the compiler.
4851 # Note that ccname for clang is also gcc.
4854 $echo 'extern int foo;' > try.c
4855 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4857 if $test $# -gt 0; then
4859 incpth="`$echo $incpth|$sed 's/^ //'`"
4861 j="`$echo $i|$sed 's,/include$,/lib,'`"
4862 if $test -d $j; then
4866 libpth="`$echo $libpth|$sed 's/^ //'`"
4867 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4868 if $test -d $xxx; then
4871 *) libpth="$libpth $xxx";;
4878 '') for i in $incpth; do
4879 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4887 case "$usecrosscompile" in
4890 '') echo "Incpth not defined." >&4; croak=y ;;
4891 *) echo "Using incpth '$incpth'." >&4 ;;
4894 '') echo "Libpth not defined." >&4; croak=y ;;
4895 *) echo "Using libpth '$libpth'." >&4 ;;
4898 '') echo "Usrinc not defined." >&4; croak=y ;;
4899 *) echo "Using usrinc $usrinc." >&4 ;;
4903 if test "X$sysroot" = X; then
4904 echo "Cannot continue, aborting." >&4; exit 1
4906 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4915 : Default value for incpth is just usrinc
4917 '') incpth="$usrinc";;
4920 : Set private lib path
4923 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4928 '') dlist="$loclibpth $plibpth $glibpth";;
4929 *) dlist="$libpth";;
4932 : Now check and see which directories actually exist, avoiding duplicates
4935 if $test -d $xxx; then
4938 *) libpth="$libpth $xxx";;
4944 Some systems have incompatible or broken versions of libraries. Among
4945 the directories listed in the question below, please remove any you
4946 know not to be holding relevant libraries, and add any that are needed.
4947 Say "none" for none.
4951 if test "X$sysroot" != X; then
4953 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4966 rp="Directories to use for library searches?"
4973 : compute shared library extension
4976 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4986 On some systems, shared libraries may be available. Answer 'none' if
4987 you want to suppress searching of shared libraries for the remainder
4988 of this configuration.
4991 rp='What is the file extension used for shared libraries?'
4995 : Does target system insist that shared library basenames are unique
4998 Some dynamic loaders assume that the *basename* of shared library filenames
4999 are globally unique. We'll default this to undef as we assume your system
5000 is not this weird. Set to defined if you're on one of them.
5005 rp='Make shared library basenames unique?'
5008 y|Y) val="$define" ;;
5011 set d_libname_unique
5014 : Define several unixisms.
5015 : Hints files or command line option can be used to override them.
5016 : The convoluted testing is in case hints files set either the old
5019 '') case "$exe_ext" in
5021 *) _exe="$exe_ext" ;;
5026 '') case "$lib_ext" in
5033 '') case "$obj_ext" in
5040 '') case "$path_sep" in
5051 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5053 : Which makefile gets called first. This is used by make depend.
5054 case "$firstmakefile" in
5055 '') firstmakefile='makefile';;
5058 : Check is we will use socks
5060 $define|true|[yY]*) dflt='y';;
5065 Perl can be built to use the SOCKS proxy protocol library. To do so,
5066 Configure must be run with -Dusesocks. If you use SOCKS you also need
5067 to use the PerlIO abstraction layer, this will be implicitly selected.
5069 If this doesn't make any sense to you, just accept the default '$dflt'.
5071 rp='Build Perl for SOCKS?'
5074 y|Y) val="$define" ;;
5080 : Check for uselongdouble support
5082 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5085 case "$uselongdouble" in
5086 $define|true|[yY]*) dflt='y';;
5091 Perl can be built to take advantage of long doubles which
5092 (if available) may give more accuracy and range for floating point numbers.
5094 If this doesn't make any sense to you, just accept the default '$dflt'.
5096 rp='Try to use long doubles if available?'
5099 y|Y) val="$define" ;;
5105 case "$uselongdouble" in
5106 true|[yY]*) uselongdouble="$define" ;;
5109 : Look for a hint-file generated 'call-back-unit'. If the
5110 : user has specified that long doubles should be used,
5111 : we may need to set or change some other defaults.
5112 if $test -f uselongdouble.cbu; then
5113 echo "Your platform has some specific hints regarding long doubles, using them..."
5114 . ./uselongdouble.cbu
5116 case "$uselongdouble" in
5119 (Your platform does not have any specific hints for long doubles.)
5125 : Looking for optional libraries
5127 echo "Checking for optional libraries..." >&4
5132 case "$libswanted" in
5133 '') libswanted='c_s';;
5136 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5142 for thisdir in $libpth $xlibpth; do
5143 test -d $thisdir && libspath="$libspath $thisdir"
5145 for thislib in $libswanted; do
5146 for thisdir in $libspath; do
5148 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5149 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5150 $test -f "$xxx" && eval $libscheck
5151 $test -f "$xxx" && libstyle=shared
5153 if test ! -f "$xxx"; then
5154 xxx=$thisdir/lib$thislib.$so
5155 $test -f "$xxx" && eval $libscheck
5156 $test -f "$xxx" && libstyle=shared
5158 if test ! -f "$xxx"; then
5159 xxx=$thisdir/lib$thislib$_a
5160 $test -f "$xxx" && eval $libscheck
5161 $test -f "$xxx" && libstyle=static
5163 if test ! -f "$xxx"; then
5164 xxx=$thisdir/$thislib$_a
5165 $test -f "$xxx" && eval $libscheck
5166 $test -f "$xxx" && libstyle=static
5168 if test ! -f "$xxx"; then
5169 xxx=$thisdir/lib${thislib}_s$_a
5170 $test -f "$xxx" && eval $libscheck
5171 $test -f "$xxx" && libstyle=static
5172 $test -f "$xxx" && thislib=${thislib}_s
5174 if test ! -f "$xxx"; then
5175 xxx=$thisdir/Slib$thislib$_a
5176 $test -f "$xxx" && eval $libscheck
5177 $test -f "$xxx" && libstyle=static
5179 if $test -f "$xxx"; then
5181 shared) echo "Found -l$thislib (shared)." ;;
5182 static) echo "Found -l$thislib." ;;
5183 *) echo "Found -l$thislib ($libstyle)." ;;
5187 *) dflt="$dflt -l$thislib"
5188 libsfound="$libsfound $xxx"
5190 libsfiles="$libsfiles $yyy"
5191 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5192 case " $libsdirs " in
5194 *) libsdirs="$libsdirs $yyy" ;;
5201 if $test ! -f "$xxx"; then
5202 echo "No -l$thislib."
5213 ' '|'') dflt='none';;
5218 In order to compile $package on your machine, a number of libraries
5219 are usually needed. Include any other special libraries here as well.
5220 Say "none" for none. The default list is almost always right.
5224 rp="What libraries to use?"
5231 : determine optimization, if desired, or use for debug flag also
5233 ' '|$undef) dflt='none';;
5235 *) dflt="$optimize";;
5239 By default, $package compiles with the -O flag to use the optimizer.
5240 Alternately, you might want to use the symbolic debugger, which uses
5241 the -g flag (on traditional Unix systems). Either flag can be
5242 specified here. To use neither flag, specify the word "none".
5245 rp="What optimizer/debugger flag should be used?"
5249 'none') optimize=" ";;
5252 : Check what DEBUGGING is required from the command line
5253 : -DEBUGGING or -DDEBUGGING or
5254 : -DEBUGGING=both = -g + -DDEBUGGING
5255 : -DEBUGGING=-g or -Doptimize=-g = -g
5256 : -DEBUGGING=none or -UDEBUGGING =
5257 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5260 *) DEBUGGING=$EBUGGING ;;
5263 case "$DEBUGGING" in
5267 *) optimize="$optimize -g" ;;
5271 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5279 case "$DEBUGGING" in
5280 both|$define) dflt='-DDEBUGGING'
5283 : argument order is deliberate, as the flag will start with - which set could
5284 : think is an option
5285 checkccflag='check=$1; flag=$2; callback=$3;
5287 echo "Checking if your compiler accepts $flag" 2>&1;
5288 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5289 echo "int main(void) { return 0; }" > gcctest.c;
5290 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5291 echo "Yes, it does." 2>&1;
5292 if $test -s gcctest.out ; then
5293 echo "But your platform does not like it:";
5298 echo "Leaving current flags $ccflags alone." 2>&1
5300 *) dflt="$dflt $flag";
5306 echo "Nope, it does not, but that is ok." 2>&1;
5310 : We will not override a previous value, but we might want to
5311 : augment a hint file
5313 default|recommended)
5314 case "$gccversion" in
5315 1*) dflt="$dflt -fpcc-struct-return" ;;
5317 case "$optimize:$DEBUGGING" in
5318 *-g*:old) dflt="$dflt -DDEBUGGING";;
5320 case "$gccversion" in
5321 2*) if $test -d /etc/conf/kconfig.d &&
5322 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5324 # Interactive Systems (ISC) POSIX mode.
5329 case "$gccversion" in
5332 ?*) set strict-aliasing -fno-strict-aliasing
5336 # For gcc, adding -pipe speeds up compilations for some, but apparently
5337 # some assemblers can't read from stdin. (It also slows down compilations
5338 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5339 case "$gccversion" in
5345 # on x86_64 (at least) we require an extra library (libssp) in the
5346 # link command line. This library is not named, so I infer that it is
5347 # an implementation detail that may change. Hence the safest approach
5348 # is to add the flag to the flags passed to the compiler at link time,
5349 # as that way the compiler can do the right implementation dependant
5351 case "$gccversion" in
5352 ?*) set stack-protector -fstack-protector
5359 case "$mips_type" in
5360 *BSD*|'') inclwanted="$locincpth $usrinc";;
5361 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5363 for thisincl in $inclwanted; do
5364 if $test -d $thisincl; then
5365 if $test x$thisincl != x$usrinc; then
5367 *" -I$thisincl "*);;
5368 *) dflt="$dflt -I$thisincl ";;
5374 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5376 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5384 *) dflt="$dflt -D$2";;
5388 set signal.h LANGUAGE_C; eval $inctest
5392 ccflags="$ccflags -DSOCKS"
5397 default|recommended) dflt="$ccflags $dflt" ;;
5398 *) dflt="$ccflags";;
5407 Your C compiler may want other flags. For this question you should include
5408 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5409 but you should NOT include libraries or ld flags like -lwhatever. If you
5410 want $package to honor its debug switch, you should include -DDEBUGGING here.
5411 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5413 To use no flags, specify the word "none".
5419 rp="Any additional cc flags?"
5426 : the following weeds options from ccflags that are of no interest to cpp
5428 '') cppflags="$ccflags" ;;
5429 *) cppflags="$cppflags $ccflags" ;;
5431 case "$gccversion" in
5432 1*) cppflags="$cppflags -D__GNUC__"
5434 case "$mips_type" in
5436 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5442 echo "Let me guess what the preprocessor flags are..." >&4
5456 *) ftry="$previous $flag";;
5458 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5459 >cpp1.out 2>/dev/null && \
5460 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5461 >cpp2.out 2>/dev/null && \
5462 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5463 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5465 cppflags="$cppflags $ftry"
5475 *-*) echo "They appear to be: $cppflags";;
5477 $rm -f cpp.c cpp?.out
5481 : flags used in final linking phase
5483 '') if ./venix; then
5489 *-posix*) dflt="$dflt -posix" ;;
5492 *) dflt="$ldflags";;
5494 # See note above about -fstack-protector
5496 *-fstack-protector*)
5498 *-fstack-protector*) ;; # Don't add it again
5499 *) dflt="$dflt -fstack-protector" ;;
5504 : Try to guess additional flags to pick up local libraries.
5505 for thislibdir in $libpth; do
5506 case " $loclibpth " in
5509 *"-L$thislibdir "*) ;;
5510 *) dflt="$dflt -L$thislibdir" ;;
5522 Your C linker may need flags. For this question you should
5523 include -L/whatever and any other flags used by the C linker, but you
5524 should NOT include libraries like -lwhatever.
5526 Make sure you include the appropriate -L/path flags if your C linker
5527 does not normally search all of the directories you specified above,
5530 To use no flags, specify the word "none".
5534 rp="Any additional ld flags (NOT including libraries)?"
5540 rmlist="$rmlist pdp11"
5544 echo "Checking your choice of C compiler and flags for coherency..." >&4
5545 $cat > try.c <<'EOF'
5547 int main() { printf("Ok\n"); return(0); }
5549 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5551 $cat >try.msg <<'EOM'
5552 I've tried to compile and run the following simple program:
5555 $cat try.c >> try.msg
5557 $cat >> try.msg <<EOM
5564 and I got the following output:
5568 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5569 if $sh -c "$run ./try " >>try.msg 2>&1; then
5573 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5576 echo "The program compiled OK, but exited with status $?." >>try.msg
5577 rp="You have a problem. Shall I abort Configure"
5581 echo "I can't compile the test program." >>try.msg
5582 rp="You have a BIG problem. Shall I abort Configure"
5588 case "$knowitall" in
5590 echo "(The supplied flags or libraries might be incorrect.)"
5598 *) echo "Ok. Stopping Configure." >&4
5603 n) echo "OK, that should do.";;
5605 $rm_try gcctest gcctest.out
5607 : define a shorthand compile call
5611 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5612 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5616 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5617 : define a shorthand compile call for compilations that should be ok.
5621 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5623 : determine filename position in cpp output
5625 echo "Computing filename position in cpp output for #include directives..." >&4
5627 vos) testaccess=-e ;;
5630 echo '#include <stdio.h>' > foo.c
5633 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5634 $grep '^[ ]*#.*stdio\.h' | \
5635 while read cline; do
5638 while $test \$# -gt 0; do
5639 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5644 pos=\`expr \$pos + 1\`
5656 *) pos="${fieldn}th";;
5658 echo "Your cpp writes the filename in the $pos field of the line."
5660 : locate header file
5665 for usrincdir in $incpth
5667 if test -f \$usrincdir/\$wanted; then
5668 echo "\$usrincdir/\$wanted"
5672 awkprg='{ print \$$fieldn }'
5673 echo "#include <\$wanted>" > foo\$\$.c
5674 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5675 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5676 while read cline; do
5677 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5679 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5680 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5685 # status = 0: grep returned 0 lines, case statement not executed
5686 # status = 1: headerfile found
5687 # status = 2: while loop executed, no headerfile found
5691 if test \$status -eq 1; then
5698 : define an alternate in-header-list? function
5699 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5700 cont=true; xxf="echo \"<\$1> found.\" >&4";
5701 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5702 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5704 case $# in 4) instead=instead;; *) instead="at last";; esac;
5705 while $test "$cont"; do
5707 var=$2; eval "was=\$$2";
5708 if $test "$xxx" && $test -r "$xxx";
5710 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5713 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5714 set $yyy; shift; shift; yyy=$@;
5715 case $# in 0) cont="";;
5716 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5717 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5718 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5719 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5723 do set $yyy; var=$2; eval "was=\$$2";
5724 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5725 set $yyy; shift; shift; yyy=$@;
5728 : see if stdlib is available
5729 set stdlib.h i_stdlib
5732 : check for lengths of integral types
5736 echo "Checking to see how big your integers are..." >&4
5745 printf("intsize=%d;\n", (int)sizeof(int));
5746 printf("longsize=%d;\n", (int)sizeof(long));
5747 printf("shortsize=%d;\n", (int)sizeof(short));
5752 if eval $compile_ok && $run ./try > /dev/null; then
5754 echo "Your integers are $intsize bytes long."
5755 echo "Your long integers are $longsize bytes long."
5756 echo "Your short integers are $shortsize bytes long."
5760 Help! I can't compile and run the intsize test program: please enlighten me!
5761 (This is probably a misconfiguration in your system or libraries, and
5762 you really ought to fix it. Still, I'll try anyway.)
5766 rp="What is the size of an integer (in bytes)?"
5770 rp="What is the size of a long integer (in bytes)?"
5774 rp="What is the size of a short integer (in bytes)?"
5782 : check for long long
5784 echo "Checking to see if you have long long..." >&4
5785 echo 'int main() { long long x = 7; return 0; }' > try.c
5787 if eval $compile; then
5789 echo "You have long long."
5792 echo "You do not have long long."
5798 : check for length of long long
5799 case "${d_longlong}${longlongsize}" in
5802 echo "Checking to see how big your long longs are..." >&4
5803 $cat >try.c <<'EOCP'
5807 printf("%d\n", (int)sizeof(long long));
5812 if eval $compile_ok; then
5813 longlongsize=`$run ./try`
5814 echo "Your long longs are $longlongsize bytes long."
5818 echo "(I can't seem to compile the test program. Guessing...)"
5819 rp="What is the size of a long long (in bytes)?"
5823 if $test "X$longsize" = "X$longlongsize"; then
5824 echo "(That isn't any different from an ordinary long.)"
5830 : see if inttypes.h is available
5831 : we want a real compile instead of Inhdr because some systems
5832 : have an inttypes.h which includes non-existent headers
5835 #include <inttypes.h>
5837 static int32_t foo32 = 0x12345678;
5841 if eval $compile; then
5842 echo "<inttypes.h> found." >&4
5845 echo "<inttypes.h> NOT found." >&4
5854 echo "Checking to see if you have int64_t..." >&4
5856 #include <sys/types.h>
5857 #$i_inttypes I_INTTYPES
5859 #include <inttypes.h>
5861 int main() { int64_t x = 7; }
5864 if eval $compile; then
5866 echo "You have int64_t."
5869 echo "You do not have int64_t."
5875 : Check if 64bit ints have a quad type
5877 echo "Checking which 64-bit integer type we could use..." >&4
5883 val='"unsigned int"'
5888 *) case "$longsize" in
5892 val='"unsigned long"'
5897 *) case "$d_longlong:$longlongsize" in
5902 val='"unsigned long long"'
5907 *) case "$d_int64_t" in
5926 '') echo "Alas, no 64-bit integer types in sight." >&4
5929 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5934 : Do we want 64bit support
5935 case "$uselonglong" in
5936 "$define"|true|[yY]*)
5939 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5941 use64bitint="$define"
5944 case "$use64bits" in
5945 "$define"|true|[yY]*)
5948 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5950 use64bitint="$define"
5953 case "$use64bitints" in
5954 "$define"|true|[yY]*)
5957 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5959 use64bitint="$define"
5962 case "$use64bitsint" in
5963 "$define"|true|[yY]*)
5966 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5968 use64bitint="$define"
5971 case "$uselonglongs" in
5972 "$define"|true|[yY]*)
5975 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5977 use64bitint="$define"
5980 case "$use64bitsall" in
5981 "$define"|true|[yY]*)
5984 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5986 use64bitall="$define"
5991 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5993 case "$use64bitall" in
5994 "$define"|true|[yY]*) use64bitint="$define" ;;
6000 You have natively 64-bit long integers.
6004 *) case "$use64bitint" in
6005 "$define"|true|[yY]*) dflt='y';;
6014 Perl can be built to take advantage of 64-bit integer types
6015 on some systems. To do so, Configure can be run with -Duse64bitint.
6016 Choosing this option will most probably introduce binary incompatibilities.
6018 If this doesn't make any sense to you, just accept the default '$dflt'.
6019 (The default has been chosen based on your configuration.)
6021 rp='Try to use 64-bit integers, if available?'
6024 [yY]*) val="$define" ;;
6032 case "$use64bitall" in
6033 "$define"|true|[yY]*) dflt='y' ;;
6034 *) case "$longsize" in
6042 You may also choose to try maximal 64-bitness. It means using as much
6043 64-bitness as possible on the platform. This in turn means even more
6044 binary incompatibilities. On the other hand, your platform may not
6045 have any more 64-bitness available than what you already have chosen.
6047 If this doesn't make any sense to you, just accept the default '$dflt'.
6048 (The default has been chosen based on your configuration.)
6050 rp='Try to use maximal 64-bit support, if available?'
6053 [yY]*) val="$define" ;;
6058 case "$use64bitall" in
6060 case "$use64bitint" in
6064 Since you have chosen a maximally 64-bit build, I'm also turning on
6065 the use of 64-bit integers.
6067 use64bitint="$define" ;;
6072 : Look for a hint-file generated 'call-back-unit'. If the
6073 : user has specified that a 64-bit perl is to be built,
6074 : we may need to set or change some other defaults.
6075 if $test -f use64bitint.cbu; then
6076 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6079 case "$use64bitint" in
6080 "$define"|true|[yY]*)
6081 : This test was common to all the OpenBSD forks, and seems harmless for
6084 echo "Checking if your C library has broken 64-bit functions..." >&4
6087 typedef $uquadtype myULL;
6094 {4294967303.15, 4294967303ULL},
6095 {4294967294.2, 4294967294ULL},
6096 {4294967295.7, 4294967295ULL},
6099 for (p = test; p->u; p++) {
6100 myULL x = (myULL)p->d;
6111 if eval $compile_ok; then
6112 libcquad=`$run ./try`
6113 echo "Your C library's 64-bit functions are $libcquad."
6115 echo "(I can't seem to compile the test program.)"
6116 echo "Assuming that your C library's 64-bit functions are ok."
6125 *** You have a C library with broken 64-bit functions.
6126 *** 64-bit support does not work reliably in this configuration.
6127 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6128 *** Cannot continue, aborting.
6135 4) case "$archname64" in
6136 '') archname64=64int ;;
6143 : Look for a hint-file generated 'call-back-unit'. If the
6144 : user has specified that a maximally 64-bit perl is to be built,
6145 : we may need to set or change some other defaults.
6146 if $test -f use64bitall.cbu; then
6147 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6150 case "$use64bitall" in
6151 "$define"|true|[yY]*)
6153 4) case "$archname64" in
6154 ''|64int) archname64=64all ;;
6161 case "$d_quad:$use64bitint" in
6165 *** You have chosen to use 64-bit integers,
6166 *** but none can be found.
6167 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6168 *** Cannot continue, aborting.
6175 : check for length of double
6177 case "$doublesize" in
6179 echo "Checking to see how big your double precision numbers are..." >&4
6188 printf("%d\n", (int)sizeof(double));
6193 if eval $compile_ok; then
6194 doublesize=`$run ./try`
6195 echo "Your double is $doublesize bytes long."
6198 echo "(I can't seem to compile the test program. Guessing...)"
6199 rp="What is the size of a double precision number (in bytes)?"
6207 : check for long doubles
6209 echo "Checking to see if you have long double..." >&4
6210 echo 'int main() { long double x = 7.0; }' > try.c
6212 if eval $compile; then
6214 echo "You have long double."
6217 echo "You do not have long double."
6223 : check for length of long double
6224 case "${d_longdbl}${longdblsize}" in
6227 echo "Checking to see how big your long doubles are..." >&4
6228 $cat >try.c <<'EOCP'
6232 printf("%d\n", sizeof(long double));
6237 if eval $compile; then
6238 longdblsize=`$run ./try`
6239 echo "Your long doubles are $longdblsize bytes long."
6243 echo "(I can't seem to compile the test program. Guessing...)" >&4
6244 rp="What is the size of a long double (in bytes)?"
6248 if $test "X$doublesize" = "X$longdblsize"; then
6249 echo "That isn't any different from an ordinary double."
6250 echo "I'll keep your setting anyway, but you may see some"
6251 echo "harmless compilation warnings."
6257 : determine the architecture name
6259 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6260 tarch=`arch`"-$osname"
6261 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6262 if uname -m > tmparch 2>&1 ; then
6263 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6264 -e 's/$/'"-$osname/" tmparch`
6272 case "$myarchname" in
6275 echo "(Your architecture name used to be $myarchname.)"
6279 case "$targetarch" in
6281 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6286 *) dflt="$archname";;
6288 rp='What is your architecture name'
6292 : optionally add API version to the architecture for versioned archlibs
6293 case "$useversionedarchname" in
6294 $define|true|[yY]*) dflt='y';;
6297 rp='Add the Perl API version to your archname?'
6300 y|Y) useversionedarchname="$define" ;;
6301 *) useversionedarchname="$undef" ;;
6303 case "$useversionedarchname" in
6306 *-$api_versionstring)
6307 echo "...and architecture name already has -$api_versionstring" >&4
6310 archname="$archname-$api_versionstring"
6311 echo "...setting architecture name to $archname." >&4
6317 case "$usethreads" in
6319 echo "Threads selected." >&4
6321 *-thread*) echo "...and architecture name already has -thread." >&4
6323 *) archname="$archname-thread"
6324 echo "...setting architecture name to $archname." >&4
6329 case "$usemultiplicity" in
6331 echo "Multiplicity selected." >&4
6333 *-multi*) echo "...and architecture name already has -multi." >&4
6335 *) archname="$archname-multi"
6336 echo "...setting architecture name to $archname." >&4
6341 case "$use64bitint$use64bitall" in
6343 case "$archname64" in
6345 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6348 case "$use64bitint" in
6349 "$define") echo "64 bit integers selected." >&4 ;;
6351 case "$use64bitall" in
6352 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6355 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6357 *) archname="$archname-$archname64"
6358 echo "...setting architecture name to $archname." >&4
6364 case "$uselongdouble" in
6366 echo "Long doubles selected." >&4
6367 case "$longdblsize" in
6369 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6373 *-ld*) echo "...and architecture name already has -ld." >&4
6375 *) archname="$archname-ld"
6376 echo "...setting architecture name to $archname." >&4
6383 if $test -f archname.cbu; then
6384 echo "Your platform has some specific hints for architecture name, using them..."
6388 : set the prefixit variable, to compute a suitable default value
6389 prefixit='case "$3" in
6391 case "$oldprefix" in
6392 "") eval "$1=\"\$$2\"";;
6399 ""|" ") eval "$1=\"\$$2\"";;
6405 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6407 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6408 /*-$oldprefix/*|\~*-$oldprefix/*)
6409 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6410 *) eval "$1=\"\$$2\"";;
6414 : determine installation style
6415 : For now, try to deduce it from prefix unless it is already set.
6416 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6417 case "$installstyle" in
6418 '') case "$prefix" in
6419 *perl*) dflt='lib';;
6420 *) dflt='lib/perl5' ;;
6423 *) dflt="$installstyle" ;;
6425 : Probably not worth prompting for this since we prompt for all
6426 : the directories individually, and the prompt would be too long and
6430 : determine where public executables go
6435 rp='Pathname where the public executables will reside?'
6437 if $test "X$ansexp" != "X$binexp"; then
6441 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6442 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6443 : this via initialinstalllocation
6446 case "$userelocatableinc" in
6447 $define|true|[yY]*) dflt='y' ;;
6452 Would you like to build Perl so that the installation is relocatable, so that
6453 library paths in @INC are determined relative to the path of the perl binary?
6454 This is not advised for system Perl installs, or if you need to run setid
6455 scripts or scripts under taint mode.
6457 If this doesn't make any sense to you, just accept the default '$dflt'.
6459 rp='Use relocatable @INC?'
6462 y|Y) val="$define" ;;
6465 set userelocatableinc
6468 initialinstalllocation="$binexp"
6469 : Default prefix is now "up one level from where the binaries are"
6470 case "$userelocatableinc" in
6476 installprefixexp=".../.."
6480 : determine where private library files go
6481 : Usual default is /usr/local/lib/perl5/$version.
6482 : Also allow things like /opt/perl/lib/$version, since
6483 : /opt/perl/lib/perl5... would be redundant.
6484 : The default "style" setting is made in installstyle.U
6485 case "$installstyle" in
6486 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6487 *) set dflt privlib lib/$version ;;
6492 There are some auxiliary files for $package that need to be put into a
6493 private library directory that is accessible by everyone.
6498 rp='Pathname where the private library files will reside?'
6503 : set the prefixup variable, to restore leading tilda escape
6504 prefixup='case "$prefixexp" in
6506 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6509 : determine where public architecture dependent libraries go
6512 : privlib default is /usr/local/lib/$package/$version
6513 : archlib default is /usr/local/lib/$package/$version/$archname
6514 : privlib may have an optional trailing /share.
6515 tdflt=`echo $privlib | $sed 's,/share$,,'`
6516 tdflt=$tdflt/$archname
6525 $spackage contains architecture-dependent library files. If you are
6526 sharing libraries in a heterogeneous environment, you might store
6527 these files in a separate location. Otherwise, you can just include
6528 them with the rest of the public library files.
6533 rp='Where do you want to put the public architecture-dependent libraries?'
6537 if $test X"$archlib" = X"$privlib"; then
6543 : see if setuid scripts can be secure
6546 Some kernels have a bug that prevents setuid #! scripts from being
6547 secure. Some sites have disabled setuid #! scripts because of this.
6549 First let's decide if your kernel supports secure setuid #! scripts.
6550 (If setuid #! scripts would be secure but have been disabled anyway,
6551 don't say that they are secure if asked.)
6556 if $test -d /dev/fd; then
6557 echo "#!$ls" >reflect
6558 chmod +x,u+s reflect
6559 ./reflect >flect 2>&1
6560 if $contains "/dev/fd" flect >/dev/null; then
6561 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6565 If you are not sure if they are secure, I can check but I'll need a
6566 username and password different from the one you are using right now.
6567 If you don't have such a username or don't want me to test, simply
6571 rp='Other username to test security of setuid scripts with?'
6576 case "$d_suidsafe" in
6577 '') echo "I'll assume setuid scripts are *not* secure." >&4
6580 echo "Well, the $hint value is *not* secure." >&4
6582 *) echo "Well, the $hint value *is* secure." >&4
6587 $rm -f reflect flect
6588 echo "#!$ls" >reflect
6589 chmod +x,u+s reflect
6592 echo '"su" will (probably) prompt you for '"$ans's password."
6593 su $ans -c './reflect >flect'
6594 if $contains "/dev/fd" flect >/dev/null; then
6595 echo "Okay, it looks like setuid scripts are secure." >&4
6598 echo "I don't think setuid scripts are secure." >&4
6603 rp='Does your kernel have *secure* setuid scripts?'
6606 [yY]*) val="$define";;
6611 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6612 echo "(That's for file descriptors, not floppy disks.)"
6618 $rm -f reflect flect
6620 : now see if they want to do setuid emulation
6621 if $test $patchlevel -lt 11; then
6624 case "$d_suidsafe" in
6627 echo "No need to emulate SUID scripts since they are secure here." >&4
6631 Some systems have disabled setuid scripts, especially systems where
6632 setuid scripts cannot be secure. On systems where setuid scripts have
6633 been disabled, the setuid/setgid bits on scripts are currently
6634 useless. It is possible for $package to detect those bits and emulate
6635 setuid/setgid in a secure fashion. This emulation will only work if
6636 setuid scripts have been disabled in your kernel.
6640 "$define") dflt=y ;;
6643 rp="Do you want to do setuid/setgid emulation?"
6646 [yY]*) val="$define";;
6658 SUID emulation has been removed for 5.12
6659 Please re-run Configure without -Dd_dosuid
6668 : Find perl5.005 or later.
6669 echo "Looking for a previously installed perl5.005 or later... "
6671 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6672 : Check if this perl is recent and can load a simple module
6673 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6676 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6686 '') echo "None found. That's ok.";;
6687 *) echo "Using $perl5." ;;
6690 : Set the siteprefix variables
6693 After $package is installed, you may wish to install various
6694 add-on modules and utilities. Typically, these add-ons will
6695 be installed under $prefix with the rest
6696 of this package. However, you may wish to install such add-ons
6697 elsewhere under a different prefix.
6699 If you do not wish to put everything under a single prefix, that's
6700 ok. You will be prompted for the individual locations; this siteprefix
6701 is only used to suggest the defaults.
6703 The default should be fine for most people.
6707 rp='Installation prefix to use for add-on modules and utilities?'
6708 : XXX Here might be another good place for an installstyle setting.
6709 case "$siteprefix" in
6711 *) dflt=$siteprefix ;;
6714 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6716 case "$siteprefix" in
6720 *) oldsiteprefix="$prefix";;
6725 siteprefixexp="$ansexp"
6727 : determine where site specific libraries go.
6728 : Usual default is /usr/local/lib/perl5/site_perl/$version
6729 : The default "style" setting is made in installstyle.U
6730 : XXX No longer works with Prefixit stuff.
6731 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6733 '') case "$installstyle" in
6734 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6735 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6743 The installation process will create a directory for
6744 site-specific extensions and modules. Most users find it convenient
6745 to place all site-specific files in this directory rather than in the
6746 main distribution directory.
6750 rp='Pathname for the site-specific library files?'
6754 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6756 : Determine list of previous versions to include in @INC
6757 $cat > getverlist <<EOPL
6760 \$api_versionstring = "$api_versionstring";
6761 \$version = "$version";
6762 \$stem = "$sitelib_stem";
6763 \$archname = "$archname";
6765 $cat >> getverlist <<'EOPL'
6766 # The list found is store twice for each entry: the original name, and
6767 # the binary broken down version as pack "sss", so sorting is easy and
6768 # unambiguous. This will work for all versions that have a maximum of
6769 # three digit groups, separate by '.'s or '_'s. Names are extended with
6770 # ".0.0" to ensure at least three elements for the pack.
6771 # -- H.Merijn Brand (m)'06 23-10-2006
6773 # Can't have leading @ because metaconfig interprets it as a command!
6774 ;@inc_version_list=();
6775 # XXX Redo to do opendir/readdir?
6778 ;@candidates = map {
6779 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6780 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6786 ($pversion, $aversion, $vsn5005) = map {
6787 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6788 foreach $d (@candidates) {
6789 if ($d->[1] lt $pversion) {
6790 if ($d->[1] ge $aversion) {
6791 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6793 elsif ($d->[1] ge $vsn5005) {
6794 unshift(@inc_version_list, grep { -d } $d->[0]);
6798 # Skip newer version. I.e. don't look in
6799 # 5.7.0 if we're installing 5.6.1.
6803 if (@inc_version_list) {
6804 print join(' ', @inc_version_list);
6807 # Blank space to preserve value for next Configure run.
6812 case "$inc_version_list" in
6813 '') if test -x "$perl5$exe_ext"; then
6814 dflt=`$perl5 getverlist`
6819 $undef) dflt='none' ;;
6820 *) eval dflt=\"$inc_version_list\" ;;
6823 ''|' ') dflt=none ;;
6830 In order to ease the process of upgrading, this version of perl
6831 can be configured to use modules built and installed with earlier
6832 versions of perl that were installed under $prefix. Specify here
6833 the list of earlier versions that this version of perl should check.
6834 If Configure detected no earlier versions of perl installed under
6835 $prefix, then the list will be empty. Answer 'none' to tell perl
6836 to not search earlier versions.
6838 The default should almost always be sensible, so if you're not sure,
6839 just accept the default.
6842 rp='List of earlier versions to include in @INC?'
6845 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6846 *) inc_version_list="$ans" ;;
6848 case "$inc_version_list" in
6850 inc_version_list_init='0'
6851 d_inc_version_list="$undef"
6853 *) inc_version_list_init=`echo $inc_version_list |
6854 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6855 d_inc_version_list="$define"
6860 : see if malloc/malloc.h has to be included
6861 set malloc/malloc.h i_mallocmalloc
6864 : see if this is a malloc.h system
6865 : we want a real compile instead of Inhdr because some systems have a
6866 : malloc.h that just gives a compile error saying to use stdlib.h instead
6871 #$i_mallocmalloc I_MALLOCMALLOC
6872 #ifdef I_MALLOCMALLOC
6873 # include <malloc/malloc.h>
6876 int main () { return 0; }
6879 if eval $compile; then
6880 echo "<malloc.h> found." >&4
6883 echo "<malloc.h> NOT found." >&4
6890 : check for length of pointer
6894 echo "Checking to see how big your pointers are..." >&4
6903 printf("%d\n", (int)sizeof(void *));
6908 if eval $compile_ok; then
6909 ptrsize=`$run ./try`
6910 echo "Your pointers are $ptrsize bytes long."
6913 echo "(I can't seem to compile the test program. Guessing...)" >&4
6914 rp="What is the size of a pointer (in bytes)?"
6921 case "$use64bitall" in
6922 "$define"|true|[yY]*)
6926 *** You have chosen a maximally 64-bit build,
6927 *** but your pointers are only 4 bytes wide.
6928 *** Please rerun Configure without -Duse64bitall.
6933 *** Since you have quads, you could possibly try with -Duse64bitint.
6938 *** Cannot continue, aborting.
6949 : determine whether to use malloc wrapping
6951 case "$usemallocwrap" in
6952 [yY]*|true|$define) dflt='y' ;;
6953 [nN]*|false|$undef) dflt='n' ;;
6954 *) case "$usedevel" in
6955 [yY]*|true|$define) dflt='y' ;;
6960 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6962 usemallocwrap="$ans"
6965 usemallocwrap="$define" ;;
6967 usemallocwrap="$undef" ;;
6970 : determine which malloc to compile in
6972 case "$usemymalloc" in
6973 [yY]*|true|$define) dflt='y' ;;
6974 [nN]*|false|$undef) dflt='n' ;;
6975 *) case "$ptrsize" in
6979 if test "$useithreads" = "$define"; then dflt='n'; fi
6982 rp="Do you wish to attempt to use the malloc that comes with $package?"
6988 mallocsrc='malloc.c'
6989 mallocobj="malloc$_o"
6990 d_mymalloc="$define"
6993 : Remove malloc from list of libraries to use
6994 echo "Removing unneeded -lmalloc from library list" >&4
6995 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6998 echo "libs = $libs" >&4
7010 : compute the return types of malloc and free
7012 $cat >malloc.c <<END
7016 #include <sys/types.h>
7030 case "$malloctype" in
7032 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7039 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7043 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7050 echo "Your system uses $freetype free(), it would seem." >&4
7052 : determine where site specific architecture-dependent libraries go.
7053 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7054 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7055 : sitelib may have an optional trailing /share.
7057 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7058 dflt="$dflt/$archname"
7063 set sitearch sitearch none
7067 The installation process will also create a directory for
7068 architecture-dependent site-specific extensions and modules.
7072 rp='Pathname for the site-specific architecture-dependent library files?'
7076 if $test X"$sitearch" = X"$sitelib"; then
7079 d_sitearch="$define"
7082 : Set the vendorprefix variables
7085 The installation process will also create a directory for
7086 vendor-supplied add-ons. Vendors who supply perl with their system
7087 may find it convenient to place all vendor-supplied files in this
7088 directory rather than in the main distribution directory. This will
7089 ease upgrades between binary-compatible maintenance versions of perl.
7091 Of course you may also use these directories in whatever way you see
7092 fit. For example, you might use them to access modules shared over a
7093 company-wide network.
7095 The default answer should be fine for most people.
7096 This causes further questions about vendor add-ons to be skipped
7097 and no vendor-specific directories will be configured for perl.
7100 rp='Do you want to configure vendor-specific add-on directories?'
7101 case "$usevendorprefix" in
7102 define|true|[yY]*) dflt=y ;;
7103 *) : User may have set vendorprefix directly on Configure command line.
7104 case "$vendorprefix" in
7113 rp='Installation prefix to use for vendor-supplied add-ons?'
7114 case "$vendorprefix" in
7115 '') dflt="$prefix" ;;
7116 *) dflt=$vendorprefix ;;
7119 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7121 case "$vendorprefix" in
7125 *) oldvendorprefix="$prefix";;
7129 usevendorprefix="$define"
7131 vendorprefixexp="$ansexp"
7133 *) usevendorprefix="$undef"
7139 : Set the vendorlib variables
7140 case "$vendorprefix" in
7141 '') d_vendorlib="$undef"
7145 *) d_vendorlib="$define"
7146 : determine where vendor-supplied modules go.
7147 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7148 case "$vendorlib" in
7150 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7151 case "$installstyle" in
7152 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7153 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7156 *) dflt="$vendorlib"
7160 rp='Pathname for the vendor-supplied library files?'
7163 vendorlibexp="$ansexp"
7166 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7170 : Set the vendorarch variables
7171 case "$vendorprefix" in
7172 '') d_vendorarch="$undef"
7176 *) d_vendorarch="$define"
7177 : determine where vendor-supplied architecture-dependent libraries go.
7178 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7179 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7180 : vendorlib may have an optional trailing /share.
7181 case "$vendorarch" in
7182 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7183 dflt="$dflt/$archname"
7185 *) dflt="$vendorarch" ;;
7188 rp='Pathname for vendor-supplied architecture-dependent files?'
7191 vendorarchexp="$ansexp"
7194 prefixvar=vendorarch
7196 if $test X"$vendorarch" = X"$vendorlib"; then
7197 d_vendorarch="$undef"
7199 d_vendorarch="$define"
7202 : Final catch-all directories to search
7205 Lastly, you can have perl look in other directories for extensions and
7206 modules in addition to those already specified.
7207 These directories will be searched after
7211 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7212 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7214 case "$otherlibdirs" in
7215 ''|' ') dflt='none' ;;
7216 *) dflt="$otherlibdirs" ;;
7219 Enter a colon-separated set of extra paths to include in perl's @INC
7220 search path, or enter 'none' for no extra paths.
7224 rp='Colon-separated list of additional directories for perl to search?'
7227 ' '|''|none) otherlibdirs=' ' ;;
7228 *) otherlibdirs="$ans" ;;
7230 case "$otherlibdirs" in
7234 set d_perl_otherlibdirs
7237 : Cruising for prototypes
7239 echo "Checking out function prototypes..." >&4
7240 $cat >prototype.c <<EOCP
7245 int main(int argc, char *argv[]) {
7248 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7249 echo "Your C compiler appears to support function prototypes."
7252 echo "Your C compiler doesn't seem to understand function prototypes."
7259 : Check if ansi2knr is required
7260 case "$prototype" in
7262 *) ansi2knr='ansi2knr'
7267 This version of $package can only be compiled by a compiler that
7268 understands function prototypes. Unfortunately, your C compiler
7270 doesn't seem to understand them. Sorry about that.
7272 If GNU cc is available for your system, perhaps you could try that instead.
7274 Eventually, we hope to support building Perl with pre-ANSI compilers.
7275 If you would like to help in that effort, please contact <perlbug@perl.org>.
7277 Aborting Configure now.
7284 dflt_dtrace='/usr/sbin/dtrace'
7285 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7289 Perl can be built to support DTrace on platforms that support it.
7290 DTrace is a diagnosis and performance analysis tool from Sun.
7292 If this doesn't make any sense to you, just accept the default '$dflt'.
7296 case "$usedtrace" in
7302 dflt_dtrace=$usedtrace
7309 rp='Support DTrace if available?'
7312 y|Y) val="$define" ;;
7318 test "X$usedtrace" != "X$define" && break
7321 rp='Where is the dtrace executable?'
7330 if $dtrace -h -s ../perldtrace.d \
7331 -o perldtrace.tmp >/dev/null 2>&1 \
7332 && rm -f perldtrace.tmp
7335 echo "Good: your $dtrace knows about the -h flag."
7339 *** $me: Fatal Error: $dtrace doesn't support -h flag
7341 *** Your installed dtrace doesn't support the -h switch to compile a D
7342 *** program into a C header. Can't continue.
7354 *** $me: Fatal Error: $dtrace not found.
7361 echo "*** $dtrace was not found."
7367 : See if we want extra modules installed
7374 Perl can be built with extra modules or bundles of modules which
7375 will be fetched from the CPAN and installed alongside Perl.
7377 Notice that you will need access to the CPAN; either via the Internet,
7378 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7379 be asked later to configure the CPAN.pm module which will in turn do
7380 the installation of the rest of the extra modules or bundles.)
7382 Notice also that if the modules require any external software such as
7383 libraries and headers (the libz library and the zlib.h header for the
7384 Compress::Zlib module, for example) you MUST have any such software
7385 already installed, this configuration process will NOT install such
7388 If this doesn't make any sense to you, just accept the default '$dflt'.
7390 rp='Install any extra modules (y or n)?'
7396 Please list any extra modules or bundles to be installed from CPAN,
7397 with spaces between the names. The names can be in any format the
7398 'install' command of CPAN.pm will understand. (Answer 'none',
7399 without the quotes, to install no extra modules or bundles.)
7409 $rm -f ../extras.lst
7411 *) echo "(Saving the list of extras for later...)"
7412 echo "$extras" > ../extras.lst
7420 : determine where html pages for programs go
7421 set html1dir html1dir none
7425 If you wish to install html files for programs in $spackage, indicate
7426 the appropriate directory here. To skip installing html files,
7430 ''|none|$undef|' ') dflt=none ;;
7431 *) dflt=$html1dir ;;
7434 rp="Directory for the main $spackage html pages?"
7438 : Use ' ' for none so value is preserved next time through Configure
7439 $test X"$html1dir" = "X" && html1dir=' '
7441 : determine where html pages for libraries and modules go
7442 set html3dir html3dir none
7446 If you wish to install html files for modules associated with $spackage,
7447 indicate the appropriate directory here. To skip installing html files,
7450 : There is no obvious default. If they have specified html1dir, then
7451 : try to key off that, possibly changing .../html1 into .../html3.
7453 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7454 *) dflt=$html3dir ;;
7457 rp="Directory for the $spackage module html pages?"
7461 : Use ' ' for none so value is preserved next time through Configure
7462 $test X"$html3dir" = "X" && html3dir=' '
7464 : determine whether to install perl also as /usr/bin/perl
7467 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7469 Many scripts expect perl to be installed as /usr/bin/perl.
7471 If you want to, I can install the perl you are about to compile
7472 as /usr/bin/perl (in addition to $bin/perl).
7474 if test -f /usr/bin/perl; then
7477 However, please note that because you already have a /usr/bin/perl,
7478 overwriting that with a new Perl would very probably cause problems.
7479 Therefore I'm assuming you don't want to do that (unless you insist).
7482 case "$installusrbinperl" in
7483 "$define"|[yY]*) dflt='y';;
7489 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7492 case "$installusrbinperl" in
7493 "$undef"|[nN]*) dflt='n';;
7497 rp="Do you want to install perl as /usr/bin/perl?"
7500 [yY]*) val="$define";;
7506 set installusrbinperl
7509 : Check if we are using the GNU C library
7511 echo "Checking for GNU C Library..." >&4
7513 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7514 alone are insufficient to distinguish different versions, such as
7515 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7516 libc version 2.1.0. A. Dougherty, June 3, 2002.
7522 # ifdef __GLIBC_MINOR__
7523 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7524 # include <gnu/libc-version.h>
7525 printf("%s\n", gnu_get_libc_version());
7527 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7530 printf("%d\n", __GLIBC__);
7539 if eval $compile_ok && $run ./try > glibc.ver; then
7541 gnulibc_version=`$cat glibc.ver`
7542 echo "You are using the GNU C Library version $gnulibc_version"
7546 echo "You are not using the GNU C Library"
7552 : see if nm is to be used to determine whether a symbol is defined or not
7556 case "$d_gnulibc" in
7559 echo "nm probably won't work on the GNU C Library." >&4
7565 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7567 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7568 echo "'nm' won't be sufficient on this system." >&4
7574 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7575 if $test $dflt -gt 20; then
7585 true|$define) dflt=y;;
7592 I can use $nm to extract the symbols from your C libraries. This
7593 is a time consuming task which may generate huge output on the disk (up
7594 to 3 megabytes) but that should make the symbols extraction faster. The
7595 alternative is to skip the 'nm' extraction part and to compile a small
7596 test program instead to determine whether each symbol is present. If
7597 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7598 this may be the best solution.
7600 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7603 rp="Shall I use $nm to extract C symbols from the libraries?"
7606 [Nn]*) usenm=false;;
7615 : nm options which may be necessary
7617 '') if $test -f /mach_boot; then
7619 elif $test -d /usr/ccs/lib; then
7620 nm_opt='-p' # Solaris (and SunOS?)
7621 elif $test -f /dgux; then
7623 elif $test -f /lib64/rld; then
7624 nm_opt='-p' # 64-bit Irix
7630 : nm options which may be necessary for shared libraries but illegal
7631 : for archive libraries. Thank you, Linux.
7632 case "$nm_so_opt" in
7633 '') case "$myuname" in
7635 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7636 nm_so_opt='--dynamic'
7643 : Figure out where the libc is located
7646 : get list of predefined functions in a handy place
7651 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7657 *) for thislib in $libs; do
7660 : Handle C library specially below.
7663 thislib=`echo $thislib | $sed -e 's/^-l//'`
7664 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7666 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7668 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7670 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7672 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7674 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7676 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7681 libnames="$libnames $try"
7683 *) libnames="$libnames $thislib" ;;
7692 for xxx in $libpth; do
7693 $test -r $1 || set $xxx/libc.$so
7694 : The messy sed command sorts on library version numbers.
7696 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7697 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7699 s/[0-9][0-9]*/0000&/g
7700 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7703 $sort | $sed -e 's/^.* //'`
7706 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7707 $test -r $1 || set $sysroot/lib/libsys_s$_a
7713 if $test -r "$1"; then
7714 echo "Your (shared) C library seems to be in $1."
7716 elif $test -r /lib/libc && $test -r /lib/clib; then
7717 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7719 libc='/lib/clib /lib/libc'
7720 if $test -r /lib/syslib; then
7721 echo "(Your math library is in /lib/syslib.)"
7722 libc="$libc /lib/syslib"
7724 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7725 echo "Your C library seems to be in $libc, as you said before."
7726 elif $test -r $incpath/usr/lib/libc$_a; then
7727 libc=$incpath/usr/lib/libc$_a;
7728 echo "Your C library seems to be in $libc. That's fine."
7729 elif $test -r /lib/libc$_a; then
7731 echo "Your C library seems to be in $libc. You're normal."
7733 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7735 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7736 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7737 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7739 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7741 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7744 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7746 if $test -r "$tans"; then
7747 echo "Your C library seems to be in $tans, of all places."
7753 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7757 If the guess above is wrong (which it might be if you're using a strange
7758 compiler, or your machine supports multiple models), you can override it here.
7763 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7765 I can't seem to find your C library. I've looked in the following places:
7768 $sed 's/^/ /' libpath
7771 None of these seems to contain your C library. I need to get its name...
7776 rp='Where is your C library?'
7781 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7782 set X `cat libnames`
7785 case $# in 1) xxx=file; esac
7786 echo "Extracting names from the following $xxx for later perusal:" >&4
7788 $sed 's/^/ /' libnames >&4
7790 $echo $n "This may take a while...$c" >&4
7794 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7795 *) $nm $nm_opt $file 2>/dev/null;;
7800 $grep fprintf libc.tmp > libc.ptf
7801 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7802 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7804 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7806 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7808 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7810 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7812 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7814 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7816 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7818 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7820 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7822 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7824 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7826 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7828 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7829 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7831 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7833 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7835 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7837 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7839 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7841 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7843 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7845 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7847 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7849 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7851 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7853 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7855 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7857 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7859 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7862 $nm -p $* 2>/dev/null >libc.tmp
7863 $grep fprintf libc.tmp > libc.ptf
7864 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7865 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7871 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7873 if $ar t $libc > libc.tmp && \
7874 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7876 for thisname in $libnames $libc; do
7877 $ar t $thisname >>libc.tmp
7879 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7881 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7882 for thisname in $libnames $libc; do
7883 $ar tv $thisname >>libc.tmp
7884 emximp -o tmp.imp $thisname \
7886 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7887 < tmp.imp >>libc.tmp
7890 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7893 echo "$ar didn't seem to work right." >&4
7894 echo "Maybe this is a Cray...trying bld instead..." >&4
7896 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7899 for thisname in $libnames; do
7901 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7902 $ar t $thisname >>libc.tmp
7906 echo "That didn't work either. Giving up." >&4
7916 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7917 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7919 *) if $test -f /lib/syscalls.exp; then
7921 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7922 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7923 /lib/syscalls.exp >>libc.list
7929 $rm -f libnames libpath
7931 : Check if we are using C++
7933 echo "Checking for C++..." >&4
7934 $cat >try.c <<'EOCP'
7946 if eval $compile_ok && $run ./try; then
7948 echo "You are using a C++ compiler."
7951 echo "You are not using a C++ compiler."
7957 : is a C symbol defined?
7960 -v) tf=libc.tmp; tdc="";;
7961 -a) tf=libc.tmp; tdc="[]";;
7962 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7964 case "$d_cplusplus" in
7965 $define) extern_C="extern \"C\"" ;;
7966 *) extern_C="extern" ;;
7969 case "$reuseval-$4" in
7971 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7976 if $test "$runnm" = true; then
7977 if $contains $tlook $tf >/dev/null 2>&1; then
7979 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7980 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
7981 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7982 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7986 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
7987 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7993 $define) tval=true;;
8000 : define an is-in-libc? function
8001 inlibc='echo " "; td=$define; tu=$undef;
8002 sym=$1; var=$2; eval "was=\$$2";
8004 case "$reuseval$was" in
8014 echo "$sym() found." >&4;
8015 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8017 echo "$sym() NOT found." >&4;
8018 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8022 $define) echo "$sym() found." >&4;;
8023 *) echo "$sym() NOT found." >&4;;
8027 : see if dlopen exists
8029 xxx_ccflags="$ccflags"
8031 : with g++ one needs -shared to get is-in-libc to work for dlopen
8032 case "$gccversion" in
8034 *) case "$d_cplusplus" in
8035 "$define") ccflags="$ccflags -shared" ;;
8042 ccflags="$xxx_ccflags"
8044 : see if this is a unistd.h system
8045 set unistd.h i_unistd
8048 : determine which dynamic loading, if any, to compile in
8050 dldir="ext/DynaLoader"
8063 $define) dflt='y' ;;
8065 : Does a dl_xxx.xs file exist for this operating system
8066 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8069 rp="Do you wish to use dynamic loading?"
8076 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8077 dflt="$dldir/dl_${osname}.xs"
8078 elif $test "$d_dlopen" = "$define" ; then
8079 dflt="$dldir/dl_dlopen.xs"
8084 *) dflt="$dldir/$dlsrc"
8087 echo "The following dynamic loading files are available:"
8088 : Can not go over to $dldir because getfile has path hard-coded in.
8089 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8090 rp="Source file to use for dynamic loading"
8096 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8100 Some systems may require passing special flags to $cc -c to
8101 compile modules that will be used to create a shared library.
8102 To use no flags, say "none".
8105 case "$cccdlflags" in
8106 '') case "$gccversion" in
8107 '') case "$osname" in
8109 next) dflt='none' ;;
8110 irix*) dflt='-KPIC' ;;
8111 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8112 sunos) dflt='-pic' ;;
8116 *) case "$osname" in
8117 darwin) dflt='none' ;;
8118 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8123 *) dflt="$cccdlflags" ;;
8130 # If -Dsysroot was specified, now's the time to add it
8132 if test "X$sysroot" != X; then
8133 case "$gccversion" in
8138 dflt="$dflt --sysroot=$sysroot" ;;
8148 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8151 none) cccdlflags=' ' ;;
8152 *) cccdlflags="$ans" ;;
8157 Some systems use ld to create libraries that can be dynamically loaded,
8158 while other systems (such as those using ELF) use $cc.
8162 : Determine if this is ELF
8164 /* Test for whether ELF binaries are produced */
8176 int i = open("a.out",O_RDONLY);
8179 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8180 exit(0); /* succeed (yes, it is ELF) */
8184 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8190 '') if $test $bin_ELF = "$define"; then
8192 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8196 echo "I'll use ld to build dynamic libraries."
8204 rp="What command should be used to create dynamic libraries?"
8210 Some systems may require passing special flags to $ld to create a
8211 library that can be dynamically loaded. If your ld flags include
8212 -L/other/path options to locate libraries outside your loader's normal
8213 search path, you may need to specify those -L options here as well. To
8214 use no flags, say "none".
8217 case "$lddlflags" in
8218 '') case "$osname" in
8219 haiku) dflt='-shared' ;;
8221 case "$gccversion" in
8222 '') dflt="$dflt +vnocompatwarnings" ;;
8225 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8226 next) dflt='none' ;;
8227 solaris) # See [perl #66604].
8228 # On Solaris 11, gcc -m64 on amd64
8229 # appears not to understand -G. gcc versions at
8230 # least as old as 3.4.3 support -shared, so just
8231 # use that with Solaris 11 and later, but keep
8232 # the old behavior for older Solaris versions.
8233 case "$gccversion" in
8235 *) case "$osvers" in
8236 2.?|2.10) dflt='-G' ;;
8237 *) dflt='-shared' ;;
8242 sunos) dflt='-assert nodefinitions' ;;
8243 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8247 *) dflt="$lddlflags" ;;
8250 : Only do this for gcc, since, for example, qcc has no concept
8252 if $test "X$sysroot" != X; then
8253 case "$gccversion" in
8255 *) dflt="$dflt --sysroot $sysroot" ;;
8259 : Try to guess additional flags to pick up local libraries.
8260 : Be careful not to append to a plain 'none'
8264 for thisflag in $ldflags; do
8269 *) dflt="$dflt $thisflag" ;;
8276 ''|' ') dflt='none' ;;
8280 *-fstack-protector*)
8282 *-fstack-protector*) ;; # Don't add it again
8283 *) dflt="$dflt -fstack-protector" ;;
8288 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8291 none) lddlflags=' ' ;;
8292 *) lddlflags="$ans" ;;
8297 Some systems may require passing special flags to $cc to indicate that
8298 the resulting executable will use dynamic linking. To use no flags,
8302 case "$ccdlflags" in
8303 '') case "$osname" in
8304 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8305 next|sunos) dflt='none' ;;
8309 *) dflt="$ccdlflags" ;;
8311 rp="Any special flags to pass to $cc to use dynamic linking?"
8314 none) ccdlflags=' ' ;;
8315 *) ccdlflags="$ans" ;;
8327 ld_can_script="$undef"
8328 case "$bin_ELF$usedl" in
8330 # Abuse try.h and a.out names for neat cleanup
8342 if $cc $cccdlflags $ccdlflags $ccflags \
8343 $ldflags $lddlflags -o a.out try.c \
8344 -Wl,--version-script=try.h >/dev/null 2>&1 \
8345 && $test -s a.out ; then
8346 echo "ld supports scripting" >&4
8347 ld_can_script="$define"
8349 echo "ld does not support scripting" >&4
8355 : Do we want a shared libperl?
8359 # No dynamic loading being used, so don't bother even to prompt.
8362 *) case "$useshrplib" in
8363 '') case "$osname" in
8364 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8366 also='Building a shared libperl is required for dynamic loading to work on your system.'
8371 also='Building a shared libperl is needed for MAB support.'
8389 The perl executable is normally obtained by linking perlmain.c with
8390 libperl${_a}, any static extensions (usually just DynaLoader), and
8391 any other libraries needed on this system (such as -lm, etc.). Since
8392 your system supports dynamic loading, it is probably possible to build
8393 a shared libperl.$so. If you will have more than one executable linked
8394 to libperl.$so, this will significantly reduce the size of each
8395 executable, but it may have a noticeable effect on performance. The
8396 default is probably sensible for your system.
8400 rp="Build a shared libperl.$so (y/n)"
8404 useshrplib='true' ;;
8405 *) useshrplib='false' ;;
8410 case "$useshrplib" in
8412 case "$userelocatableinc" in
8414 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8415 echo "See INSTALL for an explanation why that won't work." >&4
8421 # Figure out a good name for libperl.so. Since it gets stored in
8422 # a version-specific architecture-dependent library, the version
8423 # number isn't really that important, except for making cc/ld happy.
8425 # A name such as libperl.so.10.1
8426 majmin="libperl.$so.$patchlevel.$subversion"
8427 # A name such as libperl.so.100
8428 majonly=`echo $patchlevel $subversion |
8429 $awk '{printf "%d%02d", $1, $2}'`
8430 majonly=libperl.$so.$majonly
8431 # I'd prefer to keep the os-specific stuff here to a minimum, and
8432 # rely on figuring it out from the naming of libc.
8433 case "${osname}${osvers}" in
8436 # XXX How handle the --version stuff for MAB?
8438 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8441 cygwin*) # ld links now against the dll directly
8442 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8443 majonly=`echo $patchlevel $subversion |
8444 $awk '{printf "%03d%03d", $1, $2}'`
8445 majonly=cygperl5.$majonly.$so
8448 *) # Try to guess based on whether libc has major.minor.
8450 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8451 *libc.$so.[0-9]*) dflt=$majonly ;;
8452 *) dflt=libperl.$so ;;
8462 I need to select a good name for the shared libperl. If your system uses
8463 library names with major and minor numbers, then you might want something
8464 like $majmin. Alternatively, if your system uses a single version
8465 number for shared libraries, then you might want to use $majonly.
8466 Or, your system might be quite happy with a simple libperl.$so.
8468 Since the shared libperl will get installed into a version-specific
8469 architecture-dependent directory, the version number of the shared perl
8470 library probably isn't important, so the default should be o.k.
8473 rp='What name do you want to give to the shared libperl?'
8476 echo "Ok, I'll use $libperl"
8479 libperl="libperl${_a}"
8483 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8487 WARNING: Use of the shrpdir variable for the installation location of
8488 the shared $libperl is not supported. It was never documented and
8489 will not work in this version. Let me (perlbug@perl.org)
8490 know of any problems this may cause.
8496 But your current setting of $shrpdir is
8497 the default anyway, so it's harmless.
8502 Further, your current attempted setting of $shrpdir
8503 conflicts with the value of $archlibexp/CORE
8504 that installperl will use.
8511 # How will the perl executable find the installed shared $libperl?
8512 # Add $xxx to ccdlflags.
8513 # If we can't figure out a command-line option, use $shrpenv to
8514 # set env LD_RUN_PATH. The main perl makefile uses this.
8515 shrpdir=$archlibexp/CORE
8518 if "$useshrplib"; then
8521 # We'll set it in Makefile.SH...
8526 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8527 xxx="-Wl,-R$shrpdir"
8529 bsdos|linux|irix*|dec_osf|gnu*)
8530 xxx="-Wl,-rpath,$shrpdir"
8533 # next doesn't like the default...
8536 # Haiku doesn't like the default, either.
8539 # hpux doesn't like the default, either.
8540 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8543 # cygwin needs only ldlibpth
8546 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8552 # Only add $xxx if it isn't already in ccdlflags.
8553 case " $ccdlflags " in
8555 *) ccdlflags="$ccdlflags $xxx"
8558 Adding $xxx to the flags
8559 passed to $ld so that the perl executable will find the
8560 installed shared $libperl.
8568 # Fix ccdlflags in AIX for building external extensions.
8569 # (For building Perl itself bare -bE:perl.exp is needed,
8570 # Makefile.SH takes care of this.)
8572 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8574 # Respect a hint or command-line value.
8576 '') shrpenv="$tmp_shrpenv" ;;
8578 case "$ldlibpthname" in
8579 '') ldlibpthname=LD_LIBRARY_PATH ;;
8580 none) ldlibpthname='' ;;
8583 : determine where manual pages are on this system
8587 syspath='/usr/share/man/man1 /usr/man/man1'
8588 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8589 syspath="$syspath /usr/man/u_man/man1"
8590 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8591 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8592 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8593 sysman=`./loc . /usr/man/man1 $syspath`
8596 if $test -d "$sysman"; then
8597 echo "System manual is in $sysman." >&4
8599 echo "Could not find manual pages in source form." >&4
8602 : determine where manual pages go
8603 set man1dir man1dir none
8607 $spackage has manual pages available in source form.
8611 echo "However, you don't have nroff, so they're probably useless to you."
8613 '') man1dir="none";;
8616 echo "If you don't want the manual sources installed, answer 'none'."
8621 lookpath="$prefixexp/share/man/man1"
8622 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8623 lookpath="$lookpath $prefixexp/man/p_man/man1"
8624 lookpath="$lookpath $prefixexp/man/u_man/man1"
8625 lookpath="$lookpath $prefixexp/man/man.1"
8627 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8628 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8638 rp="Where do the main $spackage manual pages (source) go?"
8640 if $test "X$man1direxp" != "X$ansexp"; then
8651 : What suffix to use on installed man pages
8658 rp="What suffix should be used for the main $spackage man pages?"
8660 '') case "$man1dir" in
8674 *) dflt="$man1ext";;
8681 : see if we can have long filenames
8683 first=123456789abcdef
8685 if (echo hi >$first) 2>/dev/null; then
8686 if $test -f 123456789abcde; then
8687 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8690 echo 'You can have filenames longer than 14 characters.'>&4
8695 You can't have filenames longer than 14 chars.
8696 You can't even think about them!
8702 $rm -rf 123456789abcde*
8704 : determine where library module manual pages go
8705 set man3dir man3dir none
8709 $spackage has manual pages for many of the library modules.
8715 However, you don't have nroff, so they're probably useless to you.
8718 '') man3dir="none";;
8722 case "$d_flexfnam" in
8725 However, your system can't handle the long file names like File::Basename.3.
8728 '') man3dir="none";;
8732 echo "If you don't want the manual sources installed, answer 'none'."
8733 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8735 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8736 if $test -d "$privlib/man/man3"; then
8739 WARNING: Previous versions of perl installed man3 pages into
8740 $privlib/man/man3. This version will suggest a
8741 new default of $dflt.
8745 rp='Do you wish to preserve the old behavior?(y/n)'
8748 y*) dflt="$privlib/man/man3" ;;
8753 *) dflt="$man3dir" ;;
8760 rp="Where do the $package library man pages (source) go?"
8770 : What suffix to use on installed man pages
8776 rp="What suffix should be used for the $package library man pages?"
8778 '') case "$man3dir" in
8792 *) dflt="$man3ext";;
8799 : see if we have to deal with yellow pages, now NIS.
8800 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8801 if $test -f /usr/etc/nibindd; then
8803 echo "I'm fairly confident you're on a NeXT."
8805 rp='Do you get the hosts file via NetInfo?'
8814 y*) hostcat='nidump hosts .';;
8815 *) case "$hostcat" in
8816 nidump*) hostcat='';;
8826 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8834 rp='Are you getting the hosts file via yellow pages?'
8837 y*) hostcat='ypcat hosts';;
8838 *) hostcat='cat /etc/hosts';;
8844 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8847 '') test -f /etc/group && groupcat='cat /etc/group';;
8850 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8853 : now get the host name
8855 echo "Figuring out host name..." >&4
8856 case "$myhostname" in
8858 echo 'Maybe "hostname" will work...'
8859 if tans=`sh -c hostname 2>&1` ; then
8867 if $test "$cont"; then
8869 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8870 if tans=`cat /etc/systemid 2>&1` ; then
8872 phostname='cat /etc/systemid'
8873 echo "Whadyaknow. Xenix always was a bit strange..."
8876 elif $test -r /etc/systemid; then
8877 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8880 if $test "$cont"; then
8881 echo 'No, maybe "uuname -l" will work...'
8882 if tans=`sh -c 'uuname -l' 2>&1` ; then
8884 phostname='uuname -l'
8886 echo 'Strange. Maybe "uname -n" will work...'
8887 if tans=`sh -c 'uname -n' 2>&1` ; then
8889 phostname='uname -n'
8891 echo 'Oh well, maybe I can mine it out of whoami.h...'
8892 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8893 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8894 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8896 case "$myhostname" in
8897 '') echo "Does this machine have an identity crisis or something?"
8900 echo "Well, you said $myhostname before..."
8901 phostname='echo $myhostname';;
8907 case "$myhostname" in
8908 '') myhostname=noname ;;
8910 : you do not want to know about this
8915 if $test "$myhostname" ; then
8917 rp='Your host name appears to be "'$myhostname'".'" Right?"
8925 : bad guess or no guess
8926 while $test "X$myhostname" = X ; do
8928 rp="Please type the (one word) name of your host:"
8933 : translate upper to lower if necessary
8934 case "$myhostname" in
8936 echo "(Normalizing case in your host name)"
8937 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8941 case "$myhostname" in
8943 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8944 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8945 echo "(Trimming domain name from host name--host name is now $myhostname)"
8947 *) case "$mydomain" in
8950 test "X$hostcat" = "Xypcat hosts" &&
8951 ypmatch "$myhostname" hosts 2>/dev/null |\
8952 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8955 test "X$hostcat" != "X" &&
8956 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8957 /[ ]$myhostname[ . ]/p" > hosts
8960 if $test -f hosts; then
8961 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8962 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8963 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8964 hosts | $sort | $uniq | \
8965 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8966 case `$echo X$dflt` in
8967 X*\ *) echo "(Several hosts in the database matched hostname)"
8970 X.) echo "(You do not have fully-qualified names in the hosts database)"
8974 echo "(I cannot locate a hosts database anywhere)"
8979 tans=`./loc resolv.conf X /etc /usr/etc`
8980 if $test -f "$tans"; then
8981 echo "(Attempting domain name extraction from $tans)"
8982 dflt=.`$sed -n -e 's/ / /g' \
8983 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8986 .) dflt=.`$sed -n -e 's/ / /g' \
8987 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8995 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8996 dflt=.`sh -c domainname 2>/dev/null`
8999 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9003 case "$dflt$osname" in
9004 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9005 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9009 .) echo "(Lost all hope -- silly guess then)"
9015 *) dflt="$mydomain";;
9019 rp="What is your domain name?"
9029 : translate upper to lower if necessary
9032 echo "(Normalizing case in your domain name)"
9033 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9037 : a little sanity check here
9038 case "$phostname" in
9041 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9042 $myhostname$mydomain|$myhostname) ;;
9044 case "$phostname" in
9046 echo "(That doesn't agree with your whoami.h file, by the way.)"
9049 echo "(That doesn't agree with your $phostname command, by the way.)"
9057 : determine the e-mail address of the user who is running us
9060 I need to get your e-mail address in Internet format if possible, i.e.
9061 something like user@host.domain. Please answer accurately since I have
9062 no easy means to double check it. The default value provided below
9063 is most probably close to reality but may not be valid from outside
9064 your organization...
9068 while test "$cont"; do
9069 case "$MAILDOMAIN" in
9071 if $test -s /etc/mailname; then
9072 maildomain=`$cat /etc/mailname`
9074 maildomain="$myhostname$mydomain"
9077 *) maildomain="$MAILDOMAIN";;
9080 '') dflt="$cf_by@$maildomain";;
9081 *) dflt="$cf_email";;
9083 rp='What is your e-mail address?'
9089 rp='Address does not look like an Internet one. Use it anyway?'
9103 : Ask e-mail of administrator
9106 If you or somebody else will be maintaining perl at your site, please
9107 fill in the correct e-mail address here so that they may be contacted
9108 if necessary. Currently, the "perlbug" program included with perl
9109 will send mail to this address in addition to perlbug@perl.org. You may
9110 enter "none" for no administrator.
9113 case "$perladmin" in
9114 '') dflt="$cf_email";;
9115 *) dflt="$perladmin";;
9117 rp='Perl administrator e-mail address'
9121 : determine whether to only install version-specific parts.
9124 Do you want to install only the version-specific parts of the perl
9125 distribution? Usually you do *not* want to do this.
9127 case "$versiononly" in
9128 "$define"|[Yy]*|true) dflt='y' ;;
9131 rp="Do you want to install only the version-specific parts of perl?"
9134 [yY]*) val="$define";;
9140 case "$versiononly" in
9141 "$define") inc_version_list=''
9142 inc_version_list_init=0
9146 : figure out how to guarantee perl startup
9147 : XXX Note that this currently takes advantage of the bug that binexp ignores
9148 : the Configure -Dinstallprefix setting, which in turn means that under
9149 : relocatable @INC, initialinstalllocation is what binexp started as.
9150 case "$startperl" in
9152 case "$sharpbang" in
9156 I can use the #! construct to start perl on your system. This will
9157 make startup of perl scripts faster, but may cause problems if you
9158 want to share those scripts and perl is not in a standard place
9159 ($initialinstalllocation/perl) on all your platforms. The alternative
9160 is to force a shell by starting the script with a single ':' character.
9163 case "$versiononly" in
9164 "$define") dflt="$initialinstalllocation/perl$version";;
9165 *) dflt="$initialinstalllocation/perl";;
9167 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9170 none) startperl=": # use perl";;
9171 *) startperl="#!$ans"
9172 if $test 30 -lt `echo "$ans" | wc -c`; then
9175 WARNING: Some systems limit the #! command to 32 characters.
9176 If you experience difficulty running Perl scripts with #!, try
9177 installing Perl in a directory with a shorter pathname.
9183 *) startperl=": # use perl"
9188 echo "I'll use $startperl to start perl scripts."
9190 : figure best path for perl in scripts
9193 case "$versiononly" in
9194 "$define") perlpath="$initialinstalllocation/perl$version";;
9195 *) perlpath="$initialinstalllocation/perl";;
9197 case "$startperl" in
9202 I will use the "eval 'exec'" idiom to start Perl on your system.
9203 I can use the full path of your Perl binary for this purpose, but
9204 doing so may cause problems if you want to share those scripts and
9205 Perl is not always in a standard place ($initialinstalllocation/perl).
9208 dflt="$initialinstalllocation/perl"
9209 rp="What path shall I use in \"eval 'exec'\"?"
9216 case "$startperl" in
9218 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9221 : determine where public executable scripts go
9222 set scriptdir scriptdir
9224 case "$scriptdir" in
9227 : guess some guesses
9228 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9229 $test -d /usr/share/bin && dflt=/usr/share/bin
9230 $test -d /usr/local/script && dflt=/usr/local/script
9231 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9232 $test -d $prefixexp/script && dflt=$prefixexp/script
9236 *) dflt="$scriptdir"
9241 Some installations have a separate directory just for executable scripts so
9242 that they can mount it across multiple architectures but keep the scripts in
9243 one spot. You might, for example, have a subdirectory of /usr/share for this.
9244 Or you might just lump your scripts in with all your other executables.
9248 rp='Where do you keep publicly executable scripts?'
9250 if $test "X$ansexp" != "X$scriptdirexp"; then
9256 : A little fix up for an irregularly named variable.
9257 installscript="$installscriptdir"
9259 : determine where add-on public executables go
9261 '') dflt=$siteprefix/bin ;;
9265 rp='Pathname where the add-on public executables should be installed?'
9270 : determine where add-on html pages go
9271 : There is no standard location, so try to copy the previously-selected
9272 : directory structure for the core html pages.
9273 case "$sitehtml1dir" in
9274 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9275 *) dflt=$sitehtml1dir ;;
9278 ''|' ') dflt=none ;;
9281 rp='Pathname where the site-specific html pages should be installed?'
9283 prefixvar=sitehtml1dir
9286 : determine where add-on library html pages go
9287 : There is no standard location, so try to copy the previously-selected
9288 : directory structure for the core html pages.
9289 case "$sitehtml3dir" in
9290 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9291 *) dflt=$sitehtml3dir ;;
9294 ''|' ') dflt=none ;;
9297 rp='Pathname where the site-specific library html pages should be installed?'
9299 prefixvar=sitehtml3dir
9302 : determine where add-on manual pages go
9303 case "$siteman1dir" in
9304 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9305 *) dflt=$siteman1dir ;;
9308 ''|' ') dflt=none ;;
9311 rp='Pathname where the site-specific manual pages should be installed?'
9313 prefixvar=siteman1dir
9316 : determine where add-on library man pages go
9317 case "$siteman3dir" in
9318 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9319 *) dflt=$siteman3dir ;;
9322 ''|' ') dflt=none ;;
9325 rp='Pathname where the site-specific library manual pages should be installed?'
9327 prefixvar=siteman3dir
9330 : determine where add-on public executable scripts go
9331 case "$sitescript" in
9332 '') dflt=$siteprefix/script
9333 $test -d $dflt || dflt=$sitebin ;;
9334 *) dflt="$sitescript" ;;
9337 rp='Pathname where add-on public executable scripts should be installed?'
9339 prefixvar=sitescript
9342 : Check if faststdio is requested and available
9343 case "$usefaststdio" in
9344 $define|true|[yY]*|'')
9345 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9355 Perl can be built to use 'fast stdio', which means using the stdio
9356 library but also directly manipulating the stdio buffers to enable
9357 faster I/O. Using stdio is better for backward compatibility (especially
9358 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9359 interface has been preferred instead of stdio.
9361 If this doesn't make any sense to you, just accept the default '$dflt'.
9363 rp='Use the "fast stdio" if available?'
9366 y|Y) val="$define" ;;
9373 : define an is-a-typedef? function
9374 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9376 "") inclist="sys/types.h";;
9378 eval "varval=\$$var";
9382 for inc in $inclist; do
9383 echo "#include <$inc>" >>temp.c;
9385 echo "#ifdef $type" >> temp.c;
9386 echo "printf(\"We have $type\");" >> temp.c;
9387 echo "#endif" >> temp.c;
9388 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9389 if $contains $type temp.E >/dev/null 2>&1; then
9395 *) eval "$var=\$varval";;
9398 : define an is-a-typedef? function that prompts if the type is not available.
9399 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9401 "") inclist="sys/types.h";;
9403 eval "varval=\$$var";
9407 for inc in $inclist; do
9408 echo "#include <$inc>" >>temp.c;
9410 echo "#ifdef $type" >> temp.c;
9411 echo "printf(\"We have $type\");" >> temp.c;
9412 echo "#endif" >> temp.c;
9413 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9415 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9416 if $contains $type temp.E >/dev/null 2>&1; then
9417 echo "$type found." >&4;
9420 echo "$type NOT found." >&4;
9426 *) eval "$var=\$varval";;
9429 : see what type lseek is declared as in the kernel
9430 rp="What is the type used for lseek's offset on this system?"
9431 set off_t lseektype long stdio.h sys/types.h
9435 echo "Checking to see how big your file offsets are..." >&4
9437 #include <sys/types.h>
9441 printf("%d\n", (int)sizeof($lseektype));
9446 if eval $compile_ok; then
9447 lseeksize=`$run ./try`
9448 echo "Your file offsets are $lseeksize bytes long."
9452 echo "(I can't seem to compile the test program. Guessing...)"
9453 rp="What is the size of your file offsets (in bytes)?"
9459 : see what type file positions are declared as in the library
9460 rp="What is the type for file position used by fsetpos()?"
9461 set fpos_t fpostype long stdio.h sys/types.h
9464 : Check size for Fpos_t
9467 *_t) zzz="$fpostype" ;;
9470 echo "Checking the size of $zzz..." >&4
9472 #include <sys/types.h>
9479 printf("%d\n", (int)sizeof($fpostype));
9484 if eval $compile_ok; then
9488 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9491 echo "Your $zzz is $fpossize bytes long."
9497 echo "(I can't compile the test program. Guessing...)" >&4
9498 rp="What is the size of your file positions (in bytes)?"
9503 : Check for large file support
9504 # Backward compatibility (uselfs is deprecated).
9506 "$define"|true|[yY]*)
9509 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9511 uselargefiles="$define"
9515 case "$lseeksize:$fpossize" in
9518 You can have files larger than 2 gigabytes.
9521 *) case "$uselargefiles" in
9522 "$undef"|false|[nN]*) dflt='n' ;;
9527 Perl can be built to understand large files (files larger than 2 gigabytes)
9528 on some systems. To do so, Configure can be run with -Duselargefiles.
9530 If this doesn't make any sense to you, just accept the default '$dflt'.
9532 rp='Try to understand large files, if available?'
9535 y|Y) val="$define" ;;
9542 : Look for a hint-file generated 'call-back-unit'. If the
9543 : user has specified that a large files perl is to be built,
9544 : we may need to set or change some other defaults.
9545 if $test -f uselargefiles.cbu; then
9546 echo "Your platform has some specific hints regarding large file builds, using them..."
9547 . ./uselargefiles.cbu
9549 case "$uselargefiles" in
9551 if $test -f uselargefiles.cbu; then
9553 echo "Rechecking to see how big your file offsets are..." >&4
9555 #include <sys/types.h>
9559 printf("%d\n", (int)sizeof($lseektype));
9564 if eval $compile_ok; then
9565 lseeksize=`$run ./try`
9566 $echo "Your file offsets are now $lseeksize bytes long."
9570 echo "(I can't seem to compile the test program. Guessing...)"
9571 rp="What is the size of your file offsets (in bytes)?"
9576 *_t) zzz="$fpostype" ;;
9579 $echo $n "Rechecking the size of $zzz...$c" >&4
9581 #include <sys/types.h>
9588 printf("%d\n", (int)sizeof($fpostype));
9593 if eval $compile_ok; then
9598 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9601 echo " $fpossize bytes." >&4
9607 echo "(I can't compile the test program. Guessing...)" >&4
9608 rp="What is the size of your file positions (in bytes)?"
9617 : Check if we want perlio
9620 : Set the vendorbin variables
9621 case "$vendorprefix" in
9622 '') d_vendorbin="$undef"
9626 *) d_vendorbin="$define"
9627 : determine where vendor-supplied executables go.
9628 case "$vendorbin" in
9629 '') dflt=$vendorprefix/bin ;;
9630 *) dflt="$vendorbin" ;;
9633 rp='Pathname for the vendor-supplied executables directory?'
9636 vendorbinexp="$ansexp"
9642 : Set the vendorhtml1dir variables
9643 case "$vendorprefix" in
9644 '') vendorhtml1dir=''
9645 vendorhtml1direxp=''
9647 *) : determine where vendor-supplied html pages go.
9648 : There is no standard location, so try to copy the previously-selected
9649 : directory structure for the core html pages.
9650 : XXX Better default suggestions would be welcome.
9651 case "$vendorhtml1dir" in
9652 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9653 *) dflt=$vendorhtml1dir ;;
9656 ''|' ') dflt=none ;;
9659 rp='Pathname for the vendor-supplied html pages?'
9661 vendorhtml1dir="$ans"
9662 vendorhtml1direxp="$ansexp"
9665 : Use ' ' for none so value is preserved next time through Configure
9666 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9667 prefixvar=vendorhtml1dir
9670 : Set the vendorhtml3dir variables
9671 case "$vendorprefix" in
9672 '') vendorhtml3dir=''
9673 vendorhtml3direxp=''
9675 *) : determine where vendor-supplied module html pages go.
9676 : There is no standard location, so try to copy the previously-selected
9677 : directory structure for the core html pages.
9678 : XXX Better default suggestions would be welcome.
9679 case "$vendorhtml3dir" in
9680 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9681 *) dflt=$vendorhtml3dir ;;
9684 ''|' ') dflt=none ;;
9687 rp='Pathname for the vendor-supplied html pages?'
9689 vendorhtml3dir="$ans"
9690 vendorhtml3direxp="$ansexp"
9693 : Use ' ' for none so value is preserved next time through Configure
9694 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9695 prefixvar=vendorhtml3dir
9698 : Set the vendorman1dir variables
9699 case "$vendorprefix" in
9700 '') vendorman1dir=''
9703 *) : determine where vendor-supplied manual pages go.
9704 case "$vendorman1dir" in
9705 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9706 *) dflt=$vendorman1dir ;;
9709 ''|' ') dflt=none ;;
9712 rp='Pathname for the vendor-supplied manual section 1 pages?'
9714 vendorman1dir="$ans"
9715 vendorman1direxp="$ansexp"
9718 : Use ' ' for none so value is preserved next time through Configure
9719 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9720 prefixvar=vendorman1dir
9723 : Set the vendorman3dir variables
9724 case "$vendorprefix" in
9725 '') vendorman3dir=''
9728 *) : determine where vendor-supplied module manual pages go.
9729 case "$vendorman3dir" in
9730 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9731 *) dflt=$vendorman3dir ;;
9734 ''|' ') dflt=none ;;
9737 rp='Pathname for the vendor-supplied manual section 3 pages?'
9739 vendorman3dir="$ans"
9740 vendorman3direxp="$ansexp"
9743 : Use ' ' for none so value is preserved next time through Configure
9744 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9745 prefixvar=vendorman3dir
9748 : Set the vendorscript variables
9749 case "$vendorprefix" in
9750 '') d_vendorscript="$undef"
9754 *) d_vendorscript="$define"
9755 : determine where vendor-supplied scripts go.
9756 case "$vendorscript" in
9757 '') dflt=$vendorprefix/script
9758 $test -d $dflt || dflt=$vendorbin ;;
9759 *) dflt="$vendorscript" ;;
9763 The installation process will create a directory for
9764 vendor-supplied scripts.
9768 rp='Pathname for the vendor-supplied scripts directory?'
9771 vendorscriptexp="$ansexp"
9774 prefixvar=vendorscript
9777 : script used to emit important warnings
9780 if test \$# -gt 0; then
9785 echo "*** WARNING:" >&4
9786 sed -e 's/^/*** /' <msg >&4
9788 cat msg >>config.msg
9789 echo " " >>config.msg
9795 : see which of string.h or strings.h is needed
9797 strings=`./findhdr string.h`
9798 if $test "$strings" && $test -r "$strings"; then
9799 echo "Using <string.h> instead of <strings.h>." >&4
9803 strings=`./findhdr strings.h`
9804 if $test "$strings" && $test -r "$strings"; then
9805 echo "Using <strings.h> instead of <string.h>." >&4
9807 ./warn "No string header found -- You'll surely have problems."
9813 "$undef") strings=`./findhdr strings.h`;;
9814 *) strings=`./findhdr string.h`;;
9817 : see if qgcvt exists
9821 : Check print/scan long double stuff
9824 if $test X"$d_longdbl" = X"$define"; then
9826 echo "Checking how to print long doubles..." >&4
9828 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9829 $cat >try.c <<'EOCP'
9830 #include <sys/types.h>
9834 printf("%.3f\n", d);
9838 if eval $compile; then
9842 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9843 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9844 echo "We will use %f."
9850 if $test X"$sPRIfldbl" = X; then
9851 $cat >try.c <<'EOCP'
9852 #include <sys/types.h>
9855 long double d = 123.456;
9856 printf("%.3Lf\n", d);
9860 if eval $compile; then
9864 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9865 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9866 echo "We will use %Lf."
9872 if $test X"$sPRIfldbl" = X; then
9873 $cat >try.c <<'EOCP'
9874 #include <sys/types.h>
9877 long double d = 123.456;
9878 printf("%.3llf\n", d);
9882 if eval $compile; then
9886 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9887 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9888 echo "We will use %llf."
9894 if $test X"$sPRIfldbl" = X; then
9895 $cat >try.c <<'EOCP'
9896 #include <sys/types.h>
9899 long double d = 123.456;
9900 printf("%.3lf\n", d);
9904 if eval $compile; then
9908 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9909 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9910 echo "We will use %lf."
9916 if $test X"$sPRIfldbl" = X; then
9917 echo "Cannot figure out how to print long doubles." >&4
9919 sSCNfldbl=$sPRIfldbl # expect consistency
9926 case "$sPRIfldbl" in
9927 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9928 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9929 d_SCNfldbl="$undef";
9931 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9932 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9933 d_SCNfldbl="$define";
9937 : Check how to convert floats to strings.
9939 if test "X$d_Gconvert" = X; then
9942 echo "Checking for an efficient way to convert floats to strings."
9944 case "$uselongdouble" in
9945 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9947 case "$d_longdbl" in
9948 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9950 case "$d_PRIgldbl" in
9951 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9955 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9956 char *myname = "gconvert";
9959 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9960 char *myname = "gcvt";
9963 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9964 char *myname = "qgcvt";
9965 #define DOUBLETYPE long double
9968 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9970 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9972 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9975 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9977 char *myname = "sprintf";
9981 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9982 #define DOUBLETYPE long double
9984 #define DOUBLETYPE double
9996 # include <string.h>
9998 # include <strings.h>
10001 int checkit(char *expect, char *got)
10003 if (strcmp(expect, got)) {
10004 printf("%s oddity: Expected %s, got %s\n",
10005 myname, expect, got);
10015 /* This must be 1st test on (which?) platform */
10016 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10017 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10018 checkit("0.1", buf);
10020 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10021 checkit("0.01", buf);
10023 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10024 checkit("0.001", buf);
10026 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10027 checkit("0.0001", buf);
10029 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10030 if (strlen(buf) > 5)
10031 checkit("9e-005", buf); /* for Microsoft ?? */
10033 checkit("9e-05", buf);
10035 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10038 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10039 checkit("1.1", buf);
10041 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10042 checkit("1.01", buf);
10044 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10045 checkit("1.001", buf);
10047 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10048 checkit("1.0001", buf);
10050 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10051 checkit("1.00001", buf);
10053 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10054 checkit("1.000001", buf);
10056 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10059 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10060 checkit("-1", buf);
10062 /* Some Linux gcvt's give 1.e+5 here. */
10063 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10064 checkit("100000", buf);
10066 /* Some Linux gcvt's give -1.e+5 here. */
10067 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10068 checkit("-100000", buf);
10070 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10071 checkit("123.456", buf);
10073 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10074 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10075 /* 34 should be enough to scare even long double
10076 * places into using the e notation. */
10077 if (strlen(buf) > 5)
10078 checkit("1e+034", buf); /* for Microsoft */
10080 checkit("1e+34", buf);
10082 /* For Perl, if you add additional tests here, also add them to
10083 * t/base/num.t for benefit of platforms not using Configure or
10084 * overriding d_Gconvert */
10089 : first add preferred functions to our list
10091 for xxx_convert in $gconvert_preference; do
10092 case $xxx_convert in
10093 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10094 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10097 : then add any others
10098 for xxx_convert in gconvert gcvt sprintf; do
10099 case "$xxx_list" in
10101 *) xxx_list="$xxx_list $xxx_convert" ;;
10105 case "$d_longdbl$uselongdouble" in
10107 : again, add preferred functions to our list first
10109 for xxx_convert in $gconvert_ld_preference; do
10110 case $xxx_convert in
10111 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10112 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10115 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10116 for xxx_convert in qgcvt sprintf $xxx_list; do
10117 case "$xxx_ld_list" in
10118 $xxx_convert*|*" $xxx_convert"*) ;;
10119 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10122 : if sprintf cannot do long doubles, move it to the end
10123 if test "$d_PRIgldbl" != "$define"; then
10124 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10126 : if no qgcvt, remove it
10127 if test "$d_qgcvt" != "$define"; then
10128 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10131 xxx_list="$xxx_ld_list"
10135 for xxx_convert in $xxx_list; do
10136 echo "Trying $xxx_convert..."
10137 $rm -f try try$_o core
10138 set try -DTRY_$xxx_convert
10139 if eval $compile; then
10140 echo "$xxx_convert() found." >&4
10141 if $run ./try; then
10142 echo "I'll use $xxx_convert to convert floats into a string." >&4
10145 echo "...But $xxx_convert didn't work as I expected."
10149 echo "$xxx_convert NOT found." >&4
10153 if test X$xxx_convert = X; then
10154 echo "*** WHOA THERE!!! ***" >&4
10155 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10156 xxx_convert=sprintf
10159 case "$xxx_convert" in
10160 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10161 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10162 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10163 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10164 "$define$define$define")
10165 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10166 "$define$define$undef")
10167 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10168 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10176 : see if _fwalk exists
10180 : Initialize h_fcntl
10183 : Initialize h_sysfile
10186 : access call always available on UNIX
10187 set access d_access
10190 : locate the flags for 'access()'
10191 case "$d_access" in
10194 $cat >access.c <<EOCP
10195 #include <sys/types.h>
10200 #include <sys/file.h>
10203 #include <unistd.h>
10205 #$i_stdlib I_STDLIB
10207 #include <stdlib.h>
10213 : check sys/file.h first, no particular reason here
10214 if $test `./findhdr sys/file.h` && \
10215 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10217 echo "<sys/file.h> defines the *_OK access constants." >&4
10218 elif $test `./findhdr fcntl.h` && \
10219 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10221 echo "<fcntl.h> defines the *_OK access constants." >&4
10222 elif $test `./findhdr unistd.h` && \
10223 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10224 echo "<unistd.h> defines the *_OK access constants." >&4
10226 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10232 : see if accessx exists
10233 set accessx d_accessx
10236 : see if aintl exists
10240 : see if alarm exists
10244 : see if 64bit time functions exists
10246 set ctime64 d_ctime64
10249 set localtime64 d_localtime64
10252 set gmtime64 d_gmtime64
10255 set mktime64 d_mktime64
10258 set difftime64 d_difftime64
10261 set asctime64 d_asctime64
10264 : see if POSIX threads are available
10265 set pthread.h i_pthread
10268 : define a function to check prototypes
10269 $cat > protochk <<EOSH
10272 optimize="$optimize"
10274 prototype="$prototype"
10277 usethreads=$usethreads
10278 i_pthread=$i_pthread
10279 pthread_h_first=$pthread_h_first
10282 $cat >> protochk <<'EOSH'
10287 while test $# -ge 2; do
10289 $define) echo "#include <$2>" >> try.c ;;
10290 literal) echo "$2" >> try.c ;;
10292 # Extra magic for the benefit of systems that need pthread.h
10293 # to be included early to correctly detect threadsafe functions.
10294 # Such functions must guarantee themselves, though, that the usethreads
10295 # and i_pthread have been defined, before calling protochk.
10296 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10297 echo "#include <pthread.h>" >> try.c
10302 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10303 cat >> try.c <<'EOCP'
10304 #ifdef CAN_PROTOTYPE
10305 #define _(args) args
10310 echo "$foo" >> try.c
10311 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10312 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10318 $eunicefix protochk
10320 : Define hasproto macro for Configure internal use
10321 hasproto='varname=$1; func=$2; shift; shift;
10322 while $test $# -ge 2; do
10324 $define) echo "#include <$2>";;
10328 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10329 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10330 echo "$func() prototype found.";
10333 echo "$func() prototype NOT found.";
10340 : see if sys/types.h has to be included
10341 set sys/types.h i_systypes
10344 : see if sys/select.h has to be included
10345 set sys/select.h i_sysselct
10348 : Define hasfield macro for Configure internal use
10349 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10350 while $test $# -ge 2; do
10352 $define) echo "#include <$2>";;
10356 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10358 if eval $compile; then
10367 : see if we should include time.h, sys/time.h, or both
10369 if test "X$timeincl" = X; then
10370 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10371 $echo $n "I'm now running the test program...$c"
10373 #include <sys/types.h>
10378 #ifdef SYSTIMEKERNEL
10381 #include <sys/time.h>
10384 #include <sys/select.h>
10386 #$i_stdlib I_STDLIB
10388 #include <stdlib.h>
10394 struct timeval bar;
10397 struct timezone tzp;
10399 if (foo.tm_sec == foo.tm_sec)
10402 if (bar.tv_sec == bar.tv_sec)
10409 for s_timezone in '-DS_TIMEZONE' ''; do
10411 for s_timeval in '-DS_TIMEVAL' ''; do
10412 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10413 for i_time in '' '-DI_TIME'; do
10414 for i_systime in '-DI_SYSTIME' ''; do
10417 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10418 if eval $compile; then
10419 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10423 $echo $n "Succeeded with $flags$c"
10435 *SYSTIMEKERNEL*) i_systimek="$define"
10436 timeincl=`./findhdr sys/time.h`
10437 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10438 *) i_systimek="$undef";;
10441 *I_TIME*) i_time="$define"
10442 timeincl=`./findhdr time.h`" $timeincl"
10443 echo "We'll include <time.h>." >&4;;
10444 *) i_time="$undef";;
10447 *I_SYSTIME*) i_systime="$define"
10448 timeincl=`./findhdr sys/time.h`" $timeincl"
10449 echo "We'll include <sys/time.h>." >&4;;
10450 *) i_systime="$undef";;
10454 : see if struct tm knows about tm_zone
10455 case "$i_systime$i_time" in
10458 echo "Checking to see if your struct tm has tm_zone field..." >&4
10459 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10467 case "$d_tm_tm_zone" in
10468 "$define") echo "Yes, it does." ;;
10469 *) echo "No, it doesn't." ;;
10471 : see if struct tm knows about tm_gmtoff
10472 case "$i_systime$i_time" in
10475 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10476 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10484 case "$d_tm_tm_gmtoff" in
10485 "$define") echo "Yes, it does." ;;
10486 *) echo "No, it doesn't." ;;
10489 : see if asctime_r exists
10490 set asctime_r d_asctime_r
10492 case "$d_asctime_r" in
10494 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10495 case "$d_asctime_r_proto:$usethreads" in
10496 ":define") d_asctime_r_proto=define
10497 set d_asctime_r_proto asctime_r $hdrs
10501 case "$d_asctime_r_proto" in
10503 case "$asctime_r_proto" in
10504 ''|0) try='char* asctime_r(const struct tm*, char*);'
10505 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10507 case "$asctime_r_proto" in
10508 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10509 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10511 case "$asctime_r_proto" in
10512 ''|0) try='int asctime_r(const struct tm*, char*);'
10513 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10515 case "$asctime_r_proto" in
10516 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10517 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10519 case "$asctime_r_proto" in
10520 ''|0) d_asctime_r=undef
10522 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10523 * ) case "$asctime_r_proto" in
10524 REENTRANT_PROTO*) ;;
10525 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10527 echo "Prototype: $try" ;;
10530 *) case "$usethreads" in
10531 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10538 *) asctime_r_proto=0
10542 : see if atolf exists
10546 : see if atoll exists
10550 : Look for GCC-style attribute format
10551 case "$d_attribute_format" in
10554 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10555 $cat >attrib.c <<'EOCP'
10557 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10559 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10560 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10561 echo "Your C compiler doesn't support __attribute__((format))."
10564 echo "Your C compiler supports __attribute__((format))."
10568 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10572 *) val="$d_attribute_format" ;;
10574 set d_attribute_format
10578 : Look for GCC-style attribute format with null format allowed
10579 case "$d_printf_format_null" in
10580 '') case "$d_attribute_format" in
10583 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10584 $cat >attrib.c <<EOCP
10586 #$i_stdlib I_STDLIB
10588 #include <stdlib.h>
10590 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10591 int null_printf (char* pat,...) { return (int)pat; }
10592 int main () { exit(null_printf(NULL)); }
10594 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10595 : run the executable in case it produces a run-time warning
10596 if $run ./attrib >>attrib.out 2>&1; then
10597 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10598 echo "Your C compiler doesn't allow __printf__ format to be null."
10601 echo "Your C compiler allows __printf__ format to be null."
10605 echo "Your C compiler executable failed with __printf__ format null."
10609 echo "Your C compiler fails with __printf__ format null."
10616 *) val="$d_printf_format_null" ;;
10618 set d_printf_format_null
10622 : Look for GCC-style attribute malloc
10623 case "$d_attribute_malloc" in
10626 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10627 $cat >attrib.c <<'EOCP'
10629 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10631 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10632 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10633 echo "Your C compiler doesn't support __attribute__((malloc))."
10636 echo "Your C compiler supports __attribute__((malloc))."
10640 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10644 *) val="$d_attribute_malloc" ;;
10646 set d_attribute_malloc
10650 : Look for GCC-style attribute nonnull
10651 case "$d_attribute_nonnull" in
10654 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10655 $cat >attrib.c <<'EOCP'
10657 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10659 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10660 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10661 echo "Your C compiler doesn't support __attribute__((nonnull))."
10664 echo "Your C compiler supports __attribute__((nonnull))."
10668 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10672 *) val="$d_attribute_nonnull" ;;
10674 set d_attribute_nonnull
10678 : Look for GCC-style attribute noreturn
10679 case "$d_attribute_noreturn" in
10682 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10683 $cat >attrib.c <<'EOCP'
10685 void fall_over_dead( void ) __attribute__((noreturn));
10687 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10688 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10689 echo "Your C compiler doesn't support __attribute__((noreturn))."
10692 echo "Your C compiler supports __attribute__((noreturn))."
10696 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10700 *) val="$d_attribute_noreturn" ;;
10702 set d_attribute_noreturn
10706 : Look for GCC-style attribute pure
10707 case "$d_attribute_pure" in
10710 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10711 $cat >attrib.c <<'EOCP'
10713 int square( int n ) __attribute__((pure));
10715 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10716 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10717 echo "Your C compiler doesn't support __attribute__((pure))."
10720 echo "Your C compiler supports __attribute__((pure))."
10724 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10728 *) val="$d_attribute_pure" ;;
10730 set d_attribute_pure
10734 : Look for GCC-style attribute unused
10735 case "$d_attribute_unused" in
10738 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10739 $cat >attrib.c <<'EOCP'
10741 int do_something( int dummy __attribute__((unused)), int n );
10743 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10744 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10745 echo "Your C compiler doesn't support __attribute__((unused))."
10748 echo "Your C compiler supports __attribute__((unused))."
10752 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10756 *) val="$d_attribute_unused" ;;
10758 set d_attribute_unused
10762 : Look for GCC-style attribute deprecated
10763 case "$d_attribute_deprecated" in
10766 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10767 $cat >attrib.c <<'EOCP'
10769 int I_am_deprecated(void) __attribute__((deprecated));
10771 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10772 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10773 echo "Your C compiler doesn't support __attribute__((deprecated))."
10776 echo "Your C compiler supports __attribute__((deprecated))."
10780 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10784 *) val="$d_attribute_deprecated" ;;
10786 set d_attribute_deprecated
10790 : Look for GCC-style attribute warn_unused_result
10791 case "$d_attribute_warn_unused_result" in
10794 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10795 $cat >attrib.c <<'EOCP'
10797 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10799 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10800 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10801 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10804 echo "Your C compiler supports __attribute__((warn_unused_result))."
10808 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10812 *) val="$d_attribute_warn_unused_result" ;;
10814 set d_attribute_warn_unused_result
10818 : see if bcmp exists
10822 : see if bcopy exists
10826 : see if getpgrp exists
10827 set getpgrp d_getpgrp
10830 case "$d_getpgrp" in
10833 echo "Checking to see which flavor of getpgrp is in use..."
10835 #$i_unistd I_UNISTD
10836 #include <sys/types.h>
10838 # include <unistd.h>
10840 #$i_stdlib I_STDLIB
10842 #include <stdlib.h>
10846 if (getuid() == 0) {
10847 printf("(I see you are running Configure as super-user...)\n");
10850 #ifdef TRY_BSD_PGRP
10851 if (getpgrp(1) == 0)
10860 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10861 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10863 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10864 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10867 echo "I can't seem to compile and run the test program."
10869 xxx="a USG one, i.e. you use getpgrp()."
10871 # SVR4 systems can appear rather BSD-ish.
10872 case "$i_unistd" in
10874 xxx="a BSD one, i.e. you use getpgrp(pid)."
10878 xxx="probably a USG one, i.e. you use getpgrp()."
10883 echo "Assuming your getpgrp is $xxx" >&4
10892 : see if setpgrp exists
10893 set setpgrp d_setpgrp
10896 case "$d_setpgrp" in
10899 echo "Checking to see which flavor of setpgrp is in use..."
10901 #$i_unistd I_UNISTD
10902 #include <sys/types.h>
10904 # include <unistd.h>
10906 #$i_stdlib I_STDLIB
10908 #include <stdlib.h>
10912 if (getuid() == 0) {
10913 printf("(I see you are running Configure as super-user...)\n");
10916 #ifdef TRY_BSD_PGRP
10917 if (-1 == setpgrp(1, 1))
10920 if (setpgrp() != -1)
10926 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10927 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10929 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10930 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10933 echo "(I can't seem to compile and run the test program.)"
10935 xxx="a USG one, i.e. you use setpgrp()."
10937 # SVR4 systems can appear rather BSD-ish.
10938 case "$i_unistd" in
10940 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10944 xxx="probably a USG one, i.e. you use setpgrp()."
10949 echo "Assuming your setpgrp is $xxx" >&4
10958 : Look for GCC-style __builtin_choose_expr
10959 case "$d_builtin_choose_expr" in
10962 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10963 $cat >try.c <<'EOCP'
10964 #include <assert.h>
10965 #include <stdlib.h>
10968 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10971 assert( SYRINX(1) == 2112 );
10972 assert( SYRINX(1) != 5150 );
10973 assert( SYRINX(0) == 5150 );
10974 assert( SYRINX(0) != 2112 );
10975 puts( "All good!" );
10981 if eval $compile && $run ./try; then
10982 echo "Your C compiler supports __builtin_choose_expr."
10985 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10989 *) val="$d_builtin_choose_expr" ;;
10992 set d_builtin_choose_expr
10996 : Look for GCC-style __builtin_expect
10997 case "$d_builtin_expect" in
11000 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11001 $cat >try.c <<'EOCP'
11004 if ( __builtin_expect(n, 0) ) n = 1;
11005 /* Remember shell exit code truth is 0, C truth is non-zero */
11010 if eval $compile && $run ./try; then
11011 echo "Your C compiler supports __builtin_expect."
11014 echo "Your C compiler doesn't seem to understand __builtin_expect."
11018 *) val="$d_builtin_expect" ;;
11021 set d_builtin_expect
11025 : see if bzero exists
11029 : see if stdarg is available
11031 if $test `./findhdr stdarg.h`; then
11032 echo "<stdarg.h> found." >&4
11035 echo "<stdarg.h> NOT found." >&4
11039 : see if varargs is available
11041 if $test `./findhdr varargs.h`; then
11042 echo "<varargs.h> found." >&4
11044 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11047 : set up the varargs testing programs
11048 $cat > varargs.c <<EOP
11050 #include <stdarg.h>
11053 #include <varargs.h>
11057 int f(char *p, ...)
11071 p = va_arg(ap, char *);
11077 $cat > varargs <<EOP
11079 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11088 : now check which varargs header should be included
11094 if `./varargs I_STDARG`; then
11096 elif `./varargs I_VARARGS`; then
11101 if `./varargs I_VARARGS`; then
11109 echo "*** WHOA THERE!!! ***" >&4
11110 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11111 case "$knowitall" in
11113 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11117 echo "I could not find the definition for va_dcl... You have problems..." >&4
11118 val="$undef"; set i_stdarg; eval $setvar
11119 val="$undef"; set i_varargs; eval $setvar
11124 case "$i_varhdr" in
11126 val="$define"; set i_stdarg; eval $setvar
11127 val="$undef"; set i_varargs; eval $setvar
11130 val="$undef"; set i_stdarg; eval $setvar
11131 val="$define"; set i_varargs; eval $setvar
11134 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11138 : see if the Compiler supports C99 variadic macros
11139 case "$i_stdarg$i_stdlib" in
11141 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11144 #include <stdarg.h>
11146 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11150 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11156 if eval $compile && $run ./try 2>&1 >/dev/null; then
11157 case "`$run ./try`" in
11159 echo "You have C99 variadic macros." >&4
11160 d_c99_variadic_macros="$define"
11163 echo "You don't have functional C99 variadic macros." >&4
11164 d_c99_variadic_macros="$undef"
11168 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11169 d_c99_variadic_macros="$undef"
11174 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11175 d_c99_variadic_macros="$undef"
11179 : see if signal is declared as pointer to function returning int or void
11181 xxx=`./findhdr signal.h`
11182 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11183 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11184 echo "You have int (*signal())() instead of void." >&4
11186 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11187 echo "You have void (*signal())()." >&4
11189 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11190 echo "You have int (*signal())() instead of void." >&4
11192 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11193 echo "You have void (*signal())()." >&4
11196 case "$d_voidsig" in
11198 echo "I can't determine whether signal handler returns void or int..." >&4
11200 rp="What type does your signal handler return?"
11203 v*) val="$define";;
11207 echo "As you already told me, signal handler returns void." >&4
11210 *) echo "As you already told me, signal handler returns int." >&4
11217 case "$d_voidsig" in
11218 "$define") signal_t="void";;
11219 *) signal_t="int";;
11223 : check for ability to cast large floats to 32-bit ints.
11225 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11226 if $test "$intsize" -ge 4; then
11233 #$i_stdlib I_STDLIB
11235 #include <stdlib.h>
11237 #include <sys/types.h>
11238 #include <signal.h>
11239 $signal_t blech(int s) { exit(3); }
11246 signal(SIGFPE, blech);
11248 /* Don't let compiler optimize the test away. Store the number
11249 in a writable string for gcc to pass to sscanf under HP-UX.
11251 sprintf(str, "2147483647");
11252 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11256 /* x86 processors will probably give 0x8000 0000, which is a
11257 sign change. We don't want that. We want to mimic SPARC
11258 behavior here, which is to preserve the sign and give
11261 if (i32 != ($xxx) f)
11267 if eval $compile_ok; then
11271 echo "(I can't seem to compile the test program--assuming it can't)"
11276 echo "Yup, it can."
11279 echo "Nope, it can't."
11286 : check for ability to cast negative floats to unsigned
11288 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11291 #$i_stdlib I_STDLIB
11293 #include <stdlib.h>
11295 #include <sys/types.h>
11296 #include <signal.h>
11297 $signal_t blech(int s) { exit(7); }
11298 $signal_t blech_in_list(int s) { exit(4); }
11299 unsigned long dummy_long(unsigned long p) { return p; }
11300 unsigned int dummy_int(unsigned int p) { return p; }
11301 unsigned short dummy_short(unsigned short p) { return p; }
11305 unsigned long along;
11307 unsigned short ashort;
11311 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11312 a direct f = -123. assignment. gcc-2.8.0 reportedly
11313 optimized the whole file away
11315 /* Store the number in a writable string for gcc to pass to
11316 sscanf under HP-UX.
11318 sprintf(str, "-123");
11319 sscanf(str, "%lf", &f); /* f = -123.; */
11321 signal(SIGFPE, blech);
11322 along = (unsigned long)f;
11323 aint = (unsigned int)f;
11324 ashort = (unsigned short)f;
11325 if (along != (unsigned long)-123)
11327 if (aint != (unsigned int)-123)
11329 if (ashort != (unsigned short)-123)
11331 sprintf(str, "1073741824.");
11332 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11335 along = (unsigned long)f;
11336 if (along != 0x80000000)
11340 along = (unsigned long)f;
11341 if (along != 0x7fffffff)
11345 along = (unsigned long)f;
11346 if (along != 0x80000001)
11350 signal(SIGFPE, blech_in_list);
11351 sprintf(str, "123.");
11352 sscanf(str, "%lf", &f); /* f = 123.; */
11353 along = dummy_long((unsigned long)f);
11354 aint = dummy_int((unsigned int)f);
11355 ashort = dummy_short((unsigned short)f);
11356 if (along != (unsigned long)123)
11358 if (aint != (unsigned int)123)
11360 if (ashort != (unsigned short)123)
11367 if eval $compile_ok; then
11371 echo "(I can't seem to compile the test program--assuming it can't)"
11374 case "$castflags" in
11376 echo "Yup, it can."
11379 echo "Nope, it can't."
11386 : see if vprintf exists
11388 if set vprintf val -f d_vprintf; eval $csym; $val; then
11389 echo 'vprintf() found.' >&4
11392 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11393 #$i_varargs I_VARARGS
11395 #$i_stdlib I_STDLIB
11396 #$i_unistd I_UNISTD
11399 # include <stdarg.h>
11400 #else /* I_VARARGS */
11401 # include <varargs.h>
11405 # include <unistd.h>
11409 # include <stdlib.h>
11412 #include <stdio.h> /* vsprintf prototype */
11415 void xxx(int n, ...)
11420 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11422 int main() { xxx(1, "foo"); }
11424 #else /* I_VARARGS */
11432 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11434 int main() { xxx("foo"); }
11440 if eval $compile_ok; then
11441 if $run ./try; then
11442 echo "Your vsprintf() returns (int)." >&4
11445 echo "Your vsprintf() returns (char*)." >&4
11449 echo 'I am unable to compile the vsprintf() test program.' >&4
11450 # We shouldn't get here. If we do, assume the standard signature,
11451 # not the old BSD one.
11452 echo 'Guessing that vsprintf() returns (int).' >&4
11456 echo 'vprintf() NOT found.' >&4
11467 : see if chown exists
11471 : see if chroot exists
11472 set chroot d_chroot
11475 : see if chsize exists
11476 set chsize d_chsize
11479 : see if class exists
11483 : see if clearenv exists
11484 set clearenv d_clearenv
11487 : Define hasstruct macro for Configure internal use
11488 hasstruct='varname=$1; struct=$2; shift; shift;
11489 while $test $# -ge 2; do
11491 $define) echo "#include <$2>";;
11495 echo "int main () { struct $struct foo; }" >> try.c;
11497 if eval $compile; then
11506 : see whether socket exists
11510 $echo $n "Hmm... $c" >&4
11511 if set socket val -f d_socket; eval $csym; $val; then
11512 echo "Looks like you have Berkeley networking support." >&4
11514 if set setsockopt val -f; eval $csym; $val; then
11517 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11518 d_oldsock="$define"
11521 if $contains socklib libc.list >/dev/null 2>&1; then
11522 echo "Looks like you have Berkeley networking support." >&4
11524 : we will have to assume that it supports the 4.2 BSD interface
11527 echo "You don't have Berkeley networking in libc$_a..." >&4
11528 if test "X$d_socket" = "X$define"; then
11529 echo "...but you seem to believe that you have sockets." >&4
11531 for net in net socket
11533 if test -f $sysroot/usr/lib/lib$net$_a; then
11534 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11535 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11536 if $contains socket libc.list >/dev/null 2>&1; then
11541 echo "...but the Wollongong group seems to have hacked it in." >&4
11542 sockethdr="-I$sysroot/usr/netinclude"
11545 echo "Found Berkeley sockets interface in lib$net." >&4
11546 if $contains setsockopt libc.list >/dev/null 2>&1; then
11549 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11550 d_oldsock="$define"
11556 if test "X$d_socket" != "X$define"; then
11557 echo "or anywhere else I see." >&4
11565 : see if socketpair exists
11566 set socketpair d_sockpair
11571 echo "Checking the availability sa_len in the sock struct ..." >&4
11573 #include <sys/types.h>
11574 #include <sys/socket.h>
11576 struct sockaddr sa;
11577 return (sa.sa_len);
11581 set try; if eval $compile; then
11584 set d_sockaddr_sa_len; eval $setvar
11588 echo "Checking the availability struct sockaddr_in6 ..." >&4
11590 #include <sys/types.h>
11591 #include <sys/socket.h>
11592 #include <netinet/in.h>
11594 struct sockaddr_in6 sin6;
11595 return (sin6.sin6_family);
11599 set try; if eval $compile; then
11602 set d_sockaddr_in6; eval $setvar
11606 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11608 #include <sys/types.h>
11609 #include <sys/socket.h>
11610 #include <netinet/in.h>
11612 struct sockaddr_in6 sin6;
11613 return (sin6.sin6_scope_id);
11617 set try; if eval $compile; then
11620 set d_sin6_scope_id; eval $setvar
11624 echo "Checking the availability struct ip_mreq ..." >&4
11626 #include <sys/types.h>
11627 #include <sys/socket.h>
11628 #include <netinet/in.h>
11630 struct ip_mreq mreq;
11631 return (mreq.imr_multiaddr.s_addr);
11635 set try; if eval $compile; then
11638 set d_ip_mreq; eval $setvar
11642 echo "Checking the availability struct ip_mreq_source ..." >&4
11644 #include <sys/types.h>
11645 #include <sys/socket.h>
11646 #include <netinet/in.h>
11648 struct ip_mreq_source mreq;
11649 return (mreq.imr_multiaddr.s_addr);
11653 set try; if eval $compile; then
11656 set d_ip_mreq_source; eval $setvar
11660 echo "Checking the availability struct ipv6_mreq ..." >&4
11662 #include <sys/types.h>
11663 #include <sys/socket.h>
11664 #include <netinet/in.h>
11666 struct ipv6_mreq mreq;
11667 return (mreq.ipv6mr_interface);
11671 set try; if eval $compile; then
11674 set d_ipv6_mreq; eval $setvar
11678 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11680 #include <sys/types.h>
11681 #include <sys/socket.h>
11682 #include <netinet/in.h>
11684 struct ipv6_mreq_source mreq;
11685 return (mreq.imr_multiaddr.s_addr);
11689 set try; if eval $compile; then
11692 set d_ipv6_mreq_source; eval $setvar
11696 echo "Checking the availability of certain socket constants..." >&4
11697 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11698 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11700 #include <sys/types.h>
11701 #include <sys/socket.h>
11707 set try; if eval $compile; then
11710 set d_${enum}; eval $setvar
11714 : see if this is a sys/uio.h system
11715 set sys/uio.h i_sysuio
11718 : Check for cmsghdr support
11720 echo "Checking to see if your system supports struct cmsghdr..." >&4
11721 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11723 case "$d_cmsghdr_s" in
11724 "$define") echo "Yes, it does." ;;
11725 *) echo "No, it doesn't." ;;
11729 : check for const keyword
11731 echo 'Checking to see if your C compiler knows about "const"...' >&4
11732 $cat >const.c <<'EOCP'
11733 typedef struct spug { int drokk; } spug;
11737 const spug y = { 0 };
11740 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11742 echo "Yup, it does."
11745 echo "Nope, it doesn't."
11750 : see if copysignl exists
11751 set copysignl d_copysignl
11754 : see if crypt exists
11759 $define) cryptlib='' ;;
11760 *) if set crypt val -f d_crypt; eval $csym; $val; then
11761 echo 'crypt() found.' >&4
11765 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11766 if $test -z "$cryptlib"; then
11767 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11771 if $test -z "$cryptlib"; then
11772 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11776 if $test -z "$cryptlib"; then
11777 cryptlib=`./loc libcrypt$_a "" $libpth`
11781 if $test -z "$cryptlib"; then
11782 echo 'crypt() NOT found.' >&4
11793 : see if this is a crypt.h system
11794 set crypt.h i_crypt
11797 : see if crypt_r exists
11798 set crypt_r d_crypt_r
11800 case "$d_crypt_r" in
11802 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11803 case "$d_crypt_r_proto:$usethreads" in
11804 ":define") d_crypt_r_proto=define
11805 set d_crypt_r_proto crypt_r $hdrs
11809 case "$d_crypt_r_proto" in
11811 case "$crypt_r_proto" in
11812 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11813 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11815 case "$crypt_r_proto" in
11816 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11817 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11819 case "$crypt_r_proto" in
11820 ''|0) d_crypt_r=undef
11822 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11823 * ) case "$crypt_r_proto" in
11824 REENTRANT_PROTO*) ;;
11825 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11827 echo "Prototype: $try" ;;
11830 *) case "$usethreads" in
11831 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11842 : get csh whereabouts
11844 'csh') val="$undef" ;;
11845 *) val="$define" ;;
11849 : Respect a hint or command line value for full_csh.
11850 case "$full_csh" in
11851 '') full_csh=$csh ;;
11854 : see if ctermid exists
11855 set ctermid d_ctermid
11858 : see if ctermid_r exists
11859 set ctermid_r d_ctermid_r
11861 case "$d_ctermid_r" in
11863 hdrs="$i_systypes sys/types.h define stdio.h "
11864 case "$d_ctermid_r_proto:$usethreads" in
11865 ":define") d_ctermid_r_proto=define
11866 set d_ctermid_r_proto ctermid_r $hdrs
11870 case "$d_ctermid_r_proto" in
11872 case "$ctermid_r_proto" in
11873 ''|0) try='char* ctermid_r(char*);'
11874 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11876 case "$ctermid_r_proto" in
11877 ''|0) d_ctermid_r=undef
11879 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11880 * ) case "$ctermid_r_proto" in
11881 REENTRANT_PROTO*) ;;
11882 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11884 echo "Prototype: $try" ;;
11887 *) case "$usethreads" in
11888 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11895 *) ctermid_r_proto=0
11899 : see if ctime_r exists
11900 set ctime_r d_ctime_r
11902 case "$d_ctime_r" in
11904 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11905 case "$d_ctime_r_proto:$usethreads" in
11906 ":define") d_ctime_r_proto=define
11907 set d_ctime_r_proto ctime_r $hdrs
11911 case "$d_ctime_r_proto" in
11913 case "$ctime_r_proto" in
11914 ''|0) try='char* ctime_r(const time_t*, char*);'
11915 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11917 case "$ctime_r_proto" in
11918 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11919 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11921 case "$ctime_r_proto" in
11922 ''|0) try='int ctime_r(const time_t*, char*);'
11923 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11925 case "$ctime_r_proto" in
11926 ''|0) try='int ctime_r(const time_t*, char*, int);'
11927 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11929 case "$ctime_r_proto" in
11930 ''|0) d_ctime_r=undef
11932 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11933 * ) case "$ctime_r_proto" in
11934 REENTRANT_PROTO*) ;;
11935 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11937 echo "Prototype: $try" ;;
11940 *) case "$usethreads" in
11941 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11952 : see if cuserid exists
11953 set cuserid d_cuserid
11956 : see if this is a limits.h system
11957 set limits.h i_limits
11960 : see if this is a float.h system
11961 set float.h i_float
11964 : See if number of significant digits in a double precision number is known
11966 $cat >dbl_dig.c <<EOM
11967 #$i_limits I_LIMITS
11970 #include <limits.h>
11976 printf("Contains DBL_DIG");
11979 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11980 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11981 echo "DBL_DIG found." >&4
11984 echo "DBL_DIG NOT found." >&4
11991 : see if dbm.h is available
11992 : see if dbmclose exists
11993 set dbmclose d_dbmclose
11996 case "$d_dbmclose" in
12006 *) set rpcsvc/dbm.h i_rpcsvcdbm
12011 *) echo "We won't be including <dbm.h>"
12021 : see if prototype for dbminit is available
12023 set d_dbminitproto dbminit $i_dbm dbm.h
12026 : see if difftime exists
12027 set difftime d_difftime
12030 : see if this is a dirent system
12032 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12034 echo "<dirent.h> found." >&4
12037 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12038 echo "<sys/dir.h> found." >&4
12041 xinc=`./findhdr sys/ndir.h`
12043 echo "<dirent.h> NOT found." >&4
12048 : Look for type of directory structure.
12050 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12052 case "$direntrytype" in
12054 case "$i_dirent" in
12055 $define) guess1='struct dirent' ;;
12056 *) guess1='struct direct' ;;
12059 *) guess1="$direntrytype"
12064 'struct dirent') guess2='struct direct' ;;
12065 *) guess2='struct dirent' ;;
12068 if $contains "$guess1" try.c >/dev/null 2>&1; then
12069 direntrytype="$guess1"
12070 echo "Your directory entries are $direntrytype." >&4
12071 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12072 direntrytype="$guess2"
12073 echo "Your directory entries seem to be $direntrytype." >&4
12075 echo "I don't recognize your system's directory entries." >&4
12076 rp="What type is used for directory entries on this system?"
12079 direntrytype="$ans"
12083 : see if the directory entry stores field length
12085 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12086 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12087 echo "Good, your directory entry keeps length information in d_namlen." >&4
12090 echo "Your directory entry does not know about the d_namlen field." >&4
12097 : Look for DIR.dd_fd
12098 case "$i_dirent" in
12100 echo "Checking to see if DIR has a dd_fd member variable" >&4
12102 #$i_stdlib I_STDLIB
12104 #include <stdlib.h>
12106 #include <dirent.h>
12116 if eval $compile; then
12117 echo "Yes, it does."
12120 echo "No, it does not."
12125 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12133 : see if this is an sysdir system
12134 set sys/dir.h i_sysdir
12137 : see if this is an sysndir system
12138 set sys/ndir.h i_sysndir
12143 $cat >dirfd.c <<EOM
12145 #$i_stdlib I_STDLIB
12147 #include <stdlib.h>
12149 #$i_dirent I_DIRENT /**/
12150 #$i_sysdir I_SYS_DIR /**/
12151 #$i_sysndir I_SYS_NDIR /**/
12152 #$i_systypes I_SYS_TYPES /**/
12153 #if defined(I_SYS_TYPES)
12154 #include <sys/types.h>
12156 #if defined(I_DIRENT)
12157 #include <dirent.h>
12158 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12159 #include <sys/dir.h>
12163 #include <sys/ndir.h>
12167 #include <ndir.h> /* may be wrong in the future */
12169 #include <sys/dir.h>
12175 DIR *dirp = opendir(".");
12176 if (dirfd(dirp) >= 0)
12184 if eval $compile; then
12188 $define) echo "dirfd() found." >&4 ;;
12189 *) echo "dirfd() NOT found." >&4 ;;
12195 : see if dlerror exists
12198 set dlerror d_dlerror
12202 : see if dlfcn is available
12203 set dlfcn.h i_dlfcn
12206 : Check what extension to use for shared libs
12211 On a few systems, the dynamically loaded modules that perl generates and uses
12212 will need a different extension than shared libs. The default will probably
12218 *) dflt="$dlext" ;;
12220 rp='What is the extension of dynamically loaded modules'
12229 : Check if dlsym need a leading underscore
12235 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12236 $cat >dyna.c <<'EOM'
12243 #$i_stdlib I_STDLIB
12245 #include <stdlib.h>
12249 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12251 #include <sys/types.h>
12256 extern int fred() ;
12265 int mode = RTLD_LAZY ;
12267 handle = dlopen("./dyna.$dlext", mode) ;
12268 if (handle == NULL) {
12273 symbol = dlsym(handle, "fred") ;
12274 if (symbol == NULL) {
12275 /* try putting a leading underscore */
12276 symbol = dlsym(handle, "_fred") ;
12277 if (symbol == NULL) {
12290 : Call the object file tmp-dyna.o in case dlext=o.
12291 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12292 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12293 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12294 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12297 1) echo "Test program failed using dlopen." >&4
12298 echo "Perhaps you should not use dynamic loading." >&4;;
12299 2) echo "Test program failed using dlsym." >&4
12300 echo "Perhaps you should not use dynamic loading." >&4;;
12301 3) echo "dlsym needs a leading underscore" >&4
12303 4) echo "dlsym doesn't need a leading underscore." >&4;;
12306 echo "I can't compile and run the test program." >&4
12307 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12312 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12317 : see if drand48_r exists
12318 set drand48_r d_drand48_r
12320 case "$d_drand48_r" in
12322 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12323 case "$d_drand48_r_proto:$usethreads" in
12324 ":define") d_drand48_r_proto=define
12325 set d_drand48_r_proto drand48_r $hdrs
12329 case "$d_drand48_r_proto" in
12331 case "$drand48_r_proto" in
12332 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12333 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12335 case "$drand48_r_proto" in
12336 ''|0) d_drand48_r=undef
12338 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12339 * ) case "$drand48_r_proto" in
12340 REENTRANT_PROTO*) ;;
12341 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12343 echo "Prototype: $try" ;;
12346 *) case "$usethreads" in
12347 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12354 *) drand48_r_proto=0
12358 : see if prototype for drand48 is available
12360 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12363 : see if dup2 exists
12367 : see if eaccess exists
12368 set eaccess d_eaccess
12371 : see if endgrent exists
12372 set endgrent d_endgrent
12375 : see if this is an grp system
12381 xxx=`./findhdr grp.h`
12382 $cppstdin $cppflags $cppminus < $xxx >$$.h
12384 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12396 set d_grpasswd; eval $setvar
12400 : see if endgrent_r exists
12401 set endgrent_r d_endgrent_r
12403 case "$d_endgrent_r" in
12405 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12406 case "$d_endgrent_r_proto:$usethreads" in
12407 ":define") d_endgrent_r_proto=define
12408 set d_endgrent_r_proto endgrent_r $hdrs
12412 case "$d_endgrent_r_proto" in
12414 case "$endgrent_r_proto" in
12415 ''|0) try='int endgrent_r(FILE**);'
12416 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12418 case "$endgrent_r_proto" in
12419 ''|0) try='void endgrent_r(FILE**);'
12420 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12422 case "$endgrent_r_proto" in
12423 ''|0) d_endgrent_r=undef
12425 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12426 * ) case "$endgrent_r_proto" in
12427 REENTRANT_PROTO*) ;;
12428 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12430 echo "Prototype: $try" ;;
12433 *) case "$usethreads" in
12434 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12441 *) endgrent_r_proto=0
12445 : see if endhostent exists
12446 set endhostent d_endhent
12449 : see if this is a netdb.h system
12450 set netdb.h i_netdb
12453 : see if endhostent_r exists
12454 set endhostent_r d_endhostent_r
12456 case "$d_endhostent_r" in
12458 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12459 case "$d_endhostent_r_proto:$usethreads" in
12460 ":define") d_endhostent_r_proto=define
12461 set d_endhostent_r_proto endhostent_r $hdrs
12465 case "$d_endhostent_r_proto" in
12467 case "$endhostent_r_proto" in
12468 ''|0) try='int endhostent_r(struct hostent_data*);'
12469 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12471 case "$endhostent_r_proto" in
12472 ''|0) try='void endhostent_r(struct hostent_data*);'
12473 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12475 case "$endhostent_r_proto" in
12476 ''|0) d_endhostent_r=undef
12477 endhostent_r_proto=0
12478 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12479 * ) case "$endhostent_r_proto" in
12480 REENTRANT_PROTO*) ;;
12481 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12483 echo "Prototype: $try" ;;
12486 *) case "$usethreads" in
12487 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12489 d_endhostent_r=undef
12490 endhostent_r_proto=0
12494 *) endhostent_r_proto=0
12498 : see if endnetent exists
12499 set endnetent d_endnent
12502 : see if endnetent_r exists
12503 set endnetent_r d_endnetent_r
12505 case "$d_endnetent_r" in
12507 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12508 case "$d_endnetent_r_proto:$usethreads" in
12509 ":define") d_endnetent_r_proto=define
12510 set d_endnetent_r_proto endnetent_r $hdrs
12514 case "$d_endnetent_r_proto" in
12516 case "$endnetent_r_proto" in
12517 ''|0) try='int endnetent_r(struct netent_data*);'
12518 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12520 case "$endnetent_r_proto" in
12521 ''|0) try='void endnetent_r(struct netent_data*);'
12522 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12524 case "$endnetent_r_proto" in
12525 ''|0) d_endnetent_r=undef
12526 endnetent_r_proto=0
12527 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12528 * ) case "$endnetent_r_proto" in
12529 REENTRANT_PROTO*) ;;
12530 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12532 echo "Prototype: $try" ;;
12535 *) case "$usethreads" in
12536 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12538 d_endnetent_r=undef
12539 endnetent_r_proto=0
12543 *) endnetent_r_proto=0
12547 : see if endprotoent exists
12548 set endprotoent d_endpent
12551 : see if endprotoent_r exists
12552 set endprotoent_r d_endprotoent_r
12554 case "$d_endprotoent_r" in
12556 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12557 case "$d_endprotoent_r_proto:$usethreads" in
12558 ":define") d_endprotoent_r_proto=define
12559 set d_endprotoent_r_proto endprotoent_r $hdrs
12563 case "$d_endprotoent_r_proto" in
12565 case "$endprotoent_r_proto" in
12566 ''|0) try='int endprotoent_r(struct protoent_data*);'
12567 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12569 case "$endprotoent_r_proto" in
12570 ''|0) try='void endprotoent_r(struct protoent_data*);'
12571 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12573 case "$endprotoent_r_proto" in
12574 ''|0) d_endprotoent_r=undef
12575 endprotoent_r_proto=0
12576 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12577 * ) case "$endprotoent_r_proto" in
12578 REENTRANT_PROTO*) ;;
12579 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12581 echo "Prototype: $try" ;;
12584 *) case "$usethreads" in
12585 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12587 d_endprotoent_r=undef
12588 endprotoent_r_proto=0
12592 *) endprotoent_r_proto=0
12596 : see if endpwent exists
12597 set endpwent d_endpwent
12600 : see if this is a pwd.h system
12606 xxx=`./findhdr pwd.h`
12607 $cppstdin $cppflags $cppminus < $xxx >$$.h
12609 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12617 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12625 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12633 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12641 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12649 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12657 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12665 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12677 set d_pwquota; eval $setvar
12678 set d_pwage; eval $setvar
12679 set d_pwchange; eval $setvar
12680 set d_pwclass; eval $setvar
12681 set d_pwexpire; eval $setvar
12682 set d_pwcomment; eval $setvar
12683 set d_pwgecos; eval $setvar
12684 set d_pwpasswd; eval $setvar
12688 : see if endpwent_r exists
12689 set endpwent_r d_endpwent_r
12691 case "$d_endpwent_r" in
12693 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12694 case "$d_endpwent_r_proto:$usethreads" in
12695 ":define") d_endpwent_r_proto=define
12696 set d_endpwent_r_proto endpwent_r $hdrs
12700 case "$d_endpwent_r_proto" in
12702 case "$endpwent_r_proto" in
12703 ''|0) try='int endpwent_r(FILE**);'
12704 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12706 case "$endpwent_r_proto" in
12707 ''|0) try='void endpwent_r(FILE**);'
12708 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12710 case "$endpwent_r_proto" in
12711 ''|0) d_endpwent_r=undef
12713 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12714 * ) case "$endpwent_r_proto" in
12715 REENTRANT_PROTO*) ;;
12716 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12718 echo "Prototype: $try" ;;
12721 *) case "$usethreads" in
12722 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12729 *) endpwent_r_proto=0
12733 : see if endservent exists
12734 set endservent d_endsent
12737 : see if endservent_r exists
12738 set endservent_r d_endservent_r
12740 case "$d_endservent_r" in
12742 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12743 case "$d_endservent_r_proto:$usethreads" in
12744 ":define") d_endservent_r_proto=define
12745 set d_endservent_r_proto endservent_r $hdrs
12749 case "$d_endservent_r_proto" in
12751 case "$endservent_r_proto" in
12752 ''|0) try='int endservent_r(struct servent_data*);'
12753 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12755 case "$endservent_r_proto" in
12756 ''|0) try='void endservent_r(struct servent_data*);'
12757 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12759 case "$endservent_r_proto" in
12760 ''|0) d_endservent_r=undef
12761 endservent_r_proto=0
12762 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12763 * ) case "$endservent_r_proto" in
12764 REENTRANT_PROTO*) ;;
12765 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12767 echo "Prototype: $try" ;;
12770 *) case "$usethreads" in
12771 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12773 d_endservent_r=undef
12774 endservent_r_proto=0
12778 *) endservent_r_proto=0
12782 : Locate the flags for 'open()'
12785 #include <sys/types.h>
12790 #include <sys/file.h>
12792 #$i_stdlib I_STDLIB
12794 #include <stdlib.h>
12805 : check sys/file.h first to get FREAD on Sun
12806 if $test `./findhdr sys/file.h` && \
12807 set try -DI_SYS_FILE && eval $compile; then
12809 echo "<sys/file.h> defines the O_* constants..." >&4
12810 if $run ./try; then
12811 echo "and you have the 3 argument form of open()." >&4
12814 echo "but not the 3 argument form of open(). Oh, well." >&4
12817 elif $test `./findhdr fcntl.h` && \
12818 set try -DI_FCNTL && eval $compile; then
12820 echo "<fcntl.h> defines the O_* constants..." >&4
12821 if $run ./try; then
12822 echo "and you have the 3 argument form of open()." >&4
12825 echo "but not the 3 argument form of open(). Oh, well." >&4
12830 echo "I can't find the O_* constant definitions! You got problems." >&4
12836 : see if this is a sys/file.h system
12841 : do we need to include sys/file.h ?
12845 if $h_sysfile; then
12847 echo "We'll be including <sys/file.h>." >&4
12850 echo "We won't be including <sys/file.h>." >&4
12860 : see if fcntl.h is there
12865 : see if we can include fcntl.h
12871 echo "We'll be including <fcntl.h>." >&4
12874 if $h_sysfile; then
12875 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12877 echo "We won't be including <fcntl.h>." >&4
12889 : see if fork exists
12893 : see if pipe exists
12897 : check for non-blocking I/O stuff
12898 case "$h_sysfile" in
12899 true) echo "#include <sys/file.h>" > head.c;;
12902 true) echo "#include <fcntl.h>" > head.c;;
12903 *) echo "#include <sys/fcntl.h>" > head.c;;
12908 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12909 case "$o_nonblock" in
12911 $cat head.c > try.c
12912 $cat >>try.c <<EOCP
12914 #$i_stdlib I_STDLIB
12916 #include <stdlib.h>
12924 printf("O_NONBLOCK\n");
12928 printf("O_NDELAY\n");
12932 printf("FNDELAY\n");
12939 if eval $compile_ok; then
12940 o_nonblock=`$run ./try`
12941 case "$o_nonblock" in
12942 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12943 *) echo "Seems like we can use $o_nonblock.";;
12946 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12949 *) echo "Using $hint value $o_nonblock.";;
12954 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12957 case "$d_fork:$d_pipe" in
12959 $cat head.c > try.c
12960 $cat >>try.c <<EOCP
12962 #include <sys/types.h>
12963 #include <signal.h>
12965 #$i_stdlib I_STDLIB
12967 #include <stdlib.h>
12973 #define MY_O_NONBLOCK $o_nonblock
12974 #ifndef errno /* XXX need better Configure test */
12977 #$i_unistd I_UNISTD
12979 #include <unistd.h>
12981 #$i_string I_STRING
12983 #include <string.h>
12985 #include <strings.h>
12987 $signal_t blech(int x) { exit(3); }
12989 $cat >> try.c <<'EOCP'
12997 pipe(pd); /* Down: child -> parent */
12998 pipe(pu); /* Up: parent -> child */
13001 close(pd[1]); /* Parent reads from pd[0] */
13002 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13004 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13009 signal(SIGALRM, blech);
13011 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13013 sprintf(string, "%d\n", ret);
13014 write(2, string, strlen(string));
13017 if (errno == EAGAIN) {
13018 printf("EAGAIN\n");
13023 if (errno == EWOULDBLOCK)
13024 printf("EWOULDBLOCK\n");
13027 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13028 sleep(2); /* Give it time to close our pipe */
13030 ret = read(pd[0], buf, 1); /* Should read EOF */
13032 sprintf(string, "%d\n", ret);
13033 write(4, string, strlen(string));
13037 close(pd[0]); /* We write to pd[1] */
13038 close(pu[1]); /* We read from pu[0] */
13039 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13040 close(pd[1]); /* Pipe pd is now fully closed! */
13041 exit(0); /* Bye bye, thank you for playing! */
13045 if eval $compile_ok; then
13046 echo "$startsh" >mtry
13047 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13049 $run ./mtry >/dev/null 2>&1
13051 0) eagain=`$cat try.out`;;
13052 1) echo "Could not perform non-blocking setting!";;
13053 2) echo "I did a successful read() for something that was not there!";;
13054 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13055 4) echo "Could not find F_SETFL!";;
13056 *) echo "Something terribly wrong happened during testing.";;
13058 rd_nodata=`$cat try.ret`
13059 echo "A read() system call with no data present returns $rd_nodata."
13060 case "$rd_nodata" in
13063 echo "(That's peculiar, fixing that to be -1.)"
13069 echo "Forcing errno EAGAIN on read() with no data available."
13073 echo "Your read() sets errno to $eagain when no data is available."
13076 status=`$cat try.err`
13078 0) echo "And it correctly returns 0 to signal EOF.";;
13079 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13080 *) echo "However, your read() returns '$status' on EOF??";;
13083 if test "$status" = "$rd_nodata"; then
13084 echo "WARNING: you can't distinguish between EOF and no data!"
13088 echo "I can't compile the test program--assuming errno EAGAIN will do."
13092 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13101 echo "Using $hint value $eagain."
13102 echo "Your read() returns $rd_nodata when no data is present."
13103 case "$d_eofnblk" in
13104 "$define") echo "And you can see EOF because read() returns 0.";;
13105 "$undef") echo "But you can't see EOF status from read() returned value.";;
13107 echo "(Assuming you can't see EOF status from read anyway.)"
13113 $rm_try head.c mtry
13115 : see if _ptr and _cnt from stdio act std
13118 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13119 echo "(Looks like you have stdio.h from BSD.)"
13120 case "$stdio_ptr" in
13121 '') stdio_ptr='((fp)->_p)'
13124 *) ptr_lval=$d_stdio_ptr_lval;;
13126 case "$stdio_cnt" in
13127 '') stdio_cnt='((fp)->_r)'
13130 *) cnt_lval=$d_stdio_cnt_lval;;
13132 case "$stdio_base" in
13133 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13135 case "$stdio_bufsiz" in
13136 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13138 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13139 echo "(Looks like you have stdio.h from Linux.)"
13140 case "$stdio_ptr" in
13141 '') stdio_ptr='((fp)->_IO_read_ptr)'
13144 *) ptr_lval=$d_stdio_ptr_lval;;
13146 case "$stdio_cnt" in
13147 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13150 *) cnt_lval=$d_stdio_cnt_lval;;
13152 case "$stdio_base" in
13153 '') stdio_base='((fp)->_IO_read_base)';;
13155 case "$stdio_bufsiz" in
13156 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13159 case "$stdio_ptr" in
13160 '') stdio_ptr='((fp)->_ptr)'
13163 *) ptr_lval=$d_stdio_ptr_lval;;
13165 case "$stdio_cnt" in
13166 '') stdio_cnt='((fp)->_cnt)'
13169 *) cnt_lval=$d_stdio_cnt_lval;;
13171 case "$stdio_base" in
13172 '') stdio_base='((fp)->_base)';;
13174 case "$stdio_bufsiz" in
13175 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13179 : test whether _ptr and _cnt really work
13180 echo "Checking how std your stdio is..." >&4
13183 #$i_stdlib I_STDLIB
13185 #include <stdlib.h>
13187 #define FILE_ptr(fp) $stdio_ptr
13188 #define FILE_cnt(fp) $stdio_cnt
13190 FILE *fp = fopen("try.c", "r");
13193 18 <= FILE_cnt(fp) &&
13194 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13202 if eval $compile && $to try.c; then
13203 if $run ./try; then
13204 echo "Your stdio acts pretty std."
13207 echo "Your stdio isn't very std."
13210 echo "Your stdio doesn't appear very std."
13214 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13215 # direct buffer manipulation no longer works. The Configure tests
13216 # should be changed to correctly detect this, but until then,
13217 # the following check should at least let perl compile and run.
13218 # (This quick fix should be updated before 5.8.1.)
13219 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13220 # A. Dougherty, June 3, 2002.
13221 case "$d_gnulibc" in
13223 case "$gnulibc_version" in
13227 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13236 : Can _ptr be used as an lvalue?
13237 case "$d_stdstdio$ptr_lval" in
13238 $define$define) val=$define ;;
13241 set d_stdio_ptr_lval
13244 : Can _cnt be used as an lvalue?
13245 case "$d_stdstdio$cnt_lval" in
13246 $define$define) val=$define ;;
13249 set d_stdio_cnt_lval
13253 : test whether setting _ptr sets _cnt as a side effect
13254 d_stdio_ptr_lval_sets_cnt="$undef"
13255 d_stdio_ptr_lval_nochange_cnt="$undef"
13256 case "$d_stdio_ptr_lval$d_stdstdio" in
13258 echo "Checking to see what happens if we set the stdio ptr..." >&4
13261 /* Can we scream? */
13262 /* Eat dust sed :-) */
13263 /* In the buffer space, no one can hear you scream. */
13264 #$i_stdlib I_STDLIB
13266 #include <stdlib.h>
13268 #define FILE_ptr(fp) $stdio_ptr
13269 #define FILE_cnt(fp) $stdio_cnt
13270 #include <sys/types.h>
13272 FILE *fp = fopen("try.c", "r");
13277 puts("Fail even to read");
13280 c = getc(fp); /* Read away the first # */
13282 puts("Fail even to read");
13286 18 <= FILE_cnt(fp) &&
13287 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13289 puts("Fail even to read");
13292 ptr = (char*) FILE_ptr(fp);
13293 cnt = (size_t)FILE_cnt(fp);
13295 FILE_ptr(fp) += 42;
13297 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13298 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13301 if (FILE_cnt(fp) <= 20) {
13302 printf ("Fail (<20 chars to test)");
13305 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13306 puts("Fail compare");
13309 if (cnt == FILE_cnt(fp)) {
13310 puts("Pass_unchanged");
13313 if (FILE_cnt(fp) == (cnt - 42)) {
13314 puts("Pass_changed");
13317 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13323 if eval $compile && $to try.c; then
13324 case `$run ./try` in
13326 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13327 d_stdio_ptr_lval_sets_cnt="$define" ;;
13329 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13330 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13332 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13334 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13337 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13343 : see if _base is also standard
13345 case "$d_stdstdio" in
13349 #$i_stdlib I_STDLIB
13351 #include <stdlib.h>
13353 #define FILE_base(fp) $stdio_base
13354 #define FILE_bufsiz(fp) $stdio_bufsiz
13356 FILE *fp = fopen("try.c", "r");
13359 19 <= FILE_bufsiz(fp) &&
13360 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13367 if eval $compile && $to try.c; then
13368 if $run ./try; then
13369 echo "And its _base field acts std."
13372 echo "But its _base field isn't std."
13375 echo "However, it seems to be lacking the _base field."
13383 : see if fast_stdio exists
13385 case "$d_stdstdio:$d_stdio_ptr_lval" in
13387 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13389 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13400 : see if fchdir exists
13401 set fchdir d_fchdir
13404 : see if fchmod exists
13405 set fchmod d_fchmod
13408 : see if fchown exists
13409 set fchown d_fchown
13412 : see if this is an fcntl system
13416 : See if fcntl-based locking works.
13419 #$i_stdlib I_STDLIB
13421 #include <stdlib.h>
13423 #include <unistd.h>
13425 #include <signal.h>
13426 $signal_t blech(int x) { exit(3); }
13428 #if defined(F_SETLK) && defined(F_SETLKW)
13429 struct flock flock;
13431 fd = open("try.c", O_RDONLY);
13432 flock.l_type = F_RDLCK;
13433 flock.l_whence = SEEK_SET;
13434 flock.l_start = flock.l_len = 0;
13435 signal(SIGALRM, blech);
13437 retval = fcntl(fd, F_SETLK, &flock);
13439 (retval < 0 ? exit(2) : exit(0));
13445 echo "Checking if fcntl-based file locking works... "
13449 if eval $compile_ok; then
13450 if $run ./try; then
13451 echo "Yes, it seems to work."
13454 echo "Nope, it didn't work."
13459 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13460 *** This is (almost) impossible.
13461 *** If your NFS lock daemons are not feeling well, something like
13462 *** this may happen, please investigate. Cannot continue, aborting.
13470 echo "I'm unable to compile the test program, so I'll assume not."
13475 echo "Nope, since you don't even have fcntl()."
13478 set d_fcntl_can_lock
13482 : check for fd_set items
13485 Checking to see how well your C compiler handles fd_set and friends ...
13488 #$i_stdlib I_STDLIB
13490 #include <stdlib.h>
13492 #$i_systime I_SYS_TIME
13493 #$i_sysselct I_SYS_SELECT
13494 #$d_socket HAS_SOCKET
13495 #include <sys/types.h>
13497 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13500 #include <sys/time.h>
13502 #ifdef I_SYS_SELECT
13503 #include <sys/select.h>
13512 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13520 if eval $compile; then
13521 d_fds_bits="$define"
13523 echo "Well, your system knows about the normal fd_set typedef..." >&4
13524 if $run ./try; then
13525 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13526 d_fd_macros="$define"
13529 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13531 d_fd_macros="$undef"
13535 Hmm, your compiler has some difficulty with fd_set. Checking further...
13538 if eval $compile; then
13539 d_fds_bits="$undef"
13541 echo "Well, your system has some sort of fd_set available..." >&4
13542 if $run ./try; then
13543 echo "and you have the normal fd_set macros." >&4
13544 d_fd_macros="$define"
13547 but not the normal fd_set macros! Gross! More work for me...
13549 d_fd_macros="$undef"
13552 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13554 d_fds_bits="$undef"
13555 d_fd_macros="$undef"
13560 : see if fgetpos exists
13561 set fgetpos d_fgetpos
13564 : see if finite exists
13565 set finite d_finite
13568 : see if finitel exists
13569 set finitel d_finitel
13572 : see if flock exists
13576 : see if prototype for flock is available
13578 set d_flockproto flock $i_sysfile sys/file.h
13581 : see if fp_class exists
13582 set fp_class d_fp_class
13585 : see if pathconf exists
13586 set pathconf d_pathconf
13589 : see if fpathconf exists
13590 set fpathconf d_fpathconf
13593 : see if fpclass exists
13594 set fpclass d_fpclass
13597 : see if fpclassify exists
13598 set fpclassify d_fpclassify
13601 : see if fpclassl exists
13602 set fpclassl d_fpclassl
13605 : check for fpos64_t
13607 echo "Checking to see if you have fpos64_t..." >&4
13610 int main() { fpos64_t x = 7; }
13613 if eval $compile; then
13615 echo "You have fpos64_t."
13618 echo "You do not have fpos64_t."
13619 case "$fpossize" in
13620 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13627 : see if frexpl exists
13628 set frexpl d_frexpl
13631 : see if this is a sys/param system
13632 set sys/param.h i_sysparam
13635 : see if this is a sys/mount.h system
13636 set sys/mount.h i_sysmount
13639 : Check for fs_data_s
13641 echo "Checking to see if your system supports struct fs_data..." >&4
13642 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13644 case "$d_fs_data_s" in
13645 "$define") echo "Yes, it does." ;;
13646 *) echo "No, it doesn't." ;;
13649 : see if fseeko exists
13650 set fseeko d_fseeko
13652 case "$longsize" in
13653 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13656 : see if fsetpos exists
13657 set fsetpos d_fsetpos
13660 : see if fstatfs exists
13661 set fstatfs d_fstatfs
13664 : see if statvfs exists
13665 set statvfs d_statvfs
13668 : see if fstatvfs exists
13669 set fstatvfs d_fstatvfs
13673 : see if fsync exists
13677 : see if ftello exists
13678 set ftello d_ftello
13680 case "$longsize" in
13681 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13684 : check for a working futimes
13687 echo "Checking if you have a working futimes()" >&4
13690 #include <sys/time.h>
13697 fd = open ("try.c", O_RDWR);
13698 if (-1 == fd) exit (1);
13699 rv = futimes (fd, NULL);
13700 exit (rv == -1 ? errno : 0);
13704 if eval $compile; then
13708 0) echo "Yes, you have" >&4
13709 d_futimes="$define"
13711 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13715 echo "No, it does not (probably harmless)" >&4
13719 : see if ndbm.h is available
13722 : Compatibility location for RedHat 7.1
13723 set gdbm/ndbm.h i_gdbmndbm
13725 : Compatibility location for Debian 4.0
13726 set gdbm-ndbm.h i_gdbm_ndbm
13730 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13731 : see if dbm_open exists
13732 set dbm_open d_dbm_open
13734 case "$d_dbm_open" in
13737 i_gdbmndbm="$undef"
13738 i_gdbm_ndbm="$undef"
13739 echo "We won't be including <ndbm.h>"
13749 ndbm_hdr_protochk='name=$1; hdr=$2;
13750 eval "ihdr=\$""i_$name";
13752 if $test "$ihdr" = "$define"; then
13753 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13754 case "$d_cplusplus" in
13755 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13756 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13759 $define) $echo "Your <$hdr> seems to have prototypes";;
13760 *) $echo "Your <$hdr> does not seem to have prototypes";;
13763 set "d_${name}_h_uses_prototypes";
13767 eval $ndbm_hdr_protochk
13768 set gdbmndbm gdbm/ndbm.h
13769 eval $ndbm_hdr_protochk
13770 set gdbm_ndbm gdbm-ndbm.h
13771 eval $ndbm_hdr_protochk
13773 : see if getaddrinfo exists
13774 set getaddrinfo d_getaddrinfo
13777 : see if getcwd exists
13778 set getcwd d_getcwd
13781 : see if getespwnam exists
13782 set getespwnam d_getespwnam
13785 : see if getfsstat exists
13786 set getfsstat d_getfsstat
13789 : see if getgrent exists
13790 set getgrent d_getgrent
13793 : see if getgrent_r exists
13794 set getgrent_r d_getgrent_r
13796 case "$d_getgrent_r" in
13798 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13799 case "$d_getgrent_r_proto:$usethreads" in
13800 ":define") d_getgrent_r_proto=define
13801 set d_getgrent_r_proto getgrent_r $hdrs
13805 case "$d_getgrent_r_proto" in
13807 case "$getgrent_r_proto" in
13808 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13809 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13811 case "$getgrent_r_proto" in
13812 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13813 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13815 case "$getgrent_r_proto" in
13816 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13817 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13819 case "$getgrent_r_proto" in
13820 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13821 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13823 case "$getgrent_r_proto" in
13824 ''|0) try='int getgrent_r(struct group*, char*, int);'
13825 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13827 case "$getgrent_r_proto" in
13828 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13829 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13831 case "$getgrent_r_proto" in
13832 ''|0) d_getgrent_r=undef
13834 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13835 * ) case "$getgrent_r_proto" in
13836 REENTRANT_PROTO*) ;;
13837 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13839 echo "Prototype: $try" ;;
13842 *) case "$usethreads" in
13843 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13850 *) getgrent_r_proto=0
13854 : see if getgrgid_r exists
13855 set getgrgid_r d_getgrgid_r
13857 case "$d_getgrgid_r" in
13859 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13860 case "$d_getgrgid_r_proto:$usethreads" in
13861 ":define") d_getgrgid_r_proto=define
13862 set d_getgrgid_r_proto getgrgid_r $hdrs
13866 case "$d_getgrgid_r_proto" in
13868 case "$getgrgid_r_proto" in
13869 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13870 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13872 case "$getgrgid_r_proto" in
13873 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13874 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13876 case "$getgrgid_r_proto" in
13877 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13878 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13880 case "$getgrgid_r_proto" in
13881 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13882 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13884 case "$getgrgid_r_proto" in
13885 ''|0) d_getgrgid_r=undef
13887 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13888 * ) case "$getgrgid_r_proto" in
13889 REENTRANT_PROTO*) ;;
13890 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13892 echo "Prototype: $try" ;;
13895 *) case "$usethreads" in
13896 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13903 *) getgrgid_r_proto=0
13907 : see if getgrnam_r exists
13908 set getgrnam_r d_getgrnam_r
13910 case "$d_getgrnam_r" in
13912 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13913 case "$d_getgrnam_r_proto:$usethreads" in
13914 ":define") d_getgrnam_r_proto=define
13915 set d_getgrnam_r_proto getgrnam_r $hdrs
13919 case "$d_getgrnam_r_proto" in
13921 case "$getgrnam_r_proto" in
13922 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13923 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13925 case "$getgrnam_r_proto" in
13926 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13927 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13929 case "$getgrnam_r_proto" in
13930 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13931 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13933 case "$getgrnam_r_proto" in
13934 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13935 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13937 case "$getgrnam_r_proto" in
13938 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13939 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13941 case "$getgrnam_r_proto" in
13942 ''|0) d_getgrnam_r=undef
13944 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13945 * ) case "$getgrnam_r_proto" in
13946 REENTRANT_PROTO*) ;;
13947 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13949 echo "Prototype: $try" ;;
13952 *) case "$usethreads" in
13953 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13960 *) getgrnam_r_proto=0
13964 : see if gethostbyaddr exists
13965 set gethostbyaddr d_gethbyaddr
13968 : see if gethostbyname exists
13969 set gethostbyname d_gethbyname
13972 : see if gethostent exists
13973 set gethostent d_gethent
13976 : see how we will look up host name
13979 if set gethostname val -f d_gethname; eval $csym; $val; then
13980 echo 'gethostname() found.' >&4
13981 d_gethname="$define"
13984 if set uname val -f d_uname; eval $csym; $val; then
13987 uname() was found, but you're running xenix, and older versions of xenix
13988 have a broken uname(). If you don't really know whether your xenix is old
13989 enough to have a broken system call, use the default answer.
13994 "$define") dflt=n;;
13996 rp='Is your uname() broken?'
13999 n*) d_uname="$define"; call=uname;;
14002 echo 'uname() found.' >&4
14009 case "$d_gethname" in
14010 '') d_gethname="$undef";;
14013 '') d_uname="$undef";;
14015 case "$d_uname$d_gethname" in
14020 Every now and then someone has a $call() that lies about the hostname
14021 but can't be fixed for political or economic reasons. If you wish, I can
14022 pretend $call() isn't there and maybe compute hostname at run-time
14023 thanks to the '$phostname' command.
14026 rp="Shall I ignore $call() from now on?"
14029 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14032 case "$phostname" in
14033 '') aphostname='';;
14034 *) case "$aphostname" in
14036 *) set X $phostname
14040 file=`./loc $file $file $pth`
14041 aphostname=`echo $file $*`
14046 case "$d_uname$d_gethname" in
14049 case "$phostname" in
14051 echo "There will be no way for $package to get your hostname." >&4;;
14053 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14057 case "$d_phostname" in
14058 '') d_phostname="$undef";;
14061 : see if gethostbyaddr_r exists
14062 set gethostbyaddr_r d_gethostbyaddr_r
14064 case "$d_gethostbyaddr_r" in
14066 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14067 case "$d_gethostbyaddr_r_proto:$usethreads" in
14068 ":define") d_gethostbyaddr_r_proto=define
14069 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14073 case "$d_gethostbyaddr_r_proto" in
14075 case "$gethostbyaddr_r_proto" in
14076 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14077 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14079 case "$gethostbyaddr_r_proto" in
14080 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14081 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14083 case "$gethostbyaddr_r_proto" in
14084 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14085 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14087 case "$gethostbyaddr_r_proto" in
14088 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14089 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14091 case "$gethostbyaddr_r_proto" in
14092 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14093 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14095 case "$gethostbyaddr_r_proto" in
14096 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14097 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14099 case "$gethostbyaddr_r_proto" in
14100 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14101 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14103 case "$gethostbyaddr_r_proto" in
14104 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14105 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14107 case "$gethostbyaddr_r_proto" in
14108 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14109 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14111 case "$gethostbyaddr_r_proto" in
14112 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14113 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14115 case "$gethostbyaddr_r_proto" in
14116 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14117 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14119 case "$gethostbyaddr_r_proto" in
14120 ''|0) d_gethostbyaddr_r=undef
14121 gethostbyaddr_r_proto=0
14122 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14123 * ) case "$gethostbyaddr_r_proto" in
14124 REENTRANT_PROTO*) ;;
14125 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14127 echo "Prototype: $try" ;;
14130 *) case "$usethreads" in
14131 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14133 d_gethostbyaddr_r=undef
14134 gethostbyaddr_r_proto=0
14138 *) gethostbyaddr_r_proto=0
14142 : see if gethostbyname_r exists
14143 set gethostbyname_r d_gethostbyname_r
14145 case "$d_gethostbyname_r" in
14147 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14148 case "$d_gethostbyname_r_proto:$usethreads" in
14149 ":define") d_gethostbyname_r_proto=define
14150 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14154 case "$d_gethostbyname_r_proto" in
14156 case "$gethostbyname_r_proto" in
14157 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14158 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14160 case "$gethostbyname_r_proto" in
14161 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14162 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14164 case "$gethostbyname_r_proto" in
14165 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14166 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14168 case "$gethostbyname_r_proto" in
14169 ''|0) d_gethostbyname_r=undef
14170 gethostbyname_r_proto=0
14171 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14172 * ) case "$gethostbyname_r_proto" in
14173 REENTRANT_PROTO*) ;;
14174 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14176 echo "Prototype: $try" ;;
14179 *) case "$usethreads" in
14180 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14182 d_gethostbyname_r=undef
14183 gethostbyname_r_proto=0
14187 *) gethostbyname_r_proto=0
14191 : see if gethostent_r exists
14192 set gethostent_r d_gethostent_r
14194 case "$d_gethostent_r" in
14196 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14197 case "$d_gethostent_r_proto:$usethreads" in
14198 ":define") d_gethostent_r_proto=define
14199 set d_gethostent_r_proto gethostent_r $hdrs
14203 case "$d_gethostent_r_proto" in
14205 case "$gethostent_r_proto" in
14206 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14207 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14209 case "$gethostent_r_proto" in
14210 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14211 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14213 case "$gethostent_r_proto" in
14214 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14215 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14217 case "$gethostent_r_proto" in
14218 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14219 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14221 case "$gethostent_r_proto" in
14222 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14223 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14225 case "$gethostent_r_proto" in
14226 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14227 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14229 case "$gethostent_r_proto" in
14230 ''|0) d_gethostent_r=undef
14231 gethostent_r_proto=0
14232 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14233 * ) case "$gethostent_r_proto" in
14234 REENTRANT_PROTO*) ;;
14235 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14237 echo "Prototype: $try" ;;
14240 *) case "$usethreads" in
14241 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14243 d_gethostent_r=undef
14244 gethostent_r_proto=0
14248 *) gethostent_r_proto=0
14252 : see if prototypes for various gethostxxx netdb.h functions are available
14254 set d_gethostprotos gethostent $i_netdb netdb.h
14257 : see if getitimer exists
14258 set getitimer d_getitimer
14261 : see if getlogin exists
14262 set getlogin d_getlogin
14265 : see if getlogin_r exists
14266 set getlogin_r d_getlogin_r
14268 case "$d_getlogin_r" in
14270 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14271 case "$d_getlogin_r_proto:$usethreads" in
14272 ":define") d_getlogin_r_proto=define
14273 set d_getlogin_r_proto getlogin_r $hdrs
14277 case "$d_getlogin_r_proto" in
14279 case "$getlogin_r_proto" in
14280 ''|0) try='int getlogin_r(char*, size_t);'
14281 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14283 case "$getlogin_r_proto" in
14284 ''|0) try='int getlogin_r(char*, int);'
14285 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14287 case "$getlogin_r_proto" in
14288 ''|0) try='char* getlogin_r(char*, size_t);'
14289 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14291 case "$getlogin_r_proto" in
14292 ''|0) try='char* getlogin_r(char*, int);'
14293 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14295 case "$getlogin_r_proto" in
14296 ''|0) d_getlogin_r=undef
14298 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14299 * ) case "$getlogin_r_proto" in
14300 REENTRANT_PROTO*) ;;
14301 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14303 echo "Prototype: $try" ;;
14306 *) case "$usethreads" in
14307 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14314 *) getlogin_r_proto=0
14318 : see if getmnt exists
14319 set getmnt d_getmnt
14322 : see if getmntent exists
14323 set getmntent d_getmntent
14326 : see if getnameinfo exists
14327 set getnameinfo d_getnameinfo
14330 : see if getnetbyaddr exists
14331 set getnetbyaddr d_getnbyaddr
14334 : see if getnetbyname exists
14335 set getnetbyname d_getnbyname
14338 : see if getnetent exists
14339 set getnetent d_getnent
14342 : see if getnetbyaddr_r exists
14343 set getnetbyaddr_r d_getnetbyaddr_r
14345 case "$d_getnetbyaddr_r" in
14347 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14348 case "$d_getnetbyaddr_r_proto:$usethreads" in
14349 ":define") d_getnetbyaddr_r_proto=define
14350 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14354 case "$d_getnetbyaddr_r_proto" in
14356 case "$getnetbyaddr_r_proto" in
14357 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14358 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14360 case "$getnetbyaddr_r_proto" in
14361 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14364 case "$getnetbyaddr_r_proto" in
14365 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14366 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14368 case "$getnetbyaddr_r_proto" in
14369 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14370 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14372 case "$getnetbyaddr_r_proto" in
14373 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14374 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14376 case "$getnetbyaddr_r_proto" in
14377 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14378 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14380 case "$getnetbyaddr_r_proto" in
14381 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14382 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14384 case "$getnetbyaddr_r_proto" in
14385 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14386 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14388 case "$getnetbyaddr_r_proto" in
14389 ''|0) d_getnetbyaddr_r=undef
14390 getnetbyaddr_r_proto=0
14391 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14392 * ) case "$getnetbyaddr_r_proto" in
14393 REENTRANT_PROTO*) ;;
14394 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14396 echo "Prototype: $try" ;;
14399 *) case "$usethreads" in
14400 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14402 d_getnetbyaddr_r=undef
14403 getnetbyaddr_r_proto=0
14407 *) getnetbyaddr_r_proto=0
14411 : see if getnetbyname_r exists
14412 set getnetbyname_r d_getnetbyname_r
14414 case "$d_getnetbyname_r" in
14416 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14417 case "$d_getnetbyname_r_proto:$usethreads" in
14418 ":define") d_getnetbyname_r_proto=define
14419 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14423 case "$d_getnetbyname_r_proto" in
14425 case "$getnetbyname_r_proto" in
14426 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14427 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14429 case "$getnetbyname_r_proto" in
14430 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14431 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14433 case "$getnetbyname_r_proto" in
14434 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14435 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14437 case "$getnetbyname_r_proto" in
14438 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14439 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14441 case "$getnetbyname_r_proto" in
14442 ''|0) d_getnetbyname_r=undef
14443 getnetbyname_r_proto=0
14444 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14445 * ) case "$getnetbyname_r_proto" in
14446 REENTRANT_PROTO*) ;;
14447 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14449 echo "Prototype: $try" ;;
14452 *) case "$usethreads" in
14453 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14455 d_getnetbyname_r=undef
14456 getnetbyname_r_proto=0
14460 *) getnetbyname_r_proto=0
14464 : see if getnetent_r exists
14465 set getnetent_r d_getnetent_r
14467 case "$d_getnetent_r" in
14469 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14470 case "$d_getnetent_r_proto:$usethreads" in
14471 ":define") d_getnetent_r_proto=define
14472 set d_getnetent_r_proto getnetent_r $hdrs
14476 case "$d_getnetent_r_proto" in
14478 case "$getnetent_r_proto" in
14479 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14480 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14482 case "$getnetent_r_proto" in
14483 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14484 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14486 case "$getnetent_r_proto" in
14487 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14488 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14490 case "$getnetent_r_proto" in
14491 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14492 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14494 case "$getnetent_r_proto" in
14495 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14496 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14498 case "$getnetent_r_proto" in
14499 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14500 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14502 case "$getnetent_r_proto" in
14503 ''|0) d_getnetent_r=undef
14504 getnetent_r_proto=0
14505 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14506 * ) case "$getnetent_r_proto" in
14507 REENTRANT_PROTO*) ;;
14508 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14510 echo "Prototype: $try" ;;
14513 *) case "$usethreads" in
14514 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14516 d_getnetent_r=undef
14517 getnetent_r_proto=0
14521 *) getnetent_r_proto=0
14525 : see if prototypes for various getnetxxx netdb.h functions are available
14527 set d_getnetprotos getnetent $i_netdb netdb.h
14530 : see if getpagesize exists
14531 set getpagesize d_getpagsz
14534 : Optional checks for getprotobyname and getprotobynumber
14536 : see if getprotobyname exists
14537 set getprotobyname d_getpbyname
14540 : see if getprotobynumber exists
14541 set getprotobynumber d_getpbynumber
14544 : see if getprotoent exists
14545 set getprotoent d_getpent
14548 : see if getpgid exists
14549 set getpgid d_getpgid
14552 : see if getpgrp2 exists
14553 set getpgrp2 d_getpgrp2
14556 : see if getppid exists
14557 set getppid d_getppid
14560 : see if getpriority exists
14561 set getpriority d_getprior
14564 : see if getprotobyname_r exists
14565 set getprotobyname_r d_getprotobyname_r
14567 case "$d_getprotobyname_r" in
14569 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14570 case "$d_getprotobyname_r_proto:$usethreads" in
14571 ":define") d_getprotobyname_r_proto=define
14572 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14576 case "$d_getprotobyname_r_proto" in
14578 case "$getprotobyname_r_proto" in
14579 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14580 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14582 case "$getprotobyname_r_proto" in
14583 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14584 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14586 case "$getprotobyname_r_proto" in
14587 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14588 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14590 case "$getprotobyname_r_proto" in
14591 ''|0) d_getprotobyname_r=undef
14592 getprotobyname_r_proto=0
14593 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14594 * ) case "$getprotobyname_r_proto" in
14595 REENTRANT_PROTO*) ;;
14596 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14598 echo "Prototype: $try" ;;
14601 *) case "$usethreads" in
14602 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14604 d_getprotobyname_r=undef
14605 getprotobyname_r_proto=0
14609 *) getprotobyname_r_proto=0
14613 : see if getprotobynumber_r exists
14614 set getprotobynumber_r d_getprotobynumber_r
14616 case "$d_getprotobynumber_r" in
14618 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14619 case "$d_getprotobynumber_r_proto:$usethreads" in
14620 ":define") d_getprotobynumber_r_proto=define
14621 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14625 case "$d_getprotobynumber_r_proto" in
14627 case "$getprotobynumber_r_proto" in
14628 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14629 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14631 case "$getprotobynumber_r_proto" in
14632 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14633 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14635 case "$getprotobynumber_r_proto" in
14636 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14637 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14639 case "$getprotobynumber_r_proto" in
14640 ''|0) d_getprotobynumber_r=undef
14641 getprotobynumber_r_proto=0
14642 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14643 * ) case "$getprotobynumber_r_proto" in
14644 REENTRANT_PROTO*) ;;
14645 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14647 echo "Prototype: $try" ;;
14650 *) case "$usethreads" in
14651 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14653 d_getprotobynumber_r=undef
14654 getprotobynumber_r_proto=0
14658 *) getprotobynumber_r_proto=0
14662 : see if getprotoent_r exists
14663 set getprotoent_r d_getprotoent_r
14665 case "$d_getprotoent_r" in
14667 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14668 case "$d_getprotoent_r_proto:$usethreads" in
14669 ":define") d_getprotoent_r_proto=define
14670 set d_getprotoent_r_proto getprotoent_r $hdrs
14674 case "$d_getprotoent_r_proto" in
14676 case "$getprotoent_r_proto" in
14677 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14678 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14680 case "$getprotoent_r_proto" in
14681 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14682 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14684 case "$getprotoent_r_proto" in
14685 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14686 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14688 case "$getprotoent_r_proto" in
14689 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14690 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14692 case "$getprotoent_r_proto" in
14693 ''|0) d_getprotoent_r=undef
14694 getprotoent_r_proto=0
14695 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14696 * ) case "$getprotoent_r_proto" in
14697 REENTRANT_PROTO*) ;;
14698 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14700 echo "Prototype: $try" ;;
14703 *) case "$usethreads" in
14704 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14706 d_getprotoent_r=undef
14707 getprotoent_r_proto=0
14711 *) getprotoent_r_proto=0
14715 : see if prototypes for various getprotoxxx netdb.h functions are available
14717 set d_getprotoprotos getprotoent $i_netdb netdb.h
14720 : see if getprpwnam exists
14721 set getprpwnam d_getprpwnam
14724 : see if getpwent exists
14725 set getpwent d_getpwent
14728 : see if getpwent_r exists
14729 set getpwent_r d_getpwent_r
14731 case "$d_getpwent_r" in
14733 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14734 case "$d_getpwent_r_proto:$usethreads" in
14735 ":define") d_getpwent_r_proto=define
14736 set d_getpwent_r_proto getpwent_r $hdrs
14740 case "$d_getpwent_r_proto" in
14742 case "$getpwent_r_proto" in
14743 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14744 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14746 case "$getpwent_r_proto" in
14747 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14748 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14750 case "$getpwent_r_proto" in
14751 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14752 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14754 case "$getpwent_r_proto" in
14755 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14756 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14758 case "$getpwent_r_proto" in
14759 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14760 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14762 case "$getpwent_r_proto" in
14763 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14764 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14766 case "$getpwent_r_proto" in
14767 ''|0) d_getpwent_r=undef
14769 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14770 * ) case "$getpwent_r_proto" in
14771 REENTRANT_PROTO*) ;;
14772 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14774 echo "Prototype: $try" ;;
14777 *) case "$usethreads" in
14778 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14785 *) getpwent_r_proto=0
14789 : see if getpwnam_r exists
14790 set getpwnam_r d_getpwnam_r
14792 case "$d_getpwnam_r" in
14794 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14795 case "$d_getpwnam_r_proto:$usethreads" in
14796 ":define") d_getpwnam_r_proto=define
14797 set d_getpwnam_r_proto getpwnam_r $hdrs
14801 case "$d_getpwnam_r_proto" in
14803 case "$getpwnam_r_proto" in
14804 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14805 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14807 case "$getpwnam_r_proto" in
14808 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14809 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14811 case "$getpwnam_r_proto" in
14812 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14813 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14815 case "$getpwnam_r_proto" in
14816 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14817 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14819 case "$getpwnam_r_proto" in
14820 ''|0) d_getpwnam_r=undef
14822 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14823 * ) case "$getpwnam_r_proto" in
14824 REENTRANT_PROTO*) ;;
14825 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14827 echo "Prototype: $try" ;;
14830 *) case "$usethreads" in
14831 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14838 *) getpwnam_r_proto=0
14842 : see if getpwuid_r exists
14843 set getpwuid_r d_getpwuid_r
14845 case "$d_getpwuid_r" in
14847 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14848 case "$d_getpwuid_r_proto:$usethreads" in
14849 ":define") d_getpwuid_r_proto=define
14850 set d_getpwuid_r_proto getpwuid_r $hdrs
14854 case "$d_getpwuid_r_proto" in
14856 case "$getpwuid_r_proto" in
14857 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14858 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14860 case "$getpwuid_r_proto" in
14861 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14862 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14864 case "$getpwuid_r_proto" in
14865 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14866 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14868 case "$getpwuid_r_proto" in
14869 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14870 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14872 case "$getpwuid_r_proto" in
14873 ''|0) d_getpwuid_r=undef
14875 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14876 * ) case "$getpwuid_r_proto" in
14877 REENTRANT_PROTO*) ;;
14878 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14880 echo "Prototype: $try" ;;
14883 *) case "$usethreads" in
14884 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14891 *) getpwuid_r_proto=0
14895 : Optional checks for getsbyname and getsbyport
14897 : see if getservbyname exists
14898 set getservbyname d_getsbyname
14901 : see if getservbyport exists
14902 set getservbyport d_getsbyport
14905 : see if getservent exists
14906 set getservent d_getsent
14909 : see if getservbyname_r exists
14910 set getservbyname_r d_getservbyname_r
14912 case "$d_getservbyname_r" in
14914 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14915 case "$d_getservbyname_r_proto:$usethreads" in
14916 ":define") d_getservbyname_r_proto=define
14917 set d_getservbyname_r_proto getservbyname_r $hdrs
14921 case "$d_getservbyname_r_proto" in
14923 case "$getservbyname_r_proto" in
14924 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14925 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14927 case "$getservbyname_r_proto" in
14928 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14929 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14931 case "$getservbyname_r_proto" in
14932 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14933 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14935 case "$getservbyname_r_proto" in
14936 ''|0) d_getservbyname_r=undef
14937 getservbyname_r_proto=0
14938 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14939 * ) case "$getservbyname_r_proto" in
14940 REENTRANT_PROTO*) ;;
14941 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14943 echo "Prototype: $try" ;;
14946 *) case "$usethreads" in
14947 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14949 d_getservbyname_r=undef
14950 getservbyname_r_proto=0
14954 *) getservbyname_r_proto=0
14958 : see if getservbyport_r exists
14959 set getservbyport_r d_getservbyport_r
14961 case "$d_getservbyport_r" in
14963 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14964 case "$d_getservbyport_r_proto:$usethreads" in
14965 ":define") d_getservbyport_r_proto=define
14966 set d_getservbyport_r_proto getservbyport_r $hdrs
14970 case "$d_getservbyport_r_proto" in
14972 case "$getservbyport_r_proto" in
14973 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14974 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14976 case "$getservbyport_r_proto" in
14977 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14978 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14980 case "$getservbyport_r_proto" in
14981 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14982 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14984 case "$getservbyport_r_proto" in
14985 ''|0) d_getservbyport_r=undef
14986 getservbyport_r_proto=0
14987 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14988 * ) case "$getservbyport_r_proto" in
14989 REENTRANT_PROTO*) ;;
14990 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14992 echo "Prototype: $try" ;;
14995 *) case "$usethreads" in
14996 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14998 d_getservbyport_r=undef
14999 getservbyport_r_proto=0
15003 *) getservbyport_r_proto=0
15007 : see if getservent_r exists
15008 set getservent_r d_getservent_r
15010 case "$d_getservent_r" in
15012 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15013 case "$d_getservent_r_proto:$usethreads" in
15014 ":define") d_getservent_r_proto=define
15015 set d_getservent_r_proto getservent_r $hdrs
15019 case "$d_getservent_r_proto" in
15021 case "$getservent_r_proto" in
15022 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15023 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15025 case "$getservent_r_proto" in
15026 ''|0) try='int getservent_r(struct servent*, char*, int);'
15027 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15029 case "$getservent_r_proto" in
15030 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15031 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15033 case "$getservent_r_proto" in
15034 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15035 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15037 case "$getservent_r_proto" in
15038 ''|0) d_getservent_r=undef
15039 getservent_r_proto=0
15040 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15041 * ) case "$getservent_r_proto" in
15042 REENTRANT_PROTO*) ;;
15043 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15045 echo "Prototype: $try" ;;
15048 *) case "$usethreads" in
15049 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15051 d_getservent_r=undef
15052 getservent_r_proto=0
15056 *) getservent_r_proto=0
15060 : see if prototypes for various getservxxx netdb.h functions are available
15062 set d_getservprotos getservent $i_netdb netdb.h
15065 : see if getspnam exists
15066 set getspnam d_getspnam
15069 : see if this is a shadow.h system
15070 set shadow.h i_shadow
15073 : see if getspnam_r exists
15074 set getspnam_r d_getspnam_r
15076 case "$d_getspnam_r" in
15078 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15079 case "$d_getspnam_r_proto:$usethreads" in
15080 ":define") d_getspnam_r_proto=define
15081 set d_getspnam_r_proto getspnam_r $hdrs
15085 case "$d_getspnam_r_proto" in
15087 case "$getspnam_r_proto" in
15088 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15089 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15091 case "$getspnam_r_proto" in
15092 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15093 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15095 case "$getspnam_r_proto" in
15096 ''|0) d_getspnam_r=undef
15098 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15099 * ) case "$getspnam_r_proto" in
15100 REENTRANT_PROTO*) ;;
15101 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15103 echo "Prototype: $try" ;;
15106 *) case "$usethreads" in
15107 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15114 *) getspnam_r_proto=0
15118 : see if gettimeofday or ftime exists
15119 set gettimeofday d_gettimeod
15121 case "$d_gettimeod" in
15127 val="$undef"; set d_ftime; eval $setvar
15130 case "$d_gettimeod$d_ftime" in
15133 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15137 : see if gmtime_r exists
15138 set gmtime_r d_gmtime_r
15140 case "$d_gmtime_r" in
15142 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15143 case "$d_gmtime_r_proto:$usethreads" in
15144 ":define") d_gmtime_r_proto=define
15145 set d_gmtime_r_proto gmtime_r $hdrs
15149 case "$d_gmtime_r_proto" in
15151 case "$gmtime_r_proto" in
15152 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15153 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15155 case "$gmtime_r_proto" in
15156 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15157 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15159 case "$gmtime_r_proto" in
15160 ''|0) d_gmtime_r=undef
15162 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15163 * ) case "$gmtime_r_proto" in
15164 REENTRANT_PROTO*) ;;
15165 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15167 echo "Prototype: $try" ;;
15170 *) case "$usethreads" in
15171 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15178 *) gmtime_r_proto=0
15182 : see if hasmntopt exists
15183 set hasmntopt d_hasmntopt
15186 : see if this is a netinet/in.h or sys/in.h system
15187 set netinet/in.h i_niin sys/in.h i_sysin
15190 : see if arpa/inet.h has to be included
15191 set arpa/inet.h i_arpainet
15194 : see if htonl --and friends-- exists
15199 : Maybe they are macros.
15202 $cat >htonl.c <<EOM
15204 #include <sys/types.h>
15205 #$i_niin I_NETINET_IN
15207 #$i_arpainet I_ARPA_INET
15208 #ifdef I_NETINET_IN
15209 #include <netinet/in.h>
15212 #include <sys/in.h>
15215 #include <arpa/inet.h>
15218 printf("Defined as a macro.");
15221 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15222 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15224 echo "But it seems to be defined as a macro." >&4
15232 : see if ilogbl exists
15233 set ilogbl d_ilogbl
15238 if set index val -f; eval $csym; $val; then
15239 if set strchr val -f d_strchr; eval $csym; $val; then
15240 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15243 echo "strchr() found." >&4
15247 echo "index() found." >&4
15252 echo "index() found." >&4
15255 if set strchr val -f d_strchr; eval $csym; $val; then
15258 echo "strchr() found." >&4
15260 echo "No index() or strchr() found!" >&4
15265 set d_strchr; eval $setvar
15267 set d_index; eval $setvar
15269 : check whether inet_aton exists
15270 set inet_aton d_inetaton
15273 : see if inet_ntop exists
15274 set inet_ntop d_inetntop
15277 : see if inet_pton exists
15278 set inet_pton d_inetpton
15283 $cat >isascii.c <<EOCP
15286 #$i_stdlib I_STDLIB
15288 #include <stdlib.h>
15299 if eval $compile; then
15300 echo "isascii() found." >&4
15303 echo "isascii() NOT found." >&4
15312 $cat >isblank.c <<'EOCP'
15323 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15324 echo "isblank() found." >&4
15327 echo "isblank() NOT found." >&4
15334 : see if isfinite exists
15335 set isfinite d_isfinite
15338 : see if isinf exists
15342 : see if isnan exists
15346 : see if isnanl exists
15347 set isnanl d_isnanl
15350 : see if killpg exists
15351 set killpg d_killpg
15354 : see if lchown exists
15356 $cat > try.c <<'EOCP'
15357 /* System header to define __stub macros and hopefully few prototypes,
15358 which can conflict with char lchown(); below. */
15359 #include <assert.h>
15360 /* Override any gcc2 internal prototype to avoid an error. */
15361 /* We use char because int might match the return type of a gcc2
15362 builtin and then its argument prototype would still apply. */
15365 /* The GNU C library defines this for functions which it implements
15366 to always fail with ENOSYS. Some functions are actually named
15367 something starting with __ and the normal name is an alias. */
15368 #if defined (__stub_lchown) || defined (__stub___lchown)
15376 if eval $compile; then
15377 $echo "lchown() found." >&4
15380 $echo "lchown() NOT found." >&4
15386 : See if number of significant digits in a double precision number is known
15388 $cat >ldbl_dig.c <<EOM
15389 #$i_limits I_LIMITS
15392 #include <limits.h>
15398 printf("Contains LDBL_DIG");
15401 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15402 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15403 echo "LDBL_DIG found." >&4
15406 echo "LDBL_DIG NOT found." >&4
15413 : see if this is a math.h system
15417 : check to see if math.h defines _LIB_VERSION
15418 d_libm_lib_version="$undef"
15422 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15424 #include <unistd.h>
15426 int main (int argc, char *argv[])
15428 printf ("%d\n", _LIB_VERSION);
15433 if eval $compile; then
15435 echo "Yes, it does ($foo)" >&4
15436 d_libm_lib_version="$define"
15438 echo "No, it does not (probably harmless)" >&4
15445 : see if link exists
15449 : see if localtime_r exists
15450 set localtime_r d_localtime_r
15452 case "$d_localtime_r" in
15454 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15455 case "$d_localtime_r_proto:$usethreads" in
15456 ":define") d_localtime_r_proto=define
15457 set d_localtime_r_proto localtime_r $hdrs
15461 case "$d_localtime_r_proto" in
15463 case "$localtime_r_proto" in
15464 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15465 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15467 case "$localtime_r_proto" in
15468 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15469 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15471 case "$localtime_r_proto" in
15472 ''|0) d_localtime_r=undef
15473 localtime_r_proto=0
15474 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15475 * ) case "$localtime_r_proto" in
15476 REENTRANT_PROTO*) ;;
15477 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15479 echo "Prototype: $try" ;;
15482 *) case "$usethreads" in
15483 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15485 d_localtime_r=undef
15486 localtime_r_proto=0
15490 *) localtime_r_proto=0
15494 : see if localtime_r calls tzset
15495 case "$localtime_r_proto" in
15498 /* Does our libc's localtime_r call tzset ?
15499 * return 0 if so, 1 otherwise.
15501 #$i_systypes I_SYS_TYPES
15502 #$i_unistd I_UNISTD
15504 #$i_stdlib I_STDLIB
15505 #$i_string I_STRING
15506 #$i_malloc I_MALLOC
15508 # include <sys/types.h>
15511 # include <unistd.h>
15517 #include <stdlib.h>
15520 # include <string.h>
15522 # include <strings.h>
15525 # include <malloc.h>
15529 time_t t = time(0L);
15530 char w_tz[]="TZ" "=GMT+5",
15531 e_tz[]="TZ" "=GMT-5",
15532 *tz_e = (char*)malloc(16),
15533 *tz_w = (char*)malloc(16);
15534 struct tm tm_e, tm_w;
15535 memset(&tm_e,'\0',sizeof(struct tm));
15536 memset(&tm_w,'\0',sizeof(struct tm));
15541 localtime_r(&t, &tm_e);
15544 localtime_r(&t, &tm_w);
15546 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15552 if eval $compile; then
15553 if $run ./try; then
15554 d_localtime_r_needs_tzset=undef;
15556 d_localtime_r_needs_tzset=define;
15559 d_localtime_r_needs_tzset=undef;
15563 d_localtime_r_needs_tzset=undef;
15568 : see if localeconv exists
15569 set localeconv d_locconv
15572 : see if lockf exists
15576 : see if prototype for lseek is available
15578 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15581 : see if lstat exists
15585 : see if madvise exists
15586 set madvise d_madvise
15589 : see if malloc_size exists
15590 set malloc_size d_malloc_size
15593 : see if malloc_size_good exists
15594 set malloc_good_size d_malloc_good_size
15597 : see if mblen exists
15601 : see if mbstowcs exists
15602 set mbstowcs d_mbstowcs
15605 : see if mbtowc exists
15606 set mbtowc d_mbtowc
15609 : see if memchr exists
15610 set memchr d_memchr
15613 : see if memcmp exists
15614 set memcmp d_memcmp
15617 : see if memcpy exists
15618 set memcpy d_memcpy
15621 : see if memmove exists
15622 set memmove d_memmove
15625 : see if memset exists
15626 set memset d_memset
15629 : see if mkdir exists
15633 : see if mkdtemp exists
15634 set mkdtemp d_mkdtemp
15637 : see if mkfifo exists
15638 set mkfifo d_mkfifo
15641 : see if mkstemp exists
15642 set mkstemp d_mkstemp
15645 : see if mkstemps exists
15646 set mkstemps d_mkstemps
15649 : see if mktime exists
15650 set mktime d_mktime
15653 : see if this is a sys/mman.h system
15654 set sys/mman.h i_sysmman
15657 : see if mmap exists
15660 : see what shmat returns
15661 : default to something harmless
15663 case "$i_sysmman$d_mmap" in
15665 $cat >mmap.c <<'END'
15666 #include <sys/mman.h>
15669 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15674 echo "and it returns ($mmaptype)." >&4
15680 : see if sqrtl exists
15684 : see if scalbnl exists
15685 set scalbnl d_scalbnl
15688 : see if modfl exists
15692 : see if prototype for modfl is available
15694 set d_modflproto modfl $i_math math.h
15697 d_modfl_pow32_bug="$undef"
15699 case "$d_longdbl$d_modfl" in
15702 Checking to see whether your modfl() is okay for large values...
15708 if $test "X$d_modflproto" != "X$define"; then
15709 $cat >>try.c <<EOCP
15710 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15711 long double modfl (long double, long double *);
15714 $cat >>try.c <<EOCP
15716 long double nv = 4294967303.15;
15722 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15726 case "$osname:$gccversion" in
15727 aix:) saveccflags="$ccflags"
15728 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15731 if eval $compile; then
15734 *" 4294967303.150000 1.150000 4294967302.000000")
15735 echo >&4 "Your modfl() is broken for large values."
15736 d_modfl_pow32_bug="$define"
15738 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15742 *" 4294967303.150000 0.150000 4294967303.000000")
15743 echo >&4 "Your modfl() seems okay for large values."
15745 *) echo >&4 "I don't understand your modfl() at all."
15751 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15754 case "$osname:$gccversion" in
15755 aix:) ccflags="$saveccflags" ;; # restore
15760 if $test "$uselongdouble" = "$define"; then
15762 if $test "$d_sqrtl" != "$define"; then
15763 message="$message sqrtl"
15765 if $test "$d_modfl" != "$define"; then
15766 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15767 echo "You have both aintl and copysignl, so I can emulate modfl."
15769 message="$message modfl"
15772 if $test "$d_frexpl" != "$define"; then
15773 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15774 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15776 message="$message frexpl"
15780 if $test "$message" != ""; then
15783 *** You requested the use of long doubles but you do not seem to have
15784 *** the following mathematical functions needed for long double support:
15786 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15787 *** Cannot continue, aborting.
15795 : see if mprotect exists
15796 set mprotect d_mprotect
15799 : see if msgctl exists
15800 set msgctl d_msgctl
15803 : see if msgget exists
15804 set msgget d_msgget
15807 : see if msgsnd exists
15808 set msgsnd d_msgsnd
15811 : see if msgrcv exists
15812 set msgrcv d_msgrcv
15815 : see how much of the 'msg*(2)' library is present.
15818 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15819 *"$undef"*) h_msg=false;;
15823 case "`ipcs 2>&1`" in
15824 "SVID messages"*"not configured"*)
15825 echo "Your $osname does not have the msg*(2) configured." >&4
15828 set msgctl d_msgctl
15830 set msgget d_msgget
15832 set msgsnd d_msgsnd
15834 set msgrcv d_msgrcv
15840 : we could also check for sys/ipc.h ...
15841 if $h_msg && $test `./findhdr sys/msg.h`; then
15842 echo "You have the full msg*(2) library." >&4
15845 echo "You don't have the full msg*(2) library." >&4
15851 : Check for msghdr_s
15853 echo "Checking to see if your system supports struct msghdr..." >&4
15854 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15856 case "$d_msghdr_s" in
15857 "$define") echo "Yes, it does." ;;
15858 *) echo "No, it doesn't." ;;
15862 : see if msync exists
15866 : see if munmap exists
15867 set munmap d_munmap
15870 : see if nice exists
15874 : see if this is a langinfo.h system
15875 set langinfo.h i_langinfo
15878 : see if nl_langinfo exists
15879 set nl_langinfo d_nl_langinfo
15882 : check for volatile keyword
15884 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15885 $cat >try.c <<'EOCP'
15888 typedef struct _goo_struct goo_struct;
15889 goo_struct * volatile goo = ((goo_struct *)0);
15890 struct _goo_struct {
15895 typedef unsigned short foo_t;
15896 char *volatile foo;
15898 volatile foo_t blech;
15902 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15904 echo "Yup, it does."
15907 echo "Nope, it doesn't."
15913 : Check basic sizes
15915 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15917 case "$use64bitint:$d_quad:$quadtype" in
15920 uvtype="$uquadtype"
15925 uvtype="unsigned long"
15931 case "$uselongdouble:$d_longdbl" in
15933 nvtype="long double"
15934 nvsize=$longdblsize
15941 $echo "(IV will be "$ivtype", $ivsize bytes)"
15942 $echo "(UV will be "$uvtype", $uvsize bytes)"
15943 $echo "(NV will be "$nvtype", $nvsize bytes)"
15946 #$i_inttypes I_INTTYPES
15948 #include <inttypes.h>
15953 int8_t i = INT8_MAX;
15954 uint8_t u = UINT8_MAX;
15955 printf("int8_t\n");
15958 int16_t i = INT16_MAX;
15959 uint16_t u = UINT16_MAX;
15960 printf("int16_t\n");
15963 int32_t i = INT32_MAX;
15964 uint32_t u = UINT32_MAX;
15965 printf("int32_t\n");
15970 i8type="signed char"
15971 u8type="unsigned char"
15976 '') case "$shortsize" in
15978 u16type="unsigned short"
15986 '') set try -DINT16
15987 if eval $compile; then
15988 case "`$run ./try`" in
16000 '') if $test $shortsize -ge 2; then
16002 u16type="unsigned short"
16010 '') case "$longsize" in
16012 u32type="unsigned long"
16016 *) case "$intsize" in
16018 u32type="unsigned int"
16028 '') set try -DINT32
16029 if eval $compile; then
16030 case "`$run ./try`" in
16042 '') if $test $intsize -ge 4; then
16044 u32type="unsigned int"
16052 '') case "$d_quad:$quadtype" in
16054 i64type="$quadtype"
16055 u64type="$uquadtype"
16063 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16064 : volatile so that the compiler has to store it out to memory.
16065 if test X"$d_volatile" = X"$define"; then
16070 #$i_stdlib I_STDLIB
16072 #include <stdlib.h>
16074 #include <sys/types.h>
16075 #include <signal.h>
16077 $volatile int bletched = 0;
16078 $signal_t blech(int s) { bletched = 1; }
16083 int n = 8 * $uvsize;
16086 signal(SIGFPE, blech);
16089 for (i = 0; i < n; i++) {
16090 u = u << 1 | ($uvtype)1;
16092 if (($uvtype)d != u)
16096 d = ($nvtype)(u - 1);
16097 if (($uvtype)d != (u - 1))
16104 printf("%d\n", ((i == n) ? -n : i));
16110 d_nv_preserves_uv="$undef"
16111 if eval $compile; then
16112 nv_preserves_uv_bits="`$run ./try`"
16114 case "$nv_preserves_uv_bits" in
16116 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16117 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16118 d_nv_preserves_uv="$define"
16120 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16121 d_nv_preserves_uv="$undef" ;;
16122 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16123 nv_preserves_uv_bits="0" ;;
16127 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16128 : volatile so that the compiler has to store it out to memory.
16129 if test X"$d_volatile" = X"$define"; then
16135 typedef $nvtype NV;
16142 while(count < 256) {
16143 $volatile NV up = value + 1.0;
16144 $volatile NV negated = -value;
16145 $volatile NV down = negated - 1.0;
16146 $volatile NV got_up = up - value;
16147 int up_good = got_up == 1.0;
16148 int got_down = down - negated;
16149 int down_good = got_down == -1.0;
16151 if (down_good != up_good) {
16153 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16154 up_good, (double) got_up, down_good, (double) got_down,
16155 count, (double) value);
16162 fputs("256.0", stdout);
16165 fputs("2.0", stdout);
16171 fputs("*", stdout);
16177 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16178 count, (double) value);
16184 nv_overflows_integers_at='0'
16185 if eval $compile; then
16191 The largest integer your NVs can preserve is equal to $xxx
16193 nv_overflows_integers_at="$xxx"
16196 Cannot determine the largest integer value your NVs can hold, unexpected output
16203 Cannot determine the largest integer value your NVs can hold
16210 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16211 : volatile so that the compiler has to store it out to memory.
16212 if test X"$d_volatile" = X"$define"; then
16217 #$i_stdlib I_STDLIB
16219 #include <stdlib.h>
16221 #$i_string I_STRING
16223 # include <string.h>
16225 # include <strings.h>
16227 #include <sys/types.h>
16228 #include <signal.h>
16230 $volatile int bletched = 0;
16231 $signal_t blech(int s) { bletched = 1; }
16234 int checkit($nvtype d, char *where) {
16235 unsigned char *p = (char *)&d;
16236 unsigned char *end = p + sizeof(d);
16246 printf("No - %s: 0x", where);
16248 printf ("%02X", *p++);
16253 int main(int argc, char **argv) {
16256 fail += checkit(d, "0.0");
16258 /* The compiler shouldn't be assuming that bletched is 0 */
16261 fail += checkit(d, "bleched");
16264 signal(SIGFPE, blech);
16267 /* Paranoia - the compiler should have no way of knowing that ANSI says
16268 that argv[argc] will always be NULL. Actually, if it did assume this it
16269 would be buggy, as this is C and main() can be called from elsewhere in
16271 d = argv[argc] ? 1 : 0;
16274 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16277 fail += checkit(d, "ternary");
16279 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16282 printf("No - memset doesn't give 0.0\n");
16283 /* This might just blow up: */
16284 printf("(gives %g)\n", d);
16290 printf("No - something bleched\n");
16295 printf("No - %d fail(s)\n", fail);
16304 d_nv_zero_is_allbits_zero="$undef"
16305 if eval $compile; then
16311 0.0 is represented as all bits zero in memory
16313 d_nv_zero_is_allbits_zero="$define"
16316 0.0 is not represented as all bits zero in memory
16318 d_nv_zero_is_allbits_zero="$undef"
16323 0.0 is not represented as all bits zero in memory
16325 d_nv_zero_is_allbits_zero="$undef"
16331 : check for off64_t
16333 echo "Checking to see if you have off64_t..." >&4
16335 #include <sys/types.h>
16336 #include <unistd.h>
16337 int main() { off64_t x = 7; }
16340 if eval $compile; then
16342 echo "You have off64_t."
16345 echo "You do not have off64_t."
16346 case "$lseeksize" in
16347 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16354 : how to create joinable pthreads
16355 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16357 echo "Checking what constant to use for creating joinable pthreads..." >&4
16358 $cat >try.c <<'EOCP'
16359 #include <pthread.h>
16361 int detachstate = JOINABLE;
16364 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16365 if eval $compile; then
16366 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16367 val="$undef" # Yes, undef.
16368 set d_old_pthread_create_joinable
16371 set old_pthread_create_joinable
16374 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16375 if eval $compile; then
16376 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16378 set d_old_pthread_create_joinable
16380 val=PTHREAD_CREATE_UNDETACHED
16381 set old_pthread_create_joinable
16384 set try -DJOINABLE=__UNDETACHED
16385 if eval $compile; then
16386 echo "You seem to use __UNDETACHED." >&4
16388 set d_old_pthread_create_joinable
16391 set old_pthread_create_joinable
16394 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16396 set d_old_pthread_create_joinable
16399 set old_pthread_create_joinable
16406 d_old_pthread_create_joinable="$undef"
16407 old_pthread_create_joinable=""
16410 : see if pause exists
16414 : see if poll exists
16418 : see if prctl exists
16422 : see if prctl supports PR_SET_NAME
16423 d_prctl_set_name=$undef
16427 #include <sys/prctl.h>
16429 int main (int argc, char *argv[])
16431 return (prctl (PR_SET_NAME, "Test"));
16435 if eval $compile_ok && $run ./try; then
16436 echo "Your prctl (PR_SET_NAME, ...) works"
16437 d_prctl_set_name=$define
16443 : see if readlink exists
16444 set readlink d_readlink
16447 : Check if exe is symlink to abs path of executing program
16451 case "$d_readlink" in
16453 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16454 : more tidy to avoid an extra level of symlink
16455 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16456 while test $# -gt 0; do
16459 if $issymlink $try; then
16460 $ls -l $try > reflect
16461 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16462 echo "You have $type-like $try."
16463 procselfexe='"'$try'"'
16465 : This will break out of the loop
16476 : backward compatibility for d_hvfork
16477 if test X$d_hvfork != X; then
16478 d_vfork="$d_hvfork"
16481 : see if there is a vfork
16486 d_pseudofork=$undef
16488 : Ok, but do we want to use it. vfork is reportedly unreliable in
16489 : perl on Solaris 2.x, and probably elsewhere.
16493 case "$usevfork" in
16499 Perl can only use a vfork() that doesn't suffer from strict
16500 restrictions on calling functions or modifying global data in
16501 the child. For example, glibc-2.1 contains such a vfork()
16502 that is unsuitable. If your system provides a proper fork()
16503 call, chances are that you do NOT want perl to use vfork().
16506 rp="Do you still want to use vfork()?"
16511 echo "Ok, we won't use vfork()."
16520 $define) usevfork='true';;
16521 *) usevfork='false';;
16524 : see whether the pthread_atfork exists
16526 #include <pthread.h>
16529 #ifdef PTHREAD_ATFORK
16530 pthread_atfork(NULL,NULL,NULL);
16535 : see if pthread_atfork exists
16536 set try -DPTHREAD_ATFORK
16537 if eval $compile; then
16542 case "$usethreads" in
16545 $define) echo 'pthread_atfork found.' >&4 ;;
16546 *) echo 'pthread_atfork NOT found.' >&4 ;;
16549 set d_pthread_atfork
16552 : see if pthread_attr_setscope exists
16553 set pthread_attr_setscope d_pthread_attr_setscope
16556 : see whether the various POSIXish _yields exist
16558 #include <pthread.h>
16564 #ifdef PTHREAD_YIELD
16567 #ifdef PTHREAD_YIELD_NULL
16568 pthread_yield(NULL);
16574 : see if sched_yield exists
16575 set try -DSCHED_YIELD
16576 if eval $compile; then
16578 sched_yield='sched_yield()'
16582 case "$usethreads" in
16585 $define) echo 'sched_yield() found.' >&4 ;;
16586 *) echo 'sched_yield() NOT found.' >&4 ;;
16592 : see if pthread_yield exists
16593 set try -DPTHREAD_YIELD
16594 if eval $compile; then
16596 case "$sched_yield" in
16597 '') sched_yield='pthread_yield()' ;;
16600 set try -DPTHREAD_YIELD_NULL
16601 if eval $compile; then
16603 case "$sched_yield" in
16604 '') sched_yield='pthread_yield(NULL)' ;;
16610 case "$usethreads" in
16613 $define) echo 'pthread_yield() found.' >&4 ;;
16614 *) echo 'pthread_yield() NOT found.' >&4 ;;
16618 set d_pthread_yield
16620 case "$sched_yield" in
16621 '') sched_yield=undef ;;
16625 : see if random_r exists
16626 set random_r d_random_r
16628 case "$d_random_r" in
16630 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16631 case "$d_random_r_proto:$usethreads" in
16632 ":define") d_random_r_proto=define
16633 set d_random_r_proto random_r $hdrs
16637 case "$d_random_r_proto" in
16639 case "$random_r_proto" in
16640 ''|0) try='int random_r(int*, struct random_data*);'
16641 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16643 case "$random_r_proto" in
16644 ''|0) try='int random_r(long*, struct random_data*);'
16645 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16647 case "$random_r_proto" in
16648 ''|0) try='int random_r(struct random_data*, int32_t*);'
16649 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16651 case "$random_r_proto" in
16652 ''|0) d_random_r=undef
16654 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16655 * ) case "$random_r_proto" in
16656 REENTRANT_PROTO*) ;;
16657 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16659 echo "Prototype: $try" ;;
16662 *) case "$usethreads" in
16663 define) echo "random_r has no prototype, not using it." >&4 ;;
16670 *) random_r_proto=0
16674 : see if readdir and friends exist
16675 set readdir d_readdir
16677 set seekdir d_seekdir
16679 set telldir d_telldir
16681 set rewinddir d_rewinddir
16684 : see if readdir64_r exists
16685 set readdir64_r d_readdir64_r
16687 case "$d_readdir64_r" in
16689 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16690 case "$d_readdir64_r_proto:$usethreads" in
16691 ":define") d_readdir64_r_proto=define
16692 set d_readdir64_r_proto readdir64_r $hdrs
16696 case "$d_readdir64_r_proto" in
16698 case "$readdir64_r_proto" in
16699 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16700 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16702 case "$readdir64_r_proto" in
16703 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16704 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16706 case "$readdir64_r_proto" in
16707 ''|0) d_readdir64_r=undef
16708 readdir64_r_proto=0
16709 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16710 * ) case "$readdir64_r_proto" in
16711 REENTRANT_PROTO*) ;;
16712 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16714 echo "Prototype: $try" ;;
16717 *) case "$usethreads" in
16718 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16720 d_readdir64_r=undef
16721 readdir64_r_proto=0
16725 *) readdir64_r_proto=0
16729 : see if readdir_r exists
16730 set readdir_r d_readdir_r
16732 case "$d_readdir_r" in
16734 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16735 case "$d_readdir_r_proto:$usethreads" in
16736 ":define") d_readdir_r_proto=define
16737 set d_readdir_r_proto readdir_r $hdrs
16741 case "$d_readdir_r_proto" in
16743 case "$readdir_r_proto" in
16744 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16745 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16747 case "$readdir_r_proto" in
16748 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16749 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16751 case "$readdir_r_proto" in
16752 ''|0) d_readdir_r=undef
16754 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16755 * ) case "$readdir_r_proto" in
16756 REENTRANT_PROTO*) ;;
16757 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16759 echo "Prototype: $try" ;;
16762 *) case "$usethreads" in
16763 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16770 *) readdir_r_proto=0
16774 : see if readv exists
16778 : see if recvmsg exists
16779 set recvmsg d_recvmsg
16782 : see if rename exists
16783 set rename d_rename
16786 : see if rmdir exists
16790 : see if memory.h is available.
16795 : See if it conflicts with string.h
16801 $cppstdin $cppflags $cppminus < $strings > mem.h
16802 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16804 echo "We won't be including <memory.h>."
16814 : can bcopy handle overlapping blocks?
16817 case "$d_memmove" in
16818 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16819 *) case "$d_bcopy" in
16821 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16823 #$i_memory I_MEMORY
16824 #$i_stdlib I_STDLIB
16825 #$i_string I_STRING
16826 #$i_unistd I_UNISTD
16828 $cat >>try.c <<'EOCP'
16831 # include <memory.h>
16834 # include <stdlib.h>
16837 # include <string.h>
16839 # include <strings.h>
16842 # include <unistd.h> /* Needed for NetBSD */
16846 char buf[128], abc[128];
16852 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16853 try to store the string in read-only memory. */
16854 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16856 for (align = 7; align >= 0; align--) {
16857 for (len = 36; len; len--) {
16859 bcopy(abc, b, len);
16860 for (off = 1; off <= len; off++) {
16861 bcopy(b, b+off, len);
16862 bcopy(b+off, b, len);
16863 if (bcmp(b, abc, len))
16872 if eval $compile_ok; then
16873 if $run ./try 2>/dev/null; then
16874 echo "Yes, it can."
16877 echo "It can't, sorry."
16880 echo "(I can't compile the test program, so we'll assume not...)"
16890 : can memcpy handle overlapping blocks?
16893 case "$d_memmove" in
16894 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16895 *) case "$d_memcpy" in
16897 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16899 #$i_memory I_MEMORY
16900 #$i_stdlib I_STDLIB
16901 #$i_string I_STRING
16902 #$i_unistd I_UNISTD
16904 $cat >>try.c <<'EOCP'
16907 # include <memory.h>
16910 # include <stdlib.h>
16913 # include <string.h>
16915 # include <strings.h>
16918 # include <unistd.h> /* Needed for NetBSD */
16922 char buf[128], abc[128];
16928 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16929 try to store the string in read-only memory. */
16930 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16932 for (align = 7; align >= 0; align--) {
16933 for (len = 36; len; len--) {
16935 memcpy(b, abc, len);
16936 for (off = 1; off <= len; off++) {
16937 memcpy(b+off, b, len);
16938 memcpy(b, b+off, len);
16939 if (memcmp(b, abc, len))
16948 if eval $compile_ok; then
16949 if $run ./try 2>/dev/null; then
16950 echo "Yes, it can."
16953 echo "It can't, sorry."
16956 echo "(I can't compile the test program, so we'll assume not...)"
16966 : can memcmp be trusted to compare relative magnitude?
16968 case "$d_memcmp" in
16971 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16973 #$i_memory I_MEMORY
16974 #$i_stdlib I_STDLIB
16975 #$i_string I_STRING
16976 #$i_unistd I_UNISTD
16978 $cat >>try.c <<'EOCP'
16981 # include <memory.h>
16984 # include <stdlib.h>
16987 # include <string.h>
16989 # include <strings.h>
16992 # include <unistd.h> /* Needed for NetBSD */
16998 if ((a < b) && memcmp(&a, &b, 1) < 0)
17004 if eval $compile_ok; then
17005 if $run ./try 2>/dev/null; then
17006 echo "Yes, it can."
17009 echo "No, it can't (it uses signed chars)."
17012 echo "(I can't compile the test program, so we'll assume not...)"
17020 : see if prototype for sbrk is available
17022 set d_sbrkproto sbrk $i_unistd unistd.h
17025 : see if select exists
17026 set select d_select
17029 : see if semctl exists
17030 set semctl d_semctl
17033 : see if semget exists
17034 set semget d_semget
17037 : see if semop exists
17041 : see how much of the 'sem*(2)' library is present.
17044 case "$d_semctl$d_semget$d_semop" in
17045 *"$undef"*) h_sem=false;;
17049 case "`ipcs 2>&1`" in
17050 "SVID messages"*"not configured"*)
17051 echo "Your $osname does not have the sem*(2) configured." >&4
17054 set semctl d_semctl
17056 set semget d_semget
17064 : we could also check for sys/ipc.h ...
17065 if $h_sem && $test `./findhdr sys/sem.h`; then
17066 echo "You have the full sem*(2) library." >&4
17069 echo "You don't have the full sem*(2) library." >&4
17075 : see whether sys/sem.h defines union semun
17077 $cat > try.c <<'END'
17078 #include <sys/types.h>
17079 #include <sys/ipc.h>
17080 #include <sys/sem.h>
17081 int main () { union semun semun; semun.buf = 0; }
17084 if eval $compile; then
17085 echo "You have union semun in <sys/sem.h>." >&4
17088 echo "You do not have union semun in <sys/sem.h>." >&4
17095 : see how to do semctl IPC_STAT
17099 $cat > tryh.h <<END
17102 # define S_IRUSR S_IREAD
17103 # define S_IWUSR S_IWRITE
17104 # define S_IXUSR S_IEXEC
17106 # define S_IRUSR 0400
17107 # define S_IWUSR 0200
17108 # define S_IXUSR 0100
17110 # define S_IRGRP (S_IRUSR>>3)
17111 # define S_IWGRP (S_IWUSR>>3)
17112 # define S_IXGRP (S_IXUSR>>3)
17113 # define S_IROTH (S_IRUSR>>6)
17114 # define S_IWOTH (S_IWUSR>>6)
17115 # define S_IXOTH (S_IXUSR>>6)
17118 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17119 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17120 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17123 : see whether semctl IPC_STAT can use union semun
17124 case "$d_semctl_semun" in
17128 #include <sys/types.h>
17129 #include <sys/ipc.h>
17130 #include <sys/sem.h>
17131 #include <sys/stat.h>
17138 #$d_union_semun HAS_UNION_SEMUN
17141 #ifndef HAS_UNION_SEMUN
17144 struct semid_ds *buf;
17145 unsigned short *array;
17151 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17152 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17154 struct semid_ds argbuf;
17157 st = semctl(sem, 0, IPC_STAT, arg);
17161 # endif /* IPC_STAT */
17162 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17164 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17165 # endif /* IPC_RMID */
17166 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17168 #endif /* IPC_PRIVATE && ... */
17169 printf("semget failed: errno = %d\n", errno);
17174 if eval $compile; then
17177 semun) val="$define" ;;
17185 case "$d_semctl_semun" in
17187 echo "You can use union semun for semctl IPC_STAT." >&4
17190 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17195 : see whether semctl IPC_STAT can use struct semid_ds pointer
17196 case "$d_semctl_semid_ds" in
17199 $cat > try.c <<'END'
17200 #include <sys/types.h>
17201 #include <sys/ipc.h>
17202 #include <sys/sem.h>
17203 #include <sys/stat.h>
17211 struct semid_ds arg;
17214 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17215 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17218 st = semctl(sem, 0, IPC_STAT, &arg);
17220 printf("semid_ds\n");
17222 # endif /* IPC_STAT */
17223 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17225 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17226 # endif /* IPC_RMID */
17227 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17229 #endif /* IPC_PRIVATE && ... */
17230 printf("semget failed: errno = %d\n", errno);
17236 if eval $compile; then
17239 semid_ds) val="$define" ;;
17243 set d_semctl_semid_ds
17247 case "$d_semctl_semid_ds" in
17249 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17251 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17257 # We do not have the full sem*(2) library, so assume we can not
17263 set d_semctl_semid_ds
17269 : see if sendmsg exists
17270 set sendmsg d_sendmsg
17273 : see if setegid exists
17274 set setegid d_setegid
17277 : see if seteuid exists
17278 set seteuid d_seteuid
17281 : see if setgrent exists
17282 set setgrent d_setgrent
17285 : see if setgrent_r exists
17286 set setgrent_r d_setgrent_r
17288 case "$d_setgrent_r" in
17290 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17291 case "$d_setgrent_r_proto:$usethreads" in
17292 ":define") d_setgrent_r_proto=define
17293 set d_setgrent_r_proto setgrent_r $hdrs
17297 case "$d_setgrent_r_proto" in
17299 case "$setgrent_r_proto" in
17300 ''|0) try='int setgrent_r(FILE**);'
17301 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17303 case "$setgrent_r_proto" in
17304 ''|0) try='void setgrent_r(FILE**);'
17305 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17307 case "$setgrent_r_proto" in
17308 ''|0) d_setgrent_r=undef
17310 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17311 * ) case "$setgrent_r_proto" in
17312 REENTRANT_PROTO*) ;;
17313 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17315 echo "Prototype: $try" ;;
17318 *) case "$usethreads" in
17319 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17326 *) setgrent_r_proto=0
17330 : see if sethostent exists
17331 set sethostent d_sethent
17334 : see if sethostent_r exists
17335 set sethostent_r d_sethostent_r
17337 case "$d_sethostent_r" in
17339 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17340 case "$d_sethostent_r_proto:$usethreads" in
17341 ":define") d_sethostent_r_proto=define
17342 set d_sethostent_r_proto sethostent_r $hdrs
17346 case "$d_sethostent_r_proto" in
17348 case "$sethostent_r_proto" in
17349 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17350 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17352 case "$sethostent_r_proto" in
17353 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17354 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17356 case "$sethostent_r_proto" in
17357 ''|0) d_sethostent_r=undef
17358 sethostent_r_proto=0
17359 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17360 * ) case "$sethostent_r_proto" in
17361 REENTRANT_PROTO*) ;;
17362 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17364 echo "Prototype: $try" ;;
17367 *) case "$usethreads" in
17368 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17370 d_sethostent_r=undef
17371 sethostent_r_proto=0
17375 *) sethostent_r_proto=0
17379 : see if setitimer exists
17380 set setitimer d_setitimer
17383 : see if setlinebuf exists
17384 set setlinebuf d_setlinebuf
17387 : see if setlocale exists
17388 set setlocale d_setlocale
17391 : see if locale.h is available
17392 set locale.h i_locale
17395 : see if setlocale_r exists
17396 set setlocale_r d_setlocale_r
17398 case "$d_setlocale_r" in
17400 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17401 case "$d_setlocale_r_proto:$usethreads" in
17402 ":define") d_setlocale_r_proto=define
17403 set d_setlocale_r_proto setlocale_r $hdrs
17407 case "$d_setlocale_r_proto" in
17409 case "$setlocale_r_proto" in
17410 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17411 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17413 case "$setlocale_r_proto" in
17414 ''|0) d_setlocale_r=undef
17415 setlocale_r_proto=0
17416 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17417 * ) case "$setlocale_r_proto" in
17418 REENTRANT_PROTO*) ;;
17419 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17421 echo "Prototype: $try" ;;
17424 *) case "$usethreads" in
17425 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17427 d_setlocale_r=undef
17428 setlocale_r_proto=0
17432 *) setlocale_r_proto=0
17436 : see if setnetent exists
17437 set setnetent d_setnent
17440 : see if setnetent_r exists
17441 set setnetent_r d_setnetent_r
17443 case "$d_setnetent_r" in
17445 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17446 case "$d_setnetent_r_proto:$usethreads" in
17447 ":define") d_setnetent_r_proto=define
17448 set d_setnetent_r_proto setnetent_r $hdrs
17452 case "$d_setnetent_r_proto" in
17454 case "$setnetent_r_proto" in
17455 ''|0) try='int setnetent_r(int, struct netent_data*);'
17456 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17458 case "$setnetent_r_proto" in
17459 ''|0) try='void setnetent_r(int, struct netent_data*);'
17460 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17462 case "$setnetent_r_proto" in
17463 ''|0) d_setnetent_r=undef
17464 setnetent_r_proto=0
17465 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17466 * ) case "$setnetent_r_proto" in
17467 REENTRANT_PROTO*) ;;
17468 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17470 echo "Prototype: $try" ;;
17473 *) case "$usethreads" in
17474 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17476 d_setnetent_r=undef
17477 setnetent_r_proto=0
17481 *) setnetent_r_proto=0
17485 : see if setprotoent exists
17486 set setprotoent d_setpent
17489 : see if setpgid exists
17490 set setpgid d_setpgid
17493 : see if setpgrp2 exists
17494 set setpgrp2 d_setpgrp2
17497 : see if setpriority exists
17498 set setpriority d_setprior
17501 : see if setproctitle exists
17502 set setproctitle d_setproctitle
17505 : see if setprotoent_r exists
17506 set setprotoent_r d_setprotoent_r
17508 case "$d_setprotoent_r" in
17510 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17511 case "$d_setprotoent_r_proto:$usethreads" in
17512 ":define") d_setprotoent_r_proto=define
17513 set d_setprotoent_r_proto setprotoent_r $hdrs
17517 case "$d_setprotoent_r_proto" in
17519 case "$setprotoent_r_proto" in
17520 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17521 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17523 case "$setprotoent_r_proto" in
17524 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17525 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17527 case "$setprotoent_r_proto" in
17528 ''|0) d_setprotoent_r=undef
17529 setprotoent_r_proto=0
17530 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17531 * ) case "$setprotoent_r_proto" in
17532 REENTRANT_PROTO*) ;;
17533 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17535 echo "Prototype: $try" ;;
17538 *) case "$usethreads" in
17539 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17541 d_setprotoent_r=undef
17542 setprotoent_r_proto=0
17546 *) setprotoent_r_proto=0
17550 : see if setpwent exists
17551 set setpwent d_setpwent
17554 : see if setpwent_r exists
17555 set setpwent_r d_setpwent_r
17557 case "$d_setpwent_r" in
17559 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17560 case "$d_setpwent_r_proto:$usethreads" in
17561 ":define") d_setpwent_r_proto=define
17562 set d_setpwent_r_proto setpwent_r $hdrs
17566 case "$d_setpwent_r_proto" in
17568 case "$setpwent_r_proto" in
17569 ''|0) try='int setpwent_r(FILE**);'
17570 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17572 case "$setpwent_r_proto" in
17573 ''|0) try='void setpwent_r(FILE**);'
17574 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17576 case "$setpwent_r_proto" in
17577 ''|0) d_setpwent_r=undef
17579 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17580 * ) case "$setpwent_r_proto" in
17581 REENTRANT_PROTO*) ;;
17582 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17584 echo "Prototype: $try" ;;
17587 *) case "$usethreads" in
17588 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17595 *) setpwent_r_proto=0
17599 : see if setregid exists
17600 set setregid d_setregid
17602 set setresgid d_setresgid
17605 : see if setreuid exists
17606 set setreuid d_setreuid
17608 set setresuid d_setresuid
17611 : see if setrgid exists
17612 set setrgid d_setrgid
17615 : see if setruid exists
17616 set setruid d_setruid
17619 : see if setservent exists
17620 set setservent d_setsent
17623 : see if setservent_r exists
17624 set setservent_r d_setservent_r
17626 case "$d_setservent_r" in
17628 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17629 case "$d_setservent_r_proto:$usethreads" in
17630 ":define") d_setservent_r_proto=define
17631 set d_setservent_r_proto setservent_r $hdrs
17635 case "$d_setservent_r_proto" in
17637 case "$setservent_r_proto" in
17638 ''|0) try='int setservent_r(int, struct servent_data*);'
17639 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17641 case "$setservent_r_proto" in
17642 ''|0) try='void setservent_r(int, struct servent_data*);'
17643 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17645 case "$setservent_r_proto" in
17646 ''|0) d_setservent_r=undef
17647 setservent_r_proto=0
17648 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17649 * ) case "$setservent_r_proto" in
17650 REENTRANT_PROTO*) ;;
17651 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17653 echo "Prototype: $try" ;;
17656 *) case "$usethreads" in
17657 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17659 d_setservent_r=undef
17660 setservent_r_proto=0
17664 *) setservent_r_proto=0
17668 : see if setsid exists
17669 set setsid d_setsid
17672 : see if setvbuf exists
17673 set setvbuf d_setvbuf
17676 : see if shmctl exists
17677 set shmctl d_shmctl
17680 : see if shmget exists
17681 set shmget d_shmget
17684 : see if shmat exists
17687 : see what shmat returns
17690 $cat >shmat.c <<'END'
17691 #include <sys/shm.h>
17694 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17699 echo "and it returns ($shmattype)." >&4
17700 : see if a prototype for shmat is available
17701 xxx=`./findhdr sys/shm.h`
17702 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17703 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17714 set d_shmatprototype
17717 : see if shmdt exists
17721 : see how much of the 'shm*(2)' library is present.
17724 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17725 *"$undef"*) h_shm=false;;
17729 case "`ipcs 2>&1`" in
17730 "SVID shared memory"*"not configured"*)
17731 echo "Your $osname does not have the shm*(2) configured." >&4
17734 set shmctl d_shmctl
17736 set shmget d_shmget
17746 : we could also check for sys/ipc.h ...
17747 if $h_shm && $test `./findhdr sys/shm.h`; then
17748 echo "You have the full shm*(2) library." >&4
17751 echo "You don't have the full shm*(2) library." >&4
17757 : see if we have sigaction
17759 if set sigaction val -f d_sigaction; eval $csym; $val; then
17760 echo 'sigaction() found.' >&4
17763 #include <sys/types.h>
17764 #include <signal.h>
17765 #$i_stdlib I_STDLIB
17767 #include <stdlib.h>
17771 struct sigaction act, oact;
17773 oact.sa_handler = 0;
17774 /* so that act and oact are used */
17775 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17779 if eval $compile_ok; then
17782 echo "But you don't seem to have a usable struct sigaction." >&4
17786 echo 'sigaction NOT found.' >&4
17789 set d_sigaction; eval $setvar
17792 : see if this is a sunmath.h system
17793 set sunmath.h i_sunmath
17796 : see if signbit exists
17797 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17800 #$i_sunmath I_SUNMATH
17804 #ifdef I_SUNMATH /* Solaris special math library */
17805 # include <sunmath.h>
17808 int main(int argc, char **argv)
17812 if ((signbit(x) == 0) && (signbit(y) != 0))
17820 if eval $compile; then
17821 if $run ./try; then
17825 $echo "Signbit seems to be available, but doesn't work as I expected."
17826 $echo "I won't use it." >&4
17837 : see if sigprocmask exists
17838 set sigprocmask d_sigprocmask
17841 : see if sigsetjmp exists
17843 case "$d_sigsetjmp" in
17846 #include <setjmp.h>
17847 #$i_stdlib I_STDLIB
17849 #include <stdlib.h>
17855 if (sigsetjmp(env,1))
17858 siglongjmp(env, 1);
17863 if eval $compile; then
17864 if $run ./try >/dev/null 2>&1; then
17865 echo "POSIX sigsetjmp found." >&4
17869 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17875 echo "sigsetjmp not found." >&4
17879 *) val="$d_sigsetjmp"
17880 case "$d_sigsetjmp" in
17881 $define) echo "POSIX sigsetjmp found." >&4;;
17882 $undef) echo "sigsetjmp not found." >&4;;
17890 : see if snprintf exists
17891 set snprintf d_snprintf
17894 : see if vsnprintf exists
17895 set vsnprintf d_vsnprintf
17898 case "$d_snprintf-$d_vsnprintf" in
17901 Checking whether your snprintf() and vsnprintf() work okay...
17903 $cat >try.c <<'EOCP'
17904 /* v?snprintf testing logic courtesy of Russ Allbery.
17905 * According to C99:
17906 * - if the buffer is too short it still must be \0-terminated
17907 * - if the buffer is too short the potentially required length
17908 * must be returned and not -1
17909 * - if the buffer is NULL the potentially required length
17910 * must be returned and not -1 or core dump
17913 #include <stdarg.h>
17917 int test (char *format, ...)
17922 va_start (args, format);
17923 count = vsnprintf (buf, sizeof buf, format, args);
17930 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17931 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17935 if eval $compile; then
17938 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17940 Your snprintf() and snprintf() don't seem to be working okay.
17942 d_snprintf="$undef"
17943 d_vsnprintf="$undef"
17947 echo "(I can't seem to compile the test program--assuming they don't)"
17948 d_snprintf="$undef"
17949 d_vsnprintf="$undef"
17955 : see if sockatmark exists
17956 set sockatmark d_sockatmark
17959 : see if prototype for sockatmark is available
17961 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17964 : see if socks5_init exists
17965 set socks5_init d_socks5_init
17968 : see if sprintf returns the length of the string in the buffer as per ANSI
17969 $echo "Checking whether sprintf returns the length of the string..." >&4
17972 #$i_stdlib I_STDLIB
17974 #include <stdlib.h>
17976 #$i_string I_STRING
17978 # include <string.h>
17980 # include <strings.h>
17989 int check (size_t expect, int test) {
17990 size_t got = strlen(buffer);
17994 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17999 int main(int argc, char **argv) {
18002 check(sprintf(buffer, ""), ++test);
18003 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18004 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18011 if eval $compile; then
18015 sprintf returns the length of the string (as ANSI says it should)
18017 d_sprintf_returns_strlen="$define"
18020 sprintf does not return the length of the string (how old is this system?)
18022 d_sprintf_returns_strlen="$undef"
18026 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18027 d_sprintf_returns_strlen="$undef"
18031 : see if srand48_r exists
18032 set srand48_r d_srand48_r
18034 case "$d_srand48_r" in
18036 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18037 case "$d_srand48_r_proto:$usethreads" in
18038 ":define") d_srand48_r_proto=define
18039 set d_srand48_r_proto srand48_r $hdrs
18043 case "$d_srand48_r_proto" in
18045 case "$srand48_r_proto" in
18046 ''|0) try='int srand48_r(long, struct drand48_data*);'
18047 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18049 case "$srand48_r_proto" in
18050 ''|0) d_srand48_r=undef
18052 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18053 * ) case "$srand48_r_proto" in
18054 REENTRANT_PROTO*) ;;
18055 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18057 echo "Prototype: $try" ;;
18060 *) case "$usethreads" in
18061 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18068 *) srand48_r_proto=0
18072 : see if srandom_r exists
18073 set srandom_r d_srandom_r
18075 case "$d_srandom_r" in
18077 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18078 case "$d_srandom_r_proto:$usethreads" in
18079 ":define") d_srandom_r_proto=define
18080 set d_srandom_r_proto srandom_r $hdrs
18084 case "$d_srandom_r_proto" in
18086 case "$srandom_r_proto" in
18087 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18088 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18090 case "$srandom_r_proto" in
18091 ''|0) d_srandom_r=undef
18093 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18094 * ) case "$srandom_r_proto" in
18095 REENTRANT_PROTO*) ;;
18096 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18098 echo "Prototype: $try" ;;
18101 *) case "$usethreads" in
18102 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18109 *) srandom_r_proto=0
18113 : see if prototype for setresgid is available
18115 set d_sresgproto setresgid $i_unistd unistd.h
18118 : see if prototype for setresuid is available
18120 set d_sresuproto setresuid $i_unistd unistd.h
18123 : see if sys/stat.h is available
18124 set sys/stat.h i_sysstat
18127 : see if stat knows about block sizes
18129 echo "Checking to see if your struct stat has st_blocks field..." >&4
18130 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18133 : see if this is a sys/vfs.h system
18134 set sys/vfs.h i_sysvfs
18137 : see if this is a sys/statfs.h system
18138 set sys/statfs.h i_sysstatfs
18141 : Check for statfs_s
18143 echo "Checking to see if your system supports struct statfs..." >&4
18144 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
18146 case "$d_statfs_s" in
18147 "$define") echo "Yes, it does." ;;
18148 *) echo "No, it doesn't." ;;
18152 : see if struct statfs knows about f_flags
18153 case "$d_statfs_s" in
18156 echo "Checking to see if your struct statfs has f_flags field..." >&4
18157 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
18161 set d_statfs_f_flags
18165 case "$d_statfs_f_flags" in
18166 "$define") echo "Yes, it does." ;;
18167 *) echo "No, it doesn't." ;;
18170 : see what flavor, if any, of static inline is supported
18172 echo "Checking to see if your system supports static inline..."
18173 $cat > try.c <<'EOCP'
18174 #include <stdlib.h>
18175 extern int f_via_a(int x);
18176 extern int f_via_b(int x);
18177 int main(int argc, char **argv)
18186 return EXIT_SUCCESS;
18189 return EXIT_FAILURE;
18193 $cat > a.c <<'EOCP'
18194 static INLINE int f(int x) {
18205 $cat > b.c <<'EOCP'
18206 extern int f(int x);
18214 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18215 case "$perl_static_inline" in
18216 '') # Check the various possibilities, and break out on success.
18217 # For gcc, prefer __inline__, which will still permit
18218 # cflags.SH to add in -ansi.
18219 case "$gccversion" in
18220 '') xxx="inline __inline__ __inline _inline";;
18221 *) xxx="__inline__ inline __inline _inline";;
18223 for inline in $xxx; do
18224 set try -DINLINE=$inline a.c
18225 if eval $compile && $run ./try; then
18226 # Now make sure there is no external linkage of static
18228 set try -DINLINE=$inline -DUSE_B a.c b.c
18229 if eval $compile && $run ./try; then
18230 $echo "Your compiler supports static $inline, " >&4
18231 $echo "but it also creates an external definition," >&4
18232 $echo "so I won't use it." >&4
18235 $echo "Your compiler supports static $inline." >&4
18237 perl_static_inline="static $inline";
18241 $echo "Your compiler does NOT support static $inline." >&4
18246 *inline*) # Some variant of inline exists.
18247 echo "Keeping your $hint value of $perl_static_inline."
18250 static) # No inline capabilities
18251 echo "Keeping your $hint value of $perl_static_inline."
18254 *) # Unrecognized previous value -- blindly trust the supplied
18255 # value and hope it makes sense. Use old value for
18256 # d_static_inline, if there is one.
18257 echo "Keeping your $hint value of $perl_static_inline."
18258 case "$d_static_inline" in
18260 *) val=$d_static_inline ;;
18264 # Fallback to plain 'static' if nothing worked.
18265 case "$perl_static_inline" in
18267 perl_static_inline="static"
18271 set d_static_inline
18273 $rm -f a.[co] b.[co]
18276 : Check stream access
18278 Checking how to access stdio streams by file descriptor number...
18280 case "$stdio_stream_array" in
18281 '') $cat >try.c <<EOCP
18284 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18288 for s in _iob __iob __sF
18290 set try -DSTDIO_STREAM_ARRAY=$s
18291 if eval $compile; then
18292 case "`$run ./try`" in
18293 yes) stdio_stream_array=$s; break ;;
18299 case "$stdio_stream_array" in
18301 I can't figure out how to access stdio streams by file descriptor number.
18303 d_stdio_stream_array="$undef"
18306 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18308 d_stdio_stream_array="$define"
18312 : see if strcoll exists
18313 set strcoll d_strcoll
18316 : check for structure copying
18318 echo "Checking to see if your C compiler can copy structs..." >&4
18319 $cat >try.c <<'EOCP'
18329 if $cc -c try.c >/dev/null 2>&1 ; then
18331 echo "Yup, it can."
18334 echo "Nope, it can't."
18340 : see if strerror and/or sys_errlist[] exist
18342 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18343 if set strerror val -f d_strerror; eval $csym; $val; then
18344 echo 'strerror() found.' >&4
18345 d_strerror="$define"
18346 d_strerrm='strerror(e)'
18347 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18348 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18349 d_syserrlst="$define"
18351 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18352 d_syserrlst="$undef"
18354 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18355 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18356 echo 'strerror() found in string header.' >&4
18357 d_strerror="$define"
18358 d_strerrm='strerror(e)'
18359 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18360 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18361 d_syserrlst="$define"
18363 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18364 d_syserrlst="$undef"
18366 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18367 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18368 d_strerror="$undef"
18369 d_syserrlst="$define"
18370 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18372 echo 'strerror() and sys_errlist[] NOT found.' >&4
18373 d_strerror="$undef"
18374 d_syserrlst="$undef"
18375 d_strerrm='"unknown"'
18379 : see if strerror_r exists
18380 set strerror_r d_strerror_r
18382 case "$d_strerror_r" in
18384 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18385 case "$d_strerror_r_proto:$usethreads" in
18386 ":define") d_strerror_r_proto=define
18387 set d_strerror_r_proto strerror_r $hdrs
18391 case "$d_strerror_r_proto" in
18393 case "$strerror_r_proto" in
18394 ''|0) try='int strerror_r(int, char*, size_t);'
18395 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18397 case "$strerror_r_proto" in
18398 ''|0) try='int strerror_r(int, char*, int);'
18399 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18401 case "$strerror_r_proto" in
18402 ''|0) try='char* strerror_r(int, char*, size_t);'
18403 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18405 case "$strerror_r_proto" in
18406 ''|0) d_strerror_r=undef
18408 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18409 * ) case "$strerror_r_proto" in
18410 REENTRANT_PROTO*) ;;
18411 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18413 echo "Prototype: $try" ;;
18416 *) case "$usethreads" in
18417 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18424 *) strerror_r_proto=0
18428 : see if strftime exists
18429 set strftime d_strftime
18432 : see if strlcat exists
18433 set strlcat d_strlcat
18436 : see if strlcpy exists
18437 set strlcpy d_strlcpy
18440 : see if strtod exists
18441 set strtod d_strtod
18444 : see if strtol exists
18445 set strtol d_strtol
18448 : see if strtold exists
18449 set strtold d_strtold
18452 : see if strtoll exists
18453 set strtoll d_strtoll
18456 case "$d_longlong-$d_strtoll" in
18459 Checking whether your strtoll() works okay...
18461 $cat >try.c <<'EOCP'
18464 #define strtoll __strtoll
18467 #define strtoll _strtoll
18470 extern long long int strtoll(char *s, char **, int);
18471 static int bad = 0;
18472 int check(char *s, long long ell, int een) {
18475 gll = strtoll(s, 0, 10);
18476 if (!((gll == ell) && (errno == een)))
18480 check(" 1", 1LL, 0);
18481 check(" 0", 0LL, 0);
18482 check("-1", -1LL, 0);
18483 check("-9223372036854775808", -9223372036854775808LL, 0);
18484 check("-9223372036854775808", -9223372036854775808LL, 0);
18485 check(" 9223372036854775807", 9223372036854775807LL, 0);
18486 check("-9223372036854775808", -9223372036854775808LL, 0);
18487 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18488 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18494 if eval $compile; then
18497 ok) echo "Your strtoll() seems to be working okay." ;;
18499 Your strtoll() doesn't seem to be working okay.
18505 echo "(I can't seem to compile the test program--assuming it doesn't)"
18511 : see if strtoq exists
18512 set strtoq d_strtoq
18515 : see if strtoul exists
18516 set strtoul d_strtoul
18519 case "$d_strtoul" in
18522 Checking whether your strtoul() works okay...
18524 $cat >try.c <<'EOCP'
18527 extern unsigned long int strtoul(char *s, char **, int);
18528 static int bad = 0;
18529 void check(char *s, unsigned long eul, int een) {
18532 gul = strtoul(s, 0, 10);
18533 if (!((gul == eul) && (errno == een)))
18537 check(" 1", 1L, 0);
18538 check(" 0", 0L, 0);
18540 case "$longsize" in
18542 $cat >>try.c <<'EOCP'
18543 check("18446744073709551615", 18446744073709551615UL, 0);
18544 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18545 #if 0 /* strtoul() for /^-/ strings is undefined. */
18546 check("-1", 18446744073709551615UL, 0);
18547 check("-18446744073709551614", 2, 0);
18548 check("-18446744073709551615", 1, 0);
18549 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18550 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18555 $cat >>try.c <<'EOCP'
18556 check("4294967295", 4294967295UL, 0);
18557 check("4294967296", 4294967295UL, ERANGE);
18558 #if 0 /* strtoul() for /^-/ strings is undefined. */
18559 check("-1", 4294967295UL, 0);
18560 check("-4294967294", 2, 0);
18561 check("-4294967295", 1, 0);
18562 check("-4294967296", 4294967295UL, ERANGE);
18563 check("-4294967297", 4294967295UL, ERANGE);
18568 : Should we write these tests to be more portable by sprintf-ing
18569 : ~0 and then manipulating that char string as input for strtol?
18572 $cat >>try.c <<'EOCP'
18579 if eval $compile; then
18580 case "`$run ./try`" in
18581 ok) echo "Your strtoul() seems to be working okay." ;;
18583 Your strtoul() doesn't seem to be working okay.
18589 echo "(I can't seem to compile the test program--assuming it doesn't)"
18595 : see if strtoull exists
18596 set strtoull d_strtoull
18599 case "$d_longlong-$d_strtoull" in
18602 Checking whether your strtoull() works okay...
18604 $cat >try.c <<'EOCP'
18607 #define strtoull __strtoull
18610 extern unsigned long long int strtoull(char *s, char **, int);
18611 static int bad = 0;
18612 int check(char *s, long long eull, int een) {
18615 gull = strtoull(s, 0, 10);
18616 if (!((gull == eull) && (errno == een)))
18620 check(" 1", 1LL, 0);
18621 check(" 0", 0LL, 0);
18622 check("18446744073709551615", 18446744073709551615ULL, 0);
18623 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18624 #if 0 /* strtoull() for /^-/ strings is undefined. */
18625 check("-1", 18446744073709551615ULL, 0);
18626 check("-18446744073709551614", 2LL, 0);
18627 check("-18446744073709551615", 1LL, 0);
18628 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18629 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18636 if eval $compile; then
18637 case "`$run ./try`" in
18638 ok) echo "Your strtoull() seems to be working okay." ;;
18640 Your strtoull() doesn't seem to be working okay.
18642 d_strtoull="$undef"
18646 echo "(I can't seem to compile the test program--assuming it doesn't)"
18647 d_strtoull="$undef"
18652 : see if strtouq exists
18653 set strtouq d_strtouq
18656 case "$d_strtouq" in
18659 Checking whether your strtouq() works okay...
18661 $cat >try.c <<'EOCP'
18664 extern unsigned long long int strtouq(char *s, char **, int);
18665 static int bad = 0;
18666 void check(char *s, unsigned long long eull, int een) {
18667 unsigned long long gull;
18669 gull = strtouq(s, 0, 10);
18670 if (!((gull == eull) && (errno == een)))
18674 check(" 1", 1LL, 0);
18675 check(" 0", 0LL, 0);
18676 check("18446744073709551615", 18446744073709551615ULL, 0);
18677 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18678 #if 0 /* strtouq() for /^-/ strings is undefined. */
18679 check("-1", 18446744073709551615ULL, 0);
18680 check("-18446744073709551614", 2LL, 0);
18681 check("-18446744073709551615", 1LL, 0);
18682 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18683 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18691 if eval $compile; then
18692 case "`$run ./try`" in
18693 ok) echo "Your strtouq() seems to be working okay." ;;
18695 Your strtouq() doesn't seem to be working okay.
18701 echo "(I can't seem to compile the test program--assuming it doesn't)"
18707 : see if strxfrm exists
18708 set strxfrm d_strxfrm
18711 : see if symlink exists
18712 set symlink d_symlink
18715 : see if syscall exists
18716 set syscall d_syscall
18719 : see if prototype for syscall is available
18721 set d_syscallproto syscall $i_unistd unistd.h
18724 : see if sysconf exists
18725 set sysconf d_sysconf
18728 : see if system exists
18729 set system d_system
18732 : see if tcgetpgrp exists
18733 set tcgetpgrp d_tcgetpgrp
18736 : see if tcsetpgrp exists
18737 set tcsetpgrp d_tcsetpgrp
18740 : see if prototype for telldir is available
18742 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18745 : see if time exists
18747 if test "X$d_time" = X -o X"$timetype" = X; then
18748 if set time val -f d_time; eval $csym; $val; then
18749 echo 'time() found.' >&4
18751 rp="What is the type returned by time() on this system?"
18752 set time_t timetype long stdio.h sys/types.h
18755 echo 'time() not found, hope that will do.' >&4
18763 : see if timegm exists
18764 set timegm d_timegm
18767 : see if this is a sys/times.h system
18768 set sys/times.h i_systimes
18771 : see if times exists
18773 if set times val -f d_times; eval $csym; $val; then
18774 echo 'times() found.' >&4
18777 case "$i_systimes" in
18778 "$define") inc='sys/times.h';;
18780 rp="What is the type returned by times() on this system?"
18781 set clock_t clocktype long stdio.h sys/types.h $inc
18784 echo 'times() NOT found, hope that will do.' >&4
18789 : see if tmpnam_r exists
18790 set tmpnam_r d_tmpnam_r
18792 case "$d_tmpnam_r" in
18794 hdrs="$i_systypes sys/types.h define stdio.h "
18795 case "$d_tmpnam_r_proto:$usethreads" in
18796 ":define") d_tmpnam_r_proto=define
18797 set d_tmpnam_r_proto tmpnam_r $hdrs
18801 case "$d_tmpnam_r_proto" in
18803 case "$tmpnam_r_proto" in
18804 ''|0) try='char* tmpnam_r(char*);'
18805 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18807 case "$tmpnam_r_proto" in
18808 ''|0) d_tmpnam_r=undef
18810 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18811 * ) case "$tmpnam_r_proto" in
18812 REENTRANT_PROTO*) ;;
18813 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18815 echo "Prototype: $try" ;;
18818 *) case "$usethreads" in
18819 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18826 *) tmpnam_r_proto=0
18830 : see if truncate exists
18831 set truncate d_truncate
18834 : see if ttyname_r exists
18835 set ttyname_r d_ttyname_r
18837 case "$d_ttyname_r" in
18839 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18840 case "$d_ttyname_r_proto:$usethreads" in
18841 ":define") d_ttyname_r_proto=define
18842 set d_ttyname_r_proto ttyname_r $hdrs
18846 case "$d_ttyname_r_proto" in
18848 case "$ttyname_r_proto" in
18849 ''|0) try='int ttyname_r(int, char*, size_t);'
18850 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18852 case "$ttyname_r_proto" in
18853 ''|0) try='int ttyname_r(int, char*, int);'
18854 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18856 case "$ttyname_r_proto" in
18857 ''|0) try='char* ttyname_r(int, char*, int);'
18858 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18860 case "$ttyname_r_proto" in
18861 ''|0) d_ttyname_r=undef
18863 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18864 * ) case "$ttyname_r_proto" in
18865 REENTRANT_PROTO*) ;;
18866 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18868 echo "Prototype: $try" ;;
18871 *) case "$usethreads" in
18872 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18879 *) ttyname_r_proto=0
18883 : see if tzname[] exists
18885 if set tzname val -a d_tzname; eval $csym; $val; then
18887 echo 'tzname[] found.' >&4
18890 echo 'tzname[] NOT found.' >&4
18895 : Check if is a multiplatform env
18897 next|darwin) multiarch="$define" ;;
18899 case "$multiarch" in
18900 ''|[nN]*) multiarch="$undef" ;;
18903 : check for ordering of bytes in a UV
18905 case "$multiarch" in
18908 You seem to be doing a multiarchitecture build,
18909 skipping the byteorder check.
18915 case "$byteorder" in
18918 In the following, larger digits indicate more significance. A big-endian
18919 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18920 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18921 machines may have weird orders like 3412. A Cray will report 87654321,
18922 an Alpha will report 12345678. If the test program works the default is
18924 I'm now running the test program...
18928 #$i_stdlib I_STDLIB
18930 #include <stdlib.h>
18932 #include <sys/types.h>
18933 typedef $uvtype UV;
18943 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18945 u.l = (UV)0x04030201;
18946 for (i = 0; i < $uvsize; i++)
18947 printf("%c", u.c[i]+'0');
18954 if eval $compile && $run ./try > /dev/null; then
18957 [1-4][1-4][1-4][1-4]|12345678|87654321)
18958 echo "(The test program ran ok.)"
18959 echo "byteorder=$dflt"
18962 ????|????????) echo "(The test program ran ok.)" ;;
18963 *) echo "(The test program didn't run right for some reason.)" ;;
18968 (I can't seem to compile the test program. Guessing big-endian...)
18971 case "$xxx_prompt" in
18973 rp="What is the order of bytes in $uvtype?"
18986 : Checking 32bit alignedness
18989 Checking to see whether you can access character data unalignedly...
18991 case "$d_u32align" in
18992 '') $cat >try.c <<EOCP
18994 #$i_stdlib I_STDLIB
18996 #include <stdlib.h>
18998 #define U32 $u32type
18999 #define BYTEORDER 0x$byteorder
19001 #include <signal.h>
19003 $signal_t bletch(int s) { exit(4); }
19006 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19007 volatile U8 buf[8];
19011 if (sizeof(U32) != 4) {
19012 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19019 signal(SIGBUS, bletch);
19031 for (i = 0; i < 4; i++) {
19032 up = (U32*)(buf + i);
19033 if (! ((*up == 1 << (8*i)) || /* big-endian */
19034 (*up == 1 << (8*(3-i))) /* little-endian */
19038 printf("read failed (%x)\n", *up);
19044 for (i = 0; i < 4; i++) {
19045 up = (U32*)(buf + i);
19047 if (*up != 0xBeef) {
19048 printf("write failed (%x)\n", *up);
19062 if eval $compile_ok; then
19063 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19064 $run ./try 2>&1 >/dev/null
19067 You can access character data pretty unalignedly.
19069 d_u32align="$undef"
19072 It seems that you must access character data in an aligned manner.
19074 d_u32align="$define"
19078 rp='Can you access character data at unaligned addresses?'
19082 [yY]*) d_u32align="$undef" ;;
19083 *) d_u32align="$define" ;;
19090 : see if ualarm exists
19091 set ualarm d_ualarm
19094 : see if umask exists
19098 : see if unordered exists
19099 set unordered d_unordered
19102 : see if unsetenv exists
19103 set unsetenv d_unsetenv
19106 : see if usleep exists
19107 set usleep d_usleep
19110 : see if prototype for usleep is available
19112 set d_usleepproto usleep $i_unistd unistd.h
19115 : see if ustat exists
19119 : see if closedir exists
19120 set closedir d_closedir
19123 case "$d_closedir" in
19126 echo "Checking whether closedir() returns a status..." >&4
19128 #$i_dirent I_DIRENT /**/
19129 #$i_sysdir I_SYS_DIR /**/
19130 #$i_sysndir I_SYS_NDIR /**/
19131 #$i_systypes I_SYS_TYPES /**/
19133 #if defined(I_SYS_TYPES)
19134 #include <sys/types.h>
19136 #if defined(I_DIRENT)
19137 #include <dirent.h>
19138 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19139 #include <sys/dir.h>
19143 #include <sys/ndir.h>
19147 #include <ndir.h> /* may be wrong in the future */
19149 #include <sys/dir.h>
19154 int main() { return closedir(opendir(".")); }
19157 if eval $compile_ok; then
19158 if $run ./try > /dev/null 2>&1 ; then
19159 echo "Yes, it does."
19162 echo "No, it doesn't."
19166 echo "(I can't seem to compile the test program--assuming it doesn't)"
19174 set d_void_closedir
19178 : see if there is a wait4
19182 : see if waitpid exists
19183 set waitpid d_waitpid
19186 : see if wcstombs exists
19187 set wcstombs d_wcstombs
19190 : see if wctomb exists
19191 set wctomb d_wctomb
19194 : see if writev exists
19195 set writev d_writev
19198 : preserve RCS keywords in files with variable substitution, grrr
19203 Revision='$Revision'
19205 : check for alignment requirements
19207 case "$alignbytes" in
19208 '') echo "Checking alignment constraints..." >&4
19209 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19210 $cat >try.c <<'EOCP'
19211 typedef long double NV;
19214 $cat >try.c <<'EOCP'
19218 $cat >>try.c <<'EOCP'
19226 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19231 if eval $compile_ok; then
19235 echo "(I can't seem to compile the test program...)"
19237 case "$multiarch" in
19239 : The usual safe value is 8, but Darwin with -Duselongdouble
19240 : needs 16. Hence, we will take 8 as a minimum, but allow
19241 : Configure to pick a larger value if needed.
19242 if $test "$dflt" -lt 8; then
19244 echo "Setting alignment to 8 for multiarch support.">&4
19249 *) dflt="$alignbytes"
19252 rp="Doubles must be aligned on a how-many-byte boundary?"
19257 : set the base revision
19260 : Determine if this is an EBCDIC system
19262 echo "Determining whether or not we are on an EBCDIC system..." >&4
19263 $cat >try.c <<'EOM'
19266 if ('M'==0xd4) return 0;
19271 case "$BOOTSTRAP_CHARSET" in
19272 Y|y|define) bootstrap_charset=$define ;;
19273 *) bootstrap_charset=$undef ;;
19278 if eval $compile_ok; then
19279 if $run ./try; then
19280 echo "You seem to speak EBCDIC." >&4
19283 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19286 echo "I'm unable to compile the test program." >&4
19287 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19293 : length of character in bytes. Is always 1, otherwise it is not C
19294 : This used to be a test using sizeof
19297 : Check for the number of bits in a character
19298 case "$charbits" in
19299 '') echo "Checking how long a character is (in bits)..." >&4
19306 for (c = 1, n = 0; c; c <<= 1, n++) ;
19307 printf ("%d\n", n);
19312 if eval $compile_ok; then
19316 echo "(I can't seem to compile the test program. Guessing...)"
19323 rp="What is the length of a character (in bits)?"
19327 case "$charbits" in
19330 Your system has an unsigned character size of $charbits bits, which
19331 is rather unusual (normally it is 8 bits). Perl likely will not work
19332 correctly on your system, with subtle bugs in various places.
19334 rp='Do you really want to continue?'
19338 [yY]) echo >&4 "Okay, continuing." ;;
19343 : how do we concatenate cpp tokens here?
19345 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19346 $cat >cpp_stuff.c <<'EOCP'
19347 #define RCAT(a,b)a/**/b
19348 #define ACAT(a,b)a ## b
19352 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19353 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19354 echo "Oh! Smells like ANSI's been here." >&4
19355 echo "We can catify or stringify, separately or together!"
19357 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19358 echo "Ah, yes! The good old days!" >&4
19359 echo "However, in the good old days we don't know how to stringify and"
19360 echo "catify at the same time."
19364 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19365 You're going to have to edit the values of CAT[2-5] in config.h...
19367 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19371 : see if this is a db.h system
19377 : Check db version.
19379 echo "Checking Berkeley DB version ..." >&4
19385 #include <sys/types.h>
19387 #$i_stdlib I_STDLIB
19389 #include <stdlib.h>
19392 int main(int argc, char *argv[])
19394 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19395 int Major, Minor, Patch ;
19396 unsigned long Version ;
19397 (void)db_version(&Major, &Minor, &Patch) ;
19399 printf("%d %d %d %d %d %d\n",
19400 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19401 Major, Minor, Patch);
19404 printf("You have Berkeley DB Version 2 or greater.\n");
19406 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19407 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19408 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19409 Major, Minor, Patch) ;
19411 /* check that db.h & libdb are compatible */
19412 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19413 printf("db.h and libdb are incompatible.\n") ;
19417 printf("db.h and libdb are compatible.\n") ;
19419 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19420 + DB_VERSION_PATCH ;
19422 /* needs to be >= 2.3.4 */
19423 if (Version < 2003004) {
19424 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19425 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19431 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19436 printf("You have Berkeley DB Version 1.\n");
19437 exit(0); /* DB version < 2: the coast is clear. */
19439 exit(1); /* <db.h> not Berkeley DB? */
19445 if eval $compile_ok && $run ./try; then
19446 echo 'Looks OK.' >&4
19448 db_version_major=$1
19449 db_version_minor=$2
19450 db_version_patch=$3
19452 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19456 : Remove db from list of libraries to use
19457 echo "Removing unusable -ldb from library list" >&4
19458 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19461 echo "libs = $libs" >&4
19471 : Check the return type needed for hash
19473 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19479 #include <sys/types.h>
19482 #ifndef DB_VERSION_MAJOR
19483 u_int32_t hash_cb (ptr, size)
19491 info.hash = hash_cb;
19495 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19496 if $contains warning try.out >>/dev/null 2>&1 ; then
19499 db_hashtype='u_int32_t'
19502 : XXX Maybe we should just give up here.
19503 db_hashtype=u_int32_t
19505 echo "Help: I can't seem to compile the db test program." >&4
19506 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19509 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19511 *) db_hashtype=u_int32_t
19516 : Check the return type needed for prefix
19518 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19524 #include <sys/types.h>
19527 #ifndef DB_VERSION_MAJOR
19528 size_t prefix_cb (key1, key2)
19536 info.prefix = prefix_cb;
19540 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19541 if $contains warning try.out >>/dev/null 2>&1 ; then
19542 db_prefixtype='int'
19544 db_prefixtype='size_t'
19547 db_prefixtype='size_t'
19548 : XXX Maybe we should just give up here.
19550 echo "Help: I can't seem to compile the db test program." >&4
19551 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19554 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19556 *) db_prefixtype='size_t'
19560 : How can we generate normalized random numbers ?
19562 echo "Using our internal random number implementation..." >&4
19565 *-Dmy_rand=*|*-Dmy_srand=*)
19566 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19567 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19568 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19569 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19573 randfunc=Perl_drand48
19574 drand01="Perl_drand48()"
19575 seedfunc="Perl_drand48_init"
19579 : Check how to flush
19582 Checking how to flush all pending stdio output...
19584 # I only know how to find the first 32 possibly open files on SunOS.
19585 # See also hints/sunos_4_1.sh and util.c --AD
19587 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19589 $cat >>try.c <<EOCP
19591 #$i_stdlib I_STDLIB
19593 #include <stdlib.h>
19595 #$i_unistd I_UNISTD
19597 # include <unistd.h>
19599 #$d_sysconf HAS_SYSCONF
19600 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19601 #ifdef HAS_STDIO_STREAM_ARRAY
19602 # define STDIO_STREAM_ARRAY $stdio_stream_array
19607 p = fopen("try.out", "w");
19611 # ifdef TRY_FPRINTF
19615 #ifdef TRY_FFLUSH_NULL
19618 #ifdef TRY_FFLUSH_ALL
19620 long open_max = -1;
19621 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19622 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19624 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19625 open_max = sysconf(_SC_OPEN_MAX);
19628 open_max = FOPEN_MAX;
19631 open_max = OPEN_MAX;
19640 # ifdef HAS_STDIO_STREAM_ARRAY
19641 if (open_max > 0) {
19643 for (i = 0; i < open_max; i++)
19644 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19645 STDIO_STREAM_ARRAY[i]._file < open_max &&
19646 STDIO_STREAM_ARRAY[i]._flag)
19647 fflush(&STDIO_STREAM_ARRAY[i]);
19655 : first we have to find out how _not_ to flush
19657 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19659 set try -DTRY_FPUTC
19660 if eval $compile; then
19661 $run ./try 2>/dev/null
19664 if $test ! -s try.out -a "X$code" = X42; then
19670 set try -DTRY_FPRINTF
19671 if eval $compile; then
19672 $run ./try 2>/dev/null
19675 if $test ! -s try.out -a "X$code" = X42; then
19676 output=-DTRY_FPRINTF
19682 : check for fflush NULL behavior
19683 case "$fflushNULL" in
19684 '') set try -DTRY_FFLUSH_NULL $output
19685 if eval $compile; then
19686 $run ./try 2>/dev/null
19689 if $test -s try.out -a "X$code" = X42; then
19690 fflushNULL="`$cat try.out`"
19692 if $test "X$code" != X42; then
19694 (If this test failed, don't worry, we'll try another method shortly.)
19699 $rm -f core try.core core.try.*
19700 case "$fflushNULL" in
19702 Your fflush(NULL) works okay for output streams.
19703 Let's see if it clobbers input pipes...
19705 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19706 # bug that improperly flushes the input end of pipes. So we avoid the
19707 # autoflush on fork/system/exec support for now. :-(
19708 $cat >tryp.c <<EOCP
19711 main(int argc, char **argv)
19717 while ((i = getc(stdin)) != -1
19718 && (*bp++ = i) != '\n'
19719 && bp < &buf[1024])
19722 fprintf(stdout, "%s", buf);
19730 fflushNULL="$define"
19732 if eval $compile; then
19734 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19735 if $test "X$targethost" != X; then
19738 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19740 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19742 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19744 fflush(NULL) seems to behave okay with input streams.
19746 fflushNULL="$define"
19749 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19751 fflushNULL="$undef"
19754 $rm -f core tryp.c tryp.core core.tryp.*
19757 Your fflush(NULL) isn't working (contrary to ANSI C).
19759 fflushNULL="$undef"
19762 Cannot figure out whether your fflush(NULL) works or not.
19763 I'm assuming it doesn't (contrary to ANSI C).
19765 fflushNULL="$undef"
19769 $define|true|[yY]*)
19770 fflushNULL="$define"
19773 fflushNULL="$undef"
19776 : check explicit looping only if NULL did not work, and if the pipe
19777 : bug does not show up on an explicit flush too
19778 case "$fflushNULL" in
19780 $cat >tryp.c <<EOCP
19783 main(int argc, char **argv)
19789 while ((i = getc(stdin)) != -1
19790 && (*bp++ = i) != '\n'
19791 && bp < &buf[1024])
19794 fprintf(stdout, "%s", buf);
19803 if eval $compile; then
19805 if $test "X$targethost" != X; then
19808 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19810 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19812 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19814 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19816 : now check for fflushall behaviour
19817 case "$fflushall" in
19818 '') set try -DTRY_FFLUSH_ALL $output
19819 if eval $compile; then
19821 (Now testing the other method--but note that this also may fail.)
19823 $run ./try 2>/dev/null
19826 if $test -s try.out -a "X$code" = X42; then
19827 fflushall="`$cat try.out`"
19831 case "$fflushall" in
19833 Whew. Flushing explicitly all the stdio streams works.
19835 fflushall="$define"
19838 Sigh. Flushing explicitly all the stdio streams doesn't work.
19843 Cannot figure out whether flushing stdio streams explicitly works or not.
19844 I'm assuming it doesn't.
19850 "$define"|true|[yY]*)
19851 fflushall="$define"
19859 All is futile. Even fflush(stdin) clobbers input pipes!
19866 $rm -f core tryp.c tryp.core core.tryp.*
19868 *) fflushall="$undef"
19872 case "$fflushNULL$fflushall" in
19875 OK, I give up. I cannot figure out how to flush pending stdio output.
19876 We won't be flushing handles at all before fork/exec/popen.
19882 : Store the full pathname to the ar program for use in the C program
19883 : Respect a hint or command line value for full_ar.
19888 : Store the full pathname to the sed program for use in the C program
19891 : see what type gids are declared as in the kernel
19893 echo "Looking for the type for group ids returned by getgid()."
19894 set gid_t gidtype xxx stdio.h sys/types.h
19898 xxx=`./findhdr sys/user.h`
19899 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19901 unsigned) dflt="$1 $2" ;;
19905 *) dflt="$gidtype";;
19908 gid_t) echo "gid_t found." ;;
19909 *) rp="What is the type for group ids returned by getgid()?"
19915 : Check the size of GID
19918 *_t) zzz="$gidtype" ;;
19921 echo "Checking the size of $zzz..." >&4
19923 #include <sys/types.h>
19925 #$i_stdlib I_STDLIB
19927 #include <stdlib.h>
19930 printf("%d\n", (int)sizeof($gidtype));
19935 if eval $compile_ok; then
19939 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19942 echo "Your $zzz is $gidsize bytes long."
19947 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19951 : Check if GID is signed
19954 *_t) zzz="$gidtype" ;;
19957 echo "Checking the sign of $zzz..." >&4
19959 #include <sys/types.h>
19970 if eval $compile; then
19974 echo "(I can't execute the test program--guessing unsigned.)" >&4
19978 1) echo "Your $zzz is unsigned." ;;
19979 -1) echo "Your $zzz is signed." ;;
19985 echo "(I can't compile the test program--guessing unsigned.)" >&4
19989 : Check 64bit sizes
19992 if $test X"$quadtype" != X; then
19994 echo "Checking how to print 64-bit integers..." >&4
19996 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19997 $cat >try.c <<'EOCP'
19998 #include <sys/types.h>
20001 int q = 12345678901;
20002 printf("%ld\n", q);
20006 if eval $compile; then
20010 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20011 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20012 echo "We will use %d."
20018 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20019 $cat >try.c <<'EOCP'
20020 #include <sys/types.h>
20023 long q = 12345678901;
20024 printf("%ld\n", q);
20028 if eval $compile; then
20032 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20033 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20034 echo "We will use %ld."
20040 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20041 $cat >try.c <<'EOCP'
20042 #include <sys/types.h>
20043 #include <inttypes.h>
20046 int64_t q = 12345678901;
20047 printf("%" PRId64 "\n", q);
20051 if eval $compile; then
20055 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20056 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20057 echo "We will use the C9X style."
20063 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20065 #include <sys/types.h>
20068 $quadtype q = 12345678901;
20069 printf("%Ld\n", q);
20073 if eval $compile; then
20077 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20078 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20079 echo "We will use %Ld."
20085 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20086 $cat >try.c <<'EOCP'
20087 #include <sys/types.h>
20090 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20091 printf("%lld\n", q);
20095 if eval $compile; then
20099 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20100 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20101 echo "We will use the %lld style."
20107 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20109 #include <sys/types.h>
20112 $quadtype q = 12345678901;
20113 printf("%qd\n", q);
20117 if eval $compile; then
20121 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20122 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20123 echo "We will use %qd."
20129 if $test X"$sPRId64" = X; then
20130 echo "Cannot figure out how to print 64-bit integers." >&4
20137 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20138 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20140 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20141 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20145 : Check format strings for internal types
20147 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20149 if $test X"$ivsize" = X8; then
20150 ivdformat="$sPRId64"
20151 uvuformat="$sPRIu64"
20152 uvoformat="$sPRIo64"
20153 uvxformat="$sPRIx64"
20154 uvXUformat="$sPRIXU64"
20156 if $test X"$ivsize" = X"$longsize"; then
20163 if $test X"$ivsize" = X"$intsize"; then
20171 if $test X"$ivsize" = X"$shortsize"; then
20182 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20183 nveformat="$sPRIeldbl"
20184 nvfformat="$sPRIfldbl"
20185 nvgformat="$sPRIgldbl"
20186 nvEUformat="$sPRIEUldbl"
20187 nvFUformat="$sPRIFUldbl"
20188 nvGUformat="$sPRIGUldbl"
20198 case "$ivdformat" in
20199 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20204 : Check format string for GID
20207 $echo "Checking the format string to be used for gids..." >&4
20210 -1) if $test X"$gidsize" = X"$ivsize"; then
20211 gidformat="$ivdformat"
20213 if $test X"$gidsize" = X"$longsize"; then
20216 if $test X"$gidsize" = X"$intsize"; then
20219 if $test X"$gidsize" = X"$shortsize"; then
20226 *) if $test X"$gidsize" = X"$uvsize"; then
20227 gidformat="$uvuformat"
20229 if $test X"$gidsize" = X"$longsize"; then
20232 if $test X"$gidsize" = X"$intsize"; then
20235 if $test X"$gidsize" = X"$shortsize"; then
20244 : see if getgroups exists
20245 set getgroups d_getgrps
20248 : see if setgroups exists
20249 set setgroups d_setgrps
20252 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20254 case "$d_getgrps$d_setgrps" in
20256 case "$groupstype" in
20257 '') dflt="$gidtype" ;;
20258 *) dflt="$groupstype" ;;
20261 What type of pointer is the second argument to getgroups() and setgroups()?
20262 Usually this is the same as group ids, $gidtype, but not always.
20265 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20269 *) groupstype="$gidtype";;
20272 : MAD = Misc Attribute Definition
20274 if $test $patchlevel -lt 9; then
20275 : MAD is not available in 5.8.x or earlier.
20279 $define|true|[yY]*) dflt='y' ;;
20284 Would you like to build with Misc Attribute Decoration? This is development
20285 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20286 overhead on the interpreter.
20288 If this doesn't make any sense to you, just accept the default '$dflt'.
20290 rp='Build Perl with MAD?'
20295 madlyh='madly.h madly.act madly.tab'
20297 madlyobj="madly$_o" ;;
20306 : check whether make sets MAKE
20308 echo "Checking if your $make program sets \$(MAKE)..." >&4
20309 case "$make_set_make" in
20311 $sed 's/^X //' > testmake.mak << 'EOF'
20313 X @echo 'maketemp="$(MAKE)"'
20315 case "`$make -f testmake.mak 2>/dev/null`" in
20316 *maketemp=*) make_set_make='#' ;;
20317 *) make_set_make="MAKE=$make" ;;
20319 $rm -f testmake.mak
20322 case "$make_set_make" in
20323 '#') echo "Yup, it does.";;
20324 *) echo "Nope, it doesn't.";;
20327 : see what type is used for mode_t
20328 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20329 set mode_t modetype int stdio.h sys/types.h
20332 : see if we need va_copy
20334 case "$i_stdarg" in
20337 #include <stdarg.h>
20339 #$i_stdlib I_STDLIB
20341 #include <stdlib.h>
20343 #include <signal.h>
20346 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20348 return vfprintf(f, fmt, *valp);
20352 myvfprintf(FILE *f, const char *fmt, va_list val)
20354 return ivfprintf(f, fmt, &val);
20358 myprintf(char *fmt, ...)
20361 va_start(val, fmt);
20362 return myvfprintf(stdout, fmt, val);
20366 main(int ac, char **av)
20368 signal(SIGSEGV, exit);
20370 myprintf("%s%cs all right, then\n", "that", '\'');
20375 if eval $compile && $run ./try 2>&1 >/dev/null; then
20376 case "`$run ./try`" in
20377 "that's all right, then")
20383 yes) echo "It seems that you don't need va_copy()." >&4
20384 need_va_copy="$undef"
20386 *) echo "It seems that va_copy() or similar will be needed." >&4
20387 need_va_copy="$define"
20392 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20393 need_va_copy="$undef"
20397 : see what type is used for size_t
20398 rp="What is the type used for the length parameter for string functions?"
20399 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20402 : check for type of arguments to gethostbyaddr.
20403 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20404 case "$d_gethbyaddr" in
20408 Checking to see what type of arguments are accepted by gethostbyaddr().
20410 hdrs="$define sys/types.h
20411 $d_socket sys/socket.h
20412 $i_niin netinet/in.h
20414 $i_unistd unistd.h"
20415 : The first arg can 'char *' or 'void *'
20416 : The second arg is some of integral type
20417 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20418 for yyy in size_t long int; do
20419 case "$netdb_host_type" in
20420 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20421 if ./protochk "$try" $hdrs; then
20422 echo "Your system accepts $xxx for the first arg."
20423 echo "...and $yyy for the second arg."
20424 netdb_host_type="$xxx"
20425 netdb_hlen_type="$yyy"
20431 : In case none of those worked, prompt the user.
20432 case "$netdb_host_type" in
20433 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20436 netdb_host_type=$ans
20437 rp='What is the type for the 2nd argument to gethostbyaddr?'
20440 netdb_hlen_type=$ans
20444 *) : no gethostbyaddr, so pick harmless defaults
20445 netdb_host_type='char *'
20446 netdb_hlen_type="$sizetype"
20449 # Remove the "const" if needed. -- but then we'll have a
20451 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20454 : check for type of argument to gethostbyname.
20455 if test "X$netdb_name_type" = X ; then
20456 case "$d_gethbyname" in
20460 Checking to see what type of argument is accepted by gethostbyname().
20462 hdrs="$define sys/types.h
20463 $d_socket sys/socket.h
20464 $i_niin netinet/in.h
20466 $i_unistd unistd.h"
20467 for xxx in "const char *" "char *"; do
20468 case "$netdb_name_type" in
20469 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20470 if ./protochk "$try" $hdrs; then
20471 echo "Your system accepts $xxx."
20472 netdb_name_type="$xxx"
20477 : In case none of those worked, prompt the user.
20478 case "$netdb_name_type" in
20479 '') rp='What is the type for the 1st argument to gethostbyname?'
20482 netdb_name_type=$ans
20486 *) : no gethostbyname, so pick harmless default
20487 netdb_name_type='char *'
20492 : check for type of 1st argument to getnetbyaddr.
20493 if test "X$netdb_net_type" = X ; then
20494 case "$d_getnbyaddr" in
20498 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20500 hdrs="$define sys/types.h
20501 $d_socket sys/socket.h
20502 $i_niin netinet/in.h
20504 $i_unistd unistd.h"
20505 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20506 case "$netdb_net_type" in
20507 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20508 if ./protochk "$try" $hdrs; then
20509 echo "Your system accepts $xxx."
20510 netdb_net_type="$xxx"
20515 : In case none of those worked, prompt the user.
20516 case "$netdb_net_type" in
20517 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20520 netdb_net_type=$ans
20524 *) : no getnetbyaddr, so pick harmless default
20525 netdb_net_type='long'
20529 : locate the preferred pager for this system
20536 [a-zA-Z]:/*) dflt=$pg;;
20540 [a-zA-Z]:/*) dflt=$more;;
20544 [a-zA-Z]:/*) dflt=$less;;
20547 '') dflt=/usr/ucb/more;;
20555 rp='What pager is used on your system?'
20559 : see what type pids are declared as in the kernel
20560 rp="What is the type of process ids on this system?"
20561 set pid_t pidtype int stdio.h sys/types.h
20564 : see if ar generates random libraries by itself
20566 echo "Checking how to generate random libraries on your machine..." >&4
20567 echo 'int bar1() { return bar2(); }' > bar1.c
20568 echo 'int bar2() { return 2; }' > bar2.c
20570 #$i_stdlib I_STDLIB
20572 #include <stdlib.h>
20574 int main() { printf("%d\n", bar1()); exit(0); }
20576 $cc $ccflags -c bar1.c >/dev/null 2>&1
20577 $cc $ccflags -c bar2.c >/dev/null 2>&1
20578 $cc $ccflags -c foo.c >/dev/null 2>&1
20579 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20580 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20581 $run ./foobar >/dev/null 2>&1; then
20582 echo "$ar appears to generate random libraries itself."
20584 if [ "X$ranlib" = "X" ]; then
20587 elif $ar s bar$_a >/dev/null 2>&1 &&
20588 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20589 $run ./foobar >/dev/null 2>&1; then
20590 echo "a table of contents needs to be added with '$ar s'."
20593 elif $ar ts bar$_a >/dev/null 2>&1 &&
20594 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20595 $run ./foobar >/dev/null 2>&1; then
20596 echo "a table of contents needs to be added with '$ar ts'."
20603 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20604 $test -f $ranlib || ranlib=''
20607 if $test -n "$ranlib"; then
20608 echo "your system has '$ranlib'; we'll use that."
20611 echo "your system doesn't seem to support random libraries"
20612 echo "so we'll use lorder and tsort to order the libraries."
20619 : see if this is a values.h system
20620 set values.h i_values
20623 : Check the max offset that gmtime and localtime accept
20624 echo "Checking max offsets that gmtime () accepts"
20627 define) yyy="#include <values.h>" ;;
20631 case "$sGMTIME_min/$sGMTIME_max" in
20634 #include <sys/types.h>
20643 void gm_check (time_t t, int min_year, int max_year)
20646 if ( tmp == NULL ||
20647 /* Check tm_year overflow */
20648 tmp->tm_year < min_year || tmp->tm_year > max_year)
20659 gm_check (MAXLONG, 69, 0x7fffffff);
20661 if (tmp == NULL || tmp->tm_year < 0) {
20662 for (i = 63; i >= 0; i--) {
20663 time_t x = pt | ((time_t)1 << i);
20664 if (x < 0 || x < pt) continue;
20665 gm_check (x, 69, 0x7fffffff);
20668 printf ("sGMTIME_max=%ld\n", pt);
20677 gm_check (MINLONG, -1900, 70);
20680 for (i = 36; i >= 0; i--) {
20681 time_t x = pt - ((time_t)1 << i);
20682 if (x > 0) continue;
20683 gm_check (x, -1900, 70);
20686 printf ("sGMTIME_min=%ld\n", pt);
20690 int main (int argc, char *argv[])
20692 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20699 if eval $compile; then
20702 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20708 echo "Checking max offsets that localtime () accepts"
20710 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20713 #include <sys/types.h>
20722 void local_check (time_t t, int min_year, int max_year)
20724 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20727 tmp = localtime (&t);
20728 if ( tmp == NULL ||
20729 /* Check tm_year overflow */
20730 tmp->tm_year < min_year || tmp->tm_year > max_year)
20734 } /* local_check */
20741 local_check (MAXLONG, 69, 0x7fffffff);
20743 if (tmp == NULL || tmp->tm_year < 0) {
20744 for (i = 63; i >= 0; i--) {
20745 time_t x = pt | ((time_t)1 << i);
20746 if (x < 0 || x < pt) continue;
20747 local_check (x, 69, 0x7fffffff);
20750 printf ("sLOCALTIME_max=%ld\n", pt);
20759 local_check (MINLONG, -1900, 70);
20762 for (i = 36; i >= 0; i--) {
20763 time_t x = pt - ((time_t)1 << i);
20764 if (x > 0) continue;
20765 local_check (x, -1900, 70);
20768 printf ("sLOCALTIME_min=%ld\n", pt);
20772 int main (int argc, char *argv[])
20780 if eval $compile; then
20783 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20789 : check for type of arguments to select.
20790 case "$selecttype" in
20791 '') case "$d_select" in
20795 Checking to see what type of arguments are accepted by select().
20797 hdrs="$define sys/types.h
20798 $i_systime sys/time.h
20799 $i_sysselct sys/select.h
20800 $d_socket sys/socket.h"
20801 : The first arg can be int, unsigned, or size_t
20802 : The last arg may or may not be 'const'
20804 : void pointer has been seen but using that
20805 : breaks the selectminbits test
20806 for xxx in 'fd_set *' 'int *'; do
20807 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20808 for tmo in 'struct timeval *' 'const struct timeval *'; do
20810 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20811 if ./protochk "$try" $hdrs; then
20812 echo "Your system accepts $xxx."
20821 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20822 case "$d_fd_set" in
20823 $define) dflt="fd_set *" ;;
20832 *) : no select, so pick a harmless default
20839 : check for the select 'width'
20840 case "$selectminbits" in
20841 '') safebits=`expr $ptrsize \* 8`
20842 case "$d_select" in
20846 Checking to see on how many bits at a time your select() operates...
20849 #include <sys/types.h>
20851 #$i_systime I_SYS_TIME
20852 #$i_systimek I_SYS_TIME_KERNEL
20857 # ifdef I_SYS_TIME_KERNEL
20860 # include <sys/time.h>
20861 # ifdef I_SYS_TIME_KERNEL
20865 #$i_sysselct I_SYS_SELECT
20866 #ifdef I_SYS_SELECT
20867 #include <sys/select.h>
20869 #$d_socket HAS_SOCKET
20871 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20874 #$i_stdlib I_STDLIB
20876 #include <stdlib.h>
20879 #define S sizeof(*(b))
20881 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20882 #define NBITS (NBYTES * 8)
20884 char *s = (char *)malloc(NBYTES);
20893 fp = fopen("try.c", "r");
20899 b = ($selecttype)s;
20900 for (i = 0; i < NBITS; i++)
20904 select(fd + 1, b, 0, 0, &t);
20905 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20907 printf("%d\n", i + 1);
20912 if eval $compile_ok; then
20913 selectminbits=`$run ./try`
20914 case "$selectminbits" in
20916 Cannot figure out on how many bits at a time your select() operates.
20917 I'll play safe and guess it is $safebits bits.
20919 selectminbits=$safebits
20920 bits="$safebits bits"
20923 *) bits="$selectminbits bits" ;;
20925 echo "Your select() operates on $bits at a time." >&4
20927 rp='What is the minimum number of bits your select() operates on?'
20928 case "$byteorder" in
20929 12345678) dflt=64 ;;
20935 selectminbits="$val"
20939 *) : no select, so pick a harmless default
20940 selectminbits=$safebits
20946 : Trace out the files included by signal.h, then look for SIGxxx names.
20947 if [ "X$fieldn" = X ]; then
20948 : Just make some guesses. We check them later.
20949 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
20951 xxx=`echo '#include <signal.h>' |
20952 $cppstdin $cppminus $cppflags 2>/dev/null |
20953 $grep '^[ ]*#.*include' |
20954 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20955 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20958 for xx in $xxx /dev/null ; do
20959 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20961 case "$xxxfiles" in
20962 '') xxxfiles=`./findhdr signal.h` ;;
20965 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20966 print substr($2, 4, 20)
20968 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20969 print substr($3, 4, 20)
20971 : Append some common names just in case the awk scan failed.
20972 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20973 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20974 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20975 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20976 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20978 : generate a few handy files for later
20979 $cat > signal.c <<EOCP
20980 #include <sys/types.h>
20981 #include <signal.h>
20982 #$i_stdlib I_STDLIB
20984 #include <stdlib.h>
20989 /* Strange style to avoid deeply-nested #if/#else/#endif */
20992 # define NSIG (_NSIG)
20998 # define NSIG (SIGMAX+1)
21004 # define NSIG (SIG_MAX+1)
21010 # define NSIG (_SIG_MAX+1)
21016 # define NSIG (MAXSIG+1)
21022 # define NSIG (MAX_SIG+1)
21027 # ifdef SIGARRAYSIZE
21028 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21034 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21038 /* Default to some arbitrary number that's big enough to get most
21039 of the common signals.
21045 printf("NSIG %d\n", NSIG);
21051 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21053 printf "#ifdef SIG"; printf $1; printf "\n"
21054 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21055 printf $1; printf ");\n"
21059 printf "#endif /* JUST_NSIG */\n";
21060 printf "exit(0);\n}\n";
21063 $cat >signal.awk <<'EOP'
21064 BEGIN { ndups = 0 }
21065 $1 ~ /^NSIG$/ { nsig = $2 }
21066 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21067 if ($2 > maxsig) { maxsig = $2 }
21068 if (sig_name[$2]) {
21069 dup_name[ndups] = $1
21070 dup_num[ndups] = $2
21082 printf("NSIG %d\n", nsig);
21083 for (n = 1; n < nsig; n++) {
21085 printf("%s %d\n", sig_name[n], sig_num[n])
21088 printf("NUM%d %d\n", n, n)
21091 for (n = 0; n < ndups; n++) {
21092 printf("%s %d\n", dup_name[n], dup_num[n])
21096 $cat >signal_cmd <<EOS
21098 if $test -s signal.lst; then
21099 echo "Using your existing signal.lst file"
21104 $cat >>signal_cmd <<'EOS'
21107 if eval $compile_ok; then
21108 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21109 $uniq | $awk -f signal.awk >signal.lst
21111 echo "(I can't seem be able to compile the whole test program)" >&4
21112 echo "(I'll try it in little pieces.)" >&4
21113 set signal -DJUST_NSIG
21114 if eval $compile_ok; then
21115 $run ./signal$_exe > signal.nsg
21118 echo "I can't seem to figure out how many signals you have." >&4
21119 echo "Guessing 50." >&4
21120 echo 'NSIG 50' > signal.nsg
21122 : Now look at all the signal names, one at a time.
21123 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21124 $cat > signal.c <<EOCP
21125 #include <sys/types.h>
21126 #include <signal.h>
21129 printf("$xx %d\n", SIG${xx});
21134 if eval $compile; then
21135 echo "SIG${xx} found."
21136 $run ./signal$_exe >> signal.ls1
21138 echo "SIG${xx} NOT found."
21141 if $test -s signal.ls1; then
21142 $cat signal.nsg signal.ls1 |
21143 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21147 if $test -s signal.lst; then
21150 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21151 echo 'kill -l' >signal
21152 set X `csh -f <signal`
21156 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21158 echo $@ | $tr ' ' $trnl | \
21159 $awk '{ printf "%s %d\n", $1, ++s; }
21160 END { printf "NSIG %d\n", ++s }' >signal.lst
21162 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21164 chmod a+x signal_cmd
21165 $eunicefix signal_cmd
21167 : generate list of signal names
21169 case "$sig_name_init" in
21171 *) case "$sig_num_init" in
21172 ''|*,*) doinit=yes ;;
21177 echo "Generating a list of signal names and numbers..." >&4
21179 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21180 sig_name=`$awk 'BEGIN { printf "ZERO " }
21181 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21182 sig_num=`$awk 'BEGIN { printf "0 " }
21183 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21184 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21185 !/^NSIG/ { printf "\"%s\", ", $1 }
21186 END { printf "0\n" }' signal.lst`
21187 sig_num_init=`$awk 'BEGIN { printf "0, " }
21188 !/^NSIG/ { printf "%d, ", $2}
21189 END { printf "0\n"}' signal.lst`
21192 echo "The following $sig_count signals are available:"
21194 echo $sig_name | $awk \
21195 'BEGIN { linelen = 0 }
21197 for (i = 1; i <= NF; i++) {
21198 name = "SIG" $i " "
21199 linelen = linelen + length(name)
21200 if (linelen > 70) {
21202 linelen = length(name)
21208 sig_size=`echo $sig_name | awk '{print NF}'`
21209 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21211 : Check size of size
21213 case "$sizetype" in
21214 *_t) zzz="$sizetype" ;;
21215 *) zzz="filesize" ;;
21217 echo "Checking the size of $zzz..." >&4
21219 #include <sys/types.h>
21221 #$i_stdlib I_STDLIB
21223 #include <stdlib.h>
21226 printf("%d\n", (int)sizeof($sizetype));
21231 if eval $compile_ok; then
21235 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21238 echo "Your $zzz size is $sizesize bytes."
21243 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21247 : check for socklen_t
21249 echo "Checking to see if you have socklen_t..." >&4
21251 #include <sys/types.h>
21252 #$d_socket HAS_SOCKET
21254 #include <sys/socket.h>
21256 int main() { socklen_t x = 16; }
21259 if eval $compile; then
21261 echo "You have socklen_t."
21264 echo "You do not have socklen_t."
21265 case "$sizetype" in
21266 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21273 : see if this is a socks.h system
21274 set socks.h i_socks
21277 : check for type of the size argument to socket calls
21278 case "$d_socket" in
21282 Checking to see what type is the last argument of accept().
21285 case "$d_socklen_t" in
21286 "$define") yyy="$yyy socklen_t"
21288 yyy="$yyy $sizetype int long unsigned"
21289 for xxx in $yyy; do
21290 case "$socksizetype" in
21291 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21292 case "$usesocks" in
21294 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21295 echo "Your system accepts '$xxx *' for the last argument of accept()."
21296 socksizetype="$xxx"
21299 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21300 echo "Your system accepts '$xxx *' for the last argument of accept()."
21301 socksizetype="$xxx"
21308 : In case none of those worked, prompt the user.
21309 case "$socksizetype" in
21310 '') rp='What is the type for socket address structure sizes?'
21317 *) : no sockets, so pick relatively harmless default
21322 : see what type is used for signed size_t
21323 set ssize_t ssizetype int stdio.h sys/types.h
21328 #$i_stdlib I_STDLIB
21330 #include <stdlib.h>
21332 #include <sys/types.h>
21333 #define Size_t $sizetype
21334 #define SSize_t $dflt
21337 if (sizeof(Size_t) == sizeof(SSize_t))
21339 else if (sizeof(Size_t) == sizeof(int))
21348 if eval $compile_ok && $run ./try > /dev/null; then
21349 ssizetype=`$run ./try`
21350 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21353 Help! I can't compile and run the ssize_t test program: please enlighten me!
21354 (This is probably a misconfiguration in your system or libraries, and
21355 you really ought to fix it. Still, I'll try anyway.)
21357 I need a type that is the same size as $sizetype, but is guaranteed to
21358 be signed. Common values are ssize_t, int and long.
21361 rp="What signed type is the same size as $sizetype?"
21367 : Check the size of st_ino
21369 $echo "Checking the size of st_ino..." >&4
21370 $cat > try.c <<EOCP
21371 #include <sys/stat.h>
21373 #$i_stdlib I_STDLIB
21375 #include <stdlib.h>
21379 printf("%d\n", (int)sizeof(st.st_ino));
21384 if eval $compile_ok; then
21388 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21390 *) st_ino_size=$val
21391 $echo "Your st_ino is $st_ino_size bytes long."
21396 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21400 : Check if st_ino is signed
21402 $echo "Checking the sign of st_ino..." >&4
21403 $cat > try.c <<EOCP
21404 #include <sys/stat.h>
21409 if (foo.st_ino < 0)
21416 if eval $compile; then
21420 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21422 *) st_ino_sign=$val
21423 case "$st_ino_sign" in
21424 1) $echo "Your st_ino is unsigned." ;;
21425 -1) $echo "Your st_ino is signed." ;;
21431 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21435 : see what type of char stdio uses.
21437 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21438 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21439 echo "Your stdio uses unsigned chars." >&4
21440 stdchar="unsigned char"
21442 echo "Your stdio uses signed chars." >&4
21447 : see what type uids are declared as in the kernel
21449 echo "Looking for the type for user ids returned by getuid()."
21450 set uid_t uidtype xxx stdio.h sys/types.h
21454 xxx=`./findhdr sys/user.h`
21455 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21457 unsigned) dflt="$1 $2" ;;
21461 *) dflt="$uidtype";;
21464 uid_t) echo "uid_t found." ;;
21465 *) rp="What is the type for user ids returned by getuid()?"
21471 : Check size of UID
21474 *_t) zzz="$uidtype" ;;
21477 echo "Checking the size of $zzz..." >&4
21479 #include <sys/types.h>
21481 #$i_stdlib I_STDLIB
21483 #include <stdlib.h>
21486 printf("%d\n", (int)sizeof($uidtype));
21491 if eval $compile_ok; then
21495 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21498 echo "Your $zzz is $uidsize bytes long."
21503 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21506 : Check if UID is signed
21509 *_t) zzz="$uidtype" ;;
21512 echo "Checking the sign of $zzz..." >&4
21514 #include <sys/types.h>
21525 if eval $compile; then
21529 echo "(I can't execute the test program--guessing unsigned.)" >&4
21533 1) echo "Your $zzz is unsigned." ;;
21534 -1) echo "Your $zzz is signed." ;;
21540 echo "(I can't compile the test program--guessing unsigned.)" >&4
21544 : Check format string for UID
21546 $echo "Checking the format string to be used for uids..." >&4
21549 -1) if $test X"$uidsize" = X"$ivsize"; then
21550 uidformat="$ivdformat"
21552 if $test X"$uidsize" = X"$longsize"; then
21555 if $test X"$uidsize" = X"$intsize"; then
21558 if $test X"$uidsize" = X"$shortsize"; then
21565 *) if $test X"$uidsize" = X"$uvsize"; then
21566 uidformat="$uvuformat"
21568 if $test X"$uidsize" = X"$longsize"; then
21571 if $test X"$uidsize" = X"$intsize"; then
21574 if $test X"$uidsize" = X"$shortsize"; then
21583 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21585 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21586 $cat >try.c <<'EOM'
21587 /* Intentionally a long probe as I'd like to sanity check that the exact
21588 approach is going to work, as thinking it will work, but only having it
21589 part working at runtime is worse than not having it. */
21591 #include <sys/types.h>
21592 #include <sys/sysctl.h>
21593 #include <sys/param.h>
21595 #include <string.h>
21596 #include <stdlib.h>
21597 #include <unistd.h>
21600 main(int argc, char **argv) {
21602 char *argv_leaf = strrchr(argv[0], '/');
21608 mib[1] = KERN_PROC;
21609 mib[2] = KERN_PROC_PATHNAME;
21613 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21617 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21622 if (size < strlen(argv_leaf) + 1) {
21623 fprintf(stderr, "size %lu is too short for a path\n",
21624 (unsigned long) size);
21628 if (size > MAXPATHLEN * MAXPATHLEN) {
21629 fprintf(stderr, "size %lu is too long for a path\n",
21630 (unsigned long) size);
21634 buffer = malloc(size);
21640 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21645 if (strlen(buffer) + 1 != size) {
21646 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21647 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21652 if (*buffer != '/') {
21653 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21657 if (strstr(buffer, "/./")) {
21658 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21662 if (strstr(buffer, "/../")) {
21663 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21667 buffer_leaf = strrchr(buffer, '/');
21668 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21669 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21681 if eval $compile; then
21682 if $run ./try; then
21683 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21686 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21690 echo "I'm unable to compile the test program." >&4
21691 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21695 set usekernprocpathname
21698 : Determine if we can use _NSGetExecutablePath to find executing program
21700 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21701 $cat >try.c <<'EOM'
21702 /* Intentionally a long probe as I'd like to sanity check that the exact
21703 approach is going to work, as thinking it will work, but only having it
21704 part working at runtime is worse than not having it. */
21705 #include <mach-o/dyld.h>
21707 #include <stdlib.h>
21708 #include <sys/param.h>
21709 #include <string.h>
21712 main(int argc, char **argv) {
21714 uint32_t size = sizeof(buf);
21718 char *argv_leaf = strrchr(argv[0], '/');
21722 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21726 _NSGetExecutablePath(buf, &size);
21727 if (size > MAXPATHLEN * MAXPATHLEN) {
21728 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21729 (unsigned int) size);
21733 buffer = malloc(size);
21739 result = _NSGetExecutablePath(buffer, &size);
21741 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21742 result, (unsigned int) size);
21746 tidied = realpath(buffer, NULL);
21748 perror("realpath");
21754 if (*tidied != '/') {
21755 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21759 if (strstr(tidied, "/./")) {
21760 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21764 if (strstr(tidied, "/../")) {
21765 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21769 tidied_leaf = strrchr(tidied, '/');
21770 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21771 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21783 if eval $compile; then
21784 if $run ./try; then
21785 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21788 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21791 echo "I'm unable to compile the test program." >&4
21792 echo "I'll assume no _NSGetExecutablePath here." >&4
21795 set usensgetexecutablepath
21798 : Check if site customization support was requested
21799 case "$usesitecustomize" in
21800 $define|true|[Yy]*)
21801 usesitecustomize="$define"
21804 usesitecustomize="$undef"
21808 : see if prototypes support variable argument declarations
21810 case "$prototype$i_stdarg" in
21812 echo "It appears we'll be able to prototype varargs functions." >&4
21816 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21823 : determine compiler compiler
21832 if $test -f "$byacc$_exe"; then
21834 comp="byacc or $comp"
21836 if $test -f "$bison$_exe"; then
21837 comp="$comp or bison -y"
21839 rp="Which compiler compiler ($comp) shall I use?"
21848 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21854 : see if this is a assert.h system
21855 set assert.h i_assert
21858 : see if this is a fp.h system
21862 : see if this is a fp_class.h system
21863 set fp_class.h i_fp_class
21866 : see if gdbm.h is available
21871 : see if gdbm_open exists
21872 set gdbm_open d_gdbm_open
21874 case "$d_gdbm_open" in
21877 echo "We won't be including <gdbm.h>"
21886 : see if this is a ieeefp.h system
21887 case "$i_ieeefp" in
21888 '' ) set ieeefp.h i_ieeefp
21893 : see if this is a libutil.h system
21894 set libutil.h i_libutil
21897 : see if mach cthreads are available
21898 if test "X$usethreads" = "X$define"; then
21899 set mach/cthreads.h i_machcthr
21902 i_machcthr="$undef"
21905 : see if this is a mntent.h system
21906 set mntent.h i_mntent
21909 : see if net/errno.h is available
21911 set net/errno.h val
21914 : Unfortunately, it causes problems on some systems. Arrgh.
21917 cat > try.c <<'EOM'
21920 #include <net/errno.h>
21926 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21927 echo "We'll be including <net/errno.h>." >&4
21929 echo "We won't be including <net/errno.h>." >&4
21938 : see if netinet/tcp.h is available
21939 set netinet/tcp.h i_netinettcp
21942 : see if this is a poll.h system
21946 : see if this is a prot.h system
21950 : Preprocessor symbols
21952 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21953 $cat <<'EOSH' > Cppsym.know
21954 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21955 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21956 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21957 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21958 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21959 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21960 bull c cadmus clipper CMU COFF COMPILER_VERSION
21961 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21962 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21963 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21964 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21966 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21967 H3050R H3050RX hbullx20 hcx host_mips
21968 hp200 hp300 hp700 HP700 hp800 hp9000
21969 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21970 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21971 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21972 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21973 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21974 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21975 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21976 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21977 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21978 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21979 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21980 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21981 MATH_HAS_NO_SIDE_EFFECTS
21982 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21983 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21984 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21985 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21986 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21987 NetBSD news1500 news1700 news1800 news1900 news3700
21988 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21989 ns32016 ns32332 ns32k nsc32000
21990 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21991 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21992 pc532 pdp11 PGC PIC plexus PORTAR posix
21993 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21994 POSIX_C_SOURCE POSIX_SOURCE POWER
21995 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21996 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21997 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21998 sony sony_news sonyrisc sparc sparclite spectrum
21999 stardent stdc STDC_EXT stratos sun sun3 sun386
22000 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
22001 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
22002 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
22003 sysV68 sysV88 Tek4132 Tek4300 titan
22004 TM3200 TM5400 TM5600
22005 tower tower32 tower32_200 tower32_600 tower32_700
22006 tower32_800 tower32_850 tss
22007 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22008 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22009 unix UNIX95 UNIX99 unixpc unos
22010 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22011 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22012 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22014 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22015 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22016 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22019 # Maybe put other stuff here too.
22020 cat <<EOSH >>Cppsym.know
22023 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22024 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22025 $cat Cppsym.know > Cppsym.c
22026 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22027 $rm -f Cppsym.a Cppsym.b Cppsym.c
22028 cat <<EOSH > Cppsym
22030 if $test \$# -gt 0; then
22031 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22032 if $test -s Cppsym.got; then
22039 $tr " " "$trnl" | ./Cppsym.try
22045 cat <<EOSH > Cppsym.try
22047 cat <<'EOCP' > try.c
22050 #define STRINGIFY(a) "a"
22052 #if cpp_stuff == 42
22053 #define StGiFy(a) #a
22054 #define STRINGIFY(a) StGiFy(a)
22056 #if $cpp_stuff != 1 && $cpp_stuff != 42
22057 # include "Bletch: How does this C preprocessor stringify macros?"
22063 cat <<'EOSH' >> Cppsym.try
22065 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22066 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22067 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22068 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22070 echo 'return 0;}' >> try.c
22072 cat <<EOSH >> Cppsym.try
22074 case "$osname-$gccversion" in
22075 irix-) ccflags="\$ccflags -woff 1178" ;;
22076 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22078 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22080 chmod +x Cppsym.try
22081 $eunicefix Cppsym.try
22082 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22083 : Add in any Linux cpp "predefined macros":
22084 case "$osname::$gccversion" in
22085 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22087 rm -f $tHdrH'.h' $tHdrH
22089 # Filter out macro arguments, such as Linux's __INT8_C(c)
22090 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22091 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22092 if [ -s $tHdrH'_cppsym.real' ]; then
22093 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22096 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22099 : now check the C compiler for additional symbols
22100 postprocess_cc_v=''
22102 aix) postprocess_cc_v="|$tr , ' '" ;;
22109 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22112 -D*) echo "\$i" | $sed 's/^-D//';;
22113 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22118 postprocess_cc_v=''
22121 ./ccsym > ccsym1.raw
22122 if $test -s ccsym1.raw; then
22123 $sort ccsym1.raw | $uniq >ccsym.raw
22125 mv ccsym1.raw ccsym.raw
22128 $awk '/\=/ { print $0; next }
22129 { print $0"=1" }' ccsym.raw >ccsym.list
22130 $comm -13 Cppsym.true ccsym.list >ccsym.own
22131 $comm -12 Cppsym.true ccsym.list >ccsym.com
22132 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22134 if $test -z ccsym.raw; then
22135 echo "Your C compiler doesn't seem to define any symbols!" >&4
22137 echo "However, your C preprocessor defines the following symbols:"
22140 cppsymbols=`$cat Cppsym.true`
22141 cppsymbols=`echo $cppsymbols`
22142 cppccsymbols="$cppsymbols"
22144 if $test -s ccsym.com; then
22145 echo "Your C compiler and pre-processor define these symbols:"
22146 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22149 cppccsymbols=`$cat ccsym.com`
22150 cppccsymbols=`echo $cppccsymbols`
22151 $test "$silent" || sleep 1
22153 if $test -s ccsym.cpp; then
22154 $test "$also" && echo " "
22155 echo "Your C pre-processor ${also}defines the following symbols:"
22156 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22158 cppsymbols=`$cat ccsym.cpp`
22159 cppsymbols=`echo $cppsymbols`
22160 $test "$silent" || sleep 1
22162 if $test -s ccsym.own; then
22163 $test "$also" && echo " "
22164 echo "Your C compiler ${also}defines the following cpp symbols:"
22165 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22166 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22167 ccsymbols=`$cat ccsym.own`
22168 ccsymbols=`echo $ccsymbols`
22169 $test "$silent" || sleep 1
22173 : see if this is a termio system
22177 if $test `./findhdr termios.h`; then
22178 set tcsetattr i_termios
22184 "$define") echo "You have POSIX termios.h... good!" >&4;;
22185 *) if ./Cppsym pyr; then
22186 case "`$run /bin/universe`" in
22187 ucb) if $test `./findhdr sgtty.h`; then
22189 echo "<sgtty.h> found." >&4
22191 echo "System is pyramid with BSD universe."
22192 ./warn "<sgtty.h> not found--you could have problems."
22194 *) if $test `./findhdr termio.h`; then
22196 echo "<termio.h> found." >&4
22198 echo "System is pyramid with USG universe."
22199 ./warn "<termio.h> not found--you could have problems."
22203 if $test `./findhdr termio.h`; then
22204 echo "<termio.h> found." >&4
22206 elif $test `./findhdr sgtty.h`; then
22207 echo "<sgtty.h> found." >&4
22210 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22213 if $test `./findhdr sgtty.h`; then
22214 echo "<sgtty.h> found." >&4
22216 elif $test `./findhdr termio.h`; then
22217 echo "<termio.h> found." >&4
22220 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22224 set i_termio; eval $setvar
22225 val=$val2; set i_sgtty; eval $setvar
22226 val=$val3; set i_termios; eval $setvar
22228 : see if stdbool is available
22229 : we want a real compile instead of Inhdr because some Solaris systems
22230 : have stdbool.h, but it can only be used if the compiler indicates it
22231 : is sufficiently c99-compliant.
22235 #include <stdbool.h>
22240 int main(int argc, char **argv)
22246 if eval $compile; then
22247 echo "<stdbool.h> found." >&4
22250 echo "<stdbool.h> NOT found." >&4
22257 : see if stddef is available
22258 set stddef.h i_stddef
22261 : see if sys/access.h is available
22262 set sys/access.h i_sysaccess
22265 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22266 set sys/filio.h i_sysfilio
22269 if $test `./findhdr sys/ioctl.h`; then
22271 echo '<sys/ioctl.h> found.' >&4
22274 if $test $i_sysfilio = "$define"; then
22275 echo '<sys/ioctl.h> NOT found.' >&4
22277 $test $i_sgtty = "$define" && xxx="sgtty.h"
22278 $test $i_termio = "$define" && xxx="termio.h"
22279 $test $i_termios = "$define" && xxx="termios.h"
22280 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22286 : see if socket ioctl defs are in sys/sockio.h
22288 xxx=`./findhdr sys/sockio.h`
22289 if $test "$xxx"; then
22290 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22292 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22295 echo "No socket ioctls found in <sys/sockio.h>." >&4
22300 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22306 : see if this is a syslog.h system
22307 set syslog.h i_syslog
22310 : see if this is a sys/mode.h system
22311 set sys/mode.h i_sysmode
22314 : see if there is a sys/poll.h file
22315 set sys/poll.h i_syspoll
22318 : see if sys/resource.h has to be included
22319 set sys/resource.h i_sysresrc
22322 : see if sys/security.h is available
22323 set sys/security.h i_syssecrt
22326 : see if this is a sys/statvfs.h system
22327 set sys/statvfs.h i_sysstatvfs
22330 : see if this is a sys/un.h system
22331 set sys/un.h i_sysun
22334 : see if this is a sys/utsname.h system
22335 set sys/utsname.h i_sysutsname
22338 : see if this is a syswait system
22339 set sys/wait.h i_syswait
22342 : see if this is a ustat.h system
22343 set ustat.h i_ustat
22346 : see if this is an utime system
22347 set utime.h i_utime
22350 : see if this is a vfork system
22353 set vfork.h i_vfork
22363 echo "Looking for extensions..." >&4
22364 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22365 : contain old or inaccurate or duplicate values.
22366 nonxs_extensions=''
22368 : We do not use find because it might not be available.
22369 : We do not just use MANIFEST because the user may have dropped
22370 : some additional extensions into the source tree and expect them
22373 : Function to recursively find available extensions, ignoring DynaLoader
22374 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22375 : In 5.10.1 and later, extensions are stored in directories
22376 : like File-Glob instead of the older File/Glob/.
22380 DynaLoader|dynaload) ;;
22382 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22383 case "$this_ext" in
22384 Scalar/List/Utils) this_ext="List/Util" ;;
22385 PathTools) this_ext="Cwd" ;;
22387 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22388 if $contains " $this_ext " $$.tmp; then
22390 echo "Duplicate directories detected for extension $xxx" >&4;
22391 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22392 case "$knowitall" in
22400 echo "Ok. Stopping Configure." >&4;
22401 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22404 echo "Ok. You will need to correct config.sh before running make." >&4;
22406 $ls -1 $xxx > $$.tmp;
22407 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22408 xs_extensions="$xs_extensions $this_ext";
22409 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22410 xs_extensions="$xs_extensions $this_ext";
22411 elif $test -d $xxx; then
22412 nonxs_extensions="$nonxs_extensions $this_ext";
22422 eval $find_extensions
22426 eval $find_extensions
22430 eval $find_extensions
22431 set X $xs_extensions
22433 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22434 set X $nonxs_extensions
22436 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22438 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22440 : Now see which are supported on this system.
22442 for xxx in $xs_extensions ; do
22446 $define) avail_ext="$avail_ext $xxx" ;;
22449 GDBM_File|gdbm_fil)
22451 $define) avail_ext="$avail_ext $xxx" ;;
22454 I18N/Langinfo|i18n_lan)
22455 case "$i_langinfo$d_nl_langinfo" in
22456 $define$define) avail_ext="$avail_ext $xxx" ;;
22460 : XXX Do we need a useipcsysv variable here
22461 case "${d_msg}${d_sem}${d_shm}" in
22462 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22465 NDBM_File|ndbm_fil)
22468 case "$osname-$use64bitint" in
22471 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22474 *) avail_ext="$avail_ext $xxx" ;;
22479 ODBM_File|odbm_fil)
22480 case "${i_dbm}${i_rpcsvcdbm}" in
22482 case "$d_cplusplus" in
22483 define) ;; # delete as a function name will not work
22484 *) case "$osname-$use64bitint" in
22487 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22490 *) avail_ext="$avail_ext $xxx" ;;
22498 case "$useopcode" in
22499 true|define|y) avail_ext="$avail_ext $xxx" ;;
22503 case "$useposix" in
22504 true|define|y) avail_ext="$avail_ext $xxx" ;;
22508 case "$d_socket" in
22509 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22512 Sys/Syslog|sys/syslog)
22513 : XXX syslog requires socket
22514 case "$d_socket" in
22515 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22519 case "$usethreads" in
22521 case "$use5005threads" in
22522 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22526 threads|threads/shared)
22527 # threads and threads::shared are special cases.
22528 # To stop people from asking "Perl 5.8.0 was supposed
22529 # to have this new fancy threads implementation but my
22530 # perl doesn't have it" and from people trying to
22531 # (re)install the threads module using CPAN.pm and
22532 # CPAN.pm then offering to reinstall Perl 5.8.0,
22533 # the threads.pm and threads/shared.pm will always be
22534 # there, croaking informatively ("you need to rebuild
22535 # all of Perl with threads, sorry") when threads haven't
22536 # been compiled in.
22538 avail_ext="$avail_ext $xxx"
22544 cygwin) avail_ext="$avail_ext $xxx" ;;
22547 XS/APItest|xs/apitest)
22548 # This is just for testing. Skip it unless we have dynamic loading.
22551 $define) avail_ext="$avail_ext $xxx" ;;
22554 XS/Typemap|xs/typemap)
22555 # This is just for testing. Skip it unless we have dynamic loading.
22557 $define) avail_ext="$avail_ext $xxx" ;;
22560 *) avail_ext="$avail_ext $xxx"
22569 case "$onlyextensions" in
22571 *) keepextensions=''
22572 echo "You have requested that only certain extensions be included..." >&4
22573 for i in $onlyextensions; do
22574 case " $avail_ext " in
22576 echo "Keeping extension $i."
22577 keepextensions="$keepextensions $i"
22579 *) echo "Ignoring extension $i." ;;
22582 avail_ext="$keepextensions"
22586 case "$noextensions" in
22588 *) keepextensions=''
22589 echo "You have requested that certain extensions be ignored..." >&4
22590 for i in $avail_ext; do
22591 case " $noextensions " in
22592 *" $i "*) echo "Ignoring extension $i." ;;
22593 *) echo "Keeping extension $i.";
22594 keepextensions="$keepextensions $i"
22598 avail_ext="$keepextensions"
22602 : Now see which nonxs extensions are supported on this system.
22603 : For now assume all are.
22605 for xxx in $nonxs_extensions ; do
22609 *) nonxs_ext="$nonxs_ext $xxx"
22621 A number of extensions are supplied with $package. You may choose to
22622 compile these extensions for dynamic loading (the default), compile
22623 them into the $package executable (static loading), or not include
22624 them at all. Answer "none" to include no extensions.
22625 Note that DynaLoader is always built and need not be mentioned here.
22628 case "$dynamic_ext" in
22630 : Exclude those listed in static_ext
22632 for xxx in $avail_ext; do
22633 case " $static_ext " in
22635 *) dflt="$dflt $xxx" ;;
22642 *) dflt="$dynamic_ext"
22643 # Perhaps we are reusing an old out-of-date config.sh.
22646 if test X"$dynamic_ext" != X"$avail_ext"; then
22648 NOTICE: Your previous config.sh list may be incorrect.
22649 The extensions now available to you are
22651 but the default list from your previous config.sh is
22663 rp="What extensions do you wish to load dynamically?"
22666 none) dynamic_ext=' ' ;;
22667 *) dynamic_ext="$ans" ;;
22670 case "$static_ext" in
22672 : Exclude those already listed in dynamic linking
22674 for xxx in $avail_ext; do
22675 case " $dynamic_ext " in
22677 *) dflt="$dflt $xxx" ;;
22684 *) dflt="$static_ext"
22691 rp="What extensions do you wish to load statically?"
22694 none) static_ext=' ' ;;
22695 *) static_ext="$ans" ;;
22700 A number of extensions are supplied with $package. Answer "none"
22701 to include no extensions.
22702 Note that DynaLoader is always built and need not be mentioned here.
22705 case "$static_ext" in
22706 '') dflt="$avail_ext" ;;
22707 *) dflt="$static_ext"
22708 # Perhaps we are reusing an old out-of-date config.sh.
22711 if test X"$static_ext" != X"$avail_ext"; then
22713 NOTICE: Your previous config.sh list may be incorrect.
22714 The extensions now available to you are
22716 but the default list from your previous config.sh is
22725 : Exclude those that are not xs extensions
22729 rp="What extensions do you wish to include?"
22732 none) static_ext=' ' ;;
22733 *) static_ext="$ans" ;;
22738 # Encode is a special case. If we are building Encode as a static
22739 # extension, we need to explicitly list its subextensions as well.
22740 # For other nested extensions, this is handled automatically by
22741 # the appropriate Makefile.PL.
22742 case " $static_ext " in
22743 *" Encode "*) # Add the subextensions of Encode
22745 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22746 static_ext="$static_ext Encode/$xxx"
22747 known_extensions="$known_extensions Encode/$xxx"
22753 set X $dynamic_ext $static_ext $nonxs_ext
22757 # Sanity check: We require an extension suitable for use with
22758 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22759 # should show up as failures in the test suite, but it's helpful to
22760 # catch them now.) The 'extensions' list is normally sorted
22761 # alphabetically, so we need to accept either
22762 # DB_File ... Fcntl ... IO ....
22763 # or something like
22764 # Fcntl ... NDBM_File ... IO ....
22765 case " $extensions" in
22766 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22767 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22768 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22769 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22770 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22774 : Remove libraries needed only for extensions
22775 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22776 : The exception is SunOS 4.x, which needs them.
22777 case "${osname}X${osvers}" in
22781 *) case "$usedl" in
22782 $define|true|[yY]*)
22783 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22787 *) perllibs="$libs"
22793 : Remove build directory name from cppstdin so it can be used from
22794 : either the present location or the final installed location.
22796 : Get out of the UU directory to get correct path name.
22798 case "$cppstdin" in
22800 echo "Stripping down cppstdin path name"
22806 : end of configuration questions
22808 echo "End of configuration questions."
22811 : back to where it started
22812 if test -d ../UU; then
22816 : configuration may be unconditionally patched via a 'config.arch' file
22817 if $test -f config.arch; then
22818 echo "I see a config.arch file, loading it." >&4
22822 : configuration may be patched via a 'config.over' file
22823 if $test -f config.over; then
22826 rp='I see a config.over file. Do you wish to load it?'
22829 n*) echo "OK, I'll ignore it.";;
22831 echo "Configuration override changes have been loaded."
22836 : in case they want portability, strip down executable paths
22837 case "$d_portable" in
22840 echo "Stripping down executable paths..." >&4
22841 for file in $loclist $trylist; do
22843 eval $file=`basename $temp`
22848 : create config.sh file
22850 echo "Creating config.sh..." >&4
22851 $spitshell <<EOT >config.sh
22854 # This file was produced by running the Configure script. It holds all the
22855 # definitions figured out by Configure. Should you modify one of these values,
22856 # do not forget to propagate your changes by running "Configure -der". You may
22857 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22860 # Package name : $package
22861 # Source directory : $src
22862 # Configuration time: $cf_time
22863 # Configured by : $cf_by
22864 # Target system : $myuname
22867 : Add in command line options if available
22868 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22870 $spitshell <<EOT >>config.sh
22879 Revision='$Revision'
22887 alignbytes='$alignbytes'
22888 ansi2knr='$ansi2knr'
22889 aphostname='$aphostname'
22890 api_revision='$api_revision'
22891 api_subversion='$api_subversion'
22892 api_version='$api_version'
22893 api_versionstring='$api_versionstring'
22896 archlibexp='$archlibexp'
22897 archname64='$archname64'
22898 archname='$archname'
22899 archobjs='$archobjs'
22900 asctime_r_proto='$asctime_r_proto'
22908 bootstrap_charset='$bootstrap_charset'
22910 byteorder='$byteorder'
22912 castflags='$castflags'
22915 cccdlflags='$cccdlflags'
22916 ccdlflags='$ccdlflags'
22918 ccflags_uselargefiles='$ccflags_uselargefiles'
22920 ccsymbols='$ccsymbols'
22921 ccversion='$ccversion'
22923 cf_email='$cf_email'
22925 charbits='$charbits'
22926 charsize='$charsize'
22930 clocktype='$clocktype'
22932 compress='$compress'
22933 contains='$contains'
22937 cpp_stuff='$cpp_stuff'
22938 cppccsymbols='$cppccsymbols'
22939 cppflags='$cppflags'
22941 cppminus='$cppminus'
22943 cppstdin='$cppstdin'
22944 cppsymbols='$cppsymbols'
22945 crypt_r_proto='$crypt_r_proto'
22946 cryptlib='$cryptlib'
22948 ctermid_r_proto='$ctermid_r_proto'
22949 ctime_r_proto='$ctime_r_proto'
22950 d_Gconvert='$d_Gconvert'
22951 d_PRIEUldbl='$d_PRIEUldbl'
22952 d_PRIFUldbl='$d_PRIFUldbl'
22953 d_PRIGUldbl='$d_PRIGUldbl'
22954 d_PRIXU64='$d_PRIXU64'
22955 d_PRId64='$d_PRId64'
22956 d_PRIeldbl='$d_PRIeldbl'
22957 d_PRIfldbl='$d_PRIfldbl'
22958 d_PRIgldbl='$d_PRIgldbl'
22959 d_PRIi64='$d_PRIi64'
22960 d_PRIo64='$d_PRIo64'
22961 d_PRIu64='$d_PRIu64'
22962 d_PRIx64='$d_PRIx64'
22963 d_SCNfldbl='$d_SCNfldbl'
22964 d__fwalk='$d__fwalk'
22965 d_access='$d_access'
22966 d_accessx='$d_accessx'
22969 d_archlib='$d_archlib'
22970 d_asctime64='$d_asctime64'
22971 d_asctime_r='$d_asctime_r'
22974 d_attribute_deprecated='$d_attribute_deprecated'
22975 d_attribute_format='$d_attribute_format'
22976 d_attribute_malloc='$d_attribute_malloc'
22977 d_attribute_nonnull='$d_attribute_nonnull'
22978 d_attribute_noreturn='$d_attribute_noreturn'
22979 d_attribute_pure='$d_attribute_pure'
22980 d_attribute_unused='$d_attribute_unused'
22981 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22985 d_bsdgetpgrp='$d_bsdgetpgrp'
22986 d_bsdsetpgrp='$d_bsdsetpgrp'
22987 d_builtin_choose_expr='$d_builtin_choose_expr'
22988 d_builtin_expect='$d_builtin_expect'
22990 d_c99_variadic_macros='$d_c99_variadic_macros'
22991 d_casti32='$d_casti32'
22992 d_castneg='$d_castneg'
22993 d_charvspr='$d_charvspr'
22995 d_chroot='$d_chroot'
22996 d_chsize='$d_chsize'
22998 d_clearenv='$d_clearenv'
22999 d_closedir='$d_closedir'
23000 d_cmsghdr_s='$d_cmsghdr_s'
23002 d_copysignl='$d_copysignl'
23003 d_cplusplus='$d_cplusplus'
23005 d_crypt_r='$d_crypt_r'
23007 d_ctermid='$d_ctermid'
23008 d_ctermid_r='$d_ctermid_r'
23009 d_ctime64='$d_ctime64'
23010 d_ctime_r='$d_ctime_r'
23011 d_cuserid='$d_cuserid'
23012 d_dbl_dig='$d_dbl_dig'
23013 d_dbminitproto='$d_dbminitproto'
23014 d_difftime64='$d_difftime64'
23015 d_difftime='$d_difftime'
23016 d_dir_dd_fd='$d_dir_dd_fd'
23018 d_dirnamlen='$d_dirnamlen'
23019 d_dlerror='$d_dlerror'
23020 d_dlopen='$d_dlopen'
23021 d_dlsymun='$d_dlsymun'
23022 d_dosuid='$d_dosuid'
23023 d_drand48_r='$d_drand48_r'
23024 d_drand48proto='$d_drand48proto'
23026 d_eaccess='$d_eaccess'
23027 d_endgrent='$d_endgrent'
23028 d_endgrent_r='$d_endgrent_r'
23029 d_endhent='$d_endhent'
23030 d_endhostent_r='$d_endhostent_r'
23031 d_endnent='$d_endnent'
23032 d_endnetent_r='$d_endnetent_r'
23033 d_endpent='$d_endpent'
23034 d_endprotoent_r='$d_endprotoent_r'
23035 d_endpwent='$d_endpwent'
23036 d_endpwent_r='$d_endpwent_r'
23037 d_endsent='$d_endsent'
23038 d_endservent_r='$d_endservent_r'
23039 d_eofnblk='$d_eofnblk'
23040 d_eunice='$d_eunice'
23041 d_faststdio='$d_faststdio'
23042 d_fchdir='$d_fchdir'
23043 d_fchmod='$d_fchmod'
23044 d_fchown='$d_fchown'
23046 d_fcntl_can_lock='$d_fcntl_can_lock'
23047 d_fd_macros='$d_fd_macros'
23048 d_fd_set='$d_fd_set'
23049 d_fds_bits='$d_fds_bits'
23050 d_fgetpos='$d_fgetpos'
23051 d_finite='$d_finite'
23052 d_finitel='$d_finitel'
23053 d_flexfnam='$d_flexfnam'
23055 d_flockproto='$d_flockproto'
23057 d_fp_class='$d_fp_class'
23058 d_fpathconf='$d_fpathconf'
23059 d_fpclass='$d_fpclass'
23060 d_fpclassify='$d_fpclassify'
23061 d_fpclassl='$d_fpclassl'
23062 d_fpos64_t='$d_fpos64_t'
23063 d_frexpl='$d_frexpl'
23064 d_fs_data_s='$d_fs_data_s'
23065 d_fseeko='$d_fseeko'
23066 d_fsetpos='$d_fsetpos'
23067 d_fstatfs='$d_fstatfs'
23068 d_fstatvfs='$d_fstatvfs'
23070 d_ftello='$d_ftello'
23072 d_futimes='$d_futimes'
23073 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23074 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23075 d_getaddrinfo='$d_getaddrinfo'
23076 d_getcwd='$d_getcwd'
23077 d_getespwnam='$d_getespwnam'
23078 d_getfsstat='$d_getfsstat'
23079 d_getgrent='$d_getgrent'
23080 d_getgrent_r='$d_getgrent_r'
23081 d_getgrgid_r='$d_getgrgid_r'
23082 d_getgrnam_r='$d_getgrnam_r'
23083 d_getgrps='$d_getgrps'
23084 d_gethbyaddr='$d_gethbyaddr'
23085 d_gethbyname='$d_gethbyname'
23086 d_gethent='$d_gethent'
23087 d_gethname='$d_gethname'
23088 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23089 d_gethostbyname_r='$d_gethostbyname_r'
23090 d_gethostent_r='$d_gethostent_r'
23091 d_gethostprotos='$d_gethostprotos'
23092 d_getitimer='$d_getitimer'
23093 d_getlogin='$d_getlogin'
23094 d_getlogin_r='$d_getlogin_r'
23095 d_getmnt='$d_getmnt'
23096 d_getmntent='$d_getmntent'
23097 d_getnameinfo='$d_getnameinfo'
23098 d_getnbyaddr='$d_getnbyaddr'
23099 d_getnbyname='$d_getnbyname'
23100 d_getnent='$d_getnent'
23101 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23102 d_getnetbyname_r='$d_getnetbyname_r'
23103 d_getnetent_r='$d_getnetent_r'
23104 d_getnetprotos='$d_getnetprotos'
23105 d_getpagsz='$d_getpagsz'
23106 d_getpbyname='$d_getpbyname'
23107 d_getpbynumber='$d_getpbynumber'
23108 d_getpent='$d_getpent'
23109 d_getpgid='$d_getpgid'
23110 d_getpgrp2='$d_getpgrp2'
23111 d_getpgrp='$d_getpgrp'
23112 d_getppid='$d_getppid'
23113 d_getprior='$d_getprior'
23114 d_getprotobyname_r='$d_getprotobyname_r'
23115 d_getprotobynumber_r='$d_getprotobynumber_r'
23116 d_getprotoent_r='$d_getprotoent_r'
23117 d_getprotoprotos='$d_getprotoprotos'
23118 d_getprpwnam='$d_getprpwnam'
23119 d_getpwent='$d_getpwent'
23120 d_getpwent_r='$d_getpwent_r'
23121 d_getpwnam_r='$d_getpwnam_r'
23122 d_getpwuid_r='$d_getpwuid_r'
23123 d_getsbyname='$d_getsbyname'
23124 d_getsbyport='$d_getsbyport'
23125 d_getsent='$d_getsent'
23126 d_getservbyname_r='$d_getservbyname_r'
23127 d_getservbyport_r='$d_getservbyport_r'
23128 d_getservent_r='$d_getservent_r'
23129 d_getservprotos='$d_getservprotos'
23130 d_getspnam='$d_getspnam'
23131 d_getspnam_r='$d_getspnam_r'
23132 d_gettimeod='$d_gettimeod'
23133 d_gmtime64='$d_gmtime64'
23134 d_gmtime_r='$d_gmtime_r'
23135 d_gnulibc='$d_gnulibc'
23136 d_grpasswd='$d_grpasswd'
23137 d_hasmntopt='$d_hasmntopt'
23139 d_ilogbl='$d_ilogbl'
23140 d_inc_version_list='$d_inc_version_list'
23142 d_inetaton='$d_inetaton'
23143 d_inetntop='$d_inetntop'
23144 d_inetpton='$d_inetpton'
23145 d_int64_t='$d_int64_t'
23146 d_ip_mreq='$d_ip_mreq'
23147 d_ip_mreq_source='$d_ip_mreq_source'
23148 d_ipv6_mreq='$d_ipv6_mreq'
23149 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23150 d_isascii='$d_isascii'
23151 d_isblank='$d_isblank'
23152 d_isfinite='$d_isfinite'
23155 d_isnanl='$d_isnanl'
23156 d_killpg='$d_killpg'
23157 d_lchown='$d_lchown'
23158 d_ldbl_dig='$d_ldbl_dig'
23159 d_libm_lib_version='$d_libm_lib_version'
23160 d_libname_unique='$d_libname_unique'
23162 d_localtime64='$d_localtime64'
23163 d_localtime_r='$d_localtime_r'
23164 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23165 d_locconv='$d_locconv'
23167 d_longdbl='$d_longdbl'
23168 d_longlong='$d_longlong'
23169 d_lseekproto='$d_lseekproto'
23171 d_madvise='$d_madvise'
23172 d_malloc_good_size='$d_malloc_good_size'
23173 d_malloc_size='$d_malloc_size'
23175 d_mbstowcs='$d_mbstowcs'
23176 d_mbtowc='$d_mbtowc'
23177 d_memchr='$d_memchr'
23178 d_memcmp='$d_memcmp'
23179 d_memcpy='$d_memcpy'
23180 d_memmove='$d_memmove'
23181 d_memset='$d_memset'
23183 d_mkdtemp='$d_mkdtemp'
23184 d_mkfifo='$d_mkfifo'
23185 d_mkstemp='$d_mkstemp'
23186 d_mkstemps='$d_mkstemps'
23187 d_mktime64='$d_mktime64'
23188 d_mktime='$d_mktime'
23191 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23192 d_modflproto='$d_modflproto'
23193 d_mprotect='$d_mprotect'
23195 d_msg_ctrunc='$d_msg_ctrunc'
23196 d_msg_dontroute='$d_msg_dontroute'
23197 d_msg_oob='$d_msg_oob'
23198 d_msg_peek='$d_msg_peek'
23199 d_msg_proxy='$d_msg_proxy'
23200 d_msgctl='$d_msgctl'
23201 d_msgget='$d_msgget'
23202 d_msghdr_s='$d_msghdr_s'
23203 d_msgrcv='$d_msgrcv'
23204 d_msgsnd='$d_msgsnd'
23206 d_munmap='$d_munmap'
23207 d_mymalloc='$d_mymalloc'
23209 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23211 d_nl_langinfo='$d_nl_langinfo'
23212 d_nv_preserves_uv='$d_nv_preserves_uv'
23213 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23214 d_off64_t='$d_off64_t'
23215 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23216 d_oldpthreads='$d_oldpthreads'
23217 d_oldsock='$d_oldsock'
23219 d_pathconf='$d_pathconf'
23221 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23222 d_phostname='$d_phostname'
23225 d_portable='$d_portable'
23227 d_prctl_set_name='$d_prctl_set_name'
23228 d_printf_format_null='$d_printf_format_null'
23229 d_procselfexe='$d_procselfexe'
23230 d_pseudofork='$d_pseudofork'
23231 d_pthread_atfork='$d_pthread_atfork'
23232 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23233 d_pthread_yield='$d_pthread_yield'
23235 d_pwchange='$d_pwchange'
23236 d_pwclass='$d_pwclass'
23237 d_pwcomment='$d_pwcomment'
23238 d_pwexpire='$d_pwexpire'
23239 d_pwgecos='$d_pwgecos'
23240 d_pwpasswd='$d_pwpasswd'
23241 d_pwquota='$d_pwquota'
23244 d_random_r='$d_random_r'
23245 d_readdir64_r='$d_readdir64_r'
23246 d_readdir='$d_readdir'
23247 d_readdir_r='$d_readdir_r'
23248 d_readlink='$d_readlink'
23250 d_recvmsg='$d_recvmsg'
23251 d_rename='$d_rename'
23252 d_rewinddir='$d_rewinddir'
23254 d_safebcpy='$d_safebcpy'
23255 d_safemcpy='$d_safemcpy'
23256 d_sanemcmp='$d_sanemcmp'
23257 d_sbrkproto='$d_sbrkproto'
23258 d_scalbnl='$d_scalbnl'
23259 d_sched_yield='$d_sched_yield'
23260 d_scm_rights='$d_scm_rights'
23261 d_seekdir='$d_seekdir'
23262 d_select='$d_select'
23264 d_semctl='$d_semctl'
23265 d_semctl_semid_ds='$d_semctl_semid_ds'
23266 d_semctl_semun='$d_semctl_semun'
23267 d_semget='$d_semget'
23269 d_sendmsg='$d_sendmsg'
23270 d_setegid='$d_setegid'
23271 d_seteuid='$d_seteuid'
23272 d_setgrent='$d_setgrent'
23273 d_setgrent_r='$d_setgrent_r'
23274 d_setgrps='$d_setgrps'
23275 d_sethent='$d_sethent'
23276 d_sethostent_r='$d_sethostent_r'
23277 d_setitimer='$d_setitimer'
23278 d_setlinebuf='$d_setlinebuf'
23279 d_setlocale='$d_setlocale'
23280 d_setlocale_r='$d_setlocale_r'
23281 d_setnent='$d_setnent'
23282 d_setnetent_r='$d_setnetent_r'
23283 d_setpent='$d_setpent'
23284 d_setpgid='$d_setpgid'
23285 d_setpgrp2='$d_setpgrp2'
23286 d_setpgrp='$d_setpgrp'
23287 d_setprior='$d_setprior'
23288 d_setproctitle='$d_setproctitle'
23289 d_setprotoent_r='$d_setprotoent_r'
23290 d_setpwent='$d_setpwent'
23291 d_setpwent_r='$d_setpwent_r'
23292 d_setregid='$d_setregid'
23293 d_setresgid='$d_setresgid'
23294 d_setresuid='$d_setresuid'
23295 d_setreuid='$d_setreuid'
23296 d_setrgid='$d_setrgid'
23297 d_setruid='$d_setruid'
23298 d_setsent='$d_setsent'
23299 d_setservent_r='$d_setservent_r'
23300 d_setsid='$d_setsid'
23301 d_setvbuf='$d_setvbuf'
23304 d_shmatprototype='$d_shmatprototype'
23305 d_shmctl='$d_shmctl'
23307 d_shmget='$d_shmget'
23308 d_sigaction='$d_sigaction'
23309 d_signbit='$d_signbit'
23310 d_sigprocmask='$d_sigprocmask'
23311 d_sigsetjmp='$d_sigsetjmp'
23312 d_sin6_scope_id='$d_sin6_scope_id'
23313 d_sitearch='$d_sitearch'
23314 d_snprintf='$d_snprintf'
23315 d_sockaddr_in6='$d_sockaddr_in6'
23316 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23317 d_sockatmark='$d_sockatmark'
23318 d_sockatmarkproto='$d_sockatmarkproto'
23319 d_socket='$d_socket'
23320 d_socklen_t='$d_socklen_t'
23321 d_sockpair='$d_sockpair'
23322 d_socks5_init='$d_socks5_init'
23323 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23325 d_srand48_r='$d_srand48_r'
23326 d_srandom_r='$d_srandom_r'
23327 d_sresgproto='$d_sresgproto'
23328 d_sresuproto='$d_sresuproto'
23329 d_statblks='$d_statblks'
23330 d_statfs_f_flags='$d_statfs_f_flags'
23331 d_statfs_s='$d_statfs_s'
23332 d_static_inline='$d_static_inline'
23333 d_statvfs='$d_statvfs'
23334 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23335 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23336 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23337 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23338 d_stdio_stream_array='$d_stdio_stream_array'
23339 d_stdiobase='$d_stdiobase'
23340 d_stdstdio='$d_stdstdio'
23341 d_strchr='$d_strchr'
23342 d_strcoll='$d_strcoll'
23343 d_strctcpy='$d_strctcpy'
23344 d_strerrm='$d_strerrm'
23345 d_strerror='$d_strerror'
23346 d_strerror_r='$d_strerror_r'
23347 d_strftime='$d_strftime'
23348 d_strlcat='$d_strlcat'
23349 d_strlcpy='$d_strlcpy'
23350 d_strtod='$d_strtod'
23351 d_strtol='$d_strtol'
23352 d_strtold='$d_strtold'
23353 d_strtoll='$d_strtoll'
23354 d_strtoq='$d_strtoq'
23355 d_strtoul='$d_strtoul'
23356 d_strtoull='$d_strtoull'
23357 d_strtouq='$d_strtouq'
23358 d_strxfrm='$d_strxfrm'
23359 d_suidsafe='$d_suidsafe'
23360 d_symlink='$d_symlink'
23361 d_syscall='$d_syscall'
23362 d_syscallproto='$d_syscallproto'
23363 d_sysconf='$d_sysconf'
23364 d_sysernlst='$d_sysernlst'
23365 d_syserrlst='$d_syserrlst'
23366 d_system='$d_system'
23367 d_tcgetpgrp='$d_tcgetpgrp'
23368 d_tcsetpgrp='$d_tcsetpgrp'
23369 d_telldir='$d_telldir'
23370 d_telldirproto='$d_telldirproto'
23372 d_timegm='$d_timegm'
23374 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23375 d_tm_tm_zone='$d_tm_tm_zone'
23376 d_tmpnam_r='$d_tmpnam_r'
23377 d_truncate='$d_truncate'
23378 d_ttyname_r='$d_ttyname_r'
23379 d_tzname='$d_tzname'
23380 d_u32align='$d_u32align'
23381 d_ualarm='$d_ualarm'
23384 d_union_semun='$d_union_semun'
23385 d_unordered='$d_unordered'
23386 d_unsetenv='$d_unsetenv'
23387 d_usleep='$d_usleep'
23388 d_usleepproto='$d_usleepproto'
23390 d_vendorarch='$d_vendorarch'
23391 d_vendorbin='$d_vendorbin'
23392 d_vendorlib='$d_vendorlib'
23393 d_vendorscript='$d_vendorscript'
23395 d_void_closedir='$d_void_closedir'
23396 d_voidsig='$d_voidsig'
23397 d_voidtty='$d_voidtty'
23398 d_volatile='$d_volatile'
23399 d_vprintf='$d_vprintf'
23400 d_vsnprintf='$d_vsnprintf'
23402 d_waitpid='$d_waitpid'
23403 d_wcstombs='$d_wcstombs'
23404 d_wctomb='$d_wctomb'
23405 d_writev='$d_writev'
23408 db_hashtype='$db_hashtype'
23409 db_prefixtype='$db_prefixtype'
23410 db_version_major='$db_version_major'
23411 db_version_minor='$db_version_minor'
23412 db_version_patch='$db_version_patch'
23413 direntrytype='$direntrytype'
23416 doublesize='$doublesize'
23418 drand48_r_proto='$drand48_r_proto'
23420 dynamic_ext='$dynamic_ext'
23426 endgrent_r_proto='$endgrent_r_proto'
23427 endhostent_r_proto='$endhostent_r_proto'
23428 endnetent_r_proto='$endnetent_r_proto'
23429 endprotoent_r_proto='$endprotoent_r_proto'
23430 endpwent_r_proto='$endpwent_r_proto'
23431 endservent_r_proto='$endservent_r_proto'
23432 eunicefix='$eunicefix'
23435 extensions='$extensions'
23436 extern_C='$extern_C'
23438 fflushNULL='$fflushNULL'
23439 fflushall='$fflushall'
23441 firstmakefile='$firstmakefile'
23443 fpossize='$fpossize'
23444 fpostype='$fpostype'
23445 freetype='$freetype'
23448 full_csh='$full_csh'
23449 full_sed='$full_sed'
23450 gccansipedantic='$gccansipedantic'
23451 gccosandvers='$gccosandvers'
23452 gccversion='$gccversion'
23453 getgrent_r_proto='$getgrent_r_proto'
23454 getgrgid_r_proto='$getgrgid_r_proto'
23455 getgrnam_r_proto='$getgrnam_r_proto'
23456 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23457 gethostbyname_r_proto='$gethostbyname_r_proto'
23458 gethostent_r_proto='$gethostent_r_proto'
23459 getlogin_r_proto='$getlogin_r_proto'
23460 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23461 getnetbyname_r_proto='$getnetbyname_r_proto'
23462 getnetent_r_proto='$getnetent_r_proto'
23463 getprotobyname_r_proto='$getprotobyname_r_proto'
23464 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23465 getprotoent_r_proto='$getprotoent_r_proto'
23466 getpwent_r_proto='$getpwent_r_proto'
23467 getpwnam_r_proto='$getpwnam_r_proto'
23468 getpwuid_r_proto='$getpwuid_r_proto'
23469 getservbyname_r_proto='$getservbyname_r_proto'
23470 getservbyport_r_proto='$getservbyport_r_proto'
23471 getservent_r_proto='$getservent_r_proto'
23472 getspnam_r_proto='$getspnam_r_proto'
23473 gidformat='$gidformat'
23479 gmtime_r_proto='$gmtime_r_proto'
23480 gnulibc_version='$gnulibc_version'
23482 groupcat='$groupcat'
23483 groupstype='$groupstype'
23486 h_sysfile='$h_sysfile'
23489 hostgenerate='$hostgenerate'
23490 hostosname='$hostosname'
23491 hostperl='$hostperl'
23492 html1dir='$html1dir'
23493 html1direxp='$html1direxp'
23494 html3dir='$html3dir'
23495 html3direxp='$html3direxp'
23504 i_arpainet='$i_arpainet'
23505 i_assert='$i_assert'
23506 i_bsdioctl='$i_bsdioctl'
23510 i_dirent='$i_dirent'
23515 i_fp_class='$i_fp_class'
23517 i_gdbm_ndbm='$i_gdbm_ndbm'
23518 i_gdbmndbm='$i_gdbmndbm'
23520 i_ieeefp='$i_ieeefp'
23521 i_inttypes='$i_inttypes'
23522 i_langinfo='$i_langinfo'
23523 i_libutil='$i_libutil'
23524 i_limits='$i_limits'
23525 i_locale='$i_locale'
23526 i_machcthr='$i_machcthr'
23527 i_malloc='$i_malloc'
23528 i_mallocmalloc='$i_mallocmalloc'
23530 i_memory='$i_memory'
23531 i_mntent='$i_mntent'
23534 i_neterrno='$i_neterrno'
23535 i_netinettcp='$i_netinettcp'
23539 i_pthread='$i_pthread'
23541 i_rpcsvcdbm='$i_rpcsvcdbm'
23543 i_shadow='$i_shadow'
23545 i_stdarg='$i_stdarg'
23546 i_stdbool='$i_stdbool'
23547 i_stddef='$i_stddef'
23548 i_stdlib='$i_stdlib'
23549 i_string='$i_string'
23550 i_sunmath='$i_sunmath'
23551 i_sysaccess='$i_sysaccess'
23552 i_sysdir='$i_sysdir'
23553 i_sysfile='$i_sysfile'
23554 i_sysfilio='$i_sysfilio'
23556 i_sysioctl='$i_sysioctl'
23557 i_syslog='$i_syslog'
23558 i_sysmman='$i_sysmman'
23559 i_sysmode='$i_sysmode'
23560 i_sysmount='$i_sysmount'
23561 i_sysndir='$i_sysndir'
23562 i_sysparam='$i_sysparam'
23563 i_syspoll='$i_syspoll'
23564 i_sysresrc='$i_sysresrc'
23565 i_syssecrt='$i_syssecrt'
23566 i_sysselct='$i_sysselct'
23567 i_syssockio='$i_syssockio'
23568 i_sysstat='$i_sysstat'
23569 i_sysstatfs='$i_sysstatfs'
23570 i_sysstatvfs='$i_sysstatvfs'
23571 i_systime='$i_systime'
23572 i_systimek='$i_systimek'
23573 i_systimes='$i_systimes'
23574 i_systypes='$i_systypes'
23575 i_sysuio='$i_sysuio'
23577 i_sysutsname='$i_sysutsname'
23578 i_sysvfs='$i_sysvfs'
23579 i_syswait='$i_syswait'
23580 i_termio='$i_termio'
23581 i_termios='$i_termios'
23583 i_unistd='$i_unistd'
23586 i_values='$i_values'
23587 i_varargs='$i_varargs'
23588 i_varhdr='$i_varhdr'
23590 ignore_versioned_solibs='$ignore_versioned_solibs'
23591 inc_version_list='$inc_version_list'
23592 inc_version_list_init='$inc_version_list_init'
23596 initialinstalllocation='$initialinstalllocation'
23597 installarchlib='$installarchlib'
23598 installbin='$installbin'
23599 installhtml1dir='$installhtml1dir'
23600 installhtml3dir='$installhtml3dir'
23601 installman1dir='$installman1dir'
23602 installman3dir='$installman3dir'
23603 installprefix='$installprefix'
23604 installprefixexp='$installprefixexp'
23605 installprivlib='$installprivlib'
23606 installscript='$installscript'
23607 installsitearch='$installsitearch'
23608 installsitebin='$installsitebin'
23609 installsitehtml1dir='$installsitehtml1dir'
23610 installsitehtml3dir='$installsitehtml3dir'
23611 installsitelib='$installsitelib'
23612 installsiteman1dir='$installsiteman1dir'
23613 installsiteman3dir='$installsiteman3dir'
23614 installsitescript='$installsitescript'
23615 installstyle='$installstyle'
23616 installusrbinperl='$installusrbinperl'
23617 installvendorarch='$installvendorarch'
23618 installvendorbin='$installvendorbin'
23619 installvendorhtml1dir='$installvendorhtml1dir'
23620 installvendorhtml3dir='$installvendorhtml3dir'
23621 installvendorlib='$installvendorlib'
23622 installvendorman1dir='$installvendorman1dir'
23623 installvendorman3dir='$installvendorman3dir'
23624 installvendorscript='$installvendorscript'
23626 issymlink='$issymlink'
23627 ivdformat='$ivdformat'
23630 known_extensions='$known_extensions'
23633 ld_can_script='$ld_can_script'
23634 lddlflags='$lddlflags'
23636 ldflags_uselargefiles='$ldflags_uselargefiles'
23637 ldlibpthname='$ldlibpthname'
23644 libsdirs='$libsdirs'
23645 libsfiles='$libsfiles'
23646 libsfound='$libsfound'
23647 libspath='$libspath'
23648 libswanted='$libswanted'
23649 libswanted_uselargefiles='$libswanted_uselargefiles'
23655 localtime_r_proto='$localtime_r_proto'
23656 locincpth='$locincpth'
23657 loclibpth='$loclibpth'
23658 longdblsize='$longdblsize'
23659 longlongsize='$longlongsize'
23660 longsize='$longsize'
23664 lseeksize='$lseeksize'
23665 lseektype='$lseektype'
23668 madlyobj='$madlyobj'
23669 madlysrc='$madlysrc'
23673 make_set_make='$make_set_make'
23674 mallocobj='$mallocobj'
23675 mallocsrc='$mallocsrc'
23676 malloctype='$malloctype'
23678 man1direxp='$man1direxp'
23681 man3direxp='$man3direxp'
23683 mips_type='$mips_type'
23684 mistrustnm='$mistrustnm'
23686 mmaptype='$mmaptype'
23687 modetype='$modetype'
23689 multiarch='$multiarch'
23691 myarchname='$myarchname'
23692 mydomain='$mydomain'
23693 myhostname='$myhostname'
23696 need_va_copy='$need_va_copy'
23697 netdb_hlen_type='$netdb_hlen_type'
23698 netdb_host_type='$netdb_host_type'
23699 netdb_name_type='$netdb_name_type'
23700 netdb_net_type='$netdb_net_type'
23703 nm_so_opt='$nm_so_opt'
23704 nonxs_ext='$nonxs_ext'
23706 nvEUformat='$nvEUformat'
23707 nvFUformat='$nvFUformat'
23708 nvGUformat='$nvGUformat'
23709 nv_overflows_integers_at='$nv_overflows_integers_at'
23710 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23711 nveformat='$nveformat'
23712 nvfformat='$nvfformat'
23713 nvgformat='$nvgformat'
23716 o_nonblock='$o_nonblock'
23718 old_pthread_create_joinable='$old_pthread_create_joinable'
23719 optimize='$optimize'
23720 orderlib='$orderlib'
23723 otherlibdirs='$otherlibdirs'
23727 patchlevel='$patchlevel'
23728 path_sep='$path_sep'
23731 perl_patchlevel='$perl_patchlevel'
23732 perl_static_inline='$perl_static_inline'
23733 perladmin='$perladmin'
23734 perllibs='$perllibs'
23735 perlpath='$perlpath'
23737 phostname='$phostname'
23743 prefixexp='$prefixexp'
23745 privlibexp='$privlibexp'
23746 procselfexe='$procselfexe'
23747 prototype='$prototype'
23749 quadkind='$quadkind'
23750 quadtype='$quadtype'
23751 randbits='$randbits'
23752 randfunc='$randfunc'
23753 random_r_proto='$random_r_proto'
23754 randseedtype='$randseedtype'
23756 rd_nodata='$rd_nodata'
23757 readdir64_r_proto='$readdir64_r_proto'
23758 readdir_r_proto='$readdir_r_proto'
23759 revision='$revision'
23765 sGMTIME_max='$sGMTIME_max'
23766 sGMTIME_min='$sGMTIME_min'
23767 sLOCALTIME_max='$sLOCALTIME_max'
23768 sLOCALTIME_min='$sLOCALTIME_min'
23769 sPRIEUldbl='$sPRIEUldbl'
23770 sPRIFUldbl='$sPRIFUldbl'
23771 sPRIGUldbl='$sPRIGUldbl'
23772 sPRIXU64='$sPRIXU64'
23774 sPRIeldbl='$sPRIeldbl'
23775 sPRIfldbl='$sPRIfldbl'
23776 sPRIgldbl='$sPRIgldbl'
23781 sSCNfldbl='$sSCNfldbl'
23782 sched_yield='$sched_yield'
23783 scriptdir='$scriptdir'
23784 scriptdirexp='$scriptdirexp'
23786 seedfunc='$seedfunc'
23787 selectminbits='$selectminbits'
23788 selecttype='$selecttype'
23789 sendmail='$sendmail'
23790 setgrent_r_proto='$setgrent_r_proto'
23791 sethostent_r_proto='$sethostent_r_proto'
23792 setlocale_r_proto='$setlocale_r_proto'
23793 setnetent_r_proto='$setnetent_r_proto'
23794 setprotoent_r_proto='$setprotoent_r_proto'
23795 setpwent_r_proto='$setpwent_r_proto'
23796 setservent_r_proto='$setservent_r_proto'
23799 sharpbang='$sharpbang'
23800 shmattype='$shmattype'
23801 shortsize='$shortsize'
23804 sig_count='$sig_count'
23805 sig_name='$sig_name'
23806 sig_name_init='$sig_name_init'
23808 sig_num_init='$sig_num_init'
23809 sig_size='$sig_size'
23810 signal_t='$signal_t'
23811 sitearch='$sitearch'
23812 sitearchexp='$sitearchexp'
23814 sitebinexp='$sitebinexp'
23815 sitehtml1dir='$sitehtml1dir'
23816 sitehtml1direxp='$sitehtml1direxp'
23817 sitehtml3dir='$sitehtml3dir'
23818 sitehtml3direxp='$sitehtml3direxp'
23820 sitelib_stem='$sitelib_stem'
23821 sitelibexp='$sitelibexp'
23822 siteman1dir='$siteman1dir'
23823 siteman1direxp='$siteman1direxp'
23824 siteman3dir='$siteman3dir'
23825 siteman3direxp='$siteman3direxp'
23826 siteprefix='$siteprefix'
23827 siteprefixexp='$siteprefixexp'
23828 sitescript='$sitescript'
23829 sitescriptexp='$sitescriptexp'
23830 sizesize='$sizesize'
23831 sizetype='$sizetype'
23835 sockethdr='$sockethdr'
23836 socketlib='$socketlib'
23837 socksizetype='$socksizetype'
23839 spackage='$spackage'
23840 spitshell='$spitshell'
23841 srand48_r_proto='$srand48_r_proto'
23842 srandom_r_proto='$srandom_r_proto'
23844 ssizetype='$ssizetype'
23845 st_ino_sign='$st_ino_sign'
23846 st_ino_size='$st_ino_size'
23847 startperl='$startperl'
23849 static_ext='$static_ext'
23851 stdio_base='$stdio_base'
23852 stdio_bufsiz='$stdio_bufsiz'
23853 stdio_cnt='$stdio_cnt'
23854 stdio_filbuf='$stdio_filbuf'
23855 stdio_ptr='$stdio_ptr'
23856 stdio_stream_array='$stdio_stream_array'
23857 strerror_r_proto='$strerror_r_proto'
23860 subversion='$subversion'
23865 targetarch='$targetarch'
23866 targetdir='$targetdir'
23867 targetenv='$targetenv'
23868 targethost='$targethost'
23869 targetmkdir='$targetmkdir'
23870 targetport='$targetport'
23871 targetsh='$targetsh'
23875 timeincl='$timeincl'
23876 timetype='$timetype'
23877 tmpnam_r_proto='$tmpnam_r_proto'
23883 ttyname_r_proto='$ttyname_r_proto'
23892 uidformat='$uidformat'
23898 uquadtype='$uquadtype'
23899 use5005threads='$use5005threads'
23900 use64bitall='$use64bitall'
23901 use64bitint='$use64bitint'
23902 usecrosscompile='$usecrosscompile'
23903 usedevel='$usedevel'
23905 usedtrace='$usedtrace'
23906 usefaststdio='$usefaststdio'
23907 useithreads='$useithreads'
23908 usekernprocpathname='$usekernprocpathname'
23909 uselargefiles='$uselargefiles'
23910 uselongdouble='$uselongdouble'
23911 usemallocwrap='$usemallocwrap'
23912 usemorebits='$usemorebits'
23913 usemultiplicity='$usemultiplicity'
23914 usemymalloc='$usemymalloc'
23916 usensgetexecutablepath='$usensgetexecutablepath'
23917 useopcode='$useopcode'
23918 useperlio='$useperlio'
23919 useposix='$useposix'
23920 usereentrant='$usereentrant'
23921 userelocatableinc='$userelocatableinc'
23922 useshrplib='$useshrplib'
23923 usesitecustomize='$usesitecustomize'
23924 usesocks='$usesocks'
23925 usethreads='$usethreads'
23926 usevendorprefix='$usevendorprefix'
23927 useversionedarchname='$useversionedarchname'
23928 usevfork='$usevfork'
23931 uvXUformat='$uvXUformat'
23932 uvoformat='$uvoformat'
23935 uvuformat='$uvuformat'
23936 uvxformat='$uvxformat'
23938 vendorarch='$vendorarch'
23939 vendorarchexp='$vendorarchexp'
23940 vendorbin='$vendorbin'
23941 vendorbinexp='$vendorbinexp'
23942 vendorhtml1dir='$vendorhtml1dir'
23943 vendorhtml1direxp='$vendorhtml1direxp'
23944 vendorhtml3dir='$vendorhtml3dir'
23945 vendorhtml3direxp='$vendorhtml3direxp'
23946 vendorlib='$vendorlib'
23947 vendorlib_stem='$vendorlib_stem'
23948 vendorlibexp='$vendorlibexp'
23949 vendorman1dir='$vendorman1dir'
23950 vendorman1direxp='$vendorman1direxp'
23951 vendorman3dir='$vendorman3dir'
23952 vendorman3direxp='$vendorman3direxp'
23953 vendorprefix='$vendorprefix'
23954 vendorprefixexp='$vendorprefixexp'
23955 vendorscript='$vendorscript'
23956 vendorscriptexp='$vendorscriptexp'
23958 version_patchlevel_string='$version_patchlevel_string'
23959 versiononly='$versiononly'
23963 yaccflags='$yaccflags'
23968 : add special variables
23969 $test -f $src/patchlevel.h && \
23970 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23971 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23972 echo "PERL_CONFIG_SH=true" >>config.sh
23974 : propagate old symbols
23975 if $test -f UU/config.sh; then
23976 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23977 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23978 config.sh config.sh UU/oldconfig.sh |\
23979 $sort | $uniq -u >UU/oldsyms
23980 set X `$cat UU/oldsyms`
23986 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23988 echo ": Variables propagated from previous config.sh file." >>config.sh
23989 for sym in `$cat UU/oldsyms`; do
23990 echo " Propagating $hint variable "'$'"$sym..."
23991 eval 'tmp="$'"${sym}"'"'
23993 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23999 : Finish up by extracting the .SH files
24003 echo "Extraction done."
24013 If you'd like to make any changes to the config.sh file before I begin
24014 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24017 rp="Press return or use a shell escape to edit config.sh:"
24022 *) : in case they cannot read
24023 sh 1>&4 -c "$ans";;
24028 : if this fails, just run all the .SH files by hand
24037 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24044 Now you need to generate make dependencies by running "$make depend".
24045 You might prefer to run it in background: "$make depend > makedepend.out &"
24046 It can take a while, so you might not want to run it right now.
24051 rp="Run $make depend now?"
24055 $make depend && echo "Now you must run '$make'."
24058 echo "You must run '$make depend' then '$make'."
24061 elif test -f [Mm]akefile; then
24063 echo "Now you must run a $make."
24065 echo "Configure done."
24068 if $test -f Policy.sh; then
24071 If you compile $package on a different machine or from a different object
24072 directory, copy the Policy.sh file from this object directory to the
24073 new one before you run Configure -- this will help you with most of
24074 the policy defaults.
24078 if $test -f config.msg; then
24079 echo "Hmm. I also noted the following information while running:"
24081 $cat config.msg >&4
24084 $rm -f kit*isdone ark*isdone