3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Wed May 8 15:28:09 CEST 2013 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
730 d_ipv6_mreq_source=''
747 d_sprintf_returns_strlen=''
759 perl_static_inline=''
764 d_stdio_ptr_lval_nochange_cnt=''
765 d_stdio_ptr_lval_sets_cnt=''
911 d_gdbm_ndbm_h_uses_prototypes=''
912 d_gdbmndbm_h_uses_prototypes=''
914 d_ndbm_h_uses_prototypes=''
989 d_inc_version_list=''
991 inc_version_list_init=''
1010 ignore_versioned_solibs=''
1074 d_perl_otherlibdirs=''
1082 api_versionstring=''
1088 version_patchlevel_string=''
1092 d_nv_preserves_uv=''
1093 d_nv_zero_is_allbits_zero=''
1104 nv_overflows_integers_at=''
1105 nv_preserves_uv_bits=''
1177 installsitehtml1dir=''
1180 installsitehtml3dir=''
1187 installsiteman1dir=''
1190 installsiteman3dir=''
1195 installsitescript=''
1212 d_stdio_stream_array=''
1213 stdio_stream_array=''
1230 usekernprocpathname=''
1231 ccflags_uselargefiles=''
1232 ldflags_uselargefiles=''
1233 libswanted_uselargefiles=''
1242 usensgetexecutablepath=''
1255 installvendorarch=''
1262 installvendorhtml1dir=''
1264 vendorhtml1direxp=''
1265 installvendorhtml3dir=''
1267 vendorhtml3direxp=''
1273 installvendorman1dir=''
1276 installvendorman3dir=''
1283 installvendorscript=''
1296 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1299 : We must find out about Eunice early
1301 if test -f /etc/unixtovms; then
1302 eunicefix=/etc/unixtovms
1304 if test -f /etc/unixtovms.exe; then
1305 eunicefix=/etc/unixtovms.exe
1308 : Set executable suffix now -- needed before hints available
1309 if test -f "/libs/version.library"; then
1312 elif test -f "/system/gnu_library/bin/ar.pm"; then
1315 elif test -n "$DJGPP"; then
1318 elif test -d c:/. -o -n "$is_os2" ; then
1325 : Trailing extension. Override this in a hint file, if needed.
1326 : Extra object files, if any, needed on this platform.
1329 : Possible local include directories to search.
1330 : Set locincpth to "" in a hint file to defeat local include searches.
1331 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1332 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1334 : no include file wanted by default
1337 : Enable -DEBUGGING and -DDEBUGGING from the command line
1342 : change the next line if compiling for Xenix/286 on Xenix/386
1343 xlibpth='/usr/lib/386 /lib/386'
1344 : Possible local library directories to search.
1345 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1346 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1348 : general looking path for locating libraries
1349 glibpth="/lib /usr/lib $xlibpth"
1350 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1351 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1352 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1353 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1355 : Private path used by Configure to find libraries. Its value
1356 : is prepended to libpth. This variable takes care of special
1357 : machines, like the mips. Usually, it should be empty.
1360 : default library list
1362 : some systems want to use only the non-versioned libso:s
1363 ignore_versioned_solibs=''
1364 : set usethreads on the Configure command line to enable threads.
1365 usereentrant='undef'
1366 : full support for void wanted by default
1372 : set useposix=false in your hint file to disable the POSIX extension.
1374 : set useopcode=false in your hint file to disable the Opcode extension.
1377 ccflags_uselargefiles=''
1378 ldflags_uselargefiles=''
1379 libswanted_uselargefiles=''
1380 : set usemultiplicity on the Configure command line to enable multiplicity.
1381 : set usesocks on the Configure command line to enable socks.
1382 : List of libraries we want.
1383 : If anyone needs extra -lxxx, put those in a hint file.
1384 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1385 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1386 : We probably want to search /usr/shlib before most other libraries.
1387 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1388 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1389 glibpth="/usr/shlib $glibpth"
1390 : Do not use vfork unless overridden by a hint file.
1393 : Find the basic shell for Bourne shell scripts
1397 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1400 if test -f "$xxx"; then
1403 : Build up a list and do a single loop so we can 'break' out.
1404 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1405 for xxx in sh bash ksh pdksh ash; do
1407 try="$try ${p}/${xxx}"
1411 if test -f "$xxx"; then
1414 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1417 elif test -f "$xxx.exe"; then
1428 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1430 Usually it's in /bin/sh. How did you even get this far?
1431 Please contact me (Perl Maintainers) at perlbug@perl.org and
1432 we'll try to straighten this all out.
1438 : see if sh knows # comments
1439 if `$sh -c '#' >/dev/null 2>&1`; then
1443 test -f $xcat$_exe || xcat=/usr/bin/cat
1444 if test ! -f $xcat$_exe; then
1445 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1446 if test -f $p/cat$_exe; then
1451 if test ! -f $xcat$_exe; then
1452 echo "Can't find cat anywhere!"
1456 echo "#!$xcat" >sharp
1459 ./sharp > today 2>/dev/null
1460 if test -s today; then
1463 echo "#! $xcat" > sharp
1466 ./sharp > today 2>/dev/null
1467 if test -s today; then
1475 echo "Your $sh doesn't grok # comments--I will strip them later on."
1478 echo "exec grep -v '^[ ]*#'" >spitshell
1480 $eunicefix spitshell
1481 spitshell=`pwd`/spitshell
1483 echo "I presume that if # doesn't work, #! won't work either!"
1488 : figure out how to guarantee sh startup
1490 '') startsh=${sharpbang}${sh} ;;
1502 : echo "Yup, it does."
1504 echo "Hmm... '$startsh' does not guarantee sh startup..."
1505 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1509 : Save command line options in file UU/cmdline.opt for later use in
1510 : generating config.sh.
1511 cat > cmdline.opt <<EOSH
1512 : Configure command line arguments.
1521 cat >>cmdline.opt <<EOSH
1522 config_arg$argn='$arg'
1524 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1527 arg_exp=`cat cmdl.opt`
1528 args_exp="$args_exp$args_sep'$arg_exp'"
1529 argn=`expr $argn + 1`
1534 : produce awk script to parse command line options
1535 cat >options.awk <<'EOF'
1537 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1539 len = length(optstr);
1540 for (i = 1; i <= len; i++) {
1541 c = substr(optstr, i, 1);
1542 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1553 if (substr(str, 1, 1) != "-") {
1554 printf("'%s'\n", str);
1558 for (i = 2; i <= len; i++) {
1559 c = substr(str, i, 1);
1561 printf("-%s\n", substr(str, i));
1567 printf("'%s'\n", substr(str, i + 1));
1580 : process the command line options
1581 set X `for arg in "$@"; do echo "X$arg"; done |
1582 sed -e s/X// | awk -f options.awk`
1587 : set up default values
1597 rm -f optdef.sh posthint.sh
1598 cat >optdef.sh <<EOS
1604 while test $# -gt 0; do
1606 -d) shift; fastread=yes;;
1607 -e) shift; alldone=cont;;
1611 if test -r "$1"; then
1614 echo "$me: cannot read config file $1." >&2
1620 -h) shift; error=true;;
1621 -r) shift; reuseval=true;;
1622 -s) shift; silent=true; realsilent=true;;
1623 -E) shift; alldone=exit;;
1624 -K) shift; knowitall=true;;
1625 -O) shift; override=true;;
1626 -S) shift; silent=true; extractsh=true;;
1631 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1632 echo "$me: ignoring -D $1" >&2
1635 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1636 *) echo "$1='define'" >> optdef.sh;;
1643 *=) echo "$1" >> optdef.sh;;
1645 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1646 echo "$me: ignoring -U $1" >&2
1648 *) echo "$1='undef'" >> optdef.sh;;
1659 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1663 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1664 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1670 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1671 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1672 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1673 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1674 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1675 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1681 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1683 echo "$yyy=''" >> posthint.sh ;;
1688 echo "$yyy='$zzz'" >> posthint.sh ;;
1690 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1692 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1697 echo "$yyy=$zzz" >> posthint.sh ;;
1698 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1702 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1705 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1713 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1714 [-U symbol] [-U symbol=] [-A command:symbol...]
1715 -d : use defaults for all answers.
1716 -e : go on without questioning past the production of config.sh.
1717 -f : specify an alternate default configuration file.
1718 -h : print this help message and exit (with an error status).
1719 -r : reuse C symbols value if possible (skips costly nm extraction).
1720 -s : silent mode, only echoes questions and essential information.
1721 -D : define symbol to have some value:
1722 -D symbol symbol gets the value 'define'
1723 -D symbol=value symbol gets the value 'value'
1724 common used examples (see INSTALL for more info):
1725 -Duse64bitint use 64bit integers
1726 -Duse64bitall use 64bit integers and pointers
1727 -Dusethreads use thread support
1728 -Dinc_version_list=none do not include older perl trees in @INC
1729 -DEBUGGING=none DEBUGGING options
1730 -Dcc=gcc choose your compiler
1731 -Dprefix=/opt/perl5 choose your destination
1732 -E : stop at the end of questions, after having produced config.sh.
1733 -K : do not use unless you know what you are doing.
1734 -O : let -D and -U override definitions from loaded configuration file.
1735 -S : perform variable substitutions on all .SH files (can mix with -f)
1736 -U : undefine symbol:
1737 -U symbol symbol gets the value 'undef'
1738 -U symbol= symbol gets completely empty
1740 -A : manipulate symbol after the platform specific hints have been applied:
1741 -A append:symbol=value append value to symbol
1742 -A symbol=value like append:, but with a separating space
1743 -A define:symbol=value define symbol to have value
1744 -A clear:symbol define symbol to be ''
1745 -A define:symbol define symbol to be 'define'
1746 -A eval:symbol=value define symbol to be eval of value
1747 -A prepend:symbol=value prepend value to symbol
1748 -A undef:symbol define symbol to be 'undef'
1749 -A undef:symbol= define symbol to be ''
1750 e.g.: -A prepend:libswanted='cl pthread '
1751 -A ccflags=-DSOME_MACRO
1752 -V : print version number and exit (with a zero status).
1759 case "$fastread$alldone" in
1762 case "$extractsh" in
1765 if test ! -t 0; then
1766 echo "Say 'sh Configure', not 'sh <Configure'"
1776 true) exec 1>/dev/null;;
1779 : run the defines and the undefines, if any, but leave the file out there...
1782 : create the posthint manipulation script and leave the file out there...
1787 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1788 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1789 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1790 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1791 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1794 : Some greps do not return status, grrr.
1795 echo "grimblepritz" >grimble
1796 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1798 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1804 : the following should work in any shell
1808 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1809 cat >contains <<'EOSS'
1810 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1815 : Find the path to the source tree
1818 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1822 *) src=`cd ../$src && pwd` ;;
1835 if test -f $rsrc/Configure && \
1836 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1838 : found it, so we are ok.
1841 for src in . .. ../.. ../../.. ../../../..; do
1842 if test -f ../$src/Configure && \
1843 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1854 Sorry, I can't seem to locate the source dir for $package. Please start
1855 Configure with an explicit path -- i.e. /some/path/Configure.
1863 echo "Sources for $package found in \"$src\"." >&4
1867 : script used to extract .SH files with variable substitutions
1868 cat >extract <<'EOS'
1870 echo "Doing variable substitutions on .SH files..."
1871 if test -f MANIFEST; then
1872 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1874 echo "(Looking for .SH files under the source directory.)"
1875 set x `(cd "$src"; find . -name "*.SH" -print)`
1879 0) set x `(cd "$src"; echo *.SH)`; shift;;
1881 if test ! -f "$src/$1"; then
1887 while test $name; do
1888 if test ! -d "$name"; then
1889 create="$name $create";
1890 name=`echo $name | sed -e "s|^[^/]*$||"`;
1891 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1896 for file in $create; do
1905 dir=`expr X$file : 'X\(.*\)/'`
1906 file=`expr X$file : 'X.*/\(.*\)'`
1907 (cd "$dir" && . ./$file)
1917 dir=`expr X$file : 'X\(.*\)/'`
1918 file=`expr X$file : 'X.*/\(.*\)'`
1919 (set x $dir; shift; eval $mkdir_p)
1920 sh <"$src/$dir/$file"
1929 if test -f "$src/config_h.SH"; then
1930 if test ! -f config.h; then
1931 : oops, they left it out of MANIFEST, probably, so do it anyway.
1932 . "$src/config_h.SH"
1937 : extract files and exit if asked to do so
1938 case "$extractsh" in
1940 case "$realsilent" in
1944 case "$config_sh" in
1945 '') config_sh='config.sh';;
1948 echo "Fetching answers from $config_sh..."
1951 test "$override" && . ./optdef.sh
1955 echo "Extraction done."
1960 : Eunice requires " " instead of "", can you believe it
1963 echo "Beginning of configuration questions for $package."
1965 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1967 : first determine how to suppress newline on echo command
1969 echo "Checking echo to see how to suppress newlines..."
1970 (echo "hi there\c" ; echo " ") >.echotmp
1971 if $contains c .echotmp >/dev/null 2>&1 ; then
1982 echo $n "The star should be here-->$c"
1986 : Now test for existence of everything in MANIFEST
1988 if test -f "$rsrc/MANIFEST"; then
1989 echo "First let's make sure your kit is complete. Checking..." >&4
1990 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1991 (split -l 50 2>/dev/null || split -50)
1994 for filelist in x??; do
1995 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1996 >/dev/null 2>>"$tmppwd/missing")
1998 if test -s missing; then
2002 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2004 You have the option of continuing the configuration process, despite the
2005 distinct possibility that your kit is damaged, by typing 'y'es. If you
2006 do, don't blame me if something goes wrong. I advise you to type 'n'o
2007 and contact the author (perlbug@perl.org).
2010 echo $n "Continue? [n] $c" >&4
2014 echo "Continuing..." >&4
2018 echo "ABORTING..." >&4
2023 echo "Looks good..."
2026 echo "There is no MANIFEST file. I hope your kit is complete !"
2030 : Find the appropriate value for a newline for tr
2032 if test -n "$DJGPP"; then
2035 if test X"$trnl" = X; then
2036 case "`echo foo|tr '\n' x 2>/dev/null`" in
2040 if test X"$trnl" = X; then
2041 case "`echo foo|tr '\012' x 2>/dev/null`" in
2042 foox) trnl='\012' ;;
2045 if test X"$trnl" = X; then
2046 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2047 fooxy) trnl='\n\r' ;;
2050 if test X"$trnl" = X; then
2053 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2059 : compute the number of columns on the terminal for proper question formatting
2064 : set up the echo used in my read
2065 myecho="case \"\$xxxm\" in
2066 '') echo $n \"\$rp $c\" >&4;;
2068 '') echo $n \"[\$xxxm] $c\";;
2070 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2072 echo $n \"[\$xxxm] $c\" >&4
2074 echo $n \"\$rp [\$xxxm] $c\" >&4
2080 : now set up to do reads with possible shell escape and default assignment
2086 case "\$fastread" in
2087 yes) case "\$dflt" in
2090 case "\$silent-\$rp" in
2095 *) case "\$silent" in
2096 true) case "\$rp" in
2101 while expr "X\$ans" : "X!" >/dev/null; do
2105 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2113 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2122 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2127 echo "(OK, I'll run with -d after this question.)" >&4
2130 echo "*** Sorry, \$1 not supported yet." >&4
2140 echo "*** Substitution done -- please confirm."
2142 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2147 echo "*** Error -- try again."
2154 case "\$ans\$xxxm\$nostick" in
2166 : create .config dir to save info across Configure sessions
2167 test -d ../.config || mkdir ../.config
2168 cat >../.config/README <<EOF
2169 This directory created by Configure to save information that should
2170 persist across sessions for $package.
2172 You may safely delete it if you wish.
2175 : See if we are using a devel version and want that
2176 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2179 usedevel="$define" ;;
2180 *) case "$xversion" in
2183 *** WHOA THERE!!! ***
2185 This is an UNSTABLE DEVELOPMENT release.
2186 The version of this $package distribution is $xversion, that is, odd,
2187 (as opposed to even) and that signifies a development release.
2188 If you want a maintenance release, you want an even-numbered version.
2190 Do ***NOT*** install this into production use.
2191 Data corruption and crashes are possible.
2193 It is most seriously suggested that you do not continue any further
2194 unless you want to help in developing and debugging Perl.
2196 If you *still* want to build perl, you can answer 'y' now,
2197 or pass -Dusedevel to Configure.
2200 rp='Do you really want to continue?'
2204 [yY]) echo >&4 "Okay, continuing."
2205 usedevel="$define" ;;
2206 *) echo >&4 "Okay, bye."
2217 case "$versiononly" in
2218 '') versiononly="$define" ;;
2220 case "$installusrbinperl" in
2221 '') installusrbinperl="$undef" ;;
2226 : general instructions
2229 user=`(logname) 2>/dev/null`
2231 '') user=`whoami 2>&1`;;
2233 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2236 rp='Would you like to see the instructions?'
2247 This installation shell script will examine your system and ask you questions
2248 to determine how the perl5 package should be installed. If you get
2249 stuck on a question, you may use a ! shell escape to start a subshell or
2250 execute a command. Many of the questions will have default answers in square
2251 brackets; typing carriage return will give you the default.
2253 On some of the questions which ask for file or directory names you are allowed
2254 to use the ~name construct to specify the login directory belonging to "name",
2255 even if you don't have a shell which knows about that. Questions where this is
2256 allowed will be marked "(~name ok)".
2260 dflt='Type carriage return to continue'
2264 The prompter used in this script allows you to use shell variables and
2265 backticks in your answers. You may use $1, $2, etc... to refer to the words
2266 in the default answer, as if the default line was a set of arguments given to a
2267 script shell. This means you may also use $* to repeat the whole default line,
2268 so you do not have to re-type everything to add something to the default.
2270 Every time there is a substitution, you will have to confirm. If there is an
2271 error (e.g. an unmatched backtick), the default answer will remain unchanged
2272 and you will be prompted again.
2274 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2275 the questions and use the computed defaults (or the previous answers if there
2276 was already a config.sh file). Type 'Configure -h' for a list of options.
2277 You may also start interactively and then answer '& -d' at any prompt to turn
2278 on the non-interactive behaviour for the remainder of the execution.
2284 Much effort has been expended to ensure that this shell script will run on any
2285 Unix system. If despite that it blows up on yours, your best bet is to edit
2286 Configure and run it again. If you can't run Configure for some reason,
2287 you'll have to generate a config.sh file by hand. Whatever problems you
2288 have, let me (perlbug@perl.org) know how I blew it.
2290 This installation script affects things in two ways:
2292 1) it may do direct variable substitutions on some of the files included
2294 2) it builds a config.h file for inclusion in C programs. You may edit
2295 any of these files as the need arises after running this script.
2297 If you make a mistake on a question, there is no easy way to back up to it
2298 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2299 files. Configure will offer to let you do this before it runs the SH files.
2302 dflt='Type carriage return to continue'
2304 case "$firsttime" in
2305 true) echo $user >>../.config/instruct;;
2309 : find out where common programs are
2311 echo "Locating common programs..." >&4
2324 if test -d \$dir/\$thing; then
2330 for thisthing in \$dir/\$thing; do
2331 : just loop through to pick last item
2333 if test -f \$thisthing; then
2336 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2339 elif test -f \$dir/\$thing.exe; then
2340 if test -n "$DJGPP"; then
2341 echo \$dir/\$thing.exe
2342 elif test "$eunicefix" != ":"; then
2343 : on Eunice apparently
2396 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2397 pth="$pth /lib /usr/lib"
2398 for file in $loclist; do
2402 if test -f "$xxx"; then
2405 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2406 xxx=`./loc $file $file $pth`
2409 '') xxx=`./loc $file $file $pth`;;
2410 *) xxx=`./loc $xxx $xxx $pth`;;
2412 eval $file=$xxx$_exe
2416 echo $file is in $xxx.
2419 echo $file is in $xxx.
2422 echo "I don't know where '$file' is, and my life depends on it." >&4
2423 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2429 echo "Don't worry if any of the following aren't found..."
2431 for file in $trylist; do
2435 if test -f "$xxx"; then
2438 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2439 xxx=`./loc $file $file $pth`
2442 '') xxx=`./loc $file $file $pth`;;
2443 *) xxx=`./loc $xxx $xxx $pth`;;
2445 eval $file=$xxx$_exe
2449 echo $file is in $xxx.
2452 echo $file is in $xxx.
2455 echo "I don't see $file out there, $say."
2462 echo "Substituting grep for egrep."
2469 *) if $less -R </dev/null >/dev/null; then
2470 echo "Substituting less -R for less."
2478 echo "Substituting cp for ln."
2487 echo "I can't find make or gmake, and my life depends on it." >&4
2488 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2496 *) # We can't have osname yet.
2497 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2498 # Assume that gmake, if found, is definitely GNU make
2499 # and prefer it over the system make.
2500 echo "Substituting gmake for make."
2508 echo "Hopefully test is built into your sh."
2511 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2512 echo "Using the test built into your sh."
2520 echo "Hopefully echo is built into your sh."
2525 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2526 $echo $n "hi there$c" >foo1
2527 echo $n "hi there$c" >foo2
2528 if cmp foo1 foo2 >/dev/null 2>&1; then
2529 echo "They are compatible. In fact, they may be identical."
2536 They are not compatible! You are probably running ksh on a non-USG system.
2537 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2538 have echo built in and we may have to run some Bourne shell scripts. That
2539 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2542 $echo $n "The star should be here-->$c"
2549 # This question was auctioned at YAPC::Europe-2007 in Vienna
2550 # I never promised you could answer it. I only auctioned the question.
2552 The following message is sponsored by
2554 Dresden.pm<--The stars should be here.
2556 Dear Perl user, system administrator or package
2557 maintainer, the Perl community sends greetings to
2558 you. Do you (emblematical) greet back [Y/n]? n
2562 : Check what type of C compiler we use
2566 cat <<'EOSC' >>trygcc
2571 int main(int argc, char *argv[]) {
2575 if $cc -o try $ccflags $ldflags try.c; then
2578 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2584 # Skip this test because it gives a false match on output like:
2585 # ./trygcc: line 23: cc: command not found
2586 # case "`$cc -v -c try.c 2>&1`" in
2587 # *gcc*) trygcc=no ;;
2589 if $test X"$trygcc" = Xyes; then
2590 if gcc -o try -c try.c; then
2592 echo "You seem to have a working gcc, though." >&4
2593 # Switching compilers may undo the work of hints files.
2594 # The most common problem is -D_REENTRANT for threads.
2595 # This heuristic catches that case, but gets false positives
2596 # if -Dusethreads was not actually specified. Better to
2597 # bail out here with a useful message than fail
2598 # mysteriously later. Should we perhaps just try to
2599 # re-invoke Configure -Dcc=gcc config_args ?
2600 if $test -f usethreads.cbu; then
2603 *** However, any setting of the C compiler flags (e.g. for thread support)
2604 *** will be lost. It may be necessary for you to restart Configure and
2605 *** add -Dcc=gcc to your Configure command line.
2608 rp="Would you like to go ahead and try gcc anyway?"
2611 rp="Would you like to use it?"
2614 if $test -f myread; then
2617 if $test -f UU/myread; then
2620 echo "Cannot find myread, sorry. Aborting." >&2
2625 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2638 cat <<'EOSC' >>checkcc
2643 int main(int argc, char *argv[]) {
2647 if $cc -o try $ccflags $ldflags try.c; then
2650 if $test X"$despair" = Xyes; then
2651 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2654 You need to find a working C compiler.
2655 Either (purchase and) install the C compiler supplied by your OS vendor,
2656 or for a free C compiler try http://gcc.gnu.org/
2657 I cannot continue any further, aborting.
2666 : determine whether symbolic links are supported
2669 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2670 echo "Symbolic links are supported." >&4
2673 echo "Symbolic links are NOT supported." >&4
2678 : determine whether symbolic links are supported
2682 echo "Checking how to test for symbolic links..." >&4
2684 if $test "X$issymlink" = X; then
2686 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2687 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2689 if test $? = 0; then
2692 echo "Your builtin 'test -h' may be broken." >&4
2695 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2698 if test -f "$p/$test"; then
2707 echo "Trying external '$test -h'." >&4
2708 issymlink="$test -h"
2709 if $test ! -h sym >/dev/null 2>&1; then
2710 echo "External '$test -h' is broken, too." >&4
2718 if $test "X$issymlink" = X; then
2719 if $test -L sym 2>/dev/null; then
2720 issymlink="$test -L"
2721 echo "The builtin '$test -L' worked." >&4
2724 if $test "X$issymlink" != X; then
2725 echo "You can test for symbolic links with '$issymlink'." >&4
2727 echo "I do not know how you can test for symbolic links." >&4
2731 *) echo "No symbolic links, so not testing for their testing..." >&4
2736 : Make symlinks util
2737 case "$mksymlinks" in
2740 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2743 *) case "$lns:$issymlink" in
2744 *"ln"*" -s:"*"test -"?)
2745 echo "Creating the symbolic links..." >&4
2746 echo "(First creating the subdirectories...)" >&4
2748 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2750 test -z "$directory" && break
2754 if test ! -d t/base; then
2755 echo "Failed to create the subdirectories. Aborting." >&4
2758 echo "(Then creating the symlinks...)" >&4
2759 awk '{print $1}' $src/MANIFEST | while true; do
2761 test -z "$filename" && break
2762 if test -f $filename; then
2763 if $issymlink $filename; then
2767 if test -f $filename; then
2768 echo "$filename already exists, not symlinking."
2770 ln -s $src/$filename $filename
2774 if test ! -f t/base/lex.t; then
2775 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2780 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2788 : Check for Cross-Compilation
2789 case "$usecrosscompile" in
2791 $echo "Cross-compiling..."
2794 *-*-gcc) # A cross-compiling gcc, probably.
2795 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2797 # leave out ld, choosing it is more complex
2799 ranlib=$targetarch-ranlib
2800 $echo 'extern int foo;' > try.c
2801 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2803 if $test $# -gt 0; then
2805 incpth="`$echo $incpth|$sed 's/^ //'`"
2806 echo "Guessing incpth '$incpth'." >&4
2808 j="`$echo $i|$sed 's,/include$,/lib,'`"
2809 if $test -d $j; then
2813 libpth="`$echo $libpth|$sed 's/^ //'`"
2814 echo "Guessing libpth '$libpth'." >&4
2819 case "$targetarch" in
2820 '') echo "Targetarch not defined." >&4; croak=y ;;
2821 *) echo "Using targetarch $targetarch." >&4 ;;
2824 '') echo "Incpth not defined." >&4; croak=y ;;
2825 *) echo "Using incpth '$incpth'." >&4 ;;
2828 '') echo "Libpth not defined." >&4; croak=y ;;
2829 *) echo "Using libpth '$libpth'." >&4 ;;
2832 '') for i in $incpth; do
2833 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2835 echo "Guessing usrinc $usrinc." >&4
2840 '') echo "Usrinc not defined." >&4; croak=y ;;
2843 *) echo "Using usrinc $usrinc." >&4 ;;
2845 case "$targethost" in
2846 '') echo "Targethost not defined." >&4; croak=y ;;
2847 *) echo "Using targethost $targethost." >&4
2852 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2855 /*) run=$src/Cross/run
2856 targetmkdir=$src/Cross/mkdir
2858 from=$src/Cross/from
2860 *) pwd=`$test -f ../Configure & cd ..; pwd`
2862 targetmkdir=$pwd/Cross/mkdir
2864 from=$pwd/Cross/from
2867 case "$targetrun" in
2868 '') targetrun=ssh ;;
2873 case "$targetfrom" in
2874 '') targetfrom=scp ;;
2878 from=$from-$targetfrom
2879 case "$targetdir" in
2881 echo "Guessing targetdir $targetdir." >&4
2884 case "$targetuser" in
2886 echo "Guessing targetuser $targetuser." >&4
2889 case "$targetfrom" in
2893 case "$targetrun" in
2905 '') cwd=$targetdir ;;
2909 if $test ! -f \$exe.xok; then
2913 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2916 *) echo "Unknown targetrun '$targetrun'" >&4
2920 case "$targetmkdir" in
2922 cat >$targetmkdir <<EOF
2924 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2926 $chmod a+rx $targetmkdir
2928 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2940 $targetmkdir \`dirname \$f\`
2941 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2944 $targetmkdir $targetdir/\`dirname \$f\`
2945 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2958 $mkdir -p $targetdir/\`dirname \$f\`
2959 $cp \$f $targetdir/\$f || exit 1
2962 $targetmkdir $targetdir/\`dirname \$f\`
2963 $cp \$f $targetdir/\$f || exit 1
2970 *) echo "Unknown targetto '$targetto'" >&4
2974 case "$targetfrom" in
2981 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2986 cp) cat >$from <<EOF
2991 cp $targetdir/\$f . || exit 1
2996 *) echo "Unknown targetfrom '$targetfrom'" >&4
3000 if $test ! -f $run; then
3001 echo "Target 'run' script '$run' not found." >&4
3005 if $test ! -f $to; then
3006 echo "Target 'to' script '$to' not found." >&4
3010 if $test ! -f $from; then
3011 echo "Target 'from' script '$from' not found." >&4
3015 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3019 Using '$run' for remote execution,
3020 and '$from' and '$to'
3021 for remote file transfer.
3027 usecrosscompile='undef'
3032 : see whether [:lower:] and [:upper:] are supported character classes
3034 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3036 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3040 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3041 # (0xd9 and 0xe2), therefore that is a nice testing point.
3042 if test "X$up" = X -o "X$low" = X; then
3043 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3049 if test "X$up" = X -o "X$low" = X; then
3050 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3056 if test "X$up" = X -o "X$low" = X; then
3057 case "`echo RS | od -x 2>/dev/null`" in
3059 echo "Hey, this might be EBCDIC." >&4
3060 if test "X$up" = X -o "X$low" = X; then
3061 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3062 rs) up='[A-IJ-RS-Z]'
3067 if test "X$up" = X -o "X$low" = X; then
3068 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3078 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3080 echo "Using $up and $low to convert case." >&4
3083 echo "I don't know how to translate letters from upper to lower case." >&4
3084 echo "Your tr is not acting any way I know of." >&4
3088 : set up the translation script tr, must be called with ./tr of course
3092 '[A-Z][a-z]') exec $tr '$up' '$low';;
3093 '[a-z][A-Z]') exec $tr '$low' '$up';;
3100 : Try to determine whether config.sh was made on this system
3101 case "$config_sh" in
3103 myuname=`$uname -a 2>/dev/null`
3104 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3105 # Downcase everything to avoid ambiguity.
3106 # Remove slashes and single quotes so we can use parts of this in
3107 # directory and file names.
3108 # Remove newlines so myuname is sane to use elsewhere.
3109 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3110 # because the A-Z/a-z are not consecutive.
3111 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3112 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3113 newmyuname="$myuname"
3115 case "$knowitall" in
3117 if test -f ../config.sh; then
3118 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3119 eval "`grep myuname= ../config.sh`"
3121 if test "X$myuname" = "X$newmyuname"; then
3129 : Get old answers from old config file if Configure was run on the
3130 : same system, otherwise use the hints.
3133 if test -f config.sh; then
3135 rp="I see a config.sh file. Shall I use it to set the defaults?"
3138 n*|N*) echo "OK, I'll ignore it."
3139 mv config.sh config.sh.old
3140 myuname="$newmyuname"
3142 *) echo "Fetching default answers from your old config.sh file..." >&4
3150 : Older versions did not always set $sh. Catch re-use of such
3160 if test ! -f config.sh; then
3163 First time through, eh? I have some defaults handy for some systems
3164 that need some extra help getting the Configure answers right:
3167 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3169 : Half the following guesses are probably wrong... If you have better
3170 : tests or hints, please send them to perlbug@perl.org
3171 : The metaconfig authors would also appreciate a copy...
3172 $test -f /irix && osname=irix
3173 $test -f /xenix && osname=sco_xenix
3174 $test -f /dynix && osname=dynix
3175 $test -f /dnix && osname=dnix
3176 $test -f /lynx.os && osname=lynxos
3177 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3178 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3179 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3180 $test -f /bin/mips && /bin/mips && osname=mips
3181 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3182 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3183 $test -d /usr/apollo/bin && osname=apollo
3184 $test -f /etc/saf/_sactab && osname=svr4
3185 $test -d /usr/include/minix && osname=minix
3186 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3187 if $test -d /MachTen -o -d /MachTen_Folder; then
3189 if $test -x /sbin/version; then
3190 osvers=`/sbin/version | $awk '{print $2}' |
3191 $sed -e 's/[A-Za-z]$//'`
3192 elif $test -x /usr/etc/version; then
3193 osvers=`/usr/etc/version | $awk '{print $2}' |
3194 $sed -e 's/[A-Za-z]$//'`
3200 $test -f /sys/posix.dll &&
3201 $test -f /usr/bin/what &&
3202 set X `/usr/bin/what /sys/posix.dll` &&
3203 $test "$3" = UWIN &&
3207 if $test -f $uname; then
3215 umips) osname=umips ;;
3218 [23]100) osname=mips ;;
3219 next*) osname=next ;;
3221 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3222 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3225 elif $test -f /etc/kconfig; then
3227 if test "$lns" = "$ln -s"; then
3229 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3231 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3238 if test -n "$DJGPP"; then
3247 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3249 # oslevel can fail with:
3250 # oslevel: Unable to acquire lock.
3251 *not\ found) osvers="$4"."$3" ;;
3252 '<3240'|'<>3240') osvers=3.2.0 ;;
3253 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3254 '=3250'|'>3250') osvers=3.2.5 ;;
3258 bsd386) osname=bsd386
3261 cygwin*) osname=cygwin
3264 *dc.osx) osname=dcosx
3270 domainos) osname=apollo
3276 dragonfly) osname=dragonfly
3279 dynixptx*) osname=dynixptx
3280 osvers=`echo "$4"|sed 's/^v//'`
3282 freebsd) osname=freebsd
3284 genix) osname=genix ;;
3288 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3304 netbsd*) osname=netbsd
3307 news-os) osvers="$3"
3309 4*) osname=newsos4 ;;
3313 next*) osname=next ;;
3314 nonstop-ux) osname=nonstopux ;;
3315 openbsd) osname=openbsd
3321 POSIX-BC | posix-bc ) osname=posix-bc
3324 powerux | power_ux | powermax_os | powermaxos | \
3325 powerunix | power_unix) osname=powerux
3331 solaris) osname=solaris
3333 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3340 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3344 titanos) osname=titanos
3353 ultrix) osname=ultrix
3356 osf1|mls+) case "$5" in
3359 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3362 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3365 hp*) osname=hp_osf1 ;;
3366 mips) osname=mips_osf1 ;;
3369 # UnixWare 7.1.2 is known as Open UNIX 8
3370 openunix|unixware) osname=svr5
3378 $2) case "$osname" in
3382 : svr4.x or possibly later
3392 if test -f /stand/boot ; then
3393 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3394 if test -n "$INITPROG" -a -f "$INITPROG"; then
3395 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3396 if test -n "$isesix"; then
3404 *) if test -f /etc/systemid; then
3406 set `echo $3 | $sed 's/\./ /g'` $4
3407 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3409 elif $test -f $src/hints/sco_$1_$2.sh; then
3411 elif $test -f $src/hints/sco_$1.sh; then
3416 '') : Still unknown. Probably a generic Sys V.
3425 *) case "$osname" in
3426 '') : Still unknown. Probably a generic BSD.
3434 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3435 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3436 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3439 $rm -f UU/kernel.what
3440 elif test -d c:/. -o -n "$is_os2" ; then
3447 case "$targetarch" in
3450 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3455 : Now look for a hint file osname_osvers, unless one has been
3456 : specified already.
3459 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3460 : Also try without trailing minor version numbers.
3461 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3462 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3463 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3464 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3467 *) case "$osvers" in
3470 *) if $test -f $src/hints/$file.sh ; then
3472 elif $test -f $src/hints/$xfile.sh ; then
3474 elif $test -f $src/hints/$xxfile.sh ; then
3476 elif $test -f $src/hints/$xxxfile.sh ; then
3478 elif $test -f $src/hints/$xxxxfile.sh ; then
3480 elif $test -f "$src/hints/${osname}.sh" ; then
3489 if $test -f Policy.sh ; then
3492 none) dflt="Policy" ;;
3493 *) dflt="Policy $dflt" ;;
3498 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3502 if $test -f Policy.sh ; then
3505 There's also a Policy hint file available, which should make the
3506 site-specific (policy) questions easier to answer.
3513 You may give one or more space-separated answers, or "none" if appropriate.
3514 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3515 previous run of Configure, you may specify it as well as or instead of
3516 OS-specific hints. If hints are provided for your OS, you should use them:
3517 although Perl can probably be built without hints on many platforms, using
3518 hints often improve performance and may enable features that Configure can't
3519 set up on its own. If there are no hints that match your OS, specify "none";
3520 DO NOT give a wrong version or a wrong OS.
3524 rp="Which of these apply, if any?"
3527 for file in $tans; do
3528 if $test X$file = XPolicy -a -f Policy.sh; then
3530 $cat Policy.sh >> UU/config.sh
3531 elif $test -f $src/hints/$file.sh; then
3532 . $src/hints/$file.sh
3533 $cat $src/hints/$file.sh >> UU/config.sh
3534 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3537 : Give one chance to correct a possible typo.
3538 echo "$file.sh does not exist"
3540 rp="hint to use instead?"
3542 for file in $ans; do
3543 if $test -f "$src/hints/$file.sh"; then
3544 . $src/hints/$file.sh
3545 $cat $src/hints/$file.sh >> UU/config.sh
3546 elif $test X$ans = X -o X$ans = Xnone ; then
3549 echo "$file.sh does not exist -- ignored."
3556 : Remember our hint file for later.
3557 if $test -f "$src/hints/$file.sh" ; then
3567 echo "Fetching default answers from $config_sh..." >&4
3571 cp $config_sh config.sh 2>/dev/null
3581 test "$override" && . ./optdef.sh
3583 : Restore computed paths
3584 for file in $loclist $trylist; do
3585 eval $file="\$_$file"
3590 Configure uses the operating system name and version to set some defaults.
3591 The default value is probably right if the name rings a bell. Otherwise,
3592 since spelling matters for me, either accept the default or answer "none"
3599 ''|' '|none) dflt=none ;;
3600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3603 *) dflt="$osname" ;;
3605 rp="Operating system name?"
3609 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3615 ''|' '|none) dflt=none ;;
3616 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3617 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3619 ''|' ') dflt=none ;;
3624 *) dflt="$osvers" ;;
3626 rp="Operating system version?"
3636 : who configured the system
3637 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3640 cf_by=`(logname) 2>/dev/null`
3643 cf_by=`(whoami) 2>/dev/null`
3645 "") cf_by=unknown ;;
3650 : decide how portable to be. Allow command line overrides.
3651 case "$d_portable" in
3653 *) d_portable="$define" ;;
3656 : set up shell script to do ~ expansion
3662 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3665 if $test -f /bin/csh; then
3666 /bin/csh -f -c "glob \$1"
3671 name=\`$expr x\$1 : '..\([^/]*\)'\`
3672 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3673 if $test ! -d "\$dir"; then
3675 echo "\$me: can't locate home directory for: \$name" >&2
3680 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3696 : now set up to get a file name
3700 cat <<'EOSC' >>getfile
3716 : getfile will accept an answer from the comma-separated list
3717 : enclosed in parentheses even if it does not meet other criteria.
3718 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3719 fn=`echo $fn | sed 's/(.*)//'`
3725 loc_file=`expr $fn : '.*:\(.*\)'`
3726 fn=`expr $fn : '\(.*\):.*'`
3734 */*) fullpath=true;;
3743 *e*) exp_file=true;;
3746 *p*) nopath_ok=true;;
3751 *d*) type='Directory';;
3752 *l*) type='Locate';;
3757 Locate) what='File';;
3762 case "$d_portable" in
3770 while test "$type"; do
3775 true) rp="$rp (~name ok)";;
3778 if test -f UU/getfile.ok && \
3779 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3798 value=`UU/filexp $ans`
3801 if test "$ans" != "$value"; then
3802 echo "(That expands to $value on this system.)"
3816 /*) value="$ansexp" ;;
3817 [a-zA-Z]:/*) value="$ansexp" ;;
3822 echo "I shall only accept a full path name, as in /bin/ls." >&4
3823 echo "Use a ! shell escape if you wish to check pathnames." >&4
3826 echo "Please give a full path name, starting with slash." >&4
3829 echo "Note that using ~name is ok provided it expands well." >&4
3842 for fp in $gfpth; do
3843 if test "X$fp" = X.; then
3848 if test -f "$pf"; then
3850 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3852 echo "($value is not a plain file, but that's ok.)"
3855 if test X"$type" = X; then
3862 for fp in $gfpth; do
3863 if test "X$fp" = X.; then
3868 direxp="$fp/$ansexp"
3870 if test -d "$direxp"; then
3878 if test -d "$ansexp"; then
3879 echo "(Looking for $loc_file in directory $value.)"
3880 value="$value/$loc_file"
3881 ansexp="$ansexp/$loc_file"
3883 if test -f "$ansexp"; then
3886 case "$nopath_ok" in
3887 true) case "$value" in
3889 *) echo "Assuming $value will be in people's path."
3905 if test "$fastread" = yes; then
3910 rp="$what $value doesn't exist. Use that name anyway?"
3929 test "X$gfpthkeep" != Xy && gfpth=""
3932 : determine root of directory hierarchy where package will be installed.
3935 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3938 dflt=`echo "$prefix" | sed 's/.$//'`
3946 By default, $package will be installed in $dflt/bin, manual pages
3947 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3948 installation directories. Typically this is something like /usr/local.
3949 If you wish to have binaries under /usr/bin but other parts of the
3950 installation under /usr/local, that's ok: you will be prompted
3951 separately for each of the installation directories, the prefix being
3952 only used to set the defaults.
3956 rp='Installation prefix to use?'
3964 *) oldprefix="$prefix";;
3971 : allow them to override the AFS root
3974 *) afsroot=$afsroot ;;
3980 $define|true) afs=true ;;
3981 $undef|false) afs=false ;;
3982 *) if $test -d $afsroot; then
3990 echo "AFS may be running... I'll be extra cautious then..." >&4
3992 echo "AFS does not seem to be running..." >&4
3995 : determine installation prefix for where package is to be installed.
3999 Since you are running AFS, I need to distinguish the directory in which
4000 files will reside from the directory in which they are installed (and from
4001 which they are presumably copied to the former directory by occult means).
4004 case "$installprefix" in
4005 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4006 *) dflt="$installprefix";;
4011 In some special cases, particularly when building $package for distribution,
4012 it is convenient to distinguish the directory in which files should be
4013 installed from the directory ($prefix) in which they will
4014 eventually reside. For most users, these two directories are the same.
4017 case "$installprefix" in
4019 *) dflt=$installprefix;;
4023 rp='What installation prefix should I use for installing files?'
4025 installprefix="$ans"
4026 installprefixexp="$ansexp"
4028 : Perform the prefixexp/installprefixexp correction if necessary
4029 cat <<EOS >installprefix
4032 cat <<'EOSC' >>installprefix
4033 : Change installation prefix, if necessary.
4034 if $test X"$prefix" != X"$installprefix"; then
4035 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4037 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4040 chmod +x installprefix
4041 $eunicefix installprefix
4043 : Set variables such as privlib and privlibexp from the output of ./getfile
4044 : performing the prefixexp/installprefixexp correction if necessary.
4045 cat <<EOS >setprefixvar
4048 cat <<'EOSC' >>setprefixvar
4049 eval "${prefixvar}=\"\$ans\""
4050 eval "${prefixvar}exp=\"\$ansexp\""
4053 chmod +x setprefixvar
4054 $eunicefix setprefixvar
4056 : set up the script used to warn in case of inconsistency
4065 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4067 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4068 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4073 echo "*** WHOA THERE!!! ***" >&4
4074 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4077 rp=" Keep the $hint value?"
4080 y) td=$was; tu=$was;;
4084 : function used to set '$1' to '$val'
4085 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4087 $define$undef) . ./whoa; eval "$var=\$td";;
4088 $undef$define) . ./whoa; eval "$var=\$tu";;
4089 *) eval "$var=$val";;
4092 : get the patchlevel
4094 echo "Getting the current patchlevel..." >&4
4095 if $test -r $rsrc/patchlevel.h;then
4096 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4097 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4098 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4099 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4100 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4101 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4102 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4111 $echo "(You do not have patchlevel.h. Eek.)"
4113 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4114 version_patchlevel_string="version $patchlevel subversion $subversion"
4115 case "$perl_patchlevel" in
4117 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4118 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4122 $echo "(You have $package $version_patchlevel_string.)"
4126 : XXX Should be a Configure test for double-dots in filenames.
4127 version=`echo $revision $patchlevel $subversion | \
4128 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4129 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4130 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 version=`echo $revision $patchlevel $subversion | \
4134 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4135 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4136 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 : Special case the 5.005_xx maintenance series, which used 5.005
4140 : without any subversion label as a subdirectory in $sitelib
4141 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4142 api_versionstring='5.005'
4145 : Do we want threads support and if so, what type
4146 case "$usethreads" in
4147 $define|true|[yY]*) dflt='y';;
4148 *) # Catch case where user specified ithreads or 5005threads but
4149 # forgot -Dusethreads (A.D. 4/2002)
4150 case "$useithreads$use5005threads" in
4151 *$define*) dflt='y';;
4158 Perl can be built to take advantage of threads on some systems.
4159 To do so, Configure can be run with -Dusethreads.
4161 Note that Perl built with threading support runs slightly slower
4162 and uses more memory than plain Perl. The current implementation
4163 is believed to be stable, but it is fairly new, and so should be
4164 treated with caution.
4166 If this doesn't make any sense to you, just accept the default '$dflt'.
4168 rp='Build a threading Perl?'
4171 y|Y) val="$define" ;;
4177 if $test $patchlevel -lt 9; then
4178 case "$usethreads" in
4182 Since release 5.6, Perl has had two different threading implementations,
4183 the newer interpreter-based version (ithreads) with one interpreter per
4184 thread, and the older 5.005 version (5005threads).
4185 The 5005threads version is effectively unmaintained and will probably be
4186 removed in Perl 5.10, so there should be no need to build a Perl using it
4187 unless needed for backwards compatibility with some existing 5.005threads
4191 : Default to ithreads unless overridden on command line or with
4194 case "$use5005threads" in
4195 $define|true|[yY]*) dflt='n';;
4197 case "$useithreads" in
4198 $undef|false|[nN]*) dflt='n';;
4200 rp='Use the newer interpreter-based ithreads?'
4203 y|Y) val="$define" ;;
4208 : Now set use5005threads to the opposite value.
4209 case "$useithreads" in
4210 $define) val="$undef" ;;
4217 useithreads="$undef"
4218 use5005threads="$undef"
4222 case "$useithreads$use5005threads" in
4226 You cannot have both the ithreads and the 5.005 threads enabled
4227 at the same time. Disabling the 5.005 threads since they are
4228 much less stable than the ithreads.
4231 use5005threads="$undef"
4236 : perl-5.9.x and later
4238 if test X"$usethreads" = "X$define"; then
4239 case "$use5005threads" in
4243 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4250 use5005threads="$undef"
4251 useithreads="$usethreads"
4254 case "$d_oldpthreads" in
4255 '') : Configure tests would be welcome here. For now, assume undef.
4257 *) val="$d_oldpthreads" ;;
4263 : Look for a hint-file generated 'call-back-unit'. If the
4264 : user has specified that a threading perl is to be built,
4265 : we may need to set or change some other defaults.
4266 if $test -f usethreads.cbu; then
4267 echo "Your platform has some specific hints regarding threaded builds, using them..."
4270 case "$usethreads" in
4271 "$define"|true|[yY]*)
4273 (Your platform does not have any specific hints for threaded builds.
4274 Assuming POSIX threads, then.)
4280 : Check if multiplicity is required
4283 Perl can be built so that multiple Perl interpreters can coexist
4284 within the same Perl executable.
4287 case "$useithreads" in
4290 This multiple interpreter support is required for interpreter-based threads.
4294 *) case "$usemultiplicity" in
4295 $define|true|[yY]*) dflt='y';;
4299 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4300 rp='Build Perl for multiplicity?'
4303 y|Y) val="$define" ;;
4311 : Check if morebits is requested
4312 case "$usemorebits" in
4313 "$define"|true|[yY]*)
4314 use64bitint="$define"
4315 uselongdouble="$define"
4316 usemorebits="$define"
4318 *) usemorebits="$undef"
4322 : Determine the C compiler to be used
4328 rp="Use which C compiler?"
4332 : See whether they have no cc but they do have gcc
4334 if $test -f cc.cbu; then
4339 : make some quick guesses about what we are up against
4341 $echo $n "Hmm... $c"
4351 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4352 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4354 echo "Looks kind of like an OSF/1 system, but we'll see..."
4356 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4357 xxx=`./loc addbib blurfl $pth`
4358 if $test -f $xxx; then
4359 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4363 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like an extended USG system, but we'll see..."
4366 echo "Looks kind of like a USG system, but we'll see..."
4370 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4371 echo "Looks kind of like a BSD system, but we'll see..."
4375 echo "Looks kind of like a Version 7 system, but we'll see..."
4378 case "$eunicefix" in
4381 There is, however, a strange, musty smell in the air that reminds me of
4382 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4386 : it so happens the Eunice I know will not run shell scripts in Unix format
4390 echo "Congratulations. You aren't running Eunice."
4394 : Detect OS2. The p_ variable is set above in the Head.U unit.
4395 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4396 : semicolon as a patch separator
4401 I have the feeling something is not exactly right, however...don't tell me...
4402 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4403 (Or you may be running DOS with DJGPP.)
4408 if test -f /xenix; then
4409 echo "Actually, this looks more like a XENIX system..."
4414 echo "It's not Xenix..."
4419 if test -f /venix; then
4420 echo "Actually, this looks more like a VENIX system..."
4427 echo "Nor is it Venix..."
4430 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4431 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4434 : Check if we are using GNU gcc and what its version is
4436 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4440 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4442 printf("%s\n", __VERSION__);
4444 printf("%s\n", "1");
4450 if $cc -o try $ccflags $ldflags try.c; then
4451 gccversion=`$run ./try`
4452 case "$gccversion" in
4453 '') echo "You are not using GNU cc." ;;
4454 *) echo "You are using GNU cc $gccversion."
4460 echo "*** WHOA THERE!!! ***" >&4
4461 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4462 case "$knowitall" in
4464 echo " You'd better start hunting for one and let me know about it." >&4
4470 case "$gccversion" in
4471 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4473 case "$gccversion" in
4474 '') gccosandvers='' ;;
4475 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4476 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4478 case "$gccosandvers" in
4479 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4480 $osname$osvers) ;; # looking good
4481 $osname*) cat <<EOM >&4
4483 *** WHOA THERE!!! ***
4485 Your gcc has not been compiled for the exact release of
4486 your operating system ($gccosandvers versus $osname$osvers).
4488 In general it is a good idea to keep gcc synchronized with
4489 the operating system because otherwise serious problems
4490 may ensue when trying to compile software, like Perl.
4492 I'm trying to be optimistic here, though, and will continue.
4493 If later during the configuration and build icky compilation
4494 problems appear (headerfile conflicts being the most common
4495 manifestation), I suggest reinstalling the gcc to match
4496 your operating system release.
4500 *) gccosandvers='' ;; # failed to parse, better be silent
4508 # gcc 3.* complain about adding -Idirectories that they already know about,
4509 # so we will take those off from locincpth.
4510 case "$gccversion" in
4512 echo "main(){}">try.c
4513 for incdir in $locincpth; do
4514 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4515 grep '^c[cp]p*[01]: warning: changing search order '`
4516 if test "X$warn" != X; then
4517 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4523 : What should the include directory be ?
4525 $echo $n "Hmm... $c"
4529 if $test -f /bin/mips && /bin/mips; then
4530 echo "Looks like a MIPS system..."
4531 $cat >usr.c <<'EOCP'
4532 #ifdef SYSTYPE_BSD43
4536 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4537 dflt='/bsd43/usr/include'
4541 mips_type='System V'
4543 $rm -f usr.c usr.out
4544 echo "and you're compiling with the $mips_type compiler and libraries."
4548 echo "Doesn't look like a MIPS system."
4558 case "$xxx_prompt" in
4561 rp='Where are the include files you want to use?'
4569 : see how we invoke the C preprocessor
4571 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4572 cat <<'EOT' >testcpp.c
4578 if test ! -f cppstdin; then
4579 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4580 # AIX cc -E doesn't show the absolute headerfile
4581 # locations but we'll cheat by using the -M flag.
4582 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4584 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4587 echo "Keeping your $hint cppstdin wrapper."
4590 wrapper=`pwd`/cppstdin
4594 if $test "X$cppstdin" != "X" && \
4595 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4598 echo "You used to use $cppstdin $cppminus so we'll use that again."
4600 '') echo "But let's see if we can live without a wrapper..." ;;
4602 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4603 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4605 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4608 echo "(However, $cpprun $cpplast does not work, let's see...)"
4616 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4623 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4624 $cc -E <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yup, it does."
4629 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4630 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "Yup, it does."
4635 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4636 $cc -P <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4638 echo "Yipee, that works!"
4641 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4642 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "At long last!"
4647 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4648 $cpp <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4653 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4654 $cpp - <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 echo "Hooray, it works! I was beginning to wonder."
4659 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4660 $wrapper <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4667 rp="No dice. I can't find a C preprocessor. Name one:"
4671 $x_cpp <testcpp.c >testcpp.out 2>&1
4672 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 echo "OK, that will do." >&4
4675 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4690 echo "Perhaps can we force $cc -E using a wrapper..."
4691 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4698 echo "Nope, we'll have to live without it..."
4712 "$wrapper"|'cppstdin') ;;
4713 *) $rm -f $wrapper;;
4715 $rm -f testcpp.c testcpp.out
4717 : Set private lib path
4720 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4725 '') dlist="$loclibpth $plibpth $glibpth";;
4726 *) dlist="$libpth";;
4729 : Now check and see which directories actually exist, avoiding duplicates
4733 if $test -d $xxx; then
4736 *) libpth="$libpth $xxx";;
4742 Some systems have incompatible or broken versions of libraries. Among
4743 the directories listed in the question below, please remove any you
4744 know not to be holding relevant libraries, and add any that are needed.
4745 Say "none" for none.
4756 rp="Directories to use for library searches?"
4763 : compute shared library extension
4766 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4776 On some systems, shared libraries may be available. Answer 'none' if
4777 you want to suppress searching of shared libraries for the remainder
4778 of this configuration.
4781 rp='What is the file extension used for shared libraries?'
4785 : Define several unixisms.
4786 : Hints files or command line option can be used to override them.
4787 : The convoluted testing is in case hints files set either the old
4790 '') case "$exe_ext" in
4792 *) _exe="$exe_ext" ;;
4797 '') case "$lib_ext" in
4804 '') case "$obj_ext" in
4811 '') case "$path_sep" in
4822 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4824 : Which makefile gets called first. This is used by make depend.
4825 case "$firstmakefile" in
4826 '') firstmakefile='makefile';;
4829 : Check is we will use socks
4831 $define|true|[yY]*) dflt='y';;
4836 Perl can be built to use the SOCKS proxy protocol library. To do so,
4837 Configure must be run with -Dusesocks. If you use SOCKS you also need
4838 to use the PerlIO abstraction layer, this will be implicitly selected.
4840 If this doesn't make any sense to you, just accept the default '$dflt'.
4842 rp='Build Perl for SOCKS?'
4845 y|Y) val="$define" ;;
4851 : Check for uselongdouble support
4853 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4856 case "$uselongdouble" in
4857 $define|true|[yY]*) dflt='y';;
4862 Perl can be built to take advantage of long doubles which
4863 (if available) may give more accuracy and range for floating point numbers.
4865 If this doesn't make any sense to you, just accept the default '$dflt'.
4867 rp='Try to use long doubles if available?'
4870 y|Y) val="$define" ;;
4876 case "$uselongdouble" in
4877 true|[yY]*) uselongdouble="$define" ;;
4880 : Look for a hint-file generated 'call-back-unit'. If the
4881 : user has specified that long doubles should be used,
4882 : we may need to set or change some other defaults.
4883 if $test -f uselongdouble.cbu; then
4884 echo "Your platform has some specific hints regarding long doubles, using them..."
4885 . ./uselongdouble.cbu
4887 case "$uselongdouble" in
4890 (Your platform does not have any specific hints for long doubles.)
4896 : Looking for optional libraries
4898 echo "Checking for optional libraries..." >&4
4903 case "$libswanted" in
4904 '') libswanted='c_s';;
4907 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4913 for thisdir in $libpth $xlibpth; do
4914 test -d $thisdir && libspath="$libspath $thisdir"
4916 for thislib in $libswanted; do
4917 for thisdir in $libspath; do
4919 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4920 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=shared
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib$thislib.$so
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=shared
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/$thislib$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/lib${thislib}_s$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4943 $test -f "$xxx" && thislib=${thislib}_s
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/Slib$thislib$_a
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=static
4950 if $test -f "$xxx"; then
4952 shared) echo "Found -l$thislib (shared)." ;;
4953 static) echo "Found -l$thislib." ;;
4954 *) echo "Found -l$thislib ($libstyle)." ;;
4958 *) dflt="$dflt -l$thislib"
4959 libsfound="$libsfound $xxx"
4961 libsfiles="$libsfiles $yyy"
4962 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4963 case " $libsdirs " in
4965 *) libsdirs="$libsdirs $yyy" ;;
4972 if $test ! -f "$xxx"; then
4973 echo "No -l$thislib."
4984 ' '|'') dflt='none';;
4989 In order to compile $package on your machine, a number of libraries
4990 are usually needed. Include any other special libraries here as well.
4991 Say "none" for none. The default list is almost always right.
4995 rp="What libraries to use?"
5002 : determine optimization, if desired, or use for debug flag also
5004 ' '|$undef) dflt='none';;
5006 *) dflt="$optimize";;
5010 By default, $package compiles with the -O flag to use the optimizer.
5011 Alternately, you might want to use the symbolic debugger, which uses
5012 the -g flag (on traditional Unix systems). Either flag can be
5013 specified here. To use neither flag, specify the word "none".
5016 rp="What optimizer/debugger flag should be used?"
5020 'none') optimize=" ";;
5023 : Check what DEBUGGING is required from the command line
5024 : -DEBUGGING or -DDEBUGGING or
5025 : -DEBUGGING=both = -g + -DDEBUGGING
5026 : -DEBUGGING=-g or -Doptimize=-g = -g
5027 : -DEBUGGING=none or -UDEBUGGING =
5028 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5031 *) DEBUGGING=$EBUGGING ;;
5034 case "$DEBUGGING" in
5038 *) optimize="$optimize -g" ;;
5042 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5050 case "$DEBUGGING" in
5051 both|$define) dflt='-DDEBUGGING'
5054 : argument order is deliberate, as the flag will start with - which set could
5055 : think is an option
5056 checkccflag='check=$1; flag=$2; callback=$3;
5058 echo "Checking if your compiler accepts $flag" 2>&1;
5059 echo "int main(void) { return 0; }" > gcctest.c;
5060 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5061 echo "Yes, it does." 2>&1;
5062 if $test -s gcctest.out ; then
5063 echo "But your platform does not like it:";
5068 echo "Leaving current flags $ccflags alone." 2>&1
5070 *) dflt="$dflt $flag";
5076 echo "Nope, it does not, but that is ok." 2>&1;
5080 : We will not override a previous value, but we might want to
5081 : augment a hint file
5083 default|recommended)
5084 case "$gccversion" in
5085 1*) dflt="$dflt -fpcc-struct-return" ;;
5087 case "$optimize:$DEBUGGING" in
5088 *-g*:old) dflt="$dflt -DDEBUGGING";;
5090 case "$gccversion" in
5091 2*) if $test -d /etc/conf/kconfig.d &&
5092 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5094 # Interactive Systems (ISC) POSIX mode.
5099 case "$gccversion" in
5102 ?*) set strict-aliasing -fno-strict-aliasing
5106 # For gcc, adding -pipe speeds up compilations for some, but apparently
5107 # some assemblers can't read from stdin. (It also slows down compilations
5108 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5109 case "$gccversion" in
5115 # on x86_64 (at least) we require an extra library (libssp) in the
5116 # link command line. This library is not named, so I infer that it is
5117 # an implementation detail that may change. Hence the safest approach
5118 # is to add the flag to the flags passed to the compiler at link time,
5119 # as that way the compiler can do the right implementation dependant
5121 case "$gccversion" in
5122 ?*) set stack-protector -fstack-protector
5129 case "$mips_type" in
5130 *BSD*|'') inclwanted="$locincpth $usrinc";;
5131 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5133 for thisincl in $inclwanted; do
5134 if $test -d $thisincl; then
5135 if $test x$thisincl != x$usrinc; then
5137 *" -I$thisincl "*);;
5138 *) dflt="$dflt -I$thisincl ";;
5144 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5146 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5154 *) dflt="$dflt -D$2";;
5158 set signal.h LANGUAGE_C; eval $inctest
5162 ccflags="$ccflags -DSOCKS"
5167 default|recommended) dflt="$ccflags $dflt" ;;
5168 *) dflt="$ccflags";;
5177 Your C compiler may want other flags. For this question you should include
5178 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5179 but you should NOT include libraries or ld flags like -lwhatever. If you
5180 want $package to honor its debug switch, you should include -DDEBUGGING here.
5181 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5183 To use no flags, specify the word "none".
5189 rp="Any additional cc flags?"
5196 : the following weeds options from ccflags that are of no interest to cpp
5198 '') cppflags="$ccflags" ;;
5199 *) cppflags="$cppflags $ccflags" ;;
5201 case "$gccversion" in
5202 1*) cppflags="$cppflags -D__GNUC__"
5204 case "$mips_type" in
5206 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5212 echo "Let me guess what the preprocessor flags are..." >&4
5226 *) ftry="$previous $flag";;
5228 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5229 >cpp1.out 2>/dev/null && \
5230 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5231 >cpp2.out 2>/dev/null && \
5232 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5233 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5235 cppflags="$cppflags $ftry"
5245 *-*) echo "They appear to be: $cppflags";;
5247 $rm -f cpp.c cpp?.out
5251 : flags used in final linking phase
5253 '') if ./venix; then
5259 *-posix*) dflt="$dflt -posix" ;;
5262 *) dflt="$ldflags";;
5264 # See note above about -fstack-protector
5266 *-fstack-protector*)
5268 *-fstack-protector*) ;; # Don't add it again
5269 *) dflt="$dflt -fstack-protector" ;;
5274 : Try to guess additional flags to pick up local libraries.
5275 for thislibdir in $libpth; do
5276 case " $loclibpth " in
5279 *"-L$thislibdir "*) ;;
5280 *) dflt="$dflt -L$thislibdir" ;;
5292 Your C linker may need flags. For this question you should
5293 include -L/whatever and any other flags used by the C linker, but you
5294 should NOT include libraries like -lwhatever.
5296 Make sure you include the appropriate -L/path flags if your C linker
5297 does not normally search all of the directories you specified above,
5300 To use no flags, specify the word "none".
5304 rp="Any additional ld flags (NOT including libraries)?"
5310 rmlist="$rmlist pdp11"
5314 echo "Checking your choice of C compiler and flags for coherency..." >&4
5315 $cat > try.c <<'EOF'
5317 int main() { printf("Ok\n"); return(0); }
5319 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5321 $cat >try.msg <<'EOM'
5322 I've tried to compile and run the following simple program:
5325 $cat try.c >> try.msg
5327 $cat >> try.msg <<EOM
5334 and I got the following output:
5338 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5339 if $sh -c "$run ./try " >>try.msg 2>&1; then
5343 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5346 cat >> try.msg <<'EOQS'
5347 If $libs contains -lsfio, and sfio is mis-configured, then it
5348 sometimes (apparently) runs and exits with a 0 status, but with no
5349 output! It may have to do with sfio's use of _exit vs. exit.
5352 rp="You have a big problem. Shall I abort Configure"
5359 echo "The program compiled OK, but exited with status $?." >>try.msg
5360 rp="You have a problem. Shall I abort Configure"
5364 echo "I can't compile the test program." >>try.msg
5365 rp="You have a BIG problem. Shall I abort Configure"
5371 case "$knowitall" in
5373 echo "(The supplied flags or libraries might be incorrect.)"
5381 *) echo "Ok. Stopping Configure." >&4
5386 n) echo "OK, that should do.";;
5388 $rm_try gcctest gcctest.out
5390 : define a shorthand compile call
5394 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5395 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5399 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5400 : define a shorthand compile call for compilations that should be ok.
5404 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5406 : determine filename position in cpp output
5408 echo "Computing filename position in cpp output for #include directives..." >&4
5410 vos) testaccess=-e ;;
5413 echo '#include <stdio.h>' > foo.c
5416 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5417 $grep '^[ ]*#.*stdio\.h' | \
5418 while read cline; do
5421 while $test \$# -gt 0; do
5422 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5427 pos=\`expr \$pos + 1\`
5439 *) pos="${fieldn}th";;
5441 echo "Your cpp writes the filename in the $pos field of the line."
5444 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5445 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5448 : locate header file
5453 for usrincdir in $usrinc
5455 if test -f \$usrincdir/\$wanted; then
5456 echo "\$usrincdir/\$wanted"
5460 awkprg='{ print \$$fieldn }'
5461 echo "#include <\$wanted>" > foo\$\$.c
5462 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5463 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5464 while read cline; do
5465 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5467 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5468 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5473 # status = 0: grep returned 0 lines, case statement not executed
5474 # status = 1: headerfile found
5475 # status = 2: while loop executed, no headerfile found
5479 if test \$status -eq 1; then
5486 : define an alternate in-header-list? function
5487 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5488 cont=true; xxf="echo \"<\$1> found.\" >&4";
5489 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5490 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5492 case $# in 4) instead=instead;; *) instead="at last";; esac;
5493 while $test "$cont"; do
5495 var=$2; eval "was=\$$2";
5496 if $test "$xxx" && $test -r "$xxx";
5498 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5501 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5502 set $yyy; shift; shift; yyy=$@;
5503 case $# in 0) cont="";;
5504 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5505 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5506 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5507 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5511 do set $yyy; var=$2; eval "was=\$$2";
5512 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5513 set $yyy; shift; shift; yyy=$@;
5516 : see if stdlib is available
5517 set stdlib.h i_stdlib
5520 : check for lengths of integral types
5524 echo "Checking to see how big your integers are..." >&4
5533 printf("intsize=%d;\n", (int)sizeof(int));
5534 printf("longsize=%d;\n", (int)sizeof(long));
5535 printf("shortsize=%d;\n", (int)sizeof(short));
5540 if eval $compile_ok && $run ./try > /dev/null; then
5542 echo "Your integers are $intsize bytes long."
5543 echo "Your long integers are $longsize bytes long."
5544 echo "Your short integers are $shortsize bytes long."
5548 Help! I can't compile and run the intsize test program: please enlighten me!
5549 (This is probably a misconfiguration in your system or libraries, and
5550 you really ought to fix it. Still, I'll try anyway.)
5554 rp="What is the size of an integer (in bytes)?"
5558 rp="What is the size of a long integer (in bytes)?"
5562 rp="What is the size of a short integer (in bytes)?"
5570 : check for long long
5572 echo "Checking to see if you have long long..." >&4
5573 echo 'int main() { long long x = 7; return 0; }' > try.c
5575 if eval $compile; then
5577 echo "You have long long."
5580 echo "You do not have long long."
5586 : check for length of long long
5587 case "${d_longlong}${longlongsize}" in
5590 echo "Checking to see how big your long longs are..." >&4
5591 $cat >try.c <<'EOCP'
5595 printf("%d\n", (int)sizeof(long long));
5600 if eval $compile_ok; then
5601 longlongsize=`$run ./try`
5602 echo "Your long longs are $longlongsize bytes long."
5606 echo "(I can't seem to compile the test program. Guessing...)"
5607 rp="What is the size of a long long (in bytes)?"
5611 if $test "X$longsize" = "X$longlongsize"; then
5612 echo "(That isn't any different from an ordinary long.)"
5618 : see if inttypes.h is available
5619 : we want a real compile instead of Inhdr because some systems
5620 : have an inttypes.h which includes non-existent headers
5623 #include <inttypes.h>
5625 static int32_t foo32 = 0x12345678;
5629 if eval $compile; then
5630 echo "<inttypes.h> found." >&4
5633 echo "<inttypes.h> NOT found." >&4
5642 echo "Checking to see if you have int64_t..." >&4
5644 #include <sys/types.h>
5645 #$i_inttypes I_INTTYPES
5647 #include <inttypes.h>
5649 int main() { int64_t x = 7; }
5652 if eval $compile; then
5654 echo "You have int64_t."
5657 echo "You do not have int64_t."
5663 : Check if 64bit ints have a quad type
5665 echo "Checking which 64-bit integer type we could use..." >&4
5671 val='"unsigned int"'
5676 *) case "$longsize" in
5680 val='"unsigned long"'
5685 *) case "$d_longlong:$longlongsize" in
5690 val='"unsigned long long"'
5695 *) case "$d_int64_t" in
5714 '') echo "Alas, no 64-bit integer types in sight." >&4
5717 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5722 : Do we want 64bit support
5723 case "$uselonglong" in
5724 "$define"|true|[yY]*)
5727 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5729 use64bitint="$define"
5732 case "$use64bits" in
5733 "$define"|true|[yY]*)
5736 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5738 use64bitint="$define"
5741 case "$use64bitints" in
5742 "$define"|true|[yY]*)
5745 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5747 use64bitint="$define"
5750 case "$use64bitsint" in
5751 "$define"|true|[yY]*)
5754 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5756 use64bitint="$define"
5759 case "$uselonglongs" in
5760 "$define"|true|[yY]*)
5763 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5765 use64bitint="$define"
5768 case "$use64bitsall" in
5769 "$define"|true|[yY]*)
5772 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5774 use64bitall="$define"
5779 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5781 case "$use64bitall" in
5782 "$define"|true|[yY]*) use64bitint="$define" ;;
5788 You have natively 64-bit long integers.
5792 *) case "$use64bitint" in
5793 "$define"|true|[yY]*) dflt='y';;
5802 Perl can be built to take advantage of 64-bit integer types
5803 on some systems. To do so, Configure can be run with -Duse64bitint.
5804 Choosing this option will most probably introduce binary incompatibilities.
5806 If this doesn't make any sense to you, just accept the default '$dflt'.
5807 (The default has been chosen based on your configuration.)
5809 rp='Try to use 64-bit integers, if available?'
5812 [yY]*) val="$define" ;;
5820 case "$use64bitall" in
5821 "$define"|true|[yY]*) dflt='y' ;;
5822 *) case "$longsize" in
5830 You may also choose to try maximal 64-bitness. It means using as much
5831 64-bitness as possible on the platform. This in turn means even more
5832 binary incompatibilities. On the other hand, your platform may not
5833 have any more 64-bitness available than what you already have chosen.
5835 If this doesn't make any sense to you, just accept the default '$dflt'.
5836 (The default has been chosen based on your configuration.)
5838 rp='Try to use maximal 64-bit support, if available?'
5841 [yY]*) val="$define" ;;
5846 case "$use64bitall" in
5848 case "$use64bitint" in
5852 Since you have chosen a maximally 64-bit build, I'm also turning on
5853 the use of 64-bit integers.
5855 use64bitint="$define" ;;
5860 : Look for a hint-file generated 'call-back-unit'. If the
5861 : user has specified that a 64-bit perl is to be built,
5862 : we may need to set or change some other defaults.
5863 if $test -f use64bitint.cbu; then
5864 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5867 case "$use64bitint" in
5868 "$define"|true|[yY]*)
5870 4) case "$archname64" in
5871 '') archname64=64int ;;
5878 : Look for a hint-file generated 'call-back-unit'. If the
5879 : user has specified that a maximally 64-bit perl is to be built,
5880 : we may need to set or change some other defaults.
5881 if $test -f use64bitall.cbu; then
5882 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5885 case "$use64bitall" in
5886 "$define"|true|[yY]*)
5888 4) case "$archname64" in
5889 ''|64int) archname64=64all ;;
5896 case "$d_quad:$use64bitint" in
5900 *** You have chosen to use 64-bit integers,
5901 *** but none can be found.
5902 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5903 *** Cannot continue, aborting.
5910 : check for length of double
5912 case "$doublesize" in
5914 echo "Checking to see how big your double precision numbers are..." >&4
5923 printf("%d\n", (int)sizeof(double));
5928 if eval $compile_ok; then
5929 doublesize=`$run ./try`
5930 echo "Your double is $doublesize bytes long."
5933 echo "(I can't seem to compile the test program. Guessing...)"
5934 rp="What is the size of a double precision number (in bytes)?"
5942 : check for long doubles
5944 echo "Checking to see if you have long double..." >&4
5945 echo 'int main() { long double x = 7.0; }' > try.c
5947 if eval $compile; then
5949 echo "You have long double."
5952 echo "You do not have long double."
5958 : check for length of long double
5959 case "${d_longdbl}${longdblsize}" in
5962 echo "Checking to see how big your long doubles are..." >&4
5963 $cat >try.c <<'EOCP'
5967 printf("%d\n", sizeof(long double));
5972 if eval $compile; then
5973 longdblsize=`$run ./try`
5974 echo "Your long doubles are $longdblsize bytes long."
5978 echo "(I can't seem to compile the test program. Guessing...)" >&4
5979 rp="What is the size of a long double (in bytes)?"
5983 if $test "X$doublesize" = "X$longdblsize"; then
5984 echo "That isn't any different from an ordinary double."
5985 echo "I'll keep your setting anyway, but you may see some"
5986 echo "harmless compilation warnings."
5992 : determine the architecture name
5994 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5995 tarch=`arch`"-$osname"
5996 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5997 if uname -m > tmparch 2>&1 ; then
5998 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5999 -e 's/$/'"-$osname/" tmparch`
6007 case "$myarchname" in
6010 echo "(Your architecture name used to be $myarchname.)"
6014 case "$targetarch" in
6016 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6021 *) dflt="$archname";;
6023 rp='What is your architecture name'
6027 : optionally add API version to the architecture for versioned archlibs
6028 case "$useversionedarchname" in
6029 $define|true|[yY]*) dflt='y';;
6032 rp='Add the Perl API version to your archname?'
6035 y|Y) useversionedarchname="$define" ;;
6036 *) useversionedarchname="$undef" ;;
6038 case "$useversionedarchname" in
6041 *-$api_versionstring)
6042 echo "...and architecture name already has -$api_versionstring" >&4
6045 archname="$archname-$api_versionstring"
6046 echo "...setting architecture name to $archname." >&4
6052 case "$usethreads" in
6054 echo "Threads selected." >&4
6056 *-thread*) echo "...and architecture name already has -thread." >&4
6058 *) archname="$archname-thread"
6059 echo "...setting architecture name to $archname." >&4
6064 case "$usemultiplicity" in
6066 echo "Multiplicity selected." >&4
6068 *-multi*) echo "...and architecture name already has -multi." >&4
6070 *) archname="$archname-multi"
6071 echo "...setting architecture name to $archname." >&4
6076 case "$use64bitint$use64bitall" in
6078 case "$archname64" in
6080 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6083 case "$use64bitint" in
6084 "$define") echo "64 bit integers selected." >&4 ;;
6086 case "$use64bitall" in
6087 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6090 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6092 *) archname="$archname-$archname64"
6093 echo "...setting architecture name to $archname." >&4
6099 case "$uselongdouble" in
6101 echo "Long doubles selected." >&4
6102 case "$longdblsize" in
6104 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6108 *-ld*) echo "...and architecture name already has -ld." >&4
6110 *) archname="$archname-ld"
6111 echo "...setting architecture name to $archname." >&4
6118 if $test -f archname.cbu; then
6119 echo "Your platform has some specific hints for architecture name, using them..."
6123 : set the prefixit variable, to compute a suitable default value
6124 prefixit='case "$3" in
6126 case "$oldprefix" in
6127 "") eval "$1=\"\$$2\"";;
6134 ""|" ") eval "$1=\"\$$2\"";;
6140 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6142 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6143 /*-$oldprefix/*|\~*-$oldprefix/*)
6144 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6145 *) eval "$1=\"\$$2\"";;
6149 : determine installation style
6150 : For now, try to deduce it from prefix unless it is already set.
6151 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6152 case "$installstyle" in
6153 '') case "$prefix" in
6154 *perl*) dflt='lib';;
6155 *) dflt='lib/perl5' ;;
6158 *) dflt="$installstyle" ;;
6160 : Probably not worth prompting for this since we prompt for all
6161 : the directories individually, and the prompt would be too long and
6165 : determine where public executables go
6170 rp='Pathname where the public executables will reside?'
6172 if $test "X$ansexp" != "X$binexp"; then
6176 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6177 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6178 : this via initialinstalllocation
6181 case "$userelocatableinc" in
6182 $define|true|[yY]*) dflt='y' ;;
6187 Would you like to build Perl so that the installation is relocatable, so that
6188 library paths in @INC are determined relative to the path of the perl binary?
6189 This is not advised for system Perl installs, or if you need to run setid
6190 scripts or scripts under taint mode.
6192 If this doesn't make any sense to you, just accept the default '$dflt'.
6194 rp='Use relocatable @INC?'
6197 y|Y) val="$define" ;;
6200 set userelocatableinc
6203 initialinstalllocation="$binexp"
6204 : Default prefix is now "up one level from where the binaries are"
6205 case "$userelocatableinc" in
6211 installprefixexp=".../.."
6215 : determine where private library files go
6216 : Usual default is /usr/local/lib/perl5/$version.
6217 : Also allow things like /opt/perl/lib/$version, since
6218 : /opt/perl/lib/perl5... would be redundant.
6219 : The default "style" setting is made in installstyle.U
6220 case "$installstyle" in
6221 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6222 *) set dflt privlib lib/$version ;;
6227 There are some auxiliary files for $package that need to be put into a
6228 private library directory that is accessible by everyone.
6233 rp='Pathname where the private library files will reside?'
6238 : set the prefixup variable, to restore leading tilda escape
6239 prefixup='case "$prefixexp" in
6241 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6244 : determine where public architecture dependent libraries go
6247 : privlib default is /usr/local/lib/$package/$version
6248 : archlib default is /usr/local/lib/$package/$version/$archname
6249 : privlib may have an optional trailing /share.
6250 tdflt=`echo $privlib | $sed 's,/share$,,'`
6251 tdflt=$tdflt/$archname
6260 $spackage contains architecture-dependent library files. If you are
6261 sharing libraries in a heterogeneous environment, you might store
6262 these files in a separate location. Otherwise, you can just include
6263 them with the rest of the public library files.
6268 rp='Where do you want to put the public architecture-dependent libraries?'
6272 if $test X"$archlib" = X"$privlib"; then
6278 : see if setuid scripts can be secure
6281 Some kernels have a bug that prevents setuid #! scripts from being
6282 secure. Some sites have disabled setuid #! scripts because of this.
6284 First let's decide if your kernel supports secure setuid #! scripts.
6285 (If setuid #! scripts would be secure but have been disabled anyway,
6286 don't say that they are secure if asked.)
6291 if $test -d /dev/fd; then
6292 echo "#!$ls" >reflect
6293 chmod +x,u+s reflect
6294 ./reflect >flect 2>&1
6295 if $contains "/dev/fd" flect >/dev/null; then
6296 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6300 If you are not sure if they are secure, I can check but I'll need a
6301 username and password different from the one you are using right now.
6302 If you don't have such a username or don't want me to test, simply
6306 rp='Other username to test security of setuid scripts with?'
6311 case "$d_suidsafe" in
6312 '') echo "I'll assume setuid scripts are *not* secure." >&4
6315 echo "Well, the $hint value is *not* secure." >&4
6317 *) echo "Well, the $hint value *is* secure." >&4
6322 $rm -f reflect flect
6323 echo "#!$ls" >reflect
6324 chmod +x,u+s reflect
6327 echo '"su" will (probably) prompt you for '"$ans's password."
6328 su $ans -c './reflect >flect'
6329 if $contains "/dev/fd" flect >/dev/null; then
6330 echo "Okay, it looks like setuid scripts are secure." >&4
6333 echo "I don't think setuid scripts are secure." >&4
6338 rp='Does your kernel have *secure* setuid scripts?'
6341 [yY]*) val="$define";;
6346 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6347 echo "(That's for file descriptors, not floppy disks.)"
6353 $rm -f reflect flect
6355 : now see if they want to do setuid emulation
6356 if $test $patchlevel -lt 11; then
6359 case "$d_suidsafe" in
6362 echo "No need to emulate SUID scripts since they are secure here." >&4
6366 Some systems have disabled setuid scripts, especially systems where
6367 setuid scripts cannot be secure. On systems where setuid scripts have
6368 been disabled, the setuid/setgid bits on scripts are currently
6369 useless. It is possible for $package to detect those bits and emulate
6370 setuid/setgid in a secure fashion. This emulation will only work if
6371 setuid scripts have been disabled in your kernel.
6375 "$define") dflt=y ;;
6378 rp="Do you want to do setuid/setgid emulation?"
6381 [yY]*) val="$define";;
6393 SUID emulation has been removed for 5.12
6394 Please re-run Configure without -Dd_dosuid
6403 : Find perl5.005 or later.
6404 echo "Looking for a previously installed perl5.005 or later... "
6406 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6407 : Check if this perl is recent and can load a simple module
6408 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6411 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6421 '') echo "None found. That's ok.";;
6422 *) echo "Using $perl5." ;;
6425 : Set the siteprefix variables
6428 After $package is installed, you may wish to install various
6429 add-on modules and utilities. Typically, these add-ons will
6430 be installed under $prefix with the rest
6431 of this package. However, you may wish to install such add-ons
6432 elsewhere under a different prefix.
6434 If you do not wish to put everything under a single prefix, that's
6435 ok. You will be prompted for the individual locations; this siteprefix
6436 is only used to suggest the defaults.
6438 The default should be fine for most people.
6442 rp='Installation prefix to use for add-on modules and utilities?'
6443 : XXX Here might be another good place for an installstyle setting.
6444 case "$siteprefix" in
6446 *) dflt=$siteprefix ;;
6449 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6451 case "$siteprefix" in
6455 *) oldsiteprefix="$prefix";;
6460 siteprefixexp="$ansexp"
6462 : determine where site specific libraries go.
6463 : Usual default is /usr/local/lib/perl5/site_perl/$version
6464 : The default "style" setting is made in installstyle.U
6465 : XXX No longer works with Prefixit stuff.
6466 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6468 '') case "$installstyle" in
6469 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6470 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6478 The installation process will create a directory for
6479 site-specific extensions and modules. Most users find it convenient
6480 to place all site-specific files in this directory rather than in the
6481 main distribution directory.
6485 rp='Pathname for the site-specific library files?'
6489 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6491 : Determine list of previous versions to include in @INC
6492 $cat > getverlist <<EOPL
6495 \$api_versionstring = "$api_versionstring";
6496 \$version = "$version";
6497 \$stem = "$sitelib_stem";
6498 \$archname = "$archname";
6500 $cat >> getverlist <<'EOPL'
6501 # The list found is store twice for each entry: the original name, and
6502 # the binary broken down version as pack "sss", so sorting is easy and
6503 # unambiguous. This will work for all versions that have a maximum of
6504 # three digit groups, separate by '.'s or '_'s. Names are extended with
6505 # ".0.0" to ensure at least three elements for the pack.
6506 # -- H.Merijn Brand (m)'06 23-10-2006
6508 # Can't have leading @ because metaconfig interprets it as a command!
6509 ;@inc_version_list=();
6510 # XXX Redo to do opendir/readdir?
6513 ;@candidates = map {
6514 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6515 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6521 ($pversion, $aversion, $vsn5005) = map {
6522 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6523 foreach $d (@candidates) {
6524 if ($d->[1] lt $pversion) {
6525 if ($d->[1] ge $aversion) {
6526 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6528 elsif ($d->[1] ge $vsn5005) {
6529 unshift(@inc_version_list, grep { -d } $d->[0]);
6533 # Skip newer version. I.e. don't look in
6534 # 5.7.0 if we're installing 5.6.1.
6538 if (@inc_version_list) {
6539 print join(' ', @inc_version_list);
6542 # Blank space to preserve value for next Configure run.
6547 case "$inc_version_list" in
6548 '') if test -x "$perl5$exe_ext"; then
6549 dflt=`$perl5 getverlist`
6554 $undef) dflt='none' ;;
6555 *) eval dflt=\"$inc_version_list\" ;;
6558 ''|' ') dflt=none ;;
6565 In order to ease the process of upgrading, this version of perl
6566 can be configured to use modules built and installed with earlier
6567 versions of perl that were installed under $prefix. Specify here
6568 the list of earlier versions that this version of perl should check.
6569 If Configure detected no earlier versions of perl installed under
6570 $prefix, then the list will be empty. Answer 'none' to tell perl
6571 to not search earlier versions.
6573 The default should almost always be sensible, so if you're not sure,
6574 just accept the default.
6577 rp='List of earlier versions to include in @INC?'
6580 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6581 *) inc_version_list="$ans" ;;
6583 case "$inc_version_list" in
6585 inc_version_list_init='0'
6586 d_inc_version_list="$undef"
6588 *) inc_version_list_init=`echo $inc_version_list |
6589 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6590 d_inc_version_list="$define"
6595 : see if malloc/malloc.h has to be included
6596 set malloc/malloc.h i_mallocmalloc
6599 : see if this is a malloc.h system
6600 : we want a real compile instead of Inhdr because some systems have a
6601 : malloc.h that just gives a compile error saying to use stdlib.h instead
6606 #$i_mallocmalloc I_MALLOCMALLOC
6607 #ifdef I_MALLOCMALLOC
6608 # include <malloc/malloc.h>
6611 int main () { return 0; }
6614 if eval $compile; then
6615 echo "<malloc.h> found." >&4
6618 echo "<malloc.h> NOT found." >&4
6625 : check for void type
6627 echo "Checking to see how well your C compiler groks the void type..." >&4
6628 case "$voidflags" in
6640 extern void moo(); /* function returning void */
6641 void (*goo)(); /* ptr to func returning void */
6643 void *hue; /* generic ptr */
6656 int main() { sub(); }
6658 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6659 voidflags=$defvoidused
6660 echo "Good. It appears to support void to the level $package wants.">&4
6661 if $contains warning .out >/dev/null 2>&1; then
6662 echo "However, you might get some warnings that look like this:"
6666 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6667 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6668 echo "It supports 1..."
6669 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6670 echo "It also supports 2..."
6671 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6673 echo "And it supports 4 but not 8 definitely."
6675 echo "It doesn't support 4..."
6676 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6678 echo "But it supports 8."
6681 echo "Neither does it support 8."
6685 echo "It does not support 2..."
6686 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6688 echo "But it supports 4 and 8."
6690 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6692 echo "And it supports 4 but has not heard about 8."
6694 echo "However it supports 8 but not 4."
6699 echo "There is no support at all for void."
6704 case "$voidflags" in
6707 Support flag bits are:
6708 1: basic void declarations.
6709 2: arrays of pointers to functions returning void.
6710 4: operations between pointers to and addresses of void functions.
6711 8: generic void pointers.
6714 rp="Your void support flags add up to what?"
6721 : check for length of pointer
6725 echo "Checking to see how big your pointers are..." >&4
6726 if test "$voidflags" -gt 7; then
6727 echo '#define VOID_PTR char *' > try.c
6729 echo '#define VOID_PTR void *' > try.c
6739 printf("%d\n", (int)sizeof(VOID_PTR));
6744 if eval $compile_ok; then
6745 ptrsize=`$run ./try`
6746 echo "Your pointers are $ptrsize bytes long."
6749 echo "(I can't seem to compile the test program. Guessing...)" >&4
6750 rp="What is the size of a pointer (in bytes)?"
6757 case "$use64bitall" in
6758 "$define"|true|[yY]*)
6762 *** You have chosen a maximally 64-bit build,
6763 *** but your pointers are only 4 bytes wide.
6764 *** Please rerun Configure without -Duse64bitall.
6769 *** Since you have quads, you could possibly try with -Duse64bitint.
6774 *** Cannot continue, aborting.
6785 : determine whether to use malloc wrapping
6787 case "$usemallocwrap" in
6788 [yY]*|true|$define) dflt='y' ;;
6789 [nN]*|false|$undef) dflt='n' ;;
6790 *) case "$usedevel" in
6791 [yY]*|true|$define) dflt='y' ;;
6796 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6798 usemallocwrap="$ans"
6801 usemallocwrap="$define" ;;
6803 usemallocwrap="$undef" ;;
6806 : determine which malloc to compile in
6808 case "$usemymalloc" in
6809 [yY]*|true|$define) dflt='y' ;;
6810 [nN]*|false|$undef) dflt='n' ;;
6811 *) case "$ptrsize" in
6815 if test "$useithreads" = "$define"; then dflt='n'; fi
6818 rp="Do you wish to attempt to use the malloc that comes with $package?"
6824 mallocsrc='malloc.c'
6825 mallocobj="malloc$_o"
6826 d_mymalloc="$define"
6829 : Remove malloc from list of libraries to use
6830 echo "Removing unneeded -lmalloc from library list" >&4
6831 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6834 echo "libs = $libs" >&4
6846 : compute the return types of malloc and free
6848 $cat >malloc.c <<END
6852 #include <sys/types.h>
6866 case "$malloctype" in
6868 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6875 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6879 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6886 echo "Your system uses $freetype free(), it would seem." >&4
6888 : determine where site specific architecture-dependent libraries go.
6889 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6890 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6891 : sitelib may have an optional trailing /share.
6893 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6894 dflt="$dflt/$archname"
6899 set sitearch sitearch none
6903 The installation process will also create a directory for
6904 architecture-dependent site-specific extensions and modules.
6908 rp='Pathname for the site-specific architecture-dependent library files?'
6912 if $test X"$sitearch" = X"$sitelib"; then
6915 d_sitearch="$define"
6918 : Set the vendorprefix variables
6921 The installation process will also create a directory for
6922 vendor-supplied add-ons. Vendors who supply perl with their system
6923 may find it convenient to place all vendor-supplied files in this
6924 directory rather than in the main distribution directory. This will
6925 ease upgrades between binary-compatible maintenance versions of perl.
6927 Of course you may also use these directories in whatever way you see
6928 fit. For example, you might use them to access modules shared over a
6929 company-wide network.
6931 The default answer should be fine for most people.
6932 This causes further questions about vendor add-ons to be skipped
6933 and no vendor-specific directories will be configured for perl.
6936 rp='Do you want to configure vendor-specific add-on directories?'
6937 case "$usevendorprefix" in
6938 define|true|[yY]*) dflt=y ;;
6939 *) : User may have set vendorprefix directly on Configure command line.
6940 case "$vendorprefix" in
6949 rp='Installation prefix to use for vendor-supplied add-ons?'
6950 case "$vendorprefix" in
6952 *) dflt=$vendorprefix ;;
6955 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6957 case "$vendorprefix" in
6961 *) oldvendorprefix="$prefix";;
6965 usevendorprefix="$define"
6967 vendorprefixexp="$ansexp"
6969 *) usevendorprefix="$undef"
6975 : Set the vendorlib variables
6976 case "$vendorprefix" in
6977 '') d_vendorlib="$undef"
6981 *) d_vendorlib="$define"
6982 : determine where vendor-supplied modules go.
6983 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6984 case "$vendorlib" in
6986 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6987 case "$installstyle" in
6988 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6989 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6992 *) dflt="$vendorlib"
6996 rp='Pathname for the vendor-supplied library files?'
6999 vendorlibexp="$ansexp"
7002 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7006 : Set the vendorarch variables
7007 case "$vendorprefix" in
7008 '') d_vendorarch="$undef"
7012 *) d_vendorarch="$define"
7013 : determine where vendor-supplied architecture-dependent libraries go.
7014 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7015 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7016 : vendorlib may have an optional trailing /share.
7017 case "$vendorarch" in
7018 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7019 dflt="$dflt/$archname"
7021 *) dflt="$vendorarch" ;;
7024 rp='Pathname for vendor-supplied architecture-dependent files?'
7027 vendorarchexp="$ansexp"
7030 prefixvar=vendorarch
7032 if $test X"$vendorarch" = X"$vendorlib"; then
7033 d_vendorarch="$undef"
7035 d_vendorarch="$define"
7038 : Final catch-all directories to search
7041 Lastly, you can have perl look in other directories for extensions and
7042 modules in addition to those already specified.
7043 These directories will be searched after
7047 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7048 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7050 case "$otherlibdirs" in
7051 ''|' ') dflt='none' ;;
7052 *) dflt="$otherlibdirs" ;;
7055 Enter a colon-separated set of extra paths to include in perl's @INC
7056 search path, or enter 'none' for no extra paths.
7060 rp='Colon-separated list of additional directories for perl to search?'
7063 ' '|''|none) otherlibdirs=' ' ;;
7064 *) otherlibdirs="$ans" ;;
7066 case "$otherlibdirs" in
7070 set d_perl_otherlibdirs
7073 : Cruising for prototypes
7075 echo "Checking out function prototypes..." >&4
7076 $cat >prototype.c <<EOCP
7081 int main(int argc, char *argv[]) {
7084 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7085 echo "Your C compiler appears to support function prototypes."
7088 echo "Your C compiler doesn't seem to understand function prototypes."
7095 : Check if ansi2knr is required
7096 case "$prototype" in
7098 *) ansi2knr='ansi2knr'
7103 This version of $package can only be compiled by a compiler that
7104 understands function prototypes. Unfortunately, your C compiler
7106 doesn't seem to understand them. Sorry about that.
7108 If GNU cc is available for your system, perhaps you could try that instead.
7110 Eventually, we hope to support building Perl with pre-ANSI compilers.
7111 If you would like to help in that effort, please contact <perlbug@perl.org>.
7113 Aborting Configure now.
7120 dflt_dtrace='/usr/sbin/dtrace'
7121 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7125 Perl can be built to support DTrace on platforms that support it.
7126 DTrace is a diagnosis and performance analysis tool from Sun.
7128 If this doesn't make any sense to you, just accept the default '$dflt'.
7132 case "$usedtrace" in
7138 dflt_dtrace=$usedtrace
7145 rp='Support DTrace if available?'
7148 y|Y) val="$define" ;;
7154 test "X$usedtrace" != "X$define" && break
7157 rp='Where is the dtrace executable?'
7166 if $dtrace -h -s ../perldtrace.d \
7167 -o perldtrace.tmp >/dev/null 2>&1 \
7168 && rm -f perldtrace.tmp
7171 echo "Good: your $dtrace knows about the -h flag."
7175 *** $me: Fatal Error: $dtrace doesn't support -h flag
7177 *** Your installed dtrace doesn't support the -h switch to compile a D
7178 *** program into a C header. Can't continue.
7190 *** $me: Fatal Error: $dtrace not found.
7197 echo "*** $dtrace was not found."
7203 : See if we want extra modules installed
7210 Perl can be built with extra modules or bundles of modules which
7211 will be fetched from the CPAN and installed alongside Perl.
7213 Notice that you will need access to the CPAN; either via the Internet,
7214 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7215 be asked later to configure the CPAN.pm module which will in turn do
7216 the installation of the rest of the extra modules or bundles.)
7218 Notice also that if the modules require any external software such as
7219 libraries and headers (the libz library and the zlib.h header for the
7220 Compress::Zlib module, for example) you MUST have any such software
7221 already installed, this configuration process will NOT install such
7224 If this doesn't make any sense to you, just accept the default '$dflt'.
7226 rp='Install any extra modules (y or n)?'
7232 Please list any extra modules or bundles to be installed from CPAN,
7233 with spaces between the names. The names can be in any format the
7234 'install' command of CPAN.pm will understand. (Answer 'none',
7235 without the quotes, to install no extra modules or bundles.)
7245 $rm -f ../extras.lst
7247 *) echo "(Saving the list of extras for later...)"
7248 echo "$extras" > ../extras.lst
7256 : determine where html pages for programs go
7257 set html1dir html1dir none
7261 If you wish to install html files for programs in $spackage, indicate
7262 the appropriate directory here. To skip installing html files,
7266 ''|none|$undef|' ') dflt=none ;;
7267 *) dflt=$html1dir ;;
7270 rp="Directory for the main $spackage html pages?"
7274 : Use ' ' for none so value is preserved next time through Configure
7275 $test X"$html1dir" = "X" && html1dir=' '
7277 : determine where html pages for libraries and modules go
7278 set html3dir html3dir none
7282 If you wish to install html files for modules associated with $spackage,
7283 indicate the appropriate directory here. To skip installing html files,
7286 : There is no obvious default. If they have specified html1dir, then
7287 : try to key off that, possibly changing .../html1 into .../html3.
7289 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7290 *) dflt=$html3dir ;;
7293 rp="Directory for the $spackage module html pages?"
7297 : Use ' ' for none so value is preserved next time through Configure
7298 $test X"$html3dir" = "X" && html3dir=' '
7300 : determine whether to install perl also as /usr/bin/perl
7303 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7305 Many scripts expect perl to be installed as /usr/bin/perl.
7307 If you want to, I can install the perl you are about to compile
7308 as /usr/bin/perl (in addition to $bin/perl).
7310 if test -f /usr/bin/perl; then
7313 However, please note that because you already have a /usr/bin/perl,
7314 overwriting that with a new Perl would very probably cause problems.
7315 Therefore I'm assuming you don't want to do that (unless you insist).
7318 case "$installusrbinperl" in
7319 "$define"|[yY]*) dflt='y';;
7325 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7328 case "$installusrbinperl" in
7329 "$undef"|[nN]*) dflt='n';;
7333 rp="Do you want to install perl as /usr/bin/perl?"
7336 [yY]*) val="$define";;
7342 set installusrbinperl
7345 : Check if we are using the GNU C library
7347 echo "Checking for GNU C Library..." >&4
7349 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7350 alone are insufficient to distinguish different versions, such as
7351 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7352 libc version 2.1.0. A. Dougherty, June 3, 2002.
7358 # ifdef __GLIBC_MINOR__
7359 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7360 # include <gnu/libc-version.h>
7361 printf("%s\n", gnu_get_libc_version());
7363 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7366 printf("%d\n", __GLIBC__);
7375 if eval $compile_ok && $run ./try > glibc.ver; then
7377 gnulibc_version=`$cat glibc.ver`
7378 echo "You are using the GNU C Library version $gnulibc_version"
7382 echo "You are not using the GNU C Library"
7388 : see if nm is to be used to determine whether a symbol is defined or not
7392 case "$d_gnulibc" in
7395 echo "nm probably won't work on the GNU C Library." >&4
7401 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7403 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7404 echo "'nm' won't be sufficient on this system." >&4
7410 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7411 if $test $dflt -gt 20; then
7421 true|$define) dflt=y;;
7428 I can use $nm to extract the symbols from your C libraries. This
7429 is a time consuming task which may generate huge output on the disk (up
7430 to 3 megabytes) but that should make the symbols extraction faster. The
7431 alternative is to skip the 'nm' extraction part and to compile a small
7432 test program instead to determine whether each symbol is present. If
7433 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7434 this may be the best solution.
7436 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7439 rp="Shall I use $nm to extract C symbols from the libraries?"
7442 [Nn]*) usenm=false;;
7451 : nm options which may be necessary
7453 '') if $test -f /mach_boot; then
7455 elif $test -d /usr/ccs/lib; then
7456 nm_opt='-p' # Solaris (and SunOS?)
7457 elif $test -f /dgux; then
7459 elif $test -f /lib64/rld; then
7460 nm_opt='-p' # 64-bit Irix
7466 : nm options which may be necessary for shared libraries but illegal
7467 : for archive libraries. Thank you, Linux.
7468 case "$nm_so_opt" in
7469 '') case "$myuname" in
7471 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7472 nm_so_opt='--dynamic'
7479 : Figure out where the libc is located
7482 : get list of predefined functions in a handy place
7487 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7493 *) for thislib in $libs; do
7496 : Handle C library specially below.
7499 thislib=`echo $thislib | $sed -e 's/^-l//'`
7500 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7502 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7504 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7506 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7508 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7510 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7512 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7517 libnames="$libnames $try"
7519 *) libnames="$libnames $thislib" ;;
7528 for xxx in $libpth; do
7529 $test -r $1 || set $xxx/libc.$so
7530 : The messy sed command sorts on library version numbers.
7532 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7533 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7535 s/[0-9][0-9]*/0000&/g
7536 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7539 $sort | $sed -e 's/^.* //'`
7542 $test -r $1 || set /usr/ccs/lib/libc.$so
7543 $test -r $1 || set /lib/libsys_s$_a
7549 if $test -r "$1"; then
7550 echo "Your (shared) C library seems to be in $1."
7552 elif $test -r /lib/libc && $test -r /lib/clib; then
7553 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7555 libc='/lib/clib /lib/libc'
7556 if $test -r /lib/syslib; then
7557 echo "(Your math library is in /lib/syslib.)"
7558 libc="$libc /lib/syslib"
7560 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7561 echo "Your C library seems to be in $libc, as you said before."
7562 elif $test -r $incpath/usr/lib/libc$_a; then
7563 libc=$incpath/usr/lib/libc$_a;
7564 echo "Your C library seems to be in $libc. That's fine."
7565 elif $test -r /lib/libc$_a; then
7567 echo "Your C library seems to be in $libc. You're normal."
7569 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7571 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7572 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7573 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7575 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7577 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7580 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7582 if $test -r "$tans"; then
7583 echo "Your C library seems to be in $tans, of all places."
7589 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7593 If the guess above is wrong (which it might be if you're using a strange
7594 compiler, or your machine supports multiple models), you can override it here.
7599 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7601 I can't seem to find your C library. I've looked in the following places:
7604 $sed 's/^/ /' libpath
7607 None of these seems to contain your C library. I need to get its name...
7612 rp='Where is your C library?'
7617 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7618 set X `cat libnames`
7621 case $# in 1) xxx=file; esac
7622 echo "Extracting names from the following $xxx for later perusal:" >&4
7624 $sed 's/^/ /' libnames >&4
7626 $echo $n "This may take a while...$c" >&4
7630 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7631 *) $nm $nm_opt $file 2>/dev/null;;
7636 $grep fprintf libc.tmp > libc.ptf
7637 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7638 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7640 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7665 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7681 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7685 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7689 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7693 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 $nm -p $* 2>/dev/null >libc.tmp
7699 $grep fprintf libc.tmp > libc.ptf
7700 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7701 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7707 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7709 if $ar t $libc > libc.tmp && \
7710 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7712 for thisname in $libnames $libc; do
7713 $ar t $thisname >>libc.tmp
7715 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7717 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7718 for thisname in $libnames $libc; do
7719 $ar tv $thisname >>libc.tmp
7720 emximp -o tmp.imp $thisname \
7722 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7723 < tmp.imp >>libc.tmp
7726 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7729 echo "$ar didn't seem to work right." >&4
7730 echo "Maybe this is a Cray...trying bld instead..." >&4
7732 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7735 for thisname in $libnames; do
7737 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7738 $ar t $thisname >>libc.tmp
7742 echo "That didn't work either. Giving up." >&4
7752 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7753 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7755 *) if $test -f /lib/syscalls.exp; then
7757 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7758 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7759 /lib/syscalls.exp >>libc.list
7765 $rm -f libnames libpath
7767 : see if dld is available
7771 : Check if we are using C++
7773 echo "Checking for C++..." >&4
7774 $cat >try.c <<'EOCP'
7786 if eval $compile_ok && $run ./try; then
7788 echo "You are using a C++ compiler."
7791 echo "You are not using a C++ compiler."
7797 : is a C symbol defined?
7800 -v) tf=libc.tmp; tdc="";;
7801 -a) tf=libc.tmp; tdc="[]";;
7802 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7804 case "$d_cplusplus" in
7805 $define) extern_C="extern \"C\"" ;;
7806 *) extern_C="extern" ;;
7809 case "$reuseval-$4" in
7811 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7816 if $test "$runnm" = true; then
7817 if $contains $tlook $tf >/dev/null 2>&1; then
7819 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7820 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7821 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7822 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7826 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7827 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7833 $define) tval=true;;
7840 : define an is-in-libc? function
7841 inlibc='echo " "; td=$define; tu=$undef;
7842 sym=$1; var=$2; eval "was=\$$2";
7844 case "$reuseval$was" in
7854 echo "$sym() found." >&4;
7855 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7857 echo "$sym() NOT found." >&4;
7858 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7862 $define) echo "$sym() found." >&4;;
7863 *) echo "$sym() NOT found." >&4;;
7867 : see if dlopen exists
7869 xxx_ccflags="$ccflags"
7871 : with g++ one needs -shared to get is-in-libc to work for dlopen
7872 case "$gccversion" in
7874 *) case "$d_cplusplus" in
7875 "$define") ccflags="$ccflags -shared" ;;
7882 ccflags="$xxx_ccflags"
7884 : see if this is a unistd.h system
7885 set unistd.h i_unistd
7888 : determine which dynamic loading, if any, to compile in
7890 dldir="ext/DynaLoader"
7903 $define) dflt='y' ;;
7906 $define) dflt='y' ;;
7908 : Does a dl_xxx.xs file exist for this operating system
7909 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7912 rp="Do you wish to use dynamic loading?"
7920 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7921 dflt="$dldir/dl_${osname}.xs"
7922 elif $test "$d_dlopen" = "$define" ; then
7923 dflt="$dldir/dl_dlopen.xs"
7924 elif $test "$i_dld" = "$define" ; then
7925 dflt="$dldir/dl_dld.xs"
7930 *) dflt="$dldir/$dlsrc"
7933 echo "The following dynamic loading files are available:"
7934 : Can not go over to $dldir because getfile has path hard-coded in.
7935 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7936 rp="Source file to use for dynamic loading"
7942 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7946 Some systems may require passing special flags to $cc -c to
7947 compile modules that will be used to create a shared library.
7948 To use no flags, say "none".
7951 case "$cccdlflags" in
7952 '') case "$gccversion" in
7953 '') case "$osname" in
7955 next) dflt='none' ;;
7956 irix*) dflt='-KPIC' ;;
7957 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7958 sunos) dflt='-pic' ;;
7962 *) case "$osname" in
7963 darwin) dflt='none' ;;
7964 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7969 *) dflt="$cccdlflags" ;;
7971 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7974 none) cccdlflags=' ' ;;
7975 *) cccdlflags="$ans" ;;
7980 Some systems use ld to create libraries that can be dynamically loaded,
7981 while other systems (such as those using ELF) use $cc.
7985 : Determine if this is ELF
7987 /* Test for whether ELF binaries are produced */
7999 int i = open("a.out",O_RDONLY);
8002 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8003 exit(0); /* succeed (yes, it is ELF) */
8008 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8014 '') if $test $bin_ELF = "$define"; then
8016 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8020 echo "I'll use ld to build dynamic libraries."
8028 rp="What command should be used to create dynamic libraries?"
8034 Some systems may require passing special flags to $ld to create a
8035 library that can be dynamically loaded. If your ld flags include
8036 -L/other/path options to locate libraries outside your loader's normal
8037 search path, you may need to specify those -L options here as well. To
8038 use no flags, say "none".
8041 case "$lddlflags" in
8042 '') case "$osname" in
8043 haiku) dflt='-shared' ;;
8045 case "$gccversion" in
8046 '') dflt="$dflt +vnocompatwarnings" ;;
8049 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8050 next) dflt='none' ;;
8051 solaris) # See [perl #66604]. On Solaris 11, gcc -m64 on amd64
8052 # appears not to understand -G. gcc versions at
8053 # least as old as 3.4.3 support -shared, so just
8054 # use that with Solaris 11 and later, but keep
8055 # the old behavior for older Solaris versions.
8056 case "$gccversion" in
8058 *) case "$osvers" in
8059 2.?|2.10) dflt='-G' ;;
8060 *) dflt='-shared' ;;
8065 sunos) dflt='-assert nodefinitions' ;;
8066 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8070 *) dflt="$lddlflags" ;;
8073 : Try to guess additional flags to pick up local libraries.
8074 : Be careful not to append to a plain 'none'
8078 for thisflag in $ldflags; do
8083 *) dflt="$dflt $thisflag" ;;
8090 ''|' ') dflt='none' ;;
8094 *-fstack-protector*)
8096 *-fstack-protector*) ;; # Don't add it again
8097 *) dflt="$dflt -fstack-protector" ;;
8103 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8106 none) lddlflags=' ' ;;
8107 *) lddlflags="$ans" ;;
8112 Some systems may require passing special flags to $cc to indicate that
8113 the resulting executable will use dynamic linking. To use no flags,
8117 case "$ccdlflags" in
8118 '') case "$osname" in
8119 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8120 next|sunos) dflt='none' ;;
8124 *) dflt="$ccdlflags" ;;
8126 rp="Any special flags to pass to $cc to use dynamic linking?"
8129 none) ccdlflags=' ' ;;
8130 *) ccdlflags="$ans" ;;
8141 ld_can_script="$undef"
8142 case "$bin_ELF$usedl" in
8144 # Abuse try.h and a.out names for neat cleanup
8156 if $cc $cccdlflags $ccdlflags $ccflags \
8157 $ldflags $lddlflags -o a.out try.c \
8158 -Wl,--version-script=try.h >/dev/null 2>&1 \
8159 && $test -s a.out ; then
8160 echo "ld supports scripting" >&4
8161 ld_can_script="$define"
8163 echo "ld does not support scripting" >&4
8169 : Do we want a shared libperl?
8173 # No dynamic loading being used, so don't bother even to prompt.
8176 *) case "$useshrplib" in
8177 '') case "$osname" in
8178 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8180 also='Building a shared libperl is required for dynamic loading to work on your system.'
8185 also='Building a shared libperl is needed for MAB support.'
8203 The perl executable is normally obtained by linking perlmain.c with
8204 libperl${_a}, any static extensions (usually just DynaLoader), and
8205 any other libraries needed on this system (such as -lm, etc.). Since
8206 your system supports dynamic loading, it is probably possible to build
8207 a shared libperl.$so. If you will have more than one executable linked
8208 to libperl.$so, this will significantly reduce the size of each
8209 executable, but it may have a noticeable effect on performance. The
8210 default is probably sensible for your system.
8214 rp="Build a shared libperl.$so (y/n)"
8218 useshrplib='true' ;;
8219 *) useshrplib='false' ;;
8224 case "$useshrplib" in
8226 case "$userelocatableinc" in
8228 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8229 echo "See INSTALL for an explanation why that won't work." >&4
8235 # Figure out a good name for libperl.so. Since it gets stored in
8236 # a version-specific architecture-dependent library, the version
8237 # number isn't really that important, except for making cc/ld happy.
8239 # A name such as libperl.so.10.1
8240 majmin="libperl.$so.$patchlevel.$subversion"
8241 # A name such as libperl.so.100
8242 majonly=`echo $patchlevel $subversion |
8243 $awk '{printf "%d%02d", $1, $2}'`
8244 majonly=libperl.$so.$majonly
8245 # I'd prefer to keep the os-specific stuff here to a minimum, and
8246 # rely on figuring it out from the naming of libc.
8247 case "${osname}${osvers}" in
8250 # XXX How handle the --version stuff for MAB?
8252 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8255 cygwin*) # ld links now against the dll directly
8256 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8257 majonly=`echo $patchlevel $subversion |
8258 $awk '{printf "%03d%03d", $1, $2}'`
8259 majonly=cygperl5.$majonly.$so
8262 *) # Try to guess based on whether libc has major.minor.
8264 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8265 *libc.$so.[0-9]*) dflt=$majonly ;;
8266 *) dflt=libperl.$so ;;
8276 I need to select a good name for the shared libperl. If your system uses
8277 library names with major and minor numbers, then you might want something
8278 like $majmin. Alternatively, if your system uses a single version
8279 number for shared libraries, then you might want to use $majonly.
8280 Or, your system might be quite happy with a simple libperl.$so.
8282 Since the shared libperl will get installed into a version-specific
8283 architecture-dependent directory, the version number of the shared perl
8284 library probably isn't important, so the default should be o.k.
8287 rp='What name do you want to give to the shared libperl?'
8290 echo "Ok, I'll use $libperl"
8293 libperl="libperl${_a}"
8297 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8301 WARNING: Use of the shrpdir variable for the installation location of
8302 the shared $libperl is not supported. It was never documented and
8303 will not work in this version. Let me (perlbug@perl.org)
8304 know of any problems this may cause.
8310 But your current setting of $shrpdir is
8311 the default anyway, so it's harmless.
8316 Further, your current attempted setting of $shrpdir
8317 conflicts with the value of $archlibexp/CORE
8318 that installperl will use.
8325 # How will the perl executable find the installed shared $libperl?
8326 # Add $xxx to ccdlflags.
8327 # If we can't figure out a command-line option, use $shrpenv to
8328 # set env LD_RUN_PATH. The main perl makefile uses this.
8329 shrpdir=$archlibexp/CORE
8332 if "$useshrplib"; then
8335 # We'll set it in Makefile.SH...
8340 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8341 xxx="-Wl,-R$shrpdir"
8343 bsdos|linux|irix*|dec_osf|gnu*)
8344 xxx="-Wl,-rpath,$shrpdir"
8347 # next doesn't like the default...
8350 # Haiku doesn't like the default, either.
8353 # hpux doesn't like the default, either.
8354 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8357 # cygwin needs only ldlibpth
8360 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8366 # Only add $xxx if it isn't already in ccdlflags.
8367 case " $ccdlflags " in
8369 *) ccdlflags="$ccdlflags $xxx"
8372 Adding $xxx to the flags
8373 passed to $ld so that the perl executable will find the
8374 installed shared $libperl.
8382 # Fix ccdlflags in AIX for building external extensions.
8383 # (For building Perl itself bare -bE:perl.exp is needed,
8384 # Makefile.SH takes care of this.)
8386 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8388 # Respect a hint or command-line value.
8390 '') shrpenv="$tmp_shrpenv" ;;
8392 case "$ldlibpthname" in
8393 '') ldlibpthname=LD_LIBRARY_PATH ;;
8394 none) ldlibpthname='' ;;
8397 : determine where manual pages are on this system
8401 syspath='/usr/share/man/man1 /usr/man/man1'
8402 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8403 syspath="$syspath /usr/man/u_man/man1"
8404 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8405 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8406 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8407 sysman=`./loc . /usr/man/man1 $syspath`
8410 if $test -d "$sysman"; then
8411 echo "System manual is in $sysman." >&4
8413 echo "Could not find manual pages in source form." >&4
8416 : determine where manual pages go
8417 set man1dir man1dir none
8421 $spackage has manual pages available in source form.
8425 echo "However, you don't have nroff, so they're probably useless to you."
8427 '') man1dir="none";;
8430 echo "If you don't want the manual sources installed, answer 'none'."
8435 lookpath="$prefixexp/share/man/man1"
8436 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8437 lookpath="$lookpath $prefixexp/man/p_man/man1"
8438 lookpath="$lookpath $prefixexp/man/u_man/man1"
8439 lookpath="$lookpath $prefixexp/man/man.1"
8441 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8442 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8452 rp="Where do the main $spackage manual pages (source) go?"
8454 if $test "X$man1direxp" != "X$ansexp"; then
8465 : What suffix to use on installed man pages
8472 rp="What suffix should be used for the main $spackage man pages?"
8474 '') case "$man1dir" in
8488 *) dflt="$man1ext";;
8495 : see if we can have long filenames
8497 first=123456789abcdef
8499 if (echo hi >$first) 2>/dev/null; then
8500 if $test -f 123456789abcde; then
8501 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8504 echo 'You can have filenames longer than 14 characters.'>&4
8509 You can't have filenames longer than 14 chars.
8510 You can't even think about them!
8516 $rm -rf 123456789abcde*
8518 : determine where library module manual pages go
8519 set man3dir man3dir none
8523 $spackage has manual pages for many of the library modules.
8529 However, you don't have nroff, so they're probably useless to you.
8532 '') man3dir="none";;
8536 case "$d_flexfnam" in
8539 However, your system can't handle the long file names like File::Basename.3.
8542 '') man3dir="none";;
8546 echo "If you don't want the manual sources installed, answer 'none'."
8547 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8549 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8550 if $test -d "$privlib/man/man3"; then
8553 WARNING: Previous versions of perl installed man3 pages into
8554 $privlib/man/man3. This version will suggest a
8555 new default of $dflt.
8559 rp='Do you wish to preserve the old behavior?(y/n)'
8562 y*) dflt="$privlib/man/man3" ;;
8567 *) dflt="$man3dir" ;;
8574 rp="Where do the $package library man pages (source) go?"
8584 : What suffix to use on installed man pages
8590 rp="What suffix should be used for the $package library man pages?"
8592 '') case "$man3dir" in
8606 *) dflt="$man3ext";;
8613 : see if we have to deal with yellow pages, now NIS.
8614 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8615 if $test -f /usr/etc/nibindd; then
8617 echo "I'm fairly confident you're on a NeXT."
8619 rp='Do you get the hosts file via NetInfo?'
8628 y*) hostcat='nidump hosts .';;
8629 *) case "$hostcat" in
8630 nidump*) hostcat='';;
8640 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8648 rp='Are you getting the hosts file via yellow pages?'
8651 y*) hostcat='ypcat hosts';;
8652 *) hostcat='cat /etc/hosts';;
8658 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8661 '') test -f /etc/group && groupcat='cat /etc/group';;
8664 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8667 : now get the host name
8669 echo "Figuring out host name..." >&4
8670 case "$myhostname" in
8672 echo 'Maybe "hostname" will work...'
8673 if tans=`sh -c hostname 2>&1` ; then
8681 if $test "$cont"; then
8683 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8684 if tans=`cat /etc/systemid 2>&1` ; then
8686 phostname='cat /etc/systemid'
8687 echo "Whadyaknow. Xenix always was a bit strange..."
8690 elif $test -r /etc/systemid; then
8691 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8694 if $test "$cont"; then
8695 echo 'No, maybe "uuname -l" will work...'
8696 if tans=`sh -c 'uuname -l' 2>&1` ; then
8698 phostname='uuname -l'
8700 echo 'Strange. Maybe "uname -n" will work...'
8701 if tans=`sh -c 'uname -n' 2>&1` ; then
8703 phostname='uname -n'
8705 echo 'Oh well, maybe I can mine it out of whoami.h...'
8706 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8707 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8708 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8710 case "$myhostname" in
8711 '') echo "Does this machine have an identity crisis or something?"
8714 echo "Well, you said $myhostname before..."
8715 phostname='echo $myhostname';;
8721 case "$myhostname" in
8722 '') myhostname=noname ;;
8724 : you do not want to know about this
8729 if $test "$myhostname" ; then
8731 rp='Your host name appears to be "'$myhostname'".'" Right?"
8739 : bad guess or no guess
8740 while $test "X$myhostname" = X ; do
8742 rp="Please type the (one word) name of your host:"
8747 : translate upper to lower if necessary
8748 case "$myhostname" in
8750 echo "(Normalizing case in your host name)"
8751 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8755 case "$myhostname" in
8757 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8758 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8759 echo "(Trimming domain name from host name--host name is now $myhostname)"
8761 *) case "$mydomain" in
8764 test "X$hostcat" = "Xypcat hosts" &&
8765 ypmatch "$myhostname" hosts 2>/dev/null |\
8766 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8769 test "X$hostcat" != "X" &&
8770 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8771 /[ ]$myhostname[ . ]/p" > hosts
8774 if $test -f hosts; then
8775 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8776 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8777 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8778 hosts | $sort | $uniq | \
8779 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8780 case `$echo X$dflt` in
8781 X*\ *) echo "(Several hosts in the database matched hostname)"
8784 X.) echo "(You do not have fully-qualified names in the hosts database)"
8788 echo "(I cannot locate a hosts database anywhere)"
8793 tans=`./loc resolv.conf X /etc /usr/etc`
8794 if $test -f "$tans"; then
8795 echo "(Attempting domain name extraction from $tans)"
8796 dflt=.`$sed -n -e 's/ / /g' \
8797 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8800 .) dflt=.`$sed -n -e 's/ / /g' \
8801 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8809 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8810 dflt=.`sh -c domainname 2>/dev/null`
8813 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8817 case "$dflt$osname" in
8818 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8819 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8823 .) echo "(Lost all hope -- silly guess then)"
8829 *) dflt="$mydomain";;
8833 rp="What is your domain name?"
8843 : translate upper to lower if necessary
8846 echo "(Normalizing case in your domain name)"
8847 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8851 : a little sanity check here
8852 case "$phostname" in
8855 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8856 $myhostname$mydomain|$myhostname) ;;
8858 case "$phostname" in
8860 echo "(That doesn't agree with your whoami.h file, by the way.)"
8863 echo "(That doesn't agree with your $phostname command, by the way.)"
8871 : determine the e-mail address of the user who is running us
8874 I need to get your e-mail address in Internet format if possible, i.e.
8875 something like user@host.domain. Please answer accurately since I have
8876 no easy means to double check it. The default value provided below
8877 is most probably close to reality but may not be valid from outside
8878 your organization...
8882 while test "$cont"; do
8883 case "$MAILDOMAIN" in
8885 if $test -s /etc/mailname; then
8886 maildomain=`$cat /etc/mailname`
8888 maildomain="$myhostname$mydomain"
8891 *) maildomain="$MAILDOMAIN";;
8894 '') dflt="$cf_by@$maildomain";;
8895 *) dflt="$cf_email";;
8897 rp='What is your e-mail address?'
8903 rp='Address does not look like an Internet one. Use it anyway?'
8917 : Ask e-mail of administrator
8920 If you or somebody else will be maintaining perl at your site, please
8921 fill in the correct e-mail address here so that they may be contacted
8922 if necessary. Currently, the "perlbug" program included with perl
8923 will send mail to this address in addition to perlbug@perl.org. You may
8924 enter "none" for no administrator.
8927 case "$perladmin" in
8928 '') dflt="$cf_email";;
8929 *) dflt="$perladmin";;
8931 rp='Perl administrator e-mail address'
8935 : determine whether to only install version-specific parts.
8938 Do you want to install only the version-specific parts of the perl
8939 distribution? Usually you do *not* want to do this.
8941 case "$versiononly" in
8942 "$define"|[Yy]*|true) dflt='y' ;;
8945 rp="Do you want to install only the version-specific parts of perl?"
8948 [yY]*) val="$define";;
8954 case "$versiononly" in
8955 "$define") inc_version_list=''
8956 inc_version_list_init=0
8960 : figure out how to guarantee perl startup
8961 : XXX Note that this currently takes advantage of the bug that binexp ignores
8962 : the Configure -Dinstallprefix setting, which in turn means that under
8963 : relocatable @INC, initialinstalllocation is what binexp started as.
8964 case "$startperl" in
8966 case "$sharpbang" in
8970 I can use the #! construct to start perl on your system. This will
8971 make startup of perl scripts faster, but may cause problems if you
8972 want to share those scripts and perl is not in a standard place
8973 ($initialinstalllocation/perl) on all your platforms. The alternative
8974 is to force a shell by starting the script with a single ':' character.
8977 case "$versiononly" in
8978 "$define") dflt="$initialinstalllocation/perl$version";;
8979 *) dflt="$initialinstalllocation/perl";;
8981 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8984 none) startperl=": # use perl";;
8985 *) startperl="#!$ans"
8986 if $test 30 -lt `echo "$ans" | wc -c`; then
8989 WARNING: Some systems limit the #! command to 32 characters.
8990 If you experience difficulty running Perl scripts with #!, try
8991 installing Perl in a directory with a shorter pathname.
8997 *) startperl=": # use perl"
9002 echo "I'll use $startperl to start perl scripts."
9004 : figure best path for perl in scripts
9007 case "$versiononly" in
9008 "$define") perlpath="$initialinstalllocation/perl$version";;
9009 *) perlpath="$initialinstalllocation/perl";;
9011 case "$startperl" in
9016 I will use the "eval 'exec'" idiom to start Perl on your system.
9017 I can use the full path of your Perl binary for this purpose, but
9018 doing so may cause problems if you want to share those scripts and
9019 Perl is not always in a standard place ($initialinstalllocation/perl).
9022 dflt="$initialinstalllocation/perl"
9023 rp="What path shall I use in \"eval 'exec'\"?"
9030 case "$startperl" in
9032 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9035 : determine where public executable scripts go
9036 set scriptdir scriptdir
9038 case "$scriptdir" in
9041 : guess some guesses
9042 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9043 $test -d /usr/share/bin && dflt=/usr/share/bin
9044 $test -d /usr/local/script && dflt=/usr/local/script
9045 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9046 $test -d $prefixexp/script && dflt=$prefixexp/script
9050 *) dflt="$scriptdir"
9055 Some installations have a separate directory just for executable scripts so
9056 that they can mount it across multiple architectures but keep the scripts in
9057 one spot. You might, for example, have a subdirectory of /usr/share for this.
9058 Or you might just lump your scripts in with all your other executables.
9062 rp='Where do you keep publicly executable scripts?'
9064 if $test "X$ansexp" != "X$scriptdirexp"; then
9070 : A little fix up for an irregularly named variable.
9071 installscript="$installscriptdir"
9073 : determine where add-on public executables go
9075 '') dflt=$siteprefix/bin ;;
9079 rp='Pathname where the add-on public executables should be installed?'
9084 : determine where add-on html pages go
9085 : There is no standard location, so try to copy the previously-selected
9086 : directory structure for the core html pages.
9087 case "$sitehtml1dir" in
9088 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9089 *) dflt=$sitehtml1dir ;;
9092 ''|' ') dflt=none ;;
9095 rp='Pathname where the site-specific html pages should be installed?'
9097 prefixvar=sitehtml1dir
9100 : determine where add-on library html pages go
9101 : There is no standard location, so try to copy the previously-selected
9102 : directory structure for the core html pages.
9103 case "$sitehtml3dir" in
9104 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9105 *) dflt=$sitehtml3dir ;;
9108 ''|' ') dflt=none ;;
9111 rp='Pathname where the site-specific library html pages should be installed?'
9113 prefixvar=sitehtml3dir
9116 : determine where add-on manual pages go
9117 case "$siteman1dir" in
9118 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9119 *) dflt=$siteman1dir ;;
9122 ''|' ') dflt=none ;;
9125 rp='Pathname where the site-specific manual pages should be installed?'
9127 prefixvar=siteman1dir
9130 : determine where add-on library man pages go
9131 case "$siteman3dir" in
9132 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9133 *) dflt=$siteman3dir ;;
9136 ''|' ') dflt=none ;;
9139 rp='Pathname where the site-specific library manual pages should be installed?'
9141 prefixvar=siteman3dir
9144 : determine where add-on public executable scripts go
9145 case "$sitescript" in
9146 '') dflt=$siteprefix/script
9147 $test -d $dflt || dflt=$sitebin ;;
9148 *) dflt="$sitescript" ;;
9151 rp='Pathname where add-on public executable scripts should be installed?'
9153 prefixvar=sitescript
9156 : Check if faststdio is requested and available
9157 case "$usefaststdio" in
9158 $define|true|[yY]*|'')
9159 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9169 Perl can be built to use 'fast stdio', which means using the stdio
9170 library but also directly manipulating the stdio buffers to enable
9171 faster I/O. Using stdio is better for backward compatibility (especially
9172 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9173 interface has been preferred instead of stdio.
9175 If this doesn't make any sense to you, just accept the default '$dflt'.
9177 rp='Use the "fast stdio" if available?'
9180 y|Y) val="$define" ;;
9187 : define an is-a-typedef? function
9188 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9190 "") inclist="sys/types.h";;
9192 eval "varval=\$$var";
9196 for inc in $inclist; do
9197 echo "#include <$inc>" >>temp.c;
9199 echo "#ifdef $type" >> temp.c;
9200 echo "printf(\"We have $type\");" >> temp.c;
9201 echo "#endif" >> temp.c;
9202 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9203 if $contains $type temp.E >/dev/null 2>&1; then
9209 *) eval "$var=\$varval";;
9212 : define an is-a-typedef? function that prompts if the type is not available.
9213 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9215 "") inclist="sys/types.h";;
9217 eval "varval=\$$var";
9221 for inc in $inclist; do
9222 echo "#include <$inc>" >>temp.c;
9224 echo "#ifdef $type" >> temp.c;
9225 echo "printf(\"We have $type\");" >> temp.c;
9226 echo "#endif" >> temp.c;
9227 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9229 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9230 if $contains $type temp.E >/dev/null 2>&1; then
9231 echo "$type found." >&4;
9234 echo "$type NOT found." >&4;
9240 *) eval "$var=\$varval";;
9243 : see what type lseek is declared as in the kernel
9244 rp="What is the type used for lseek's offset on this system?"
9245 set off_t lseektype long stdio.h sys/types.h
9249 echo "Checking to see how big your file offsets are..." >&4
9251 #include <sys/types.h>
9255 printf("%d\n", (int)sizeof($lseektype));
9260 if eval $compile_ok; then
9261 lseeksize=`$run ./try`
9262 echo "Your file offsets are $lseeksize bytes long."
9266 echo "(I can't seem to compile the test program. Guessing...)"
9267 rp="What is the size of your file offsets (in bytes)?"
9273 : see what type file positions are declared as in the library
9274 rp="What is the type for file position used by fsetpos()?"
9275 set fpos_t fpostype long stdio.h sys/types.h
9278 : Check size for Fpos_t
9281 *_t) zzz="$fpostype" ;;
9284 echo "Checking the size of $zzz..." >&4
9286 #include <sys/types.h>
9293 printf("%d\n", (int)sizeof($fpostype));
9298 if eval $compile_ok; then
9302 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9305 echo "Your $zzz is $fpossize bytes long."
9311 echo "(I can't compile the test program. Guessing...)" >&4
9312 rp="What is the size of your file positions (in bytes)?"
9317 : Check for large file support
9318 # Backward compatibility (uselfs is deprecated).
9320 "$define"|true|[yY]*)
9323 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9325 uselargefiles="$define"
9329 case "$lseeksize:$fpossize" in
9332 You can have files larger than 2 gigabytes.
9335 *) case "$uselargefiles" in
9336 "$undef"|false|[nN]*) dflt='n' ;;
9341 Perl can be built to understand large files (files larger than 2 gigabytes)
9342 on some systems. To do so, Configure can be run with -Duselargefiles.
9344 If this doesn't make any sense to you, just accept the default '$dflt'.
9346 rp='Try to understand large files, if available?'
9349 y|Y) val="$define" ;;
9356 : Look for a hint-file generated 'call-back-unit'. If the
9357 : user has specified that a large files perl is to be built,
9358 : we may need to set or change some other defaults.
9359 if $test -f uselargefiles.cbu; then
9360 echo "Your platform has some specific hints regarding large file builds, using them..."
9361 . ./uselargefiles.cbu
9363 case "$uselargefiles" in
9365 if $test -f uselargefiles.cbu; then
9367 echo "Rechecking to see how big your file offsets are..." >&4
9369 #include <sys/types.h>
9373 printf("%d\n", (int)sizeof($lseektype));
9378 if eval $compile_ok; then
9379 lseeksize=`$run ./try`
9380 $echo "Your file offsets are now $lseeksize bytes long."
9384 echo "(I can't seem to compile the test program. Guessing...)"
9385 rp="What is the size of your file offsets (in bytes)?"
9390 *_t) zzz="$fpostype" ;;
9393 $echo $n "Rechecking the size of $zzz...$c" >&4
9395 #include <sys/types.h>
9402 printf("%d\n", (int)sizeof($fpostype));
9407 if eval $compile_ok; then
9412 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9415 echo " $fpossize bytes." >&4
9421 echo "(I can't compile the test program. Guessing...)" >&4
9422 rp="What is the size of your file positions (in bytes)?"
9431 : Check if we want perlio
9434 : Set the vendorbin variables
9435 case "$vendorprefix" in
9436 '') d_vendorbin="$undef"
9440 *) d_vendorbin="$define"
9441 : determine where vendor-supplied executables go.
9442 case "$vendorbin" in
9443 '') dflt=$vendorprefix/bin ;;
9444 *) dflt="$vendorbin" ;;
9447 rp='Pathname for the vendor-supplied executables directory?'
9450 vendorbinexp="$ansexp"
9456 : Set the vendorhtml1dir variables
9457 case "$vendorprefix" in
9458 '') vendorhtml1dir=''
9459 vendorhtml1direxp=''
9461 *) : determine where vendor-supplied html pages go.
9462 : There is no standard location, so try to copy the previously-selected
9463 : directory structure for the core html pages.
9464 : XXX Better default suggestions would be welcome.
9465 case "$vendorhtml1dir" in
9466 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9467 *) dflt=$vendorhtml1dir ;;
9470 ''|' ') dflt=none ;;
9473 rp='Pathname for the vendor-supplied html pages?'
9475 vendorhtml1dir="$ans"
9476 vendorhtml1direxp="$ansexp"
9479 : Use ' ' for none so value is preserved next time through Configure
9480 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9481 prefixvar=vendorhtml1dir
9484 : Set the vendorhtml3dir variables
9485 case "$vendorprefix" in
9486 '') vendorhtml3dir=''
9487 vendorhtml3direxp=''
9489 *) : determine where vendor-supplied module html pages go.
9490 : There is no standard location, so try to copy the previously-selected
9491 : directory structure for the core html pages.
9492 : XXX Better default suggestions would be welcome.
9493 case "$vendorhtml3dir" in
9494 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9495 *) dflt=$vendorhtml3dir ;;
9498 ''|' ') dflt=none ;;
9501 rp='Pathname for the vendor-supplied html pages?'
9503 vendorhtml3dir="$ans"
9504 vendorhtml3direxp="$ansexp"
9507 : Use ' ' for none so value is preserved next time through Configure
9508 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9509 prefixvar=vendorhtml3dir
9512 : Set the vendorman1dir variables
9513 case "$vendorprefix" in
9514 '') vendorman1dir=''
9517 *) : determine where vendor-supplied manual pages go.
9518 case "$vendorman1dir" in
9519 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9520 *) dflt=$vendorman1dir ;;
9523 ''|' ') dflt=none ;;
9526 rp='Pathname for the vendor-supplied manual section 1 pages?'
9528 vendorman1dir="$ans"
9529 vendorman1direxp="$ansexp"
9532 : Use ' ' for none so value is preserved next time through Configure
9533 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9534 prefixvar=vendorman1dir
9537 : Set the vendorman3dir variables
9538 case "$vendorprefix" in
9539 '') vendorman3dir=''
9542 *) : determine where vendor-supplied module manual pages go.
9543 case "$vendorman3dir" in
9544 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9545 *) dflt=$vendorman3dir ;;
9548 ''|' ') dflt=none ;;
9551 rp='Pathname for the vendor-supplied manual section 3 pages?'
9553 vendorman3dir="$ans"
9554 vendorman3direxp="$ansexp"
9557 : Use ' ' for none so value is preserved next time through Configure
9558 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9559 prefixvar=vendorman3dir
9562 : Set the vendorscript variables
9563 case "$vendorprefix" in
9564 '') d_vendorscript="$undef"
9568 *) d_vendorscript="$define"
9569 : determine where vendor-supplied scripts go.
9570 case "$vendorscript" in
9571 '') dflt=$vendorprefix/script
9572 $test -d $dflt || dflt=$vendorbin ;;
9573 *) dflt="$vendorscript" ;;
9577 The installation process will create a directory for
9578 vendor-supplied scripts.
9582 rp='Pathname for the vendor-supplied scripts directory?'
9585 vendorscriptexp="$ansexp"
9588 prefixvar=vendorscript
9591 : script used to emit important warnings
9594 if test \$# -gt 0; then
9599 echo "*** WARNING:" >&4
9600 sed -e 's/^/*** /' <msg >&4
9602 cat msg >>config.msg
9603 echo " " >>config.msg
9609 : see which of string.h or strings.h is needed
9611 strings=`./findhdr string.h`
9612 if $test "$strings" && $test -r "$strings"; then
9613 echo "Using <string.h> instead of <strings.h>." >&4
9617 strings=`./findhdr strings.h`
9618 if $test "$strings" && $test -r "$strings"; then
9619 echo "Using <strings.h> instead of <string.h>." >&4
9621 ./warn "No string header found -- You'll surely have problems."
9627 "$undef") strings=`./findhdr strings.h`;;
9628 *) strings=`./findhdr string.h`;;
9631 : see if qgcvt exists
9635 : Check print/scan long double stuff
9638 if $test X"$d_longdbl" = X"$define"; then
9640 echo "Checking how to print long doubles..." >&4
9642 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9643 $cat >try.c <<'EOCP'
9644 #include <sys/types.h>
9648 printf("%.3f\n", d);
9652 if eval $compile; then
9656 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9657 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9658 echo "We will use %f."
9664 if $test X"$sPRIfldbl" = X; then
9665 $cat >try.c <<'EOCP'
9666 #include <sys/types.h>
9669 long double d = 123.456;
9670 printf("%.3Lf\n", d);
9674 if eval $compile; then
9678 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9679 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9680 echo "We will use %Lf."
9686 if $test X"$sPRIfldbl" = X; then
9687 $cat >try.c <<'EOCP'
9688 #include <sys/types.h>
9691 long double d = 123.456;
9692 printf("%.3llf\n", d);
9696 if eval $compile; then
9700 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9701 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9702 echo "We will use %llf."
9708 if $test X"$sPRIfldbl" = X; then
9709 $cat >try.c <<'EOCP'
9710 #include <sys/types.h>
9713 long double d = 123.456;
9714 printf("%.3lf\n", d);
9718 if eval $compile; then
9722 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9723 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9724 echo "We will use %lf."
9730 if $test X"$sPRIfldbl" = X; then
9731 echo "Cannot figure out how to print long doubles." >&4
9733 sSCNfldbl=$sPRIfldbl # expect consistency
9740 case "$sPRIfldbl" in
9741 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9742 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9743 d_SCNfldbl="$undef";
9745 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9746 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9747 d_SCNfldbl="$define";
9751 : Check how to convert floats to strings.
9753 if test "X$d_Gconvert" = X; then
9756 echo "Checking for an efficient way to convert floats to strings."
9758 case "$uselongdouble" in
9759 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9761 case "$d_longdbl" in
9762 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9764 case "$d_PRIgldbl" in
9765 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9769 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9770 char *myname = "gconvert";
9773 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9774 char *myname = "gcvt";
9777 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9778 char *myname = "qgcvt";
9779 #define DOUBLETYPE long double
9782 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9784 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9786 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9789 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9791 char *myname = "sprintf";
9795 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9796 #define DOUBLETYPE long double
9798 #define DOUBLETYPE double
9810 # include <string.h>
9812 # include <strings.h>
9815 int checkit(char *expect, char *got)
9817 if (strcmp(expect, got)) {
9818 printf("%s oddity: Expected %s, got %s\n",
9819 myname, expect, got);
9829 /* This must be 1st test on (which?) platform */
9830 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9831 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9832 checkit("0.1", buf);
9834 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9835 checkit("0.01", buf);
9837 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9838 checkit("0.001", buf);
9840 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9841 checkit("0.0001", buf);
9843 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9844 if (strlen(buf) > 5)
9845 checkit("9e-005", buf); /* for Microsoft ?? */
9847 checkit("9e-05", buf);
9849 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9852 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9853 checkit("1.1", buf);
9855 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9856 checkit("1.01", buf);
9858 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9859 checkit("1.001", buf);
9861 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9862 checkit("1.0001", buf);
9864 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9865 checkit("1.00001", buf);
9867 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9868 checkit("1.000001", buf);
9870 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9873 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9876 /* Some Linux gcvt's give 1.e+5 here. */
9877 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9878 checkit("100000", buf);
9880 /* Some Linux gcvt's give -1.e+5 here. */
9881 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9882 checkit("-100000", buf);
9884 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9885 checkit("123.456", buf);
9887 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9888 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9889 /* 34 should be enough to scare even long double
9890 * places into using the e notation. */
9891 if (strlen(buf) > 5)
9892 checkit("1e+034", buf); /* for Microsoft */
9894 checkit("1e+34", buf);
9896 /* For Perl, if you add additional tests here, also add them to
9897 * t/base/num.t for benefit of platforms not using Configure or
9898 * overriding d_Gconvert */
9903 : first add preferred functions to our list
9905 for xxx_convert in $gconvert_preference; do
9906 case $xxx_convert in
9907 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9908 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9911 : then add any others
9912 for xxx_convert in gconvert gcvt sprintf; do
9915 *) xxx_list="$xxx_list $xxx_convert" ;;
9919 case "$d_longdbl$uselongdouble" in
9921 : again, add preferred functions to our list first
9923 for xxx_convert in $gconvert_ld_preference; do
9924 case $xxx_convert in
9925 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9926 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9929 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9930 for xxx_convert in qgcvt sprintf $xxx_list; do
9931 case "$xxx_ld_list" in
9932 $xxx_convert*|*" $xxx_convert"*) ;;
9933 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9936 : if sprintf cannot do long doubles, move it to the end
9937 if test "$d_PRIgldbl" != "$define"; then
9938 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9940 : if no qgcvt, remove it
9941 if test "$d_qgcvt" != "$define"; then
9942 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9945 xxx_list="$xxx_ld_list"
9949 for xxx_convert in $xxx_list; do
9950 echo "Trying $xxx_convert..."
9951 $rm -f try try$_o core
9952 set try -DTRY_$xxx_convert
9953 if eval $compile; then
9954 echo "$xxx_convert() found." >&4
9956 echo "I'll use $xxx_convert to convert floats into a string." >&4
9959 echo "...But $xxx_convert didn't work as I expected."
9963 echo "$xxx_convert NOT found." >&4
9967 if test X$xxx_convert = X; then
9968 echo "*** WHOA THERE!!! ***" >&4
9969 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9973 case "$xxx_convert" in
9974 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9975 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9976 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9977 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9978 "$define$define$define")
9979 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9980 "$define$define$undef")
9981 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9982 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9990 : see if _fwalk exists
9994 : Initialize h_fcntl
9997 : Initialize h_sysfile
10000 : access call always available on UNIX
10001 set access d_access
10004 : locate the flags for 'access()'
10005 case "$d_access" in
10008 $cat >access.c <<EOCP
10009 #include <sys/types.h>
10014 #include <sys/file.h>
10017 #include <unistd.h>
10019 #$i_stdlib I_STDLIB
10021 #include <stdlib.h>
10027 : check sys/file.h first, no particular reason here
10028 if $test `./findhdr sys/file.h` && \
10029 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10031 echo "<sys/file.h> defines the *_OK access constants." >&4
10032 elif $test `./findhdr fcntl.h` && \
10033 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10035 echo "<fcntl.h> defines the *_OK access constants." >&4
10036 elif $test `./findhdr unistd.h` && \
10037 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10038 echo "<unistd.h> defines the *_OK access constants." >&4
10040 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10046 : see if accessx exists
10047 set accessx d_accessx
10050 : see if aintl exists
10054 : see if alarm exists
10058 : see if 64bit time functions exists
10060 set ctime64 d_ctime64
10063 set localtime64 d_localtime64
10066 set gmtime64 d_gmtime64
10069 set mktime64 d_mktime64
10072 set difftime64 d_difftime64
10075 set asctime64 d_asctime64
10078 : see if POSIX threads are available
10079 set pthread.h i_pthread
10082 : define a function to check prototypes
10083 $cat > protochk <<EOSH
10086 optimize="$optimize"
10088 prototype="$prototype"
10091 usethreads=$usethreads
10092 i_pthread=$i_pthread
10093 pthread_h_first=$pthread_h_first
10096 $cat >> protochk <<'EOSH'
10101 while test $# -ge 2; do
10103 $define) echo "#include <$2>" >> try.c ;;
10104 literal) echo "$2" >> try.c ;;
10106 # Extra magic for the benefit of systems that need pthread.h
10107 # to be included early to correctly detect threadsafe functions.
10108 # Such functions must guarantee themselves, though, that the usethreads
10109 # and i_pthread have been defined, before calling protochk.
10110 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10111 echo "#include <pthread.h>" >> try.c
10116 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10117 cat >> try.c <<'EOCP'
10118 #ifdef CAN_PROTOTYPE
10119 #define _(args) args
10124 echo "$foo" >> try.c
10125 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10126 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10132 $eunicefix protochk
10134 : Define hasproto macro for Configure internal use
10135 hasproto='varname=$1; func=$2; shift; shift;
10136 while $test $# -ge 2; do
10138 $define) echo "#include <$2>";;
10142 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10143 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10144 echo "$func() prototype found.";
10147 echo "$func() prototype NOT found.";
10154 : see if sys/types.h has to be included
10155 set sys/types.h i_systypes
10158 : see if sys/select.h has to be included
10159 set sys/select.h i_sysselct
10162 : Define hasfield macro for Configure internal use
10163 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10164 while $test $# -ge 2; do
10166 $define) echo "#include <$2>";;
10170 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10172 if eval $compile; then
10181 : see if we should include time.h, sys/time.h, or both
10183 if test "X$timeincl" = X; then
10184 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10185 $echo $n "I'm now running the test program...$c"
10187 #include <sys/types.h>
10192 #ifdef SYSTIMEKERNEL
10195 #include <sys/time.h>
10198 #include <sys/select.h>
10200 #$i_stdlib I_STDLIB
10202 #include <stdlib.h>
10208 struct timeval bar;
10211 struct timezone tzp;
10213 if (foo.tm_sec == foo.tm_sec)
10216 if (bar.tv_sec == bar.tv_sec)
10223 for s_timezone in '-DS_TIMEZONE' ''; do
10225 for s_timeval in '-DS_TIMEVAL' ''; do
10226 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10227 for i_time in '' '-DI_TIME'; do
10228 for i_systime in '-DI_SYSTIME' ''; do
10231 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10232 if eval $compile; then
10233 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10237 $echo $n "Succeeded with $flags$c"
10249 *SYSTIMEKERNEL*) i_systimek="$define"
10250 timeincl=`./findhdr sys/time.h`
10251 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10252 *) i_systimek="$undef";;
10255 *I_TIME*) i_time="$define"
10256 timeincl=`./findhdr time.h`" $timeincl"
10257 echo "We'll include <time.h>." >&4;;
10258 *) i_time="$undef";;
10261 *I_SYSTIME*) i_systime="$define"
10262 timeincl=`./findhdr sys/time.h`" $timeincl"
10263 echo "We'll include <sys/time.h>." >&4;;
10264 *) i_systime="$undef";;
10268 : see if struct tm knows about tm_zone
10269 case "$i_systime$i_time" in
10272 echo "Checking to see if your struct tm has tm_zone field..." >&4
10273 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10281 case "$d_tm_tm_zone" in
10282 "$define") echo "Yes, it does." ;;
10283 *) echo "No, it doesn't." ;;
10285 : see if struct tm knows about tm_gmtoff
10286 case "$i_systime$i_time" in
10289 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10290 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10298 case "$d_tm_tm_gmtoff" in
10299 "$define") echo "Yes, it does." ;;
10300 *) echo "No, it doesn't." ;;
10303 : see if asctime_r exists
10304 set asctime_r d_asctime_r
10306 case "$d_asctime_r" in
10308 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10309 case "$d_asctime_r_proto:$usethreads" in
10310 ":define") d_asctime_r_proto=define
10311 set d_asctime_r_proto asctime_r $hdrs
10315 case "$d_asctime_r_proto" in
10317 case "$asctime_r_proto" in
10318 ''|0) try='char* asctime_r(const struct tm*, char*);'
10319 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10321 case "$asctime_r_proto" in
10322 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10323 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10325 case "$asctime_r_proto" in
10326 ''|0) try='int asctime_r(const struct tm*, char*);'
10327 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10329 case "$asctime_r_proto" in
10330 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10331 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10333 case "$asctime_r_proto" in
10334 ''|0) d_asctime_r=undef
10336 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10337 * ) case "$asctime_r_proto" in
10338 REENTRANT_PROTO*) ;;
10339 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10341 echo "Prototype: $try" ;;
10344 *) case "$usethreads" in
10345 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10352 *) asctime_r_proto=0
10356 : see if atolf exists
10360 : see if atoll exists
10364 : Look for GCC-style attribute format
10365 case "$d_attribute_format" in
10368 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10369 $cat >attrib.c <<'EOCP'
10371 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10373 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10374 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10375 echo "Your C compiler doesn't support __attribute__((format))."
10378 echo "Your C compiler supports __attribute__((format))."
10382 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10386 *) val="$d_attribute_format" ;;
10388 set d_attribute_format
10392 : Look for GCC-style attribute format with null format allowed
10393 case "$d_printf_format_null" in
10394 '') case "$d_attribute_format" in
10397 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10398 $cat >attrib.c <<EOCP
10400 #$i_stdlib I_STDLIB
10402 #include <stdlib.h>
10404 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10405 int null_printf (char* pat,...) { return (int)pat; }
10406 int main () { exit(null_printf(NULL)); }
10408 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10409 : run the executable in case it produces a run-time warning
10410 if $run ./attrib >>attrib.out 2>&1; then
10411 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10412 echo "Your C compiler doesn't allow __printf__ format to be null."
10415 echo "Your C compiler allows __printf__ format to be null."
10419 echo "Your C compiler executable failed with __printf__ format null."
10423 echo "Your C compiler fails with __printf__ format null."
10430 *) val="$d_printf_format_null" ;;
10432 set d_printf_format_null
10436 : Look for GCC-style attribute malloc
10437 case "$d_attribute_malloc" in
10440 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10441 $cat >attrib.c <<'EOCP'
10443 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10445 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10446 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10447 echo "Your C compiler doesn't support __attribute__((malloc))."
10450 echo "Your C compiler supports __attribute__((malloc))."
10454 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10458 *) val="$d_attribute_malloc" ;;
10460 set d_attribute_malloc
10464 : Look for GCC-style attribute nonnull
10465 case "$d_attribute_nonnull" in
10468 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10469 $cat >attrib.c <<'EOCP'
10471 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10473 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10474 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10475 echo "Your C compiler doesn't support __attribute__((nonnull))."
10478 echo "Your C compiler supports __attribute__((nonnull))."
10482 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10486 *) val="$d_attribute_nonnull" ;;
10488 set d_attribute_nonnull
10492 : Look for GCC-style attribute noreturn
10493 case "$d_attribute_noreturn" in
10496 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10497 $cat >attrib.c <<'EOCP'
10499 void fall_over_dead( void ) __attribute__((noreturn));
10501 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10502 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10503 echo "Your C compiler doesn't support __attribute__((noreturn))."
10506 echo "Your C compiler supports __attribute__((noreturn))."
10510 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10514 *) val="$d_attribute_noreturn" ;;
10516 set d_attribute_noreturn
10520 : Look for GCC-style attribute pure
10521 case "$d_attribute_pure" in
10524 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10525 $cat >attrib.c <<'EOCP'
10527 int square( int n ) __attribute__((pure));
10529 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10530 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10531 echo "Your C compiler doesn't support __attribute__((pure))."
10534 echo "Your C compiler supports __attribute__((pure))."
10538 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10542 *) val="$d_attribute_pure" ;;
10544 set d_attribute_pure
10548 : Look for GCC-style attribute unused
10549 case "$d_attribute_unused" in
10552 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10553 $cat >attrib.c <<'EOCP'
10555 int do_something( int dummy __attribute__((unused)), int n );
10557 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10558 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10559 echo "Your C compiler doesn't support __attribute__((unused))."
10562 echo "Your C compiler supports __attribute__((unused))."
10566 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10570 *) val="$d_attribute_unused" ;;
10572 set d_attribute_unused
10576 : Look for GCC-style attribute deprecated
10577 case "$d_attribute_deprecated" in
10580 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10581 $cat >attrib.c <<'EOCP'
10583 int I_am_deprecated(void) __attribute__((deprecated));
10585 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10586 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10587 echo "Your C compiler doesn't support __attribute__((deprecated))."
10590 echo "Your C compiler supports __attribute__((deprecated))."
10594 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10598 *) val="$d_attribute_deprecated" ;;
10600 set d_attribute_deprecated
10604 : Look for GCC-style attribute warn_unused_result
10605 case "$d_attribute_warn_unused_result" in
10608 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10609 $cat >attrib.c <<'EOCP'
10611 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10613 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10614 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10615 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10618 echo "Your C compiler supports __attribute__((warn_unused_result))."
10622 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10626 *) val="$d_attribute_warn_unused_result" ;;
10628 set d_attribute_warn_unused_result
10632 : see if bcmp exists
10636 : see if bcopy exists
10640 : see if getpgrp exists
10641 set getpgrp d_getpgrp
10644 case "$d_getpgrp" in
10647 echo "Checking to see which flavor of getpgrp is in use..."
10649 #$i_unistd I_UNISTD
10650 #include <sys/types.h>
10652 # include <unistd.h>
10654 #$i_stdlib I_STDLIB
10656 #include <stdlib.h>
10660 if (getuid() == 0) {
10661 printf("(I see you are running Configure as super-user...)\n");
10664 #ifdef TRY_BSD_PGRP
10665 if (getpgrp(1) == 0)
10674 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10675 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10677 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10678 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10681 echo "I can't seem to compile and run the test program."
10683 xxx="a USG one, i.e. you use getpgrp()."
10685 # SVR4 systems can appear rather BSD-ish.
10686 case "$i_unistd" in
10688 xxx="a BSD one, i.e. you use getpgrp(pid)."
10692 xxx="probably a USG one, i.e. you use getpgrp()."
10697 echo "Assuming your getpgrp is $xxx" >&4
10706 : see if setpgrp exists
10707 set setpgrp d_setpgrp
10710 case "$d_setpgrp" in
10713 echo "Checking to see which flavor of setpgrp is in use..."
10715 #$i_unistd I_UNISTD
10716 #include <sys/types.h>
10718 # include <unistd.h>
10720 #$i_stdlib I_STDLIB
10722 #include <stdlib.h>
10726 if (getuid() == 0) {
10727 printf("(I see you are running Configure as super-user...)\n");
10730 #ifdef TRY_BSD_PGRP
10731 if (-1 == setpgrp(1, 1))
10734 if (setpgrp() != -1)
10740 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10741 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10743 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10744 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10747 echo "(I can't seem to compile and run the test program.)"
10749 xxx="a USG one, i.e. you use setpgrp()."
10751 # SVR4 systems can appear rather BSD-ish.
10752 case "$i_unistd" in
10754 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10758 xxx="probably a USG one, i.e. you use setpgrp()."
10763 echo "Assuming your setpgrp is $xxx" >&4
10772 : Look for GCC-style __builtin_choose_expr
10773 case "$d_builtin_choose_expr" in
10776 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10777 $cat >try.c <<'EOCP'
10778 #include <assert.h>
10779 #include <stdlib.h>
10782 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10785 assert( SYRINX(1) == 2112 );
10786 assert( SYRINX(1) != 5150 );
10787 assert( SYRINX(0) == 5150 );
10788 assert( SYRINX(0) != 2112 );
10789 puts( "All good!" );
10795 if eval $compile && $run ./try; then
10796 echo "Your C compiler supports __builtin_choose_expr."
10799 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10803 *) val="$d_builtin_choose_expr" ;;
10806 set d_builtin_choose_expr
10810 : Look for GCC-style __builtin_expect
10811 case "$d_builtin_expect" in
10814 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10815 $cat >try.c <<'EOCP'
10818 if ( __builtin_expect(n, 0) ) n = 1;
10819 /* Remember shell exit code truth is 0, C truth is non-zero */
10824 if eval $compile && $run ./try; then
10825 echo "Your C compiler supports __builtin_expect."
10828 echo "Your C compiler doesn't seem to understand __builtin_expect."
10832 *) val="$d_builtin_expect" ;;
10835 set d_builtin_expect
10839 : see if bzero exists
10843 : see if stdarg is available
10845 if $test `./findhdr stdarg.h`; then
10846 echo "<stdarg.h> found." >&4
10849 echo "<stdarg.h> NOT found." >&4
10853 : see if varargs is available
10855 if $test `./findhdr varargs.h`; then
10856 echo "<varargs.h> found." >&4
10858 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10861 : set up the varargs testing programs
10862 $cat > varargs.c <<EOP
10864 #include <stdarg.h>
10867 #include <varargs.h>
10871 int f(char *p, ...)
10885 p = va_arg(ap, char *);
10891 $cat > varargs <<EOP
10893 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10902 : now check which varargs header should be included
10908 if `./varargs I_STDARG`; then
10910 elif `./varargs I_VARARGS`; then
10915 if `./varargs I_VARARGS`; then
10923 echo "*** WHOA THERE!!! ***" >&4
10924 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10925 case "$knowitall" in
10927 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10931 echo "I could not find the definition for va_dcl... You have problems..." >&4
10932 val="$undef"; set i_stdarg; eval $setvar
10933 val="$undef"; set i_varargs; eval $setvar
10938 case "$i_varhdr" in
10940 val="$define"; set i_stdarg; eval $setvar
10941 val="$undef"; set i_varargs; eval $setvar
10944 val="$undef"; set i_stdarg; eval $setvar
10945 val="$define"; set i_varargs; eval $setvar
10948 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10952 : see if the Compiler supports C99 variadic macros
10953 case "$i_stdarg$i_stdlib" in
10955 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10958 #include <stdarg.h>
10960 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10964 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10970 if eval $compile && $run ./try 2>&1 >/dev/null; then
10971 case "`$run ./try`" in
10973 echo "You have C99 variadic macros." >&4
10974 d_c99_variadic_macros="$define"
10977 echo "You don't have functional C99 variadic macros." >&4
10978 d_c99_variadic_macros="$undef"
10982 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10983 d_c99_variadic_macros="$undef"
10988 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10989 d_c99_variadic_macros="$undef"
10993 : see if signal is declared as pointer to function returning int or void
10995 xxx=`./findhdr signal.h`
10996 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10997 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10998 echo "You have int (*signal())() instead of void." >&4
11000 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11001 echo "You have void (*signal())()." >&4
11003 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11004 echo "You have int (*signal())() instead of void." >&4
11006 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11007 echo "You have void (*signal())()." >&4
11010 case "$d_voidsig" in
11012 echo "I can't determine whether signal handler returns void or int..." >&4
11014 rp="What type does your signal handler return?"
11017 v*) val="$define";;
11021 echo "As you already told me, signal handler returns void." >&4
11024 *) echo "As you already told me, signal handler returns int." >&4
11031 case "$d_voidsig" in
11032 "$define") signal_t="void";;
11033 *) signal_t="int";;
11037 : check for ability to cast large floats to 32-bit ints.
11039 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11040 if $test "$intsize" -ge 4; then
11047 #$i_stdlib I_STDLIB
11049 #include <stdlib.h>
11051 #include <sys/types.h>
11052 #include <signal.h>
11053 $signal_t blech(int s) { exit(3); }
11060 signal(SIGFPE, blech);
11062 /* Don't let compiler optimize the test away. Store the number
11063 in a writable string for gcc to pass to sscanf under HP-UX.
11065 sprintf(str, "2147483647");
11066 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11070 /* x86 processors will probably give 0x8000 0000, which is a
11071 sign change. We don't want that. We want to mimic SPARC
11072 behavior here, which is to preserve the sign and give
11075 if (i32 != ($xxx) f)
11081 if eval $compile_ok; then
11085 echo "(I can't seem to compile the test program--assuming it can't)"
11090 echo "Yup, it can."
11093 echo "Nope, it can't."
11100 : check for ability to cast negative floats to unsigned
11102 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11105 #$i_stdlib I_STDLIB
11107 #include <stdlib.h>
11109 #include <sys/types.h>
11110 #include <signal.h>
11111 $signal_t blech(int s) { exit(7); }
11112 $signal_t blech_in_list(int s) { exit(4); }
11113 unsigned long dummy_long(unsigned long p) { return p; }
11114 unsigned int dummy_int(unsigned int p) { return p; }
11115 unsigned short dummy_short(unsigned short p) { return p; }
11119 unsigned long along;
11121 unsigned short ashort;
11125 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11126 a direct f = -123. assignment. gcc-2.8.0 reportedly
11127 optimized the whole file away
11129 /* Store the number in a writable string for gcc to pass to
11130 sscanf under HP-UX.
11132 sprintf(str, "-123");
11133 sscanf(str, "%lf", &f); /* f = -123.; */
11135 signal(SIGFPE, blech);
11136 along = (unsigned long)f;
11137 aint = (unsigned int)f;
11138 ashort = (unsigned short)f;
11139 if (along != (unsigned long)-123)
11141 if (aint != (unsigned int)-123)
11143 if (ashort != (unsigned short)-123)
11145 sprintf(str, "1073741824.");
11146 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11149 along = (unsigned long)f;
11150 if (along != 0x80000000)
11154 along = (unsigned long)f;
11155 if (along != 0x7fffffff)
11159 along = (unsigned long)f;
11160 if (along != 0x80000001)
11164 signal(SIGFPE, blech_in_list);
11165 sprintf(str, "123.");
11166 sscanf(str, "%lf", &f); /* f = 123.; */
11167 along = dummy_long((unsigned long)f);
11168 aint = dummy_int((unsigned int)f);
11169 ashort = dummy_short((unsigned short)f);
11170 if (along != (unsigned long)123)
11172 if (aint != (unsigned int)123)
11174 if (ashort != (unsigned short)123)
11181 if eval $compile_ok; then
11185 echo "(I can't seem to compile the test program--assuming it can't)"
11188 case "$castflags" in
11190 echo "Yup, it can."
11193 echo "Nope, it can't."
11200 : see if vprintf exists
11202 if set vprintf val -f d_vprintf; eval $csym; $val; then
11203 echo 'vprintf() found.' >&4
11206 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11207 #$i_varargs I_VARARGS
11209 #$i_stdlib I_STDLIB
11210 #$i_unistd I_UNISTD
11213 # include <stdarg.h>
11214 #else /* I_VARARGS */
11215 # include <varargs.h>
11219 # include <unistd.h>
11223 # include <stdlib.h>
11226 #include <stdio.h> /* vsprintf prototype */
11229 void xxx(int n, ...)
11234 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11236 int main() { xxx(1, "foo"); }
11238 #else /* I_VARARGS */
11246 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11248 int main() { xxx("foo"); }
11254 if eval $compile_ok; then
11255 if $run ./try; then
11256 echo "Your vsprintf() returns (int)." >&4
11259 echo "Your vsprintf() returns (char*)." >&4
11263 echo 'I am unable to compile the vsprintf() test program.' >&4
11264 # We shouldn't get here. If we do, assume the standard signature,
11265 # not the old BSD one.
11266 echo 'Guessing that vsprintf() returns (int).' >&4
11270 echo 'vprintf() NOT found.' >&4
11281 : see if chown exists
11285 : see if chroot exists
11286 set chroot d_chroot
11289 : see if chsize exists
11290 set chsize d_chsize
11293 : see if class exists
11297 : see if clearenv exists
11298 set clearenv d_clearenv
11301 : Define hasstruct macro for Configure internal use
11302 hasstruct='varname=$1; struct=$2; shift; shift;
11303 while $test $# -ge 2; do
11305 $define) echo "#include <$2>";;
11309 echo "int main () { struct $struct foo; }" >> try.c;
11311 if eval $compile; then
11320 : see whether socket exists
11324 $echo $n "Hmm... $c" >&4
11325 if set socket val -f d_socket; eval $csym; $val; then
11326 echo "Looks like you have Berkeley networking support." >&4
11328 if set setsockopt val -f; eval $csym; $val; then
11331 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11332 d_oldsock="$define"
11335 if $contains socklib libc.list >/dev/null 2>&1; then
11336 echo "Looks like you have Berkeley networking support." >&4
11338 : we will have to assume that it supports the 4.2 BSD interface
11341 echo "You don't have Berkeley networking in libc$_a..." >&4
11342 if test "X$d_socket" = "X$define"; then
11343 echo "...but you seem to believe that you have sockets." >&4
11345 for net in net socket
11347 if test -f /usr/lib/lib$net$_a; then
11348 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11349 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11350 if $contains socket libc.list >/dev/null 2>&1; then
11355 echo "...but the Wollongong group seems to have hacked it in." >&4
11356 sockethdr="-I/usr/netinclude"
11359 echo "Found Berkeley sockets interface in lib$net." >&4
11360 if $contains setsockopt libc.list >/dev/null 2>&1; then
11363 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11364 d_oldsock="$define"
11370 if test "X$d_socket" != "X$define"; then
11371 echo "or anywhere else I see." >&4
11379 : see if socketpair exists
11380 set socketpair d_sockpair
11385 echo "Checking the availability sa_len in the sock struct ..." >&4
11387 #include <sys/types.h>
11388 #include <sys/socket.h>
11390 struct sockaddr sa;
11391 return (sa.sa_len);
11395 set try; if eval $compile; then
11398 set d_sockaddr_sa_len; eval $setvar
11402 echo "Checking the availability struct sockaddr_in6 ..." >&4
11404 #include <sys/types.h>
11405 #include <sys/socket.h>
11406 #include <netinet/in.h>
11408 struct sockaddr_in6 sin6;
11409 return (sin6.sin6_family);
11413 set try; if eval $compile; then
11416 set d_sockaddr_in6; eval $setvar
11420 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11422 #include <sys/types.h>
11423 #include <sys/socket.h>
11424 #include <netinet/in.h>
11426 struct sockaddr_in6 sin6;
11427 return (sin6.sin6_scope_id);
11431 set try; if eval $compile; then
11434 set d_sin6_scope_id; eval $setvar
11438 echo "Checking the availability struct ip_mreq ..." >&4
11440 #include <sys/types.h>
11441 #include <sys/socket.h>
11442 #include <netinet/in.h>
11444 struct ip_mreq mreq;
11445 return (mreq.imr_multiaddr.s_addr);
11449 set try; if eval $compile; then
11452 set d_ip_mreq; eval $setvar
11456 echo "Checking the availability struct ip_mreq_source ..." >&4
11458 #include <sys/types.h>
11459 #include <sys/socket.h>
11460 #include <netinet/in.h>
11462 struct ip_mreq_source mreq;
11463 return (mreq.imr_multiaddr.s_addr);
11467 set try; if eval $compile; then
11470 set d_ip_mreq_source; eval $setvar
11474 echo "Checking the availability struct ipv6_mreq ..." >&4
11476 #include <sys/types.h>
11477 #include <sys/socket.h>
11478 #include <netinet/in.h>
11480 struct ipv6_mreq mreq;
11481 return (mreq.ipv6mr_interface);
11485 set try; if eval $compile; then
11488 set d_ipv6_mreq; eval $setvar
11492 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11494 #include <sys/types.h>
11495 #include <sys/socket.h>
11496 #include <netinet/in.h>
11498 struct ipv6_mreq_source mreq;
11499 return (mreq.imr_multiaddr.s_addr);
11503 set try; if eval $compile; then
11506 set d_ipv6_mreq_source; eval $setvar
11510 echo "Checking the availability of certain socket constants..." >&4
11511 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11512 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11514 #include <sys/types.h>
11515 #include <sys/socket.h>
11521 set try; if eval $compile; then
11524 set d_${enum}; eval $setvar
11528 : see if this is a sys/uio.h system
11529 set sys/uio.h i_sysuio
11532 : Check for cmsghdr support
11534 echo "Checking to see if your system supports struct cmsghdr..." >&4
11535 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11537 case "$d_cmsghdr_s" in
11538 "$define") echo "Yes, it does." ;;
11539 *) echo "No, it doesn't." ;;
11543 : check for const keyword
11545 echo 'Checking to see if your C compiler knows about "const"...' >&4
11546 $cat >const.c <<'EOCP'
11547 typedef struct spug { int drokk; } spug;
11551 const spug y = { 0 };
11554 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11556 echo "Yup, it does."
11559 echo "Nope, it doesn't."
11564 : see if copysignl exists
11565 set copysignl d_copysignl
11568 : see if crypt exists
11573 $define) cryptlib='' ;;
11574 *) if set crypt val -f d_crypt; eval $csym; $val; then
11575 echo 'crypt() found.' >&4
11579 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11580 if $test -z "$cryptlib"; then
11581 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11585 if $test -z "$cryptlib"; then
11586 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11590 if $test -z "$cryptlib"; then
11591 cryptlib=`./loc libcrypt$_a "" $libpth`
11595 if $test -z "$cryptlib"; then
11596 echo 'crypt() NOT found.' >&4
11607 : see if this is a crypt.h system
11608 set crypt.h i_crypt
11611 : see if crypt_r exists
11612 set crypt_r d_crypt_r
11614 case "$d_crypt_r" in
11616 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11617 case "$d_crypt_r_proto:$usethreads" in
11618 ":define") d_crypt_r_proto=define
11619 set d_crypt_r_proto crypt_r $hdrs
11623 case "$d_crypt_r_proto" in
11625 case "$crypt_r_proto" in
11626 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11627 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11629 case "$crypt_r_proto" in
11630 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11631 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11633 case "$crypt_r_proto" in
11634 ''|0) d_crypt_r=undef
11636 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11637 * ) case "$crypt_r_proto" in
11638 REENTRANT_PROTO*) ;;
11639 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11641 echo "Prototype: $try" ;;
11644 *) case "$usethreads" in
11645 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11656 : get csh whereabouts
11658 'csh') val="$undef" ;;
11659 *) val="$define" ;;
11663 : Respect a hint or command line value for full_csh.
11664 case "$full_csh" in
11665 '') full_csh=$csh ;;
11668 : see if ctermid exists
11669 set ctermid d_ctermid
11672 : see if ctermid_r exists
11673 set ctermid_r d_ctermid_r
11675 case "$d_ctermid_r" in
11677 hdrs="$i_systypes sys/types.h define stdio.h "
11678 case "$d_ctermid_r_proto:$usethreads" in
11679 ":define") d_ctermid_r_proto=define
11680 set d_ctermid_r_proto ctermid_r $hdrs
11684 case "$d_ctermid_r_proto" in
11686 case "$ctermid_r_proto" in
11687 ''|0) try='char* ctermid_r(char*);'
11688 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11690 case "$ctermid_r_proto" in
11691 ''|0) d_ctermid_r=undef
11693 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11694 * ) case "$ctermid_r_proto" in
11695 REENTRANT_PROTO*) ;;
11696 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11698 echo "Prototype: $try" ;;
11701 *) case "$usethreads" in
11702 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11709 *) ctermid_r_proto=0
11713 : see if ctime_r exists
11714 set ctime_r d_ctime_r
11716 case "$d_ctime_r" in
11718 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11719 case "$d_ctime_r_proto:$usethreads" in
11720 ":define") d_ctime_r_proto=define
11721 set d_ctime_r_proto ctime_r $hdrs
11725 case "$d_ctime_r_proto" in
11727 case "$ctime_r_proto" in
11728 ''|0) try='char* ctime_r(const time_t*, char*);'
11729 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11731 case "$ctime_r_proto" in
11732 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11733 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11735 case "$ctime_r_proto" in
11736 ''|0) try='int ctime_r(const time_t*, char*);'
11737 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11739 case "$ctime_r_proto" in
11740 ''|0) try='int ctime_r(const time_t*, char*, int);'
11741 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11743 case "$ctime_r_proto" in
11744 ''|0) d_ctime_r=undef
11746 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11747 * ) case "$ctime_r_proto" in
11748 REENTRANT_PROTO*) ;;
11749 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11751 echo "Prototype: $try" ;;
11754 *) case "$usethreads" in
11755 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11766 : see if cuserid exists
11767 set cuserid d_cuserid
11770 : see if this is a limits.h system
11771 set limits.h i_limits
11774 : see if this is a float.h system
11775 set float.h i_float
11778 : See if number of significant digits in a double precision number is known
11780 $cat >dbl_dig.c <<EOM
11781 #$i_limits I_LIMITS
11784 #include <limits.h>
11790 printf("Contains DBL_DIG");
11793 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11794 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11795 echo "DBL_DIG found." >&4
11798 echo "DBL_DIG NOT found." >&4
11805 : see if dbm.h is available
11806 : see if dbmclose exists
11807 set dbmclose d_dbmclose
11810 case "$d_dbmclose" in
11820 *) set rpcsvc/dbm.h i_rpcsvcdbm
11825 *) echo "We won't be including <dbm.h>"
11835 : see if prototype for dbminit is available
11837 set d_dbminitproto dbminit $i_dbm dbm.h
11840 : see if difftime exists
11841 set difftime d_difftime
11844 : see if this is a dirent system
11846 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11848 echo "<dirent.h> found." >&4
11851 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11852 echo "<sys/dir.h> found." >&4
11855 xinc=`./findhdr sys/ndir.h`
11857 echo "<dirent.h> NOT found." >&4
11862 : Look for type of directory structure.
11864 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11866 case "$direntrytype" in
11868 case "$i_dirent" in
11869 $define) guess1='struct dirent' ;;
11870 *) guess1='struct direct' ;;
11873 *) guess1="$direntrytype"
11878 'struct dirent') guess2='struct direct' ;;
11879 *) guess2='struct dirent' ;;
11882 if $contains "$guess1" try.c >/dev/null 2>&1; then
11883 direntrytype="$guess1"
11884 echo "Your directory entries are $direntrytype." >&4
11885 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11886 direntrytype="$guess2"
11887 echo "Your directory entries seem to be $direntrytype." >&4
11889 echo "I don't recognize your system's directory entries." >&4
11890 rp="What type is used for directory entries on this system?"
11893 direntrytype="$ans"
11897 : see if the directory entry stores field length
11899 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11900 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11901 echo "Good, your directory entry keeps length information in d_namlen." >&4
11904 echo "Your directory entry does not know about the d_namlen field." >&4
11911 : Look for DIR.dd_fd
11912 case "$i_dirent" in
11914 echo "Checking to see if DIR has a dd_fd member variable" >&4
11916 #$i_stdlib I_STDLIB
11918 #include <stdlib.h>
11920 #include <dirent.h>
11930 if eval $compile; then
11931 echo "Yes, it does."
11934 echo "No, it does not."
11939 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11947 : see if this is an sysdir system
11948 set sys/dir.h i_sysdir
11951 : see if this is an sysndir system
11952 set sys/ndir.h i_sysndir
11957 $cat >dirfd.c <<EOM
11959 #$i_stdlib I_STDLIB
11961 #include <stdlib.h>
11963 #$i_dirent I_DIRENT /**/
11964 #$i_sysdir I_SYS_DIR /**/
11965 #$i_sysndir I_SYS_NDIR /**/
11966 #$i_systypes I_SYS_TYPES /**/
11967 #if defined(I_SYS_TYPES)
11968 #include <sys/types.h>
11970 #if defined(I_DIRENT)
11971 #include <dirent.h>
11972 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11973 #include <sys/dir.h>
11977 #include <sys/ndir.h>
11981 #include <ndir.h> /* may be wrong in the future */
11983 #include <sys/dir.h>
11989 DIR *dirp = opendir(".");
11990 if (dirfd(dirp) >= 0)
11998 if eval $compile; then
12002 $define) echo "dirfd() found." >&4 ;;
12003 *) echo "dirfd() NOT found." >&4 ;;
12009 : see if dlerror exists
12012 set dlerror d_dlerror
12016 : see if dlfcn is available
12017 set dlfcn.h i_dlfcn
12020 : Check what extension to use for shared libs
12025 On a few systems, the dynamically loaded modules that perl generates and uses
12026 will need a different extension than shared libs. The default will probably
12032 *) dflt="$dlext" ;;
12034 rp='What is the extension of dynamically loaded modules'
12043 : Check if dlsym need a leading underscore
12049 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12050 $cat >dyna.c <<'EOM'
12057 #$i_stdlib I_STDLIB
12059 #include <stdlib.h>
12063 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12065 #include <sys/types.h>
12070 extern int fred() ;
12079 int mode = RTLD_LAZY ;
12081 handle = dlopen("./dyna.$dlext", mode) ;
12082 if (handle == NULL) {
12087 symbol = dlsym(handle, "fred") ;
12088 if (symbol == NULL) {
12089 /* try putting a leading underscore */
12090 symbol = dlsym(handle, "_fred") ;
12091 if (symbol == NULL) {
12104 : Call the object file tmp-dyna.o in case dlext=o.
12105 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12106 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12107 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12108 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12111 1) echo "Test program failed using dlopen." >&4
12112 echo "Perhaps you should not use dynamic loading." >&4;;
12113 2) echo "Test program failed using dlsym." >&4
12114 echo "Perhaps you should not use dynamic loading." >&4;;
12115 3) echo "dlsym needs a leading underscore" >&4
12117 4) echo "dlsym doesn't need a leading underscore." >&4;;
12120 echo "I can't compile and run the test program." >&4
12121 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12126 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12131 : see if drand48_r exists
12132 set drand48_r d_drand48_r
12134 case "$d_drand48_r" in
12136 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12137 case "$d_drand48_r_proto:$usethreads" in
12138 ":define") d_drand48_r_proto=define
12139 set d_drand48_r_proto drand48_r $hdrs
12143 case "$d_drand48_r_proto" in
12145 case "$drand48_r_proto" in
12146 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12147 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12149 case "$drand48_r_proto" in
12150 ''|0) d_drand48_r=undef
12152 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12153 * ) case "$drand48_r_proto" in
12154 REENTRANT_PROTO*) ;;
12155 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12157 echo "Prototype: $try" ;;
12160 *) case "$usethreads" in
12161 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12168 *) drand48_r_proto=0
12172 : see if prototype for drand48 is available
12174 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12177 : see if dup2 exists
12181 : see if eaccess exists
12182 set eaccess d_eaccess
12185 : see if endgrent exists
12186 set endgrent d_endgrent
12189 : see if this is an grp system
12195 xxx=`./findhdr grp.h`
12196 $cppstdin $cppflags $cppminus < $xxx >$$.h
12198 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12210 set d_grpasswd; eval $setvar
12214 : see if endgrent_r exists
12215 set endgrent_r d_endgrent_r
12217 case "$d_endgrent_r" in
12219 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12220 case "$d_endgrent_r_proto:$usethreads" in
12221 ":define") d_endgrent_r_proto=define
12222 set d_endgrent_r_proto endgrent_r $hdrs
12226 case "$d_endgrent_r_proto" in
12228 case "$endgrent_r_proto" in
12229 ''|0) try='int endgrent_r(FILE**);'
12230 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12232 case "$endgrent_r_proto" in
12233 ''|0) try='void endgrent_r(FILE**);'
12234 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12236 case "$endgrent_r_proto" in
12237 ''|0) d_endgrent_r=undef
12239 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12240 * ) case "$endgrent_r_proto" in
12241 REENTRANT_PROTO*) ;;
12242 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12244 echo "Prototype: $try" ;;
12247 *) case "$usethreads" in
12248 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12255 *) endgrent_r_proto=0
12259 : see if endhostent exists
12260 set endhostent d_endhent
12263 : see if this is a netdb.h system
12264 set netdb.h i_netdb
12267 : see if endhostent_r exists
12268 set endhostent_r d_endhostent_r
12270 case "$d_endhostent_r" in
12272 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12273 case "$d_endhostent_r_proto:$usethreads" in
12274 ":define") d_endhostent_r_proto=define
12275 set d_endhostent_r_proto endhostent_r $hdrs
12279 case "$d_endhostent_r_proto" in
12281 case "$endhostent_r_proto" in
12282 ''|0) try='int endhostent_r(struct hostent_data*);'
12283 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12285 case "$endhostent_r_proto" in
12286 ''|0) try='void endhostent_r(struct hostent_data*);'
12287 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12289 case "$endhostent_r_proto" in
12290 ''|0) d_endhostent_r=undef
12291 endhostent_r_proto=0
12292 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12293 * ) case "$endhostent_r_proto" in
12294 REENTRANT_PROTO*) ;;
12295 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12297 echo "Prototype: $try" ;;
12300 *) case "$usethreads" in
12301 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12303 d_endhostent_r=undef
12304 endhostent_r_proto=0
12308 *) endhostent_r_proto=0
12312 : see if endnetent exists
12313 set endnetent d_endnent
12316 : see if endnetent_r exists
12317 set endnetent_r d_endnetent_r
12319 case "$d_endnetent_r" in
12321 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12322 case "$d_endnetent_r_proto:$usethreads" in
12323 ":define") d_endnetent_r_proto=define
12324 set d_endnetent_r_proto endnetent_r $hdrs
12328 case "$d_endnetent_r_proto" in
12330 case "$endnetent_r_proto" in
12331 ''|0) try='int endnetent_r(struct netent_data*);'
12332 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12334 case "$endnetent_r_proto" in
12335 ''|0) try='void endnetent_r(struct netent_data*);'
12336 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12338 case "$endnetent_r_proto" in
12339 ''|0) d_endnetent_r=undef
12340 endnetent_r_proto=0
12341 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12342 * ) case "$endnetent_r_proto" in
12343 REENTRANT_PROTO*) ;;
12344 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12346 echo "Prototype: $try" ;;
12349 *) case "$usethreads" in
12350 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12352 d_endnetent_r=undef
12353 endnetent_r_proto=0
12357 *) endnetent_r_proto=0
12361 : see if endprotoent exists
12362 set endprotoent d_endpent
12365 : see if endprotoent_r exists
12366 set endprotoent_r d_endprotoent_r
12368 case "$d_endprotoent_r" in
12370 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12371 case "$d_endprotoent_r_proto:$usethreads" in
12372 ":define") d_endprotoent_r_proto=define
12373 set d_endprotoent_r_proto endprotoent_r $hdrs
12377 case "$d_endprotoent_r_proto" in
12379 case "$endprotoent_r_proto" in
12380 ''|0) try='int endprotoent_r(struct protoent_data*);'
12381 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12383 case "$endprotoent_r_proto" in
12384 ''|0) try='void endprotoent_r(struct protoent_data*);'
12385 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12387 case "$endprotoent_r_proto" in
12388 ''|0) d_endprotoent_r=undef
12389 endprotoent_r_proto=0
12390 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12391 * ) case "$endprotoent_r_proto" in
12392 REENTRANT_PROTO*) ;;
12393 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12395 echo "Prototype: $try" ;;
12398 *) case "$usethreads" in
12399 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12401 d_endprotoent_r=undef
12402 endprotoent_r_proto=0
12406 *) endprotoent_r_proto=0
12410 : see if endpwent exists
12411 set endpwent d_endpwent
12414 : see if this is a pwd.h system
12420 xxx=`./findhdr pwd.h`
12421 $cppstdin $cppflags $cppminus < $xxx >$$.h
12423 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12431 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12439 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12447 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12455 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12463 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12471 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12479 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12491 set d_pwquota; eval $setvar
12492 set d_pwage; eval $setvar
12493 set d_pwchange; eval $setvar
12494 set d_pwclass; eval $setvar
12495 set d_pwexpire; eval $setvar
12496 set d_pwcomment; eval $setvar
12497 set d_pwgecos; eval $setvar
12498 set d_pwpasswd; eval $setvar
12502 : see if endpwent_r exists
12503 set endpwent_r d_endpwent_r
12505 case "$d_endpwent_r" in
12507 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12508 case "$d_endpwent_r_proto:$usethreads" in
12509 ":define") d_endpwent_r_proto=define
12510 set d_endpwent_r_proto endpwent_r $hdrs
12514 case "$d_endpwent_r_proto" in
12516 case "$endpwent_r_proto" in
12517 ''|0) try='int endpwent_r(FILE**);'
12518 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12520 case "$endpwent_r_proto" in
12521 ''|0) try='void endpwent_r(FILE**);'
12522 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12524 case "$endpwent_r_proto" in
12525 ''|0) d_endpwent_r=undef
12527 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12528 * ) case "$endpwent_r_proto" in
12529 REENTRANT_PROTO*) ;;
12530 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12532 echo "Prototype: $try" ;;
12535 *) case "$usethreads" in
12536 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12543 *) endpwent_r_proto=0
12547 : see if endservent exists
12548 set endservent d_endsent
12551 : see if endservent_r exists
12552 set endservent_r d_endservent_r
12554 case "$d_endservent_r" in
12556 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12557 case "$d_endservent_r_proto:$usethreads" in
12558 ":define") d_endservent_r_proto=define
12559 set d_endservent_r_proto endservent_r $hdrs
12563 case "$d_endservent_r_proto" in
12565 case "$endservent_r_proto" in
12566 ''|0) try='int endservent_r(struct servent_data*);'
12567 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12569 case "$endservent_r_proto" in
12570 ''|0) try='void endservent_r(struct servent_data*);'
12571 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12573 case "$endservent_r_proto" in
12574 ''|0) d_endservent_r=undef
12575 endservent_r_proto=0
12576 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12577 * ) case "$endservent_r_proto" in
12578 REENTRANT_PROTO*) ;;
12579 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12581 echo "Prototype: $try" ;;
12584 *) case "$usethreads" in
12585 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12587 d_endservent_r=undef
12588 endservent_r_proto=0
12592 *) endservent_r_proto=0
12596 : Locate the flags for 'open()'
12599 #include <sys/types.h>
12604 #include <sys/file.h>
12606 #$i_stdlib I_STDLIB
12608 #include <stdlib.h>
12619 : check sys/file.h first to get FREAD on Sun
12620 if $test `./findhdr sys/file.h` && \
12621 set try -DI_SYS_FILE && eval $compile; then
12623 echo "<sys/file.h> defines the O_* constants..." >&4
12624 if $run ./try; then
12625 echo "and you have the 3 argument form of open()." >&4
12628 echo "but not the 3 argument form of open(). Oh, well." >&4
12631 elif $test `./findhdr fcntl.h` && \
12632 set try -DI_FCNTL && eval $compile; then
12634 echo "<fcntl.h> defines the O_* constants..." >&4
12635 if $run ./try; then
12636 echo "and you have the 3 argument form of open()." >&4
12639 echo "but not the 3 argument form of open(). Oh, well." >&4
12644 echo "I can't find the O_* constant definitions! You got problems." >&4
12650 : see if this is a sys/file.h system
12655 : do we need to include sys/file.h ?
12659 if $h_sysfile; then
12661 echo "We'll be including <sys/file.h>." >&4
12664 echo "We won't be including <sys/file.h>." >&4
12674 : see if fcntl.h is there
12679 : see if we can include fcntl.h
12685 echo "We'll be including <fcntl.h>." >&4
12688 if $h_sysfile; then
12689 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12691 echo "We won't be including <fcntl.h>." >&4
12703 : see if fork exists
12707 : see if pipe exists
12711 : check for non-blocking I/O stuff
12712 case "$h_sysfile" in
12713 true) echo "#include <sys/file.h>" > head.c;;
12716 true) echo "#include <fcntl.h>" > head.c;;
12717 *) echo "#include <sys/fcntl.h>" > head.c;;
12722 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12723 case "$o_nonblock" in
12725 $cat head.c > try.c
12726 $cat >>try.c <<EOCP
12728 #$i_stdlib I_STDLIB
12730 #include <stdlib.h>
12738 printf("O_NONBLOCK\n");
12742 printf("O_NDELAY\n");
12746 printf("FNDELAY\n");
12753 if eval $compile_ok; then
12754 o_nonblock=`$run ./try`
12755 case "$o_nonblock" in
12756 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12757 *) echo "Seems like we can use $o_nonblock.";;
12760 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12763 *) echo "Using $hint value $o_nonblock.";;
12768 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12771 case "$d_fork:$d_pipe" in
12773 $cat head.c > try.c
12774 $cat >>try.c <<EOCP
12776 #include <sys/types.h>
12777 #include <signal.h>
12779 #$i_stdlib I_STDLIB
12781 #include <stdlib.h>
12787 #define MY_O_NONBLOCK $o_nonblock
12788 #ifndef errno /* XXX need better Configure test */
12791 #$i_unistd I_UNISTD
12793 #include <unistd.h>
12795 #$i_string I_STRING
12797 #include <string.h>
12799 #include <strings.h>
12801 $signal_t blech(int x) { exit(3); }
12803 $cat >> try.c <<'EOCP'
12811 pipe(pd); /* Down: child -> parent */
12812 pipe(pu); /* Up: parent -> child */
12815 close(pd[1]); /* Parent reads from pd[0] */
12816 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12818 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12823 signal(SIGALRM, blech);
12825 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12827 sprintf(string, "%d\n", ret);
12828 write(2, string, strlen(string));
12831 if (errno == EAGAIN) {
12832 printf("EAGAIN\n");
12837 if (errno == EWOULDBLOCK)
12838 printf("EWOULDBLOCK\n");
12841 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12842 sleep(2); /* Give it time to close our pipe */
12844 ret = read(pd[0], buf, 1); /* Should read EOF */
12846 sprintf(string, "%d\n", ret);
12847 write(4, string, strlen(string));
12851 close(pd[0]); /* We write to pd[1] */
12852 close(pu[1]); /* We read from pu[0] */
12853 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12854 close(pd[1]); /* Pipe pd is now fully closed! */
12855 exit(0); /* Bye bye, thank you for playing! */
12859 if eval $compile_ok; then
12860 echo "$startsh" >mtry
12861 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12863 ./mtry >/dev/null 2>&1
12865 0) eagain=`$cat try.out`;;
12866 1) echo "Could not perform non-blocking setting!";;
12867 2) echo "I did a successful read() for something that was not there!";;
12868 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12869 4) echo "Could not find F_SETFL!";;
12870 *) echo "Something terribly wrong happened during testing.";;
12872 rd_nodata=`$cat try.ret`
12873 echo "A read() system call with no data present returns $rd_nodata."
12874 case "$rd_nodata" in
12877 echo "(That's peculiar, fixing that to be -1.)"
12883 echo "Forcing errno EAGAIN on read() with no data available."
12887 echo "Your read() sets errno to $eagain when no data is available."
12890 status=`$cat try.err`
12892 0) echo "And it correctly returns 0 to signal EOF.";;
12893 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12894 *) echo "However, your read() returns '$status' on EOF??";;
12897 if test "$status" = "$rd_nodata"; then
12898 echo "WARNING: you can't distinguish between EOF and no data!"
12902 echo "I can't compile the test program--assuming errno EAGAIN will do."
12906 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12915 echo "Using $hint value $eagain."
12916 echo "Your read() returns $rd_nodata when no data is present."
12917 case "$d_eofnblk" in
12918 "$define") echo "And you can see EOF because read() returns 0.";;
12919 "$undef") echo "But you can't see EOF status from read() returned value.";;
12921 echo "(Assuming you can't see EOF status from read anyway.)"
12927 $rm_try head.c mtry
12929 : see if _ptr and _cnt from stdio act std
12932 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12933 echo "(Looks like you have stdio.h from BSD.)"
12934 case "$stdio_ptr" in
12935 '') stdio_ptr='((fp)->_p)'
12938 *) ptr_lval=$d_stdio_ptr_lval;;
12940 case "$stdio_cnt" in
12941 '') stdio_cnt='((fp)->_r)'
12944 *) cnt_lval=$d_stdio_cnt_lval;;
12946 case "$stdio_base" in
12947 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12949 case "$stdio_bufsiz" in
12950 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12952 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12953 echo "(Looks like you have stdio.h from Linux.)"
12954 case "$stdio_ptr" in
12955 '') stdio_ptr='((fp)->_IO_read_ptr)'
12958 *) ptr_lval=$d_stdio_ptr_lval;;
12960 case "$stdio_cnt" in
12961 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12964 *) cnt_lval=$d_stdio_cnt_lval;;
12966 case "$stdio_base" in
12967 '') stdio_base='((fp)->_IO_read_base)';;
12969 case "$stdio_bufsiz" in
12970 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12973 case "$stdio_ptr" in
12974 '') stdio_ptr='((fp)->_ptr)'
12977 *) ptr_lval=$d_stdio_ptr_lval;;
12979 case "$stdio_cnt" in
12980 '') stdio_cnt='((fp)->_cnt)'
12983 *) cnt_lval=$d_stdio_cnt_lval;;
12985 case "$stdio_base" in
12986 '') stdio_base='((fp)->_base)';;
12988 case "$stdio_bufsiz" in
12989 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12993 : test whether _ptr and _cnt really work
12994 echo "Checking how std your stdio is..." >&4
12997 #$i_stdlib I_STDLIB
12999 #include <stdlib.h>
13001 #define FILE_ptr(fp) $stdio_ptr
13002 #define FILE_cnt(fp) $stdio_cnt
13004 FILE *fp = fopen("try.c", "r");
13007 18 <= FILE_cnt(fp) &&
13008 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13016 if eval $compile && $to try.c; then
13017 if $run ./try; then
13018 echo "Your stdio acts pretty std."
13021 echo "Your stdio isn't very std."
13024 echo "Your stdio doesn't appear very std."
13028 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13029 # direct buffer manipulation no longer works. The Configure tests
13030 # should be changed to correctly detect this, but until then,
13031 # the following check should at least let perl compile and run.
13032 # (This quick fix should be updated before 5.8.1.)
13033 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13034 # A. Dougherty, June 3, 2002.
13035 case "$d_gnulibc" in
13037 case "$gnulibc_version" in
13041 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13050 : Can _ptr be used as an lvalue?
13051 case "$d_stdstdio$ptr_lval" in
13052 $define$define) val=$define ;;
13055 set d_stdio_ptr_lval
13058 : Can _cnt be used as an lvalue?
13059 case "$d_stdstdio$cnt_lval" in
13060 $define$define) val=$define ;;
13063 set d_stdio_cnt_lval
13067 : test whether setting _ptr sets _cnt as a side effect
13068 d_stdio_ptr_lval_sets_cnt="$undef"
13069 d_stdio_ptr_lval_nochange_cnt="$undef"
13070 case "$d_stdio_ptr_lval$d_stdstdio" in
13072 echo "Checking to see what happens if we set the stdio ptr..." >&4
13075 /* Can we scream? */
13076 /* Eat dust sed :-) */
13077 /* In the buffer space, no one can hear you scream. */
13078 #$i_stdlib I_STDLIB
13080 #include <stdlib.h>
13082 #define FILE_ptr(fp) $stdio_ptr
13083 #define FILE_cnt(fp) $stdio_cnt
13084 #include <sys/types.h>
13086 FILE *fp = fopen("try.c", "r");
13091 puts("Fail even to read");
13094 c = getc(fp); /* Read away the first # */
13096 puts("Fail even to read");
13100 18 <= FILE_cnt(fp) &&
13101 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13103 puts("Fail even to read");
13106 ptr = (char*) FILE_ptr(fp);
13107 cnt = (size_t)FILE_cnt(fp);
13109 FILE_ptr(fp) += 42;
13111 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13112 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13115 if (FILE_cnt(fp) <= 20) {
13116 printf ("Fail (<20 chars to test)");
13119 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13120 puts("Fail compare");
13123 if (cnt == FILE_cnt(fp)) {
13124 puts("Pass_unchanged");
13127 if (FILE_cnt(fp) == (cnt - 42)) {
13128 puts("Pass_changed");
13131 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13137 if eval $compile && $to try.c; then
13138 case `$run ./try` in
13140 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13141 d_stdio_ptr_lval_sets_cnt="$define" ;;
13143 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13144 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13146 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13148 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13151 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13157 : see if _base is also standard
13159 case "$d_stdstdio" in
13163 #$i_stdlib I_STDLIB
13165 #include <stdlib.h>
13167 #define FILE_base(fp) $stdio_base
13168 #define FILE_bufsiz(fp) $stdio_bufsiz
13170 FILE *fp = fopen("try.c", "r");
13173 19 <= FILE_bufsiz(fp) &&
13174 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13181 if eval $compile && $to try.c; then
13182 if $run ./try; then
13183 echo "And its _base field acts std."
13186 echo "But its _base field isn't std."
13189 echo "However, it seems to be lacking the _base field."
13197 : see if fast_stdio exists
13199 case "$d_stdstdio:$d_stdio_ptr_lval" in
13201 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13203 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13214 : see if fchdir exists
13215 set fchdir d_fchdir
13218 : see if fchmod exists
13219 set fchmod d_fchmod
13222 : see if fchown exists
13223 set fchown d_fchown
13226 : see if this is an fcntl system
13230 : See if fcntl-based locking works.
13233 #$i_stdlib I_STDLIB
13235 #include <stdlib.h>
13237 #include <unistd.h>
13239 #include <signal.h>
13240 $signal_t blech(int x) { exit(3); }
13242 #if defined(F_SETLK) && defined(F_SETLKW)
13243 struct flock flock;
13245 fd = open("try.c", O_RDONLY);
13246 flock.l_type = F_RDLCK;
13247 flock.l_whence = SEEK_SET;
13248 flock.l_start = flock.l_len = 0;
13249 signal(SIGALRM, blech);
13251 retval = fcntl(fd, F_SETLK, &flock);
13253 (retval < 0 ? exit(2) : exit(0));
13259 echo "Checking if fcntl-based file locking works... "
13263 if eval $compile_ok; then
13264 if $run ./try; then
13265 echo "Yes, it seems to work."
13268 echo "Nope, it didn't work."
13273 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13274 *** This is (almost) impossible.
13275 *** If your NFS lock daemons are not feeling well, something like
13276 *** this may happen, please investigate. Cannot continue, aborting.
13284 echo "I'm unable to compile the test program, so I'll assume not."
13289 echo "Nope, since you don't even have fcntl()."
13292 set d_fcntl_can_lock
13296 : check for fd_set items
13299 Checking to see how well your C compiler handles fd_set and friends ...
13302 #$i_stdlib I_STDLIB
13304 #include <stdlib.h>
13306 #$i_systime I_SYS_TIME
13307 #$i_sysselct I_SYS_SELECT
13308 #$d_socket HAS_SOCKET
13309 #include <sys/types.h>
13311 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13314 #include <sys/time.h>
13316 #ifdef I_SYS_SELECT
13317 #include <sys/select.h>
13326 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13334 if eval $compile; then
13335 d_fds_bits="$define"
13337 echo "Well, your system knows about the normal fd_set typedef..." >&4
13338 if $run ./try; then
13339 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13340 d_fd_macros="$define"
13343 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13345 d_fd_macros="$undef"
13349 Hmm, your compiler has some difficulty with fd_set. Checking further...
13352 if eval $compile; then
13353 d_fds_bits="$undef"
13355 echo "Well, your system has some sort of fd_set available..." >&4
13356 if $run ./try; then
13357 echo "and you have the normal fd_set macros." >&4
13358 d_fd_macros="$define"
13361 but not the normal fd_set macros! Gross! More work for me...
13363 d_fd_macros="$undef"
13366 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13368 d_fds_bits="$undef"
13369 d_fd_macros="$undef"
13374 : see if fgetpos exists
13375 set fgetpos d_fgetpos
13378 : see if finite exists
13379 set finite d_finite
13382 : see if finitel exists
13383 set finitel d_finitel
13386 : see if flock exists
13390 : see if prototype for flock is available
13392 set d_flockproto flock $i_sysfile sys/file.h
13395 : see if fp_class exists
13396 set fp_class d_fp_class
13399 : see if pathconf exists
13400 set pathconf d_pathconf
13403 : see if fpathconf exists
13404 set fpathconf d_fpathconf
13407 : see if fpclass exists
13408 set fpclass d_fpclass
13411 : see if fpclassify exists
13412 set fpclassify d_fpclassify
13415 : see if fpclassl exists
13416 set fpclassl d_fpclassl
13419 : check for fpos64_t
13421 echo "Checking to see if you have fpos64_t..." >&4
13424 int main() { fpos64_t x = 7; }
13427 if eval $compile; then
13429 echo "You have fpos64_t."
13432 echo "You do not have fpos64_t."
13433 case "$fpossize" in
13434 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13441 : see if frexpl exists
13442 set frexpl d_frexpl
13445 : see if this is a sys/param system
13446 set sys/param.h i_sysparam
13449 : see if this is a sys/mount.h system
13450 set sys/mount.h i_sysmount
13453 : Check for fs_data_s
13455 echo "Checking to see if your system supports struct fs_data..." >&4
13456 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13458 case "$d_fs_data_s" in
13459 "$define") echo "Yes, it does." ;;
13460 *) echo "No, it doesn't." ;;
13463 : see if fseeko exists
13464 set fseeko d_fseeko
13466 case "$longsize" in
13467 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13470 : see if fsetpos exists
13471 set fsetpos d_fsetpos
13474 : see if fstatfs exists
13475 set fstatfs d_fstatfs
13478 : see if statvfs exists
13479 set statvfs d_statvfs
13482 : see if fstatvfs exists
13483 set fstatvfs d_fstatvfs
13487 : see if fsync exists
13491 : see if ftello exists
13492 set ftello d_ftello
13494 case "$longsize" in
13495 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13498 : check for a working futimes
13501 echo "Checking if you have a working futimes()" >&4
13504 #include <sys/time.h>
13511 fd = open ("try.c", O_RDWR);
13512 if (-1 == fd) exit (1);
13513 rv = futimes (fd, NULL);
13514 exit (rv == -1 ? errno : 0);
13518 if eval $compile; then
13522 0) echo "Yes, you have" >&4
13523 d_futimes="$define"
13525 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13529 echo "No, it does not (probably harmless)" >&4
13533 : see if ndbm.h is available
13536 : Compatibility location for RedHat 7.1
13537 set gdbm/ndbm.h i_gdbmndbm
13539 : Compatibility location for Debian 4.0
13540 set gdbm-ndbm.h i_gdbm_ndbm
13544 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13545 : see if dbm_open exists
13546 set dbm_open d_dbm_open
13548 case "$d_dbm_open" in
13551 i_gdbmndbm="$undef"
13552 i_gdbm_ndbm="$undef"
13553 echo "We won't be including <ndbm.h>"
13563 ndbm_hdr_protochk='name=$1; hdr=$2;
13564 eval "ihdr=\$""i_$name";
13566 if $test "$ihdr" = "$define"; then
13567 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13568 case "$d_cplusplus" in
13569 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13570 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13573 $define) $echo "Your <$hdr> seems to have prototypes";;
13574 *) $echo "Your <$hdr> does not seem to have prototypes";;
13577 set "d_${name}_h_uses_prototypes";
13581 eval $ndbm_hdr_protochk
13582 set gdbmndbm gdbm/ndbm.h
13583 eval $ndbm_hdr_protochk
13584 set gdbm_ndbm gdbm-ndbm.h
13585 eval $ndbm_hdr_protochk
13587 : see if getaddrinfo exists
13588 set getaddrinfo d_getaddrinfo
13591 : see if getcwd exists
13592 set getcwd d_getcwd
13595 : see if getespwnam exists
13596 set getespwnam d_getespwnam
13599 : see if getfsstat exists
13600 set getfsstat d_getfsstat
13603 : see if getgrent exists
13604 set getgrent d_getgrent
13607 : see if getgrent_r exists
13608 set getgrent_r d_getgrent_r
13610 case "$d_getgrent_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13613 case "$d_getgrent_r_proto:$usethreads" in
13614 ":define") d_getgrent_r_proto=define
13615 set d_getgrent_r_proto getgrent_r $hdrs
13619 case "$d_getgrent_r_proto" in
13621 case "$getgrent_r_proto" in
13622 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13623 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13625 case "$getgrent_r_proto" in
13626 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13627 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13629 case "$getgrent_r_proto" in
13630 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13631 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13633 case "$getgrent_r_proto" in
13634 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13635 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13637 case "$getgrent_r_proto" in
13638 ''|0) try='int getgrent_r(struct group*, char*, int);'
13639 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13641 case "$getgrent_r_proto" in
13642 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13643 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13645 case "$getgrent_r_proto" in
13646 ''|0) d_getgrent_r=undef
13648 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13649 * ) case "$getgrent_r_proto" in
13650 REENTRANT_PROTO*) ;;
13651 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13653 echo "Prototype: $try" ;;
13656 *) case "$usethreads" in
13657 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13664 *) getgrent_r_proto=0
13668 : see if getgrgid_r exists
13669 set getgrgid_r d_getgrgid_r
13671 case "$d_getgrgid_r" in
13673 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13674 case "$d_getgrgid_r_proto:$usethreads" in
13675 ":define") d_getgrgid_r_proto=define
13676 set d_getgrgid_r_proto getgrgid_r $hdrs
13680 case "$d_getgrgid_r_proto" in
13682 case "$getgrgid_r_proto" in
13683 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13684 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13686 case "$getgrgid_r_proto" in
13687 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13688 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13690 case "$getgrgid_r_proto" in
13691 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13692 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13694 case "$getgrgid_r_proto" in
13695 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13696 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13698 case "$getgrgid_r_proto" in
13699 ''|0) d_getgrgid_r=undef
13701 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13702 * ) case "$getgrgid_r_proto" in
13703 REENTRANT_PROTO*) ;;
13704 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13706 echo "Prototype: $try" ;;
13709 *) case "$usethreads" in
13710 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13717 *) getgrgid_r_proto=0
13721 : see if getgrnam_r exists
13722 set getgrnam_r d_getgrnam_r
13724 case "$d_getgrnam_r" in
13726 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13727 case "$d_getgrnam_r_proto:$usethreads" in
13728 ":define") d_getgrnam_r_proto=define
13729 set d_getgrnam_r_proto getgrnam_r $hdrs
13733 case "$d_getgrnam_r_proto" in
13735 case "$getgrnam_r_proto" in
13736 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13737 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13739 case "$getgrnam_r_proto" in
13740 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13741 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13743 case "$getgrnam_r_proto" in
13744 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13745 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13747 case "$getgrnam_r_proto" in
13748 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13749 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13751 case "$getgrnam_r_proto" in
13752 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13753 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13755 case "$getgrnam_r_proto" in
13756 ''|0) d_getgrnam_r=undef
13758 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13759 * ) case "$getgrnam_r_proto" in
13760 REENTRANT_PROTO*) ;;
13761 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13763 echo "Prototype: $try" ;;
13766 *) case "$usethreads" in
13767 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13774 *) getgrnam_r_proto=0
13778 : see if gethostbyaddr exists
13779 set gethostbyaddr d_gethbyaddr
13782 : see if gethostbyname exists
13783 set gethostbyname d_gethbyname
13786 : see if gethostent exists
13787 set gethostent d_gethent
13790 : see how we will look up host name
13793 if set gethostname val -f d_gethname; eval $csym; $val; then
13794 echo 'gethostname() found.' >&4
13795 d_gethname="$define"
13798 if set uname val -f d_uname; eval $csym; $val; then
13801 uname() was found, but you're running xenix, and older versions of xenix
13802 have a broken uname(). If you don't really know whether your xenix is old
13803 enough to have a broken system call, use the default answer.
13808 "$define") dflt=n;;
13810 rp='Is your uname() broken?'
13813 n*) d_uname="$define"; call=uname;;
13816 echo 'uname() found.' >&4
13823 case "$d_gethname" in
13824 '') d_gethname="$undef";;
13827 '') d_uname="$undef";;
13829 case "$d_uname$d_gethname" in
13834 Every now and then someone has a $call() that lies about the hostname
13835 but can't be fixed for political or economic reasons. If you wish, I can
13836 pretend $call() isn't there and maybe compute hostname at run-time
13837 thanks to the '$phostname' command.
13840 rp="Shall I ignore $call() from now on?"
13843 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13846 case "$phostname" in
13847 '') aphostname='';;
13848 *) case "$aphostname" in
13850 *) set X $phostname
13854 file=`./loc $file $file $pth`
13855 aphostname=`echo $file $*`
13860 case "$d_uname$d_gethname" in
13863 case "$phostname" in
13865 echo "There will be no way for $package to get your hostname." >&4;;
13867 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13871 case "$d_phostname" in
13872 '') d_phostname="$undef";;
13875 : see if gethostbyaddr_r exists
13876 set gethostbyaddr_r d_gethostbyaddr_r
13878 case "$d_gethostbyaddr_r" in
13880 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13881 case "$d_gethostbyaddr_r_proto:$usethreads" in
13882 ":define") d_gethostbyaddr_r_proto=define
13883 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13887 case "$d_gethostbyaddr_r_proto" in
13889 case "$gethostbyaddr_r_proto" in
13890 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13891 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13893 case "$gethostbyaddr_r_proto" in
13894 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13895 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13897 case "$gethostbyaddr_r_proto" in
13898 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13899 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13901 case "$gethostbyaddr_r_proto" in
13902 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13903 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13905 case "$gethostbyaddr_r_proto" in
13906 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13907 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13909 case "$gethostbyaddr_r_proto" in
13910 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13911 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13913 case "$gethostbyaddr_r_proto" in
13914 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13915 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13917 case "$gethostbyaddr_r_proto" in
13918 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13919 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13921 case "$gethostbyaddr_r_proto" in
13922 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13923 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13925 case "$gethostbyaddr_r_proto" in
13926 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13927 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13929 case "$gethostbyaddr_r_proto" in
13930 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13931 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13933 case "$gethostbyaddr_r_proto" in
13934 ''|0) d_gethostbyaddr_r=undef
13935 gethostbyaddr_r_proto=0
13936 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13937 * ) case "$gethostbyaddr_r_proto" in
13938 REENTRANT_PROTO*) ;;
13939 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13941 echo "Prototype: $try" ;;
13944 *) case "$usethreads" in
13945 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13947 d_gethostbyaddr_r=undef
13948 gethostbyaddr_r_proto=0
13952 *) gethostbyaddr_r_proto=0
13956 : see if gethostbyname_r exists
13957 set gethostbyname_r d_gethostbyname_r
13959 case "$d_gethostbyname_r" in
13961 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13962 case "$d_gethostbyname_r_proto:$usethreads" in
13963 ":define") d_gethostbyname_r_proto=define
13964 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13968 case "$d_gethostbyname_r_proto" in
13970 case "$gethostbyname_r_proto" in
13971 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13972 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13974 case "$gethostbyname_r_proto" in
13975 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13976 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13978 case "$gethostbyname_r_proto" in
13979 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13980 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13982 case "$gethostbyname_r_proto" in
13983 ''|0) d_gethostbyname_r=undef
13984 gethostbyname_r_proto=0
13985 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13986 * ) case "$gethostbyname_r_proto" in
13987 REENTRANT_PROTO*) ;;
13988 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13990 echo "Prototype: $try" ;;
13993 *) case "$usethreads" in
13994 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13996 d_gethostbyname_r=undef
13997 gethostbyname_r_proto=0
14001 *) gethostbyname_r_proto=0
14005 : see if gethostent_r exists
14006 set gethostent_r d_gethostent_r
14008 case "$d_gethostent_r" in
14010 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14011 case "$d_gethostent_r_proto:$usethreads" in
14012 ":define") d_gethostent_r_proto=define
14013 set d_gethostent_r_proto gethostent_r $hdrs
14017 case "$d_gethostent_r_proto" in
14019 case "$gethostent_r_proto" in
14020 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14021 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14023 case "$gethostent_r_proto" in
14024 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14025 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14027 case "$gethostent_r_proto" in
14028 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14029 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14031 case "$gethostent_r_proto" in
14032 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14033 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14035 case "$gethostent_r_proto" in
14036 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14037 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14039 case "$gethostent_r_proto" in
14040 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14041 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14043 case "$gethostent_r_proto" in
14044 ''|0) d_gethostent_r=undef
14045 gethostent_r_proto=0
14046 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14047 * ) case "$gethostent_r_proto" in
14048 REENTRANT_PROTO*) ;;
14049 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14051 echo "Prototype: $try" ;;
14054 *) case "$usethreads" in
14055 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14057 d_gethostent_r=undef
14058 gethostent_r_proto=0
14062 *) gethostent_r_proto=0
14066 : see if prototypes for various gethostxxx netdb.h functions are available
14068 set d_gethostprotos gethostent $i_netdb netdb.h
14071 : see if getitimer exists
14072 set getitimer d_getitimer
14075 : see if getlogin exists
14076 set getlogin d_getlogin
14079 : see if getlogin_r exists
14080 set getlogin_r d_getlogin_r
14082 case "$d_getlogin_r" in
14084 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14085 case "$d_getlogin_r_proto:$usethreads" in
14086 ":define") d_getlogin_r_proto=define
14087 set d_getlogin_r_proto getlogin_r $hdrs
14091 case "$d_getlogin_r_proto" in
14093 case "$getlogin_r_proto" in
14094 ''|0) try='int getlogin_r(char*, size_t);'
14095 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14097 case "$getlogin_r_proto" in
14098 ''|0) try='int getlogin_r(char*, int);'
14099 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14101 case "$getlogin_r_proto" in
14102 ''|0) try='char* getlogin_r(char*, size_t);'
14103 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14105 case "$getlogin_r_proto" in
14106 ''|0) try='char* getlogin_r(char*, int);'
14107 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14109 case "$getlogin_r_proto" in
14110 ''|0) d_getlogin_r=undef
14112 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14113 * ) case "$getlogin_r_proto" in
14114 REENTRANT_PROTO*) ;;
14115 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14117 echo "Prototype: $try" ;;
14120 *) case "$usethreads" in
14121 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14128 *) getlogin_r_proto=0
14132 : see if getmnt exists
14133 set getmnt d_getmnt
14136 : see if getmntent exists
14137 set getmntent d_getmntent
14140 : see if getnameinfo exists
14141 set getnameinfo d_getnameinfo
14144 : see if getnetbyaddr exists
14145 set getnetbyaddr d_getnbyaddr
14148 : see if getnetbyname exists
14149 set getnetbyname d_getnbyname
14152 : see if getnetent exists
14153 set getnetent d_getnent
14156 : see if getnetbyaddr_r exists
14157 set getnetbyaddr_r d_getnetbyaddr_r
14159 case "$d_getnetbyaddr_r" in
14161 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14162 case "$d_getnetbyaddr_r_proto:$usethreads" in
14163 ":define") d_getnetbyaddr_r_proto=define
14164 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14168 case "$d_getnetbyaddr_r_proto" in
14170 case "$getnetbyaddr_r_proto" in
14171 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14172 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14174 case "$getnetbyaddr_r_proto" in
14175 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14176 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14178 case "$getnetbyaddr_r_proto" in
14179 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14180 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14182 case "$getnetbyaddr_r_proto" in
14183 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14184 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14186 case "$getnetbyaddr_r_proto" in
14187 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14188 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14190 case "$getnetbyaddr_r_proto" in
14191 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14192 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14194 case "$getnetbyaddr_r_proto" in
14195 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14196 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14198 case "$getnetbyaddr_r_proto" in
14199 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14200 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14202 case "$getnetbyaddr_r_proto" in
14203 ''|0) d_getnetbyaddr_r=undef
14204 getnetbyaddr_r_proto=0
14205 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14206 * ) case "$getnetbyaddr_r_proto" in
14207 REENTRANT_PROTO*) ;;
14208 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14210 echo "Prototype: $try" ;;
14213 *) case "$usethreads" in
14214 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14216 d_getnetbyaddr_r=undef
14217 getnetbyaddr_r_proto=0
14221 *) getnetbyaddr_r_proto=0
14225 : see if getnetbyname_r exists
14226 set getnetbyname_r d_getnetbyname_r
14228 case "$d_getnetbyname_r" in
14230 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14231 case "$d_getnetbyname_r_proto:$usethreads" in
14232 ":define") d_getnetbyname_r_proto=define
14233 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14237 case "$d_getnetbyname_r_proto" in
14239 case "$getnetbyname_r_proto" in
14240 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14241 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14243 case "$getnetbyname_r_proto" in
14244 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14245 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14247 case "$getnetbyname_r_proto" in
14248 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14251 case "$getnetbyname_r_proto" in
14252 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14253 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14255 case "$getnetbyname_r_proto" in
14256 ''|0) d_getnetbyname_r=undef
14257 getnetbyname_r_proto=0
14258 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14259 * ) case "$getnetbyname_r_proto" in
14260 REENTRANT_PROTO*) ;;
14261 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14263 echo "Prototype: $try" ;;
14266 *) case "$usethreads" in
14267 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14269 d_getnetbyname_r=undef
14270 getnetbyname_r_proto=0
14274 *) getnetbyname_r_proto=0
14278 : see if getnetent_r exists
14279 set getnetent_r d_getnetent_r
14281 case "$d_getnetent_r" in
14283 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14284 case "$d_getnetent_r_proto:$usethreads" in
14285 ":define") d_getnetent_r_proto=define
14286 set d_getnetent_r_proto getnetent_r $hdrs
14290 case "$d_getnetent_r_proto" in
14292 case "$getnetent_r_proto" in
14293 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14294 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14296 case "$getnetent_r_proto" in
14297 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14298 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14300 case "$getnetent_r_proto" in
14301 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14302 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14304 case "$getnetent_r_proto" in
14305 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14306 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14308 case "$getnetent_r_proto" in
14309 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14310 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14312 case "$getnetent_r_proto" in
14313 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14314 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14316 case "$getnetent_r_proto" in
14317 ''|0) d_getnetent_r=undef
14318 getnetent_r_proto=0
14319 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14320 * ) case "$getnetent_r_proto" in
14321 REENTRANT_PROTO*) ;;
14322 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14324 echo "Prototype: $try" ;;
14327 *) case "$usethreads" in
14328 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14330 d_getnetent_r=undef
14331 getnetent_r_proto=0
14335 *) getnetent_r_proto=0
14339 : see if prototypes for various getnetxxx netdb.h functions are available
14341 set d_getnetprotos getnetent $i_netdb netdb.h
14344 : see if getpagesize exists
14345 set getpagesize d_getpagsz
14348 : Optional checks for getprotobyname and getprotobynumber
14350 : see if getprotobyname exists
14351 set getprotobyname d_getpbyname
14354 : see if getprotobynumber exists
14355 set getprotobynumber d_getpbynumber
14358 : see if getprotoent exists
14359 set getprotoent d_getpent
14362 : see if getpgid exists
14363 set getpgid d_getpgid
14366 : see if getpgrp2 exists
14367 set getpgrp2 d_getpgrp2
14370 : see if getppid exists
14371 set getppid d_getppid
14374 : see if getpriority exists
14375 set getpriority d_getprior
14378 : see if getprotobyname_r exists
14379 set getprotobyname_r d_getprotobyname_r
14381 case "$d_getprotobyname_r" in
14383 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14384 case "$d_getprotobyname_r_proto:$usethreads" in
14385 ":define") d_getprotobyname_r_proto=define
14386 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14390 case "$d_getprotobyname_r_proto" in
14392 case "$getprotobyname_r_proto" in
14393 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14394 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14396 case "$getprotobyname_r_proto" in
14397 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14398 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14400 case "$getprotobyname_r_proto" in
14401 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14402 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14404 case "$getprotobyname_r_proto" in
14405 ''|0) d_getprotobyname_r=undef
14406 getprotobyname_r_proto=0
14407 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14408 * ) case "$getprotobyname_r_proto" in
14409 REENTRANT_PROTO*) ;;
14410 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14412 echo "Prototype: $try" ;;
14415 *) case "$usethreads" in
14416 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14418 d_getprotobyname_r=undef
14419 getprotobyname_r_proto=0
14423 *) getprotobyname_r_proto=0
14427 : see if getprotobynumber_r exists
14428 set getprotobynumber_r d_getprotobynumber_r
14430 case "$d_getprotobynumber_r" in
14432 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14433 case "$d_getprotobynumber_r_proto:$usethreads" in
14434 ":define") d_getprotobynumber_r_proto=define
14435 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14439 case "$d_getprotobynumber_r_proto" in
14441 case "$getprotobynumber_r_proto" in
14442 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14443 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14445 case "$getprotobynumber_r_proto" in
14446 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14447 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14449 case "$getprotobynumber_r_proto" in
14450 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14451 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14453 case "$getprotobynumber_r_proto" in
14454 ''|0) d_getprotobynumber_r=undef
14455 getprotobynumber_r_proto=0
14456 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14457 * ) case "$getprotobynumber_r_proto" in
14458 REENTRANT_PROTO*) ;;
14459 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14461 echo "Prototype: $try" ;;
14464 *) case "$usethreads" in
14465 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14467 d_getprotobynumber_r=undef
14468 getprotobynumber_r_proto=0
14472 *) getprotobynumber_r_proto=0
14476 : see if getprotoent_r exists
14477 set getprotoent_r d_getprotoent_r
14479 case "$d_getprotoent_r" in
14481 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14482 case "$d_getprotoent_r_proto:$usethreads" in
14483 ":define") d_getprotoent_r_proto=define
14484 set d_getprotoent_r_proto getprotoent_r $hdrs
14488 case "$d_getprotoent_r_proto" in
14490 case "$getprotoent_r_proto" in
14491 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14492 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14494 case "$getprotoent_r_proto" in
14495 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14496 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14498 case "$getprotoent_r_proto" in
14499 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14500 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14502 case "$getprotoent_r_proto" in
14503 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14504 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14506 case "$getprotoent_r_proto" in
14507 ''|0) d_getprotoent_r=undef
14508 getprotoent_r_proto=0
14509 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14510 * ) case "$getprotoent_r_proto" in
14511 REENTRANT_PROTO*) ;;
14512 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14514 echo "Prototype: $try" ;;
14517 *) case "$usethreads" in
14518 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14520 d_getprotoent_r=undef
14521 getprotoent_r_proto=0
14525 *) getprotoent_r_proto=0
14529 : see if prototypes for various getprotoxxx netdb.h functions are available
14531 set d_getprotoprotos getprotoent $i_netdb netdb.h
14534 : see if getprpwnam exists
14535 set getprpwnam d_getprpwnam
14538 : see if getpwent exists
14539 set getpwent d_getpwent
14542 : see if getpwent_r exists
14543 set getpwent_r d_getpwent_r
14545 case "$d_getpwent_r" in
14547 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14548 case "$d_getpwent_r_proto:$usethreads" in
14549 ":define") d_getpwent_r_proto=define
14550 set d_getpwent_r_proto getpwent_r $hdrs
14554 case "$d_getpwent_r_proto" in
14556 case "$getpwent_r_proto" in
14557 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14558 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14560 case "$getpwent_r_proto" in
14561 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14562 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14564 case "$getpwent_r_proto" in
14565 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14566 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14568 case "$getpwent_r_proto" in
14569 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14570 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14572 case "$getpwent_r_proto" in
14573 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14574 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14576 case "$getpwent_r_proto" in
14577 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14578 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14580 case "$getpwent_r_proto" in
14581 ''|0) d_getpwent_r=undef
14583 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14584 * ) case "$getpwent_r_proto" in
14585 REENTRANT_PROTO*) ;;
14586 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14588 echo "Prototype: $try" ;;
14591 *) case "$usethreads" in
14592 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14599 *) getpwent_r_proto=0
14603 : see if getpwnam_r exists
14604 set getpwnam_r d_getpwnam_r
14606 case "$d_getpwnam_r" in
14608 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14609 case "$d_getpwnam_r_proto:$usethreads" in
14610 ":define") d_getpwnam_r_proto=define
14611 set d_getpwnam_r_proto getpwnam_r $hdrs
14615 case "$d_getpwnam_r_proto" in
14617 case "$getpwnam_r_proto" in
14618 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14619 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14621 case "$getpwnam_r_proto" in
14622 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14623 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14625 case "$getpwnam_r_proto" in
14626 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14627 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14629 case "$getpwnam_r_proto" in
14630 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14631 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14633 case "$getpwnam_r_proto" in
14634 ''|0) d_getpwnam_r=undef
14636 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14637 * ) case "$getpwnam_r_proto" in
14638 REENTRANT_PROTO*) ;;
14639 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14641 echo "Prototype: $try" ;;
14644 *) case "$usethreads" in
14645 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14652 *) getpwnam_r_proto=0
14656 : see if getpwuid_r exists
14657 set getpwuid_r d_getpwuid_r
14659 case "$d_getpwuid_r" in
14661 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14662 case "$d_getpwuid_r_proto:$usethreads" in
14663 ":define") d_getpwuid_r_proto=define
14664 set d_getpwuid_r_proto getpwuid_r $hdrs
14668 case "$d_getpwuid_r_proto" in
14670 case "$getpwuid_r_proto" in
14671 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14672 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14674 case "$getpwuid_r_proto" in
14675 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14676 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14678 case "$getpwuid_r_proto" in
14679 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14680 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14682 case "$getpwuid_r_proto" in
14683 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14684 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14686 case "$getpwuid_r_proto" in
14687 ''|0) d_getpwuid_r=undef
14689 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14690 * ) case "$getpwuid_r_proto" in
14691 REENTRANT_PROTO*) ;;
14692 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14694 echo "Prototype: $try" ;;
14697 *) case "$usethreads" in
14698 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14705 *) getpwuid_r_proto=0
14709 : Optional checks for getsbyname and getsbyport
14711 : see if getservbyname exists
14712 set getservbyname d_getsbyname
14715 : see if getservbyport exists
14716 set getservbyport d_getsbyport
14719 : see if getservent exists
14720 set getservent d_getsent
14723 : see if getservbyname_r exists
14724 set getservbyname_r d_getservbyname_r
14726 case "$d_getservbyname_r" in
14728 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14729 case "$d_getservbyname_r_proto:$usethreads" in
14730 ":define") d_getservbyname_r_proto=define
14731 set d_getservbyname_r_proto getservbyname_r $hdrs
14735 case "$d_getservbyname_r_proto" in
14737 case "$getservbyname_r_proto" in
14738 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14739 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14741 case "$getservbyname_r_proto" in
14742 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14743 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14745 case "$getservbyname_r_proto" in
14746 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14747 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14749 case "$getservbyname_r_proto" in
14750 ''|0) d_getservbyname_r=undef
14751 getservbyname_r_proto=0
14752 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14753 * ) case "$getservbyname_r_proto" in
14754 REENTRANT_PROTO*) ;;
14755 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14757 echo "Prototype: $try" ;;
14760 *) case "$usethreads" in
14761 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14763 d_getservbyname_r=undef
14764 getservbyname_r_proto=0
14768 *) getservbyname_r_proto=0
14772 : see if getservbyport_r exists
14773 set getservbyport_r d_getservbyport_r
14775 case "$d_getservbyport_r" in
14777 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14778 case "$d_getservbyport_r_proto:$usethreads" in
14779 ":define") d_getservbyport_r_proto=define
14780 set d_getservbyport_r_proto getservbyport_r $hdrs
14784 case "$d_getservbyport_r_proto" in
14786 case "$getservbyport_r_proto" in
14787 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14788 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14790 case "$getservbyport_r_proto" in
14791 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14792 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14794 case "$getservbyport_r_proto" in
14795 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14796 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14798 case "$getservbyport_r_proto" in
14799 ''|0) d_getservbyport_r=undef
14800 getservbyport_r_proto=0
14801 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14802 * ) case "$getservbyport_r_proto" in
14803 REENTRANT_PROTO*) ;;
14804 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14806 echo "Prototype: $try" ;;
14809 *) case "$usethreads" in
14810 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14812 d_getservbyport_r=undef
14813 getservbyport_r_proto=0
14817 *) getservbyport_r_proto=0
14821 : see if getservent_r exists
14822 set getservent_r d_getservent_r
14824 case "$d_getservent_r" in
14826 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14827 case "$d_getservent_r_proto:$usethreads" in
14828 ":define") d_getservent_r_proto=define
14829 set d_getservent_r_proto getservent_r $hdrs
14833 case "$d_getservent_r_proto" in
14835 case "$getservent_r_proto" in
14836 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14837 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14839 case "$getservent_r_proto" in
14840 ''|0) try='int getservent_r(struct servent*, char*, int);'
14841 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14843 case "$getservent_r_proto" in
14844 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14845 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14847 case "$getservent_r_proto" in
14848 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14849 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14851 case "$getservent_r_proto" in
14852 ''|0) d_getservent_r=undef
14853 getservent_r_proto=0
14854 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14855 * ) case "$getservent_r_proto" in
14856 REENTRANT_PROTO*) ;;
14857 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14859 echo "Prototype: $try" ;;
14862 *) case "$usethreads" in
14863 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14865 d_getservent_r=undef
14866 getservent_r_proto=0
14870 *) getservent_r_proto=0
14874 : see if prototypes for various getservxxx netdb.h functions are available
14876 set d_getservprotos getservent $i_netdb netdb.h
14879 : see if getspnam exists
14880 set getspnam d_getspnam
14883 : see if this is a shadow.h system
14884 set shadow.h i_shadow
14887 : see if getspnam_r exists
14888 set getspnam_r d_getspnam_r
14890 case "$d_getspnam_r" in
14892 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14893 case "$d_getspnam_r_proto:$usethreads" in
14894 ":define") d_getspnam_r_proto=define
14895 set d_getspnam_r_proto getspnam_r $hdrs
14899 case "$d_getspnam_r_proto" in
14901 case "$getspnam_r_proto" in
14902 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14903 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14905 case "$getspnam_r_proto" in
14906 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14907 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14909 case "$getspnam_r_proto" in
14910 ''|0) d_getspnam_r=undef
14912 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14913 * ) case "$getspnam_r_proto" in
14914 REENTRANT_PROTO*) ;;
14915 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14917 echo "Prototype: $try" ;;
14920 *) case "$usethreads" in
14921 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14928 *) getspnam_r_proto=0
14932 : see if gettimeofday or ftime exists
14933 set gettimeofday d_gettimeod
14935 case "$d_gettimeod" in
14941 val="$undef"; set d_ftime; eval $setvar
14944 case "$d_gettimeod$d_ftime" in
14947 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14951 : see if gmtime_r exists
14952 set gmtime_r d_gmtime_r
14954 case "$d_gmtime_r" in
14956 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14957 case "$d_gmtime_r_proto:$usethreads" in
14958 ":define") d_gmtime_r_proto=define
14959 set d_gmtime_r_proto gmtime_r $hdrs
14963 case "$d_gmtime_r_proto" in
14965 case "$gmtime_r_proto" in
14966 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14967 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14969 case "$gmtime_r_proto" in
14970 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14971 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14973 case "$gmtime_r_proto" in
14974 ''|0) d_gmtime_r=undef
14976 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14977 * ) case "$gmtime_r_proto" in
14978 REENTRANT_PROTO*) ;;
14979 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14981 echo "Prototype: $try" ;;
14984 *) case "$usethreads" in
14985 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14992 *) gmtime_r_proto=0
14996 : see if hasmntopt exists
14997 set hasmntopt d_hasmntopt
15000 : see if this is a netinet/in.h or sys/in.h system
15001 set netinet/in.h i_niin sys/in.h i_sysin
15004 : see if arpa/inet.h has to be included
15005 set arpa/inet.h i_arpainet
15008 : see if htonl --and friends-- exists
15013 : Maybe they are macros.
15016 $cat >htonl.c <<EOM
15018 #include <sys/types.h>
15019 #$i_niin I_NETINET_IN
15021 #$i_arpainet I_ARPA_INET
15022 #ifdef I_NETINET_IN
15023 #include <netinet/in.h>
15026 #include <sys/in.h>
15029 #include <arpa/inet.h>
15032 printf("Defined as a macro.");
15035 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15036 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15038 echo "But it seems to be defined as a macro." >&4
15046 : see if ilogbl exists
15047 set ilogbl d_ilogbl
15052 if set index val -f; eval $csym; $val; then
15053 if set strchr val -f d_strchr; eval $csym; $val; then
15054 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15057 echo "strchr() found." >&4
15061 echo "index() found." >&4
15066 echo "index() found." >&4
15069 if set strchr val -f d_strchr; eval $csym; $val; then
15072 echo "strchr() found." >&4
15074 echo "No index() or strchr() found!" >&4
15079 set d_strchr; eval $setvar
15081 set d_index; eval $setvar
15083 : check whether inet_aton exists
15084 set inet_aton d_inetaton
15087 : see if inet_ntop exists
15088 set inet_ntop d_inetntop
15091 : see if inet_pton exists
15092 set inet_pton d_inetpton
15097 $cat >isascii.c <<EOCP
15100 #$i_stdlib I_STDLIB
15102 #include <stdlib.h>
15113 if eval $compile; then
15114 echo "isascii() found." >&4
15117 echo "isascii() NOT found." >&4
15126 $cat >isblank.c <<'EOCP'
15137 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15138 echo "isblank() found." >&4
15141 echo "isblank() NOT found." >&4
15148 : see if isfinite exists
15149 set isfinite d_isfinite
15152 : see if isinf exists
15156 : see if isnan exists
15160 : see if isnanl exists
15161 set isnanl d_isnanl
15164 : see if killpg exists
15165 set killpg d_killpg
15168 : see if lchown exists
15170 $cat > try.c <<'EOCP'
15171 /* System header to define __stub macros and hopefully few prototypes,
15172 which can conflict with char lchown(); below. */
15173 #include <assert.h>
15174 /* Override any gcc2 internal prototype to avoid an error. */
15175 /* We use char because int might match the return type of a gcc2
15176 builtin and then its argument prototype would still apply. */
15179 /* The GNU C library defines this for functions which it implements
15180 to always fail with ENOSYS. Some functions are actually named
15181 something starting with __ and the normal name is an alias. */
15182 #if defined (__stub_lchown) || defined (__stub___lchown)
15190 if eval $compile; then
15191 $echo "lchown() found." >&4
15194 $echo "lchown() NOT found." >&4
15200 : See if number of significant digits in a double precision number is known
15202 $cat >ldbl_dig.c <<EOM
15203 #$i_limits I_LIMITS
15206 #include <limits.h>
15212 printf("Contains LDBL_DIG");
15215 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15216 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15217 echo "LDBL_DIG found." >&4
15220 echo "LDBL_DIG NOT found." >&4
15227 : see if this is a math.h system
15231 : check to see if math.h defines _LIB_VERSION
15232 d_libm_lib_version="$undef"
15236 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15238 #include <unistd.h>
15240 int main (int argc, char *argv[])
15242 printf ("%d\n", _LIB_VERSION);
15247 if eval $compile; then
15249 echo "Yes, it does ($foo)" >&4
15250 d_libm_lib_version="$define"
15252 echo "No, it does not (probably harmless)" >&4
15259 : see if link exists
15263 : see if localtime_r exists
15264 set localtime_r d_localtime_r
15266 case "$d_localtime_r" in
15268 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15269 case "$d_localtime_r_proto:$usethreads" in
15270 ":define") d_localtime_r_proto=define
15271 set d_localtime_r_proto localtime_r $hdrs
15275 case "$d_localtime_r_proto" in
15277 case "$localtime_r_proto" in
15278 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15279 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15281 case "$localtime_r_proto" in
15282 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15283 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15285 case "$localtime_r_proto" in
15286 ''|0) d_localtime_r=undef
15287 localtime_r_proto=0
15288 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15289 * ) case "$localtime_r_proto" in
15290 REENTRANT_PROTO*) ;;
15291 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15293 echo "Prototype: $try" ;;
15296 *) case "$usethreads" in
15297 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15299 d_localtime_r=undef
15300 localtime_r_proto=0
15304 *) localtime_r_proto=0
15308 : see if localtime_r calls tzset
15309 case "$localtime_r_proto" in
15312 /* Does our libc's localtime_r call tzset ?
15313 * return 0 if so, 1 otherwise.
15315 #$i_systypes I_SYS_TYPES
15316 #$i_unistd I_UNISTD
15318 #$i_stdlib I_STDLIB
15319 #$i_string I_STRING
15320 #$i_malloc I_MALLOC
15322 # include <sys/types.h>
15325 # include <unistd.h>
15331 #include <stdlib.h>
15334 # include <string.h>
15336 # include <strings.h>
15339 # include <malloc.h>
15343 time_t t = time(0L);
15344 char w_tz[]="TZ" "=GMT+5",
15345 e_tz[]="TZ" "=GMT-5",
15346 *tz_e = (char*)malloc(16),
15347 *tz_w = (char*)malloc(16);
15348 struct tm tm_e, tm_w;
15349 memset(&tm_e,'\0',sizeof(struct tm));
15350 memset(&tm_w,'\0',sizeof(struct tm));
15355 localtime_r(&t, &tm_e);
15358 localtime_r(&t, &tm_w);
15360 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15366 if eval $compile; then
15367 if $run ./try; then
15368 d_localtime_r_needs_tzset=undef;
15370 d_localtime_r_needs_tzset=define;
15373 d_localtime_r_needs_tzset=undef;
15377 d_localtime_r_needs_tzset=undef;
15382 : see if localeconv exists
15383 set localeconv d_locconv
15386 : see if lockf exists
15390 : see if prototype for lseek is available
15392 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15395 : see if lstat exists
15399 : see if madvise exists
15400 set madvise d_madvise
15403 : see if malloc_size exists
15404 set malloc_size d_malloc_size
15407 : see if malloc_size_good exists
15408 set malloc_good_size d_malloc_good_size
15411 : see if mblen exists
15415 : see if mbstowcs exists
15416 set mbstowcs d_mbstowcs
15419 : see if mbtowc exists
15420 set mbtowc d_mbtowc
15423 : see if memchr exists
15424 set memchr d_memchr
15427 : see if memcmp exists
15428 set memcmp d_memcmp
15431 : see if memcpy exists
15432 set memcpy d_memcpy
15435 : see if memmove exists
15436 set memmove d_memmove
15439 : see if memset exists
15440 set memset d_memset
15443 : see if mkdir exists
15447 : see if mkdtemp exists
15448 set mkdtemp d_mkdtemp
15451 : see if mkfifo exists
15452 set mkfifo d_mkfifo
15455 : see if mkstemp exists
15456 set mkstemp d_mkstemp
15459 : see if mkstemps exists
15460 set mkstemps d_mkstemps
15463 : see if mktime exists
15464 set mktime d_mktime
15467 : see if this is a sys/mman.h system
15468 set sys/mman.h i_sysmman
15471 : see if mmap exists
15474 : see what shmat returns
15475 : default to something harmless
15477 case "$i_sysmman$d_mmap" in
15479 $cat >mmap.c <<'END'
15480 #include <sys/mman.h>
15483 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15488 echo "and it returns ($mmaptype)." >&4
15494 : see if sqrtl exists
15498 : see if scalbnl exists
15499 set scalbnl d_scalbnl
15502 : see if modfl exists
15506 : see if prototype for modfl is available
15508 set d_modflproto modfl $i_math math.h
15511 d_modfl_pow32_bug="$undef"
15513 case "$d_longdbl$d_modfl" in
15516 Checking to see whether your modfl() is okay for large values...
15522 if $test "X$d_modflproto" != "X$define"; then
15523 $cat >>try.c <<EOCP
15524 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15525 long double modfl (long double, long double *);
15528 $cat >>try.c <<EOCP
15530 long double nv = 4294967303.15;
15536 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15540 case "$osname:$gccversion" in
15541 aix:) saveccflags="$ccflags"
15542 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15545 if eval $compile; then
15548 *" 4294967303.150000 1.150000 4294967302.000000")
15549 echo >&4 "Your modfl() is broken for large values."
15550 d_modfl_pow32_bug="$define"
15552 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15556 *" 4294967303.150000 0.150000 4294967303.000000")
15557 echo >&4 "Your modfl() seems okay for large values."
15559 *) echo >&4 "I don't understand your modfl() at all."
15565 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15568 case "$osname:$gccversion" in
15569 aix:) ccflags="$saveccflags" ;; # restore
15574 if $test "$uselongdouble" = "$define"; then
15576 if $test "$d_sqrtl" != "$define"; then
15577 message="$message sqrtl"
15579 if $test "$d_modfl" != "$define"; then
15580 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15581 echo "You have both aintl and copysignl, so I can emulate modfl."
15583 message="$message modfl"
15586 if $test "$d_frexpl" != "$define"; then
15587 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15588 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15590 message="$message frexpl"
15594 if $test "$message" != ""; then
15597 *** You requested the use of long doubles but you do not seem to have
15598 *** the following mathematical functions needed for long double support:
15600 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15601 *** Cannot continue, aborting.
15609 : see if mprotect exists
15610 set mprotect d_mprotect
15613 : see if msgctl exists
15614 set msgctl d_msgctl
15617 : see if msgget exists
15618 set msgget d_msgget
15621 : see if msgsnd exists
15622 set msgsnd d_msgsnd
15625 : see if msgrcv exists
15626 set msgrcv d_msgrcv
15629 : see how much of the 'msg*(2)' library is present.
15632 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15633 *"$undef"*) h_msg=false;;
15637 case "`ipcs 2>&1`" in
15638 "SVID messages"*"not configured"*)
15639 echo "Your $osname does not have the msg*(2) configured." >&4
15642 set msgctl d_msgctl
15644 set msgget d_msgget
15646 set msgsnd d_msgsnd
15648 set msgrcv d_msgrcv
15654 : we could also check for sys/ipc.h ...
15655 if $h_msg && $test `./findhdr sys/msg.h`; then
15656 echo "You have the full msg*(2) library." >&4
15659 echo "You don't have the full msg*(2) library." >&4
15665 : Check for msghdr_s
15667 echo "Checking to see if your system supports struct msghdr..." >&4
15668 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15670 case "$d_msghdr_s" in
15671 "$define") echo "Yes, it does." ;;
15672 *) echo "No, it doesn't." ;;
15676 : see if msync exists
15680 : see if munmap exists
15681 set munmap d_munmap
15684 : see if nice exists
15688 : see if this is a langinfo.h system
15689 set langinfo.h i_langinfo
15692 : see if nl_langinfo exists
15693 set nl_langinfo d_nl_langinfo
15696 : check for volatile keyword
15698 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15699 $cat >try.c <<'EOCP'
15702 typedef struct _goo_struct goo_struct;
15703 goo_struct * volatile goo = ((goo_struct *)0);
15704 struct _goo_struct {
15709 typedef unsigned short foo_t;
15710 char *volatile foo;
15712 volatile foo_t blech;
15716 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15718 echo "Yup, it does."
15721 echo "Nope, it doesn't."
15727 : Check basic sizes
15729 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15731 case "$use64bitint:$d_quad:$quadtype" in
15734 uvtype="$uquadtype"
15739 uvtype="unsigned long"
15745 case "$uselongdouble:$d_longdbl" in
15747 nvtype="long double"
15748 nvsize=$longdblsize
15755 $echo "(IV will be "$ivtype", $ivsize bytes)"
15756 $echo "(UV will be "$uvtype", $uvsize bytes)"
15757 $echo "(NV will be "$nvtype", $nvsize bytes)"
15760 #$i_inttypes I_INTTYPES
15762 #include <inttypes.h>
15767 int8_t i = INT8_MAX;
15768 uint8_t u = UINT8_MAX;
15769 printf("int8_t\n");
15772 int16_t i = INT16_MAX;
15773 uint16_t i = UINT16_MAX;
15774 printf("int16_t\n");
15777 int32_t i = INT32_MAX;
15778 uint32_t u = UINT32_MAX;
15779 printf("int32_t\n");
15784 i8type="signed char"
15785 u8type="unsigned char"
15790 '') case "$shortsize" in
15792 u16type="unsigned short"
15800 '') set try -DINT16
15801 if eval $compile; then
15802 case "`$run ./try`" in
15814 '') if $test $shortsize -ge 2; then
15816 u16type="unsigned short"
15824 '') case "$longsize" in
15826 u32type="unsigned long"
15830 *) case "$intsize" in
15832 u32type="unsigned int"
15842 '') set try -DINT32
15843 if eval $compile; then
15844 case "`$run ./try`" in
15856 '') if $test $intsize -ge 4; then
15858 u32type="unsigned int"
15866 '') case "$d_quad:$quadtype" in
15868 i64type="$quadtype"
15869 u64type="$uquadtype"
15877 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15878 : volatile so that the compiler has to store it out to memory.
15879 if test X"$d_volatile" = X"$define"; then
15884 #$i_stdlib I_STDLIB
15886 #include <stdlib.h>
15888 #include <sys/types.h>
15889 #include <signal.h>
15891 $volatile int bletched = 0;
15892 $signal_t blech(int s) { bletched = 1; }
15897 int n = 8 * $uvsize;
15900 signal(SIGFPE, blech);
15903 for (i = 0; i < n; i++) {
15904 u = u << 1 | ($uvtype)1;
15906 if (($uvtype)d != u)
15910 d = ($nvtype)(u - 1);
15911 if (($uvtype)d != (u - 1))
15918 printf("%d\n", ((i == n) ? -n : i));
15924 d_nv_preserves_uv="$undef"
15925 if eval $compile; then
15926 nv_preserves_uv_bits="`$run ./try`"
15928 case "$nv_preserves_uv_bits" in
15930 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15931 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15932 d_nv_preserves_uv="$define"
15934 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15935 d_nv_preserves_uv="$undef" ;;
15936 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15937 nv_preserves_uv_bits="0" ;;
15941 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15942 : volatile so that the compiler has to store it out to memory.
15943 if test X"$d_volatile" = X"$define"; then
15949 typedef $nvtype NV;
15956 while(count < 256) {
15957 $volatile NV up = value + 1.0;
15958 $volatile NV negated = -value;
15959 $volatile NV down = negated - 1.0;
15960 $volatile NV got_up = up - value;
15961 int up_good = got_up == 1.0;
15962 int got_down = down - negated;
15963 int down_good = got_down == -1.0;
15965 if (down_good != up_good) {
15967 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15968 up_good, (double) got_up, down_good, (double) got_down,
15969 count, (double) value);
15976 fputs("256.0", stdout);
15979 fputs("2.0", stdout);
15985 fputs("*", stdout);
15991 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15992 count, (double) value);
15998 nv_overflows_integers_at='0'
15999 if eval $compile; then
16005 The largest integer your NVs can preserve is equal to $xxx
16007 nv_overflows_integers_at="$xxx"
16010 Cannot determine the largest integer value your NVs can hold, unexpected output
16017 Cannot determine the largest integer value your NVs can hold
16024 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16025 : volatile so that the compiler has to store it out to memory.
16026 if test X"$d_volatile" = X"$define"; then
16031 #$i_stdlib I_STDLIB
16033 #include <stdlib.h>
16035 #$i_string I_STRING
16037 # include <string.h>
16039 # include <strings.h>
16041 #include <sys/types.h>
16042 #include <signal.h>
16044 $volatile int bletched = 0;
16045 $signal_t blech(int s) { bletched = 1; }
16048 int checkit($nvtype d, char *where) {
16049 unsigned char *p = (char *)&d;
16050 unsigned char *end = p + sizeof(d);
16060 printf("No - %s: 0x", where);
16062 printf ("%02X", *p++);
16067 int main(int argc, char **argv) {
16070 fail += checkit(d, "0.0");
16072 /* The compiler shouldn't be assuming that bletched is 0 */
16075 fail += checkit(d, "bleched");
16078 signal(SIGFPE, blech);
16081 /* Paranoia - the compiler should have no way of knowing that ANSI says
16082 that argv[argc] will always be NULL. Actually, if it did assume this it
16083 would be buggy, as this is C and main() can be called from elsewhere in
16085 d = argv[argc] ? 1 : 0;
16088 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16091 fail += checkit(d, "ternary");
16093 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16096 printf("No - memset doesn't give 0.0\n");
16097 /* This might just blow up: */
16098 printf("(gives %g)\n", d);
16104 printf("No - something bleched\n");
16109 printf("No - %d fail(s)\n", fail);
16118 d_nv_zero_is_allbits_zero="$undef"
16119 if eval $compile; then
16125 0.0 is represented as all bits zero in memory
16127 d_nv_zero_is_allbits_zero="$define"
16130 0.0 is not represented as all bits zero in memory
16132 d_nv_zero_is_allbits_zero="$undef"
16137 0.0 is not represented as all bits zero in memory
16139 d_nv_zero_is_allbits_zero="$undef"
16145 : check for off64_t
16147 echo "Checking to see if you have off64_t..." >&4
16149 #include <sys/types.h>
16150 #include <unistd.h>
16151 int main() { off64_t x = 7; }
16154 if eval $compile; then
16156 echo "You have off64_t."
16159 echo "You do not have off64_t."
16160 case "$lseeksize" in
16161 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16168 : how to create joinable pthreads
16169 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16171 echo "Checking what constant to use for creating joinable pthreads..." >&4
16172 $cat >try.c <<'EOCP'
16173 #include <pthread.h>
16175 int detachstate = JOINABLE;
16178 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16179 if eval $compile; then
16180 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16181 val="$undef" # Yes, undef.
16182 set d_old_pthread_create_joinable
16185 set old_pthread_create_joinable
16188 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16189 if eval $compile; then
16190 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16192 set d_old_pthread_create_joinable
16194 val=PTHREAD_CREATE_UNDETACHED
16195 set old_pthread_create_joinable
16198 set try -DJOINABLE=__UNDETACHED
16199 if eval $compile; then
16200 echo "You seem to use __UNDETACHED." >&4
16202 set d_old_pthread_create_joinable
16205 set old_pthread_create_joinable
16208 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16210 set d_old_pthread_create_joinable
16213 set old_pthread_create_joinable
16220 d_old_pthread_create_joinable="$undef"
16221 old_pthread_create_joinable=""
16224 : see if pause exists
16228 : see if poll exists
16232 : see if prctl exists
16236 : see if prctl supports PR_SET_NAME
16237 d_prctl_set_name=$undef
16241 #include <sys/prctl.h>
16243 int main (int argc, char *argv[])
16245 return (prctl (PR_SET_NAME, "Test"));
16249 if eval $compile_ok && $run ./try; then
16250 echo "Your prctl (PR_SET_NAME, ...) works"
16251 d_prctl_set_name=$define
16257 : see if readlink exists
16258 set readlink d_readlink
16261 : Check if exe is symlink to abs path of executing program
16265 case "$d_readlink" in
16267 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16268 : more tidy to avoid an extra level of symlink
16269 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16270 while test $# -gt 0; do
16273 if $issymlink $try; then
16274 $ls -l $try > reflect
16275 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16276 echo "You have $type-like $try."
16277 procselfexe='"'$try'"'
16279 : This will break out of the loop
16290 : backward compatibility for d_hvfork
16291 if test X$d_hvfork != X; then
16292 d_vfork="$d_hvfork"
16295 : see if there is a vfork
16300 d_pseudofork=$undef
16302 : Ok, but do we want to use it. vfork is reportedly unreliable in
16303 : perl on Solaris 2.x, and probably elsewhere.
16307 case "$usevfork" in
16313 Perl can only use a vfork() that doesn't suffer from strict
16314 restrictions on calling functions or modifying global data in
16315 the child. For example, glibc-2.1 contains such a vfork()
16316 that is unsuitable. If your system provides a proper fork()
16317 call, chances are that you do NOT want perl to use vfork().
16320 rp="Do you still want to use vfork()?"
16325 echo "Ok, we won't use vfork()."
16334 $define) usevfork='true';;
16335 *) usevfork='false';;
16338 : see whether the pthread_atfork exists
16340 #include <pthread.h>
16343 #ifdef PTHREAD_ATFORK
16344 pthread_atfork(NULL,NULL,NULL);
16349 : see if pthread_atfork exists
16350 set try -DPTHREAD_ATFORK
16351 if eval $compile; then
16356 case "$usethreads" in
16359 $define) echo 'pthread_atfork found.' >&4 ;;
16360 *) echo 'pthread_atfork NOT found.' >&4 ;;
16363 set d_pthread_atfork
16366 : see if pthread_attr_setscope exists
16367 set pthread_attr_setscope d_pthread_attr_setscope
16370 : see whether the various POSIXish _yields exist
16372 #include <pthread.h>
16378 #ifdef PTHREAD_YIELD
16381 #ifdef PTHREAD_YIELD_NULL
16382 pthread_yield(NULL);
16388 : see if sched_yield exists
16389 set try -DSCHED_YIELD
16390 if eval $compile; then
16392 sched_yield='sched_yield()'
16396 case "$usethreads" in
16399 $define) echo 'sched_yield() found.' >&4 ;;
16400 *) echo 'sched_yield() NOT found.' >&4 ;;
16406 : see if pthread_yield exists
16407 set try -DPTHREAD_YIELD
16408 if eval $compile; then
16410 case "$sched_yield" in
16411 '') sched_yield='pthread_yield()' ;;
16414 set try -DPTHREAD_YIELD_NULL
16415 if eval $compile; then
16417 case "$sched_yield" in
16418 '') sched_yield='pthread_yield(NULL)' ;;
16424 case "$usethreads" in
16427 $define) echo 'pthread_yield() found.' >&4 ;;
16428 *) echo 'pthread_yield() NOT found.' >&4 ;;
16432 set d_pthread_yield
16434 case "$sched_yield" in
16435 '') sched_yield=undef ;;
16439 : see if random_r exists
16440 set random_r d_random_r
16442 case "$d_random_r" in
16444 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16445 case "$d_random_r_proto:$usethreads" in
16446 ":define") d_random_r_proto=define
16447 set d_random_r_proto random_r $hdrs
16451 case "$d_random_r_proto" in
16453 case "$random_r_proto" in
16454 ''|0) try='int random_r(int*, struct random_data*);'
16455 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16457 case "$random_r_proto" in
16458 ''|0) try='int random_r(long*, struct random_data*);'
16459 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16461 case "$random_r_proto" in
16462 ''|0) try='int random_r(struct random_data*, int32_t*);'
16463 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16465 case "$random_r_proto" in
16466 ''|0) d_random_r=undef
16468 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16469 * ) case "$random_r_proto" in
16470 REENTRANT_PROTO*) ;;
16471 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16473 echo "Prototype: $try" ;;
16476 *) case "$usethreads" in
16477 define) echo "random_r has no prototype, not using it." >&4 ;;
16484 *) random_r_proto=0
16488 : see if readdir and friends exist
16489 set readdir d_readdir
16491 set seekdir d_seekdir
16493 set telldir d_telldir
16495 set rewinddir d_rewinddir
16498 : see if readdir64_r exists
16499 set readdir64_r d_readdir64_r
16501 case "$d_readdir64_r" in
16503 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16504 case "$d_readdir64_r_proto:$usethreads" in
16505 ":define") d_readdir64_r_proto=define
16506 set d_readdir64_r_proto readdir64_r $hdrs
16510 case "$d_readdir64_r_proto" in
16512 case "$readdir64_r_proto" in
16513 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16514 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16516 case "$readdir64_r_proto" in
16517 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16518 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16520 case "$readdir64_r_proto" in
16521 ''|0) d_readdir64_r=undef
16522 readdir64_r_proto=0
16523 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16524 * ) case "$readdir64_r_proto" in
16525 REENTRANT_PROTO*) ;;
16526 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16528 echo "Prototype: $try" ;;
16531 *) case "$usethreads" in
16532 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16534 d_readdir64_r=undef
16535 readdir64_r_proto=0
16539 *) readdir64_r_proto=0
16543 : see if readdir_r exists
16544 set readdir_r d_readdir_r
16546 case "$d_readdir_r" in
16548 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16549 case "$d_readdir_r_proto:$usethreads" in
16550 ":define") d_readdir_r_proto=define
16551 set d_readdir_r_proto readdir_r $hdrs
16555 case "$d_readdir_r_proto" in
16557 case "$readdir_r_proto" in
16558 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16559 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16561 case "$readdir_r_proto" in
16562 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16563 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16565 case "$readdir_r_proto" in
16566 ''|0) d_readdir_r=undef
16568 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16569 * ) case "$readdir_r_proto" in
16570 REENTRANT_PROTO*) ;;
16571 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16573 echo "Prototype: $try" ;;
16576 *) case "$usethreads" in
16577 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16584 *) readdir_r_proto=0
16588 : see if readv exists
16592 : see if recvmsg exists
16593 set recvmsg d_recvmsg
16596 : see if rename exists
16597 set rename d_rename
16600 : see if rmdir exists
16604 : see if memory.h is available.
16609 : See if it conflicts with string.h
16615 $cppstdin $cppflags $cppminus < $strings > mem.h
16616 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16618 echo "We won't be including <memory.h>."
16628 : can bcopy handle overlapping blocks?
16631 case "$d_memmove" in
16632 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16633 *) case "$d_bcopy" in
16635 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16637 #$i_memory I_MEMORY
16638 #$i_stdlib I_STDLIB
16639 #$i_string I_STRING
16640 #$i_unistd I_UNISTD
16642 $cat >>try.c <<'EOCP'
16645 # include <memory.h>
16648 # include <stdlib.h>
16651 # include <string.h>
16653 # include <strings.h>
16656 # include <unistd.h> /* Needed for NetBSD */
16660 char buf[128], abc[128];
16666 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16667 try to store the string in read-only memory. */
16668 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16670 for (align = 7; align >= 0; align--) {
16671 for (len = 36; len; len--) {
16673 bcopy(abc, b, len);
16674 for (off = 1; off <= len; off++) {
16675 bcopy(b, b+off, len);
16676 bcopy(b+off, b, len);
16677 if (bcmp(b, abc, len))
16686 if eval $compile_ok; then
16687 if $run ./try 2>/dev/null; then
16688 echo "Yes, it can."
16691 echo "It can't, sorry."
16694 echo "(I can't compile the test program, so we'll assume not...)"
16704 : can memcpy handle overlapping blocks?
16707 case "$d_memmove" in
16708 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16709 *) case "$d_memcpy" in
16711 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16713 #$i_memory I_MEMORY
16714 #$i_stdlib I_STDLIB
16715 #$i_string I_STRING
16716 #$i_unistd I_UNISTD
16718 $cat >>try.c <<'EOCP'
16721 # include <memory.h>
16724 # include <stdlib.h>
16727 # include <string.h>
16729 # include <strings.h>
16732 # include <unistd.h> /* Needed for NetBSD */
16736 char buf[128], abc[128];
16742 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16743 try to store the string in read-only memory. */
16744 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16746 for (align = 7; align >= 0; align--) {
16747 for (len = 36; len; len--) {
16749 memcpy(b, abc, len);
16750 for (off = 1; off <= len; off++) {
16751 memcpy(b+off, b, len);
16752 memcpy(b, b+off, len);
16753 if (memcmp(b, abc, len))
16762 if eval $compile_ok; then
16763 if $run ./try 2>/dev/null; then
16764 echo "Yes, it can."
16767 echo "It can't, sorry."
16770 echo "(I can't compile the test program, so we'll assume not...)"
16780 : can memcmp be trusted to compare relative magnitude?
16782 case "$d_memcmp" in
16785 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16787 #$i_memory I_MEMORY
16788 #$i_stdlib I_STDLIB
16789 #$i_string I_STRING
16790 #$i_unistd I_UNISTD
16792 $cat >>try.c <<'EOCP'
16795 # include <memory.h>
16798 # include <stdlib.h>
16801 # include <string.h>
16803 # include <strings.h>
16806 # include <unistd.h> /* Needed for NetBSD */
16812 if ((a < b) && memcmp(&a, &b, 1) < 0)
16818 if eval $compile_ok; then
16819 if $run ./try 2>/dev/null; then
16820 echo "Yes, it can."
16823 echo "No, it can't (it uses signed chars)."
16826 echo "(I can't compile the test program, so we'll assume not...)"
16834 : see if prototype for sbrk is available
16836 set d_sbrkproto sbrk $i_unistd unistd.h
16839 : see if select exists
16840 set select d_select
16843 : see if semctl exists
16844 set semctl d_semctl
16847 : see if semget exists
16848 set semget d_semget
16851 : see if semop exists
16855 : see how much of the 'sem*(2)' library is present.
16858 case "$d_semctl$d_semget$d_semop" in
16859 *"$undef"*) h_sem=false;;
16863 case "`ipcs 2>&1`" in
16864 "SVID messages"*"not configured"*)
16865 echo "Your $osname does not have the sem*(2) configured." >&4
16868 set semctl d_semctl
16870 set semget d_semget
16878 : we could also check for sys/ipc.h ...
16879 if $h_sem && $test `./findhdr sys/sem.h`; then
16880 echo "You have the full sem*(2) library." >&4
16883 echo "You don't have the full sem*(2) library." >&4
16889 : see whether sys/sem.h defines union semun
16891 $cat > try.c <<'END'
16892 #include <sys/types.h>
16893 #include <sys/ipc.h>
16894 #include <sys/sem.h>
16895 int main () { union semun semun; semun.buf = 0; }
16898 if eval $compile; then
16899 echo "You have union semun in <sys/sem.h>." >&4
16902 echo "You do not have union semun in <sys/sem.h>." >&4
16909 : see how to do semctl IPC_STAT
16913 $cat > tryh.h <<END
16916 # define S_IRUSR S_IREAD
16917 # define S_IWUSR S_IWRITE
16918 # define S_IXUSR S_IEXEC
16920 # define S_IRUSR 0400
16921 # define S_IWUSR 0200
16922 # define S_IXUSR 0100
16924 # define S_IRGRP (S_IRUSR>>3)
16925 # define S_IWGRP (S_IWUSR>>3)
16926 # define S_IXGRP (S_IXUSR>>3)
16927 # define S_IROTH (S_IRUSR>>6)
16928 # define S_IWOTH (S_IWUSR>>6)
16929 # define S_IXOTH (S_IXUSR>>6)
16932 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16933 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16934 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16937 : see whether semctl IPC_STAT can use union semun
16938 case "$d_semctl_semun" in
16942 #include <sys/types.h>
16943 #include <sys/ipc.h>
16944 #include <sys/sem.h>
16945 #include <sys/stat.h>
16952 #$d_union_semun HAS_UNION_SEMUN
16955 #ifndef HAS_UNION_SEMUN
16958 struct semid_ds *buf;
16959 unsigned short *array;
16965 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16966 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16968 struct semid_ds argbuf;
16971 st = semctl(sem, 0, IPC_STAT, arg);
16975 # endif /* IPC_STAT */
16976 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16978 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16979 # endif /* IPC_RMID */
16980 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16982 #endif /* IPC_PRIVATE && ... */
16983 printf("semget failed: errno = %d\n", errno);
16988 if eval $compile; then
16991 semun) val="$define" ;;
16999 case "$d_semctl_semun" in
17001 echo "You can use union semun for semctl IPC_STAT." >&4
17004 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17009 : see whether semctl IPC_STAT can use struct semid_ds pointer
17010 case "$d_semctl_semid_ds" in
17013 $cat > try.c <<'END'
17014 #include <sys/types.h>
17015 #include <sys/ipc.h>
17016 #include <sys/sem.h>
17017 #include <sys/stat.h>
17025 struct semid_ds arg;
17028 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17029 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17032 st = semctl(sem, 0, IPC_STAT, &arg);
17034 printf("semid_ds\n");
17036 # endif /* IPC_STAT */
17037 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17039 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17040 # endif /* IPC_RMID */
17041 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17043 #endif /* IPC_PRIVATE && ... */
17044 printf("semget failed: errno = %d\n", errno);
17050 if eval $compile; then
17053 semid_ds) val="$define" ;;
17057 set d_semctl_semid_ds
17061 case "$d_semctl_semid_ds" in
17063 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17065 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17071 # We do not have the full sem*(2) library, so assume we can not
17077 set d_semctl_semid_ds
17083 : see if sendmsg exists
17084 set sendmsg d_sendmsg
17087 : see if setegid exists
17088 set setegid d_setegid
17091 : see if seteuid exists
17092 set seteuid d_seteuid
17095 : see if setgrent exists
17096 set setgrent d_setgrent
17099 : see if setgrent_r exists
17100 set setgrent_r d_setgrent_r
17102 case "$d_setgrent_r" in
17104 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17105 case "$d_setgrent_r_proto:$usethreads" in
17106 ":define") d_setgrent_r_proto=define
17107 set d_setgrent_r_proto setgrent_r $hdrs
17111 case "$d_setgrent_r_proto" in
17113 case "$setgrent_r_proto" in
17114 ''|0) try='int setgrent_r(FILE**);'
17115 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17117 case "$setgrent_r_proto" in
17118 ''|0) try='void setgrent_r(FILE**);'
17119 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17121 case "$setgrent_r_proto" in
17122 ''|0) d_setgrent_r=undef
17124 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17125 * ) case "$setgrent_r_proto" in
17126 REENTRANT_PROTO*) ;;
17127 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17129 echo "Prototype: $try" ;;
17132 *) case "$usethreads" in
17133 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17140 *) setgrent_r_proto=0
17144 : see if sethostent exists
17145 set sethostent d_sethent
17148 : see if sethostent_r exists
17149 set sethostent_r d_sethostent_r
17151 case "$d_sethostent_r" in
17153 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17154 case "$d_sethostent_r_proto:$usethreads" in
17155 ":define") d_sethostent_r_proto=define
17156 set d_sethostent_r_proto sethostent_r $hdrs
17160 case "$d_sethostent_r_proto" in
17162 case "$sethostent_r_proto" in
17163 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17164 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17166 case "$sethostent_r_proto" in
17167 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17168 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17170 case "$sethostent_r_proto" in
17171 ''|0) d_sethostent_r=undef
17172 sethostent_r_proto=0
17173 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17174 * ) case "$sethostent_r_proto" in
17175 REENTRANT_PROTO*) ;;
17176 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17178 echo "Prototype: $try" ;;
17181 *) case "$usethreads" in
17182 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17184 d_sethostent_r=undef
17185 sethostent_r_proto=0
17189 *) sethostent_r_proto=0
17193 : see if setitimer exists
17194 set setitimer d_setitimer
17197 : see if setlinebuf exists
17198 set setlinebuf d_setlinebuf
17201 : see if setlocale exists
17202 set setlocale d_setlocale
17205 : see if locale.h is available
17206 set locale.h i_locale
17209 : see if setlocale_r exists
17210 set setlocale_r d_setlocale_r
17212 case "$d_setlocale_r" in
17214 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17215 case "$d_setlocale_r_proto:$usethreads" in
17216 ":define") d_setlocale_r_proto=define
17217 set d_setlocale_r_proto setlocale_r $hdrs
17221 case "$d_setlocale_r_proto" in
17223 case "$setlocale_r_proto" in
17224 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17225 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17227 case "$setlocale_r_proto" in
17228 ''|0) d_setlocale_r=undef
17229 setlocale_r_proto=0
17230 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17231 * ) case "$setlocale_r_proto" in
17232 REENTRANT_PROTO*) ;;
17233 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17235 echo "Prototype: $try" ;;
17238 *) case "$usethreads" in
17239 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17241 d_setlocale_r=undef
17242 setlocale_r_proto=0
17246 *) setlocale_r_proto=0
17250 : see if setnetent exists
17251 set setnetent d_setnent
17254 : see if setnetent_r exists
17255 set setnetent_r d_setnetent_r
17257 case "$d_setnetent_r" in
17259 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17260 case "$d_setnetent_r_proto:$usethreads" in
17261 ":define") d_setnetent_r_proto=define
17262 set d_setnetent_r_proto setnetent_r $hdrs
17266 case "$d_setnetent_r_proto" in
17268 case "$setnetent_r_proto" in
17269 ''|0) try='int setnetent_r(int, struct netent_data*);'
17270 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17272 case "$setnetent_r_proto" in
17273 ''|0) try='void setnetent_r(int, struct netent_data*);'
17274 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17276 case "$setnetent_r_proto" in
17277 ''|0) d_setnetent_r=undef
17278 setnetent_r_proto=0
17279 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17280 * ) case "$setnetent_r_proto" in
17281 REENTRANT_PROTO*) ;;
17282 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17284 echo "Prototype: $try" ;;
17287 *) case "$usethreads" in
17288 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17290 d_setnetent_r=undef
17291 setnetent_r_proto=0
17295 *) setnetent_r_proto=0
17299 : see if setprotoent exists
17300 set setprotoent d_setpent
17303 : see if setpgid exists
17304 set setpgid d_setpgid
17307 : see if setpgrp2 exists
17308 set setpgrp2 d_setpgrp2
17311 : see if setpriority exists
17312 set setpriority d_setprior
17315 : see if setproctitle exists
17316 set setproctitle d_setproctitle
17319 : see if setprotoent_r exists
17320 set setprotoent_r d_setprotoent_r
17322 case "$d_setprotoent_r" in
17324 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17325 case "$d_setprotoent_r_proto:$usethreads" in
17326 ":define") d_setprotoent_r_proto=define
17327 set d_setprotoent_r_proto setprotoent_r $hdrs
17331 case "$d_setprotoent_r_proto" in
17333 case "$setprotoent_r_proto" in
17334 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17335 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17337 case "$setprotoent_r_proto" in
17338 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17339 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17341 case "$setprotoent_r_proto" in
17342 ''|0) d_setprotoent_r=undef
17343 setprotoent_r_proto=0
17344 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17345 * ) case "$setprotoent_r_proto" in
17346 REENTRANT_PROTO*) ;;
17347 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17349 echo "Prototype: $try" ;;
17352 *) case "$usethreads" in
17353 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17355 d_setprotoent_r=undef
17356 setprotoent_r_proto=0
17360 *) setprotoent_r_proto=0
17364 : see if setpwent exists
17365 set setpwent d_setpwent
17368 : see if setpwent_r exists
17369 set setpwent_r d_setpwent_r
17371 case "$d_setpwent_r" in
17373 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17374 case "$d_setpwent_r_proto:$usethreads" in
17375 ":define") d_setpwent_r_proto=define
17376 set d_setpwent_r_proto setpwent_r $hdrs
17380 case "$d_setpwent_r_proto" in
17382 case "$setpwent_r_proto" in
17383 ''|0) try='int setpwent_r(FILE**);'
17384 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17386 case "$setpwent_r_proto" in
17387 ''|0) try='void setpwent_r(FILE**);'
17388 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17390 case "$setpwent_r_proto" in
17391 ''|0) d_setpwent_r=undef
17393 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17394 * ) case "$setpwent_r_proto" in
17395 REENTRANT_PROTO*) ;;
17396 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17398 echo "Prototype: $try" ;;
17401 *) case "$usethreads" in
17402 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17409 *) setpwent_r_proto=0
17413 : see if setregid exists
17414 set setregid d_setregid
17416 set setresgid d_setresgid
17419 : see if setreuid exists
17420 set setreuid d_setreuid
17422 set setresuid d_setresuid
17425 : see if setrgid exists
17426 set setrgid d_setrgid
17429 : see if setruid exists
17430 set setruid d_setruid
17433 : see if setservent exists
17434 set setservent d_setsent
17437 : see if setservent_r exists
17438 set setservent_r d_setservent_r
17440 case "$d_setservent_r" in
17442 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17443 case "$d_setservent_r_proto:$usethreads" in
17444 ":define") d_setservent_r_proto=define
17445 set d_setservent_r_proto setservent_r $hdrs
17449 case "$d_setservent_r_proto" in
17451 case "$setservent_r_proto" in
17452 ''|0) try='int setservent_r(int, struct servent_data*);'
17453 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17455 case "$setservent_r_proto" in
17456 ''|0) try='void setservent_r(int, struct servent_data*);'
17457 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17459 case "$setservent_r_proto" in
17460 ''|0) d_setservent_r=undef
17461 setservent_r_proto=0
17462 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17463 * ) case "$setservent_r_proto" in
17464 REENTRANT_PROTO*) ;;
17465 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17467 echo "Prototype: $try" ;;
17470 *) case "$usethreads" in
17471 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17473 d_setservent_r=undef
17474 setservent_r_proto=0
17478 *) setservent_r_proto=0
17482 : see if setsid exists
17483 set setsid d_setsid
17486 : see if setvbuf exists
17487 set setvbuf d_setvbuf
17490 : see if sfio.h is available
17494 : see if sfio library is available
17505 : Ok, but do we want to use it.
17509 true|$define|[yY]*) dflt='y';;
17512 echo "$package can use the sfio library, but it is experimental."
17513 rp="You seem to have sfio available, do you want to try using it?"
17516 y|Y) echo "Ok, turning on sfio then."
17519 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17524 *) case "$usesfio" in
17525 true|$define|[yY]*)
17526 echo "Sorry, cannot find sfio on this machine." >&4
17527 echo "Ignoring your setting of usesfio=$usesfio." >&4
17536 $define) usesfio='true';;
17537 *) usesfio='false';;
17541 *) : Remove sfio from list of libraries to use
17544 echo "Removing unneeded -lsfio from library list" >&4
17545 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17548 echo "libs = $libs" >&4
17555 : see if shmctl exists
17556 set shmctl d_shmctl
17559 : see if shmget exists
17560 set shmget d_shmget
17563 : see if shmat exists
17566 : see what shmat returns
17569 $cat >shmat.c <<'END'
17570 #include <sys/shm.h>
17573 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17578 echo "and it returns ($shmattype)." >&4
17579 : see if a prototype for shmat is available
17580 xxx=`./findhdr sys/shm.h`
17581 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17582 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17593 set d_shmatprototype
17596 : see if shmdt exists
17600 : see how much of the 'shm*(2)' library is present.
17603 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17604 *"$undef"*) h_shm=false;;
17608 case "`ipcs 2>&1`" in
17609 "SVID shared memory"*"not configured"*)
17610 echo "Your $osname does not have the shm*(2) configured." >&4
17613 set shmctl d_shmctl
17615 set shmget d_shmget
17625 : we could also check for sys/ipc.h ...
17626 if $h_shm && $test `./findhdr sys/shm.h`; then
17627 echo "You have the full shm*(2) library." >&4
17630 echo "You don't have the full shm*(2) library." >&4
17636 : see if we have sigaction
17638 if set sigaction val -f d_sigaction; eval $csym; $val; then
17639 echo 'sigaction() found.' >&4
17642 #include <sys/types.h>
17643 #include <signal.h>
17644 #$i_stdlib I_STDLIB
17646 #include <stdlib.h>
17650 struct sigaction act, oact;
17652 oact.sa_handler = 0;
17653 /* so that act and oact are used */
17654 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17658 if eval $compile_ok; then
17661 echo "But you don't seem to have a usable struct sigaction." >&4
17665 echo 'sigaction NOT found.' >&4
17668 set d_sigaction; eval $setvar
17671 : see if this is a sunmath.h system
17672 set sunmath.h i_sunmath
17675 : see if signbit exists
17676 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17679 #$i_sunmath I_SUNMATH
17683 #ifdef I_SUNMATH /* Solaris special math library */
17684 # include <sunmath.h>
17687 int main(int argc, char **argv)
17691 if ((signbit(x) == 0) && (signbit(y) != 0))
17699 if eval $compile; then
17700 if $run ./try; then
17704 $echo "Signbit seems to be available, but doesn't work as I expected."
17705 $echo "I won't use it." >&4
17716 : see if sigprocmask exists
17717 set sigprocmask d_sigprocmask
17720 : see if sigsetjmp exists
17722 case "$d_sigsetjmp" in
17725 #include <setjmp.h>
17726 #$i_stdlib I_STDLIB
17728 #include <stdlib.h>
17734 if (sigsetjmp(env,1))
17737 siglongjmp(env, 1);
17742 if eval $compile; then
17743 if $run ./try >/dev/null 2>&1; then
17744 echo "POSIX sigsetjmp found." >&4
17748 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17754 echo "sigsetjmp not found." >&4
17758 *) val="$d_sigsetjmp"
17759 case "$d_sigsetjmp" in
17760 $define) echo "POSIX sigsetjmp found." >&4;;
17761 $undef) echo "sigsetjmp not found." >&4;;
17769 : see if snprintf exists
17770 set snprintf d_snprintf
17773 : see if vsnprintf exists
17774 set vsnprintf d_vsnprintf
17777 case "$d_snprintf-$d_vsnprintf" in
17780 Checking whether your snprintf() and vsnprintf() work okay...
17782 $cat >try.c <<'EOCP'
17783 /* v?snprintf testing logic courtesy of Russ Allbery.
17784 * According to C99:
17785 * - if the buffer is too short it still must be \0-terminated
17786 * - if the buffer is too short the potentially required length
17787 * must be returned and not -1
17788 * - if the buffer is NULL the potentially required length
17789 * must be returned and not -1 or core dump
17792 #include <stdarg.h>
17796 int test (char *format, ...)
17801 va_start (args, format);
17802 count = vsnprintf (buf, sizeof buf, format, args);
17809 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17810 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17814 if eval $compile; then
17817 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17819 Your snprintf() and snprintf() don't seem to be working okay.
17821 d_snprintf="$undef"
17822 d_vsnprintf="$undef"
17826 echo "(I can't seem to compile the test program--assuming they don't)"
17827 d_snprintf="$undef"
17828 d_vsnprintf="$undef"
17834 : see if sockatmark exists
17835 set sockatmark d_sockatmark
17838 : see if prototype for sockatmark is available
17840 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17843 : see if socks5_init exists
17844 set socks5_init d_socks5_init
17847 : see if sprintf returns the length of the string in the buffer as per ANSI
17848 $echo "Checking whether sprintf returns the length of the string..." >&4
17851 #$i_stdlib I_STDLIB
17853 #include <stdlib.h>
17855 #$i_string I_STRING
17857 # include <string.h>
17859 # include <strings.h>
17868 int check (size_t expect, int test) {
17869 size_t got = strlen(buffer);
17873 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17878 int main(int argc, char **argv) {
17881 check(sprintf(buffer, ""), ++test);
17882 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17883 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17890 if eval $compile; then
17894 sprintf returns the length of the string (as ANSI says it should)
17896 d_sprintf_returns_strlen="$define"
17899 sprintf does not return the length of the string (how old is this system?)
17901 d_sprintf_returns_strlen="$undef"
17905 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17906 d_sprintf_returns_strlen="$undef"
17910 : see if srand48_r exists
17911 set srand48_r d_srand48_r
17913 case "$d_srand48_r" in
17915 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17916 case "$d_srand48_r_proto:$usethreads" in
17917 ":define") d_srand48_r_proto=define
17918 set d_srand48_r_proto srand48_r $hdrs
17922 case "$d_srand48_r_proto" in
17924 case "$srand48_r_proto" in
17925 ''|0) try='int srand48_r(long, struct drand48_data*);'
17926 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17928 case "$srand48_r_proto" in
17929 ''|0) d_srand48_r=undef
17931 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17932 * ) case "$srand48_r_proto" in
17933 REENTRANT_PROTO*) ;;
17934 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17936 echo "Prototype: $try" ;;
17939 *) case "$usethreads" in
17940 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17947 *) srand48_r_proto=0
17951 : see if srandom_r exists
17952 set srandom_r d_srandom_r
17954 case "$d_srandom_r" in
17956 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17957 case "$d_srandom_r_proto:$usethreads" in
17958 ":define") d_srandom_r_proto=define
17959 set d_srandom_r_proto srandom_r $hdrs
17963 case "$d_srandom_r_proto" in
17965 case "$srandom_r_proto" in
17966 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17967 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17969 case "$srandom_r_proto" in
17970 ''|0) d_srandom_r=undef
17972 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17973 * ) case "$srandom_r_proto" in
17974 REENTRANT_PROTO*) ;;
17975 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17977 echo "Prototype: $try" ;;
17980 *) case "$usethreads" in
17981 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17988 *) srandom_r_proto=0
17992 : see if prototype for setresgid is available
17994 set d_sresgproto setresgid $i_unistd unistd.h
17997 : see if prototype for setresuid is available
17999 set d_sresuproto setresuid $i_unistd unistd.h
18002 : see if sys/stat.h is available
18003 set sys/stat.h i_sysstat
18006 : see if stat knows about block sizes
18008 echo "Checking to see if your struct stat has st_blocks field..." >&4
18009 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18012 : see if this is a sys/vfs.h system
18013 set sys/vfs.h i_sysvfs
18016 : see if this is a sys/statfs.h system
18017 set sys/statfs.h i_sysstatfs
18020 : Check for statfs_s
18022 echo "Checking to see if your system supports struct statfs..." >&4
18023 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
18025 case "$d_statfs_s" in
18026 "$define") echo "Yes, it does." ;;
18027 *) echo "No, it doesn't." ;;
18031 : see if struct statfs knows about f_flags
18032 case "$d_statfs_s" in
18035 echo "Checking to see if your struct statfs has f_flags field..." >&4
18036 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
18040 set d_statfs_f_flags
18044 case "$d_statfs_f_flags" in
18045 "$define") echo "Yes, it does." ;;
18046 *) echo "No, it doesn't." ;;
18049 : see what flavor, if any, of static inline is supported
18051 echo "Checking to see if your system supports static inline..."
18052 $cat > try.c <<'EOCP'
18053 #include <stdlib.h>
18054 extern int f_via_a(int x);
18055 extern int f_via_b(int x);
18056 int main(int argc, char **argv)
18065 return EXIT_SUCCESS;
18068 return EXIT_FAILURE;
18072 $cat > a.c <<'EOCP'
18073 static INLINE int f(int x) {
18084 $cat > b.c <<'EOCP'
18085 extern int f(int x);
18093 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18094 case "$perl_static_inline" in
18095 '') # Check the various possibilities, and break out on success.
18096 # For gcc, prefer __inline__, which will still permit
18097 # cflags.SH to add in -ansi.
18098 case "$gccversion" in
18099 '') xxx="inline __inline__ __inline _inline";;
18100 *) xxx="__inline__ inline __inline _inline";;
18102 for inline in $xxx; do
18103 set try -DINLINE=$inline a.c
18104 if eval $compile && $run ./try; then
18105 # Now make sure there is no external linkage of static
18107 set try -DINLINE=$inline -DUSE_B a.c b.c
18108 if eval $compile && $run ./try; then
18109 $echo "Your compiler supports static $inline, " >&4
18110 $echo "but it also creates an external definition," >&4
18111 $echo "so I won't use it." >&4
18114 $echo "Your compiler supports static $inline." >&4
18116 perl_static_inline="static $inline";
18120 $echo "Your compiler does NOT support static $inline." >&4
18125 *inline*) # Some variant of inline exists.
18126 echo "Keeping your $hint value of $perl_static_inline."
18129 static) # No inline capabilities
18130 echo "Keeping your $hint value of $perl_static_inline."
18133 *) # Unrecognized previous value -- blindly trust the supplied
18134 # value and hope it makes sense. Use old value for
18135 # d_static_inline, if there is one.
18136 echo "Keeping your $hint value of $perl_static_inline."
18137 case "$d_static_inline" in
18139 *) val=$d_static_inline ;;
18143 # Fallback to plain 'static' if nothing worked.
18144 case "$perl_static_inline" in
18146 perl_static_inline="static"
18150 set d_static_inline
18152 $rm -f a.[co] b.[co]
18155 : Check stream access
18157 Checking how to access stdio streams by file descriptor number...
18159 case "$stdio_stream_array" in
18160 '') $cat >try.c <<EOCP
18163 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18167 for s in _iob __iob __sF
18169 set try -DSTDIO_STREAM_ARRAY=$s
18170 if eval $compile; then
18171 case "`$run ./try`" in
18172 yes) stdio_stream_array=$s; break ;;
18178 case "$stdio_stream_array" in
18180 I can't figure out how to access stdio streams by file descriptor number.
18182 d_stdio_stream_array="$undef"
18185 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18187 d_stdio_stream_array="$define"
18191 : see if strcoll exists
18192 set strcoll d_strcoll
18195 : check for structure copying
18197 echo "Checking to see if your C compiler can copy structs..." >&4
18198 $cat >try.c <<'EOCP'
18208 if $cc -c try.c >/dev/null 2>&1 ; then
18210 echo "Yup, it can."
18213 echo "Nope, it can't."
18219 : see if strerror and/or sys_errlist[] exist
18221 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18222 if set strerror val -f d_strerror; eval $csym; $val; then
18223 echo 'strerror() found.' >&4
18224 d_strerror="$define"
18225 d_strerrm='strerror(e)'
18226 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18227 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18228 d_syserrlst="$define"
18230 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18231 d_syserrlst="$undef"
18233 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18234 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18235 echo 'strerror() found in string header.' >&4
18236 d_strerror="$define"
18237 d_strerrm='strerror(e)'
18238 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18239 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18240 d_syserrlst="$define"
18242 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18243 d_syserrlst="$undef"
18245 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18246 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18247 d_strerror="$undef"
18248 d_syserrlst="$define"
18249 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18251 echo 'strerror() and sys_errlist[] NOT found.' >&4
18252 d_strerror="$undef"
18253 d_syserrlst="$undef"
18254 d_strerrm='"unknown"'
18258 : see if strerror_r exists
18259 set strerror_r d_strerror_r
18261 case "$d_strerror_r" in
18263 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18264 case "$d_strerror_r_proto:$usethreads" in
18265 ":define") d_strerror_r_proto=define
18266 set d_strerror_r_proto strerror_r $hdrs
18270 case "$d_strerror_r_proto" in
18272 case "$strerror_r_proto" in
18273 ''|0) try='int strerror_r(int, char*, size_t);'
18274 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18276 case "$strerror_r_proto" in
18277 ''|0) try='int strerror_r(int, char*, int);'
18278 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18280 case "$strerror_r_proto" in
18281 ''|0) try='char* strerror_r(int, char*, size_t);'
18282 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18284 case "$strerror_r_proto" in
18285 ''|0) d_strerror_r=undef
18287 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18288 * ) case "$strerror_r_proto" in
18289 REENTRANT_PROTO*) ;;
18290 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18292 echo "Prototype: $try" ;;
18295 *) case "$usethreads" in
18296 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18303 *) strerror_r_proto=0
18307 : see if strftime exists
18308 set strftime d_strftime
18311 : see if strlcat exists
18312 set strlcat d_strlcat
18315 : see if strlcpy exists
18316 set strlcpy d_strlcpy
18319 : see if strtod exists
18320 set strtod d_strtod
18323 : see if strtol exists
18324 set strtol d_strtol
18327 : see if strtold exists
18328 set strtold d_strtold
18331 : see if strtoll exists
18332 set strtoll d_strtoll
18335 case "$d_longlong-$d_strtoll" in
18338 Checking whether your strtoll() works okay...
18340 $cat >try.c <<'EOCP'
18343 #define strtoll __strtoll
18346 #define strtoll _strtoll
18349 extern long long int strtoll(char *s, char **, int);
18350 static int bad = 0;
18351 int check(char *s, long long ell, int een) {
18354 gll = strtoll(s, 0, 10);
18355 if (!((gll == ell) && (errno == een)))
18359 check(" 1", 1LL, 0);
18360 check(" 0", 0LL, 0);
18361 check("-1", -1LL, 0);
18362 check("-9223372036854775808", -9223372036854775808LL, 0);
18363 check("-9223372036854775808", -9223372036854775808LL, 0);
18364 check(" 9223372036854775807", 9223372036854775807LL, 0);
18365 check("-9223372036854775808", -9223372036854775808LL, 0);
18366 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18367 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18373 if eval $compile; then
18376 ok) echo "Your strtoll() seems to be working okay." ;;
18378 Your strtoll() doesn't seem to be working okay.
18384 echo "(I can't seem to compile the test program--assuming it doesn't)"
18390 : see if strtoq exists
18391 set strtoq d_strtoq
18394 : see if strtoul exists
18395 set strtoul d_strtoul
18398 case "$d_strtoul" in
18401 Checking whether your strtoul() works okay...
18403 $cat >try.c <<'EOCP'
18406 extern unsigned long int strtoul(char *s, char **, int);
18407 static int bad = 0;
18408 void check(char *s, unsigned long eul, int een) {
18411 gul = strtoul(s, 0, 10);
18412 if (!((gul == eul) && (errno == een)))
18416 check(" 1", 1L, 0);
18417 check(" 0", 0L, 0);
18419 case "$longsize" in
18421 $cat >>try.c <<'EOCP'
18422 check("18446744073709551615", 18446744073709551615UL, 0);
18423 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18424 #if 0 /* strtoul() for /^-/ strings is undefined. */
18425 check("-1", 18446744073709551615UL, 0);
18426 check("-18446744073709551614", 2, 0);
18427 check("-18446744073709551615", 1, 0);
18428 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18429 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18434 $cat >>try.c <<'EOCP'
18435 check("4294967295", 4294967295UL, 0);
18436 check("4294967296", 4294967295UL, ERANGE);
18437 #if 0 /* strtoul() for /^-/ strings is undefined. */
18438 check("-1", 4294967295UL, 0);
18439 check("-4294967294", 2, 0);
18440 check("-4294967295", 1, 0);
18441 check("-4294967296", 4294967295UL, ERANGE);
18442 check("-4294967297", 4294967295UL, ERANGE);
18447 : Should we write these tests to be more portable by sprintf-ing
18448 : ~0 and then manipulating that char string as input for strtol?
18451 $cat >>try.c <<'EOCP'
18458 if eval $compile; then
18459 case "`$run ./try`" in
18460 ok) echo "Your strtoul() seems to be working okay." ;;
18462 Your strtoul() doesn't seem to be working okay.
18468 echo "(I can't seem to compile the test program--assuming it doesn't)"
18474 : see if strtoull exists
18475 set strtoull d_strtoull
18478 case "$d_longlong-$d_strtoull" in
18481 Checking whether your strtoull() works okay...
18483 $cat >try.c <<'EOCP'
18486 #define strtoull __strtoull
18489 extern unsigned long long int strtoull(char *s, char **, int);
18490 static int bad = 0;
18491 int check(char *s, long long eull, int een) {
18494 gull = strtoull(s, 0, 10);
18495 if (!((gull == eull) && (errno == een)))
18499 check(" 1", 1LL, 0);
18500 check(" 0", 0LL, 0);
18501 check("18446744073709551615", 18446744073709551615ULL, 0);
18502 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18503 #if 0 /* strtoull() for /^-/ strings is undefined. */
18504 check("-1", 18446744073709551615ULL, 0);
18505 check("-18446744073709551614", 2LL, 0);
18506 check("-18446744073709551615", 1LL, 0);
18507 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18508 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18515 if eval $compile; then
18516 case "`$run ./try`" in
18517 ok) echo "Your strtoull() seems to be working okay." ;;
18519 Your strtoull() doesn't seem to be working okay.
18521 d_strtoull="$undef"
18525 echo "(I can't seem to compile the test program--assuming it doesn't)"
18526 d_strtoull="$undef"
18531 : see if strtouq exists
18532 set strtouq d_strtouq
18535 case "$d_strtouq" in
18538 Checking whether your strtouq() works okay...
18540 $cat >try.c <<'EOCP'
18543 extern unsigned long long int strtouq(char *s, char **, int);
18544 static int bad = 0;
18545 void check(char *s, unsigned long long eull, int een) {
18546 unsigned long long gull;
18548 gull = strtouq(s, 0, 10);
18549 if (!((gull == eull) && (errno == een)))
18553 check(" 1", 1LL, 0);
18554 check(" 0", 0LL, 0);
18555 check("18446744073709551615", 18446744073709551615ULL, 0);
18556 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18557 #if 0 /* strtouq() for /^-/ strings is undefined. */
18558 check("-1", 18446744073709551615ULL, 0);
18559 check("-18446744073709551614", 2LL, 0);
18560 check("-18446744073709551615", 1LL, 0);
18561 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18562 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18570 if eval $compile; then
18571 case "`$run ./try`" in
18572 ok) echo "Your strtouq() seems to be working okay." ;;
18574 Your strtouq() doesn't seem to be working okay.
18580 echo "(I can't seem to compile the test program--assuming it doesn't)"
18586 : see if strxfrm exists
18587 set strxfrm d_strxfrm
18590 : see if symlink exists
18591 set symlink d_symlink
18594 : see if syscall exists
18595 set syscall d_syscall
18598 : see if prototype for syscall is available
18600 set d_syscallproto syscall $i_unistd unistd.h
18603 : see if sysconf exists
18604 set sysconf d_sysconf
18607 : see if system exists
18608 set system d_system
18611 : see if tcgetpgrp exists
18612 set tcgetpgrp d_tcgetpgrp
18615 : see if tcsetpgrp exists
18616 set tcsetpgrp d_tcsetpgrp
18619 : see if prototype for telldir is available
18621 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18624 : see if time exists
18626 if test "X$d_time" = X -o X"$timetype" = X; then
18627 if set time val -f d_time; eval $csym; $val; then
18628 echo 'time() found.' >&4
18630 rp="What is the type returned by time() on this system?"
18631 set time_t timetype long stdio.h sys/types.h
18634 echo 'time() not found, hope that will do.' >&4
18642 : see if timegm exists
18643 set timegm d_timegm
18646 : see if this is a sys/times.h system
18647 set sys/times.h i_systimes
18650 : see if times exists
18652 if set times val -f d_times; eval $csym; $val; then
18653 echo 'times() found.' >&4
18656 case "$i_systimes" in
18657 "$define") inc='sys/times.h';;
18659 rp="What is the type returned by times() on this system?"
18660 set clock_t clocktype long stdio.h sys/types.h $inc
18663 echo 'times() NOT found, hope that will do.' >&4
18668 : see if tmpnam_r exists
18669 set tmpnam_r d_tmpnam_r
18671 case "$d_tmpnam_r" in
18673 hdrs="$i_systypes sys/types.h define stdio.h "
18674 case "$d_tmpnam_r_proto:$usethreads" in
18675 ":define") d_tmpnam_r_proto=define
18676 set d_tmpnam_r_proto tmpnam_r $hdrs
18680 case "$d_tmpnam_r_proto" in
18682 case "$tmpnam_r_proto" in
18683 ''|0) try='char* tmpnam_r(char*);'
18684 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18686 case "$tmpnam_r_proto" in
18687 ''|0) d_tmpnam_r=undef
18689 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18690 * ) case "$tmpnam_r_proto" in
18691 REENTRANT_PROTO*) ;;
18692 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18694 echo "Prototype: $try" ;;
18697 *) case "$usethreads" in
18698 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18705 *) tmpnam_r_proto=0
18709 : see if truncate exists
18710 set truncate d_truncate
18713 : see if ttyname_r exists
18714 set ttyname_r d_ttyname_r
18716 case "$d_ttyname_r" in
18718 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18719 case "$d_ttyname_r_proto:$usethreads" in
18720 ":define") d_ttyname_r_proto=define
18721 set d_ttyname_r_proto ttyname_r $hdrs
18725 case "$d_ttyname_r_proto" in
18727 case "$ttyname_r_proto" in
18728 ''|0) try='int ttyname_r(int, char*, size_t);'
18729 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18731 case "$ttyname_r_proto" in
18732 ''|0) try='int ttyname_r(int, char*, int);'
18733 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18735 case "$ttyname_r_proto" in
18736 ''|0) try='char* ttyname_r(int, char*, int);'
18737 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18739 case "$ttyname_r_proto" in
18740 ''|0) d_ttyname_r=undef
18742 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18743 * ) case "$ttyname_r_proto" in
18744 REENTRANT_PROTO*) ;;
18745 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18747 echo "Prototype: $try" ;;
18750 *) case "$usethreads" in
18751 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18758 *) ttyname_r_proto=0
18762 : see if tzname[] exists
18764 if set tzname val -a d_tzname; eval $csym; $val; then
18766 echo 'tzname[] found.' >&4
18769 echo 'tzname[] NOT found.' >&4
18774 : Check if is a multiplatform env
18776 next|darwin) multiarch="$define" ;;
18778 case "$multiarch" in
18779 ''|[nN]*) multiarch="$undef" ;;
18782 : check for ordering of bytes in a UV
18784 case "$usecrosscompile$multiarch" in
18787 You seem to be either cross-compiling or doing a multiarchitecture build,
18788 skipping the byteorder check.
18794 case "$byteorder" in
18797 In the following, larger digits indicate more significance. A big-endian
18798 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18799 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18800 machines may have weird orders like 3412. A Cray will report 87654321,
18801 an Alpha will report 12345678. If the test program works the default is
18803 I'm now running the test program...
18807 #$i_stdlib I_STDLIB
18809 #include <stdlib.h>
18811 #include <sys/types.h>
18812 typedef $uvtype UV;
18822 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18824 u.l = (UV)0x04030201;
18825 for (i = 0; i < $uvsize; i++)
18826 printf("%c", u.c[i]+'0');
18833 if eval $compile && $run ./try > /dev/null; then
18836 [1-4][1-4][1-4][1-4]|12345678|87654321)
18837 echo "(The test program ran ok.)"
18838 echo "byteorder=$dflt"
18841 ????|????????) echo "(The test program ran ok.)" ;;
18842 *) echo "(The test program didn't run right for some reason.)" ;;
18847 (I can't seem to compile the test program. Guessing big-endian...)
18850 case "$xxx_prompt" in
18852 rp="What is the order of bytes in $uvtype?"
18865 : Checking 32bit alignedness
18868 Checking to see whether you can access character data unalignedly...
18870 case "$d_u32align" in
18871 '') $cat >try.c <<EOCP
18873 #$i_stdlib I_STDLIB
18875 #include <stdlib.h>
18877 #define U32 $u32type
18878 #define BYTEORDER 0x$byteorder
18880 #include <signal.h>
18882 $signal_t bletch(int s) { exit(4); }
18885 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18886 volatile U8 buf[8];
18890 if (sizeof(U32) != 4) {
18891 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18898 signal(SIGBUS, bletch);
18910 for (i = 0; i < 4; i++) {
18911 up = (U32*)(buf + i);
18912 if (! ((*up == 1 << (8*i)) || /* big-endian */
18913 (*up == 1 << (8*(3-i))) /* little-endian */
18917 printf("read failed (%x)\n", *up);
18923 for (i = 0; i < 4; i++) {
18924 up = (U32*)(buf + i);
18926 if (*up != 0xBeef) {
18927 printf("write failed (%x)\n", *up);
18941 if eval $compile_ok; then
18942 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18943 $run ./try 2>&1 >/dev/null
18946 You can access character data pretty unalignedly.
18948 d_u32align="$undef"
18951 It seems that you must access character data in an aligned manner.
18953 d_u32align="$define"
18957 rp='Can you access character data at unaligned addresses?'
18961 [yY]*) d_u32align="$undef" ;;
18962 *) d_u32align="$define" ;;
18969 : see if ualarm exists
18970 set ualarm d_ualarm
18973 : see if umask exists
18977 : see if unordered exists
18978 set unordered d_unordered
18981 : see if unsetenv exists
18982 set unsetenv d_unsetenv
18985 : see if usleep exists
18986 set usleep d_usleep
18989 : see if prototype for usleep is available
18991 set d_usleepproto usleep $i_unistd unistd.h
18994 : see if ustat exists
18998 : see if closedir exists
18999 set closedir d_closedir
19002 case "$d_closedir" in
19005 echo "Checking whether closedir() returns a status..." >&4
19007 #$i_dirent I_DIRENT /**/
19008 #$i_sysdir I_SYS_DIR /**/
19009 #$i_sysndir I_SYS_NDIR /**/
19010 #$i_systypes I_SYS_TYPES /**/
19012 #if defined(I_SYS_TYPES)
19013 #include <sys/types.h>
19015 #if defined(I_DIRENT)
19016 #include <dirent.h>
19017 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19018 #include <sys/dir.h>
19022 #include <sys/ndir.h>
19026 #include <ndir.h> /* may be wrong in the future */
19028 #include <sys/dir.h>
19033 int main() { return closedir(opendir(".")); }
19036 if eval $compile_ok; then
19037 if $run ./try > /dev/null 2>&1 ; then
19038 echo "Yes, it does."
19041 echo "No, it doesn't."
19045 echo "(I can't seem to compile the test program--assuming it doesn't)"
19053 set d_void_closedir
19057 : see if there is a wait4
19061 : see if waitpid exists
19062 set waitpid d_waitpid
19065 : see if wcstombs exists
19066 set wcstombs d_wcstombs
19069 : see if wctomb exists
19070 set wctomb d_wctomb
19073 : see if writev exists
19074 set writev d_writev
19077 : preserve RCS keywords in files with variable substitution, grrr
19082 Revision='$Revision'
19084 : check for alignment requirements
19086 case "$usecrosscompile" in
19089 You seem to be cross-compiling. Skipping the memory alignment check.
19092 case "$alignbytes" in
19093 '') alignbytes=8 ;;
19097 case "$alignbytes" in
19098 '') echo "Checking alignment constraints..." >&4
19099 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19100 $cat >try.c <<'EOCP'
19101 typedef long double NV;
19104 $cat >try.c <<'EOCP'
19108 $cat >>try.c <<'EOCP'
19116 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19121 if eval $compile_ok; then
19125 echo "(I can't seem to compile the test program...)"
19127 case "$multiarch" in
19129 : The usual safe value is 8, but Darwin with -Duselongdouble
19130 : needs 16. Hence, we will take 8 as a minimum, but allow
19131 : Configure to pick a larger value if needed.
19132 if $test "$dflt" -lt 8; then
19134 echo "Setting alignment to 8 for multiarch support.">&4
19139 *) dflt="$alignbytes"
19142 rp="Doubles must be aligned on a how-many-byte boundary?"
19150 : set the base revision
19153 : Determine if this is an EBCDIC system
19155 echo "Determining whether or not we are on an EBCDIC system..." >&4
19156 $cat >try.c <<'EOM'
19159 if ('M'==0xd4) return 0;
19164 case "$BOOTSTRAP_CHARSET" in
19165 Y|y|define) bootstrap_charset=$define ;;
19166 *) bootstrap_charset=$undef ;;
19171 if eval $compile_ok; then
19172 if $run ./try; then
19173 echo "You seem to speak EBCDIC." >&4
19176 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19179 echo "I'm unable to compile the test program." >&4
19180 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19186 : length of character in bytes. Is always 1, otherwise it is not C
19187 : This used to be a test using sizeof
19190 : Check for the number of bits in a character
19191 case "$charbits" in
19192 '') echo "Checking how long a character is (in bits)..." >&4
19199 for (c = 1, n = 0; c; c <<= 1, n++) ;
19200 printf ("%d\n", n);
19205 if eval $compile_ok; then
19209 echo "(I can't seem to compile the test program. Guessing...)"
19216 rp="What is the length of a character (in bits)?"
19220 case "$charbits" in
19223 Your system has an unsigned character size of $charbits bits, which
19224 is rather unusual (normally it is 8 bits). Perl likely will not work
19225 correctly on your system, with subtle bugs in various places.
19227 rp='Do you really want to continue?'
19231 [yY]) echo >&4 "Okay, continuing." ;;
19236 : how do we concatenate cpp tokens here?
19238 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19239 $cat >cpp_stuff.c <<'EOCP'
19240 #define RCAT(a,b)a/**/b
19241 #define ACAT(a,b)a ## b
19245 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19246 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19247 echo "Oh! Smells like ANSI's been here." >&4
19248 echo "We can catify or stringify, separately or together!"
19250 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19251 echo "Ah, yes! The good old days!" >&4
19252 echo "However, in the good old days we don't know how to stringify and"
19253 echo "catify at the same time."
19257 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19258 You're going to have to edit the values of CAT[2-5] in config.h...
19260 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19264 : see if this is a db.h system
19270 : Check db version.
19272 echo "Checking Berkeley DB version ..." >&4
19278 #include <sys/types.h>
19280 #$i_stdlib I_STDLIB
19282 #include <stdlib.h>
19285 int main(int argc, char *argv[])
19287 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19288 int Major, Minor, Patch ;
19289 unsigned long Version ;
19290 (void)db_version(&Major, &Minor, &Patch) ;
19292 printf("%d %d %d %d %d %d\n",
19293 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19294 Major, Minor, Patch);
19297 printf("You have Berkeley DB Version 2 or greater.\n");
19299 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19300 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19301 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19302 Major, Minor, Patch) ;
19304 /* check that db.h & libdb are compatible */
19305 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19306 printf("db.h and libdb are incompatible.\n") ;
19310 printf("db.h and libdb are compatible.\n") ;
19312 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19313 + DB_VERSION_PATCH ;
19315 /* needs to be >= 2.3.4 */
19316 if (Version < 2003004) {
19317 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19318 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19324 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19329 printf("You have Berkeley DB Version 1.\n");
19330 exit(0); /* DB version < 2: the coast is clear. */
19332 exit(1); /* <db.h> not Berkeley DB? */
19338 if eval $compile_ok && $run ./try; then
19339 echo 'Looks OK.' >&4
19341 db_version_major=$1
19342 db_version_minor=$2
19343 db_version_patch=$3
19345 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19349 : Remove db from list of libraries to use
19350 echo "Removing unusable -ldb from library list" >&4
19351 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19354 echo "libs = $libs" >&4
19364 : Check the return type needed for hash
19366 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19372 #include <sys/types.h>
19375 #ifndef DB_VERSION_MAJOR
19376 u_int32_t hash_cb (ptr, size)
19384 info.hash = hash_cb;
19388 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19389 if $contains warning try.out >>/dev/null 2>&1 ; then
19392 db_hashtype='u_int32_t'
19395 : XXX Maybe we should just give up here.
19396 db_hashtype=u_int32_t
19398 echo "Help: I can't seem to compile the db test program." >&4
19399 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19402 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19404 *) db_hashtype=u_int32_t
19409 : Check the return type needed for prefix
19411 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19417 #include <sys/types.h>
19420 #ifndef DB_VERSION_MAJOR
19421 size_t prefix_cb (key1, key2)
19429 info.prefix = prefix_cb;
19433 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19434 if $contains warning try.out >>/dev/null 2>&1 ; then
19435 db_prefixtype='int'
19437 db_prefixtype='size_t'
19440 db_prefixtype='size_t'
19441 : XXX Maybe we should just give up here.
19443 echo "Help: I can't seem to compile the db test program." >&4
19444 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19447 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19449 *) db_prefixtype='size_t'
19453 : How can we generate normalized random numbers ?
19455 echo "Looking for a random number function..." >&4
19456 case "$randfunc" in
19458 if set drand48 val -f; eval $csym; $val; then
19460 echo "Good, found drand48()." >&4
19461 elif set random val -f; eval $csym; $val; then
19463 echo "OK, found random()." >&4
19466 echo "Yuck, looks like I have to use rand()." >&4
19477 *-Dmy_rand=*|*-Dmy_srand=*)
19478 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19479 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19480 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19481 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19485 while $test "$cont"; do
19486 rp="Use which function to generate random numbers?"
19488 if $test "$ans" = "$dflt"; then
19494 if set $ans val -f; eval $csym; $val; then
19498 rp="I cannot find function $ans. Use that name anyway?"
19507 case "$randfunc" in
19509 drand01="drand48()"
19515 case "$randbits" in
19517 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19519 #$i_unistd I_UNISTD
19520 #$i_stdlib I_STDLIB
19523 # include <unistd.h>
19526 # include <stdlib.h>
19532 unsigned long max = 0L;
19534 for (i = 1000; i; i--) {
19535 tmp = (unsigned long) $randfunc();
19536 if (tmp > max) max = tmp;
19538 for (i = 0; max; i++)
19544 if eval $compile_ok; then
19548 echo "(I can't seem to compile the test program...)"
19555 rp="How many bits does your $randfunc() function produce?"
19559 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19560 seedfunc="s$randfunc"
19561 randseedtype=unsigned
19565 rp="How many bits does your $randfunc() function produce?"
19568 seedfunc="s$randfunc"
19569 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19570 if set $seedfunc val -f; eval $csym; $val; then
19571 echo "(Using $seedfunc() to seed random generator)"
19573 echo "(Warning: no $seedfunc() to seed random generator)"
19576 randseedtype=unsigned
19583 : Check how to flush
19586 Checking how to flush all pending stdio output...
19588 # I only know how to find the first 32 possibly open files on SunOS.
19589 # See also hints/sunos_4_1.sh and util.c --AD
19591 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19593 $cat >>try.c <<EOCP
19595 #$i_stdlib I_STDLIB
19597 #include <stdlib.h>
19599 #$i_unistd I_UNISTD
19601 # include <unistd.h>
19603 #$d_sysconf HAS_SYSCONF
19604 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19605 #ifdef HAS_STDIO_STREAM_ARRAY
19606 # define STDIO_STREAM_ARRAY $stdio_stream_array
19611 p = fopen("try.out", "w");
19615 # ifdef TRY_FPRINTF
19619 #ifdef TRY_FFLUSH_NULL
19622 #ifdef TRY_FFLUSH_ALL
19624 long open_max = -1;
19625 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19626 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19628 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19629 open_max = sysconf(_SC_OPEN_MAX);
19632 open_max = FOPEN_MAX;
19635 open_max = OPEN_MAX;
19644 # ifdef HAS_STDIO_STREAM_ARRAY
19645 if (open_max > 0) {
19647 for (i = 0; i < open_max; i++)
19648 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19649 STDIO_STREAM_ARRAY[i]._file < open_max &&
19650 STDIO_STREAM_ARRAY[i]._flag)
19651 fflush(&STDIO_STREAM_ARRAY[i]);
19659 : first we have to find out how _not_ to flush
19661 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19663 set try -DTRY_FPUTC
19664 if eval $compile; then
19665 $run ./try 2>/dev/null
19668 if $test ! -s try.out -a "X$code" = X42; then
19674 set try -DTRY_FPRINTF
19675 if eval $compile; then
19676 $run ./try 2>/dev/null
19679 if $test ! -s try.out -a "X$code" = X42; then
19680 output=-DTRY_FPRINTF
19686 : check for fflush NULL behavior
19687 case "$fflushNULL" in
19688 '') set try -DTRY_FFLUSH_NULL $output
19689 if eval $compile; then
19690 $run ./try 2>/dev/null
19693 if $test -s try.out -a "X$code" = X42; then
19694 fflushNULL="`$cat try.out`"
19696 if $test "X$code" != X42; then
19698 (If this test failed, don't worry, we'll try another method shortly.)
19703 $rm -f core try.core core.try.*
19704 case "$fflushNULL" in
19706 Your fflush(NULL) works okay for output streams.
19707 Let's see if it clobbers input pipes...
19709 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19710 # bug that improperly flushes the input end of pipes. So we avoid the
19711 # autoflush on fork/system/exec support for now. :-(
19712 $cat >tryp.c <<EOCP
19715 main(int argc, char **argv)
19721 while ((i = getc(stdin)) != -1
19722 && (*bp++ = i) != '\n'
19723 && bp < &buf[1024])
19726 fprintf(stdout, "%s", buf);
19734 fflushNULL="$define"
19736 if eval $compile; then
19738 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19739 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19741 fflush(NULL) seems to behave okay with input streams.
19743 fflushNULL="$define"
19746 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19748 fflushNULL="$undef"
19751 $rm -f core tryp.c tryp.core core.tryp.*
19754 Your fflush(NULL) isn't working (contrary to ANSI C).
19756 fflushNULL="$undef"
19759 Cannot figure out whether your fflush(NULL) works or not.
19760 I'm assuming it doesn't (contrary to ANSI C).
19762 fflushNULL="$undef"
19766 $define|true|[yY]*)
19767 fflushNULL="$define"
19770 fflushNULL="$undef"
19773 : check explicit looping only if NULL did not work, and if the pipe
19774 : bug does not show up on an explicit flush too
19775 case "$fflushNULL" in
19777 $cat >tryp.c <<EOCP
19780 main(int argc, char **argv)
19786 while ((i = getc(stdin)) != -1
19787 && (*bp++ = i) != '\n'
19788 && bp < &buf[1024])
19791 fprintf(stdout, "%s", buf);
19800 if eval $compile; then
19802 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19803 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19805 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19807 : now check for fflushall behaviour
19808 case "$fflushall" in
19809 '') set try -DTRY_FFLUSH_ALL $output
19810 if eval $compile; then
19812 (Now testing the other method--but note that this also may fail.)
19814 $run ./try 2>/dev/null
19817 if $test -s try.out -a "X$code" = X42; then
19818 fflushall="`$cat try.out`"
19822 case "$fflushall" in
19824 Whew. Flushing explicitly all the stdio streams works.
19826 fflushall="$define"
19829 Sigh. Flushing explicitly all the stdio streams doesn't work.
19834 Cannot figure out whether flushing stdio streams explicitly works or not.
19835 I'm assuming it doesn't.
19841 "$define"|true|[yY]*)
19842 fflushall="$define"
19850 All is futile. Even fflush(stdin) clobbers input pipes!
19857 $rm -f core tryp.c tryp.core core.tryp.*
19859 *) fflushall="$undef"
19863 case "$fflushNULL$fflushall" in
19866 OK, I give up. I cannot figure out how to flush pending stdio output.
19867 We won't be flushing handles at all before fork/exec/popen.
19873 : Store the full pathname to the ar program for use in the C program
19874 : Respect a hint or command line value for full_ar.
19879 : Store the full pathname to the sed program for use in the C program
19882 : see what type gids are declared as in the kernel
19884 echo "Looking for the type for group ids returned by getgid()."
19885 set gid_t gidtype xxx stdio.h sys/types.h
19889 xxx=`./findhdr sys/user.h`
19890 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19892 unsigned) dflt="$1 $2" ;;
19896 *) dflt="$gidtype";;
19899 gid_t) echo "gid_t found." ;;
19900 *) rp="What is the type for group ids returned by getgid()?"
19906 : Check the size of GID
19909 *_t) zzz="$gidtype" ;;
19912 echo "Checking the size of $zzz..." >&4
19914 #include <sys/types.h>
19916 #$i_stdlib I_STDLIB
19918 #include <stdlib.h>
19921 printf("%d\n", (int)sizeof($gidtype));
19926 if eval $compile_ok; then
19930 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19933 echo "Your $zzz is $gidsize bytes long."
19938 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19942 : Check if GID is signed
19945 *_t) zzz="$gidtype" ;;
19948 echo "Checking the sign of $zzz..." >&4
19950 #include <sys/types.h>
19961 if eval $compile; then
19965 echo "(I can't execute the test program--guessing unsigned.)" >&4
19969 1) echo "Your $zzz is unsigned." ;;
19970 -1) echo "Your $zzz is signed." ;;
19976 echo "(I can't compile the test program--guessing unsigned.)" >&4
19980 : Check 64bit sizes
19983 if $test X"$quadtype" != X; then
19985 echo "Checking how to print 64-bit integers..." >&4
19987 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19988 $cat >try.c <<'EOCP'
19989 #include <sys/types.h>
19992 int q = 12345678901;
19993 printf("%ld\n", q);
19997 if eval $compile; then
20001 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20002 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20003 echo "We will use %d."
20009 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20010 $cat >try.c <<'EOCP'
20011 #include <sys/types.h>
20014 long q = 12345678901;
20015 printf("%ld\n", q);
20019 if eval $compile; then
20023 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20024 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20025 echo "We will use %ld."
20031 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20032 $cat >try.c <<'EOCP'
20033 #include <sys/types.h>
20034 #include <inttypes.h>
20037 int64_t q = 12345678901;
20038 printf("%" PRId64 "\n", q);
20042 if eval $compile; then
20046 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20047 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20048 echo "We will use the C9X style."
20054 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20056 #include <sys/types.h>
20059 $quadtype q = 12345678901;
20060 printf("%Ld\n", q);
20064 if eval $compile; then
20068 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20069 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20070 echo "We will use %Ld."
20076 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20077 $cat >try.c <<'EOCP'
20078 #include <sys/types.h>
20081 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20082 printf("%lld\n", q);
20086 if eval $compile; then
20090 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20091 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20092 echo "We will use the %lld style."
20098 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20100 #include <sys/types.h>
20103 $quadtype q = 12345678901;
20104 printf("%qd\n", q);
20108 if eval $compile; then
20112 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20113 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20114 echo "We will use %qd."
20120 if $test X"$sPRId64" = X; then
20121 echo "Cannot figure out how to print 64-bit integers." >&4
20128 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20129 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20131 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20132 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20136 : Check format strings for internal types
20138 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20140 if $test X"$ivsize" = X8; then
20141 ivdformat="$sPRId64"
20142 uvuformat="$sPRIu64"
20143 uvoformat="$sPRIo64"
20144 uvxformat="$sPRIx64"
20145 uvXUformat="$sPRIXU64"
20147 if $test X"$ivsize" = X"$longsize"; then
20154 if $test X"$ivsize" = X"$intsize"; then
20162 if $test X"$ivsize" = X"$shortsize"; then
20173 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20174 nveformat="$sPRIeldbl"
20175 nvfformat="$sPRIfldbl"
20176 nvgformat="$sPRIgldbl"
20177 nvEUformat="$sPRIEUldbl"
20178 nvFUformat="$sPRIFUldbl"
20179 nvGUformat="$sPRIGUldbl"
20189 case "$ivdformat" in
20190 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20195 : Check format string for GID
20198 $echo "Checking the format string to be used for gids..." >&4
20201 -1) if $test X"$gidsize" = X"$ivsize"; then
20202 gidformat="$ivdformat"
20204 if $test X"$gidsize" = X"$longsize"; then
20207 if $test X"$gidsize" = X"$intsize"; then
20210 if $test X"$gidsize" = X"$shortsize"; then
20217 *) if $test X"$gidsize" = X"$uvsize"; then
20218 gidformat="$uvuformat"
20220 if $test X"$gidsize" = X"$longsize"; then
20223 if $test X"$gidsize" = X"$intsize"; then
20226 if $test X"$gidsize" = X"$shortsize"; then
20235 : see if getgroups exists
20236 set getgroups d_getgrps
20239 : see if setgroups exists
20240 set setgroups d_setgrps
20243 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20245 case "$d_getgrps$d_setgrps" in
20247 case "$groupstype" in
20248 '') dflt="$gidtype" ;;
20249 *) dflt="$groupstype" ;;
20252 What type of pointer is the second argument to getgroups() and setgroups()?
20253 Usually this is the same as group ids, $gidtype, but not always.
20256 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20260 *) groupstype="$gidtype";;
20263 : MAD = Misc Attribute Definition
20265 if $test $patchlevel -lt 9; then
20266 : MAD is not available in 5.8.x or earlier.
20270 $define|true|[yY]*) dflt='y' ;;
20275 Would you like to build with Misc Attribute Decoration? This is development
20276 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20277 overhead on the interpreter.
20279 If this doesn't make any sense to you, just accept the default '$dflt'.
20281 rp='Build Perl with MAD?'
20286 madlyh='madly.h madly.act madly.tab'
20288 madlyobj="madly$_o" ;;
20297 : check whether make sets MAKE
20299 echo "Checking if your $make program sets \$(MAKE)..." >&4
20300 case "$make_set_make" in
20302 $sed 's/^X //' > testmake.mak << 'EOF'
20304 X @echo 'maketemp="$(MAKE)"'
20306 case "`$make -f testmake.mak 2>/dev/null`" in
20307 *maketemp=*) make_set_make='#' ;;
20308 *) make_set_make="MAKE=$make" ;;
20310 $rm -f testmake.mak
20313 case "$make_set_make" in
20314 '#') echo "Yup, it does.";;
20315 *) echo "Nope, it doesn't.";;
20318 : see what type is used for mode_t
20319 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20320 set mode_t modetype int stdio.h sys/types.h
20323 : see if we need va_copy
20325 case "$i_stdarg" in
20328 #include <stdarg.h>
20330 #$i_stdlib I_STDLIB
20332 #include <stdlib.h>
20334 #include <signal.h>
20337 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20339 return vfprintf(f, fmt, *valp);
20343 myvfprintf(FILE *f, const char *fmt, va_list val)
20345 return ivfprintf(f, fmt, &val);
20349 myprintf(char *fmt, ...)
20352 va_start(val, fmt);
20353 return myvfprintf(stdout, fmt, val);
20357 main(int ac, char **av)
20359 signal(SIGSEGV, exit);
20361 myprintf("%s%cs all right, then\n", "that", '\'');
20366 if eval $compile && $run ./try 2>&1 >/dev/null; then
20367 case "`$run ./try`" in
20368 "that's all right, then")
20374 yes) echo "It seems that you don't need va_copy()." >&4
20375 need_va_copy="$undef"
20377 *) echo "It seems that va_copy() or similar will be needed." >&4
20378 need_va_copy="$define"
20383 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20384 need_va_copy="$undef"
20388 : see what type is used for size_t
20389 rp="What is the type used for the length parameter for string functions?"
20390 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20393 : check for type of arguments to gethostbyaddr.
20394 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20395 case "$d_gethbyaddr" in
20399 Checking to see what type of arguments are accepted by gethostbyaddr().
20401 hdrs="$define sys/types.h
20402 $d_socket sys/socket.h
20403 $i_niin netinet/in.h
20405 $i_unistd unistd.h"
20406 : The first arg can 'char *' or 'void *'
20407 : The second arg is some of integral type
20408 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20409 for yyy in size_t long int; do
20410 case "$netdb_host_type" in
20411 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20412 if ./protochk "$try" $hdrs; then
20413 echo "Your system accepts $xxx for the first arg."
20414 echo "...and $yyy for the second arg."
20415 netdb_host_type="$xxx"
20416 netdb_hlen_type="$yyy"
20422 : In case none of those worked, prompt the user.
20423 case "$netdb_host_type" in
20424 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20427 netdb_host_type=$ans
20428 rp='What is the type for the 2nd argument to gethostbyaddr?'
20431 netdb_hlen_type=$ans
20435 *) : no gethostbyaddr, so pick harmless defaults
20436 netdb_host_type='char *'
20437 netdb_hlen_type="$sizetype"
20440 # Remove the "const" if needed. -- but then we'll have a
20442 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20445 : check for type of argument to gethostbyname.
20446 if test "X$netdb_name_type" = X ; then
20447 case "$d_gethbyname" in
20451 Checking to see what type of argument is accepted by gethostbyname().
20453 hdrs="$define sys/types.h
20454 $d_socket sys/socket.h
20455 $i_niin netinet/in.h
20457 $i_unistd unistd.h"
20458 for xxx in "const char *" "char *"; do
20459 case "$netdb_name_type" in
20460 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20461 if ./protochk "$try" $hdrs; then
20462 echo "Your system accepts $xxx."
20463 netdb_name_type="$xxx"
20468 : In case none of those worked, prompt the user.
20469 case "$netdb_name_type" in
20470 '') rp='What is the type for the 1st argument to gethostbyname?'
20473 netdb_name_type=$ans
20477 *) : no gethostbyname, so pick harmless default
20478 netdb_name_type='char *'
20483 : check for type of 1st argument to getnetbyaddr.
20484 if test "X$netdb_net_type" = X ; then
20485 case "$d_getnbyaddr" in
20489 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20491 hdrs="$define sys/types.h
20492 $d_socket sys/socket.h
20493 $i_niin netinet/in.h
20495 $i_unistd unistd.h"
20496 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20497 case "$netdb_net_type" in
20498 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20499 if ./protochk "$try" $hdrs; then
20500 echo "Your system accepts $xxx."
20501 netdb_net_type="$xxx"
20506 : In case none of those worked, prompt the user.
20507 case "$netdb_net_type" in
20508 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20511 netdb_net_type=$ans
20515 *) : no getnetbyaddr, so pick harmless default
20516 netdb_net_type='long'
20520 : locate the preferred pager for this system
20527 [a-zA-Z]:/*) dflt=$pg;;
20531 [a-zA-Z]:/*) dflt=$more;;
20535 [a-zA-Z]:/*) dflt=$less;;
20538 '') dflt=/usr/ucb/more;;
20546 rp='What pager is used on your system?'
20550 : see what type pids are declared as in the kernel
20551 rp="What is the type of process ids on this system?"
20552 set pid_t pidtype int stdio.h sys/types.h
20555 : see if ar generates random libraries by itself
20557 echo "Checking how to generate random libraries on your machine..." >&4
20558 echo 'int bar1() { return bar2(); }' > bar1.c
20559 echo 'int bar2() { return 2; }' > bar2.c
20561 #$i_stdlib I_STDLIB
20563 #include <stdlib.h>
20565 int main() { printf("%d\n", bar1()); exit(0); }
20567 $cc $ccflags -c bar1.c >/dev/null 2>&1
20568 $cc $ccflags -c bar2.c >/dev/null 2>&1
20569 $cc $ccflags -c foo.c >/dev/null 2>&1
20570 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20571 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20572 $run ./foobar >/dev/null 2>&1; then
20573 echo "$ar appears to generate random libraries itself."
20575 if [ "X$ranlib" = "X" ]; then
20578 elif $ar s bar$_a >/dev/null 2>&1 &&
20579 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20580 $run ./foobar >/dev/null 2>&1; then
20581 echo "a table of contents needs to be added with '$ar s'."
20584 elif $ar ts bar$_a >/dev/null 2>&1 &&
20585 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20586 $run ./foobar >/dev/null 2>&1; then
20587 echo "a table of contents needs to be added with '$ar ts'."
20594 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20595 $test -f $ranlib || ranlib=''
20598 if $test -n "$ranlib"; then
20599 echo "your system has '$ranlib'; we'll use that."
20602 echo "your system doesn't seem to support random libraries"
20603 echo "so we'll use lorder and tsort to order the libraries."
20610 : see if this is a values.h system
20611 set values.h i_values
20614 : Check the max offset that gmtime and localtime accept
20615 echo "Checking max offsets that gmtime () accepts"
20618 define) yyy="#include <values.h>" ;;
20622 case "$sGMTIME_min/$sGMTIME_max" in
20625 #include <sys/types.h>
20634 void gm_check (time_t t, int min_year, int max_year)
20637 if ( tmp == NULL ||
20638 /* Check tm_year overflow */
20639 tmp->tm_year < min_year || tmp->tm_year > max_year)
20650 gm_check (MAXLONG, 69, 0x7fffffff);
20652 if (tmp == NULL || tmp->tm_year < 0) {
20653 for (i = 63; i >= 0; i--) {
20654 time_t x = pt | ((time_t)1 << i);
20655 if (x < 0 || x < pt) continue;
20656 gm_check (x, 69, 0x7fffffff);
20659 printf ("sGMTIME_max=%ld\n", pt);
20668 gm_check (MINLONG, -1900, 70);
20671 for (i = 36; i >= 0; i--) {
20672 time_t x = pt - ((time_t)1 << i);
20673 if (x > 0) continue;
20674 gm_check (x, -1900, 70);
20677 printf ("sGMTIME_min=%ld\n", pt);
20681 int main (int argc, char *argv[])
20683 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20690 if eval $compile; then
20693 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20699 echo "Checking max offsets that localtime () accepts"
20701 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20704 #include <sys/types.h>
20713 void local_check (time_t t, int min_year, int max_year)
20715 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20718 tmp = localtime (&t);
20719 if ( tmp == NULL ||
20720 /* Check tm_year overflow */
20721 tmp->tm_year < min_year || tmp->tm_year > max_year)
20725 } /* local_check */
20732 local_check (MAXLONG, 69, 0x7fffffff);
20734 if (tmp == NULL || tmp->tm_year < 0) {
20735 for (i = 63; i >= 0; i--) {
20736 time_t x = pt | ((time_t)1 << i);
20737 if (x < 0 || x < pt) continue;
20738 local_check (x, 69, 0x7fffffff);
20741 printf ("sLOCALTIME_max=%ld\n", pt);
20750 local_check (MINLONG, -1900, 70);
20753 for (i = 36; i >= 0; i--) {
20754 time_t x = pt - ((time_t)1 << i);
20755 if (x > 0) continue;
20756 local_check (x, -1900, 70);
20759 printf ("sLOCALTIME_min=%ld\n", pt);
20763 int main (int argc, char *argv[])
20771 if eval $compile; then
20774 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20780 : check for type of arguments to select.
20781 case "$selecttype" in
20782 '') case "$d_select" in
20786 Checking to see what type of arguments are accepted by select().
20788 hdrs="$define sys/types.h
20789 $i_systime sys/time.h
20790 $i_sysselct sys/select.h
20791 $d_socket sys/socket.h"
20792 : The first arg can be int, unsigned, or size_t
20793 : The last arg may or may not be 'const'
20795 : void pointer has been seen but using that
20796 : breaks the selectminbits test
20797 for xxx in 'fd_set *' 'int *'; do
20798 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20799 for tmo in 'struct timeval *' 'const struct timeval *'; do
20801 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20802 if ./protochk "$try" $hdrs; then
20803 echo "Your system accepts $xxx."
20812 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20813 case "$d_fd_set" in
20814 $define) dflt="fd_set *" ;;
20823 *) : no select, so pick a harmless default
20830 : check for the select 'width'
20831 case "$selectminbits" in
20832 '') safebits=`expr $ptrsize \* 8`
20833 case "$d_select" in
20837 Checking to see on how many bits at a time your select() operates...
20840 #include <sys/types.h>
20842 #$i_systime I_SYS_TIME
20843 #$i_systimek I_SYS_TIME_KERNEL
20848 # ifdef I_SYS_TIME_KERNEL
20851 # include <sys/time.h>
20852 # ifdef I_SYS_TIME_KERNEL
20856 #$i_sysselct I_SYS_SELECT
20857 #ifdef I_SYS_SELECT
20858 #include <sys/select.h>
20860 #$d_socket HAS_SOCKET
20862 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20865 #$i_stdlib I_STDLIB
20867 #include <stdlib.h>
20870 #define S sizeof(*(b))
20872 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20873 #define NBITS (NBYTES * 8)
20875 char *s = (char *)malloc(NBYTES);
20884 fp = fopen("try.c", "r");
20890 b = ($selecttype)s;
20891 for (i = 0; i < NBITS; i++)
20895 select(fd + 1, b, 0, 0, &t);
20896 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20898 printf("%d\n", i + 1);
20903 if eval $compile_ok; then
20904 selectminbits=`$run ./try`
20905 case "$selectminbits" in
20907 Cannot figure out on how many bits at a time your select() operates.
20908 I'll play safe and guess it is $safebits bits.
20910 selectminbits=$safebits
20911 bits="$safebits bits"
20914 *) bits="$selectminbits bits" ;;
20916 echo "Your select() operates on $bits at a time." >&4
20918 rp='What is the minimum number of bits your select() operates on?'
20919 case "$byteorder" in
20920 12345678) dflt=64 ;;
20926 selectminbits="$val"
20930 *) : no select, so pick a harmless default
20931 selectminbits=$safebits
20937 : Trace out the files included by signal.h, then look for SIGxxx names.
20938 if [ "X$fieldn" = X ]; then
20939 : Just make some guesses. We check them later.
20940 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20942 xxx=`echo '#include <signal.h>' |
20943 $cppstdin $cppminus $cppflags 2>/dev/null |
20944 $grep '^[ ]*#.*include' |
20945 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20946 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20949 for xx in $xxx /dev/null ; do
20950 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20952 case "$xxxfiles" in
20953 '') xxxfiles=`./findhdr signal.h` ;;
20956 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20957 print substr($2, 4, 20)
20959 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20960 print substr($3, 4, 20)
20962 : Append some common names just in case the awk scan failed.
20963 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20964 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20965 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20966 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20967 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20969 : generate a few handy files for later
20970 $cat > signal.c <<EOCP
20971 #include <sys/types.h>
20972 #include <signal.h>
20973 #$i_stdlib I_STDLIB
20975 #include <stdlib.h>
20980 /* Strange style to avoid deeply-nested #if/#else/#endif */
20983 # define NSIG (_NSIG)
20989 # define NSIG (SIGMAX+1)
20995 # define NSIG (SIG_MAX+1)
21001 # define NSIG (_SIG_MAX+1)
21007 # define NSIG (MAXSIG+1)
21013 # define NSIG (MAX_SIG+1)
21018 # ifdef SIGARRAYSIZE
21019 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21025 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21029 /* Default to some arbitrary number that's big enough to get most
21030 of the common signals.
21036 printf("NSIG %d\n", NSIG);
21042 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21044 printf "#ifdef SIG"; printf $1; printf "\n"
21045 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21046 printf $1; printf ");\n"
21050 printf "#endif /* JUST_NSIG */\n";
21051 printf "exit(0);\n}\n";
21054 $cat >signal.awk <<'EOP'
21055 BEGIN { ndups = 0 }
21056 $1 ~ /^NSIG$/ { nsig = $2 }
21057 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21058 if ($2 > maxsig) { maxsig = $2 }
21059 if (sig_name[$2]) {
21060 dup_name[ndups] = $1
21061 dup_num[ndups] = $2
21073 printf("NSIG %d\n", nsig);
21074 for (n = 1; n < nsig; n++) {
21076 printf("%s %d\n", sig_name[n], sig_num[n])
21079 printf("NUM%d %d\n", n, n)
21082 for (n = 0; n < ndups; n++) {
21083 printf("%s %d\n", dup_name[n], dup_num[n])
21087 $cat >signal_cmd <<EOS
21089 if $test -s signal.lst; then
21090 echo "Using your existing signal.lst file"
21095 $cat >>signal_cmd <<'EOS'
21098 if eval $compile_ok; then
21099 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21100 $uniq | $awk -f signal.awk >signal.lst
21102 echo "(I can't seem be able to compile the whole test program)" >&4
21103 echo "(I'll try it in little pieces.)" >&4
21104 set signal -DJUST_NSIG
21105 if eval $compile_ok; then
21106 $run ./signal$_exe > signal.nsg
21109 echo "I can't seem to figure out how many signals you have." >&4
21110 echo "Guessing 50." >&4
21111 echo 'NSIG 50' > signal.nsg
21113 : Now look at all the signal names, one at a time.
21114 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21115 $cat > signal.c <<EOCP
21116 #include <sys/types.h>
21117 #include <signal.h>
21120 printf("$xx %d\n", SIG${xx});
21125 if eval $compile; then
21126 echo "SIG${xx} found."
21127 $run ./signal$_exe >> signal.ls1
21129 echo "SIG${xx} NOT found."
21132 if $test -s signal.ls1; then
21133 $cat signal.nsg signal.ls1 |
21134 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21138 if $test -s signal.lst; then
21141 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21142 echo 'kill -l' >signal
21143 set X `csh -f <signal`
21147 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21149 echo $@ | $tr ' ' $trnl | \
21150 $awk '{ printf "%s %d\n", $1, ++s; }
21151 END { printf "NSIG %d\n", ++s }' >signal.lst
21153 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21155 chmod a+x signal_cmd
21156 $eunicefix signal_cmd
21158 : generate list of signal names
21160 case "$sig_name_init" in
21162 *) case "$sig_num_init" in
21163 ''|*,*) doinit=yes ;;
21168 echo "Generating a list of signal names and numbers..." >&4
21170 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21171 sig_name=`$awk 'BEGIN { printf "ZERO " }
21172 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21173 sig_num=`$awk 'BEGIN { printf "0 " }
21174 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21175 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21176 !/^NSIG/ { printf "\"%s\", ", $1 }
21177 END { printf "0\n" }' signal.lst`
21178 sig_num_init=`$awk 'BEGIN { printf "0, " }
21179 !/^NSIG/ { printf "%d, ", $2}
21180 END { printf "0\n"}' signal.lst`
21183 echo "The following $sig_count signals are available:"
21185 echo $sig_name | $awk \
21186 'BEGIN { linelen = 0 }
21188 for (i = 1; i <= NF; i++) {
21189 name = "SIG" $i " "
21190 linelen = linelen + length(name)
21191 if (linelen > 70) {
21193 linelen = length(name)
21199 sig_size=`echo $sig_name | awk '{print NF}'`
21200 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21202 : Check size of size
21204 case "$sizetype" in
21205 *_t) zzz="$sizetype" ;;
21206 *) zzz="filesize" ;;
21208 echo "Checking the size of $zzz..." >&4
21210 #include <sys/types.h>
21212 #$i_stdlib I_STDLIB
21214 #include <stdlib.h>
21217 printf("%d\n", (int)sizeof($sizetype));
21222 if eval $compile_ok; then
21226 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21229 echo "Your $zzz size is $sizesize bytes."
21234 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21238 : check for socklen_t
21240 echo "Checking to see if you have socklen_t..." >&4
21242 #include <sys/types.h>
21243 #$d_socket HAS_SOCKET
21245 #include <sys/socket.h>
21247 int main() { socklen_t x = 16; }
21250 if eval $compile; then
21252 echo "You have socklen_t."
21255 echo "You do not have socklen_t."
21256 case "$sizetype" in
21257 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21264 : see if this is a socks.h system
21265 set socks.h i_socks
21268 : check for type of the size argument to socket calls
21269 case "$d_socket" in
21273 Checking to see what type is the last argument of accept().
21276 case "$d_socklen_t" in
21277 "$define") yyy="$yyy socklen_t"
21279 yyy="$yyy $sizetype int long unsigned"
21280 for xxx in $yyy; do
21281 case "$socksizetype" in
21282 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21283 case "$usesocks" in
21285 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21286 echo "Your system accepts '$xxx *' for the last argument of accept()."
21287 socksizetype="$xxx"
21290 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21291 echo "Your system accepts '$xxx *' for the last argument of accept()."
21292 socksizetype="$xxx"
21299 : In case none of those worked, prompt the user.
21300 case "$socksizetype" in
21301 '') rp='What is the type for socket address structure sizes?'
21308 *) : no sockets, so pick relatively harmless default
21313 : see what type is used for signed size_t
21314 set ssize_t ssizetype int stdio.h sys/types.h
21319 #$i_stdlib I_STDLIB
21321 #include <stdlib.h>
21323 #include <sys/types.h>
21324 #define Size_t $sizetype
21325 #define SSize_t $dflt
21328 if (sizeof(Size_t) == sizeof(SSize_t))
21330 else if (sizeof(Size_t) == sizeof(int))
21339 if eval $compile_ok && $run ./try > /dev/null; then
21340 ssizetype=`$run ./try`
21341 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21344 Help! I can't compile and run the ssize_t test program: please enlighten me!
21345 (This is probably a misconfiguration in your system or libraries, and
21346 you really ought to fix it. Still, I'll try anyway.)
21348 I need a type that is the same size as $sizetype, but is guaranteed to
21349 be signed. Common values are ssize_t, int and long.
21352 rp="What signed type is the same size as $sizetype?"
21358 : Check the size of st_ino
21360 $echo "Checking the size of st_ino..." >&4
21361 $cat > try.c <<EOCP
21362 #include <sys/stat.h>
21364 #$i_stdlib I_STDLIB
21366 #include <stdlib.h>
21370 printf("%d\n", (int)sizeof(st.st_ino));
21375 if eval $compile_ok; then
21379 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21381 *) st_ino_size=$val
21382 $echo "Your st_ino is $st_ino_size bytes long."
21387 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21391 : Check if st_ino is signed
21393 $echo "Checking the sign of st_ino..." >&4
21394 $cat > try.c <<EOCP
21395 #include <sys/stat.h>
21400 if (foo.st_ino < 0)
21407 if eval $compile; then
21411 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21413 *) st_ino_sign=$val
21414 case "$st_ino_sign" in
21415 1) $echo "Your st_ino is unsigned." ;;
21416 -1) $echo "Your st_ino is signed." ;;
21422 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21426 : see what type of char stdio uses.
21428 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21429 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21430 echo "Your stdio uses unsigned chars." >&4
21431 stdchar="unsigned char"
21433 echo "Your stdio uses signed chars." >&4
21438 : see what type uids are declared as in the kernel
21440 echo "Looking for the type for user ids returned by getuid()."
21441 set uid_t uidtype xxx stdio.h sys/types.h
21445 xxx=`./findhdr sys/user.h`
21446 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21448 unsigned) dflt="$1 $2" ;;
21452 *) dflt="$uidtype";;
21455 uid_t) echo "uid_t found." ;;
21456 *) rp="What is the type for user ids returned by getuid()?"
21462 : Check size of UID
21465 *_t) zzz="$uidtype" ;;
21468 echo "Checking the size of $zzz..." >&4
21470 #include <sys/types.h>
21472 #$i_stdlib I_STDLIB
21474 #include <stdlib.h>
21477 printf("%d\n", (int)sizeof($uidtype));
21482 if eval $compile_ok; then
21486 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21489 echo "Your $zzz is $uidsize bytes long."
21494 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21497 : Check if UID is signed
21500 *_t) zzz="$uidtype" ;;
21503 echo "Checking the sign of $zzz..." >&4
21505 #include <sys/types.h>
21516 if eval $compile; then
21520 echo "(I can't execute the test program--guessing unsigned.)" >&4
21524 1) echo "Your $zzz is unsigned." ;;
21525 -1) echo "Your $zzz is signed." ;;
21531 echo "(I can't compile the test program--guessing unsigned.)" >&4
21535 : Check format string for UID
21537 $echo "Checking the format string to be used for uids..." >&4
21540 -1) if $test X"$uidsize" = X"$ivsize"; then
21541 uidformat="$ivdformat"
21543 if $test X"$uidsize" = X"$longsize"; then
21546 if $test X"$uidsize" = X"$intsize"; then
21549 if $test X"$uidsize" = X"$shortsize"; then
21556 *) if $test X"$uidsize" = X"$uvsize"; then
21557 uidformat="$uvuformat"
21559 if $test X"$uidsize" = X"$longsize"; then
21562 if $test X"$uidsize" = X"$intsize"; then
21565 if $test X"$uidsize" = X"$shortsize"; then
21574 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21576 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21577 $cat >try.c <<'EOM'
21578 /* Intentionally a long probe as I'd like to sanity check that the exact
21579 approach is going to work, as thinking it will work, but only having it
21580 part working at runtime is worse than not having it. */
21582 #include <sys/types.h>
21583 #include <sys/sysctl.h>
21584 #include <sys/param.h>
21586 #include <string.h>
21587 #include <stdlib.h>
21588 #include <unistd.h>
21591 main(int argc, char **argv) {
21593 char *argv_leaf = strrchr(argv[0], '/');
21599 mib[1] = KERN_PROC;
21600 mib[2] = KERN_PROC_PATHNAME;
21604 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21608 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21613 if (size < strlen(argv_leaf) + 1) {
21614 fprintf(stderr, "size %lu is too short for a path\n",
21615 (unsigned long) size);
21619 if (size > MAXPATHLEN * MAXPATHLEN) {
21620 fprintf(stderr, "size %lu is too long for a path\n",
21621 (unsigned long) size);
21625 buffer = malloc(size);
21631 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21636 if (strlen(buffer) + 1 != size) {
21637 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21638 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21643 if (*buffer != '/') {
21644 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21648 if (strstr(buffer, "/./")) {
21649 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21653 if (strstr(buffer, "/../")) {
21654 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21658 buffer_leaf = strrchr(buffer, '/');
21659 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21660 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21672 if eval $compile; then
21673 if $run ./try; then
21674 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21677 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21681 echo "I'm unable to compile the test program." >&4
21682 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21686 set usekernprocpathname
21689 : Determine if we can use _NSGetExecutablePath to find executing program
21691 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21692 $cat >try.c <<'EOM'
21693 /* Intentionally a long probe as I'd like to sanity check that the exact
21694 approach is going to work, as thinking it will work, but only having it
21695 part working at runtime is worse than not having it. */
21696 #include <mach-o/dyld.h>
21698 #include <stdlib.h>
21699 #include <sys/param.h>
21700 #include <string.h>
21703 main(int argc, char **argv) {
21705 uint32_t size = sizeof(buf);
21709 char *argv_leaf = strrchr(argv[0], '/');
21713 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21717 _NSGetExecutablePath(buf, &size);
21718 if (size > MAXPATHLEN * MAXPATHLEN) {
21719 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21720 (unsigned int) size);
21724 buffer = malloc(size);
21730 result = _NSGetExecutablePath(buffer, &size);
21732 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21733 result, (unsigned int) size);
21737 tidied = realpath(buffer, NULL);
21739 perror("realpath");
21745 if (*tidied != '/') {
21746 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21750 if (strstr(tidied, "/./")) {
21751 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21755 if (strstr(tidied, "/../")) {
21756 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21760 tidied_leaf = strrchr(tidied, '/');
21761 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21762 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21774 if eval $compile; then
21775 if $run ./try; then
21776 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21779 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21782 echo "I'm unable to compile the test program." >&4
21783 echo "I'll assume no _NSGetExecutablePath here." >&4
21786 set usensgetexecutablepath
21789 : Check if site customization support was requested
21790 case "$usesitecustomize" in
21791 $define|true|[Yy]*)
21792 usesitecustomize="$define"
21795 usesitecustomize="$undef"
21799 : see if prototypes support variable argument declarations
21801 case "$prototype$i_stdarg" in
21803 echo "It appears we'll be able to prototype varargs functions." >&4
21807 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21814 : determine compiler compiler
21823 if $test -f "$byacc$_exe"; then
21825 comp="byacc or $comp"
21827 if $test -f "$bison$_exe"; then
21828 comp="$comp or bison -y"
21830 rp="Which compiler compiler ($comp) shall I use?"
21839 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21845 : see if this is a assert.h system
21846 set assert.h i_assert
21849 : see if this is a fp.h system
21853 : see if this is a fp_class.h system
21854 set fp_class.h i_fp_class
21857 : see if gdbm.h is available
21862 : see if gdbm_open exists
21863 set gdbm_open d_gdbm_open
21865 case "$d_gdbm_open" in
21868 echo "We won't be including <gdbm.h>"
21877 : see if this is a ieeefp.h system
21878 case "$i_ieeefp" in
21879 '' ) set ieeefp.h i_ieeefp
21884 : see if this is a libutil.h system
21885 set libutil.h i_libutil
21888 : see if mach cthreads are available
21889 if test "X$usethreads" = "X$define"; then
21890 set mach/cthreads.h i_machcthr
21893 i_machcthr="$undef"
21896 : see if this is a mntent.h system
21897 set mntent.h i_mntent
21900 : see if net/errno.h is available
21902 set net/errno.h val
21905 : Unfortunately, it causes problems on some systems. Arrgh.
21908 cat > try.c <<'EOM'
21911 #include <net/errno.h>
21917 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21918 echo "We'll be including <net/errno.h>." >&4
21920 echo "We won't be including <net/errno.h>." >&4
21929 : see if netinet/tcp.h is available
21930 set netinet/tcp.h i_netinettcp
21933 : see if this is a poll.h system
21937 : see if this is a prot.h system
21941 : Preprocessor symbols
21943 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21944 $cat <<'EOSH' > Cppsym.know
21945 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21946 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21947 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21948 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21949 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21950 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21951 bull c cadmus clipper CMU COFF COMPILER_VERSION
21952 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21953 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21954 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21955 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21957 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21958 H3050R H3050RX hbullx20 hcx host_mips
21959 hp200 hp300 hp700 HP700 hp800 hp9000
21960 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21961 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21962 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21963 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21964 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21965 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21966 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21967 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21968 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21969 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21970 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21971 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21972 MATH_HAS_NO_SIDE_EFFECTS
21973 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21974 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21975 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21976 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21977 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21978 NetBSD news1500 news1700 news1800 news1900 news3700
21979 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21980 ns32016 ns32332 ns32k nsc32000
21981 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21982 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21983 pc532 pdp11 PGC PIC plexus PORTAR posix
21984 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21985 POSIX_C_SOURCE POSIX_SOURCE POWER
21986 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21987 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21988 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21989 sony sony_news sonyrisc sparc sparclite spectrum
21990 stardent stdc STDC_EXT stratos sun sun3 sun386
21991 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21992 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21993 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21994 sysV68 sysV88 Tek4132 Tek4300 titan
21995 TM3200 TM5400 TM5600
21996 tower tower32 tower32_200 tower32_600 tower32_700
21997 tower32_800 tower32_850 tss
21998 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21999 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22000 unix UNIX95 UNIX99 unixpc unos
22001 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22002 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22003 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22005 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22006 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22007 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22010 # Maybe put other stuff here too.
22011 cat <<EOSH >>Cppsym.know
22014 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22015 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22016 $cat Cppsym.know > Cppsym.c
22017 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22018 $rm -f Cppsym.a Cppsym.b Cppsym.c
22019 cat <<EOSH > Cppsym
22021 if $test \$# -gt 0; then
22022 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22023 if $test -s Cppsym.got; then
22030 $tr " " "$trnl" | ./Cppsym.try
22036 cat <<EOSH > Cppsym.try
22038 cat <<'EOCP' > try.c
22041 #define STRINGIFY(a) "a"
22043 #if cpp_stuff == 42
22044 #define StGiFy(a) #a
22045 #define STRINGIFY(a) StGiFy(a)
22047 #if $cpp_stuff != 1 && $cpp_stuff != 42
22048 # include "Bletch: How does this C preprocessor stringify macros?"
22054 cat <<'EOSH' >> Cppsym.try
22056 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22057 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22058 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22059 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22061 echo 'return 0;}' >> try.c
22063 cat <<EOSH >> Cppsym.try
22065 case "$osname-$gccversion" in
22066 irix-) ccflags="\$ccflags -woff 1178" ;;
22067 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22069 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22071 chmod +x Cppsym.try
22072 $eunicefix Cppsym.try
22073 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22074 : Add in any Linux cpp "predefined macros":
22075 case "$osname::$gccversion" in
22076 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22078 rm -f $tHdrH'.h' $tHdrH
22080 # Filter out macro arguments, such as Linux's __INT8_C(c)
22081 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22082 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22083 if [ -s $tHdrH'_cppsym.real' ]; then
22084 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22087 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22090 : now check the C compiler for additional symbols
22091 postprocess_cc_v=''
22093 aix) postprocess_cc_v="|$tr , ' '" ;;
22100 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22103 -D*) echo "\$i" | $sed 's/^-D//';;
22104 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22109 postprocess_cc_v=''
22112 ./ccsym > ccsym1.raw
22113 if $test -s ccsym1.raw; then
22114 $sort ccsym1.raw | $uniq >ccsym.raw
22116 mv ccsym1.raw ccsym.raw
22119 $awk '/\=/ { print $0; next }
22120 { print $0"=1" }' ccsym.raw >ccsym.list
22121 $comm -13 Cppsym.true ccsym.list >ccsym.own
22122 $comm -12 Cppsym.true ccsym.list >ccsym.com
22123 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22125 if $test -z ccsym.raw; then
22126 echo "Your C compiler doesn't seem to define any symbols!" >&4
22128 echo "However, your C preprocessor defines the following symbols:"
22131 cppsymbols=`$cat Cppsym.true`
22132 cppsymbols=`echo $cppsymbols`
22133 cppccsymbols="$cppsymbols"
22135 if $test -s ccsym.com; then
22136 echo "Your C compiler and pre-processor define these symbols:"
22137 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22140 cppccsymbols=`$cat ccsym.com`
22141 cppccsymbols=`echo $cppccsymbols`
22142 $test "$silent" || sleep 1
22144 if $test -s ccsym.cpp; then
22145 $test "$also" && echo " "
22146 echo "Your C pre-processor ${also}defines the following symbols:"
22147 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22149 cppsymbols=`$cat ccsym.cpp`
22150 cppsymbols=`echo $cppsymbols`
22151 $test "$silent" || sleep 1
22153 if $test -s ccsym.own; then
22154 $test "$also" && echo " "
22155 echo "Your C compiler ${also}defines the following cpp symbols:"
22156 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22157 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22158 ccsymbols=`$cat ccsym.own`
22159 ccsymbols=`echo $ccsymbols`
22160 $test "$silent" || sleep 1
22164 : see if this is a termio system
22168 if $test `./findhdr termios.h`; then
22169 set tcsetattr i_termios
22175 "$define") echo "You have POSIX termios.h... good!" >&4;;
22176 *) if ./Cppsym pyr; then
22177 case "`/bin/universe`" in
22178 ucb) if $test `./findhdr sgtty.h`; then
22180 echo "<sgtty.h> found." >&4
22182 echo "System is pyramid with BSD universe."
22183 ./warn "<sgtty.h> not found--you could have problems."
22185 *) if $test `./findhdr termio.h`; then
22187 echo "<termio.h> found." >&4
22189 echo "System is pyramid with USG universe."
22190 ./warn "<termio.h> not found--you could have problems."
22194 if $test `./findhdr termio.h`; then
22195 echo "<termio.h> found." >&4
22197 elif $test `./findhdr sgtty.h`; then
22198 echo "<sgtty.h> found." >&4
22201 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22204 if $test `./findhdr sgtty.h`; then
22205 echo "<sgtty.h> found." >&4
22207 elif $test `./findhdr termio.h`; then
22208 echo "<termio.h> found." >&4
22211 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22215 set i_termio; eval $setvar
22216 val=$val2; set i_sgtty; eval $setvar
22217 val=$val3; set i_termios; eval $setvar
22219 : see if stdbool is available
22220 : we want a real compile instead of Inhdr because some Solaris systems
22221 : have stdbool.h, but it can only be used if the compiler indicates it
22222 : is sufficiently c99-compliant.
22226 #include <stdbool.h>
22231 int main(int argc, char **argv)
22237 if eval $compile; then
22238 echo "<stdbool.h> found." >&4
22241 echo "<stdbool.h> NOT found." >&4
22248 : see if stddef is available
22249 set stddef.h i_stddef
22252 : see if sys/access.h is available
22253 set sys/access.h i_sysaccess
22256 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22257 set sys/filio.h i_sysfilio
22260 if $test `./findhdr sys/ioctl.h`; then
22262 echo '<sys/ioctl.h> found.' >&4
22265 if $test $i_sysfilio = "$define"; then
22266 echo '<sys/ioctl.h> NOT found.' >&4
22268 $test $i_sgtty = "$define" && xxx="sgtty.h"
22269 $test $i_termio = "$define" && xxx="termio.h"
22270 $test $i_termios = "$define" && xxx="termios.h"
22271 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22277 : see if socket ioctl defs are in sys/sockio.h
22279 xxx=`./findhdr sys/sockio.h`
22280 if $test "$xxx"; then
22281 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22283 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22286 echo "No socket ioctls found in <sys/sockio.h>." >&4
22291 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22297 : see if this is a syslog.h system
22298 set syslog.h i_syslog
22301 : see if this is a sys/mode.h system
22302 set sys/mode.h i_sysmode
22305 : see if there is a sys/poll.h file
22306 set sys/poll.h i_syspoll
22309 : see if sys/resource.h has to be included
22310 set sys/resource.h i_sysresrc
22313 : see if sys/security.h is available
22314 set sys/security.h i_syssecrt
22317 : see if this is a sys/statvfs.h system
22318 set sys/statvfs.h i_sysstatvfs
22321 : see if this is a sys/un.h system
22322 set sys/un.h i_sysun
22325 : see if this is a sys/utsname.h system
22326 set sys/utsname.h i_sysutsname
22329 : see if this is a syswait system
22330 set sys/wait.h i_syswait
22333 : see if this is a ustat.h system
22334 set ustat.h i_ustat
22337 : see if this is an utime system
22338 set utime.h i_utime
22341 : see if this is a vfork system
22344 set vfork.h i_vfork
22354 echo "Looking for extensions..." >&4
22355 : If we are using the old config.sh, known_extensions may contain
22356 : old or inaccurate or duplicate values.
22357 known_extensions=''
22358 nonxs_extensions=''
22359 : We do not use find because it might not be available.
22360 : We do not just use MANIFEST because the user may have dropped
22361 : some additional extensions into the source tree and expect them
22364 : Function to recursively find available extensions, ignoring DynaLoader
22365 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22366 : In 5.10.1 and later, extensions are stored in directories
22367 : like File-Glob instead of the older File/Glob/.
22371 DynaLoader|dynaload) ;;
22373 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22374 leaf=`echo $xxx | $sed -e s/.*-//`;
22375 if $test -d File; then
22376 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22377 known_extensions="$known_extensions $1$this_ext";
22378 elif $test -f $xxx/Makefile.PL; then
22379 nonxs_extensions="$nonxs_extensions $1$this_ext";
22381 if $test -d $xxx -a $# -lt 10; then
22384 eval $find_extensions;
22390 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22391 if $contains " $this_ext " $$.tmp; then
22393 echo "Duplicate directories detected for extension $xxx" >&4;
22394 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22395 case "$knowitall" in
22403 echo "Ok. Stopping Configure." >&4;
22404 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22407 echo "Ok. You will need to correct config.sh before running make." >&4;
22409 $ls -1 $xxx > $$.tmp;
22410 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22411 known_extensions="$known_extensions $this_ext";
22412 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22413 known_extensions="$known_extensions $this_ext";
22414 elif $test -d $xxx; then
22415 nonxs_extensions="$nonxs_extensions $this_ext";
22426 eval $find_extensions
22430 eval $find_extensions
22434 eval $find_extensions
22435 if $test -d File-Glob; then
22436 : All ext/ flattened
22438 # Special case: Add in modules that nest beyond the first level.
22439 # Currently threads/shared and Hash/Util/FieldHash, since they are
22440 # not picked up by the recursive find above (and adding in general
22441 # recursive finding breaks SDBM_File/sdbm).
22442 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22443 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22445 set X $known_extensions
22447 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22448 set X $nonxs_extensions
22450 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22453 : Now see which are supported on this system.
22455 for xxx in $known_extensions ; do
22459 $define) avail_ext="$avail_ext $xxx" ;;
22462 GDBM_File|gdbm_fil)
22464 $define) avail_ext="$avail_ext $xxx" ;;
22467 I18N/Langinfo|i18n_lan)
22468 case "$i_langinfo$d_nl_langinfo" in
22469 $define$define) avail_ext="$avail_ext $xxx" ;;
22473 : XXX Do we need a useipcsysv variable here
22474 case "${d_msg}${d_sem}${d_shm}" in
22475 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22478 NDBM_File|ndbm_fil)
22481 case "$osname-$use64bitint" in
22484 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22487 *) avail_ext="$avail_ext $xxx" ;;
22492 ODBM_File|odbm_fil)
22493 case "${i_dbm}${i_rpcsvcdbm}" in
22495 case "$d_cplusplus" in
22496 define) ;; # delete as a function name will not work
22497 *) case "$osname-$use64bitint" in
22500 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22503 *) avail_ext="$avail_ext $xxx" ;;
22511 case "$useopcode" in
22512 true|define|y) avail_ext="$avail_ext $xxx" ;;
22516 case "$useposix" in
22517 true|define|y) avail_ext="$avail_ext $xxx" ;;
22521 case "$d_socket" in
22522 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22525 Sys/Syslog|sys/syslog)
22526 : XXX syslog requires socket
22527 case "$d_socket" in
22528 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22532 case "$usethreads" in
22534 case "$use5005threads" in
22535 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22539 threads|threads/shared)
22540 # threads and threads::shared are special cases.
22541 # To stop people from asking "Perl 5.8.0 was supposed
22542 # to have this new fancy threads implementation but my
22543 # perl doesn't have it" and from people trying to
22544 # (re)install the threads module using CPAN.pm and
22545 # CPAN.pm then offering to reinstall Perl 5.8.0,
22546 # the threads.pm and threads/shared.pm will always be
22547 # there, croaking informatively ("you need to rebuild
22548 # all of Perl with threads, sorry") when threads haven't
22549 # been compiled in.
22551 avail_ext="$avail_ext $xxx"
22557 cygwin) avail_ext="$avail_ext $xxx" ;;
22560 XS/APItest|xs/apitest)
22561 # This is just for testing. Skip it unless we have dynamic loading.
22564 $define) avail_ext="$avail_ext $xxx" ;;
22567 XS/Typemap|xs/typemap)
22568 # This is just for testing. Skip it unless we have dynamic loading.
22570 $define) avail_ext="$avail_ext $xxx" ;;
22573 *) avail_ext="$avail_ext $xxx"
22582 case "$onlyextensions" in
22584 *) keepextensions=''
22585 echo "You have requested that only certain extensions be included..." >&4
22586 for i in $onlyextensions; do
22587 case " $avail_ext " in
22589 echo "Keeping extension $i."
22590 keepextensions="$keepextensions $i"
22592 *) echo "Ignoring extension $i." ;;
22595 avail_ext="$keepextensions"
22599 case "$noextensions" in
22601 *) keepextensions=''
22602 echo "You have requested that certain extensions be ignored..." >&4
22603 for i in $avail_ext; do
22604 case " $noextensions " in
22605 *" $i "*) echo "Ignoring extension $i." ;;
22606 *) echo "Keeping extension $i.";
22607 keepextensions="$keepextensions $i"
22611 avail_ext="$keepextensions"
22615 : Now see which nonxs extensions are supported on this system.
22616 : For now assume all are.
22618 for xxx in $nonxs_extensions ; do
22620 *) nonxs_ext="$nonxs_ext $xxx"
22632 A number of extensions are supplied with $package. You may choose to
22633 compile these extensions for dynamic loading (the default), compile
22634 them into the $package executable (static loading), or not include
22635 them at all. Answer "none" to include no extensions.
22636 Note that DynaLoader is always built and need not be mentioned here.
22639 case "$dynamic_ext" in
22641 : Exclude those listed in static_ext
22643 for xxx in $avail_ext; do
22644 case " $static_ext " in
22646 *) dflt="$dflt $xxx" ;;
22653 *) dflt="$dynamic_ext"
22654 # Perhaps we are reusing an old out-of-date config.sh.
22657 if test X"$dynamic_ext" != X"$avail_ext"; then
22659 NOTICE: Your previous config.sh list may be incorrect.
22660 The extensions now available to you are
22662 but the default list from your previous config.sh is
22674 rp="What extensions do you wish to load dynamically?"
22677 none) dynamic_ext=' ' ;;
22678 *) dynamic_ext="$ans" ;;
22681 case "$static_ext" in
22683 : Exclude those already listed in dynamic linking
22685 for xxx in $avail_ext; do
22686 case " $dynamic_ext " in
22688 *) dflt="$dflt $xxx" ;;
22695 *) dflt="$static_ext"
22702 rp="What extensions do you wish to load statically?"
22705 none) static_ext=' ' ;;
22706 *) static_ext="$ans" ;;
22711 A number of extensions are supplied with $package. Answer "none"
22712 to include no extensions.
22713 Note that DynaLoader is always built and need not be mentioned here.
22716 case "$static_ext" in
22717 '') dflt="$avail_ext" ;;
22718 *) dflt="$static_ext"
22719 # Perhaps we are reusing an old out-of-date config.sh.
22722 if test X"$static_ext" != X"$avail_ext"; then
22724 NOTICE: Your previous config.sh list may be incorrect.
22725 The extensions now available to you are
22727 but the default list from your previous config.sh is
22736 : Exclude those that are not xs extensions
22740 rp="What extensions do you wish to include?"
22743 none) static_ext=' ' ;;
22744 *) static_ext="$ans" ;;
22749 # Encode is a special case. If we are building Encode as a static
22750 # extension, we need to explicitly list its subextensions as well.
22751 # For other nested extensions, this is handled automatically by
22752 # the appropriate Makefile.PL.
22753 case " $static_ext " in
22754 *" Encode "*) # Add the subextensions of Encode
22756 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22757 static_ext="$static_ext Encode/$xxx"
22763 set X $dynamic_ext $static_ext $nonxs_ext
22767 # Sanity check: We require an extension suitable for use with
22768 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22769 # should show up as failures in the test suite, but it's helpful to
22770 # catch them now.) The 'extensions' list is normally sorted
22771 # alphabetically, so we need to accept either
22772 # DB_File ... Fcntl ... IO ....
22773 # or something like
22774 # Fcntl ... NDBM_File ... IO ....
22775 case " $extensions" in
22776 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22777 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22778 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22779 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22780 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22784 : Remove libraries needed only for extensions
22785 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22786 : The exception is SunOS 4.x, which needs them.
22787 case "${osname}X${osvers}" in
22791 *) case "$usedl" in
22792 $define|true|[yY]*)
22793 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22797 *) perllibs="$libs"
22803 : Remove build directory name from cppstdin so it can be used from
22804 : either the present location or the final installed location.
22806 : Get out of the UU directory to get correct path name.
22808 case "$cppstdin" in
22810 echo "Stripping down cppstdin path name"
22816 : end of configuration questions
22818 echo "End of configuration questions."
22821 : back to where it started
22822 if test -d ../UU; then
22826 : configuration may be unconditionally patched via a 'config.arch' file
22827 if $test -f config.arch; then
22828 echo "I see a config.arch file, loading it." >&4
22832 : configuration may be patched via a 'config.over' file
22833 if $test -f config.over; then
22836 rp='I see a config.over file. Do you wish to load it?'
22839 n*) echo "OK, I'll ignore it.";;
22841 echo "Configuration override changes have been loaded."
22846 : in case they want portability, strip down executable paths
22847 case "$d_portable" in
22850 echo "Stripping down executable paths..." >&4
22851 for file in $loclist $trylist; do
22853 eval $file=`basename $temp`
22858 : create config.sh file
22860 echo "Creating config.sh..." >&4
22861 $spitshell <<EOT >config.sh
22864 # This file was produced by running the Configure script. It holds all the
22865 # definitions figured out by Configure. Should you modify one of these values,
22866 # do not forget to propagate your changes by running "Configure -der". You may
22867 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22870 # Package name : $package
22871 # Source directory : $src
22872 # Configuration time: $cf_time
22873 # Configured by : $cf_by
22874 # Target system : $myuname
22877 : Add in command line options if available
22878 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22880 $spitshell <<EOT >>config.sh
22889 Revision='$Revision'
22897 alignbytes='$alignbytes'
22898 ansi2knr='$ansi2knr'
22899 aphostname='$aphostname'
22900 api_revision='$api_revision'
22901 api_subversion='$api_subversion'
22902 api_version='$api_version'
22903 api_versionstring='$api_versionstring'
22906 archlibexp='$archlibexp'
22907 archname64='$archname64'
22908 archname='$archname'
22909 archobjs='$archobjs'
22910 asctime_r_proto='$asctime_r_proto'
22918 bootstrap_charset='$bootstrap_charset'
22920 byteorder='$byteorder'
22922 castflags='$castflags'
22925 cccdlflags='$cccdlflags'
22926 ccdlflags='$ccdlflags'
22928 ccflags_uselargefiles='$ccflags_uselargefiles'
22930 ccsymbols='$ccsymbols'
22931 ccversion='$ccversion'
22933 cf_email='$cf_email'
22935 charbits='$charbits'
22936 charsize='$charsize'
22940 clocktype='$clocktype'
22942 compress='$compress'
22943 contains='$contains'
22947 cpp_stuff='$cpp_stuff'
22948 cppccsymbols='$cppccsymbols'
22949 cppflags='$cppflags'
22951 cppminus='$cppminus'
22953 cppstdin='$cppstdin'
22954 cppsymbols='$cppsymbols'
22955 crypt_r_proto='$crypt_r_proto'
22956 cryptlib='$cryptlib'
22958 ctermid_r_proto='$ctermid_r_proto'
22959 ctime_r_proto='$ctime_r_proto'
22960 d_Gconvert='$d_Gconvert'
22961 d_PRIEUldbl='$d_PRIEUldbl'
22962 d_PRIFUldbl='$d_PRIFUldbl'
22963 d_PRIGUldbl='$d_PRIGUldbl'
22964 d_PRIXU64='$d_PRIXU64'
22965 d_PRId64='$d_PRId64'
22966 d_PRIeldbl='$d_PRIeldbl'
22967 d_PRIfldbl='$d_PRIfldbl'
22968 d_PRIgldbl='$d_PRIgldbl'
22969 d_PRIi64='$d_PRIi64'
22970 d_PRIo64='$d_PRIo64'
22971 d_PRIu64='$d_PRIu64'
22972 d_PRIx64='$d_PRIx64'
22973 d_SCNfldbl='$d_SCNfldbl'
22974 d__fwalk='$d__fwalk'
22975 d_access='$d_access'
22976 d_accessx='$d_accessx'
22979 d_archlib='$d_archlib'
22980 d_asctime64='$d_asctime64'
22981 d_asctime_r='$d_asctime_r'
22984 d_attribute_deprecated='$d_attribute_deprecated'
22985 d_attribute_format='$d_attribute_format'
22986 d_attribute_malloc='$d_attribute_malloc'
22987 d_attribute_nonnull='$d_attribute_nonnull'
22988 d_attribute_noreturn='$d_attribute_noreturn'
22989 d_attribute_pure='$d_attribute_pure'
22990 d_attribute_unused='$d_attribute_unused'
22991 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22995 d_bsdgetpgrp='$d_bsdgetpgrp'
22996 d_bsdsetpgrp='$d_bsdsetpgrp'
22997 d_builtin_choose_expr='$d_builtin_choose_expr'
22998 d_builtin_expect='$d_builtin_expect'
23000 d_c99_variadic_macros='$d_c99_variadic_macros'
23001 d_casti32='$d_casti32'
23002 d_castneg='$d_castneg'
23003 d_charvspr='$d_charvspr'
23005 d_chroot='$d_chroot'
23006 d_chsize='$d_chsize'
23008 d_clearenv='$d_clearenv'
23009 d_closedir='$d_closedir'
23010 d_cmsghdr_s='$d_cmsghdr_s'
23012 d_copysignl='$d_copysignl'
23013 d_cplusplus='$d_cplusplus'
23015 d_crypt_r='$d_crypt_r'
23017 d_ctermid='$d_ctermid'
23018 d_ctermid_r='$d_ctermid_r'
23019 d_ctime64='$d_ctime64'
23020 d_ctime_r='$d_ctime_r'
23021 d_cuserid='$d_cuserid'
23022 d_dbl_dig='$d_dbl_dig'
23023 d_dbminitproto='$d_dbminitproto'
23024 d_difftime64='$d_difftime64'
23025 d_difftime='$d_difftime'
23026 d_dir_dd_fd='$d_dir_dd_fd'
23028 d_dirnamlen='$d_dirnamlen'
23029 d_dlerror='$d_dlerror'
23030 d_dlopen='$d_dlopen'
23031 d_dlsymun='$d_dlsymun'
23032 d_dosuid='$d_dosuid'
23033 d_drand48_r='$d_drand48_r'
23034 d_drand48proto='$d_drand48proto'
23036 d_eaccess='$d_eaccess'
23037 d_endgrent='$d_endgrent'
23038 d_endgrent_r='$d_endgrent_r'
23039 d_endhent='$d_endhent'
23040 d_endhostent_r='$d_endhostent_r'
23041 d_endnent='$d_endnent'
23042 d_endnetent_r='$d_endnetent_r'
23043 d_endpent='$d_endpent'
23044 d_endprotoent_r='$d_endprotoent_r'
23045 d_endpwent='$d_endpwent'
23046 d_endpwent_r='$d_endpwent_r'
23047 d_endsent='$d_endsent'
23048 d_endservent_r='$d_endservent_r'
23049 d_eofnblk='$d_eofnblk'
23050 d_eunice='$d_eunice'
23051 d_faststdio='$d_faststdio'
23052 d_fchdir='$d_fchdir'
23053 d_fchmod='$d_fchmod'
23054 d_fchown='$d_fchown'
23056 d_fcntl_can_lock='$d_fcntl_can_lock'
23057 d_fd_macros='$d_fd_macros'
23058 d_fd_set='$d_fd_set'
23059 d_fds_bits='$d_fds_bits'
23060 d_fgetpos='$d_fgetpos'
23061 d_finite='$d_finite'
23062 d_finitel='$d_finitel'
23063 d_flexfnam='$d_flexfnam'
23065 d_flockproto='$d_flockproto'
23067 d_fp_class='$d_fp_class'
23068 d_fpathconf='$d_fpathconf'
23069 d_fpclass='$d_fpclass'
23070 d_fpclassify='$d_fpclassify'
23071 d_fpclassl='$d_fpclassl'
23072 d_fpos64_t='$d_fpos64_t'
23073 d_frexpl='$d_frexpl'
23074 d_fs_data_s='$d_fs_data_s'
23075 d_fseeko='$d_fseeko'
23076 d_fsetpos='$d_fsetpos'
23077 d_fstatfs='$d_fstatfs'
23078 d_fstatvfs='$d_fstatvfs'
23080 d_ftello='$d_ftello'
23082 d_futimes='$d_futimes'
23083 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23084 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23085 d_getaddrinfo='$d_getaddrinfo'
23086 d_getcwd='$d_getcwd'
23087 d_getespwnam='$d_getespwnam'
23088 d_getfsstat='$d_getfsstat'
23089 d_getgrent='$d_getgrent'
23090 d_getgrent_r='$d_getgrent_r'
23091 d_getgrgid_r='$d_getgrgid_r'
23092 d_getgrnam_r='$d_getgrnam_r'
23093 d_getgrps='$d_getgrps'
23094 d_gethbyaddr='$d_gethbyaddr'
23095 d_gethbyname='$d_gethbyname'
23096 d_gethent='$d_gethent'
23097 d_gethname='$d_gethname'
23098 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23099 d_gethostbyname_r='$d_gethostbyname_r'
23100 d_gethostent_r='$d_gethostent_r'
23101 d_gethostprotos='$d_gethostprotos'
23102 d_getitimer='$d_getitimer'
23103 d_getlogin='$d_getlogin'
23104 d_getlogin_r='$d_getlogin_r'
23105 d_getmnt='$d_getmnt'
23106 d_getmntent='$d_getmntent'
23107 d_getnameinfo='$d_getnameinfo'
23108 d_getnbyaddr='$d_getnbyaddr'
23109 d_getnbyname='$d_getnbyname'
23110 d_getnent='$d_getnent'
23111 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23112 d_getnetbyname_r='$d_getnetbyname_r'
23113 d_getnetent_r='$d_getnetent_r'
23114 d_getnetprotos='$d_getnetprotos'
23115 d_getpagsz='$d_getpagsz'
23116 d_getpbyname='$d_getpbyname'
23117 d_getpbynumber='$d_getpbynumber'
23118 d_getpent='$d_getpent'
23119 d_getpgid='$d_getpgid'
23120 d_getpgrp2='$d_getpgrp2'
23121 d_getpgrp='$d_getpgrp'
23122 d_getppid='$d_getppid'
23123 d_getprior='$d_getprior'
23124 d_getprotobyname_r='$d_getprotobyname_r'
23125 d_getprotobynumber_r='$d_getprotobynumber_r'
23126 d_getprotoent_r='$d_getprotoent_r'
23127 d_getprotoprotos='$d_getprotoprotos'
23128 d_getprpwnam='$d_getprpwnam'
23129 d_getpwent='$d_getpwent'
23130 d_getpwent_r='$d_getpwent_r'
23131 d_getpwnam_r='$d_getpwnam_r'
23132 d_getpwuid_r='$d_getpwuid_r'
23133 d_getsbyname='$d_getsbyname'
23134 d_getsbyport='$d_getsbyport'
23135 d_getsent='$d_getsent'
23136 d_getservbyname_r='$d_getservbyname_r'
23137 d_getservbyport_r='$d_getservbyport_r'
23138 d_getservent_r='$d_getservent_r'
23139 d_getservprotos='$d_getservprotos'
23140 d_getspnam='$d_getspnam'
23141 d_getspnam_r='$d_getspnam_r'
23142 d_gettimeod='$d_gettimeod'
23143 d_gmtime64='$d_gmtime64'
23144 d_gmtime_r='$d_gmtime_r'
23145 d_gnulibc='$d_gnulibc'
23146 d_grpasswd='$d_grpasswd'
23147 d_hasmntopt='$d_hasmntopt'
23149 d_ilogbl='$d_ilogbl'
23150 d_inc_version_list='$d_inc_version_list'
23152 d_inetaton='$d_inetaton'
23153 d_inetntop='$d_inetntop'
23154 d_inetpton='$d_inetpton'
23155 d_int64_t='$d_int64_t'
23156 d_ip_mreq='$d_ip_mreq'
23157 d_ip_mreq_source='$d_ip_mreq_source'
23158 d_ipv6_mreq='$d_ipv6_mreq'
23159 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23160 d_isascii='$d_isascii'
23161 d_isblank='$d_isblank'
23162 d_isfinite='$d_isfinite'
23165 d_isnanl='$d_isnanl'
23166 d_killpg='$d_killpg'
23167 d_lchown='$d_lchown'
23168 d_ldbl_dig='$d_ldbl_dig'
23169 d_libm_lib_version='$d_libm_lib_version'
23171 d_localtime64='$d_localtime64'
23172 d_localtime_r='$d_localtime_r'
23173 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23174 d_locconv='$d_locconv'
23176 d_longdbl='$d_longdbl'
23177 d_longlong='$d_longlong'
23178 d_lseekproto='$d_lseekproto'
23180 d_madvise='$d_madvise'
23181 d_malloc_good_size='$d_malloc_good_size'
23182 d_malloc_size='$d_malloc_size'
23184 d_mbstowcs='$d_mbstowcs'
23185 d_mbtowc='$d_mbtowc'
23186 d_memchr='$d_memchr'
23187 d_memcmp='$d_memcmp'
23188 d_memcpy='$d_memcpy'
23189 d_memmove='$d_memmove'
23190 d_memset='$d_memset'
23192 d_mkdtemp='$d_mkdtemp'
23193 d_mkfifo='$d_mkfifo'
23194 d_mkstemp='$d_mkstemp'
23195 d_mkstemps='$d_mkstemps'
23196 d_mktime64='$d_mktime64'
23197 d_mktime='$d_mktime'
23200 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23201 d_modflproto='$d_modflproto'
23202 d_mprotect='$d_mprotect'
23204 d_msg_ctrunc='$d_msg_ctrunc'
23205 d_msg_dontroute='$d_msg_dontroute'
23206 d_msg_oob='$d_msg_oob'
23207 d_msg_peek='$d_msg_peek'
23208 d_msg_proxy='$d_msg_proxy'
23209 d_msgctl='$d_msgctl'
23210 d_msgget='$d_msgget'
23211 d_msghdr_s='$d_msghdr_s'
23212 d_msgrcv='$d_msgrcv'
23213 d_msgsnd='$d_msgsnd'
23215 d_munmap='$d_munmap'
23216 d_mymalloc='$d_mymalloc'
23218 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23220 d_nl_langinfo='$d_nl_langinfo'
23221 d_nv_preserves_uv='$d_nv_preserves_uv'
23222 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23223 d_off64_t='$d_off64_t'
23224 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23225 d_oldpthreads='$d_oldpthreads'
23226 d_oldsock='$d_oldsock'
23228 d_pathconf='$d_pathconf'
23230 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23231 d_phostname='$d_phostname'
23234 d_portable='$d_portable'
23236 d_prctl_set_name='$d_prctl_set_name'
23237 d_printf_format_null='$d_printf_format_null'
23238 d_procselfexe='$d_procselfexe'
23239 d_pseudofork='$d_pseudofork'
23240 d_pthread_atfork='$d_pthread_atfork'
23241 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23242 d_pthread_yield='$d_pthread_yield'
23244 d_pwchange='$d_pwchange'
23245 d_pwclass='$d_pwclass'
23246 d_pwcomment='$d_pwcomment'
23247 d_pwexpire='$d_pwexpire'
23248 d_pwgecos='$d_pwgecos'
23249 d_pwpasswd='$d_pwpasswd'
23250 d_pwquota='$d_pwquota'
23253 d_random_r='$d_random_r'
23254 d_readdir64_r='$d_readdir64_r'
23255 d_readdir='$d_readdir'
23256 d_readdir_r='$d_readdir_r'
23257 d_readlink='$d_readlink'
23259 d_recvmsg='$d_recvmsg'
23260 d_rename='$d_rename'
23261 d_rewinddir='$d_rewinddir'
23263 d_safebcpy='$d_safebcpy'
23264 d_safemcpy='$d_safemcpy'
23265 d_sanemcmp='$d_sanemcmp'
23266 d_sbrkproto='$d_sbrkproto'
23267 d_scalbnl='$d_scalbnl'
23268 d_sched_yield='$d_sched_yield'
23269 d_scm_rights='$d_scm_rights'
23270 d_seekdir='$d_seekdir'
23271 d_select='$d_select'
23273 d_semctl='$d_semctl'
23274 d_semctl_semid_ds='$d_semctl_semid_ds'
23275 d_semctl_semun='$d_semctl_semun'
23276 d_semget='$d_semget'
23278 d_sendmsg='$d_sendmsg'
23279 d_setegid='$d_setegid'
23280 d_seteuid='$d_seteuid'
23281 d_setgrent='$d_setgrent'
23282 d_setgrent_r='$d_setgrent_r'
23283 d_setgrps='$d_setgrps'
23284 d_sethent='$d_sethent'
23285 d_sethostent_r='$d_sethostent_r'
23286 d_setitimer='$d_setitimer'
23287 d_setlinebuf='$d_setlinebuf'
23288 d_setlocale='$d_setlocale'
23289 d_setlocale_r='$d_setlocale_r'
23290 d_setnent='$d_setnent'
23291 d_setnetent_r='$d_setnetent_r'
23292 d_setpent='$d_setpent'
23293 d_setpgid='$d_setpgid'
23294 d_setpgrp2='$d_setpgrp2'
23295 d_setpgrp='$d_setpgrp'
23296 d_setprior='$d_setprior'
23297 d_setproctitle='$d_setproctitle'
23298 d_setprotoent_r='$d_setprotoent_r'
23299 d_setpwent='$d_setpwent'
23300 d_setpwent_r='$d_setpwent_r'
23301 d_setregid='$d_setregid'
23302 d_setresgid='$d_setresgid'
23303 d_setresuid='$d_setresuid'
23304 d_setreuid='$d_setreuid'
23305 d_setrgid='$d_setrgid'
23306 d_setruid='$d_setruid'
23307 d_setsent='$d_setsent'
23308 d_setservent_r='$d_setservent_r'
23309 d_setsid='$d_setsid'
23310 d_setvbuf='$d_setvbuf'
23314 d_shmatprototype='$d_shmatprototype'
23315 d_shmctl='$d_shmctl'
23317 d_shmget='$d_shmget'
23318 d_sigaction='$d_sigaction'
23319 d_signbit='$d_signbit'
23320 d_sigprocmask='$d_sigprocmask'
23321 d_sigsetjmp='$d_sigsetjmp'
23322 d_sin6_scope_id='$d_sin6_scope_id'
23323 d_sitearch='$d_sitearch'
23324 d_snprintf='$d_snprintf'
23325 d_sockaddr_in6='$d_sockaddr_in6'
23326 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23327 d_sockatmark='$d_sockatmark'
23328 d_sockatmarkproto='$d_sockatmarkproto'
23329 d_socket='$d_socket'
23330 d_socklen_t='$d_socklen_t'
23331 d_sockpair='$d_sockpair'
23332 d_socks5_init='$d_socks5_init'
23333 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23335 d_srand48_r='$d_srand48_r'
23336 d_srandom_r='$d_srandom_r'
23337 d_sresgproto='$d_sresgproto'
23338 d_sresuproto='$d_sresuproto'
23339 d_statblks='$d_statblks'
23340 d_statfs_f_flags='$d_statfs_f_flags'
23341 d_statfs_s='$d_statfs_s'
23342 d_static_inline='$d_static_inline'
23343 d_statvfs='$d_statvfs'
23344 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23345 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23346 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23347 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23348 d_stdio_stream_array='$d_stdio_stream_array'
23349 d_stdiobase='$d_stdiobase'
23350 d_stdstdio='$d_stdstdio'
23351 d_strchr='$d_strchr'
23352 d_strcoll='$d_strcoll'
23353 d_strctcpy='$d_strctcpy'
23354 d_strerrm='$d_strerrm'
23355 d_strerror='$d_strerror'
23356 d_strerror_r='$d_strerror_r'
23357 d_strftime='$d_strftime'
23358 d_strlcat='$d_strlcat'
23359 d_strlcpy='$d_strlcpy'
23360 d_strtod='$d_strtod'
23361 d_strtol='$d_strtol'
23362 d_strtold='$d_strtold'
23363 d_strtoll='$d_strtoll'
23364 d_strtoq='$d_strtoq'
23365 d_strtoul='$d_strtoul'
23366 d_strtoull='$d_strtoull'
23367 d_strtouq='$d_strtouq'
23368 d_strxfrm='$d_strxfrm'
23369 d_suidsafe='$d_suidsafe'
23370 d_symlink='$d_symlink'
23371 d_syscall='$d_syscall'
23372 d_syscallproto='$d_syscallproto'
23373 d_sysconf='$d_sysconf'
23374 d_sysernlst='$d_sysernlst'
23375 d_syserrlst='$d_syserrlst'
23376 d_system='$d_system'
23377 d_tcgetpgrp='$d_tcgetpgrp'
23378 d_tcsetpgrp='$d_tcsetpgrp'
23379 d_telldir='$d_telldir'
23380 d_telldirproto='$d_telldirproto'
23382 d_timegm='$d_timegm'
23384 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23385 d_tm_tm_zone='$d_tm_tm_zone'
23386 d_tmpnam_r='$d_tmpnam_r'
23387 d_truncate='$d_truncate'
23388 d_ttyname_r='$d_ttyname_r'
23389 d_tzname='$d_tzname'
23390 d_u32align='$d_u32align'
23391 d_ualarm='$d_ualarm'
23394 d_union_semun='$d_union_semun'
23395 d_unordered='$d_unordered'
23396 d_unsetenv='$d_unsetenv'
23397 d_usleep='$d_usleep'
23398 d_usleepproto='$d_usleepproto'
23400 d_vendorarch='$d_vendorarch'
23401 d_vendorbin='$d_vendorbin'
23402 d_vendorlib='$d_vendorlib'
23403 d_vendorscript='$d_vendorscript'
23405 d_void_closedir='$d_void_closedir'
23406 d_voidsig='$d_voidsig'
23407 d_voidtty='$d_voidtty'
23408 d_volatile='$d_volatile'
23409 d_vprintf='$d_vprintf'
23410 d_vsnprintf='$d_vsnprintf'
23412 d_waitpid='$d_waitpid'
23413 d_wcstombs='$d_wcstombs'
23414 d_wctomb='$d_wctomb'
23415 d_writev='$d_writev'
23418 db_hashtype='$db_hashtype'
23419 db_prefixtype='$db_prefixtype'
23420 db_version_major='$db_version_major'
23421 db_version_minor='$db_version_minor'
23422 db_version_patch='$db_version_patch'
23423 defvoidused='$defvoidused'
23424 direntrytype='$direntrytype'
23427 doublesize='$doublesize'
23429 drand48_r_proto='$drand48_r_proto'
23431 dynamic_ext='$dynamic_ext'
23437 endgrent_r_proto='$endgrent_r_proto'
23438 endhostent_r_proto='$endhostent_r_proto'
23439 endnetent_r_proto='$endnetent_r_proto'
23440 endprotoent_r_proto='$endprotoent_r_proto'
23441 endpwent_r_proto='$endpwent_r_proto'
23442 endservent_r_proto='$endservent_r_proto'
23443 eunicefix='$eunicefix'
23446 extensions='$extensions'
23447 extern_C='$extern_C'
23449 fflushNULL='$fflushNULL'
23450 fflushall='$fflushall'
23452 firstmakefile='$firstmakefile'
23454 fpossize='$fpossize'
23455 fpostype='$fpostype'
23456 freetype='$freetype'
23459 full_csh='$full_csh'
23460 full_sed='$full_sed'
23461 gccansipedantic='$gccansipedantic'
23462 gccosandvers='$gccosandvers'
23463 gccversion='$gccversion'
23464 getgrent_r_proto='$getgrent_r_proto'
23465 getgrgid_r_proto='$getgrgid_r_proto'
23466 getgrnam_r_proto='$getgrnam_r_proto'
23467 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23468 gethostbyname_r_proto='$gethostbyname_r_proto'
23469 gethostent_r_proto='$gethostent_r_proto'
23470 getlogin_r_proto='$getlogin_r_proto'
23471 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23472 getnetbyname_r_proto='$getnetbyname_r_proto'
23473 getnetent_r_proto='$getnetent_r_proto'
23474 getprotobyname_r_proto='$getprotobyname_r_proto'
23475 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23476 getprotoent_r_proto='$getprotoent_r_proto'
23477 getpwent_r_proto='$getpwent_r_proto'
23478 getpwnam_r_proto='$getpwnam_r_proto'
23479 getpwuid_r_proto='$getpwuid_r_proto'
23480 getservbyname_r_proto='$getservbyname_r_proto'
23481 getservbyport_r_proto='$getservbyport_r_proto'
23482 getservent_r_proto='$getservent_r_proto'
23483 getspnam_r_proto='$getspnam_r_proto'
23484 gidformat='$gidformat'
23490 gmtime_r_proto='$gmtime_r_proto'
23491 gnulibc_version='$gnulibc_version'
23493 groupcat='$groupcat'
23494 groupstype='$groupstype'
23497 h_sysfile='$h_sysfile'
23500 html1dir='$html1dir'
23501 html1direxp='$html1direxp'
23502 html3dir='$html3dir'
23503 html3direxp='$html3direxp'
23512 i_arpainet='$i_arpainet'
23513 i_assert='$i_assert'
23514 i_bsdioctl='$i_bsdioctl'
23518 i_dirent='$i_dirent'
23524 i_fp_class='$i_fp_class'
23526 i_gdbm_ndbm='$i_gdbm_ndbm'
23527 i_gdbmndbm='$i_gdbmndbm'
23529 i_ieeefp='$i_ieeefp'
23530 i_inttypes='$i_inttypes'
23531 i_langinfo='$i_langinfo'
23532 i_libutil='$i_libutil'
23533 i_limits='$i_limits'
23534 i_locale='$i_locale'
23535 i_machcthr='$i_machcthr'
23536 i_malloc='$i_malloc'
23537 i_mallocmalloc='$i_mallocmalloc'
23539 i_memory='$i_memory'
23540 i_mntent='$i_mntent'
23543 i_neterrno='$i_neterrno'
23544 i_netinettcp='$i_netinettcp'
23548 i_pthread='$i_pthread'
23550 i_rpcsvcdbm='$i_rpcsvcdbm'
23553 i_shadow='$i_shadow'
23555 i_stdarg='$i_stdarg'
23556 i_stdbool='$i_stdbool'
23557 i_stddef='$i_stddef'
23558 i_stdlib='$i_stdlib'
23559 i_string='$i_string'
23560 i_sunmath='$i_sunmath'
23561 i_sysaccess='$i_sysaccess'
23562 i_sysdir='$i_sysdir'
23563 i_sysfile='$i_sysfile'
23564 i_sysfilio='$i_sysfilio'
23566 i_sysioctl='$i_sysioctl'
23567 i_syslog='$i_syslog'
23568 i_sysmman='$i_sysmman'
23569 i_sysmode='$i_sysmode'
23570 i_sysmount='$i_sysmount'
23571 i_sysndir='$i_sysndir'
23572 i_sysparam='$i_sysparam'
23573 i_syspoll='$i_syspoll'
23574 i_sysresrc='$i_sysresrc'
23575 i_syssecrt='$i_syssecrt'
23576 i_sysselct='$i_sysselct'
23577 i_syssockio='$i_syssockio'
23578 i_sysstat='$i_sysstat'
23579 i_sysstatfs='$i_sysstatfs'
23580 i_sysstatvfs='$i_sysstatvfs'
23581 i_systime='$i_systime'
23582 i_systimek='$i_systimek'
23583 i_systimes='$i_systimes'
23584 i_systypes='$i_systypes'
23585 i_sysuio='$i_sysuio'
23587 i_sysutsname='$i_sysutsname'
23588 i_sysvfs='$i_sysvfs'
23589 i_syswait='$i_syswait'
23590 i_termio='$i_termio'
23591 i_termios='$i_termios'
23593 i_unistd='$i_unistd'
23596 i_values='$i_values'
23597 i_varargs='$i_varargs'
23598 i_varhdr='$i_varhdr'
23600 ignore_versioned_solibs='$ignore_versioned_solibs'
23601 inc_version_list='$inc_version_list'
23602 inc_version_list_init='$inc_version_list_init'
23605 initialinstalllocation='$initialinstalllocation'
23606 installarchlib='$installarchlib'
23607 installbin='$installbin'
23608 installhtml1dir='$installhtml1dir'
23609 installhtml3dir='$installhtml3dir'
23610 installman1dir='$installman1dir'
23611 installman3dir='$installman3dir'
23612 installprefix='$installprefix'
23613 installprefixexp='$installprefixexp'
23614 installprivlib='$installprivlib'
23615 installscript='$installscript'
23616 installsitearch='$installsitearch'
23617 installsitebin='$installsitebin'
23618 installsitehtml1dir='$installsitehtml1dir'
23619 installsitehtml3dir='$installsitehtml3dir'
23620 installsitelib='$installsitelib'
23621 installsiteman1dir='$installsiteman1dir'
23622 installsiteman3dir='$installsiteman3dir'
23623 installsitescript='$installsitescript'
23624 installstyle='$installstyle'
23625 installusrbinperl='$installusrbinperl'
23626 installvendorarch='$installvendorarch'
23627 installvendorbin='$installvendorbin'
23628 installvendorhtml1dir='$installvendorhtml1dir'
23629 installvendorhtml3dir='$installvendorhtml3dir'
23630 installvendorlib='$installvendorlib'
23631 installvendorman1dir='$installvendorman1dir'
23632 installvendorman3dir='$installvendorman3dir'
23633 installvendorscript='$installvendorscript'
23635 issymlink='$issymlink'
23636 ivdformat='$ivdformat'
23639 known_extensions='$known_extensions'
23642 ld_can_script='$ld_can_script'
23643 lddlflags='$lddlflags'
23645 ldflags_uselargefiles='$ldflags_uselargefiles'
23646 ldlibpthname='$ldlibpthname'
23653 libsdirs='$libsdirs'
23654 libsfiles='$libsfiles'
23655 libsfound='$libsfound'
23656 libspath='$libspath'
23657 libswanted='$libswanted'
23658 libswanted_uselargefiles='$libswanted_uselargefiles'
23664 localtime_r_proto='$localtime_r_proto'
23665 locincpth='$locincpth'
23666 loclibpth='$loclibpth'
23667 longdblsize='$longdblsize'
23668 longlongsize='$longlongsize'
23669 longsize='$longsize'
23673 lseeksize='$lseeksize'
23674 lseektype='$lseektype'
23677 madlyobj='$madlyobj'
23678 madlysrc='$madlysrc'
23682 make_set_make='$make_set_make'
23683 mallocobj='$mallocobj'
23684 mallocsrc='$mallocsrc'
23685 malloctype='$malloctype'
23687 man1direxp='$man1direxp'
23690 man3direxp='$man3direxp'
23692 mips_type='$mips_type'
23693 mistrustnm='$mistrustnm'
23695 mmaptype='$mmaptype'
23696 modetype='$modetype'
23698 multiarch='$multiarch'
23700 myarchname='$myarchname'
23701 mydomain='$mydomain'
23702 myhostname='$myhostname'
23705 need_va_copy='$need_va_copy'
23706 netdb_hlen_type='$netdb_hlen_type'
23707 netdb_host_type='$netdb_host_type'
23708 netdb_name_type='$netdb_name_type'
23709 netdb_net_type='$netdb_net_type'
23712 nm_so_opt='$nm_so_opt'
23713 nonxs_ext='$nonxs_ext'
23715 nvEUformat='$nvEUformat'
23716 nvFUformat='$nvFUformat'
23717 nvGUformat='$nvGUformat'
23718 nv_overflows_integers_at='$nv_overflows_integers_at'
23719 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23720 nveformat='$nveformat'
23721 nvfformat='$nvfformat'
23722 nvgformat='$nvgformat'
23725 o_nonblock='$o_nonblock'
23727 old_pthread_create_joinable='$old_pthread_create_joinable'
23728 optimize='$optimize'
23729 orderlib='$orderlib'
23732 otherlibdirs='$otherlibdirs'
23736 patchlevel='$patchlevel'
23737 path_sep='$path_sep'
23740 perl_patchlevel='$perl_patchlevel'
23741 perl_static_inline='$perl_static_inline'
23742 perladmin='$perladmin'
23743 perllibs='$perllibs'
23744 perlpath='$perlpath'
23746 phostname='$phostname'
23752 prefixexp='$prefixexp'
23754 privlibexp='$privlibexp'
23755 procselfexe='$procselfexe'
23756 prototype='$prototype'
23758 quadkind='$quadkind'
23759 quadtype='$quadtype'
23760 randbits='$randbits'
23761 randfunc='$randfunc'
23762 random_r_proto='$random_r_proto'
23763 randseedtype='$randseedtype'
23765 rd_nodata='$rd_nodata'
23766 readdir64_r_proto='$readdir64_r_proto'
23767 readdir_r_proto='$readdir_r_proto'
23768 revision='$revision'
23774 sGMTIME_max='$sGMTIME_max'
23775 sGMTIME_min='$sGMTIME_min'
23776 sLOCALTIME_max='$sLOCALTIME_max'
23777 sLOCALTIME_min='$sLOCALTIME_min'
23778 sPRIEUldbl='$sPRIEUldbl'
23779 sPRIFUldbl='$sPRIFUldbl'
23780 sPRIGUldbl='$sPRIGUldbl'
23781 sPRIXU64='$sPRIXU64'
23783 sPRIeldbl='$sPRIeldbl'
23784 sPRIfldbl='$sPRIfldbl'
23785 sPRIgldbl='$sPRIgldbl'
23790 sSCNfldbl='$sSCNfldbl'
23791 sched_yield='$sched_yield'
23792 scriptdir='$scriptdir'
23793 scriptdirexp='$scriptdirexp'
23795 seedfunc='$seedfunc'
23796 selectminbits='$selectminbits'
23797 selecttype='$selecttype'
23798 sendmail='$sendmail'
23799 setgrent_r_proto='$setgrent_r_proto'
23800 sethostent_r_proto='$sethostent_r_proto'
23801 setlocale_r_proto='$setlocale_r_proto'
23802 setnetent_r_proto='$setnetent_r_proto'
23803 setprotoent_r_proto='$setprotoent_r_proto'
23804 setpwent_r_proto='$setpwent_r_proto'
23805 setservent_r_proto='$setservent_r_proto'
23808 sharpbang='$sharpbang'
23809 shmattype='$shmattype'
23810 shortsize='$shortsize'
23813 sig_count='$sig_count'
23814 sig_name='$sig_name'
23815 sig_name_init='$sig_name_init'
23817 sig_num_init='$sig_num_init'
23818 sig_size='$sig_size'
23819 signal_t='$signal_t'
23820 sitearch='$sitearch'
23821 sitearchexp='$sitearchexp'
23823 sitebinexp='$sitebinexp'
23824 sitehtml1dir='$sitehtml1dir'
23825 sitehtml1direxp='$sitehtml1direxp'
23826 sitehtml3dir='$sitehtml3dir'
23827 sitehtml3direxp='$sitehtml3direxp'
23829 sitelib_stem='$sitelib_stem'
23830 sitelibexp='$sitelibexp'
23831 siteman1dir='$siteman1dir'
23832 siteman1direxp='$siteman1direxp'
23833 siteman3dir='$siteman3dir'
23834 siteman3direxp='$siteman3direxp'
23835 siteprefix='$siteprefix'
23836 siteprefixexp='$siteprefixexp'
23837 sitescript='$sitescript'
23838 sitescriptexp='$sitescriptexp'
23839 sizesize='$sizesize'
23840 sizetype='$sizetype'
23844 sockethdr='$sockethdr'
23845 socketlib='$socketlib'
23846 socksizetype='$socksizetype'
23848 spackage='$spackage'
23849 spitshell='$spitshell'
23850 srand48_r_proto='$srand48_r_proto'
23851 srandom_r_proto='$srandom_r_proto'
23853 ssizetype='$ssizetype'
23854 st_ino_sign='$st_ino_sign'
23855 st_ino_size='$st_ino_size'
23856 startperl='$startperl'
23858 static_ext='$static_ext'
23860 stdio_base='$stdio_base'
23861 stdio_bufsiz='$stdio_bufsiz'
23862 stdio_cnt='$stdio_cnt'
23863 stdio_filbuf='$stdio_filbuf'
23864 stdio_ptr='$stdio_ptr'
23865 stdio_stream_array='$stdio_stream_array'
23866 strerror_r_proto='$strerror_r_proto'
23869 subversion='$subversion'
23873 targetarch='$targetarch'
23877 timeincl='$timeincl'
23878 timetype='$timetype'
23879 tmpnam_r_proto='$tmpnam_r_proto'
23885 ttyname_r_proto='$ttyname_r_proto'
23894 uidformat='$uidformat'
23900 uquadtype='$uquadtype'
23901 use5005threads='$use5005threads'
23902 use64bitall='$use64bitall'
23903 use64bitint='$use64bitint'
23904 usecrosscompile='$usecrosscompile'
23905 usedevel='$usedevel'
23907 usedtrace='$usedtrace'
23908 usefaststdio='$usefaststdio'
23909 useithreads='$useithreads'
23910 usekernprocpathname='$usekernprocpathname'
23911 uselargefiles='$uselargefiles'
23912 uselongdouble='$uselongdouble'
23913 usemallocwrap='$usemallocwrap'
23914 usemorebits='$usemorebits'
23915 usemultiplicity='$usemultiplicity'
23916 usemymalloc='$usemymalloc'
23918 usensgetexecutablepath='$usensgetexecutablepath'
23919 useopcode='$useopcode'
23920 useperlio='$useperlio'
23921 useposix='$useposix'
23922 usereentrant='$usereentrant'
23923 userelocatableinc='$userelocatableinc'
23925 useshrplib='$useshrplib'
23926 usesitecustomize='$usesitecustomize'
23927 usesocks='$usesocks'
23928 usethreads='$usethreads'
23929 usevendorprefix='$usevendorprefix'
23930 useversionedarchname='$useversionedarchname'
23931 usevfork='$usevfork'
23934 uvXUformat='$uvXUformat'
23935 uvoformat='$uvoformat'
23938 uvuformat='$uvuformat'
23939 uvxformat='$uvxformat'
23941 vendorarch='$vendorarch'
23942 vendorarchexp='$vendorarchexp'
23943 vendorbin='$vendorbin'
23944 vendorbinexp='$vendorbinexp'
23945 vendorhtml1dir='$vendorhtml1dir'
23946 vendorhtml1direxp='$vendorhtml1direxp'
23947 vendorhtml3dir='$vendorhtml3dir'
23948 vendorhtml3direxp='$vendorhtml3direxp'
23949 vendorlib='$vendorlib'
23950 vendorlib_stem='$vendorlib_stem'
23951 vendorlibexp='$vendorlibexp'
23952 vendorman1dir='$vendorman1dir'
23953 vendorman1direxp='$vendorman1direxp'
23954 vendorman3dir='$vendorman3dir'
23955 vendorman3direxp='$vendorman3direxp'
23956 vendorprefix='$vendorprefix'
23957 vendorprefixexp='$vendorprefixexp'
23958 vendorscript='$vendorscript'
23959 vendorscriptexp='$vendorscriptexp'
23961 version_patchlevel_string='$version_patchlevel_string'
23962 versiononly='$versiononly'
23964 voidflags='$voidflags'
23967 yaccflags='$yaccflags'
23972 : add special variables
23973 $test -f $src/patchlevel.h && \
23974 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23975 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23976 echo "PERL_CONFIG_SH=true" >>config.sh
23978 : propagate old symbols
23979 if $test -f UU/config.sh; then
23980 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23981 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23982 config.sh config.sh UU/oldconfig.sh |\
23983 $sort | $uniq -u >UU/oldsyms
23984 set X `$cat UU/oldsyms`
23990 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23992 echo ": Variables propagated from previous config.sh file." >>config.sh
23993 for sym in `$cat UU/oldsyms`; do
23994 echo " Propagating $hint variable "'$'"$sym..."
23995 eval 'tmp="$'"${sym}"'"'
23997 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24003 : Finish up by extracting the .SH files
24007 echo "Extraction done."
24017 If you'd like to make any changes to the config.sh file before I begin
24018 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24021 rp="Press return or use a shell escape to edit config.sh:"
24026 *) : in case they cannot read
24027 sh 1>&4 -c "$ans";;
24032 : if this fails, just run all the .SH files by hand
24041 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24048 Now you need to generate make dependencies by running "$make depend".
24049 You might prefer to run it in background: "$make depend > makedepend.out &"
24050 It can take a while, so you might not want to run it right now.
24055 rp="Run $make depend now?"
24059 $make depend && echo "Now you must run '$make'."
24062 echo "You must run '$make depend' then '$make'."
24065 elif test -f [Mm]akefile; then
24067 echo "Now you must run a $make."
24069 echo "Configure done."
24072 if $test -f Policy.sh; then
24075 If you compile $package on a different machine or from a different object
24076 directory, copy the Policy.sh file from this object directory to the
24077 new one before you run Configure -- this will help you with most of
24078 the policy defaults.
24082 if $test -f config.msg; then
24083 echo "Hmm. I also noted the following information while running:"
24085 $cat config.msg >&4
24088 $rm -f kit*isdone ark*isdone