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 Jul 15 15:52:13 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 offer a form of threading support 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 slightly more memory than plain Perl.
4164 If this doesn't make any sense to you, just accept the default '$dflt'.
4166 rp='Build a threading Perl?'
4169 y|Y) val="$define" ;;
4175 if $test $patchlevel -lt 9; then
4176 case "$usethreads" in
4178 : Default to ithreads unless overridden on command line or with
4181 case "$use5005threads" in
4183 echo "5.005 threads are no longer supported"
4187 case "$useithreads" in
4188 $undef|false|[nN]*) dflt='n';;
4190 rp='Use the newer interpreter-based ithreads?'
4193 y|Y) val="$define" ;;
4198 : Now set use5005threads to the opposite value.
4199 case "$useithreads" in
4200 $define) val="$undef" ;;
4207 useithreads="$undef"
4208 use5005threads="$undef"
4212 case "$useithreads$use5005threads" in
4216 You cannot have both the ithreads and the 5.005 threads enabled
4217 at the same time. Disabling the 5.005 threads since they are
4218 much less stable than the ithreads.
4221 use5005threads="$undef"
4226 : perl-5.9.x and later
4228 if test X"$usethreads" = "X$define"; then
4229 case "$use5005threads" in
4233 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4240 use5005threads="$undef"
4241 useithreads="$usethreads"
4244 case "$d_oldpthreads" in
4245 '') : Configure tests would be welcome here. For now, assume undef.
4247 *) val="$d_oldpthreads" ;;
4253 : Look for a hint-file generated 'call-back-unit'. If the
4254 : user has specified that a threading perl is to be built,
4255 : we may need to set or change some other defaults.
4256 if $test -f usethreads.cbu; then
4257 echo "Your platform has some specific hints regarding threaded builds, using them..."
4260 case "$usethreads" in
4261 "$define"|true|[yY]*)
4263 (Your platform does not have any specific hints for threaded builds.
4264 Assuming POSIX threads, then.)
4270 : Check if multiplicity is required
4273 Perl can be built so that multiple Perl interpreters can coexist
4274 within the same Perl executable.
4277 case "$useithreads" in
4280 This multiple interpreter support is required for interpreter-based threads.
4284 *) case "$usemultiplicity" in
4285 $define|true|[yY]*) dflt='y';;
4289 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4290 rp='Build Perl for multiplicity?'
4293 y|Y) val="$define" ;;
4301 : Check if morebits is requested
4302 case "$usemorebits" in
4303 "$define"|true|[yY]*)
4304 use64bitint="$define"
4305 uselongdouble="$define"
4306 usemorebits="$define"
4308 *) usemorebits="$undef"
4312 : Determine the C compiler to be used
4318 rp="Use which C compiler?"
4322 : See whether they have no cc but they do have gcc
4324 if $test -f cc.cbu; then
4329 : make some quick guesses about what we are up against
4331 $echo $n "Hmm... $c"
4341 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4342 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4344 echo "Looks kind of like an OSF/1 system, but we'll see..."
4346 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4347 xxx=`./loc addbib blurfl $pth`
4348 if $test -f $xxx; then
4349 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4353 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4354 echo "Looks kind of like an extended USG system, but we'll see..."
4356 echo "Looks kind of like a USG system, but we'll see..."
4360 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4361 echo "Looks kind of like a BSD system, but we'll see..."
4365 echo "Looks kind of like a Version 7 system, but we'll see..."
4368 case "$eunicefix" in
4371 There is, however, a strange, musty smell in the air that reminds me of
4372 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4376 : it so happens the Eunice I know will not run shell scripts in Unix format
4380 echo "Congratulations. You aren't running Eunice."
4384 : Detect OS2. The p_ variable is set above in the Head.U unit.
4385 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4386 : semicolon as a patch separator
4391 I have the feeling something is not exactly right, however...don't tell me...
4392 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4393 (Or you may be running DOS with DJGPP.)
4398 if test -f /xenix; then
4399 echo "Actually, this looks more like a XENIX system..."
4404 echo "It's not Xenix..."
4409 if test -f /venix; then
4410 echo "Actually, this looks more like a VENIX system..."
4417 echo "Nor is it Venix..."
4420 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4421 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4424 : Check if we are using GNU gcc and what its version is
4426 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4430 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4432 printf("%s\n", __VERSION__);
4434 printf("%s\n", "1");
4440 if $cc -o try $ccflags $ldflags try.c; then
4441 gccversion=`$run ./try`
4442 case "$gccversion" in
4443 '') echo "You are not using GNU cc." ;;
4444 *) echo "You are using GNU cc $gccversion."
4450 echo "*** WHOA THERE!!! ***" >&4
4451 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4452 case "$knowitall" in
4454 echo " You'd better start hunting for one and let me know about it." >&4
4460 case "$gccversion" in
4461 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4463 case "$gccversion" in
4464 '') gccosandvers='' ;;
4465 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4466 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4468 case "$gccosandvers" in
4469 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4470 $osname$osvers) ;; # looking good
4471 $osname*) cat <<EOM >&4
4473 *** WHOA THERE!!! ***
4475 Your gcc has not been compiled for the exact release of
4476 your operating system ($gccosandvers versus $osname$osvers).
4478 In general it is a good idea to keep gcc synchronized with
4479 the operating system because otherwise serious problems
4480 may ensue when trying to compile software, like Perl.
4482 I'm trying to be optimistic here, though, and will continue.
4483 If later during the configuration and build icky compilation
4484 problems appear (headerfile conflicts being the most common
4485 manifestation), I suggest reinstalling the gcc to match
4486 your operating system release.
4490 *) gccosandvers='' ;; # failed to parse, better be silent
4498 # gcc 3.* complain about adding -Idirectories that they already know about,
4499 # so we will take those off from locincpth.
4500 case "$gccversion" in
4502 echo "main(){}">try.c
4503 for incdir in $locincpth; do
4504 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4505 grep '^c[cp]p*[01]: warning: changing search order '`
4506 if test "X$warn" != X; then
4507 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4513 : What should the include directory be ?
4515 $echo $n "Hmm... $c"
4519 if $test -f /bin/mips && /bin/mips; then
4520 echo "Looks like a MIPS system..."
4521 $cat >usr.c <<'EOCP'
4522 #ifdef SYSTYPE_BSD43
4526 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4527 dflt='/bsd43/usr/include'
4531 mips_type='System V'
4533 $rm -f usr.c usr.out
4534 echo "and you're compiling with the $mips_type compiler and libraries."
4538 echo "Doesn't look like a MIPS system."
4548 case "$xxx_prompt" in
4551 rp='Where are the include files you want to use?'
4559 : see how we invoke the C preprocessor
4561 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4562 cat <<'EOT' >testcpp.c
4568 if test ! -f cppstdin; then
4569 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4570 # AIX cc -E doesn't show the absolute headerfile
4571 # locations but we'll cheat by using the -M flag.
4572 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
4574 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4577 echo "Keeping your $hint cppstdin wrapper."
4580 wrapper=`pwd`/cppstdin
4584 if $test "X$cppstdin" != "X" && \
4585 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4586 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4588 echo "You used to use $cppstdin $cppminus so we'll use that again."
4590 '') echo "But let's see if we can live without a wrapper..." ;;
4592 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4593 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4595 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4598 echo "(However, $cpprun $cpplast does not work, let's see...)"
4606 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4613 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4614 $cc -E <testcpp.c >testcpp.out 2>&1; \
4615 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4616 echo "Yup, it does."
4619 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4620 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4621 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4622 echo "Yup, it does."
4625 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4626 $cc -P <testcpp.c >testcpp.out 2>&1; \
4627 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4628 echo "Yipee, that works!"
4631 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4632 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4633 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4634 echo "At long last!"
4637 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4638 $cpp <testcpp.c >testcpp.out 2>&1; \
4639 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4644 $cpp - <testcpp.c >testcpp.out 2>&1; \
4645 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4646 echo "Hooray, it works! I was beginning to wonder."
4649 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4650 $wrapper <testcpp.c >testcpp.out 2>&1; \
4651 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4657 rp="No dice. I can't find a C preprocessor. Name one:"
4661 $x_cpp <testcpp.c >testcpp.out 2>&1
4662 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4663 echo "OK, that will do." >&4
4665 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4680 echo "Perhaps can we force $cc -E using a wrapper..."
4681 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4682 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4688 echo "Nope, we'll have to live without it..."
4702 "$wrapper"|'cppstdin') ;;
4703 *) $rm -f $wrapper;;
4705 $rm -f testcpp.c testcpp.out
4707 : Set private lib path
4710 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4715 '') dlist="$loclibpth $plibpth $glibpth";;
4716 *) dlist="$libpth";;
4719 : Now check and see which directories actually exist, avoiding duplicates
4723 if $test -d $xxx; then
4726 *) libpth="$libpth $xxx";;
4732 Some systems have incompatible or broken versions of libraries. Among
4733 the directories listed in the question below, please remove any you
4734 know not to be holding relevant libraries, and add any that are needed.
4735 Say "none" for none.
4746 rp="Directories to use for library searches?"
4753 : compute shared library extension
4756 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4766 On some systems, shared libraries may be available. Answer 'none' if
4767 you want to suppress searching of shared libraries for the remainder
4768 of this configuration.
4771 rp='What is the file extension used for shared libraries?'
4775 : Define several unixisms.
4776 : Hints files or command line option can be used to override them.
4777 : The convoluted testing is in case hints files set either the old
4780 '') case "$exe_ext" in
4782 *) _exe="$exe_ext" ;;
4787 '') case "$lib_ext" in
4794 '') case "$obj_ext" in
4801 '') case "$path_sep" in
4812 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4814 : Which makefile gets called first. This is used by make depend.
4815 case "$firstmakefile" in
4816 '') firstmakefile='makefile';;
4819 : Check is we will use socks
4821 $define|true|[yY]*) dflt='y';;
4826 Perl can be built to use the SOCKS proxy protocol library. To do so,
4827 Configure must be run with -Dusesocks. If you use SOCKS you also need
4828 to use the PerlIO abstraction layer, this will be implicitly selected.
4830 If this doesn't make any sense to you, just accept the default '$dflt'.
4832 rp='Build Perl for SOCKS?'
4835 y|Y) val="$define" ;;
4841 : Check for uselongdouble support
4843 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4846 case "$uselongdouble" in
4847 $define|true|[yY]*) dflt='y';;
4852 Perl can be built to take advantage of long doubles which
4853 (if available) may give more accuracy and range for floating point numbers.
4855 If this doesn't make any sense to you, just accept the default '$dflt'.
4857 rp='Try to use long doubles if available?'
4860 y|Y) val="$define" ;;
4866 case "$uselongdouble" in
4867 true|[yY]*) uselongdouble="$define" ;;
4870 : Look for a hint-file generated 'call-back-unit'. If the
4871 : user has specified that long doubles should be used,
4872 : we may need to set or change some other defaults.
4873 if $test -f uselongdouble.cbu; then
4874 echo "Your platform has some specific hints regarding long doubles, using them..."
4875 . ./uselongdouble.cbu
4877 case "$uselongdouble" in
4880 (Your platform does not have any specific hints for long doubles.)
4886 : Looking for optional libraries
4888 echo "Checking for optional libraries..." >&4
4893 case "$libswanted" in
4894 '') libswanted='c_s';;
4897 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4903 for thisdir in $libpth $xlibpth; do
4904 test -d $thisdir && libspath="$libspath $thisdir"
4906 for thislib in $libswanted; do
4907 for thisdir in $libspath; do
4909 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4910 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4911 $test -f "$xxx" && eval $libscheck
4912 $test -f "$xxx" && libstyle=shared
4914 if test ! -f "$xxx"; then
4915 xxx=$thisdir/lib$thislib.$so
4916 $test -f "$xxx" && eval $libscheck
4917 $test -f "$xxx" && libstyle=shared
4919 if test ! -f "$xxx"; then
4920 xxx=$thisdir/lib$thislib$_a
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=static
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/$thislib$_a
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=static
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib${thislib}_s$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4933 $test -f "$xxx" && thislib=${thislib}_s
4935 if test ! -f "$xxx"; then
4936 xxx=$thisdir/Slib$thislib$_a
4937 $test -f "$xxx" && eval $libscheck
4938 $test -f "$xxx" && libstyle=static
4940 if $test -f "$xxx"; then
4942 shared) echo "Found -l$thislib (shared)." ;;
4943 static) echo "Found -l$thislib." ;;
4944 *) echo "Found -l$thislib ($libstyle)." ;;
4948 *) dflt="$dflt -l$thislib"
4949 libsfound="$libsfound $xxx"
4951 libsfiles="$libsfiles $yyy"
4952 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4953 case " $libsdirs " in
4955 *) libsdirs="$libsdirs $yyy" ;;
4962 if $test ! -f "$xxx"; then
4963 echo "No -l$thislib."
4974 ' '|'') dflt='none';;
4979 In order to compile $package on your machine, a number of libraries
4980 are usually needed. Include any other special libraries here as well.
4981 Say "none" for none. The default list is almost always right.
4985 rp="What libraries to use?"
4992 : determine optimization, if desired, or use for debug flag also
4994 ' '|$undef) dflt='none';;
4996 *) dflt="$optimize";;
5000 By default, $package compiles with the -O flag to use the optimizer.
5001 Alternately, you might want to use the symbolic debugger, which uses
5002 the -g flag (on traditional Unix systems). Either flag can be
5003 specified here. To use neither flag, specify the word "none".
5006 rp="What optimizer/debugger flag should be used?"
5010 'none') optimize=" ";;
5013 : Check what DEBUGGING is required from the command line
5014 : -DEBUGGING or -DDEBUGGING or
5015 : -DEBUGGING=both = -g + -DDEBUGGING
5016 : -DEBUGGING=-g or -Doptimize=-g = -g
5017 : -DEBUGGING=none or -UDEBUGGING =
5018 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5021 *) DEBUGGING=$EBUGGING ;;
5024 case "$DEBUGGING" in
5028 *) optimize="$optimize -g" ;;
5032 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5040 case "$DEBUGGING" in
5041 both|$define) dflt='-DDEBUGGING'
5044 : argument order is deliberate, as the flag will start with - which set could
5045 : think is an option
5046 checkccflag='check=$1; flag=$2; callback=$3;
5048 echo "Checking if your compiler accepts $flag" 2>&1;
5049 echo "int main(void) { return 0; }" > gcctest.c;
5050 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5051 echo "Yes, it does." 2>&1;
5052 if $test -s gcctest.out ; then
5053 echo "But your platform does not like it:";
5058 echo "Leaving current flags $ccflags alone." 2>&1
5060 *) dflt="$dflt $flag";
5066 echo "Nope, it does not, but that is ok." 2>&1;
5070 : We will not override a previous value, but we might want to
5071 : augment a hint file
5073 default|recommended)
5074 case "$gccversion" in
5075 1*) dflt="$dflt -fpcc-struct-return" ;;
5077 case "$optimize:$DEBUGGING" in
5078 *-g*:old) dflt="$dflt -DDEBUGGING";;
5080 case "$gccversion" in
5081 2*) if $test -d /etc/conf/kconfig.d &&
5082 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5084 # Interactive Systems (ISC) POSIX mode.
5089 case "$gccversion" in
5092 ?*) set strict-aliasing -fno-strict-aliasing
5096 # For gcc, adding -pipe speeds up compilations for some, but apparently
5097 # some assemblers can't read from stdin. (It also slows down compilations
5098 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5099 case "$gccversion" in
5105 # on x86_64 (at least) we require an extra library (libssp) in the
5106 # link command line. This library is not named, so I infer that it is
5107 # an implementation detail that may change. Hence the safest approach
5108 # is to add the flag to the flags passed to the compiler at link time,
5109 # as that way the compiler can do the right implementation dependant
5111 case "$gccversion" in
5112 ?*) set stack-protector -fstack-protector
5119 case "$mips_type" in
5120 *BSD*|'') inclwanted="$locincpth $usrinc";;
5121 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5123 for thisincl in $inclwanted; do
5124 if $test -d $thisincl; then
5125 if $test x$thisincl != x$usrinc; then
5127 *" -I$thisincl "*);;
5128 *) dflt="$dflt -I$thisincl ";;
5134 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5136 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5144 *) dflt="$dflt -D$2";;
5148 set signal.h LANGUAGE_C; eval $inctest
5152 ccflags="$ccflags -DSOCKS"
5157 default|recommended) dflt="$ccflags $dflt" ;;
5158 *) dflt="$ccflags";;
5167 Your C compiler may want other flags. For this question you should include
5168 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5169 but you should NOT include libraries or ld flags like -lwhatever. If you
5170 want $package to honor its debug switch, you should include -DDEBUGGING here.
5171 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5173 To use no flags, specify the word "none".
5179 rp="Any additional cc flags?"
5186 : the following weeds options from ccflags that are of no interest to cpp
5188 '') cppflags="$ccflags" ;;
5189 *) cppflags="$cppflags $ccflags" ;;
5191 case "$gccversion" in
5192 1*) cppflags="$cppflags -D__GNUC__"
5194 case "$mips_type" in
5196 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5202 echo "Let me guess what the preprocessor flags are..." >&4
5216 *) ftry="$previous $flag";;
5218 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5219 >cpp1.out 2>/dev/null && \
5220 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5221 >cpp2.out 2>/dev/null && \
5222 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5223 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5225 cppflags="$cppflags $ftry"
5235 *-*) echo "They appear to be: $cppflags";;
5237 $rm -f cpp.c cpp?.out
5241 : flags used in final linking phase
5243 '') if ./venix; then
5249 *-posix*) dflt="$dflt -posix" ;;
5252 *) dflt="$ldflags";;
5254 # See note above about -fstack-protector
5256 *-fstack-protector*)
5258 *-fstack-protector*) ;; # Don't add it again
5259 *) dflt="$dflt -fstack-protector" ;;
5264 : Try to guess additional flags to pick up local libraries.
5265 for thislibdir in $libpth; do
5266 case " $loclibpth " in
5269 *"-L$thislibdir "*) ;;
5270 *) dflt="$dflt -L$thislibdir" ;;
5282 Your C linker may need flags. For this question you should
5283 include -L/whatever and any other flags used by the C linker, but you
5284 should NOT include libraries like -lwhatever.
5286 Make sure you include the appropriate -L/path flags if your C linker
5287 does not normally search all of the directories you specified above,
5290 To use no flags, specify the word "none".
5294 rp="Any additional ld flags (NOT including libraries)?"
5300 rmlist="$rmlist pdp11"
5304 echo "Checking your choice of C compiler and flags for coherency..." >&4
5305 $cat > try.c <<'EOF'
5307 int main() { printf("Ok\n"); return(0); }
5309 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5311 $cat >try.msg <<'EOM'
5312 I've tried to compile and run the following simple program:
5315 $cat try.c >> try.msg
5317 $cat >> try.msg <<EOM
5324 and I got the following output:
5328 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5329 if $sh -c "$run ./try " >>try.msg 2>&1; then
5333 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5336 cat >> try.msg <<'EOQS'
5337 If $libs contains -lsfio, and sfio is mis-configured, then it
5338 sometimes (apparently) runs and exits with a 0 status, but with no
5339 output! It may have to do with sfio's use of _exit vs. exit.
5342 rp="You have a big problem. Shall I abort Configure"
5349 echo "The program compiled OK, but exited with status $?." >>try.msg
5350 rp="You have a problem. Shall I abort Configure"
5354 echo "I can't compile the test program." >>try.msg
5355 rp="You have a BIG problem. Shall I abort Configure"
5361 case "$knowitall" in
5363 echo "(The supplied flags or libraries might be incorrect.)"
5371 *) echo "Ok. Stopping Configure." >&4
5376 n) echo "OK, that should do.";;
5378 $rm_try gcctest gcctest.out
5380 : define a shorthand compile call
5384 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5385 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5389 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5390 : define a shorthand compile call for compilations that should be ok.
5394 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5396 : determine filename position in cpp output
5398 echo "Computing filename position in cpp output for #include directives..." >&4
5400 vos) testaccess=-e ;;
5403 echo '#include <stdio.h>' > foo.c
5406 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5407 $grep '^[ ]*#.*stdio\.h' | \
5408 while read cline; do
5411 while $test \$# -gt 0; do
5412 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5417 pos=\`expr \$pos + 1\`
5429 *) pos="${fieldn}th";;
5431 echo "Your cpp writes the filename in the $pos field of the line."
5434 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5435 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5438 : locate header file
5443 for usrincdir in $usrinc
5445 if test -f \$usrincdir/\$wanted; then
5446 echo "\$usrincdir/\$wanted"
5450 awkprg='{ print \$$fieldn }'
5451 echo "#include <\$wanted>" > foo\$\$.c
5452 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5453 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5454 while read cline; do
5455 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5457 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5458 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5463 # status = 0: grep returned 0 lines, case statement not executed
5464 # status = 1: headerfile found
5465 # status = 2: while loop executed, no headerfile found
5469 if test \$status -eq 1; then
5476 : define an alternate in-header-list? function
5477 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5478 cont=true; xxf="echo \"<\$1> found.\" >&4";
5479 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5480 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5482 case $# in 4) instead=instead;; *) instead="at last";; esac;
5483 while $test "$cont"; do
5485 var=$2; eval "was=\$$2";
5486 if $test "$xxx" && $test -r "$xxx";
5488 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5491 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5492 set $yyy; shift; shift; yyy=$@;
5493 case $# in 0) cont="";;
5494 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5495 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5496 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5497 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5501 do set $yyy; var=$2; eval "was=\$$2";
5502 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5503 set $yyy; shift; shift; yyy=$@;
5506 : see if stdlib is available
5507 set stdlib.h i_stdlib
5510 : check for lengths of integral types
5514 echo "Checking to see how big your integers are..." >&4
5523 printf("intsize=%d;\n", (int)sizeof(int));
5524 printf("longsize=%d;\n", (int)sizeof(long));
5525 printf("shortsize=%d;\n", (int)sizeof(short));
5530 if eval $compile_ok && $run ./try > /dev/null; then
5532 echo "Your integers are $intsize bytes long."
5533 echo "Your long integers are $longsize bytes long."
5534 echo "Your short integers are $shortsize bytes long."
5538 Help! I can't compile and run the intsize test program: please enlighten me!
5539 (This is probably a misconfiguration in your system or libraries, and
5540 you really ought to fix it. Still, I'll try anyway.)
5544 rp="What is the size of an integer (in bytes)?"
5548 rp="What is the size of a long integer (in bytes)?"
5552 rp="What is the size of a short integer (in bytes)?"
5560 : check for long long
5562 echo "Checking to see if you have long long..." >&4
5563 echo 'int main() { long long x = 7; return 0; }' > try.c
5565 if eval $compile; then
5567 echo "You have long long."
5570 echo "You do not have long long."
5576 : check for length of long long
5577 case "${d_longlong}${longlongsize}" in
5580 echo "Checking to see how big your long longs are..." >&4
5581 $cat >try.c <<'EOCP'
5585 printf("%d\n", (int)sizeof(long long));
5590 if eval $compile_ok; then
5591 longlongsize=`$run ./try`
5592 echo "Your long longs are $longlongsize bytes long."
5596 echo "(I can't seem to compile the test program. Guessing...)"
5597 rp="What is the size of a long long (in bytes)?"
5601 if $test "X$longsize" = "X$longlongsize"; then
5602 echo "(That isn't any different from an ordinary long.)"
5608 : see if inttypes.h is available
5609 : we want a real compile instead of Inhdr because some systems
5610 : have an inttypes.h which includes non-existent headers
5613 #include <inttypes.h>
5615 static int32_t foo32 = 0x12345678;
5619 if eval $compile; then
5620 echo "<inttypes.h> found." >&4
5623 echo "<inttypes.h> NOT found." >&4
5632 echo "Checking to see if you have int64_t..." >&4
5634 #include <sys/types.h>
5635 #$i_inttypes I_INTTYPES
5637 #include <inttypes.h>
5639 int main() { int64_t x = 7; }
5642 if eval $compile; then
5644 echo "You have int64_t."
5647 echo "You do not have int64_t."
5653 : Check if 64bit ints have a quad type
5655 echo "Checking which 64-bit integer type we could use..." >&4
5661 val='"unsigned int"'
5666 *) case "$longsize" in
5670 val='"unsigned long"'
5675 *) case "$d_longlong:$longlongsize" in
5680 val='"unsigned long long"'
5685 *) case "$d_int64_t" in
5704 '') echo "Alas, no 64-bit integer types in sight." >&4
5707 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5712 : Do we want 64bit support
5713 case "$uselonglong" in
5714 "$define"|true|[yY]*)
5717 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5719 use64bitint="$define"
5722 case "$use64bits" in
5723 "$define"|true|[yY]*)
5726 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5728 use64bitint="$define"
5731 case "$use64bitints" in
5732 "$define"|true|[yY]*)
5735 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5737 use64bitint="$define"
5740 case "$use64bitsint" in
5741 "$define"|true|[yY]*)
5744 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5746 use64bitint="$define"
5749 case "$uselonglongs" in
5750 "$define"|true|[yY]*)
5753 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5755 use64bitint="$define"
5758 case "$use64bitsall" in
5759 "$define"|true|[yY]*)
5762 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5764 use64bitall="$define"
5769 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5771 case "$use64bitall" in
5772 "$define"|true|[yY]*) use64bitint="$define" ;;
5778 You have natively 64-bit long integers.
5782 *) case "$use64bitint" in
5783 "$define"|true|[yY]*) dflt='y';;
5792 Perl can be built to take advantage of 64-bit integer types
5793 on some systems. To do so, Configure can be run with -Duse64bitint.
5794 Choosing this option will most probably introduce binary incompatibilities.
5796 If this doesn't make any sense to you, just accept the default '$dflt'.
5797 (The default has been chosen based on your configuration.)
5799 rp='Try to use 64-bit integers, if available?'
5802 [yY]*) val="$define" ;;
5810 case "$use64bitall" in
5811 "$define"|true|[yY]*) dflt='y' ;;
5812 *) case "$longsize" in
5820 You may also choose to try maximal 64-bitness. It means using as much
5821 64-bitness as possible on the platform. This in turn means even more
5822 binary incompatibilities. On the other hand, your platform may not
5823 have any more 64-bitness available than what you already have chosen.
5825 If this doesn't make any sense to you, just accept the default '$dflt'.
5826 (The default has been chosen based on your configuration.)
5828 rp='Try to use maximal 64-bit support, if available?'
5831 [yY]*) val="$define" ;;
5836 case "$use64bitall" in
5838 case "$use64bitint" in
5842 Since you have chosen a maximally 64-bit build, I'm also turning on
5843 the use of 64-bit integers.
5845 use64bitint="$define" ;;
5850 : Look for a hint-file generated 'call-back-unit'. If the
5851 : user has specified that a 64-bit perl is to be built,
5852 : we may need to set or change some other defaults.
5853 if $test -f use64bitint.cbu; then
5854 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5857 case "$use64bitint" in
5858 "$define"|true|[yY]*)
5860 4) case "$archname64" in
5861 '') archname64=64int ;;
5868 : Look for a hint-file generated 'call-back-unit'. If the
5869 : user has specified that a maximally 64-bit perl is to be built,
5870 : we may need to set or change some other defaults.
5871 if $test -f use64bitall.cbu; then
5872 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5875 case "$use64bitall" in
5876 "$define"|true|[yY]*)
5878 4) case "$archname64" in
5879 ''|64int) archname64=64all ;;
5886 case "$d_quad:$use64bitint" in
5890 *** You have chosen to use 64-bit integers,
5891 *** but none can be found.
5892 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5893 *** Cannot continue, aborting.
5900 : check for length of double
5902 case "$doublesize" in
5904 echo "Checking to see how big your double precision numbers are..." >&4
5913 printf("%d\n", (int)sizeof(double));
5918 if eval $compile_ok; then
5919 doublesize=`$run ./try`
5920 echo "Your double is $doublesize bytes long."
5923 echo "(I can't seem to compile the test program. Guessing...)"
5924 rp="What is the size of a double precision number (in bytes)?"
5932 : check for long doubles
5934 echo "Checking to see if you have long double..." >&4
5935 echo 'int main() { long double x = 7.0; }' > try.c
5937 if eval $compile; then
5939 echo "You have long double."
5942 echo "You do not have long double."
5948 : check for length of long double
5949 case "${d_longdbl}${longdblsize}" in
5952 echo "Checking to see how big your long doubles are..." >&4
5953 $cat >try.c <<'EOCP'
5957 printf("%d\n", sizeof(long double));
5962 if eval $compile; then
5963 longdblsize=`$run ./try`
5964 echo "Your long doubles are $longdblsize bytes long."
5968 echo "(I can't seem to compile the test program. Guessing...)" >&4
5969 rp="What is the size of a long double (in bytes)?"
5973 if $test "X$doublesize" = "X$longdblsize"; then
5974 echo "That isn't any different from an ordinary double."
5975 echo "I'll keep your setting anyway, but you may see some"
5976 echo "harmless compilation warnings."
5982 : determine the architecture name
5984 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5985 tarch=`arch`"-$osname"
5986 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5987 if uname -m > tmparch 2>&1 ; then
5988 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5989 -e 's/$/'"-$osname/" tmparch`
5997 case "$myarchname" in
6000 echo "(Your architecture name used to be $myarchname.)"
6004 case "$targetarch" in
6006 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6011 *) dflt="$archname";;
6013 rp='What is your architecture name'
6017 : optionally add API version to the architecture for versioned archlibs
6018 case "$useversionedarchname" in
6019 $define|true|[yY]*) dflt='y';;
6022 rp='Add the Perl API version to your archname?'
6025 y|Y) useversionedarchname="$define" ;;
6026 *) useversionedarchname="$undef" ;;
6028 case "$useversionedarchname" in
6031 *-$api_versionstring)
6032 echo "...and architecture name already has -$api_versionstring" >&4
6035 archname="$archname-$api_versionstring"
6036 echo "...setting architecture name to $archname." >&4
6042 case "$usethreads" in
6044 echo "Threads selected." >&4
6046 *-thread*) echo "...and architecture name already has -thread." >&4
6048 *) archname="$archname-thread"
6049 echo "...setting architecture name to $archname." >&4
6054 case "$usemultiplicity" in
6056 echo "Multiplicity selected." >&4
6058 *-multi*) echo "...and architecture name already has -multi." >&4
6060 *) archname="$archname-multi"
6061 echo "...setting architecture name to $archname." >&4
6066 case "$use64bitint$use64bitall" in
6068 case "$archname64" in
6070 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6073 case "$use64bitint" in
6074 "$define") echo "64 bit integers selected." >&4 ;;
6076 case "$use64bitall" in
6077 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6080 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6082 *) archname="$archname-$archname64"
6083 echo "...setting architecture name to $archname." >&4
6089 case "$uselongdouble" in
6091 echo "Long doubles selected." >&4
6092 case "$longdblsize" in
6094 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6098 *-ld*) echo "...and architecture name already has -ld." >&4
6100 *) archname="$archname-ld"
6101 echo "...setting architecture name to $archname." >&4
6108 if $test -f archname.cbu; then
6109 echo "Your platform has some specific hints for architecture name, using them..."
6113 : set the prefixit variable, to compute a suitable default value
6114 prefixit='case "$3" in
6116 case "$oldprefix" in
6117 "") eval "$1=\"\$$2\"";;
6124 ""|" ") eval "$1=\"\$$2\"";;
6130 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6132 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6133 /*-$oldprefix/*|\~*-$oldprefix/*)
6134 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6135 *) eval "$1=\"\$$2\"";;
6139 : determine installation style
6140 : For now, try to deduce it from prefix unless it is already set.
6141 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6142 case "$installstyle" in
6143 '') case "$prefix" in
6144 *perl*) dflt='lib';;
6145 *) dflt='lib/perl5' ;;
6148 *) dflt="$installstyle" ;;
6150 : Probably not worth prompting for this since we prompt for all
6151 : the directories individually, and the prompt would be too long and
6155 : determine where public executables go
6160 rp='Pathname where the public executables will reside?'
6162 if $test "X$ansexp" != "X$binexp"; then
6166 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6167 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6168 : this via initialinstalllocation
6171 case "$userelocatableinc" in
6172 $define|true|[yY]*) dflt='y' ;;
6177 Would you like to build Perl so that the installation is relocatable, so that
6178 library paths in @INC are determined relative to the path of the perl binary?
6179 This is not advised for system Perl installs, or if you need to run setid
6180 scripts or scripts under taint mode.
6182 If this doesn't make any sense to you, just accept the default '$dflt'.
6184 rp='Use relocatable @INC?'
6187 y|Y) val="$define" ;;
6190 set userelocatableinc
6193 initialinstalllocation="$binexp"
6194 : Default prefix is now "up one level from where the binaries are"
6195 case "$userelocatableinc" in
6201 installprefixexp=".../.."
6205 : determine where private library files go
6206 : Usual default is /usr/local/lib/perl5/$version.
6207 : Also allow things like /opt/perl/lib/$version, since
6208 : /opt/perl/lib/perl5... would be redundant.
6209 : The default "style" setting is made in installstyle.U
6210 case "$installstyle" in
6211 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6212 *) set dflt privlib lib/$version ;;
6217 There are some auxiliary files for $package that need to be put into a
6218 private library directory that is accessible by everyone.
6223 rp='Pathname where the private library files will reside?'
6228 : set the prefixup variable, to restore leading tilda escape
6229 prefixup='case "$prefixexp" in
6231 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6234 : determine where public architecture dependent libraries go
6237 : privlib default is /usr/local/lib/$package/$version
6238 : archlib default is /usr/local/lib/$package/$version/$archname
6239 : privlib may have an optional trailing /share.
6240 tdflt=`echo $privlib | $sed 's,/share$,,'`
6241 tdflt=$tdflt/$archname
6250 $spackage contains architecture-dependent library files. If you are
6251 sharing libraries in a heterogeneous environment, you might store
6252 these files in a separate location. Otherwise, you can just include
6253 them with the rest of the public library files.
6258 rp='Where do you want to put the public architecture-dependent libraries?'
6262 if $test X"$archlib" = X"$privlib"; then
6268 : see if setuid scripts can be secure
6271 Some kernels have a bug that prevents setuid #! scripts from being
6272 secure. Some sites have disabled setuid #! scripts because of this.
6274 First let's decide if your kernel supports secure setuid #! scripts.
6275 (If setuid #! scripts would be secure but have been disabled anyway,
6276 don't say that they are secure if asked.)
6281 if $test -d /dev/fd; then
6282 echo "#!$ls" >reflect
6283 chmod +x,u+s reflect
6284 ./reflect >flect 2>&1
6285 if $contains "/dev/fd" flect >/dev/null; then
6286 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6290 If you are not sure if they are secure, I can check but I'll need a
6291 username and password different from the one you are using right now.
6292 If you don't have such a username or don't want me to test, simply
6296 rp='Other username to test security of setuid scripts with?'
6301 case "$d_suidsafe" in
6302 '') echo "I'll assume setuid scripts are *not* secure." >&4
6305 echo "Well, the $hint value is *not* secure." >&4
6307 *) echo "Well, the $hint value *is* secure." >&4
6312 $rm -f reflect flect
6313 echo "#!$ls" >reflect
6314 chmod +x,u+s reflect
6317 echo '"su" will (probably) prompt you for '"$ans's password."
6318 su $ans -c './reflect >flect'
6319 if $contains "/dev/fd" flect >/dev/null; then
6320 echo "Okay, it looks like setuid scripts are secure." >&4
6323 echo "I don't think setuid scripts are secure." >&4
6328 rp='Does your kernel have *secure* setuid scripts?'
6331 [yY]*) val="$define";;
6336 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6337 echo "(That's for file descriptors, not floppy disks.)"
6343 $rm -f reflect flect
6345 : now see if they want to do setuid emulation
6346 if $test $patchlevel -lt 11; then
6349 case "$d_suidsafe" in
6352 echo "No need to emulate SUID scripts since they are secure here." >&4
6356 Some systems have disabled setuid scripts, especially systems where
6357 setuid scripts cannot be secure. On systems where setuid scripts have
6358 been disabled, the setuid/setgid bits on scripts are currently
6359 useless. It is possible for $package to detect those bits and emulate
6360 setuid/setgid in a secure fashion. This emulation will only work if
6361 setuid scripts have been disabled in your kernel.
6365 "$define") dflt=y ;;
6368 rp="Do you want to do setuid/setgid emulation?"
6371 [yY]*) val="$define";;
6383 SUID emulation has been removed for 5.12
6384 Please re-run Configure without -Dd_dosuid
6393 : Find perl5.005 or later.
6394 echo "Looking for a previously installed perl5.005 or later... "
6396 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6397 : Check if this perl is recent and can load a simple module
6398 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6401 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6411 '') echo "None found. That's ok.";;
6412 *) echo "Using $perl5." ;;
6415 : Set the siteprefix variables
6418 After $package is installed, you may wish to install various
6419 add-on modules and utilities. Typically, these add-ons will
6420 be installed under $prefix with the rest
6421 of this package. However, you may wish to install such add-ons
6422 elsewhere under a different prefix.
6424 If you do not wish to put everything under a single prefix, that's
6425 ok. You will be prompted for the individual locations; this siteprefix
6426 is only used to suggest the defaults.
6428 The default should be fine for most people.
6432 rp='Installation prefix to use for add-on modules and utilities?'
6433 : XXX Here might be another good place for an installstyle setting.
6434 case "$siteprefix" in
6436 *) dflt=$siteprefix ;;
6439 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6441 case "$siteprefix" in
6445 *) oldsiteprefix="$prefix";;
6450 siteprefixexp="$ansexp"
6452 : determine where site specific libraries go.
6453 : Usual default is /usr/local/lib/perl5/site_perl/$version
6454 : The default "style" setting is made in installstyle.U
6455 : XXX No longer works with Prefixit stuff.
6456 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6458 '') case "$installstyle" in
6459 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6460 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6468 The installation process will create a directory for
6469 site-specific extensions and modules. Most users find it convenient
6470 to place all site-specific files in this directory rather than in the
6471 main distribution directory.
6475 rp='Pathname for the site-specific library files?'
6479 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6481 : Determine list of previous versions to include in @INC
6482 $cat > getverlist <<EOPL
6485 \$api_versionstring = "$api_versionstring";
6486 \$version = "$version";
6487 \$stem = "$sitelib_stem";
6488 \$archname = "$archname";
6490 $cat >> getverlist <<'EOPL'
6491 # The list found is store twice for each entry: the original name, and
6492 # the binary broken down version as pack "sss", so sorting is easy and
6493 # unambiguous. This will work for all versions that have a maximum of
6494 # three digit groups, separate by '.'s or '_'s. Names are extended with
6495 # ".0.0" to ensure at least three elements for the pack.
6496 # -- H.Merijn Brand (m)'06 23-10-2006
6498 # Can't have leading @ because metaconfig interprets it as a command!
6499 ;@inc_version_list=();
6500 # XXX Redo to do opendir/readdir?
6503 ;@candidates = map {
6504 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6505 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6511 ($pversion, $aversion, $vsn5005) = map {
6512 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6513 foreach $d (@candidates) {
6514 if ($d->[1] lt $pversion) {
6515 if ($d->[1] ge $aversion) {
6516 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6518 elsif ($d->[1] ge $vsn5005) {
6519 unshift(@inc_version_list, grep { -d } $d->[0]);
6523 # Skip newer version. I.e. don't look in
6524 # 5.7.0 if we're installing 5.6.1.
6528 if (@inc_version_list) {
6529 print join(' ', @inc_version_list);
6532 # Blank space to preserve value for next Configure run.
6537 case "$inc_version_list" in
6538 '') if test -x "$perl5$exe_ext"; then
6539 dflt=`$perl5 getverlist`
6544 $undef) dflt='none' ;;
6545 *) eval dflt=\"$inc_version_list\" ;;
6548 ''|' ') dflt=none ;;
6555 In order to ease the process of upgrading, this version of perl
6556 can be configured to use modules built and installed with earlier
6557 versions of perl that were installed under $prefix. Specify here
6558 the list of earlier versions that this version of perl should check.
6559 If Configure detected no earlier versions of perl installed under
6560 $prefix, then the list will be empty. Answer 'none' to tell perl
6561 to not search earlier versions.
6563 The default should almost always be sensible, so if you're not sure,
6564 just accept the default.
6567 rp='List of earlier versions to include in @INC?'
6570 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6571 *) inc_version_list="$ans" ;;
6573 case "$inc_version_list" in
6575 inc_version_list_init='0'
6576 d_inc_version_list="$undef"
6578 *) inc_version_list_init=`echo $inc_version_list |
6579 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6580 d_inc_version_list="$define"
6585 : see if malloc/malloc.h has to be included
6586 set malloc/malloc.h i_mallocmalloc
6589 : see if this is a malloc.h system
6590 : we want a real compile instead of Inhdr because some systems have a
6591 : malloc.h that just gives a compile error saying to use stdlib.h instead
6596 #$i_mallocmalloc I_MALLOCMALLOC
6597 #ifdef I_MALLOCMALLOC
6598 # include <malloc/malloc.h>
6601 int main () { return 0; }
6604 if eval $compile; then
6605 echo "<malloc.h> found." >&4
6608 echo "<malloc.h> NOT found." >&4
6615 : check for void type
6617 echo "Checking to see how well your C compiler groks the void type..." >&4
6618 case "$voidflags" in
6630 extern void moo(); /* function returning void */
6631 void (*goo)(); /* ptr to func returning void */
6633 void *hue; /* generic ptr */
6646 int main() { sub(); }
6648 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6649 voidflags=$defvoidused
6650 echo "Good. It appears to support void to the level $package wants.">&4
6651 if $contains warning .out >/dev/null 2>&1; then
6652 echo "However, you might get some warnings that look like this:"
6656 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6657 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6658 echo "It supports 1..."
6659 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6660 echo "It also supports 2..."
6661 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6663 echo "And it supports 4 but not 8 definitely."
6665 echo "It doesn't support 4..."
6666 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6668 echo "But it supports 8."
6671 echo "Neither does it support 8."
6675 echo "It does not support 2..."
6676 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6678 echo "But it supports 4 and 8."
6680 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6682 echo "And it supports 4 but has not heard about 8."
6684 echo "However it supports 8 but not 4."
6689 echo "There is no support at all for void."
6694 case "$voidflags" in
6697 Support flag bits are:
6698 1: basic void declarations.
6699 2: arrays of pointers to functions returning void.
6700 4: operations between pointers to and addresses of void functions.
6701 8: generic void pointers.
6704 rp="Your void support flags add up to what?"
6711 : check for length of pointer
6715 echo "Checking to see how big your pointers are..." >&4
6716 if test "$voidflags" -gt 7; then
6717 echo '#define VOID_PTR char *' > try.c
6719 echo '#define VOID_PTR void *' > try.c
6729 printf("%d\n", (int)sizeof(VOID_PTR));
6734 if eval $compile_ok; then
6735 ptrsize=`$run ./try`
6736 echo "Your pointers are $ptrsize bytes long."
6739 echo "(I can't seem to compile the test program. Guessing...)" >&4
6740 rp="What is the size of a pointer (in bytes)?"
6747 case "$use64bitall" in
6748 "$define"|true|[yY]*)
6752 *** You have chosen a maximally 64-bit build,
6753 *** but your pointers are only 4 bytes wide.
6754 *** Please rerun Configure without -Duse64bitall.
6759 *** Since you have quads, you could possibly try with -Duse64bitint.
6764 *** Cannot continue, aborting.
6775 : determine whether to use malloc wrapping
6777 case "$usemallocwrap" in
6778 [yY]*|true|$define) dflt='y' ;;
6779 [nN]*|false|$undef) dflt='n' ;;
6780 *) case "$usedevel" in
6781 [yY]*|true|$define) dflt='y' ;;
6786 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6788 usemallocwrap="$ans"
6791 usemallocwrap="$define" ;;
6793 usemallocwrap="$undef" ;;
6796 : determine which malloc to compile in
6798 case "$usemymalloc" in
6799 [yY]*|true|$define) dflt='y' ;;
6800 [nN]*|false|$undef) dflt='n' ;;
6801 *) case "$ptrsize" in
6805 if test "$useithreads" = "$define"; then dflt='n'; fi
6808 rp="Do you wish to attempt to use the malloc that comes with $package?"
6814 mallocsrc='malloc.c'
6815 mallocobj="malloc$_o"
6816 d_mymalloc="$define"
6819 : Remove malloc from list of libraries to use
6820 echo "Removing unneeded -lmalloc from library list" >&4
6821 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6824 echo "libs = $libs" >&4
6836 : compute the return types of malloc and free
6838 $cat >malloc.c <<END
6842 #include <sys/types.h>
6856 case "$malloctype" in
6858 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6865 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6869 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6876 echo "Your system uses $freetype free(), it would seem." >&4
6878 : determine where site specific architecture-dependent libraries go.
6879 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6880 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6881 : sitelib may have an optional trailing /share.
6883 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6884 dflt="$dflt/$archname"
6889 set sitearch sitearch none
6893 The installation process will also create a directory for
6894 architecture-dependent site-specific extensions and modules.
6898 rp='Pathname for the site-specific architecture-dependent library files?'
6902 if $test X"$sitearch" = X"$sitelib"; then
6905 d_sitearch="$define"
6908 : Set the vendorprefix variables
6911 The installation process will also create a directory for
6912 vendor-supplied add-ons. Vendors who supply perl with their system
6913 may find it convenient to place all vendor-supplied files in this
6914 directory rather than in the main distribution directory. This will
6915 ease upgrades between binary-compatible maintenance versions of perl.
6917 Of course you may also use these directories in whatever way you see
6918 fit. For example, you might use them to access modules shared over a
6919 company-wide network.
6921 The default answer should be fine for most people.
6922 This causes further questions about vendor add-ons to be skipped
6923 and no vendor-specific directories will be configured for perl.
6926 rp='Do you want to configure vendor-specific add-on directories?'
6927 case "$usevendorprefix" in
6928 define|true|[yY]*) dflt=y ;;
6929 *) : User may have set vendorprefix directly on Configure command line.
6930 case "$vendorprefix" in
6939 rp='Installation prefix to use for vendor-supplied add-ons?'
6940 case "$vendorprefix" in
6941 '') dflt="$prefix" ;;
6942 *) dflt=$vendorprefix ;;
6945 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6947 case "$vendorprefix" in
6951 *) oldvendorprefix="$prefix";;
6955 usevendorprefix="$define"
6957 vendorprefixexp="$ansexp"
6959 *) usevendorprefix="$undef"
6965 : Set the vendorlib variables
6966 case "$vendorprefix" in
6967 '') d_vendorlib="$undef"
6971 *) d_vendorlib="$define"
6972 : determine where vendor-supplied modules go.
6973 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6974 case "$vendorlib" in
6976 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6977 case "$installstyle" in
6978 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6979 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6982 *) dflt="$vendorlib"
6986 rp='Pathname for the vendor-supplied library files?'
6989 vendorlibexp="$ansexp"
6992 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6996 : Set the vendorarch variables
6997 case "$vendorprefix" in
6998 '') d_vendorarch="$undef"
7002 *) d_vendorarch="$define"
7003 : determine where vendor-supplied architecture-dependent libraries go.
7004 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7005 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7006 : vendorlib may have an optional trailing /share.
7007 case "$vendorarch" in
7008 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7009 dflt="$dflt/$archname"
7011 *) dflt="$vendorarch" ;;
7014 rp='Pathname for vendor-supplied architecture-dependent files?'
7017 vendorarchexp="$ansexp"
7020 prefixvar=vendorarch
7022 if $test X"$vendorarch" = X"$vendorlib"; then
7023 d_vendorarch="$undef"
7025 d_vendorarch="$define"
7028 : Final catch-all directories to search
7031 Lastly, you can have perl look in other directories for extensions and
7032 modules in addition to those already specified.
7033 These directories will be searched after
7037 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7038 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7040 case "$otherlibdirs" in
7041 ''|' ') dflt='none' ;;
7042 *) dflt="$otherlibdirs" ;;
7045 Enter a colon-separated set of extra paths to include in perl's @INC
7046 search path, or enter 'none' for no extra paths.
7050 rp='Colon-separated list of additional directories for perl to search?'
7053 ' '|''|none) otherlibdirs=' ' ;;
7054 *) otherlibdirs="$ans" ;;
7056 case "$otherlibdirs" in
7060 set d_perl_otherlibdirs
7063 : Cruising for prototypes
7065 echo "Checking out function prototypes..." >&4
7066 $cat >prototype.c <<EOCP
7071 int main(int argc, char *argv[]) {
7074 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7075 echo "Your C compiler appears to support function prototypes."
7078 echo "Your C compiler doesn't seem to understand function prototypes."
7085 : Check if ansi2knr is required
7086 case "$prototype" in
7088 *) ansi2knr='ansi2knr'
7093 This version of $package can only be compiled by a compiler that
7094 understands function prototypes. Unfortunately, your C compiler
7096 doesn't seem to understand them. Sorry about that.
7098 If GNU cc is available for your system, perhaps you could try that instead.
7100 Eventually, we hope to support building Perl with pre-ANSI compilers.
7101 If you would like to help in that effort, please contact <perlbug@perl.org>.
7103 Aborting Configure now.
7110 dflt_dtrace='/usr/sbin/dtrace'
7111 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7115 Perl can be built to support DTrace on platforms that support it.
7116 DTrace is a diagnosis and performance analysis tool from Sun.
7118 If this doesn't make any sense to you, just accept the default '$dflt'.
7122 case "$usedtrace" in
7128 dflt_dtrace=$usedtrace
7135 rp='Support DTrace if available?'
7138 y|Y) val="$define" ;;
7144 test "X$usedtrace" != "X$define" && break
7147 rp='Where is the dtrace executable?'
7156 if $dtrace -h -s ../perldtrace.d \
7157 -o perldtrace.tmp >/dev/null 2>&1 \
7158 && rm -f perldtrace.tmp
7161 echo "Good: your $dtrace knows about the -h flag."
7165 *** $me: Fatal Error: $dtrace doesn't support -h flag
7167 *** Your installed dtrace doesn't support the -h switch to compile a D
7168 *** program into a C header. Can't continue.
7180 *** $me: Fatal Error: $dtrace not found.
7187 echo "*** $dtrace was not found."
7193 : See if we want extra modules installed
7200 Perl can be built with extra modules or bundles of modules which
7201 will be fetched from the CPAN and installed alongside Perl.
7203 Notice that you will need access to the CPAN; either via the Internet,
7204 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7205 be asked later to configure the CPAN.pm module which will in turn do
7206 the installation of the rest of the extra modules or bundles.)
7208 Notice also that if the modules require any external software such as
7209 libraries and headers (the libz library and the zlib.h header for the
7210 Compress::Zlib module, for example) you MUST have any such software
7211 already installed, this configuration process will NOT install such
7214 If this doesn't make any sense to you, just accept the default '$dflt'.
7216 rp='Install any extra modules (y or n)?'
7222 Please list any extra modules or bundles to be installed from CPAN,
7223 with spaces between the names. The names can be in any format the
7224 'install' command of CPAN.pm will understand. (Answer 'none',
7225 without the quotes, to install no extra modules or bundles.)
7235 $rm -f ../extras.lst
7237 *) echo "(Saving the list of extras for later...)"
7238 echo "$extras" > ../extras.lst
7246 : determine where html pages for programs go
7247 set html1dir html1dir none
7251 If you wish to install html files for programs in $spackage, indicate
7252 the appropriate directory here. To skip installing html files,
7256 ''|none|$undef|' ') dflt=none ;;
7257 *) dflt=$html1dir ;;
7260 rp="Directory for the main $spackage html pages?"
7264 : Use ' ' for none so value is preserved next time through Configure
7265 $test X"$html1dir" = "X" && html1dir=' '
7267 : determine where html pages for libraries and modules go
7268 set html3dir html3dir none
7272 If you wish to install html files for modules associated with $spackage,
7273 indicate the appropriate directory here. To skip installing html files,
7276 : There is no obvious default. If they have specified html1dir, then
7277 : try to key off that, possibly changing .../html1 into .../html3.
7279 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7280 *) dflt=$html3dir ;;
7283 rp="Directory for the $spackage module html pages?"
7287 : Use ' ' for none so value is preserved next time through Configure
7288 $test X"$html3dir" = "X" && html3dir=' '
7290 : determine whether to install perl also as /usr/bin/perl
7293 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7295 Many scripts expect perl to be installed as /usr/bin/perl.
7297 If you want to, I can install the perl you are about to compile
7298 as /usr/bin/perl (in addition to $bin/perl).
7300 if test -f /usr/bin/perl; then
7303 However, please note that because you already have a /usr/bin/perl,
7304 overwriting that with a new Perl would very probably cause problems.
7305 Therefore I'm assuming you don't want to do that (unless you insist).
7308 case "$installusrbinperl" in
7309 "$define"|[yY]*) dflt='y';;
7315 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7318 case "$installusrbinperl" in
7319 "$undef"|[nN]*) dflt='n';;
7323 rp="Do you want to install perl as /usr/bin/perl?"
7326 [yY]*) val="$define";;
7332 set installusrbinperl
7335 : Check if we are using the GNU C library
7337 echo "Checking for GNU C Library..." >&4
7339 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7340 alone are insufficient to distinguish different versions, such as
7341 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7342 libc version 2.1.0. A. Dougherty, June 3, 2002.
7348 # ifdef __GLIBC_MINOR__
7349 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7350 # include <gnu/libc-version.h>
7351 printf("%s\n", gnu_get_libc_version());
7353 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7356 printf("%d\n", __GLIBC__);
7365 if eval $compile_ok && $run ./try > glibc.ver; then
7367 gnulibc_version=`$cat glibc.ver`
7368 echo "You are using the GNU C Library version $gnulibc_version"
7372 echo "You are not using the GNU C Library"
7378 : see if nm is to be used to determine whether a symbol is defined or not
7382 case "$d_gnulibc" in
7385 echo "nm probably won't work on the GNU C Library." >&4
7391 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7393 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7394 echo "'nm' won't be sufficient on this system." >&4
7400 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7401 if $test $dflt -gt 20; then
7411 true|$define) dflt=y;;
7418 I can use $nm to extract the symbols from your C libraries. This
7419 is a time consuming task which may generate huge output on the disk (up
7420 to 3 megabytes) but that should make the symbols extraction faster. The
7421 alternative is to skip the 'nm' extraction part and to compile a small
7422 test program instead to determine whether each symbol is present. If
7423 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7424 this may be the best solution.
7426 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7429 rp="Shall I use $nm to extract C symbols from the libraries?"
7432 [Nn]*) usenm=false;;
7441 : nm options which may be necessary
7443 '') if $test -f /mach_boot; then
7445 elif $test -d /usr/ccs/lib; then
7446 nm_opt='-p' # Solaris (and SunOS?)
7447 elif $test -f /dgux; then
7449 elif $test -f /lib64/rld; then
7450 nm_opt='-p' # 64-bit Irix
7456 : nm options which may be necessary for shared libraries but illegal
7457 : for archive libraries. Thank you, Linux.
7458 case "$nm_so_opt" in
7459 '') case "$myuname" in
7461 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7462 nm_so_opt='--dynamic'
7469 : Figure out where the libc is located
7472 : get list of predefined functions in a handy place
7477 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7483 *) for thislib in $libs; do
7486 : Handle C library specially below.
7489 thislib=`echo $thislib | $sed -e 's/^-l//'`
7490 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7492 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7494 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7496 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7498 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7500 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7502 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7507 libnames="$libnames $try"
7509 *) libnames="$libnames $thislib" ;;
7518 for xxx in $libpth; do
7519 $test -r $1 || set $xxx/libc.$so
7520 : The messy sed command sorts on library version numbers.
7522 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7523 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7525 s/[0-9][0-9]*/0000&/g
7526 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7529 $sort | $sed -e 's/^.* //'`
7532 $test -r $1 || set /usr/ccs/lib/libc.$so
7533 $test -r $1 || set /lib/libsys_s$_a
7539 if $test -r "$1"; then
7540 echo "Your (shared) C library seems to be in $1."
7542 elif $test -r /lib/libc && $test -r /lib/clib; then
7543 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7545 libc='/lib/clib /lib/libc'
7546 if $test -r /lib/syslib; then
7547 echo "(Your math library is in /lib/syslib.)"
7548 libc="$libc /lib/syslib"
7550 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7551 echo "Your C library seems to be in $libc, as you said before."
7552 elif $test -r $incpath/usr/lib/libc$_a; then
7553 libc=$incpath/usr/lib/libc$_a;
7554 echo "Your C library seems to be in $libc. That's fine."
7555 elif $test -r /lib/libc$_a; then
7557 echo "Your C library seems to be in $libc. You're normal."
7559 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7561 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7562 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7563 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7565 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7567 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7570 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7572 if $test -r "$tans"; then
7573 echo "Your C library seems to be in $tans, of all places."
7579 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7583 If the guess above is wrong (which it might be if you're using a strange
7584 compiler, or your machine supports multiple models), you can override it here.
7589 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7591 I can't seem to find your C library. I've looked in the following places:
7594 $sed 's/^/ /' libpath
7597 None of these seems to contain your C library. I need to get its name...
7602 rp='Where is your C library?'
7607 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7608 set X `cat libnames`
7611 case $# in 1) xxx=file; esac
7612 echo "Extracting names from the following $xxx for later perusal:" >&4
7614 $sed 's/^/ /' libnames >&4
7616 $echo $n "This may take a while...$c" >&4
7620 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7621 *) $nm $nm_opt $file 2>/dev/null;;
7626 $grep fprintf libc.tmp > libc.ptf
7627 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7628 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7630 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7632 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7634 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7636 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7638 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7640 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7642 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7646 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7650 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7654 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7655 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7659 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7663 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7667 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7671 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7675 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7679 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7683 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7688 $nm -p $* 2>/dev/null >libc.tmp
7689 $grep fprintf libc.tmp > libc.ptf
7690 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7691 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7697 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7699 if $ar t $libc > libc.tmp && \
7700 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7702 for thisname in $libnames $libc; do
7703 $ar t $thisname >>libc.tmp
7705 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7707 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7708 for thisname in $libnames $libc; do
7709 $ar tv $thisname >>libc.tmp
7710 emximp -o tmp.imp $thisname \
7712 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7713 < tmp.imp >>libc.tmp
7716 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7719 echo "$ar didn't seem to work right." >&4
7720 echo "Maybe this is a Cray...trying bld instead..." >&4
7722 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7725 for thisname in $libnames; do
7727 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7728 $ar t $thisname >>libc.tmp
7732 echo "That didn't work either. Giving up." >&4
7742 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7743 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7745 *) if $test -f /lib/syscalls.exp; then
7747 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7748 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7749 /lib/syscalls.exp >>libc.list
7755 $rm -f libnames libpath
7757 : see if dld is available
7761 : Check if we are using C++
7763 echo "Checking for C++..." >&4
7764 $cat >try.c <<'EOCP'
7776 if eval $compile_ok && $run ./try; then
7778 echo "You are using a C++ compiler."
7781 echo "You are not using a C++ compiler."
7787 : is a C symbol defined?
7790 -v) tf=libc.tmp; tdc="";;
7791 -a) tf=libc.tmp; tdc="[]";;
7792 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7794 case "$d_cplusplus" in
7795 $define) extern_C="extern \"C\"" ;;
7796 *) extern_C="extern" ;;
7799 case "$reuseval-$4" in
7801 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7806 if $test "$runnm" = true; then
7807 if $contains $tlook $tf >/dev/null 2>&1; then
7809 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7810 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7811 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7812 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7816 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7817 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7823 $define) tval=true;;
7830 : define an is-in-libc? function
7831 inlibc='echo " "; td=$define; tu=$undef;
7832 sym=$1; var=$2; eval "was=\$$2";
7834 case "$reuseval$was" in
7844 echo "$sym() found." >&4;
7845 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7847 echo "$sym() NOT found." >&4;
7848 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7852 $define) echo "$sym() found." >&4;;
7853 *) echo "$sym() NOT found." >&4;;
7857 : see if dlopen exists
7859 xxx_ccflags="$ccflags"
7861 : with g++ one needs -shared to get is-in-libc to work for dlopen
7862 case "$gccversion" in
7864 *) case "$d_cplusplus" in
7865 "$define") ccflags="$ccflags -shared" ;;
7872 ccflags="$xxx_ccflags"
7874 : see if this is a unistd.h system
7875 set unistd.h i_unistd
7878 : determine which dynamic loading, if any, to compile in
7880 dldir="ext/DynaLoader"
7893 $define) dflt='y' ;;
7896 $define) dflt='y' ;;
7898 : Does a dl_xxx.xs file exist for this operating system
7899 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7902 rp="Do you wish to use dynamic loading?"
7910 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7911 dflt="$dldir/dl_${osname}.xs"
7912 elif $test "$d_dlopen" = "$define" ; then
7913 dflt="$dldir/dl_dlopen.xs"
7914 elif $test "$i_dld" = "$define" ; then
7915 dflt="$dldir/dl_dld.xs"
7920 *) dflt="$dldir/$dlsrc"
7923 echo "The following dynamic loading files are available:"
7924 : Can not go over to $dldir because getfile has path hard-coded in.
7925 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7926 rp="Source file to use for dynamic loading"
7932 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7936 Some systems may require passing special flags to $cc -c to
7937 compile modules that will be used to create a shared library.
7938 To use no flags, say "none".
7941 case "$cccdlflags" in
7942 '') case "$gccversion" in
7943 '') case "$osname" in
7945 next) dflt='none' ;;
7946 irix*) dflt='-KPIC' ;;
7947 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7948 sunos) dflt='-pic' ;;
7952 *) case "$osname" in
7953 darwin) dflt='none' ;;
7954 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7959 *) dflt="$cccdlflags" ;;
7961 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7964 none) cccdlflags=' ' ;;
7965 *) cccdlflags="$ans" ;;
7970 Some systems use ld to create libraries that can be dynamically loaded,
7971 while other systems (such as those using ELF) use $cc.
7975 : Determine if this is ELF
7977 /* Test for whether ELF binaries are produced */
7989 int i = open("a.out",O_RDONLY);
7992 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7993 exit(0); /* succeed (yes, it is ELF) */
7998 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8004 '') if $test $bin_ELF = "$define"; then
8006 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8010 echo "I'll use ld to build dynamic libraries."
8018 rp="What command should be used to create dynamic libraries?"
8024 Some systems may require passing special flags to $ld to create a
8025 library that can be dynamically loaded. If your ld flags include
8026 -L/other/path options to locate libraries outside your loader's normal
8027 search path, you may need to specify those -L options here as well. To
8028 use no flags, say "none".
8031 case "$lddlflags" in
8032 '') case "$osname" in
8033 haiku) dflt='-shared' ;;
8035 case "$gccversion" in
8036 '') dflt="$dflt +vnocompatwarnings" ;;
8039 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8040 next) dflt='none' ;;
8041 solaris) # See [perl #66604].
8042 # On Solaris 11, gcc -m64 on amd64
8043 # appears not to understand -G. gcc versions at
8044 # least as old as 3.4.3 support -shared, so just
8045 # use that with Solaris 11 and later, but keep
8046 # the old behavior for older Solaris versions.
8047 case "$gccversion" in
8049 *) case "$osvers" in
8050 2.?|2.10) dflt='-G' ;;
8051 *) dflt='-shared' ;;
8056 sunos) dflt='-assert nodefinitions' ;;
8057 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8061 *) dflt="$lddlflags" ;;
8064 : Try to guess additional flags to pick up local libraries.
8065 : Be careful not to append to a plain 'none'
8069 for thisflag in $ldflags; do
8074 *) dflt="$dflt $thisflag" ;;
8081 ''|' ') dflt='none' ;;
8085 *-fstack-protector*)
8087 *-fstack-protector*) ;; # Don't add it again
8088 *) dflt="$dflt -fstack-protector" ;;
8094 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8097 none) lddlflags=' ' ;;
8098 *) lddlflags="$ans" ;;
8103 Some systems may require passing special flags to $cc to indicate that
8104 the resulting executable will use dynamic linking. To use no flags,
8108 case "$ccdlflags" in
8109 '') case "$osname" in
8110 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8111 next|sunos) dflt='none' ;;
8115 *) dflt="$ccdlflags" ;;
8117 rp="Any special flags to pass to $cc to use dynamic linking?"
8120 none) ccdlflags=' ' ;;
8121 *) ccdlflags="$ans" ;;
8132 ld_can_script="$undef"
8133 case "$bin_ELF$usedl" in
8135 # Abuse try.h and a.out names for neat cleanup
8147 if $cc $cccdlflags $ccdlflags $ccflags \
8148 $ldflags $lddlflags -o a.out try.c \
8149 -Wl,--version-script=try.h >/dev/null 2>&1 \
8150 && $test -s a.out ; then
8151 echo "ld supports scripting" >&4
8152 ld_can_script="$define"
8154 echo "ld does not support scripting" >&4
8160 : Do we want a shared libperl?
8164 # No dynamic loading being used, so don't bother even to prompt.
8167 *) case "$useshrplib" in
8168 '') case "$osname" in
8169 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8171 also='Building a shared libperl is required for dynamic loading to work on your system.'
8176 also='Building a shared libperl is needed for MAB support.'
8194 The perl executable is normally obtained by linking perlmain.c with
8195 libperl${_a}, any static extensions (usually just DynaLoader), and
8196 any other libraries needed on this system (such as -lm, etc.). Since
8197 your system supports dynamic loading, it is probably possible to build
8198 a shared libperl.$so. If you will have more than one executable linked
8199 to libperl.$so, this will significantly reduce the size of each
8200 executable, but it may have a noticeable effect on performance. The
8201 default is probably sensible for your system.
8205 rp="Build a shared libperl.$so (y/n)"
8209 useshrplib='true' ;;
8210 *) useshrplib='false' ;;
8215 case "$useshrplib" in
8217 case "$userelocatableinc" in
8219 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8220 echo "See INSTALL for an explanation why that won't work." >&4
8226 # Figure out a good name for libperl.so. Since it gets stored in
8227 # a version-specific architecture-dependent library, the version
8228 # number isn't really that important, except for making cc/ld happy.
8230 # A name such as libperl.so.10.1
8231 majmin="libperl.$so.$patchlevel.$subversion"
8232 # A name such as libperl.so.100
8233 majonly=`echo $patchlevel $subversion |
8234 $awk '{printf "%d%02d", $1, $2}'`
8235 majonly=libperl.$so.$majonly
8236 # I'd prefer to keep the os-specific stuff here to a minimum, and
8237 # rely on figuring it out from the naming of libc.
8238 case "${osname}${osvers}" in
8241 # XXX How handle the --version stuff for MAB?
8243 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8246 cygwin*) # ld links now against the dll directly
8247 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8248 majonly=`echo $patchlevel $subversion |
8249 $awk '{printf "%03d%03d", $1, $2}'`
8250 majonly=cygperl5.$majonly.$so
8253 *) # Try to guess based on whether libc has major.minor.
8255 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8256 *libc.$so.[0-9]*) dflt=$majonly ;;
8257 *) dflt=libperl.$so ;;
8267 I need to select a good name for the shared libperl. If your system uses
8268 library names with major and minor numbers, then you might want something
8269 like $majmin. Alternatively, if your system uses a single version
8270 number for shared libraries, then you might want to use $majonly.
8271 Or, your system might be quite happy with a simple libperl.$so.
8273 Since the shared libperl will get installed into a version-specific
8274 architecture-dependent directory, the version number of the shared perl
8275 library probably isn't important, so the default should be o.k.
8278 rp='What name do you want to give to the shared libperl?'
8281 echo "Ok, I'll use $libperl"
8284 libperl="libperl${_a}"
8288 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8292 WARNING: Use of the shrpdir variable for the installation location of
8293 the shared $libperl is not supported. It was never documented and
8294 will not work in this version. Let me (perlbug@perl.org)
8295 know of any problems this may cause.
8301 But your current setting of $shrpdir is
8302 the default anyway, so it's harmless.
8307 Further, your current attempted setting of $shrpdir
8308 conflicts with the value of $archlibexp/CORE
8309 that installperl will use.
8316 # How will the perl executable find the installed shared $libperl?
8317 # Add $xxx to ccdlflags.
8318 # If we can't figure out a command-line option, use $shrpenv to
8319 # set env LD_RUN_PATH. The main perl makefile uses this.
8320 shrpdir=$archlibexp/CORE
8323 if "$useshrplib"; then
8326 # We'll set it in Makefile.SH...
8331 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8332 xxx="-Wl,-R$shrpdir"
8334 bsdos|linux|irix*|dec_osf|gnu*)
8335 xxx="-Wl,-rpath,$shrpdir"
8338 # next doesn't like the default...
8341 # Haiku doesn't like the default, either.
8344 # hpux doesn't like the default, either.
8345 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8348 # cygwin needs only ldlibpth
8351 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8357 # Only add $xxx if it isn't already in ccdlflags.
8358 case " $ccdlflags " in
8360 *) ccdlflags="$ccdlflags $xxx"
8363 Adding $xxx to the flags
8364 passed to $ld so that the perl executable will find the
8365 installed shared $libperl.
8373 # Fix ccdlflags in AIX for building external extensions.
8374 # (For building Perl itself bare -bE:perl.exp is needed,
8375 # Makefile.SH takes care of this.)
8377 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8379 # Respect a hint or command-line value.
8381 '') shrpenv="$tmp_shrpenv" ;;
8383 case "$ldlibpthname" in
8384 '') ldlibpthname=LD_LIBRARY_PATH ;;
8385 none) ldlibpthname='' ;;
8388 : determine where manual pages are on this system
8392 syspath='/usr/share/man/man1 /usr/man/man1'
8393 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8394 syspath="$syspath /usr/man/u_man/man1"
8395 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8396 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8397 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8398 sysman=`./loc . /usr/man/man1 $syspath`
8401 if $test -d "$sysman"; then
8402 echo "System manual is in $sysman." >&4
8404 echo "Could not find manual pages in source form." >&4
8407 : determine where manual pages go
8408 set man1dir man1dir none
8412 $spackage has manual pages available in source form.
8416 echo "However, you don't have nroff, so they're probably useless to you."
8418 '') man1dir="none";;
8421 echo "If you don't want the manual sources installed, answer 'none'."
8426 lookpath="$prefixexp/share/man/man1"
8427 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8428 lookpath="$lookpath $prefixexp/man/p_man/man1"
8429 lookpath="$lookpath $prefixexp/man/u_man/man1"
8430 lookpath="$lookpath $prefixexp/man/man.1"
8432 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8433 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8443 rp="Where do the main $spackage manual pages (source) go?"
8445 if $test "X$man1direxp" != "X$ansexp"; then
8456 : What suffix to use on installed man pages
8463 rp="What suffix should be used for the main $spackage man pages?"
8465 '') case "$man1dir" in
8479 *) dflt="$man1ext";;
8486 : see if we can have long filenames
8488 first=123456789abcdef
8490 if (echo hi >$first) 2>/dev/null; then
8491 if $test -f 123456789abcde; then
8492 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8495 echo 'You can have filenames longer than 14 characters.'>&4
8500 You can't have filenames longer than 14 chars.
8501 You can't even think about them!
8507 $rm -rf 123456789abcde*
8509 : determine where library module manual pages go
8510 set man3dir man3dir none
8514 $spackage has manual pages for many of the library modules.
8520 However, you don't have nroff, so they're probably useless to you.
8523 '') man3dir="none";;
8527 case "$d_flexfnam" in
8530 However, your system can't handle the long file names like File::Basename.3.
8533 '') man3dir="none";;
8537 echo "If you don't want the manual sources installed, answer 'none'."
8538 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8540 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8541 if $test -d "$privlib/man/man3"; then
8544 WARNING: Previous versions of perl installed man3 pages into
8545 $privlib/man/man3. This version will suggest a
8546 new default of $dflt.
8550 rp='Do you wish to preserve the old behavior?(y/n)'
8553 y*) dflt="$privlib/man/man3" ;;
8558 *) dflt="$man3dir" ;;
8565 rp="Where do the $package library man pages (source) go?"
8575 : What suffix to use on installed man pages
8581 rp="What suffix should be used for the $package library man pages?"
8583 '') case "$man3dir" in
8597 *) dflt="$man3ext";;
8604 : see if we have to deal with yellow pages, now NIS.
8605 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8606 if $test -f /usr/etc/nibindd; then
8608 echo "I'm fairly confident you're on a NeXT."
8610 rp='Do you get the hosts file via NetInfo?'
8619 y*) hostcat='nidump hosts .';;
8620 *) case "$hostcat" in
8621 nidump*) hostcat='';;
8631 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8639 rp='Are you getting the hosts file via yellow pages?'
8642 y*) hostcat='ypcat hosts';;
8643 *) hostcat='cat /etc/hosts';;
8649 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8652 '') test -f /etc/group && groupcat='cat /etc/group';;
8655 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8658 : now get the host name
8660 echo "Figuring out host name..." >&4
8661 case "$myhostname" in
8663 echo 'Maybe "hostname" will work...'
8664 if tans=`sh -c hostname 2>&1` ; then
8672 if $test "$cont"; then
8674 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8675 if tans=`cat /etc/systemid 2>&1` ; then
8677 phostname='cat /etc/systemid'
8678 echo "Whadyaknow. Xenix always was a bit strange..."
8681 elif $test -r /etc/systemid; then
8682 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8685 if $test "$cont"; then
8686 echo 'No, maybe "uuname -l" will work...'
8687 if tans=`sh -c 'uuname -l' 2>&1` ; then
8689 phostname='uuname -l'
8691 echo 'Strange. Maybe "uname -n" will work...'
8692 if tans=`sh -c 'uname -n' 2>&1` ; then
8694 phostname='uname -n'
8696 echo 'Oh well, maybe I can mine it out of whoami.h...'
8697 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8698 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8699 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8701 case "$myhostname" in
8702 '') echo "Does this machine have an identity crisis or something?"
8705 echo "Well, you said $myhostname before..."
8706 phostname='echo $myhostname';;
8712 case "$myhostname" in
8713 '') myhostname=noname ;;
8715 : you do not want to know about this
8720 if $test "$myhostname" ; then
8722 rp='Your host name appears to be "'$myhostname'".'" Right?"
8730 : bad guess or no guess
8731 while $test "X$myhostname" = X ; do
8733 rp="Please type the (one word) name of your host:"
8738 : translate upper to lower if necessary
8739 case "$myhostname" in
8741 echo "(Normalizing case in your host name)"
8742 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8746 case "$myhostname" in
8748 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8749 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8750 echo "(Trimming domain name from host name--host name is now $myhostname)"
8752 *) case "$mydomain" in
8755 test "X$hostcat" = "Xypcat hosts" &&
8756 ypmatch "$myhostname" hosts 2>/dev/null |\
8757 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8760 test "X$hostcat" != "X" &&
8761 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8762 /[ ]$myhostname[ . ]/p" > hosts
8765 if $test -f hosts; then
8766 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8767 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8768 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8769 hosts | $sort | $uniq | \
8770 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8771 case `$echo X$dflt` in
8772 X*\ *) echo "(Several hosts in the database matched hostname)"
8775 X.) echo "(You do not have fully-qualified names in the hosts database)"
8779 echo "(I cannot locate a hosts database anywhere)"
8784 tans=`./loc resolv.conf X /etc /usr/etc`
8785 if $test -f "$tans"; then
8786 echo "(Attempting domain name extraction from $tans)"
8787 dflt=.`$sed -n -e 's/ / /g' \
8788 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8791 .) dflt=.`$sed -n -e 's/ / /g' \
8792 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8800 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8801 dflt=.`sh -c domainname 2>/dev/null`
8804 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8808 case "$dflt$osname" in
8809 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8810 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8814 .) echo "(Lost all hope -- silly guess then)"
8820 *) dflt="$mydomain";;
8824 rp="What is your domain name?"
8834 : translate upper to lower if necessary
8837 echo "(Normalizing case in your domain name)"
8838 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8842 : a little sanity check here
8843 case "$phostname" in
8846 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8847 $myhostname$mydomain|$myhostname) ;;
8849 case "$phostname" in
8851 echo "(That doesn't agree with your whoami.h file, by the way.)"
8854 echo "(That doesn't agree with your $phostname command, by the way.)"
8862 : determine the e-mail address of the user who is running us
8865 I need to get your e-mail address in Internet format if possible, i.e.
8866 something like user@host.domain. Please answer accurately since I have
8867 no easy means to double check it. The default value provided below
8868 is most probably close to reality but may not be valid from outside
8869 your organization...
8873 while test "$cont"; do
8874 case "$MAILDOMAIN" in
8876 if $test -s /etc/mailname; then
8877 maildomain=`$cat /etc/mailname`
8879 maildomain="$myhostname$mydomain"
8882 *) maildomain="$MAILDOMAIN";;
8885 '') dflt="$cf_by@$maildomain";;
8886 *) dflt="$cf_email";;
8888 rp='What is your e-mail address?'
8894 rp='Address does not look like an Internet one. Use it anyway?'
8908 : Ask e-mail of administrator
8911 If you or somebody else will be maintaining perl at your site, please
8912 fill in the correct e-mail address here so that they may be contacted
8913 if necessary. Currently, the "perlbug" program included with perl
8914 will send mail to this address in addition to perlbug@perl.org. You may
8915 enter "none" for no administrator.
8918 case "$perladmin" in
8919 '') dflt="$cf_email";;
8920 *) dflt="$perladmin";;
8922 rp='Perl administrator e-mail address'
8926 : determine whether to only install version-specific parts.
8929 Do you want to install only the version-specific parts of the perl
8930 distribution? Usually you do *not* want to do this.
8932 case "$versiononly" in
8933 "$define"|[Yy]*|true) dflt='y' ;;
8936 rp="Do you want to install only the version-specific parts of perl?"
8939 [yY]*) val="$define";;
8945 case "$versiononly" in
8946 "$define") inc_version_list=''
8947 inc_version_list_init=0
8951 : figure out how to guarantee perl startup
8952 : XXX Note that this currently takes advantage of the bug that binexp ignores
8953 : the Configure -Dinstallprefix setting, which in turn means that under
8954 : relocatable @INC, initialinstalllocation is what binexp started as.
8955 case "$startperl" in
8957 case "$sharpbang" in
8961 I can use the #! construct to start perl on your system. This will
8962 make startup of perl scripts faster, but may cause problems if you
8963 want to share those scripts and perl is not in a standard place
8964 ($initialinstalllocation/perl) on all your platforms. The alternative
8965 is to force a shell by starting the script with a single ':' character.
8968 case "$versiononly" in
8969 "$define") dflt="$initialinstalllocation/perl$version";;
8970 *) dflt="$initialinstalllocation/perl";;
8972 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8975 none) startperl=": # use perl";;
8976 *) startperl="#!$ans"
8977 if $test 30 -lt `echo "$ans" | wc -c`; then
8980 WARNING: Some systems limit the #! command to 32 characters.
8981 If you experience difficulty running Perl scripts with #!, try
8982 installing Perl in a directory with a shorter pathname.
8988 *) startperl=": # use perl"
8993 echo "I'll use $startperl to start perl scripts."
8995 : figure best path for perl in scripts
8998 case "$versiononly" in
8999 "$define") perlpath="$initialinstalllocation/perl$version";;
9000 *) perlpath="$initialinstalllocation/perl";;
9002 case "$startperl" in
9007 I will use the "eval 'exec'" idiom to start Perl on your system.
9008 I can use the full path of your Perl binary for this purpose, but
9009 doing so may cause problems if you want to share those scripts and
9010 Perl is not always in a standard place ($initialinstalllocation/perl).
9013 dflt="$initialinstalllocation/perl"
9014 rp="What path shall I use in \"eval 'exec'\"?"
9021 case "$startperl" in
9023 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9026 : determine where public executable scripts go
9027 set scriptdir scriptdir
9029 case "$scriptdir" in
9032 : guess some guesses
9033 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9034 $test -d /usr/share/bin && dflt=/usr/share/bin
9035 $test -d /usr/local/script && dflt=/usr/local/script
9036 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9037 $test -d $prefixexp/script && dflt=$prefixexp/script
9041 *) dflt="$scriptdir"
9046 Some installations have a separate directory just for executable scripts so
9047 that they can mount it across multiple architectures but keep the scripts in
9048 one spot. You might, for example, have a subdirectory of /usr/share for this.
9049 Or you might just lump your scripts in with all your other executables.
9053 rp='Where do you keep publicly executable scripts?'
9055 if $test "X$ansexp" != "X$scriptdirexp"; then
9061 : A little fix up for an irregularly named variable.
9062 installscript="$installscriptdir"
9064 : determine where add-on public executables go
9066 '') dflt=$siteprefix/bin ;;
9070 rp='Pathname where the add-on public executables should be installed?'
9075 : determine where add-on html pages go
9076 : There is no standard location, so try to copy the previously-selected
9077 : directory structure for the core html pages.
9078 case "$sitehtml1dir" in
9079 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9080 *) dflt=$sitehtml1dir ;;
9083 ''|' ') dflt=none ;;
9086 rp='Pathname where the site-specific html pages should be installed?'
9088 prefixvar=sitehtml1dir
9091 : determine where add-on library html pages go
9092 : There is no standard location, so try to copy the previously-selected
9093 : directory structure for the core html pages.
9094 case "$sitehtml3dir" in
9095 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9096 *) dflt=$sitehtml3dir ;;
9099 ''|' ') dflt=none ;;
9102 rp='Pathname where the site-specific library html pages should be installed?'
9104 prefixvar=sitehtml3dir
9107 : determine where add-on manual pages go
9108 case "$siteman1dir" in
9109 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9110 *) dflt=$siteman1dir ;;
9113 ''|' ') dflt=none ;;
9116 rp='Pathname where the site-specific manual pages should be installed?'
9118 prefixvar=siteman1dir
9121 : determine where add-on library man pages go
9122 case "$siteman3dir" in
9123 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9124 *) dflt=$siteman3dir ;;
9127 ''|' ') dflt=none ;;
9130 rp='Pathname where the site-specific library manual pages should be installed?'
9132 prefixvar=siteman3dir
9135 : determine where add-on public executable scripts go
9136 case "$sitescript" in
9137 '') dflt=$siteprefix/script
9138 $test -d $dflt || dflt=$sitebin ;;
9139 *) dflt="$sitescript" ;;
9142 rp='Pathname where add-on public executable scripts should be installed?'
9144 prefixvar=sitescript
9147 : Check if faststdio is requested and available
9148 case "$usefaststdio" in
9149 $define|true|[yY]*|'')
9150 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9160 Perl can be built to use 'fast stdio', which means using the stdio
9161 library but also directly manipulating the stdio buffers to enable
9162 faster I/O. Using stdio is better for backward compatibility (especially
9163 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9164 interface has been preferred instead of stdio.
9166 If this doesn't make any sense to you, just accept the default '$dflt'.
9168 rp='Use the "fast stdio" if available?'
9171 y|Y) val="$define" ;;
9178 : define an is-a-typedef? function
9179 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9181 "") inclist="sys/types.h";;
9183 eval "varval=\$$var";
9187 for inc in $inclist; do
9188 echo "#include <$inc>" >>temp.c;
9190 echo "#ifdef $type" >> temp.c;
9191 echo "printf(\"We have $type\");" >> temp.c;
9192 echo "#endif" >> temp.c;
9193 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9194 if $contains $type temp.E >/dev/null 2>&1; then
9200 *) eval "$var=\$varval";;
9203 : define an is-a-typedef? function that prompts if the type is not available.
9204 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9206 "") inclist="sys/types.h";;
9208 eval "varval=\$$var";
9212 for inc in $inclist; do
9213 echo "#include <$inc>" >>temp.c;
9215 echo "#ifdef $type" >> temp.c;
9216 echo "printf(\"We have $type\");" >> temp.c;
9217 echo "#endif" >> temp.c;
9218 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9220 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9221 if $contains $type temp.E >/dev/null 2>&1; then
9222 echo "$type found." >&4;
9225 echo "$type NOT found." >&4;
9231 *) eval "$var=\$varval";;
9234 : see what type lseek is declared as in the kernel
9235 rp="What is the type used for lseek's offset on this system?"
9236 set off_t lseektype long stdio.h sys/types.h
9240 echo "Checking to see how big your file offsets are..." >&4
9242 #include <sys/types.h>
9246 printf("%d\n", (int)sizeof($lseektype));
9251 if eval $compile_ok; then
9252 lseeksize=`$run ./try`
9253 echo "Your file offsets are $lseeksize bytes long."
9257 echo "(I can't seem to compile the test program. Guessing...)"
9258 rp="What is the size of your file offsets (in bytes)?"
9264 : see what type file positions are declared as in the library
9265 rp="What is the type for file position used by fsetpos()?"
9266 set fpos_t fpostype long stdio.h sys/types.h
9269 : Check size for Fpos_t
9272 *_t) zzz="$fpostype" ;;
9275 echo "Checking the size of $zzz..." >&4
9277 #include <sys/types.h>
9284 printf("%d\n", (int)sizeof($fpostype));
9289 if eval $compile_ok; then
9293 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9296 echo "Your $zzz is $fpossize bytes long."
9302 echo "(I can't compile the test program. Guessing...)" >&4
9303 rp="What is the size of your file positions (in bytes)?"
9308 : Check for large file support
9309 # Backward compatibility (uselfs is deprecated).
9311 "$define"|true|[yY]*)
9314 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9316 uselargefiles="$define"
9320 case "$lseeksize:$fpossize" in
9323 You can have files larger than 2 gigabytes.
9326 *) case "$uselargefiles" in
9327 "$undef"|false|[nN]*) dflt='n' ;;
9332 Perl can be built to understand large files (files larger than 2 gigabytes)
9333 on some systems. To do so, Configure can be run with -Duselargefiles.
9335 If this doesn't make any sense to you, just accept the default '$dflt'.
9337 rp='Try to understand large files, if available?'
9340 y|Y) val="$define" ;;
9347 : Look for a hint-file generated 'call-back-unit'. If the
9348 : user has specified that a large files perl is to be built,
9349 : we may need to set or change some other defaults.
9350 if $test -f uselargefiles.cbu; then
9351 echo "Your platform has some specific hints regarding large file builds, using them..."
9352 . ./uselargefiles.cbu
9354 case "$uselargefiles" in
9356 if $test -f uselargefiles.cbu; then
9358 echo "Rechecking to see how big your file offsets are..." >&4
9360 #include <sys/types.h>
9364 printf("%d\n", (int)sizeof($lseektype));
9369 if eval $compile_ok; then
9370 lseeksize=`$run ./try`
9371 $echo "Your file offsets are now $lseeksize bytes long."
9375 echo "(I can't seem to compile the test program. Guessing...)"
9376 rp="What is the size of your file offsets (in bytes)?"
9381 *_t) zzz="$fpostype" ;;
9384 $echo $n "Rechecking the size of $zzz...$c" >&4
9386 #include <sys/types.h>
9393 printf("%d\n", (int)sizeof($fpostype));
9398 if eval $compile_ok; then
9403 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9406 echo " $fpossize bytes." >&4
9412 echo "(I can't compile the test program. Guessing...)" >&4
9413 rp="What is the size of your file positions (in bytes)?"
9422 : Check if we want perlio
9425 : Set the vendorbin variables
9426 case "$vendorprefix" in
9427 '') d_vendorbin="$undef"
9431 *) d_vendorbin="$define"
9432 : determine where vendor-supplied executables go.
9433 case "$vendorbin" in
9434 '') dflt=$vendorprefix/bin ;;
9435 *) dflt="$vendorbin" ;;
9438 rp='Pathname for the vendor-supplied executables directory?'
9441 vendorbinexp="$ansexp"
9447 : Set the vendorhtml1dir variables
9448 case "$vendorprefix" in
9449 '') vendorhtml1dir=''
9450 vendorhtml1direxp=''
9452 *) : determine where vendor-supplied html pages go.
9453 : There is no standard location, so try to copy the previously-selected
9454 : directory structure for the core html pages.
9455 : XXX Better default suggestions would be welcome.
9456 case "$vendorhtml1dir" in
9457 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9458 *) dflt=$vendorhtml1dir ;;
9461 ''|' ') dflt=none ;;
9464 rp='Pathname for the vendor-supplied html pages?'
9466 vendorhtml1dir="$ans"
9467 vendorhtml1direxp="$ansexp"
9470 : Use ' ' for none so value is preserved next time through Configure
9471 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9472 prefixvar=vendorhtml1dir
9475 : Set the vendorhtml3dir variables
9476 case "$vendorprefix" in
9477 '') vendorhtml3dir=''
9478 vendorhtml3direxp=''
9480 *) : determine where vendor-supplied module html pages go.
9481 : There is no standard location, so try to copy the previously-selected
9482 : directory structure for the core html pages.
9483 : XXX Better default suggestions would be welcome.
9484 case "$vendorhtml3dir" in
9485 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9486 *) dflt=$vendorhtml3dir ;;
9489 ''|' ') dflt=none ;;
9492 rp='Pathname for the vendor-supplied html pages?'
9494 vendorhtml3dir="$ans"
9495 vendorhtml3direxp="$ansexp"
9498 : Use ' ' for none so value is preserved next time through Configure
9499 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9500 prefixvar=vendorhtml3dir
9503 : Set the vendorman1dir variables
9504 case "$vendorprefix" in
9505 '') vendorman1dir=''
9508 *) : determine where vendor-supplied manual pages go.
9509 case "$vendorman1dir" in
9510 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9511 *) dflt=$vendorman1dir ;;
9514 ''|' ') dflt=none ;;
9517 rp='Pathname for the vendor-supplied manual section 1 pages?'
9519 vendorman1dir="$ans"
9520 vendorman1direxp="$ansexp"
9523 : Use ' ' for none so value is preserved next time through Configure
9524 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9525 prefixvar=vendorman1dir
9528 : Set the vendorman3dir variables
9529 case "$vendorprefix" in
9530 '') vendorman3dir=''
9533 *) : determine where vendor-supplied module manual pages go.
9534 case "$vendorman3dir" in
9535 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9536 *) dflt=$vendorman3dir ;;
9539 ''|' ') dflt=none ;;
9542 rp='Pathname for the vendor-supplied manual section 3 pages?'
9544 vendorman3dir="$ans"
9545 vendorman3direxp="$ansexp"
9548 : Use ' ' for none so value is preserved next time through Configure
9549 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9550 prefixvar=vendorman3dir
9553 : Set the vendorscript variables
9554 case "$vendorprefix" in
9555 '') d_vendorscript="$undef"
9559 *) d_vendorscript="$define"
9560 : determine where vendor-supplied scripts go.
9561 case "$vendorscript" in
9562 '') dflt=$vendorprefix/script
9563 $test -d $dflt || dflt=$vendorbin ;;
9564 *) dflt="$vendorscript" ;;
9568 The installation process will create a directory for
9569 vendor-supplied scripts.
9573 rp='Pathname for the vendor-supplied scripts directory?'
9576 vendorscriptexp="$ansexp"
9579 prefixvar=vendorscript
9582 : script used to emit important warnings
9585 if test \$# -gt 0; then
9590 echo "*** WARNING:" >&4
9591 sed -e 's/^/*** /' <msg >&4
9593 cat msg >>config.msg
9594 echo " " >>config.msg
9600 : see which of string.h or strings.h is needed
9602 strings=`./findhdr string.h`
9603 if $test "$strings" && $test -r "$strings"; then
9604 echo "Using <string.h> instead of <strings.h>." >&4
9608 strings=`./findhdr strings.h`
9609 if $test "$strings" && $test -r "$strings"; then
9610 echo "Using <strings.h> instead of <string.h>." >&4
9612 ./warn "No string header found -- You'll surely have problems."
9618 "$undef") strings=`./findhdr strings.h`;;
9619 *) strings=`./findhdr string.h`;;
9622 : see if qgcvt exists
9626 : Check print/scan long double stuff
9629 if $test X"$d_longdbl" = X"$define"; then
9631 echo "Checking how to print long doubles..." >&4
9633 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9634 $cat >try.c <<'EOCP'
9635 #include <sys/types.h>
9639 printf("%.3f\n", d);
9643 if eval $compile; then
9647 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9648 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9649 echo "We will use %f."
9655 if $test X"$sPRIfldbl" = X; then
9656 $cat >try.c <<'EOCP'
9657 #include <sys/types.h>
9660 long double d = 123.456;
9661 printf("%.3Lf\n", d);
9665 if eval $compile; then
9669 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9670 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9671 echo "We will use %Lf."
9677 if $test X"$sPRIfldbl" = X; then
9678 $cat >try.c <<'EOCP'
9679 #include <sys/types.h>
9682 long double d = 123.456;
9683 printf("%.3llf\n", d);
9687 if eval $compile; then
9691 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9692 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9693 echo "We will use %llf."
9699 if $test X"$sPRIfldbl" = X; then
9700 $cat >try.c <<'EOCP'
9701 #include <sys/types.h>
9704 long double d = 123.456;
9705 printf("%.3lf\n", d);
9709 if eval $compile; then
9713 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9714 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9715 echo "We will use %lf."
9721 if $test X"$sPRIfldbl" = X; then
9722 echo "Cannot figure out how to print long doubles." >&4
9724 sSCNfldbl=$sPRIfldbl # expect consistency
9731 case "$sPRIfldbl" in
9732 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9733 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9734 d_SCNfldbl="$undef";
9736 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9737 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9738 d_SCNfldbl="$define";
9742 : Check how to convert floats to strings.
9744 if test "X$d_Gconvert" = X; then
9747 echo "Checking for an efficient way to convert floats to strings."
9749 case "$uselongdouble" in
9750 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9752 case "$d_longdbl" in
9753 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9755 case "$d_PRIgldbl" in
9756 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9760 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9761 char *myname = "gconvert";
9764 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9765 char *myname = "gcvt";
9768 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9769 char *myname = "qgcvt";
9770 #define DOUBLETYPE long double
9773 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9775 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9777 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9780 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9782 char *myname = "sprintf";
9786 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9787 #define DOUBLETYPE long double
9789 #define DOUBLETYPE double
9801 # include <string.h>
9803 # include <strings.h>
9806 int checkit(char *expect, char *got)
9808 if (strcmp(expect, got)) {
9809 printf("%s oddity: Expected %s, got %s\n",
9810 myname, expect, got);
9820 /* This must be 1st test on (which?) platform */
9821 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9822 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9823 checkit("0.1", buf);
9825 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9826 checkit("0.01", buf);
9828 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9829 checkit("0.001", buf);
9831 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9832 checkit("0.0001", buf);
9834 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9835 if (strlen(buf) > 5)
9836 checkit("9e-005", buf); /* for Microsoft ?? */
9838 checkit("9e-05", buf);
9840 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9843 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9844 checkit("1.1", buf);
9846 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9847 checkit("1.01", buf);
9849 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9850 checkit("1.001", buf);
9852 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9853 checkit("1.0001", buf);
9855 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9856 checkit("1.00001", buf);
9858 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9859 checkit("1.000001", buf);
9861 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9864 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9867 /* Some Linux gcvt's give 1.e+5 here. */
9868 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9869 checkit("100000", buf);
9871 /* Some Linux gcvt's give -1.e+5 here. */
9872 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9873 checkit("-100000", buf);
9875 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9876 checkit("123.456", buf);
9878 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9879 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9880 /* 34 should be enough to scare even long double
9881 * places into using the e notation. */
9882 if (strlen(buf) > 5)
9883 checkit("1e+034", buf); /* for Microsoft */
9885 checkit("1e+34", buf);
9887 /* For Perl, if you add additional tests here, also add them to
9888 * t/base/num.t for benefit of platforms not using Configure or
9889 * overriding d_Gconvert */
9894 : first add preferred functions to our list
9896 for xxx_convert in $gconvert_preference; do
9897 case $xxx_convert in
9898 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9899 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9902 : then add any others
9903 for xxx_convert in gconvert gcvt sprintf; do
9906 *) xxx_list="$xxx_list $xxx_convert" ;;
9910 case "$d_longdbl$uselongdouble" in
9912 : again, add preferred functions to our list first
9914 for xxx_convert in $gconvert_ld_preference; do
9915 case $xxx_convert in
9916 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9917 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9920 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9921 for xxx_convert in qgcvt sprintf $xxx_list; do
9922 case "$xxx_ld_list" in
9923 $xxx_convert*|*" $xxx_convert"*) ;;
9924 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9927 : if sprintf cannot do long doubles, move it to the end
9928 if test "$d_PRIgldbl" != "$define"; then
9929 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9931 : if no qgcvt, remove it
9932 if test "$d_qgcvt" != "$define"; then
9933 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9936 xxx_list="$xxx_ld_list"
9940 for xxx_convert in $xxx_list; do
9941 echo "Trying $xxx_convert..."
9942 $rm -f try try$_o core
9943 set try -DTRY_$xxx_convert
9944 if eval $compile; then
9945 echo "$xxx_convert() found." >&4
9947 echo "I'll use $xxx_convert to convert floats into a string." >&4
9950 echo "...But $xxx_convert didn't work as I expected."
9954 echo "$xxx_convert NOT found." >&4
9958 if test X$xxx_convert = X; then
9959 echo "*** WHOA THERE!!! ***" >&4
9960 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9964 case "$xxx_convert" in
9965 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9966 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9967 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9968 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9969 "$define$define$define")
9970 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9971 "$define$define$undef")
9972 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9973 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9981 : see if _fwalk exists
9985 : Initialize h_fcntl
9988 : Initialize h_sysfile
9991 : access call always available on UNIX
9995 : locate the flags for 'access()'
9999 $cat >access.c <<EOCP
10000 #include <sys/types.h>
10005 #include <sys/file.h>
10008 #include <unistd.h>
10010 #$i_stdlib I_STDLIB
10012 #include <stdlib.h>
10018 : check sys/file.h first, no particular reason here
10019 if $test `./findhdr sys/file.h` && \
10020 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10022 echo "<sys/file.h> defines the *_OK access constants." >&4
10023 elif $test `./findhdr fcntl.h` && \
10024 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10026 echo "<fcntl.h> defines the *_OK access constants." >&4
10027 elif $test `./findhdr unistd.h` && \
10028 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10029 echo "<unistd.h> defines the *_OK access constants." >&4
10031 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10037 : see if accessx exists
10038 set accessx d_accessx
10041 : see if aintl exists
10045 : see if alarm exists
10049 : see if 64bit time functions exists
10051 set ctime64 d_ctime64
10054 set localtime64 d_localtime64
10057 set gmtime64 d_gmtime64
10060 set mktime64 d_mktime64
10063 set difftime64 d_difftime64
10066 set asctime64 d_asctime64
10069 : see if POSIX threads are available
10070 set pthread.h i_pthread
10073 : define a function to check prototypes
10074 $cat > protochk <<EOSH
10077 optimize="$optimize"
10079 prototype="$prototype"
10082 usethreads=$usethreads
10083 i_pthread=$i_pthread
10084 pthread_h_first=$pthread_h_first
10087 $cat >> protochk <<'EOSH'
10092 while test $# -ge 2; do
10094 $define) echo "#include <$2>" >> try.c ;;
10095 literal) echo "$2" >> try.c ;;
10097 # Extra magic for the benefit of systems that need pthread.h
10098 # to be included early to correctly detect threadsafe functions.
10099 # Such functions must guarantee themselves, though, that the usethreads
10100 # and i_pthread have been defined, before calling protochk.
10101 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10102 echo "#include <pthread.h>" >> try.c
10107 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10108 cat >> try.c <<'EOCP'
10109 #ifdef CAN_PROTOTYPE
10110 #define _(args) args
10115 echo "$foo" >> try.c
10116 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10117 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10123 $eunicefix protochk
10125 : Define hasproto macro for Configure internal use
10126 hasproto='varname=$1; func=$2; shift; shift;
10127 while $test $# -ge 2; do
10129 $define) echo "#include <$2>";;
10133 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10134 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10135 echo "$func() prototype found.";
10138 echo "$func() prototype NOT found.";
10145 : see if sys/types.h has to be included
10146 set sys/types.h i_systypes
10149 : see if sys/select.h has to be included
10150 set sys/select.h i_sysselct
10153 : Define hasfield macro for Configure internal use
10154 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10155 while $test $# -ge 2; do
10157 $define) echo "#include <$2>";;
10161 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10163 if eval $compile; then
10172 : see if we should include time.h, sys/time.h, or both
10174 if test "X$timeincl" = X; then
10175 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10176 $echo $n "I'm now running the test program...$c"
10178 #include <sys/types.h>
10183 #ifdef SYSTIMEKERNEL
10186 #include <sys/time.h>
10189 #include <sys/select.h>
10191 #$i_stdlib I_STDLIB
10193 #include <stdlib.h>
10199 struct timeval bar;
10202 struct timezone tzp;
10204 if (foo.tm_sec == foo.tm_sec)
10207 if (bar.tv_sec == bar.tv_sec)
10214 for s_timezone in '-DS_TIMEZONE' ''; do
10216 for s_timeval in '-DS_TIMEVAL' ''; do
10217 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10218 for i_time in '' '-DI_TIME'; do
10219 for i_systime in '-DI_SYSTIME' ''; do
10222 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10223 if eval $compile; then
10224 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10228 $echo $n "Succeeded with $flags$c"
10240 *SYSTIMEKERNEL*) i_systimek="$define"
10241 timeincl=`./findhdr sys/time.h`
10242 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10243 *) i_systimek="$undef";;
10246 *I_TIME*) i_time="$define"
10247 timeincl=`./findhdr time.h`" $timeincl"
10248 echo "We'll include <time.h>." >&4;;
10249 *) i_time="$undef";;
10252 *I_SYSTIME*) i_systime="$define"
10253 timeincl=`./findhdr sys/time.h`" $timeincl"
10254 echo "We'll include <sys/time.h>." >&4;;
10255 *) i_systime="$undef";;
10259 : see if struct tm knows about tm_zone
10260 case "$i_systime$i_time" in
10263 echo "Checking to see if your struct tm has tm_zone field..." >&4
10264 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10272 case "$d_tm_tm_zone" in
10273 "$define") echo "Yes, it does." ;;
10274 *) echo "No, it doesn't." ;;
10276 : see if struct tm knows about tm_gmtoff
10277 case "$i_systime$i_time" in
10280 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10281 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10289 case "$d_tm_tm_gmtoff" in
10290 "$define") echo "Yes, it does." ;;
10291 *) echo "No, it doesn't." ;;
10294 : see if asctime_r exists
10295 set asctime_r d_asctime_r
10297 case "$d_asctime_r" in
10299 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10300 case "$d_asctime_r_proto:$usethreads" in
10301 ":define") d_asctime_r_proto=define
10302 set d_asctime_r_proto asctime_r $hdrs
10306 case "$d_asctime_r_proto" in
10308 case "$asctime_r_proto" in
10309 ''|0) try='char* asctime_r(const struct tm*, char*);'
10310 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10312 case "$asctime_r_proto" in
10313 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10314 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10316 case "$asctime_r_proto" in
10317 ''|0) try='int asctime_r(const struct tm*, char*);'
10318 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10320 case "$asctime_r_proto" in
10321 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10322 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10324 case "$asctime_r_proto" in
10325 ''|0) d_asctime_r=undef
10327 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10328 * ) case "$asctime_r_proto" in
10329 REENTRANT_PROTO*) ;;
10330 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10332 echo "Prototype: $try" ;;
10335 *) case "$usethreads" in
10336 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10343 *) asctime_r_proto=0
10347 : see if atolf exists
10351 : see if atoll exists
10355 : Look for GCC-style attribute format
10356 case "$d_attribute_format" in
10359 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10360 $cat >attrib.c <<'EOCP'
10362 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10364 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10365 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10366 echo "Your C compiler doesn't support __attribute__((format))."
10369 echo "Your C compiler supports __attribute__((format))."
10373 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10377 *) val="$d_attribute_format" ;;
10379 set d_attribute_format
10383 : Look for GCC-style attribute format with null format allowed
10384 case "$d_printf_format_null" in
10385 '') case "$d_attribute_format" in
10388 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10389 $cat >attrib.c <<EOCP
10391 #$i_stdlib I_STDLIB
10393 #include <stdlib.h>
10395 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10396 int null_printf (char* pat,...) { return (int)pat; }
10397 int main () { exit(null_printf(NULL)); }
10399 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10400 : run the executable in case it produces a run-time warning
10401 if $run ./attrib >>attrib.out 2>&1; then
10402 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10403 echo "Your C compiler doesn't allow __printf__ format to be null."
10406 echo "Your C compiler allows __printf__ format to be null."
10410 echo "Your C compiler executable failed with __printf__ format null."
10414 echo "Your C compiler fails with __printf__ format null."
10421 *) val="$d_printf_format_null" ;;
10423 set d_printf_format_null
10427 : Look for GCC-style attribute malloc
10428 case "$d_attribute_malloc" in
10431 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10432 $cat >attrib.c <<'EOCP'
10434 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10436 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10437 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10438 echo "Your C compiler doesn't support __attribute__((malloc))."
10441 echo "Your C compiler supports __attribute__((malloc))."
10445 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10449 *) val="$d_attribute_malloc" ;;
10451 set d_attribute_malloc
10455 : Look for GCC-style attribute nonnull
10456 case "$d_attribute_nonnull" in
10459 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10460 $cat >attrib.c <<'EOCP'
10462 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10464 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10465 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10466 echo "Your C compiler doesn't support __attribute__((nonnull))."
10469 echo "Your C compiler supports __attribute__((nonnull))."
10473 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10477 *) val="$d_attribute_nonnull" ;;
10479 set d_attribute_nonnull
10483 : Look for GCC-style attribute noreturn
10484 case "$d_attribute_noreturn" in
10487 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10488 $cat >attrib.c <<'EOCP'
10490 void fall_over_dead( void ) __attribute__((noreturn));
10492 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10493 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10494 echo "Your C compiler doesn't support __attribute__((noreturn))."
10497 echo "Your C compiler supports __attribute__((noreturn))."
10501 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10505 *) val="$d_attribute_noreturn" ;;
10507 set d_attribute_noreturn
10511 : Look for GCC-style attribute pure
10512 case "$d_attribute_pure" in
10515 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10516 $cat >attrib.c <<'EOCP'
10518 int square( int n ) __attribute__((pure));
10520 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10521 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10522 echo "Your C compiler doesn't support __attribute__((pure))."
10525 echo "Your C compiler supports __attribute__((pure))."
10529 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10533 *) val="$d_attribute_pure" ;;
10535 set d_attribute_pure
10539 : Look for GCC-style attribute unused
10540 case "$d_attribute_unused" in
10543 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10544 $cat >attrib.c <<'EOCP'
10546 int do_something( int dummy __attribute__((unused)), int n );
10548 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10549 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10550 echo "Your C compiler doesn't support __attribute__((unused))."
10553 echo "Your C compiler supports __attribute__((unused))."
10557 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10561 *) val="$d_attribute_unused" ;;
10563 set d_attribute_unused
10567 : Look for GCC-style attribute deprecated
10568 case "$d_attribute_deprecated" in
10571 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10572 $cat >attrib.c <<'EOCP'
10574 int I_am_deprecated(void) __attribute__((deprecated));
10576 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10577 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10578 echo "Your C compiler doesn't support __attribute__((deprecated))."
10581 echo "Your C compiler supports __attribute__((deprecated))."
10585 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10589 *) val="$d_attribute_deprecated" ;;
10591 set d_attribute_deprecated
10595 : Look for GCC-style attribute warn_unused_result
10596 case "$d_attribute_warn_unused_result" in
10599 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10600 $cat >attrib.c <<'EOCP'
10602 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10604 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10605 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10606 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10609 echo "Your C compiler supports __attribute__((warn_unused_result))."
10613 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10617 *) val="$d_attribute_warn_unused_result" ;;
10619 set d_attribute_warn_unused_result
10623 : see if bcmp exists
10627 : see if bcopy exists
10631 : see if getpgrp exists
10632 set getpgrp d_getpgrp
10635 case "$d_getpgrp" in
10638 echo "Checking to see which flavor of getpgrp is in use..."
10640 #$i_unistd I_UNISTD
10641 #include <sys/types.h>
10643 # include <unistd.h>
10645 #$i_stdlib I_STDLIB
10647 #include <stdlib.h>
10651 if (getuid() == 0) {
10652 printf("(I see you are running Configure as super-user...)\n");
10655 #ifdef TRY_BSD_PGRP
10656 if (getpgrp(1) == 0)
10665 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10666 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10668 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10669 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10672 echo "I can't seem to compile and run the test program."
10674 xxx="a USG one, i.e. you use getpgrp()."
10676 # SVR4 systems can appear rather BSD-ish.
10677 case "$i_unistd" in
10679 xxx="a BSD one, i.e. you use getpgrp(pid)."
10683 xxx="probably a USG one, i.e. you use getpgrp()."
10688 echo "Assuming your getpgrp is $xxx" >&4
10697 : see if setpgrp exists
10698 set setpgrp d_setpgrp
10701 case "$d_setpgrp" in
10704 echo "Checking to see which flavor of setpgrp is in use..."
10706 #$i_unistd I_UNISTD
10707 #include <sys/types.h>
10709 # include <unistd.h>
10711 #$i_stdlib I_STDLIB
10713 #include <stdlib.h>
10717 if (getuid() == 0) {
10718 printf("(I see you are running Configure as super-user...)\n");
10721 #ifdef TRY_BSD_PGRP
10722 if (-1 == setpgrp(1, 1))
10725 if (setpgrp() != -1)
10731 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10732 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10734 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10735 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10738 echo "(I can't seem to compile and run the test program.)"
10740 xxx="a USG one, i.e. you use setpgrp()."
10742 # SVR4 systems can appear rather BSD-ish.
10743 case "$i_unistd" in
10745 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10749 xxx="probably a USG one, i.e. you use setpgrp()."
10754 echo "Assuming your setpgrp is $xxx" >&4
10763 : Look for GCC-style __builtin_choose_expr
10764 case "$d_builtin_choose_expr" in
10767 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10768 $cat >try.c <<'EOCP'
10769 #include <assert.h>
10770 #include <stdlib.h>
10773 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10776 assert( SYRINX(1) == 2112 );
10777 assert( SYRINX(1) != 5150 );
10778 assert( SYRINX(0) == 5150 );
10779 assert( SYRINX(0) != 2112 );
10780 puts( "All good!" );
10786 if eval $compile && $run ./try; then
10787 echo "Your C compiler supports __builtin_choose_expr."
10790 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10794 *) val="$d_builtin_choose_expr" ;;
10797 set d_builtin_choose_expr
10801 : Look for GCC-style __builtin_expect
10802 case "$d_builtin_expect" in
10805 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10806 $cat >try.c <<'EOCP'
10809 if ( __builtin_expect(n, 0) ) n = 1;
10810 /* Remember shell exit code truth is 0, C truth is non-zero */
10815 if eval $compile && $run ./try; then
10816 echo "Your C compiler supports __builtin_expect."
10819 echo "Your C compiler doesn't seem to understand __builtin_expect."
10823 *) val="$d_builtin_expect" ;;
10826 set d_builtin_expect
10830 : see if bzero exists
10834 : see if stdarg is available
10836 if $test `./findhdr stdarg.h`; then
10837 echo "<stdarg.h> found." >&4
10840 echo "<stdarg.h> NOT found." >&4
10844 : see if varargs is available
10846 if $test `./findhdr varargs.h`; then
10847 echo "<varargs.h> found." >&4
10849 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10852 : set up the varargs testing programs
10853 $cat > varargs.c <<EOP
10855 #include <stdarg.h>
10858 #include <varargs.h>
10862 int f(char *p, ...)
10876 p = va_arg(ap, char *);
10882 $cat > varargs <<EOP
10884 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10893 : now check which varargs header should be included
10899 if `./varargs I_STDARG`; then
10901 elif `./varargs I_VARARGS`; then
10906 if `./varargs I_VARARGS`; then
10914 echo "*** WHOA THERE!!! ***" >&4
10915 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10916 case "$knowitall" in
10918 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10922 echo "I could not find the definition for va_dcl... You have problems..." >&4
10923 val="$undef"; set i_stdarg; eval $setvar
10924 val="$undef"; set i_varargs; eval $setvar
10929 case "$i_varhdr" in
10931 val="$define"; set i_stdarg; eval $setvar
10932 val="$undef"; set i_varargs; eval $setvar
10935 val="$undef"; set i_stdarg; eval $setvar
10936 val="$define"; set i_varargs; eval $setvar
10939 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10943 : see if the Compiler supports C99 variadic macros
10944 case "$i_stdarg$i_stdlib" in
10946 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10949 #include <stdarg.h>
10951 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10955 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10961 if eval $compile && $run ./try 2>&1 >/dev/null; then
10962 case "`$run ./try`" in
10964 echo "You have C99 variadic macros." >&4
10965 d_c99_variadic_macros="$define"
10968 echo "You don't have functional C99 variadic macros." >&4
10969 d_c99_variadic_macros="$undef"
10973 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10974 d_c99_variadic_macros="$undef"
10979 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10980 d_c99_variadic_macros="$undef"
10984 : see if signal is declared as pointer to function returning int or void
10986 xxx=`./findhdr signal.h`
10987 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10988 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10989 echo "You have int (*signal())() instead of void." >&4
10991 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10992 echo "You have void (*signal())()." >&4
10994 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10995 echo "You have int (*signal())() instead of void." >&4
10997 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10998 echo "You have void (*signal())()." >&4
11001 case "$d_voidsig" in
11003 echo "I can't determine whether signal handler returns void or int..." >&4
11005 rp="What type does your signal handler return?"
11008 v*) val="$define";;
11012 echo "As you already told me, signal handler returns void." >&4
11015 *) echo "As you already told me, signal handler returns int." >&4
11022 case "$d_voidsig" in
11023 "$define") signal_t="void";;
11024 *) signal_t="int";;
11028 : check for ability to cast large floats to 32-bit ints.
11030 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11031 if $test "$intsize" -ge 4; then
11038 #$i_stdlib I_STDLIB
11040 #include <stdlib.h>
11042 #include <sys/types.h>
11043 #include <signal.h>
11044 $signal_t blech(int s) { exit(3); }
11051 signal(SIGFPE, blech);
11053 /* Don't let compiler optimize the test away. Store the number
11054 in a writable string for gcc to pass to sscanf under HP-UX.
11056 sprintf(str, "2147483647");
11057 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11061 /* x86 processors will probably give 0x8000 0000, which is a
11062 sign change. We don't want that. We want to mimic SPARC
11063 behavior here, which is to preserve the sign and give
11066 if (i32 != ($xxx) f)
11072 if eval $compile_ok; then
11076 echo "(I can't seem to compile the test program--assuming it can't)"
11081 echo "Yup, it can."
11084 echo "Nope, it can't."
11091 : check for ability to cast negative floats to unsigned
11093 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11096 #$i_stdlib I_STDLIB
11098 #include <stdlib.h>
11100 #include <sys/types.h>
11101 #include <signal.h>
11102 $signal_t blech(int s) { exit(7); }
11103 $signal_t blech_in_list(int s) { exit(4); }
11104 unsigned long dummy_long(unsigned long p) { return p; }
11105 unsigned int dummy_int(unsigned int p) { return p; }
11106 unsigned short dummy_short(unsigned short p) { return p; }
11110 unsigned long along;
11112 unsigned short ashort;
11116 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11117 a direct f = -123. assignment. gcc-2.8.0 reportedly
11118 optimized the whole file away
11120 /* Store the number in a writable string for gcc to pass to
11121 sscanf under HP-UX.
11123 sprintf(str, "-123");
11124 sscanf(str, "%lf", &f); /* f = -123.; */
11126 signal(SIGFPE, blech);
11127 along = (unsigned long)f;
11128 aint = (unsigned int)f;
11129 ashort = (unsigned short)f;
11130 if (along != (unsigned long)-123)
11132 if (aint != (unsigned int)-123)
11134 if (ashort != (unsigned short)-123)
11136 sprintf(str, "1073741824.");
11137 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11140 along = (unsigned long)f;
11141 if (along != 0x80000000)
11145 along = (unsigned long)f;
11146 if (along != 0x7fffffff)
11150 along = (unsigned long)f;
11151 if (along != 0x80000001)
11155 signal(SIGFPE, blech_in_list);
11156 sprintf(str, "123.");
11157 sscanf(str, "%lf", &f); /* f = 123.; */
11158 along = dummy_long((unsigned long)f);
11159 aint = dummy_int((unsigned int)f);
11160 ashort = dummy_short((unsigned short)f);
11161 if (along != (unsigned long)123)
11163 if (aint != (unsigned int)123)
11165 if (ashort != (unsigned short)123)
11172 if eval $compile_ok; then
11176 echo "(I can't seem to compile the test program--assuming it can't)"
11179 case "$castflags" in
11181 echo "Yup, it can."
11184 echo "Nope, it can't."
11191 : see if vprintf exists
11193 if set vprintf val -f d_vprintf; eval $csym; $val; then
11194 echo 'vprintf() found.' >&4
11197 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11198 #$i_varargs I_VARARGS
11200 #$i_stdlib I_STDLIB
11201 #$i_unistd I_UNISTD
11204 # include <stdarg.h>
11205 #else /* I_VARARGS */
11206 # include <varargs.h>
11210 # include <unistd.h>
11214 # include <stdlib.h>
11217 #include <stdio.h> /* vsprintf prototype */
11220 void xxx(int n, ...)
11225 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11227 int main() { xxx(1, "foo"); }
11229 #else /* I_VARARGS */
11237 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11239 int main() { xxx("foo"); }
11245 if eval $compile_ok; then
11246 if $run ./try; then
11247 echo "Your vsprintf() returns (int)." >&4
11250 echo "Your vsprintf() returns (char*)." >&4
11254 echo 'I am unable to compile the vsprintf() test program.' >&4
11255 # We shouldn't get here. If we do, assume the standard signature,
11256 # not the old BSD one.
11257 echo 'Guessing that vsprintf() returns (int).' >&4
11261 echo 'vprintf() NOT found.' >&4
11272 : see if chown exists
11276 : see if chroot exists
11277 set chroot d_chroot
11280 : see if chsize exists
11281 set chsize d_chsize
11284 : see if class exists
11288 : see if clearenv exists
11289 set clearenv d_clearenv
11292 : Define hasstruct macro for Configure internal use
11293 hasstruct='varname=$1; struct=$2; shift; shift;
11294 while $test $# -ge 2; do
11296 $define) echo "#include <$2>";;
11300 echo "int main () { struct $struct foo; }" >> try.c;
11302 if eval $compile; then
11311 : see whether socket exists
11315 $echo $n "Hmm... $c" >&4
11316 if set socket val -f d_socket; eval $csym; $val; then
11317 echo "Looks like you have Berkeley networking support." >&4
11319 if set setsockopt val -f; eval $csym; $val; then
11322 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11323 d_oldsock="$define"
11326 if $contains socklib libc.list >/dev/null 2>&1; then
11327 echo "Looks like you have Berkeley networking support." >&4
11329 : we will have to assume that it supports the 4.2 BSD interface
11332 echo "You don't have Berkeley networking in libc$_a..." >&4
11333 if test "X$d_socket" = "X$define"; then
11334 echo "...but you seem to believe that you have sockets." >&4
11336 for net in net socket
11338 if test -f /usr/lib/lib$net$_a; then
11339 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11340 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11341 if $contains socket libc.list >/dev/null 2>&1; then
11346 echo "...but the Wollongong group seems to have hacked it in." >&4
11347 sockethdr="-I/usr/netinclude"
11350 echo "Found Berkeley sockets interface in lib$net." >&4
11351 if $contains setsockopt libc.list >/dev/null 2>&1; then
11354 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11355 d_oldsock="$define"
11361 if test "X$d_socket" != "X$define"; then
11362 echo "or anywhere else I see." >&4
11370 : see if socketpair exists
11371 set socketpair d_sockpair
11376 echo "Checking the availability sa_len in the sock struct ..." >&4
11378 #include <sys/types.h>
11379 #include <sys/socket.h>
11381 struct sockaddr sa;
11382 return (sa.sa_len);
11386 set try; if eval $compile; then
11389 set d_sockaddr_sa_len; eval $setvar
11393 echo "Checking the availability struct sockaddr_in6 ..." >&4
11395 #include <sys/types.h>
11396 #include <sys/socket.h>
11397 #include <netinet/in.h>
11399 struct sockaddr_in6 sin6;
11400 return (sin6.sin6_family);
11404 set try; if eval $compile; then
11407 set d_sockaddr_in6; eval $setvar
11411 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11413 #include <sys/types.h>
11414 #include <sys/socket.h>
11415 #include <netinet/in.h>
11417 struct sockaddr_in6 sin6;
11418 return (sin6.sin6_scope_id);
11422 set try; if eval $compile; then
11425 set d_sin6_scope_id; eval $setvar
11429 echo "Checking the availability struct ip_mreq ..." >&4
11431 #include <sys/types.h>
11432 #include <sys/socket.h>
11433 #include <netinet/in.h>
11435 struct ip_mreq mreq;
11436 return (mreq.imr_multiaddr.s_addr);
11440 set try; if eval $compile; then
11443 set d_ip_mreq; eval $setvar
11447 echo "Checking the availability struct ip_mreq_source ..." >&4
11449 #include <sys/types.h>
11450 #include <sys/socket.h>
11451 #include <netinet/in.h>
11453 struct ip_mreq_source mreq;
11454 return (mreq.imr_multiaddr.s_addr);
11458 set try; if eval $compile; then
11461 set d_ip_mreq_source; eval $setvar
11465 echo "Checking the availability struct ipv6_mreq ..." >&4
11467 #include <sys/types.h>
11468 #include <sys/socket.h>
11469 #include <netinet/in.h>
11471 struct ipv6_mreq mreq;
11472 return (mreq.ipv6mr_interface);
11476 set try; if eval $compile; then
11479 set d_ipv6_mreq; eval $setvar
11483 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11485 #include <sys/types.h>
11486 #include <sys/socket.h>
11487 #include <netinet/in.h>
11489 struct ipv6_mreq_source mreq;
11490 return (mreq.imr_multiaddr.s_addr);
11494 set try; if eval $compile; then
11497 set d_ipv6_mreq_source; eval $setvar
11501 echo "Checking the availability of certain socket constants..." >&4
11502 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11503 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11505 #include <sys/types.h>
11506 #include <sys/socket.h>
11512 set try; if eval $compile; then
11515 set d_${enum}; eval $setvar
11519 : see if this is a sys/uio.h system
11520 set sys/uio.h i_sysuio
11523 : Check for cmsghdr support
11525 echo "Checking to see if your system supports struct cmsghdr..." >&4
11526 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11528 case "$d_cmsghdr_s" in
11529 "$define") echo "Yes, it does." ;;
11530 *) echo "No, it doesn't." ;;
11534 : check for const keyword
11536 echo 'Checking to see if your C compiler knows about "const"...' >&4
11537 $cat >const.c <<'EOCP'
11538 typedef struct spug { int drokk; } spug;
11542 const spug y = { 0 };
11545 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11547 echo "Yup, it does."
11550 echo "Nope, it doesn't."
11555 : see if copysignl exists
11556 set copysignl d_copysignl
11559 : see if crypt exists
11564 $define) cryptlib='' ;;
11565 *) if set crypt val -f d_crypt; eval $csym; $val; then
11566 echo 'crypt() found.' >&4
11570 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11571 if $test -z "$cryptlib"; then
11572 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11576 if $test -z "$cryptlib"; then
11577 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11581 if $test -z "$cryptlib"; then
11582 cryptlib=`./loc libcrypt$_a "" $libpth`
11586 if $test -z "$cryptlib"; then
11587 echo 'crypt() NOT found.' >&4
11598 : see if this is a crypt.h system
11599 set crypt.h i_crypt
11602 : see if crypt_r exists
11603 set crypt_r d_crypt_r
11605 case "$d_crypt_r" in
11607 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11608 case "$d_crypt_r_proto:$usethreads" in
11609 ":define") d_crypt_r_proto=define
11610 set d_crypt_r_proto crypt_r $hdrs
11614 case "$d_crypt_r_proto" in
11616 case "$crypt_r_proto" in
11617 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11618 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11620 case "$crypt_r_proto" in
11621 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11622 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11624 case "$crypt_r_proto" in
11625 ''|0) d_crypt_r=undef
11627 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11628 * ) case "$crypt_r_proto" in
11629 REENTRANT_PROTO*) ;;
11630 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11632 echo "Prototype: $try" ;;
11635 *) case "$usethreads" in
11636 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11647 : get csh whereabouts
11649 'csh') val="$undef" ;;
11650 *) val="$define" ;;
11654 : Respect a hint or command line value for full_csh.
11655 case "$full_csh" in
11656 '') full_csh=$csh ;;
11659 : see if ctermid exists
11660 set ctermid d_ctermid
11663 : see if ctermid_r exists
11664 set ctermid_r d_ctermid_r
11666 case "$d_ctermid_r" in
11668 hdrs="$i_systypes sys/types.h define stdio.h "
11669 case "$d_ctermid_r_proto:$usethreads" in
11670 ":define") d_ctermid_r_proto=define
11671 set d_ctermid_r_proto ctermid_r $hdrs
11675 case "$d_ctermid_r_proto" in
11677 case "$ctermid_r_proto" in
11678 ''|0) try='char* ctermid_r(char*);'
11679 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11681 case "$ctermid_r_proto" in
11682 ''|0) d_ctermid_r=undef
11684 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11685 * ) case "$ctermid_r_proto" in
11686 REENTRANT_PROTO*) ;;
11687 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11689 echo "Prototype: $try" ;;
11692 *) case "$usethreads" in
11693 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11700 *) ctermid_r_proto=0
11704 : see if ctime_r exists
11705 set ctime_r d_ctime_r
11707 case "$d_ctime_r" in
11709 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11710 case "$d_ctime_r_proto:$usethreads" in
11711 ":define") d_ctime_r_proto=define
11712 set d_ctime_r_proto ctime_r $hdrs
11716 case "$d_ctime_r_proto" in
11718 case "$ctime_r_proto" in
11719 ''|0) try='char* ctime_r(const time_t*, char*);'
11720 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11722 case "$ctime_r_proto" in
11723 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11724 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11726 case "$ctime_r_proto" in
11727 ''|0) try='int ctime_r(const time_t*, char*);'
11728 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11730 case "$ctime_r_proto" in
11731 ''|0) try='int ctime_r(const time_t*, char*, int);'
11732 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11734 case "$ctime_r_proto" in
11735 ''|0) d_ctime_r=undef
11737 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11738 * ) case "$ctime_r_proto" in
11739 REENTRANT_PROTO*) ;;
11740 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11742 echo "Prototype: $try" ;;
11745 *) case "$usethreads" in
11746 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11757 : see if cuserid exists
11758 set cuserid d_cuserid
11761 : see if this is a limits.h system
11762 set limits.h i_limits
11765 : see if this is a float.h system
11766 set float.h i_float
11769 : See if number of significant digits in a double precision number is known
11771 $cat >dbl_dig.c <<EOM
11772 #$i_limits I_LIMITS
11775 #include <limits.h>
11781 printf("Contains DBL_DIG");
11784 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11785 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11786 echo "DBL_DIG found." >&4
11789 echo "DBL_DIG NOT found." >&4
11796 : see if dbm.h is available
11797 : see if dbmclose exists
11798 set dbmclose d_dbmclose
11801 case "$d_dbmclose" in
11811 *) set rpcsvc/dbm.h i_rpcsvcdbm
11816 *) echo "We won't be including <dbm.h>"
11826 : see if prototype for dbminit is available
11828 set d_dbminitproto dbminit $i_dbm dbm.h
11831 : see if difftime exists
11832 set difftime d_difftime
11835 : see if this is a dirent system
11837 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11839 echo "<dirent.h> found." >&4
11842 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11843 echo "<sys/dir.h> found." >&4
11846 xinc=`./findhdr sys/ndir.h`
11848 echo "<dirent.h> NOT found." >&4
11853 : Look for type of directory structure.
11855 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11857 case "$direntrytype" in
11859 case "$i_dirent" in
11860 $define) guess1='struct dirent' ;;
11861 *) guess1='struct direct' ;;
11864 *) guess1="$direntrytype"
11869 'struct dirent') guess2='struct direct' ;;
11870 *) guess2='struct dirent' ;;
11873 if $contains "$guess1" try.c >/dev/null 2>&1; then
11874 direntrytype="$guess1"
11875 echo "Your directory entries are $direntrytype." >&4
11876 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11877 direntrytype="$guess2"
11878 echo "Your directory entries seem to be $direntrytype." >&4
11880 echo "I don't recognize your system's directory entries." >&4
11881 rp="What type is used for directory entries on this system?"
11884 direntrytype="$ans"
11888 : see if the directory entry stores field length
11890 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11891 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11892 echo "Good, your directory entry keeps length information in d_namlen." >&4
11895 echo "Your directory entry does not know about the d_namlen field." >&4
11902 : Look for DIR.dd_fd
11903 case "$i_dirent" in
11905 echo "Checking to see if DIR has a dd_fd member variable" >&4
11907 #$i_stdlib I_STDLIB
11909 #include <stdlib.h>
11911 #include <dirent.h>
11921 if eval $compile; then
11922 echo "Yes, it does."
11925 echo "No, it does not."
11930 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11938 : see if this is an sysdir system
11939 set sys/dir.h i_sysdir
11942 : see if this is an sysndir system
11943 set sys/ndir.h i_sysndir
11948 $cat >dirfd.c <<EOM
11950 #$i_stdlib I_STDLIB
11952 #include <stdlib.h>
11954 #$i_dirent I_DIRENT /**/
11955 #$i_sysdir I_SYS_DIR /**/
11956 #$i_sysndir I_SYS_NDIR /**/
11957 #$i_systypes I_SYS_TYPES /**/
11958 #if defined(I_SYS_TYPES)
11959 #include <sys/types.h>
11961 #if defined(I_DIRENT)
11962 #include <dirent.h>
11963 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11964 #include <sys/dir.h>
11968 #include <sys/ndir.h>
11972 #include <ndir.h> /* may be wrong in the future */
11974 #include <sys/dir.h>
11980 DIR *dirp = opendir(".");
11981 if (dirfd(dirp) >= 0)
11989 if eval $compile; then
11993 $define) echo "dirfd() found." >&4 ;;
11994 *) echo "dirfd() NOT found." >&4 ;;
12000 : see if dlerror exists
12003 set dlerror d_dlerror
12007 : see if dlfcn is available
12008 set dlfcn.h i_dlfcn
12011 : Check what extension to use for shared libs
12016 On a few systems, the dynamically loaded modules that perl generates and uses
12017 will need a different extension than shared libs. The default will probably
12023 *) dflt="$dlext" ;;
12025 rp='What is the extension of dynamically loaded modules'
12034 : Check if dlsym need a leading underscore
12040 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12041 $cat >dyna.c <<'EOM'
12048 #$i_stdlib I_STDLIB
12050 #include <stdlib.h>
12054 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12056 #include <sys/types.h>
12061 extern int fred() ;
12070 int mode = RTLD_LAZY ;
12072 handle = dlopen("./dyna.$dlext", mode) ;
12073 if (handle == NULL) {
12078 symbol = dlsym(handle, "fred") ;
12079 if (symbol == NULL) {
12080 /* try putting a leading underscore */
12081 symbol = dlsym(handle, "_fred") ;
12082 if (symbol == NULL) {
12095 : Call the object file tmp-dyna.o in case dlext=o.
12096 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12097 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12098 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12099 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12102 1) echo "Test program failed using dlopen." >&4
12103 echo "Perhaps you should not use dynamic loading." >&4;;
12104 2) echo "Test program failed using dlsym." >&4
12105 echo "Perhaps you should not use dynamic loading." >&4;;
12106 3) echo "dlsym needs a leading underscore" >&4
12108 4) echo "dlsym doesn't need a leading underscore." >&4;;
12111 echo "I can't compile and run the test program." >&4
12112 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12117 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12122 : see if drand48_r exists
12123 set drand48_r d_drand48_r
12125 case "$d_drand48_r" in
12127 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12128 case "$d_drand48_r_proto:$usethreads" in
12129 ":define") d_drand48_r_proto=define
12130 set d_drand48_r_proto drand48_r $hdrs
12134 case "$d_drand48_r_proto" in
12136 case "$drand48_r_proto" in
12137 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12138 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12140 case "$drand48_r_proto" in
12141 ''|0) d_drand48_r=undef
12143 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12144 * ) case "$drand48_r_proto" in
12145 REENTRANT_PROTO*) ;;
12146 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12148 echo "Prototype: $try" ;;
12151 *) case "$usethreads" in
12152 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12159 *) drand48_r_proto=0
12163 : see if prototype for drand48 is available
12165 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12168 : see if dup2 exists
12172 : see if eaccess exists
12173 set eaccess d_eaccess
12176 : see if endgrent exists
12177 set endgrent d_endgrent
12180 : see if this is an grp system
12186 xxx=`./findhdr grp.h`
12187 $cppstdin $cppflags $cppminus < $xxx >$$.h
12189 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12201 set d_grpasswd; eval $setvar
12205 : see if endgrent_r exists
12206 set endgrent_r d_endgrent_r
12208 case "$d_endgrent_r" in
12210 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12211 case "$d_endgrent_r_proto:$usethreads" in
12212 ":define") d_endgrent_r_proto=define
12213 set d_endgrent_r_proto endgrent_r $hdrs
12217 case "$d_endgrent_r_proto" in
12219 case "$endgrent_r_proto" in
12220 ''|0) try='int endgrent_r(FILE**);'
12221 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12223 case "$endgrent_r_proto" in
12224 ''|0) try='void endgrent_r(FILE**);'
12225 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12227 case "$endgrent_r_proto" in
12228 ''|0) d_endgrent_r=undef
12230 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12231 * ) case "$endgrent_r_proto" in
12232 REENTRANT_PROTO*) ;;
12233 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12235 echo "Prototype: $try" ;;
12238 *) case "$usethreads" in
12239 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12246 *) endgrent_r_proto=0
12250 : see if endhostent exists
12251 set endhostent d_endhent
12254 : see if this is a netdb.h system
12255 set netdb.h i_netdb
12258 : see if endhostent_r exists
12259 set endhostent_r d_endhostent_r
12261 case "$d_endhostent_r" in
12263 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12264 case "$d_endhostent_r_proto:$usethreads" in
12265 ":define") d_endhostent_r_proto=define
12266 set d_endhostent_r_proto endhostent_r $hdrs
12270 case "$d_endhostent_r_proto" in
12272 case "$endhostent_r_proto" in
12273 ''|0) try='int endhostent_r(struct hostent_data*);'
12274 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12276 case "$endhostent_r_proto" in
12277 ''|0) try='void endhostent_r(struct hostent_data*);'
12278 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12280 case "$endhostent_r_proto" in
12281 ''|0) d_endhostent_r=undef
12282 endhostent_r_proto=0
12283 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12284 * ) case "$endhostent_r_proto" in
12285 REENTRANT_PROTO*) ;;
12286 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12288 echo "Prototype: $try" ;;
12291 *) case "$usethreads" in
12292 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12294 d_endhostent_r=undef
12295 endhostent_r_proto=0
12299 *) endhostent_r_proto=0
12303 : see if endnetent exists
12304 set endnetent d_endnent
12307 : see if endnetent_r exists
12308 set endnetent_r d_endnetent_r
12310 case "$d_endnetent_r" in
12312 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12313 case "$d_endnetent_r_proto:$usethreads" in
12314 ":define") d_endnetent_r_proto=define
12315 set d_endnetent_r_proto endnetent_r $hdrs
12319 case "$d_endnetent_r_proto" in
12321 case "$endnetent_r_proto" in
12322 ''|0) try='int endnetent_r(struct netent_data*);'
12323 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12325 case "$endnetent_r_proto" in
12326 ''|0) try='void endnetent_r(struct netent_data*);'
12327 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12329 case "$endnetent_r_proto" in
12330 ''|0) d_endnetent_r=undef
12331 endnetent_r_proto=0
12332 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12333 * ) case "$endnetent_r_proto" in
12334 REENTRANT_PROTO*) ;;
12335 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12337 echo "Prototype: $try" ;;
12340 *) case "$usethreads" in
12341 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12343 d_endnetent_r=undef
12344 endnetent_r_proto=0
12348 *) endnetent_r_proto=0
12352 : see if endprotoent exists
12353 set endprotoent d_endpent
12356 : see if endprotoent_r exists
12357 set endprotoent_r d_endprotoent_r
12359 case "$d_endprotoent_r" in
12361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12362 case "$d_endprotoent_r_proto:$usethreads" in
12363 ":define") d_endprotoent_r_proto=define
12364 set d_endprotoent_r_proto endprotoent_r $hdrs
12368 case "$d_endprotoent_r_proto" in
12370 case "$endprotoent_r_proto" in
12371 ''|0) try='int endprotoent_r(struct protoent_data*);'
12372 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12374 case "$endprotoent_r_proto" in
12375 ''|0) try='void endprotoent_r(struct protoent_data*);'
12376 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12378 case "$endprotoent_r_proto" in
12379 ''|0) d_endprotoent_r=undef
12380 endprotoent_r_proto=0
12381 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12382 * ) case "$endprotoent_r_proto" in
12383 REENTRANT_PROTO*) ;;
12384 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12386 echo "Prototype: $try" ;;
12389 *) case "$usethreads" in
12390 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12392 d_endprotoent_r=undef
12393 endprotoent_r_proto=0
12397 *) endprotoent_r_proto=0
12401 : see if endpwent exists
12402 set endpwent d_endpwent
12405 : see if this is a pwd.h system
12411 xxx=`./findhdr pwd.h`
12412 $cppstdin $cppflags $cppminus < $xxx >$$.h
12414 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12422 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12430 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12438 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12446 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12454 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12462 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12470 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12482 set d_pwquota; eval $setvar
12483 set d_pwage; eval $setvar
12484 set d_pwchange; eval $setvar
12485 set d_pwclass; eval $setvar
12486 set d_pwexpire; eval $setvar
12487 set d_pwcomment; eval $setvar
12488 set d_pwgecos; eval $setvar
12489 set d_pwpasswd; eval $setvar
12493 : see if endpwent_r exists
12494 set endpwent_r d_endpwent_r
12496 case "$d_endpwent_r" in
12498 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12499 case "$d_endpwent_r_proto:$usethreads" in
12500 ":define") d_endpwent_r_proto=define
12501 set d_endpwent_r_proto endpwent_r $hdrs
12505 case "$d_endpwent_r_proto" in
12507 case "$endpwent_r_proto" in
12508 ''|0) try='int endpwent_r(FILE**);'
12509 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12511 case "$endpwent_r_proto" in
12512 ''|0) try='void endpwent_r(FILE**);'
12513 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12515 case "$endpwent_r_proto" in
12516 ''|0) d_endpwent_r=undef
12518 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12519 * ) case "$endpwent_r_proto" in
12520 REENTRANT_PROTO*) ;;
12521 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12523 echo "Prototype: $try" ;;
12526 *) case "$usethreads" in
12527 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12534 *) endpwent_r_proto=0
12538 : see if endservent exists
12539 set endservent d_endsent
12542 : see if endservent_r exists
12543 set endservent_r d_endservent_r
12545 case "$d_endservent_r" in
12547 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12548 case "$d_endservent_r_proto:$usethreads" in
12549 ":define") d_endservent_r_proto=define
12550 set d_endservent_r_proto endservent_r $hdrs
12554 case "$d_endservent_r_proto" in
12556 case "$endservent_r_proto" in
12557 ''|0) try='int endservent_r(struct servent_data*);'
12558 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12560 case "$endservent_r_proto" in
12561 ''|0) try='void endservent_r(struct servent_data*);'
12562 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12564 case "$endservent_r_proto" in
12565 ''|0) d_endservent_r=undef
12566 endservent_r_proto=0
12567 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12568 * ) case "$endservent_r_proto" in
12569 REENTRANT_PROTO*) ;;
12570 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12572 echo "Prototype: $try" ;;
12575 *) case "$usethreads" in
12576 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12578 d_endservent_r=undef
12579 endservent_r_proto=0
12583 *) endservent_r_proto=0
12587 : Locate the flags for 'open()'
12590 #include <sys/types.h>
12595 #include <sys/file.h>
12597 #$i_stdlib I_STDLIB
12599 #include <stdlib.h>
12610 : check sys/file.h first to get FREAD on Sun
12611 if $test `./findhdr sys/file.h` && \
12612 set try -DI_SYS_FILE && eval $compile; then
12614 echo "<sys/file.h> defines the O_* constants..." >&4
12615 if $run ./try; then
12616 echo "and you have the 3 argument form of open()." >&4
12619 echo "but not the 3 argument form of open(). Oh, well." >&4
12622 elif $test `./findhdr fcntl.h` && \
12623 set try -DI_FCNTL && eval $compile; then
12625 echo "<fcntl.h> defines the O_* constants..." >&4
12626 if $run ./try; then
12627 echo "and you have the 3 argument form of open()." >&4
12630 echo "but not the 3 argument form of open(). Oh, well." >&4
12635 echo "I can't find the O_* constant definitions! You got problems." >&4
12641 : see if this is a sys/file.h system
12646 : do we need to include sys/file.h ?
12650 if $h_sysfile; then
12652 echo "We'll be including <sys/file.h>." >&4
12655 echo "We won't be including <sys/file.h>." >&4
12665 : see if fcntl.h is there
12670 : see if we can include fcntl.h
12676 echo "We'll be including <fcntl.h>." >&4
12679 if $h_sysfile; then
12680 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12682 echo "We won't be including <fcntl.h>." >&4
12694 : see if fork exists
12698 : see if pipe exists
12702 : check for non-blocking I/O stuff
12703 case "$h_sysfile" in
12704 true) echo "#include <sys/file.h>" > head.c;;
12707 true) echo "#include <fcntl.h>" > head.c;;
12708 *) echo "#include <sys/fcntl.h>" > head.c;;
12713 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12714 case "$o_nonblock" in
12716 $cat head.c > try.c
12717 $cat >>try.c <<EOCP
12719 #$i_stdlib I_STDLIB
12721 #include <stdlib.h>
12729 printf("O_NONBLOCK\n");
12733 printf("O_NDELAY\n");
12737 printf("FNDELAY\n");
12744 if eval $compile_ok; then
12745 o_nonblock=`$run ./try`
12746 case "$o_nonblock" in
12747 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12748 *) echo "Seems like we can use $o_nonblock.";;
12751 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12754 *) echo "Using $hint value $o_nonblock.";;
12759 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12762 case "$d_fork:$d_pipe" in
12764 $cat head.c > try.c
12765 $cat >>try.c <<EOCP
12767 #include <sys/types.h>
12768 #include <signal.h>
12770 #$i_stdlib I_STDLIB
12772 #include <stdlib.h>
12778 #define MY_O_NONBLOCK $o_nonblock
12779 #ifndef errno /* XXX need better Configure test */
12782 #$i_unistd I_UNISTD
12784 #include <unistd.h>
12786 #$i_string I_STRING
12788 #include <string.h>
12790 #include <strings.h>
12792 $signal_t blech(int x) { exit(3); }
12794 $cat >> try.c <<'EOCP'
12802 pipe(pd); /* Down: child -> parent */
12803 pipe(pu); /* Up: parent -> child */
12806 close(pd[1]); /* Parent reads from pd[0] */
12807 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12809 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12814 signal(SIGALRM, blech);
12816 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12818 sprintf(string, "%d\n", ret);
12819 write(2, string, strlen(string));
12822 if (errno == EAGAIN) {
12823 printf("EAGAIN\n");
12828 if (errno == EWOULDBLOCK)
12829 printf("EWOULDBLOCK\n");
12832 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12833 sleep(2); /* Give it time to close our pipe */
12835 ret = read(pd[0], buf, 1); /* Should read EOF */
12837 sprintf(string, "%d\n", ret);
12838 write(4, string, strlen(string));
12842 close(pd[0]); /* We write to pd[1] */
12843 close(pu[1]); /* We read from pu[0] */
12844 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12845 close(pd[1]); /* Pipe pd is now fully closed! */
12846 exit(0); /* Bye bye, thank you for playing! */
12850 if eval $compile_ok; then
12851 echo "$startsh" >mtry
12852 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12854 ./mtry >/dev/null 2>&1
12856 0) eagain=`$cat try.out`;;
12857 1) echo "Could not perform non-blocking setting!";;
12858 2) echo "I did a successful read() for something that was not there!";;
12859 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12860 4) echo "Could not find F_SETFL!";;
12861 *) echo "Something terribly wrong happened during testing.";;
12863 rd_nodata=`$cat try.ret`
12864 echo "A read() system call with no data present returns $rd_nodata."
12865 case "$rd_nodata" in
12868 echo "(That's peculiar, fixing that to be -1.)"
12874 echo "Forcing errno EAGAIN on read() with no data available."
12878 echo "Your read() sets errno to $eagain when no data is available."
12881 status=`$cat try.err`
12883 0) echo "And it correctly returns 0 to signal EOF.";;
12884 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12885 *) echo "However, your read() returns '$status' on EOF??";;
12888 if test "$status" = "$rd_nodata"; then
12889 echo "WARNING: you can't distinguish between EOF and no data!"
12893 echo "I can't compile the test program--assuming errno EAGAIN will do."
12897 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12906 echo "Using $hint value $eagain."
12907 echo "Your read() returns $rd_nodata when no data is present."
12908 case "$d_eofnblk" in
12909 "$define") echo "And you can see EOF because read() returns 0.";;
12910 "$undef") echo "But you can't see EOF status from read() returned value.";;
12912 echo "(Assuming you can't see EOF status from read anyway.)"
12918 $rm_try head.c mtry
12920 : see if _ptr and _cnt from stdio act std
12923 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12924 echo "(Looks like you have stdio.h from BSD.)"
12925 case "$stdio_ptr" in
12926 '') stdio_ptr='((fp)->_p)'
12929 *) ptr_lval=$d_stdio_ptr_lval;;
12931 case "$stdio_cnt" in
12932 '') stdio_cnt='((fp)->_r)'
12935 *) cnt_lval=$d_stdio_cnt_lval;;
12937 case "$stdio_base" in
12938 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12940 case "$stdio_bufsiz" in
12941 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12943 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12944 echo "(Looks like you have stdio.h from Linux.)"
12945 case "$stdio_ptr" in
12946 '') stdio_ptr='((fp)->_IO_read_ptr)'
12949 *) ptr_lval=$d_stdio_ptr_lval;;
12951 case "$stdio_cnt" in
12952 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12955 *) cnt_lval=$d_stdio_cnt_lval;;
12957 case "$stdio_base" in
12958 '') stdio_base='((fp)->_IO_read_base)';;
12960 case "$stdio_bufsiz" in
12961 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12964 case "$stdio_ptr" in
12965 '') stdio_ptr='((fp)->_ptr)'
12968 *) ptr_lval=$d_stdio_ptr_lval;;
12970 case "$stdio_cnt" in
12971 '') stdio_cnt='((fp)->_cnt)'
12974 *) cnt_lval=$d_stdio_cnt_lval;;
12976 case "$stdio_base" in
12977 '') stdio_base='((fp)->_base)';;
12979 case "$stdio_bufsiz" in
12980 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12984 : test whether _ptr and _cnt really work
12985 echo "Checking how std your stdio is..." >&4
12988 #$i_stdlib I_STDLIB
12990 #include <stdlib.h>
12992 #define FILE_ptr(fp) $stdio_ptr
12993 #define FILE_cnt(fp) $stdio_cnt
12995 FILE *fp = fopen("try.c", "r");
12998 18 <= FILE_cnt(fp) &&
12999 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13007 if eval $compile && $to try.c; then
13008 if $run ./try; then
13009 echo "Your stdio acts pretty std."
13012 echo "Your stdio isn't very std."
13015 echo "Your stdio doesn't appear very std."
13019 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13020 # direct buffer manipulation no longer works. The Configure tests
13021 # should be changed to correctly detect this, but until then,
13022 # the following check should at least let perl compile and run.
13023 # (This quick fix should be updated before 5.8.1.)
13024 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13025 # A. Dougherty, June 3, 2002.
13026 case "$d_gnulibc" in
13028 case "$gnulibc_version" in
13032 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13041 : Can _ptr be used as an lvalue?
13042 case "$d_stdstdio$ptr_lval" in
13043 $define$define) val=$define ;;
13046 set d_stdio_ptr_lval
13049 : Can _cnt be used as an lvalue?
13050 case "$d_stdstdio$cnt_lval" in
13051 $define$define) val=$define ;;
13054 set d_stdio_cnt_lval
13058 : test whether setting _ptr sets _cnt as a side effect
13059 d_stdio_ptr_lval_sets_cnt="$undef"
13060 d_stdio_ptr_lval_nochange_cnt="$undef"
13061 case "$d_stdio_ptr_lval$d_stdstdio" in
13063 echo "Checking to see what happens if we set the stdio ptr..." >&4
13066 /* Can we scream? */
13067 /* Eat dust sed :-) */
13068 /* In the buffer space, no one can hear you scream. */
13069 #$i_stdlib I_STDLIB
13071 #include <stdlib.h>
13073 #define FILE_ptr(fp) $stdio_ptr
13074 #define FILE_cnt(fp) $stdio_cnt
13075 #include <sys/types.h>
13077 FILE *fp = fopen("try.c", "r");
13082 puts("Fail even to read");
13085 c = getc(fp); /* Read away the first # */
13087 puts("Fail even to read");
13091 18 <= FILE_cnt(fp) &&
13092 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13094 puts("Fail even to read");
13097 ptr = (char*) FILE_ptr(fp);
13098 cnt = (size_t)FILE_cnt(fp);
13100 FILE_ptr(fp) += 42;
13102 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13103 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13106 if (FILE_cnt(fp) <= 20) {
13107 printf ("Fail (<20 chars to test)");
13110 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13111 puts("Fail compare");
13114 if (cnt == FILE_cnt(fp)) {
13115 puts("Pass_unchanged");
13118 if (FILE_cnt(fp) == (cnt - 42)) {
13119 puts("Pass_changed");
13122 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13128 if eval $compile && $to try.c; then
13129 case `$run ./try` in
13131 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13132 d_stdio_ptr_lval_sets_cnt="$define" ;;
13134 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13135 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13137 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13139 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13142 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13148 : see if _base is also standard
13150 case "$d_stdstdio" in
13154 #$i_stdlib I_STDLIB
13156 #include <stdlib.h>
13158 #define FILE_base(fp) $stdio_base
13159 #define FILE_bufsiz(fp) $stdio_bufsiz
13161 FILE *fp = fopen("try.c", "r");
13164 19 <= FILE_bufsiz(fp) &&
13165 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13172 if eval $compile && $to try.c; then
13173 if $run ./try; then
13174 echo "And its _base field acts std."
13177 echo "But its _base field isn't std."
13180 echo "However, it seems to be lacking the _base field."
13188 : see if fast_stdio exists
13190 case "$d_stdstdio:$d_stdio_ptr_lval" in
13192 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13194 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13205 : see if fchdir exists
13206 set fchdir d_fchdir
13209 : see if fchmod exists
13210 set fchmod d_fchmod
13213 : see if fchown exists
13214 set fchown d_fchown
13217 : see if this is an fcntl system
13221 : See if fcntl-based locking works.
13224 #$i_stdlib I_STDLIB
13226 #include <stdlib.h>
13228 #include <unistd.h>
13230 #include <signal.h>
13231 $signal_t blech(int x) { exit(3); }
13233 #if defined(F_SETLK) && defined(F_SETLKW)
13234 struct flock flock;
13236 fd = open("try.c", O_RDONLY);
13237 flock.l_type = F_RDLCK;
13238 flock.l_whence = SEEK_SET;
13239 flock.l_start = flock.l_len = 0;
13240 signal(SIGALRM, blech);
13242 retval = fcntl(fd, F_SETLK, &flock);
13244 (retval < 0 ? exit(2) : exit(0));
13250 echo "Checking if fcntl-based file locking works... "
13254 if eval $compile_ok; then
13255 if $run ./try; then
13256 echo "Yes, it seems to work."
13259 echo "Nope, it didn't work."
13264 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13265 *** This is (almost) impossible.
13266 *** If your NFS lock daemons are not feeling well, something like
13267 *** this may happen, please investigate. Cannot continue, aborting.
13275 echo "I'm unable to compile the test program, so I'll assume not."
13280 echo "Nope, since you don't even have fcntl()."
13283 set d_fcntl_can_lock
13287 : check for fd_set items
13290 Checking to see how well your C compiler handles fd_set and friends ...
13293 #$i_stdlib I_STDLIB
13295 #include <stdlib.h>
13297 #$i_systime I_SYS_TIME
13298 #$i_sysselct I_SYS_SELECT
13299 #$d_socket HAS_SOCKET
13300 #include <sys/types.h>
13302 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13305 #include <sys/time.h>
13307 #ifdef I_SYS_SELECT
13308 #include <sys/select.h>
13317 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13325 if eval $compile; then
13326 d_fds_bits="$define"
13328 echo "Well, your system knows about the normal fd_set typedef..." >&4
13329 if $run ./try; then
13330 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13331 d_fd_macros="$define"
13334 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13336 d_fd_macros="$undef"
13340 Hmm, your compiler has some difficulty with fd_set. Checking further...
13343 if eval $compile; then
13344 d_fds_bits="$undef"
13346 echo "Well, your system has some sort of fd_set available..." >&4
13347 if $run ./try; then
13348 echo "and you have the normal fd_set macros." >&4
13349 d_fd_macros="$define"
13352 but not the normal fd_set macros! Gross! More work for me...
13354 d_fd_macros="$undef"
13357 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13359 d_fds_bits="$undef"
13360 d_fd_macros="$undef"
13365 : see if fgetpos exists
13366 set fgetpos d_fgetpos
13369 : see if finite exists
13370 set finite d_finite
13373 : see if finitel exists
13374 set finitel d_finitel
13377 : see if flock exists
13381 : see if prototype for flock is available
13383 set d_flockproto flock $i_sysfile sys/file.h
13386 : see if fp_class exists
13387 set fp_class d_fp_class
13390 : see if pathconf exists
13391 set pathconf d_pathconf
13394 : see if fpathconf exists
13395 set fpathconf d_fpathconf
13398 : see if fpclass exists
13399 set fpclass d_fpclass
13402 : see if fpclassify exists
13403 set fpclassify d_fpclassify
13406 : see if fpclassl exists
13407 set fpclassl d_fpclassl
13410 : check for fpos64_t
13412 echo "Checking to see if you have fpos64_t..." >&4
13415 int main() { fpos64_t x = 7; }
13418 if eval $compile; then
13420 echo "You have fpos64_t."
13423 echo "You do not have fpos64_t."
13424 case "$fpossize" in
13425 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13432 : see if frexpl exists
13433 set frexpl d_frexpl
13436 : see if this is a sys/param system
13437 set sys/param.h i_sysparam
13440 : see if this is a sys/mount.h system
13441 set sys/mount.h i_sysmount
13444 : Check for fs_data_s
13446 echo "Checking to see if your system supports struct fs_data..." >&4
13447 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13449 case "$d_fs_data_s" in
13450 "$define") echo "Yes, it does." ;;
13451 *) echo "No, it doesn't." ;;
13454 : see if fseeko exists
13455 set fseeko d_fseeko
13457 case "$longsize" in
13458 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13461 : see if fsetpos exists
13462 set fsetpos d_fsetpos
13465 : see if fstatfs exists
13466 set fstatfs d_fstatfs
13469 : see if statvfs exists
13470 set statvfs d_statvfs
13473 : see if fstatvfs exists
13474 set fstatvfs d_fstatvfs
13478 : see if fsync exists
13482 : see if ftello exists
13483 set ftello d_ftello
13485 case "$longsize" in
13486 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13489 : check for a working futimes
13492 echo "Checking if you have a working futimes()" >&4
13495 #include <sys/time.h>
13502 fd = open ("try.c", O_RDWR);
13503 if (-1 == fd) exit (1);
13504 rv = futimes (fd, NULL);
13505 exit (rv == -1 ? errno : 0);
13509 if eval $compile; then
13513 0) echo "Yes, you have" >&4
13514 d_futimes="$define"
13516 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13520 echo "No, it does not (probably harmless)" >&4
13524 : see if ndbm.h is available
13527 : Compatibility location for RedHat 7.1
13528 set gdbm/ndbm.h i_gdbmndbm
13530 : Compatibility location for Debian 4.0
13531 set gdbm-ndbm.h i_gdbm_ndbm
13535 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13536 : see if dbm_open exists
13537 set dbm_open d_dbm_open
13539 case "$d_dbm_open" in
13542 i_gdbmndbm="$undef"
13543 i_gdbm_ndbm="$undef"
13544 echo "We won't be including <ndbm.h>"
13554 ndbm_hdr_protochk='name=$1; hdr=$2;
13555 eval "ihdr=\$""i_$name";
13557 if $test "$ihdr" = "$define"; then
13558 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13559 case "$d_cplusplus" in
13560 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13561 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13564 $define) $echo "Your <$hdr> seems to have prototypes";;
13565 *) $echo "Your <$hdr> does not seem to have prototypes";;
13568 set "d_${name}_h_uses_prototypes";
13572 eval $ndbm_hdr_protochk
13573 set gdbmndbm gdbm/ndbm.h
13574 eval $ndbm_hdr_protochk
13575 set gdbm_ndbm gdbm-ndbm.h
13576 eval $ndbm_hdr_protochk
13578 : see if getaddrinfo exists
13579 set getaddrinfo d_getaddrinfo
13582 : see if getcwd exists
13583 set getcwd d_getcwd
13586 : see if getespwnam exists
13587 set getespwnam d_getespwnam
13590 : see if getfsstat exists
13591 set getfsstat d_getfsstat
13594 : see if getgrent exists
13595 set getgrent d_getgrent
13598 : see if getgrent_r exists
13599 set getgrent_r d_getgrent_r
13601 case "$d_getgrent_r" in
13603 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13604 case "$d_getgrent_r_proto:$usethreads" in
13605 ":define") d_getgrent_r_proto=define
13606 set d_getgrent_r_proto getgrent_r $hdrs
13610 case "$d_getgrent_r_proto" in
13612 case "$getgrent_r_proto" in
13613 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13614 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13616 case "$getgrent_r_proto" in
13617 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13618 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13620 case "$getgrent_r_proto" in
13621 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13622 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13624 case "$getgrent_r_proto" in
13625 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13626 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13628 case "$getgrent_r_proto" in
13629 ''|0) try='int getgrent_r(struct group*, char*, int);'
13630 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13632 case "$getgrent_r_proto" in
13633 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13634 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13636 case "$getgrent_r_proto" in
13637 ''|0) d_getgrent_r=undef
13639 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13640 * ) case "$getgrent_r_proto" in
13641 REENTRANT_PROTO*) ;;
13642 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13644 echo "Prototype: $try" ;;
13647 *) case "$usethreads" in
13648 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13655 *) getgrent_r_proto=0
13659 : see if getgrgid_r exists
13660 set getgrgid_r d_getgrgid_r
13662 case "$d_getgrgid_r" in
13664 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13665 case "$d_getgrgid_r_proto:$usethreads" in
13666 ":define") d_getgrgid_r_proto=define
13667 set d_getgrgid_r_proto getgrgid_r $hdrs
13671 case "$d_getgrgid_r_proto" in
13673 case "$getgrgid_r_proto" in
13674 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13675 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13677 case "$getgrgid_r_proto" in
13678 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13679 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13681 case "$getgrgid_r_proto" in
13682 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13683 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13685 case "$getgrgid_r_proto" in
13686 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13687 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13689 case "$getgrgid_r_proto" in
13690 ''|0) d_getgrgid_r=undef
13692 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13693 * ) case "$getgrgid_r_proto" in
13694 REENTRANT_PROTO*) ;;
13695 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13697 echo "Prototype: $try" ;;
13700 *) case "$usethreads" in
13701 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13708 *) getgrgid_r_proto=0
13712 : see if getgrnam_r exists
13713 set getgrnam_r d_getgrnam_r
13715 case "$d_getgrnam_r" in
13717 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13718 case "$d_getgrnam_r_proto:$usethreads" in
13719 ":define") d_getgrnam_r_proto=define
13720 set d_getgrnam_r_proto getgrnam_r $hdrs
13724 case "$d_getgrnam_r_proto" in
13726 case "$getgrnam_r_proto" in
13727 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13728 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13730 case "$getgrnam_r_proto" in
13731 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13732 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13734 case "$getgrnam_r_proto" in
13735 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13736 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13738 case "$getgrnam_r_proto" in
13739 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13740 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13742 case "$getgrnam_r_proto" in
13743 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13744 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13746 case "$getgrnam_r_proto" in
13747 ''|0) d_getgrnam_r=undef
13749 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13750 * ) case "$getgrnam_r_proto" in
13751 REENTRANT_PROTO*) ;;
13752 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13754 echo "Prototype: $try" ;;
13757 *) case "$usethreads" in
13758 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13765 *) getgrnam_r_proto=0
13769 : see if gethostbyaddr exists
13770 set gethostbyaddr d_gethbyaddr
13773 : see if gethostbyname exists
13774 set gethostbyname d_gethbyname
13777 : see if gethostent exists
13778 set gethostent d_gethent
13781 : see how we will look up host name
13784 if set gethostname val -f d_gethname; eval $csym; $val; then
13785 echo 'gethostname() found.' >&4
13786 d_gethname="$define"
13789 if set uname val -f d_uname; eval $csym; $val; then
13792 uname() was found, but you're running xenix, and older versions of xenix
13793 have a broken uname(). If you don't really know whether your xenix is old
13794 enough to have a broken system call, use the default answer.
13799 "$define") dflt=n;;
13801 rp='Is your uname() broken?'
13804 n*) d_uname="$define"; call=uname;;
13807 echo 'uname() found.' >&4
13814 case "$d_gethname" in
13815 '') d_gethname="$undef";;
13818 '') d_uname="$undef";;
13820 case "$d_uname$d_gethname" in
13825 Every now and then someone has a $call() that lies about the hostname
13826 but can't be fixed for political or economic reasons. If you wish, I can
13827 pretend $call() isn't there and maybe compute hostname at run-time
13828 thanks to the '$phostname' command.
13831 rp="Shall I ignore $call() from now on?"
13834 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13837 case "$phostname" in
13838 '') aphostname='';;
13839 *) case "$aphostname" in
13841 *) set X $phostname
13845 file=`./loc $file $file $pth`
13846 aphostname=`echo $file $*`
13851 case "$d_uname$d_gethname" in
13854 case "$phostname" in
13856 echo "There will be no way for $package to get your hostname." >&4;;
13858 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13862 case "$d_phostname" in
13863 '') d_phostname="$undef";;
13866 : see if gethostbyaddr_r exists
13867 set gethostbyaddr_r d_gethostbyaddr_r
13869 case "$d_gethostbyaddr_r" in
13871 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13872 case "$d_gethostbyaddr_r_proto:$usethreads" in
13873 ":define") d_gethostbyaddr_r_proto=define
13874 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13878 case "$d_gethostbyaddr_r_proto" in
13880 case "$gethostbyaddr_r_proto" in
13881 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13882 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13884 case "$gethostbyaddr_r_proto" in
13885 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13886 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13888 case "$gethostbyaddr_r_proto" in
13889 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13890 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13892 case "$gethostbyaddr_r_proto" in
13893 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13894 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13896 case "$gethostbyaddr_r_proto" in
13897 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13898 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13900 case "$gethostbyaddr_r_proto" in
13901 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13902 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13904 case "$gethostbyaddr_r_proto" in
13905 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13906 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13908 case "$gethostbyaddr_r_proto" in
13909 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13910 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13912 case "$gethostbyaddr_r_proto" in
13913 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13914 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13916 case "$gethostbyaddr_r_proto" in
13917 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13918 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13920 case "$gethostbyaddr_r_proto" in
13921 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13922 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13924 case "$gethostbyaddr_r_proto" in
13925 ''|0) d_gethostbyaddr_r=undef
13926 gethostbyaddr_r_proto=0
13927 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13928 * ) case "$gethostbyaddr_r_proto" in
13929 REENTRANT_PROTO*) ;;
13930 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13932 echo "Prototype: $try" ;;
13935 *) case "$usethreads" in
13936 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13938 d_gethostbyaddr_r=undef
13939 gethostbyaddr_r_proto=0
13943 *) gethostbyaddr_r_proto=0
13947 : see if gethostbyname_r exists
13948 set gethostbyname_r d_gethostbyname_r
13950 case "$d_gethostbyname_r" in
13952 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13953 case "$d_gethostbyname_r_proto:$usethreads" in
13954 ":define") d_gethostbyname_r_proto=define
13955 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13959 case "$d_gethostbyname_r_proto" in
13961 case "$gethostbyname_r_proto" in
13962 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13963 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13965 case "$gethostbyname_r_proto" in
13966 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13967 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13969 case "$gethostbyname_r_proto" in
13970 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13971 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13973 case "$gethostbyname_r_proto" in
13974 ''|0) d_gethostbyname_r=undef
13975 gethostbyname_r_proto=0
13976 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13977 * ) case "$gethostbyname_r_proto" in
13978 REENTRANT_PROTO*) ;;
13979 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13981 echo "Prototype: $try" ;;
13984 *) case "$usethreads" in
13985 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13987 d_gethostbyname_r=undef
13988 gethostbyname_r_proto=0
13992 *) gethostbyname_r_proto=0
13996 : see if gethostent_r exists
13997 set gethostent_r d_gethostent_r
13999 case "$d_gethostent_r" in
14001 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14002 case "$d_gethostent_r_proto:$usethreads" in
14003 ":define") d_gethostent_r_proto=define
14004 set d_gethostent_r_proto gethostent_r $hdrs
14008 case "$d_gethostent_r_proto" in
14010 case "$gethostent_r_proto" in
14011 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14012 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14014 case "$gethostent_r_proto" in
14015 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14016 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14018 case "$gethostent_r_proto" in
14019 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14020 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14022 case "$gethostent_r_proto" in
14023 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14024 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14026 case "$gethostent_r_proto" in
14027 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14028 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14030 case "$gethostent_r_proto" in
14031 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14032 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14034 case "$gethostent_r_proto" in
14035 ''|0) d_gethostent_r=undef
14036 gethostent_r_proto=0
14037 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14038 * ) case "$gethostent_r_proto" in
14039 REENTRANT_PROTO*) ;;
14040 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14042 echo "Prototype: $try" ;;
14045 *) case "$usethreads" in
14046 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14048 d_gethostent_r=undef
14049 gethostent_r_proto=0
14053 *) gethostent_r_proto=0
14057 : see if prototypes for various gethostxxx netdb.h functions are available
14059 set d_gethostprotos gethostent $i_netdb netdb.h
14062 : see if getitimer exists
14063 set getitimer d_getitimer
14066 : see if getlogin exists
14067 set getlogin d_getlogin
14070 : see if getlogin_r exists
14071 set getlogin_r d_getlogin_r
14073 case "$d_getlogin_r" in
14075 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14076 case "$d_getlogin_r_proto:$usethreads" in
14077 ":define") d_getlogin_r_proto=define
14078 set d_getlogin_r_proto getlogin_r $hdrs
14082 case "$d_getlogin_r_proto" in
14084 case "$getlogin_r_proto" in
14085 ''|0) try='int getlogin_r(char*, size_t);'
14086 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14088 case "$getlogin_r_proto" in
14089 ''|0) try='int getlogin_r(char*, int);'
14090 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14092 case "$getlogin_r_proto" in
14093 ''|0) try='char* getlogin_r(char*, size_t);'
14094 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14096 case "$getlogin_r_proto" in
14097 ''|0) try='char* getlogin_r(char*, int);'
14098 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14100 case "$getlogin_r_proto" in
14101 ''|0) d_getlogin_r=undef
14103 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14104 * ) case "$getlogin_r_proto" in
14105 REENTRANT_PROTO*) ;;
14106 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14108 echo "Prototype: $try" ;;
14111 *) case "$usethreads" in
14112 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14119 *) getlogin_r_proto=0
14123 : see if getmnt exists
14124 set getmnt d_getmnt
14127 : see if getmntent exists
14128 set getmntent d_getmntent
14131 : see if getnameinfo exists
14132 set getnameinfo d_getnameinfo
14135 : see if getnetbyaddr exists
14136 set getnetbyaddr d_getnbyaddr
14139 : see if getnetbyname exists
14140 set getnetbyname d_getnbyname
14143 : see if getnetent exists
14144 set getnetent d_getnent
14147 : see if getnetbyaddr_r exists
14148 set getnetbyaddr_r d_getnetbyaddr_r
14150 case "$d_getnetbyaddr_r" in
14152 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14153 case "$d_getnetbyaddr_r_proto:$usethreads" in
14154 ":define") d_getnetbyaddr_r_proto=define
14155 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14159 case "$d_getnetbyaddr_r_proto" in
14161 case "$getnetbyaddr_r_proto" in
14162 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14163 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14165 case "$getnetbyaddr_r_proto" in
14166 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14167 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14169 case "$getnetbyaddr_r_proto" in
14170 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14171 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14173 case "$getnetbyaddr_r_proto" in
14174 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14175 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14177 case "$getnetbyaddr_r_proto" in
14178 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14179 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14181 case "$getnetbyaddr_r_proto" in
14182 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14183 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14185 case "$getnetbyaddr_r_proto" in
14186 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14187 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14189 case "$getnetbyaddr_r_proto" in
14190 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14191 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14193 case "$getnetbyaddr_r_proto" in
14194 ''|0) d_getnetbyaddr_r=undef
14195 getnetbyaddr_r_proto=0
14196 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14197 * ) case "$getnetbyaddr_r_proto" in
14198 REENTRANT_PROTO*) ;;
14199 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14201 echo "Prototype: $try" ;;
14204 *) case "$usethreads" in
14205 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14207 d_getnetbyaddr_r=undef
14208 getnetbyaddr_r_proto=0
14212 *) getnetbyaddr_r_proto=0
14216 : see if getnetbyname_r exists
14217 set getnetbyname_r d_getnetbyname_r
14219 case "$d_getnetbyname_r" in
14221 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14222 case "$d_getnetbyname_r_proto:$usethreads" in
14223 ":define") d_getnetbyname_r_proto=define
14224 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14228 case "$d_getnetbyname_r_proto" in
14230 case "$getnetbyname_r_proto" in
14231 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14232 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14234 case "$getnetbyname_r_proto" in
14235 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14236 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14238 case "$getnetbyname_r_proto" in
14239 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14240 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14242 case "$getnetbyname_r_proto" in
14243 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14244 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14246 case "$getnetbyname_r_proto" in
14247 ''|0) d_getnetbyname_r=undef
14248 getnetbyname_r_proto=0
14249 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14250 * ) case "$getnetbyname_r_proto" in
14251 REENTRANT_PROTO*) ;;
14252 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14254 echo "Prototype: $try" ;;
14257 *) case "$usethreads" in
14258 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14260 d_getnetbyname_r=undef
14261 getnetbyname_r_proto=0
14265 *) getnetbyname_r_proto=0
14269 : see if getnetent_r exists
14270 set getnetent_r d_getnetent_r
14272 case "$d_getnetent_r" in
14274 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14275 case "$d_getnetent_r_proto:$usethreads" in
14276 ":define") d_getnetent_r_proto=define
14277 set d_getnetent_r_proto getnetent_r $hdrs
14281 case "$d_getnetent_r_proto" in
14283 case "$getnetent_r_proto" in
14284 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14285 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14287 case "$getnetent_r_proto" in
14288 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14289 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14291 case "$getnetent_r_proto" in
14292 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14293 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14295 case "$getnetent_r_proto" in
14296 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14297 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14299 case "$getnetent_r_proto" in
14300 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14301 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14303 case "$getnetent_r_proto" in
14304 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14305 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14307 case "$getnetent_r_proto" in
14308 ''|0) d_getnetent_r=undef
14309 getnetent_r_proto=0
14310 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14311 * ) case "$getnetent_r_proto" in
14312 REENTRANT_PROTO*) ;;
14313 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14315 echo "Prototype: $try" ;;
14318 *) case "$usethreads" in
14319 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14321 d_getnetent_r=undef
14322 getnetent_r_proto=0
14326 *) getnetent_r_proto=0
14330 : see if prototypes for various getnetxxx netdb.h functions are available
14332 set d_getnetprotos getnetent $i_netdb netdb.h
14335 : see if getpagesize exists
14336 set getpagesize d_getpagsz
14339 : Optional checks for getprotobyname and getprotobynumber
14341 : see if getprotobyname exists
14342 set getprotobyname d_getpbyname
14345 : see if getprotobynumber exists
14346 set getprotobynumber d_getpbynumber
14349 : see if getprotoent exists
14350 set getprotoent d_getpent
14353 : see if getpgid exists
14354 set getpgid d_getpgid
14357 : see if getpgrp2 exists
14358 set getpgrp2 d_getpgrp2
14361 : see if getppid exists
14362 set getppid d_getppid
14365 : see if getpriority exists
14366 set getpriority d_getprior
14369 : see if getprotobyname_r exists
14370 set getprotobyname_r d_getprotobyname_r
14372 case "$d_getprotobyname_r" in
14374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14375 case "$d_getprotobyname_r_proto:$usethreads" in
14376 ":define") d_getprotobyname_r_proto=define
14377 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14381 case "$d_getprotobyname_r_proto" in
14383 case "$getprotobyname_r_proto" in
14384 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14385 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14387 case "$getprotobyname_r_proto" in
14388 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14389 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14391 case "$getprotobyname_r_proto" in
14392 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14393 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14395 case "$getprotobyname_r_proto" in
14396 ''|0) d_getprotobyname_r=undef
14397 getprotobyname_r_proto=0
14398 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14399 * ) case "$getprotobyname_r_proto" in
14400 REENTRANT_PROTO*) ;;
14401 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14403 echo "Prototype: $try" ;;
14406 *) case "$usethreads" in
14407 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14409 d_getprotobyname_r=undef
14410 getprotobyname_r_proto=0
14414 *) getprotobyname_r_proto=0
14418 : see if getprotobynumber_r exists
14419 set getprotobynumber_r d_getprotobynumber_r
14421 case "$d_getprotobynumber_r" in
14423 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14424 case "$d_getprotobynumber_r_proto:$usethreads" in
14425 ":define") d_getprotobynumber_r_proto=define
14426 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14430 case "$d_getprotobynumber_r_proto" in
14432 case "$getprotobynumber_r_proto" in
14433 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14434 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14436 case "$getprotobynumber_r_proto" in
14437 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14438 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14440 case "$getprotobynumber_r_proto" in
14441 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14442 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14444 case "$getprotobynumber_r_proto" in
14445 ''|0) d_getprotobynumber_r=undef
14446 getprotobynumber_r_proto=0
14447 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14448 * ) case "$getprotobynumber_r_proto" in
14449 REENTRANT_PROTO*) ;;
14450 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14452 echo "Prototype: $try" ;;
14455 *) case "$usethreads" in
14456 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14458 d_getprotobynumber_r=undef
14459 getprotobynumber_r_proto=0
14463 *) getprotobynumber_r_proto=0
14467 : see if getprotoent_r exists
14468 set getprotoent_r d_getprotoent_r
14470 case "$d_getprotoent_r" in
14472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14473 case "$d_getprotoent_r_proto:$usethreads" in
14474 ":define") d_getprotoent_r_proto=define
14475 set d_getprotoent_r_proto getprotoent_r $hdrs
14479 case "$d_getprotoent_r_proto" in
14481 case "$getprotoent_r_proto" in
14482 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14483 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14485 case "$getprotoent_r_proto" in
14486 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14487 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14489 case "$getprotoent_r_proto" in
14490 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14491 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14493 case "$getprotoent_r_proto" in
14494 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14495 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14497 case "$getprotoent_r_proto" in
14498 ''|0) d_getprotoent_r=undef
14499 getprotoent_r_proto=0
14500 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14501 * ) case "$getprotoent_r_proto" in
14502 REENTRANT_PROTO*) ;;
14503 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14505 echo "Prototype: $try" ;;
14508 *) case "$usethreads" in
14509 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14511 d_getprotoent_r=undef
14512 getprotoent_r_proto=0
14516 *) getprotoent_r_proto=0
14520 : see if prototypes for various getprotoxxx netdb.h functions are available
14522 set d_getprotoprotos getprotoent $i_netdb netdb.h
14525 : see if getprpwnam exists
14526 set getprpwnam d_getprpwnam
14529 : see if getpwent exists
14530 set getpwent d_getpwent
14533 : see if getpwent_r exists
14534 set getpwent_r d_getpwent_r
14536 case "$d_getpwent_r" in
14538 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14539 case "$d_getpwent_r_proto:$usethreads" in
14540 ":define") d_getpwent_r_proto=define
14541 set d_getpwent_r_proto getpwent_r $hdrs
14545 case "$d_getpwent_r_proto" in
14547 case "$getpwent_r_proto" in
14548 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14549 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14551 case "$getpwent_r_proto" in
14552 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14553 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14555 case "$getpwent_r_proto" in
14556 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14557 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14559 case "$getpwent_r_proto" in
14560 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14561 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14563 case "$getpwent_r_proto" in
14564 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14565 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14567 case "$getpwent_r_proto" in
14568 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14569 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14571 case "$getpwent_r_proto" in
14572 ''|0) d_getpwent_r=undef
14574 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14575 * ) case "$getpwent_r_proto" in
14576 REENTRANT_PROTO*) ;;
14577 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14579 echo "Prototype: $try" ;;
14582 *) case "$usethreads" in
14583 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14590 *) getpwent_r_proto=0
14594 : see if getpwnam_r exists
14595 set getpwnam_r d_getpwnam_r
14597 case "$d_getpwnam_r" in
14599 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14600 case "$d_getpwnam_r_proto:$usethreads" in
14601 ":define") d_getpwnam_r_proto=define
14602 set d_getpwnam_r_proto getpwnam_r $hdrs
14606 case "$d_getpwnam_r_proto" in
14608 case "$getpwnam_r_proto" in
14609 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14610 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14612 case "$getpwnam_r_proto" in
14613 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14614 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14616 case "$getpwnam_r_proto" in
14617 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14618 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14620 case "$getpwnam_r_proto" in
14621 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14622 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14624 case "$getpwnam_r_proto" in
14625 ''|0) d_getpwnam_r=undef
14627 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14628 * ) case "$getpwnam_r_proto" in
14629 REENTRANT_PROTO*) ;;
14630 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14632 echo "Prototype: $try" ;;
14635 *) case "$usethreads" in
14636 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14643 *) getpwnam_r_proto=0
14647 : see if getpwuid_r exists
14648 set getpwuid_r d_getpwuid_r
14650 case "$d_getpwuid_r" in
14652 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14653 case "$d_getpwuid_r_proto:$usethreads" in
14654 ":define") d_getpwuid_r_proto=define
14655 set d_getpwuid_r_proto getpwuid_r $hdrs
14659 case "$d_getpwuid_r_proto" in
14661 case "$getpwuid_r_proto" in
14662 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14663 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14665 case "$getpwuid_r_proto" in
14666 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14667 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14669 case "$getpwuid_r_proto" in
14670 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14671 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14673 case "$getpwuid_r_proto" in
14674 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14675 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14677 case "$getpwuid_r_proto" in
14678 ''|0) d_getpwuid_r=undef
14680 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14681 * ) case "$getpwuid_r_proto" in
14682 REENTRANT_PROTO*) ;;
14683 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14685 echo "Prototype: $try" ;;
14688 *) case "$usethreads" in
14689 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14696 *) getpwuid_r_proto=0
14700 : Optional checks for getsbyname and getsbyport
14702 : see if getservbyname exists
14703 set getservbyname d_getsbyname
14706 : see if getservbyport exists
14707 set getservbyport d_getsbyport
14710 : see if getservent exists
14711 set getservent d_getsent
14714 : see if getservbyname_r exists
14715 set getservbyname_r d_getservbyname_r
14717 case "$d_getservbyname_r" in
14719 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14720 case "$d_getservbyname_r_proto:$usethreads" in
14721 ":define") d_getservbyname_r_proto=define
14722 set d_getservbyname_r_proto getservbyname_r $hdrs
14726 case "$d_getservbyname_r_proto" in
14728 case "$getservbyname_r_proto" in
14729 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14730 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14732 case "$getservbyname_r_proto" in
14733 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14734 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14736 case "$getservbyname_r_proto" in
14737 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14738 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14740 case "$getservbyname_r_proto" in
14741 ''|0) d_getservbyname_r=undef
14742 getservbyname_r_proto=0
14743 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14744 * ) case "$getservbyname_r_proto" in
14745 REENTRANT_PROTO*) ;;
14746 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14748 echo "Prototype: $try" ;;
14751 *) case "$usethreads" in
14752 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14754 d_getservbyname_r=undef
14755 getservbyname_r_proto=0
14759 *) getservbyname_r_proto=0
14763 : see if getservbyport_r exists
14764 set getservbyport_r d_getservbyport_r
14766 case "$d_getservbyport_r" in
14768 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14769 case "$d_getservbyport_r_proto:$usethreads" in
14770 ":define") d_getservbyport_r_proto=define
14771 set d_getservbyport_r_proto getservbyport_r $hdrs
14775 case "$d_getservbyport_r_proto" in
14777 case "$getservbyport_r_proto" in
14778 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14779 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14781 case "$getservbyport_r_proto" in
14782 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14783 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14785 case "$getservbyport_r_proto" in
14786 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14787 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14789 case "$getservbyport_r_proto" in
14790 ''|0) d_getservbyport_r=undef
14791 getservbyport_r_proto=0
14792 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14793 * ) case "$getservbyport_r_proto" in
14794 REENTRANT_PROTO*) ;;
14795 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14797 echo "Prototype: $try" ;;
14800 *) case "$usethreads" in
14801 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14803 d_getservbyport_r=undef
14804 getservbyport_r_proto=0
14808 *) getservbyport_r_proto=0
14812 : see if getservent_r exists
14813 set getservent_r d_getservent_r
14815 case "$d_getservent_r" in
14817 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14818 case "$d_getservent_r_proto:$usethreads" in
14819 ":define") d_getservent_r_proto=define
14820 set d_getservent_r_proto getservent_r $hdrs
14824 case "$d_getservent_r_proto" in
14826 case "$getservent_r_proto" in
14827 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14828 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14830 case "$getservent_r_proto" in
14831 ''|0) try='int getservent_r(struct servent*, char*, int);'
14832 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14834 case "$getservent_r_proto" in
14835 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14836 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14838 case "$getservent_r_proto" in
14839 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14840 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14842 case "$getservent_r_proto" in
14843 ''|0) d_getservent_r=undef
14844 getservent_r_proto=0
14845 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14846 * ) case "$getservent_r_proto" in
14847 REENTRANT_PROTO*) ;;
14848 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14850 echo "Prototype: $try" ;;
14853 *) case "$usethreads" in
14854 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14856 d_getservent_r=undef
14857 getservent_r_proto=0
14861 *) getservent_r_proto=0
14865 : see if prototypes for various getservxxx netdb.h functions are available
14867 set d_getservprotos getservent $i_netdb netdb.h
14870 : see if getspnam exists
14871 set getspnam d_getspnam
14874 : see if this is a shadow.h system
14875 set shadow.h i_shadow
14878 : see if getspnam_r exists
14879 set getspnam_r d_getspnam_r
14881 case "$d_getspnam_r" in
14883 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14884 case "$d_getspnam_r_proto:$usethreads" in
14885 ":define") d_getspnam_r_proto=define
14886 set d_getspnam_r_proto getspnam_r $hdrs
14890 case "$d_getspnam_r_proto" in
14892 case "$getspnam_r_proto" in
14893 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14894 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14896 case "$getspnam_r_proto" in
14897 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14898 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14900 case "$getspnam_r_proto" in
14901 ''|0) d_getspnam_r=undef
14903 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14904 * ) case "$getspnam_r_proto" in
14905 REENTRANT_PROTO*) ;;
14906 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14908 echo "Prototype: $try" ;;
14911 *) case "$usethreads" in
14912 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14919 *) getspnam_r_proto=0
14923 : see if gettimeofday or ftime exists
14924 set gettimeofday d_gettimeod
14926 case "$d_gettimeod" in
14932 val="$undef"; set d_ftime; eval $setvar
14935 case "$d_gettimeod$d_ftime" in
14938 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14942 : see if gmtime_r exists
14943 set gmtime_r d_gmtime_r
14945 case "$d_gmtime_r" in
14947 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14948 case "$d_gmtime_r_proto:$usethreads" in
14949 ":define") d_gmtime_r_proto=define
14950 set d_gmtime_r_proto gmtime_r $hdrs
14954 case "$d_gmtime_r_proto" in
14956 case "$gmtime_r_proto" in
14957 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14958 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14960 case "$gmtime_r_proto" in
14961 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14962 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14964 case "$gmtime_r_proto" in
14965 ''|0) d_gmtime_r=undef
14967 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14968 * ) case "$gmtime_r_proto" in
14969 REENTRANT_PROTO*) ;;
14970 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14972 echo "Prototype: $try" ;;
14975 *) case "$usethreads" in
14976 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14983 *) gmtime_r_proto=0
14987 : see if hasmntopt exists
14988 set hasmntopt d_hasmntopt
14991 : see if this is a netinet/in.h or sys/in.h system
14992 set netinet/in.h i_niin sys/in.h i_sysin
14995 : see if arpa/inet.h has to be included
14996 set arpa/inet.h i_arpainet
14999 : see if htonl --and friends-- exists
15004 : Maybe they are macros.
15007 $cat >htonl.c <<EOM
15009 #include <sys/types.h>
15010 #$i_niin I_NETINET_IN
15012 #$i_arpainet I_ARPA_INET
15013 #ifdef I_NETINET_IN
15014 #include <netinet/in.h>
15017 #include <sys/in.h>
15020 #include <arpa/inet.h>
15023 printf("Defined as a macro.");
15026 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15027 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15029 echo "But it seems to be defined as a macro." >&4
15037 : see if ilogbl exists
15038 set ilogbl d_ilogbl
15043 if set index val -f; eval $csym; $val; then
15044 if set strchr val -f d_strchr; eval $csym; $val; then
15045 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15048 echo "strchr() found." >&4
15052 echo "index() found." >&4
15057 echo "index() found." >&4
15060 if set strchr val -f d_strchr; eval $csym; $val; then
15063 echo "strchr() found." >&4
15065 echo "No index() or strchr() found!" >&4
15070 set d_strchr; eval $setvar
15072 set d_index; eval $setvar
15074 : check whether inet_aton exists
15075 set inet_aton d_inetaton
15078 : see if inet_ntop exists
15079 set inet_ntop d_inetntop
15082 : see if inet_pton exists
15083 set inet_pton d_inetpton
15088 $cat >isascii.c <<EOCP
15091 #$i_stdlib I_STDLIB
15093 #include <stdlib.h>
15104 if eval $compile; then
15105 echo "isascii() found." >&4
15108 echo "isascii() NOT found." >&4
15117 $cat >isblank.c <<'EOCP'
15128 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15129 echo "isblank() found." >&4
15132 echo "isblank() NOT found." >&4
15139 : see if isfinite exists
15140 set isfinite d_isfinite
15143 : see if isinf exists
15147 : see if isnan exists
15151 : see if isnanl exists
15152 set isnanl d_isnanl
15155 : see if killpg exists
15156 set killpg d_killpg
15159 : see if lchown exists
15161 $cat > try.c <<'EOCP'
15162 /* System header to define __stub macros and hopefully few prototypes,
15163 which can conflict with char lchown(); below. */
15164 #include <assert.h>
15165 /* Override any gcc2 internal prototype to avoid an error. */
15166 /* We use char because int might match the return type of a gcc2
15167 builtin and then its argument prototype would still apply. */
15170 /* The GNU C library defines this for functions which it implements
15171 to always fail with ENOSYS. Some functions are actually named
15172 something starting with __ and the normal name is an alias. */
15173 #if defined (__stub_lchown) || defined (__stub___lchown)
15181 if eval $compile; then
15182 $echo "lchown() found." >&4
15185 $echo "lchown() NOT found." >&4
15191 : See if number of significant digits in a double precision number is known
15193 $cat >ldbl_dig.c <<EOM
15194 #$i_limits I_LIMITS
15197 #include <limits.h>
15203 printf("Contains LDBL_DIG");
15206 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15207 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15208 echo "LDBL_DIG found." >&4
15211 echo "LDBL_DIG NOT found." >&4
15218 : see if this is a math.h system
15222 : check to see if math.h defines _LIB_VERSION
15223 d_libm_lib_version="$undef"
15227 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15229 #include <unistd.h>
15231 int main (int argc, char *argv[])
15233 printf ("%d\n", _LIB_VERSION);
15238 if eval $compile; then
15240 echo "Yes, it does ($foo)" >&4
15241 d_libm_lib_version="$define"
15243 echo "No, it does not (probably harmless)" >&4
15250 : see if link exists
15254 : see if localtime_r exists
15255 set localtime_r d_localtime_r
15257 case "$d_localtime_r" in
15259 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15260 case "$d_localtime_r_proto:$usethreads" in
15261 ":define") d_localtime_r_proto=define
15262 set d_localtime_r_proto localtime_r $hdrs
15266 case "$d_localtime_r_proto" in
15268 case "$localtime_r_proto" in
15269 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15270 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15272 case "$localtime_r_proto" in
15273 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15274 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15276 case "$localtime_r_proto" in
15277 ''|0) d_localtime_r=undef
15278 localtime_r_proto=0
15279 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15280 * ) case "$localtime_r_proto" in
15281 REENTRANT_PROTO*) ;;
15282 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15284 echo "Prototype: $try" ;;
15287 *) case "$usethreads" in
15288 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15290 d_localtime_r=undef
15291 localtime_r_proto=0
15295 *) localtime_r_proto=0
15299 : see if localtime_r calls tzset
15300 case "$localtime_r_proto" in
15303 /* Does our libc's localtime_r call tzset ?
15304 * return 0 if so, 1 otherwise.
15306 #$i_systypes I_SYS_TYPES
15307 #$i_unistd I_UNISTD
15309 #$i_stdlib I_STDLIB
15310 #$i_string I_STRING
15311 #$i_malloc I_MALLOC
15313 # include <sys/types.h>
15316 # include <unistd.h>
15322 #include <stdlib.h>
15325 # include <string.h>
15327 # include <strings.h>
15330 # include <malloc.h>
15334 time_t t = time(0L);
15335 char w_tz[]="TZ" "=GMT+5",
15336 e_tz[]="TZ" "=GMT-5",
15337 *tz_e = (char*)malloc(16),
15338 *tz_w = (char*)malloc(16);
15339 struct tm tm_e, tm_w;
15340 memset(&tm_e,'\0',sizeof(struct tm));
15341 memset(&tm_w,'\0',sizeof(struct tm));
15346 localtime_r(&t, &tm_e);
15349 localtime_r(&t, &tm_w);
15351 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15357 if eval $compile; then
15358 if $run ./try; then
15359 d_localtime_r_needs_tzset=undef;
15361 d_localtime_r_needs_tzset=define;
15364 d_localtime_r_needs_tzset=undef;
15368 d_localtime_r_needs_tzset=undef;
15373 : see if localeconv exists
15374 set localeconv d_locconv
15377 : see if lockf exists
15381 : see if prototype for lseek is available
15383 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15386 : see if lstat exists
15390 : see if madvise exists
15391 set madvise d_madvise
15394 : see if malloc_size exists
15395 set malloc_size d_malloc_size
15398 : see if malloc_size_good exists
15399 set malloc_good_size d_malloc_good_size
15402 : see if mblen exists
15406 : see if mbstowcs exists
15407 set mbstowcs d_mbstowcs
15410 : see if mbtowc exists
15411 set mbtowc d_mbtowc
15414 : see if memchr exists
15415 set memchr d_memchr
15418 : see if memcmp exists
15419 set memcmp d_memcmp
15422 : see if memcpy exists
15423 set memcpy d_memcpy
15426 : see if memmove exists
15427 set memmove d_memmove
15430 : see if memset exists
15431 set memset d_memset
15434 : see if mkdir exists
15438 : see if mkdtemp exists
15439 set mkdtemp d_mkdtemp
15442 : see if mkfifo exists
15443 set mkfifo d_mkfifo
15446 : see if mkstemp exists
15447 set mkstemp d_mkstemp
15450 : see if mkstemps exists
15451 set mkstemps d_mkstemps
15454 : see if mktime exists
15455 set mktime d_mktime
15458 : see if this is a sys/mman.h system
15459 set sys/mman.h i_sysmman
15462 : see if mmap exists
15465 : see what shmat returns
15466 : default to something harmless
15468 case "$i_sysmman$d_mmap" in
15470 $cat >mmap.c <<'END'
15471 #include <sys/mman.h>
15474 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15479 echo "and it returns ($mmaptype)." >&4
15485 : see if sqrtl exists
15489 : see if scalbnl exists
15490 set scalbnl d_scalbnl
15493 : see if modfl exists
15497 : see if prototype for modfl is available
15499 set d_modflproto modfl $i_math math.h
15502 d_modfl_pow32_bug="$undef"
15504 case "$d_longdbl$d_modfl" in
15507 Checking to see whether your modfl() is okay for large values...
15513 if $test "X$d_modflproto" != "X$define"; then
15514 $cat >>try.c <<EOCP
15515 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15516 long double modfl (long double, long double *);
15519 $cat >>try.c <<EOCP
15521 long double nv = 4294967303.15;
15527 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15531 case "$osname:$gccversion" in
15532 aix:) saveccflags="$ccflags"
15533 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15536 if eval $compile; then
15539 *" 4294967303.150000 1.150000 4294967302.000000")
15540 echo >&4 "Your modfl() is broken for large values."
15541 d_modfl_pow32_bug="$define"
15543 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15547 *" 4294967303.150000 0.150000 4294967303.000000")
15548 echo >&4 "Your modfl() seems okay for large values."
15550 *) echo >&4 "I don't understand your modfl() at all."
15556 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15559 case "$osname:$gccversion" in
15560 aix:) ccflags="$saveccflags" ;; # restore
15565 if $test "$uselongdouble" = "$define"; then
15567 if $test "$d_sqrtl" != "$define"; then
15568 message="$message sqrtl"
15570 if $test "$d_modfl" != "$define"; then
15571 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15572 echo "You have both aintl and copysignl, so I can emulate modfl."
15574 message="$message modfl"
15577 if $test "$d_frexpl" != "$define"; then
15578 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15579 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15581 message="$message frexpl"
15585 if $test "$message" != ""; then
15588 *** You requested the use of long doubles but you do not seem to have
15589 *** the following mathematical functions needed for long double support:
15591 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15592 *** Cannot continue, aborting.
15600 : see if mprotect exists
15601 set mprotect d_mprotect
15604 : see if msgctl exists
15605 set msgctl d_msgctl
15608 : see if msgget exists
15609 set msgget d_msgget
15612 : see if msgsnd exists
15613 set msgsnd d_msgsnd
15616 : see if msgrcv exists
15617 set msgrcv d_msgrcv
15620 : see how much of the 'msg*(2)' library is present.
15623 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15624 *"$undef"*) h_msg=false;;
15628 case "`ipcs 2>&1`" in
15629 "SVID messages"*"not configured"*)
15630 echo "Your $osname does not have the msg*(2) configured." >&4
15633 set msgctl d_msgctl
15635 set msgget d_msgget
15637 set msgsnd d_msgsnd
15639 set msgrcv d_msgrcv
15645 : we could also check for sys/ipc.h ...
15646 if $h_msg && $test `./findhdr sys/msg.h`; then
15647 echo "You have the full msg*(2) library." >&4
15650 echo "You don't have the full msg*(2) library." >&4
15656 : Check for msghdr_s
15658 echo "Checking to see if your system supports struct msghdr..." >&4
15659 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15661 case "$d_msghdr_s" in
15662 "$define") echo "Yes, it does." ;;
15663 *) echo "No, it doesn't." ;;
15667 : see if msync exists
15671 : see if munmap exists
15672 set munmap d_munmap
15675 : see if nice exists
15679 : see if this is a langinfo.h system
15680 set langinfo.h i_langinfo
15683 : see if nl_langinfo exists
15684 set nl_langinfo d_nl_langinfo
15687 : check for volatile keyword
15689 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15690 $cat >try.c <<'EOCP'
15693 typedef struct _goo_struct goo_struct;
15694 goo_struct * volatile goo = ((goo_struct *)0);
15695 struct _goo_struct {
15700 typedef unsigned short foo_t;
15701 char *volatile foo;
15703 volatile foo_t blech;
15707 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15709 echo "Yup, it does."
15712 echo "Nope, it doesn't."
15718 : Check basic sizes
15720 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15722 case "$use64bitint:$d_quad:$quadtype" in
15725 uvtype="$uquadtype"
15730 uvtype="unsigned long"
15736 case "$uselongdouble:$d_longdbl" in
15738 nvtype="long double"
15739 nvsize=$longdblsize
15746 $echo "(IV will be "$ivtype", $ivsize bytes)"
15747 $echo "(UV will be "$uvtype", $uvsize bytes)"
15748 $echo "(NV will be "$nvtype", $nvsize bytes)"
15751 #$i_inttypes I_INTTYPES
15753 #include <inttypes.h>
15758 int8_t i = INT8_MAX;
15759 uint8_t u = UINT8_MAX;
15760 printf("int8_t\n");
15763 int16_t i = INT16_MAX;
15764 uint16_t i = UINT16_MAX;
15765 printf("int16_t\n");
15768 int32_t i = INT32_MAX;
15769 uint32_t u = UINT32_MAX;
15770 printf("int32_t\n");
15775 i8type="signed char"
15776 u8type="unsigned char"
15781 '') case "$shortsize" in
15783 u16type="unsigned short"
15791 '') set try -DINT16
15792 if eval $compile; then
15793 case "`$run ./try`" in
15805 '') if $test $shortsize -ge 2; then
15807 u16type="unsigned short"
15815 '') case "$longsize" in
15817 u32type="unsigned long"
15821 *) case "$intsize" in
15823 u32type="unsigned int"
15833 '') set try -DINT32
15834 if eval $compile; then
15835 case "`$run ./try`" in
15847 '') if $test $intsize -ge 4; then
15849 u32type="unsigned int"
15857 '') case "$d_quad:$quadtype" in
15859 i64type="$quadtype"
15860 u64type="$uquadtype"
15868 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15869 : volatile so that the compiler has to store it out to memory.
15870 if test X"$d_volatile" = X"$define"; then
15875 #$i_stdlib I_STDLIB
15877 #include <stdlib.h>
15879 #include <sys/types.h>
15880 #include <signal.h>
15882 $volatile int bletched = 0;
15883 $signal_t blech(int s) { bletched = 1; }
15888 int n = 8 * $uvsize;
15891 signal(SIGFPE, blech);
15894 for (i = 0; i < n; i++) {
15895 u = u << 1 | ($uvtype)1;
15897 if (($uvtype)d != u)
15901 d = ($nvtype)(u - 1);
15902 if (($uvtype)d != (u - 1))
15909 printf("%d\n", ((i == n) ? -n : i));
15915 d_nv_preserves_uv="$undef"
15916 if eval $compile; then
15917 nv_preserves_uv_bits="`$run ./try`"
15919 case "$nv_preserves_uv_bits" in
15921 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15922 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15923 d_nv_preserves_uv="$define"
15925 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15926 d_nv_preserves_uv="$undef" ;;
15927 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15928 nv_preserves_uv_bits="0" ;;
15932 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15933 : volatile so that the compiler has to store it out to memory.
15934 if test X"$d_volatile" = X"$define"; then
15940 typedef $nvtype NV;
15947 while(count < 256) {
15948 $volatile NV up = value + 1.0;
15949 $volatile NV negated = -value;
15950 $volatile NV down = negated - 1.0;
15951 $volatile NV got_up = up - value;
15952 int up_good = got_up == 1.0;
15953 int got_down = down - negated;
15954 int down_good = got_down == -1.0;
15956 if (down_good != up_good) {
15958 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15959 up_good, (double) got_up, down_good, (double) got_down,
15960 count, (double) value);
15967 fputs("256.0", stdout);
15970 fputs("2.0", stdout);
15976 fputs("*", stdout);
15982 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15983 count, (double) value);
15989 nv_overflows_integers_at='0'
15990 if eval $compile; then
15996 The largest integer your NVs can preserve is equal to $xxx
15998 nv_overflows_integers_at="$xxx"
16001 Cannot determine the largest integer value your NVs can hold, unexpected output
16008 Cannot determine the largest integer value your NVs can hold
16015 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16016 : volatile so that the compiler has to store it out to memory.
16017 if test X"$d_volatile" = X"$define"; then
16022 #$i_stdlib I_STDLIB
16024 #include <stdlib.h>
16026 #$i_string I_STRING
16028 # include <string.h>
16030 # include <strings.h>
16032 #include <sys/types.h>
16033 #include <signal.h>
16035 $volatile int bletched = 0;
16036 $signal_t blech(int s) { bletched = 1; }
16039 int checkit($nvtype d, char *where) {
16040 unsigned char *p = (char *)&d;
16041 unsigned char *end = p + sizeof(d);
16051 printf("No - %s: 0x", where);
16053 printf ("%02X", *p++);
16058 int main(int argc, char **argv) {
16061 fail += checkit(d, "0.0");
16063 /* The compiler shouldn't be assuming that bletched is 0 */
16066 fail += checkit(d, "bleched");
16069 signal(SIGFPE, blech);
16072 /* Paranoia - the compiler should have no way of knowing that ANSI says
16073 that argv[argc] will always be NULL. Actually, if it did assume this it
16074 would be buggy, as this is C and main() can be called from elsewhere in
16076 d = argv[argc] ? 1 : 0;
16079 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16082 fail += checkit(d, "ternary");
16084 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16087 printf("No - memset doesn't give 0.0\n");
16088 /* This might just blow up: */
16089 printf("(gives %g)\n", d);
16095 printf("No - something bleched\n");
16100 printf("No - %d fail(s)\n", fail);
16109 d_nv_zero_is_allbits_zero="$undef"
16110 if eval $compile; then
16116 0.0 is represented as all bits zero in memory
16118 d_nv_zero_is_allbits_zero="$define"
16121 0.0 is not represented as all bits zero in memory
16123 d_nv_zero_is_allbits_zero="$undef"
16128 0.0 is not represented as all bits zero in memory
16130 d_nv_zero_is_allbits_zero="$undef"
16136 : check for off64_t
16138 echo "Checking to see if you have off64_t..." >&4
16140 #include <sys/types.h>
16141 #include <unistd.h>
16142 int main() { off64_t x = 7; }
16145 if eval $compile; then
16147 echo "You have off64_t."
16150 echo "You do not have off64_t."
16151 case "$lseeksize" in
16152 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16159 : how to create joinable pthreads
16160 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16162 echo "Checking what constant to use for creating joinable pthreads..." >&4
16163 $cat >try.c <<'EOCP'
16164 #include <pthread.h>
16166 int detachstate = JOINABLE;
16169 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16170 if eval $compile; then
16171 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16172 val="$undef" # Yes, undef.
16173 set d_old_pthread_create_joinable
16176 set old_pthread_create_joinable
16179 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16180 if eval $compile; then
16181 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16183 set d_old_pthread_create_joinable
16185 val=PTHREAD_CREATE_UNDETACHED
16186 set old_pthread_create_joinable
16189 set try -DJOINABLE=__UNDETACHED
16190 if eval $compile; then
16191 echo "You seem to use __UNDETACHED." >&4
16193 set d_old_pthread_create_joinable
16196 set old_pthread_create_joinable
16199 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16201 set d_old_pthread_create_joinable
16204 set old_pthread_create_joinable
16211 d_old_pthread_create_joinable="$undef"
16212 old_pthread_create_joinable=""
16215 : see if pause exists
16219 : see if poll exists
16223 : see if prctl exists
16227 : see if prctl supports PR_SET_NAME
16228 d_prctl_set_name=$undef
16232 #include <sys/prctl.h>
16234 int main (int argc, char *argv[])
16236 return (prctl (PR_SET_NAME, "Test"));
16240 if eval $compile_ok && $run ./try; then
16241 echo "Your prctl (PR_SET_NAME, ...) works"
16242 d_prctl_set_name=$define
16248 : see if readlink exists
16249 set readlink d_readlink
16252 : Check if exe is symlink to abs path of executing program
16256 case "$d_readlink" in
16258 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16259 : more tidy to avoid an extra level of symlink
16260 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16261 while test $# -gt 0; do
16264 if $issymlink $try; then
16265 $ls -l $try > reflect
16266 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16267 echo "You have $type-like $try."
16268 procselfexe='"'$try'"'
16270 : This will break out of the loop
16281 : backward compatibility for d_hvfork
16282 if test X$d_hvfork != X; then
16283 d_vfork="$d_hvfork"
16286 : see if there is a vfork
16291 d_pseudofork=$undef
16293 : Ok, but do we want to use it. vfork is reportedly unreliable in
16294 : perl on Solaris 2.x, and probably elsewhere.
16298 case "$usevfork" in
16304 Perl can only use a vfork() that doesn't suffer from strict
16305 restrictions on calling functions or modifying global data in
16306 the child. For example, glibc-2.1 contains such a vfork()
16307 that is unsuitable. If your system provides a proper fork()
16308 call, chances are that you do NOT want perl to use vfork().
16311 rp="Do you still want to use vfork()?"
16316 echo "Ok, we won't use vfork()."
16325 $define) usevfork='true';;
16326 *) usevfork='false';;
16329 : see whether the pthread_atfork exists
16331 #include <pthread.h>
16334 #ifdef PTHREAD_ATFORK
16335 pthread_atfork(NULL,NULL,NULL);
16340 : see if pthread_atfork exists
16341 set try -DPTHREAD_ATFORK
16342 if eval $compile; then
16347 case "$usethreads" in
16350 $define) echo 'pthread_atfork found.' >&4 ;;
16351 *) echo 'pthread_atfork NOT found.' >&4 ;;
16354 set d_pthread_atfork
16357 : see if pthread_attr_setscope exists
16358 set pthread_attr_setscope d_pthread_attr_setscope
16361 : see whether the various POSIXish _yields exist
16363 #include <pthread.h>
16369 #ifdef PTHREAD_YIELD
16372 #ifdef PTHREAD_YIELD_NULL
16373 pthread_yield(NULL);
16379 : see if sched_yield exists
16380 set try -DSCHED_YIELD
16381 if eval $compile; then
16383 sched_yield='sched_yield()'
16387 case "$usethreads" in
16390 $define) echo 'sched_yield() found.' >&4 ;;
16391 *) echo 'sched_yield() NOT found.' >&4 ;;
16397 : see if pthread_yield exists
16398 set try -DPTHREAD_YIELD
16399 if eval $compile; then
16401 case "$sched_yield" in
16402 '') sched_yield='pthread_yield()' ;;
16405 set try -DPTHREAD_YIELD_NULL
16406 if eval $compile; then
16408 case "$sched_yield" in
16409 '') sched_yield='pthread_yield(NULL)' ;;
16415 case "$usethreads" in
16418 $define) echo 'pthread_yield() found.' >&4 ;;
16419 *) echo 'pthread_yield() NOT found.' >&4 ;;
16423 set d_pthread_yield
16425 case "$sched_yield" in
16426 '') sched_yield=undef ;;
16430 : see if random_r exists
16431 set random_r d_random_r
16433 case "$d_random_r" in
16435 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16436 case "$d_random_r_proto:$usethreads" in
16437 ":define") d_random_r_proto=define
16438 set d_random_r_proto random_r $hdrs
16442 case "$d_random_r_proto" in
16444 case "$random_r_proto" in
16445 ''|0) try='int random_r(int*, struct random_data*);'
16446 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16448 case "$random_r_proto" in
16449 ''|0) try='int random_r(long*, struct random_data*);'
16450 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16452 case "$random_r_proto" in
16453 ''|0) try='int random_r(struct random_data*, int32_t*);'
16454 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16456 case "$random_r_proto" in
16457 ''|0) d_random_r=undef
16459 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16460 * ) case "$random_r_proto" in
16461 REENTRANT_PROTO*) ;;
16462 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16464 echo "Prototype: $try" ;;
16467 *) case "$usethreads" in
16468 define) echo "random_r has no prototype, not using it." >&4 ;;
16475 *) random_r_proto=0
16479 : see if readdir and friends exist
16480 set readdir d_readdir
16482 set seekdir d_seekdir
16484 set telldir d_telldir
16486 set rewinddir d_rewinddir
16489 : see if readdir64_r exists
16490 set readdir64_r d_readdir64_r
16492 case "$d_readdir64_r" in
16494 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16495 case "$d_readdir64_r_proto:$usethreads" in
16496 ":define") d_readdir64_r_proto=define
16497 set d_readdir64_r_proto readdir64_r $hdrs
16501 case "$d_readdir64_r_proto" in
16503 case "$readdir64_r_proto" in
16504 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16505 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16507 case "$readdir64_r_proto" in
16508 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16509 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16511 case "$readdir64_r_proto" in
16512 ''|0) d_readdir64_r=undef
16513 readdir64_r_proto=0
16514 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16515 * ) case "$readdir64_r_proto" in
16516 REENTRANT_PROTO*) ;;
16517 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16519 echo "Prototype: $try" ;;
16522 *) case "$usethreads" in
16523 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16525 d_readdir64_r=undef
16526 readdir64_r_proto=0
16530 *) readdir64_r_proto=0
16534 : see if readdir_r exists
16535 set readdir_r d_readdir_r
16537 case "$d_readdir_r" in
16539 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16540 case "$d_readdir_r_proto:$usethreads" in
16541 ":define") d_readdir_r_proto=define
16542 set d_readdir_r_proto readdir_r $hdrs
16546 case "$d_readdir_r_proto" in
16548 case "$readdir_r_proto" in
16549 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16550 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16552 case "$readdir_r_proto" in
16553 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16554 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16556 case "$readdir_r_proto" in
16557 ''|0) d_readdir_r=undef
16559 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16560 * ) case "$readdir_r_proto" in
16561 REENTRANT_PROTO*) ;;
16562 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16564 echo "Prototype: $try" ;;
16567 *) case "$usethreads" in
16568 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16575 *) readdir_r_proto=0
16579 : see if readv exists
16583 : see if recvmsg exists
16584 set recvmsg d_recvmsg
16587 : see if rename exists
16588 set rename d_rename
16591 : see if rmdir exists
16595 : see if memory.h is available.
16600 : See if it conflicts with string.h
16606 $cppstdin $cppflags $cppminus < $strings > mem.h
16607 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16609 echo "We won't be including <memory.h>."
16619 : can bcopy handle overlapping blocks?
16622 case "$d_memmove" in
16623 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16624 *) case "$d_bcopy" in
16626 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16628 #$i_memory I_MEMORY
16629 #$i_stdlib I_STDLIB
16630 #$i_string I_STRING
16631 #$i_unistd I_UNISTD
16633 $cat >>try.c <<'EOCP'
16636 # include <memory.h>
16639 # include <stdlib.h>
16642 # include <string.h>
16644 # include <strings.h>
16647 # include <unistd.h> /* Needed for NetBSD */
16651 char buf[128], abc[128];
16657 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16658 try to store the string in read-only memory. */
16659 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16661 for (align = 7; align >= 0; align--) {
16662 for (len = 36; len; len--) {
16664 bcopy(abc, b, len);
16665 for (off = 1; off <= len; off++) {
16666 bcopy(b, b+off, len);
16667 bcopy(b+off, b, len);
16668 if (bcmp(b, abc, len))
16677 if eval $compile_ok; then
16678 if $run ./try 2>/dev/null; then
16679 echo "Yes, it can."
16682 echo "It can't, sorry."
16685 echo "(I can't compile the test program, so we'll assume not...)"
16695 : can memcpy handle overlapping blocks?
16698 case "$d_memmove" in
16699 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16700 *) case "$d_memcpy" in
16702 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16704 #$i_memory I_MEMORY
16705 #$i_stdlib I_STDLIB
16706 #$i_string I_STRING
16707 #$i_unistd I_UNISTD
16709 $cat >>try.c <<'EOCP'
16712 # include <memory.h>
16715 # include <stdlib.h>
16718 # include <string.h>
16720 # include <strings.h>
16723 # include <unistd.h> /* Needed for NetBSD */
16727 char buf[128], abc[128];
16733 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16734 try to store the string in read-only memory. */
16735 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16737 for (align = 7; align >= 0; align--) {
16738 for (len = 36; len; len--) {
16740 memcpy(b, abc, len);
16741 for (off = 1; off <= len; off++) {
16742 memcpy(b+off, b, len);
16743 memcpy(b, b+off, len);
16744 if (memcmp(b, abc, len))
16753 if eval $compile_ok; then
16754 if $run ./try 2>/dev/null; then
16755 echo "Yes, it can."
16758 echo "It can't, sorry."
16761 echo "(I can't compile the test program, so we'll assume not...)"
16771 : can memcmp be trusted to compare relative magnitude?
16773 case "$d_memcmp" in
16776 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16778 #$i_memory I_MEMORY
16779 #$i_stdlib I_STDLIB
16780 #$i_string I_STRING
16781 #$i_unistd I_UNISTD
16783 $cat >>try.c <<'EOCP'
16786 # include <memory.h>
16789 # include <stdlib.h>
16792 # include <string.h>
16794 # include <strings.h>
16797 # include <unistd.h> /* Needed for NetBSD */
16803 if ((a < b) && memcmp(&a, &b, 1) < 0)
16809 if eval $compile_ok; then
16810 if $run ./try 2>/dev/null; then
16811 echo "Yes, it can."
16814 echo "No, it can't (it uses signed chars)."
16817 echo "(I can't compile the test program, so we'll assume not...)"
16825 : see if prototype for sbrk is available
16827 set d_sbrkproto sbrk $i_unistd unistd.h
16830 : see if select exists
16831 set select d_select
16834 : see if semctl exists
16835 set semctl d_semctl
16838 : see if semget exists
16839 set semget d_semget
16842 : see if semop exists
16846 : see how much of the 'sem*(2)' library is present.
16849 case "$d_semctl$d_semget$d_semop" in
16850 *"$undef"*) h_sem=false;;
16854 case "`ipcs 2>&1`" in
16855 "SVID messages"*"not configured"*)
16856 echo "Your $osname does not have the sem*(2) configured." >&4
16859 set semctl d_semctl
16861 set semget d_semget
16869 : we could also check for sys/ipc.h ...
16870 if $h_sem && $test `./findhdr sys/sem.h`; then
16871 echo "You have the full sem*(2) library." >&4
16874 echo "You don't have the full sem*(2) library." >&4
16880 : see whether sys/sem.h defines union semun
16882 $cat > try.c <<'END'
16883 #include <sys/types.h>
16884 #include <sys/ipc.h>
16885 #include <sys/sem.h>
16886 int main () { union semun semun; semun.buf = 0; }
16889 if eval $compile; then
16890 echo "You have union semun in <sys/sem.h>." >&4
16893 echo "You do not have union semun in <sys/sem.h>." >&4
16900 : see how to do semctl IPC_STAT
16904 $cat > tryh.h <<END
16907 # define S_IRUSR S_IREAD
16908 # define S_IWUSR S_IWRITE
16909 # define S_IXUSR S_IEXEC
16911 # define S_IRUSR 0400
16912 # define S_IWUSR 0200
16913 # define S_IXUSR 0100
16915 # define S_IRGRP (S_IRUSR>>3)
16916 # define S_IWGRP (S_IWUSR>>3)
16917 # define S_IXGRP (S_IXUSR>>3)
16918 # define S_IROTH (S_IRUSR>>6)
16919 # define S_IWOTH (S_IWUSR>>6)
16920 # define S_IXOTH (S_IXUSR>>6)
16923 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16924 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16925 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16928 : see whether semctl IPC_STAT can use union semun
16929 case "$d_semctl_semun" in
16933 #include <sys/types.h>
16934 #include <sys/ipc.h>
16935 #include <sys/sem.h>
16936 #include <sys/stat.h>
16943 #$d_union_semun HAS_UNION_SEMUN
16946 #ifndef HAS_UNION_SEMUN
16949 struct semid_ds *buf;
16950 unsigned short *array;
16956 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16957 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16959 struct semid_ds argbuf;
16962 st = semctl(sem, 0, IPC_STAT, arg);
16966 # endif /* IPC_STAT */
16967 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16969 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16970 # endif /* IPC_RMID */
16971 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16973 #endif /* IPC_PRIVATE && ... */
16974 printf("semget failed: errno = %d\n", errno);
16979 if eval $compile; then
16982 semun) val="$define" ;;
16990 case "$d_semctl_semun" in
16992 echo "You can use union semun for semctl IPC_STAT." >&4
16995 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17000 : see whether semctl IPC_STAT can use struct semid_ds pointer
17001 case "$d_semctl_semid_ds" in
17004 $cat > try.c <<'END'
17005 #include <sys/types.h>
17006 #include <sys/ipc.h>
17007 #include <sys/sem.h>
17008 #include <sys/stat.h>
17016 struct semid_ds arg;
17019 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17020 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17023 st = semctl(sem, 0, IPC_STAT, &arg);
17025 printf("semid_ds\n");
17027 # endif /* IPC_STAT */
17028 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17030 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17031 # endif /* IPC_RMID */
17032 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17034 #endif /* IPC_PRIVATE && ... */
17035 printf("semget failed: errno = %d\n", errno);
17041 if eval $compile; then
17044 semid_ds) val="$define" ;;
17048 set d_semctl_semid_ds
17052 case "$d_semctl_semid_ds" in
17054 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17056 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17062 # We do not have the full sem*(2) library, so assume we can not
17068 set d_semctl_semid_ds
17074 : see if sendmsg exists
17075 set sendmsg d_sendmsg
17078 : see if setegid exists
17079 set setegid d_setegid
17082 : see if seteuid exists
17083 set seteuid d_seteuid
17086 : see if setgrent exists
17087 set setgrent d_setgrent
17090 : see if setgrent_r exists
17091 set setgrent_r d_setgrent_r
17093 case "$d_setgrent_r" in
17095 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17096 case "$d_setgrent_r_proto:$usethreads" in
17097 ":define") d_setgrent_r_proto=define
17098 set d_setgrent_r_proto setgrent_r $hdrs
17102 case "$d_setgrent_r_proto" in
17104 case "$setgrent_r_proto" in
17105 ''|0) try='int setgrent_r(FILE**);'
17106 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17108 case "$setgrent_r_proto" in
17109 ''|0) try='void setgrent_r(FILE**);'
17110 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17112 case "$setgrent_r_proto" in
17113 ''|0) d_setgrent_r=undef
17115 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17116 * ) case "$setgrent_r_proto" in
17117 REENTRANT_PROTO*) ;;
17118 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17120 echo "Prototype: $try" ;;
17123 *) case "$usethreads" in
17124 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17131 *) setgrent_r_proto=0
17135 : see if sethostent exists
17136 set sethostent d_sethent
17139 : see if sethostent_r exists
17140 set sethostent_r d_sethostent_r
17142 case "$d_sethostent_r" in
17144 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17145 case "$d_sethostent_r_proto:$usethreads" in
17146 ":define") d_sethostent_r_proto=define
17147 set d_sethostent_r_proto sethostent_r $hdrs
17151 case "$d_sethostent_r_proto" in
17153 case "$sethostent_r_proto" in
17154 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17155 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17157 case "$sethostent_r_proto" in
17158 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17159 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17161 case "$sethostent_r_proto" in
17162 ''|0) d_sethostent_r=undef
17163 sethostent_r_proto=0
17164 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17165 * ) case "$sethostent_r_proto" in
17166 REENTRANT_PROTO*) ;;
17167 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17169 echo "Prototype: $try" ;;
17172 *) case "$usethreads" in
17173 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17175 d_sethostent_r=undef
17176 sethostent_r_proto=0
17180 *) sethostent_r_proto=0
17184 : see if setitimer exists
17185 set setitimer d_setitimer
17188 : see if setlinebuf exists
17189 set setlinebuf d_setlinebuf
17192 : see if setlocale exists
17193 set setlocale d_setlocale
17196 : see if locale.h is available
17197 set locale.h i_locale
17200 : see if setlocale_r exists
17201 set setlocale_r d_setlocale_r
17203 case "$d_setlocale_r" in
17205 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17206 case "$d_setlocale_r_proto:$usethreads" in
17207 ":define") d_setlocale_r_proto=define
17208 set d_setlocale_r_proto setlocale_r $hdrs
17212 case "$d_setlocale_r_proto" in
17214 case "$setlocale_r_proto" in
17215 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17216 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17218 case "$setlocale_r_proto" in
17219 ''|0) d_setlocale_r=undef
17220 setlocale_r_proto=0
17221 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17222 * ) case "$setlocale_r_proto" in
17223 REENTRANT_PROTO*) ;;
17224 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17226 echo "Prototype: $try" ;;
17229 *) case "$usethreads" in
17230 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17232 d_setlocale_r=undef
17233 setlocale_r_proto=0
17237 *) setlocale_r_proto=0
17241 : see if setnetent exists
17242 set setnetent d_setnent
17245 : see if setnetent_r exists
17246 set setnetent_r d_setnetent_r
17248 case "$d_setnetent_r" in
17250 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17251 case "$d_setnetent_r_proto:$usethreads" in
17252 ":define") d_setnetent_r_proto=define
17253 set d_setnetent_r_proto setnetent_r $hdrs
17257 case "$d_setnetent_r_proto" in
17259 case "$setnetent_r_proto" in
17260 ''|0) try='int setnetent_r(int, struct netent_data*);'
17261 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17263 case "$setnetent_r_proto" in
17264 ''|0) try='void setnetent_r(int, struct netent_data*);'
17265 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17267 case "$setnetent_r_proto" in
17268 ''|0) d_setnetent_r=undef
17269 setnetent_r_proto=0
17270 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17271 * ) case "$setnetent_r_proto" in
17272 REENTRANT_PROTO*) ;;
17273 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17275 echo "Prototype: $try" ;;
17278 *) case "$usethreads" in
17279 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17281 d_setnetent_r=undef
17282 setnetent_r_proto=0
17286 *) setnetent_r_proto=0
17290 : see if setprotoent exists
17291 set setprotoent d_setpent
17294 : see if setpgid exists
17295 set setpgid d_setpgid
17298 : see if setpgrp2 exists
17299 set setpgrp2 d_setpgrp2
17302 : see if setpriority exists
17303 set setpriority d_setprior
17306 : see if setproctitle exists
17307 set setproctitle d_setproctitle
17310 : see if setprotoent_r exists
17311 set setprotoent_r d_setprotoent_r
17313 case "$d_setprotoent_r" in
17315 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17316 case "$d_setprotoent_r_proto:$usethreads" in
17317 ":define") d_setprotoent_r_proto=define
17318 set d_setprotoent_r_proto setprotoent_r $hdrs
17322 case "$d_setprotoent_r_proto" in
17324 case "$setprotoent_r_proto" in
17325 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17326 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17328 case "$setprotoent_r_proto" in
17329 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17330 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17332 case "$setprotoent_r_proto" in
17333 ''|0) d_setprotoent_r=undef
17334 setprotoent_r_proto=0
17335 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17336 * ) case "$setprotoent_r_proto" in
17337 REENTRANT_PROTO*) ;;
17338 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17340 echo "Prototype: $try" ;;
17343 *) case "$usethreads" in
17344 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17346 d_setprotoent_r=undef
17347 setprotoent_r_proto=0
17351 *) setprotoent_r_proto=0
17355 : see if setpwent exists
17356 set setpwent d_setpwent
17359 : see if setpwent_r exists
17360 set setpwent_r d_setpwent_r
17362 case "$d_setpwent_r" in
17364 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17365 case "$d_setpwent_r_proto:$usethreads" in
17366 ":define") d_setpwent_r_proto=define
17367 set d_setpwent_r_proto setpwent_r $hdrs
17371 case "$d_setpwent_r_proto" in
17373 case "$setpwent_r_proto" in
17374 ''|0) try='int setpwent_r(FILE**);'
17375 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17377 case "$setpwent_r_proto" in
17378 ''|0) try='void setpwent_r(FILE**);'
17379 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17381 case "$setpwent_r_proto" in
17382 ''|0) d_setpwent_r=undef
17384 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17385 * ) case "$setpwent_r_proto" in
17386 REENTRANT_PROTO*) ;;
17387 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17389 echo "Prototype: $try" ;;
17392 *) case "$usethreads" in
17393 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17400 *) setpwent_r_proto=0
17404 : see if setregid exists
17405 set setregid d_setregid
17407 set setresgid d_setresgid
17410 : see if setreuid exists
17411 set setreuid d_setreuid
17413 set setresuid d_setresuid
17416 : see if setrgid exists
17417 set setrgid d_setrgid
17420 : see if setruid exists
17421 set setruid d_setruid
17424 : see if setservent exists
17425 set setservent d_setsent
17428 : see if setservent_r exists
17429 set setservent_r d_setservent_r
17431 case "$d_setservent_r" in
17433 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17434 case "$d_setservent_r_proto:$usethreads" in
17435 ":define") d_setservent_r_proto=define
17436 set d_setservent_r_proto setservent_r $hdrs
17440 case "$d_setservent_r_proto" in
17442 case "$setservent_r_proto" in
17443 ''|0) try='int setservent_r(int, struct servent_data*);'
17444 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17446 case "$setservent_r_proto" in
17447 ''|0) try='void setservent_r(int, struct servent_data*);'
17448 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17450 case "$setservent_r_proto" in
17451 ''|0) d_setservent_r=undef
17452 setservent_r_proto=0
17453 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17454 * ) case "$setservent_r_proto" in
17455 REENTRANT_PROTO*) ;;
17456 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17458 echo "Prototype: $try" ;;
17461 *) case "$usethreads" in
17462 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17464 d_setservent_r=undef
17465 setservent_r_proto=0
17469 *) setservent_r_proto=0
17473 : see if setsid exists
17474 set setsid d_setsid
17477 : see if setvbuf exists
17478 set setvbuf d_setvbuf
17481 : see if sfio.h is available
17485 : see if sfio library is available
17496 : Ok, but do we want to use it.
17500 true|$define|[yY]*) dflt='y';;
17503 echo "$package can use the sfio library, but it is experimental."
17504 rp="You seem to have sfio available, do you want to try using it?"
17507 y|Y) echo "Ok, turning on sfio then."
17510 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17515 *) case "$usesfio" in
17516 true|$define|[yY]*)
17517 echo "Sorry, cannot find sfio on this machine." >&4
17518 echo "Ignoring your setting of usesfio=$usesfio." >&4
17527 $define) usesfio='true';;
17528 *) usesfio='false';;
17532 *) : Remove sfio from list of libraries to use
17535 echo "Removing unneeded -lsfio from library list" >&4
17536 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17539 echo "libs = $libs" >&4
17546 : see if shmctl exists
17547 set shmctl d_shmctl
17550 : see if shmget exists
17551 set shmget d_shmget
17554 : see if shmat exists
17557 : see what shmat returns
17560 $cat >shmat.c <<'END'
17561 #include <sys/shm.h>
17564 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17569 echo "and it returns ($shmattype)." >&4
17570 : see if a prototype for shmat is available
17571 xxx=`./findhdr sys/shm.h`
17572 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17573 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17584 set d_shmatprototype
17587 : see if shmdt exists
17591 : see how much of the 'shm*(2)' library is present.
17594 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17595 *"$undef"*) h_shm=false;;
17599 case "`ipcs 2>&1`" in
17600 "SVID shared memory"*"not configured"*)
17601 echo "Your $osname does not have the shm*(2) configured." >&4
17604 set shmctl d_shmctl
17606 set shmget d_shmget
17616 : we could also check for sys/ipc.h ...
17617 if $h_shm && $test `./findhdr sys/shm.h`; then
17618 echo "You have the full shm*(2) library." >&4
17621 echo "You don't have the full shm*(2) library." >&4
17627 : see if we have sigaction
17629 if set sigaction val -f d_sigaction; eval $csym; $val; then
17630 echo 'sigaction() found.' >&4
17633 #include <sys/types.h>
17634 #include <signal.h>
17635 #$i_stdlib I_STDLIB
17637 #include <stdlib.h>
17641 struct sigaction act, oact;
17643 oact.sa_handler = 0;
17644 /* so that act and oact are used */
17645 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17649 if eval $compile_ok; then
17652 echo "But you don't seem to have a usable struct sigaction." >&4
17656 echo 'sigaction NOT found.' >&4
17659 set d_sigaction; eval $setvar
17662 : see if this is a sunmath.h system
17663 set sunmath.h i_sunmath
17666 : see if signbit exists
17667 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17670 #$i_sunmath I_SUNMATH
17674 #ifdef I_SUNMATH /* Solaris special math library */
17675 # include <sunmath.h>
17678 int main(int argc, char **argv)
17682 if ((signbit(x) == 0) && (signbit(y) != 0))
17690 if eval $compile; then
17691 if $run ./try; then
17695 $echo "Signbit seems to be available, but doesn't work as I expected."
17696 $echo "I won't use it." >&4
17707 : see if sigprocmask exists
17708 set sigprocmask d_sigprocmask
17711 : see if sigsetjmp exists
17713 case "$d_sigsetjmp" in
17716 #include <setjmp.h>
17717 #$i_stdlib I_STDLIB
17719 #include <stdlib.h>
17725 if (sigsetjmp(env,1))
17728 siglongjmp(env, 1);
17733 if eval $compile; then
17734 if $run ./try >/dev/null 2>&1; then
17735 echo "POSIX sigsetjmp found." >&4
17739 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17745 echo "sigsetjmp not found." >&4
17749 *) val="$d_sigsetjmp"
17750 case "$d_sigsetjmp" in
17751 $define) echo "POSIX sigsetjmp found." >&4;;
17752 $undef) echo "sigsetjmp not found." >&4;;
17760 : see if snprintf exists
17761 set snprintf d_snprintf
17764 : see if vsnprintf exists
17765 set vsnprintf d_vsnprintf
17768 case "$d_snprintf-$d_vsnprintf" in
17771 Checking whether your snprintf() and vsnprintf() work okay...
17773 $cat >try.c <<'EOCP'
17774 /* v?snprintf testing logic courtesy of Russ Allbery.
17775 * According to C99:
17776 * - if the buffer is too short it still must be \0-terminated
17777 * - if the buffer is too short the potentially required length
17778 * must be returned and not -1
17779 * - if the buffer is NULL the potentially required length
17780 * must be returned and not -1 or core dump
17783 #include <stdarg.h>
17787 int test (char *format, ...)
17792 va_start (args, format);
17793 count = vsnprintf (buf, sizeof buf, format, args);
17800 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17801 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17805 if eval $compile; then
17808 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17810 Your snprintf() and snprintf() don't seem to be working okay.
17812 d_snprintf="$undef"
17813 d_vsnprintf="$undef"
17817 echo "(I can't seem to compile the test program--assuming they don't)"
17818 d_snprintf="$undef"
17819 d_vsnprintf="$undef"
17825 : see if sockatmark exists
17826 set sockatmark d_sockatmark
17829 : see if prototype for sockatmark is available
17831 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17834 : see if socks5_init exists
17835 set socks5_init d_socks5_init
17838 : see if sprintf returns the length of the string in the buffer as per ANSI
17839 $echo "Checking whether sprintf returns the length of the string..." >&4
17842 #$i_stdlib I_STDLIB
17844 #include <stdlib.h>
17846 #$i_string I_STRING
17848 # include <string.h>
17850 # include <strings.h>
17859 int check (size_t expect, int test) {
17860 size_t got = strlen(buffer);
17864 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17869 int main(int argc, char **argv) {
17872 check(sprintf(buffer, ""), ++test);
17873 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17874 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17881 if eval $compile; then
17885 sprintf returns the length of the string (as ANSI says it should)
17887 d_sprintf_returns_strlen="$define"
17890 sprintf does not return the length of the string (how old is this system?)
17892 d_sprintf_returns_strlen="$undef"
17896 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17897 d_sprintf_returns_strlen="$undef"
17901 : see if srand48_r exists
17902 set srand48_r d_srand48_r
17904 case "$d_srand48_r" in
17906 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17907 case "$d_srand48_r_proto:$usethreads" in
17908 ":define") d_srand48_r_proto=define
17909 set d_srand48_r_proto srand48_r $hdrs
17913 case "$d_srand48_r_proto" in
17915 case "$srand48_r_proto" in
17916 ''|0) try='int srand48_r(long, struct drand48_data*);'
17917 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17919 case "$srand48_r_proto" in
17920 ''|0) d_srand48_r=undef
17922 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17923 * ) case "$srand48_r_proto" in
17924 REENTRANT_PROTO*) ;;
17925 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17927 echo "Prototype: $try" ;;
17930 *) case "$usethreads" in
17931 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17938 *) srand48_r_proto=0
17942 : see if srandom_r exists
17943 set srandom_r d_srandom_r
17945 case "$d_srandom_r" in
17947 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17948 case "$d_srandom_r_proto:$usethreads" in
17949 ":define") d_srandom_r_proto=define
17950 set d_srandom_r_proto srandom_r $hdrs
17954 case "$d_srandom_r_proto" in
17956 case "$srandom_r_proto" in
17957 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17958 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17960 case "$srandom_r_proto" in
17961 ''|0) d_srandom_r=undef
17963 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17964 * ) case "$srandom_r_proto" in
17965 REENTRANT_PROTO*) ;;
17966 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17968 echo "Prototype: $try" ;;
17971 *) case "$usethreads" in
17972 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17979 *) srandom_r_proto=0
17983 : see if prototype for setresgid is available
17985 set d_sresgproto setresgid $i_unistd unistd.h
17988 : see if prototype for setresuid is available
17990 set d_sresuproto setresuid $i_unistd unistd.h
17993 : see if sys/stat.h is available
17994 set sys/stat.h i_sysstat
17997 : see if stat knows about block sizes
17999 echo "Checking to see if your struct stat has st_blocks field..." >&4
18000 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18003 : see if this is a sys/vfs.h system
18004 set sys/vfs.h i_sysvfs
18007 : see if this is a sys/statfs.h system
18008 set sys/statfs.h i_sysstatfs
18011 : Check for statfs_s
18013 echo "Checking to see if your system supports struct statfs..." >&4
18014 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
18016 case "$d_statfs_s" in
18017 "$define") echo "Yes, it does." ;;
18018 *) echo "No, it doesn't." ;;
18022 : see if struct statfs knows about f_flags
18023 case "$d_statfs_s" in
18026 echo "Checking to see if your struct statfs has f_flags field..." >&4
18027 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
18031 set d_statfs_f_flags
18035 case "$d_statfs_f_flags" in
18036 "$define") echo "Yes, it does." ;;
18037 *) echo "No, it doesn't." ;;
18040 : see what flavor, if any, of static inline is supported
18042 echo "Checking to see if your system supports static inline..."
18043 $cat > try.c <<'EOCP'
18044 #include <stdlib.h>
18045 extern int f_via_a(int x);
18046 extern int f_via_b(int x);
18047 int main(int argc, char **argv)
18056 return EXIT_SUCCESS;
18059 return EXIT_FAILURE;
18063 $cat > a.c <<'EOCP'
18064 static INLINE int f(int x) {
18075 $cat > b.c <<'EOCP'
18076 extern int f(int x);
18084 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18085 case "$perl_static_inline" in
18086 '') # Check the various possibilities, and break out on success.
18087 # For gcc, prefer __inline__, which will still permit
18088 # cflags.SH to add in -ansi.
18089 case "$gccversion" in
18090 '') xxx="inline __inline__ __inline _inline";;
18091 *) xxx="__inline__ inline __inline _inline";;
18093 for inline in $xxx; do
18094 set try -DINLINE=$inline a.c
18095 if eval $compile && $run ./try; then
18096 # Now make sure there is no external linkage of static
18098 set try -DINLINE=$inline -DUSE_B a.c b.c
18099 if eval $compile && $run ./try; then
18100 $echo "Your compiler supports static $inline, " >&4
18101 $echo "but it also creates an external definition," >&4
18102 $echo "so I won't use it." >&4
18105 $echo "Your compiler supports static $inline." >&4
18107 perl_static_inline="static $inline";
18111 $echo "Your compiler does NOT support static $inline." >&4
18116 *inline*) # Some variant of inline exists.
18117 echo "Keeping your $hint value of $perl_static_inline."
18120 static) # No inline capabilities
18121 echo "Keeping your $hint value of $perl_static_inline."
18124 *) # Unrecognized previous value -- blindly trust the supplied
18125 # value and hope it makes sense. Use old value for
18126 # d_static_inline, if there is one.
18127 echo "Keeping your $hint value of $perl_static_inline."
18128 case "$d_static_inline" in
18130 *) val=$d_static_inline ;;
18134 # Fallback to plain 'static' if nothing worked.
18135 case "$perl_static_inline" in
18137 perl_static_inline="static"
18141 set d_static_inline
18143 $rm -f a.[co] b.[co]
18146 : Check stream access
18148 Checking how to access stdio streams by file descriptor number...
18150 case "$stdio_stream_array" in
18151 '') $cat >try.c <<EOCP
18154 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18158 for s in _iob __iob __sF
18160 set try -DSTDIO_STREAM_ARRAY=$s
18161 if eval $compile; then
18162 case "`$run ./try`" in
18163 yes) stdio_stream_array=$s; break ;;
18169 case "$stdio_stream_array" in
18171 I can't figure out how to access stdio streams by file descriptor number.
18173 d_stdio_stream_array="$undef"
18176 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18178 d_stdio_stream_array="$define"
18182 : see if strcoll exists
18183 set strcoll d_strcoll
18186 : check for structure copying
18188 echo "Checking to see if your C compiler can copy structs..." >&4
18189 $cat >try.c <<'EOCP'
18199 if $cc -c try.c >/dev/null 2>&1 ; then
18201 echo "Yup, it can."
18204 echo "Nope, it can't."
18210 : see if strerror and/or sys_errlist[] exist
18212 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18213 if set strerror val -f d_strerror; eval $csym; $val; then
18214 echo 'strerror() found.' >&4
18215 d_strerror="$define"
18216 d_strerrm='strerror(e)'
18217 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18218 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18219 d_syserrlst="$define"
18221 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18222 d_syserrlst="$undef"
18224 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18225 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18226 echo 'strerror() found in string header.' >&4
18227 d_strerror="$define"
18228 d_strerrm='strerror(e)'
18229 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18230 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18231 d_syserrlst="$define"
18233 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18234 d_syserrlst="$undef"
18236 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18237 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18238 d_strerror="$undef"
18239 d_syserrlst="$define"
18240 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18242 echo 'strerror() and sys_errlist[] NOT found.' >&4
18243 d_strerror="$undef"
18244 d_syserrlst="$undef"
18245 d_strerrm='"unknown"'
18249 : see if strerror_r exists
18250 set strerror_r d_strerror_r
18252 case "$d_strerror_r" in
18254 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18255 case "$d_strerror_r_proto:$usethreads" in
18256 ":define") d_strerror_r_proto=define
18257 set d_strerror_r_proto strerror_r $hdrs
18261 case "$d_strerror_r_proto" in
18263 case "$strerror_r_proto" in
18264 ''|0) try='int strerror_r(int, char*, size_t);'
18265 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18267 case "$strerror_r_proto" in
18268 ''|0) try='int strerror_r(int, char*, int);'
18269 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18271 case "$strerror_r_proto" in
18272 ''|0) try='char* strerror_r(int, char*, size_t);'
18273 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18275 case "$strerror_r_proto" in
18276 ''|0) d_strerror_r=undef
18278 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18279 * ) case "$strerror_r_proto" in
18280 REENTRANT_PROTO*) ;;
18281 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18283 echo "Prototype: $try" ;;
18286 *) case "$usethreads" in
18287 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18294 *) strerror_r_proto=0
18298 : see if strftime exists
18299 set strftime d_strftime
18302 : see if strlcat exists
18303 set strlcat d_strlcat
18306 : see if strlcpy exists
18307 set strlcpy d_strlcpy
18310 : see if strtod exists
18311 set strtod d_strtod
18314 : see if strtol exists
18315 set strtol d_strtol
18318 : see if strtold exists
18319 set strtold d_strtold
18322 : see if strtoll exists
18323 set strtoll d_strtoll
18326 case "$d_longlong-$d_strtoll" in
18329 Checking whether your strtoll() works okay...
18331 $cat >try.c <<'EOCP'
18334 #define strtoll __strtoll
18337 #define strtoll _strtoll
18340 extern long long int strtoll(char *s, char **, int);
18341 static int bad = 0;
18342 int check(char *s, long long ell, int een) {
18345 gll = strtoll(s, 0, 10);
18346 if (!((gll == ell) && (errno == een)))
18350 check(" 1", 1LL, 0);
18351 check(" 0", 0LL, 0);
18352 check("-1", -1LL, 0);
18353 check("-9223372036854775808", -9223372036854775808LL, 0);
18354 check("-9223372036854775808", -9223372036854775808LL, 0);
18355 check(" 9223372036854775807", 9223372036854775807LL, 0);
18356 check("-9223372036854775808", -9223372036854775808LL, 0);
18357 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18358 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18364 if eval $compile; then
18367 ok) echo "Your strtoll() seems to be working okay." ;;
18369 Your strtoll() doesn't seem to be working okay.
18375 echo "(I can't seem to compile the test program--assuming it doesn't)"
18381 : see if strtoq exists
18382 set strtoq d_strtoq
18385 : see if strtoul exists
18386 set strtoul d_strtoul
18389 case "$d_strtoul" in
18392 Checking whether your strtoul() works okay...
18394 $cat >try.c <<'EOCP'
18397 extern unsigned long int strtoul(char *s, char **, int);
18398 static int bad = 0;
18399 void check(char *s, unsigned long eul, int een) {
18402 gul = strtoul(s, 0, 10);
18403 if (!((gul == eul) && (errno == een)))
18407 check(" 1", 1L, 0);
18408 check(" 0", 0L, 0);
18410 case "$longsize" in
18412 $cat >>try.c <<'EOCP'
18413 check("18446744073709551615", 18446744073709551615UL, 0);
18414 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18415 #if 0 /* strtoul() for /^-/ strings is undefined. */
18416 check("-1", 18446744073709551615UL, 0);
18417 check("-18446744073709551614", 2, 0);
18418 check("-18446744073709551615", 1, 0);
18419 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18420 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18425 $cat >>try.c <<'EOCP'
18426 check("4294967295", 4294967295UL, 0);
18427 check("4294967296", 4294967295UL, ERANGE);
18428 #if 0 /* strtoul() for /^-/ strings is undefined. */
18429 check("-1", 4294967295UL, 0);
18430 check("-4294967294", 2, 0);
18431 check("-4294967295", 1, 0);
18432 check("-4294967296", 4294967295UL, ERANGE);
18433 check("-4294967297", 4294967295UL, ERANGE);
18438 : Should we write these tests to be more portable by sprintf-ing
18439 : ~0 and then manipulating that char string as input for strtol?
18442 $cat >>try.c <<'EOCP'
18449 if eval $compile; then
18450 case "`$run ./try`" in
18451 ok) echo "Your strtoul() seems to be working okay." ;;
18453 Your strtoul() doesn't seem to be working okay.
18459 echo "(I can't seem to compile the test program--assuming it doesn't)"
18465 : see if strtoull exists
18466 set strtoull d_strtoull
18469 case "$d_longlong-$d_strtoull" in
18472 Checking whether your strtoull() works okay...
18474 $cat >try.c <<'EOCP'
18477 #define strtoull __strtoull
18480 extern unsigned long long int strtoull(char *s, char **, int);
18481 static int bad = 0;
18482 int check(char *s, long long eull, int een) {
18485 gull = strtoull(s, 0, 10);
18486 if (!((gull == eull) && (errno == een)))
18490 check(" 1", 1LL, 0);
18491 check(" 0", 0LL, 0);
18492 check("18446744073709551615", 18446744073709551615ULL, 0);
18493 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18494 #if 0 /* strtoull() for /^-/ strings is undefined. */
18495 check("-1", 18446744073709551615ULL, 0);
18496 check("-18446744073709551614", 2LL, 0);
18497 check("-18446744073709551615", 1LL, 0);
18498 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18499 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18506 if eval $compile; then
18507 case "`$run ./try`" in
18508 ok) echo "Your strtoull() seems to be working okay." ;;
18510 Your strtoull() doesn't seem to be working okay.
18512 d_strtoull="$undef"
18516 echo "(I can't seem to compile the test program--assuming it doesn't)"
18517 d_strtoull="$undef"
18522 : see if strtouq exists
18523 set strtouq d_strtouq
18526 case "$d_strtouq" in
18529 Checking whether your strtouq() works okay...
18531 $cat >try.c <<'EOCP'
18534 extern unsigned long long int strtouq(char *s, char **, int);
18535 static int bad = 0;
18536 void check(char *s, unsigned long long eull, int een) {
18537 unsigned long long gull;
18539 gull = strtouq(s, 0, 10);
18540 if (!((gull == eull) && (errno == een)))
18544 check(" 1", 1LL, 0);
18545 check(" 0", 0LL, 0);
18546 check("18446744073709551615", 18446744073709551615ULL, 0);
18547 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18548 #if 0 /* strtouq() for /^-/ strings is undefined. */
18549 check("-1", 18446744073709551615ULL, 0);
18550 check("-18446744073709551614", 2LL, 0);
18551 check("-18446744073709551615", 1LL, 0);
18552 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18553 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18561 if eval $compile; then
18562 case "`$run ./try`" in
18563 ok) echo "Your strtouq() seems to be working okay." ;;
18565 Your strtouq() doesn't seem to be working okay.
18571 echo "(I can't seem to compile the test program--assuming it doesn't)"
18577 : see if strxfrm exists
18578 set strxfrm d_strxfrm
18581 : see if symlink exists
18582 set symlink d_symlink
18585 : see if syscall exists
18586 set syscall d_syscall
18589 : see if prototype for syscall is available
18591 set d_syscallproto syscall $i_unistd unistd.h
18594 : see if sysconf exists
18595 set sysconf d_sysconf
18598 : see if system exists
18599 set system d_system
18602 : see if tcgetpgrp exists
18603 set tcgetpgrp d_tcgetpgrp
18606 : see if tcsetpgrp exists
18607 set tcsetpgrp d_tcsetpgrp
18610 : see if prototype for telldir is available
18612 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18615 : see if time exists
18617 if test "X$d_time" = X -o X"$timetype" = X; then
18618 if set time val -f d_time; eval $csym; $val; then
18619 echo 'time() found.' >&4
18621 rp="What is the type returned by time() on this system?"
18622 set time_t timetype long stdio.h sys/types.h
18625 echo 'time() not found, hope that will do.' >&4
18633 : see if timegm exists
18634 set timegm d_timegm
18637 : see if this is a sys/times.h system
18638 set sys/times.h i_systimes
18641 : see if times exists
18643 if set times val -f d_times; eval $csym; $val; then
18644 echo 'times() found.' >&4
18647 case "$i_systimes" in
18648 "$define") inc='sys/times.h';;
18650 rp="What is the type returned by times() on this system?"
18651 set clock_t clocktype long stdio.h sys/types.h $inc
18654 echo 'times() NOT found, hope that will do.' >&4
18659 : see if tmpnam_r exists
18660 set tmpnam_r d_tmpnam_r
18662 case "$d_tmpnam_r" in
18664 hdrs="$i_systypes sys/types.h define stdio.h "
18665 case "$d_tmpnam_r_proto:$usethreads" in
18666 ":define") d_tmpnam_r_proto=define
18667 set d_tmpnam_r_proto tmpnam_r $hdrs
18671 case "$d_tmpnam_r_proto" in
18673 case "$tmpnam_r_proto" in
18674 ''|0) try='char* tmpnam_r(char*);'
18675 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18677 case "$tmpnam_r_proto" in
18678 ''|0) d_tmpnam_r=undef
18680 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18681 * ) case "$tmpnam_r_proto" in
18682 REENTRANT_PROTO*) ;;
18683 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18685 echo "Prototype: $try" ;;
18688 *) case "$usethreads" in
18689 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18696 *) tmpnam_r_proto=0
18700 : see if truncate exists
18701 set truncate d_truncate
18704 : see if ttyname_r exists
18705 set ttyname_r d_ttyname_r
18707 case "$d_ttyname_r" in
18709 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18710 case "$d_ttyname_r_proto:$usethreads" in
18711 ":define") d_ttyname_r_proto=define
18712 set d_ttyname_r_proto ttyname_r $hdrs
18716 case "$d_ttyname_r_proto" in
18718 case "$ttyname_r_proto" in
18719 ''|0) try='int ttyname_r(int, char*, size_t);'
18720 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18722 case "$ttyname_r_proto" in
18723 ''|0) try='int ttyname_r(int, char*, int);'
18724 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18726 case "$ttyname_r_proto" in
18727 ''|0) try='char* ttyname_r(int, char*, int);'
18728 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18730 case "$ttyname_r_proto" in
18731 ''|0) d_ttyname_r=undef
18733 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18734 * ) case "$ttyname_r_proto" in
18735 REENTRANT_PROTO*) ;;
18736 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18738 echo "Prototype: $try" ;;
18741 *) case "$usethreads" in
18742 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18749 *) ttyname_r_proto=0
18753 : see if tzname[] exists
18755 if set tzname val -a d_tzname; eval $csym; $val; then
18757 echo 'tzname[] found.' >&4
18760 echo 'tzname[] NOT found.' >&4
18765 : Check if is a multiplatform env
18767 next|darwin) multiarch="$define" ;;
18769 case "$multiarch" in
18770 ''|[nN]*) multiarch="$undef" ;;
18773 : check for ordering of bytes in a UV
18775 case "$usecrosscompile$multiarch" in
18778 You seem to be either cross-compiling or doing a multiarchitecture build,
18779 skipping the byteorder check.
18785 case "$byteorder" in
18788 In the following, larger digits indicate more significance. A big-endian
18789 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18790 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18791 machines may have weird orders like 3412. A Cray will report 87654321,
18792 an Alpha will report 12345678. If the test program works the default is
18794 I'm now running the test program...
18798 #$i_stdlib I_STDLIB
18800 #include <stdlib.h>
18802 #include <sys/types.h>
18803 typedef $uvtype UV;
18813 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18815 u.l = (UV)0x04030201;
18816 for (i = 0; i < $uvsize; i++)
18817 printf("%c", u.c[i]+'0');
18824 if eval $compile && $run ./try > /dev/null; then
18827 [1-4][1-4][1-4][1-4]|12345678|87654321)
18828 echo "(The test program ran ok.)"
18829 echo "byteorder=$dflt"
18832 ????|????????) echo "(The test program ran ok.)" ;;
18833 *) echo "(The test program didn't run right for some reason.)" ;;
18838 (I can't seem to compile the test program. Guessing big-endian...)
18841 case "$xxx_prompt" in
18843 rp="What is the order of bytes in $uvtype?"
18856 : Checking 32bit alignedness
18859 Checking to see whether you can access character data unalignedly...
18861 case "$d_u32align" in
18862 '') $cat >try.c <<EOCP
18864 #$i_stdlib I_STDLIB
18866 #include <stdlib.h>
18868 #define U32 $u32type
18869 #define BYTEORDER 0x$byteorder
18871 #include <signal.h>
18873 $signal_t bletch(int s) { exit(4); }
18876 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18877 volatile U8 buf[8];
18881 if (sizeof(U32) != 4) {
18882 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18889 signal(SIGBUS, bletch);
18901 for (i = 0; i < 4; i++) {
18902 up = (U32*)(buf + i);
18903 if (! ((*up == 1 << (8*i)) || /* big-endian */
18904 (*up == 1 << (8*(3-i))) /* little-endian */
18908 printf("read failed (%x)\n", *up);
18914 for (i = 0; i < 4; i++) {
18915 up = (U32*)(buf + i);
18917 if (*up != 0xBeef) {
18918 printf("write failed (%x)\n", *up);
18932 if eval $compile_ok; then
18933 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18934 $run ./try 2>&1 >/dev/null
18937 You can access character data pretty unalignedly.
18939 d_u32align="$undef"
18942 It seems that you must access character data in an aligned manner.
18944 d_u32align="$define"
18948 rp='Can you access character data at unaligned addresses?'
18952 [yY]*) d_u32align="$undef" ;;
18953 *) d_u32align="$define" ;;
18960 : see if ualarm exists
18961 set ualarm d_ualarm
18964 : see if umask exists
18968 : see if unordered exists
18969 set unordered d_unordered
18972 : see if unsetenv exists
18973 set unsetenv d_unsetenv
18976 : see if usleep exists
18977 set usleep d_usleep
18980 : see if prototype for usleep is available
18982 set d_usleepproto usleep $i_unistd unistd.h
18985 : see if ustat exists
18989 : see if closedir exists
18990 set closedir d_closedir
18993 case "$d_closedir" in
18996 echo "Checking whether closedir() returns a status..." >&4
18998 #$i_dirent I_DIRENT /**/
18999 #$i_sysdir I_SYS_DIR /**/
19000 #$i_sysndir I_SYS_NDIR /**/
19001 #$i_systypes I_SYS_TYPES /**/
19003 #if defined(I_SYS_TYPES)
19004 #include <sys/types.h>
19006 #if defined(I_DIRENT)
19007 #include <dirent.h>
19008 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19009 #include <sys/dir.h>
19013 #include <sys/ndir.h>
19017 #include <ndir.h> /* may be wrong in the future */
19019 #include <sys/dir.h>
19024 int main() { return closedir(opendir(".")); }
19027 if eval $compile_ok; then
19028 if $run ./try > /dev/null 2>&1 ; then
19029 echo "Yes, it does."
19032 echo "No, it doesn't."
19036 echo "(I can't seem to compile the test program--assuming it doesn't)"
19044 set d_void_closedir
19048 : see if there is a wait4
19052 : see if waitpid exists
19053 set waitpid d_waitpid
19056 : see if wcstombs exists
19057 set wcstombs d_wcstombs
19060 : see if wctomb exists
19061 set wctomb d_wctomb
19064 : see if writev exists
19065 set writev d_writev
19068 : preserve RCS keywords in files with variable substitution, grrr
19073 Revision='$Revision'
19075 : check for alignment requirements
19077 case "$usecrosscompile" in
19080 You seem to be cross-compiling. Skipping the memory alignment check.
19083 case "$alignbytes" in
19084 '') alignbytes=8 ;;
19088 case "$alignbytes" in
19089 '') echo "Checking alignment constraints..." >&4
19090 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19091 $cat >try.c <<'EOCP'
19092 typedef long double NV;
19095 $cat >try.c <<'EOCP'
19099 $cat >>try.c <<'EOCP'
19107 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19112 if eval $compile_ok; then
19116 echo "(I can't seem to compile the test program...)"
19118 case "$multiarch" in
19120 : The usual safe value is 8, but Darwin with -Duselongdouble
19121 : needs 16. Hence, we will take 8 as a minimum, but allow
19122 : Configure to pick a larger value if needed.
19123 if $test "$dflt" -lt 8; then
19125 echo "Setting alignment to 8 for multiarch support.">&4
19130 *) dflt="$alignbytes"
19133 rp="Doubles must be aligned on a how-many-byte boundary?"
19141 : set the base revision
19144 : Determine if this is an EBCDIC system
19146 echo "Determining whether or not we are on an EBCDIC system..." >&4
19147 $cat >try.c <<'EOM'
19150 if ('M'==0xd4) return 0;
19155 case "$BOOTSTRAP_CHARSET" in
19156 Y|y|define) bootstrap_charset=$define ;;
19157 *) bootstrap_charset=$undef ;;
19162 if eval $compile_ok; then
19163 if $run ./try; then
19164 echo "You seem to speak EBCDIC." >&4
19167 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19170 echo "I'm unable to compile the test program." >&4
19171 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19177 : length of character in bytes. Is always 1, otherwise it is not C
19178 : This used to be a test using sizeof
19181 : Check for the number of bits in a character
19182 case "$charbits" in
19183 '') echo "Checking how long a character is (in bits)..." >&4
19190 for (c = 1, n = 0; c; c <<= 1, n++) ;
19191 printf ("%d\n", n);
19196 if eval $compile_ok; then
19200 echo "(I can't seem to compile the test program. Guessing...)"
19207 rp="What is the length of a character (in bits)?"
19211 case "$charbits" in
19214 Your system has an unsigned character size of $charbits bits, which
19215 is rather unusual (normally it is 8 bits). Perl likely will not work
19216 correctly on your system, with subtle bugs in various places.
19218 rp='Do you really want to continue?'
19222 [yY]) echo >&4 "Okay, continuing." ;;
19227 : how do we concatenate cpp tokens here?
19229 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19230 $cat >cpp_stuff.c <<'EOCP'
19231 #define RCAT(a,b)a/**/b
19232 #define ACAT(a,b)a ## b
19236 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19237 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19238 echo "Oh! Smells like ANSI's been here." >&4
19239 echo "We can catify or stringify, separately or together!"
19241 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19242 echo "Ah, yes! The good old days!" >&4
19243 echo "However, in the good old days we don't know how to stringify and"
19244 echo "catify at the same time."
19248 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19249 You're going to have to edit the values of CAT[2-5] in config.h...
19251 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19255 : see if this is a db.h system
19261 : Check db version.
19263 echo "Checking Berkeley DB version ..." >&4
19269 #include <sys/types.h>
19271 #$i_stdlib I_STDLIB
19273 #include <stdlib.h>
19276 int main(int argc, char *argv[])
19278 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19279 int Major, Minor, Patch ;
19280 unsigned long Version ;
19281 (void)db_version(&Major, &Minor, &Patch) ;
19283 printf("%d %d %d %d %d %d\n",
19284 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19285 Major, Minor, Patch);
19288 printf("You have Berkeley DB Version 2 or greater.\n");
19290 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19291 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19292 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19293 Major, Minor, Patch) ;
19295 /* check that db.h & libdb are compatible */
19296 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19297 printf("db.h and libdb are incompatible.\n") ;
19301 printf("db.h and libdb are compatible.\n") ;
19303 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19304 + DB_VERSION_PATCH ;
19306 /* needs to be >= 2.3.4 */
19307 if (Version < 2003004) {
19308 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19309 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19315 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19320 printf("You have Berkeley DB Version 1.\n");
19321 exit(0); /* DB version < 2: the coast is clear. */
19323 exit(1); /* <db.h> not Berkeley DB? */
19329 if eval $compile_ok && $run ./try; then
19330 echo 'Looks OK.' >&4
19332 db_version_major=$1
19333 db_version_minor=$2
19334 db_version_patch=$3
19336 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19340 : Remove db from list of libraries to use
19341 echo "Removing unusable -ldb from library list" >&4
19342 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19345 echo "libs = $libs" >&4
19355 : Check the return type needed for hash
19357 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19363 #include <sys/types.h>
19366 #ifndef DB_VERSION_MAJOR
19367 u_int32_t hash_cb (ptr, size)
19375 info.hash = hash_cb;
19379 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19380 if $contains warning try.out >>/dev/null 2>&1 ; then
19383 db_hashtype='u_int32_t'
19386 : XXX Maybe we should just give up here.
19387 db_hashtype=u_int32_t
19389 echo "Help: I can't seem to compile the db test program." >&4
19390 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19393 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19395 *) db_hashtype=u_int32_t
19400 : Check the return type needed for prefix
19402 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19408 #include <sys/types.h>
19411 #ifndef DB_VERSION_MAJOR
19412 size_t prefix_cb (key1, key2)
19420 info.prefix = prefix_cb;
19424 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19425 if $contains warning try.out >>/dev/null 2>&1 ; then
19426 db_prefixtype='int'
19428 db_prefixtype='size_t'
19431 db_prefixtype='size_t'
19432 : XXX Maybe we should just give up here.
19434 echo "Help: I can't seem to compile the db test program." >&4
19435 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19438 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19440 *) db_prefixtype='size_t'
19444 : How can we generate normalized random numbers ?
19446 echo "Looking for a random number function..." >&4
19447 case "$randfunc" in
19449 if set drand48 val -f; eval $csym; $val; then
19451 echo "Good, found drand48()." >&4
19452 elif set random val -f; eval $csym; $val; then
19454 echo "OK, found random()." >&4
19457 echo "Yuck, looks like I have to use rand()." >&4
19468 *-Dmy_rand=*|*-Dmy_srand=*)
19469 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19470 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19471 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19472 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19476 while $test "$cont"; do
19477 rp="Use which function to generate random numbers?"
19479 if $test "$ans" = "$dflt"; then
19485 if set $ans val -f; eval $csym; $val; then
19489 rp="I cannot find function $ans. Use that name anyway?"
19498 case "$randfunc" in
19500 drand01="drand48()"
19506 case "$randbits" in
19508 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19510 #$i_unistd I_UNISTD
19511 #$i_stdlib I_STDLIB
19514 # include <unistd.h>
19517 # include <stdlib.h>
19523 unsigned long max = 0L;
19525 for (i = 1000; i; i--) {
19526 tmp = (unsigned long) $randfunc();
19527 if (tmp > max) max = tmp;
19529 for (i = 0; max; i++)
19535 if eval $compile_ok; then
19539 echo "(I can't seem to compile the test program...)"
19546 rp="How many bits does your $randfunc() function produce?"
19550 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19551 seedfunc="s$randfunc"
19552 randseedtype=unsigned
19556 rp="How many bits does your $randfunc() function produce?"
19559 seedfunc="s$randfunc"
19560 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19561 if set $seedfunc val -f; eval $csym; $val; then
19562 echo "(Using $seedfunc() to seed random generator)"
19564 echo "(Warning: no $seedfunc() to seed random generator)"
19567 randseedtype=unsigned
19574 : Check how to flush
19577 Checking how to flush all pending stdio output...
19579 # I only know how to find the first 32 possibly open files on SunOS.
19580 # See also hints/sunos_4_1.sh and util.c --AD
19582 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19584 $cat >>try.c <<EOCP
19586 #$i_stdlib I_STDLIB
19588 #include <stdlib.h>
19590 #$i_unistd I_UNISTD
19592 # include <unistd.h>
19594 #$d_sysconf HAS_SYSCONF
19595 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19596 #ifdef HAS_STDIO_STREAM_ARRAY
19597 # define STDIO_STREAM_ARRAY $stdio_stream_array
19602 p = fopen("try.out", "w");
19606 # ifdef TRY_FPRINTF
19610 #ifdef TRY_FFLUSH_NULL
19613 #ifdef TRY_FFLUSH_ALL
19615 long open_max = -1;
19616 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19617 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19619 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19620 open_max = sysconf(_SC_OPEN_MAX);
19623 open_max = FOPEN_MAX;
19626 open_max = OPEN_MAX;
19635 # ifdef HAS_STDIO_STREAM_ARRAY
19636 if (open_max > 0) {
19638 for (i = 0; i < open_max; i++)
19639 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19640 STDIO_STREAM_ARRAY[i]._file < open_max &&
19641 STDIO_STREAM_ARRAY[i]._flag)
19642 fflush(&STDIO_STREAM_ARRAY[i]);
19650 : first we have to find out how _not_ to flush
19652 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19654 set try -DTRY_FPUTC
19655 if eval $compile; then
19656 $run ./try 2>/dev/null
19659 if $test ! -s try.out -a "X$code" = X42; then
19665 set try -DTRY_FPRINTF
19666 if eval $compile; then
19667 $run ./try 2>/dev/null
19670 if $test ! -s try.out -a "X$code" = X42; then
19671 output=-DTRY_FPRINTF
19677 : check for fflush NULL behavior
19678 case "$fflushNULL" in
19679 '') set try -DTRY_FFLUSH_NULL $output
19680 if eval $compile; then
19681 $run ./try 2>/dev/null
19684 if $test -s try.out -a "X$code" = X42; then
19685 fflushNULL="`$cat try.out`"
19687 if $test "X$code" != X42; then
19689 (If this test failed, don't worry, we'll try another method shortly.)
19694 $rm -f core try.core core.try.*
19695 case "$fflushNULL" in
19697 Your fflush(NULL) works okay for output streams.
19698 Let's see if it clobbers input pipes...
19700 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19701 # bug that improperly flushes the input end of pipes. So we avoid the
19702 # autoflush on fork/system/exec support for now. :-(
19703 $cat >tryp.c <<EOCP
19706 main(int argc, char **argv)
19712 while ((i = getc(stdin)) != -1
19713 && (*bp++ = i) != '\n'
19714 && bp < &buf[1024])
19717 fprintf(stdout, "%s", buf);
19725 fflushNULL="$define"
19727 if eval $compile; then
19729 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19730 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19732 fflush(NULL) seems to behave okay with input streams.
19734 fflushNULL="$define"
19737 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19739 fflushNULL="$undef"
19742 $rm -f core tryp.c tryp.core core.tryp.*
19745 Your fflush(NULL) isn't working (contrary to ANSI C).
19747 fflushNULL="$undef"
19750 Cannot figure out whether your fflush(NULL) works or not.
19751 I'm assuming it doesn't (contrary to ANSI C).
19753 fflushNULL="$undef"
19757 $define|true|[yY]*)
19758 fflushNULL="$define"
19761 fflushNULL="$undef"
19764 : check explicit looping only if NULL did not work, and if the pipe
19765 : bug does not show up on an explicit flush too
19766 case "$fflushNULL" in
19768 $cat >tryp.c <<EOCP
19771 main(int argc, char **argv)
19777 while ((i = getc(stdin)) != -1
19778 && (*bp++ = i) != '\n'
19779 && bp < &buf[1024])
19782 fprintf(stdout, "%s", buf);
19791 if eval $compile; then
19793 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19794 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19796 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19798 : now check for fflushall behaviour
19799 case "$fflushall" in
19800 '') set try -DTRY_FFLUSH_ALL $output
19801 if eval $compile; then
19803 (Now testing the other method--but note that this also may fail.)
19805 $run ./try 2>/dev/null
19808 if $test -s try.out -a "X$code" = X42; then
19809 fflushall="`$cat try.out`"
19813 case "$fflushall" in
19815 Whew. Flushing explicitly all the stdio streams works.
19817 fflushall="$define"
19820 Sigh. Flushing explicitly all the stdio streams doesn't work.
19825 Cannot figure out whether flushing stdio streams explicitly works or not.
19826 I'm assuming it doesn't.
19832 "$define"|true|[yY]*)
19833 fflushall="$define"
19841 All is futile. Even fflush(stdin) clobbers input pipes!
19848 $rm -f core tryp.c tryp.core core.tryp.*
19850 *) fflushall="$undef"
19854 case "$fflushNULL$fflushall" in
19857 OK, I give up. I cannot figure out how to flush pending stdio output.
19858 We won't be flushing handles at all before fork/exec/popen.
19864 : Store the full pathname to the ar program for use in the C program
19865 : Respect a hint or command line value for full_ar.
19870 : Store the full pathname to the sed program for use in the C program
19873 : see what type gids are declared as in the kernel
19875 echo "Looking for the type for group ids returned by getgid()."
19876 set gid_t gidtype xxx stdio.h sys/types.h
19880 xxx=`./findhdr sys/user.h`
19881 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19883 unsigned) dflt="$1 $2" ;;
19887 *) dflt="$gidtype";;
19890 gid_t) echo "gid_t found." ;;
19891 *) rp="What is the type for group ids returned by getgid()?"
19897 : Check the size of GID
19900 *_t) zzz="$gidtype" ;;
19903 echo "Checking the size of $zzz..." >&4
19905 #include <sys/types.h>
19907 #$i_stdlib I_STDLIB
19909 #include <stdlib.h>
19912 printf("%d\n", (int)sizeof($gidtype));
19917 if eval $compile_ok; then
19921 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19924 echo "Your $zzz is $gidsize bytes long."
19929 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19933 : Check if GID is signed
19936 *_t) zzz="$gidtype" ;;
19939 echo "Checking the sign of $zzz..." >&4
19941 #include <sys/types.h>
19952 if eval $compile; then
19956 echo "(I can't execute the test program--guessing unsigned.)" >&4
19960 1) echo "Your $zzz is unsigned." ;;
19961 -1) echo "Your $zzz is signed." ;;
19967 echo "(I can't compile the test program--guessing unsigned.)" >&4
19971 : Check 64bit sizes
19974 if $test X"$quadtype" != X; then
19976 echo "Checking how to print 64-bit integers..." >&4
19978 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19979 $cat >try.c <<'EOCP'
19980 #include <sys/types.h>
19983 int q = 12345678901;
19984 printf("%ld\n", q);
19988 if eval $compile; then
19992 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19993 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19994 echo "We will use %d."
20000 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20001 $cat >try.c <<'EOCP'
20002 #include <sys/types.h>
20005 long q = 12345678901;
20006 printf("%ld\n", q);
20010 if eval $compile; then
20014 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20015 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20016 echo "We will use %ld."
20022 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20023 $cat >try.c <<'EOCP'
20024 #include <sys/types.h>
20025 #include <inttypes.h>
20028 int64_t q = 12345678901;
20029 printf("%" PRId64 "\n", q);
20033 if eval $compile; then
20037 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20038 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20039 echo "We will use the C9X style."
20045 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20047 #include <sys/types.h>
20050 $quadtype q = 12345678901;
20051 printf("%Ld\n", q);
20055 if eval $compile; then
20059 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20060 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20061 echo "We will use %Ld."
20067 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20068 $cat >try.c <<'EOCP'
20069 #include <sys/types.h>
20072 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20073 printf("%lld\n", q);
20077 if eval $compile; then
20081 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20082 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20083 echo "We will use the %lld style."
20089 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20091 #include <sys/types.h>
20094 $quadtype q = 12345678901;
20095 printf("%qd\n", q);
20099 if eval $compile; then
20103 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20104 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20105 echo "We will use %qd."
20111 if $test X"$sPRId64" = X; then
20112 echo "Cannot figure out how to print 64-bit integers." >&4
20119 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20120 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20122 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20123 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20127 : Check format strings for internal types
20129 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20131 if $test X"$ivsize" = X8; then
20132 ivdformat="$sPRId64"
20133 uvuformat="$sPRIu64"
20134 uvoformat="$sPRIo64"
20135 uvxformat="$sPRIx64"
20136 uvXUformat="$sPRIXU64"
20138 if $test X"$ivsize" = X"$longsize"; then
20145 if $test X"$ivsize" = X"$intsize"; then
20153 if $test X"$ivsize" = X"$shortsize"; then
20164 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20165 nveformat="$sPRIeldbl"
20166 nvfformat="$sPRIfldbl"
20167 nvgformat="$sPRIgldbl"
20168 nvEUformat="$sPRIEUldbl"
20169 nvFUformat="$sPRIFUldbl"
20170 nvGUformat="$sPRIGUldbl"
20180 case "$ivdformat" in
20181 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20186 : Check format string for GID
20189 $echo "Checking the format string to be used for gids..." >&4
20192 -1) if $test X"$gidsize" = X"$ivsize"; then
20193 gidformat="$ivdformat"
20195 if $test X"$gidsize" = X"$longsize"; then
20198 if $test X"$gidsize" = X"$intsize"; then
20201 if $test X"$gidsize" = X"$shortsize"; then
20208 *) if $test X"$gidsize" = X"$uvsize"; then
20209 gidformat="$uvuformat"
20211 if $test X"$gidsize" = X"$longsize"; then
20214 if $test X"$gidsize" = X"$intsize"; then
20217 if $test X"$gidsize" = X"$shortsize"; then
20226 : see if getgroups exists
20227 set getgroups d_getgrps
20230 : see if setgroups exists
20231 set setgroups d_setgrps
20234 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20236 case "$d_getgrps$d_setgrps" in
20238 case "$groupstype" in
20239 '') dflt="$gidtype" ;;
20240 *) dflt="$groupstype" ;;
20243 What type of pointer is the second argument to getgroups() and setgroups()?
20244 Usually this is the same as group ids, $gidtype, but not always.
20247 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20251 *) groupstype="$gidtype";;
20254 : MAD = Misc Attribute Definition
20256 if $test $patchlevel -lt 9; then
20257 : MAD is not available in 5.8.x or earlier.
20261 $define|true|[yY]*) dflt='y' ;;
20266 Would you like to build with Misc Attribute Decoration? This is development
20267 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20268 overhead on the interpreter.
20270 If this doesn't make any sense to you, just accept the default '$dflt'.
20272 rp='Build Perl with MAD?'
20277 madlyh='madly.h madly.act madly.tab'
20279 madlyobj="madly$_o" ;;
20288 : check whether make sets MAKE
20290 echo "Checking if your $make program sets \$(MAKE)..." >&4
20291 case "$make_set_make" in
20293 $sed 's/^X //' > testmake.mak << 'EOF'
20295 X @echo 'maketemp="$(MAKE)"'
20297 case "`$make -f testmake.mak 2>/dev/null`" in
20298 *maketemp=*) make_set_make='#' ;;
20299 *) make_set_make="MAKE=$make" ;;
20301 $rm -f testmake.mak
20304 case "$make_set_make" in
20305 '#') echo "Yup, it does.";;
20306 *) echo "Nope, it doesn't.";;
20309 : see what type is used for mode_t
20310 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20311 set mode_t modetype int stdio.h sys/types.h
20314 : see if we need va_copy
20316 case "$i_stdarg" in
20319 #include <stdarg.h>
20321 #$i_stdlib I_STDLIB
20323 #include <stdlib.h>
20325 #include <signal.h>
20328 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20330 return vfprintf(f, fmt, *valp);
20334 myvfprintf(FILE *f, const char *fmt, va_list val)
20336 return ivfprintf(f, fmt, &val);
20340 myprintf(char *fmt, ...)
20343 va_start(val, fmt);
20344 return myvfprintf(stdout, fmt, val);
20348 main(int ac, char **av)
20350 signal(SIGSEGV, exit);
20352 myprintf("%s%cs all right, then\n", "that", '\'');
20357 if eval $compile && $run ./try 2>&1 >/dev/null; then
20358 case "`$run ./try`" in
20359 "that's all right, then")
20365 yes) echo "It seems that you don't need va_copy()." >&4
20366 need_va_copy="$undef"
20368 *) echo "It seems that va_copy() or similar will be needed." >&4
20369 need_va_copy="$define"
20374 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20375 need_va_copy="$undef"
20379 : see what type is used for size_t
20380 rp="What is the type used for the length parameter for string functions?"
20381 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20384 : check for type of arguments to gethostbyaddr.
20385 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20386 case "$d_gethbyaddr" in
20390 Checking to see what type of arguments are accepted by gethostbyaddr().
20392 hdrs="$define sys/types.h
20393 $d_socket sys/socket.h
20394 $i_niin netinet/in.h
20396 $i_unistd unistd.h"
20397 : The first arg can 'char *' or 'void *'
20398 : The second arg is some of integral type
20399 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20400 for yyy in size_t long int; do
20401 case "$netdb_host_type" in
20402 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20403 if ./protochk "$try" $hdrs; then
20404 echo "Your system accepts $xxx for the first arg."
20405 echo "...and $yyy for the second arg."
20406 netdb_host_type="$xxx"
20407 netdb_hlen_type="$yyy"
20413 : In case none of those worked, prompt the user.
20414 case "$netdb_host_type" in
20415 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20418 netdb_host_type=$ans
20419 rp='What is the type for the 2nd argument to gethostbyaddr?'
20422 netdb_hlen_type=$ans
20426 *) : no gethostbyaddr, so pick harmless defaults
20427 netdb_host_type='char *'
20428 netdb_hlen_type="$sizetype"
20431 # Remove the "const" if needed. -- but then we'll have a
20433 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20436 : check for type of argument to gethostbyname.
20437 if test "X$netdb_name_type" = X ; then
20438 case "$d_gethbyname" in
20442 Checking to see what type of argument is accepted by gethostbyname().
20444 hdrs="$define sys/types.h
20445 $d_socket sys/socket.h
20446 $i_niin netinet/in.h
20448 $i_unistd unistd.h"
20449 for xxx in "const char *" "char *"; do
20450 case "$netdb_name_type" in
20451 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20452 if ./protochk "$try" $hdrs; then
20453 echo "Your system accepts $xxx."
20454 netdb_name_type="$xxx"
20459 : In case none of those worked, prompt the user.
20460 case "$netdb_name_type" in
20461 '') rp='What is the type for the 1st argument to gethostbyname?'
20464 netdb_name_type=$ans
20468 *) : no gethostbyname, so pick harmless default
20469 netdb_name_type='char *'
20474 : check for type of 1st argument to getnetbyaddr.
20475 if test "X$netdb_net_type" = X ; then
20476 case "$d_getnbyaddr" in
20480 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20482 hdrs="$define sys/types.h
20483 $d_socket sys/socket.h
20484 $i_niin netinet/in.h
20486 $i_unistd unistd.h"
20487 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20488 case "$netdb_net_type" in
20489 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20490 if ./protochk "$try" $hdrs; then
20491 echo "Your system accepts $xxx."
20492 netdb_net_type="$xxx"
20497 : In case none of those worked, prompt the user.
20498 case "$netdb_net_type" in
20499 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20502 netdb_net_type=$ans
20506 *) : no getnetbyaddr, so pick harmless default
20507 netdb_net_type='long'
20511 : locate the preferred pager for this system
20518 [a-zA-Z]:/*) dflt=$pg;;
20522 [a-zA-Z]:/*) dflt=$more;;
20526 [a-zA-Z]:/*) dflt=$less;;
20529 '') dflt=/usr/ucb/more;;
20537 rp='What pager is used on your system?'
20541 : see what type pids are declared as in the kernel
20542 rp="What is the type of process ids on this system?"
20543 set pid_t pidtype int stdio.h sys/types.h
20546 : see if ar generates random libraries by itself
20548 echo "Checking how to generate random libraries on your machine..." >&4
20549 echo 'int bar1() { return bar2(); }' > bar1.c
20550 echo 'int bar2() { return 2; }' > bar2.c
20552 #$i_stdlib I_STDLIB
20554 #include <stdlib.h>
20556 int main() { printf("%d\n", bar1()); exit(0); }
20558 $cc $ccflags -c bar1.c >/dev/null 2>&1
20559 $cc $ccflags -c bar2.c >/dev/null 2>&1
20560 $cc $ccflags -c foo.c >/dev/null 2>&1
20561 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20562 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20563 $run ./foobar >/dev/null 2>&1; then
20564 echo "$ar appears to generate random libraries itself."
20566 if [ "X$ranlib" = "X" ]; then
20569 elif $ar s bar$_a >/dev/null 2>&1 &&
20570 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20571 $run ./foobar >/dev/null 2>&1; then
20572 echo "a table of contents needs to be added with '$ar s'."
20575 elif $ar ts bar$_a >/dev/null 2>&1 &&
20576 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20577 $run ./foobar >/dev/null 2>&1; then
20578 echo "a table of contents needs to be added with '$ar ts'."
20585 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20586 $test -f $ranlib || ranlib=''
20589 if $test -n "$ranlib"; then
20590 echo "your system has '$ranlib'; we'll use that."
20593 echo "your system doesn't seem to support random libraries"
20594 echo "so we'll use lorder and tsort to order the libraries."
20601 : see if this is a values.h system
20602 set values.h i_values
20605 : Check the max offset that gmtime and localtime accept
20606 echo "Checking max offsets that gmtime () accepts"
20609 define) yyy="#include <values.h>" ;;
20613 case "$sGMTIME_min/$sGMTIME_max" in
20616 #include <sys/types.h>
20625 void gm_check (time_t t, int min_year, int max_year)
20628 if ( tmp == NULL ||
20629 /* Check tm_year overflow */
20630 tmp->tm_year < min_year || tmp->tm_year > max_year)
20641 gm_check (MAXLONG, 69, 0x7fffffff);
20643 if (tmp == NULL || tmp->tm_year < 0) {
20644 for (i = 63; i >= 0; i--) {
20645 time_t x = pt | ((time_t)1 << i);
20646 if (x < 0 || x < pt) continue;
20647 gm_check (x, 69, 0x7fffffff);
20650 printf ("sGMTIME_max=%ld\n", pt);
20659 gm_check (MINLONG, -1900, 70);
20662 for (i = 36; i >= 0; i--) {
20663 time_t x = pt - ((time_t)1 << i);
20664 if (x > 0) continue;
20665 gm_check (x, -1900, 70);
20668 printf ("sGMTIME_min=%ld\n", pt);
20672 int main (int argc, char *argv[])
20674 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20681 if eval $compile; then
20684 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20690 echo "Checking max offsets that localtime () accepts"
20692 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20695 #include <sys/types.h>
20704 void local_check (time_t t, int min_year, int max_year)
20706 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20709 tmp = localtime (&t);
20710 if ( tmp == NULL ||
20711 /* Check tm_year overflow */
20712 tmp->tm_year < min_year || tmp->tm_year > max_year)
20716 } /* local_check */
20723 local_check (MAXLONG, 69, 0x7fffffff);
20725 if (tmp == NULL || tmp->tm_year < 0) {
20726 for (i = 63; i >= 0; i--) {
20727 time_t x = pt | ((time_t)1 << i);
20728 if (x < 0 || x < pt) continue;
20729 local_check (x, 69, 0x7fffffff);
20732 printf ("sLOCALTIME_max=%ld\n", pt);
20741 local_check (MINLONG, -1900, 70);
20744 for (i = 36; i >= 0; i--) {
20745 time_t x = pt - ((time_t)1 << i);
20746 if (x > 0) continue;
20747 local_check (x, -1900, 70);
20750 printf ("sLOCALTIME_min=%ld\n", pt);
20754 int main (int argc, char *argv[])
20762 if eval $compile; then
20765 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20771 : check for type of arguments to select.
20772 case "$selecttype" in
20773 '') case "$d_select" in
20777 Checking to see what type of arguments are accepted by select().
20779 hdrs="$define sys/types.h
20780 $i_systime sys/time.h
20781 $i_sysselct sys/select.h
20782 $d_socket sys/socket.h"
20783 : The first arg can be int, unsigned, or size_t
20784 : The last arg may or may not be 'const'
20786 : void pointer has been seen but using that
20787 : breaks the selectminbits test
20788 for xxx in 'fd_set *' 'int *'; do
20789 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20790 for tmo in 'struct timeval *' 'const struct timeval *'; do
20792 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20793 if ./protochk "$try" $hdrs; then
20794 echo "Your system accepts $xxx."
20803 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20804 case "$d_fd_set" in
20805 $define) dflt="fd_set *" ;;
20814 *) : no select, so pick a harmless default
20821 : check for the select 'width'
20822 case "$selectminbits" in
20823 '') safebits=`expr $ptrsize \* 8`
20824 case "$d_select" in
20828 Checking to see on how many bits at a time your select() operates...
20831 #include <sys/types.h>
20833 #$i_systime I_SYS_TIME
20834 #$i_systimek I_SYS_TIME_KERNEL
20839 # ifdef I_SYS_TIME_KERNEL
20842 # include <sys/time.h>
20843 # ifdef I_SYS_TIME_KERNEL
20847 #$i_sysselct I_SYS_SELECT
20848 #ifdef I_SYS_SELECT
20849 #include <sys/select.h>
20851 #$d_socket HAS_SOCKET
20853 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20856 #$i_stdlib I_STDLIB
20858 #include <stdlib.h>
20861 #define S sizeof(*(b))
20863 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20864 #define NBITS (NBYTES * 8)
20866 char *s = (char *)malloc(NBYTES);
20875 fp = fopen("try.c", "r");
20881 b = ($selecttype)s;
20882 for (i = 0; i < NBITS; i++)
20886 select(fd + 1, b, 0, 0, &t);
20887 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20889 printf("%d\n", i + 1);
20894 if eval $compile_ok; then
20895 selectminbits=`$run ./try`
20896 case "$selectminbits" in
20898 Cannot figure out on how many bits at a time your select() operates.
20899 I'll play safe and guess it is $safebits bits.
20901 selectminbits=$safebits
20902 bits="$safebits bits"
20905 *) bits="$selectminbits bits" ;;
20907 echo "Your select() operates on $bits at a time." >&4
20909 rp='What is the minimum number of bits your select() operates on?'
20910 case "$byteorder" in
20911 12345678) dflt=64 ;;
20917 selectminbits="$val"
20921 *) : no select, so pick a harmless default
20922 selectminbits=$safebits
20928 : Trace out the files included by signal.h, then look for SIGxxx names.
20929 if [ "X$fieldn" = X ]; then
20930 : Just make some guesses. We check them later.
20931 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20933 xxx=`echo '#include <signal.h>' |
20934 $cppstdin $cppminus $cppflags 2>/dev/null |
20935 $grep '^[ ]*#.*include' |
20936 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20937 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20940 for xx in $xxx /dev/null ; do
20941 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20943 case "$xxxfiles" in
20944 '') xxxfiles=`./findhdr signal.h` ;;
20947 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20948 print substr($2, 4, 20)
20950 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20951 print substr($3, 4, 20)
20953 : Append some common names just in case the awk scan failed.
20954 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20955 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20956 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20957 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20958 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20960 : generate a few handy files for later
20961 $cat > signal.c <<EOCP
20962 #include <sys/types.h>
20963 #include <signal.h>
20964 #$i_stdlib I_STDLIB
20966 #include <stdlib.h>
20971 /* Strange style to avoid deeply-nested #if/#else/#endif */
20974 # define NSIG (_NSIG)
20980 # define NSIG (SIGMAX+1)
20986 # define NSIG (SIG_MAX+1)
20992 # define NSIG (_SIG_MAX+1)
20998 # define NSIG (MAXSIG+1)
21004 # define NSIG (MAX_SIG+1)
21009 # ifdef SIGARRAYSIZE
21010 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21016 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21020 /* Default to some arbitrary number that's big enough to get most
21021 of the common signals.
21027 printf("NSIG %d\n", NSIG);
21033 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21035 printf "#ifdef SIG"; printf $1; printf "\n"
21036 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21037 printf $1; printf ");\n"
21041 printf "#endif /* JUST_NSIG */\n";
21042 printf "exit(0);\n}\n";
21045 $cat >signal.awk <<'EOP'
21046 BEGIN { ndups = 0 }
21047 $1 ~ /^NSIG$/ { nsig = $2 }
21048 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21049 if ($2 > maxsig) { maxsig = $2 }
21050 if (sig_name[$2]) {
21051 dup_name[ndups] = $1
21052 dup_num[ndups] = $2
21064 printf("NSIG %d\n", nsig);
21065 for (n = 1; n < nsig; n++) {
21067 printf("%s %d\n", sig_name[n], sig_num[n])
21070 printf("NUM%d %d\n", n, n)
21073 for (n = 0; n < ndups; n++) {
21074 printf("%s %d\n", dup_name[n], dup_num[n])
21078 $cat >signal_cmd <<EOS
21080 if $test -s signal.lst; then
21081 echo "Using your existing signal.lst file"
21086 $cat >>signal_cmd <<'EOS'
21089 if eval $compile_ok; then
21090 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21091 $uniq | $awk -f signal.awk >signal.lst
21093 echo "(I can't seem be able to compile the whole test program)" >&4
21094 echo "(I'll try it in little pieces.)" >&4
21095 set signal -DJUST_NSIG
21096 if eval $compile_ok; then
21097 $run ./signal$_exe > signal.nsg
21100 echo "I can't seem to figure out how many signals you have." >&4
21101 echo "Guessing 50." >&4
21102 echo 'NSIG 50' > signal.nsg
21104 : Now look at all the signal names, one at a time.
21105 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21106 $cat > signal.c <<EOCP
21107 #include <sys/types.h>
21108 #include <signal.h>
21111 printf("$xx %d\n", SIG${xx});
21116 if eval $compile; then
21117 echo "SIG${xx} found."
21118 $run ./signal$_exe >> signal.ls1
21120 echo "SIG${xx} NOT found."
21123 if $test -s signal.ls1; then
21124 $cat signal.nsg signal.ls1 |
21125 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21129 if $test -s signal.lst; then
21132 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21133 echo 'kill -l' >signal
21134 set X `csh -f <signal`
21138 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21140 echo $@ | $tr ' ' $trnl | \
21141 $awk '{ printf "%s %d\n", $1, ++s; }
21142 END { printf "NSIG %d\n", ++s }' >signal.lst
21144 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21146 chmod a+x signal_cmd
21147 $eunicefix signal_cmd
21149 : generate list of signal names
21151 case "$sig_name_init" in
21153 *) case "$sig_num_init" in
21154 ''|*,*) doinit=yes ;;
21159 echo "Generating a list of signal names and numbers..." >&4
21161 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21162 sig_name=`$awk 'BEGIN { printf "ZERO " }
21163 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21164 sig_num=`$awk 'BEGIN { printf "0 " }
21165 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21166 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21167 !/^NSIG/ { printf "\"%s\", ", $1 }
21168 END { printf "0\n" }' signal.lst`
21169 sig_num_init=`$awk 'BEGIN { printf "0, " }
21170 !/^NSIG/ { printf "%d, ", $2}
21171 END { printf "0\n"}' signal.lst`
21174 echo "The following $sig_count signals are available:"
21176 echo $sig_name | $awk \
21177 'BEGIN { linelen = 0 }
21179 for (i = 1; i <= NF; i++) {
21180 name = "SIG" $i " "
21181 linelen = linelen + length(name)
21182 if (linelen > 70) {
21184 linelen = length(name)
21190 sig_size=`echo $sig_name | awk '{print NF}'`
21191 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21193 : Check size of size
21195 case "$sizetype" in
21196 *_t) zzz="$sizetype" ;;
21197 *) zzz="filesize" ;;
21199 echo "Checking the size of $zzz..." >&4
21201 #include <sys/types.h>
21203 #$i_stdlib I_STDLIB
21205 #include <stdlib.h>
21208 printf("%d\n", (int)sizeof($sizetype));
21213 if eval $compile_ok; then
21217 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21220 echo "Your $zzz size is $sizesize bytes."
21225 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21229 : check for socklen_t
21231 echo "Checking to see if you have socklen_t..." >&4
21233 #include <sys/types.h>
21234 #$d_socket HAS_SOCKET
21236 #include <sys/socket.h>
21238 int main() { socklen_t x = 16; }
21241 if eval $compile; then
21243 echo "You have socklen_t."
21246 echo "You do not have socklen_t."
21247 case "$sizetype" in
21248 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21255 : see if this is a socks.h system
21256 set socks.h i_socks
21259 : check for type of the size argument to socket calls
21260 case "$d_socket" in
21264 Checking to see what type is the last argument of accept().
21267 case "$d_socklen_t" in
21268 "$define") yyy="$yyy socklen_t"
21270 yyy="$yyy $sizetype int long unsigned"
21271 for xxx in $yyy; do
21272 case "$socksizetype" in
21273 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21274 case "$usesocks" in
21276 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21277 echo "Your system accepts '$xxx *' for the last argument of accept()."
21278 socksizetype="$xxx"
21281 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21282 echo "Your system accepts '$xxx *' for the last argument of accept()."
21283 socksizetype="$xxx"
21290 : In case none of those worked, prompt the user.
21291 case "$socksizetype" in
21292 '') rp='What is the type for socket address structure sizes?'
21299 *) : no sockets, so pick relatively harmless default
21304 : see what type is used for signed size_t
21305 set ssize_t ssizetype int stdio.h sys/types.h
21310 #$i_stdlib I_STDLIB
21312 #include <stdlib.h>
21314 #include <sys/types.h>
21315 #define Size_t $sizetype
21316 #define SSize_t $dflt
21319 if (sizeof(Size_t) == sizeof(SSize_t))
21321 else if (sizeof(Size_t) == sizeof(int))
21330 if eval $compile_ok && $run ./try > /dev/null; then
21331 ssizetype=`$run ./try`
21332 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21335 Help! I can't compile and run the ssize_t test program: please enlighten me!
21336 (This is probably a misconfiguration in your system or libraries, and
21337 you really ought to fix it. Still, I'll try anyway.)
21339 I need a type that is the same size as $sizetype, but is guaranteed to
21340 be signed. Common values are ssize_t, int and long.
21343 rp="What signed type is the same size as $sizetype?"
21349 : Check the size of st_ino
21351 $echo "Checking the size of st_ino..." >&4
21352 $cat > try.c <<EOCP
21353 #include <sys/stat.h>
21355 #$i_stdlib I_STDLIB
21357 #include <stdlib.h>
21361 printf("%d\n", (int)sizeof(st.st_ino));
21366 if eval $compile_ok; then
21370 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21372 *) st_ino_size=$val
21373 $echo "Your st_ino is $st_ino_size bytes long."
21378 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21382 : Check if st_ino is signed
21384 $echo "Checking the sign of st_ino..." >&4
21385 $cat > try.c <<EOCP
21386 #include <sys/stat.h>
21391 if (foo.st_ino < 0)
21398 if eval $compile; then
21402 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21404 *) st_ino_sign=$val
21405 case "$st_ino_sign" in
21406 1) $echo "Your st_ino is unsigned." ;;
21407 -1) $echo "Your st_ino is signed." ;;
21413 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21417 : see what type of char stdio uses.
21419 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21420 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21421 echo "Your stdio uses unsigned chars." >&4
21422 stdchar="unsigned char"
21424 echo "Your stdio uses signed chars." >&4
21429 : see what type uids are declared as in the kernel
21431 echo "Looking for the type for user ids returned by getuid()."
21432 set uid_t uidtype xxx stdio.h sys/types.h
21436 xxx=`./findhdr sys/user.h`
21437 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21439 unsigned) dflt="$1 $2" ;;
21443 *) dflt="$uidtype";;
21446 uid_t) echo "uid_t found." ;;
21447 *) rp="What is the type for user ids returned by getuid()?"
21453 : Check size of UID
21456 *_t) zzz="$uidtype" ;;
21459 echo "Checking the size of $zzz..." >&4
21461 #include <sys/types.h>
21463 #$i_stdlib I_STDLIB
21465 #include <stdlib.h>
21468 printf("%d\n", (int)sizeof($uidtype));
21473 if eval $compile_ok; then
21477 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21480 echo "Your $zzz is $uidsize bytes long."
21485 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21488 : Check if UID is signed
21491 *_t) zzz="$uidtype" ;;
21494 echo "Checking the sign of $zzz..." >&4
21496 #include <sys/types.h>
21507 if eval $compile; then
21511 echo "(I can't execute the test program--guessing unsigned.)" >&4
21515 1) echo "Your $zzz is unsigned." ;;
21516 -1) echo "Your $zzz is signed." ;;
21522 echo "(I can't compile the test program--guessing unsigned.)" >&4
21526 : Check format string for UID
21528 $echo "Checking the format string to be used for uids..." >&4
21531 -1) if $test X"$uidsize" = X"$ivsize"; then
21532 uidformat="$ivdformat"
21534 if $test X"$uidsize" = X"$longsize"; then
21537 if $test X"$uidsize" = X"$intsize"; then
21540 if $test X"$uidsize" = X"$shortsize"; then
21547 *) if $test X"$uidsize" = X"$uvsize"; then
21548 uidformat="$uvuformat"
21550 if $test X"$uidsize" = X"$longsize"; then
21553 if $test X"$uidsize" = X"$intsize"; then
21556 if $test X"$uidsize" = X"$shortsize"; then
21565 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21567 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21568 $cat >try.c <<'EOM'
21569 /* Intentionally a long probe as I'd like to sanity check that the exact
21570 approach is going to work, as thinking it will work, but only having it
21571 part working at runtime is worse than not having it. */
21573 #include <sys/types.h>
21574 #include <sys/sysctl.h>
21575 #include <sys/param.h>
21577 #include <string.h>
21578 #include <stdlib.h>
21579 #include <unistd.h>
21582 main(int argc, char **argv) {
21584 char *argv_leaf = strrchr(argv[0], '/');
21590 mib[1] = KERN_PROC;
21591 mib[2] = KERN_PROC_PATHNAME;
21595 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21599 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21604 if (size < strlen(argv_leaf) + 1) {
21605 fprintf(stderr, "size %lu is too short for a path\n",
21606 (unsigned long) size);
21610 if (size > MAXPATHLEN * MAXPATHLEN) {
21611 fprintf(stderr, "size %lu is too long for a path\n",
21612 (unsigned long) size);
21616 buffer = malloc(size);
21622 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21627 if (strlen(buffer) + 1 != size) {
21628 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21629 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21634 if (*buffer != '/') {
21635 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21639 if (strstr(buffer, "/./")) {
21640 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21644 if (strstr(buffer, "/../")) {
21645 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21649 buffer_leaf = strrchr(buffer, '/');
21650 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21651 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21663 if eval $compile; then
21664 if $run ./try; then
21665 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21668 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21672 echo "I'm unable to compile the test program." >&4
21673 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21677 set usekernprocpathname
21680 : Determine if we can use _NSGetExecutablePath to find executing program
21682 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21683 $cat >try.c <<'EOM'
21684 /* Intentionally a long probe as I'd like to sanity check that the exact
21685 approach is going to work, as thinking it will work, but only having it
21686 part working at runtime is worse than not having it. */
21687 #include <mach-o/dyld.h>
21689 #include <stdlib.h>
21690 #include <sys/param.h>
21691 #include <string.h>
21694 main(int argc, char **argv) {
21696 uint32_t size = sizeof(buf);
21700 char *argv_leaf = strrchr(argv[0], '/');
21704 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21708 _NSGetExecutablePath(buf, &size);
21709 if (size > MAXPATHLEN * MAXPATHLEN) {
21710 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21711 (unsigned int) size);
21715 buffer = malloc(size);
21721 result = _NSGetExecutablePath(buffer, &size);
21723 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21724 result, (unsigned int) size);
21728 tidied = realpath(buffer, NULL);
21730 perror("realpath");
21736 if (*tidied != '/') {
21737 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21741 if (strstr(tidied, "/./")) {
21742 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21746 if (strstr(tidied, "/../")) {
21747 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21751 tidied_leaf = strrchr(tidied, '/');
21752 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21753 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21765 if eval $compile; then
21766 if $run ./try; then
21767 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21770 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21773 echo "I'm unable to compile the test program." >&4
21774 echo "I'll assume no _NSGetExecutablePath here." >&4
21777 set usensgetexecutablepath
21780 : Check if site customization support was requested
21781 case "$usesitecustomize" in
21782 $define|true|[Yy]*)
21783 usesitecustomize="$define"
21786 usesitecustomize="$undef"
21790 : see if prototypes support variable argument declarations
21792 case "$prototype$i_stdarg" in
21794 echo "It appears we'll be able to prototype varargs functions." >&4
21798 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21805 : determine compiler compiler
21814 if $test -f "$byacc$_exe"; then
21816 comp="byacc or $comp"
21818 if $test -f "$bison$_exe"; then
21819 comp="$comp or bison -y"
21821 rp="Which compiler compiler ($comp) shall I use?"
21830 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21836 : see if this is a assert.h system
21837 set assert.h i_assert
21840 : see if this is a fp.h system
21844 : see if this is a fp_class.h system
21845 set fp_class.h i_fp_class
21848 : see if gdbm.h is available
21853 : see if gdbm_open exists
21854 set gdbm_open d_gdbm_open
21856 case "$d_gdbm_open" in
21859 echo "We won't be including <gdbm.h>"
21868 : see if this is a ieeefp.h system
21869 case "$i_ieeefp" in
21870 '' ) set ieeefp.h i_ieeefp
21875 : see if this is a libutil.h system
21876 set libutil.h i_libutil
21879 : see if mach cthreads are available
21880 if test "X$usethreads" = "X$define"; then
21881 set mach/cthreads.h i_machcthr
21884 i_machcthr="$undef"
21887 : see if this is a mntent.h system
21888 set mntent.h i_mntent
21891 : see if net/errno.h is available
21893 set net/errno.h val
21896 : Unfortunately, it causes problems on some systems. Arrgh.
21899 cat > try.c <<'EOM'
21902 #include <net/errno.h>
21908 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21909 echo "We'll be including <net/errno.h>." >&4
21911 echo "We won't be including <net/errno.h>." >&4
21920 : see if netinet/tcp.h is available
21921 set netinet/tcp.h i_netinettcp
21924 : see if this is a poll.h system
21928 : see if this is a prot.h system
21932 : Preprocessor symbols
21934 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21935 $cat <<'EOSH' > Cppsym.know
21936 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21937 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21938 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21939 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21940 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21941 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21942 bull c cadmus clipper CMU COFF COMPILER_VERSION
21943 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21944 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21945 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21946 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21948 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21949 H3050R H3050RX hbullx20 hcx host_mips
21950 hp200 hp300 hp700 HP700 hp800 hp9000
21951 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21952 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21953 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21954 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21955 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21956 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21957 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21958 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21959 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21960 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21961 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21962 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21963 MATH_HAS_NO_SIDE_EFFECTS
21964 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21965 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21966 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21967 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21968 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21969 NetBSD news1500 news1700 news1800 news1900 news3700
21970 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21971 ns32016 ns32332 ns32k nsc32000
21972 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21973 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21974 pc532 pdp11 PGC PIC plexus PORTAR posix
21975 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21976 POSIX_C_SOURCE POSIX_SOURCE POWER
21977 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21978 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21979 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21980 sony sony_news sonyrisc sparc sparclite spectrum
21981 stardent stdc STDC_EXT stratos sun sun3 sun386
21982 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21983 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21984 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21985 sysV68 sysV88 Tek4132 Tek4300 titan
21986 TM3200 TM5400 TM5600
21987 tower tower32 tower32_200 tower32_600 tower32_700
21988 tower32_800 tower32_850 tss
21989 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21990 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21991 unix UNIX95 UNIX99 unixpc unos
21992 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21993 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21994 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21996 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21997 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21998 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22001 # Maybe put other stuff here too.
22002 cat <<EOSH >>Cppsym.know
22005 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22006 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22007 $cat Cppsym.know > Cppsym.c
22008 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22009 $rm -f Cppsym.a Cppsym.b Cppsym.c
22010 cat <<EOSH > Cppsym
22012 if $test \$# -gt 0; then
22013 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22014 if $test -s Cppsym.got; then
22021 $tr " " "$trnl" | ./Cppsym.try
22027 cat <<EOSH > Cppsym.try
22029 cat <<'EOCP' > try.c
22032 #define STRINGIFY(a) "a"
22034 #if cpp_stuff == 42
22035 #define StGiFy(a) #a
22036 #define STRINGIFY(a) StGiFy(a)
22038 #if $cpp_stuff != 1 && $cpp_stuff != 42
22039 # include "Bletch: How does this C preprocessor stringify macros?"
22045 cat <<'EOSH' >> Cppsym.try
22047 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22048 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22049 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22050 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22052 echo 'return 0;}' >> try.c
22054 cat <<EOSH >> Cppsym.try
22056 case "$osname-$gccversion" in
22057 irix-) ccflags="\$ccflags -woff 1178" ;;
22058 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22060 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22062 chmod +x Cppsym.try
22063 $eunicefix Cppsym.try
22064 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22065 : Add in any Linux cpp "predefined macros":
22066 case "$osname::$gccversion" in
22067 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22069 rm -f $tHdrH'.h' $tHdrH
22071 # Filter out macro arguments, such as Linux's __INT8_C(c)
22072 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22073 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22074 if [ -s $tHdrH'_cppsym.real' ]; then
22075 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22078 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22081 : now check the C compiler for additional symbols
22082 postprocess_cc_v=''
22084 aix) postprocess_cc_v="|$tr , ' '" ;;
22091 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22094 -D*) echo "\$i" | $sed 's/^-D//';;
22095 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22100 postprocess_cc_v=''
22103 ./ccsym > ccsym1.raw
22104 if $test -s ccsym1.raw; then
22105 $sort ccsym1.raw | $uniq >ccsym.raw
22107 mv ccsym1.raw ccsym.raw
22110 $awk '/\=/ { print $0; next }
22111 { print $0"=1" }' ccsym.raw >ccsym.list
22112 $comm -13 Cppsym.true ccsym.list >ccsym.own
22113 $comm -12 Cppsym.true ccsym.list >ccsym.com
22114 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22116 if $test -z ccsym.raw; then
22117 echo "Your C compiler doesn't seem to define any symbols!" >&4
22119 echo "However, your C preprocessor defines the following symbols:"
22122 cppsymbols=`$cat Cppsym.true`
22123 cppsymbols=`echo $cppsymbols`
22124 cppccsymbols="$cppsymbols"
22126 if $test -s ccsym.com; then
22127 echo "Your C compiler and pre-processor define these symbols:"
22128 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22131 cppccsymbols=`$cat ccsym.com`
22132 cppccsymbols=`echo $cppccsymbols`
22133 $test "$silent" || sleep 1
22135 if $test -s ccsym.cpp; then
22136 $test "$also" && echo " "
22137 echo "Your C pre-processor ${also}defines the following symbols:"
22138 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22140 cppsymbols=`$cat ccsym.cpp`
22141 cppsymbols=`echo $cppsymbols`
22142 $test "$silent" || sleep 1
22144 if $test -s ccsym.own; then
22145 $test "$also" && echo " "
22146 echo "Your C compiler ${also}defines the following cpp symbols:"
22147 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22148 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22149 ccsymbols=`$cat ccsym.own`
22150 ccsymbols=`echo $ccsymbols`
22151 $test "$silent" || sleep 1
22155 : see if this is a termio system
22159 if $test `./findhdr termios.h`; then
22160 set tcsetattr i_termios
22166 "$define") echo "You have POSIX termios.h... good!" >&4;;
22167 *) if ./Cppsym pyr; then
22168 case "`/bin/universe`" in
22169 ucb) if $test `./findhdr sgtty.h`; then
22171 echo "<sgtty.h> found." >&4
22173 echo "System is pyramid with BSD universe."
22174 ./warn "<sgtty.h> not found--you could have problems."
22176 *) if $test `./findhdr termio.h`; then
22178 echo "<termio.h> found." >&4
22180 echo "System is pyramid with USG universe."
22181 ./warn "<termio.h> not found--you could have problems."
22185 if $test `./findhdr termio.h`; then
22186 echo "<termio.h> found." >&4
22188 elif $test `./findhdr sgtty.h`; then
22189 echo "<sgtty.h> found." >&4
22192 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22195 if $test `./findhdr sgtty.h`; then
22196 echo "<sgtty.h> found." >&4
22198 elif $test `./findhdr termio.h`; then
22199 echo "<termio.h> found." >&4
22202 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22206 set i_termio; eval $setvar
22207 val=$val2; set i_sgtty; eval $setvar
22208 val=$val3; set i_termios; eval $setvar
22210 : see if stdbool is available
22211 : we want a real compile instead of Inhdr because some Solaris systems
22212 : have stdbool.h, but it can only be used if the compiler indicates it
22213 : is sufficiently c99-compliant.
22217 #include <stdbool.h>
22222 int main(int argc, char **argv)
22228 if eval $compile; then
22229 echo "<stdbool.h> found." >&4
22232 echo "<stdbool.h> NOT found." >&4
22239 : see if stddef is available
22240 set stddef.h i_stddef
22243 : see if sys/access.h is available
22244 set sys/access.h i_sysaccess
22247 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22248 set sys/filio.h i_sysfilio
22251 if $test `./findhdr sys/ioctl.h`; then
22253 echo '<sys/ioctl.h> found.' >&4
22256 if $test $i_sysfilio = "$define"; then
22257 echo '<sys/ioctl.h> NOT found.' >&4
22259 $test $i_sgtty = "$define" && xxx="sgtty.h"
22260 $test $i_termio = "$define" && xxx="termio.h"
22261 $test $i_termios = "$define" && xxx="termios.h"
22262 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22268 : see if socket ioctl defs are in sys/sockio.h
22270 xxx=`./findhdr sys/sockio.h`
22271 if $test "$xxx"; then
22272 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22274 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22277 echo "No socket ioctls found in <sys/sockio.h>." >&4
22282 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22288 : see if this is a syslog.h system
22289 set syslog.h i_syslog
22292 : see if this is a sys/mode.h system
22293 set sys/mode.h i_sysmode
22296 : see if there is a sys/poll.h file
22297 set sys/poll.h i_syspoll
22300 : see if sys/resource.h has to be included
22301 set sys/resource.h i_sysresrc
22304 : see if sys/security.h is available
22305 set sys/security.h i_syssecrt
22308 : see if this is a sys/statvfs.h system
22309 set sys/statvfs.h i_sysstatvfs
22312 : see if this is a sys/un.h system
22313 set sys/un.h i_sysun
22316 : see if this is a sys/utsname.h system
22317 set sys/utsname.h i_sysutsname
22320 : see if this is a syswait system
22321 set sys/wait.h i_syswait
22324 : see if this is a ustat.h system
22325 set ustat.h i_ustat
22328 : see if this is an utime system
22329 set utime.h i_utime
22332 : see if this is a vfork system
22335 set vfork.h i_vfork
22345 echo "Looking for extensions..." >&4
22346 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22347 : contain old or inaccurate or duplicate values.
22348 nonxs_extensions=''
22350 : We do not use find because it might not be available.
22351 : We do not just use MANIFEST because the user may have dropped
22352 : some additional extensions into the source tree and expect them
22355 : Function to recursively find available extensions, ignoring DynaLoader
22356 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22357 : In 5.10.1 and later, extensions are stored in directories
22358 : like File-Glob instead of the older File/Glob/.
22362 DynaLoader|dynaload) ;;
22364 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22365 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22366 if $contains " $this_ext " $$.tmp; then
22368 echo "Duplicate directories detected for extension $xxx" >&4;
22369 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22370 case "$knowitall" in
22378 echo "Ok. Stopping Configure." >&4;
22379 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22382 echo "Ok. You will need to correct config.sh before running make." >&4;
22384 $ls -1 $xxx > $$.tmp;
22385 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22386 xs_extensions="$xs_extensions $this_ext";
22387 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22388 xs_extensions="$xs_extensions $this_ext";
22389 elif $test -d $xxx; then
22390 nonxs_extensions="$nonxs_extensions $this_ext";
22400 eval $find_extensions
22404 eval $find_extensions
22408 eval $find_extensions
22409 set X $xs_extensions
22411 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22412 set X $nonxs_extensions
22414 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22416 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22418 : Now see which are supported on this system.
22420 for xxx in $xs_extensions ; do
22424 $define) avail_ext="$avail_ext $xxx" ;;
22427 GDBM_File|gdbm_fil)
22429 $define) avail_ext="$avail_ext $xxx" ;;
22432 I18N/Langinfo|i18n_lan)
22433 case "$i_langinfo$d_nl_langinfo" in
22434 $define$define) avail_ext="$avail_ext $xxx" ;;
22438 : XXX Do we need a useipcsysv variable here
22439 case "${d_msg}${d_sem}${d_shm}" in
22440 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22443 NDBM_File|ndbm_fil)
22446 case "$osname-$use64bitint" in
22449 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22452 *) avail_ext="$avail_ext $xxx" ;;
22457 ODBM_File|odbm_fil)
22458 case "${i_dbm}${i_rpcsvcdbm}" in
22460 case "$d_cplusplus" in
22461 define) ;; # delete as a function name will not work
22462 *) case "$osname-$use64bitint" in
22465 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22468 *) avail_ext="$avail_ext $xxx" ;;
22476 case "$useopcode" in
22477 true|define|y) avail_ext="$avail_ext $xxx" ;;
22481 case "$useposix" in
22482 true|define|y) avail_ext="$avail_ext $xxx" ;;
22486 case "$d_socket" in
22487 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22490 Sys/Syslog|sys/syslog)
22491 : XXX syslog requires socket
22492 case "$d_socket" in
22493 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22497 case "$usethreads" in
22499 case "$use5005threads" in
22500 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22504 threads|threads/shared)
22505 # threads and threads::shared are special cases.
22506 # To stop people from asking "Perl 5.8.0 was supposed
22507 # to have this new fancy threads implementation but my
22508 # perl doesn't have it" and from people trying to
22509 # (re)install the threads module using CPAN.pm and
22510 # CPAN.pm then offering to reinstall Perl 5.8.0,
22511 # the threads.pm and threads/shared.pm will always be
22512 # there, croaking informatively ("you need to rebuild
22513 # all of Perl with threads, sorry") when threads haven't
22514 # been compiled in.
22516 avail_ext="$avail_ext $xxx"
22522 cygwin) avail_ext="$avail_ext $xxx" ;;
22525 XS/APItest|xs/apitest)
22526 # This is just for testing. Skip it unless we have dynamic loading.
22529 $define) avail_ext="$avail_ext $xxx" ;;
22532 XS/Typemap|xs/typemap)
22533 # This is just for testing. Skip it unless we have dynamic loading.
22535 $define) avail_ext="$avail_ext $xxx" ;;
22538 *) avail_ext="$avail_ext $xxx"
22547 case "$onlyextensions" in
22549 *) keepextensions=''
22550 echo "You have requested that only certain extensions be included..." >&4
22551 for i in $onlyextensions; do
22552 case " $avail_ext " in
22554 echo "Keeping extension $i."
22555 keepextensions="$keepextensions $i"
22557 *) echo "Ignoring extension $i." ;;
22560 avail_ext="$keepextensions"
22564 case "$noextensions" in
22566 *) keepextensions=''
22567 echo "You have requested that certain extensions be ignored..." >&4
22568 for i in $avail_ext; do
22569 case " $noextensions " in
22570 *" $i "*) echo "Ignoring extension $i." ;;
22571 *) echo "Keeping extension $i.";
22572 keepextensions="$keepextensions $i"
22576 avail_ext="$keepextensions"
22580 : Now see which nonxs extensions are supported on this system.
22581 : For now assume all are.
22583 for xxx in $nonxs_extensions ; do
22587 *) nonxs_ext="$nonxs_ext $xxx"
22599 A number of extensions are supplied with $package. You may choose to
22600 compile these extensions for dynamic loading (the default), compile
22601 them into the $package executable (static loading), or not include
22602 them at all. Answer "none" to include no extensions.
22603 Note that DynaLoader is always built and need not be mentioned here.
22606 case "$dynamic_ext" in
22608 : Exclude those listed in static_ext
22610 for xxx in $avail_ext; do
22611 case " $static_ext " in
22613 *) dflt="$dflt $xxx" ;;
22620 *) dflt="$dynamic_ext"
22621 # Perhaps we are reusing an old out-of-date config.sh.
22624 if test X"$dynamic_ext" != X"$avail_ext"; then
22626 NOTICE: Your previous config.sh list may be incorrect.
22627 The extensions now available to you are
22629 but the default list from your previous config.sh is
22641 rp="What extensions do you wish to load dynamically?"
22644 none) dynamic_ext=' ' ;;
22645 *) dynamic_ext="$ans" ;;
22648 case "$static_ext" in
22650 : Exclude those already listed in dynamic linking
22652 for xxx in $avail_ext; do
22653 case " $dynamic_ext " in
22655 *) dflt="$dflt $xxx" ;;
22662 *) dflt="$static_ext"
22669 rp="What extensions do you wish to load statically?"
22672 none) static_ext=' ' ;;
22673 *) static_ext="$ans" ;;
22678 A number of extensions are supplied with $package. Answer "none"
22679 to include no extensions.
22680 Note that DynaLoader is always built and need not be mentioned here.
22683 case "$static_ext" in
22684 '') dflt="$avail_ext" ;;
22685 *) dflt="$static_ext"
22686 # Perhaps we are reusing an old out-of-date config.sh.
22689 if test X"$static_ext" != X"$avail_ext"; then
22691 NOTICE: Your previous config.sh list may be incorrect.
22692 The extensions now available to you are
22694 but the default list from your previous config.sh is
22703 : Exclude those that are not xs extensions
22707 rp="What extensions do you wish to include?"
22710 none) static_ext=' ' ;;
22711 *) static_ext="$ans" ;;
22716 # Encode is a special case. If we are building Encode as a static
22717 # extension, we need to explicitly list its subextensions as well.
22718 # For other nested extensions, this is handled automatically by
22719 # the appropriate Makefile.PL.
22720 case " $static_ext " in
22721 *" Encode "*) # Add the subextensions of Encode
22723 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22724 static_ext="$static_ext Encode/$xxx"
22725 known_extensions="$known_extensions Encode/$xxx"
22731 set X $dynamic_ext $static_ext $nonxs_ext
22735 # Sanity check: We require an extension suitable for use with
22736 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22737 # should show up as failures in the test suite, but it's helpful to
22738 # catch them now.) The 'extensions' list is normally sorted
22739 # alphabetically, so we need to accept either
22740 # DB_File ... Fcntl ... IO ....
22741 # or something like
22742 # Fcntl ... NDBM_File ... IO ....
22743 case " $extensions" in
22744 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22745 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22746 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22747 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22748 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22752 : Remove libraries needed only for extensions
22753 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22754 : The exception is SunOS 4.x, which needs them.
22755 case "${osname}X${osvers}" in
22759 *) case "$usedl" in
22760 $define|true|[yY]*)
22761 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22765 *) perllibs="$libs"
22771 : Remove build directory name from cppstdin so it can be used from
22772 : either the present location or the final installed location.
22774 : Get out of the UU directory to get correct path name.
22776 case "$cppstdin" in
22778 echo "Stripping down cppstdin path name"
22784 : end of configuration questions
22786 echo "End of configuration questions."
22789 : back to where it started
22790 if test -d ../UU; then
22794 : configuration may be unconditionally patched via a 'config.arch' file
22795 if $test -f config.arch; then
22796 echo "I see a config.arch file, loading it." >&4
22800 : configuration may be patched via a 'config.over' file
22801 if $test -f config.over; then
22804 rp='I see a config.over file. Do you wish to load it?'
22807 n*) echo "OK, I'll ignore it.";;
22809 echo "Configuration override changes have been loaded."
22814 : in case they want portability, strip down executable paths
22815 case "$d_portable" in
22818 echo "Stripping down executable paths..." >&4
22819 for file in $loclist $trylist; do
22821 eval $file=`basename $temp`
22826 : create config.sh file
22828 echo "Creating config.sh..." >&4
22829 $spitshell <<EOT >config.sh
22832 # This file was produced by running the Configure script. It holds all the
22833 # definitions figured out by Configure. Should you modify one of these values,
22834 # do not forget to propagate your changes by running "Configure -der". You may
22835 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22838 # Package name : $package
22839 # Source directory : $src
22840 # Configuration time: $cf_time
22841 # Configured by : $cf_by
22842 # Target system : $myuname
22845 : Add in command line options if available
22846 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22848 $spitshell <<EOT >>config.sh
22857 Revision='$Revision'
22865 alignbytes='$alignbytes'
22866 ansi2knr='$ansi2knr'
22867 aphostname='$aphostname'
22868 api_revision='$api_revision'
22869 api_subversion='$api_subversion'
22870 api_version='$api_version'
22871 api_versionstring='$api_versionstring'
22874 archlibexp='$archlibexp'
22875 archname64='$archname64'
22876 archname='$archname'
22877 archobjs='$archobjs'
22878 asctime_r_proto='$asctime_r_proto'
22886 bootstrap_charset='$bootstrap_charset'
22888 byteorder='$byteorder'
22890 castflags='$castflags'
22893 cccdlflags='$cccdlflags'
22894 ccdlflags='$ccdlflags'
22896 ccflags_uselargefiles='$ccflags_uselargefiles'
22898 ccsymbols='$ccsymbols'
22899 ccversion='$ccversion'
22901 cf_email='$cf_email'
22903 charbits='$charbits'
22904 charsize='$charsize'
22908 clocktype='$clocktype'
22910 compress='$compress'
22911 contains='$contains'
22915 cpp_stuff='$cpp_stuff'
22916 cppccsymbols='$cppccsymbols'
22917 cppflags='$cppflags'
22919 cppminus='$cppminus'
22921 cppstdin='$cppstdin'
22922 cppsymbols='$cppsymbols'
22923 crypt_r_proto='$crypt_r_proto'
22924 cryptlib='$cryptlib'
22926 ctermid_r_proto='$ctermid_r_proto'
22927 ctime_r_proto='$ctime_r_proto'
22928 d_Gconvert='$d_Gconvert'
22929 d_PRIEUldbl='$d_PRIEUldbl'
22930 d_PRIFUldbl='$d_PRIFUldbl'
22931 d_PRIGUldbl='$d_PRIGUldbl'
22932 d_PRIXU64='$d_PRIXU64'
22933 d_PRId64='$d_PRId64'
22934 d_PRIeldbl='$d_PRIeldbl'
22935 d_PRIfldbl='$d_PRIfldbl'
22936 d_PRIgldbl='$d_PRIgldbl'
22937 d_PRIi64='$d_PRIi64'
22938 d_PRIo64='$d_PRIo64'
22939 d_PRIu64='$d_PRIu64'
22940 d_PRIx64='$d_PRIx64'
22941 d_SCNfldbl='$d_SCNfldbl'
22942 d__fwalk='$d__fwalk'
22943 d_access='$d_access'
22944 d_accessx='$d_accessx'
22947 d_archlib='$d_archlib'
22948 d_asctime64='$d_asctime64'
22949 d_asctime_r='$d_asctime_r'
22952 d_attribute_deprecated='$d_attribute_deprecated'
22953 d_attribute_format='$d_attribute_format'
22954 d_attribute_malloc='$d_attribute_malloc'
22955 d_attribute_nonnull='$d_attribute_nonnull'
22956 d_attribute_noreturn='$d_attribute_noreturn'
22957 d_attribute_pure='$d_attribute_pure'
22958 d_attribute_unused='$d_attribute_unused'
22959 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22963 d_bsdgetpgrp='$d_bsdgetpgrp'
22964 d_bsdsetpgrp='$d_bsdsetpgrp'
22965 d_builtin_choose_expr='$d_builtin_choose_expr'
22966 d_builtin_expect='$d_builtin_expect'
22968 d_c99_variadic_macros='$d_c99_variadic_macros'
22969 d_casti32='$d_casti32'
22970 d_castneg='$d_castneg'
22971 d_charvspr='$d_charvspr'
22973 d_chroot='$d_chroot'
22974 d_chsize='$d_chsize'
22976 d_clearenv='$d_clearenv'
22977 d_closedir='$d_closedir'
22978 d_cmsghdr_s='$d_cmsghdr_s'
22980 d_copysignl='$d_copysignl'
22981 d_cplusplus='$d_cplusplus'
22983 d_crypt_r='$d_crypt_r'
22985 d_ctermid='$d_ctermid'
22986 d_ctermid_r='$d_ctermid_r'
22987 d_ctime64='$d_ctime64'
22988 d_ctime_r='$d_ctime_r'
22989 d_cuserid='$d_cuserid'
22990 d_dbl_dig='$d_dbl_dig'
22991 d_dbminitproto='$d_dbminitproto'
22992 d_difftime64='$d_difftime64'
22993 d_difftime='$d_difftime'
22994 d_dir_dd_fd='$d_dir_dd_fd'
22996 d_dirnamlen='$d_dirnamlen'
22997 d_dlerror='$d_dlerror'
22998 d_dlopen='$d_dlopen'
22999 d_dlsymun='$d_dlsymun'
23000 d_dosuid='$d_dosuid'
23001 d_drand48_r='$d_drand48_r'
23002 d_drand48proto='$d_drand48proto'
23004 d_eaccess='$d_eaccess'
23005 d_endgrent='$d_endgrent'
23006 d_endgrent_r='$d_endgrent_r'
23007 d_endhent='$d_endhent'
23008 d_endhostent_r='$d_endhostent_r'
23009 d_endnent='$d_endnent'
23010 d_endnetent_r='$d_endnetent_r'
23011 d_endpent='$d_endpent'
23012 d_endprotoent_r='$d_endprotoent_r'
23013 d_endpwent='$d_endpwent'
23014 d_endpwent_r='$d_endpwent_r'
23015 d_endsent='$d_endsent'
23016 d_endservent_r='$d_endservent_r'
23017 d_eofnblk='$d_eofnblk'
23018 d_eunice='$d_eunice'
23019 d_faststdio='$d_faststdio'
23020 d_fchdir='$d_fchdir'
23021 d_fchmod='$d_fchmod'
23022 d_fchown='$d_fchown'
23024 d_fcntl_can_lock='$d_fcntl_can_lock'
23025 d_fd_macros='$d_fd_macros'
23026 d_fd_set='$d_fd_set'
23027 d_fds_bits='$d_fds_bits'
23028 d_fgetpos='$d_fgetpos'
23029 d_finite='$d_finite'
23030 d_finitel='$d_finitel'
23031 d_flexfnam='$d_flexfnam'
23033 d_flockproto='$d_flockproto'
23035 d_fp_class='$d_fp_class'
23036 d_fpathconf='$d_fpathconf'
23037 d_fpclass='$d_fpclass'
23038 d_fpclassify='$d_fpclassify'
23039 d_fpclassl='$d_fpclassl'
23040 d_fpos64_t='$d_fpos64_t'
23041 d_frexpl='$d_frexpl'
23042 d_fs_data_s='$d_fs_data_s'
23043 d_fseeko='$d_fseeko'
23044 d_fsetpos='$d_fsetpos'
23045 d_fstatfs='$d_fstatfs'
23046 d_fstatvfs='$d_fstatvfs'
23048 d_ftello='$d_ftello'
23050 d_futimes='$d_futimes'
23051 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23052 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23053 d_getaddrinfo='$d_getaddrinfo'
23054 d_getcwd='$d_getcwd'
23055 d_getespwnam='$d_getespwnam'
23056 d_getfsstat='$d_getfsstat'
23057 d_getgrent='$d_getgrent'
23058 d_getgrent_r='$d_getgrent_r'
23059 d_getgrgid_r='$d_getgrgid_r'
23060 d_getgrnam_r='$d_getgrnam_r'
23061 d_getgrps='$d_getgrps'
23062 d_gethbyaddr='$d_gethbyaddr'
23063 d_gethbyname='$d_gethbyname'
23064 d_gethent='$d_gethent'
23065 d_gethname='$d_gethname'
23066 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23067 d_gethostbyname_r='$d_gethostbyname_r'
23068 d_gethostent_r='$d_gethostent_r'
23069 d_gethostprotos='$d_gethostprotos'
23070 d_getitimer='$d_getitimer'
23071 d_getlogin='$d_getlogin'
23072 d_getlogin_r='$d_getlogin_r'
23073 d_getmnt='$d_getmnt'
23074 d_getmntent='$d_getmntent'
23075 d_getnameinfo='$d_getnameinfo'
23076 d_getnbyaddr='$d_getnbyaddr'
23077 d_getnbyname='$d_getnbyname'
23078 d_getnent='$d_getnent'
23079 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23080 d_getnetbyname_r='$d_getnetbyname_r'
23081 d_getnetent_r='$d_getnetent_r'
23082 d_getnetprotos='$d_getnetprotos'
23083 d_getpagsz='$d_getpagsz'
23084 d_getpbyname='$d_getpbyname'
23085 d_getpbynumber='$d_getpbynumber'
23086 d_getpent='$d_getpent'
23087 d_getpgid='$d_getpgid'
23088 d_getpgrp2='$d_getpgrp2'
23089 d_getpgrp='$d_getpgrp'
23090 d_getppid='$d_getppid'
23091 d_getprior='$d_getprior'
23092 d_getprotobyname_r='$d_getprotobyname_r'
23093 d_getprotobynumber_r='$d_getprotobynumber_r'
23094 d_getprotoent_r='$d_getprotoent_r'
23095 d_getprotoprotos='$d_getprotoprotos'
23096 d_getprpwnam='$d_getprpwnam'
23097 d_getpwent='$d_getpwent'
23098 d_getpwent_r='$d_getpwent_r'
23099 d_getpwnam_r='$d_getpwnam_r'
23100 d_getpwuid_r='$d_getpwuid_r'
23101 d_getsbyname='$d_getsbyname'
23102 d_getsbyport='$d_getsbyport'
23103 d_getsent='$d_getsent'
23104 d_getservbyname_r='$d_getservbyname_r'
23105 d_getservbyport_r='$d_getservbyport_r'
23106 d_getservent_r='$d_getservent_r'
23107 d_getservprotos='$d_getservprotos'
23108 d_getspnam='$d_getspnam'
23109 d_getspnam_r='$d_getspnam_r'
23110 d_gettimeod='$d_gettimeod'
23111 d_gmtime64='$d_gmtime64'
23112 d_gmtime_r='$d_gmtime_r'
23113 d_gnulibc='$d_gnulibc'
23114 d_grpasswd='$d_grpasswd'
23115 d_hasmntopt='$d_hasmntopt'
23117 d_ilogbl='$d_ilogbl'
23118 d_inc_version_list='$d_inc_version_list'
23120 d_inetaton='$d_inetaton'
23121 d_inetntop='$d_inetntop'
23122 d_inetpton='$d_inetpton'
23123 d_int64_t='$d_int64_t'
23124 d_ip_mreq='$d_ip_mreq'
23125 d_ip_mreq_source='$d_ip_mreq_source'
23126 d_ipv6_mreq='$d_ipv6_mreq'
23127 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23128 d_isascii='$d_isascii'
23129 d_isblank='$d_isblank'
23130 d_isfinite='$d_isfinite'
23133 d_isnanl='$d_isnanl'
23134 d_killpg='$d_killpg'
23135 d_lchown='$d_lchown'
23136 d_ldbl_dig='$d_ldbl_dig'
23137 d_libm_lib_version='$d_libm_lib_version'
23139 d_localtime64='$d_localtime64'
23140 d_localtime_r='$d_localtime_r'
23141 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23142 d_locconv='$d_locconv'
23144 d_longdbl='$d_longdbl'
23145 d_longlong='$d_longlong'
23146 d_lseekproto='$d_lseekproto'
23148 d_madvise='$d_madvise'
23149 d_malloc_good_size='$d_malloc_good_size'
23150 d_malloc_size='$d_malloc_size'
23152 d_mbstowcs='$d_mbstowcs'
23153 d_mbtowc='$d_mbtowc'
23154 d_memchr='$d_memchr'
23155 d_memcmp='$d_memcmp'
23156 d_memcpy='$d_memcpy'
23157 d_memmove='$d_memmove'
23158 d_memset='$d_memset'
23160 d_mkdtemp='$d_mkdtemp'
23161 d_mkfifo='$d_mkfifo'
23162 d_mkstemp='$d_mkstemp'
23163 d_mkstemps='$d_mkstemps'
23164 d_mktime64='$d_mktime64'
23165 d_mktime='$d_mktime'
23168 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23169 d_modflproto='$d_modflproto'
23170 d_mprotect='$d_mprotect'
23172 d_msg_ctrunc='$d_msg_ctrunc'
23173 d_msg_dontroute='$d_msg_dontroute'
23174 d_msg_oob='$d_msg_oob'
23175 d_msg_peek='$d_msg_peek'
23176 d_msg_proxy='$d_msg_proxy'
23177 d_msgctl='$d_msgctl'
23178 d_msgget='$d_msgget'
23179 d_msghdr_s='$d_msghdr_s'
23180 d_msgrcv='$d_msgrcv'
23181 d_msgsnd='$d_msgsnd'
23183 d_munmap='$d_munmap'
23184 d_mymalloc='$d_mymalloc'
23186 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23188 d_nl_langinfo='$d_nl_langinfo'
23189 d_nv_preserves_uv='$d_nv_preserves_uv'
23190 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23191 d_off64_t='$d_off64_t'
23192 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23193 d_oldpthreads='$d_oldpthreads'
23194 d_oldsock='$d_oldsock'
23196 d_pathconf='$d_pathconf'
23198 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23199 d_phostname='$d_phostname'
23202 d_portable='$d_portable'
23204 d_prctl_set_name='$d_prctl_set_name'
23205 d_printf_format_null='$d_printf_format_null'
23206 d_procselfexe='$d_procselfexe'
23207 d_pseudofork='$d_pseudofork'
23208 d_pthread_atfork='$d_pthread_atfork'
23209 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23210 d_pthread_yield='$d_pthread_yield'
23212 d_pwchange='$d_pwchange'
23213 d_pwclass='$d_pwclass'
23214 d_pwcomment='$d_pwcomment'
23215 d_pwexpire='$d_pwexpire'
23216 d_pwgecos='$d_pwgecos'
23217 d_pwpasswd='$d_pwpasswd'
23218 d_pwquota='$d_pwquota'
23221 d_random_r='$d_random_r'
23222 d_readdir64_r='$d_readdir64_r'
23223 d_readdir='$d_readdir'
23224 d_readdir_r='$d_readdir_r'
23225 d_readlink='$d_readlink'
23227 d_recvmsg='$d_recvmsg'
23228 d_rename='$d_rename'
23229 d_rewinddir='$d_rewinddir'
23231 d_safebcpy='$d_safebcpy'
23232 d_safemcpy='$d_safemcpy'
23233 d_sanemcmp='$d_sanemcmp'
23234 d_sbrkproto='$d_sbrkproto'
23235 d_scalbnl='$d_scalbnl'
23236 d_sched_yield='$d_sched_yield'
23237 d_scm_rights='$d_scm_rights'
23238 d_seekdir='$d_seekdir'
23239 d_select='$d_select'
23241 d_semctl='$d_semctl'
23242 d_semctl_semid_ds='$d_semctl_semid_ds'
23243 d_semctl_semun='$d_semctl_semun'
23244 d_semget='$d_semget'
23246 d_sendmsg='$d_sendmsg'
23247 d_setegid='$d_setegid'
23248 d_seteuid='$d_seteuid'
23249 d_setgrent='$d_setgrent'
23250 d_setgrent_r='$d_setgrent_r'
23251 d_setgrps='$d_setgrps'
23252 d_sethent='$d_sethent'
23253 d_sethostent_r='$d_sethostent_r'
23254 d_setitimer='$d_setitimer'
23255 d_setlinebuf='$d_setlinebuf'
23256 d_setlocale='$d_setlocale'
23257 d_setlocale_r='$d_setlocale_r'
23258 d_setnent='$d_setnent'
23259 d_setnetent_r='$d_setnetent_r'
23260 d_setpent='$d_setpent'
23261 d_setpgid='$d_setpgid'
23262 d_setpgrp2='$d_setpgrp2'
23263 d_setpgrp='$d_setpgrp'
23264 d_setprior='$d_setprior'
23265 d_setproctitle='$d_setproctitle'
23266 d_setprotoent_r='$d_setprotoent_r'
23267 d_setpwent='$d_setpwent'
23268 d_setpwent_r='$d_setpwent_r'
23269 d_setregid='$d_setregid'
23270 d_setresgid='$d_setresgid'
23271 d_setresuid='$d_setresuid'
23272 d_setreuid='$d_setreuid'
23273 d_setrgid='$d_setrgid'
23274 d_setruid='$d_setruid'
23275 d_setsent='$d_setsent'
23276 d_setservent_r='$d_setservent_r'
23277 d_setsid='$d_setsid'
23278 d_setvbuf='$d_setvbuf'
23282 d_shmatprototype='$d_shmatprototype'
23283 d_shmctl='$d_shmctl'
23285 d_shmget='$d_shmget'
23286 d_sigaction='$d_sigaction'
23287 d_signbit='$d_signbit'
23288 d_sigprocmask='$d_sigprocmask'
23289 d_sigsetjmp='$d_sigsetjmp'
23290 d_sin6_scope_id='$d_sin6_scope_id'
23291 d_sitearch='$d_sitearch'
23292 d_snprintf='$d_snprintf'
23293 d_sockaddr_in6='$d_sockaddr_in6'
23294 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23295 d_sockatmark='$d_sockatmark'
23296 d_sockatmarkproto='$d_sockatmarkproto'
23297 d_socket='$d_socket'
23298 d_socklen_t='$d_socklen_t'
23299 d_sockpair='$d_sockpair'
23300 d_socks5_init='$d_socks5_init'
23301 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23303 d_srand48_r='$d_srand48_r'
23304 d_srandom_r='$d_srandom_r'
23305 d_sresgproto='$d_sresgproto'
23306 d_sresuproto='$d_sresuproto'
23307 d_statblks='$d_statblks'
23308 d_statfs_f_flags='$d_statfs_f_flags'
23309 d_statfs_s='$d_statfs_s'
23310 d_static_inline='$d_static_inline'
23311 d_statvfs='$d_statvfs'
23312 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23313 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23314 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23315 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23316 d_stdio_stream_array='$d_stdio_stream_array'
23317 d_stdiobase='$d_stdiobase'
23318 d_stdstdio='$d_stdstdio'
23319 d_strchr='$d_strchr'
23320 d_strcoll='$d_strcoll'
23321 d_strctcpy='$d_strctcpy'
23322 d_strerrm='$d_strerrm'
23323 d_strerror='$d_strerror'
23324 d_strerror_r='$d_strerror_r'
23325 d_strftime='$d_strftime'
23326 d_strlcat='$d_strlcat'
23327 d_strlcpy='$d_strlcpy'
23328 d_strtod='$d_strtod'
23329 d_strtol='$d_strtol'
23330 d_strtold='$d_strtold'
23331 d_strtoll='$d_strtoll'
23332 d_strtoq='$d_strtoq'
23333 d_strtoul='$d_strtoul'
23334 d_strtoull='$d_strtoull'
23335 d_strtouq='$d_strtouq'
23336 d_strxfrm='$d_strxfrm'
23337 d_suidsafe='$d_suidsafe'
23338 d_symlink='$d_symlink'
23339 d_syscall='$d_syscall'
23340 d_syscallproto='$d_syscallproto'
23341 d_sysconf='$d_sysconf'
23342 d_sysernlst='$d_sysernlst'
23343 d_syserrlst='$d_syserrlst'
23344 d_system='$d_system'
23345 d_tcgetpgrp='$d_tcgetpgrp'
23346 d_tcsetpgrp='$d_tcsetpgrp'
23347 d_telldir='$d_telldir'
23348 d_telldirproto='$d_telldirproto'
23350 d_timegm='$d_timegm'
23352 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23353 d_tm_tm_zone='$d_tm_tm_zone'
23354 d_tmpnam_r='$d_tmpnam_r'
23355 d_truncate='$d_truncate'
23356 d_ttyname_r='$d_ttyname_r'
23357 d_tzname='$d_tzname'
23358 d_u32align='$d_u32align'
23359 d_ualarm='$d_ualarm'
23362 d_union_semun='$d_union_semun'
23363 d_unordered='$d_unordered'
23364 d_unsetenv='$d_unsetenv'
23365 d_usleep='$d_usleep'
23366 d_usleepproto='$d_usleepproto'
23368 d_vendorarch='$d_vendorarch'
23369 d_vendorbin='$d_vendorbin'
23370 d_vendorlib='$d_vendorlib'
23371 d_vendorscript='$d_vendorscript'
23373 d_void_closedir='$d_void_closedir'
23374 d_voidsig='$d_voidsig'
23375 d_voidtty='$d_voidtty'
23376 d_volatile='$d_volatile'
23377 d_vprintf='$d_vprintf'
23378 d_vsnprintf='$d_vsnprintf'
23380 d_waitpid='$d_waitpid'
23381 d_wcstombs='$d_wcstombs'
23382 d_wctomb='$d_wctomb'
23383 d_writev='$d_writev'
23386 db_hashtype='$db_hashtype'
23387 db_prefixtype='$db_prefixtype'
23388 db_version_major='$db_version_major'
23389 db_version_minor='$db_version_minor'
23390 db_version_patch='$db_version_patch'
23391 defvoidused='$defvoidused'
23392 direntrytype='$direntrytype'
23395 doublesize='$doublesize'
23397 drand48_r_proto='$drand48_r_proto'
23399 dynamic_ext='$dynamic_ext'
23405 endgrent_r_proto='$endgrent_r_proto'
23406 endhostent_r_proto='$endhostent_r_proto'
23407 endnetent_r_proto='$endnetent_r_proto'
23408 endprotoent_r_proto='$endprotoent_r_proto'
23409 endpwent_r_proto='$endpwent_r_proto'
23410 endservent_r_proto='$endservent_r_proto'
23411 eunicefix='$eunicefix'
23414 extensions='$extensions'
23415 extern_C='$extern_C'
23417 fflushNULL='$fflushNULL'
23418 fflushall='$fflushall'
23420 firstmakefile='$firstmakefile'
23422 fpossize='$fpossize'
23423 fpostype='$fpostype'
23424 freetype='$freetype'
23427 full_csh='$full_csh'
23428 full_sed='$full_sed'
23429 gccansipedantic='$gccansipedantic'
23430 gccosandvers='$gccosandvers'
23431 gccversion='$gccversion'
23432 getgrent_r_proto='$getgrent_r_proto'
23433 getgrgid_r_proto='$getgrgid_r_proto'
23434 getgrnam_r_proto='$getgrnam_r_proto'
23435 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23436 gethostbyname_r_proto='$gethostbyname_r_proto'
23437 gethostent_r_proto='$gethostent_r_proto'
23438 getlogin_r_proto='$getlogin_r_proto'
23439 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23440 getnetbyname_r_proto='$getnetbyname_r_proto'
23441 getnetent_r_proto='$getnetent_r_proto'
23442 getprotobyname_r_proto='$getprotobyname_r_proto'
23443 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23444 getprotoent_r_proto='$getprotoent_r_proto'
23445 getpwent_r_proto='$getpwent_r_proto'
23446 getpwnam_r_proto='$getpwnam_r_proto'
23447 getpwuid_r_proto='$getpwuid_r_proto'
23448 getservbyname_r_proto='$getservbyname_r_proto'
23449 getservbyport_r_proto='$getservbyport_r_proto'
23450 getservent_r_proto='$getservent_r_proto'
23451 getspnam_r_proto='$getspnam_r_proto'
23452 gidformat='$gidformat'
23458 gmtime_r_proto='$gmtime_r_proto'
23459 gnulibc_version='$gnulibc_version'
23461 groupcat='$groupcat'
23462 groupstype='$groupstype'
23465 h_sysfile='$h_sysfile'
23468 html1dir='$html1dir'
23469 html1direxp='$html1direxp'
23470 html3dir='$html3dir'
23471 html3direxp='$html3direxp'
23480 i_arpainet='$i_arpainet'
23481 i_assert='$i_assert'
23482 i_bsdioctl='$i_bsdioctl'
23486 i_dirent='$i_dirent'
23492 i_fp_class='$i_fp_class'
23494 i_gdbm_ndbm='$i_gdbm_ndbm'
23495 i_gdbmndbm='$i_gdbmndbm'
23497 i_ieeefp='$i_ieeefp'
23498 i_inttypes='$i_inttypes'
23499 i_langinfo='$i_langinfo'
23500 i_libutil='$i_libutil'
23501 i_limits='$i_limits'
23502 i_locale='$i_locale'
23503 i_machcthr='$i_machcthr'
23504 i_malloc='$i_malloc'
23505 i_mallocmalloc='$i_mallocmalloc'
23507 i_memory='$i_memory'
23508 i_mntent='$i_mntent'
23511 i_neterrno='$i_neterrno'
23512 i_netinettcp='$i_netinettcp'
23516 i_pthread='$i_pthread'
23518 i_rpcsvcdbm='$i_rpcsvcdbm'
23521 i_shadow='$i_shadow'
23523 i_stdarg='$i_stdarg'
23524 i_stdbool='$i_stdbool'
23525 i_stddef='$i_stddef'
23526 i_stdlib='$i_stdlib'
23527 i_string='$i_string'
23528 i_sunmath='$i_sunmath'
23529 i_sysaccess='$i_sysaccess'
23530 i_sysdir='$i_sysdir'
23531 i_sysfile='$i_sysfile'
23532 i_sysfilio='$i_sysfilio'
23534 i_sysioctl='$i_sysioctl'
23535 i_syslog='$i_syslog'
23536 i_sysmman='$i_sysmman'
23537 i_sysmode='$i_sysmode'
23538 i_sysmount='$i_sysmount'
23539 i_sysndir='$i_sysndir'
23540 i_sysparam='$i_sysparam'
23541 i_syspoll='$i_syspoll'
23542 i_sysresrc='$i_sysresrc'
23543 i_syssecrt='$i_syssecrt'
23544 i_sysselct='$i_sysselct'
23545 i_syssockio='$i_syssockio'
23546 i_sysstat='$i_sysstat'
23547 i_sysstatfs='$i_sysstatfs'
23548 i_sysstatvfs='$i_sysstatvfs'
23549 i_systime='$i_systime'
23550 i_systimek='$i_systimek'
23551 i_systimes='$i_systimes'
23552 i_systypes='$i_systypes'
23553 i_sysuio='$i_sysuio'
23555 i_sysutsname='$i_sysutsname'
23556 i_sysvfs='$i_sysvfs'
23557 i_syswait='$i_syswait'
23558 i_termio='$i_termio'
23559 i_termios='$i_termios'
23561 i_unistd='$i_unistd'
23564 i_values='$i_values'
23565 i_varargs='$i_varargs'
23566 i_varhdr='$i_varhdr'
23568 ignore_versioned_solibs='$ignore_versioned_solibs'
23569 inc_version_list='$inc_version_list'
23570 inc_version_list_init='$inc_version_list_init'
23573 initialinstalllocation='$initialinstalllocation'
23574 installarchlib='$installarchlib'
23575 installbin='$installbin'
23576 installhtml1dir='$installhtml1dir'
23577 installhtml3dir='$installhtml3dir'
23578 installman1dir='$installman1dir'
23579 installman3dir='$installman3dir'
23580 installprefix='$installprefix'
23581 installprefixexp='$installprefixexp'
23582 installprivlib='$installprivlib'
23583 installscript='$installscript'
23584 installsitearch='$installsitearch'
23585 installsitebin='$installsitebin'
23586 installsitehtml1dir='$installsitehtml1dir'
23587 installsitehtml3dir='$installsitehtml3dir'
23588 installsitelib='$installsitelib'
23589 installsiteman1dir='$installsiteman1dir'
23590 installsiteman3dir='$installsiteman3dir'
23591 installsitescript='$installsitescript'
23592 installstyle='$installstyle'
23593 installusrbinperl='$installusrbinperl'
23594 installvendorarch='$installvendorarch'
23595 installvendorbin='$installvendorbin'
23596 installvendorhtml1dir='$installvendorhtml1dir'
23597 installvendorhtml3dir='$installvendorhtml3dir'
23598 installvendorlib='$installvendorlib'
23599 installvendorman1dir='$installvendorman1dir'
23600 installvendorman3dir='$installvendorman3dir'
23601 installvendorscript='$installvendorscript'
23603 issymlink='$issymlink'
23604 ivdformat='$ivdformat'
23607 known_extensions='$known_extensions'
23610 ld_can_script='$ld_can_script'
23611 lddlflags='$lddlflags'
23613 ldflags_uselargefiles='$ldflags_uselargefiles'
23614 ldlibpthname='$ldlibpthname'
23621 libsdirs='$libsdirs'
23622 libsfiles='$libsfiles'
23623 libsfound='$libsfound'
23624 libspath='$libspath'
23625 libswanted='$libswanted'
23626 libswanted_uselargefiles='$libswanted_uselargefiles'
23632 localtime_r_proto='$localtime_r_proto'
23633 locincpth='$locincpth'
23634 loclibpth='$loclibpth'
23635 longdblsize='$longdblsize'
23636 longlongsize='$longlongsize'
23637 longsize='$longsize'
23641 lseeksize='$lseeksize'
23642 lseektype='$lseektype'
23645 madlyobj='$madlyobj'
23646 madlysrc='$madlysrc'
23650 make_set_make='$make_set_make'
23651 mallocobj='$mallocobj'
23652 mallocsrc='$mallocsrc'
23653 malloctype='$malloctype'
23655 man1direxp='$man1direxp'
23658 man3direxp='$man3direxp'
23660 mips_type='$mips_type'
23661 mistrustnm='$mistrustnm'
23663 mmaptype='$mmaptype'
23664 modetype='$modetype'
23666 multiarch='$multiarch'
23668 myarchname='$myarchname'
23669 mydomain='$mydomain'
23670 myhostname='$myhostname'
23673 need_va_copy='$need_va_copy'
23674 netdb_hlen_type='$netdb_hlen_type'
23675 netdb_host_type='$netdb_host_type'
23676 netdb_name_type='$netdb_name_type'
23677 netdb_net_type='$netdb_net_type'
23680 nm_so_opt='$nm_so_opt'
23681 nonxs_ext='$nonxs_ext'
23683 nvEUformat='$nvEUformat'
23684 nvFUformat='$nvFUformat'
23685 nvGUformat='$nvGUformat'
23686 nv_overflows_integers_at='$nv_overflows_integers_at'
23687 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23688 nveformat='$nveformat'
23689 nvfformat='$nvfformat'
23690 nvgformat='$nvgformat'
23693 o_nonblock='$o_nonblock'
23695 old_pthread_create_joinable='$old_pthread_create_joinable'
23696 optimize='$optimize'
23697 orderlib='$orderlib'
23700 otherlibdirs='$otherlibdirs'
23704 patchlevel='$patchlevel'
23705 path_sep='$path_sep'
23708 perl_patchlevel='$perl_patchlevel'
23709 perl_static_inline='$perl_static_inline'
23710 perladmin='$perladmin'
23711 perllibs='$perllibs'
23712 perlpath='$perlpath'
23714 phostname='$phostname'
23720 prefixexp='$prefixexp'
23722 privlibexp='$privlibexp'
23723 procselfexe='$procselfexe'
23724 prototype='$prototype'
23726 quadkind='$quadkind'
23727 quadtype='$quadtype'
23728 randbits='$randbits'
23729 randfunc='$randfunc'
23730 random_r_proto='$random_r_proto'
23731 randseedtype='$randseedtype'
23733 rd_nodata='$rd_nodata'
23734 readdir64_r_proto='$readdir64_r_proto'
23735 readdir_r_proto='$readdir_r_proto'
23736 revision='$revision'
23742 sGMTIME_max='$sGMTIME_max'
23743 sGMTIME_min='$sGMTIME_min'
23744 sLOCALTIME_max='$sLOCALTIME_max'
23745 sLOCALTIME_min='$sLOCALTIME_min'
23746 sPRIEUldbl='$sPRIEUldbl'
23747 sPRIFUldbl='$sPRIFUldbl'
23748 sPRIGUldbl='$sPRIGUldbl'
23749 sPRIXU64='$sPRIXU64'
23751 sPRIeldbl='$sPRIeldbl'
23752 sPRIfldbl='$sPRIfldbl'
23753 sPRIgldbl='$sPRIgldbl'
23758 sSCNfldbl='$sSCNfldbl'
23759 sched_yield='$sched_yield'
23760 scriptdir='$scriptdir'
23761 scriptdirexp='$scriptdirexp'
23763 seedfunc='$seedfunc'
23764 selectminbits='$selectminbits'
23765 selecttype='$selecttype'
23766 sendmail='$sendmail'
23767 setgrent_r_proto='$setgrent_r_proto'
23768 sethostent_r_proto='$sethostent_r_proto'
23769 setlocale_r_proto='$setlocale_r_proto'
23770 setnetent_r_proto='$setnetent_r_proto'
23771 setprotoent_r_proto='$setprotoent_r_proto'
23772 setpwent_r_proto='$setpwent_r_proto'
23773 setservent_r_proto='$setservent_r_proto'
23776 sharpbang='$sharpbang'
23777 shmattype='$shmattype'
23778 shortsize='$shortsize'
23781 sig_count='$sig_count'
23782 sig_name='$sig_name'
23783 sig_name_init='$sig_name_init'
23785 sig_num_init='$sig_num_init'
23786 sig_size='$sig_size'
23787 signal_t='$signal_t'
23788 sitearch='$sitearch'
23789 sitearchexp='$sitearchexp'
23791 sitebinexp='$sitebinexp'
23792 sitehtml1dir='$sitehtml1dir'
23793 sitehtml1direxp='$sitehtml1direxp'
23794 sitehtml3dir='$sitehtml3dir'
23795 sitehtml3direxp='$sitehtml3direxp'
23797 sitelib_stem='$sitelib_stem'
23798 sitelibexp='$sitelibexp'
23799 siteman1dir='$siteman1dir'
23800 siteman1direxp='$siteman1direxp'
23801 siteman3dir='$siteman3dir'
23802 siteman3direxp='$siteman3direxp'
23803 siteprefix='$siteprefix'
23804 siteprefixexp='$siteprefixexp'
23805 sitescript='$sitescript'
23806 sitescriptexp='$sitescriptexp'
23807 sizesize='$sizesize'
23808 sizetype='$sizetype'
23812 sockethdr='$sockethdr'
23813 socketlib='$socketlib'
23814 socksizetype='$socksizetype'
23816 spackage='$spackage'
23817 spitshell='$spitshell'
23818 srand48_r_proto='$srand48_r_proto'
23819 srandom_r_proto='$srandom_r_proto'
23821 ssizetype='$ssizetype'
23822 st_ino_sign='$st_ino_sign'
23823 st_ino_size='$st_ino_size'
23824 startperl='$startperl'
23826 static_ext='$static_ext'
23828 stdio_base='$stdio_base'
23829 stdio_bufsiz='$stdio_bufsiz'
23830 stdio_cnt='$stdio_cnt'
23831 stdio_filbuf='$stdio_filbuf'
23832 stdio_ptr='$stdio_ptr'
23833 stdio_stream_array='$stdio_stream_array'
23834 strerror_r_proto='$strerror_r_proto'
23837 subversion='$subversion'
23841 targetarch='$targetarch'
23845 timeincl='$timeincl'
23846 timetype='$timetype'
23847 tmpnam_r_proto='$tmpnam_r_proto'
23853 ttyname_r_proto='$ttyname_r_proto'
23862 uidformat='$uidformat'
23868 uquadtype='$uquadtype'
23869 use5005threads='$use5005threads'
23870 use64bitall='$use64bitall'
23871 use64bitint='$use64bitint'
23872 usecrosscompile='$usecrosscompile'
23873 usedevel='$usedevel'
23875 usedtrace='$usedtrace'
23876 usefaststdio='$usefaststdio'
23877 useithreads='$useithreads'
23878 usekernprocpathname='$usekernprocpathname'
23879 uselargefiles='$uselargefiles'
23880 uselongdouble='$uselongdouble'
23881 usemallocwrap='$usemallocwrap'
23882 usemorebits='$usemorebits'
23883 usemultiplicity='$usemultiplicity'
23884 usemymalloc='$usemymalloc'
23886 usensgetexecutablepath='$usensgetexecutablepath'
23887 useopcode='$useopcode'
23888 useperlio='$useperlio'
23889 useposix='$useposix'
23890 usereentrant='$usereentrant'
23891 userelocatableinc='$userelocatableinc'
23893 useshrplib='$useshrplib'
23894 usesitecustomize='$usesitecustomize'
23895 usesocks='$usesocks'
23896 usethreads='$usethreads'
23897 usevendorprefix='$usevendorprefix'
23898 useversionedarchname='$useversionedarchname'
23899 usevfork='$usevfork'
23902 uvXUformat='$uvXUformat'
23903 uvoformat='$uvoformat'
23906 uvuformat='$uvuformat'
23907 uvxformat='$uvxformat'
23909 vendorarch='$vendorarch'
23910 vendorarchexp='$vendorarchexp'
23911 vendorbin='$vendorbin'
23912 vendorbinexp='$vendorbinexp'
23913 vendorhtml1dir='$vendorhtml1dir'
23914 vendorhtml1direxp='$vendorhtml1direxp'
23915 vendorhtml3dir='$vendorhtml3dir'
23916 vendorhtml3direxp='$vendorhtml3direxp'
23917 vendorlib='$vendorlib'
23918 vendorlib_stem='$vendorlib_stem'
23919 vendorlibexp='$vendorlibexp'
23920 vendorman1dir='$vendorman1dir'
23921 vendorman1direxp='$vendorman1direxp'
23922 vendorman3dir='$vendorman3dir'
23923 vendorman3direxp='$vendorman3direxp'
23924 vendorprefix='$vendorprefix'
23925 vendorprefixexp='$vendorprefixexp'
23926 vendorscript='$vendorscript'
23927 vendorscriptexp='$vendorscriptexp'
23929 version_patchlevel_string='$version_patchlevel_string'
23930 versiononly='$versiononly'
23932 voidflags='$voidflags'
23935 yaccflags='$yaccflags'
23940 : add special variables
23941 $test -f $src/patchlevel.h && \
23942 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23943 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23944 echo "PERL_CONFIG_SH=true" >>config.sh
23946 : propagate old symbols
23947 if $test -f UU/config.sh; then
23948 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23949 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23950 config.sh config.sh UU/oldconfig.sh |\
23951 $sort | $uniq -u >UU/oldsyms
23952 set X `$cat UU/oldsyms`
23958 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23960 echo ": Variables propagated from previous config.sh file." >>config.sh
23961 for sym in `$cat UU/oldsyms`; do
23962 echo " Propagating $hint variable "'$'"$sym..."
23963 eval 'tmp="$'"${sym}"'"'
23965 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23971 : Finish up by extracting the .SH files
23975 echo "Extraction done."
23985 If you'd like to make any changes to the config.sh file before I begin
23986 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23989 rp="Press return or use a shell escape to edit config.sh:"
23994 *) : in case they cannot read
23995 sh 1>&4 -c "$ans";;
24000 : if this fails, just run all the .SH files by hand
24009 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24016 Now you need to generate make dependencies by running "$make depend".
24017 You might prefer to run it in background: "$make depend > makedepend.out &"
24018 It can take a while, so you might not want to run it right now.
24023 rp="Run $make depend now?"
24027 $make depend && echo "Now you must run '$make'."
24030 echo "You must run '$make depend' then '$make'."
24033 elif test -f [Mm]akefile; then
24035 echo "Now you must run a $make."
24037 echo "Configure done."
24040 if $test -f Policy.sh; then
24043 If you compile $package on a different machine or from a different object
24044 directory, copy the Policy.sh file from this object directory to the
24045 new one before you run Configure -- this will help you with most of
24046 the policy defaults.
24050 if $test -f config.msg; then
24051 echo "Hmm. I also noted the following information while running:"
24053 $cat config.msg >&4
24056 $rm -f kit*isdone ark*isdone