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 Mon May 27 09:27:16 CEST 2013 [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
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
730 d_ipv6_mreq_source=''
747 d_sprintf_returns_strlen=''
759 perl_static_inline=''
764 d_stdio_ptr_lval_nochange_cnt=''
765 d_stdio_ptr_lval_sets_cnt=''
911 d_gdbm_ndbm_h_uses_prototypes=''
912 d_gdbmndbm_h_uses_prototypes=''
914 d_ndbm_h_uses_prototypes=''
989 d_inc_version_list=''
991 inc_version_list_init=''
1010 ignore_versioned_solibs=''
1074 d_perl_otherlibdirs=''
1082 api_versionstring=''
1088 version_patchlevel_string=''
1092 d_nv_preserves_uv=''
1093 d_nv_zero_is_allbits_zero=''
1104 nv_overflows_integers_at=''
1105 nv_preserves_uv_bits=''
1177 installsitehtml1dir=''
1180 installsitehtml3dir=''
1187 installsiteman1dir=''
1190 installsiteman3dir=''
1195 installsitescript=''
1212 d_stdio_stream_array=''
1213 stdio_stream_array=''
1230 usekernprocpathname=''
1231 ccflags_uselargefiles=''
1232 ldflags_uselargefiles=''
1233 libswanted_uselargefiles=''
1242 usensgetexecutablepath=''
1255 installvendorarch=''
1262 installvendorhtml1dir=''
1264 vendorhtml1direxp=''
1265 installvendorhtml3dir=''
1267 vendorhtml3direxp=''
1273 installvendorman1dir=''
1276 installvendorman3dir=''
1283 installvendorscript=''
1296 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1299 : We must find out about Eunice early
1301 if test -f /etc/unixtovms; then
1302 eunicefix=/etc/unixtovms
1304 if test -f /etc/unixtovms.exe; then
1305 eunicefix=/etc/unixtovms.exe
1308 : Set executable suffix now -- needed before hints available
1309 if test -f "/libs/version.library"; then
1312 elif test -f "/system/gnu_library/bin/ar.pm"; then
1315 elif test -n "$DJGPP"; then
1318 elif test -d c:/. -o -n "$is_os2" ; then
1325 : Trailing extension. Override this in a hint file, if needed.
1326 : Extra object files, if any, needed on this platform.
1329 : Possible local include directories to search.
1330 : Set locincpth to "" in a hint file to defeat local include searches.
1331 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1332 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1334 : no include file wanted by default
1337 : Enable -DEBUGGING and -DDEBUGGING from the command line
1342 : change the next line if compiling for Xenix/286 on Xenix/386
1343 xlibpth='/usr/lib/386 /lib/386'
1344 : Possible local library directories to search.
1345 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1346 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1348 : general looking path for locating libraries
1349 glibpth="/lib /usr/lib $xlibpth"
1350 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1351 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1352 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1353 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1355 : Private path used by Configure to find libraries. Its value
1356 : is prepended to libpth. This variable takes care of special
1357 : machines, like the mips. Usually, it should be empty.
1360 : default library list
1362 : some systems want to use only the non-versioned libso:s
1363 ignore_versioned_solibs=''
1364 : set usethreads on the Configure command line to enable threads.
1365 usereentrant='undef'
1366 : full support for void wanted by default
1372 : set useposix=false in your hint file to disable the POSIX extension.
1374 : set useopcode=false in your hint file to disable the Opcode extension.
1377 ccflags_uselargefiles=''
1378 ldflags_uselargefiles=''
1379 libswanted_uselargefiles=''
1380 : set usemultiplicity on the Configure command line to enable multiplicity.
1381 : set usesocks on the Configure command line to enable socks.
1382 : List of libraries we want.
1383 : If anyone needs extra -lxxx, put those in a hint file.
1384 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1385 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1386 : We probably want to search /usr/shlib before most other libraries.
1387 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1388 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1389 glibpth="/usr/shlib $glibpth"
1390 : Do not use vfork unless overridden by a hint file.
1393 : Find the basic shell for Bourne shell scripts
1397 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1400 if test -f "$xxx"; then
1403 : Build up a list and do a single loop so we can 'break' out.
1404 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1405 for xxx in sh bash ksh pdksh ash; do
1407 try="$try ${p}/${xxx}"
1411 if test -f "$xxx"; then
1414 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1417 elif test -f "$xxx.exe"; then
1428 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1430 Usually it's in /bin/sh. How did you even get this far?
1431 Please contact me (Perl Maintainers) at perlbug@perl.org and
1432 we'll try to straighten this all out.
1438 : see if sh knows # comments
1439 if `$sh -c '#' >/dev/null 2>&1`; then
1443 test -f $xcat$_exe || xcat=/usr/bin/cat
1444 if test ! -f $xcat$_exe; then
1445 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1446 if test -f $p/cat$_exe; then
1451 if test ! -f $xcat$_exe; then
1452 echo "Can't find cat anywhere!"
1456 echo "#!$xcat" >sharp
1459 ./sharp > today 2>/dev/null
1460 if test -s today; then
1463 echo "#! $xcat" > sharp
1466 ./sharp > today 2>/dev/null
1467 if test -s today; then
1475 echo "Your $sh doesn't grok # comments--I will strip them later on."
1478 echo "exec grep -v '^[ ]*#'" >spitshell
1480 $eunicefix spitshell
1481 spitshell=`pwd`/spitshell
1483 echo "I presume that if # doesn't work, #! won't work either!"
1488 : figure out how to guarantee sh startup
1490 '') startsh=${sharpbang}${sh} ;;
1502 : echo "Yup, it does."
1504 echo "Hmm... '$startsh' does not guarantee sh startup..."
1505 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1509 : Save command line options in file UU/cmdline.opt for later use in
1510 : generating config.sh.
1511 cat > cmdline.opt <<EOSH
1512 : Configure command line arguments.
1521 cat >>cmdline.opt <<EOSH
1522 config_arg$argn='$arg'
1524 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1527 arg_exp=`cat cmdl.opt`
1528 args_exp="$args_exp$args_sep'$arg_exp'"
1529 argn=`expr $argn + 1`
1534 : produce awk script to parse command line options
1535 cat >options.awk <<'EOF'
1537 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1539 len = length(optstr);
1540 for (i = 1; i <= len; i++) {
1541 c = substr(optstr, i, 1);
1542 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1553 if (substr(str, 1, 1) != "-") {
1554 printf("'%s'\n", str);
1558 for (i = 2; i <= len; i++) {
1559 c = substr(str, i, 1);
1561 printf("-%s\n", substr(str, i));
1567 printf("'%s'\n", substr(str, i + 1));
1580 : process the command line options
1581 set X `for arg in "$@"; do echo "X$arg"; done |
1582 sed -e s/X// | awk -f options.awk`
1587 : set up default values
1597 rm -f optdef.sh posthint.sh
1598 cat >optdef.sh <<EOS
1604 while test $# -gt 0; do
1606 -d) shift; fastread=yes;;
1607 -e) shift; alldone=cont;;
1611 if test -r "$1"; then
1614 echo "$me: cannot read config file $1." >&2
1620 -h) shift; error=true;;
1621 -r) shift; reuseval=true;;
1622 -s) shift; silent=true; realsilent=true;;
1623 -E) shift; alldone=exit;;
1624 -K) shift; knowitall=true;;
1625 -O) shift; override=true;;
1626 -S) shift; silent=true; extractsh=true;;
1631 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1632 echo "$me: ignoring -D $1" >&2
1635 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1636 *) echo "$1='define'" >> optdef.sh;;
1643 *=) echo "$1" >> optdef.sh;;
1645 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1646 echo "$me: ignoring -U $1" >&2
1648 *) echo "$1='undef'" >> optdef.sh;;
1659 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1663 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1664 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1670 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1671 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1672 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1673 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1674 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1675 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1681 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1683 echo "$yyy=''" >> posthint.sh ;;
1688 echo "$yyy='$zzz'" >> posthint.sh ;;
1690 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1692 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1697 echo "$yyy=$zzz" >> posthint.sh ;;
1698 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1702 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1705 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1713 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1714 [-U symbol] [-U symbol=] [-A command:symbol...]
1715 -d : use defaults for all answers.
1716 -e : go on without questioning past the production of config.sh.
1717 -f : specify an alternate default configuration file.
1718 -h : print this help message and exit (with an error status).
1719 -r : reuse C symbols value if possible (skips costly nm extraction).
1720 -s : silent mode, only echoes questions and essential information.
1721 -D : define symbol to have some value:
1722 -D symbol symbol gets the value 'define'
1723 -D symbol=value symbol gets the value 'value'
1724 common used examples (see INSTALL for more info):
1725 -Duse64bitint use 64bit integers
1726 -Duse64bitall use 64bit integers and pointers
1727 -Dusethreads use thread support
1728 -Dinc_version_list=none do not include older perl trees in @INC
1729 -DEBUGGING=none DEBUGGING options
1730 -Dcc=gcc choose your compiler
1731 -Dprefix=/opt/perl5 choose your destination
1732 -E : stop at the end of questions, after having produced config.sh.
1733 -K : do not use unless you know what you are doing.
1734 -O : let -D and -U override definitions from loaded configuration file.
1735 -S : perform variable substitutions on all .SH files (can mix with -f)
1736 -U : undefine symbol:
1737 -U symbol symbol gets the value 'undef'
1738 -U symbol= symbol gets completely empty
1740 -A : manipulate symbol after the platform specific hints have been applied:
1741 -A append:symbol=value append value to symbol
1742 -A symbol=value like append:, but with a separating space
1743 -A define:symbol=value define symbol to have value
1744 -A clear:symbol define symbol to be ''
1745 -A define:symbol define symbol to be 'define'
1746 -A eval:symbol=value define symbol to be eval of value
1747 -A prepend:symbol=value prepend value to symbol
1748 -A undef:symbol define symbol to be 'undef'
1749 -A undef:symbol= define symbol to be ''
1750 e.g.: -A prepend:libswanted='cl pthread '
1751 -A ccflags=-DSOME_MACRO
1752 -V : print version number and exit (with a zero status).
1759 case "$fastread$alldone" in
1762 case "$extractsh" in
1765 if test ! -t 0; then
1766 echo "Say 'sh Configure', not 'sh <Configure'"
1776 true) exec 1>/dev/null;;
1779 : run the defines and the undefines, if any, but leave the file out there...
1782 : create the posthint manipulation script and leave the file out there...
1787 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1788 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1789 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1790 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1791 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1794 : Some greps do not return status, grrr.
1795 echo "grimblepritz" >grimble
1796 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1798 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1804 : the following should work in any shell
1808 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1809 cat >contains <<'EOSS'
1810 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1815 : Find the path to the source tree
1818 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1822 *) src=`cd ../$src && pwd` ;;
1835 if test -f $rsrc/Configure && \
1836 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1838 : found it, so we are ok.
1841 for src in . .. ../.. ../../.. ../../../..; do
1842 if test -f ../$src/Configure && \
1843 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1854 Sorry, I can't seem to locate the source dir for $package. Please start
1855 Configure with an explicit path -- i.e. /some/path/Configure.
1863 echo "Sources for $package found in \"$src\"." >&4
1867 : script used to extract .SH files with variable substitutions
1868 cat >extract <<'EOS'
1870 echo "Doing variable substitutions on .SH files..."
1871 if test -f MANIFEST; then
1872 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1874 echo "(Looking for .SH files under the source directory.)"
1875 set x `(cd "$src"; find . -name "*.SH" -print)`
1879 0) set x `(cd "$src"; echo *.SH)`; shift;;
1881 if test ! -f "$src/$1"; then
1887 while test $name; do
1888 if test ! -d "$name"; then
1889 create="$name $create";
1890 name=`echo $name | sed -e "s|^[^/]*$||"`;
1891 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1896 for file in $create; do
1905 dir=`expr X$file : 'X\(.*\)/'`
1906 file=`expr X$file : 'X.*/\(.*\)'`
1907 (cd "$dir" && . ./$file)
1917 dir=`expr X$file : 'X\(.*\)/'`
1918 file=`expr X$file : 'X.*/\(.*\)'`
1919 (set x $dir; shift; eval $mkdir_p)
1920 sh <"$src/$dir/$file"
1929 if test -f "$src/config_h.SH"; then
1930 if test ! -f config.h; then
1931 : oops, they left it out of MANIFEST, probably, so do it anyway.
1932 . "$src/config_h.SH"
1937 : extract files and exit if asked to do so
1938 case "$extractsh" in
1940 case "$realsilent" in
1944 case "$config_sh" in
1945 '') config_sh='config.sh';;
1948 echo "Fetching answers from $config_sh..."
1951 test "$override" && . ./optdef.sh
1955 echo "Extraction done."
1960 : Eunice requires " " instead of "", can you believe it
1963 echo "Beginning of configuration questions for $package."
1965 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1967 : first determine how to suppress newline on echo command
1969 echo "Checking echo to see how to suppress newlines..."
1970 (echo "hi there\c" ; echo " ") >.echotmp
1971 if $contains c .echotmp >/dev/null 2>&1 ; then
1982 echo $n "The star should be here-->$c"
1986 : Now test for existence of everything in MANIFEST
1988 if test -f "$rsrc/MANIFEST"; then
1989 echo "First let's make sure your kit is complete. Checking..." >&4
1990 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1991 (split -l 50 2>/dev/null || split -50)
1994 for filelist in x??; do
1995 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1996 >/dev/null 2>>"$tmppwd/missing")
1998 if test -s missing; then
2002 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2004 You have the option of continuing the configuration process, despite the
2005 distinct possibility that your kit is damaged, by typing 'y'es. If you
2006 do, don't blame me if something goes wrong. I advise you to type 'n'o
2007 and contact the author (perlbug@perl.org).
2010 echo $n "Continue? [n] $c" >&4
2014 echo "Continuing..." >&4
2018 echo "ABORTING..." >&4
2023 echo "Looks good..."
2026 echo "There is no MANIFEST file. I hope your kit is complete !"
2030 : Find the appropriate value for a newline for tr
2032 if test -n "$DJGPP"; then
2035 if test X"$trnl" = X; then
2036 case "`echo foo|tr '\n' x 2>/dev/null`" in
2040 if test X"$trnl" = X; then
2041 case "`echo foo|tr '\012' x 2>/dev/null`" in
2042 foox) trnl='\012' ;;
2045 if test X"$trnl" = X; then
2046 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2047 fooxy) trnl='\n\r' ;;
2050 if test X"$trnl" = X; then
2053 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2059 : compute the number of columns on the terminal for proper question formatting
2064 : set up the echo used in my read
2065 myecho="case \"\$xxxm\" in
2066 '') echo $n \"\$rp $c\" >&4;;
2068 '') echo $n \"[\$xxxm] $c\";;
2070 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2072 echo $n \"[\$xxxm] $c\" >&4
2074 echo $n \"\$rp [\$xxxm] $c\" >&4
2080 : now set up to do reads with possible shell escape and default assignment
2086 case "\$fastread" in
2087 yes) case "\$dflt" in
2090 case "\$silent-\$rp" in
2095 *) case "\$silent" in
2096 true) case "\$rp" in
2101 while expr "X\$ans" : "X!" >/dev/null; do
2105 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2113 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2122 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2127 echo "(OK, I'll run with -d after this question.)" >&4
2130 echo "*** Sorry, \$1 not supported yet." >&4
2140 echo "*** Substitution done -- please confirm."
2142 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2147 echo "*** Error -- try again."
2154 case "\$ans\$xxxm\$nostick" in
2166 : create .config dir to save info across Configure sessions
2167 test -d ../.config || mkdir ../.config
2168 cat >../.config/README <<EOF
2169 This directory created by Configure to save information that should
2170 persist across sessions for $package.
2172 You may safely delete it if you wish.
2175 : See if we are using a devel version and want that
2176 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2179 usedevel="$define" ;;
2180 *) case "$xversion" in
2183 *** WHOA THERE!!! ***
2185 This is an UNSTABLE DEVELOPMENT release.
2186 The version of this $package distribution is $xversion, that is, odd,
2187 (as opposed to even) and that signifies a development release.
2188 If you want a maintenance release, you want an even-numbered version.
2190 Do ***NOT*** install this into production use.
2191 Data corruption and crashes are possible.
2193 It is most seriously suggested that you do not continue any further
2194 unless you want to help in developing and debugging Perl.
2196 If you *still* want to build perl, you can answer 'y' now,
2197 or pass -Dusedevel to Configure.
2200 rp='Do you really want to continue?'
2204 [yY]) echo >&4 "Okay, continuing."
2205 usedevel="$define" ;;
2206 *) echo >&4 "Okay, bye."
2217 case "$versiononly" in
2218 '') versiononly="$define" ;;
2220 case "$installusrbinperl" in
2221 '') installusrbinperl="$undef" ;;
2226 : general instructions
2229 user=`(logname) 2>/dev/null`
2231 '') user=`whoami 2>&1`;;
2233 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2236 rp='Would you like to see the instructions?'
2247 This installation shell script will examine your system and ask you questions
2248 to determine how the perl5 package should be installed. If you get
2249 stuck on a question, you may use a ! shell escape to start a subshell or
2250 execute a command. Many of the questions will have default answers in square
2251 brackets; typing carriage return will give you the default.
2253 On some of the questions which ask for file or directory names you are allowed
2254 to use the ~name construct to specify the login directory belonging to "name",
2255 even if you don't have a shell which knows about that. Questions where this is
2256 allowed will be marked "(~name ok)".
2260 dflt='Type carriage return to continue'
2264 The prompter used in this script allows you to use shell variables and
2265 backticks in your answers. You may use $1, $2, etc... to refer to the words
2266 in the default answer, as if the default line was a set of arguments given to a
2267 script shell. This means you may also use $* to repeat the whole default line,
2268 so you do not have to re-type everything to add something to the default.
2270 Every time there is a substitution, you will have to confirm. If there is an
2271 error (e.g. an unmatched backtick), the default answer will remain unchanged
2272 and you will be prompted again.
2274 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2275 the questions and use the computed defaults (or the previous answers if there
2276 was already a config.sh file). Type 'Configure -h' for a list of options.
2277 You may also start interactively and then answer '& -d' at any prompt to turn
2278 on the non-interactive behaviour for the remainder of the execution.
2284 Much effort has been expended to ensure that this shell script will run on any
2285 Unix system. If despite that it blows up on yours, your best bet is to edit
2286 Configure and run it again. If you can't run Configure for some reason,
2287 you'll have to generate a config.sh file by hand. Whatever problems you
2288 have, let me (perlbug@perl.org) know how I blew it.
2290 This installation script affects things in two ways:
2292 1) it may do direct variable substitutions on some of the files included
2294 2) it builds a config.h file for inclusion in C programs. You may edit
2295 any of these files as the need arises after running this script.
2297 If you make a mistake on a question, there is no easy way to back up to it
2298 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2299 files. Configure will offer to let you do this before it runs the SH files.
2302 dflt='Type carriage return to continue'
2304 case "$firsttime" in
2305 true) echo $user >>../.config/instruct;;
2309 : find out where common programs are
2311 echo "Locating common programs..." >&4
2324 if test -d \$dir/\$thing; then
2330 for thisthing in \$dir/\$thing; do
2331 : just loop through to pick last item
2333 if test -f \$thisthing; then
2336 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2339 elif test -f \$dir/\$thing.exe; then
2340 if test -n "$DJGPP"; then
2341 echo \$dir/\$thing.exe
2342 elif test "$eunicefix" != ":"; then
2343 : on Eunice apparently
2396 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2397 pth="$pth /lib /usr/lib"
2398 for file in $loclist; do
2402 if test -f "$xxx"; then
2405 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2406 xxx=`./loc $file $file $pth`
2409 '') xxx=`./loc $file $file $pth`;;
2410 *) xxx=`./loc $xxx $xxx $pth`;;
2412 eval $file=$xxx$_exe
2416 echo $file is in $xxx.
2419 echo $file is in $xxx.
2422 echo "I don't know where '$file' is, and my life depends on it." >&4
2423 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2429 echo "Don't worry if any of the following aren't found..."
2431 for file in $trylist; do
2435 if test -f "$xxx"; then
2438 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2439 xxx=`./loc $file $file $pth`
2442 '') xxx=`./loc $file $file $pth`;;
2443 *) xxx=`./loc $xxx $xxx $pth`;;
2445 eval $file=$xxx$_exe
2449 echo $file is in $xxx.
2452 echo $file is in $xxx.
2455 echo "I don't see $file out there, $say."
2462 echo "Substituting grep for egrep."
2469 *) if $less -R </dev/null >/dev/null; then
2470 echo "Substituting less -R for less."
2478 echo "Substituting cp for ln."
2487 echo "I can't find make or gmake, and my life depends on it." >&4
2488 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2496 *) # We can't have osname yet.
2497 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2498 # Assume that gmake, if found, is definitely GNU make
2499 # and prefer it over the system make.
2500 echo "Substituting gmake for make."
2508 echo "Hopefully test is built into your sh."
2511 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2512 echo "Using the test built into your sh."
2520 echo "Hopefully echo is built into your sh."
2525 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2526 $echo $n "hi there$c" >foo1
2527 echo $n "hi there$c" >foo2
2528 if cmp foo1 foo2 >/dev/null 2>&1; then
2529 echo "They are compatible. In fact, they may be identical."
2536 They are not compatible! You are probably running ksh on a non-USG system.
2537 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2538 have echo built in and we may have to run some Bourne shell scripts. That
2539 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2542 $echo $n "The star should be here-->$c"
2549 # This question was auctioned at YAPC::Europe-2007 in Vienna
2550 # I never promised you could answer it. I only auctioned the question.
2552 The following message is sponsored by
2554 Dresden.pm<--The stars should be here.
2556 Dear Perl user, system administrator or package
2557 maintainer, the Perl community sends greetings to
2558 you. Do you (emblematical) greet back [Y/n]? n
2562 : Check what type of C compiler we use
2566 cat <<'EOSC' >>trygcc
2571 int main(int argc, char *argv[]) {
2575 if $cc -o try $ccflags $ldflags try.c; then
2578 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2584 # Skip this test because it gives a false match on output like:
2585 # ./trygcc: line 23: cc: command not found
2586 # case "`$cc -v -c try.c 2>&1`" in
2587 # *gcc*) trygcc=no ;;
2589 if $test X"$trygcc" = Xyes; then
2590 if gcc -o try -c try.c; then
2592 echo "You seem to have a working gcc, though." >&4
2593 # Switching compilers may undo the work of hints files.
2594 # The most common problem is -D_REENTRANT for threads.
2595 # This heuristic catches that case, but gets false positives
2596 # if -Dusethreads was not actually specified. Better to
2597 # bail out here with a useful message than fail
2598 # mysteriously later. Should we perhaps just try to
2599 # re-invoke Configure -Dcc=gcc config_args ?
2600 if $test -f usethreads.cbu; then
2603 *** However, any setting of the C compiler flags (e.g. for thread support)
2604 *** will be lost. It may be necessary for you to restart Configure and
2605 *** add -Dcc=gcc to your Configure command line.
2608 rp="Would you like to go ahead and try gcc anyway?"
2611 rp="Would you like to use it?"
2614 if $test -f myread; then
2617 if $test -f UU/myread; then
2620 echo "Cannot find myread, sorry. Aborting." >&2
2625 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2638 cat <<'EOSC' >>checkcc
2643 int main(int argc, char *argv[]) {
2647 if $cc -o try $ccflags $ldflags try.c; then
2650 if $test X"$despair" = Xyes; then
2651 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2654 You need to find a working C compiler.
2655 Either (purchase and) install the C compiler supplied by your OS vendor,
2656 or for a free C compiler try http://gcc.gnu.org/
2657 I cannot continue any further, aborting.
2666 : determine whether symbolic links are supported
2669 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2670 echo "Symbolic links are supported." >&4
2673 echo "Symbolic links are NOT supported." >&4
2678 : determine whether symbolic links are supported
2682 echo "Checking how to test for symbolic links..." >&4
2684 if $test "X$issymlink" = X; then
2686 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2687 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2689 if test $? = 0; then
2692 echo "Your builtin 'test -h' may be broken." >&4
2695 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2698 if test -f "$p/$test"; then
2707 echo "Trying external '$test -h'." >&4
2708 issymlink="$test -h"
2709 if $test ! -h sym >/dev/null 2>&1; then
2710 echo "External '$test -h' is broken, too." >&4
2718 if $test "X$issymlink" = X; then
2719 if $test -L sym 2>/dev/null; then
2720 issymlink="$test -L"
2721 echo "The builtin '$test -L' worked." >&4
2724 if $test "X$issymlink" != X; then
2725 echo "You can test for symbolic links with '$issymlink'." >&4
2727 echo "I do not know how you can test for symbolic links." >&4
2731 *) echo "No symbolic links, so not testing for their testing..." >&4
2736 : Make symlinks util
2737 case "$mksymlinks" in
2740 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2743 *) case "$lns:$issymlink" in
2744 *"ln"*" -s:"*"test -"?)
2745 echo "Creating the symbolic links..." >&4
2746 echo "(First creating the subdirectories...)" >&4
2748 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2750 test -z "$directory" && break
2754 if test ! -d t/base; then
2755 echo "Failed to create the subdirectories. Aborting." >&4
2758 echo "(Then creating the symlinks...)" >&4
2759 awk '{print $1}' $src/MANIFEST | while true; do
2761 test -z "$filename" && break
2762 if test -f $filename; then
2763 if $issymlink $filename; then
2767 if test -f $filename; then
2768 echo "$filename already exists, not symlinking."
2770 ln -s $src/$filename $filename
2774 if test ! -f t/base/lex.t; then
2775 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2780 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2788 : Check for Cross-Compilation
2789 case "$usecrosscompile" in
2791 $echo "Cross-compiling..."
2794 *-*-gcc) # A cross-compiling gcc, probably.
2795 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2797 # leave out ld, choosing it is more complex
2799 ranlib=$targetarch-ranlib
2800 $echo 'extern int foo;' > try.c
2801 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2803 if $test $# -gt 0; then
2805 incpth="`$echo $incpth|$sed 's/^ //'`"
2806 echo "Guessing incpth '$incpth'." >&4
2808 j="`$echo $i|$sed 's,/include$,/lib,'`"
2809 if $test -d $j; then
2813 libpth="`$echo $libpth|$sed 's/^ //'`"
2814 echo "Guessing libpth '$libpth'." >&4
2819 case "$targetarch" in
2820 '') echo "Targetarch not defined." >&4; croak=y ;;
2821 *) echo "Using targetarch $targetarch." >&4 ;;
2824 '') echo "Incpth not defined." >&4; croak=y ;;
2825 *) echo "Using incpth '$incpth'." >&4 ;;
2828 '') echo "Libpth not defined." >&4; croak=y ;;
2829 *) echo "Using libpth '$libpth'." >&4 ;;
2832 '') for i in $incpth; do
2833 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2835 echo "Guessing usrinc $usrinc." >&4
2840 '') echo "Usrinc not defined." >&4; croak=y ;;
2843 *) echo "Using usrinc $usrinc." >&4 ;;
2845 case "$targethost" in
2846 '') echo "Targethost not defined." >&4; croak=y ;;
2847 *) echo "Using targethost $targethost." >&4
2852 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2855 /*) run=$src/Cross/run
2856 targetmkdir=$src/Cross/mkdir
2858 from=$src/Cross/from
2860 *) pwd=`$test -f ../Configure & cd ..; pwd`
2862 targetmkdir=$pwd/Cross/mkdir
2864 from=$pwd/Cross/from
2867 case "$targetrun" in
2868 '') targetrun=ssh ;;
2873 case "$targetfrom" in
2874 '') targetfrom=scp ;;
2878 from=$from-$targetfrom
2879 case "$targetdir" in
2881 echo "Guessing targetdir $targetdir." >&4
2884 case "$targetuser" in
2886 echo "Guessing targetuser $targetuser." >&4
2889 case "$targetfrom" in
2893 case "$targetrun" in
2905 '') cwd=$targetdir ;;
2909 if $test ! -f \$exe.xok; then
2913 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2916 *) echo "Unknown targetrun '$targetrun'" >&4
2920 case "$targetmkdir" in
2922 cat >$targetmkdir <<EOF
2924 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2926 $chmod a+rx $targetmkdir
2928 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2940 $targetmkdir \`dirname \$f\`
2941 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2944 $targetmkdir $targetdir/\`dirname \$f\`
2945 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2958 $mkdir -p $targetdir/\`dirname \$f\`
2959 $cp \$f $targetdir/\$f || exit 1
2962 $targetmkdir $targetdir/\`dirname \$f\`
2963 $cp \$f $targetdir/\$f || exit 1
2970 *) echo "Unknown targetto '$targetto'" >&4
2974 case "$targetfrom" in
2981 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2986 cp) cat >$from <<EOF
2991 cp $targetdir/\$f . || exit 1
2996 *) echo "Unknown targetfrom '$targetfrom'" >&4
3000 if $test ! -f $run; then
3001 echo "Target 'run' script '$run' not found." >&4
3005 if $test ! -f $to; then
3006 echo "Target 'to' script '$to' not found." >&4
3010 if $test ! -f $from; then
3011 echo "Target 'from' script '$from' not found." >&4
3015 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3019 Using '$run' for remote execution,
3020 and '$from' and '$to'
3021 for remote file transfer.
3027 usecrosscompile='undef'
3032 : see whether [:lower:] and [:upper:] are supported character classes
3034 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3036 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3040 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3041 # (0xd9 and 0xe2), therefore that is a nice testing point.
3042 if test "X$up" = X -o "X$low" = X; then
3043 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3049 if test "X$up" = X -o "X$low" = X; then
3050 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3056 if test "X$up" = X -o "X$low" = X; then
3057 case "`echo RS | od -x 2>/dev/null`" in
3059 echo "Hey, this might be EBCDIC." >&4
3060 if test "X$up" = X -o "X$low" = X; then
3061 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3062 rs) up='[A-IJ-RS-Z]'
3067 if test "X$up" = X -o "X$low" = X; then
3068 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3078 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3080 echo "Using $up and $low to convert case." >&4
3083 echo "I don't know how to translate letters from upper to lower case." >&4
3084 echo "Your tr is not acting any way I know of." >&4
3088 : set up the translation script tr, must be called with ./tr of course
3092 '[A-Z][a-z]') exec $tr '$up' '$low';;
3093 '[a-z][A-Z]') exec $tr '$low' '$up';;
3100 : Try to determine whether config.sh was made on this system
3101 case "$config_sh" in
3103 myuname=`$uname -a 2>/dev/null`
3104 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3105 # Downcase everything to avoid ambiguity.
3106 # Remove slashes and single quotes so we can use parts of this in
3107 # directory and file names.
3108 # Remove newlines so myuname is sane to use elsewhere.
3109 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3110 # because the A-Z/a-z are not consecutive.
3111 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3112 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3113 newmyuname="$myuname"
3115 case "$knowitall" in
3117 if test -f ../config.sh; then
3118 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3119 eval "`grep myuname= ../config.sh`"
3121 if test "X$myuname" = "X$newmyuname"; then
3129 : Get old answers from old config file if Configure was run on the
3130 : same system, otherwise use the hints.
3133 if test -f config.sh; then
3135 rp="I see a config.sh file. Shall I use it to set the defaults?"
3138 n*|N*) echo "OK, I'll ignore it."
3139 mv config.sh config.sh.old
3140 myuname="$newmyuname"
3142 *) echo "Fetching default answers from your old config.sh file..." >&4
3150 : Older versions did not always set $sh. Catch re-use of such
3160 if test ! -f config.sh; then
3163 First time through, eh? I have some defaults handy for some systems
3164 that need some extra help getting the Configure answers right:
3167 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3169 : Half the following guesses are probably wrong... If you have better
3170 : tests or hints, please send them to perlbug@perl.org
3171 : The metaconfig authors would also appreciate a copy...
3172 $test -f /irix && osname=irix
3173 $test -f /xenix && osname=sco_xenix
3174 $test -f /dynix && osname=dynix
3175 $test -f /dnix && osname=dnix
3176 $test -f /lynx.os && osname=lynxos
3177 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3178 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3179 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3180 $test -f /bin/mips && /bin/mips && osname=mips
3181 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3182 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3183 $test -d /usr/apollo/bin && osname=apollo
3184 $test -f /etc/saf/_sactab && osname=svr4
3185 $test -d /usr/include/minix && osname=minix
3186 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3187 if $test -d /MachTen -o -d /MachTen_Folder; then
3189 if $test -x /sbin/version; then
3190 osvers=`/sbin/version | $awk '{print $2}' |
3191 $sed -e 's/[A-Za-z]$//'`
3192 elif $test -x /usr/etc/version; then
3193 osvers=`/usr/etc/version | $awk '{print $2}' |
3194 $sed -e 's/[A-Za-z]$//'`
3200 $test -f /sys/posix.dll &&
3201 $test -f /usr/bin/what &&
3202 set X `/usr/bin/what /sys/posix.dll` &&
3203 $test "$3" = UWIN &&
3207 if $test -f $uname; then
3215 umips) osname=umips ;;
3218 [23]100) osname=mips ;;
3219 next*) osname=next ;;
3221 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3222 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3225 elif $test -f /etc/kconfig; then
3227 if test "$lns" = "$ln -s"; then
3229 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3231 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3238 if test -n "$DJGPP"; then
3247 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3249 # oslevel can fail with:
3250 # oslevel: Unable to acquire lock.
3251 *not\ found) osvers="$4"."$3" ;;
3252 '<3240'|'<>3240') osvers=3.2.0 ;;
3253 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3254 '=3250'|'>3250') osvers=3.2.5 ;;
3258 bsd386) osname=bsd386
3261 cygwin*) osname=cygwin
3264 *dc.osx) osname=dcosx
3270 domainos) osname=apollo
3276 dragonfly) osname=dragonfly
3279 dynixptx*) osname=dynixptx
3280 osvers=`echo "$4"|sed 's/^v//'`
3282 freebsd) osname=freebsd
3284 genix) osname=genix ;;
3288 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3304 netbsd*) osname=netbsd
3307 news-os) osvers="$3"
3309 4*) osname=newsos4 ;;
3313 next*) osname=next ;;
3314 nonstop-ux) osname=nonstopux ;;
3315 openbsd) osname=openbsd
3321 POSIX-BC | posix-bc ) osname=posix-bc
3324 powerux | power_ux | powermax_os | powermaxos | \
3325 powerunix | power_unix) osname=powerux
3331 solaris) osname=solaris
3333 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3340 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3344 titanos) osname=titanos
3353 ultrix) osname=ultrix
3356 osf1|mls+) case "$5" in
3359 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3362 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3365 hp*) osname=hp_osf1 ;;
3366 mips) osname=mips_osf1 ;;
3369 # UnixWare 7.1.2 is known as Open UNIX 8
3370 openunix|unixware) osname=svr5
3378 $2) case "$osname" in
3382 : svr4.x or possibly later
3392 if test -f /stand/boot ; then
3393 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3394 if test -n "$INITPROG" -a -f "$INITPROG"; then
3395 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3396 if test -n "$isesix"; then
3404 *) if test -f /etc/systemid; then
3406 set `echo $3 | $sed 's/\./ /g'` $4
3407 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3409 elif $test -f $src/hints/sco_$1_$2.sh; then
3411 elif $test -f $src/hints/sco_$1.sh; then
3416 '') : Still unknown. Probably a generic Sys V.
3425 *) case "$osname" in
3426 '') : Still unknown. Probably a generic BSD.
3434 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3435 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3436 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3439 $rm -f UU/kernel.what
3440 elif test -d c:/. -o -n "$is_os2" ; then
3447 case "$targetarch" in
3450 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3455 : Now look for a hint file osname_osvers, unless one has been
3456 : specified already.
3459 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3460 : Also try without trailing minor version numbers.
3461 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3462 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3463 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3464 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3467 *) case "$osvers" in
3470 *) if $test -f $src/hints/$file.sh ; then
3472 elif $test -f $src/hints/$xfile.sh ; then
3474 elif $test -f $src/hints/$xxfile.sh ; then
3476 elif $test -f $src/hints/$xxxfile.sh ; then
3478 elif $test -f $src/hints/$xxxxfile.sh ; then
3480 elif $test -f "$src/hints/${osname}.sh" ; then
3489 if $test -f Policy.sh ; then
3492 none) dflt="Policy" ;;
3493 *) dflt="Policy $dflt" ;;
3498 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3502 if $test -f Policy.sh ; then
3505 There's also a Policy hint file available, which should make the
3506 site-specific (policy) questions easier to answer.
3513 You may give one or more space-separated answers, or "none" if appropriate.
3514 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3515 previous run of Configure, you may specify it as well as or instead of
3516 OS-specific hints. If hints are provided for your OS, you should use them:
3517 although Perl can probably be built without hints on many platforms, using
3518 hints often improve performance and may enable features that Configure can't
3519 set up on its own. If there are no hints that match your OS, specify "none";
3520 DO NOT give a wrong version or a wrong OS.
3524 rp="Which of these apply, if any?"
3527 for file in $tans; do
3528 if $test X$file = XPolicy -a -f Policy.sh; then
3530 $cat Policy.sh >> UU/config.sh
3531 elif $test -f $src/hints/$file.sh; then
3532 . $src/hints/$file.sh
3533 $cat $src/hints/$file.sh >> UU/config.sh
3534 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3537 : Give one chance to correct a possible typo.
3538 echo "$file.sh does not exist"
3540 rp="hint to use instead?"
3542 for file in $ans; do
3543 if $test -f "$src/hints/$file.sh"; then
3544 . $src/hints/$file.sh
3545 $cat $src/hints/$file.sh >> UU/config.sh
3546 elif $test X$ans = X -o X$ans = Xnone ; then
3549 echo "$file.sh does not exist -- ignored."
3556 : Remember our hint file for later.
3557 if $test -f "$src/hints/$file.sh" ; then
3567 echo "Fetching default answers from $config_sh..." >&4
3571 cp $config_sh config.sh 2>/dev/null
3581 test "$override" && . ./optdef.sh
3583 : Restore computed paths
3584 for file in $loclist $trylist; do
3585 eval $file="\$_$file"
3590 Configure uses the operating system name and version to set some defaults.
3591 The default value is probably right if the name rings a bell. Otherwise,
3592 since spelling matters for me, either accept the default or answer "none"
3599 ''|' '|none) dflt=none ;;
3600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3603 *) dflt="$osname" ;;
3605 rp="Operating system name?"
3609 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3615 ''|' '|none) dflt=none ;;
3616 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3617 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3619 ''|' ') dflt=none ;;
3624 *) dflt="$osvers" ;;
3626 rp="Operating system version?"
3636 : who configured the system
3637 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3640 cf_by=`(logname) 2>/dev/null`
3643 cf_by=`(whoami) 2>/dev/null`
3645 "") cf_by=unknown ;;
3650 : decide how portable to be. Allow command line overrides.
3651 case "$d_portable" in
3653 *) d_portable="$define" ;;
3656 : set up shell script to do ~ expansion
3662 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3665 if $test -f /bin/csh; then
3666 /bin/csh -f -c "glob \$1"
3671 name=\`$expr x\$1 : '..\([^/]*\)'\`
3672 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3673 if $test ! -d "\$dir"; then
3675 echo "\$me: can't locate home directory for: \$name" >&2
3680 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3696 : now set up to get a file name
3700 cat <<'EOSC' >>getfile
3716 : getfile will accept an answer from the comma-separated list
3717 : enclosed in parentheses even if it does not meet other criteria.
3718 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3719 fn=`echo $fn | sed 's/(.*)//'`
3725 loc_file=`expr $fn : '.*:\(.*\)'`
3726 fn=`expr $fn : '\(.*\):.*'`
3734 */*) fullpath=true;;
3743 *e*) exp_file=true;;
3746 *p*) nopath_ok=true;;
3751 *d*) type='Directory';;
3752 *l*) type='Locate';;
3757 Locate) what='File';;
3762 case "$d_portable" in
3770 while test "$type"; do
3775 true) rp="$rp (~name ok)";;
3778 if test -f UU/getfile.ok && \
3779 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3798 value=`UU/filexp $ans`
3801 if test "$ans" != "$value"; then
3802 echo "(That expands to $value on this system.)"
3816 /*) value="$ansexp" ;;
3817 [a-zA-Z]:/*) value="$ansexp" ;;
3822 echo "I shall only accept a full path name, as in /bin/ls." >&4
3823 echo "Use a ! shell escape if you wish to check pathnames." >&4
3826 echo "Please give a full path name, starting with slash." >&4
3829 echo "Note that using ~name is ok provided it expands well." >&4
3842 for fp in $gfpth; do
3843 if test "X$fp" = X.; then
3848 if test -f "$pf"; then
3850 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3852 echo "($value is not a plain file, but that's ok.)"
3855 if test X"$type" = X; then
3862 for fp in $gfpth; do
3863 if test "X$fp" = X.; then
3868 direxp="$fp/$ansexp"
3870 if test -d "$direxp"; then
3878 if test -d "$ansexp"; then
3879 echo "(Looking for $loc_file in directory $value.)"
3880 value="$value/$loc_file"
3881 ansexp="$ansexp/$loc_file"
3883 if test -f "$ansexp"; then
3886 case "$nopath_ok" in
3887 true) case "$value" in
3889 *) echo "Assuming $value will be in people's path."
3905 if test "$fastread" = yes; then
3910 rp="$what $value doesn't exist. Use that name anyway?"
3929 test "X$gfpthkeep" != Xy && gfpth=""
3932 : determine root of directory hierarchy where package will be installed.
3935 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3938 dflt=`echo "$prefix" | sed 's/.$//'`
3946 By default, $package will be installed in $dflt/bin, manual pages
3947 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3948 installation directories. Typically this is something like /usr/local.
3949 If you wish to have binaries under /usr/bin but other parts of the
3950 installation under /usr/local, that's ok: you will be prompted
3951 separately for each of the installation directories, the prefix being
3952 only used to set the defaults.
3956 rp='Installation prefix to use?'
3964 *) oldprefix="$prefix";;
3971 : allow them to override the AFS root
3974 *) afsroot=$afsroot ;;
3980 $define|true) afs=true ;;
3981 $undef|false) afs=false ;;
3982 *) if $test -d $afsroot; then
3990 echo "AFS may be running... I'll be extra cautious then..." >&4
3992 echo "AFS does not seem to be running..." >&4
3995 : determine installation prefix for where package is to be installed.
3999 Since you are running AFS, I need to distinguish the directory in which
4000 files will reside from the directory in which they are installed (and from
4001 which they are presumably copied to the former directory by occult means).
4004 case "$installprefix" in
4005 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4006 *) dflt="$installprefix";;
4011 In some special cases, particularly when building $package for distribution,
4012 it is convenient to distinguish the directory in which files should be
4013 installed from the directory ($prefix) in which they will
4014 eventually reside. For most users, these two directories are the same.
4017 case "$installprefix" in
4019 *) dflt=$installprefix;;
4023 rp='What installation prefix should I use for installing files?'
4025 installprefix="$ans"
4026 installprefixexp="$ansexp"
4028 : Perform the prefixexp/installprefixexp correction if necessary
4029 cat <<EOS >installprefix
4032 cat <<'EOSC' >>installprefix
4033 : Change installation prefix, if necessary.
4034 if $test X"$prefix" != X"$installprefix"; then
4035 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4037 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4040 chmod +x installprefix
4041 $eunicefix installprefix
4043 : Set variables such as privlib and privlibexp from the output of ./getfile
4044 : performing the prefixexp/installprefixexp correction if necessary.
4045 cat <<EOS >setprefixvar
4048 cat <<'EOSC' >>setprefixvar
4049 eval "${prefixvar}=\"\$ans\""
4050 eval "${prefixvar}exp=\"\$ansexp\""
4053 chmod +x setprefixvar
4054 $eunicefix setprefixvar
4056 : set up the script used to warn in case of inconsistency
4065 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4067 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4068 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4073 echo "*** WHOA THERE!!! ***" >&4
4074 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4077 rp=" Keep the $hint value?"
4080 y) td=$was; tu=$was;;
4084 : function used to set '$1' to '$val'
4085 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4087 $define$undef) . ./whoa; eval "$var=\$td";;
4088 $undef$define) . ./whoa; eval "$var=\$tu";;
4089 *) eval "$var=$val";;
4092 : get the patchlevel
4094 echo "Getting the current patchlevel..." >&4
4095 if $test -r $rsrc/patchlevel.h;then
4096 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4097 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4098 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4099 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4100 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4101 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4102 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4111 $echo "(You do not have patchlevel.h. Eek.)"
4113 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4114 version_patchlevel_string="version $patchlevel subversion $subversion"
4115 case "$perl_patchlevel" in
4117 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4118 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4122 $echo "(You have $package $version_patchlevel_string.)"
4126 : XXX Should be a Configure test for double-dots in filenames.
4127 version=`echo $revision $patchlevel $subversion | \
4128 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4129 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4130 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 version=`echo $revision $patchlevel $subversion | \
4134 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4135 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4136 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 : Special case the 5.005_xx maintenance series, which used 5.005
4140 : without any subversion label as a subdirectory in $sitelib
4141 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4142 api_versionstring='5.005'
4145 : Do we want threads support and if so, what type
4146 case "$usethreads" in
4147 $define|true|[yY]*) dflt='y';;
4148 *) # Catch case where user specified ithreads or 5005threads but
4149 # forgot -Dusethreads (A.D. 4/2002)
4150 case "$useithreads$use5005threads" in
4151 *$define*) dflt='y';;
4158 Perl can be built to take advantage of threads on some systems.
4159 To do so, Configure can be run with -Dusethreads.
4161 Note that Perl built with threading support runs slightly slower
4162 and uses more memory than plain Perl. The current implementation
4163 is believed to be stable, but it is fairly new, and so should be
4164 treated with caution.
4166 If this doesn't make any sense to you, just accept the default '$dflt'.
4168 rp='Build a threading Perl?'
4171 y|Y) val="$define" ;;
4177 if $test $patchlevel -lt 9; then
4178 case "$usethreads" in
4182 Since release 5.6, Perl has had two different threading implementations,
4183 the newer interpreter-based version (ithreads) with one interpreter per
4184 thread, and the older 5.005 version (5005threads).
4185 The 5005threads version is effectively unmaintained and will probably be
4186 removed in Perl 5.10, so there should be no need to build a Perl using it
4187 unless needed for backwards compatibility with some existing 5.005threads
4191 : Default to ithreads unless overridden on command line or with
4194 case "$use5005threads" in
4195 $define|true|[yY]*) dflt='n';;
4197 case "$useithreads" in
4198 $undef|false|[nN]*) dflt='n';;
4200 rp='Use the newer interpreter-based ithreads?'
4203 y|Y) val="$define" ;;
4208 : Now set use5005threads to the opposite value.
4209 case "$useithreads" in
4210 $define) val="$undef" ;;
4217 useithreads="$undef"
4218 use5005threads="$undef"
4222 case "$useithreads$use5005threads" in
4226 You cannot have both the ithreads and the 5.005 threads enabled
4227 at the same time. Disabling the 5.005 threads since they are
4228 much less stable than the ithreads.
4231 use5005threads="$undef"
4236 : perl-5.9.x and later
4238 if test X"$usethreads" = "X$define"; then
4239 case "$use5005threads" in
4243 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4250 use5005threads="$undef"
4251 useithreads="$usethreads"
4254 case "$d_oldpthreads" in
4255 '') : Configure tests would be welcome here. For now, assume undef.
4257 *) val="$d_oldpthreads" ;;
4263 : Look for a hint-file generated 'call-back-unit'. If the
4264 : user has specified that a threading perl is to be built,
4265 : we may need to set or change some other defaults.
4266 if $test -f usethreads.cbu; then
4267 echo "Your platform has some specific hints regarding threaded builds, using them..."
4270 case "$usethreads" in
4271 "$define"|true|[yY]*)
4273 (Your platform does not have any specific hints for threaded builds.
4274 Assuming POSIX threads, then.)
4280 : Check if multiplicity is required
4283 Perl can be built so that multiple Perl interpreters can coexist
4284 within the same Perl executable.
4287 case "$useithreads" in
4290 This multiple interpreter support is required for interpreter-based threads.
4294 *) case "$usemultiplicity" in
4295 $define|true|[yY]*) dflt='y';;
4299 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4300 rp='Build Perl for multiplicity?'
4303 y|Y) val="$define" ;;
4311 : Check if morebits is requested
4312 case "$usemorebits" in
4313 "$define"|true|[yY]*)
4314 use64bitint="$define"
4315 uselongdouble="$define"
4316 usemorebits="$define"
4318 *) usemorebits="$undef"
4322 : Determine the C compiler to be used
4328 rp="Use which C compiler?"
4332 : See whether they have no cc but they do have gcc
4334 if $test -f cc.cbu; then
4339 : make some quick guesses about what we are up against
4341 $echo $n "Hmm... $c"
4351 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4352 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4354 echo "Looks kind of like an OSF/1 system, but we'll see..."
4356 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4357 xxx=`./loc addbib blurfl $pth`
4358 if $test -f $xxx; then
4359 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4363 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like an extended USG system, but we'll see..."
4366 echo "Looks kind of like a USG system, but we'll see..."
4370 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4371 echo "Looks kind of like a BSD system, but we'll see..."
4375 echo "Looks kind of like a Version 7 system, but we'll see..."
4378 case "$eunicefix" in
4381 There is, however, a strange, musty smell in the air that reminds me of
4382 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4386 : it so happens the Eunice I know will not run shell scripts in Unix format
4390 echo "Congratulations. You aren't running Eunice."
4394 : Detect OS2. The p_ variable is set above in the Head.U unit.
4395 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4396 : semicolon as a patch separator
4401 I have the feeling something is not exactly right, however...don't tell me...
4402 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4403 (Or you may be running DOS with DJGPP.)
4408 if test -f /xenix; then
4409 echo "Actually, this looks more like a XENIX system..."
4414 echo "It's not Xenix..."
4419 if test -f /venix; then
4420 echo "Actually, this looks more like a VENIX system..."
4427 echo "Nor is it Venix..."
4430 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4431 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4434 : Check if we are using GNU gcc and what its version is
4436 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4440 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4442 printf("%s\n", __VERSION__);
4444 printf("%s\n", "1");
4450 if $cc -o try $ccflags $ldflags try.c; then
4451 gccversion=`$run ./try`
4452 case "$gccversion" in
4453 '') echo "You are not using GNU cc." ;;
4454 *) echo "You are using GNU cc $gccversion."
4460 echo "*** WHOA THERE!!! ***" >&4
4461 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4462 case "$knowitall" in
4464 echo " You'd better start hunting for one and let me know about it." >&4
4470 case "$gccversion" in
4471 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4473 case "$gccversion" in
4474 '') gccosandvers='' ;;
4475 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4476 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4478 case "$gccosandvers" in
4479 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4480 $osname$osvers) ;; # looking good
4481 $osname*) cat <<EOM >&4
4483 *** WHOA THERE!!! ***
4485 Your gcc has not been compiled for the exact release of
4486 your operating system ($gccosandvers versus $osname$osvers).
4488 In general it is a good idea to keep gcc synchronized with
4489 the operating system because otherwise serious problems
4490 may ensue when trying to compile software, like Perl.
4492 I'm trying to be optimistic here, though, and will continue.
4493 If later during the configuration and build icky compilation
4494 problems appear (headerfile conflicts being the most common
4495 manifestation), I suggest reinstalling the gcc to match
4496 your operating system release.
4500 *) gccosandvers='' ;; # failed to parse, better be silent
4508 # gcc 3.* complain about adding -Idirectories that they already know about,
4509 # so we will take those off from locincpth.
4510 case "$gccversion" in
4512 echo "main(){}">try.c
4513 for incdir in $locincpth; do
4514 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4515 grep '^c[cp]p*[01]: warning: changing search order '`
4516 if test "X$warn" != X; then
4517 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4523 : What should the include directory be ?
4525 $echo $n "Hmm... $c"
4529 if $test -f /bin/mips && /bin/mips; then
4530 echo "Looks like a MIPS system..."
4531 $cat >usr.c <<'EOCP'
4532 #ifdef SYSTYPE_BSD43
4536 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4537 dflt='/bsd43/usr/include'
4541 mips_type='System V'
4543 $rm -f usr.c usr.out
4544 echo "and you're compiling with the $mips_type compiler and libraries."
4548 echo "Doesn't look like a MIPS system."
4558 case "$xxx_prompt" in
4561 rp='Where are the include files you want to use?'
4569 : see how we invoke the C preprocessor
4571 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4572 cat <<'EOT' >testcpp.c
4578 if test ! -f cppstdin; then
4579 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4580 # AIX cc -E doesn't show the absolute headerfile
4581 # locations but we'll cheat by using the -M flag.
4582 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
4584 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4587 echo "Keeping your $hint cppstdin wrapper."
4590 wrapper=`pwd`/cppstdin
4594 if $test "X$cppstdin" != "X" && \
4595 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4598 echo "You used to use $cppstdin $cppminus so we'll use that again."
4600 '') echo "But let's see if we can live without a wrapper..." ;;
4602 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4603 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4605 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4608 echo "(However, $cpprun $cpplast does not work, let's see...)"
4616 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4623 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4624 $cc -E <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yup, it does."
4629 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4630 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "Yup, it does."
4635 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4636 $cc -P <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4638 echo "Yipee, that works!"
4641 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4642 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "At long last!"
4647 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4648 $cpp <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4653 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4654 $cpp - <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 echo "Hooray, it works! I was beginning to wonder."
4659 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4660 $wrapper <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4667 rp="No dice. I can't find a C preprocessor. Name one:"
4671 $x_cpp <testcpp.c >testcpp.out 2>&1
4672 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 echo "OK, that will do." >&4
4675 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4690 echo "Perhaps can we force $cc -E using a wrapper..."
4691 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4698 echo "Nope, we'll have to live without it..."
4712 "$wrapper"|'cppstdin') ;;
4713 *) $rm -f $wrapper;;
4715 $rm -f testcpp.c testcpp.out
4717 : Set private lib path
4720 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4725 '') dlist="$loclibpth $plibpth $glibpth";;
4726 *) dlist="$libpth";;
4729 : Now check and see which directories actually exist, avoiding duplicates
4733 if $test -d $xxx; then
4736 *) libpth="$libpth $xxx";;
4742 Some systems have incompatible or broken versions of libraries. Among
4743 the directories listed in the question below, please remove any you
4744 know not to be holding relevant libraries, and add any that are needed.
4745 Say "none" for none.
4756 rp="Directories to use for library searches?"
4763 : compute shared library extension
4766 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4776 On some systems, shared libraries may be available. Answer 'none' if
4777 you want to suppress searching of shared libraries for the remainder
4778 of this configuration.
4781 rp='What is the file extension used for shared libraries?'
4785 : Define several unixisms.
4786 : Hints files or command line option can be used to override them.
4787 : The convoluted testing is in case hints files set either the old
4790 '') case "$exe_ext" in
4792 *) _exe="$exe_ext" ;;
4797 '') case "$lib_ext" in
4804 '') case "$obj_ext" in
4811 '') case "$path_sep" in
4822 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4824 : Which makefile gets called first. This is used by make depend.
4825 case "$firstmakefile" in
4826 '') firstmakefile='makefile';;
4829 : Check is we will use socks
4831 $define|true|[yY]*) dflt='y';;
4836 Perl can be built to use the SOCKS proxy protocol library. To do so,
4837 Configure must be run with -Dusesocks. If you use SOCKS you also need
4838 to use the PerlIO abstraction layer, this will be implicitly selected.
4840 If this doesn't make any sense to you, just accept the default '$dflt'.
4842 rp='Build Perl for SOCKS?'
4845 y|Y) val="$define" ;;
4851 : Check for uselongdouble support
4853 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4856 case "$uselongdouble" in
4857 $define|true|[yY]*) dflt='y';;
4862 Perl can be built to take advantage of long doubles which
4863 (if available) may give more accuracy and range for floating point numbers.
4865 If this doesn't make any sense to you, just accept the default '$dflt'.
4867 rp='Try to use long doubles if available?'
4870 y|Y) val="$define" ;;
4876 case "$uselongdouble" in
4877 true|[yY]*) uselongdouble="$define" ;;
4880 : Look for a hint-file generated 'call-back-unit'. If the
4881 : user has specified that long doubles should be used,
4882 : we may need to set or change some other defaults.
4883 if $test -f uselongdouble.cbu; then
4884 echo "Your platform has some specific hints regarding long doubles, using them..."
4885 . ./uselongdouble.cbu
4887 case "$uselongdouble" in
4890 (Your platform does not have any specific hints for long doubles.)
4896 : Looking for optional libraries
4898 echo "Checking for optional libraries..." >&4
4903 case "$libswanted" in
4904 '') libswanted='c_s';;
4907 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4913 for thisdir in $libpth $xlibpth; do
4914 test -d $thisdir && libspath="$libspath $thisdir"
4916 for thislib in $libswanted; do
4917 for thisdir in $libspath; do
4919 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4920 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=shared
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib$thislib.$so
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=shared
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/$thislib$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/lib${thislib}_s$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4943 $test -f "$xxx" && thislib=${thislib}_s
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/Slib$thislib$_a
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=static
4950 if $test -f "$xxx"; then
4952 shared) echo "Found -l$thislib (shared)." ;;
4953 static) echo "Found -l$thislib." ;;
4954 *) echo "Found -l$thislib ($libstyle)." ;;
4958 *) dflt="$dflt -l$thislib"
4959 libsfound="$libsfound $xxx"
4961 libsfiles="$libsfiles $yyy"
4962 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4963 case " $libsdirs " in
4965 *) libsdirs="$libsdirs $yyy" ;;
4972 if $test ! -f "$xxx"; then
4973 echo "No -l$thislib."
4984 ' '|'') dflt='none';;
4989 In order to compile $package on your machine, a number of libraries
4990 are usually needed. Include any other special libraries here as well.
4991 Say "none" for none. The default list is almost always right.
4995 rp="What libraries to use?"
5002 : determine optimization, if desired, or use for debug flag also
5004 ' '|$undef) dflt='none';;
5006 *) dflt="$optimize";;
5010 By default, $package compiles with the -O flag to use the optimizer.
5011 Alternately, you might want to use the symbolic debugger, which uses
5012 the -g flag (on traditional Unix systems). Either flag can be
5013 specified here. To use neither flag, specify the word "none".
5016 rp="What optimizer/debugger flag should be used?"
5020 'none') optimize=" ";;
5023 : Check what DEBUGGING is required from the command line
5024 : -DEBUGGING or -DDEBUGGING or
5025 : -DEBUGGING=both = -g + -DDEBUGGING
5026 : -DEBUGGING=-g or -Doptimize=-g = -g
5027 : -DEBUGGING=none or -UDEBUGGING =
5028 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5031 *) DEBUGGING=$EBUGGING ;;
5034 case "$DEBUGGING" in
5038 *) optimize="$optimize -g" ;;
5042 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5050 case "$DEBUGGING" in
5051 both|$define) dflt='-DDEBUGGING'
5054 : argument order is deliberate, as the flag will start with - which set could
5055 : think is an option
5056 checkccflag='check=$1; flag=$2; callback=$3;
5058 echo "Checking if your compiler accepts $flag" 2>&1;
5059 echo "int main(void) { return 0; }" > gcctest.c;
5060 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5061 echo "Yes, it does." 2>&1;
5062 if $test -s gcctest.out ; then
5063 echo "But your platform does not like it:";
5068 echo "Leaving current flags $ccflags alone." 2>&1
5070 *) dflt="$dflt $flag";
5076 echo "Nope, it does not, but that is ok." 2>&1;
5080 : We will not override a previous value, but we might want to
5081 : augment a hint file
5083 default|recommended)
5084 case "$gccversion" in
5085 1*) dflt="$dflt -fpcc-struct-return" ;;
5087 case "$optimize:$DEBUGGING" in
5088 *-g*:old) dflt="$dflt -DDEBUGGING";;
5090 case "$gccversion" in
5091 2*) if $test -d /etc/conf/kconfig.d &&
5092 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5094 # Interactive Systems (ISC) POSIX mode.
5099 case "$gccversion" in
5102 ?*) set strict-aliasing -fno-strict-aliasing
5106 # For gcc, adding -pipe speeds up compilations for some, but apparently
5107 # some assemblers can't read from stdin. (It also slows down compilations
5108 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5109 case "$gccversion" in
5115 # on x86_64 (at least) we require an extra library (libssp) in the
5116 # link command line. This library is not named, so I infer that it is
5117 # an implementation detail that may change. Hence the safest approach
5118 # is to add the flag to the flags passed to the compiler at link time,
5119 # as that way the compiler can do the right implementation dependant
5121 case "$gccversion" in
5122 ?*) set stack-protector -fstack-protector
5129 case "$mips_type" in
5130 *BSD*|'') inclwanted="$locincpth $usrinc";;
5131 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5133 for thisincl in $inclwanted; do
5134 if $test -d $thisincl; then
5135 if $test x$thisincl != x$usrinc; then
5137 *" -I$thisincl "*);;
5138 *) dflt="$dflt -I$thisincl ";;
5144 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5146 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5154 *) dflt="$dflt -D$2";;
5158 set signal.h LANGUAGE_C; eval $inctest
5162 ccflags="$ccflags -DSOCKS"
5167 default|recommended) dflt="$ccflags $dflt" ;;
5168 *) dflt="$ccflags";;
5177 Your C compiler may want other flags. For this question you should include
5178 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5179 but you should NOT include libraries or ld flags like -lwhatever. If you
5180 want $package to honor its debug switch, you should include -DDEBUGGING here.
5181 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5183 To use no flags, specify the word "none".
5189 rp="Any additional cc flags?"
5196 : the following weeds options from ccflags that are of no interest to cpp
5198 '') cppflags="$ccflags" ;;
5199 *) cppflags="$cppflags $ccflags" ;;
5201 case "$gccversion" in
5202 1*) cppflags="$cppflags -D__GNUC__"
5204 case "$mips_type" in
5206 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5212 echo "Let me guess what the preprocessor flags are..." >&4
5226 *) ftry="$previous $flag";;
5228 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5229 >cpp1.out 2>/dev/null && \
5230 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5231 >cpp2.out 2>/dev/null && \
5232 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5233 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5235 cppflags="$cppflags $ftry"
5245 *-*) echo "They appear to be: $cppflags";;
5247 $rm -f cpp.c cpp?.out
5251 : flags used in final linking phase
5253 '') if ./venix; then
5259 *-posix*) dflt="$dflt -posix" ;;
5262 *) dflt="$ldflags";;
5264 # See note above about -fstack-protector
5266 *-fstack-protector*)
5268 *-fstack-protector*) ;; # Don't add it again
5269 *) dflt="$dflt -fstack-protector" ;;
5274 : Try to guess additional flags to pick up local libraries.
5275 for thislibdir in $libpth; do
5276 case " $loclibpth " in
5279 *"-L$thislibdir "*) ;;
5280 *) dflt="$dflt -L$thislibdir" ;;
5292 Your C linker may need flags. For this question you should
5293 include -L/whatever and any other flags used by the C linker, but you
5294 should NOT include libraries like -lwhatever.
5296 Make sure you include the appropriate -L/path flags if your C linker
5297 does not normally search all of the directories you specified above,
5300 To use no flags, specify the word "none".
5304 rp="Any additional ld flags (NOT including libraries)?"
5310 rmlist="$rmlist pdp11"
5314 echo "Checking your choice of C compiler and flags for coherency..." >&4
5315 $cat > try.c <<'EOF'
5317 int main() { printf("Ok\n"); return(0); }
5319 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5321 $cat >try.msg <<'EOM'
5322 I've tried to compile and run the following simple program:
5325 $cat try.c >> try.msg
5327 $cat >> try.msg <<EOM
5334 and I got the following output:
5338 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5339 if $sh -c "$run ./try " >>try.msg 2>&1; then
5343 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5346 cat >> try.msg <<'EOQS'
5347 If $libs contains -lsfio, and sfio is mis-configured, then it
5348 sometimes (apparently) runs and exits with a 0 status, but with no
5349 output! It may have to do with sfio's use of _exit vs. exit.
5352 rp="You have a big problem. Shall I abort Configure"
5359 echo "The program compiled OK, but exited with status $?." >>try.msg
5360 rp="You have a problem. Shall I abort Configure"
5364 echo "I can't compile the test program." >>try.msg
5365 rp="You have a BIG problem. Shall I abort Configure"
5371 case "$knowitall" in
5373 echo "(The supplied flags or libraries might be incorrect.)"
5381 *) echo "Ok. Stopping Configure." >&4
5386 n) echo "OK, that should do.";;
5388 $rm_try gcctest gcctest.out
5390 : define a shorthand compile call
5394 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5395 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5399 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5400 : define a shorthand compile call for compilations that should be ok.
5404 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5406 : determine filename position in cpp output
5408 echo "Computing filename position in cpp output for #include directives..." >&4
5410 vos) testaccess=-e ;;
5413 echo '#include <stdio.h>' > foo.c
5416 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5417 $grep '^[ ]*#.*stdio\.h' | \
5418 while read cline; do
5421 while $test \$# -gt 0; do
5422 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5427 pos=\`expr \$pos + 1\`
5439 *) pos="${fieldn}th";;
5441 echo "Your cpp writes the filename in the $pos field of the line."
5444 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5445 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5448 : locate header file
5453 for usrincdir in $usrinc
5455 if test -f \$usrincdir/\$wanted; then
5456 echo "\$usrincdir/\$wanted"
5460 awkprg='{ print \$$fieldn }'
5461 echo "#include <\$wanted>" > foo\$\$.c
5462 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5463 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5464 while read cline; do
5465 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5467 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5468 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5473 # status = 0: grep returned 0 lines, case statement not executed
5474 # status = 1: headerfile found
5475 # status = 2: while loop executed, no headerfile found
5479 if test \$status -eq 1; then
5486 : define an alternate in-header-list? function
5487 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5488 cont=true; xxf="echo \"<\$1> found.\" >&4";
5489 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5490 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5492 case $# in 4) instead=instead;; *) instead="at last";; esac;
5493 while $test "$cont"; do
5495 var=$2; eval "was=\$$2";
5496 if $test "$xxx" && $test -r "$xxx";
5498 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5501 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5502 set $yyy; shift; shift; yyy=$@;
5503 case $# in 0) cont="";;
5504 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5505 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5506 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5507 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5511 do set $yyy; var=$2; eval "was=\$$2";
5512 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5513 set $yyy; shift; shift; yyy=$@;
5516 : see if stdlib is available
5517 set stdlib.h i_stdlib
5520 : check for lengths of integral types
5524 echo "Checking to see how big your integers are..." >&4
5533 printf("intsize=%d;\n", (int)sizeof(int));
5534 printf("longsize=%d;\n", (int)sizeof(long));
5535 printf("shortsize=%d;\n", (int)sizeof(short));
5540 if eval $compile_ok && $run ./try > /dev/null; then
5542 echo "Your integers are $intsize bytes long."
5543 echo "Your long integers are $longsize bytes long."
5544 echo "Your short integers are $shortsize bytes long."
5548 Help! I can't compile and run the intsize test program: please enlighten me!
5549 (This is probably a misconfiguration in your system or libraries, and
5550 you really ought to fix it. Still, I'll try anyway.)
5554 rp="What is the size of an integer (in bytes)?"
5558 rp="What is the size of a long integer (in bytes)?"
5562 rp="What is the size of a short integer (in bytes)?"
5570 : check for long long
5572 echo "Checking to see if you have long long..." >&4
5573 echo 'int main() { long long x = 7; return 0; }' > try.c
5575 if eval $compile; then
5577 echo "You have long long."
5580 echo "You do not have long long."
5586 : check for length of long long
5587 case "${d_longlong}${longlongsize}" in
5590 echo "Checking to see how big your long longs are..." >&4
5591 $cat >try.c <<'EOCP'
5595 printf("%d\n", (int)sizeof(long long));
5600 if eval $compile_ok; then
5601 longlongsize=`$run ./try`
5602 echo "Your long longs are $longlongsize bytes long."
5606 echo "(I can't seem to compile the test program. Guessing...)"
5607 rp="What is the size of a long long (in bytes)?"
5611 if $test "X$longsize" = "X$longlongsize"; then
5612 echo "(That isn't any different from an ordinary long.)"
5618 : see if inttypes.h is available
5619 : we want a real compile instead of Inhdr because some systems
5620 : have an inttypes.h which includes non-existent headers
5623 #include <inttypes.h>
5625 static int32_t foo32 = 0x12345678;
5629 if eval $compile; then
5630 echo "<inttypes.h> found." >&4
5633 echo "<inttypes.h> NOT found." >&4
5642 echo "Checking to see if you have int64_t..." >&4
5644 #include <sys/types.h>
5645 #$i_inttypes I_INTTYPES
5647 #include <inttypes.h>
5649 int main() { int64_t x = 7; }
5652 if eval $compile; then
5654 echo "You have int64_t."
5657 echo "You do not have int64_t."
5663 : Check if 64bit ints have a quad type
5665 echo "Checking which 64-bit integer type we could use..." >&4
5671 val='"unsigned int"'
5676 *) case "$longsize" in
5680 val='"unsigned long"'
5685 *) case "$d_longlong:$longlongsize" in
5690 val='"unsigned long long"'
5695 *) case "$d_int64_t" in
5714 '') echo "Alas, no 64-bit integer types in sight." >&4
5717 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5722 : Do we want 64bit support
5723 case "$uselonglong" in
5724 "$define"|true|[yY]*)
5727 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5729 use64bitint="$define"
5732 case "$use64bits" in
5733 "$define"|true|[yY]*)
5736 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5738 use64bitint="$define"
5741 case "$use64bitints" in
5742 "$define"|true|[yY]*)
5745 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5747 use64bitint="$define"
5750 case "$use64bitsint" in
5751 "$define"|true|[yY]*)
5754 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5756 use64bitint="$define"
5759 case "$uselonglongs" in
5760 "$define"|true|[yY]*)
5763 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5765 use64bitint="$define"
5768 case "$use64bitsall" in
5769 "$define"|true|[yY]*)
5772 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5774 use64bitall="$define"
5779 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5781 case "$use64bitall" in
5782 "$define"|true|[yY]*) use64bitint="$define" ;;
5788 You have natively 64-bit long integers.
5792 *) case "$use64bitint" in
5793 "$define"|true|[yY]*) dflt='y';;
5802 Perl can be built to take advantage of 64-bit integer types
5803 on some systems. To do so, Configure can be run with -Duse64bitint.
5804 Choosing this option will most probably introduce binary incompatibilities.
5806 If this doesn't make any sense to you, just accept the default '$dflt'.
5807 (The default has been chosen based on your configuration.)
5809 rp='Try to use 64-bit integers, if available?'
5812 [yY]*) val="$define" ;;
5820 case "$use64bitall" in
5821 "$define"|true|[yY]*) dflt='y' ;;
5822 *) case "$longsize" in
5830 You may also choose to try maximal 64-bitness. It means using as much
5831 64-bitness as possible on the platform. This in turn means even more
5832 binary incompatibilities. On the other hand, your platform may not
5833 have any more 64-bitness available than what you already have chosen.
5835 If this doesn't make any sense to you, just accept the default '$dflt'.
5836 (The default has been chosen based on your configuration.)
5838 rp='Try to use maximal 64-bit support, if available?'
5841 [yY]*) val="$define" ;;
5846 case "$use64bitall" in
5848 case "$use64bitint" in
5852 Since you have chosen a maximally 64-bit build, I'm also turning on
5853 the use of 64-bit integers.
5855 use64bitint="$define" ;;
5860 : Look for a hint-file generated 'call-back-unit'. If the
5861 : user has specified that a 64-bit perl is to be built,
5862 : we may need to set or change some other defaults.
5863 if $test -f use64bitint.cbu; then
5864 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5867 case "$use64bitint" in
5868 "$define"|true|[yY]*)
5870 4) case "$archname64" in
5871 '') archname64=64int ;;
5878 : Look for a hint-file generated 'call-back-unit'. If the
5879 : user has specified that a maximally 64-bit perl is to be built,
5880 : we may need to set or change some other defaults.
5881 if $test -f use64bitall.cbu; then
5882 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5885 case "$use64bitall" in
5886 "$define"|true|[yY]*)
5888 4) case "$archname64" in
5889 ''|64int) archname64=64all ;;
5896 case "$d_quad:$use64bitint" in
5900 *** You have chosen to use 64-bit integers,
5901 *** but none can be found.
5902 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5903 *** Cannot continue, aborting.
5910 : check for length of double
5912 case "$doublesize" in
5914 echo "Checking to see how big your double precision numbers are..." >&4
5923 printf("%d\n", (int)sizeof(double));
5928 if eval $compile_ok; then
5929 doublesize=`$run ./try`
5930 echo "Your double is $doublesize bytes long."
5933 echo "(I can't seem to compile the test program. Guessing...)"
5934 rp="What is the size of a double precision number (in bytes)?"
5942 : check for long doubles
5944 echo "Checking to see if you have long double..." >&4
5945 echo 'int main() { long double x = 7.0; }' > try.c
5947 if eval $compile; then
5949 echo "You have long double."
5952 echo "You do not have long double."
5958 : check for length of long double
5959 case "${d_longdbl}${longdblsize}" in
5962 echo "Checking to see how big your long doubles are..." >&4
5963 $cat >try.c <<'EOCP'
5967 printf("%d\n", sizeof(long double));
5972 if eval $compile; then
5973 longdblsize=`$run ./try`
5974 echo "Your long doubles are $longdblsize bytes long."
5978 echo "(I can't seem to compile the test program. Guessing...)" >&4
5979 rp="What is the size of a long double (in bytes)?"
5983 if $test "X$doublesize" = "X$longdblsize"; then
5984 echo "That isn't any different from an ordinary double."
5985 echo "I'll keep your setting anyway, but you may see some"
5986 echo "harmless compilation warnings."
5992 : determine the architecture name
5994 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5995 tarch=`arch`"-$osname"
5996 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5997 if uname -m > tmparch 2>&1 ; then
5998 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5999 -e 's/$/'"-$osname/" tmparch`
6007 case "$myarchname" in
6010 echo "(Your architecture name used to be $myarchname.)"
6014 case "$targetarch" in
6016 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6021 *) dflt="$archname";;
6023 rp='What is your architecture name'
6027 : optionally add API version to the architecture for versioned archlibs
6028 case "$useversionedarchname" in
6029 $define|true|[yY]*) dflt='y';;
6032 rp='Add the Perl API version to your archname?'
6035 y|Y) useversionedarchname="$define" ;;
6036 *) useversionedarchname="$undef" ;;
6038 case "$useversionedarchname" in
6041 *-$api_versionstring)
6042 echo "...and architecture name already has -$api_versionstring" >&4
6045 archname="$archname-$api_versionstring"
6046 echo "...setting architecture name to $archname." >&4
6052 case "$usethreads" in
6054 echo "Threads selected." >&4
6056 *-thread*) echo "...and architecture name already has -thread." >&4
6058 *) archname="$archname-thread"
6059 echo "...setting architecture name to $archname." >&4
6064 case "$usemultiplicity" in
6066 echo "Multiplicity selected." >&4
6068 *-multi*) echo "...and architecture name already has -multi." >&4
6070 *) archname="$archname-multi"
6071 echo "...setting architecture name to $archname." >&4
6076 case "$use64bitint$use64bitall" in
6078 case "$archname64" in
6080 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6083 case "$use64bitint" in
6084 "$define") echo "64 bit integers selected." >&4 ;;
6086 case "$use64bitall" in
6087 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6090 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6092 *) archname="$archname-$archname64"
6093 echo "...setting architecture name to $archname." >&4
6099 case "$uselongdouble" in
6101 echo "Long doubles selected." >&4
6102 case "$longdblsize" in
6104 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6108 *-ld*) echo "...and architecture name already has -ld." >&4
6110 *) archname="$archname-ld"
6111 echo "...setting architecture name to $archname." >&4
6118 if $test -f archname.cbu; then
6119 echo "Your platform has some specific hints for architecture name, using them..."
6123 : set the prefixit variable, to compute a suitable default value
6124 prefixit='case "$3" in
6126 case "$oldprefix" in
6127 "") eval "$1=\"\$$2\"";;
6134 ""|" ") eval "$1=\"\$$2\"";;
6140 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6142 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6143 /*-$oldprefix/*|\~*-$oldprefix/*)
6144 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6145 *) eval "$1=\"\$$2\"";;
6149 : determine installation style
6150 : For now, try to deduce it from prefix unless it is already set.
6151 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6152 case "$installstyle" in
6153 '') case "$prefix" in
6154 *perl*) dflt='lib';;
6155 *) dflt='lib/perl5' ;;
6158 *) dflt="$installstyle" ;;
6160 : Probably not worth prompting for this since we prompt for all
6161 : the directories individually, and the prompt would be too long and
6165 : determine where public executables go
6170 rp='Pathname where the public executables will reside?'
6172 if $test "X$ansexp" != "X$binexp"; then
6176 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6177 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6178 : this via initialinstalllocation
6181 case "$userelocatableinc" in
6182 $define|true|[yY]*) dflt='y' ;;
6187 Would you like to build Perl so that the installation is relocatable, so that
6188 library paths in @INC are determined relative to the path of the perl binary?
6189 This is not advised for system Perl installs, or if you need to run setid
6190 scripts or scripts under taint mode.
6192 If this doesn't make any sense to you, just accept the default '$dflt'.
6194 rp='Use relocatable @INC?'
6197 y|Y) val="$define" ;;
6200 set userelocatableinc
6203 initialinstalllocation="$binexp"
6204 : Default prefix is now "up one level from where the binaries are"
6205 case "$userelocatableinc" in
6211 installprefixexp=".../.."
6215 : determine where private library files go
6216 : Usual default is /usr/local/lib/perl5/$version.
6217 : Also allow things like /opt/perl/lib/$version, since
6218 : /opt/perl/lib/perl5... would be redundant.
6219 : The default "style" setting is made in installstyle.U
6220 case "$installstyle" in
6221 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6222 *) set dflt privlib lib/$version ;;
6227 There are some auxiliary files for $package that need to be put into a
6228 private library directory that is accessible by everyone.
6233 rp='Pathname where the private library files will reside?'
6238 : set the prefixup variable, to restore leading tilda escape
6239 prefixup='case "$prefixexp" in
6241 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6244 : determine where public architecture dependent libraries go
6247 : privlib default is /usr/local/lib/$package/$version
6248 : archlib default is /usr/local/lib/$package/$version/$archname
6249 : privlib may have an optional trailing /share.
6250 tdflt=`echo $privlib | $sed 's,/share$,,'`
6251 tdflt=$tdflt/$archname
6260 $spackage contains architecture-dependent library files. If you are
6261 sharing libraries in a heterogeneous environment, you might store
6262 these files in a separate location. Otherwise, you can just include
6263 them with the rest of the public library files.
6268 rp='Where do you want to put the public architecture-dependent libraries?'
6272 if $test X"$archlib" = X"$privlib"; then
6278 : see if setuid scripts can be secure
6281 Some kernels have a bug that prevents setuid #! scripts from being
6282 secure. Some sites have disabled setuid #! scripts because of this.
6284 First let's decide if your kernel supports secure setuid #! scripts.
6285 (If setuid #! scripts would be secure but have been disabled anyway,
6286 don't say that they are secure if asked.)
6291 if $test -d /dev/fd; then
6292 echo "#!$ls" >reflect
6293 chmod +x,u+s reflect
6294 ./reflect >flect 2>&1
6295 if $contains "/dev/fd" flect >/dev/null; then
6296 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6300 If you are not sure if they are secure, I can check but I'll need a
6301 username and password different from the one you are using right now.
6302 If you don't have such a username or don't want me to test, simply
6306 rp='Other username to test security of setuid scripts with?'
6311 case "$d_suidsafe" in
6312 '') echo "I'll assume setuid scripts are *not* secure." >&4
6315 echo "Well, the $hint value is *not* secure." >&4
6317 *) echo "Well, the $hint value *is* secure." >&4
6322 $rm -f reflect flect
6323 echo "#!$ls" >reflect
6324 chmod +x,u+s reflect
6327 echo '"su" will (probably) prompt you for '"$ans's password."
6328 su $ans -c './reflect >flect'
6329 if $contains "/dev/fd" flect >/dev/null; then
6330 echo "Okay, it looks like setuid scripts are secure." >&4
6333 echo "I don't think setuid scripts are secure." >&4
6338 rp='Does your kernel have *secure* setuid scripts?'
6341 [yY]*) val="$define";;
6346 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6347 echo "(That's for file descriptors, not floppy disks.)"
6353 $rm -f reflect flect
6355 : now see if they want to do setuid emulation
6356 if $test $patchlevel -lt 11; then
6359 case "$d_suidsafe" in
6362 echo "No need to emulate SUID scripts since they are secure here." >&4
6366 Some systems have disabled setuid scripts, especially systems where
6367 setuid scripts cannot be secure. On systems where setuid scripts have
6368 been disabled, the setuid/setgid bits on scripts are currently
6369 useless. It is possible for $package to detect those bits and emulate
6370 setuid/setgid in a secure fashion. This emulation will only work if
6371 setuid scripts have been disabled in your kernel.
6375 "$define") dflt=y ;;
6378 rp="Do you want to do setuid/setgid emulation?"
6381 [yY]*) val="$define";;
6393 SUID emulation has been removed for 5.12
6394 Please re-run Configure without -Dd_dosuid
6403 : Find perl5.005 or later.
6404 echo "Looking for a previously installed perl5.005 or later... "
6406 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6407 : Check if this perl is recent and can load a simple module
6408 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6411 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6421 '') echo "None found. That's ok.";;
6422 *) echo "Using $perl5." ;;
6425 : Set the siteprefix variables
6428 After $package is installed, you may wish to install various
6429 add-on modules and utilities. Typically, these add-ons will
6430 be installed under $prefix with the rest
6431 of this package. However, you may wish to install such add-ons
6432 elsewhere under a different prefix.
6434 If you do not wish to put everything under a single prefix, that's
6435 ok. You will be prompted for the individual locations; this siteprefix
6436 is only used to suggest the defaults.
6438 The default should be fine for most people.
6442 rp='Installation prefix to use for add-on modules and utilities?'
6443 : XXX Here might be another good place for an installstyle setting.
6444 case "$siteprefix" in
6446 *) dflt=$siteprefix ;;
6449 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6451 case "$siteprefix" in
6455 *) oldsiteprefix="$prefix";;
6460 siteprefixexp="$ansexp"
6462 : determine where site specific libraries go.
6463 : Usual default is /usr/local/lib/perl5/site_perl/$version
6464 : The default "style" setting is made in installstyle.U
6465 : XXX No longer works with Prefixit stuff.
6466 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6468 '') case "$installstyle" in
6469 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6470 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6478 The installation process will create a directory for
6479 site-specific extensions and modules. Most users find it convenient
6480 to place all site-specific files in this directory rather than in the
6481 main distribution directory.
6485 rp='Pathname for the site-specific library files?'
6489 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6491 : Determine list of previous versions to include in @INC
6492 $cat > getverlist <<EOPL
6495 \$api_versionstring = "$api_versionstring";
6496 \$version = "$version";
6497 \$stem = "$sitelib_stem";
6498 \$archname = "$archname";
6500 $cat >> getverlist <<'EOPL'
6501 # The list found is store twice for each entry: the original name, and
6502 # the binary broken down version as pack "sss", so sorting is easy and
6503 # unambiguous. This will work for all versions that have a maximum of
6504 # three digit groups, separate by '.'s or '_'s. Names are extended with
6505 # ".0.0" to ensure at least three elements for the pack.
6506 # -- H.Merijn Brand (m)'06 23-10-2006
6508 # Can't have leading @ because metaconfig interprets it as a command!
6509 ;@inc_version_list=();
6510 # XXX Redo to do opendir/readdir?
6513 ;@candidates = map {
6514 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6515 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6521 ($pversion, $aversion, $vsn5005) = map {
6522 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6523 foreach $d (@candidates) {
6524 if ($d->[1] lt $pversion) {
6525 if ($d->[1] ge $aversion) {
6526 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6528 elsif ($d->[1] ge $vsn5005) {
6529 unshift(@inc_version_list, grep { -d } $d->[0]);
6533 # Skip newer version. I.e. don't look in
6534 # 5.7.0 if we're installing 5.6.1.
6538 if (@inc_version_list) {
6539 print join(' ', @inc_version_list);
6542 # Blank space to preserve value for next Configure run.
6547 case "$inc_version_list" in
6548 '') if test -x "$perl5$exe_ext"; then
6549 dflt=`$perl5 getverlist`
6554 $undef) dflt='none' ;;
6555 *) eval dflt=\"$inc_version_list\" ;;
6558 ''|' ') dflt=none ;;
6565 In order to ease the process of upgrading, this version of perl
6566 can be configured to use modules built and installed with earlier
6567 versions of perl that were installed under $prefix. Specify here
6568 the list of earlier versions that this version of perl should check.
6569 If Configure detected no earlier versions of perl installed under
6570 $prefix, then the list will be empty. Answer 'none' to tell perl
6571 to not search earlier versions.
6573 The default should almost always be sensible, so if you're not sure,
6574 just accept the default.
6577 rp='List of earlier versions to include in @INC?'
6580 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6581 *) inc_version_list="$ans" ;;
6583 case "$inc_version_list" in
6585 inc_version_list_init='0'
6586 d_inc_version_list="$undef"
6588 *) inc_version_list_init=`echo $inc_version_list |
6589 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6590 d_inc_version_list="$define"
6595 : see if malloc/malloc.h has to be included
6596 set malloc/malloc.h i_mallocmalloc
6599 : see if this is a malloc.h system
6600 : we want a real compile instead of Inhdr because some systems have a
6601 : malloc.h that just gives a compile error saying to use stdlib.h instead
6606 #$i_mallocmalloc I_MALLOCMALLOC
6607 #ifdef I_MALLOCMALLOC
6608 # include <malloc/malloc.h>
6611 int main () { return 0; }
6614 if eval $compile; then
6615 echo "<malloc.h> found." >&4
6618 echo "<malloc.h> NOT found." >&4
6625 : check for void type
6627 echo "Checking to see how well your C compiler groks the void type..." >&4
6628 case "$voidflags" in
6640 extern void moo(); /* function returning void */
6641 void (*goo)(); /* ptr to func returning void */
6643 void *hue; /* generic ptr */
6656 int main() { sub(); }
6658 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6659 voidflags=$defvoidused
6660 echo "Good. It appears to support void to the level $package wants.">&4
6661 if $contains warning .out >/dev/null 2>&1; then
6662 echo "However, you might get some warnings that look like this:"
6666 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6667 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6668 echo "It supports 1..."
6669 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6670 echo "It also supports 2..."
6671 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6673 echo "And it supports 4 but not 8 definitely."
6675 echo "It doesn't support 4..."
6676 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6678 echo "But it supports 8."
6681 echo "Neither does it support 8."
6685 echo "It does not support 2..."
6686 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6688 echo "But it supports 4 and 8."
6690 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6692 echo "And it supports 4 but has not heard about 8."
6694 echo "However it supports 8 but not 4."
6699 echo "There is no support at all for void."
6704 case "$voidflags" in
6707 Support flag bits are:
6708 1: basic void declarations.
6709 2: arrays of pointers to functions returning void.
6710 4: operations between pointers to and addresses of void functions.
6711 8: generic void pointers.
6714 rp="Your void support flags add up to what?"
6721 : check for length of pointer
6725 echo "Checking to see how big your pointers are..." >&4
6726 if test "$voidflags" -gt 7; then
6727 echo '#define VOID_PTR char *' > try.c
6729 echo '#define VOID_PTR void *' > try.c
6739 printf("%d\n", (int)sizeof(VOID_PTR));
6744 if eval $compile_ok; then
6745 ptrsize=`$run ./try`
6746 echo "Your pointers are $ptrsize bytes long."
6749 echo "(I can't seem to compile the test program. Guessing...)" >&4
6750 rp="What is the size of a pointer (in bytes)?"
6757 case "$use64bitall" in
6758 "$define"|true|[yY]*)
6762 *** You have chosen a maximally 64-bit build,
6763 *** but your pointers are only 4 bytes wide.
6764 *** Please rerun Configure without -Duse64bitall.
6769 *** Since you have quads, you could possibly try with -Duse64bitint.
6774 *** Cannot continue, aborting.
6785 : determine whether to use malloc wrapping
6787 case "$usemallocwrap" in
6788 [yY]*|true|$define) dflt='y' ;;
6789 [nN]*|false|$undef) dflt='n' ;;
6790 *) case "$usedevel" in
6791 [yY]*|true|$define) dflt='y' ;;
6796 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6798 usemallocwrap="$ans"
6801 usemallocwrap="$define" ;;
6803 usemallocwrap="$undef" ;;
6806 : determine which malloc to compile in
6808 case "$usemymalloc" in
6809 [yY]*|true|$define) dflt='y' ;;
6810 [nN]*|false|$undef) dflt='n' ;;
6811 *) case "$ptrsize" in
6815 if test "$useithreads" = "$define"; then dflt='n'; fi
6818 rp="Do you wish to attempt to use the malloc that comes with $package?"
6824 mallocsrc='malloc.c'
6825 mallocobj="malloc$_o"
6826 d_mymalloc="$define"
6829 : Remove malloc from list of libraries to use
6830 echo "Removing unneeded -lmalloc from library list" >&4
6831 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6834 echo "libs = $libs" >&4
6846 : compute the return types of malloc and free
6848 $cat >malloc.c <<END
6852 #include <sys/types.h>
6866 case "$malloctype" in
6868 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6875 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6879 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6886 echo "Your system uses $freetype free(), it would seem." >&4
6888 : determine where site specific architecture-dependent libraries go.
6889 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6890 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6891 : sitelib may have an optional trailing /share.
6893 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6894 dflt="$dflt/$archname"
6899 set sitearch sitearch none
6903 The installation process will also create a directory for
6904 architecture-dependent site-specific extensions and modules.
6908 rp='Pathname for the site-specific architecture-dependent library files?'
6912 if $test X"$sitearch" = X"$sitelib"; then
6915 d_sitearch="$define"
6918 : Set the vendorprefix variables
6921 The installation process will also create a directory for
6922 vendor-supplied add-ons. Vendors who supply perl with their system
6923 may find it convenient to place all vendor-supplied files in this
6924 directory rather than in the main distribution directory. This will
6925 ease upgrades between binary-compatible maintenance versions of perl.
6927 Of course you may also use these directories in whatever way you see
6928 fit. For example, you might use them to access modules shared over a
6929 company-wide network.
6931 The default answer should be fine for most people.
6932 This causes further questions about vendor add-ons to be skipped
6933 and no vendor-specific directories will be configured for perl.
6936 rp='Do you want to configure vendor-specific add-on directories?'
6937 case "$usevendorprefix" in
6938 define|true|[yY]*) dflt=y ;;
6939 *) : User may have set vendorprefix directly on Configure command line.
6940 case "$vendorprefix" in
6949 rp='Installation prefix to use for vendor-supplied add-ons?'
6950 case "$vendorprefix" in
6951 '') dflt="$prefix" ;;
6952 *) dflt=$vendorprefix ;;
6955 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6957 case "$vendorprefix" in
6961 *) oldvendorprefix="$prefix";;
6965 usevendorprefix="$define"
6967 vendorprefixexp="$ansexp"
6969 *) usevendorprefix="$undef"
6975 : Set the vendorlib variables
6976 case "$vendorprefix" in
6977 '') d_vendorlib="$undef"
6981 *) d_vendorlib="$define"
6982 : determine where vendor-supplied modules go.
6983 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6984 case "$vendorlib" in
6986 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6987 case "$installstyle" in
6988 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6989 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6992 *) dflt="$vendorlib"
6996 rp='Pathname for the vendor-supplied library files?'
6999 vendorlibexp="$ansexp"
7002 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7006 : Set the vendorarch variables
7007 case "$vendorprefix" in
7008 '') d_vendorarch="$undef"
7012 *) d_vendorarch="$define"
7013 : determine where vendor-supplied architecture-dependent libraries go.
7014 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7015 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7016 : vendorlib may have an optional trailing /share.
7017 case "$vendorarch" in
7018 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7019 dflt="$dflt/$archname"
7021 *) dflt="$vendorarch" ;;
7024 rp='Pathname for vendor-supplied architecture-dependent files?'
7027 vendorarchexp="$ansexp"
7030 prefixvar=vendorarch
7032 if $test X"$vendorarch" = X"$vendorlib"; then
7033 d_vendorarch="$undef"
7035 d_vendorarch="$define"
7038 : Final catch-all directories to search
7041 Lastly, you can have perl look in other directories for extensions and
7042 modules in addition to those already specified.
7043 These directories will be searched after
7047 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7048 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7050 case "$otherlibdirs" in
7051 ''|' ') dflt='none' ;;
7052 *) dflt="$otherlibdirs" ;;
7055 Enter a colon-separated set of extra paths to include in perl's @INC
7056 search path, or enter 'none' for no extra paths.
7060 rp='Colon-separated list of additional directories for perl to search?'
7063 ' '|''|none) otherlibdirs=' ' ;;
7064 *) otherlibdirs="$ans" ;;
7066 case "$otherlibdirs" in
7070 set d_perl_otherlibdirs
7073 : Cruising for prototypes
7075 echo "Checking out function prototypes..." >&4
7076 $cat >prototype.c <<EOCP
7081 int main(int argc, char *argv[]) {
7084 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7085 echo "Your C compiler appears to support function prototypes."
7088 echo "Your C compiler doesn't seem to understand function prototypes."
7095 : Check if ansi2knr is required
7096 case "$prototype" in
7098 *) ansi2knr='ansi2knr'
7103 This version of $package can only be compiled by a compiler that
7104 understands function prototypes. Unfortunately, your C compiler
7106 doesn't seem to understand them. Sorry about that.
7108 If GNU cc is available for your system, perhaps you could try that instead.
7110 Eventually, we hope to support building Perl with pre-ANSI compilers.
7111 If you would like to help in that effort, please contact <perlbug@perl.org>.
7113 Aborting Configure now.
7120 dflt_dtrace='/usr/sbin/dtrace'
7121 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7125 Perl can be built to support DTrace on platforms that support it.
7126 DTrace is a diagnosis and performance analysis tool from Sun.
7128 If this doesn't make any sense to you, just accept the default '$dflt'.
7132 case "$usedtrace" in
7138 dflt_dtrace=$usedtrace
7145 rp='Support DTrace if available?'
7148 y|Y) val="$define" ;;
7154 test "X$usedtrace" != "X$define" && break
7157 rp='Where is the dtrace executable?'
7166 if $dtrace -h -s ../perldtrace.d \
7167 -o perldtrace.tmp >/dev/null 2>&1 \
7168 && rm -f perldtrace.tmp
7171 echo "Good: your $dtrace knows about the -h flag."
7175 *** $me: Fatal Error: $dtrace doesn't support -h flag
7177 *** Your installed dtrace doesn't support the -h switch to compile a D
7178 *** program into a C header. Can't continue.
7190 *** $me: Fatal Error: $dtrace not found.
7197 echo "*** $dtrace was not found."
7203 : See if we want extra modules installed
7210 Perl can be built with extra modules or bundles of modules which
7211 will be fetched from the CPAN and installed alongside Perl.
7213 Notice that you will need access to the CPAN; either via the Internet,
7214 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7215 be asked later to configure the CPAN.pm module which will in turn do
7216 the installation of the rest of the extra modules or bundles.)
7218 Notice also that if the modules require any external software such as
7219 libraries and headers (the libz library and the zlib.h header for the
7220 Compress::Zlib module, for example) you MUST have any such software
7221 already installed, this configuration process will NOT install such
7224 If this doesn't make any sense to you, just accept the default '$dflt'.
7226 rp='Install any extra modules (y or n)?'
7232 Please list any extra modules or bundles to be installed from CPAN,
7233 with spaces between the names. The names can be in any format the
7234 'install' command of CPAN.pm will understand. (Answer 'none',
7235 without the quotes, to install no extra modules or bundles.)
7245 $rm -f ../extras.lst
7247 *) echo "(Saving the list of extras for later...)"
7248 echo "$extras" > ../extras.lst
7256 : determine where html pages for programs go
7257 set html1dir html1dir none
7261 If you wish to install html files for programs in $spackage, indicate
7262 the appropriate directory here. To skip installing html files,
7266 ''|none|$undef|' ') dflt=none ;;
7267 *) dflt=$html1dir ;;
7270 rp="Directory for the main $spackage html pages?"
7274 : Use ' ' for none so value is preserved next time through Configure
7275 $test X"$html1dir" = "X" && html1dir=' '
7277 : determine where html pages for libraries and modules go
7278 set html3dir html3dir none
7282 If you wish to install html files for modules associated with $spackage,
7283 indicate the appropriate directory here. To skip installing html files,
7286 : There is no obvious default. If they have specified html1dir, then
7287 : try to key off that, possibly changing .../html1 into .../html3.
7289 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7290 *) dflt=$html3dir ;;
7293 rp="Directory for the $spackage module html pages?"
7297 : Use ' ' for none so value is preserved next time through Configure
7298 $test X"$html3dir" = "X" && html3dir=' '
7300 : determine whether to install perl also as /usr/bin/perl
7303 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7305 Many scripts expect perl to be installed as /usr/bin/perl.
7307 If you want to, I can install the perl you are about to compile
7308 as /usr/bin/perl (in addition to $bin/perl).
7310 if test -f /usr/bin/perl; then
7313 However, please note that because you already have a /usr/bin/perl,
7314 overwriting that with a new Perl would very probably cause problems.
7315 Therefore I'm assuming you don't want to do that (unless you insist).
7318 case "$installusrbinperl" in
7319 "$define"|[yY]*) dflt='y';;
7325 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7328 case "$installusrbinperl" in
7329 "$undef"|[nN]*) dflt='n';;
7333 rp="Do you want to install perl as /usr/bin/perl?"
7336 [yY]*) val="$define";;
7342 set installusrbinperl
7345 : Check if we are using the GNU C library
7347 echo "Checking for GNU C Library..." >&4
7349 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7350 alone are insufficient to distinguish different versions, such as
7351 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7352 libc version 2.1.0. A. Dougherty, June 3, 2002.
7358 # ifdef __GLIBC_MINOR__
7359 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7360 # include <gnu/libc-version.h>
7361 printf("%s\n", gnu_get_libc_version());
7363 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7366 printf("%d\n", __GLIBC__);
7375 if eval $compile_ok && $run ./try > glibc.ver; then
7377 gnulibc_version=`$cat glibc.ver`
7378 echo "You are using the GNU C Library version $gnulibc_version"
7382 echo "You are not using the GNU C Library"
7388 : see if nm is to be used to determine whether a symbol is defined or not
7392 case "$d_gnulibc" in
7395 echo "nm probably won't work on the GNU C Library." >&4
7401 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7403 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7404 echo "'nm' won't be sufficient on this system." >&4
7410 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7411 if $test $dflt -gt 20; then
7421 true|$define) dflt=y;;
7428 I can use $nm to extract the symbols from your C libraries. This
7429 is a time consuming task which may generate huge output on the disk (up
7430 to 3 megabytes) but that should make the symbols extraction faster. The
7431 alternative is to skip the 'nm' extraction part and to compile a small
7432 test program instead to determine whether each symbol is present. If
7433 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7434 this may be the best solution.
7436 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7439 rp="Shall I use $nm to extract C symbols from the libraries?"
7442 [Nn]*) usenm=false;;
7451 : nm options which may be necessary
7453 '') if $test -f /mach_boot; then
7455 elif $test -d /usr/ccs/lib; then
7456 nm_opt='-p' # Solaris (and SunOS?)
7457 elif $test -f /dgux; then
7459 elif $test -f /lib64/rld; then
7460 nm_opt='-p' # 64-bit Irix
7466 : nm options which may be necessary for shared libraries but illegal
7467 : for archive libraries. Thank you, Linux.
7468 case "$nm_so_opt" in
7469 '') case "$myuname" in
7471 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7472 nm_so_opt='--dynamic'
7479 : Figure out where the libc is located
7482 : get list of predefined functions in a handy place
7487 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7493 *) for thislib in $libs; do
7496 : Handle C library specially below.
7499 thislib=`echo $thislib | $sed -e 's/^-l//'`
7500 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7502 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7504 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7506 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7508 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7510 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7512 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7517 libnames="$libnames $try"
7519 *) libnames="$libnames $thislib" ;;
7528 for xxx in $libpth; do
7529 $test -r $1 || set $xxx/libc.$so
7530 : The messy sed command sorts on library version numbers.
7532 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7533 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7535 s/[0-9][0-9]*/0000&/g
7536 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7539 $sort | $sed -e 's/^.* //'`
7542 $test -r $1 || set /usr/ccs/lib/libc.$so
7543 $test -r $1 || set /lib/libsys_s$_a
7549 if $test -r "$1"; then
7550 echo "Your (shared) C library seems to be in $1."
7552 elif $test -r /lib/libc && $test -r /lib/clib; then
7553 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7555 libc='/lib/clib /lib/libc'
7556 if $test -r /lib/syslib; then
7557 echo "(Your math library is in /lib/syslib.)"
7558 libc="$libc /lib/syslib"
7560 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7561 echo "Your C library seems to be in $libc, as you said before."
7562 elif $test -r $incpath/usr/lib/libc$_a; then
7563 libc=$incpath/usr/lib/libc$_a;
7564 echo "Your C library seems to be in $libc. That's fine."
7565 elif $test -r /lib/libc$_a; then
7567 echo "Your C library seems to be in $libc. You're normal."
7569 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7571 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7572 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7573 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7575 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7577 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7580 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7582 if $test -r "$tans"; then
7583 echo "Your C library seems to be in $tans, of all places."
7589 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7593 If the guess above is wrong (which it might be if you're using a strange
7594 compiler, or your machine supports multiple models), you can override it here.
7599 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7601 I can't seem to find your C library. I've looked in the following places:
7604 $sed 's/^/ /' libpath
7607 None of these seems to contain your C library. I need to get its name...
7612 rp='Where is your C library?'
7617 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7618 set X `cat libnames`
7621 case $# in 1) xxx=file; esac
7622 echo "Extracting names from the following $xxx for later perusal:" >&4
7624 $sed 's/^/ /' libnames >&4
7626 $echo $n "This may take a while...$c" >&4
7630 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7631 *) $nm $nm_opt $file 2>/dev/null;;
7636 $grep fprintf libc.tmp > libc.ptf
7637 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7638 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7640 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7665 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7681 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7685 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7689 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7693 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 $nm -p $* 2>/dev/null >libc.tmp
7699 $grep fprintf libc.tmp > libc.ptf
7700 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7701 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7707 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7709 if $ar t $libc > libc.tmp && \
7710 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7712 for thisname in $libnames $libc; do
7713 $ar t $thisname >>libc.tmp
7715 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7717 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7718 for thisname in $libnames $libc; do
7719 $ar tv $thisname >>libc.tmp
7720 emximp -o tmp.imp $thisname \
7722 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7723 < tmp.imp >>libc.tmp
7726 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7729 echo "$ar didn't seem to work right." >&4
7730 echo "Maybe this is a Cray...trying bld instead..." >&4
7732 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7735 for thisname in $libnames; do
7737 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7738 $ar t $thisname >>libc.tmp
7742 echo "That didn't work either. Giving up." >&4
7752 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7753 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7755 *) if $test -f /lib/syscalls.exp; then
7757 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7758 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7759 /lib/syscalls.exp >>libc.list
7765 $rm -f libnames libpath
7767 : see if dld is available
7771 : Check if we are using C++
7773 echo "Checking for C++..." >&4
7774 $cat >try.c <<'EOCP'
7786 if eval $compile_ok && $run ./try; then
7788 echo "You are using a C++ compiler."
7791 echo "You are not using a C++ compiler."
7797 : is a C symbol defined?
7800 -v) tf=libc.tmp; tdc="";;
7801 -a) tf=libc.tmp; tdc="[]";;
7802 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7804 case "$d_cplusplus" in
7805 $define) extern_C="extern \"C\"" ;;
7806 *) extern_C="extern" ;;
7809 case "$reuseval-$4" in
7811 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7816 if $test "$runnm" = true; then
7817 if $contains $tlook $tf >/dev/null 2>&1; then
7819 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7820 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7821 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7822 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7826 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7827 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7833 $define) tval=true;;
7840 : define an is-in-libc? function
7841 inlibc='echo " "; td=$define; tu=$undef;
7842 sym=$1; var=$2; eval "was=\$$2";
7844 case "$reuseval$was" in
7854 echo "$sym() found." >&4;
7855 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7857 echo "$sym() NOT found." >&4;
7858 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7862 $define) echo "$sym() found." >&4;;
7863 *) echo "$sym() NOT found." >&4;;
7867 : see if dlopen exists
7869 xxx_ccflags="$ccflags"
7871 : with g++ one needs -shared to get is-in-libc to work for dlopen
7872 case "$gccversion" in
7874 *) case "$d_cplusplus" in
7875 "$define") ccflags="$ccflags -shared" ;;
7882 ccflags="$xxx_ccflags"
7884 : see if this is a unistd.h system
7885 set unistd.h i_unistd
7888 : determine which dynamic loading, if any, to compile in
7890 dldir="ext/DynaLoader"
7903 $define) dflt='y' ;;
7906 $define) dflt='y' ;;
7908 : Does a dl_xxx.xs file exist for this operating system
7909 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7912 rp="Do you wish to use dynamic loading?"
7920 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7921 dflt="$dldir/dl_${osname}.xs"
7922 elif $test "$d_dlopen" = "$define" ; then
7923 dflt="$dldir/dl_dlopen.xs"
7924 elif $test "$i_dld" = "$define" ; then
7925 dflt="$dldir/dl_dld.xs"
7930 *) dflt="$dldir/$dlsrc"
7933 echo "The following dynamic loading files are available:"
7934 : Can not go over to $dldir because getfile has path hard-coded in.
7935 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7936 rp="Source file to use for dynamic loading"
7942 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7946 Some systems may require passing special flags to $cc -c to
7947 compile modules that will be used to create a shared library.
7948 To use no flags, say "none".
7951 case "$cccdlflags" in
7952 '') case "$gccversion" in
7953 '') case "$osname" in
7955 next) dflt='none' ;;
7956 irix*) dflt='-KPIC' ;;
7957 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7958 sunos) dflt='-pic' ;;
7962 *) case "$osname" in
7963 darwin) dflt='none' ;;
7964 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7969 *) dflt="$cccdlflags" ;;
7971 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7974 none) cccdlflags=' ' ;;
7975 *) cccdlflags="$ans" ;;
7980 Some systems use ld to create libraries that can be dynamically loaded,
7981 while other systems (such as those using ELF) use $cc.
7985 : Determine if this is ELF
7987 /* Test for whether ELF binaries are produced */
7999 int i = open("a.out",O_RDONLY);
8002 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8003 exit(0); /* succeed (yes, it is ELF) */
8008 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8014 '') if $test $bin_ELF = "$define"; then
8016 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8020 echo "I'll use ld to build dynamic libraries."
8028 rp="What command should be used to create dynamic libraries?"
8034 Some systems may require passing special flags to $ld to create a
8035 library that can be dynamically loaded. If your ld flags include
8036 -L/other/path options to locate libraries outside your loader's normal
8037 search path, you may need to specify those -L options here as well. To
8038 use no flags, say "none".
8041 case "$lddlflags" in
8042 '') case "$osname" in
8043 haiku) dflt='-shared' ;;
8045 case "$gccversion" in
8046 '') dflt="$dflt +vnocompatwarnings" ;;
8049 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8050 next) dflt='none' ;;
8051 solaris) # See [perl #66604].
8052 # On Solaris 11, gcc -m64 on amd64
8053 # appears not to understand -G. gcc versions at
8054 # least as old as 3.4.3 support -shared, so just
8055 # use that with Solaris 11 and later, but keep
8056 # the old behavior for older Solaris versions.
8057 case "$gccversion" in
8059 *) case "$osvers" in
8060 2.?|2.10) dflt='-G' ;;
8061 *) dflt='-shared' ;;
8066 sunos) dflt='-assert nodefinitions' ;;
8067 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8071 *) dflt="$lddlflags" ;;
8074 : Try to guess additional flags to pick up local libraries.
8075 : Be careful not to append to a plain 'none'
8079 for thisflag in $ldflags; do
8084 *) dflt="$dflt $thisflag" ;;
8091 ''|' ') dflt='none' ;;
8095 *-fstack-protector*)
8097 *-fstack-protector*) ;; # Don't add it again
8098 *) dflt="$dflt -fstack-protector" ;;
8104 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8107 none) lddlflags=' ' ;;
8108 *) lddlflags="$ans" ;;
8113 Some systems may require passing special flags to $cc to indicate that
8114 the resulting executable will use dynamic linking. To use no flags,
8118 case "$ccdlflags" in
8119 '') case "$osname" in
8120 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8121 next|sunos) dflt='none' ;;
8125 *) dflt="$ccdlflags" ;;
8127 rp="Any special flags to pass to $cc to use dynamic linking?"
8130 none) ccdlflags=' ' ;;
8131 *) ccdlflags="$ans" ;;
8142 ld_can_script="$undef"
8143 case "$bin_ELF$usedl" in
8145 # Abuse try.h and a.out names for neat cleanup
8157 if $cc $cccdlflags $ccdlflags $ccflags \
8158 $ldflags $lddlflags -o a.out try.c \
8159 -Wl,--version-script=try.h >/dev/null 2>&1 \
8160 && $test -s a.out ; then
8161 echo "ld supports scripting" >&4
8162 ld_can_script="$define"
8164 echo "ld does not support scripting" >&4
8170 : Do we want a shared libperl?
8174 # No dynamic loading being used, so don't bother even to prompt.
8177 *) case "$useshrplib" in
8178 '') case "$osname" in
8179 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8181 also='Building a shared libperl is required for dynamic loading to work on your system.'
8186 also='Building a shared libperl is needed for MAB support.'
8204 The perl executable is normally obtained by linking perlmain.c with
8205 libperl${_a}, any static extensions (usually just DynaLoader), and
8206 any other libraries needed on this system (such as -lm, etc.). Since
8207 your system supports dynamic loading, it is probably possible to build
8208 a shared libperl.$so. If you will have more than one executable linked
8209 to libperl.$so, this will significantly reduce the size of each
8210 executable, but it may have a noticeable effect on performance. The
8211 default is probably sensible for your system.
8215 rp="Build a shared libperl.$so (y/n)"
8219 useshrplib='true' ;;
8220 *) useshrplib='false' ;;
8225 case "$useshrplib" in
8227 case "$userelocatableinc" in
8229 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8230 echo "See INSTALL for an explanation why that won't work." >&4
8236 # Figure out a good name for libperl.so. Since it gets stored in
8237 # a version-specific architecture-dependent library, the version
8238 # number isn't really that important, except for making cc/ld happy.
8240 # A name such as libperl.so.10.1
8241 majmin="libperl.$so.$patchlevel.$subversion"
8242 # A name such as libperl.so.100
8243 majonly=`echo $patchlevel $subversion |
8244 $awk '{printf "%d%02d", $1, $2}'`
8245 majonly=libperl.$so.$majonly
8246 # I'd prefer to keep the os-specific stuff here to a minimum, and
8247 # rely on figuring it out from the naming of libc.
8248 case "${osname}${osvers}" in
8251 # XXX How handle the --version stuff for MAB?
8253 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8256 cygwin*) # ld links now against the dll directly
8257 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8258 majonly=`echo $patchlevel $subversion |
8259 $awk '{printf "%03d%03d", $1, $2}'`
8260 majonly=cygperl5.$majonly.$so
8263 *) # Try to guess based on whether libc has major.minor.
8265 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8266 *libc.$so.[0-9]*) dflt=$majonly ;;
8267 *) dflt=libperl.$so ;;
8277 I need to select a good name for the shared libperl. If your system uses
8278 library names with major and minor numbers, then you might want something
8279 like $majmin. Alternatively, if your system uses a single version
8280 number for shared libraries, then you might want to use $majonly.
8281 Or, your system might be quite happy with a simple libperl.$so.
8283 Since the shared libperl will get installed into a version-specific
8284 architecture-dependent directory, the version number of the shared perl
8285 library probably isn't important, so the default should be o.k.
8288 rp='What name do you want to give to the shared libperl?'
8291 echo "Ok, I'll use $libperl"
8294 libperl="libperl${_a}"
8298 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8302 WARNING: Use of the shrpdir variable for the installation location of
8303 the shared $libperl is not supported. It was never documented and
8304 will not work in this version. Let me (perlbug@perl.org)
8305 know of any problems this may cause.
8311 But your current setting of $shrpdir is
8312 the default anyway, so it's harmless.
8317 Further, your current attempted setting of $shrpdir
8318 conflicts with the value of $archlibexp/CORE
8319 that installperl will use.
8326 # How will the perl executable find the installed shared $libperl?
8327 # Add $xxx to ccdlflags.
8328 # If we can't figure out a command-line option, use $shrpenv to
8329 # set env LD_RUN_PATH. The main perl makefile uses this.
8330 shrpdir=$archlibexp/CORE
8333 if "$useshrplib"; then
8336 # We'll set it in Makefile.SH...
8341 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8342 xxx="-Wl,-R$shrpdir"
8344 bsdos|linux|irix*|dec_osf|gnu*)
8345 xxx="-Wl,-rpath,$shrpdir"
8348 # next doesn't like the default...
8351 # Haiku doesn't like the default, either.
8354 # hpux doesn't like the default, either.
8355 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8358 # cygwin needs only ldlibpth
8361 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8367 # Only add $xxx if it isn't already in ccdlflags.
8368 case " $ccdlflags " in
8370 *) ccdlflags="$ccdlflags $xxx"
8373 Adding $xxx to the flags
8374 passed to $ld so that the perl executable will find the
8375 installed shared $libperl.
8383 # Fix ccdlflags in AIX for building external extensions.
8384 # (For building Perl itself bare -bE:perl.exp is needed,
8385 # Makefile.SH takes care of this.)
8387 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8389 # Respect a hint or command-line value.
8391 '') shrpenv="$tmp_shrpenv" ;;
8393 case "$ldlibpthname" in
8394 '') ldlibpthname=LD_LIBRARY_PATH ;;
8395 none) ldlibpthname='' ;;
8398 : determine where manual pages are on this system
8402 syspath='/usr/share/man/man1 /usr/man/man1'
8403 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8404 syspath="$syspath /usr/man/u_man/man1"
8405 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8406 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8407 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8408 sysman=`./loc . /usr/man/man1 $syspath`
8411 if $test -d "$sysman"; then
8412 echo "System manual is in $sysman." >&4
8414 echo "Could not find manual pages in source form." >&4
8417 : determine where manual pages go
8418 set man1dir man1dir none
8422 $spackage has manual pages available in source form.
8426 echo "However, you don't have nroff, so they're probably useless to you."
8428 '') man1dir="none";;
8431 echo "If you don't want the manual sources installed, answer 'none'."
8436 lookpath="$prefixexp/share/man/man1"
8437 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8438 lookpath="$lookpath $prefixexp/man/p_man/man1"
8439 lookpath="$lookpath $prefixexp/man/u_man/man1"
8440 lookpath="$lookpath $prefixexp/man/man.1"
8442 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8443 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8453 rp="Where do the main $spackage manual pages (source) go?"
8455 if $test "X$man1direxp" != "X$ansexp"; then
8466 : What suffix to use on installed man pages
8473 rp="What suffix should be used for the main $spackage man pages?"
8475 '') case "$man1dir" in
8489 *) dflt="$man1ext";;
8496 : see if we can have long filenames
8498 first=123456789abcdef
8500 if (echo hi >$first) 2>/dev/null; then
8501 if $test -f 123456789abcde; then
8502 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8505 echo 'You can have filenames longer than 14 characters.'>&4
8510 You can't have filenames longer than 14 chars.
8511 You can't even think about them!
8517 $rm -rf 123456789abcde*
8519 : determine where library module manual pages go
8520 set man3dir man3dir none
8524 $spackage has manual pages for many of the library modules.
8530 However, you don't have nroff, so they're probably useless to you.
8533 '') man3dir="none";;
8537 case "$d_flexfnam" in
8540 However, your system can't handle the long file names like File::Basename.3.
8543 '') man3dir="none";;
8547 echo "If you don't want the manual sources installed, answer 'none'."
8548 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8550 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8551 if $test -d "$privlib/man/man3"; then
8554 WARNING: Previous versions of perl installed man3 pages into
8555 $privlib/man/man3. This version will suggest a
8556 new default of $dflt.
8560 rp='Do you wish to preserve the old behavior?(y/n)'
8563 y*) dflt="$privlib/man/man3" ;;
8568 *) dflt="$man3dir" ;;
8575 rp="Where do the $package library man pages (source) go?"
8585 : What suffix to use on installed man pages
8591 rp="What suffix should be used for the $package library man pages?"
8593 '') case "$man3dir" in
8607 *) dflt="$man3ext";;
8614 : see if we have to deal with yellow pages, now NIS.
8615 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8616 if $test -f /usr/etc/nibindd; then
8618 echo "I'm fairly confident you're on a NeXT."
8620 rp='Do you get the hosts file via NetInfo?'
8629 y*) hostcat='nidump hosts .';;
8630 *) case "$hostcat" in
8631 nidump*) hostcat='';;
8641 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8649 rp='Are you getting the hosts file via yellow pages?'
8652 y*) hostcat='ypcat hosts';;
8653 *) hostcat='cat /etc/hosts';;
8659 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8662 '') test -f /etc/group && groupcat='cat /etc/group';;
8665 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8668 : now get the host name
8670 echo "Figuring out host name..." >&4
8671 case "$myhostname" in
8673 echo 'Maybe "hostname" will work...'
8674 if tans=`sh -c hostname 2>&1` ; then
8682 if $test "$cont"; then
8684 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8685 if tans=`cat /etc/systemid 2>&1` ; then
8687 phostname='cat /etc/systemid'
8688 echo "Whadyaknow. Xenix always was a bit strange..."
8691 elif $test -r /etc/systemid; then
8692 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8695 if $test "$cont"; then
8696 echo 'No, maybe "uuname -l" will work...'
8697 if tans=`sh -c 'uuname -l' 2>&1` ; then
8699 phostname='uuname -l'
8701 echo 'Strange. Maybe "uname -n" will work...'
8702 if tans=`sh -c 'uname -n' 2>&1` ; then
8704 phostname='uname -n'
8706 echo 'Oh well, maybe I can mine it out of whoami.h...'
8707 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8708 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8709 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8711 case "$myhostname" in
8712 '') echo "Does this machine have an identity crisis or something?"
8715 echo "Well, you said $myhostname before..."
8716 phostname='echo $myhostname';;
8722 case "$myhostname" in
8723 '') myhostname=noname ;;
8725 : you do not want to know about this
8730 if $test "$myhostname" ; then
8732 rp='Your host name appears to be "'$myhostname'".'" Right?"
8740 : bad guess or no guess
8741 while $test "X$myhostname" = X ; do
8743 rp="Please type the (one word) name of your host:"
8748 : translate upper to lower if necessary
8749 case "$myhostname" in
8751 echo "(Normalizing case in your host name)"
8752 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8756 case "$myhostname" in
8758 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8759 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8760 echo "(Trimming domain name from host name--host name is now $myhostname)"
8762 *) case "$mydomain" in
8765 test "X$hostcat" = "Xypcat hosts" &&
8766 ypmatch "$myhostname" hosts 2>/dev/null |\
8767 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8770 test "X$hostcat" != "X" &&
8771 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8772 /[ ]$myhostname[ . ]/p" > hosts
8775 if $test -f hosts; then
8776 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8777 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8778 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8779 hosts | $sort | $uniq | \
8780 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8781 case `$echo X$dflt` in
8782 X*\ *) echo "(Several hosts in the database matched hostname)"
8785 X.) echo "(You do not have fully-qualified names in the hosts database)"
8789 echo "(I cannot locate a hosts database anywhere)"
8794 tans=`./loc resolv.conf X /etc /usr/etc`
8795 if $test -f "$tans"; then
8796 echo "(Attempting domain name extraction from $tans)"
8797 dflt=.`$sed -n -e 's/ / /g' \
8798 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8801 .) dflt=.`$sed -n -e 's/ / /g' \
8802 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8810 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8811 dflt=.`sh -c domainname 2>/dev/null`
8814 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8818 case "$dflt$osname" in
8819 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8820 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8824 .) echo "(Lost all hope -- silly guess then)"
8830 *) dflt="$mydomain";;
8834 rp="What is your domain name?"
8844 : translate upper to lower if necessary
8847 echo "(Normalizing case in your domain name)"
8848 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8852 : a little sanity check here
8853 case "$phostname" in
8856 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8857 $myhostname$mydomain|$myhostname) ;;
8859 case "$phostname" in
8861 echo "(That doesn't agree with your whoami.h file, by the way.)"
8864 echo "(That doesn't agree with your $phostname command, by the way.)"
8872 : determine the e-mail address of the user who is running us
8875 I need to get your e-mail address in Internet format if possible, i.e.
8876 something like user@host.domain. Please answer accurately since I have
8877 no easy means to double check it. The default value provided below
8878 is most probably close to reality but may not be valid from outside
8879 your organization...
8883 while test "$cont"; do
8884 case "$MAILDOMAIN" in
8886 if $test -s /etc/mailname; then
8887 maildomain=`$cat /etc/mailname`
8889 maildomain="$myhostname$mydomain"
8892 *) maildomain="$MAILDOMAIN";;
8895 '') dflt="$cf_by@$maildomain";;
8896 *) dflt="$cf_email";;
8898 rp='What is your e-mail address?'
8904 rp='Address does not look like an Internet one. Use it anyway?'
8918 : Ask e-mail of administrator
8921 If you or somebody else will be maintaining perl at your site, please
8922 fill in the correct e-mail address here so that they may be contacted
8923 if necessary. Currently, the "perlbug" program included with perl
8924 will send mail to this address in addition to perlbug@perl.org. You may
8925 enter "none" for no administrator.
8928 case "$perladmin" in
8929 '') dflt="$cf_email";;
8930 *) dflt="$perladmin";;
8932 rp='Perl administrator e-mail address'
8936 : determine whether to only install version-specific parts.
8939 Do you want to install only the version-specific parts of the perl
8940 distribution? Usually you do *not* want to do this.
8942 case "$versiononly" in
8943 "$define"|[Yy]*|true) dflt='y' ;;
8946 rp="Do you want to install only the version-specific parts of perl?"
8949 [yY]*) val="$define";;
8955 case "$versiononly" in
8956 "$define") inc_version_list=''
8957 inc_version_list_init=0
8961 : figure out how to guarantee perl startup
8962 : XXX Note that this currently takes advantage of the bug that binexp ignores
8963 : the Configure -Dinstallprefix setting, which in turn means that under
8964 : relocatable @INC, initialinstalllocation is what binexp started as.
8965 case "$startperl" in
8967 case "$sharpbang" in
8971 I can use the #! construct to start perl on your system. This will
8972 make startup of perl scripts faster, but may cause problems if you
8973 want to share those scripts and perl is not in a standard place
8974 ($initialinstalllocation/perl) on all your platforms. The alternative
8975 is to force a shell by starting the script with a single ':' character.
8978 case "$versiononly" in
8979 "$define") dflt="$initialinstalllocation/perl$version";;
8980 *) dflt="$initialinstalllocation/perl";;
8982 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8985 none) startperl=": # use perl";;
8986 *) startperl="#!$ans"
8987 if $test 30 -lt `echo "$ans" | wc -c`; then
8990 WARNING: Some systems limit the #! command to 32 characters.
8991 If you experience difficulty running Perl scripts with #!, try
8992 installing Perl in a directory with a shorter pathname.
8998 *) startperl=": # use perl"
9003 echo "I'll use $startperl to start perl scripts."
9005 : figure best path for perl in scripts
9008 case "$versiononly" in
9009 "$define") perlpath="$initialinstalllocation/perl$version";;
9010 *) perlpath="$initialinstalllocation/perl";;
9012 case "$startperl" in
9017 I will use the "eval 'exec'" idiom to start Perl on your system.
9018 I can use the full path of your Perl binary for this purpose, but
9019 doing so may cause problems if you want to share those scripts and
9020 Perl is not always in a standard place ($initialinstalllocation/perl).
9023 dflt="$initialinstalllocation/perl"
9024 rp="What path shall I use in \"eval 'exec'\"?"
9031 case "$startperl" in
9033 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9036 : determine where public executable scripts go
9037 set scriptdir scriptdir
9039 case "$scriptdir" in
9042 : guess some guesses
9043 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9044 $test -d /usr/share/bin && dflt=/usr/share/bin
9045 $test -d /usr/local/script && dflt=/usr/local/script
9046 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9047 $test -d $prefixexp/script && dflt=$prefixexp/script
9051 *) dflt="$scriptdir"
9056 Some installations have a separate directory just for executable scripts so
9057 that they can mount it across multiple architectures but keep the scripts in
9058 one spot. You might, for example, have a subdirectory of /usr/share for this.
9059 Or you might just lump your scripts in with all your other executables.
9063 rp='Where do you keep publicly executable scripts?'
9065 if $test "X$ansexp" != "X$scriptdirexp"; then
9071 : A little fix up for an irregularly named variable.
9072 installscript="$installscriptdir"
9074 : determine where add-on public executables go
9076 '') dflt=$siteprefix/bin ;;
9080 rp='Pathname where the add-on public executables should be installed?'
9085 : determine where add-on html pages go
9086 : There is no standard location, so try to copy the previously-selected
9087 : directory structure for the core html pages.
9088 case "$sitehtml1dir" in
9089 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9090 *) dflt=$sitehtml1dir ;;
9093 ''|' ') dflt=none ;;
9096 rp='Pathname where the site-specific html pages should be installed?'
9098 prefixvar=sitehtml1dir
9101 : determine where add-on library html pages go
9102 : There is no standard location, so try to copy the previously-selected
9103 : directory structure for the core html pages.
9104 case "$sitehtml3dir" in
9105 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9106 *) dflt=$sitehtml3dir ;;
9109 ''|' ') dflt=none ;;
9112 rp='Pathname where the site-specific library html pages should be installed?'
9114 prefixvar=sitehtml3dir
9117 : determine where add-on manual pages go
9118 case "$siteman1dir" in
9119 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9120 *) dflt=$siteman1dir ;;
9123 ''|' ') dflt=none ;;
9126 rp='Pathname where the site-specific manual pages should be installed?'
9128 prefixvar=siteman1dir
9131 : determine where add-on library man pages go
9132 case "$siteman3dir" in
9133 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9134 *) dflt=$siteman3dir ;;
9137 ''|' ') dflt=none ;;
9140 rp='Pathname where the site-specific library manual pages should be installed?'
9142 prefixvar=siteman3dir
9145 : determine where add-on public executable scripts go
9146 case "$sitescript" in
9147 '') dflt=$siteprefix/script
9148 $test -d $dflt || dflt=$sitebin ;;
9149 *) dflt="$sitescript" ;;
9152 rp='Pathname where add-on public executable scripts should be installed?'
9154 prefixvar=sitescript
9157 : Check if faststdio is requested and available
9158 case "$usefaststdio" in
9159 $define|true|[yY]*|'')
9160 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9170 Perl can be built to use 'fast stdio', which means using the stdio
9171 library but also directly manipulating the stdio buffers to enable
9172 faster I/O. Using stdio is better for backward compatibility (especially
9173 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9174 interface has been preferred instead of stdio.
9176 If this doesn't make any sense to you, just accept the default '$dflt'.
9178 rp='Use the "fast stdio" if available?'
9181 y|Y) val="$define" ;;
9188 : define an is-a-typedef? function
9189 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9191 "") inclist="sys/types.h";;
9193 eval "varval=\$$var";
9197 for inc in $inclist; do
9198 echo "#include <$inc>" >>temp.c;
9200 echo "#ifdef $type" >> temp.c;
9201 echo "printf(\"We have $type\");" >> temp.c;
9202 echo "#endif" >> temp.c;
9203 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9204 if $contains $type temp.E >/dev/null 2>&1; then
9210 *) eval "$var=\$varval";;
9213 : define an is-a-typedef? function that prompts if the type is not available.
9214 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9216 "") inclist="sys/types.h";;
9218 eval "varval=\$$var";
9222 for inc in $inclist; do
9223 echo "#include <$inc>" >>temp.c;
9225 echo "#ifdef $type" >> temp.c;
9226 echo "printf(\"We have $type\");" >> temp.c;
9227 echo "#endif" >> temp.c;
9228 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9230 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9231 if $contains $type temp.E >/dev/null 2>&1; then
9232 echo "$type found." >&4;
9235 echo "$type NOT found." >&4;
9241 *) eval "$var=\$varval";;
9244 : see what type lseek is declared as in the kernel
9245 rp="What is the type used for lseek's offset on this system?"
9246 set off_t lseektype long stdio.h sys/types.h
9250 echo "Checking to see how big your file offsets are..." >&4
9252 #include <sys/types.h>
9256 printf("%d\n", (int)sizeof($lseektype));
9261 if eval $compile_ok; then
9262 lseeksize=`$run ./try`
9263 echo "Your file offsets are $lseeksize bytes long."
9267 echo "(I can't seem to compile the test program. Guessing...)"
9268 rp="What is the size of your file offsets (in bytes)?"
9274 : see what type file positions are declared as in the library
9275 rp="What is the type for file position used by fsetpos()?"
9276 set fpos_t fpostype long stdio.h sys/types.h
9279 : Check size for Fpos_t
9282 *_t) zzz="$fpostype" ;;
9285 echo "Checking the size of $zzz..." >&4
9287 #include <sys/types.h>
9294 printf("%d\n", (int)sizeof($fpostype));
9299 if eval $compile_ok; then
9303 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9306 echo "Your $zzz is $fpossize bytes long."
9312 echo "(I can't compile the test program. Guessing...)" >&4
9313 rp="What is the size of your file positions (in bytes)?"
9318 : Check for large file support
9319 # Backward compatibility (uselfs is deprecated).
9321 "$define"|true|[yY]*)
9324 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9326 uselargefiles="$define"
9330 case "$lseeksize:$fpossize" in
9333 You can have files larger than 2 gigabytes.
9336 *) case "$uselargefiles" in
9337 "$undef"|false|[nN]*) dflt='n' ;;
9342 Perl can be built to understand large files (files larger than 2 gigabytes)
9343 on some systems. To do so, Configure can be run with -Duselargefiles.
9345 If this doesn't make any sense to you, just accept the default '$dflt'.
9347 rp='Try to understand large files, if available?'
9350 y|Y) val="$define" ;;
9357 : Look for a hint-file generated 'call-back-unit'. If the
9358 : user has specified that a large files perl is to be built,
9359 : we may need to set or change some other defaults.
9360 if $test -f uselargefiles.cbu; then
9361 echo "Your platform has some specific hints regarding large file builds, using them..."
9362 . ./uselargefiles.cbu
9364 case "$uselargefiles" in
9366 if $test -f uselargefiles.cbu; then
9368 echo "Rechecking to see how big your file offsets are..." >&4
9370 #include <sys/types.h>
9374 printf("%d\n", (int)sizeof($lseektype));
9379 if eval $compile_ok; then
9380 lseeksize=`$run ./try`
9381 $echo "Your file offsets are now $lseeksize bytes long."
9385 echo "(I can't seem to compile the test program. Guessing...)"
9386 rp="What is the size of your file offsets (in bytes)?"
9391 *_t) zzz="$fpostype" ;;
9394 $echo $n "Rechecking the size of $zzz...$c" >&4
9396 #include <sys/types.h>
9403 printf("%d\n", (int)sizeof($fpostype));
9408 if eval $compile_ok; then
9413 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9416 echo " $fpossize bytes." >&4
9422 echo "(I can't compile the test program. Guessing...)" >&4
9423 rp="What is the size of your file positions (in bytes)?"
9432 : Check if we want perlio
9435 : Set the vendorbin variables
9436 case "$vendorprefix" in
9437 '') d_vendorbin="$undef"
9441 *) d_vendorbin="$define"
9442 : determine where vendor-supplied executables go.
9443 case "$vendorbin" in
9444 '') dflt=$vendorprefix/bin ;;
9445 *) dflt="$vendorbin" ;;
9448 rp='Pathname for the vendor-supplied executables directory?'
9451 vendorbinexp="$ansexp"
9457 : Set the vendorhtml1dir variables
9458 case "$vendorprefix" in
9459 '') vendorhtml1dir=''
9460 vendorhtml1direxp=''
9462 *) : determine where vendor-supplied html pages go.
9463 : There is no standard location, so try to copy the previously-selected
9464 : directory structure for the core html pages.
9465 : XXX Better default suggestions would be welcome.
9466 case "$vendorhtml1dir" in
9467 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9468 *) dflt=$vendorhtml1dir ;;
9471 ''|' ') dflt=none ;;
9474 rp='Pathname for the vendor-supplied html pages?'
9476 vendorhtml1dir="$ans"
9477 vendorhtml1direxp="$ansexp"
9480 : Use ' ' for none so value is preserved next time through Configure
9481 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9482 prefixvar=vendorhtml1dir
9485 : Set the vendorhtml3dir variables
9486 case "$vendorprefix" in
9487 '') vendorhtml3dir=''
9488 vendorhtml3direxp=''
9490 *) : determine where vendor-supplied module html pages go.
9491 : There is no standard location, so try to copy the previously-selected
9492 : directory structure for the core html pages.
9493 : XXX Better default suggestions would be welcome.
9494 case "$vendorhtml3dir" in
9495 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9496 *) dflt=$vendorhtml3dir ;;
9499 ''|' ') dflt=none ;;
9502 rp='Pathname for the vendor-supplied html pages?'
9504 vendorhtml3dir="$ans"
9505 vendorhtml3direxp="$ansexp"
9508 : Use ' ' for none so value is preserved next time through Configure
9509 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9510 prefixvar=vendorhtml3dir
9513 : Set the vendorman1dir variables
9514 case "$vendorprefix" in
9515 '') vendorman1dir=''
9518 *) : determine where vendor-supplied manual pages go.
9519 case "$vendorman1dir" in
9520 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9521 *) dflt=$vendorman1dir ;;
9524 ''|' ') dflt=none ;;
9527 rp='Pathname for the vendor-supplied manual section 1 pages?'
9529 vendorman1dir="$ans"
9530 vendorman1direxp="$ansexp"
9533 : Use ' ' for none so value is preserved next time through Configure
9534 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9535 prefixvar=vendorman1dir
9538 : Set the vendorman3dir variables
9539 case "$vendorprefix" in
9540 '') vendorman3dir=''
9543 *) : determine where vendor-supplied module manual pages go.
9544 case "$vendorman3dir" in
9545 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9546 *) dflt=$vendorman3dir ;;
9549 ''|' ') dflt=none ;;
9552 rp='Pathname for the vendor-supplied manual section 3 pages?'
9554 vendorman3dir="$ans"
9555 vendorman3direxp="$ansexp"
9558 : Use ' ' for none so value is preserved next time through Configure
9559 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9560 prefixvar=vendorman3dir
9563 : Set the vendorscript variables
9564 case "$vendorprefix" in
9565 '') d_vendorscript="$undef"
9569 *) d_vendorscript="$define"
9570 : determine where vendor-supplied scripts go.
9571 case "$vendorscript" in
9572 '') dflt=$vendorprefix/script
9573 $test -d $dflt || dflt=$vendorbin ;;
9574 *) dflt="$vendorscript" ;;
9578 The installation process will create a directory for
9579 vendor-supplied scripts.
9583 rp='Pathname for the vendor-supplied scripts directory?'
9586 vendorscriptexp="$ansexp"
9589 prefixvar=vendorscript
9592 : script used to emit important warnings
9595 if test \$# -gt 0; then
9600 echo "*** WARNING:" >&4
9601 sed -e 's/^/*** /' <msg >&4
9603 cat msg >>config.msg
9604 echo " " >>config.msg
9610 : see which of string.h or strings.h is needed
9612 strings=`./findhdr string.h`
9613 if $test "$strings" && $test -r "$strings"; then
9614 echo "Using <string.h> instead of <strings.h>." >&4
9618 strings=`./findhdr strings.h`
9619 if $test "$strings" && $test -r "$strings"; then
9620 echo "Using <strings.h> instead of <string.h>." >&4
9622 ./warn "No string header found -- You'll surely have problems."
9628 "$undef") strings=`./findhdr strings.h`;;
9629 *) strings=`./findhdr string.h`;;
9632 : see if qgcvt exists
9636 : Check print/scan long double stuff
9639 if $test X"$d_longdbl" = X"$define"; then
9641 echo "Checking how to print long doubles..." >&4
9643 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9644 $cat >try.c <<'EOCP'
9645 #include <sys/types.h>
9649 printf("%.3f\n", d);
9653 if eval $compile; then
9657 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9658 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9659 echo "We will use %f."
9665 if $test X"$sPRIfldbl" = X; then
9666 $cat >try.c <<'EOCP'
9667 #include <sys/types.h>
9670 long double d = 123.456;
9671 printf("%.3Lf\n", d);
9675 if eval $compile; then
9679 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9680 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9681 echo "We will use %Lf."
9687 if $test X"$sPRIfldbl" = X; then
9688 $cat >try.c <<'EOCP'
9689 #include <sys/types.h>
9692 long double d = 123.456;
9693 printf("%.3llf\n", d);
9697 if eval $compile; then
9701 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9702 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9703 echo "We will use %llf."
9709 if $test X"$sPRIfldbl" = X; then
9710 $cat >try.c <<'EOCP'
9711 #include <sys/types.h>
9714 long double d = 123.456;
9715 printf("%.3lf\n", d);
9719 if eval $compile; then
9723 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9724 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9725 echo "We will use %lf."
9731 if $test X"$sPRIfldbl" = X; then
9732 echo "Cannot figure out how to print long doubles." >&4
9734 sSCNfldbl=$sPRIfldbl # expect consistency
9741 case "$sPRIfldbl" in
9742 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9743 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9744 d_SCNfldbl="$undef";
9746 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9747 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9748 d_SCNfldbl="$define";
9752 : Check how to convert floats to strings.
9754 if test "X$d_Gconvert" = X; then
9757 echo "Checking for an efficient way to convert floats to strings."
9759 case "$uselongdouble" in
9760 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9762 case "$d_longdbl" in
9763 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9765 case "$d_PRIgldbl" in
9766 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9770 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9771 char *myname = "gconvert";
9774 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9775 char *myname = "gcvt";
9778 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9779 char *myname = "qgcvt";
9780 #define DOUBLETYPE long double
9783 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9785 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9787 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9790 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9792 char *myname = "sprintf";
9796 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9797 #define DOUBLETYPE long double
9799 #define DOUBLETYPE double
9811 # include <string.h>
9813 # include <strings.h>
9816 int checkit(char *expect, char *got)
9818 if (strcmp(expect, got)) {
9819 printf("%s oddity: Expected %s, got %s\n",
9820 myname, expect, got);
9830 /* This must be 1st test on (which?) platform */
9831 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9832 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9833 checkit("0.1", buf);
9835 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9836 checkit("0.01", buf);
9838 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9839 checkit("0.001", buf);
9841 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9842 checkit("0.0001", buf);
9844 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9845 if (strlen(buf) > 5)
9846 checkit("9e-005", buf); /* for Microsoft ?? */
9848 checkit("9e-05", buf);
9850 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9853 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9854 checkit("1.1", buf);
9856 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9857 checkit("1.01", buf);
9859 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9860 checkit("1.001", buf);
9862 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9863 checkit("1.0001", buf);
9865 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9866 checkit("1.00001", buf);
9868 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9869 checkit("1.000001", buf);
9871 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9874 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9877 /* Some Linux gcvt's give 1.e+5 here. */
9878 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9879 checkit("100000", buf);
9881 /* Some Linux gcvt's give -1.e+5 here. */
9882 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9883 checkit("-100000", buf);
9885 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9886 checkit("123.456", buf);
9888 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9889 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9890 /* 34 should be enough to scare even long double
9891 * places into using the e notation. */
9892 if (strlen(buf) > 5)
9893 checkit("1e+034", buf); /* for Microsoft */
9895 checkit("1e+34", buf);
9897 /* For Perl, if you add additional tests here, also add them to
9898 * t/base/num.t for benefit of platforms not using Configure or
9899 * overriding d_Gconvert */
9904 : first add preferred functions to our list
9906 for xxx_convert in $gconvert_preference; do
9907 case $xxx_convert in
9908 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9909 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9912 : then add any others
9913 for xxx_convert in gconvert gcvt sprintf; do
9916 *) xxx_list="$xxx_list $xxx_convert" ;;
9920 case "$d_longdbl$uselongdouble" in
9922 : again, add preferred functions to our list first
9924 for xxx_convert in $gconvert_ld_preference; do
9925 case $xxx_convert in
9926 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9927 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9930 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9931 for xxx_convert in qgcvt sprintf $xxx_list; do
9932 case "$xxx_ld_list" in
9933 $xxx_convert*|*" $xxx_convert"*) ;;
9934 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9937 : if sprintf cannot do long doubles, move it to the end
9938 if test "$d_PRIgldbl" != "$define"; then
9939 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9941 : if no qgcvt, remove it
9942 if test "$d_qgcvt" != "$define"; then
9943 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9946 xxx_list="$xxx_ld_list"
9950 for xxx_convert in $xxx_list; do
9951 echo "Trying $xxx_convert..."
9952 $rm -f try try$_o core
9953 set try -DTRY_$xxx_convert
9954 if eval $compile; then
9955 echo "$xxx_convert() found." >&4
9957 echo "I'll use $xxx_convert to convert floats into a string." >&4
9960 echo "...But $xxx_convert didn't work as I expected."
9964 echo "$xxx_convert NOT found." >&4
9968 if test X$xxx_convert = X; then
9969 echo "*** WHOA THERE!!! ***" >&4
9970 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9974 case "$xxx_convert" in
9975 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9976 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9977 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9978 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9979 "$define$define$define")
9980 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9981 "$define$define$undef")
9982 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9983 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9991 : see if _fwalk exists
9995 : Initialize h_fcntl
9998 : Initialize h_sysfile
10001 : access call always available on UNIX
10002 set access d_access
10005 : locate the flags for 'access()'
10006 case "$d_access" in
10009 $cat >access.c <<EOCP
10010 #include <sys/types.h>
10015 #include <sys/file.h>
10018 #include <unistd.h>
10020 #$i_stdlib I_STDLIB
10022 #include <stdlib.h>
10028 : check sys/file.h first, no particular reason here
10029 if $test `./findhdr sys/file.h` && \
10030 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10032 echo "<sys/file.h> defines the *_OK access constants." >&4
10033 elif $test `./findhdr fcntl.h` && \
10034 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10036 echo "<fcntl.h> defines the *_OK access constants." >&4
10037 elif $test `./findhdr unistd.h` && \
10038 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10039 echo "<unistd.h> defines the *_OK access constants." >&4
10041 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10047 : see if accessx exists
10048 set accessx d_accessx
10051 : see if aintl exists
10055 : see if alarm exists
10059 : see if 64bit time functions exists
10061 set ctime64 d_ctime64
10064 set localtime64 d_localtime64
10067 set gmtime64 d_gmtime64
10070 set mktime64 d_mktime64
10073 set difftime64 d_difftime64
10076 set asctime64 d_asctime64
10079 : see if POSIX threads are available
10080 set pthread.h i_pthread
10083 : define a function to check prototypes
10084 $cat > protochk <<EOSH
10087 optimize="$optimize"
10089 prototype="$prototype"
10092 usethreads=$usethreads
10093 i_pthread=$i_pthread
10094 pthread_h_first=$pthread_h_first
10097 $cat >> protochk <<'EOSH'
10102 while test $# -ge 2; do
10104 $define) echo "#include <$2>" >> try.c ;;
10105 literal) echo "$2" >> try.c ;;
10107 # Extra magic for the benefit of systems that need pthread.h
10108 # to be included early to correctly detect threadsafe functions.
10109 # Such functions must guarantee themselves, though, that the usethreads
10110 # and i_pthread have been defined, before calling protochk.
10111 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10112 echo "#include <pthread.h>" >> try.c
10117 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10118 cat >> try.c <<'EOCP'
10119 #ifdef CAN_PROTOTYPE
10120 #define _(args) args
10125 echo "$foo" >> try.c
10126 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10127 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10133 $eunicefix protochk
10135 : Define hasproto macro for Configure internal use
10136 hasproto='varname=$1; func=$2; shift; shift;
10137 while $test $# -ge 2; do
10139 $define) echo "#include <$2>";;
10143 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10144 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10145 echo "$func() prototype found.";
10148 echo "$func() prototype NOT found.";
10155 : see if sys/types.h has to be included
10156 set sys/types.h i_systypes
10159 : see if sys/select.h has to be included
10160 set sys/select.h i_sysselct
10163 : Define hasfield macro for Configure internal use
10164 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10165 while $test $# -ge 2; do
10167 $define) echo "#include <$2>";;
10171 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10173 if eval $compile; then
10182 : see if we should include time.h, sys/time.h, or both
10184 if test "X$timeincl" = X; then
10185 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10186 $echo $n "I'm now running the test program...$c"
10188 #include <sys/types.h>
10193 #ifdef SYSTIMEKERNEL
10196 #include <sys/time.h>
10199 #include <sys/select.h>
10201 #$i_stdlib I_STDLIB
10203 #include <stdlib.h>
10209 struct timeval bar;
10212 struct timezone tzp;
10214 if (foo.tm_sec == foo.tm_sec)
10217 if (bar.tv_sec == bar.tv_sec)
10224 for s_timezone in '-DS_TIMEZONE' ''; do
10226 for s_timeval in '-DS_TIMEVAL' ''; do
10227 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10228 for i_time in '' '-DI_TIME'; do
10229 for i_systime in '-DI_SYSTIME' ''; do
10232 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10233 if eval $compile; then
10234 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10238 $echo $n "Succeeded with $flags$c"
10250 *SYSTIMEKERNEL*) i_systimek="$define"
10251 timeincl=`./findhdr sys/time.h`
10252 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10253 *) i_systimek="$undef";;
10256 *I_TIME*) i_time="$define"
10257 timeincl=`./findhdr time.h`" $timeincl"
10258 echo "We'll include <time.h>." >&4;;
10259 *) i_time="$undef";;
10262 *I_SYSTIME*) i_systime="$define"
10263 timeincl=`./findhdr sys/time.h`" $timeincl"
10264 echo "We'll include <sys/time.h>." >&4;;
10265 *) i_systime="$undef";;
10269 : see if struct tm knows about tm_zone
10270 case "$i_systime$i_time" in
10273 echo "Checking to see if your struct tm has tm_zone field..." >&4
10274 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10282 case "$d_tm_tm_zone" in
10283 "$define") echo "Yes, it does." ;;
10284 *) echo "No, it doesn't." ;;
10286 : see if struct tm knows about tm_gmtoff
10287 case "$i_systime$i_time" in
10290 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10291 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10299 case "$d_tm_tm_gmtoff" in
10300 "$define") echo "Yes, it does." ;;
10301 *) echo "No, it doesn't." ;;
10304 : see if asctime_r exists
10305 set asctime_r d_asctime_r
10307 case "$d_asctime_r" in
10309 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10310 case "$d_asctime_r_proto:$usethreads" in
10311 ":define") d_asctime_r_proto=define
10312 set d_asctime_r_proto asctime_r $hdrs
10316 case "$d_asctime_r_proto" in
10318 case "$asctime_r_proto" in
10319 ''|0) try='char* asctime_r(const struct tm*, char*);'
10320 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10322 case "$asctime_r_proto" in
10323 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10324 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10326 case "$asctime_r_proto" in
10327 ''|0) try='int asctime_r(const struct tm*, char*);'
10328 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10330 case "$asctime_r_proto" in
10331 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10332 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10334 case "$asctime_r_proto" in
10335 ''|0) d_asctime_r=undef
10337 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10338 * ) case "$asctime_r_proto" in
10339 REENTRANT_PROTO*) ;;
10340 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10342 echo "Prototype: $try" ;;
10345 *) case "$usethreads" in
10346 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10353 *) asctime_r_proto=0
10357 : see if atolf exists
10361 : see if atoll exists
10365 : Look for GCC-style attribute format
10366 case "$d_attribute_format" in
10369 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10370 $cat >attrib.c <<'EOCP'
10372 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10374 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10375 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10376 echo "Your C compiler doesn't support __attribute__((format))."
10379 echo "Your C compiler supports __attribute__((format))."
10383 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10387 *) val="$d_attribute_format" ;;
10389 set d_attribute_format
10393 : Look for GCC-style attribute format with null format allowed
10394 case "$d_printf_format_null" in
10395 '') case "$d_attribute_format" in
10398 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10399 $cat >attrib.c <<EOCP
10401 #$i_stdlib I_STDLIB
10403 #include <stdlib.h>
10405 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10406 int null_printf (char* pat,...) { return (int)pat; }
10407 int main () { exit(null_printf(NULL)); }
10409 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10410 : run the executable in case it produces a run-time warning
10411 if $run ./attrib >>attrib.out 2>&1; then
10412 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10413 echo "Your C compiler doesn't allow __printf__ format to be null."
10416 echo "Your C compiler allows __printf__ format to be null."
10420 echo "Your C compiler executable failed with __printf__ format null."
10424 echo "Your C compiler fails with __printf__ format null."
10431 *) val="$d_printf_format_null" ;;
10433 set d_printf_format_null
10437 : Look for GCC-style attribute malloc
10438 case "$d_attribute_malloc" in
10441 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10442 $cat >attrib.c <<'EOCP'
10444 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10446 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10447 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10448 echo "Your C compiler doesn't support __attribute__((malloc))."
10451 echo "Your C compiler supports __attribute__((malloc))."
10455 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10459 *) val="$d_attribute_malloc" ;;
10461 set d_attribute_malloc
10465 : Look for GCC-style attribute nonnull
10466 case "$d_attribute_nonnull" in
10469 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10470 $cat >attrib.c <<'EOCP'
10472 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10474 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10475 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10476 echo "Your C compiler doesn't support __attribute__((nonnull))."
10479 echo "Your C compiler supports __attribute__((nonnull))."
10483 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10487 *) val="$d_attribute_nonnull" ;;
10489 set d_attribute_nonnull
10493 : Look for GCC-style attribute noreturn
10494 case "$d_attribute_noreturn" in
10497 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10498 $cat >attrib.c <<'EOCP'
10500 void fall_over_dead( void ) __attribute__((noreturn));
10502 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10503 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10504 echo "Your C compiler doesn't support __attribute__((noreturn))."
10507 echo "Your C compiler supports __attribute__((noreturn))."
10511 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10515 *) val="$d_attribute_noreturn" ;;
10517 set d_attribute_noreturn
10521 : Look for GCC-style attribute pure
10522 case "$d_attribute_pure" in
10525 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10526 $cat >attrib.c <<'EOCP'
10528 int square( int n ) __attribute__((pure));
10530 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10531 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10532 echo "Your C compiler doesn't support __attribute__((pure))."
10535 echo "Your C compiler supports __attribute__((pure))."
10539 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10543 *) val="$d_attribute_pure" ;;
10545 set d_attribute_pure
10549 : Look for GCC-style attribute unused
10550 case "$d_attribute_unused" in
10553 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10554 $cat >attrib.c <<'EOCP'
10556 int do_something( int dummy __attribute__((unused)), int n );
10558 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10559 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10560 echo "Your C compiler doesn't support __attribute__((unused))."
10563 echo "Your C compiler supports __attribute__((unused))."
10567 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10571 *) val="$d_attribute_unused" ;;
10573 set d_attribute_unused
10577 : Look for GCC-style attribute deprecated
10578 case "$d_attribute_deprecated" in
10581 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10582 $cat >attrib.c <<'EOCP'
10584 int I_am_deprecated(void) __attribute__((deprecated));
10586 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10587 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10588 echo "Your C compiler doesn't support __attribute__((deprecated))."
10591 echo "Your C compiler supports __attribute__((deprecated))."
10595 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10599 *) val="$d_attribute_deprecated" ;;
10601 set d_attribute_deprecated
10605 : Look for GCC-style attribute warn_unused_result
10606 case "$d_attribute_warn_unused_result" in
10609 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10610 $cat >attrib.c <<'EOCP'
10612 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10614 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10615 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10616 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10619 echo "Your C compiler supports __attribute__((warn_unused_result))."
10623 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10627 *) val="$d_attribute_warn_unused_result" ;;
10629 set d_attribute_warn_unused_result
10633 : see if bcmp exists
10637 : see if bcopy exists
10641 : see if getpgrp exists
10642 set getpgrp d_getpgrp
10645 case "$d_getpgrp" in
10648 echo "Checking to see which flavor of getpgrp is in use..."
10650 #$i_unistd I_UNISTD
10651 #include <sys/types.h>
10653 # include <unistd.h>
10655 #$i_stdlib I_STDLIB
10657 #include <stdlib.h>
10661 if (getuid() == 0) {
10662 printf("(I see you are running Configure as super-user...)\n");
10665 #ifdef TRY_BSD_PGRP
10666 if (getpgrp(1) == 0)
10675 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10676 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10678 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10679 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10682 echo "I can't seem to compile and run the test program."
10684 xxx="a USG one, i.e. you use getpgrp()."
10686 # SVR4 systems can appear rather BSD-ish.
10687 case "$i_unistd" in
10689 xxx="a BSD one, i.e. you use getpgrp(pid)."
10693 xxx="probably a USG one, i.e. you use getpgrp()."
10698 echo "Assuming your getpgrp is $xxx" >&4
10707 : see if setpgrp exists
10708 set setpgrp d_setpgrp
10711 case "$d_setpgrp" in
10714 echo "Checking to see which flavor of setpgrp is in use..."
10716 #$i_unistd I_UNISTD
10717 #include <sys/types.h>
10719 # include <unistd.h>
10721 #$i_stdlib I_STDLIB
10723 #include <stdlib.h>
10727 if (getuid() == 0) {
10728 printf("(I see you are running Configure as super-user...)\n");
10731 #ifdef TRY_BSD_PGRP
10732 if (-1 == setpgrp(1, 1))
10735 if (setpgrp() != -1)
10741 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10742 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10744 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10745 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10748 echo "(I can't seem to compile and run the test program.)"
10750 xxx="a USG one, i.e. you use setpgrp()."
10752 # SVR4 systems can appear rather BSD-ish.
10753 case "$i_unistd" in
10755 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10759 xxx="probably a USG one, i.e. you use setpgrp()."
10764 echo "Assuming your setpgrp is $xxx" >&4
10773 : Look for GCC-style __builtin_choose_expr
10774 case "$d_builtin_choose_expr" in
10777 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10778 $cat >try.c <<'EOCP'
10779 #include <assert.h>
10780 #include <stdlib.h>
10783 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10786 assert( SYRINX(1) == 2112 );
10787 assert( SYRINX(1) != 5150 );
10788 assert( SYRINX(0) == 5150 );
10789 assert( SYRINX(0) != 2112 );
10790 puts( "All good!" );
10796 if eval $compile && $run ./try; then
10797 echo "Your C compiler supports __builtin_choose_expr."
10800 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10804 *) val="$d_builtin_choose_expr" ;;
10807 set d_builtin_choose_expr
10811 : Look for GCC-style __builtin_expect
10812 case "$d_builtin_expect" in
10815 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10816 $cat >try.c <<'EOCP'
10819 if ( __builtin_expect(n, 0) ) n = 1;
10820 /* Remember shell exit code truth is 0, C truth is non-zero */
10825 if eval $compile && $run ./try; then
10826 echo "Your C compiler supports __builtin_expect."
10829 echo "Your C compiler doesn't seem to understand __builtin_expect."
10833 *) val="$d_builtin_expect" ;;
10836 set d_builtin_expect
10840 : see if bzero exists
10844 : see if stdarg is available
10846 if $test `./findhdr stdarg.h`; then
10847 echo "<stdarg.h> found." >&4
10850 echo "<stdarg.h> NOT found." >&4
10854 : see if varargs is available
10856 if $test `./findhdr varargs.h`; then
10857 echo "<varargs.h> found." >&4
10859 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10862 : set up the varargs testing programs
10863 $cat > varargs.c <<EOP
10865 #include <stdarg.h>
10868 #include <varargs.h>
10872 int f(char *p, ...)
10886 p = va_arg(ap, char *);
10892 $cat > varargs <<EOP
10894 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10903 : now check which varargs header should be included
10909 if `./varargs I_STDARG`; then
10911 elif `./varargs I_VARARGS`; then
10916 if `./varargs I_VARARGS`; then
10924 echo "*** WHOA THERE!!! ***" >&4
10925 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10926 case "$knowitall" in
10928 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10932 echo "I could not find the definition for va_dcl... You have problems..." >&4
10933 val="$undef"; set i_stdarg; eval $setvar
10934 val="$undef"; set i_varargs; eval $setvar
10939 case "$i_varhdr" in
10941 val="$define"; set i_stdarg; eval $setvar
10942 val="$undef"; set i_varargs; eval $setvar
10945 val="$undef"; set i_stdarg; eval $setvar
10946 val="$define"; set i_varargs; eval $setvar
10949 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10953 : see if the Compiler supports C99 variadic macros
10954 case "$i_stdarg$i_stdlib" in
10956 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10959 #include <stdarg.h>
10961 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10965 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10971 if eval $compile && $run ./try 2>&1 >/dev/null; then
10972 case "`$run ./try`" in
10974 echo "You have C99 variadic macros." >&4
10975 d_c99_variadic_macros="$define"
10978 echo "You don't have functional C99 variadic macros." >&4
10979 d_c99_variadic_macros="$undef"
10983 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10984 d_c99_variadic_macros="$undef"
10989 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10990 d_c99_variadic_macros="$undef"
10994 : see if signal is declared as pointer to function returning int or void
10996 xxx=`./findhdr signal.h`
10997 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10998 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10999 echo "You have int (*signal())() instead of void." >&4
11001 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11002 echo "You have void (*signal())()." >&4
11004 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11005 echo "You have int (*signal())() instead of void." >&4
11007 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11008 echo "You have void (*signal())()." >&4
11011 case "$d_voidsig" in
11013 echo "I can't determine whether signal handler returns void or int..." >&4
11015 rp="What type does your signal handler return?"
11018 v*) val="$define";;
11022 echo "As you already told me, signal handler returns void." >&4
11025 *) echo "As you already told me, signal handler returns int." >&4
11032 case "$d_voidsig" in
11033 "$define") signal_t="void";;
11034 *) signal_t="int";;
11038 : check for ability to cast large floats to 32-bit ints.
11040 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11041 if $test "$intsize" -ge 4; then
11048 #$i_stdlib I_STDLIB
11050 #include <stdlib.h>
11052 #include <sys/types.h>
11053 #include <signal.h>
11054 $signal_t blech(int s) { exit(3); }
11061 signal(SIGFPE, blech);
11063 /* Don't let compiler optimize the test away. Store the number
11064 in a writable string for gcc to pass to sscanf under HP-UX.
11066 sprintf(str, "2147483647");
11067 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11071 /* x86 processors will probably give 0x8000 0000, which is a
11072 sign change. We don't want that. We want to mimic SPARC
11073 behavior here, which is to preserve the sign and give
11076 if (i32 != ($xxx) f)
11082 if eval $compile_ok; then
11086 echo "(I can't seem to compile the test program--assuming it can't)"
11091 echo "Yup, it can."
11094 echo "Nope, it can't."
11101 : check for ability to cast negative floats to unsigned
11103 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11106 #$i_stdlib I_STDLIB
11108 #include <stdlib.h>
11110 #include <sys/types.h>
11111 #include <signal.h>
11112 $signal_t blech(int s) { exit(7); }
11113 $signal_t blech_in_list(int s) { exit(4); }
11114 unsigned long dummy_long(unsigned long p) { return p; }
11115 unsigned int dummy_int(unsigned int p) { return p; }
11116 unsigned short dummy_short(unsigned short p) { return p; }
11120 unsigned long along;
11122 unsigned short ashort;
11126 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11127 a direct f = -123. assignment. gcc-2.8.0 reportedly
11128 optimized the whole file away
11130 /* Store the number in a writable string for gcc to pass to
11131 sscanf under HP-UX.
11133 sprintf(str, "-123");
11134 sscanf(str, "%lf", &f); /* f = -123.; */
11136 signal(SIGFPE, blech);
11137 along = (unsigned long)f;
11138 aint = (unsigned int)f;
11139 ashort = (unsigned short)f;
11140 if (along != (unsigned long)-123)
11142 if (aint != (unsigned int)-123)
11144 if (ashort != (unsigned short)-123)
11146 sprintf(str, "1073741824.");
11147 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11150 along = (unsigned long)f;
11151 if (along != 0x80000000)
11155 along = (unsigned long)f;
11156 if (along != 0x7fffffff)
11160 along = (unsigned long)f;
11161 if (along != 0x80000001)
11165 signal(SIGFPE, blech_in_list);
11166 sprintf(str, "123.");
11167 sscanf(str, "%lf", &f); /* f = 123.; */
11168 along = dummy_long((unsigned long)f);
11169 aint = dummy_int((unsigned int)f);
11170 ashort = dummy_short((unsigned short)f);
11171 if (along != (unsigned long)123)
11173 if (aint != (unsigned int)123)
11175 if (ashort != (unsigned short)123)
11182 if eval $compile_ok; then
11186 echo "(I can't seem to compile the test program--assuming it can't)"
11189 case "$castflags" in
11191 echo "Yup, it can."
11194 echo "Nope, it can't."
11201 : see if vprintf exists
11203 if set vprintf val -f d_vprintf; eval $csym; $val; then
11204 echo 'vprintf() found.' >&4
11207 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11208 #$i_varargs I_VARARGS
11210 #$i_stdlib I_STDLIB
11211 #$i_unistd I_UNISTD
11214 # include <stdarg.h>
11215 #else /* I_VARARGS */
11216 # include <varargs.h>
11220 # include <unistd.h>
11224 # include <stdlib.h>
11227 #include <stdio.h> /* vsprintf prototype */
11230 void xxx(int n, ...)
11235 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11237 int main() { xxx(1, "foo"); }
11239 #else /* I_VARARGS */
11247 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11249 int main() { xxx("foo"); }
11255 if eval $compile_ok; then
11256 if $run ./try; then
11257 echo "Your vsprintf() returns (int)." >&4
11260 echo "Your vsprintf() returns (char*)." >&4
11264 echo 'I am unable to compile the vsprintf() test program.' >&4
11265 # We shouldn't get here. If we do, assume the standard signature,
11266 # not the old BSD one.
11267 echo 'Guessing that vsprintf() returns (int).' >&4
11271 echo 'vprintf() NOT found.' >&4
11282 : see if chown exists
11286 : see if chroot exists
11287 set chroot d_chroot
11290 : see if chsize exists
11291 set chsize d_chsize
11294 : see if class exists
11298 : see if clearenv exists
11299 set clearenv d_clearenv
11302 : Define hasstruct macro for Configure internal use
11303 hasstruct='varname=$1; struct=$2; shift; shift;
11304 while $test $# -ge 2; do
11306 $define) echo "#include <$2>";;
11310 echo "int main () { struct $struct foo; }" >> try.c;
11312 if eval $compile; then
11321 : see whether socket exists
11325 $echo $n "Hmm... $c" >&4
11326 if set socket val -f d_socket; eval $csym; $val; then
11327 echo "Looks like you have Berkeley networking support." >&4
11329 if set setsockopt val -f; eval $csym; $val; then
11332 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11333 d_oldsock="$define"
11336 if $contains socklib libc.list >/dev/null 2>&1; then
11337 echo "Looks like you have Berkeley networking support." >&4
11339 : we will have to assume that it supports the 4.2 BSD interface
11342 echo "You don't have Berkeley networking in libc$_a..." >&4
11343 if test "X$d_socket" = "X$define"; then
11344 echo "...but you seem to believe that you have sockets." >&4
11346 for net in net socket
11348 if test -f /usr/lib/lib$net$_a; then
11349 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11350 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11351 if $contains socket libc.list >/dev/null 2>&1; then
11356 echo "...but the Wollongong group seems to have hacked it in." >&4
11357 sockethdr="-I/usr/netinclude"
11360 echo "Found Berkeley sockets interface in lib$net." >&4
11361 if $contains setsockopt libc.list >/dev/null 2>&1; then
11364 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11365 d_oldsock="$define"
11371 if test "X$d_socket" != "X$define"; then
11372 echo "or anywhere else I see." >&4
11380 : see if socketpair exists
11381 set socketpair d_sockpair
11386 echo "Checking the availability sa_len in the sock struct ..." >&4
11388 #include <sys/types.h>
11389 #include <sys/socket.h>
11391 struct sockaddr sa;
11392 return (sa.sa_len);
11396 set try; if eval $compile; then
11399 set d_sockaddr_sa_len; eval $setvar
11403 echo "Checking the availability struct sockaddr_in6 ..." >&4
11405 #include <sys/types.h>
11406 #include <sys/socket.h>
11407 #include <netinet/in.h>
11409 struct sockaddr_in6 sin6;
11410 return (sin6.sin6_family);
11414 set try; if eval $compile; then
11417 set d_sockaddr_in6; eval $setvar
11421 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11423 #include <sys/types.h>
11424 #include <sys/socket.h>
11425 #include <netinet/in.h>
11427 struct sockaddr_in6 sin6;
11428 return (sin6.sin6_scope_id);
11432 set try; if eval $compile; then
11435 set d_sin6_scope_id; eval $setvar
11439 echo "Checking the availability struct ip_mreq ..." >&4
11441 #include <sys/types.h>
11442 #include <sys/socket.h>
11443 #include <netinet/in.h>
11445 struct ip_mreq mreq;
11446 return (mreq.imr_multiaddr.s_addr);
11450 set try; if eval $compile; then
11453 set d_ip_mreq; eval $setvar
11457 echo "Checking the availability struct ip_mreq_source ..." >&4
11459 #include <sys/types.h>
11460 #include <sys/socket.h>
11461 #include <netinet/in.h>
11463 struct ip_mreq_source mreq;
11464 return (mreq.imr_multiaddr.s_addr);
11468 set try; if eval $compile; then
11471 set d_ip_mreq_source; eval $setvar
11475 echo "Checking the availability struct ipv6_mreq ..." >&4
11477 #include <sys/types.h>
11478 #include <sys/socket.h>
11479 #include <netinet/in.h>
11481 struct ipv6_mreq mreq;
11482 return (mreq.ipv6mr_interface);
11486 set try; if eval $compile; then
11489 set d_ipv6_mreq; eval $setvar
11493 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11495 #include <sys/types.h>
11496 #include <sys/socket.h>
11497 #include <netinet/in.h>
11499 struct ipv6_mreq_source mreq;
11500 return (mreq.imr_multiaddr.s_addr);
11504 set try; if eval $compile; then
11507 set d_ipv6_mreq_source; eval $setvar
11511 echo "Checking the availability of certain socket constants..." >&4
11512 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11513 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11515 #include <sys/types.h>
11516 #include <sys/socket.h>
11522 set try; if eval $compile; then
11525 set d_${enum}; eval $setvar
11529 : see if this is a sys/uio.h system
11530 set sys/uio.h i_sysuio
11533 : Check for cmsghdr support
11535 echo "Checking to see if your system supports struct cmsghdr..." >&4
11536 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11538 case "$d_cmsghdr_s" in
11539 "$define") echo "Yes, it does." ;;
11540 *) echo "No, it doesn't." ;;
11544 : check for const keyword
11546 echo 'Checking to see if your C compiler knows about "const"...' >&4
11547 $cat >const.c <<'EOCP'
11548 typedef struct spug { int drokk; } spug;
11552 const spug y = { 0 };
11555 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11557 echo "Yup, it does."
11560 echo "Nope, it doesn't."
11565 : see if copysignl exists
11566 set copysignl d_copysignl
11569 : see if crypt exists
11574 $define) cryptlib='' ;;
11575 *) if set crypt val -f d_crypt; eval $csym; $val; then
11576 echo 'crypt() found.' >&4
11580 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11581 if $test -z "$cryptlib"; then
11582 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11586 if $test -z "$cryptlib"; then
11587 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11591 if $test -z "$cryptlib"; then
11592 cryptlib=`./loc libcrypt$_a "" $libpth`
11596 if $test -z "$cryptlib"; then
11597 echo 'crypt() NOT found.' >&4
11608 : see if this is a crypt.h system
11609 set crypt.h i_crypt
11612 : see if crypt_r exists
11613 set crypt_r d_crypt_r
11615 case "$d_crypt_r" in
11617 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11618 case "$d_crypt_r_proto:$usethreads" in
11619 ":define") d_crypt_r_proto=define
11620 set d_crypt_r_proto crypt_r $hdrs
11624 case "$d_crypt_r_proto" in
11626 case "$crypt_r_proto" in
11627 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11628 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11630 case "$crypt_r_proto" in
11631 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11632 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11634 case "$crypt_r_proto" in
11635 ''|0) d_crypt_r=undef
11637 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11638 * ) case "$crypt_r_proto" in
11639 REENTRANT_PROTO*) ;;
11640 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11642 echo "Prototype: $try" ;;
11645 *) case "$usethreads" in
11646 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11657 : get csh whereabouts
11659 'csh') val="$undef" ;;
11660 *) val="$define" ;;
11664 : Respect a hint or command line value for full_csh.
11665 case "$full_csh" in
11666 '') full_csh=$csh ;;
11669 : see if ctermid exists
11670 set ctermid d_ctermid
11673 : see if ctermid_r exists
11674 set ctermid_r d_ctermid_r
11676 case "$d_ctermid_r" in
11678 hdrs="$i_systypes sys/types.h define stdio.h "
11679 case "$d_ctermid_r_proto:$usethreads" in
11680 ":define") d_ctermid_r_proto=define
11681 set d_ctermid_r_proto ctermid_r $hdrs
11685 case "$d_ctermid_r_proto" in
11687 case "$ctermid_r_proto" in
11688 ''|0) try='char* ctermid_r(char*);'
11689 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11691 case "$ctermid_r_proto" in
11692 ''|0) d_ctermid_r=undef
11694 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11695 * ) case "$ctermid_r_proto" in
11696 REENTRANT_PROTO*) ;;
11697 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11699 echo "Prototype: $try" ;;
11702 *) case "$usethreads" in
11703 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11710 *) ctermid_r_proto=0
11714 : see if ctime_r exists
11715 set ctime_r d_ctime_r
11717 case "$d_ctime_r" in
11719 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11720 case "$d_ctime_r_proto:$usethreads" in
11721 ":define") d_ctime_r_proto=define
11722 set d_ctime_r_proto ctime_r $hdrs
11726 case "$d_ctime_r_proto" in
11728 case "$ctime_r_proto" in
11729 ''|0) try='char* ctime_r(const time_t*, char*);'
11730 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11732 case "$ctime_r_proto" in
11733 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11734 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11736 case "$ctime_r_proto" in
11737 ''|0) try='int ctime_r(const time_t*, char*);'
11738 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11740 case "$ctime_r_proto" in
11741 ''|0) try='int ctime_r(const time_t*, char*, int);'
11742 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11744 case "$ctime_r_proto" in
11745 ''|0) d_ctime_r=undef
11747 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11748 * ) case "$ctime_r_proto" in
11749 REENTRANT_PROTO*) ;;
11750 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11752 echo "Prototype: $try" ;;
11755 *) case "$usethreads" in
11756 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11767 : see if cuserid exists
11768 set cuserid d_cuserid
11771 : see if this is a limits.h system
11772 set limits.h i_limits
11775 : see if this is a float.h system
11776 set float.h i_float
11779 : See if number of significant digits in a double precision number is known
11781 $cat >dbl_dig.c <<EOM
11782 #$i_limits I_LIMITS
11785 #include <limits.h>
11791 printf("Contains DBL_DIG");
11794 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11795 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11796 echo "DBL_DIG found." >&4
11799 echo "DBL_DIG NOT found." >&4
11806 : see if dbm.h is available
11807 : see if dbmclose exists
11808 set dbmclose d_dbmclose
11811 case "$d_dbmclose" in
11821 *) set rpcsvc/dbm.h i_rpcsvcdbm
11826 *) echo "We won't be including <dbm.h>"
11836 : see if prototype for dbminit is available
11838 set d_dbminitproto dbminit $i_dbm dbm.h
11841 : see if difftime exists
11842 set difftime d_difftime
11845 : see if this is a dirent system
11847 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11849 echo "<dirent.h> found." >&4
11852 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11853 echo "<sys/dir.h> found." >&4
11856 xinc=`./findhdr sys/ndir.h`
11858 echo "<dirent.h> NOT found." >&4
11863 : Look for type of directory structure.
11865 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11867 case "$direntrytype" in
11869 case "$i_dirent" in
11870 $define) guess1='struct dirent' ;;
11871 *) guess1='struct direct' ;;
11874 *) guess1="$direntrytype"
11879 'struct dirent') guess2='struct direct' ;;
11880 *) guess2='struct dirent' ;;
11883 if $contains "$guess1" try.c >/dev/null 2>&1; then
11884 direntrytype="$guess1"
11885 echo "Your directory entries are $direntrytype." >&4
11886 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11887 direntrytype="$guess2"
11888 echo "Your directory entries seem to be $direntrytype." >&4
11890 echo "I don't recognize your system's directory entries." >&4
11891 rp="What type is used for directory entries on this system?"
11894 direntrytype="$ans"
11898 : see if the directory entry stores field length
11900 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11901 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11902 echo "Good, your directory entry keeps length information in d_namlen." >&4
11905 echo "Your directory entry does not know about the d_namlen field." >&4
11912 : Look for DIR.dd_fd
11913 case "$i_dirent" in
11915 echo "Checking to see if DIR has a dd_fd member variable" >&4
11917 #$i_stdlib I_STDLIB
11919 #include <stdlib.h>
11921 #include <dirent.h>
11931 if eval $compile; then
11932 echo "Yes, it does."
11935 echo "No, it does not."
11940 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11948 : see if this is an sysdir system
11949 set sys/dir.h i_sysdir
11952 : see if this is an sysndir system
11953 set sys/ndir.h i_sysndir
11958 $cat >dirfd.c <<EOM
11960 #$i_stdlib I_STDLIB
11962 #include <stdlib.h>
11964 #$i_dirent I_DIRENT /**/
11965 #$i_sysdir I_SYS_DIR /**/
11966 #$i_sysndir I_SYS_NDIR /**/
11967 #$i_systypes I_SYS_TYPES /**/
11968 #if defined(I_SYS_TYPES)
11969 #include <sys/types.h>
11971 #if defined(I_DIRENT)
11972 #include <dirent.h>
11973 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11974 #include <sys/dir.h>
11978 #include <sys/ndir.h>
11982 #include <ndir.h> /* may be wrong in the future */
11984 #include <sys/dir.h>
11990 DIR *dirp = opendir(".");
11991 if (dirfd(dirp) >= 0)
11999 if eval $compile; then
12003 $define) echo "dirfd() found." >&4 ;;
12004 *) echo "dirfd() NOT found." >&4 ;;
12010 : see if dlerror exists
12013 set dlerror d_dlerror
12017 : see if dlfcn is available
12018 set dlfcn.h i_dlfcn
12021 : Check what extension to use for shared libs
12026 On a few systems, the dynamically loaded modules that perl generates and uses
12027 will need a different extension than shared libs. The default will probably
12033 *) dflt="$dlext" ;;
12035 rp='What is the extension of dynamically loaded modules'
12044 : Check if dlsym need a leading underscore
12050 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12051 $cat >dyna.c <<'EOM'
12058 #$i_stdlib I_STDLIB
12060 #include <stdlib.h>
12064 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12066 #include <sys/types.h>
12071 extern int fred() ;
12080 int mode = RTLD_LAZY ;
12082 handle = dlopen("./dyna.$dlext", mode) ;
12083 if (handle == NULL) {
12088 symbol = dlsym(handle, "fred") ;
12089 if (symbol == NULL) {
12090 /* try putting a leading underscore */
12091 symbol = dlsym(handle, "_fred") ;
12092 if (symbol == NULL) {
12105 : Call the object file tmp-dyna.o in case dlext=o.
12106 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12107 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12108 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12109 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12112 1) echo "Test program failed using dlopen." >&4
12113 echo "Perhaps you should not use dynamic loading." >&4;;
12114 2) echo "Test program failed using dlsym." >&4
12115 echo "Perhaps you should not use dynamic loading." >&4;;
12116 3) echo "dlsym needs a leading underscore" >&4
12118 4) echo "dlsym doesn't need a leading underscore." >&4;;
12121 echo "I can't compile and run the test program." >&4
12122 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12127 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12132 : see if drand48_r exists
12133 set drand48_r d_drand48_r
12135 case "$d_drand48_r" in
12137 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12138 case "$d_drand48_r_proto:$usethreads" in
12139 ":define") d_drand48_r_proto=define
12140 set d_drand48_r_proto drand48_r $hdrs
12144 case "$d_drand48_r_proto" in
12146 case "$drand48_r_proto" in
12147 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12148 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12150 case "$drand48_r_proto" in
12151 ''|0) d_drand48_r=undef
12153 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12154 * ) case "$drand48_r_proto" in
12155 REENTRANT_PROTO*) ;;
12156 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12158 echo "Prototype: $try" ;;
12161 *) case "$usethreads" in
12162 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12169 *) drand48_r_proto=0
12173 : see if prototype for drand48 is available
12175 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12178 : see if dup2 exists
12182 : see if eaccess exists
12183 set eaccess d_eaccess
12186 : see if endgrent exists
12187 set endgrent d_endgrent
12190 : see if this is an grp system
12196 xxx=`./findhdr grp.h`
12197 $cppstdin $cppflags $cppminus < $xxx >$$.h
12199 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12211 set d_grpasswd; eval $setvar
12215 : see if endgrent_r exists
12216 set endgrent_r d_endgrent_r
12218 case "$d_endgrent_r" in
12220 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12221 case "$d_endgrent_r_proto:$usethreads" in
12222 ":define") d_endgrent_r_proto=define
12223 set d_endgrent_r_proto endgrent_r $hdrs
12227 case "$d_endgrent_r_proto" in
12229 case "$endgrent_r_proto" in
12230 ''|0) try='int endgrent_r(FILE**);'
12231 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12233 case "$endgrent_r_proto" in
12234 ''|0) try='void endgrent_r(FILE**);'
12235 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12237 case "$endgrent_r_proto" in
12238 ''|0) d_endgrent_r=undef
12240 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12241 * ) case "$endgrent_r_proto" in
12242 REENTRANT_PROTO*) ;;
12243 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12245 echo "Prototype: $try" ;;
12248 *) case "$usethreads" in
12249 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12256 *) endgrent_r_proto=0
12260 : see if endhostent exists
12261 set endhostent d_endhent
12264 : see if this is a netdb.h system
12265 set netdb.h i_netdb
12268 : see if endhostent_r exists
12269 set endhostent_r d_endhostent_r
12271 case "$d_endhostent_r" in
12273 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12274 case "$d_endhostent_r_proto:$usethreads" in
12275 ":define") d_endhostent_r_proto=define
12276 set d_endhostent_r_proto endhostent_r $hdrs
12280 case "$d_endhostent_r_proto" in
12282 case "$endhostent_r_proto" in
12283 ''|0) try='int endhostent_r(struct hostent_data*);'
12284 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12286 case "$endhostent_r_proto" in
12287 ''|0) try='void endhostent_r(struct hostent_data*);'
12288 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12290 case "$endhostent_r_proto" in
12291 ''|0) d_endhostent_r=undef
12292 endhostent_r_proto=0
12293 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12294 * ) case "$endhostent_r_proto" in
12295 REENTRANT_PROTO*) ;;
12296 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12298 echo "Prototype: $try" ;;
12301 *) case "$usethreads" in
12302 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12304 d_endhostent_r=undef
12305 endhostent_r_proto=0
12309 *) endhostent_r_proto=0
12313 : see if endnetent exists
12314 set endnetent d_endnent
12317 : see if endnetent_r exists
12318 set endnetent_r d_endnetent_r
12320 case "$d_endnetent_r" in
12322 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12323 case "$d_endnetent_r_proto:$usethreads" in
12324 ":define") d_endnetent_r_proto=define
12325 set d_endnetent_r_proto endnetent_r $hdrs
12329 case "$d_endnetent_r_proto" in
12331 case "$endnetent_r_proto" in
12332 ''|0) try='int endnetent_r(struct netent_data*);'
12333 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12335 case "$endnetent_r_proto" in
12336 ''|0) try='void endnetent_r(struct netent_data*);'
12337 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12339 case "$endnetent_r_proto" in
12340 ''|0) d_endnetent_r=undef
12341 endnetent_r_proto=0
12342 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12343 * ) case "$endnetent_r_proto" in
12344 REENTRANT_PROTO*) ;;
12345 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12347 echo "Prototype: $try" ;;
12350 *) case "$usethreads" in
12351 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12353 d_endnetent_r=undef
12354 endnetent_r_proto=0
12358 *) endnetent_r_proto=0
12362 : see if endprotoent exists
12363 set endprotoent d_endpent
12366 : see if endprotoent_r exists
12367 set endprotoent_r d_endprotoent_r
12369 case "$d_endprotoent_r" in
12371 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12372 case "$d_endprotoent_r_proto:$usethreads" in
12373 ":define") d_endprotoent_r_proto=define
12374 set d_endprotoent_r_proto endprotoent_r $hdrs
12378 case "$d_endprotoent_r_proto" in
12380 case "$endprotoent_r_proto" in
12381 ''|0) try='int endprotoent_r(struct protoent_data*);'
12382 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12384 case "$endprotoent_r_proto" in
12385 ''|0) try='void endprotoent_r(struct protoent_data*);'
12386 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12388 case "$endprotoent_r_proto" in
12389 ''|0) d_endprotoent_r=undef
12390 endprotoent_r_proto=0
12391 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12392 * ) case "$endprotoent_r_proto" in
12393 REENTRANT_PROTO*) ;;
12394 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12396 echo "Prototype: $try" ;;
12399 *) case "$usethreads" in
12400 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12402 d_endprotoent_r=undef
12403 endprotoent_r_proto=0
12407 *) endprotoent_r_proto=0
12411 : see if endpwent exists
12412 set endpwent d_endpwent
12415 : see if this is a pwd.h system
12421 xxx=`./findhdr pwd.h`
12422 $cppstdin $cppflags $cppminus < $xxx >$$.h
12424 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12432 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12440 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12448 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12456 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12464 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12472 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12480 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12492 set d_pwquota; eval $setvar
12493 set d_pwage; eval $setvar
12494 set d_pwchange; eval $setvar
12495 set d_pwclass; eval $setvar
12496 set d_pwexpire; eval $setvar
12497 set d_pwcomment; eval $setvar
12498 set d_pwgecos; eval $setvar
12499 set d_pwpasswd; eval $setvar
12503 : see if endpwent_r exists
12504 set endpwent_r d_endpwent_r
12506 case "$d_endpwent_r" in
12508 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12509 case "$d_endpwent_r_proto:$usethreads" in
12510 ":define") d_endpwent_r_proto=define
12511 set d_endpwent_r_proto endpwent_r $hdrs
12515 case "$d_endpwent_r_proto" in
12517 case "$endpwent_r_proto" in
12518 ''|0) try='int endpwent_r(FILE**);'
12519 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12521 case "$endpwent_r_proto" in
12522 ''|0) try='void endpwent_r(FILE**);'
12523 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12525 case "$endpwent_r_proto" in
12526 ''|0) d_endpwent_r=undef
12528 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12529 * ) case "$endpwent_r_proto" in
12530 REENTRANT_PROTO*) ;;
12531 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12533 echo "Prototype: $try" ;;
12536 *) case "$usethreads" in
12537 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12544 *) endpwent_r_proto=0
12548 : see if endservent exists
12549 set endservent d_endsent
12552 : see if endservent_r exists
12553 set endservent_r d_endservent_r
12555 case "$d_endservent_r" in
12557 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12558 case "$d_endservent_r_proto:$usethreads" in
12559 ":define") d_endservent_r_proto=define
12560 set d_endservent_r_proto endservent_r $hdrs
12564 case "$d_endservent_r_proto" in
12566 case "$endservent_r_proto" in
12567 ''|0) try='int endservent_r(struct servent_data*);'
12568 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12570 case "$endservent_r_proto" in
12571 ''|0) try='void endservent_r(struct servent_data*);'
12572 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12574 case "$endservent_r_proto" in
12575 ''|0) d_endservent_r=undef
12576 endservent_r_proto=0
12577 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12578 * ) case "$endservent_r_proto" in
12579 REENTRANT_PROTO*) ;;
12580 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12582 echo "Prototype: $try" ;;
12585 *) case "$usethreads" in
12586 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12588 d_endservent_r=undef
12589 endservent_r_proto=0
12593 *) endservent_r_proto=0
12597 : Locate the flags for 'open()'
12600 #include <sys/types.h>
12605 #include <sys/file.h>
12607 #$i_stdlib I_STDLIB
12609 #include <stdlib.h>
12620 : check sys/file.h first to get FREAD on Sun
12621 if $test `./findhdr sys/file.h` && \
12622 set try -DI_SYS_FILE && eval $compile; then
12624 echo "<sys/file.h> defines the O_* constants..." >&4
12625 if $run ./try; then
12626 echo "and you have the 3 argument form of open()." >&4
12629 echo "but not the 3 argument form of open(). Oh, well." >&4
12632 elif $test `./findhdr fcntl.h` && \
12633 set try -DI_FCNTL && eval $compile; then
12635 echo "<fcntl.h> defines the O_* constants..." >&4
12636 if $run ./try; then
12637 echo "and you have the 3 argument form of open()." >&4
12640 echo "but not the 3 argument form of open(). Oh, well." >&4
12645 echo "I can't find the O_* constant definitions! You got problems." >&4
12651 : see if this is a sys/file.h system
12656 : do we need to include sys/file.h ?
12660 if $h_sysfile; then
12662 echo "We'll be including <sys/file.h>." >&4
12665 echo "We won't be including <sys/file.h>." >&4
12675 : see if fcntl.h is there
12680 : see if we can include fcntl.h
12686 echo "We'll be including <fcntl.h>." >&4
12689 if $h_sysfile; then
12690 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12692 echo "We won't be including <fcntl.h>." >&4
12704 : see if fork exists
12708 : see if pipe exists
12712 : check for non-blocking I/O stuff
12713 case "$h_sysfile" in
12714 true) echo "#include <sys/file.h>" > head.c;;
12717 true) echo "#include <fcntl.h>" > head.c;;
12718 *) echo "#include <sys/fcntl.h>" > head.c;;
12723 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12724 case "$o_nonblock" in
12726 $cat head.c > try.c
12727 $cat >>try.c <<EOCP
12729 #$i_stdlib I_STDLIB
12731 #include <stdlib.h>
12739 printf("O_NONBLOCK\n");
12743 printf("O_NDELAY\n");
12747 printf("FNDELAY\n");
12754 if eval $compile_ok; then
12755 o_nonblock=`$run ./try`
12756 case "$o_nonblock" in
12757 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12758 *) echo "Seems like we can use $o_nonblock.";;
12761 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12764 *) echo "Using $hint value $o_nonblock.";;
12769 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12772 case "$d_fork:$d_pipe" in
12774 $cat head.c > try.c
12775 $cat >>try.c <<EOCP
12777 #include <sys/types.h>
12778 #include <signal.h>
12780 #$i_stdlib I_STDLIB
12782 #include <stdlib.h>
12788 #define MY_O_NONBLOCK $o_nonblock
12789 #ifndef errno /* XXX need better Configure test */
12792 #$i_unistd I_UNISTD
12794 #include <unistd.h>
12796 #$i_string I_STRING
12798 #include <string.h>
12800 #include <strings.h>
12802 $signal_t blech(int x) { exit(3); }
12804 $cat >> try.c <<'EOCP'
12812 pipe(pd); /* Down: child -> parent */
12813 pipe(pu); /* Up: parent -> child */
12816 close(pd[1]); /* Parent reads from pd[0] */
12817 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12819 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12824 signal(SIGALRM, blech);
12826 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12828 sprintf(string, "%d\n", ret);
12829 write(2, string, strlen(string));
12832 if (errno == EAGAIN) {
12833 printf("EAGAIN\n");
12838 if (errno == EWOULDBLOCK)
12839 printf("EWOULDBLOCK\n");
12842 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12843 sleep(2); /* Give it time to close our pipe */
12845 ret = read(pd[0], buf, 1); /* Should read EOF */
12847 sprintf(string, "%d\n", ret);
12848 write(4, string, strlen(string));
12852 close(pd[0]); /* We write to pd[1] */
12853 close(pu[1]); /* We read from pu[0] */
12854 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12855 close(pd[1]); /* Pipe pd is now fully closed! */
12856 exit(0); /* Bye bye, thank you for playing! */
12860 if eval $compile_ok; then
12861 echo "$startsh" >mtry
12862 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12864 ./mtry >/dev/null 2>&1
12866 0) eagain=`$cat try.out`;;
12867 1) echo "Could not perform non-blocking setting!";;
12868 2) echo "I did a successful read() for something that was not there!";;
12869 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12870 4) echo "Could not find F_SETFL!";;
12871 *) echo "Something terribly wrong happened during testing.";;
12873 rd_nodata=`$cat try.ret`
12874 echo "A read() system call with no data present returns $rd_nodata."
12875 case "$rd_nodata" in
12878 echo "(That's peculiar, fixing that to be -1.)"
12884 echo "Forcing errno EAGAIN on read() with no data available."
12888 echo "Your read() sets errno to $eagain when no data is available."
12891 status=`$cat try.err`
12893 0) echo "And it correctly returns 0 to signal EOF.";;
12894 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12895 *) echo "However, your read() returns '$status' on EOF??";;
12898 if test "$status" = "$rd_nodata"; then
12899 echo "WARNING: you can't distinguish between EOF and no data!"
12903 echo "I can't compile the test program--assuming errno EAGAIN will do."
12907 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12916 echo "Using $hint value $eagain."
12917 echo "Your read() returns $rd_nodata when no data is present."
12918 case "$d_eofnblk" in
12919 "$define") echo "And you can see EOF because read() returns 0.";;
12920 "$undef") echo "But you can't see EOF status from read() returned value.";;
12922 echo "(Assuming you can't see EOF status from read anyway.)"
12928 $rm_try head.c mtry
12930 : see if _ptr and _cnt from stdio act std
12933 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12934 echo "(Looks like you have stdio.h from BSD.)"
12935 case "$stdio_ptr" in
12936 '') stdio_ptr='((fp)->_p)'
12939 *) ptr_lval=$d_stdio_ptr_lval;;
12941 case "$stdio_cnt" in
12942 '') stdio_cnt='((fp)->_r)'
12945 *) cnt_lval=$d_stdio_cnt_lval;;
12947 case "$stdio_base" in
12948 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12950 case "$stdio_bufsiz" in
12951 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12953 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12954 echo "(Looks like you have stdio.h from Linux.)"
12955 case "$stdio_ptr" in
12956 '') stdio_ptr='((fp)->_IO_read_ptr)'
12959 *) ptr_lval=$d_stdio_ptr_lval;;
12961 case "$stdio_cnt" in
12962 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12965 *) cnt_lval=$d_stdio_cnt_lval;;
12967 case "$stdio_base" in
12968 '') stdio_base='((fp)->_IO_read_base)';;
12970 case "$stdio_bufsiz" in
12971 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12974 case "$stdio_ptr" in
12975 '') stdio_ptr='((fp)->_ptr)'
12978 *) ptr_lval=$d_stdio_ptr_lval;;
12980 case "$stdio_cnt" in
12981 '') stdio_cnt='((fp)->_cnt)'
12984 *) cnt_lval=$d_stdio_cnt_lval;;
12986 case "$stdio_base" in
12987 '') stdio_base='((fp)->_base)';;
12989 case "$stdio_bufsiz" in
12990 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12994 : test whether _ptr and _cnt really work
12995 echo "Checking how std your stdio is..." >&4
12998 #$i_stdlib I_STDLIB
13000 #include <stdlib.h>
13002 #define FILE_ptr(fp) $stdio_ptr
13003 #define FILE_cnt(fp) $stdio_cnt
13005 FILE *fp = fopen("try.c", "r");
13008 18 <= FILE_cnt(fp) &&
13009 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13017 if eval $compile && $to try.c; then
13018 if $run ./try; then
13019 echo "Your stdio acts pretty std."
13022 echo "Your stdio isn't very std."
13025 echo "Your stdio doesn't appear very std."
13029 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13030 # direct buffer manipulation no longer works. The Configure tests
13031 # should be changed to correctly detect this, but until then,
13032 # the following check should at least let perl compile and run.
13033 # (This quick fix should be updated before 5.8.1.)
13034 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13035 # A. Dougherty, June 3, 2002.
13036 case "$d_gnulibc" in
13038 case "$gnulibc_version" in
13042 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13051 : Can _ptr be used as an lvalue?
13052 case "$d_stdstdio$ptr_lval" in
13053 $define$define) val=$define ;;
13056 set d_stdio_ptr_lval
13059 : Can _cnt be used as an lvalue?
13060 case "$d_stdstdio$cnt_lval" in
13061 $define$define) val=$define ;;
13064 set d_stdio_cnt_lval
13068 : test whether setting _ptr sets _cnt as a side effect
13069 d_stdio_ptr_lval_sets_cnt="$undef"
13070 d_stdio_ptr_lval_nochange_cnt="$undef"
13071 case "$d_stdio_ptr_lval$d_stdstdio" in
13073 echo "Checking to see what happens if we set the stdio ptr..." >&4
13076 /* Can we scream? */
13077 /* Eat dust sed :-) */
13078 /* In the buffer space, no one can hear you scream. */
13079 #$i_stdlib I_STDLIB
13081 #include <stdlib.h>
13083 #define FILE_ptr(fp) $stdio_ptr
13084 #define FILE_cnt(fp) $stdio_cnt
13085 #include <sys/types.h>
13087 FILE *fp = fopen("try.c", "r");
13092 puts("Fail even to read");
13095 c = getc(fp); /* Read away the first # */
13097 puts("Fail even to read");
13101 18 <= FILE_cnt(fp) &&
13102 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13104 puts("Fail even to read");
13107 ptr = (char*) FILE_ptr(fp);
13108 cnt = (size_t)FILE_cnt(fp);
13110 FILE_ptr(fp) += 42;
13112 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13113 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13116 if (FILE_cnt(fp) <= 20) {
13117 printf ("Fail (<20 chars to test)");
13120 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13121 puts("Fail compare");
13124 if (cnt == FILE_cnt(fp)) {
13125 puts("Pass_unchanged");
13128 if (FILE_cnt(fp) == (cnt - 42)) {
13129 puts("Pass_changed");
13132 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13138 if eval $compile && $to try.c; then
13139 case `$run ./try` in
13141 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13142 d_stdio_ptr_lval_sets_cnt="$define" ;;
13144 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13145 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13147 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13149 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13152 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13158 : see if _base is also standard
13160 case "$d_stdstdio" in
13164 #$i_stdlib I_STDLIB
13166 #include <stdlib.h>
13168 #define FILE_base(fp) $stdio_base
13169 #define FILE_bufsiz(fp) $stdio_bufsiz
13171 FILE *fp = fopen("try.c", "r");
13174 19 <= FILE_bufsiz(fp) &&
13175 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13182 if eval $compile && $to try.c; then
13183 if $run ./try; then
13184 echo "And its _base field acts std."
13187 echo "But its _base field isn't std."
13190 echo "However, it seems to be lacking the _base field."
13198 : see if fast_stdio exists
13200 case "$d_stdstdio:$d_stdio_ptr_lval" in
13202 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13204 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13215 : see if fchdir exists
13216 set fchdir d_fchdir
13219 : see if fchmod exists
13220 set fchmod d_fchmod
13223 : see if fchown exists
13224 set fchown d_fchown
13227 : see if this is an fcntl system
13231 : See if fcntl-based locking works.
13234 #$i_stdlib I_STDLIB
13236 #include <stdlib.h>
13238 #include <unistd.h>
13240 #include <signal.h>
13241 $signal_t blech(int x) { exit(3); }
13243 #if defined(F_SETLK) && defined(F_SETLKW)
13244 struct flock flock;
13246 fd = open("try.c", O_RDONLY);
13247 flock.l_type = F_RDLCK;
13248 flock.l_whence = SEEK_SET;
13249 flock.l_start = flock.l_len = 0;
13250 signal(SIGALRM, blech);
13252 retval = fcntl(fd, F_SETLK, &flock);
13254 (retval < 0 ? exit(2) : exit(0));
13260 echo "Checking if fcntl-based file locking works... "
13264 if eval $compile_ok; then
13265 if $run ./try; then
13266 echo "Yes, it seems to work."
13269 echo "Nope, it didn't work."
13274 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13275 *** This is (almost) impossible.
13276 *** If your NFS lock daemons are not feeling well, something like
13277 *** this may happen, please investigate. Cannot continue, aborting.
13285 echo "I'm unable to compile the test program, so I'll assume not."
13290 echo "Nope, since you don't even have fcntl()."
13293 set d_fcntl_can_lock
13297 : check for fd_set items
13300 Checking to see how well your C compiler handles fd_set and friends ...
13303 #$i_stdlib I_STDLIB
13305 #include <stdlib.h>
13307 #$i_systime I_SYS_TIME
13308 #$i_sysselct I_SYS_SELECT
13309 #$d_socket HAS_SOCKET
13310 #include <sys/types.h>
13312 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13315 #include <sys/time.h>
13317 #ifdef I_SYS_SELECT
13318 #include <sys/select.h>
13327 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13335 if eval $compile; then
13336 d_fds_bits="$define"
13338 echo "Well, your system knows about the normal fd_set typedef..." >&4
13339 if $run ./try; then
13340 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13341 d_fd_macros="$define"
13344 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13346 d_fd_macros="$undef"
13350 Hmm, your compiler has some difficulty with fd_set. Checking further...
13353 if eval $compile; then
13354 d_fds_bits="$undef"
13356 echo "Well, your system has some sort of fd_set available..." >&4
13357 if $run ./try; then
13358 echo "and you have the normal fd_set macros." >&4
13359 d_fd_macros="$define"
13362 but not the normal fd_set macros! Gross! More work for me...
13364 d_fd_macros="$undef"
13367 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13369 d_fds_bits="$undef"
13370 d_fd_macros="$undef"
13375 : see if fgetpos exists
13376 set fgetpos d_fgetpos
13379 : see if finite exists
13380 set finite d_finite
13383 : see if finitel exists
13384 set finitel d_finitel
13387 : see if flock exists
13391 : see if prototype for flock is available
13393 set d_flockproto flock $i_sysfile sys/file.h
13396 : see if fp_class exists
13397 set fp_class d_fp_class
13400 : see if pathconf exists
13401 set pathconf d_pathconf
13404 : see if fpathconf exists
13405 set fpathconf d_fpathconf
13408 : see if fpclass exists
13409 set fpclass d_fpclass
13412 : see if fpclassify exists
13413 set fpclassify d_fpclassify
13416 : see if fpclassl exists
13417 set fpclassl d_fpclassl
13420 : check for fpos64_t
13422 echo "Checking to see if you have fpos64_t..." >&4
13425 int main() { fpos64_t x = 7; }
13428 if eval $compile; then
13430 echo "You have fpos64_t."
13433 echo "You do not have fpos64_t."
13434 case "$fpossize" in
13435 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13442 : see if frexpl exists
13443 set frexpl d_frexpl
13446 : see if this is a sys/param system
13447 set sys/param.h i_sysparam
13450 : see if this is a sys/mount.h system
13451 set sys/mount.h i_sysmount
13454 : Check for fs_data_s
13456 echo "Checking to see if your system supports struct fs_data..." >&4
13457 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13459 case "$d_fs_data_s" in
13460 "$define") echo "Yes, it does." ;;
13461 *) echo "No, it doesn't." ;;
13464 : see if fseeko exists
13465 set fseeko d_fseeko
13467 case "$longsize" in
13468 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13471 : see if fsetpos exists
13472 set fsetpos d_fsetpos
13475 : see if fstatfs exists
13476 set fstatfs d_fstatfs
13479 : see if statvfs exists
13480 set statvfs d_statvfs
13483 : see if fstatvfs exists
13484 set fstatvfs d_fstatvfs
13488 : see if fsync exists
13492 : see if ftello exists
13493 set ftello d_ftello
13495 case "$longsize" in
13496 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13499 : check for a working futimes
13502 echo "Checking if you have a working futimes()" >&4
13505 #include <sys/time.h>
13512 fd = open ("try.c", O_RDWR);
13513 if (-1 == fd) exit (1);
13514 rv = futimes (fd, NULL);
13515 exit (rv == -1 ? errno : 0);
13519 if eval $compile; then
13523 0) echo "Yes, you have" >&4
13524 d_futimes="$define"
13526 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13530 echo "No, it does not (probably harmless)" >&4
13534 : see if ndbm.h is available
13537 : Compatibility location for RedHat 7.1
13538 set gdbm/ndbm.h i_gdbmndbm
13540 : Compatibility location for Debian 4.0
13541 set gdbm-ndbm.h i_gdbm_ndbm
13545 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13546 : see if dbm_open exists
13547 set dbm_open d_dbm_open
13549 case "$d_dbm_open" in
13552 i_gdbmndbm="$undef"
13553 i_gdbm_ndbm="$undef"
13554 echo "We won't be including <ndbm.h>"
13564 ndbm_hdr_protochk='name=$1; hdr=$2;
13565 eval "ihdr=\$""i_$name";
13567 if $test "$ihdr" = "$define"; then
13568 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13569 case "$d_cplusplus" in
13570 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13571 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13574 $define) $echo "Your <$hdr> seems to have prototypes";;
13575 *) $echo "Your <$hdr> does not seem to have prototypes";;
13578 set "d_${name}_h_uses_prototypes";
13582 eval $ndbm_hdr_protochk
13583 set gdbmndbm gdbm/ndbm.h
13584 eval $ndbm_hdr_protochk
13585 set gdbm_ndbm gdbm-ndbm.h
13586 eval $ndbm_hdr_protochk
13588 : see if getaddrinfo exists
13589 set getaddrinfo d_getaddrinfo
13592 : see if getcwd exists
13593 set getcwd d_getcwd
13596 : see if getespwnam exists
13597 set getespwnam d_getespwnam
13600 : see if getfsstat exists
13601 set getfsstat d_getfsstat
13604 : see if getgrent exists
13605 set getgrent d_getgrent
13608 : see if getgrent_r exists
13609 set getgrent_r d_getgrent_r
13611 case "$d_getgrent_r" in
13613 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13614 case "$d_getgrent_r_proto:$usethreads" in
13615 ":define") d_getgrent_r_proto=define
13616 set d_getgrent_r_proto getgrent_r $hdrs
13620 case "$d_getgrent_r_proto" in
13622 case "$getgrent_r_proto" in
13623 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13624 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13626 case "$getgrent_r_proto" in
13627 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13628 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13630 case "$getgrent_r_proto" in
13631 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13632 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13634 case "$getgrent_r_proto" in
13635 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13636 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13638 case "$getgrent_r_proto" in
13639 ''|0) try='int getgrent_r(struct group*, char*, int);'
13640 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13642 case "$getgrent_r_proto" in
13643 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13644 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13646 case "$getgrent_r_proto" in
13647 ''|0) d_getgrent_r=undef
13649 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13650 * ) case "$getgrent_r_proto" in
13651 REENTRANT_PROTO*) ;;
13652 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13654 echo "Prototype: $try" ;;
13657 *) case "$usethreads" in
13658 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13665 *) getgrent_r_proto=0
13669 : see if getgrgid_r exists
13670 set getgrgid_r d_getgrgid_r
13672 case "$d_getgrgid_r" in
13674 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13675 case "$d_getgrgid_r_proto:$usethreads" in
13676 ":define") d_getgrgid_r_proto=define
13677 set d_getgrgid_r_proto getgrgid_r $hdrs
13681 case "$d_getgrgid_r_proto" in
13683 case "$getgrgid_r_proto" in
13684 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13685 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13687 case "$getgrgid_r_proto" in
13688 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13689 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13691 case "$getgrgid_r_proto" in
13692 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13693 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13695 case "$getgrgid_r_proto" in
13696 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13697 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13699 case "$getgrgid_r_proto" in
13700 ''|0) d_getgrgid_r=undef
13702 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13703 * ) case "$getgrgid_r_proto" in
13704 REENTRANT_PROTO*) ;;
13705 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13707 echo "Prototype: $try" ;;
13710 *) case "$usethreads" in
13711 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13718 *) getgrgid_r_proto=0
13722 : see if getgrnam_r exists
13723 set getgrnam_r d_getgrnam_r
13725 case "$d_getgrnam_r" in
13727 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13728 case "$d_getgrnam_r_proto:$usethreads" in
13729 ":define") d_getgrnam_r_proto=define
13730 set d_getgrnam_r_proto getgrnam_r $hdrs
13734 case "$d_getgrnam_r_proto" in
13736 case "$getgrnam_r_proto" in
13737 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13738 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13740 case "$getgrnam_r_proto" in
13741 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13742 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13744 case "$getgrnam_r_proto" in
13745 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13746 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13748 case "$getgrnam_r_proto" in
13749 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13750 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13752 case "$getgrnam_r_proto" in
13753 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13754 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13756 case "$getgrnam_r_proto" in
13757 ''|0) d_getgrnam_r=undef
13759 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13760 * ) case "$getgrnam_r_proto" in
13761 REENTRANT_PROTO*) ;;
13762 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13764 echo "Prototype: $try" ;;
13767 *) case "$usethreads" in
13768 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13775 *) getgrnam_r_proto=0
13779 : see if gethostbyaddr exists
13780 set gethostbyaddr d_gethbyaddr
13783 : see if gethostbyname exists
13784 set gethostbyname d_gethbyname
13787 : see if gethostent exists
13788 set gethostent d_gethent
13791 : see how we will look up host name
13794 if set gethostname val -f d_gethname; eval $csym; $val; then
13795 echo 'gethostname() found.' >&4
13796 d_gethname="$define"
13799 if set uname val -f d_uname; eval $csym; $val; then
13802 uname() was found, but you're running xenix, and older versions of xenix
13803 have a broken uname(). If you don't really know whether your xenix is old
13804 enough to have a broken system call, use the default answer.
13809 "$define") dflt=n;;
13811 rp='Is your uname() broken?'
13814 n*) d_uname="$define"; call=uname;;
13817 echo 'uname() found.' >&4
13824 case "$d_gethname" in
13825 '') d_gethname="$undef";;
13828 '') d_uname="$undef";;
13830 case "$d_uname$d_gethname" in
13835 Every now and then someone has a $call() that lies about the hostname
13836 but can't be fixed for political or economic reasons. If you wish, I can
13837 pretend $call() isn't there and maybe compute hostname at run-time
13838 thanks to the '$phostname' command.
13841 rp="Shall I ignore $call() from now on?"
13844 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13847 case "$phostname" in
13848 '') aphostname='';;
13849 *) case "$aphostname" in
13851 *) set X $phostname
13855 file=`./loc $file $file $pth`
13856 aphostname=`echo $file $*`
13861 case "$d_uname$d_gethname" in
13864 case "$phostname" in
13866 echo "There will be no way for $package to get your hostname." >&4;;
13868 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13872 case "$d_phostname" in
13873 '') d_phostname="$undef";;
13876 : see if gethostbyaddr_r exists
13877 set gethostbyaddr_r d_gethostbyaddr_r
13879 case "$d_gethostbyaddr_r" in
13881 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13882 case "$d_gethostbyaddr_r_proto:$usethreads" in
13883 ":define") d_gethostbyaddr_r_proto=define
13884 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13888 case "$d_gethostbyaddr_r_proto" in
13890 case "$gethostbyaddr_r_proto" in
13891 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13892 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13894 case "$gethostbyaddr_r_proto" in
13895 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13896 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13898 case "$gethostbyaddr_r_proto" in
13899 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13900 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13902 case "$gethostbyaddr_r_proto" in
13903 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13904 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13906 case "$gethostbyaddr_r_proto" in
13907 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13908 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13910 case "$gethostbyaddr_r_proto" in
13911 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13912 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13914 case "$gethostbyaddr_r_proto" in
13915 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13916 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13918 case "$gethostbyaddr_r_proto" in
13919 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13920 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13922 case "$gethostbyaddr_r_proto" in
13923 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13924 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13926 case "$gethostbyaddr_r_proto" in
13927 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13928 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13930 case "$gethostbyaddr_r_proto" in
13931 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13932 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13934 case "$gethostbyaddr_r_proto" in
13935 ''|0) d_gethostbyaddr_r=undef
13936 gethostbyaddr_r_proto=0
13937 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13938 * ) case "$gethostbyaddr_r_proto" in
13939 REENTRANT_PROTO*) ;;
13940 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13942 echo "Prototype: $try" ;;
13945 *) case "$usethreads" in
13946 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13948 d_gethostbyaddr_r=undef
13949 gethostbyaddr_r_proto=0
13953 *) gethostbyaddr_r_proto=0
13957 : see if gethostbyname_r exists
13958 set gethostbyname_r d_gethostbyname_r
13960 case "$d_gethostbyname_r" in
13962 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13963 case "$d_gethostbyname_r_proto:$usethreads" in
13964 ":define") d_gethostbyname_r_proto=define
13965 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13969 case "$d_gethostbyname_r_proto" in
13971 case "$gethostbyname_r_proto" in
13972 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13973 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13975 case "$gethostbyname_r_proto" in
13976 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13977 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13979 case "$gethostbyname_r_proto" in
13980 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13981 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13983 case "$gethostbyname_r_proto" in
13984 ''|0) d_gethostbyname_r=undef
13985 gethostbyname_r_proto=0
13986 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13987 * ) case "$gethostbyname_r_proto" in
13988 REENTRANT_PROTO*) ;;
13989 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13991 echo "Prototype: $try" ;;
13994 *) case "$usethreads" in
13995 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13997 d_gethostbyname_r=undef
13998 gethostbyname_r_proto=0
14002 *) gethostbyname_r_proto=0
14006 : see if gethostent_r exists
14007 set gethostent_r d_gethostent_r
14009 case "$d_gethostent_r" in
14011 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14012 case "$d_gethostent_r_proto:$usethreads" in
14013 ":define") d_gethostent_r_proto=define
14014 set d_gethostent_r_proto gethostent_r $hdrs
14018 case "$d_gethostent_r_proto" in
14020 case "$gethostent_r_proto" in
14021 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14022 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14024 case "$gethostent_r_proto" in
14025 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14026 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14028 case "$gethostent_r_proto" in
14029 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14030 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14032 case "$gethostent_r_proto" in
14033 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14034 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14036 case "$gethostent_r_proto" in
14037 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14038 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14040 case "$gethostent_r_proto" in
14041 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14042 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14044 case "$gethostent_r_proto" in
14045 ''|0) d_gethostent_r=undef
14046 gethostent_r_proto=0
14047 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14048 * ) case "$gethostent_r_proto" in
14049 REENTRANT_PROTO*) ;;
14050 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14052 echo "Prototype: $try" ;;
14055 *) case "$usethreads" in
14056 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14058 d_gethostent_r=undef
14059 gethostent_r_proto=0
14063 *) gethostent_r_proto=0
14067 : see if prototypes for various gethostxxx netdb.h functions are available
14069 set d_gethostprotos gethostent $i_netdb netdb.h
14072 : see if getitimer exists
14073 set getitimer d_getitimer
14076 : see if getlogin exists
14077 set getlogin d_getlogin
14080 : see if getlogin_r exists
14081 set getlogin_r d_getlogin_r
14083 case "$d_getlogin_r" in
14085 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14086 case "$d_getlogin_r_proto:$usethreads" in
14087 ":define") d_getlogin_r_proto=define
14088 set d_getlogin_r_proto getlogin_r $hdrs
14092 case "$d_getlogin_r_proto" in
14094 case "$getlogin_r_proto" in
14095 ''|0) try='int getlogin_r(char*, size_t);'
14096 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14098 case "$getlogin_r_proto" in
14099 ''|0) try='int getlogin_r(char*, int);'
14100 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14102 case "$getlogin_r_proto" in
14103 ''|0) try='char* getlogin_r(char*, size_t);'
14104 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14106 case "$getlogin_r_proto" in
14107 ''|0) try='char* getlogin_r(char*, int);'
14108 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14110 case "$getlogin_r_proto" in
14111 ''|0) d_getlogin_r=undef
14113 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14114 * ) case "$getlogin_r_proto" in
14115 REENTRANT_PROTO*) ;;
14116 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14118 echo "Prototype: $try" ;;
14121 *) case "$usethreads" in
14122 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14129 *) getlogin_r_proto=0
14133 : see if getmnt exists
14134 set getmnt d_getmnt
14137 : see if getmntent exists
14138 set getmntent d_getmntent
14141 : see if getnameinfo exists
14142 set getnameinfo d_getnameinfo
14145 : see if getnetbyaddr exists
14146 set getnetbyaddr d_getnbyaddr
14149 : see if getnetbyname exists
14150 set getnetbyname d_getnbyname
14153 : see if getnetent exists
14154 set getnetent d_getnent
14157 : see if getnetbyaddr_r exists
14158 set getnetbyaddr_r d_getnetbyaddr_r
14160 case "$d_getnetbyaddr_r" in
14162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14163 case "$d_getnetbyaddr_r_proto:$usethreads" in
14164 ":define") d_getnetbyaddr_r_proto=define
14165 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14169 case "$d_getnetbyaddr_r_proto" in
14171 case "$getnetbyaddr_r_proto" in
14172 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14173 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14175 case "$getnetbyaddr_r_proto" in
14176 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14177 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14179 case "$getnetbyaddr_r_proto" in
14180 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14181 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14183 case "$getnetbyaddr_r_proto" in
14184 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14185 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14187 case "$getnetbyaddr_r_proto" in
14188 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14189 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14191 case "$getnetbyaddr_r_proto" in
14192 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14193 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14195 case "$getnetbyaddr_r_proto" in
14196 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14197 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14199 case "$getnetbyaddr_r_proto" in
14200 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14201 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14203 case "$getnetbyaddr_r_proto" in
14204 ''|0) d_getnetbyaddr_r=undef
14205 getnetbyaddr_r_proto=0
14206 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14207 * ) case "$getnetbyaddr_r_proto" in
14208 REENTRANT_PROTO*) ;;
14209 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14211 echo "Prototype: $try" ;;
14214 *) case "$usethreads" in
14215 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14217 d_getnetbyaddr_r=undef
14218 getnetbyaddr_r_proto=0
14222 *) getnetbyaddr_r_proto=0
14226 : see if getnetbyname_r exists
14227 set getnetbyname_r d_getnetbyname_r
14229 case "$d_getnetbyname_r" in
14231 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14232 case "$d_getnetbyname_r_proto:$usethreads" in
14233 ":define") d_getnetbyname_r_proto=define
14234 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14238 case "$d_getnetbyname_r_proto" in
14240 case "$getnetbyname_r_proto" in
14241 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14242 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14244 case "$getnetbyname_r_proto" in
14245 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14246 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14248 case "$getnetbyname_r_proto" in
14249 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14250 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14252 case "$getnetbyname_r_proto" in
14253 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14254 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14256 case "$getnetbyname_r_proto" in
14257 ''|0) d_getnetbyname_r=undef
14258 getnetbyname_r_proto=0
14259 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14260 * ) case "$getnetbyname_r_proto" in
14261 REENTRANT_PROTO*) ;;
14262 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14264 echo "Prototype: $try" ;;
14267 *) case "$usethreads" in
14268 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14270 d_getnetbyname_r=undef
14271 getnetbyname_r_proto=0
14275 *) getnetbyname_r_proto=0
14279 : see if getnetent_r exists
14280 set getnetent_r d_getnetent_r
14282 case "$d_getnetent_r" in
14284 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14285 case "$d_getnetent_r_proto:$usethreads" in
14286 ":define") d_getnetent_r_proto=define
14287 set d_getnetent_r_proto getnetent_r $hdrs
14291 case "$d_getnetent_r_proto" in
14293 case "$getnetent_r_proto" in
14294 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14295 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14297 case "$getnetent_r_proto" in
14298 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14299 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14301 case "$getnetent_r_proto" in
14302 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14303 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14305 case "$getnetent_r_proto" in
14306 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14307 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14309 case "$getnetent_r_proto" in
14310 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14311 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14313 case "$getnetent_r_proto" in
14314 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14315 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14317 case "$getnetent_r_proto" in
14318 ''|0) d_getnetent_r=undef
14319 getnetent_r_proto=0
14320 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14321 * ) case "$getnetent_r_proto" in
14322 REENTRANT_PROTO*) ;;
14323 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14325 echo "Prototype: $try" ;;
14328 *) case "$usethreads" in
14329 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14331 d_getnetent_r=undef
14332 getnetent_r_proto=0
14336 *) getnetent_r_proto=0
14340 : see if prototypes for various getnetxxx netdb.h functions are available
14342 set d_getnetprotos getnetent $i_netdb netdb.h
14345 : see if getpagesize exists
14346 set getpagesize d_getpagsz
14349 : Optional checks for getprotobyname and getprotobynumber
14351 : see if getprotobyname exists
14352 set getprotobyname d_getpbyname
14355 : see if getprotobynumber exists
14356 set getprotobynumber d_getpbynumber
14359 : see if getprotoent exists
14360 set getprotoent d_getpent
14363 : see if getpgid exists
14364 set getpgid d_getpgid
14367 : see if getpgrp2 exists
14368 set getpgrp2 d_getpgrp2
14371 : see if getppid exists
14372 set getppid d_getppid
14375 : see if getpriority exists
14376 set getpriority d_getprior
14379 : see if getprotobyname_r exists
14380 set getprotobyname_r d_getprotobyname_r
14382 case "$d_getprotobyname_r" in
14384 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14385 case "$d_getprotobyname_r_proto:$usethreads" in
14386 ":define") d_getprotobyname_r_proto=define
14387 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14391 case "$d_getprotobyname_r_proto" in
14393 case "$getprotobyname_r_proto" in
14394 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14395 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14397 case "$getprotobyname_r_proto" in
14398 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14399 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14401 case "$getprotobyname_r_proto" in
14402 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14403 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14405 case "$getprotobyname_r_proto" in
14406 ''|0) d_getprotobyname_r=undef
14407 getprotobyname_r_proto=0
14408 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14409 * ) case "$getprotobyname_r_proto" in
14410 REENTRANT_PROTO*) ;;
14411 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14413 echo "Prototype: $try" ;;
14416 *) case "$usethreads" in
14417 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14419 d_getprotobyname_r=undef
14420 getprotobyname_r_proto=0
14424 *) getprotobyname_r_proto=0
14428 : see if getprotobynumber_r exists
14429 set getprotobynumber_r d_getprotobynumber_r
14431 case "$d_getprotobynumber_r" in
14433 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14434 case "$d_getprotobynumber_r_proto:$usethreads" in
14435 ":define") d_getprotobynumber_r_proto=define
14436 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14440 case "$d_getprotobynumber_r_proto" in
14442 case "$getprotobynumber_r_proto" in
14443 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14444 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14446 case "$getprotobynumber_r_proto" in
14447 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14448 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14450 case "$getprotobynumber_r_proto" in
14451 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14452 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14454 case "$getprotobynumber_r_proto" in
14455 ''|0) d_getprotobynumber_r=undef
14456 getprotobynumber_r_proto=0
14457 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14458 * ) case "$getprotobynumber_r_proto" in
14459 REENTRANT_PROTO*) ;;
14460 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14462 echo "Prototype: $try" ;;
14465 *) case "$usethreads" in
14466 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14468 d_getprotobynumber_r=undef
14469 getprotobynumber_r_proto=0
14473 *) getprotobynumber_r_proto=0
14477 : see if getprotoent_r exists
14478 set getprotoent_r d_getprotoent_r
14480 case "$d_getprotoent_r" in
14482 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14483 case "$d_getprotoent_r_proto:$usethreads" in
14484 ":define") d_getprotoent_r_proto=define
14485 set d_getprotoent_r_proto getprotoent_r $hdrs
14489 case "$d_getprotoent_r_proto" in
14491 case "$getprotoent_r_proto" in
14492 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14493 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14495 case "$getprotoent_r_proto" in
14496 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14497 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14499 case "$getprotoent_r_proto" in
14500 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14501 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14503 case "$getprotoent_r_proto" in
14504 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14505 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14507 case "$getprotoent_r_proto" in
14508 ''|0) d_getprotoent_r=undef
14509 getprotoent_r_proto=0
14510 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14511 * ) case "$getprotoent_r_proto" in
14512 REENTRANT_PROTO*) ;;
14513 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14515 echo "Prototype: $try" ;;
14518 *) case "$usethreads" in
14519 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14521 d_getprotoent_r=undef
14522 getprotoent_r_proto=0
14526 *) getprotoent_r_proto=0
14530 : see if prototypes for various getprotoxxx netdb.h functions are available
14532 set d_getprotoprotos getprotoent $i_netdb netdb.h
14535 : see if getprpwnam exists
14536 set getprpwnam d_getprpwnam
14539 : see if getpwent exists
14540 set getpwent d_getpwent
14543 : see if getpwent_r exists
14544 set getpwent_r d_getpwent_r
14546 case "$d_getpwent_r" in
14548 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14549 case "$d_getpwent_r_proto:$usethreads" in
14550 ":define") d_getpwent_r_proto=define
14551 set d_getpwent_r_proto getpwent_r $hdrs
14555 case "$d_getpwent_r_proto" in
14557 case "$getpwent_r_proto" in
14558 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14559 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14561 case "$getpwent_r_proto" in
14562 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14563 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14565 case "$getpwent_r_proto" in
14566 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14567 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14569 case "$getpwent_r_proto" in
14570 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14571 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14573 case "$getpwent_r_proto" in
14574 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14575 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14577 case "$getpwent_r_proto" in
14578 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14579 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14581 case "$getpwent_r_proto" in
14582 ''|0) d_getpwent_r=undef
14584 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14585 * ) case "$getpwent_r_proto" in
14586 REENTRANT_PROTO*) ;;
14587 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14589 echo "Prototype: $try" ;;
14592 *) case "$usethreads" in
14593 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14600 *) getpwent_r_proto=0
14604 : see if getpwnam_r exists
14605 set getpwnam_r d_getpwnam_r
14607 case "$d_getpwnam_r" in
14609 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14610 case "$d_getpwnam_r_proto:$usethreads" in
14611 ":define") d_getpwnam_r_proto=define
14612 set d_getpwnam_r_proto getpwnam_r $hdrs
14616 case "$d_getpwnam_r_proto" in
14618 case "$getpwnam_r_proto" in
14619 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14620 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14622 case "$getpwnam_r_proto" in
14623 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14624 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14626 case "$getpwnam_r_proto" in
14627 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14628 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14630 case "$getpwnam_r_proto" in
14631 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14632 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14634 case "$getpwnam_r_proto" in
14635 ''|0) d_getpwnam_r=undef
14637 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14638 * ) case "$getpwnam_r_proto" in
14639 REENTRANT_PROTO*) ;;
14640 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14642 echo "Prototype: $try" ;;
14645 *) case "$usethreads" in
14646 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14653 *) getpwnam_r_proto=0
14657 : see if getpwuid_r exists
14658 set getpwuid_r d_getpwuid_r
14660 case "$d_getpwuid_r" in
14662 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14663 case "$d_getpwuid_r_proto:$usethreads" in
14664 ":define") d_getpwuid_r_proto=define
14665 set d_getpwuid_r_proto getpwuid_r $hdrs
14669 case "$d_getpwuid_r_proto" in
14671 case "$getpwuid_r_proto" in
14672 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14673 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14675 case "$getpwuid_r_proto" in
14676 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14677 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14679 case "$getpwuid_r_proto" in
14680 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14681 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14683 case "$getpwuid_r_proto" in
14684 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14685 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14687 case "$getpwuid_r_proto" in
14688 ''|0) d_getpwuid_r=undef
14690 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14691 * ) case "$getpwuid_r_proto" in
14692 REENTRANT_PROTO*) ;;
14693 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14695 echo "Prototype: $try" ;;
14698 *) case "$usethreads" in
14699 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14706 *) getpwuid_r_proto=0
14710 : Optional checks for getsbyname and getsbyport
14712 : see if getservbyname exists
14713 set getservbyname d_getsbyname
14716 : see if getservbyport exists
14717 set getservbyport d_getsbyport
14720 : see if getservent exists
14721 set getservent d_getsent
14724 : see if getservbyname_r exists
14725 set getservbyname_r d_getservbyname_r
14727 case "$d_getservbyname_r" in
14729 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14730 case "$d_getservbyname_r_proto:$usethreads" in
14731 ":define") d_getservbyname_r_proto=define
14732 set d_getservbyname_r_proto getservbyname_r $hdrs
14736 case "$d_getservbyname_r_proto" in
14738 case "$getservbyname_r_proto" in
14739 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14740 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14742 case "$getservbyname_r_proto" in
14743 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14744 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14746 case "$getservbyname_r_proto" in
14747 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14748 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14750 case "$getservbyname_r_proto" in
14751 ''|0) d_getservbyname_r=undef
14752 getservbyname_r_proto=0
14753 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14754 * ) case "$getservbyname_r_proto" in
14755 REENTRANT_PROTO*) ;;
14756 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14758 echo "Prototype: $try" ;;
14761 *) case "$usethreads" in
14762 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14764 d_getservbyname_r=undef
14765 getservbyname_r_proto=0
14769 *) getservbyname_r_proto=0
14773 : see if getservbyport_r exists
14774 set getservbyport_r d_getservbyport_r
14776 case "$d_getservbyport_r" in
14778 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14779 case "$d_getservbyport_r_proto:$usethreads" in
14780 ":define") d_getservbyport_r_proto=define
14781 set d_getservbyport_r_proto getservbyport_r $hdrs
14785 case "$d_getservbyport_r_proto" in
14787 case "$getservbyport_r_proto" in
14788 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14789 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14791 case "$getservbyport_r_proto" in
14792 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14793 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14795 case "$getservbyport_r_proto" in
14796 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14797 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14799 case "$getservbyport_r_proto" in
14800 ''|0) d_getservbyport_r=undef
14801 getservbyport_r_proto=0
14802 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14803 * ) case "$getservbyport_r_proto" in
14804 REENTRANT_PROTO*) ;;
14805 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14807 echo "Prototype: $try" ;;
14810 *) case "$usethreads" in
14811 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14813 d_getservbyport_r=undef
14814 getservbyport_r_proto=0
14818 *) getservbyport_r_proto=0
14822 : see if getservent_r exists
14823 set getservent_r d_getservent_r
14825 case "$d_getservent_r" in
14827 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14828 case "$d_getservent_r_proto:$usethreads" in
14829 ":define") d_getservent_r_proto=define
14830 set d_getservent_r_proto getservent_r $hdrs
14834 case "$d_getservent_r_proto" in
14836 case "$getservent_r_proto" in
14837 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14838 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14840 case "$getservent_r_proto" in
14841 ''|0) try='int getservent_r(struct servent*, char*, int);'
14842 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14844 case "$getservent_r_proto" in
14845 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14846 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14848 case "$getservent_r_proto" in
14849 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14850 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14852 case "$getservent_r_proto" in
14853 ''|0) d_getservent_r=undef
14854 getservent_r_proto=0
14855 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14856 * ) case "$getservent_r_proto" in
14857 REENTRANT_PROTO*) ;;
14858 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14860 echo "Prototype: $try" ;;
14863 *) case "$usethreads" in
14864 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14866 d_getservent_r=undef
14867 getservent_r_proto=0
14871 *) getservent_r_proto=0
14875 : see if prototypes for various getservxxx netdb.h functions are available
14877 set d_getservprotos getservent $i_netdb netdb.h
14880 : see if getspnam exists
14881 set getspnam d_getspnam
14884 : see if this is a shadow.h system
14885 set shadow.h i_shadow
14888 : see if getspnam_r exists
14889 set getspnam_r d_getspnam_r
14891 case "$d_getspnam_r" in
14893 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14894 case "$d_getspnam_r_proto:$usethreads" in
14895 ":define") d_getspnam_r_proto=define
14896 set d_getspnam_r_proto getspnam_r $hdrs
14900 case "$d_getspnam_r_proto" in
14902 case "$getspnam_r_proto" in
14903 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14904 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14906 case "$getspnam_r_proto" in
14907 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14908 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14910 case "$getspnam_r_proto" in
14911 ''|0) d_getspnam_r=undef
14913 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14914 * ) case "$getspnam_r_proto" in
14915 REENTRANT_PROTO*) ;;
14916 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14918 echo "Prototype: $try" ;;
14921 *) case "$usethreads" in
14922 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14929 *) getspnam_r_proto=0
14933 : see if gettimeofday or ftime exists
14934 set gettimeofday d_gettimeod
14936 case "$d_gettimeod" in
14942 val="$undef"; set d_ftime; eval $setvar
14945 case "$d_gettimeod$d_ftime" in
14948 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14952 : see if gmtime_r exists
14953 set gmtime_r d_gmtime_r
14955 case "$d_gmtime_r" in
14957 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14958 case "$d_gmtime_r_proto:$usethreads" in
14959 ":define") d_gmtime_r_proto=define
14960 set d_gmtime_r_proto gmtime_r $hdrs
14964 case "$d_gmtime_r_proto" in
14966 case "$gmtime_r_proto" in
14967 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14968 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14970 case "$gmtime_r_proto" in
14971 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14972 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14974 case "$gmtime_r_proto" in
14975 ''|0) d_gmtime_r=undef
14977 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14978 * ) case "$gmtime_r_proto" in
14979 REENTRANT_PROTO*) ;;
14980 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14982 echo "Prototype: $try" ;;
14985 *) case "$usethreads" in
14986 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14993 *) gmtime_r_proto=0
14997 : see if hasmntopt exists
14998 set hasmntopt d_hasmntopt
15001 : see if this is a netinet/in.h or sys/in.h system
15002 set netinet/in.h i_niin sys/in.h i_sysin
15005 : see if arpa/inet.h has to be included
15006 set arpa/inet.h i_arpainet
15009 : see if htonl --and friends-- exists
15014 : Maybe they are macros.
15017 $cat >htonl.c <<EOM
15019 #include <sys/types.h>
15020 #$i_niin I_NETINET_IN
15022 #$i_arpainet I_ARPA_INET
15023 #ifdef I_NETINET_IN
15024 #include <netinet/in.h>
15027 #include <sys/in.h>
15030 #include <arpa/inet.h>
15033 printf("Defined as a macro.");
15036 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15037 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15039 echo "But it seems to be defined as a macro." >&4
15047 : see if ilogbl exists
15048 set ilogbl d_ilogbl
15053 if set index val -f; eval $csym; $val; then
15054 if set strchr val -f d_strchr; eval $csym; $val; then
15055 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15058 echo "strchr() found." >&4
15062 echo "index() found." >&4
15067 echo "index() found." >&4
15070 if set strchr val -f d_strchr; eval $csym; $val; then
15073 echo "strchr() found." >&4
15075 echo "No index() or strchr() found!" >&4
15080 set d_strchr; eval $setvar
15082 set d_index; eval $setvar
15084 : check whether inet_aton exists
15085 set inet_aton d_inetaton
15088 : see if inet_ntop exists
15089 set inet_ntop d_inetntop
15092 : see if inet_pton exists
15093 set inet_pton d_inetpton
15098 $cat >isascii.c <<EOCP
15101 #$i_stdlib I_STDLIB
15103 #include <stdlib.h>
15114 if eval $compile; then
15115 echo "isascii() found." >&4
15118 echo "isascii() NOT found." >&4
15127 $cat >isblank.c <<'EOCP'
15138 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15139 echo "isblank() found." >&4
15142 echo "isblank() NOT found." >&4
15149 : see if isfinite exists
15150 set isfinite d_isfinite
15153 : see if isinf exists
15157 : see if isnan exists
15161 : see if isnanl exists
15162 set isnanl d_isnanl
15165 : see if killpg exists
15166 set killpg d_killpg
15169 : see if lchown exists
15171 $cat > try.c <<'EOCP'
15172 /* System header to define __stub macros and hopefully few prototypes,
15173 which can conflict with char lchown(); below. */
15174 #include <assert.h>
15175 /* Override any gcc2 internal prototype to avoid an error. */
15176 /* We use char because int might match the return type of a gcc2
15177 builtin and then its argument prototype would still apply. */
15180 /* The GNU C library defines this for functions which it implements
15181 to always fail with ENOSYS. Some functions are actually named
15182 something starting with __ and the normal name is an alias. */
15183 #if defined (__stub_lchown) || defined (__stub___lchown)
15191 if eval $compile; then
15192 $echo "lchown() found." >&4
15195 $echo "lchown() NOT found." >&4
15201 : See if number of significant digits in a double precision number is known
15203 $cat >ldbl_dig.c <<EOM
15204 #$i_limits I_LIMITS
15207 #include <limits.h>
15213 printf("Contains LDBL_DIG");
15216 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15217 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15218 echo "LDBL_DIG found." >&4
15221 echo "LDBL_DIG NOT found." >&4
15228 : see if this is a math.h system
15232 : check to see if math.h defines _LIB_VERSION
15233 d_libm_lib_version="$undef"
15237 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15239 #include <unistd.h>
15241 int main (int argc, char *argv[])
15243 printf ("%d\n", _LIB_VERSION);
15248 if eval $compile; then
15250 echo "Yes, it does ($foo)" >&4
15251 d_libm_lib_version="$define"
15253 echo "No, it does not (probably harmless)" >&4
15260 : see if link exists
15264 : see if localtime_r exists
15265 set localtime_r d_localtime_r
15267 case "$d_localtime_r" in
15269 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15270 case "$d_localtime_r_proto:$usethreads" in
15271 ":define") d_localtime_r_proto=define
15272 set d_localtime_r_proto localtime_r $hdrs
15276 case "$d_localtime_r_proto" in
15278 case "$localtime_r_proto" in
15279 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15280 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15282 case "$localtime_r_proto" in
15283 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15284 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15286 case "$localtime_r_proto" in
15287 ''|0) d_localtime_r=undef
15288 localtime_r_proto=0
15289 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15290 * ) case "$localtime_r_proto" in
15291 REENTRANT_PROTO*) ;;
15292 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15294 echo "Prototype: $try" ;;
15297 *) case "$usethreads" in
15298 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15300 d_localtime_r=undef
15301 localtime_r_proto=0
15305 *) localtime_r_proto=0
15309 : see if localtime_r calls tzset
15310 case "$localtime_r_proto" in
15313 /* Does our libc's localtime_r call tzset ?
15314 * return 0 if so, 1 otherwise.
15316 #$i_systypes I_SYS_TYPES
15317 #$i_unistd I_UNISTD
15319 #$i_stdlib I_STDLIB
15320 #$i_string I_STRING
15321 #$i_malloc I_MALLOC
15323 # include <sys/types.h>
15326 # include <unistd.h>
15332 #include <stdlib.h>
15335 # include <string.h>
15337 # include <strings.h>
15340 # include <malloc.h>
15344 time_t t = time(0L);
15345 char w_tz[]="TZ" "=GMT+5",
15346 e_tz[]="TZ" "=GMT-5",
15347 *tz_e = (char*)malloc(16),
15348 *tz_w = (char*)malloc(16);
15349 struct tm tm_e, tm_w;
15350 memset(&tm_e,'\0',sizeof(struct tm));
15351 memset(&tm_w,'\0',sizeof(struct tm));
15356 localtime_r(&t, &tm_e);
15359 localtime_r(&t, &tm_w);
15361 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15367 if eval $compile; then
15368 if $run ./try; then
15369 d_localtime_r_needs_tzset=undef;
15371 d_localtime_r_needs_tzset=define;
15374 d_localtime_r_needs_tzset=undef;
15378 d_localtime_r_needs_tzset=undef;
15383 : see if localeconv exists
15384 set localeconv d_locconv
15387 : see if lockf exists
15391 : see if prototype for lseek is available
15393 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15396 : see if lstat exists
15400 : see if madvise exists
15401 set madvise d_madvise
15404 : see if malloc_size exists
15405 set malloc_size d_malloc_size
15408 : see if malloc_size_good exists
15409 set malloc_good_size d_malloc_good_size
15412 : see if mblen exists
15416 : see if mbstowcs exists
15417 set mbstowcs d_mbstowcs
15420 : see if mbtowc exists
15421 set mbtowc d_mbtowc
15424 : see if memchr exists
15425 set memchr d_memchr
15428 : see if memcmp exists
15429 set memcmp d_memcmp
15432 : see if memcpy exists
15433 set memcpy d_memcpy
15436 : see if memmove exists
15437 set memmove d_memmove
15440 : see if memset exists
15441 set memset d_memset
15444 : see if mkdir exists
15448 : see if mkdtemp exists
15449 set mkdtemp d_mkdtemp
15452 : see if mkfifo exists
15453 set mkfifo d_mkfifo
15456 : see if mkstemp exists
15457 set mkstemp d_mkstemp
15460 : see if mkstemps exists
15461 set mkstemps d_mkstemps
15464 : see if mktime exists
15465 set mktime d_mktime
15468 : see if this is a sys/mman.h system
15469 set sys/mman.h i_sysmman
15472 : see if mmap exists
15475 : see what shmat returns
15476 : default to something harmless
15478 case "$i_sysmman$d_mmap" in
15480 $cat >mmap.c <<'END'
15481 #include <sys/mman.h>
15484 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15489 echo "and it returns ($mmaptype)." >&4
15495 : see if sqrtl exists
15499 : see if scalbnl exists
15500 set scalbnl d_scalbnl
15503 : see if modfl exists
15507 : see if prototype for modfl is available
15509 set d_modflproto modfl $i_math math.h
15512 d_modfl_pow32_bug="$undef"
15514 case "$d_longdbl$d_modfl" in
15517 Checking to see whether your modfl() is okay for large values...
15523 if $test "X$d_modflproto" != "X$define"; then
15524 $cat >>try.c <<EOCP
15525 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15526 long double modfl (long double, long double *);
15529 $cat >>try.c <<EOCP
15531 long double nv = 4294967303.15;
15537 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15541 case "$osname:$gccversion" in
15542 aix:) saveccflags="$ccflags"
15543 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15546 if eval $compile; then
15549 *" 4294967303.150000 1.150000 4294967302.000000")
15550 echo >&4 "Your modfl() is broken for large values."
15551 d_modfl_pow32_bug="$define"
15553 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15557 *" 4294967303.150000 0.150000 4294967303.000000")
15558 echo >&4 "Your modfl() seems okay for large values."
15560 *) echo >&4 "I don't understand your modfl() at all."
15566 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15569 case "$osname:$gccversion" in
15570 aix:) ccflags="$saveccflags" ;; # restore
15575 if $test "$uselongdouble" = "$define"; then
15577 if $test "$d_sqrtl" != "$define"; then
15578 message="$message sqrtl"
15580 if $test "$d_modfl" != "$define"; then
15581 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15582 echo "You have both aintl and copysignl, so I can emulate modfl."
15584 message="$message modfl"
15587 if $test "$d_frexpl" != "$define"; then
15588 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15589 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15591 message="$message frexpl"
15595 if $test "$message" != ""; then
15598 *** You requested the use of long doubles but you do not seem to have
15599 *** the following mathematical functions needed for long double support:
15601 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15602 *** Cannot continue, aborting.
15610 : see if mprotect exists
15611 set mprotect d_mprotect
15614 : see if msgctl exists
15615 set msgctl d_msgctl
15618 : see if msgget exists
15619 set msgget d_msgget
15622 : see if msgsnd exists
15623 set msgsnd d_msgsnd
15626 : see if msgrcv exists
15627 set msgrcv d_msgrcv
15630 : see how much of the 'msg*(2)' library is present.
15633 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15634 *"$undef"*) h_msg=false;;
15638 case "`ipcs 2>&1`" in
15639 "SVID messages"*"not configured"*)
15640 echo "Your $osname does not have the msg*(2) configured." >&4
15643 set msgctl d_msgctl
15645 set msgget d_msgget
15647 set msgsnd d_msgsnd
15649 set msgrcv d_msgrcv
15655 : we could also check for sys/ipc.h ...
15656 if $h_msg && $test `./findhdr sys/msg.h`; then
15657 echo "You have the full msg*(2) library." >&4
15660 echo "You don't have the full msg*(2) library." >&4
15666 : Check for msghdr_s
15668 echo "Checking to see if your system supports struct msghdr..." >&4
15669 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15671 case "$d_msghdr_s" in
15672 "$define") echo "Yes, it does." ;;
15673 *) echo "No, it doesn't." ;;
15677 : see if msync exists
15681 : see if munmap exists
15682 set munmap d_munmap
15685 : see if nice exists
15689 : see if this is a langinfo.h system
15690 set langinfo.h i_langinfo
15693 : see if nl_langinfo exists
15694 set nl_langinfo d_nl_langinfo
15697 : check for volatile keyword
15699 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15700 $cat >try.c <<'EOCP'
15703 typedef struct _goo_struct goo_struct;
15704 goo_struct * volatile goo = ((goo_struct *)0);
15705 struct _goo_struct {
15710 typedef unsigned short foo_t;
15711 char *volatile foo;
15713 volatile foo_t blech;
15717 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15719 echo "Yup, it does."
15722 echo "Nope, it doesn't."
15728 : Check basic sizes
15730 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15732 case "$use64bitint:$d_quad:$quadtype" in
15735 uvtype="$uquadtype"
15740 uvtype="unsigned long"
15746 case "$uselongdouble:$d_longdbl" in
15748 nvtype="long double"
15749 nvsize=$longdblsize
15756 $echo "(IV will be "$ivtype", $ivsize bytes)"
15757 $echo "(UV will be "$uvtype", $uvsize bytes)"
15758 $echo "(NV will be "$nvtype", $nvsize bytes)"
15761 #$i_inttypes I_INTTYPES
15763 #include <inttypes.h>
15768 int8_t i = INT8_MAX;
15769 uint8_t u = UINT8_MAX;
15770 printf("int8_t\n");
15773 int16_t i = INT16_MAX;
15774 uint16_t i = UINT16_MAX;
15775 printf("int16_t\n");
15778 int32_t i = INT32_MAX;
15779 uint32_t u = UINT32_MAX;
15780 printf("int32_t\n");
15785 i8type="signed char"
15786 u8type="unsigned char"
15791 '') case "$shortsize" in
15793 u16type="unsigned short"
15801 '') set try -DINT16
15802 if eval $compile; then
15803 case "`$run ./try`" in
15815 '') if $test $shortsize -ge 2; then
15817 u16type="unsigned short"
15825 '') case "$longsize" in
15827 u32type="unsigned long"
15831 *) case "$intsize" in
15833 u32type="unsigned int"
15843 '') set try -DINT32
15844 if eval $compile; then
15845 case "`$run ./try`" in
15857 '') if $test $intsize -ge 4; then
15859 u32type="unsigned int"
15867 '') case "$d_quad:$quadtype" in
15869 i64type="$quadtype"
15870 u64type="$uquadtype"
15878 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15879 : volatile so that the compiler has to store it out to memory.
15880 if test X"$d_volatile" = X"$define"; then
15885 #$i_stdlib I_STDLIB
15887 #include <stdlib.h>
15889 #include <sys/types.h>
15890 #include <signal.h>
15892 $volatile int bletched = 0;
15893 $signal_t blech(int s) { bletched = 1; }
15898 int n = 8 * $uvsize;
15901 signal(SIGFPE, blech);
15904 for (i = 0; i < n; i++) {
15905 u = u << 1 | ($uvtype)1;
15907 if (($uvtype)d != u)
15911 d = ($nvtype)(u - 1);
15912 if (($uvtype)d != (u - 1))
15919 printf("%d\n", ((i == n) ? -n : i));
15925 d_nv_preserves_uv="$undef"
15926 if eval $compile; then
15927 nv_preserves_uv_bits="`$run ./try`"
15929 case "$nv_preserves_uv_bits" in
15931 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15932 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15933 d_nv_preserves_uv="$define"
15935 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15936 d_nv_preserves_uv="$undef" ;;
15937 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15938 nv_preserves_uv_bits="0" ;;
15942 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15943 : volatile so that the compiler has to store it out to memory.
15944 if test X"$d_volatile" = X"$define"; then
15950 typedef $nvtype NV;
15957 while(count < 256) {
15958 $volatile NV up = value + 1.0;
15959 $volatile NV negated = -value;
15960 $volatile NV down = negated - 1.0;
15961 $volatile NV got_up = up - value;
15962 int up_good = got_up == 1.0;
15963 int got_down = down - negated;
15964 int down_good = got_down == -1.0;
15966 if (down_good != up_good) {
15968 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15969 up_good, (double) got_up, down_good, (double) got_down,
15970 count, (double) value);
15977 fputs("256.0", stdout);
15980 fputs("2.0", stdout);
15986 fputs("*", stdout);
15992 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15993 count, (double) value);
15999 nv_overflows_integers_at='0'
16000 if eval $compile; then
16006 The largest integer your NVs can preserve is equal to $xxx
16008 nv_overflows_integers_at="$xxx"
16011 Cannot determine the largest integer value your NVs can hold, unexpected output
16018 Cannot determine the largest integer value your NVs can hold
16025 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16026 : volatile so that the compiler has to store it out to memory.
16027 if test X"$d_volatile" = X"$define"; then
16032 #$i_stdlib I_STDLIB
16034 #include <stdlib.h>
16036 #$i_string I_STRING
16038 # include <string.h>
16040 # include <strings.h>
16042 #include <sys/types.h>
16043 #include <signal.h>
16045 $volatile int bletched = 0;
16046 $signal_t blech(int s) { bletched = 1; }
16049 int checkit($nvtype d, char *where) {
16050 unsigned char *p = (char *)&d;
16051 unsigned char *end = p + sizeof(d);
16061 printf("No - %s: 0x", where);
16063 printf ("%02X", *p++);
16068 int main(int argc, char **argv) {
16071 fail += checkit(d, "0.0");
16073 /* The compiler shouldn't be assuming that bletched is 0 */
16076 fail += checkit(d, "bleched");
16079 signal(SIGFPE, blech);
16082 /* Paranoia - the compiler should have no way of knowing that ANSI says
16083 that argv[argc] will always be NULL. Actually, if it did assume this it
16084 would be buggy, as this is C and main() can be called from elsewhere in
16086 d = argv[argc] ? 1 : 0;
16089 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16092 fail += checkit(d, "ternary");
16094 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16097 printf("No - memset doesn't give 0.0\n");
16098 /* This might just blow up: */
16099 printf("(gives %g)\n", d);
16105 printf("No - something bleched\n");
16110 printf("No - %d fail(s)\n", fail);
16119 d_nv_zero_is_allbits_zero="$undef"
16120 if eval $compile; then
16126 0.0 is represented as all bits zero in memory
16128 d_nv_zero_is_allbits_zero="$define"
16131 0.0 is not represented as all bits zero in memory
16133 d_nv_zero_is_allbits_zero="$undef"
16138 0.0 is not represented as all bits zero in memory
16140 d_nv_zero_is_allbits_zero="$undef"
16146 : check for off64_t
16148 echo "Checking to see if you have off64_t..." >&4
16150 #include <sys/types.h>
16151 #include <unistd.h>
16152 int main() { off64_t x = 7; }
16155 if eval $compile; then
16157 echo "You have off64_t."
16160 echo "You do not have off64_t."
16161 case "$lseeksize" in
16162 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16169 : how to create joinable pthreads
16170 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16172 echo "Checking what constant to use for creating joinable pthreads..." >&4
16173 $cat >try.c <<'EOCP'
16174 #include <pthread.h>
16176 int detachstate = JOINABLE;
16179 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16180 if eval $compile; then
16181 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16182 val="$undef" # Yes, undef.
16183 set d_old_pthread_create_joinable
16186 set old_pthread_create_joinable
16189 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16190 if eval $compile; then
16191 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16193 set d_old_pthread_create_joinable
16195 val=PTHREAD_CREATE_UNDETACHED
16196 set old_pthread_create_joinable
16199 set try -DJOINABLE=__UNDETACHED
16200 if eval $compile; then
16201 echo "You seem to use __UNDETACHED." >&4
16203 set d_old_pthread_create_joinable
16206 set old_pthread_create_joinable
16209 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16211 set d_old_pthread_create_joinable
16214 set old_pthread_create_joinable
16221 d_old_pthread_create_joinable="$undef"
16222 old_pthread_create_joinable=""
16225 : see if pause exists
16229 : see if poll exists
16233 : see if prctl exists
16237 : see if prctl supports PR_SET_NAME
16238 d_prctl_set_name=$undef
16242 #include <sys/prctl.h>
16244 int main (int argc, char *argv[])
16246 return (prctl (PR_SET_NAME, "Test"));
16250 if eval $compile_ok && $run ./try; then
16251 echo "Your prctl (PR_SET_NAME, ...) works"
16252 d_prctl_set_name=$define
16258 : see if readlink exists
16259 set readlink d_readlink
16262 : Check if exe is symlink to abs path of executing program
16266 case "$d_readlink" in
16268 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16269 : more tidy to avoid an extra level of symlink
16270 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16271 while test $# -gt 0; do
16274 if $issymlink $try; then
16275 $ls -l $try > reflect
16276 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16277 echo "You have $type-like $try."
16278 procselfexe='"'$try'"'
16280 : This will break out of the loop
16291 : backward compatibility for d_hvfork
16292 if test X$d_hvfork != X; then
16293 d_vfork="$d_hvfork"
16296 : see if there is a vfork
16301 d_pseudofork=$undef
16303 : Ok, but do we want to use it. vfork is reportedly unreliable in
16304 : perl on Solaris 2.x, and probably elsewhere.
16308 case "$usevfork" in
16314 Perl can only use a vfork() that doesn't suffer from strict
16315 restrictions on calling functions or modifying global data in
16316 the child. For example, glibc-2.1 contains such a vfork()
16317 that is unsuitable. If your system provides a proper fork()
16318 call, chances are that you do NOT want perl to use vfork().
16321 rp="Do you still want to use vfork()?"
16326 echo "Ok, we won't use vfork()."
16335 $define) usevfork='true';;
16336 *) usevfork='false';;
16339 : see whether the pthread_atfork exists
16341 #include <pthread.h>
16344 #ifdef PTHREAD_ATFORK
16345 pthread_atfork(NULL,NULL,NULL);
16350 : see if pthread_atfork exists
16351 set try -DPTHREAD_ATFORK
16352 if eval $compile; then
16357 case "$usethreads" in
16360 $define) echo 'pthread_atfork found.' >&4 ;;
16361 *) echo 'pthread_atfork NOT found.' >&4 ;;
16364 set d_pthread_atfork
16367 : see if pthread_attr_setscope exists
16368 set pthread_attr_setscope d_pthread_attr_setscope
16371 : see whether the various POSIXish _yields exist
16373 #include <pthread.h>
16379 #ifdef PTHREAD_YIELD
16382 #ifdef PTHREAD_YIELD_NULL
16383 pthread_yield(NULL);
16389 : see if sched_yield exists
16390 set try -DSCHED_YIELD
16391 if eval $compile; then
16393 sched_yield='sched_yield()'
16397 case "$usethreads" in
16400 $define) echo 'sched_yield() found.' >&4 ;;
16401 *) echo 'sched_yield() NOT found.' >&4 ;;
16407 : see if pthread_yield exists
16408 set try -DPTHREAD_YIELD
16409 if eval $compile; then
16411 case "$sched_yield" in
16412 '') sched_yield='pthread_yield()' ;;
16415 set try -DPTHREAD_YIELD_NULL
16416 if eval $compile; then
16418 case "$sched_yield" in
16419 '') sched_yield='pthread_yield(NULL)' ;;
16425 case "$usethreads" in
16428 $define) echo 'pthread_yield() found.' >&4 ;;
16429 *) echo 'pthread_yield() NOT found.' >&4 ;;
16433 set d_pthread_yield
16435 case "$sched_yield" in
16436 '') sched_yield=undef ;;
16440 : see if random_r exists
16441 set random_r d_random_r
16443 case "$d_random_r" in
16445 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16446 case "$d_random_r_proto:$usethreads" in
16447 ":define") d_random_r_proto=define
16448 set d_random_r_proto random_r $hdrs
16452 case "$d_random_r_proto" in
16454 case "$random_r_proto" in
16455 ''|0) try='int random_r(int*, struct random_data*);'
16456 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16458 case "$random_r_proto" in
16459 ''|0) try='int random_r(long*, struct random_data*);'
16460 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16462 case "$random_r_proto" in
16463 ''|0) try='int random_r(struct random_data*, int32_t*);'
16464 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16466 case "$random_r_proto" in
16467 ''|0) d_random_r=undef
16469 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16470 * ) case "$random_r_proto" in
16471 REENTRANT_PROTO*) ;;
16472 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16474 echo "Prototype: $try" ;;
16477 *) case "$usethreads" in
16478 define) echo "random_r has no prototype, not using it." >&4 ;;
16485 *) random_r_proto=0
16489 : see if readdir and friends exist
16490 set readdir d_readdir
16492 set seekdir d_seekdir
16494 set telldir d_telldir
16496 set rewinddir d_rewinddir
16499 : see if readdir64_r exists
16500 set readdir64_r d_readdir64_r
16502 case "$d_readdir64_r" in
16504 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16505 case "$d_readdir64_r_proto:$usethreads" in
16506 ":define") d_readdir64_r_proto=define
16507 set d_readdir64_r_proto readdir64_r $hdrs
16511 case "$d_readdir64_r_proto" in
16513 case "$readdir64_r_proto" in
16514 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16515 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16517 case "$readdir64_r_proto" in
16518 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16519 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16521 case "$readdir64_r_proto" in
16522 ''|0) d_readdir64_r=undef
16523 readdir64_r_proto=0
16524 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16525 * ) case "$readdir64_r_proto" in
16526 REENTRANT_PROTO*) ;;
16527 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16529 echo "Prototype: $try" ;;
16532 *) case "$usethreads" in
16533 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16535 d_readdir64_r=undef
16536 readdir64_r_proto=0
16540 *) readdir64_r_proto=0
16544 : see if readdir_r exists
16545 set readdir_r d_readdir_r
16547 case "$d_readdir_r" in
16549 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16550 case "$d_readdir_r_proto:$usethreads" in
16551 ":define") d_readdir_r_proto=define
16552 set d_readdir_r_proto readdir_r $hdrs
16556 case "$d_readdir_r_proto" in
16558 case "$readdir_r_proto" in
16559 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16560 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16562 case "$readdir_r_proto" in
16563 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16564 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16566 case "$readdir_r_proto" in
16567 ''|0) d_readdir_r=undef
16569 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16570 * ) case "$readdir_r_proto" in
16571 REENTRANT_PROTO*) ;;
16572 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16574 echo "Prototype: $try" ;;
16577 *) case "$usethreads" in
16578 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16585 *) readdir_r_proto=0
16589 : see if readv exists
16593 : see if recvmsg exists
16594 set recvmsg d_recvmsg
16597 : see if rename exists
16598 set rename d_rename
16601 : see if rmdir exists
16605 : see if memory.h is available.
16610 : See if it conflicts with string.h
16616 $cppstdin $cppflags $cppminus < $strings > mem.h
16617 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16619 echo "We won't be including <memory.h>."
16629 : can bcopy handle overlapping blocks?
16632 case "$d_memmove" in
16633 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16634 *) case "$d_bcopy" in
16636 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16638 #$i_memory I_MEMORY
16639 #$i_stdlib I_STDLIB
16640 #$i_string I_STRING
16641 #$i_unistd I_UNISTD
16643 $cat >>try.c <<'EOCP'
16646 # include <memory.h>
16649 # include <stdlib.h>
16652 # include <string.h>
16654 # include <strings.h>
16657 # include <unistd.h> /* Needed for NetBSD */
16661 char buf[128], abc[128];
16667 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16668 try to store the string in read-only memory. */
16669 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16671 for (align = 7; align >= 0; align--) {
16672 for (len = 36; len; len--) {
16674 bcopy(abc, b, len);
16675 for (off = 1; off <= len; off++) {
16676 bcopy(b, b+off, len);
16677 bcopy(b+off, b, len);
16678 if (bcmp(b, abc, len))
16687 if eval $compile_ok; then
16688 if $run ./try 2>/dev/null; then
16689 echo "Yes, it can."
16692 echo "It can't, sorry."
16695 echo "(I can't compile the test program, so we'll assume not...)"
16705 : can memcpy handle overlapping blocks?
16708 case "$d_memmove" in
16709 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16710 *) case "$d_memcpy" in
16712 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16714 #$i_memory I_MEMORY
16715 #$i_stdlib I_STDLIB
16716 #$i_string I_STRING
16717 #$i_unistd I_UNISTD
16719 $cat >>try.c <<'EOCP'
16722 # include <memory.h>
16725 # include <stdlib.h>
16728 # include <string.h>
16730 # include <strings.h>
16733 # include <unistd.h> /* Needed for NetBSD */
16737 char buf[128], abc[128];
16743 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16744 try to store the string in read-only memory. */
16745 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16747 for (align = 7; align >= 0; align--) {
16748 for (len = 36; len; len--) {
16750 memcpy(b, abc, len);
16751 for (off = 1; off <= len; off++) {
16752 memcpy(b+off, b, len);
16753 memcpy(b, b+off, len);
16754 if (memcmp(b, abc, len))
16763 if eval $compile_ok; then
16764 if $run ./try 2>/dev/null; then
16765 echo "Yes, it can."
16768 echo "It can't, sorry."
16771 echo "(I can't compile the test program, so we'll assume not...)"
16781 : can memcmp be trusted to compare relative magnitude?
16783 case "$d_memcmp" in
16786 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16788 #$i_memory I_MEMORY
16789 #$i_stdlib I_STDLIB
16790 #$i_string I_STRING
16791 #$i_unistd I_UNISTD
16793 $cat >>try.c <<'EOCP'
16796 # include <memory.h>
16799 # include <stdlib.h>
16802 # include <string.h>
16804 # include <strings.h>
16807 # include <unistd.h> /* Needed for NetBSD */
16813 if ((a < b) && memcmp(&a, &b, 1) < 0)
16819 if eval $compile_ok; then
16820 if $run ./try 2>/dev/null; then
16821 echo "Yes, it can."
16824 echo "No, it can't (it uses signed chars)."
16827 echo "(I can't compile the test program, so we'll assume not...)"
16835 : see if prototype for sbrk is available
16837 set d_sbrkproto sbrk $i_unistd unistd.h
16840 : see if select exists
16841 set select d_select
16844 : see if semctl exists
16845 set semctl d_semctl
16848 : see if semget exists
16849 set semget d_semget
16852 : see if semop exists
16856 : see how much of the 'sem*(2)' library is present.
16859 case "$d_semctl$d_semget$d_semop" in
16860 *"$undef"*) h_sem=false;;
16864 case "`ipcs 2>&1`" in
16865 "SVID messages"*"not configured"*)
16866 echo "Your $osname does not have the sem*(2) configured." >&4
16869 set semctl d_semctl
16871 set semget d_semget
16879 : we could also check for sys/ipc.h ...
16880 if $h_sem && $test `./findhdr sys/sem.h`; then
16881 echo "You have the full sem*(2) library." >&4
16884 echo "You don't have the full sem*(2) library." >&4
16890 : see whether sys/sem.h defines union semun
16892 $cat > try.c <<'END'
16893 #include <sys/types.h>
16894 #include <sys/ipc.h>
16895 #include <sys/sem.h>
16896 int main () { union semun semun; semun.buf = 0; }
16899 if eval $compile; then
16900 echo "You have union semun in <sys/sem.h>." >&4
16903 echo "You do not have union semun in <sys/sem.h>." >&4
16910 : see how to do semctl IPC_STAT
16914 $cat > tryh.h <<END
16917 # define S_IRUSR S_IREAD
16918 # define S_IWUSR S_IWRITE
16919 # define S_IXUSR S_IEXEC
16921 # define S_IRUSR 0400
16922 # define S_IWUSR 0200
16923 # define S_IXUSR 0100
16925 # define S_IRGRP (S_IRUSR>>3)
16926 # define S_IWGRP (S_IWUSR>>3)
16927 # define S_IXGRP (S_IXUSR>>3)
16928 # define S_IROTH (S_IRUSR>>6)
16929 # define S_IWOTH (S_IWUSR>>6)
16930 # define S_IXOTH (S_IXUSR>>6)
16933 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16934 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16935 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16938 : see whether semctl IPC_STAT can use union semun
16939 case "$d_semctl_semun" in
16943 #include <sys/types.h>
16944 #include <sys/ipc.h>
16945 #include <sys/sem.h>
16946 #include <sys/stat.h>
16953 #$d_union_semun HAS_UNION_SEMUN
16956 #ifndef HAS_UNION_SEMUN
16959 struct semid_ds *buf;
16960 unsigned short *array;
16966 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16967 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16969 struct semid_ds argbuf;
16972 st = semctl(sem, 0, IPC_STAT, arg);
16976 # endif /* IPC_STAT */
16977 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16979 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16980 # endif /* IPC_RMID */
16981 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16983 #endif /* IPC_PRIVATE && ... */
16984 printf("semget failed: errno = %d\n", errno);
16989 if eval $compile; then
16992 semun) val="$define" ;;
17000 case "$d_semctl_semun" in
17002 echo "You can use union semun for semctl IPC_STAT." >&4
17005 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17010 : see whether semctl IPC_STAT can use struct semid_ds pointer
17011 case "$d_semctl_semid_ds" in
17014 $cat > try.c <<'END'
17015 #include <sys/types.h>
17016 #include <sys/ipc.h>
17017 #include <sys/sem.h>
17018 #include <sys/stat.h>
17026 struct semid_ds arg;
17029 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17030 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17033 st = semctl(sem, 0, IPC_STAT, &arg);
17035 printf("semid_ds\n");
17037 # endif /* IPC_STAT */
17038 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17040 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17041 # endif /* IPC_RMID */
17042 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17044 #endif /* IPC_PRIVATE && ... */
17045 printf("semget failed: errno = %d\n", errno);
17051 if eval $compile; then
17054 semid_ds) val="$define" ;;
17058 set d_semctl_semid_ds
17062 case "$d_semctl_semid_ds" in
17064 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17066 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17072 # We do not have the full sem*(2) library, so assume we can not
17078 set d_semctl_semid_ds
17084 : see if sendmsg exists
17085 set sendmsg d_sendmsg
17088 : see if setegid exists
17089 set setegid d_setegid
17092 : see if seteuid exists
17093 set seteuid d_seteuid
17096 : see if setgrent exists
17097 set setgrent d_setgrent
17100 : see if setgrent_r exists
17101 set setgrent_r d_setgrent_r
17103 case "$d_setgrent_r" in
17105 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17106 case "$d_setgrent_r_proto:$usethreads" in
17107 ":define") d_setgrent_r_proto=define
17108 set d_setgrent_r_proto setgrent_r $hdrs
17112 case "$d_setgrent_r_proto" in
17114 case "$setgrent_r_proto" in
17115 ''|0) try='int setgrent_r(FILE**);'
17116 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17118 case "$setgrent_r_proto" in
17119 ''|0) try='void setgrent_r(FILE**);'
17120 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17122 case "$setgrent_r_proto" in
17123 ''|0) d_setgrent_r=undef
17125 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17126 * ) case "$setgrent_r_proto" in
17127 REENTRANT_PROTO*) ;;
17128 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17130 echo "Prototype: $try" ;;
17133 *) case "$usethreads" in
17134 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17141 *) setgrent_r_proto=0
17145 : see if sethostent exists
17146 set sethostent d_sethent
17149 : see if sethostent_r exists
17150 set sethostent_r d_sethostent_r
17152 case "$d_sethostent_r" in
17154 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17155 case "$d_sethostent_r_proto:$usethreads" in
17156 ":define") d_sethostent_r_proto=define
17157 set d_sethostent_r_proto sethostent_r $hdrs
17161 case "$d_sethostent_r_proto" in
17163 case "$sethostent_r_proto" in
17164 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17165 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17167 case "$sethostent_r_proto" in
17168 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17169 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17171 case "$sethostent_r_proto" in
17172 ''|0) d_sethostent_r=undef
17173 sethostent_r_proto=0
17174 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17175 * ) case "$sethostent_r_proto" in
17176 REENTRANT_PROTO*) ;;
17177 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17179 echo "Prototype: $try" ;;
17182 *) case "$usethreads" in
17183 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17185 d_sethostent_r=undef
17186 sethostent_r_proto=0
17190 *) sethostent_r_proto=0
17194 : see if setitimer exists
17195 set setitimer d_setitimer
17198 : see if setlinebuf exists
17199 set setlinebuf d_setlinebuf
17202 : see if setlocale exists
17203 set setlocale d_setlocale
17206 : see if locale.h is available
17207 set locale.h i_locale
17210 : see if setlocale_r exists
17211 set setlocale_r d_setlocale_r
17213 case "$d_setlocale_r" in
17215 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17216 case "$d_setlocale_r_proto:$usethreads" in
17217 ":define") d_setlocale_r_proto=define
17218 set d_setlocale_r_proto setlocale_r $hdrs
17222 case "$d_setlocale_r_proto" in
17224 case "$setlocale_r_proto" in
17225 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17226 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17228 case "$setlocale_r_proto" in
17229 ''|0) d_setlocale_r=undef
17230 setlocale_r_proto=0
17231 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17232 * ) case "$setlocale_r_proto" in
17233 REENTRANT_PROTO*) ;;
17234 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17236 echo "Prototype: $try" ;;
17239 *) case "$usethreads" in
17240 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17242 d_setlocale_r=undef
17243 setlocale_r_proto=0
17247 *) setlocale_r_proto=0
17251 : see if setnetent exists
17252 set setnetent d_setnent
17255 : see if setnetent_r exists
17256 set setnetent_r d_setnetent_r
17258 case "$d_setnetent_r" in
17260 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17261 case "$d_setnetent_r_proto:$usethreads" in
17262 ":define") d_setnetent_r_proto=define
17263 set d_setnetent_r_proto setnetent_r $hdrs
17267 case "$d_setnetent_r_proto" in
17269 case "$setnetent_r_proto" in
17270 ''|0) try='int setnetent_r(int, struct netent_data*);'
17271 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17273 case "$setnetent_r_proto" in
17274 ''|0) try='void setnetent_r(int, struct netent_data*);'
17275 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17277 case "$setnetent_r_proto" in
17278 ''|0) d_setnetent_r=undef
17279 setnetent_r_proto=0
17280 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17281 * ) case "$setnetent_r_proto" in
17282 REENTRANT_PROTO*) ;;
17283 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17285 echo "Prototype: $try" ;;
17288 *) case "$usethreads" in
17289 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17291 d_setnetent_r=undef
17292 setnetent_r_proto=0
17296 *) setnetent_r_proto=0
17300 : see if setprotoent exists
17301 set setprotoent d_setpent
17304 : see if setpgid exists
17305 set setpgid d_setpgid
17308 : see if setpgrp2 exists
17309 set setpgrp2 d_setpgrp2
17312 : see if setpriority exists
17313 set setpriority d_setprior
17316 : see if setproctitle exists
17317 set setproctitle d_setproctitle
17320 : see if setprotoent_r exists
17321 set setprotoent_r d_setprotoent_r
17323 case "$d_setprotoent_r" in
17325 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17326 case "$d_setprotoent_r_proto:$usethreads" in
17327 ":define") d_setprotoent_r_proto=define
17328 set d_setprotoent_r_proto setprotoent_r $hdrs
17332 case "$d_setprotoent_r_proto" in
17334 case "$setprotoent_r_proto" in
17335 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17336 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17338 case "$setprotoent_r_proto" in
17339 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17340 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17342 case "$setprotoent_r_proto" in
17343 ''|0) d_setprotoent_r=undef
17344 setprotoent_r_proto=0
17345 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17346 * ) case "$setprotoent_r_proto" in
17347 REENTRANT_PROTO*) ;;
17348 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17350 echo "Prototype: $try" ;;
17353 *) case "$usethreads" in
17354 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17356 d_setprotoent_r=undef
17357 setprotoent_r_proto=0
17361 *) setprotoent_r_proto=0
17365 : see if setpwent exists
17366 set setpwent d_setpwent
17369 : see if setpwent_r exists
17370 set setpwent_r d_setpwent_r
17372 case "$d_setpwent_r" in
17374 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17375 case "$d_setpwent_r_proto:$usethreads" in
17376 ":define") d_setpwent_r_proto=define
17377 set d_setpwent_r_proto setpwent_r $hdrs
17381 case "$d_setpwent_r_proto" in
17383 case "$setpwent_r_proto" in
17384 ''|0) try='int setpwent_r(FILE**);'
17385 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17387 case "$setpwent_r_proto" in
17388 ''|0) try='void setpwent_r(FILE**);'
17389 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17391 case "$setpwent_r_proto" in
17392 ''|0) d_setpwent_r=undef
17394 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17395 * ) case "$setpwent_r_proto" in
17396 REENTRANT_PROTO*) ;;
17397 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17399 echo "Prototype: $try" ;;
17402 *) case "$usethreads" in
17403 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17410 *) setpwent_r_proto=0
17414 : see if setregid exists
17415 set setregid d_setregid
17417 set setresgid d_setresgid
17420 : see if setreuid exists
17421 set setreuid d_setreuid
17423 set setresuid d_setresuid
17426 : see if setrgid exists
17427 set setrgid d_setrgid
17430 : see if setruid exists
17431 set setruid d_setruid
17434 : see if setservent exists
17435 set setservent d_setsent
17438 : see if setservent_r exists
17439 set setservent_r d_setservent_r
17441 case "$d_setservent_r" in
17443 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17444 case "$d_setservent_r_proto:$usethreads" in
17445 ":define") d_setservent_r_proto=define
17446 set d_setservent_r_proto setservent_r $hdrs
17450 case "$d_setservent_r_proto" in
17452 case "$setservent_r_proto" in
17453 ''|0) try='int setservent_r(int, struct servent_data*);'
17454 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17456 case "$setservent_r_proto" in
17457 ''|0) try='void setservent_r(int, struct servent_data*);'
17458 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17460 case "$setservent_r_proto" in
17461 ''|0) d_setservent_r=undef
17462 setservent_r_proto=0
17463 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17464 * ) case "$setservent_r_proto" in
17465 REENTRANT_PROTO*) ;;
17466 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17468 echo "Prototype: $try" ;;
17471 *) case "$usethreads" in
17472 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17474 d_setservent_r=undef
17475 setservent_r_proto=0
17479 *) setservent_r_proto=0
17483 : see if setsid exists
17484 set setsid d_setsid
17487 : see if setvbuf exists
17488 set setvbuf d_setvbuf
17491 : see if sfio.h is available
17495 : see if sfio library is available
17506 : Ok, but do we want to use it.
17510 true|$define|[yY]*) dflt='y';;
17513 echo "$package can use the sfio library, but it is experimental."
17514 rp="You seem to have sfio available, do you want to try using it?"
17517 y|Y) echo "Ok, turning on sfio then."
17520 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17525 *) case "$usesfio" in
17526 true|$define|[yY]*)
17527 echo "Sorry, cannot find sfio on this machine." >&4
17528 echo "Ignoring your setting of usesfio=$usesfio." >&4
17537 $define) usesfio='true';;
17538 *) usesfio='false';;
17542 *) : Remove sfio from list of libraries to use
17545 echo "Removing unneeded -lsfio from library list" >&4
17546 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17549 echo "libs = $libs" >&4
17556 : see if shmctl exists
17557 set shmctl d_shmctl
17560 : see if shmget exists
17561 set shmget d_shmget
17564 : see if shmat exists
17567 : see what shmat returns
17570 $cat >shmat.c <<'END'
17571 #include <sys/shm.h>
17574 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17579 echo "and it returns ($shmattype)." >&4
17580 : see if a prototype for shmat is available
17581 xxx=`./findhdr sys/shm.h`
17582 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17583 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17594 set d_shmatprototype
17597 : see if shmdt exists
17601 : see how much of the 'shm*(2)' library is present.
17604 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17605 *"$undef"*) h_shm=false;;
17609 case "`ipcs 2>&1`" in
17610 "SVID shared memory"*"not configured"*)
17611 echo "Your $osname does not have the shm*(2) configured." >&4
17614 set shmctl d_shmctl
17616 set shmget d_shmget
17626 : we could also check for sys/ipc.h ...
17627 if $h_shm && $test `./findhdr sys/shm.h`; then
17628 echo "You have the full shm*(2) library." >&4
17631 echo "You don't have the full shm*(2) library." >&4
17637 : see if we have sigaction
17639 if set sigaction val -f d_sigaction; eval $csym; $val; then
17640 echo 'sigaction() found.' >&4
17643 #include <sys/types.h>
17644 #include <signal.h>
17645 #$i_stdlib I_STDLIB
17647 #include <stdlib.h>
17651 struct sigaction act, oact;
17653 oact.sa_handler = 0;
17654 /* so that act and oact are used */
17655 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17659 if eval $compile_ok; then
17662 echo "But you don't seem to have a usable struct sigaction." >&4
17666 echo 'sigaction NOT found.' >&4
17669 set d_sigaction; eval $setvar
17672 : see if this is a sunmath.h system
17673 set sunmath.h i_sunmath
17676 : see if signbit exists
17677 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17680 #$i_sunmath I_SUNMATH
17684 #ifdef I_SUNMATH /* Solaris special math library */
17685 # include <sunmath.h>
17688 int main(int argc, char **argv)
17692 if ((signbit(x) == 0) && (signbit(y) != 0))
17700 if eval $compile; then
17701 if $run ./try; then
17705 $echo "Signbit seems to be available, but doesn't work as I expected."
17706 $echo "I won't use it." >&4
17717 : see if sigprocmask exists
17718 set sigprocmask d_sigprocmask
17721 : see if sigsetjmp exists
17723 case "$d_sigsetjmp" in
17726 #include <setjmp.h>
17727 #$i_stdlib I_STDLIB
17729 #include <stdlib.h>
17735 if (sigsetjmp(env,1))
17738 siglongjmp(env, 1);
17743 if eval $compile; then
17744 if $run ./try >/dev/null 2>&1; then
17745 echo "POSIX sigsetjmp found." >&4
17749 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17755 echo "sigsetjmp not found." >&4
17759 *) val="$d_sigsetjmp"
17760 case "$d_sigsetjmp" in
17761 $define) echo "POSIX sigsetjmp found." >&4;;
17762 $undef) echo "sigsetjmp not found." >&4;;
17770 : see if snprintf exists
17771 set snprintf d_snprintf
17774 : see if vsnprintf exists
17775 set vsnprintf d_vsnprintf
17778 case "$d_snprintf-$d_vsnprintf" in
17781 Checking whether your snprintf() and vsnprintf() work okay...
17783 $cat >try.c <<'EOCP'
17784 /* v?snprintf testing logic courtesy of Russ Allbery.
17785 * According to C99:
17786 * - if the buffer is too short it still must be \0-terminated
17787 * - if the buffer is too short the potentially required length
17788 * must be returned and not -1
17789 * - if the buffer is NULL the potentially required length
17790 * must be returned and not -1 or core dump
17793 #include <stdarg.h>
17797 int test (char *format, ...)
17802 va_start (args, format);
17803 count = vsnprintf (buf, sizeof buf, format, args);
17810 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17811 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17815 if eval $compile; then
17818 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17820 Your snprintf() and snprintf() don't seem to be working okay.
17822 d_snprintf="$undef"
17823 d_vsnprintf="$undef"
17827 echo "(I can't seem to compile the test program--assuming they don't)"
17828 d_snprintf="$undef"
17829 d_vsnprintf="$undef"
17835 : see if sockatmark exists
17836 set sockatmark d_sockatmark
17839 : see if prototype for sockatmark is available
17841 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17844 : see if socks5_init exists
17845 set socks5_init d_socks5_init
17848 : see if sprintf returns the length of the string in the buffer as per ANSI
17849 $echo "Checking whether sprintf returns the length of the string..." >&4
17852 #$i_stdlib I_STDLIB
17854 #include <stdlib.h>
17856 #$i_string I_STRING
17858 # include <string.h>
17860 # include <strings.h>
17869 int check (size_t expect, int test) {
17870 size_t got = strlen(buffer);
17874 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17879 int main(int argc, char **argv) {
17882 check(sprintf(buffer, ""), ++test);
17883 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17884 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17891 if eval $compile; then
17895 sprintf returns the length of the string (as ANSI says it should)
17897 d_sprintf_returns_strlen="$define"
17900 sprintf does not return the length of the string (how old is this system?)
17902 d_sprintf_returns_strlen="$undef"
17906 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17907 d_sprintf_returns_strlen="$undef"
17911 : see if srand48_r exists
17912 set srand48_r d_srand48_r
17914 case "$d_srand48_r" in
17916 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17917 case "$d_srand48_r_proto:$usethreads" in
17918 ":define") d_srand48_r_proto=define
17919 set d_srand48_r_proto srand48_r $hdrs
17923 case "$d_srand48_r_proto" in
17925 case "$srand48_r_proto" in
17926 ''|0) try='int srand48_r(long, struct drand48_data*);'
17927 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17929 case "$srand48_r_proto" in
17930 ''|0) d_srand48_r=undef
17932 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17933 * ) case "$srand48_r_proto" in
17934 REENTRANT_PROTO*) ;;
17935 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17937 echo "Prototype: $try" ;;
17940 *) case "$usethreads" in
17941 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17948 *) srand48_r_proto=0
17952 : see if srandom_r exists
17953 set srandom_r d_srandom_r
17955 case "$d_srandom_r" in
17957 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17958 case "$d_srandom_r_proto:$usethreads" in
17959 ":define") d_srandom_r_proto=define
17960 set d_srandom_r_proto srandom_r $hdrs
17964 case "$d_srandom_r_proto" in
17966 case "$srandom_r_proto" in
17967 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17968 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17970 case "$srandom_r_proto" in
17971 ''|0) d_srandom_r=undef
17973 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17974 * ) case "$srandom_r_proto" in
17975 REENTRANT_PROTO*) ;;
17976 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17978 echo "Prototype: $try" ;;
17981 *) case "$usethreads" in
17982 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17989 *) srandom_r_proto=0
17993 : see if prototype for setresgid is available
17995 set d_sresgproto setresgid $i_unistd unistd.h
17998 : see if prototype for setresuid is available
18000 set d_sresuproto setresuid $i_unistd unistd.h
18003 : see if sys/stat.h is available
18004 set sys/stat.h i_sysstat
18007 : see if stat knows about block sizes
18009 echo "Checking to see if your struct stat has st_blocks field..." >&4
18010 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18013 : see if this is a sys/vfs.h system
18014 set sys/vfs.h i_sysvfs
18017 : see if this is a sys/statfs.h system
18018 set sys/statfs.h i_sysstatfs
18021 : Check for statfs_s
18023 echo "Checking to see if your system supports struct statfs..." >&4
18024 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
18026 case "$d_statfs_s" in
18027 "$define") echo "Yes, it does." ;;
18028 *) echo "No, it doesn't." ;;
18032 : see if struct statfs knows about f_flags
18033 case "$d_statfs_s" in
18036 echo "Checking to see if your struct statfs has f_flags field..." >&4
18037 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
18041 set d_statfs_f_flags
18045 case "$d_statfs_f_flags" in
18046 "$define") echo "Yes, it does." ;;
18047 *) echo "No, it doesn't." ;;
18050 : see what flavor, if any, of static inline is supported
18052 echo "Checking to see if your system supports static inline..."
18053 $cat > try.c <<'EOCP'
18054 #include <stdlib.h>
18055 extern int f_via_a(int x);
18056 extern int f_via_b(int x);
18057 int main(int argc, char **argv)
18066 return EXIT_SUCCESS;
18069 return EXIT_FAILURE;
18073 $cat > a.c <<'EOCP'
18074 static INLINE int f(int x) {
18085 $cat > b.c <<'EOCP'
18086 extern int f(int x);
18094 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18095 case "$perl_static_inline" in
18096 '') # Check the various possibilities, and break out on success.
18097 # For gcc, prefer __inline__, which will still permit
18098 # cflags.SH to add in -ansi.
18099 case "$gccversion" in
18100 '') xxx="inline __inline__ __inline _inline";;
18101 *) xxx="__inline__ inline __inline _inline";;
18103 for inline in $xxx; do
18104 set try -DINLINE=$inline a.c
18105 if eval $compile && $run ./try; then
18106 # Now make sure there is no external linkage of static
18108 set try -DINLINE=$inline -DUSE_B a.c b.c
18109 if eval $compile && $run ./try; then
18110 $echo "Your compiler supports static $inline, " >&4
18111 $echo "but it also creates an external definition," >&4
18112 $echo "so I won't use it." >&4
18115 $echo "Your compiler supports static $inline." >&4
18117 perl_static_inline="static $inline";
18121 $echo "Your compiler does NOT support static $inline." >&4
18126 *inline*) # Some variant of inline exists.
18127 echo "Keeping your $hint value of $perl_static_inline."
18130 static) # No inline capabilities
18131 echo "Keeping your $hint value of $perl_static_inline."
18134 *) # Unrecognized previous value -- blindly trust the supplied
18135 # value and hope it makes sense. Use old value for
18136 # d_static_inline, if there is one.
18137 echo "Keeping your $hint value of $perl_static_inline."
18138 case "$d_static_inline" in
18140 *) val=$d_static_inline ;;
18144 # Fallback to plain 'static' if nothing worked.
18145 case "$perl_static_inline" in
18147 perl_static_inline="static"
18151 set d_static_inline
18153 $rm -f a.[co] b.[co]
18156 : Check stream access
18158 Checking how to access stdio streams by file descriptor number...
18160 case "$stdio_stream_array" in
18161 '') $cat >try.c <<EOCP
18164 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18168 for s in _iob __iob __sF
18170 set try -DSTDIO_STREAM_ARRAY=$s
18171 if eval $compile; then
18172 case "`$run ./try`" in
18173 yes) stdio_stream_array=$s; break ;;
18179 case "$stdio_stream_array" in
18181 I can't figure out how to access stdio streams by file descriptor number.
18183 d_stdio_stream_array="$undef"
18186 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18188 d_stdio_stream_array="$define"
18192 : see if strcoll exists
18193 set strcoll d_strcoll
18196 : check for structure copying
18198 echo "Checking to see if your C compiler can copy structs..." >&4
18199 $cat >try.c <<'EOCP'
18209 if $cc -c try.c >/dev/null 2>&1 ; then
18211 echo "Yup, it can."
18214 echo "Nope, it can't."
18220 : see if strerror and/or sys_errlist[] exist
18222 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18223 if set strerror val -f d_strerror; eval $csym; $val; then
18224 echo 'strerror() found.' >&4
18225 d_strerror="$define"
18226 d_strerrm='strerror(e)'
18227 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18228 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18229 d_syserrlst="$define"
18231 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18232 d_syserrlst="$undef"
18234 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18235 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18236 echo 'strerror() found in string header.' >&4
18237 d_strerror="$define"
18238 d_strerrm='strerror(e)'
18239 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18240 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18241 d_syserrlst="$define"
18243 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18244 d_syserrlst="$undef"
18246 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18247 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18248 d_strerror="$undef"
18249 d_syserrlst="$define"
18250 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18252 echo 'strerror() and sys_errlist[] NOT found.' >&4
18253 d_strerror="$undef"
18254 d_syserrlst="$undef"
18255 d_strerrm='"unknown"'
18259 : see if strerror_r exists
18260 set strerror_r d_strerror_r
18262 case "$d_strerror_r" in
18264 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18265 case "$d_strerror_r_proto:$usethreads" in
18266 ":define") d_strerror_r_proto=define
18267 set d_strerror_r_proto strerror_r $hdrs
18271 case "$d_strerror_r_proto" in
18273 case "$strerror_r_proto" in
18274 ''|0) try='int strerror_r(int, char*, size_t);'
18275 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18277 case "$strerror_r_proto" in
18278 ''|0) try='int strerror_r(int, char*, int);'
18279 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18281 case "$strerror_r_proto" in
18282 ''|0) try='char* strerror_r(int, char*, size_t);'
18283 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18285 case "$strerror_r_proto" in
18286 ''|0) d_strerror_r=undef
18288 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18289 * ) case "$strerror_r_proto" in
18290 REENTRANT_PROTO*) ;;
18291 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18293 echo "Prototype: $try" ;;
18296 *) case "$usethreads" in
18297 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18304 *) strerror_r_proto=0
18308 : see if strftime exists
18309 set strftime d_strftime
18312 : see if strlcat exists
18313 set strlcat d_strlcat
18316 : see if strlcpy exists
18317 set strlcpy d_strlcpy
18320 : see if strtod exists
18321 set strtod d_strtod
18324 : see if strtol exists
18325 set strtol d_strtol
18328 : see if strtold exists
18329 set strtold d_strtold
18332 : see if strtoll exists
18333 set strtoll d_strtoll
18336 case "$d_longlong-$d_strtoll" in
18339 Checking whether your strtoll() works okay...
18341 $cat >try.c <<'EOCP'
18344 #define strtoll __strtoll
18347 #define strtoll _strtoll
18350 extern long long int strtoll(char *s, char **, int);
18351 static int bad = 0;
18352 int check(char *s, long long ell, int een) {
18355 gll = strtoll(s, 0, 10);
18356 if (!((gll == ell) && (errno == een)))
18360 check(" 1", 1LL, 0);
18361 check(" 0", 0LL, 0);
18362 check("-1", -1LL, 0);
18363 check("-9223372036854775808", -9223372036854775808LL, 0);
18364 check("-9223372036854775808", -9223372036854775808LL, 0);
18365 check(" 9223372036854775807", 9223372036854775807LL, 0);
18366 check("-9223372036854775808", -9223372036854775808LL, 0);
18367 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18368 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18374 if eval $compile; then
18377 ok) echo "Your strtoll() seems to be working okay." ;;
18379 Your strtoll() doesn't seem to be working okay.
18385 echo "(I can't seem to compile the test program--assuming it doesn't)"
18391 : see if strtoq exists
18392 set strtoq d_strtoq
18395 : see if strtoul exists
18396 set strtoul d_strtoul
18399 case "$d_strtoul" in
18402 Checking whether your strtoul() works okay...
18404 $cat >try.c <<'EOCP'
18407 extern unsigned long int strtoul(char *s, char **, int);
18408 static int bad = 0;
18409 void check(char *s, unsigned long eul, int een) {
18412 gul = strtoul(s, 0, 10);
18413 if (!((gul == eul) && (errno == een)))
18417 check(" 1", 1L, 0);
18418 check(" 0", 0L, 0);
18420 case "$longsize" in
18422 $cat >>try.c <<'EOCP'
18423 check("18446744073709551615", 18446744073709551615UL, 0);
18424 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18425 #if 0 /* strtoul() for /^-/ strings is undefined. */
18426 check("-1", 18446744073709551615UL, 0);
18427 check("-18446744073709551614", 2, 0);
18428 check("-18446744073709551615", 1, 0);
18429 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18430 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18435 $cat >>try.c <<'EOCP'
18436 check("4294967295", 4294967295UL, 0);
18437 check("4294967296", 4294967295UL, ERANGE);
18438 #if 0 /* strtoul() for /^-/ strings is undefined. */
18439 check("-1", 4294967295UL, 0);
18440 check("-4294967294", 2, 0);
18441 check("-4294967295", 1, 0);
18442 check("-4294967296", 4294967295UL, ERANGE);
18443 check("-4294967297", 4294967295UL, ERANGE);
18448 : Should we write these tests to be more portable by sprintf-ing
18449 : ~0 and then manipulating that char string as input for strtol?
18452 $cat >>try.c <<'EOCP'
18459 if eval $compile; then
18460 case "`$run ./try`" in
18461 ok) echo "Your strtoul() seems to be working okay." ;;
18463 Your strtoul() doesn't seem to be working okay.
18469 echo "(I can't seem to compile the test program--assuming it doesn't)"
18475 : see if strtoull exists
18476 set strtoull d_strtoull
18479 case "$d_longlong-$d_strtoull" in
18482 Checking whether your strtoull() works okay...
18484 $cat >try.c <<'EOCP'
18487 #define strtoull __strtoull
18490 extern unsigned long long int strtoull(char *s, char **, int);
18491 static int bad = 0;
18492 int check(char *s, long long eull, int een) {
18495 gull = strtoull(s, 0, 10);
18496 if (!((gull == eull) && (errno == een)))
18500 check(" 1", 1LL, 0);
18501 check(" 0", 0LL, 0);
18502 check("18446744073709551615", 18446744073709551615ULL, 0);
18503 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18504 #if 0 /* strtoull() for /^-/ strings is undefined. */
18505 check("-1", 18446744073709551615ULL, 0);
18506 check("-18446744073709551614", 2LL, 0);
18507 check("-18446744073709551615", 1LL, 0);
18508 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18509 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18516 if eval $compile; then
18517 case "`$run ./try`" in
18518 ok) echo "Your strtoull() seems to be working okay." ;;
18520 Your strtoull() doesn't seem to be working okay.
18522 d_strtoull="$undef"
18526 echo "(I can't seem to compile the test program--assuming it doesn't)"
18527 d_strtoull="$undef"
18532 : see if strtouq exists
18533 set strtouq d_strtouq
18536 case "$d_strtouq" in
18539 Checking whether your strtouq() works okay...
18541 $cat >try.c <<'EOCP'
18544 extern unsigned long long int strtouq(char *s, char **, int);
18545 static int bad = 0;
18546 void check(char *s, unsigned long long eull, int een) {
18547 unsigned long long gull;
18549 gull = strtouq(s, 0, 10);
18550 if (!((gull == eull) && (errno == een)))
18554 check(" 1", 1LL, 0);
18555 check(" 0", 0LL, 0);
18556 check("18446744073709551615", 18446744073709551615ULL, 0);
18557 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18558 #if 0 /* strtouq() for /^-/ strings is undefined. */
18559 check("-1", 18446744073709551615ULL, 0);
18560 check("-18446744073709551614", 2LL, 0);
18561 check("-18446744073709551615", 1LL, 0);
18562 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18563 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18571 if eval $compile; then
18572 case "`$run ./try`" in
18573 ok) echo "Your strtouq() seems to be working okay." ;;
18575 Your strtouq() doesn't seem to be working okay.
18581 echo "(I can't seem to compile the test program--assuming it doesn't)"
18587 : see if strxfrm exists
18588 set strxfrm d_strxfrm
18591 : see if symlink exists
18592 set symlink d_symlink
18595 : see if syscall exists
18596 set syscall d_syscall
18599 : see if prototype for syscall is available
18601 set d_syscallproto syscall $i_unistd unistd.h
18604 : see if sysconf exists
18605 set sysconf d_sysconf
18608 : see if system exists
18609 set system d_system
18612 : see if tcgetpgrp exists
18613 set tcgetpgrp d_tcgetpgrp
18616 : see if tcsetpgrp exists
18617 set tcsetpgrp d_tcsetpgrp
18620 : see if prototype for telldir is available
18622 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18625 : see if time exists
18627 if test "X$d_time" = X -o X"$timetype" = X; then
18628 if set time val -f d_time; eval $csym; $val; then
18629 echo 'time() found.' >&4
18631 rp="What is the type returned by time() on this system?"
18632 set time_t timetype long stdio.h sys/types.h
18635 echo 'time() not found, hope that will do.' >&4
18643 : see if timegm exists
18644 set timegm d_timegm
18647 : see if this is a sys/times.h system
18648 set sys/times.h i_systimes
18651 : see if times exists
18653 if set times val -f d_times; eval $csym; $val; then
18654 echo 'times() found.' >&4
18657 case "$i_systimes" in
18658 "$define") inc='sys/times.h';;
18660 rp="What is the type returned by times() on this system?"
18661 set clock_t clocktype long stdio.h sys/types.h $inc
18664 echo 'times() NOT found, hope that will do.' >&4
18669 : see if tmpnam_r exists
18670 set tmpnam_r d_tmpnam_r
18672 case "$d_tmpnam_r" in
18674 hdrs="$i_systypes sys/types.h define stdio.h "
18675 case "$d_tmpnam_r_proto:$usethreads" in
18676 ":define") d_tmpnam_r_proto=define
18677 set d_tmpnam_r_proto tmpnam_r $hdrs
18681 case "$d_tmpnam_r_proto" in
18683 case "$tmpnam_r_proto" in
18684 ''|0) try='char* tmpnam_r(char*);'
18685 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18687 case "$tmpnam_r_proto" in
18688 ''|0) d_tmpnam_r=undef
18690 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18691 * ) case "$tmpnam_r_proto" in
18692 REENTRANT_PROTO*) ;;
18693 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18695 echo "Prototype: $try" ;;
18698 *) case "$usethreads" in
18699 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18706 *) tmpnam_r_proto=0
18710 : see if truncate exists
18711 set truncate d_truncate
18714 : see if ttyname_r exists
18715 set ttyname_r d_ttyname_r
18717 case "$d_ttyname_r" in
18719 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18720 case "$d_ttyname_r_proto:$usethreads" in
18721 ":define") d_ttyname_r_proto=define
18722 set d_ttyname_r_proto ttyname_r $hdrs
18726 case "$d_ttyname_r_proto" in
18728 case "$ttyname_r_proto" in
18729 ''|0) try='int ttyname_r(int, char*, size_t);'
18730 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18732 case "$ttyname_r_proto" in
18733 ''|0) try='int ttyname_r(int, char*, int);'
18734 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18736 case "$ttyname_r_proto" in
18737 ''|0) try='char* ttyname_r(int, char*, int);'
18738 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18740 case "$ttyname_r_proto" in
18741 ''|0) d_ttyname_r=undef
18743 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18744 * ) case "$ttyname_r_proto" in
18745 REENTRANT_PROTO*) ;;
18746 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18748 echo "Prototype: $try" ;;
18751 *) case "$usethreads" in
18752 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18759 *) ttyname_r_proto=0
18763 : see if tzname[] exists
18765 if set tzname val -a d_tzname; eval $csym; $val; then
18767 echo 'tzname[] found.' >&4
18770 echo 'tzname[] NOT found.' >&4
18775 : Check if is a multiplatform env
18777 next|darwin) multiarch="$define" ;;
18779 case "$multiarch" in
18780 ''|[nN]*) multiarch="$undef" ;;
18783 : check for ordering of bytes in a UV
18785 case "$usecrosscompile$multiarch" in
18788 You seem to be either cross-compiling or doing a multiarchitecture build,
18789 skipping the byteorder check.
18795 case "$byteorder" in
18798 In the following, larger digits indicate more significance. A big-endian
18799 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18800 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18801 machines may have weird orders like 3412. A Cray will report 87654321,
18802 an Alpha will report 12345678. If the test program works the default is
18804 I'm now running the test program...
18808 #$i_stdlib I_STDLIB
18810 #include <stdlib.h>
18812 #include <sys/types.h>
18813 typedef $uvtype UV;
18823 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18825 u.l = (UV)0x04030201;
18826 for (i = 0; i < $uvsize; i++)
18827 printf("%c", u.c[i]+'0');
18834 if eval $compile && $run ./try > /dev/null; then
18837 [1-4][1-4][1-4][1-4]|12345678|87654321)
18838 echo "(The test program ran ok.)"
18839 echo "byteorder=$dflt"
18842 ????|????????) echo "(The test program ran ok.)" ;;
18843 *) echo "(The test program didn't run right for some reason.)" ;;
18848 (I can't seem to compile the test program. Guessing big-endian...)
18851 case "$xxx_prompt" in
18853 rp="What is the order of bytes in $uvtype?"
18866 : Checking 32bit alignedness
18869 Checking to see whether you can access character data unalignedly...
18871 case "$d_u32align" in
18872 '') $cat >try.c <<EOCP
18874 #$i_stdlib I_STDLIB
18876 #include <stdlib.h>
18878 #define U32 $u32type
18879 #define BYTEORDER 0x$byteorder
18881 #include <signal.h>
18883 $signal_t bletch(int s) { exit(4); }
18886 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18887 volatile U8 buf[8];
18891 if (sizeof(U32) != 4) {
18892 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18899 signal(SIGBUS, bletch);
18911 for (i = 0; i < 4; i++) {
18912 up = (U32*)(buf + i);
18913 if (! ((*up == 1 << (8*i)) || /* big-endian */
18914 (*up == 1 << (8*(3-i))) /* little-endian */
18918 printf("read failed (%x)\n", *up);
18924 for (i = 0; i < 4; i++) {
18925 up = (U32*)(buf + i);
18927 if (*up != 0xBeef) {
18928 printf("write failed (%x)\n", *up);
18942 if eval $compile_ok; then
18943 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18944 $run ./try 2>&1 >/dev/null
18947 You can access character data pretty unalignedly.
18949 d_u32align="$undef"
18952 It seems that you must access character data in an aligned manner.
18954 d_u32align="$define"
18958 rp='Can you access character data at unaligned addresses?'
18962 [yY]*) d_u32align="$undef" ;;
18963 *) d_u32align="$define" ;;
18970 : see if ualarm exists
18971 set ualarm d_ualarm
18974 : see if umask exists
18978 : see if unordered exists
18979 set unordered d_unordered
18982 : see if unsetenv exists
18983 set unsetenv d_unsetenv
18986 : see if usleep exists
18987 set usleep d_usleep
18990 : see if prototype for usleep is available
18992 set d_usleepproto usleep $i_unistd unistd.h
18995 : see if ustat exists
18999 : see if closedir exists
19000 set closedir d_closedir
19003 case "$d_closedir" in
19006 echo "Checking whether closedir() returns a status..." >&4
19008 #$i_dirent I_DIRENT /**/
19009 #$i_sysdir I_SYS_DIR /**/
19010 #$i_sysndir I_SYS_NDIR /**/
19011 #$i_systypes I_SYS_TYPES /**/
19013 #if defined(I_SYS_TYPES)
19014 #include <sys/types.h>
19016 #if defined(I_DIRENT)
19017 #include <dirent.h>
19018 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19019 #include <sys/dir.h>
19023 #include <sys/ndir.h>
19027 #include <ndir.h> /* may be wrong in the future */
19029 #include <sys/dir.h>
19034 int main() { return closedir(opendir(".")); }
19037 if eval $compile_ok; then
19038 if $run ./try > /dev/null 2>&1 ; then
19039 echo "Yes, it does."
19042 echo "No, it doesn't."
19046 echo "(I can't seem to compile the test program--assuming it doesn't)"
19054 set d_void_closedir
19058 : see if there is a wait4
19062 : see if waitpid exists
19063 set waitpid d_waitpid
19066 : see if wcstombs exists
19067 set wcstombs d_wcstombs
19070 : see if wctomb exists
19071 set wctomb d_wctomb
19074 : see if writev exists
19075 set writev d_writev
19078 : preserve RCS keywords in files with variable substitution, grrr
19083 Revision='$Revision'
19085 : check for alignment requirements
19087 case "$usecrosscompile" in
19090 You seem to be cross-compiling. Skipping the memory alignment check.
19093 case "$alignbytes" in
19094 '') alignbytes=8 ;;
19098 case "$alignbytes" in
19099 '') echo "Checking alignment constraints..." >&4
19100 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19101 $cat >try.c <<'EOCP'
19102 typedef long double NV;
19105 $cat >try.c <<'EOCP'
19109 $cat >>try.c <<'EOCP'
19117 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19122 if eval $compile_ok; then
19126 echo "(I can't seem to compile the test program...)"
19128 case "$multiarch" in
19130 : The usual safe value is 8, but Darwin with -Duselongdouble
19131 : needs 16. Hence, we will take 8 as a minimum, but allow
19132 : Configure to pick a larger value if needed.
19133 if $test "$dflt" -lt 8; then
19135 echo "Setting alignment to 8 for multiarch support.">&4
19140 *) dflt="$alignbytes"
19143 rp="Doubles must be aligned on a how-many-byte boundary?"
19151 : set the base revision
19154 : Determine if this is an EBCDIC system
19156 echo "Determining whether or not we are on an EBCDIC system..." >&4
19157 $cat >try.c <<'EOM'
19160 if ('M'==0xd4) return 0;
19165 case "$BOOTSTRAP_CHARSET" in
19166 Y|y|define) bootstrap_charset=$define ;;
19167 *) bootstrap_charset=$undef ;;
19172 if eval $compile_ok; then
19173 if $run ./try; then
19174 echo "You seem to speak EBCDIC." >&4
19177 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19180 echo "I'm unable to compile the test program." >&4
19181 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19187 : length of character in bytes. Is always 1, otherwise it is not C
19188 : This used to be a test using sizeof
19191 : Check for the number of bits in a character
19192 case "$charbits" in
19193 '') echo "Checking how long a character is (in bits)..." >&4
19200 for (c = 1, n = 0; c; c <<= 1, n++) ;
19201 printf ("%d\n", n);
19206 if eval $compile_ok; then
19210 echo "(I can't seem to compile the test program. Guessing...)"
19217 rp="What is the length of a character (in bits)?"
19221 case "$charbits" in
19224 Your system has an unsigned character size of $charbits bits, which
19225 is rather unusual (normally it is 8 bits). Perl likely will not work
19226 correctly on your system, with subtle bugs in various places.
19228 rp='Do you really want to continue?'
19232 [yY]) echo >&4 "Okay, continuing." ;;
19237 : how do we concatenate cpp tokens here?
19239 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19240 $cat >cpp_stuff.c <<'EOCP'
19241 #define RCAT(a,b)a/**/b
19242 #define ACAT(a,b)a ## b
19246 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19247 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19248 echo "Oh! Smells like ANSI's been here." >&4
19249 echo "We can catify or stringify, separately or together!"
19251 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19252 echo "Ah, yes! The good old days!" >&4
19253 echo "However, in the good old days we don't know how to stringify and"
19254 echo "catify at the same time."
19258 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19259 You're going to have to edit the values of CAT[2-5] in config.h...
19261 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19265 : see if this is a db.h system
19271 : Check db version.
19273 echo "Checking Berkeley DB version ..." >&4
19279 #include <sys/types.h>
19281 #$i_stdlib I_STDLIB
19283 #include <stdlib.h>
19286 int main(int argc, char *argv[])
19288 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19289 int Major, Minor, Patch ;
19290 unsigned long Version ;
19291 (void)db_version(&Major, &Minor, &Patch) ;
19293 printf("%d %d %d %d %d %d\n",
19294 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19295 Major, Minor, Patch);
19298 printf("You have Berkeley DB Version 2 or greater.\n");
19300 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19301 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19302 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19303 Major, Minor, Patch) ;
19305 /* check that db.h & libdb are compatible */
19306 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19307 printf("db.h and libdb are incompatible.\n") ;
19311 printf("db.h and libdb are compatible.\n") ;
19313 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19314 + DB_VERSION_PATCH ;
19316 /* needs to be >= 2.3.4 */
19317 if (Version < 2003004) {
19318 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19319 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19325 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19330 printf("You have Berkeley DB Version 1.\n");
19331 exit(0); /* DB version < 2: the coast is clear. */
19333 exit(1); /* <db.h> not Berkeley DB? */
19339 if eval $compile_ok && $run ./try; then
19340 echo 'Looks OK.' >&4
19342 db_version_major=$1
19343 db_version_minor=$2
19344 db_version_patch=$3
19346 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19350 : Remove db from list of libraries to use
19351 echo "Removing unusable -ldb from library list" >&4
19352 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19355 echo "libs = $libs" >&4
19365 : Check the return type needed for hash
19367 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19373 #include <sys/types.h>
19376 #ifndef DB_VERSION_MAJOR
19377 u_int32_t hash_cb (ptr, size)
19385 info.hash = hash_cb;
19389 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19390 if $contains warning try.out >>/dev/null 2>&1 ; then
19393 db_hashtype='u_int32_t'
19396 : XXX Maybe we should just give up here.
19397 db_hashtype=u_int32_t
19399 echo "Help: I can't seem to compile the db test program." >&4
19400 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19403 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19405 *) db_hashtype=u_int32_t
19410 : Check the return type needed for prefix
19412 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19418 #include <sys/types.h>
19421 #ifndef DB_VERSION_MAJOR
19422 size_t prefix_cb (key1, key2)
19430 info.prefix = prefix_cb;
19434 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19435 if $contains warning try.out >>/dev/null 2>&1 ; then
19436 db_prefixtype='int'
19438 db_prefixtype='size_t'
19441 db_prefixtype='size_t'
19442 : XXX Maybe we should just give up here.
19444 echo "Help: I can't seem to compile the db test program." >&4
19445 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19448 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19450 *) db_prefixtype='size_t'
19454 : How can we generate normalized random numbers ?
19456 echo "Looking for a random number function..." >&4
19457 case "$randfunc" in
19459 if set drand48 val -f; eval $csym; $val; then
19461 echo "Good, found drand48()." >&4
19462 elif set random val -f; eval $csym; $val; then
19464 echo "OK, found random()." >&4
19467 echo "Yuck, looks like I have to use rand()." >&4
19478 *-Dmy_rand=*|*-Dmy_srand=*)
19479 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19480 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19481 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19482 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19486 while $test "$cont"; do
19487 rp="Use which function to generate random numbers?"
19489 if $test "$ans" = "$dflt"; then
19495 if set $ans val -f; eval $csym; $val; then
19499 rp="I cannot find function $ans. Use that name anyway?"
19508 case "$randfunc" in
19510 drand01="drand48()"
19516 case "$randbits" in
19518 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19520 #$i_unistd I_UNISTD
19521 #$i_stdlib I_STDLIB
19524 # include <unistd.h>
19527 # include <stdlib.h>
19533 unsigned long max = 0L;
19535 for (i = 1000; i; i--) {
19536 tmp = (unsigned long) $randfunc();
19537 if (tmp > max) max = tmp;
19539 for (i = 0; max; i++)
19545 if eval $compile_ok; then
19549 echo "(I can't seem to compile the test program...)"
19556 rp="How many bits does your $randfunc() function produce?"
19560 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19561 seedfunc="s$randfunc"
19562 randseedtype=unsigned
19566 rp="How many bits does your $randfunc() function produce?"
19569 seedfunc="s$randfunc"
19570 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19571 if set $seedfunc val -f; eval $csym; $val; then
19572 echo "(Using $seedfunc() to seed random generator)"
19574 echo "(Warning: no $seedfunc() to seed random generator)"
19577 randseedtype=unsigned
19584 : Check how to flush
19587 Checking how to flush all pending stdio output...
19589 # I only know how to find the first 32 possibly open files on SunOS.
19590 # See also hints/sunos_4_1.sh and util.c --AD
19592 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19594 $cat >>try.c <<EOCP
19596 #$i_stdlib I_STDLIB
19598 #include <stdlib.h>
19600 #$i_unistd I_UNISTD
19602 # include <unistd.h>
19604 #$d_sysconf HAS_SYSCONF
19605 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19606 #ifdef HAS_STDIO_STREAM_ARRAY
19607 # define STDIO_STREAM_ARRAY $stdio_stream_array
19612 p = fopen("try.out", "w");
19616 # ifdef TRY_FPRINTF
19620 #ifdef TRY_FFLUSH_NULL
19623 #ifdef TRY_FFLUSH_ALL
19625 long open_max = -1;
19626 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19627 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19629 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19630 open_max = sysconf(_SC_OPEN_MAX);
19633 open_max = FOPEN_MAX;
19636 open_max = OPEN_MAX;
19645 # ifdef HAS_STDIO_STREAM_ARRAY
19646 if (open_max > 0) {
19648 for (i = 0; i < open_max; i++)
19649 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19650 STDIO_STREAM_ARRAY[i]._file < open_max &&
19651 STDIO_STREAM_ARRAY[i]._flag)
19652 fflush(&STDIO_STREAM_ARRAY[i]);
19660 : first we have to find out how _not_ to flush
19662 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19664 set try -DTRY_FPUTC
19665 if eval $compile; then
19666 $run ./try 2>/dev/null
19669 if $test ! -s try.out -a "X$code" = X42; then
19675 set try -DTRY_FPRINTF
19676 if eval $compile; then
19677 $run ./try 2>/dev/null
19680 if $test ! -s try.out -a "X$code" = X42; then
19681 output=-DTRY_FPRINTF
19687 : check for fflush NULL behavior
19688 case "$fflushNULL" in
19689 '') set try -DTRY_FFLUSH_NULL $output
19690 if eval $compile; then
19691 $run ./try 2>/dev/null
19694 if $test -s try.out -a "X$code" = X42; then
19695 fflushNULL="`$cat try.out`"
19697 if $test "X$code" != X42; then
19699 (If this test failed, don't worry, we'll try another method shortly.)
19704 $rm -f core try.core core.try.*
19705 case "$fflushNULL" in
19707 Your fflush(NULL) works okay for output streams.
19708 Let's see if it clobbers input pipes...
19710 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19711 # bug that improperly flushes the input end of pipes. So we avoid the
19712 # autoflush on fork/system/exec support for now. :-(
19713 $cat >tryp.c <<EOCP
19716 main(int argc, char **argv)
19722 while ((i = getc(stdin)) != -1
19723 && (*bp++ = i) != '\n'
19724 && bp < &buf[1024])
19727 fprintf(stdout, "%s", buf);
19735 fflushNULL="$define"
19737 if eval $compile; then
19739 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19740 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19742 fflush(NULL) seems to behave okay with input streams.
19744 fflushNULL="$define"
19747 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19749 fflushNULL="$undef"
19752 $rm -f core tryp.c tryp.core core.tryp.*
19755 Your fflush(NULL) isn't working (contrary to ANSI C).
19757 fflushNULL="$undef"
19760 Cannot figure out whether your fflush(NULL) works or not.
19761 I'm assuming it doesn't (contrary to ANSI C).
19763 fflushNULL="$undef"
19767 $define|true|[yY]*)
19768 fflushNULL="$define"
19771 fflushNULL="$undef"
19774 : check explicit looping only if NULL did not work, and if the pipe
19775 : bug does not show up on an explicit flush too
19776 case "$fflushNULL" in
19778 $cat >tryp.c <<EOCP
19781 main(int argc, char **argv)
19787 while ((i = getc(stdin)) != -1
19788 && (*bp++ = i) != '\n'
19789 && bp < &buf[1024])
19792 fprintf(stdout, "%s", buf);
19801 if eval $compile; then
19803 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19804 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19806 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19808 : now check for fflushall behaviour
19809 case "$fflushall" in
19810 '') set try -DTRY_FFLUSH_ALL $output
19811 if eval $compile; then
19813 (Now testing the other method--but note that this also may fail.)
19815 $run ./try 2>/dev/null
19818 if $test -s try.out -a "X$code" = X42; then
19819 fflushall="`$cat try.out`"
19823 case "$fflushall" in
19825 Whew. Flushing explicitly all the stdio streams works.
19827 fflushall="$define"
19830 Sigh. Flushing explicitly all the stdio streams doesn't work.
19835 Cannot figure out whether flushing stdio streams explicitly works or not.
19836 I'm assuming it doesn't.
19842 "$define"|true|[yY]*)
19843 fflushall="$define"
19851 All is futile. Even fflush(stdin) clobbers input pipes!
19858 $rm -f core tryp.c tryp.core core.tryp.*
19860 *) fflushall="$undef"
19864 case "$fflushNULL$fflushall" in
19867 OK, I give up. I cannot figure out how to flush pending stdio output.
19868 We won't be flushing handles at all before fork/exec/popen.
19874 : Store the full pathname to the ar program for use in the C program
19875 : Respect a hint or command line value for full_ar.
19880 : Store the full pathname to the sed program for use in the C program
19883 : see what type gids are declared as in the kernel
19885 echo "Looking for the type for group ids returned by getgid()."
19886 set gid_t gidtype xxx stdio.h sys/types.h
19890 xxx=`./findhdr sys/user.h`
19891 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19893 unsigned) dflt="$1 $2" ;;
19897 *) dflt="$gidtype";;
19900 gid_t) echo "gid_t found." ;;
19901 *) rp="What is the type for group ids returned by getgid()?"
19907 : Check the size of GID
19910 *_t) zzz="$gidtype" ;;
19913 echo "Checking the size of $zzz..." >&4
19915 #include <sys/types.h>
19917 #$i_stdlib I_STDLIB
19919 #include <stdlib.h>
19922 printf("%d\n", (int)sizeof($gidtype));
19927 if eval $compile_ok; then
19931 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19934 echo "Your $zzz is $gidsize bytes long."
19939 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19943 : Check if GID is signed
19946 *_t) zzz="$gidtype" ;;
19949 echo "Checking the sign of $zzz..." >&4
19951 #include <sys/types.h>
19962 if eval $compile; then
19966 echo "(I can't execute the test program--guessing unsigned.)" >&4
19970 1) echo "Your $zzz is unsigned." ;;
19971 -1) echo "Your $zzz is signed." ;;
19977 echo "(I can't compile the test program--guessing unsigned.)" >&4
19981 : Check 64bit sizes
19984 if $test X"$quadtype" != X; then
19986 echo "Checking how to print 64-bit integers..." >&4
19988 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19989 $cat >try.c <<'EOCP'
19990 #include <sys/types.h>
19993 int q = 12345678901;
19994 printf("%ld\n", q);
19998 if eval $compile; then
20002 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20003 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20004 echo "We will use %d."
20010 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20011 $cat >try.c <<'EOCP'
20012 #include <sys/types.h>
20015 long q = 12345678901;
20016 printf("%ld\n", q);
20020 if eval $compile; then
20024 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20025 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20026 echo "We will use %ld."
20032 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20033 $cat >try.c <<'EOCP'
20034 #include <sys/types.h>
20035 #include <inttypes.h>
20038 int64_t q = 12345678901;
20039 printf("%" PRId64 "\n", q);
20043 if eval $compile; then
20047 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20048 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20049 echo "We will use the C9X style."
20055 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20057 #include <sys/types.h>
20060 $quadtype q = 12345678901;
20061 printf("%Ld\n", q);
20065 if eval $compile; then
20069 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20070 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20071 echo "We will use %Ld."
20077 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20078 $cat >try.c <<'EOCP'
20079 #include <sys/types.h>
20082 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20083 printf("%lld\n", q);
20087 if eval $compile; then
20091 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20092 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20093 echo "We will use the %lld style."
20099 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20101 #include <sys/types.h>
20104 $quadtype q = 12345678901;
20105 printf("%qd\n", q);
20109 if eval $compile; then
20113 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20114 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20115 echo "We will use %qd."
20121 if $test X"$sPRId64" = X; then
20122 echo "Cannot figure out how to print 64-bit integers." >&4
20129 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20130 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20132 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20133 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20137 : Check format strings for internal types
20139 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20141 if $test X"$ivsize" = X8; then
20142 ivdformat="$sPRId64"
20143 uvuformat="$sPRIu64"
20144 uvoformat="$sPRIo64"
20145 uvxformat="$sPRIx64"
20146 uvXUformat="$sPRIXU64"
20148 if $test X"$ivsize" = X"$longsize"; then
20155 if $test X"$ivsize" = X"$intsize"; then
20163 if $test X"$ivsize" = X"$shortsize"; then
20174 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20175 nveformat="$sPRIeldbl"
20176 nvfformat="$sPRIfldbl"
20177 nvgformat="$sPRIgldbl"
20178 nvEUformat="$sPRIEUldbl"
20179 nvFUformat="$sPRIFUldbl"
20180 nvGUformat="$sPRIGUldbl"
20190 case "$ivdformat" in
20191 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20196 : Check format string for GID
20199 $echo "Checking the format string to be used for gids..." >&4
20202 -1) if $test X"$gidsize" = X"$ivsize"; then
20203 gidformat="$ivdformat"
20205 if $test X"$gidsize" = X"$longsize"; then
20208 if $test X"$gidsize" = X"$intsize"; then
20211 if $test X"$gidsize" = X"$shortsize"; then
20218 *) if $test X"$gidsize" = X"$uvsize"; then
20219 gidformat="$uvuformat"
20221 if $test X"$gidsize" = X"$longsize"; then
20224 if $test X"$gidsize" = X"$intsize"; then
20227 if $test X"$gidsize" = X"$shortsize"; then
20236 : see if getgroups exists
20237 set getgroups d_getgrps
20240 : see if setgroups exists
20241 set setgroups d_setgrps
20244 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20246 case "$d_getgrps$d_setgrps" in
20248 case "$groupstype" in
20249 '') dflt="$gidtype" ;;
20250 *) dflt="$groupstype" ;;
20253 What type of pointer is the second argument to getgroups() and setgroups()?
20254 Usually this is the same as group ids, $gidtype, but not always.
20257 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20261 *) groupstype="$gidtype";;
20264 : MAD = Misc Attribute Definition
20266 if $test $patchlevel -lt 9; then
20267 : MAD is not available in 5.8.x or earlier.
20271 $define|true|[yY]*) dflt='y' ;;
20276 Would you like to build with Misc Attribute Decoration? This is development
20277 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20278 overhead on the interpreter.
20280 If this doesn't make any sense to you, just accept the default '$dflt'.
20282 rp='Build Perl with MAD?'
20287 madlyh='madly.h madly.act madly.tab'
20289 madlyobj="madly$_o" ;;
20298 : check whether make sets MAKE
20300 echo "Checking if your $make program sets \$(MAKE)..." >&4
20301 case "$make_set_make" in
20303 $sed 's/^X //' > testmake.mak << 'EOF'
20305 X @echo 'maketemp="$(MAKE)"'
20307 case "`$make -f testmake.mak 2>/dev/null`" in
20308 *maketemp=*) make_set_make='#' ;;
20309 *) make_set_make="MAKE=$make" ;;
20311 $rm -f testmake.mak
20314 case "$make_set_make" in
20315 '#') echo "Yup, it does.";;
20316 *) echo "Nope, it doesn't.";;
20319 : see what type is used for mode_t
20320 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20321 set mode_t modetype int stdio.h sys/types.h
20324 : see if we need va_copy
20326 case "$i_stdarg" in
20329 #include <stdarg.h>
20331 #$i_stdlib I_STDLIB
20333 #include <stdlib.h>
20335 #include <signal.h>
20338 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20340 return vfprintf(f, fmt, *valp);
20344 myvfprintf(FILE *f, const char *fmt, va_list val)
20346 return ivfprintf(f, fmt, &val);
20350 myprintf(char *fmt, ...)
20353 va_start(val, fmt);
20354 return myvfprintf(stdout, fmt, val);
20358 main(int ac, char **av)
20360 signal(SIGSEGV, exit);
20362 myprintf("%s%cs all right, then\n", "that", '\'');
20367 if eval $compile && $run ./try 2>&1 >/dev/null; then
20368 case "`$run ./try`" in
20369 "that's all right, then")
20375 yes) echo "It seems that you don't need va_copy()." >&4
20376 need_va_copy="$undef"
20378 *) echo "It seems that va_copy() or similar will be needed." >&4
20379 need_va_copy="$define"
20384 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20385 need_va_copy="$undef"
20389 : see what type is used for size_t
20390 rp="What is the type used for the length parameter for string functions?"
20391 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20394 : check for type of arguments to gethostbyaddr.
20395 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20396 case "$d_gethbyaddr" in
20400 Checking to see what type of arguments are accepted by gethostbyaddr().
20402 hdrs="$define sys/types.h
20403 $d_socket sys/socket.h
20404 $i_niin netinet/in.h
20406 $i_unistd unistd.h"
20407 : The first arg can 'char *' or 'void *'
20408 : The second arg is some of integral type
20409 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20410 for yyy in size_t long int; do
20411 case "$netdb_host_type" in
20412 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20413 if ./protochk "$try" $hdrs; then
20414 echo "Your system accepts $xxx for the first arg."
20415 echo "...and $yyy for the second arg."
20416 netdb_host_type="$xxx"
20417 netdb_hlen_type="$yyy"
20423 : In case none of those worked, prompt the user.
20424 case "$netdb_host_type" in
20425 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20428 netdb_host_type=$ans
20429 rp='What is the type for the 2nd argument to gethostbyaddr?'
20432 netdb_hlen_type=$ans
20436 *) : no gethostbyaddr, so pick harmless defaults
20437 netdb_host_type='char *'
20438 netdb_hlen_type="$sizetype"
20441 # Remove the "const" if needed. -- but then we'll have a
20443 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20446 : check for type of argument to gethostbyname.
20447 if test "X$netdb_name_type" = X ; then
20448 case "$d_gethbyname" in
20452 Checking to see what type of argument is accepted by gethostbyname().
20454 hdrs="$define sys/types.h
20455 $d_socket sys/socket.h
20456 $i_niin netinet/in.h
20458 $i_unistd unistd.h"
20459 for xxx in "const char *" "char *"; do
20460 case "$netdb_name_type" in
20461 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20462 if ./protochk "$try" $hdrs; then
20463 echo "Your system accepts $xxx."
20464 netdb_name_type="$xxx"
20469 : In case none of those worked, prompt the user.
20470 case "$netdb_name_type" in
20471 '') rp='What is the type for the 1st argument to gethostbyname?'
20474 netdb_name_type=$ans
20478 *) : no gethostbyname, so pick harmless default
20479 netdb_name_type='char *'
20484 : check for type of 1st argument to getnetbyaddr.
20485 if test "X$netdb_net_type" = X ; then
20486 case "$d_getnbyaddr" in
20490 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20492 hdrs="$define sys/types.h
20493 $d_socket sys/socket.h
20494 $i_niin netinet/in.h
20496 $i_unistd unistd.h"
20497 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20498 case "$netdb_net_type" in
20499 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20500 if ./protochk "$try" $hdrs; then
20501 echo "Your system accepts $xxx."
20502 netdb_net_type="$xxx"
20507 : In case none of those worked, prompt the user.
20508 case "$netdb_net_type" in
20509 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20512 netdb_net_type=$ans
20516 *) : no getnetbyaddr, so pick harmless default
20517 netdb_net_type='long'
20521 : locate the preferred pager for this system
20528 [a-zA-Z]:/*) dflt=$pg;;
20532 [a-zA-Z]:/*) dflt=$more;;
20536 [a-zA-Z]:/*) dflt=$less;;
20539 '') dflt=/usr/ucb/more;;
20547 rp='What pager is used on your system?'
20551 : see what type pids are declared as in the kernel
20552 rp="What is the type of process ids on this system?"
20553 set pid_t pidtype int stdio.h sys/types.h
20556 : see if ar generates random libraries by itself
20558 echo "Checking how to generate random libraries on your machine..." >&4
20559 echo 'int bar1() { return bar2(); }' > bar1.c
20560 echo 'int bar2() { return 2; }' > bar2.c
20562 #$i_stdlib I_STDLIB
20564 #include <stdlib.h>
20566 int main() { printf("%d\n", bar1()); exit(0); }
20568 $cc $ccflags -c bar1.c >/dev/null 2>&1
20569 $cc $ccflags -c bar2.c >/dev/null 2>&1
20570 $cc $ccflags -c foo.c >/dev/null 2>&1
20571 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20572 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20573 $run ./foobar >/dev/null 2>&1; then
20574 echo "$ar appears to generate random libraries itself."
20576 if [ "X$ranlib" = "X" ]; then
20579 elif $ar s bar$_a >/dev/null 2>&1 &&
20580 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20581 $run ./foobar >/dev/null 2>&1; then
20582 echo "a table of contents needs to be added with '$ar s'."
20585 elif $ar ts bar$_a >/dev/null 2>&1 &&
20586 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20587 $run ./foobar >/dev/null 2>&1; then
20588 echo "a table of contents needs to be added with '$ar ts'."
20595 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20596 $test -f $ranlib || ranlib=''
20599 if $test -n "$ranlib"; then
20600 echo "your system has '$ranlib'; we'll use that."
20603 echo "your system doesn't seem to support random libraries"
20604 echo "so we'll use lorder and tsort to order the libraries."
20611 : see if this is a values.h system
20612 set values.h i_values
20615 : Check the max offset that gmtime and localtime accept
20616 echo "Checking max offsets that gmtime () accepts"
20619 define) yyy="#include <values.h>" ;;
20623 case "$sGMTIME_min/$sGMTIME_max" in
20626 #include <sys/types.h>
20635 void gm_check (time_t t, int min_year, int max_year)
20638 if ( tmp == NULL ||
20639 /* Check tm_year overflow */
20640 tmp->tm_year < min_year || tmp->tm_year > max_year)
20651 gm_check (MAXLONG, 69, 0x7fffffff);
20653 if (tmp == NULL || tmp->tm_year < 0) {
20654 for (i = 63; i >= 0; i--) {
20655 time_t x = pt | ((time_t)1 << i);
20656 if (x < 0 || x < pt) continue;
20657 gm_check (x, 69, 0x7fffffff);
20660 printf ("sGMTIME_max=%ld\n", pt);
20669 gm_check (MINLONG, -1900, 70);
20672 for (i = 36; i >= 0; i--) {
20673 time_t x = pt - ((time_t)1 << i);
20674 if (x > 0) continue;
20675 gm_check (x, -1900, 70);
20678 printf ("sGMTIME_min=%ld\n", pt);
20682 int main (int argc, char *argv[])
20684 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20691 if eval $compile; then
20694 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20700 echo "Checking max offsets that localtime () accepts"
20702 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20705 #include <sys/types.h>
20714 void local_check (time_t t, int min_year, int max_year)
20716 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20719 tmp = localtime (&t);
20720 if ( tmp == NULL ||
20721 /* Check tm_year overflow */
20722 tmp->tm_year < min_year || tmp->tm_year > max_year)
20726 } /* local_check */
20733 local_check (MAXLONG, 69, 0x7fffffff);
20735 if (tmp == NULL || tmp->tm_year < 0) {
20736 for (i = 63; i >= 0; i--) {
20737 time_t x = pt | ((time_t)1 << i);
20738 if (x < 0 || x < pt) continue;
20739 local_check (x, 69, 0x7fffffff);
20742 printf ("sLOCALTIME_max=%ld\n", pt);
20751 local_check (MINLONG, -1900, 70);
20754 for (i = 36; i >= 0; i--) {
20755 time_t x = pt - ((time_t)1 << i);
20756 if (x > 0) continue;
20757 local_check (x, -1900, 70);
20760 printf ("sLOCALTIME_min=%ld\n", pt);
20764 int main (int argc, char *argv[])
20772 if eval $compile; then
20775 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20781 : check for type of arguments to select.
20782 case "$selecttype" in
20783 '') case "$d_select" in
20787 Checking to see what type of arguments are accepted by select().
20789 hdrs="$define sys/types.h
20790 $i_systime sys/time.h
20791 $i_sysselct sys/select.h
20792 $d_socket sys/socket.h"
20793 : The first arg can be int, unsigned, or size_t
20794 : The last arg may or may not be 'const'
20796 : void pointer has been seen but using that
20797 : breaks the selectminbits test
20798 for xxx in 'fd_set *' 'int *'; do
20799 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20800 for tmo in 'struct timeval *' 'const struct timeval *'; do
20802 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20803 if ./protochk "$try" $hdrs; then
20804 echo "Your system accepts $xxx."
20813 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20814 case "$d_fd_set" in
20815 $define) dflt="fd_set *" ;;
20824 *) : no select, so pick a harmless default
20831 : check for the select 'width'
20832 case "$selectminbits" in
20833 '') safebits=`expr $ptrsize \* 8`
20834 case "$d_select" in
20838 Checking to see on how many bits at a time your select() operates...
20841 #include <sys/types.h>
20843 #$i_systime I_SYS_TIME
20844 #$i_systimek I_SYS_TIME_KERNEL
20849 # ifdef I_SYS_TIME_KERNEL
20852 # include <sys/time.h>
20853 # ifdef I_SYS_TIME_KERNEL
20857 #$i_sysselct I_SYS_SELECT
20858 #ifdef I_SYS_SELECT
20859 #include <sys/select.h>
20861 #$d_socket HAS_SOCKET
20863 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20866 #$i_stdlib I_STDLIB
20868 #include <stdlib.h>
20871 #define S sizeof(*(b))
20873 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20874 #define NBITS (NBYTES * 8)
20876 char *s = (char *)malloc(NBYTES);
20885 fp = fopen("try.c", "r");
20891 b = ($selecttype)s;
20892 for (i = 0; i < NBITS; i++)
20896 select(fd + 1, b, 0, 0, &t);
20897 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20899 printf("%d\n", i + 1);
20904 if eval $compile_ok; then
20905 selectminbits=`$run ./try`
20906 case "$selectminbits" in
20908 Cannot figure out on how many bits at a time your select() operates.
20909 I'll play safe and guess it is $safebits bits.
20911 selectminbits=$safebits
20912 bits="$safebits bits"
20915 *) bits="$selectminbits bits" ;;
20917 echo "Your select() operates on $bits at a time." >&4
20919 rp='What is the minimum number of bits your select() operates on?'
20920 case "$byteorder" in
20921 12345678) dflt=64 ;;
20927 selectminbits="$val"
20931 *) : no select, so pick a harmless default
20932 selectminbits=$safebits
20938 : Trace out the files included by signal.h, then look for SIGxxx names.
20939 if [ "X$fieldn" = X ]; then
20940 : Just make some guesses. We check them later.
20941 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20943 xxx=`echo '#include <signal.h>' |
20944 $cppstdin $cppminus $cppflags 2>/dev/null |
20945 $grep '^[ ]*#.*include' |
20946 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20947 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20950 for xx in $xxx /dev/null ; do
20951 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20953 case "$xxxfiles" in
20954 '') xxxfiles=`./findhdr signal.h` ;;
20957 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20958 print substr($2, 4, 20)
20960 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20961 print substr($3, 4, 20)
20963 : Append some common names just in case the awk scan failed.
20964 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20965 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20966 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20967 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20968 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20970 : generate a few handy files for later
20971 $cat > signal.c <<EOCP
20972 #include <sys/types.h>
20973 #include <signal.h>
20974 #$i_stdlib I_STDLIB
20976 #include <stdlib.h>
20981 /* Strange style to avoid deeply-nested #if/#else/#endif */
20984 # define NSIG (_NSIG)
20990 # define NSIG (SIGMAX+1)
20996 # define NSIG (SIG_MAX+1)
21002 # define NSIG (_SIG_MAX+1)
21008 # define NSIG (MAXSIG+1)
21014 # define NSIG (MAX_SIG+1)
21019 # ifdef SIGARRAYSIZE
21020 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21026 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21030 /* Default to some arbitrary number that's big enough to get most
21031 of the common signals.
21037 printf("NSIG %d\n", NSIG);
21043 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21045 printf "#ifdef SIG"; printf $1; printf "\n"
21046 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21047 printf $1; printf ");\n"
21051 printf "#endif /* JUST_NSIG */\n";
21052 printf "exit(0);\n}\n";
21055 $cat >signal.awk <<'EOP'
21056 BEGIN { ndups = 0 }
21057 $1 ~ /^NSIG$/ { nsig = $2 }
21058 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21059 if ($2 > maxsig) { maxsig = $2 }
21060 if (sig_name[$2]) {
21061 dup_name[ndups] = $1
21062 dup_num[ndups] = $2
21074 printf("NSIG %d\n", nsig);
21075 for (n = 1; n < nsig; n++) {
21077 printf("%s %d\n", sig_name[n], sig_num[n])
21080 printf("NUM%d %d\n", n, n)
21083 for (n = 0; n < ndups; n++) {
21084 printf("%s %d\n", dup_name[n], dup_num[n])
21088 $cat >signal_cmd <<EOS
21090 if $test -s signal.lst; then
21091 echo "Using your existing signal.lst file"
21096 $cat >>signal_cmd <<'EOS'
21099 if eval $compile_ok; then
21100 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21101 $uniq | $awk -f signal.awk >signal.lst
21103 echo "(I can't seem be able to compile the whole test program)" >&4
21104 echo "(I'll try it in little pieces.)" >&4
21105 set signal -DJUST_NSIG
21106 if eval $compile_ok; then
21107 $run ./signal$_exe > signal.nsg
21110 echo "I can't seem to figure out how many signals you have." >&4
21111 echo "Guessing 50." >&4
21112 echo 'NSIG 50' > signal.nsg
21114 : Now look at all the signal names, one at a time.
21115 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21116 $cat > signal.c <<EOCP
21117 #include <sys/types.h>
21118 #include <signal.h>
21121 printf("$xx %d\n", SIG${xx});
21126 if eval $compile; then
21127 echo "SIG${xx} found."
21128 $run ./signal$_exe >> signal.ls1
21130 echo "SIG${xx} NOT found."
21133 if $test -s signal.ls1; then
21134 $cat signal.nsg signal.ls1 |
21135 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21139 if $test -s signal.lst; then
21142 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21143 echo 'kill -l' >signal
21144 set X `csh -f <signal`
21148 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21150 echo $@ | $tr ' ' $trnl | \
21151 $awk '{ printf "%s %d\n", $1, ++s; }
21152 END { printf "NSIG %d\n", ++s }' >signal.lst
21154 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21156 chmod a+x signal_cmd
21157 $eunicefix signal_cmd
21159 : generate list of signal names
21161 case "$sig_name_init" in
21163 *) case "$sig_num_init" in
21164 ''|*,*) doinit=yes ;;
21169 echo "Generating a list of signal names and numbers..." >&4
21171 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21172 sig_name=`$awk 'BEGIN { printf "ZERO " }
21173 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21174 sig_num=`$awk 'BEGIN { printf "0 " }
21175 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21176 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21177 !/^NSIG/ { printf "\"%s\", ", $1 }
21178 END { printf "0\n" }' signal.lst`
21179 sig_num_init=`$awk 'BEGIN { printf "0, " }
21180 !/^NSIG/ { printf "%d, ", $2}
21181 END { printf "0\n"}' signal.lst`
21184 echo "The following $sig_count signals are available:"
21186 echo $sig_name | $awk \
21187 'BEGIN { linelen = 0 }
21189 for (i = 1; i <= NF; i++) {
21190 name = "SIG" $i " "
21191 linelen = linelen + length(name)
21192 if (linelen > 70) {
21194 linelen = length(name)
21200 sig_size=`echo $sig_name | awk '{print NF}'`
21201 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21203 : Check size of size
21205 case "$sizetype" in
21206 *_t) zzz="$sizetype" ;;
21207 *) zzz="filesize" ;;
21209 echo "Checking the size of $zzz..." >&4
21211 #include <sys/types.h>
21213 #$i_stdlib I_STDLIB
21215 #include <stdlib.h>
21218 printf("%d\n", (int)sizeof($sizetype));
21223 if eval $compile_ok; then
21227 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21230 echo "Your $zzz size is $sizesize bytes."
21235 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21239 : check for socklen_t
21241 echo "Checking to see if you have socklen_t..." >&4
21243 #include <sys/types.h>
21244 #$d_socket HAS_SOCKET
21246 #include <sys/socket.h>
21248 int main() { socklen_t x = 16; }
21251 if eval $compile; then
21253 echo "You have socklen_t."
21256 echo "You do not have socklen_t."
21257 case "$sizetype" in
21258 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21265 : see if this is a socks.h system
21266 set socks.h i_socks
21269 : check for type of the size argument to socket calls
21270 case "$d_socket" in
21274 Checking to see what type is the last argument of accept().
21277 case "$d_socklen_t" in
21278 "$define") yyy="$yyy socklen_t"
21280 yyy="$yyy $sizetype int long unsigned"
21281 for xxx in $yyy; do
21282 case "$socksizetype" in
21283 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21284 case "$usesocks" in
21286 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21287 echo "Your system accepts '$xxx *' for the last argument of accept()."
21288 socksizetype="$xxx"
21291 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21292 echo "Your system accepts '$xxx *' for the last argument of accept()."
21293 socksizetype="$xxx"
21300 : In case none of those worked, prompt the user.
21301 case "$socksizetype" in
21302 '') rp='What is the type for socket address structure sizes?'
21309 *) : no sockets, so pick relatively harmless default
21314 : see what type is used for signed size_t
21315 set ssize_t ssizetype int stdio.h sys/types.h
21320 #$i_stdlib I_STDLIB
21322 #include <stdlib.h>
21324 #include <sys/types.h>
21325 #define Size_t $sizetype
21326 #define SSize_t $dflt
21329 if (sizeof(Size_t) == sizeof(SSize_t))
21331 else if (sizeof(Size_t) == sizeof(int))
21340 if eval $compile_ok && $run ./try > /dev/null; then
21341 ssizetype=`$run ./try`
21342 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21345 Help! I can't compile and run the ssize_t test program: please enlighten me!
21346 (This is probably a misconfiguration in your system or libraries, and
21347 you really ought to fix it. Still, I'll try anyway.)
21349 I need a type that is the same size as $sizetype, but is guaranteed to
21350 be signed. Common values are ssize_t, int and long.
21353 rp="What signed type is the same size as $sizetype?"
21359 : Check the size of st_ino
21361 $echo "Checking the size of st_ino..." >&4
21362 $cat > try.c <<EOCP
21363 #include <sys/stat.h>
21365 #$i_stdlib I_STDLIB
21367 #include <stdlib.h>
21371 printf("%d\n", (int)sizeof(st.st_ino));
21376 if eval $compile_ok; then
21380 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21382 *) st_ino_size=$val
21383 $echo "Your st_ino is $st_ino_size bytes long."
21388 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21392 : Check if st_ino is signed
21394 $echo "Checking the sign of st_ino..." >&4
21395 $cat > try.c <<EOCP
21396 #include <sys/stat.h>
21401 if (foo.st_ino < 0)
21408 if eval $compile; then
21412 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21414 *) st_ino_sign=$val
21415 case "$st_ino_sign" in
21416 1) $echo "Your st_ino is unsigned." ;;
21417 -1) $echo "Your st_ino is signed." ;;
21423 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21427 : see what type of char stdio uses.
21429 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21430 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21431 echo "Your stdio uses unsigned chars." >&4
21432 stdchar="unsigned char"
21434 echo "Your stdio uses signed chars." >&4
21439 : see what type uids are declared as in the kernel
21441 echo "Looking for the type for user ids returned by getuid()."
21442 set uid_t uidtype xxx stdio.h sys/types.h
21446 xxx=`./findhdr sys/user.h`
21447 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21449 unsigned) dflt="$1 $2" ;;
21453 *) dflt="$uidtype";;
21456 uid_t) echo "uid_t found." ;;
21457 *) rp="What is the type for user ids returned by getuid()?"
21463 : Check size of UID
21466 *_t) zzz="$uidtype" ;;
21469 echo "Checking the size of $zzz..." >&4
21471 #include <sys/types.h>
21473 #$i_stdlib I_STDLIB
21475 #include <stdlib.h>
21478 printf("%d\n", (int)sizeof($uidtype));
21483 if eval $compile_ok; then
21487 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21490 echo "Your $zzz is $uidsize bytes long."
21495 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21498 : Check if UID is signed
21501 *_t) zzz="$uidtype" ;;
21504 echo "Checking the sign of $zzz..." >&4
21506 #include <sys/types.h>
21517 if eval $compile; then
21521 echo "(I can't execute the test program--guessing unsigned.)" >&4
21525 1) echo "Your $zzz is unsigned." ;;
21526 -1) echo "Your $zzz is signed." ;;
21532 echo "(I can't compile the test program--guessing unsigned.)" >&4
21536 : Check format string for UID
21538 $echo "Checking the format string to be used for uids..." >&4
21541 -1) if $test X"$uidsize" = X"$ivsize"; then
21542 uidformat="$ivdformat"
21544 if $test X"$uidsize" = X"$longsize"; then
21547 if $test X"$uidsize" = X"$intsize"; then
21550 if $test X"$uidsize" = X"$shortsize"; then
21557 *) if $test X"$uidsize" = X"$uvsize"; then
21558 uidformat="$uvuformat"
21560 if $test X"$uidsize" = X"$longsize"; then
21563 if $test X"$uidsize" = X"$intsize"; then
21566 if $test X"$uidsize" = X"$shortsize"; then
21575 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21577 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21578 $cat >try.c <<'EOM'
21579 /* Intentionally a long probe as I'd like to sanity check that the exact
21580 approach is going to work, as thinking it will work, but only having it
21581 part working at runtime is worse than not having it. */
21583 #include <sys/types.h>
21584 #include <sys/sysctl.h>
21585 #include <sys/param.h>
21587 #include <string.h>
21588 #include <stdlib.h>
21589 #include <unistd.h>
21592 main(int argc, char **argv) {
21594 char *argv_leaf = strrchr(argv[0], '/');
21600 mib[1] = KERN_PROC;
21601 mib[2] = KERN_PROC_PATHNAME;
21605 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21609 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21614 if (size < strlen(argv_leaf) + 1) {
21615 fprintf(stderr, "size %lu is too short for a path\n",
21616 (unsigned long) size);
21620 if (size > MAXPATHLEN * MAXPATHLEN) {
21621 fprintf(stderr, "size %lu is too long for a path\n",
21622 (unsigned long) size);
21626 buffer = malloc(size);
21632 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21637 if (strlen(buffer) + 1 != size) {
21638 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21639 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21644 if (*buffer != '/') {
21645 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21649 if (strstr(buffer, "/./")) {
21650 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21654 if (strstr(buffer, "/../")) {
21655 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21659 buffer_leaf = strrchr(buffer, '/');
21660 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21661 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21673 if eval $compile; then
21674 if $run ./try; then
21675 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21678 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21682 echo "I'm unable to compile the test program." >&4
21683 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21687 set usekernprocpathname
21690 : Determine if we can use _NSGetExecutablePath to find executing program
21692 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21693 $cat >try.c <<'EOM'
21694 /* Intentionally a long probe as I'd like to sanity check that the exact
21695 approach is going to work, as thinking it will work, but only having it
21696 part working at runtime is worse than not having it. */
21697 #include <mach-o/dyld.h>
21699 #include <stdlib.h>
21700 #include <sys/param.h>
21701 #include <string.h>
21704 main(int argc, char **argv) {
21706 uint32_t size = sizeof(buf);
21710 char *argv_leaf = strrchr(argv[0], '/');
21714 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21718 _NSGetExecutablePath(buf, &size);
21719 if (size > MAXPATHLEN * MAXPATHLEN) {
21720 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21721 (unsigned int) size);
21725 buffer = malloc(size);
21731 result = _NSGetExecutablePath(buffer, &size);
21733 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21734 result, (unsigned int) size);
21738 tidied = realpath(buffer, NULL);
21740 perror("realpath");
21746 if (*tidied != '/') {
21747 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21751 if (strstr(tidied, "/./")) {
21752 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21756 if (strstr(tidied, "/../")) {
21757 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21761 tidied_leaf = strrchr(tidied, '/');
21762 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21763 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21775 if eval $compile; then
21776 if $run ./try; then
21777 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21780 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21783 echo "I'm unable to compile the test program." >&4
21784 echo "I'll assume no _NSGetExecutablePath here." >&4
21787 set usensgetexecutablepath
21790 : Check if site customization support was requested
21791 case "$usesitecustomize" in
21792 $define|true|[Yy]*)
21793 usesitecustomize="$define"
21796 usesitecustomize="$undef"
21800 : see if prototypes support variable argument declarations
21802 case "$prototype$i_stdarg" in
21804 echo "It appears we'll be able to prototype varargs functions." >&4
21808 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21815 : determine compiler compiler
21824 if $test -f "$byacc$_exe"; then
21826 comp="byacc or $comp"
21828 if $test -f "$bison$_exe"; then
21829 comp="$comp or bison -y"
21831 rp="Which compiler compiler ($comp) shall I use?"
21840 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21846 : see if this is a assert.h system
21847 set assert.h i_assert
21850 : see if this is a fp.h system
21854 : see if this is a fp_class.h system
21855 set fp_class.h i_fp_class
21858 : see if gdbm.h is available
21863 : see if gdbm_open exists
21864 set gdbm_open d_gdbm_open
21866 case "$d_gdbm_open" in
21869 echo "We won't be including <gdbm.h>"
21878 : see if this is a ieeefp.h system
21879 case "$i_ieeefp" in
21880 '' ) set ieeefp.h i_ieeefp
21885 : see if this is a libutil.h system
21886 set libutil.h i_libutil
21889 : see if mach cthreads are available
21890 if test "X$usethreads" = "X$define"; then
21891 set mach/cthreads.h i_machcthr
21894 i_machcthr="$undef"
21897 : see if this is a mntent.h system
21898 set mntent.h i_mntent
21901 : see if net/errno.h is available
21903 set net/errno.h val
21906 : Unfortunately, it causes problems on some systems. Arrgh.
21909 cat > try.c <<'EOM'
21912 #include <net/errno.h>
21918 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21919 echo "We'll be including <net/errno.h>." >&4
21921 echo "We won't be including <net/errno.h>." >&4
21930 : see if netinet/tcp.h is available
21931 set netinet/tcp.h i_netinettcp
21934 : see if this is a poll.h system
21938 : see if this is a prot.h system
21942 : Preprocessor symbols
21944 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21945 $cat <<'EOSH' > Cppsym.know
21946 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21947 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21948 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21949 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21950 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21951 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21952 bull c cadmus clipper CMU COFF COMPILER_VERSION
21953 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21954 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21955 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21956 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21958 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21959 H3050R H3050RX hbullx20 hcx host_mips
21960 hp200 hp300 hp700 HP700 hp800 hp9000
21961 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21962 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21963 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21964 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21965 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21966 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21967 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21968 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21969 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21970 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21971 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21972 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21973 MATH_HAS_NO_SIDE_EFFECTS
21974 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21975 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21976 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21977 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21978 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21979 NetBSD news1500 news1700 news1800 news1900 news3700
21980 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21981 ns32016 ns32332 ns32k nsc32000
21982 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21983 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21984 pc532 pdp11 PGC PIC plexus PORTAR posix
21985 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21986 POSIX_C_SOURCE POSIX_SOURCE POWER
21987 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21988 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21989 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21990 sony sony_news sonyrisc sparc sparclite spectrum
21991 stardent stdc STDC_EXT stratos sun sun3 sun386
21992 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21993 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21994 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21995 sysV68 sysV88 Tek4132 Tek4300 titan
21996 TM3200 TM5400 TM5600
21997 tower tower32 tower32_200 tower32_600 tower32_700
21998 tower32_800 tower32_850 tss
21999 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22000 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22001 unix UNIX95 UNIX99 unixpc unos
22002 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22003 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22004 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22006 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22007 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22008 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22011 # Maybe put other stuff here too.
22012 cat <<EOSH >>Cppsym.know
22015 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22016 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22017 $cat Cppsym.know > Cppsym.c
22018 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22019 $rm -f Cppsym.a Cppsym.b Cppsym.c
22020 cat <<EOSH > Cppsym
22022 if $test \$# -gt 0; then
22023 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22024 if $test -s Cppsym.got; then
22031 $tr " " "$trnl" | ./Cppsym.try
22037 cat <<EOSH > Cppsym.try
22039 cat <<'EOCP' > try.c
22042 #define STRINGIFY(a) "a"
22044 #if cpp_stuff == 42
22045 #define StGiFy(a) #a
22046 #define STRINGIFY(a) StGiFy(a)
22048 #if $cpp_stuff != 1 && $cpp_stuff != 42
22049 # include "Bletch: How does this C preprocessor stringify macros?"
22055 cat <<'EOSH' >> Cppsym.try
22057 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22058 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22059 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22060 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22062 echo 'return 0;}' >> try.c
22064 cat <<EOSH >> Cppsym.try
22066 case "$osname-$gccversion" in
22067 irix-) ccflags="\$ccflags -woff 1178" ;;
22068 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22070 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22072 chmod +x Cppsym.try
22073 $eunicefix Cppsym.try
22074 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22075 : Add in any Linux cpp "predefined macros":
22076 case "$osname::$gccversion" in
22077 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22079 rm -f $tHdrH'.h' $tHdrH
22081 # Filter out macro arguments, such as Linux's __INT8_C(c)
22082 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22083 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22084 if [ -s $tHdrH'_cppsym.real' ]; then
22085 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22088 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22091 : now check the C compiler for additional symbols
22092 postprocess_cc_v=''
22094 aix) postprocess_cc_v="|$tr , ' '" ;;
22101 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22104 -D*) echo "\$i" | $sed 's/^-D//';;
22105 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22110 postprocess_cc_v=''
22113 ./ccsym > ccsym1.raw
22114 if $test -s ccsym1.raw; then
22115 $sort ccsym1.raw | $uniq >ccsym.raw
22117 mv ccsym1.raw ccsym.raw
22120 $awk '/\=/ { print $0; next }
22121 { print $0"=1" }' ccsym.raw >ccsym.list
22122 $comm -13 Cppsym.true ccsym.list >ccsym.own
22123 $comm -12 Cppsym.true ccsym.list >ccsym.com
22124 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22126 if $test -z ccsym.raw; then
22127 echo "Your C compiler doesn't seem to define any symbols!" >&4
22129 echo "However, your C preprocessor defines the following symbols:"
22132 cppsymbols=`$cat Cppsym.true`
22133 cppsymbols=`echo $cppsymbols`
22134 cppccsymbols="$cppsymbols"
22136 if $test -s ccsym.com; then
22137 echo "Your C compiler and pre-processor define these symbols:"
22138 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22141 cppccsymbols=`$cat ccsym.com`
22142 cppccsymbols=`echo $cppccsymbols`
22143 $test "$silent" || sleep 1
22145 if $test -s ccsym.cpp; then
22146 $test "$also" && echo " "
22147 echo "Your C pre-processor ${also}defines the following symbols:"
22148 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22150 cppsymbols=`$cat ccsym.cpp`
22151 cppsymbols=`echo $cppsymbols`
22152 $test "$silent" || sleep 1
22154 if $test -s ccsym.own; then
22155 $test "$also" && echo " "
22156 echo "Your C compiler ${also}defines the following cpp symbols:"
22157 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22158 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22159 ccsymbols=`$cat ccsym.own`
22160 ccsymbols=`echo $ccsymbols`
22161 $test "$silent" || sleep 1
22165 : see if this is a termio system
22169 if $test `./findhdr termios.h`; then
22170 set tcsetattr i_termios
22176 "$define") echo "You have POSIX termios.h... good!" >&4;;
22177 *) if ./Cppsym pyr; then
22178 case "`/bin/universe`" in
22179 ucb) if $test `./findhdr sgtty.h`; then
22181 echo "<sgtty.h> found." >&4
22183 echo "System is pyramid with BSD universe."
22184 ./warn "<sgtty.h> not found--you could have problems."
22186 *) if $test `./findhdr termio.h`; then
22188 echo "<termio.h> found." >&4
22190 echo "System is pyramid with USG universe."
22191 ./warn "<termio.h> not found--you could have problems."
22195 if $test `./findhdr termio.h`; then
22196 echo "<termio.h> found." >&4
22198 elif $test `./findhdr sgtty.h`; then
22199 echo "<sgtty.h> found." >&4
22202 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22205 if $test `./findhdr sgtty.h`; then
22206 echo "<sgtty.h> found." >&4
22208 elif $test `./findhdr termio.h`; then
22209 echo "<termio.h> found." >&4
22212 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22216 set i_termio; eval $setvar
22217 val=$val2; set i_sgtty; eval $setvar
22218 val=$val3; set i_termios; eval $setvar
22220 : see if stdbool is available
22221 : we want a real compile instead of Inhdr because some Solaris systems
22222 : have stdbool.h, but it can only be used if the compiler indicates it
22223 : is sufficiently c99-compliant.
22227 #include <stdbool.h>
22232 int main(int argc, char **argv)
22238 if eval $compile; then
22239 echo "<stdbool.h> found." >&4
22242 echo "<stdbool.h> NOT found." >&4
22249 : see if stddef is available
22250 set stddef.h i_stddef
22253 : see if sys/access.h is available
22254 set sys/access.h i_sysaccess
22257 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22258 set sys/filio.h i_sysfilio
22261 if $test `./findhdr sys/ioctl.h`; then
22263 echo '<sys/ioctl.h> found.' >&4
22266 if $test $i_sysfilio = "$define"; then
22267 echo '<sys/ioctl.h> NOT found.' >&4
22269 $test $i_sgtty = "$define" && xxx="sgtty.h"
22270 $test $i_termio = "$define" && xxx="termio.h"
22271 $test $i_termios = "$define" && xxx="termios.h"
22272 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22278 : see if socket ioctl defs are in sys/sockio.h
22280 xxx=`./findhdr sys/sockio.h`
22281 if $test "$xxx"; then
22282 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22284 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22287 echo "No socket ioctls found in <sys/sockio.h>." >&4
22292 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22298 : see if this is a syslog.h system
22299 set syslog.h i_syslog
22302 : see if this is a sys/mode.h system
22303 set sys/mode.h i_sysmode
22306 : see if there is a sys/poll.h file
22307 set sys/poll.h i_syspoll
22310 : see if sys/resource.h has to be included
22311 set sys/resource.h i_sysresrc
22314 : see if sys/security.h is available
22315 set sys/security.h i_syssecrt
22318 : see if this is a sys/statvfs.h system
22319 set sys/statvfs.h i_sysstatvfs
22322 : see if this is a sys/un.h system
22323 set sys/un.h i_sysun
22326 : see if this is a sys/utsname.h system
22327 set sys/utsname.h i_sysutsname
22330 : see if this is a syswait system
22331 set sys/wait.h i_syswait
22334 : see if this is a ustat.h system
22335 set ustat.h i_ustat
22338 : see if this is an utime system
22339 set utime.h i_utime
22342 : see if this is a vfork system
22345 set vfork.h i_vfork
22355 echo "Looking for extensions..." >&4
22356 : If we are using the old config.sh, known_extensions may contain
22357 : old or inaccurate or duplicate values.
22358 known_extensions=''
22359 nonxs_extensions=''
22360 : We do not use find because it might not be available.
22361 : We do not just use MANIFEST because the user may have dropped
22362 : some additional extensions into the source tree and expect them
22365 : Function to recursively find available extensions, ignoring DynaLoader
22366 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22367 : In 5.10.1 and later, extensions are stored in directories
22368 : like File-Glob instead of the older File/Glob/.
22372 DynaLoader|dynaload) ;;
22374 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22375 leaf=`echo $xxx | $sed -e s/.*-//`;
22376 if $test -d File; then
22377 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22378 known_extensions="$known_extensions $1$this_ext";
22379 elif $test -f $xxx/Makefile.PL; then
22380 nonxs_extensions="$nonxs_extensions $1$this_ext";
22382 if $test -d $xxx -a $# -lt 10; then
22385 eval $find_extensions;
22391 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22392 if $contains " $this_ext " $$.tmp; then
22394 echo "Duplicate directories detected for extension $xxx" >&4;
22395 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22396 case "$knowitall" in
22404 echo "Ok. Stopping Configure." >&4;
22405 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22408 echo "Ok. You will need to correct config.sh before running make." >&4;
22410 $ls -1 $xxx > $$.tmp;
22411 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22412 known_extensions="$known_extensions $this_ext";
22413 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22414 known_extensions="$known_extensions $this_ext";
22415 elif $test -d $xxx; then
22416 nonxs_extensions="$nonxs_extensions $this_ext";
22427 eval $find_extensions
22431 eval $find_extensions
22435 eval $find_extensions
22436 if $test -d File-Glob; then
22437 : All ext/ flattened
22439 # Special case: Add in modules that nest beyond the first level.
22440 # Currently threads/shared and Hash/Util/FieldHash, since they are
22441 # not picked up by the recursive find above (and adding in general
22442 # recursive finding breaks SDBM_File/sdbm).
22443 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22444 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22446 set X $known_extensions
22448 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22449 set X $nonxs_extensions
22451 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22454 : Now see which are supported on this system.
22456 for xxx in $known_extensions ; do
22460 $define) avail_ext="$avail_ext $xxx" ;;
22463 GDBM_File|gdbm_fil)
22465 $define) avail_ext="$avail_ext $xxx" ;;
22468 I18N/Langinfo|i18n_lan)
22469 case "$i_langinfo$d_nl_langinfo" in
22470 $define$define) avail_ext="$avail_ext $xxx" ;;
22474 : XXX Do we need a useipcsysv variable here
22475 case "${d_msg}${d_sem}${d_shm}" in
22476 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22479 NDBM_File|ndbm_fil)
22482 case "$osname-$use64bitint" in
22485 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22488 *) avail_ext="$avail_ext $xxx" ;;
22493 ODBM_File|odbm_fil)
22494 case "${i_dbm}${i_rpcsvcdbm}" in
22496 case "$d_cplusplus" in
22497 define) ;; # delete as a function name will not work
22498 *) case "$osname-$use64bitint" in
22501 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22504 *) avail_ext="$avail_ext $xxx" ;;
22512 case "$useopcode" in
22513 true|define|y) avail_ext="$avail_ext $xxx" ;;
22517 case "$useposix" in
22518 true|define|y) avail_ext="$avail_ext $xxx" ;;
22522 case "$d_socket" in
22523 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22526 Sys/Syslog|sys/syslog)
22527 : XXX syslog requires socket
22528 case "$d_socket" in
22529 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22533 case "$usethreads" in
22535 case "$use5005threads" in
22536 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22540 threads|threads/shared)
22541 # threads and threads::shared are special cases.
22542 # To stop people from asking "Perl 5.8.0 was supposed
22543 # to have this new fancy threads implementation but my
22544 # perl doesn't have it" and from people trying to
22545 # (re)install the threads module using CPAN.pm and
22546 # CPAN.pm then offering to reinstall Perl 5.8.0,
22547 # the threads.pm and threads/shared.pm will always be
22548 # there, croaking informatively ("you need to rebuild
22549 # all of Perl with threads, sorry") when threads haven't
22550 # been compiled in.
22552 avail_ext="$avail_ext $xxx"
22558 cygwin) avail_ext="$avail_ext $xxx" ;;
22561 XS/APItest|xs/apitest)
22562 # This is just for testing. Skip it unless we have dynamic loading.
22565 $define) avail_ext="$avail_ext $xxx" ;;
22568 XS/Typemap|xs/typemap)
22569 # This is just for testing. Skip it unless we have dynamic loading.
22571 $define) avail_ext="$avail_ext $xxx" ;;
22574 *) avail_ext="$avail_ext $xxx"
22583 case "$onlyextensions" in
22585 *) keepextensions=''
22586 echo "You have requested that only certain extensions be included..." >&4
22587 for i in $onlyextensions; do
22588 case " $avail_ext " in
22590 echo "Keeping extension $i."
22591 keepextensions="$keepextensions $i"
22593 *) echo "Ignoring extension $i." ;;
22596 avail_ext="$keepextensions"
22600 case "$noextensions" in
22602 *) keepextensions=''
22603 echo "You have requested that certain extensions be ignored..." >&4
22604 for i in $avail_ext; do
22605 case " $noextensions " in
22606 *" $i "*) echo "Ignoring extension $i." ;;
22607 *) echo "Keeping extension $i.";
22608 keepextensions="$keepextensions $i"
22612 avail_ext="$keepextensions"
22616 : Now see which nonxs extensions are supported on this system.
22617 : For now assume all are.
22619 for xxx in $nonxs_extensions ; do
22621 *) nonxs_ext="$nonxs_ext $xxx"
22633 A number of extensions are supplied with $package. You may choose to
22634 compile these extensions for dynamic loading (the default), compile
22635 them into the $package executable (static loading), or not include
22636 them at all. Answer "none" to include no extensions.
22637 Note that DynaLoader is always built and need not be mentioned here.
22640 case "$dynamic_ext" in
22642 : Exclude those listed in static_ext
22644 for xxx in $avail_ext; do
22645 case " $static_ext " in
22647 *) dflt="$dflt $xxx" ;;
22654 *) dflt="$dynamic_ext"
22655 # Perhaps we are reusing an old out-of-date config.sh.
22658 if test X"$dynamic_ext" != X"$avail_ext"; then
22660 NOTICE: Your previous config.sh list may be incorrect.
22661 The extensions now available to you are
22663 but the default list from your previous config.sh is
22675 rp="What extensions do you wish to load dynamically?"
22678 none) dynamic_ext=' ' ;;
22679 *) dynamic_ext="$ans" ;;
22682 case "$static_ext" in
22684 : Exclude those already listed in dynamic linking
22686 for xxx in $avail_ext; do
22687 case " $dynamic_ext " in
22689 *) dflt="$dflt $xxx" ;;
22696 *) dflt="$static_ext"
22703 rp="What extensions do you wish to load statically?"
22706 none) static_ext=' ' ;;
22707 *) static_ext="$ans" ;;
22712 A number of extensions are supplied with $package. Answer "none"
22713 to include no extensions.
22714 Note that DynaLoader is always built and need not be mentioned here.
22717 case "$static_ext" in
22718 '') dflt="$avail_ext" ;;
22719 *) dflt="$static_ext"
22720 # Perhaps we are reusing an old out-of-date config.sh.
22723 if test X"$static_ext" != X"$avail_ext"; then
22725 NOTICE: Your previous config.sh list may be incorrect.
22726 The extensions now available to you are
22728 but the default list from your previous config.sh is
22737 : Exclude those that are not xs extensions
22741 rp="What extensions do you wish to include?"
22744 none) static_ext=' ' ;;
22745 *) static_ext="$ans" ;;
22750 # Encode is a special case. If we are building Encode as a static
22751 # extension, we need to explicitly list its subextensions as well.
22752 # For other nested extensions, this is handled automatically by
22753 # the appropriate Makefile.PL.
22754 case " $static_ext " in
22755 *" Encode "*) # Add the subextensions of Encode
22757 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22758 static_ext="$static_ext Encode/$xxx"
22764 set X $dynamic_ext $static_ext $nonxs_ext
22768 # Sanity check: We require an extension suitable for use with
22769 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22770 # should show up as failures in the test suite, but it's helpful to
22771 # catch them now.) The 'extensions' list is normally sorted
22772 # alphabetically, so we need to accept either
22773 # DB_File ... Fcntl ... IO ....
22774 # or something like
22775 # Fcntl ... NDBM_File ... IO ....
22776 case " $extensions" in
22777 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22778 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22779 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22780 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22781 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22785 : Remove libraries needed only for extensions
22786 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22787 : The exception is SunOS 4.x, which needs them.
22788 case "${osname}X${osvers}" in
22792 *) case "$usedl" in
22793 $define|true|[yY]*)
22794 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22798 *) perllibs="$libs"
22804 : Remove build directory name from cppstdin so it can be used from
22805 : either the present location or the final installed location.
22807 : Get out of the UU directory to get correct path name.
22809 case "$cppstdin" in
22811 echo "Stripping down cppstdin path name"
22817 : end of configuration questions
22819 echo "End of configuration questions."
22822 : back to where it started
22823 if test -d ../UU; then
22827 : configuration may be unconditionally patched via a 'config.arch' file
22828 if $test -f config.arch; then
22829 echo "I see a config.arch file, loading it." >&4
22833 : configuration may be patched via a 'config.over' file
22834 if $test -f config.over; then
22837 rp='I see a config.over file. Do you wish to load it?'
22840 n*) echo "OK, I'll ignore it.";;
22842 echo "Configuration override changes have been loaded."
22847 : in case they want portability, strip down executable paths
22848 case "$d_portable" in
22851 echo "Stripping down executable paths..." >&4
22852 for file in $loclist $trylist; do
22854 eval $file=`basename $temp`
22859 : create config.sh file
22861 echo "Creating config.sh..." >&4
22862 $spitshell <<EOT >config.sh
22865 # This file was produced by running the Configure script. It holds all the
22866 # definitions figured out by Configure. Should you modify one of these values,
22867 # do not forget to propagate your changes by running "Configure -der". You may
22868 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22871 # Package name : $package
22872 # Source directory : $src
22873 # Configuration time: $cf_time
22874 # Configured by : $cf_by
22875 # Target system : $myuname
22878 : Add in command line options if available
22879 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22881 $spitshell <<EOT >>config.sh
22890 Revision='$Revision'
22898 alignbytes='$alignbytes'
22899 ansi2knr='$ansi2knr'
22900 aphostname='$aphostname'
22901 api_revision='$api_revision'
22902 api_subversion='$api_subversion'
22903 api_version='$api_version'
22904 api_versionstring='$api_versionstring'
22907 archlibexp='$archlibexp'
22908 archname64='$archname64'
22909 archname='$archname'
22910 archobjs='$archobjs'
22911 asctime_r_proto='$asctime_r_proto'
22919 bootstrap_charset='$bootstrap_charset'
22921 byteorder='$byteorder'
22923 castflags='$castflags'
22926 cccdlflags='$cccdlflags'
22927 ccdlflags='$ccdlflags'
22929 ccflags_uselargefiles='$ccflags_uselargefiles'
22931 ccsymbols='$ccsymbols'
22932 ccversion='$ccversion'
22934 cf_email='$cf_email'
22936 charbits='$charbits'
22937 charsize='$charsize'
22941 clocktype='$clocktype'
22943 compress='$compress'
22944 contains='$contains'
22948 cpp_stuff='$cpp_stuff'
22949 cppccsymbols='$cppccsymbols'
22950 cppflags='$cppflags'
22952 cppminus='$cppminus'
22954 cppstdin='$cppstdin'
22955 cppsymbols='$cppsymbols'
22956 crypt_r_proto='$crypt_r_proto'
22957 cryptlib='$cryptlib'
22959 ctermid_r_proto='$ctermid_r_proto'
22960 ctime_r_proto='$ctime_r_proto'
22961 d_Gconvert='$d_Gconvert'
22962 d_PRIEUldbl='$d_PRIEUldbl'
22963 d_PRIFUldbl='$d_PRIFUldbl'
22964 d_PRIGUldbl='$d_PRIGUldbl'
22965 d_PRIXU64='$d_PRIXU64'
22966 d_PRId64='$d_PRId64'
22967 d_PRIeldbl='$d_PRIeldbl'
22968 d_PRIfldbl='$d_PRIfldbl'
22969 d_PRIgldbl='$d_PRIgldbl'
22970 d_PRIi64='$d_PRIi64'
22971 d_PRIo64='$d_PRIo64'
22972 d_PRIu64='$d_PRIu64'
22973 d_PRIx64='$d_PRIx64'
22974 d_SCNfldbl='$d_SCNfldbl'
22975 d__fwalk='$d__fwalk'
22976 d_access='$d_access'
22977 d_accessx='$d_accessx'
22980 d_archlib='$d_archlib'
22981 d_asctime64='$d_asctime64'
22982 d_asctime_r='$d_asctime_r'
22985 d_attribute_deprecated='$d_attribute_deprecated'
22986 d_attribute_format='$d_attribute_format'
22987 d_attribute_malloc='$d_attribute_malloc'
22988 d_attribute_nonnull='$d_attribute_nonnull'
22989 d_attribute_noreturn='$d_attribute_noreturn'
22990 d_attribute_pure='$d_attribute_pure'
22991 d_attribute_unused='$d_attribute_unused'
22992 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22996 d_bsdgetpgrp='$d_bsdgetpgrp'
22997 d_bsdsetpgrp='$d_bsdsetpgrp'
22998 d_builtin_choose_expr='$d_builtin_choose_expr'
22999 d_builtin_expect='$d_builtin_expect'
23001 d_c99_variadic_macros='$d_c99_variadic_macros'
23002 d_casti32='$d_casti32'
23003 d_castneg='$d_castneg'
23004 d_charvspr='$d_charvspr'
23006 d_chroot='$d_chroot'
23007 d_chsize='$d_chsize'
23009 d_clearenv='$d_clearenv'
23010 d_closedir='$d_closedir'
23011 d_cmsghdr_s='$d_cmsghdr_s'
23013 d_copysignl='$d_copysignl'
23014 d_cplusplus='$d_cplusplus'
23016 d_crypt_r='$d_crypt_r'
23018 d_ctermid='$d_ctermid'
23019 d_ctermid_r='$d_ctermid_r'
23020 d_ctime64='$d_ctime64'
23021 d_ctime_r='$d_ctime_r'
23022 d_cuserid='$d_cuserid'
23023 d_dbl_dig='$d_dbl_dig'
23024 d_dbminitproto='$d_dbminitproto'
23025 d_difftime64='$d_difftime64'
23026 d_difftime='$d_difftime'
23027 d_dir_dd_fd='$d_dir_dd_fd'
23029 d_dirnamlen='$d_dirnamlen'
23030 d_dlerror='$d_dlerror'
23031 d_dlopen='$d_dlopen'
23032 d_dlsymun='$d_dlsymun'
23033 d_dosuid='$d_dosuid'
23034 d_drand48_r='$d_drand48_r'
23035 d_drand48proto='$d_drand48proto'
23037 d_eaccess='$d_eaccess'
23038 d_endgrent='$d_endgrent'
23039 d_endgrent_r='$d_endgrent_r'
23040 d_endhent='$d_endhent'
23041 d_endhostent_r='$d_endhostent_r'
23042 d_endnent='$d_endnent'
23043 d_endnetent_r='$d_endnetent_r'
23044 d_endpent='$d_endpent'
23045 d_endprotoent_r='$d_endprotoent_r'
23046 d_endpwent='$d_endpwent'
23047 d_endpwent_r='$d_endpwent_r'
23048 d_endsent='$d_endsent'
23049 d_endservent_r='$d_endservent_r'
23050 d_eofnblk='$d_eofnblk'
23051 d_eunice='$d_eunice'
23052 d_faststdio='$d_faststdio'
23053 d_fchdir='$d_fchdir'
23054 d_fchmod='$d_fchmod'
23055 d_fchown='$d_fchown'
23057 d_fcntl_can_lock='$d_fcntl_can_lock'
23058 d_fd_macros='$d_fd_macros'
23059 d_fd_set='$d_fd_set'
23060 d_fds_bits='$d_fds_bits'
23061 d_fgetpos='$d_fgetpos'
23062 d_finite='$d_finite'
23063 d_finitel='$d_finitel'
23064 d_flexfnam='$d_flexfnam'
23066 d_flockproto='$d_flockproto'
23068 d_fp_class='$d_fp_class'
23069 d_fpathconf='$d_fpathconf'
23070 d_fpclass='$d_fpclass'
23071 d_fpclassify='$d_fpclassify'
23072 d_fpclassl='$d_fpclassl'
23073 d_fpos64_t='$d_fpos64_t'
23074 d_frexpl='$d_frexpl'
23075 d_fs_data_s='$d_fs_data_s'
23076 d_fseeko='$d_fseeko'
23077 d_fsetpos='$d_fsetpos'
23078 d_fstatfs='$d_fstatfs'
23079 d_fstatvfs='$d_fstatvfs'
23081 d_ftello='$d_ftello'
23083 d_futimes='$d_futimes'
23084 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23085 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23086 d_getaddrinfo='$d_getaddrinfo'
23087 d_getcwd='$d_getcwd'
23088 d_getespwnam='$d_getespwnam'
23089 d_getfsstat='$d_getfsstat'
23090 d_getgrent='$d_getgrent'
23091 d_getgrent_r='$d_getgrent_r'
23092 d_getgrgid_r='$d_getgrgid_r'
23093 d_getgrnam_r='$d_getgrnam_r'
23094 d_getgrps='$d_getgrps'
23095 d_gethbyaddr='$d_gethbyaddr'
23096 d_gethbyname='$d_gethbyname'
23097 d_gethent='$d_gethent'
23098 d_gethname='$d_gethname'
23099 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23100 d_gethostbyname_r='$d_gethostbyname_r'
23101 d_gethostent_r='$d_gethostent_r'
23102 d_gethostprotos='$d_gethostprotos'
23103 d_getitimer='$d_getitimer'
23104 d_getlogin='$d_getlogin'
23105 d_getlogin_r='$d_getlogin_r'
23106 d_getmnt='$d_getmnt'
23107 d_getmntent='$d_getmntent'
23108 d_getnameinfo='$d_getnameinfo'
23109 d_getnbyaddr='$d_getnbyaddr'
23110 d_getnbyname='$d_getnbyname'
23111 d_getnent='$d_getnent'
23112 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23113 d_getnetbyname_r='$d_getnetbyname_r'
23114 d_getnetent_r='$d_getnetent_r'
23115 d_getnetprotos='$d_getnetprotos'
23116 d_getpagsz='$d_getpagsz'
23117 d_getpbyname='$d_getpbyname'
23118 d_getpbynumber='$d_getpbynumber'
23119 d_getpent='$d_getpent'
23120 d_getpgid='$d_getpgid'
23121 d_getpgrp2='$d_getpgrp2'
23122 d_getpgrp='$d_getpgrp'
23123 d_getppid='$d_getppid'
23124 d_getprior='$d_getprior'
23125 d_getprotobyname_r='$d_getprotobyname_r'
23126 d_getprotobynumber_r='$d_getprotobynumber_r'
23127 d_getprotoent_r='$d_getprotoent_r'
23128 d_getprotoprotos='$d_getprotoprotos'
23129 d_getprpwnam='$d_getprpwnam'
23130 d_getpwent='$d_getpwent'
23131 d_getpwent_r='$d_getpwent_r'
23132 d_getpwnam_r='$d_getpwnam_r'
23133 d_getpwuid_r='$d_getpwuid_r'
23134 d_getsbyname='$d_getsbyname'
23135 d_getsbyport='$d_getsbyport'
23136 d_getsent='$d_getsent'
23137 d_getservbyname_r='$d_getservbyname_r'
23138 d_getservbyport_r='$d_getservbyport_r'
23139 d_getservent_r='$d_getservent_r'
23140 d_getservprotos='$d_getservprotos'
23141 d_getspnam='$d_getspnam'
23142 d_getspnam_r='$d_getspnam_r'
23143 d_gettimeod='$d_gettimeod'
23144 d_gmtime64='$d_gmtime64'
23145 d_gmtime_r='$d_gmtime_r'
23146 d_gnulibc='$d_gnulibc'
23147 d_grpasswd='$d_grpasswd'
23148 d_hasmntopt='$d_hasmntopt'
23150 d_ilogbl='$d_ilogbl'
23151 d_inc_version_list='$d_inc_version_list'
23153 d_inetaton='$d_inetaton'
23154 d_inetntop='$d_inetntop'
23155 d_inetpton='$d_inetpton'
23156 d_int64_t='$d_int64_t'
23157 d_ip_mreq='$d_ip_mreq'
23158 d_ip_mreq_source='$d_ip_mreq_source'
23159 d_ipv6_mreq='$d_ipv6_mreq'
23160 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23161 d_isascii='$d_isascii'
23162 d_isblank='$d_isblank'
23163 d_isfinite='$d_isfinite'
23166 d_isnanl='$d_isnanl'
23167 d_killpg='$d_killpg'
23168 d_lchown='$d_lchown'
23169 d_ldbl_dig='$d_ldbl_dig'
23170 d_libm_lib_version='$d_libm_lib_version'
23172 d_localtime64='$d_localtime64'
23173 d_localtime_r='$d_localtime_r'
23174 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23175 d_locconv='$d_locconv'
23177 d_longdbl='$d_longdbl'
23178 d_longlong='$d_longlong'
23179 d_lseekproto='$d_lseekproto'
23181 d_madvise='$d_madvise'
23182 d_malloc_good_size='$d_malloc_good_size'
23183 d_malloc_size='$d_malloc_size'
23185 d_mbstowcs='$d_mbstowcs'
23186 d_mbtowc='$d_mbtowc'
23187 d_memchr='$d_memchr'
23188 d_memcmp='$d_memcmp'
23189 d_memcpy='$d_memcpy'
23190 d_memmove='$d_memmove'
23191 d_memset='$d_memset'
23193 d_mkdtemp='$d_mkdtemp'
23194 d_mkfifo='$d_mkfifo'
23195 d_mkstemp='$d_mkstemp'
23196 d_mkstemps='$d_mkstemps'
23197 d_mktime64='$d_mktime64'
23198 d_mktime='$d_mktime'
23201 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23202 d_modflproto='$d_modflproto'
23203 d_mprotect='$d_mprotect'
23205 d_msg_ctrunc='$d_msg_ctrunc'
23206 d_msg_dontroute='$d_msg_dontroute'
23207 d_msg_oob='$d_msg_oob'
23208 d_msg_peek='$d_msg_peek'
23209 d_msg_proxy='$d_msg_proxy'
23210 d_msgctl='$d_msgctl'
23211 d_msgget='$d_msgget'
23212 d_msghdr_s='$d_msghdr_s'
23213 d_msgrcv='$d_msgrcv'
23214 d_msgsnd='$d_msgsnd'
23216 d_munmap='$d_munmap'
23217 d_mymalloc='$d_mymalloc'
23219 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23221 d_nl_langinfo='$d_nl_langinfo'
23222 d_nv_preserves_uv='$d_nv_preserves_uv'
23223 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23224 d_off64_t='$d_off64_t'
23225 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23226 d_oldpthreads='$d_oldpthreads'
23227 d_oldsock='$d_oldsock'
23229 d_pathconf='$d_pathconf'
23231 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23232 d_phostname='$d_phostname'
23235 d_portable='$d_portable'
23237 d_prctl_set_name='$d_prctl_set_name'
23238 d_printf_format_null='$d_printf_format_null'
23239 d_procselfexe='$d_procselfexe'
23240 d_pseudofork='$d_pseudofork'
23241 d_pthread_atfork='$d_pthread_atfork'
23242 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23243 d_pthread_yield='$d_pthread_yield'
23245 d_pwchange='$d_pwchange'
23246 d_pwclass='$d_pwclass'
23247 d_pwcomment='$d_pwcomment'
23248 d_pwexpire='$d_pwexpire'
23249 d_pwgecos='$d_pwgecos'
23250 d_pwpasswd='$d_pwpasswd'
23251 d_pwquota='$d_pwquota'
23254 d_random_r='$d_random_r'
23255 d_readdir64_r='$d_readdir64_r'
23256 d_readdir='$d_readdir'
23257 d_readdir_r='$d_readdir_r'
23258 d_readlink='$d_readlink'
23260 d_recvmsg='$d_recvmsg'
23261 d_rename='$d_rename'
23262 d_rewinddir='$d_rewinddir'
23264 d_safebcpy='$d_safebcpy'
23265 d_safemcpy='$d_safemcpy'
23266 d_sanemcmp='$d_sanemcmp'
23267 d_sbrkproto='$d_sbrkproto'
23268 d_scalbnl='$d_scalbnl'
23269 d_sched_yield='$d_sched_yield'
23270 d_scm_rights='$d_scm_rights'
23271 d_seekdir='$d_seekdir'
23272 d_select='$d_select'
23274 d_semctl='$d_semctl'
23275 d_semctl_semid_ds='$d_semctl_semid_ds'
23276 d_semctl_semun='$d_semctl_semun'
23277 d_semget='$d_semget'
23279 d_sendmsg='$d_sendmsg'
23280 d_setegid='$d_setegid'
23281 d_seteuid='$d_seteuid'
23282 d_setgrent='$d_setgrent'
23283 d_setgrent_r='$d_setgrent_r'
23284 d_setgrps='$d_setgrps'
23285 d_sethent='$d_sethent'
23286 d_sethostent_r='$d_sethostent_r'
23287 d_setitimer='$d_setitimer'
23288 d_setlinebuf='$d_setlinebuf'
23289 d_setlocale='$d_setlocale'
23290 d_setlocale_r='$d_setlocale_r'
23291 d_setnent='$d_setnent'
23292 d_setnetent_r='$d_setnetent_r'
23293 d_setpent='$d_setpent'
23294 d_setpgid='$d_setpgid'
23295 d_setpgrp2='$d_setpgrp2'
23296 d_setpgrp='$d_setpgrp'
23297 d_setprior='$d_setprior'
23298 d_setproctitle='$d_setproctitle'
23299 d_setprotoent_r='$d_setprotoent_r'
23300 d_setpwent='$d_setpwent'
23301 d_setpwent_r='$d_setpwent_r'
23302 d_setregid='$d_setregid'
23303 d_setresgid='$d_setresgid'
23304 d_setresuid='$d_setresuid'
23305 d_setreuid='$d_setreuid'
23306 d_setrgid='$d_setrgid'
23307 d_setruid='$d_setruid'
23308 d_setsent='$d_setsent'
23309 d_setservent_r='$d_setservent_r'
23310 d_setsid='$d_setsid'
23311 d_setvbuf='$d_setvbuf'
23315 d_shmatprototype='$d_shmatprototype'
23316 d_shmctl='$d_shmctl'
23318 d_shmget='$d_shmget'
23319 d_sigaction='$d_sigaction'
23320 d_signbit='$d_signbit'
23321 d_sigprocmask='$d_sigprocmask'
23322 d_sigsetjmp='$d_sigsetjmp'
23323 d_sin6_scope_id='$d_sin6_scope_id'
23324 d_sitearch='$d_sitearch'
23325 d_snprintf='$d_snprintf'
23326 d_sockaddr_in6='$d_sockaddr_in6'
23327 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23328 d_sockatmark='$d_sockatmark'
23329 d_sockatmarkproto='$d_sockatmarkproto'
23330 d_socket='$d_socket'
23331 d_socklen_t='$d_socklen_t'
23332 d_sockpair='$d_sockpair'
23333 d_socks5_init='$d_socks5_init'
23334 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23336 d_srand48_r='$d_srand48_r'
23337 d_srandom_r='$d_srandom_r'
23338 d_sresgproto='$d_sresgproto'
23339 d_sresuproto='$d_sresuproto'
23340 d_statblks='$d_statblks'
23341 d_statfs_f_flags='$d_statfs_f_flags'
23342 d_statfs_s='$d_statfs_s'
23343 d_static_inline='$d_static_inline'
23344 d_statvfs='$d_statvfs'
23345 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23346 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23347 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23348 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23349 d_stdio_stream_array='$d_stdio_stream_array'
23350 d_stdiobase='$d_stdiobase'
23351 d_stdstdio='$d_stdstdio'
23352 d_strchr='$d_strchr'
23353 d_strcoll='$d_strcoll'
23354 d_strctcpy='$d_strctcpy'
23355 d_strerrm='$d_strerrm'
23356 d_strerror='$d_strerror'
23357 d_strerror_r='$d_strerror_r'
23358 d_strftime='$d_strftime'
23359 d_strlcat='$d_strlcat'
23360 d_strlcpy='$d_strlcpy'
23361 d_strtod='$d_strtod'
23362 d_strtol='$d_strtol'
23363 d_strtold='$d_strtold'
23364 d_strtoll='$d_strtoll'
23365 d_strtoq='$d_strtoq'
23366 d_strtoul='$d_strtoul'
23367 d_strtoull='$d_strtoull'
23368 d_strtouq='$d_strtouq'
23369 d_strxfrm='$d_strxfrm'
23370 d_suidsafe='$d_suidsafe'
23371 d_symlink='$d_symlink'
23372 d_syscall='$d_syscall'
23373 d_syscallproto='$d_syscallproto'
23374 d_sysconf='$d_sysconf'
23375 d_sysernlst='$d_sysernlst'
23376 d_syserrlst='$d_syserrlst'
23377 d_system='$d_system'
23378 d_tcgetpgrp='$d_tcgetpgrp'
23379 d_tcsetpgrp='$d_tcsetpgrp'
23380 d_telldir='$d_telldir'
23381 d_telldirproto='$d_telldirproto'
23383 d_timegm='$d_timegm'
23385 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23386 d_tm_tm_zone='$d_tm_tm_zone'
23387 d_tmpnam_r='$d_tmpnam_r'
23388 d_truncate='$d_truncate'
23389 d_ttyname_r='$d_ttyname_r'
23390 d_tzname='$d_tzname'
23391 d_u32align='$d_u32align'
23392 d_ualarm='$d_ualarm'
23395 d_union_semun='$d_union_semun'
23396 d_unordered='$d_unordered'
23397 d_unsetenv='$d_unsetenv'
23398 d_usleep='$d_usleep'
23399 d_usleepproto='$d_usleepproto'
23401 d_vendorarch='$d_vendorarch'
23402 d_vendorbin='$d_vendorbin'
23403 d_vendorlib='$d_vendorlib'
23404 d_vendorscript='$d_vendorscript'
23406 d_void_closedir='$d_void_closedir'
23407 d_voidsig='$d_voidsig'
23408 d_voidtty='$d_voidtty'
23409 d_volatile='$d_volatile'
23410 d_vprintf='$d_vprintf'
23411 d_vsnprintf='$d_vsnprintf'
23413 d_waitpid='$d_waitpid'
23414 d_wcstombs='$d_wcstombs'
23415 d_wctomb='$d_wctomb'
23416 d_writev='$d_writev'
23419 db_hashtype='$db_hashtype'
23420 db_prefixtype='$db_prefixtype'
23421 db_version_major='$db_version_major'
23422 db_version_minor='$db_version_minor'
23423 db_version_patch='$db_version_patch'
23424 defvoidused='$defvoidused'
23425 direntrytype='$direntrytype'
23428 doublesize='$doublesize'
23430 drand48_r_proto='$drand48_r_proto'
23432 dynamic_ext='$dynamic_ext'
23438 endgrent_r_proto='$endgrent_r_proto'
23439 endhostent_r_proto='$endhostent_r_proto'
23440 endnetent_r_proto='$endnetent_r_proto'
23441 endprotoent_r_proto='$endprotoent_r_proto'
23442 endpwent_r_proto='$endpwent_r_proto'
23443 endservent_r_proto='$endservent_r_proto'
23444 eunicefix='$eunicefix'
23447 extensions='$extensions'
23448 extern_C='$extern_C'
23450 fflushNULL='$fflushNULL'
23451 fflushall='$fflushall'
23453 firstmakefile='$firstmakefile'
23455 fpossize='$fpossize'
23456 fpostype='$fpostype'
23457 freetype='$freetype'
23460 full_csh='$full_csh'
23461 full_sed='$full_sed'
23462 gccansipedantic='$gccansipedantic'
23463 gccosandvers='$gccosandvers'
23464 gccversion='$gccversion'
23465 getgrent_r_proto='$getgrent_r_proto'
23466 getgrgid_r_proto='$getgrgid_r_proto'
23467 getgrnam_r_proto='$getgrnam_r_proto'
23468 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23469 gethostbyname_r_proto='$gethostbyname_r_proto'
23470 gethostent_r_proto='$gethostent_r_proto'
23471 getlogin_r_proto='$getlogin_r_proto'
23472 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23473 getnetbyname_r_proto='$getnetbyname_r_proto'
23474 getnetent_r_proto='$getnetent_r_proto'
23475 getprotobyname_r_proto='$getprotobyname_r_proto'
23476 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23477 getprotoent_r_proto='$getprotoent_r_proto'
23478 getpwent_r_proto='$getpwent_r_proto'
23479 getpwnam_r_proto='$getpwnam_r_proto'
23480 getpwuid_r_proto='$getpwuid_r_proto'
23481 getservbyname_r_proto='$getservbyname_r_proto'
23482 getservbyport_r_proto='$getservbyport_r_proto'
23483 getservent_r_proto='$getservent_r_proto'
23484 getspnam_r_proto='$getspnam_r_proto'
23485 gidformat='$gidformat'
23491 gmtime_r_proto='$gmtime_r_proto'
23492 gnulibc_version='$gnulibc_version'
23494 groupcat='$groupcat'
23495 groupstype='$groupstype'
23498 h_sysfile='$h_sysfile'
23501 html1dir='$html1dir'
23502 html1direxp='$html1direxp'
23503 html3dir='$html3dir'
23504 html3direxp='$html3direxp'
23513 i_arpainet='$i_arpainet'
23514 i_assert='$i_assert'
23515 i_bsdioctl='$i_bsdioctl'
23519 i_dirent='$i_dirent'
23525 i_fp_class='$i_fp_class'
23527 i_gdbm_ndbm='$i_gdbm_ndbm'
23528 i_gdbmndbm='$i_gdbmndbm'
23530 i_ieeefp='$i_ieeefp'
23531 i_inttypes='$i_inttypes'
23532 i_langinfo='$i_langinfo'
23533 i_libutil='$i_libutil'
23534 i_limits='$i_limits'
23535 i_locale='$i_locale'
23536 i_machcthr='$i_machcthr'
23537 i_malloc='$i_malloc'
23538 i_mallocmalloc='$i_mallocmalloc'
23540 i_memory='$i_memory'
23541 i_mntent='$i_mntent'
23544 i_neterrno='$i_neterrno'
23545 i_netinettcp='$i_netinettcp'
23549 i_pthread='$i_pthread'
23551 i_rpcsvcdbm='$i_rpcsvcdbm'
23554 i_shadow='$i_shadow'
23556 i_stdarg='$i_stdarg'
23557 i_stdbool='$i_stdbool'
23558 i_stddef='$i_stddef'
23559 i_stdlib='$i_stdlib'
23560 i_string='$i_string'
23561 i_sunmath='$i_sunmath'
23562 i_sysaccess='$i_sysaccess'
23563 i_sysdir='$i_sysdir'
23564 i_sysfile='$i_sysfile'
23565 i_sysfilio='$i_sysfilio'
23567 i_sysioctl='$i_sysioctl'
23568 i_syslog='$i_syslog'
23569 i_sysmman='$i_sysmman'
23570 i_sysmode='$i_sysmode'
23571 i_sysmount='$i_sysmount'
23572 i_sysndir='$i_sysndir'
23573 i_sysparam='$i_sysparam'
23574 i_syspoll='$i_syspoll'
23575 i_sysresrc='$i_sysresrc'
23576 i_syssecrt='$i_syssecrt'
23577 i_sysselct='$i_sysselct'
23578 i_syssockio='$i_syssockio'
23579 i_sysstat='$i_sysstat'
23580 i_sysstatfs='$i_sysstatfs'
23581 i_sysstatvfs='$i_sysstatvfs'
23582 i_systime='$i_systime'
23583 i_systimek='$i_systimek'
23584 i_systimes='$i_systimes'
23585 i_systypes='$i_systypes'
23586 i_sysuio='$i_sysuio'
23588 i_sysutsname='$i_sysutsname'
23589 i_sysvfs='$i_sysvfs'
23590 i_syswait='$i_syswait'
23591 i_termio='$i_termio'
23592 i_termios='$i_termios'
23594 i_unistd='$i_unistd'
23597 i_values='$i_values'
23598 i_varargs='$i_varargs'
23599 i_varhdr='$i_varhdr'
23601 ignore_versioned_solibs='$ignore_versioned_solibs'
23602 inc_version_list='$inc_version_list'
23603 inc_version_list_init='$inc_version_list_init'
23606 initialinstalllocation='$initialinstalllocation'
23607 installarchlib='$installarchlib'
23608 installbin='$installbin'
23609 installhtml1dir='$installhtml1dir'
23610 installhtml3dir='$installhtml3dir'
23611 installman1dir='$installman1dir'
23612 installman3dir='$installman3dir'
23613 installprefix='$installprefix'
23614 installprefixexp='$installprefixexp'
23615 installprivlib='$installprivlib'
23616 installscript='$installscript'
23617 installsitearch='$installsitearch'
23618 installsitebin='$installsitebin'
23619 installsitehtml1dir='$installsitehtml1dir'
23620 installsitehtml3dir='$installsitehtml3dir'
23621 installsitelib='$installsitelib'
23622 installsiteman1dir='$installsiteman1dir'
23623 installsiteman3dir='$installsiteman3dir'
23624 installsitescript='$installsitescript'
23625 installstyle='$installstyle'
23626 installusrbinperl='$installusrbinperl'
23627 installvendorarch='$installvendorarch'
23628 installvendorbin='$installvendorbin'
23629 installvendorhtml1dir='$installvendorhtml1dir'
23630 installvendorhtml3dir='$installvendorhtml3dir'
23631 installvendorlib='$installvendorlib'
23632 installvendorman1dir='$installvendorman1dir'
23633 installvendorman3dir='$installvendorman3dir'
23634 installvendorscript='$installvendorscript'
23636 issymlink='$issymlink'
23637 ivdformat='$ivdformat'
23640 known_extensions='$known_extensions'
23643 ld_can_script='$ld_can_script'
23644 lddlflags='$lddlflags'
23646 ldflags_uselargefiles='$ldflags_uselargefiles'
23647 ldlibpthname='$ldlibpthname'
23654 libsdirs='$libsdirs'
23655 libsfiles='$libsfiles'
23656 libsfound='$libsfound'
23657 libspath='$libspath'
23658 libswanted='$libswanted'
23659 libswanted_uselargefiles='$libswanted_uselargefiles'
23665 localtime_r_proto='$localtime_r_proto'
23666 locincpth='$locincpth'
23667 loclibpth='$loclibpth'
23668 longdblsize='$longdblsize'
23669 longlongsize='$longlongsize'
23670 longsize='$longsize'
23674 lseeksize='$lseeksize'
23675 lseektype='$lseektype'
23678 madlyobj='$madlyobj'
23679 madlysrc='$madlysrc'
23683 make_set_make='$make_set_make'
23684 mallocobj='$mallocobj'
23685 mallocsrc='$mallocsrc'
23686 malloctype='$malloctype'
23688 man1direxp='$man1direxp'
23691 man3direxp='$man3direxp'
23693 mips_type='$mips_type'
23694 mistrustnm='$mistrustnm'
23696 mmaptype='$mmaptype'
23697 modetype='$modetype'
23699 multiarch='$multiarch'
23701 myarchname='$myarchname'
23702 mydomain='$mydomain'
23703 myhostname='$myhostname'
23706 need_va_copy='$need_va_copy'
23707 netdb_hlen_type='$netdb_hlen_type'
23708 netdb_host_type='$netdb_host_type'
23709 netdb_name_type='$netdb_name_type'
23710 netdb_net_type='$netdb_net_type'
23713 nm_so_opt='$nm_so_opt'
23714 nonxs_ext='$nonxs_ext'
23716 nvEUformat='$nvEUformat'
23717 nvFUformat='$nvFUformat'
23718 nvGUformat='$nvGUformat'
23719 nv_overflows_integers_at='$nv_overflows_integers_at'
23720 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23721 nveformat='$nveformat'
23722 nvfformat='$nvfformat'
23723 nvgformat='$nvgformat'
23726 o_nonblock='$o_nonblock'
23728 old_pthread_create_joinable='$old_pthread_create_joinable'
23729 optimize='$optimize'
23730 orderlib='$orderlib'
23733 otherlibdirs='$otherlibdirs'
23737 patchlevel='$patchlevel'
23738 path_sep='$path_sep'
23741 perl_patchlevel='$perl_patchlevel'
23742 perl_static_inline='$perl_static_inline'
23743 perladmin='$perladmin'
23744 perllibs='$perllibs'
23745 perlpath='$perlpath'
23747 phostname='$phostname'
23753 prefixexp='$prefixexp'
23755 privlibexp='$privlibexp'
23756 procselfexe='$procselfexe'
23757 prototype='$prototype'
23759 quadkind='$quadkind'
23760 quadtype='$quadtype'
23761 randbits='$randbits'
23762 randfunc='$randfunc'
23763 random_r_proto='$random_r_proto'
23764 randseedtype='$randseedtype'
23766 rd_nodata='$rd_nodata'
23767 readdir64_r_proto='$readdir64_r_proto'
23768 readdir_r_proto='$readdir_r_proto'
23769 revision='$revision'
23775 sGMTIME_max='$sGMTIME_max'
23776 sGMTIME_min='$sGMTIME_min'
23777 sLOCALTIME_max='$sLOCALTIME_max'
23778 sLOCALTIME_min='$sLOCALTIME_min'
23779 sPRIEUldbl='$sPRIEUldbl'
23780 sPRIFUldbl='$sPRIFUldbl'
23781 sPRIGUldbl='$sPRIGUldbl'
23782 sPRIXU64='$sPRIXU64'
23784 sPRIeldbl='$sPRIeldbl'
23785 sPRIfldbl='$sPRIfldbl'
23786 sPRIgldbl='$sPRIgldbl'
23791 sSCNfldbl='$sSCNfldbl'
23792 sched_yield='$sched_yield'
23793 scriptdir='$scriptdir'
23794 scriptdirexp='$scriptdirexp'
23796 seedfunc='$seedfunc'
23797 selectminbits='$selectminbits'
23798 selecttype='$selecttype'
23799 sendmail='$sendmail'
23800 setgrent_r_proto='$setgrent_r_proto'
23801 sethostent_r_proto='$sethostent_r_proto'
23802 setlocale_r_proto='$setlocale_r_proto'
23803 setnetent_r_proto='$setnetent_r_proto'
23804 setprotoent_r_proto='$setprotoent_r_proto'
23805 setpwent_r_proto='$setpwent_r_proto'
23806 setservent_r_proto='$setservent_r_proto'
23809 sharpbang='$sharpbang'
23810 shmattype='$shmattype'
23811 shortsize='$shortsize'
23814 sig_count='$sig_count'
23815 sig_name='$sig_name'
23816 sig_name_init='$sig_name_init'
23818 sig_num_init='$sig_num_init'
23819 sig_size='$sig_size'
23820 signal_t='$signal_t'
23821 sitearch='$sitearch'
23822 sitearchexp='$sitearchexp'
23824 sitebinexp='$sitebinexp'
23825 sitehtml1dir='$sitehtml1dir'
23826 sitehtml1direxp='$sitehtml1direxp'
23827 sitehtml3dir='$sitehtml3dir'
23828 sitehtml3direxp='$sitehtml3direxp'
23830 sitelib_stem='$sitelib_stem'
23831 sitelibexp='$sitelibexp'
23832 siteman1dir='$siteman1dir'
23833 siteman1direxp='$siteman1direxp'
23834 siteman3dir='$siteman3dir'
23835 siteman3direxp='$siteman3direxp'
23836 siteprefix='$siteprefix'
23837 siteprefixexp='$siteprefixexp'
23838 sitescript='$sitescript'
23839 sitescriptexp='$sitescriptexp'
23840 sizesize='$sizesize'
23841 sizetype='$sizetype'
23845 sockethdr='$sockethdr'
23846 socketlib='$socketlib'
23847 socksizetype='$socksizetype'
23849 spackage='$spackage'
23850 spitshell='$spitshell'
23851 srand48_r_proto='$srand48_r_proto'
23852 srandom_r_proto='$srandom_r_proto'
23854 ssizetype='$ssizetype'
23855 st_ino_sign='$st_ino_sign'
23856 st_ino_size='$st_ino_size'
23857 startperl='$startperl'
23859 static_ext='$static_ext'
23861 stdio_base='$stdio_base'
23862 stdio_bufsiz='$stdio_bufsiz'
23863 stdio_cnt='$stdio_cnt'
23864 stdio_filbuf='$stdio_filbuf'
23865 stdio_ptr='$stdio_ptr'
23866 stdio_stream_array='$stdio_stream_array'
23867 strerror_r_proto='$strerror_r_proto'
23870 subversion='$subversion'
23874 targetarch='$targetarch'
23878 timeincl='$timeincl'
23879 timetype='$timetype'
23880 tmpnam_r_proto='$tmpnam_r_proto'
23886 ttyname_r_proto='$ttyname_r_proto'
23895 uidformat='$uidformat'
23901 uquadtype='$uquadtype'
23902 use5005threads='$use5005threads'
23903 use64bitall='$use64bitall'
23904 use64bitint='$use64bitint'
23905 usecrosscompile='$usecrosscompile'
23906 usedevel='$usedevel'
23908 usedtrace='$usedtrace'
23909 usefaststdio='$usefaststdio'
23910 useithreads='$useithreads'
23911 usekernprocpathname='$usekernprocpathname'
23912 uselargefiles='$uselargefiles'
23913 uselongdouble='$uselongdouble'
23914 usemallocwrap='$usemallocwrap'
23915 usemorebits='$usemorebits'
23916 usemultiplicity='$usemultiplicity'
23917 usemymalloc='$usemymalloc'
23919 usensgetexecutablepath='$usensgetexecutablepath'
23920 useopcode='$useopcode'
23921 useperlio='$useperlio'
23922 useposix='$useposix'
23923 usereentrant='$usereentrant'
23924 userelocatableinc='$userelocatableinc'
23926 useshrplib='$useshrplib'
23927 usesitecustomize='$usesitecustomize'
23928 usesocks='$usesocks'
23929 usethreads='$usethreads'
23930 usevendorprefix='$usevendorprefix'
23931 useversionedarchname='$useversionedarchname'
23932 usevfork='$usevfork'
23935 uvXUformat='$uvXUformat'
23936 uvoformat='$uvoformat'
23939 uvuformat='$uvuformat'
23940 uvxformat='$uvxformat'
23942 vendorarch='$vendorarch'
23943 vendorarchexp='$vendorarchexp'
23944 vendorbin='$vendorbin'
23945 vendorbinexp='$vendorbinexp'
23946 vendorhtml1dir='$vendorhtml1dir'
23947 vendorhtml1direxp='$vendorhtml1direxp'
23948 vendorhtml3dir='$vendorhtml3dir'
23949 vendorhtml3direxp='$vendorhtml3direxp'
23950 vendorlib='$vendorlib'
23951 vendorlib_stem='$vendorlib_stem'
23952 vendorlibexp='$vendorlibexp'
23953 vendorman1dir='$vendorman1dir'
23954 vendorman1direxp='$vendorman1direxp'
23955 vendorman3dir='$vendorman3dir'
23956 vendorman3direxp='$vendorman3direxp'
23957 vendorprefix='$vendorprefix'
23958 vendorprefixexp='$vendorprefixexp'
23959 vendorscript='$vendorscript'
23960 vendorscriptexp='$vendorscriptexp'
23962 version_patchlevel_string='$version_patchlevel_string'
23963 versiononly='$versiononly'
23965 voidflags='$voidflags'
23968 yaccflags='$yaccflags'
23973 : add special variables
23974 $test -f $src/patchlevel.h && \
23975 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23976 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23977 echo "PERL_CONFIG_SH=true" >>config.sh
23979 : propagate old symbols
23980 if $test -f UU/config.sh; then
23981 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23982 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23983 config.sh config.sh UU/oldconfig.sh |\
23984 $sort | $uniq -u >UU/oldsyms
23985 set X `$cat UU/oldsyms`
23991 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23993 echo ": Variables propagated from previous config.sh file." >>config.sh
23994 for sym in `$cat UU/oldsyms`; do
23995 echo " Propagating $hint variable "'$'"$sym..."
23996 eval 'tmp="$'"${sym}"'"'
23998 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24004 : Finish up by extracting the .SH files
24008 echo "Extraction done."
24018 If you'd like to make any changes to the config.sh file before I begin
24019 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24022 rp="Press return or use a shell escape to edit config.sh:"
24027 *) : in case they cannot read
24028 sh 1>&4 -c "$ans";;
24033 : if this fails, just run all the .SH files by hand
24042 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24049 Now you need to generate make dependencies by running "$make depend".
24050 You might prefer to run it in background: "$make depend > makedepend.out &"
24051 It can take a while, so you might not want to run it right now.
24056 rp="Run $make depend now?"
24060 $make depend && echo "Now you must run '$make'."
24063 echo "You must run '$make depend' then '$make'."
24066 elif test -f [Mm]akefile; then
24068 echo "Now you must run a $make."
24070 echo "Configure done."
24073 if $test -f Policy.sh; then
24076 If you compile $package on a different machine or from a different object
24077 directory, copy the Policy.sh file from this object directory to the
24078 new one before you run Configure -- this will help you with most of
24079 the policy defaults.
24083 if $test -f config.msg; then
24084 echo "Hmm. I also noted the following information while running:"
24086 $cat config.msg >&4
24089 $rm -f kit*isdone ark*isdone