3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Wed Jan 1 18:06:40 CET 2014 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
339 useversionedarchname=''
345 initialinstalllocation=''
374 d_attribute_deprecated=''
375 d_attribute_format=''
376 d_attribute_malloc=''
377 d_attribute_nonnull=''
378 d_attribute_noreturn=''
380 d_attribute_unused=''
381 d_attribute_warn_unused_result=''
382 d_printf_format_null=''
385 d_builtin_choose_expr=''
388 d_c99_variadic_macros=''
435 endhostent_r_proto=''
441 endprotoent_r_proto=''
447 endservent_r_proto=''
500 gethostbyaddr_r_proto=''
502 gethostbyname_r_proto=''
504 gethostent_r_proto=''
517 getnetbyaddr_r_proto=''
519 getnetbyname_r_proto=''
533 d_getprotobyname_r=''
534 getprotobyname_r_proto=''
535 d_getprotobynumber_r=''
536 getprotobynumber_r_proto=''
538 getprotoent_r_proto=''
550 getservbyname_r_proto=''
552 getservbyport_r_proto=''
554 getservent_r_proto=''
581 d_libm_lib_version=''
585 d_localtime_r_needs_tzset=''
596 d_malloc_good_size=''
640 d_old_pthread_create_joinable=''
641 old_pthread_create_joinable=''
643 d_pthread_attr_setscope=''
682 sethostent_r_proto=''
699 setprotoent_r_proto=''
711 setservent_r_proto=''
733 d_ipv6_mreq_source=''
750 d_sprintf_returns_strlen=''
762 perl_static_inline=''
767 d_stdio_ptr_lval_nochange_cnt=''
768 d_stdio_ptr_lval_sets_cnt=''
913 d_gdbm_ndbm_h_uses_prototypes=''
914 d_gdbmndbm_h_uses_prototypes=''
916 d_ndbm_h_uses_prototypes=''
990 d_inc_version_list=''
992 inc_version_list_init=''
1011 ignore_versioned_solibs=''
1075 d_perl_otherlibdirs=''
1083 api_versionstring=''
1089 version_patchlevel_string=''
1093 d_nv_preserves_uv=''
1094 d_nv_zero_is_allbits_zero=''
1105 nv_overflows_integers_at=''
1106 nv_preserves_uv_bits=''
1178 installsitehtml1dir=''
1181 installsitehtml3dir=''
1188 installsiteman1dir=''
1191 installsiteman3dir=''
1196 installsitescript=''
1213 d_stdio_stream_array=''
1214 stdio_stream_array=''
1231 usekernprocpathname=''
1232 ccflags_uselargefiles=''
1233 ldflags_uselargefiles=''
1234 libswanted_uselargefiles=''
1243 usensgetexecutablepath=''
1256 installvendorarch=''
1263 installvendorhtml1dir=''
1265 vendorhtml1direxp=''
1266 installvendorhtml3dir=''
1268 vendorhtml3direxp=''
1274 installvendorman1dir=''
1277 installvendorman3dir=''
1284 installvendorscript=''
1295 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1298 : We must find out about Eunice early
1300 if test -f /etc/unixtovms; then
1301 eunicefix=/etc/unixtovms
1303 if test -f /etc/unixtovms.exe; then
1304 eunicefix=/etc/unixtovms.exe
1307 : Set executable suffix now -- needed before hints available
1308 if test -f "/libs/version.library"; then
1311 elif test -f "/system/gnu_library/bin/ar.pm"; then
1314 elif test -n "$DJGPP"; then
1317 elif test -f /kern/cookiejar; then
1320 elif test -d c:/. -o -n "$is_os2" ; then
1327 : Trailing extension. Override this in a hint file, if needed.
1328 : Extra object files, if any, needed on this platform.
1331 : Possible local include directories to search.
1332 : Set locincpth to "" in a hint file to defeat local include searches.
1333 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1334 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1336 : no include file wanted by default
1339 : Enable -DEBUGGING and -DDEBUGGING from the command line
1344 : change the next line if compiling for Xenix/286 on Xenix/386
1345 xlibpth='/usr/lib/386 /lib/386'
1346 : Possible local library directories to search.
1347 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1348 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1350 : general looking path for locating libraries
1351 glibpth="/lib /usr/lib $xlibpth"
1352 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1353 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1354 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1355 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1357 : Private path used by Configure to find libraries. Its value
1358 : is prepended to libpth. This variable takes care of special
1359 : machines, like the mips. Usually, it should be empty.
1362 : default library list
1364 : some systems want to use only the non-versioned libso:s
1365 ignore_versioned_solibs=''
1366 : set usethreads on the Configure command line to enable threads.
1367 usereentrant='undef'
1371 : set useposix=false in your hint file to disable the POSIX extension.
1373 : set useopcode=false in your hint file to disable the Opcode extension.
1376 ccflags_uselargefiles=''
1377 ldflags_uselargefiles=''
1378 libswanted_uselargefiles=''
1379 : set usemultiplicity on the Configure command line to enable multiplicity.
1380 : set usesocks on the Configure command line to enable socks.
1381 : List of libraries we want.
1382 : If anyone needs extra -lxxx, put those in a hint file.
1383 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1384 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1385 : We probably want to search /usr/shlib before most other libraries.
1386 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1387 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1388 glibpth="/usr/shlib $glibpth"
1389 : Do not use vfork unless overridden by a hint file.
1392 : Find the basic shell for Bourne shell scripts
1396 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1399 if test -f "$xxx"; then
1402 : Build up a list and do a single loop so we can 'break' out.
1403 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1404 for xxx in sh bash ksh pdksh ash; do
1406 try="$try ${p}/${xxx}"
1410 if test -f "$xxx"; then
1413 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1416 elif test -f "$xxx.exe"; then
1427 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1429 Usually it's in /bin/sh. How did you even get this far?
1430 Please contact me (Perl Maintainers) at perlbug@perl.org and
1431 we'll try to straighten this all out.
1437 : see if sh knows # comments
1438 if `$sh -c '#' >/dev/null 2>&1`; then
1442 test -f $xcat$_exe || xcat=/usr/bin/cat
1443 if test ! -f $xcat$_exe; then
1444 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1445 if test -f $p/cat$_exe; then
1450 if test ! -f $xcat$_exe; then
1451 echo "Can't find cat anywhere!"
1455 echo "#!$xcat" >sharp
1458 ./sharp > today 2>/dev/null
1459 if test -s today; then
1462 echo "#! $xcat" > sharp
1465 ./sharp > today 2>/dev/null
1466 if test -s today; then
1474 echo "Your $sh doesn't grok # comments--I will strip them later on."
1477 echo "exec grep -v '^[ ]*#'" >spitshell
1479 $eunicefix spitshell
1480 spitshell=`pwd`/spitshell
1482 echo "I presume that if # doesn't work, #! won't work either!"
1487 : figure out how to guarantee sh startup
1489 '') startsh=${sharpbang}${sh} ;;
1501 : echo "Yup, it does."
1503 echo "Hmm... '$startsh' does not guarantee sh startup..."
1504 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1508 : Save command line options in file UU/cmdline.opt for later use in
1509 : generating config.sh.
1510 cat > cmdline.opt <<EOSH
1511 : Configure command line arguments.
1520 cat >>cmdline.opt <<EOSH
1521 config_arg$argn='$arg'
1523 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1526 arg_exp=`cat cmdl.opt`
1527 args_exp="$args_exp$args_sep'$arg_exp'"
1528 argn=`expr $argn + 1`
1533 : produce awk script to parse command line options
1534 cat >options.awk <<'EOF'
1536 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1538 len = length(optstr);
1539 for (i = 1; i <= len; i++) {
1540 c = substr(optstr, i, 1);
1541 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1552 if (substr(str, 1, 1) != "-") {
1553 printf("'%s'\n", str);
1557 for (i = 2; i <= len; i++) {
1558 c = substr(str, i, 1);
1560 printf("-%s\n", substr(str, i));
1566 printf("'%s'\n", substr(str, i + 1));
1579 : process the command line options
1580 set X `for arg in "$@"; do echo "X$arg"; done |
1581 sed -e s/X// | awk -f options.awk`
1586 : set up default values
1596 rm -f optdef.sh posthint.sh
1597 cat >optdef.sh <<EOS
1603 while test $# -gt 0; do
1605 -d) shift; fastread=yes;;
1606 -e) shift; alldone=cont;;
1610 if test -r "$1"; then
1613 echo "$me: cannot read config file $1." >&2
1619 -h) shift; error=true;;
1620 -r) shift; reuseval=true;;
1621 -s) shift; silent=true; realsilent=true;;
1622 -E) shift; alldone=exit;;
1623 -K) shift; knowitall=true;;
1624 -O) shift; override=true;;
1625 -S) shift; silent=true; extractsh=true;;
1630 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1631 echo "$me: ignoring -D $1" >&2
1634 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1635 *) echo "$1='define'" >> optdef.sh;;
1642 *=) echo "$1" >> optdef.sh;;
1644 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1645 echo "$me: ignoring -U $1" >&2
1647 *) echo "$1='undef'" >> optdef.sh;;
1658 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1662 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1663 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1669 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1670 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1671 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1672 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1673 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1674 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1680 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1682 echo "$yyy=''" >> posthint.sh ;;
1687 echo "$yyy='$zzz'" >> posthint.sh ;;
1689 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1691 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1696 echo "$yyy=$zzz" >> posthint.sh ;;
1697 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1701 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1704 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1712 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1713 [-U symbol] [-U symbol=] [-A command:symbol...]
1714 -d : use defaults for all answers.
1715 -e : go on without questioning past the production of config.sh.
1716 -f : specify an alternate default configuration file.
1717 -h : print this help message and exit (with an error status).
1718 -r : reuse C symbols value if possible (skips costly nm extraction).
1719 -s : silent mode, only echoes questions and essential information.
1720 -D : define symbol to have some value:
1721 -D symbol symbol gets the value 'define'
1722 -D symbol=value symbol gets the value 'value'
1723 common used examples (see INSTALL for more info):
1724 -Duse64bitint use 64bit integers
1725 -Duse64bitall use 64bit integers and pointers
1726 -Dusethreads use thread support
1727 -Dinc_version_list=none do not include older perl trees in @INC
1728 -DEBUGGING=none DEBUGGING options
1729 -Dcc=gcc choose your compiler
1730 -Dprefix=/opt/perl5 choose your destination
1731 -E : stop at the end of questions, after having produced config.sh.
1732 -K : do not use unless you know what you are doing.
1733 -O : let -D and -U override definitions from loaded configuration file.
1734 -S : perform variable substitutions on all .SH files (can mix with -f)
1735 -U : undefine symbol:
1736 -U symbol symbol gets the value 'undef'
1737 -U symbol= symbol gets completely empty
1739 -A : manipulate symbol after the platform specific hints have been applied:
1740 -A append:symbol=value append value to symbol
1741 -A symbol=value like append:, but with a separating space
1742 -A define:symbol=value define symbol to have value
1743 -A clear:symbol define symbol to be ''
1744 -A define:symbol define symbol to be 'define'
1745 -A eval:symbol=value define symbol to be eval of value
1746 -A prepend:symbol=value prepend value to symbol
1747 -A undef:symbol define symbol to be 'undef'
1748 -A undef:symbol= define symbol to be ''
1749 e.g.: -A prepend:libswanted='cl pthread '
1750 -A ccflags=-DSOME_MACRO
1751 -V : print version number and exit (with a zero status).
1758 case "$fastread$alldone" in
1761 case "$extractsh" in
1764 if test ! -t 0; then
1765 echo "Say 'sh Configure', not 'sh <Configure'"
1775 true) exec 1>/dev/null;;
1778 : run the defines and the undefines, if any, but leave the file out there...
1781 : create the posthint manipulation script and leave the file out there...
1786 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1787 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1788 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1789 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1790 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1793 : Some greps do not return status, grrr.
1794 echo "grimblepritz" >grimble
1795 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1797 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1803 : the following should work in any shell
1807 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1808 cat >contains <<'EOSS'
1809 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1814 : Find the path to the source tree
1817 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1821 *) src=`cd ../$src && pwd` ;;
1834 if test -f $rsrc/Configure && \
1835 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1837 : found it, so we are ok.
1840 for src in . .. ../.. ../../.. ../../../..; do
1841 if test -f ../$src/Configure && \
1842 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1853 Sorry, I can't seem to locate the source dir for $package. Please start
1854 Configure with an explicit path -- i.e. /some/path/Configure.
1862 echo "Sources for $package found in \"$src\"." >&4
1866 : script used to extract .SH files with variable substitutions
1867 cat >extract <<'EOS'
1869 echo "Doing variable substitutions on .SH files..."
1870 if test -f MANIFEST; then
1871 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1873 echo "(Looking for .SH files under the source directory.)"
1874 set x `(cd "$src"; find . -name "*.SH" -print)`
1878 0) set x `(cd "$src"; echo *.SH)`; shift;;
1880 if test ! -f "$src/$1"; then
1886 while test $name; do
1887 if test ! -d "$name"; then
1888 create="$name $create";
1889 name=`echo $name | sed -e "s|^[^/]*$||"`;
1890 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1895 for file in $create; do
1904 dir=`expr X$file : 'X\(.*\)/'`
1905 file=`expr X$file : 'X.*/\(.*\)'`
1906 (cd "$dir" && . ./$file)
1916 dir=`expr X$file : 'X\(.*\)/'`
1917 file=`expr X$file : 'X.*/\(.*\)'`
1918 (set x $dir; shift; eval $mkdir_p)
1919 sh <"$src/$dir/$file"
1928 if test -f "$src/config_h.SH"; then
1929 if test ! -f config.h; then
1930 : oops, they left it out of MANIFEST, probably, so do it anyway.
1931 . "$src/config_h.SH"
1936 : extract files and exit if asked to do so
1937 case "$extractsh" in
1939 case "$realsilent" in
1943 case "$config_sh" in
1944 '') config_sh='config.sh';;
1947 echo "Fetching answers from $config_sh..."
1950 test "$override" && . ./optdef.sh
1954 echo "Extraction done."
1959 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
1960 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
1962 if test "X$sysroot" != X; then
1965 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
1966 # _sysroot is used in places where we need --sysroot=foo
1967 # but using the rest of the flags could cause issues.
1968 _sysroot="--sysroot=$sysroot";
1972 ccflags="$ccflags $_sysroot"
1977 ldflags="$ldflags $_sysroot"
1982 cppflags="$cppflags $_sysroot"
1984 # lddlflags updated below in lddlflags section;
1985 # same with cccdlflags
1989 # Adjust some defaults to also use $sysroot
1990 for var in xlibpth loclibpth locincpth glibpth; do
1993 for path in $xxx; do
1994 eval $var=\"\$$var $sysroot$path\"
2000 : Eunice requires " " instead of "", can you believe it
2003 echo "Beginning of configuration questions for $package."
2005 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2007 : first determine how to suppress newline on echo command
2009 echo "Checking echo to see how to suppress newlines..."
2010 (echo "hi there\c" ; echo " ") >.echotmp
2011 if $contains c .echotmp >/dev/null 2>&1 ; then
2022 echo $n "The star should be here-->$c"
2026 : Now test for existence of everything in MANIFEST
2028 if test -f "$rsrc/MANIFEST"; then
2029 echo "First let's make sure your kit is complete. Checking..." >&4
2030 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2031 (split -l 50 2>/dev/null || split -50)
2034 for filelist in x??; do
2035 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2036 >/dev/null 2>>"$tmppwd/missing")
2038 if test -s missing; then
2042 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2044 You have the option of continuing the configuration process, despite the
2045 distinct possibility that your kit is damaged, by typing 'y'es. If you
2046 do, don't blame me if something goes wrong. I advise you to type 'n'o
2047 and contact the author (perlbug@perl.org).
2050 echo $n "Continue? [n] $c" >&4
2054 echo "Continuing..." >&4
2058 echo "ABORTING..." >&4
2063 echo "Looks good..."
2066 echo "There is no MANIFEST file. I hope your kit is complete !"
2070 : Find the appropriate value for a newline for tr
2072 if test -n "$DJGPP"; then
2075 if test X"$trnl" = X; then
2076 case "`echo foo|tr '\n' x 2>/dev/null`" in
2080 if test X"$trnl" = X; then
2081 case "`echo foo|tr '\012' x 2>/dev/null`" in
2082 foox) trnl='\012' ;;
2085 if test X"$trnl" = X; then
2086 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2087 fooxy) trnl='\n\r' ;;
2090 if test X"$trnl" = X; then
2093 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2099 : compute the number of columns on the terminal for proper question formatting
2104 : set up the echo used in my read
2105 myecho="case \"\$xxxm\" in
2106 '') echo $n \"\$rp $c\" >&4;;
2108 '') echo $n \"[\$xxxm] $c\";;
2110 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2112 echo $n \"[\$xxxm] $c\" >&4
2114 echo $n \"\$rp [\$xxxm] $c\" >&4
2120 : now set up to do reads with possible shell escape and default assignment
2126 case "\$fastread" in
2127 yes) case "\$dflt" in
2130 case "\$silent-\$rp" in
2135 *) case "\$silent" in
2136 true) case "\$rp" in
2141 while expr "X\$ans" : "X!" >/dev/null; do
2145 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2153 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2162 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2167 echo "(OK, I'll run with -d after this question.)" >&4
2170 echo "*** Sorry, \$1 not supported yet." >&4
2180 echo "*** Substitution done -- please confirm."
2182 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2187 echo "*** Error -- try again."
2194 case "\$ans\$xxxm\$nostick" in
2206 : create .config dir to save info across Configure sessions
2207 test -d ../.config || mkdir ../.config
2208 cat >../.config/README <<EOF
2209 This directory created by Configure to save information that should
2210 persist across sessions for $package.
2212 You may safely delete it if you wish.
2215 : See if we are using a devel version and want that
2216 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2219 usedevel="$define" ;;
2220 *) case "$xversion" in
2223 *** WHOA THERE!!! ***
2225 This is an UNSTABLE DEVELOPMENT release.
2226 The version of this $package distribution is $xversion, that is, odd,
2227 (as opposed to even) and that signifies a development release.
2228 If you want a maintenance release, you want an even-numbered version.
2230 Do ***NOT*** install this into production use.
2231 Data corruption and crashes are possible.
2233 It is most seriously suggested that you do not continue any further
2234 unless you want to help in developing and debugging Perl.
2236 If you *still* want to build perl, you can answer 'y' now,
2237 or pass -Dusedevel to Configure.
2240 rp='Do you really want to continue?'
2244 [yY]) echo >&4 "Okay, continuing."
2245 usedevel="$define" ;;
2246 *) echo >&4 "Okay, bye."
2257 case "$versiononly" in
2258 '') versiononly="$define" ;;
2260 case "$installusrbinperl" in
2261 '') installusrbinperl="$undef" ;;
2266 : general instructions
2269 user=`(logname) 2>/dev/null`
2271 '') user=`whoami 2>&1`;;
2273 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2276 rp='Would you like to see the instructions?'
2287 This installation shell script will examine your system and ask you questions
2288 to determine how the perl5 package should be installed. If you get
2289 stuck on a question, you may use a ! shell escape to start a subshell or
2290 execute a command. Many of the questions will have default answers in square
2291 brackets; typing carriage return will give you the default.
2293 On some of the questions which ask for file or directory names you are allowed
2294 to use the ~name construct to specify the login directory belonging to "name",
2295 even if you don't have a shell which knows about that. Questions where this is
2296 allowed will be marked "(~name ok)".
2300 dflt='Type carriage return to continue'
2304 The prompter used in this script allows you to use shell variables and
2305 backticks in your answers. You may use $1, $2, etc... to refer to the words
2306 in the default answer, as if the default line was a set of arguments given to a
2307 script shell. This means you may also use $* to repeat the whole default line,
2308 so you do not have to re-type everything to add something to the default.
2310 Every time there is a substitution, you will have to confirm. If there is an
2311 error (e.g. an unmatched backtick), the default answer will remain unchanged
2312 and you will be prompted again.
2314 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2315 the questions and use the computed defaults (or the previous answers if there
2316 was already a config.sh file). Type 'Configure -h' for a list of options.
2317 You may also start interactively and then answer '& -d' at any prompt to turn
2318 on the non-interactive behaviour for the remainder of the execution.
2324 Much effort has been expended to ensure that this shell script will run on any
2325 Unix system. If despite that it blows up on yours, your best bet is to edit
2326 Configure and run it again. If you can't run Configure for some reason,
2327 you'll have to generate a config.sh file by hand. Whatever problems you
2328 have, let me (perlbug@perl.org) know how I blew it.
2330 This installation script affects things in two ways:
2332 1) it may do direct variable substitutions on some of the files included
2334 2) it builds a config.h file for inclusion in C programs. You may edit
2335 any of these files as the need arises after running this script.
2337 If you make a mistake on a question, there is no easy way to back up to it
2338 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2339 files. Configure will offer to let you do this before it runs the SH files.
2342 dflt='Type carriage return to continue'
2344 case "$firsttime" in
2345 true) echo $user >>../.config/instruct;;
2349 : find out where common programs are
2351 echo "Locating common programs..." >&4
2364 if test -d \$dir/\$thing; then
2370 for thisthing in \$dir/\$thing; do
2371 : just loop through to pick last item
2373 if test -f \$thisthing; then
2376 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2379 elif test -f \$dir/\$thing.exe; then
2380 if test -n "$DJGPP"; then
2381 echo \$dir/\$thing.exe
2382 elif test "$eunicefix" != ":"; then
2383 : on Eunice apparently
2436 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2437 pth="$pth $sysroot/lib $sysroot/usr/lib"
2438 for file in $loclist; do
2442 if test -f "$xxx"; then
2445 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2446 xxx=`./loc $file $file $pth`
2449 '') xxx=`./loc $file $file $pth`;;
2450 *) xxx=`./loc $xxx $xxx $pth`;;
2452 eval $file=$xxx$_exe
2456 echo $file is in $xxx.
2459 echo $file is in $xxx.
2462 echo "I don't know where '$file' is, and my life depends on it." >&4
2463 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2469 echo "Don't worry if any of the following aren't found..."
2471 for file in $trylist; do
2475 if test -f "$xxx"; then
2478 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2479 xxx=`./loc $file $file $pth`
2482 '') xxx=`./loc $file $file $pth`;;
2483 *) xxx=`./loc $xxx $xxx $pth`;;
2485 eval $file=$xxx$_exe
2489 echo $file is in $xxx.
2492 echo $file is in $xxx.
2495 echo "I don't see $file out there, $say."
2502 echo "Substituting grep for egrep."
2509 *) if $less -R </dev/null >/dev/null; then
2510 echo "Substituting less -R for less."
2518 echo "Substituting cp for ln."
2527 echo "I can't find make or gmake, and my life depends on it." >&4
2528 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2536 *) # We can't have osname yet.
2537 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2538 # Assume that gmake, if found, is definitely GNU make
2539 # and prefer it over the system make.
2540 echo "Substituting gmake for make."
2548 echo "Hopefully test is built into your sh."
2551 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2552 echo "Using the test built into your sh."
2560 echo "Hopefully echo is built into your sh."
2565 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2566 $echo $n "hi there$c" >foo1
2567 echo $n "hi there$c" >foo2
2568 if cmp foo1 foo2 >/dev/null 2>&1; then
2569 echo "They are compatible. In fact, they may be identical."
2576 They are not compatible! You are probably running ksh on a non-USG system.
2577 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2578 have echo built in and we may have to run some Bourne shell scripts. That
2579 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2582 $echo $n "The star should be here-->$c"
2589 # This question was auctioned at YAPC::Europe-2007 in Vienna
2590 # I never promised you could answer it. I only auctioned the question.
2592 The following message is sponsored by
2594 Dresden.pm<--The stars should be here.
2596 Dear Perl user, system administrator or package
2597 maintainer, the Perl community sends greetings to
2598 you. Do you (emblematical) greet back [Y/n]? n
2602 : Check what type of C compiler we use
2606 cat <<'EOSC' >>trygcc
2611 int main(int argc, char *argv[]) {
2615 if $cc -o try $ccflags $ldflags try.c; then
2618 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2624 # Skip this test because it gives a false match on output like:
2625 # ./trygcc: line 23: cc: command not found
2626 # case "`$cc -v -c try.c 2>&1`" in
2627 # *gcc*) trygcc=no ;;
2629 if $test X"$trygcc" = Xyes; then
2630 if gcc -o try -c try.c; then
2632 echo "You seem to have a working gcc, though." >&4
2633 # Switching compilers may undo the work of hints files.
2634 # The most common problem is -D_REENTRANT for threads.
2635 # This heuristic catches that case, but gets false positives
2636 # if -Dusethreads was not actually specified. Better to
2637 # bail out here with a useful message than fail
2638 # mysteriously later. Should we perhaps just try to
2639 # re-invoke Configure -Dcc=gcc config_args ?
2640 if $test -f usethreads.cbu; then
2643 *** However, any setting of the C compiler flags (e.g. for thread support)
2644 *** will be lost. It may be necessary for you to restart Configure and
2645 *** add -Dcc=gcc to your Configure command line.
2648 rp="Would you like to go ahead and try gcc anyway?"
2651 rp="Would you like to use it?"
2654 if $test -f myread; then
2657 if $test -f UU/myread; then
2660 echo "Cannot find myread, sorry. Aborting." >&2
2665 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2678 cat <<'EOSC' >>checkcc
2683 int main(int argc, char *argv[]) {
2687 if $cc -o try $ccflags $ldflags try.c; then
2690 if $test X"$despair" = Xyes; then
2691 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2694 You need to find a working C compiler.
2695 Either (purchase and) install the C compiler supplied by your OS vendor,
2696 or for a free C compiler try http://gcc.gnu.org/
2697 I cannot continue any further, aborting.
2706 : determine whether symbolic links are supported
2709 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2710 echo "Symbolic links are supported." >&4
2713 echo "Symbolic links are NOT supported." >&4
2718 : determine whether symbolic links are supported
2722 echo "Checking how to test for symbolic links..." >&4
2724 if $test "X$issymlink" = X; then
2726 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2727 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2729 if test $? = 0; then
2732 echo "Your builtin 'test -h' may be broken." >&4
2735 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2738 if test -f "$p/$test"; then
2747 echo "Trying external '$test -h'." >&4
2748 issymlink="$test -h"
2749 if $test ! -h sym >/dev/null 2>&1; then
2750 echo "External '$test -h' is broken, too." >&4
2758 if $test "X$issymlink" = X; then
2759 if $test -L sym 2>/dev/null; then
2760 issymlink="$test -L"
2761 echo "The builtin '$test -L' worked." >&4
2764 if $test "X$issymlink" != X; then
2765 echo "You can test for symbolic links with '$issymlink'." >&4
2767 echo "I do not know how you can test for symbolic links." >&4
2771 *) echo "No symbolic links, so not testing for their testing..." >&4
2776 : Make symlinks util
2777 case "$mksymlinks" in
2780 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2783 *) case "$lns:$issymlink" in
2784 *"ln"*" -s:"*"test -"?)
2785 echo "Creating the symbolic links..." >&4
2786 echo "(First creating the subdirectories...)" >&4
2788 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2790 test -z "$directory" && break
2794 if test ! -d t/base; then
2795 echo "Failed to create the subdirectories. Aborting." >&4
2798 echo "(Then creating the symlinks...)" >&4
2799 awk '{print $1}' $src/MANIFEST | while true; do
2801 test -z "$filename" && break
2802 if test -f $filename; then
2803 if $issymlink $filename; then
2807 if test -f $filename; then
2808 echo "$filename already exists, not symlinking."
2810 ln -s $src/$filename $filename
2814 if test ! -f t/base/lex.t; then
2815 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2820 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2828 : Check for Cross-Compilation
2829 case "$usecrosscompile" in
2831 $echo "Cross-compiling..."
2834 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2835 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2836 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2837 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2838 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2839 # leave out ld, choosing it is more complex
2840 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2841 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2842 # We are in a weird spot. Just before us, some values
2843 # were 'saved', to be restored after the hints are
2844 # run. This means that the changes we made to ar,
2845 # nm and ranlib will get reverted.
2846 # To avoid that, we hijack the saving mechanism and
2847 # have it save our new values.
2848 for file in ar nm ranlib; do
2850 eval $file=$xxx$_exe
2855 case "$targetarch" in
2856 '') echo "Targetarch not defined." >&4; croak=y ;;
2857 *) echo "Using targetarch $targetarch." >&4 ;;
2859 case "$targethost" in
2860 '') echo "Targethost not defined." >&4; croak=y ;;
2861 *) echo "Using targethost $targethost." >&4
2866 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2869 /*) run=$src/Cross/run
2870 targetmkdir=$src/Cross/mkdir
2872 from=$src/Cross/from
2874 *) pwd=`$test -f ../Configure & cd ..; pwd`
2876 targetmkdir=$pwd/Cross/mkdir
2878 from=$pwd/Cross/from
2881 case "$targetrun" in
2882 '') targetrun=ssh ;;
2887 case "$targetfrom" in
2888 '') targetfrom=scp ;;
2892 from=$from-$targetfrom
2893 case "$targetdir" in
2895 echo "Guessing targetdir $targetdir." >&4
2898 case "$targetuser" in
2900 echo "Guessing targetuser $targetuser." >&4
2903 case "$targetport" in
2905 echo "Guessing targetport $targetport." >&4
2908 case "$targetfrom" in
2912 case "$targetrun" in
2924 '') cwd=$targetdir ;;
2929 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2932 *) echo "Unknown targetrun '$targetrun'" >&4
2936 case "$targetmkdir" in
2938 cat >$targetmkdir <<EOF
2940 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
2942 $chmod a+rx $targetmkdir
2944 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2956 $targetmkdir \`dirname \$f\`
2957 $targetto -P $targetport $q \$f $targetuser@$targethost:\$f || exit 1
2960 $targetmkdir $targetdir/\`dirname \$f\`
2961 $targetto -P $targetport $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2974 $mkdir -p $targetdir/\`dirname \$f\`
2975 $cp \$f $targetdir/\$f || exit 1
2978 $targetmkdir $targetdir/\`dirname \$f\`
2979 $cp \$f $targetdir/\$f || exit 1
2986 *) echo "Unknown targetto '$targetto'" >&4
2990 case "$targetfrom" in
2997 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3002 cp) cat >$from <<EOF
3007 cp $targetdir/\$f . || exit 1
3012 *) echo "Unknown targetfrom '$targetfrom'" >&4
3016 if $test ! -f $run; then
3017 echo "Target 'run' script '$run' not found." >&4
3021 if $test ! -f $to; then
3022 echo "Target 'to' script '$to' not found." >&4
3026 if $test ! -f $from; then
3027 echo "Target 'from' script '$from' not found." >&4
3031 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3035 Using '$run' for remote execution,
3036 and '$from' and '$to'
3037 for remote file transfer.
3043 usecrosscompile='undef'
3048 : see whether [:lower:] and [:upper:] are supported character classes
3050 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3052 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3056 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3057 # (0xd9 and 0xe2), therefore that is a nice testing point.
3058 if test "X$up" = X -o "X$low" = X; then
3059 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3065 if test "X$up" = X -o "X$low" = X; then
3066 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3072 if test "X$up" = X -o "X$low" = X; then
3073 case "`echo RS | od -x 2>/dev/null`" in
3075 echo "Hey, this might be EBCDIC." >&4
3076 if test "X$up" = X -o "X$low" = X; then
3077 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3078 rs) up='[A-IJ-RS-Z]'
3083 if test "X$up" = X -o "X$low" = X; then
3084 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3094 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3096 echo "Using $up and $low to convert case." >&4
3099 echo "I don't know how to translate letters from upper to lower case." >&4
3100 echo "Your tr is not acting any way I know of." >&4
3104 : set up the translation script tr, must be called with ./tr of course
3108 '[A-Z][a-z]') exec $tr '$up' '$low';;
3109 '[a-z][A-Z]') exec $tr '$low' '$up';;
3116 : Try to determine whether config.sh was made on this system
3117 case "$config_sh" in
3119 myuname=`$uname -a 2>/dev/null`
3120 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3121 # Downcase everything to avoid ambiguity.
3122 # Remove slashes and single quotes so we can use parts of this in
3123 # directory and file names.
3124 # Remove newlines so myuname is sane to use elsewhere.
3125 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3126 # because the A-Z/a-z are not consecutive.
3127 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3128 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3129 newmyuname="$myuname"
3131 case "$knowitall" in
3133 if test -f ../config.sh; then
3134 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3135 eval "`grep myuname= ../config.sh`"
3137 if test "X$myuname" = "X$newmyuname"; then
3145 : Get old answers from old config file if Configure was run on the
3146 : same system, otherwise use the hints.
3149 if test -f config.sh; then
3151 rp="I see a config.sh file. Shall I use it to set the defaults?"
3154 n*|N*) echo "OK, I'll ignore it."
3155 mv config.sh config.sh.old
3156 myuname="$newmyuname"
3158 *) echo "Fetching default answers from your old config.sh file..." >&4
3166 : Older versions did not always set $sh. Catch re-use of such
3176 if test ! -f config.sh; then
3179 First time through, eh? I have some defaults handy for some systems
3180 that need some extra help getting the Configure answers right:
3183 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3185 : Half the following guesses are probably wrong... If you have better
3186 : tests or hints, please send them to perlbug@perl.org
3187 : The metaconfig authors would also appreciate a copy...
3188 $test -f /irix && osname=irix
3189 $test -f /xenix && osname=sco_xenix
3190 $test -f /dynix && osname=dynix
3191 $test -f /dnix && osname=dnix
3192 $test -f /lynx.os && osname=lynxos
3193 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3194 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3195 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3196 $test -f /bin/mips && /bin/mips && osname=mips
3197 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3198 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3199 $test -d /usr/apollo/bin && osname=apollo
3200 $test -f /etc/saf/_sactab && osname=svr4
3201 $test -d /usr/include/minix && osname=minix
3202 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3203 if $test -d /MachTen -o -d /MachTen_Folder; then
3205 if $test -x /sbin/version; then
3206 osvers=`/sbin/version | $awk '{print $2}' |
3207 $sed -e 's/[A-Za-z]$//'`
3208 elif $test -x /usr/etc/version; then
3209 osvers=`/usr/etc/version | $awk '{print $2}' |
3210 $sed -e 's/[A-Za-z]$//'`
3216 $test -f /sys/posix.dll &&
3217 $test -f /usr/bin/what &&
3218 set X `/usr/bin/what /sys/posix.dll` &&
3219 $test "$3" = UWIN &&
3223 if $test -f $uname; then
3231 umips) osname=umips ;;
3234 [23]100) osname=mips ;;
3235 next*) osname=next ;;
3237 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3238 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3241 elif $test -f /etc/kconfig; then
3243 if test "$lns" = "$ln -s"; then
3245 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3247 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3254 if test -n "$DJGPP"; then
3263 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3265 # oslevel can fail with:
3266 # oslevel: Unable to acquire lock.
3267 *not\ found) osvers="$4"."$3" ;;
3268 '<3240'|'<>3240') osvers=3.2.0 ;;
3269 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3270 '=3250'|'>3250') osvers=3.2.5 ;;
3274 bitrig) osname=bitrig
3277 bsd386) osname=bsd386
3280 cygwin*) osname=cygwin
3283 *dc.osx) osname=dcosx
3289 domainos) osname=apollo
3295 dragonfly) osname=dragonfly
3298 dynixptx*) osname=dynixptx
3299 osvers=`echo "$4"|sed 's/^v//'`
3301 freebsd) osname=freebsd
3303 genix) osname=genix ;;
3307 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3323 netbsd*) osname=netbsd
3326 news-os) osvers="$3"
3328 4*) osname=newsos4 ;;
3332 next*) osname=next ;;
3333 nonstop-ux) osname=nonstopux ;;
3334 openbsd) osname=openbsd
3340 POSIX-BC | posix-bc ) osname=posix-bc
3343 powerux | power_ux | powermax_os | powermaxos | \
3344 powerunix | power_unix) osname=powerux
3350 solaris) osname=solaris
3352 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3359 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3363 titanos) osname=titanos
3372 ultrix) osname=ultrix
3375 osf1|mls+) case "$5" in
3378 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3381 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3384 hp*) osname=hp_osf1 ;;
3385 mips) osname=mips_osf1 ;;
3388 # UnixWare 7.1.2 is known as Open UNIX 8
3389 openunix|unixware) osname=svr5
3397 $2) case "$osname" in
3401 : svr4.x or possibly later
3411 if test -f /stand/boot ; then
3412 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3413 if test -n "$INITPROG" -a -f "$INITPROG"; then
3414 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3415 if test -n "$isesix"; then
3423 *) if test -f /etc/systemid; then
3425 set `echo $3 | $sed 's/\./ /g'` $4
3426 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3428 elif $test -f $src/hints/sco_$1_$2.sh; then
3430 elif $test -f $src/hints/sco_$1.sh; then
3435 '') : Still unknown. Probably a generic Sys V.
3444 *) case "$osname" in
3445 '') : Still unknown. Probably a generic BSD.
3453 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3454 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3455 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3458 $rm -f UU/kernel.what
3459 elif test -d c:/. -o -n "$is_os2" ; then
3466 case "$targetarch" in
3469 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3474 : Now look for a hint file osname_osvers, unless one has been
3475 : specified already.
3478 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3479 : Also try without trailing minor version numbers.
3480 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3481 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3482 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3483 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3486 *) case "$osvers" in
3489 *) if $test -f $src/hints/$file.sh ; then
3491 elif $test -f $src/hints/$xfile.sh ; then
3493 elif $test -f $src/hints/$xxfile.sh ; then
3495 elif $test -f $src/hints/$xxxfile.sh ; then
3497 elif $test -f $src/hints/$xxxxfile.sh ; then
3499 elif $test -f "$src/hints/${osname}.sh" ; then
3508 if $test -f Policy.sh ; then
3511 none) dflt="Policy" ;;
3512 *) dflt="Policy $dflt" ;;
3517 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3521 if $test -f Policy.sh ; then
3524 There's also a Policy hint file available, which should make the
3525 site-specific (policy) questions easier to answer.
3532 You may give one or more space-separated answers, or "none" if appropriate.
3533 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3534 previous run of Configure, you may specify it as well as or instead of
3535 OS-specific hints. If hints are provided for your OS, you should use them:
3536 although Perl can probably be built without hints on many platforms, using
3537 hints often improve performance and may enable features that Configure can't
3538 set up on its own. If there are no hints that match your OS, specify "none";
3539 DO NOT give a wrong version or a wrong OS.
3543 rp="Which of these apply, if any?"
3546 for file in $tans; do
3547 if $test X$file = XPolicy -a -f Policy.sh; then
3549 $cat Policy.sh >> UU/config.sh
3550 elif $test -f $src/hints/$file.sh; then
3551 . $src/hints/$file.sh
3552 $cat $src/hints/$file.sh >> UU/config.sh
3553 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3556 : Give one chance to correct a possible typo.
3557 echo "$file.sh does not exist"
3559 rp="hint to use instead?"
3561 for file in $ans; do
3562 if $test -f "$src/hints/$file.sh"; then
3563 . $src/hints/$file.sh
3564 $cat $src/hints/$file.sh >> UU/config.sh
3565 elif $test X$ans = X -o X$ans = Xnone ; then
3568 echo "$file.sh does not exist -- ignored."
3575 : Remember our hint file for later.
3576 if $test -f "$src/hints/$file.sh" ; then
3586 echo "Fetching default answers from $config_sh..." >&4
3590 cp $config_sh config.sh 2>/dev/null
3600 test "$override" && . ./optdef.sh
3602 : Restore computed paths
3603 for file in $loclist $trylist; do
3604 eval $file="\$_$file"
3609 Configure uses the operating system name and version to set some defaults.
3610 The default value is probably right if the name rings a bell. Otherwise,
3611 since spelling matters for me, either accept the default or answer "none"
3618 ''|' '|none) dflt=none ;;
3619 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3622 *) dflt="$osname" ;;
3624 rp="Operating system name?"
3628 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3634 ''|' '|none) dflt=none ;;
3635 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3636 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3638 ''|' ') dflt=none ;;
3643 *) dflt="$osvers" ;;
3645 rp="Operating system version?"
3655 : who configured the system
3656 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3659 cf_by=`(logname) 2>/dev/null`
3662 cf_by=`(whoami) 2>/dev/null`
3664 "") cf_by=unknown ;;
3669 : decide how portable to be. Allow command line overrides.
3670 case "$d_portable" in
3672 *) d_portable="$define" ;;
3675 : set up shell script to do ~ expansion
3681 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3684 if $test -f /bin/csh; then
3685 /bin/csh -f -c "glob \$1"
3690 name=\`$expr x\$1 : '..\([^/]*\)'\`
3691 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3692 if $test ! -d "\$dir"; then
3694 echo "\$me: can't locate home directory for: \$name" >&2
3699 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3715 : now set up to get a file name
3719 cat <<'EOSC' >>getfile
3735 : getfile will accept an answer from the comma-separated list
3736 : enclosed in parentheses even if it does not meet other criteria.
3737 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3738 fn=`echo $fn | sed 's/(.*)//'`
3744 loc_file=`expr $fn : '.*:\(.*\)'`
3745 fn=`expr $fn : '\(.*\):.*'`
3753 */*) fullpath=true;;
3762 *e*) exp_file=true;;
3765 *p*) nopath_ok=true;;
3770 *d*) type='Directory';;
3771 *l*) type='Locate';;
3776 Locate) what='File';;
3781 case "$d_portable" in
3789 while test "$type"; do
3794 true) rp="$rp (~name ok)";;
3797 if test -f UU/getfile.ok && \
3798 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3817 value=`UU/filexp $ans`
3820 if test "$ans" != "$value"; then
3821 echo "(That expands to $value on this system.)"
3835 /*) value="$ansexp" ;;
3836 [a-zA-Z]:/*) value="$ansexp" ;;
3841 echo "I shall only accept a full path name, as in /bin/ls." >&4
3842 echo "Use a ! shell escape if you wish to check pathnames." >&4
3845 echo "Please give a full path name, starting with slash." >&4
3848 echo "Note that using ~name is ok provided it expands well." >&4
3861 for fp in $gfpth; do
3862 if test "X$fp" = X.; then
3867 if test -f "$pf"; then
3869 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3871 echo "($value is not a plain file, but that's ok.)"
3874 if test X"$type" = X; then
3881 for fp in $gfpth; do
3882 if test "X$fp" = X.; then
3887 direxp="$fp/$ansexp"
3889 if test -d "$direxp"; then
3897 if test -d "$ansexp"; then
3898 echo "(Looking for $loc_file in directory $value.)"
3899 value="$value/$loc_file"
3900 ansexp="$ansexp/$loc_file"
3902 if test -f "$ansexp"; then
3905 case "$nopath_ok" in
3906 true) case "$value" in
3908 *) echo "Assuming $value will be in people's path."
3924 if test "$fastread" = yes; then
3929 rp="$what $value doesn't exist. Use that name anyway?"
3948 test "X$gfpthkeep" != Xy && gfpth=""
3951 : determine root of directory hierarchy where package will be installed.
3954 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3957 dflt=`echo "$prefix" | sed 's/.$//'`
3965 By default, $package will be installed in $dflt/bin, manual pages
3966 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3967 installation directories. Typically this is something like /usr/local.
3968 If you wish to have binaries under /usr/bin but other parts of the
3969 installation under /usr/local, that's ok: you will be prompted
3970 separately for each of the installation directories, the prefix being
3971 only used to set the defaults.
3975 rp='Installation prefix to use?'
3983 *) oldprefix="$prefix";;
3990 : allow them to override the AFS root
3993 *) afsroot=$afsroot ;;
3999 $define|true) afs=true ;;
4000 $undef|false) afs=false ;;
4001 *) if $test -d $afsroot; then
4009 echo "AFS may be running... I'll be extra cautious then..." >&4
4011 echo "AFS does not seem to be running..." >&4
4014 : determine installation prefix for where package is to be installed.
4018 Since you are running AFS, I need to distinguish the directory in which
4019 files will reside from the directory in which they are installed (and from
4020 which they are presumably copied to the former directory by occult means).
4023 case "$installprefix" in
4024 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4025 *) dflt="$installprefix";;
4030 In some special cases, particularly when building $package for distribution,
4031 it is convenient to distinguish the directory in which files should be
4032 installed from the directory ($prefix) in which they will
4033 eventually reside. For most users, these two directories are the same.
4036 case "$installprefix" in
4038 *) dflt=$installprefix;;
4042 rp='What installation prefix should I use for installing files?'
4044 installprefix="$ans"
4045 installprefixexp="$ansexp"
4047 : Perform the prefixexp/installprefixexp correction if necessary
4048 cat <<EOS >installprefix
4051 cat <<'EOSC' >>installprefix
4052 : Change installation prefix, if necessary.
4053 if $test X"$prefix" != X"$installprefix"; then
4054 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4056 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4059 chmod +x installprefix
4060 $eunicefix installprefix
4062 : Set variables such as privlib and privlibexp from the output of ./getfile
4063 : performing the prefixexp/installprefixexp correction if necessary.
4064 cat <<EOS >setprefixvar
4067 cat <<'EOSC' >>setprefixvar
4068 eval "${prefixvar}=\"\$ans\""
4069 eval "${prefixvar}exp=\"\$ansexp\""
4072 chmod +x setprefixvar
4073 $eunicefix setprefixvar
4075 : set up the script used to warn in case of inconsistency
4084 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4086 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4087 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4092 echo "*** WHOA THERE!!! ***" >&4
4093 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4096 rp=" Keep the $hint value?"
4099 y) td=$was; tu=$was;;
4103 : function used to set '$1' to '$val'
4104 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4106 $define$undef) . ./whoa; eval "$var=\$td";;
4107 $undef$define) . ./whoa; eval "$var=\$tu";;
4108 *) eval "$var=$val";;
4111 : get the patchlevel
4113 echo "Getting the current patchlevel..." >&4
4114 if $test -r $rsrc/patchlevel.h;then
4115 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4116 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4117 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4118 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4119 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4120 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4121 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4130 $echo "(You do not have patchlevel.h. Eek.)"
4132 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4133 version_patchlevel_string="version $patchlevel subversion $subversion"
4134 case "$perl_patchlevel" in
4136 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4137 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4141 $echo "(You have $package $version_patchlevel_string.)"
4145 : XXX Should be a Configure test for double-dots in filenames.
4146 version=`echo $revision $patchlevel $subversion | \
4147 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4148 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4149 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4152 version=`echo $revision $patchlevel $subversion | \
4153 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4154 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4155 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4158 : Special case the 5.005_xx maintenance series, which used 5.005
4159 : without any subversion label as a subdirectory in $sitelib
4160 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4161 api_versionstring='5.005'
4164 : Do we want threads support and if so, what type
4165 case "$usethreads" in
4166 $define|true|[yY]*) dflt='y';;
4167 *) # Catch case where user specified ithreads or 5005threads but
4168 # forgot -Dusethreads (A.D. 4/2002)
4169 case "$useithreads$use5005threads" in
4170 *$define*) dflt='y';;
4177 Perl can be built to offer a form of threading support on some systems
4178 To do so, Configure can be run with -Dusethreads.
4180 Note that Perl built with threading support runs slightly slower
4181 and uses slightly more memory than plain Perl.
4183 If this doesn't make any sense to you, just accept the default '$dflt'.
4185 rp='Build a threading Perl?'
4188 y|Y) val="$define" ;;
4194 if $test $patchlevel -lt 9; then
4195 case "$usethreads" in
4197 : Default to ithreads unless overridden on command line or with
4200 case "$use5005threads" in
4202 echo "5.005 threads are no longer supported"
4206 case "$useithreads" in
4207 $undef|false|[nN]*) dflt='n';;
4209 rp='Use the newer interpreter-based ithreads?'
4212 y|Y) val="$define" ;;
4217 : Now set use5005threads to the opposite value.
4218 case "$useithreads" in
4219 $define) val="$undef" ;;
4226 useithreads="$undef"
4227 use5005threads="$undef"
4231 case "$useithreads$use5005threads" in
4235 You cannot have both the ithreads and the 5.005 threads enabled
4236 at the same time. Disabling the 5.005 threads since they are
4237 much less stable than the ithreads.
4240 use5005threads="$undef"
4245 : perl-5.9.x and later
4247 if test X"$usethreads" = "X$define"; then
4248 case "$use5005threads" in
4252 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4259 use5005threads="$undef"
4260 useithreads="$usethreads"
4263 case "$d_oldpthreads" in
4264 '') : Configure tests would be welcome here. For now, assume undef.
4266 *) val="$d_oldpthreads" ;;
4272 : Look for a hint-file generated 'call-back-unit'. If the
4273 : user has specified that a threading perl is to be built,
4274 : we may need to set or change some other defaults.
4275 if $test -f usethreads.cbu; then
4276 echo "Your platform has some specific hints regarding threaded builds, using them..."
4279 case "$usethreads" in
4280 "$define"|true|[yY]*)
4282 (Your platform does not have any specific hints for threaded builds.
4283 Assuming POSIX threads, then.)
4289 : Check if multiplicity is required
4292 Perl can be built so that multiple Perl interpreters can coexist
4293 within the same Perl executable.
4296 case "$useithreads" in
4299 This multiple interpreter support is required for interpreter-based threads.
4303 *) case "$usemultiplicity" in
4304 $define|true|[yY]*) dflt='y';;
4308 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4309 rp='Build Perl for multiplicity?'
4312 y|Y) val="$define" ;;
4320 : Check if morebits is requested
4321 case "$usemorebits" in
4322 "$define"|true|[yY]*)
4323 use64bitint="$define"
4324 uselongdouble="$define"
4325 usemorebits="$define"
4327 *) usemorebits="$undef"
4331 : Determine the C compiler to be used
4337 rp="Use which C compiler?"
4341 : See whether they have no cc but they do have gcc
4343 if $test -f cc.cbu; then
4348 : make some quick guesses about what we are up against
4350 $echo $n "Hmm... $c"
4360 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4361 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4363 echo "Looks kind of like an OSF/1 system, but we'll see..."
4365 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4366 xxx=`./loc addbib blurfl $pth`
4367 if $test -f $xxx; then
4368 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4372 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4373 echo "Looks kind of like an extended USG system, but we'll see..."
4375 echo "Looks kind of like a USG system, but we'll see..."
4379 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4380 echo "Looks kind of like a BSD system, but we'll see..."
4384 echo "Looks kind of like a Version 7 system, but we'll see..."
4387 case "$eunicefix" in
4390 There is, however, a strange, musty smell in the air that reminds me of
4391 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4395 : it so happens the Eunice I know will not run shell scripts in Unix format
4399 echo "Congratulations. You aren't running Eunice."
4403 : Detect OS2. The p_ variable is set above in the Head.U unit.
4404 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4405 : semicolon as a patch separator
4410 I have the feeling something is not exactly right, however...don't tell me...
4411 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4412 (Or you may be running DOS with DJGPP.)
4417 if test -f /xenix; then
4418 echo "Actually, this looks more like a XENIX system..."
4423 echo "It's not Xenix..."
4428 if test -f /venix; then
4429 echo "Actually, this looks more like a VENIX system..."
4436 echo "Nor is it Venix..."
4439 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4440 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4443 : Check if we are using GNU gcc and what its version is
4445 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4449 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4451 printf("%s\n", __VERSION__);
4453 printf("%s\n", "1");
4459 if $cc -o try $ccflags $ldflags try.c; then
4460 gccversion=`$run ./try`
4461 case "$gccversion" in
4462 '') echo "You are not using GNU cc." ;;
4463 *) echo "You are using GNU cc $gccversion."
4469 echo "*** WHOA THERE!!! ***" >&4
4470 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4471 case "$knowitall" in
4473 echo " You'd better start hunting for one and let me know about it." >&4
4479 case "$gccversion" in
4480 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4482 case "$gccversion" in
4483 '') gccosandvers='' ;;
4484 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4485 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4487 case "$gccosandvers" in
4488 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4489 $osname$osvers) ;; # looking good
4490 $osname*) cat <<EOM >&4
4492 *** WHOA THERE!!! ***
4494 Your gcc has not been compiled for the exact release of
4495 your operating system ($gccosandvers versus $osname$osvers).
4497 In general it is a good idea to keep gcc synchronized with
4498 the operating system because otherwise serious problems
4499 may ensue when trying to compile software, like Perl.
4501 I'm trying to be optimistic here, though, and will continue.
4502 If later during the configuration and build icky compilation
4503 problems appear (headerfile conflicts being the most common
4504 manifestation), I suggest reinstalling the gcc to match
4505 your operating system release.
4509 *) gccosandvers='' ;; # failed to parse, better be silent
4517 # gcc 3.* complain about adding -Idirectories that they already know about,
4518 # so we will take those off from locincpth.
4519 case "$gccversion" in
4521 echo "main(){}">try.c
4522 for incdir in $locincpth; do
4523 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4524 grep '^c[cp]p*[01]: warning: changing search order '`
4525 if test "X$warn" != X; then
4526 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4532 : see how we invoke the C preprocessor
4534 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4535 cat <<'EOT' >testcpp.c
4541 if test ! -f cppstdin; then
4542 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4543 # AIX cc -E doesn't show the absolute headerfile
4544 # locations but we'll cheat by using the -M flag.
4545 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
4547 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4550 echo "Keeping your $hint cppstdin wrapper."
4553 wrapper=`pwd`/cppstdin
4557 if $test "X$cppstdin" != "X" && \
4558 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4559 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4561 echo "You used to use $cppstdin $cppminus so we'll use that again."
4563 '') echo "But let's see if we can live without a wrapper..." ;;
4565 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4566 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4568 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4571 echo "(However, $cpprun $cpplast does not work, let's see...)"
4579 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4586 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4587 $cc -E <testcpp.c >testcpp.out 2>&1; \
4588 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4589 echo "Yup, it does."
4590 x_cpp="$cc $cppflags -E"
4592 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4593 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4594 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4595 echo "Yup, it does."
4596 x_cpp="$cc $cppflags -E"
4598 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4599 $cc -P <testcpp.c >testcpp.out 2>&1; \
4600 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4601 echo "Yipee, that works!"
4602 x_cpp="$cc $cppflags -P"
4604 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4605 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4606 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4607 echo "At long last!"
4608 x_cpp="$cc $cppflags -P"
4610 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4611 $cpp <testcpp.c >testcpp.out 2>&1; \
4612 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4614 x_cpp="$cpp $cppflags"
4616 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4617 $cpp - <testcpp.c >testcpp.out 2>&1; \
4618 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4619 echo "Hooray, it works! I was beginning to wonder."
4620 x_cpp="$cpp $cppflags"
4622 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4623 $wrapper <testcpp.c >testcpp.out 2>&1; \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4630 rp="No dice. I can't find a C preprocessor. Name one:"
4634 $x_cpp <testcpp.c >testcpp.out 2>&1
4635 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4636 echo "OK, that will do." >&4
4638 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4653 echo "Perhaps can we force $cc -E using a wrapper..."
4654 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4661 echo "Nope, we'll have to live without it..."
4675 "$wrapper"|'cppstdin') ;;
4676 *) $rm -f $wrapper;;
4678 $rm -f testcpp.c testcpp.out
4681 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4682 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4686 # If using gcc or clang, we can get better values for libpth, incpth
4687 # and usrinc directly from the compiler.
4688 # Note that ccname for clang is also gcc.
4691 $echo 'extern int foo;' > try.c
4692 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4694 if $test $# -gt 0; then
4696 incpth="`$echo $incpth|$sed 's/^ //'`"
4698 j="`$echo $i|$sed 's,/include$,/lib,'`"
4699 if $test -d $j; then
4703 libpth="`$echo $libpth|$sed 's/^ //'`"
4704 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4705 if $test -d $xxx; then
4708 *) libpth="$libpth $xxx";;
4715 '') for i in $incpth; do
4716 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4724 case "$usecrosscompile" in
4727 '') echo "Incpth not defined." >&4; croak=y ;;
4728 *) echo "Using incpth '$incpth'." >&4 ;;
4731 '') echo "Libpth not defined." >&4; croak=y ;;
4732 *) echo "Using libpth '$libpth'." >&4 ;;
4735 '') echo "Usrinc not defined." >&4; croak=y ;;
4736 *) echo "Using usrinc $usrinc." >&4 ;;
4740 if test "X$sysroot" = X; then
4741 echo "Cannot continue, aborting." >&4; exit 1
4743 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4752 : What should the include directory be ?
4753 : Use sysroot if set, so findhdr looks in the right place.
4755 $echo $n "Hmm... $c"
4756 dflt="$sysroot/usr/include"
4759 if $test -f /bin/mips && /bin/mips; then
4760 echo "Looks like a MIPS system..."
4761 $cat >usr.c <<'EOCP'
4762 #ifdef SYSTYPE_BSD43
4766 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4767 dflt='/bsd43/usr/include'
4771 mips_type='System V'
4773 $rm -f usr.c usr.out
4774 echo "and you're compiling with the $mips_type compiler and libraries."
4778 echo "Doesn't look like a MIPS system."
4788 case "$xxx_prompt" in
4791 rp='Where are the include files you want to use?'
4799 : Default value for incpth is just usrinc
4801 '') incpth="$usrinc";;
4804 : Set private lib path
4807 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4812 '') dlist="$loclibpth $plibpth $glibpth";;
4813 *) dlist="$libpth";;
4816 : Now check and see which directories actually exist, avoiding duplicates
4819 if $test -d $xxx; then
4822 *) libpth="$libpth $xxx";;
4828 Some systems have incompatible or broken versions of libraries. Among
4829 the directories listed in the question below, please remove any you
4830 know not to be holding relevant libraries, and add any that are needed.
4831 Say "none" for none.
4835 if test "X$sysroot" != X; then
4837 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4850 rp="Directories to use for library searches?"
4857 : compute shared library extension
4860 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4870 On some systems, shared libraries may be available. Answer 'none' if
4871 you want to suppress searching of shared libraries for the remainder
4872 of this configuration.
4875 rp='What is the file extension used for shared libraries?'
4879 : Does target system insist that shared library basenames are unique
4882 Some dynamic loaders assume that the *basename* of shared
4883 library filenames are globally unique.
4884 We'll default this to undef as we assume your system is not this
4885 weird. Set to defined if you're on one of them.
4890 rp='Make shared library basenames unique?'
4893 y|Y) val="$define" ;;
4896 set d_libname_unique
4899 : Define several unixisms.
4900 : Hints files or command line option can be used to override them.
4901 : The convoluted testing is in case hints files set either the old
4904 '') case "$exe_ext" in
4906 *) _exe="$exe_ext" ;;
4911 '') case "$lib_ext" in
4918 '') case "$obj_ext" in
4925 '') case "$path_sep" in
4936 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4938 : Which makefile gets called first. This is used by make depend.
4939 case "$firstmakefile" in
4940 '') firstmakefile='makefile';;
4943 : Check is we will use socks
4945 $define|true|[yY]*) dflt='y';;
4950 Perl can be built to use the SOCKS proxy protocol library. To do so,
4951 Configure must be run with -Dusesocks. If you use SOCKS you also need
4952 to use the PerlIO abstraction layer, this will be implicitly selected.
4954 If this doesn't make any sense to you, just accept the default '$dflt'.
4956 rp='Build Perl for SOCKS?'
4959 y|Y) val="$define" ;;
4965 : Check for uselongdouble support
4967 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4970 case "$uselongdouble" in
4971 $define|true|[yY]*) dflt='y';;
4976 Perl can be built to take advantage of long doubles which
4977 (if available) may give more accuracy and range for floating point numbers.
4979 If this doesn't make any sense to you, just accept the default '$dflt'.
4981 rp='Try to use long doubles if available?'
4984 y|Y) val="$define" ;;
4990 case "$uselongdouble" in
4991 true|[yY]*) uselongdouble="$define" ;;
4994 : Look for a hint-file generated 'call-back-unit'. If the
4995 : user has specified that long doubles should be used,
4996 : we may need to set or change some other defaults.
4997 if $test -f uselongdouble.cbu; then
4998 echo "Your platform has some specific hints regarding long doubles, using them..."
4999 . ./uselongdouble.cbu
5001 case "$uselongdouble" in
5004 (Your platform does not have any specific hints for long doubles.)
5010 : Looking for optional libraries
5012 echo "Checking for optional libraries..." >&4
5017 case "$libswanted" in
5018 '') libswanted='c_s';;
5021 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5027 for thisdir in $libpth $xlibpth; do
5028 test -d $thisdir && libspath="$libspath $thisdir"
5030 for thislib in $libswanted; do
5031 for thisdir in $libspath; do
5033 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5034 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5035 $test -f "$xxx" && eval $libscheck
5036 $test -f "$xxx" && libstyle=shared
5038 if test ! -f "$xxx"; then
5039 xxx=$thisdir/lib$thislib.$so
5040 $test -f "$xxx" && eval $libscheck
5041 $test -f "$xxx" && libstyle=shared
5043 if test ! -f "$xxx"; then
5044 xxx=$thisdir/lib$thislib$_a
5045 $test -f "$xxx" && eval $libscheck
5046 $test -f "$xxx" && libstyle=static
5048 if test ! -f "$xxx"; then
5049 xxx=$thisdir/$thislib$_a
5050 $test -f "$xxx" && eval $libscheck
5051 $test -f "$xxx" && libstyle=static
5053 if test ! -f "$xxx"; then
5054 xxx=$thisdir/lib${thislib}_s$_a
5055 $test -f "$xxx" && eval $libscheck
5056 $test -f "$xxx" && libstyle=static
5057 $test -f "$xxx" && thislib=${thislib}_s
5059 if test ! -f "$xxx"; then
5060 xxx=$thisdir/Slib$thislib$_a
5061 $test -f "$xxx" && eval $libscheck
5062 $test -f "$xxx" && libstyle=static
5064 if $test -f "$xxx"; then
5066 shared) echo "Found -l$thislib (shared)." ;;
5067 static) echo "Found -l$thislib." ;;
5068 *) echo "Found -l$thislib ($libstyle)." ;;
5072 *) dflt="$dflt -l$thislib"
5073 libsfound="$libsfound $xxx"
5075 libsfiles="$libsfiles $yyy"
5076 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5077 case " $libsdirs " in
5079 *) libsdirs="$libsdirs $yyy" ;;
5086 if $test ! -f "$xxx"; then
5087 echo "No -l$thislib."
5098 ' '|'') dflt='none';;
5103 In order to compile $package on your machine, a number of libraries
5104 are usually needed. Include any other special libraries here as well.
5105 Say "none" for none. The default list is almost always right.
5109 rp="What libraries to use?"
5116 : determine optimization, if desired, or use for debug flag also
5118 ' '|$undef) dflt='none';;
5120 *) dflt="$optimize";;
5124 By default, $package compiles with the -O flag to use the optimizer.
5125 Alternately, you might want to use the symbolic debugger, which uses
5126 the -g flag (on traditional Unix systems). Either flag can be
5127 specified here. To use neither flag, specify the word "none".
5130 rp="What optimizer/debugger flag should be used?"
5134 'none') optimize=" ";;
5137 : Check what DEBUGGING is required from the command line
5138 : -DEBUGGING or -DDEBUGGING or
5139 : -DEBUGGING=both = -g + -DDEBUGGING
5140 : -DEBUGGING=-g or -Doptimize=-g = -g
5141 : -DEBUGGING=none or -UDEBUGGING =
5142 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5145 *) DEBUGGING=$EBUGGING ;;
5148 case "$DEBUGGING" in
5152 *) optimize="$optimize -g" ;;
5156 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5164 case "$DEBUGGING" in
5165 both|$define) dflt='-DDEBUGGING'
5168 : argument order is deliberate, as the flag will start with - which set could
5169 : think is an option
5170 checkccflag='check=$1; flag=$2; callback=$3;
5172 echo "Checking if your compiler accepts $flag" 2>&1;
5173 echo "int main(void) { return 0; }" > gcctest.c;
5174 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5175 echo "Yes, it does." 2>&1;
5176 if $test -s gcctest.out ; then
5177 echo "But your platform does not like it:";
5182 echo "Leaving current flags $ccflags alone." 2>&1
5184 *) dflt="$dflt $flag";
5190 echo "Nope, it does not, but that is ok." 2>&1;
5194 : We will not override a previous value, but we might want to
5195 : augment a hint file
5197 default|recommended)
5198 case "$gccversion" in
5199 1*) dflt="$dflt -fpcc-struct-return" ;;
5201 case "$optimize:$DEBUGGING" in
5202 *-g*:old) dflt="$dflt -DDEBUGGING";;
5204 case "$gccversion" in
5205 2*) if $test -d /etc/conf/kconfig.d &&
5206 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5208 # Interactive Systems (ISC) POSIX mode.
5213 case "$gccversion" in
5216 ?*) set strict-aliasing -fno-strict-aliasing
5220 # For gcc, adding -pipe speeds up compilations for some, but apparently
5221 # some assemblers can't read from stdin. (It also slows down compilations
5222 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5223 case "$gccversion" in
5229 # on x86_64 (at least) we require an extra library (libssp) in the
5230 # link command line. This library is not named, so I infer that it is
5231 # an implementation detail that may change. Hence the safest approach
5232 # is to add the flag to the flags passed to the compiler at link time,
5233 # as that way the compiler can do the right implementation dependant
5235 case "$gccversion" in
5236 ?*) set stack-protector -fstack-protector
5243 case "$mips_type" in
5244 *BSD*|'') inclwanted="$locincpth $usrinc";;
5245 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5247 for thisincl in $inclwanted; do
5248 if $test -d $thisincl; then
5249 if $test x$thisincl != x$usrinc; then
5251 *" -I$thisincl "*);;
5252 *) dflt="$dflt -I$thisincl ";;
5258 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5260 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5268 *) dflt="$dflt -D$2";;
5272 set signal.h LANGUAGE_C; eval $inctest
5276 ccflags="$ccflags -DSOCKS"
5281 default|recommended) dflt="$ccflags $dflt" ;;
5282 *) dflt="$ccflags";;
5291 Your C compiler may want other flags. For this question you should include
5292 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5293 but you should NOT include libraries or ld flags like -lwhatever. If you
5294 want $package to honor its debug switch, you should include -DDEBUGGING here.
5295 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5297 To use no flags, specify the word "none".
5303 rp="Any additional cc flags?"
5310 : the following weeds options from ccflags that are of no interest to cpp
5312 '') cppflags="$ccflags" ;;
5313 *) cppflags="$cppflags $ccflags" ;;
5315 case "$gccversion" in
5316 1*) cppflags="$cppflags -D__GNUC__"
5318 case "$mips_type" in
5320 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5326 echo "Let me guess what the preprocessor flags are..." >&4
5340 *) ftry="$previous $flag";;
5342 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5343 >cpp1.out 2>/dev/null && \
5344 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5345 >cpp2.out 2>/dev/null && \
5346 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5347 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5349 cppflags="$cppflags $ftry"
5359 *-*) echo "They appear to be: $cppflags";;
5361 $rm -f cpp.c cpp?.out
5365 : flags used in final linking phase
5367 '') if ./venix; then
5373 *-posix*) dflt="$dflt -posix" ;;
5376 *) dflt="$ldflags";;
5378 # See note above about -fstack-protector
5380 *-fstack-protector*)
5382 *-fstack-protector*) ;; # Don't add it again
5383 *) dflt="$dflt -fstack-protector" ;;
5388 : Try to guess additional flags to pick up local libraries.
5389 for thislibdir in $libpth; do
5390 case " $loclibpth " in
5393 *"-L$thislibdir "*) ;;
5394 *) dflt="$dflt -L$thislibdir" ;;
5406 Your C linker may need flags. For this question you should
5407 include -L/whatever and any other flags used by the C linker, but you
5408 should NOT include libraries like -lwhatever.
5410 Make sure you include the appropriate -L/path flags if your C linker
5411 does not normally search all of the directories you specified above,
5414 To use no flags, specify the word "none".
5418 rp="Any additional ld flags (NOT including libraries)?"
5424 rmlist="$rmlist pdp11"
5428 echo "Checking your choice of C compiler and flags for coherency..." >&4
5429 $cat > try.c <<'EOF'
5431 int main() { printf("Ok\n"); return(0); }
5433 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5435 $cat >try.msg <<'EOM'
5436 I've tried to compile and run the following simple program:
5439 $cat try.c >> try.msg
5441 $cat >> try.msg <<EOM
5448 and I got the following output:
5452 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5453 if $sh -c "$run ./try " >>try.msg 2>&1; then
5457 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5460 echo "The program compiled OK, but exited with status $?." >>try.msg
5461 rp="You have a problem. Shall I abort Configure"
5465 echo "I can't compile the test program." >>try.msg
5466 rp="You have a BIG problem. Shall I abort Configure"
5472 case "$knowitall" in
5474 echo "(The supplied flags or libraries might be incorrect.)"
5482 *) echo "Ok. Stopping Configure." >&4
5487 n) echo "OK, that should do.";;
5489 $rm_try gcctest gcctest.out
5491 : define a shorthand compile call
5495 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5496 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5500 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5501 : define a shorthand compile call for compilations that should be ok.
5505 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5507 : determine filename position in cpp output
5509 echo "Computing filename position in cpp output for #include directives..." >&4
5511 vos) testaccess=-e ;;
5514 echo '#include <stdio.h>' > foo.c
5517 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5518 $grep '^[ ]*#.*stdio\.h' | \
5519 while read cline; do
5522 while $test \$# -gt 0; do
5523 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5528 pos=\`expr \$pos + 1\`
5540 *) pos="${fieldn}th";;
5542 echo "Your cpp writes the filename in the $pos field of the line."
5544 : locate header file
5549 for usrincdir in $incpth
5551 if test -f \$usrincdir/\$wanted; then
5552 echo "\$usrincdir/\$wanted"
5556 awkprg='{ print \$$fieldn }'
5557 echo "#include <\$wanted>" > foo\$\$.c
5558 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5559 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5560 while read cline; do
5561 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5563 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5564 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5569 # status = 0: grep returned 0 lines, case statement not executed
5570 # status = 1: headerfile found
5571 # status = 2: while loop executed, no headerfile found
5575 if test \$status -eq 1; then
5582 : define an alternate in-header-list? function
5583 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5584 cont=true; xxf="echo \"<\$1> found.\" >&4";
5585 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5586 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5588 case $# in 4) instead=instead;; *) instead="at last";; esac;
5589 while $test "$cont"; do
5591 var=$2; eval "was=\$$2";
5592 if $test "$xxx" && $test -r "$xxx";
5594 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5597 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5598 set $yyy; shift; shift; yyy=$@;
5599 case $# in 0) cont="";;
5600 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5601 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5602 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5603 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5607 do set $yyy; var=$2; eval "was=\$$2";
5608 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5609 set $yyy; shift; shift; yyy=$@;
5612 : see if stdlib is available
5613 set stdlib.h i_stdlib
5616 : check for lengths of integral types
5620 echo "Checking to see how big your integers are..." >&4
5629 printf("intsize=%d;\n", (int)sizeof(int));
5630 printf("longsize=%d;\n", (int)sizeof(long));
5631 printf("shortsize=%d;\n", (int)sizeof(short));
5636 if eval $compile_ok && $run ./try > /dev/null; then
5638 echo "Your integers are $intsize bytes long."
5639 echo "Your long integers are $longsize bytes long."
5640 echo "Your short integers are $shortsize bytes long."
5644 Help! I can't compile and run the intsize test program: please enlighten me!
5645 (This is probably a misconfiguration in your system or libraries, and
5646 you really ought to fix it. Still, I'll try anyway.)
5650 rp="What is the size of an integer (in bytes)?"
5654 rp="What is the size of a long integer (in bytes)?"
5658 rp="What is the size of a short integer (in bytes)?"
5666 : check for long long
5668 echo "Checking to see if you have long long..." >&4
5669 echo 'int main() { long long x = 7; return 0; }' > try.c
5671 if eval $compile; then
5673 echo "You have long long."
5676 echo "You do not have long long."
5682 : check for length of long long
5683 case "${d_longlong}${longlongsize}" in
5686 echo "Checking to see how big your long longs are..." >&4
5687 $cat >try.c <<'EOCP'
5691 printf("%d\n", (int)sizeof(long long));
5696 if eval $compile_ok; then
5697 longlongsize=`$run ./try`
5698 echo "Your long longs are $longlongsize bytes long."
5702 echo "(I can't seem to compile the test program. Guessing...)"
5703 rp="What is the size of a long long (in bytes)?"
5707 if $test "X$longsize" = "X$longlongsize"; then
5708 echo "(That isn't any different from an ordinary long.)"
5714 : see if inttypes.h is available
5715 : we want a real compile instead of Inhdr because some systems
5716 : have an inttypes.h which includes non-existent headers
5719 #include <inttypes.h>
5721 static int32_t foo32 = 0x12345678;
5725 if eval $compile; then
5726 echo "<inttypes.h> found." >&4
5729 echo "<inttypes.h> NOT found." >&4
5738 echo "Checking to see if you have int64_t..." >&4
5740 #include <sys/types.h>
5741 #$i_inttypes I_INTTYPES
5743 #include <inttypes.h>
5745 int main() { int64_t x = 7; }
5748 if eval $compile; then
5750 echo "You have int64_t."
5753 echo "You do not have int64_t."
5759 : Check if 64bit ints have a quad type
5761 echo "Checking which 64-bit integer type we could use..." >&4
5767 val='"unsigned int"'
5772 *) case "$longsize" in
5776 val='"unsigned long"'
5781 *) case "$d_longlong:$longlongsize" in
5786 val='"unsigned long long"'
5791 *) case "$d_int64_t" in
5810 '') echo "Alas, no 64-bit integer types in sight." >&4
5813 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5818 : Do we want 64bit support
5819 case "$uselonglong" in
5820 "$define"|true|[yY]*)
5823 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5825 use64bitint="$define"
5828 case "$use64bits" in
5829 "$define"|true|[yY]*)
5832 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5834 use64bitint="$define"
5837 case "$use64bitints" in
5838 "$define"|true|[yY]*)
5841 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5843 use64bitint="$define"
5846 case "$use64bitsint" in
5847 "$define"|true|[yY]*)
5850 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5852 use64bitint="$define"
5855 case "$uselonglongs" in
5856 "$define"|true|[yY]*)
5859 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5861 use64bitint="$define"
5864 case "$use64bitsall" in
5865 "$define"|true|[yY]*)
5868 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5870 use64bitall="$define"
5875 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5877 case "$use64bitall" in
5878 "$define"|true|[yY]*) use64bitint="$define" ;;
5884 You have natively 64-bit long integers.
5888 *) case "$use64bitint" in
5889 "$define"|true|[yY]*) dflt='y';;
5898 Perl can be built to take advantage of 64-bit integer types
5899 on some systems. To do so, Configure can be run with -Duse64bitint.
5900 Choosing this option will most probably introduce binary incompatibilities.
5902 If this doesn't make any sense to you, just accept the default '$dflt'.
5903 (The default has been chosen based on your configuration.)
5905 rp='Try to use 64-bit integers, if available?'
5908 [yY]*) val="$define" ;;
5916 case "$use64bitall" in
5917 "$define"|true|[yY]*) dflt='y' ;;
5918 *) case "$longsize" in
5926 You may also choose to try maximal 64-bitness. It means using as much
5927 64-bitness as possible on the platform. This in turn means even more
5928 binary incompatibilities. On the other hand, your platform may not
5929 have any more 64-bitness available than what you already have chosen.
5931 If this doesn't make any sense to you, just accept the default '$dflt'.
5932 (The default has been chosen based on your configuration.)
5934 rp='Try to use maximal 64-bit support, if available?'
5937 [yY]*) val="$define" ;;
5942 case "$use64bitall" in
5944 case "$use64bitint" in
5948 Since you have chosen a maximally 64-bit build, I'm also turning on
5949 the use of 64-bit integers.
5951 use64bitint="$define" ;;
5956 : Look for a hint-file generated 'call-back-unit'. If the
5957 : user has specified that a 64-bit perl is to be built,
5958 : we may need to set or change some other defaults.
5959 if $test -f use64bitint.cbu; then
5960 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5963 case "$use64bitint" in
5964 "$define"|true|[yY]*)
5965 : This test was common to all the OpenBSD forks, and seems harmless for
5968 echo "Checking if your C library has broken 64-bit functions..." >&4
5971 typedef $uquadtype myULL;
5978 {4294967303.15, 4294967303ULL},
5979 {4294967294.2, 4294967294ULL},
5980 {4294967295.7, 4294967295ULL},
5983 for (p = test; p->u; p++) {
5984 myULL x = (myULL)p->d;
5995 if eval $compile_ok; then
5996 libcquad=`$run ./try`
5997 echo "Your C library's 64-bit functions are $libcquad."
5999 echo "(I can't seem to compile the test program.)"
6000 echo "Assuming that your C library's 64-bit functions are ok."
6009 *** You have a C library with broken 64-bit functions.
6010 *** 64-bit support does not work reliably in this configuration.
6011 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6012 *** Cannot continue, aborting.
6019 4) case "$archname64" in
6020 '') archname64=64int ;;
6027 : Look for a hint-file generated 'call-back-unit'. If the
6028 : user has specified that a maximally 64-bit perl is to be built,
6029 : we may need to set or change some other defaults.
6030 if $test -f use64bitall.cbu; then
6031 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6034 case "$use64bitall" in
6035 "$define"|true|[yY]*)
6037 4) case "$archname64" in
6038 ''|64int) archname64=64all ;;
6045 case "$d_quad:$use64bitint" in
6049 *** You have chosen to use 64-bit integers,
6050 *** but none can be found.
6051 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6052 *** Cannot continue, aborting.
6059 : check for length of double
6061 case "$doublesize" in
6063 echo "Checking to see how big your double precision numbers are..." >&4
6072 printf("%d\n", (int)sizeof(double));
6077 if eval $compile_ok; then
6078 doublesize=`$run ./try`
6079 echo "Your double is $doublesize bytes long."
6082 echo "(I can't seem to compile the test program. Guessing...)"
6083 rp="What is the size of a double precision number (in bytes)?"
6091 : check for long doubles
6093 echo "Checking to see if you have long double..." >&4
6094 echo 'int main() { long double x = 7.0; }' > try.c
6096 if eval $compile; then
6098 echo "You have long double."
6101 echo "You do not have long double."
6107 : check for length of long double
6108 case "${d_longdbl}${longdblsize}" in
6111 echo "Checking to see how big your long doubles are..." >&4
6112 $cat >try.c <<'EOCP'
6116 printf("%d\n", sizeof(long double));
6121 if eval $compile; then
6122 longdblsize=`$run ./try`
6123 echo "Your long doubles are $longdblsize bytes long."
6127 echo "(I can't seem to compile the test program. Guessing...)" >&4
6128 rp="What is the size of a long double (in bytes)?"
6132 if $test "X$doublesize" = "X$longdblsize"; then
6133 echo "That isn't any different from an ordinary double."
6134 echo "I'll keep your setting anyway, but you may see some"
6135 echo "harmless compilation warnings."
6141 : determine the architecture name
6143 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6144 tarch=`arch`"-$osname"
6145 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6146 if uname -m > tmparch 2>&1 ; then
6147 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6148 -e 's/$/'"-$osname/" tmparch`
6156 case "$myarchname" in
6159 echo "(Your architecture name used to be $myarchname.)"
6163 case "$targetarch" in
6165 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6170 *) dflt="$archname";;
6172 rp='What is your architecture name'
6176 : optionally add API version to the architecture for versioned archlibs
6177 case "$useversionedarchname" in
6178 $define|true|[yY]*) dflt='y';;
6181 rp='Add the Perl API version to your archname?'
6184 y|Y) useversionedarchname="$define" ;;
6185 *) useversionedarchname="$undef" ;;
6187 case "$useversionedarchname" in
6190 *-$api_versionstring)
6191 echo "...and architecture name already has -$api_versionstring" >&4
6194 archname="$archname-$api_versionstring"
6195 echo "...setting architecture name to $archname." >&4
6201 case "$usethreads" in
6203 echo "Threads selected." >&4
6205 *-thread*) echo "...and architecture name already has -thread." >&4
6207 *) archname="$archname-thread"
6208 echo "...setting architecture name to $archname." >&4
6213 case "$usemultiplicity" in
6215 echo "Multiplicity selected." >&4
6217 *-multi*) echo "...and architecture name already has -multi." >&4
6219 *) archname="$archname-multi"
6220 echo "...setting architecture name to $archname." >&4
6225 case "$use64bitint$use64bitall" in
6227 case "$archname64" in
6229 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6232 case "$use64bitint" in
6233 "$define") echo "64 bit integers selected." >&4 ;;
6235 case "$use64bitall" in
6236 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6239 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6241 *) archname="$archname-$archname64"
6242 echo "...setting architecture name to $archname." >&4
6248 case "$uselongdouble" in
6250 echo "Long doubles selected." >&4
6251 case "$longdblsize" in
6253 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6257 *-ld*) echo "...and architecture name already has -ld." >&4
6259 *) archname="$archname-ld"
6260 echo "...setting architecture name to $archname." >&4
6267 if $test -f archname.cbu; then
6268 echo "Your platform has some specific hints for architecture name, using them..."
6272 : set the prefixit variable, to compute a suitable default value
6273 prefixit='case "$3" in
6275 case "$oldprefix" in
6276 "") eval "$1=\"\$$2\"";;
6283 ""|" ") eval "$1=\"\$$2\"";;
6289 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6291 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6292 /*-$oldprefix/*|\~*-$oldprefix/*)
6293 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6294 *) eval "$1=\"\$$2\"";;
6298 : determine installation style
6299 : For now, try to deduce it from prefix unless it is already set.
6300 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6301 case "$installstyle" in
6302 '') case "$prefix" in
6303 *perl*) dflt='lib';;
6304 *) dflt='lib/perl5' ;;
6307 *) dflt="$installstyle" ;;
6309 : Probably not worth prompting for this since we prompt for all
6310 : the directories individually, and the prompt would be too long and
6314 : determine where public executables go
6319 rp='Pathname where the public executables will reside?'
6321 if $test "X$ansexp" != "X$binexp"; then
6325 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6326 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6327 : this via initialinstalllocation
6330 case "$userelocatableinc" in
6331 $define|true|[yY]*) dflt='y' ;;
6336 Would you like to build Perl so that the installation is relocatable, so that
6337 library paths in @INC are determined relative to the path of the perl binary?
6338 This is not advised for system Perl installs, or if you need to run setid
6339 scripts or scripts under taint mode.
6341 If this doesn't make any sense to you, just accept the default '$dflt'.
6343 rp='Use relocatable @INC?'
6346 y|Y) val="$define" ;;
6349 set userelocatableinc
6352 initialinstalllocation="$binexp"
6353 : Default prefix is now "up one level from where the binaries are"
6354 case "$userelocatableinc" in
6360 installprefixexp=".../.."
6364 : determine where private library files go
6365 : Usual default is /usr/local/lib/perl5/$version.
6366 : Also allow things like /opt/perl/lib/$version, since
6367 : /opt/perl/lib/perl5... would be redundant.
6368 : The default "style" setting is made in installstyle.U
6369 case "$installstyle" in
6370 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6371 *) set dflt privlib lib/$version ;;
6376 There are some auxiliary files for $package that need to be put into a
6377 private library directory that is accessible by everyone.
6382 rp='Pathname where the private library files will reside?'
6387 : set the prefixup variable, to restore leading tilda escape
6388 prefixup='case "$prefixexp" in
6390 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6393 : determine where public architecture dependent libraries go
6396 : privlib default is /usr/local/lib/$package/$version
6397 : archlib default is /usr/local/lib/$package/$version/$archname
6398 : privlib may have an optional trailing /share.
6399 tdflt=`echo $privlib | $sed 's,/share$,,'`
6400 tdflt=$tdflt/$archname
6409 $spackage contains architecture-dependent library files. If you are
6410 sharing libraries in a heterogeneous environment, you might store
6411 these files in a separate location. Otherwise, you can just include
6412 them with the rest of the public library files.
6417 rp='Where do you want to put the public architecture-dependent libraries?'
6421 if $test X"$archlib" = X"$privlib"; then
6427 : see if setuid scripts can be secure
6430 Some kernels have a bug that prevents setuid #! scripts from being
6431 secure. Some sites have disabled setuid #! scripts because of this.
6433 First let's decide if your kernel supports secure setuid #! scripts.
6434 (If setuid #! scripts would be secure but have been disabled anyway,
6435 don't say that they are secure if asked.)
6440 if $test -d /dev/fd; then
6441 echo "#!$ls" >reflect
6442 chmod +x,u+s reflect
6443 ./reflect >flect 2>&1
6444 if $contains "/dev/fd" flect >/dev/null; then
6445 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6449 If you are not sure if they are secure, I can check but I'll need a
6450 username and password different from the one you are using right now.
6451 If you don't have such a username or don't want me to test, simply
6455 rp='Other username to test security of setuid scripts with?'
6460 case "$d_suidsafe" in
6461 '') echo "I'll assume setuid scripts are *not* secure." >&4
6464 echo "Well, the $hint value is *not* secure." >&4
6466 *) echo "Well, the $hint value *is* secure." >&4
6471 $rm -f reflect flect
6472 echo "#!$ls" >reflect
6473 chmod +x,u+s reflect
6476 echo '"su" will (probably) prompt you for '"$ans's password."
6477 su $ans -c './reflect >flect'
6478 if $contains "/dev/fd" flect >/dev/null; then
6479 echo "Okay, it looks like setuid scripts are secure." >&4
6482 echo "I don't think setuid scripts are secure." >&4
6487 rp='Does your kernel have *secure* setuid scripts?'
6490 [yY]*) val="$define";;
6495 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6496 echo "(That's for file descriptors, not floppy disks.)"
6502 $rm -f reflect flect
6504 : now see if they want to do setuid emulation
6505 if $test $patchlevel -lt 11; then
6508 case "$d_suidsafe" in
6511 echo "No need to emulate SUID scripts since they are secure here." >&4
6515 Some systems have disabled setuid scripts, especially systems where
6516 setuid scripts cannot be secure. On systems where setuid scripts have
6517 been disabled, the setuid/setgid bits on scripts are currently
6518 useless. It is possible for $package to detect those bits and emulate
6519 setuid/setgid in a secure fashion. This emulation will only work if
6520 setuid scripts have been disabled in your kernel.
6524 "$define") dflt=y ;;
6527 rp="Do you want to do setuid/setgid emulation?"
6530 [yY]*) val="$define";;
6542 SUID emulation has been removed for 5.12
6543 Please re-run Configure without -Dd_dosuid
6552 : Find perl5.005 or later.
6553 echo "Looking for a previously installed perl5.005 or later... "
6555 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6556 : Check if this perl is recent and can load a simple module
6557 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6560 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6570 '') echo "None found. That's ok.";;
6571 *) echo "Using $perl5." ;;
6574 : Set the siteprefix variables
6577 After $package is installed, you may wish to install various
6578 add-on modules and utilities. Typically, these add-ons will
6579 be installed under $prefix with the rest
6580 of this package. However, you may wish to install such add-ons
6581 elsewhere under a different prefix.
6583 If you do not wish to put everything under a single prefix, that's
6584 ok. You will be prompted for the individual locations; this siteprefix
6585 is only used to suggest the defaults.
6587 The default should be fine for most people.
6591 rp='Installation prefix to use for add-on modules and utilities?'
6592 : XXX Here might be another good place for an installstyle setting.
6593 case "$siteprefix" in
6595 *) dflt=$siteprefix ;;
6598 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6600 case "$siteprefix" in
6604 *) oldsiteprefix="$prefix";;
6609 siteprefixexp="$ansexp"
6611 : determine where site specific libraries go.
6612 : Usual default is /usr/local/lib/perl5/site_perl/$version
6613 : The default "style" setting is made in installstyle.U
6614 : XXX No longer works with Prefixit stuff.
6615 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6617 '') case "$installstyle" in
6618 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6619 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6627 The installation process will create a directory for
6628 site-specific extensions and modules. Most users find it convenient
6629 to place all site-specific files in this directory rather than in the
6630 main distribution directory.
6634 rp='Pathname for the site-specific library files?'
6638 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6640 : Determine list of previous versions to include in @INC
6641 $cat > getverlist <<EOPL
6644 \$api_versionstring = "$api_versionstring";
6645 \$version = "$version";
6646 \$stem = "$sitelib_stem";
6647 \$archname = "$archname";
6649 $cat >> getverlist <<'EOPL'
6650 # The list found is store twice for each entry: the original name, and
6651 # the binary broken down version as pack "sss", so sorting is easy and
6652 # unambiguous. This will work for all versions that have a maximum of
6653 # three digit groups, separate by '.'s or '_'s. Names are extended with
6654 # ".0.0" to ensure at least three elements for the pack.
6655 # -- H.Merijn Brand (m)'06 23-10-2006
6657 # Can't have leading @ because metaconfig interprets it as a command!
6658 ;@inc_version_list=();
6659 # XXX Redo to do opendir/readdir?
6662 ;@candidates = map {
6663 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6664 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6670 ($pversion, $aversion, $vsn5005) = map {
6671 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6672 foreach $d (@candidates) {
6673 if ($d->[1] lt $pversion) {
6674 if ($d->[1] ge $aversion) {
6675 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6677 elsif ($d->[1] ge $vsn5005) {
6678 unshift(@inc_version_list, grep { -d } $d->[0]);
6682 # Skip newer version. I.e. don't look in
6683 # 5.7.0 if we're installing 5.6.1.
6687 if (@inc_version_list) {
6688 print join(' ', @inc_version_list);
6691 # Blank space to preserve value for next Configure run.
6696 case "$inc_version_list" in
6697 '') if test -x "$perl5$exe_ext"; then
6698 dflt=`$perl5 getverlist`
6703 $undef) dflt='none' ;;
6704 *) eval dflt=\"$inc_version_list\" ;;
6707 ''|' ') dflt=none ;;
6714 In order to ease the process of upgrading, this version of perl
6715 can be configured to use modules built and installed with earlier
6716 versions of perl that were installed under $prefix. Specify here
6717 the list of earlier versions that this version of perl should check.
6718 If Configure detected no earlier versions of perl installed under
6719 $prefix, then the list will be empty. Answer 'none' to tell perl
6720 to not search earlier versions.
6722 The default should almost always be sensible, so if you're not sure,
6723 just accept the default.
6726 rp='List of earlier versions to include in @INC?'
6729 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6730 *) inc_version_list="$ans" ;;
6732 case "$inc_version_list" in
6734 inc_version_list_init='0'
6735 d_inc_version_list="$undef"
6737 *) inc_version_list_init=`echo $inc_version_list |
6738 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6739 d_inc_version_list="$define"
6744 : see if malloc/malloc.h has to be included
6745 set malloc/malloc.h i_mallocmalloc
6748 : see if this is a malloc.h system
6749 : we want a real compile instead of Inhdr because some systems have a
6750 : malloc.h that just gives a compile error saying to use stdlib.h instead
6755 #$i_mallocmalloc I_MALLOCMALLOC
6756 #ifdef I_MALLOCMALLOC
6757 # include <malloc/malloc.h>
6760 int main () { return 0; }
6763 if eval $compile; then
6764 echo "<malloc.h> found." >&4
6767 echo "<malloc.h> NOT found." >&4
6774 : check for length of pointer
6778 echo "Checking to see how big your pointers are..." >&4
6787 printf("%d\n", (int)sizeof(void *));
6792 if eval $compile_ok; then
6793 ptrsize=`$run ./try`
6794 echo "Your pointers are $ptrsize bytes long."
6797 echo "(I can't seem to compile the test program. Guessing...)" >&4
6798 rp="What is the size of a pointer (in bytes)?"
6805 case "$use64bitall" in
6806 "$define"|true|[yY]*)
6810 *** You have chosen a maximally 64-bit build,
6811 *** but your pointers are only 4 bytes wide.
6812 *** Please rerun Configure without -Duse64bitall.
6817 *** Since you have quads, you could possibly try with -Duse64bitint.
6822 *** Cannot continue, aborting.
6833 : determine whether to use malloc wrapping
6835 case "$usemallocwrap" in
6836 [yY]*|true|$define) dflt='y' ;;
6837 [nN]*|false|$undef) dflt='n' ;;
6838 *) case "$usedevel" in
6839 [yY]*|true|$define) dflt='y' ;;
6844 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6846 usemallocwrap="$ans"
6849 usemallocwrap="$define" ;;
6851 usemallocwrap="$undef" ;;
6854 : determine which malloc to compile in
6856 case "$usemymalloc" in
6857 [yY]*|true|$define) dflt='y' ;;
6858 [nN]*|false|$undef) dflt='n' ;;
6859 *) case "$ptrsize" in
6863 if test "$useithreads" = "$define"; then dflt='n'; fi
6866 rp="Do you wish to attempt to use the malloc that comes with $package?"
6872 mallocsrc='malloc.c'
6873 mallocobj="malloc$_o"
6874 d_mymalloc="$define"
6877 : Remove malloc from list of libraries to use
6878 echo "Removing unneeded -lmalloc from library list" >&4
6879 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6882 echo "libs = $libs" >&4
6894 : compute the return types of malloc and free
6896 $cat >malloc.c <<END
6900 #include <sys/types.h>
6914 case "$malloctype" in
6916 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6923 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6927 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6934 echo "Your system uses $freetype free(), it would seem." >&4
6936 : determine where site specific architecture-dependent libraries go.
6937 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6938 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6939 : sitelib may have an optional trailing /share.
6941 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6942 dflt="$dflt/$archname"
6947 set sitearch sitearch none
6951 The installation process will also create a directory for
6952 architecture-dependent site-specific extensions and modules.
6956 rp='Pathname for the site-specific architecture-dependent library files?'
6960 if $test X"$sitearch" = X"$sitelib"; then
6963 d_sitearch="$define"
6966 : Set the vendorprefix variables
6969 The installation process will also create a directory for
6970 vendor-supplied add-ons. Vendors who supply perl with their system
6971 may find it convenient to place all vendor-supplied files in this
6972 directory rather than in the main distribution directory. This will
6973 ease upgrades between binary-compatible maintenance versions of perl.
6975 Of course you may also use these directories in whatever way you see
6976 fit. For example, you might use them to access modules shared over a
6977 company-wide network.
6979 The default answer should be fine for most people.
6980 This causes further questions about vendor add-ons to be skipped
6981 and no vendor-specific directories will be configured for perl.
6984 rp='Do you want to configure vendor-specific add-on directories?'
6985 case "$usevendorprefix" in
6986 define|true|[yY]*) dflt=y ;;
6987 *) : User may have set vendorprefix directly on Configure command line.
6988 case "$vendorprefix" in
6997 rp='Installation prefix to use for vendor-supplied add-ons?'
6998 case "$vendorprefix" in
6999 '') dflt="$prefix" ;;
7000 *) dflt=$vendorprefix ;;
7003 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7005 case "$vendorprefix" in
7009 *) oldvendorprefix="$prefix";;
7013 usevendorprefix="$define"
7015 vendorprefixexp="$ansexp"
7017 *) usevendorprefix="$undef"
7023 : Set the vendorlib variables
7024 case "$vendorprefix" in
7025 '') d_vendorlib="$undef"
7029 *) d_vendorlib="$define"
7030 : determine where vendor-supplied modules go.
7031 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7032 case "$vendorlib" in
7034 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7035 case "$installstyle" in
7036 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7037 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7040 *) dflt="$vendorlib"
7044 rp='Pathname for the vendor-supplied library files?'
7047 vendorlibexp="$ansexp"
7050 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7054 : Set the vendorarch variables
7055 case "$vendorprefix" in
7056 '') d_vendorarch="$undef"
7060 *) d_vendorarch="$define"
7061 : determine where vendor-supplied architecture-dependent libraries go.
7062 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7063 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7064 : vendorlib may have an optional trailing /share.
7065 case "$vendorarch" in
7066 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7067 dflt="$dflt/$archname"
7069 *) dflt="$vendorarch" ;;
7072 rp='Pathname for vendor-supplied architecture-dependent files?'
7075 vendorarchexp="$ansexp"
7078 prefixvar=vendorarch
7080 if $test X"$vendorarch" = X"$vendorlib"; then
7081 d_vendorarch="$undef"
7083 d_vendorarch="$define"
7086 : Final catch-all directories to search
7089 Lastly, you can have perl look in other directories for extensions and
7090 modules in addition to those already specified.
7091 These directories will be searched after
7095 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7096 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7098 case "$otherlibdirs" in
7099 ''|' ') dflt='none' ;;
7100 *) dflt="$otherlibdirs" ;;
7103 Enter a colon-separated set of extra paths to include in perl's @INC
7104 search path, or enter 'none' for no extra paths.
7108 rp='Colon-separated list of additional directories for perl to search?'
7111 ' '|''|none) otherlibdirs=' ' ;;
7112 *) otherlibdirs="$ans" ;;
7114 case "$otherlibdirs" in
7118 set d_perl_otherlibdirs
7121 : Cruising for prototypes
7123 echo "Checking out function prototypes..." >&4
7124 $cat >prototype.c <<EOCP
7129 int main(int argc, char *argv[]) {
7132 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7133 echo "Your C compiler appears to support function prototypes."
7136 echo "Your C compiler doesn't seem to understand function prototypes."
7143 : Check if ansi2knr is required
7144 case "$prototype" in
7146 *) ansi2knr='ansi2knr'
7151 This version of $package can only be compiled by a compiler that
7152 understands function prototypes. Unfortunately, your C compiler
7154 doesn't seem to understand them. Sorry about that.
7156 If GNU cc is available for your system, perhaps you could try that instead.
7158 Eventually, we hope to support building Perl with pre-ANSI compilers.
7159 If you would like to help in that effort, please contact <perlbug@perl.org>.
7161 Aborting Configure now.
7168 dflt_dtrace='/usr/sbin/dtrace'
7169 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7173 Perl can be built to support DTrace on platforms that support it.
7174 DTrace is a diagnosis and performance analysis tool from Sun.
7176 If this doesn't make any sense to you, just accept the default '$dflt'.
7180 case "$usedtrace" in
7186 dflt_dtrace=$usedtrace
7193 rp='Support DTrace if available?'
7196 y|Y) val="$define" ;;
7202 test "X$usedtrace" != "X$define" && break
7205 rp='Where is the dtrace executable?'
7214 if $dtrace -h -s ../perldtrace.d \
7215 -o perldtrace.tmp >/dev/null 2>&1 \
7216 && rm -f perldtrace.tmp
7219 echo "Good: your $dtrace knows about the -h flag."
7223 *** $me: Fatal Error: $dtrace doesn't support -h flag
7225 *** Your installed dtrace doesn't support the -h switch to compile a D
7226 *** program into a C header. Can't continue.
7238 *** $me: Fatal Error: $dtrace not found.
7245 echo "*** $dtrace was not found."
7251 : See if we want extra modules installed
7258 Perl can be built with extra modules or bundles of modules which
7259 will be fetched from the CPAN and installed alongside Perl.
7261 Notice that you will need access to the CPAN; either via the Internet,
7262 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7263 be asked later to configure the CPAN.pm module which will in turn do
7264 the installation of the rest of the extra modules or bundles.)
7266 Notice also that if the modules require any external software such as
7267 libraries and headers (the libz library and the zlib.h header for the
7268 Compress::Zlib module, for example) you MUST have any such software
7269 already installed, this configuration process will NOT install such
7272 If this doesn't make any sense to you, just accept the default '$dflt'.
7274 rp='Install any extra modules (y or n)?'
7280 Please list any extra modules or bundles to be installed from CPAN,
7281 with spaces between the names. The names can be in any format the
7282 'install' command of CPAN.pm will understand. (Answer 'none',
7283 without the quotes, to install no extra modules or bundles.)
7293 $rm -f ../extras.lst
7295 *) echo "(Saving the list of extras for later...)"
7296 echo "$extras" > ../extras.lst
7304 : determine where html pages for programs go
7305 set html1dir html1dir none
7309 If you wish to install html files for programs in $spackage, indicate
7310 the appropriate directory here. To skip installing html files,
7314 ''|none|$undef|' ') dflt=none ;;
7315 *) dflt=$html1dir ;;
7318 rp="Directory for the main $spackage html pages?"
7322 : Use ' ' for none so value is preserved next time through Configure
7323 $test X"$html1dir" = "X" && html1dir=' '
7325 : determine where html pages for libraries and modules go
7326 set html3dir html3dir none
7330 If you wish to install html files for modules associated with $spackage,
7331 indicate the appropriate directory here. To skip installing html files,
7334 : There is no obvious default. If they have specified html1dir, then
7335 : try to key off that, possibly changing .../html1 into .../html3.
7337 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7338 *) dflt=$html3dir ;;
7341 rp="Directory for the $spackage module html pages?"
7345 : Use ' ' for none so value is preserved next time through Configure
7346 $test X"$html3dir" = "X" && html3dir=' '
7348 : determine whether to install perl also as /usr/bin/perl
7351 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7353 Many scripts expect perl to be installed as /usr/bin/perl.
7355 If you want to, I can install the perl you are about to compile
7356 as /usr/bin/perl (in addition to $bin/perl).
7358 if test -f /usr/bin/perl; then
7361 However, please note that because you already have a /usr/bin/perl,
7362 overwriting that with a new Perl would very probably cause problems.
7363 Therefore I'm assuming you don't want to do that (unless you insist).
7366 case "$installusrbinperl" in
7367 "$define"|[yY]*) dflt='y';;
7373 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7376 case "$installusrbinperl" in
7377 "$undef"|[nN]*) dflt='n';;
7381 rp="Do you want to install perl as /usr/bin/perl?"
7384 [yY]*) val="$define";;
7390 set installusrbinperl
7393 : Check if we are using the GNU C library
7395 echo "Checking for GNU C Library..." >&4
7397 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7398 alone are insufficient to distinguish different versions, such as
7399 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7400 libc version 2.1.0. A. Dougherty, June 3, 2002.
7406 # ifdef __GLIBC_MINOR__
7407 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7408 # include <gnu/libc-version.h>
7409 printf("%s\n", gnu_get_libc_version());
7411 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7414 printf("%d\n", __GLIBC__);
7423 if eval $compile_ok && $run ./try > glibc.ver; then
7425 gnulibc_version=`$cat glibc.ver`
7426 echo "You are using the GNU C Library version $gnulibc_version"
7430 echo "You are not using the GNU C Library"
7436 : see if nm is to be used to determine whether a symbol is defined or not
7440 case "$d_gnulibc" in
7443 echo "nm probably won't work on the GNU C Library." >&4
7449 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7451 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7452 echo "'nm' won't be sufficient on this system." >&4
7458 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7459 if $test $dflt -gt 20; then
7469 true|$define) dflt=y;;
7476 I can use $nm to extract the symbols from your C libraries. This
7477 is a time consuming task which may generate huge output on the disk (up
7478 to 3 megabytes) but that should make the symbols extraction faster. The
7479 alternative is to skip the 'nm' extraction part and to compile a small
7480 test program instead to determine whether each symbol is present. If
7481 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7482 this may be the best solution.
7484 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7487 rp="Shall I use $nm to extract C symbols from the libraries?"
7490 [Nn]*) usenm=false;;
7499 : nm options which may be necessary
7501 '') if $test -f /mach_boot; then
7503 elif $test -d /usr/ccs/lib; then
7504 nm_opt='-p' # Solaris (and SunOS?)
7505 elif $test -f /dgux; then
7507 elif $test -f /lib64/rld; then
7508 nm_opt='-p' # 64-bit Irix
7514 : nm options which may be necessary for shared libraries but illegal
7515 : for archive libraries. Thank you, Linux.
7516 case "$nm_so_opt" in
7517 '') case "$myuname" in
7519 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7520 nm_so_opt='--dynamic'
7527 : Figure out where the libc is located
7530 : get list of predefined functions in a handy place
7535 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7541 *) for thislib in $libs; do
7544 : Handle C library specially below.
7547 thislib=`echo $thislib | $sed -e 's/^-l//'`
7548 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7550 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7552 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7554 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7556 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7558 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7560 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7565 libnames="$libnames $try"
7567 *) libnames="$libnames $thislib" ;;
7576 for xxx in $libpth; do
7577 $test -r $1 || set $xxx/libc.$so
7578 : The messy sed command sorts on library version numbers.
7580 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7581 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7583 s/[0-9][0-9]*/0000&/g
7584 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7587 $sort | $sed -e 's/^.* //'`
7590 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7591 $test -r $1 || set $sysroot/lib/libsys_s$_a
7597 if $test -r "$1"; then
7598 echo "Your (shared) C library seems to be in $1."
7600 elif $test -r /lib/libc && $test -r /lib/clib; then
7601 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7603 libc='/lib/clib /lib/libc'
7604 if $test -r /lib/syslib; then
7605 echo "(Your math library is in /lib/syslib.)"
7606 libc="$libc /lib/syslib"
7608 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7609 echo "Your C library seems to be in $libc, as you said before."
7610 elif $test -r $incpath/usr/lib/libc$_a; then
7611 libc=$incpath/usr/lib/libc$_a;
7612 echo "Your C library seems to be in $libc. That's fine."
7613 elif $test -r /lib/libc$_a; then
7615 echo "Your C library seems to be in $libc. You're normal."
7617 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7619 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7620 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7621 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7623 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7625 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7628 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7630 if $test -r "$tans"; then
7631 echo "Your C library seems to be in $tans, of all places."
7637 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7641 If the guess above is wrong (which it might be if you're using a strange
7642 compiler, or your machine supports multiple models), you can override it here.
7647 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7649 I can't seem to find your C library. I've looked in the following places:
7652 $sed 's/^/ /' libpath
7655 None of these seems to contain your C library. I need to get its name...
7660 rp='Where is your C library?'
7665 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7666 set X `cat libnames`
7669 case $# in 1) xxx=file; esac
7670 echo "Extracting names from the following $xxx for later perusal:" >&4
7672 $sed 's/^/ /' libnames >&4
7674 $echo $n "This may take a while...$c" >&4
7678 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7679 *) $nm $nm_opt $file 2>/dev/null;;
7684 $grep fprintf libc.tmp > libc.ptf
7685 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7686 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7688 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7692 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7696 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7700 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7704 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7708 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7712 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7713 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7715 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7717 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7719 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7721 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7723 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7725 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7727 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7729 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7731 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7733 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7735 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7737 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7739 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7741 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7743 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7746 $nm -p $* 2>/dev/null >libc.tmp
7747 $grep fprintf libc.tmp > libc.ptf
7748 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7749 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7755 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7757 if $ar t $libc > libc.tmp && \
7758 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7760 for thisname in $libnames $libc; do
7761 $ar t $thisname >>libc.tmp
7763 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7765 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7766 for thisname in $libnames $libc; do
7767 $ar tv $thisname >>libc.tmp
7768 emximp -o tmp.imp $thisname \
7770 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7771 < tmp.imp >>libc.tmp
7774 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7777 echo "$ar didn't seem to work right." >&4
7778 echo "Maybe this is a Cray...trying bld instead..." >&4
7780 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7783 for thisname in $libnames; do
7785 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7786 $ar t $thisname >>libc.tmp
7790 echo "That didn't work either. Giving up." >&4
7800 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7801 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7803 *) if $test -f /lib/syscalls.exp; then
7805 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7806 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7807 /lib/syscalls.exp >>libc.list
7813 $rm -f libnames libpath
7815 : Check if we are using C++
7817 echo "Checking for C++..." >&4
7818 $cat >try.c <<'EOCP'
7830 if eval $compile_ok && $run ./try; then
7832 echo "You are using a C++ compiler."
7835 echo "You are not using a C++ compiler."
7841 : is a C symbol defined?
7844 -v) tf=libc.tmp; tdc="";;
7845 -a) tf=libc.tmp; tdc="[]";;
7846 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7848 case "$d_cplusplus" in
7849 $define) extern_C="extern \"C\"" ;;
7850 *) extern_C="extern" ;;
7853 case "$reuseval-$4" in
7855 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7860 if $test "$runnm" = true; then
7861 if $contains $tlook $tf >/dev/null 2>&1; then
7863 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7864 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7865 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7866 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7870 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7871 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7877 $define) tval=true;;
7884 : define an is-in-libc? function
7885 inlibc='echo " "; td=$define; tu=$undef;
7886 sym=$1; var=$2; eval "was=\$$2";
7888 case "$reuseval$was" in
7898 echo "$sym() found." >&4;
7899 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7901 echo "$sym() NOT found." >&4;
7902 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7906 $define) echo "$sym() found." >&4;;
7907 *) echo "$sym() NOT found." >&4;;
7911 : see if dlopen exists
7913 xxx_ccflags="$ccflags"
7915 : with g++ one needs -shared to get is-in-libc to work for dlopen
7916 case "$gccversion" in
7918 *) case "$d_cplusplus" in
7919 "$define") ccflags="$ccflags -shared" ;;
7926 ccflags="$xxx_ccflags"
7928 : see if this is a unistd.h system
7929 set unistd.h i_unistd
7932 : determine which dynamic loading, if any, to compile in
7934 dldir="ext/DynaLoader"
7947 $define) dflt='y' ;;
7949 : Does a dl_xxx.xs file exist for this operating system
7950 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7953 rp="Do you wish to use dynamic loading?"
7961 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7962 dflt="$dldir/dl_${osname}.xs"
7963 elif $test "$d_dlopen" = "$define" ; then
7964 dflt="$dldir/dl_dlopen.xs"
7969 *) dflt="$dldir/$dlsrc"
7972 echo "The following dynamic loading files are available:"
7973 : Can not go over to $dldir because getfile has path hard-coded in.
7974 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7975 rp="Source file to use for dynamic loading"
7981 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7985 Some systems may require passing special flags to $cc -c to
7986 compile modules that will be used to create a shared library.
7987 To use no flags, say "none".
7990 case "$cccdlflags" in
7991 '') case "$gccversion" in
7992 '') case "$osname" in
7994 next) dflt='none' ;;
7995 irix*) dflt='-KPIC' ;;
7996 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7997 sunos) dflt='-pic' ;;
8001 *) case "$osname" in
8002 darwin) dflt='none' ;;
8003 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8008 *) dflt="$cccdlflags" ;;
8015 # If -Dsysroot was specified, now's the time to add it
8017 if test "X$sysroot" != X; then
8018 case "$gccversion" in
8023 dflt="$dflt --sysroot=$sysroot" ;;
8033 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8036 none) cccdlflags=' ' ;;
8037 *) cccdlflags="$ans" ;;
8042 Some systems use ld to create libraries that can be dynamically loaded,
8043 while other systems (such as those using ELF) use $cc.
8047 : Determine if this is ELF
8049 /* Test for whether ELF binaries are produced */
8061 int i = open("a.out",O_RDONLY);
8064 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8065 exit(0); /* succeed (yes, it is ELF) */
8070 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8076 '') if $test $bin_ELF = "$define"; then
8078 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8082 echo "I'll use ld to build dynamic libraries."
8090 rp="What command should be used to create dynamic libraries?"
8096 Some systems may require passing special flags to $ld to create a
8097 library that can be dynamically loaded. If your ld flags include
8098 -L/other/path options to locate libraries outside your loader's normal
8099 search path, you may need to specify those -L options here as well. To
8100 use no flags, say "none".
8103 case "$lddlflags" in
8104 '') case "$osname" in
8105 haiku) dflt='-shared' ;;
8107 case "$gccversion" in
8108 '') dflt="$dflt +vnocompatwarnings" ;;
8111 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8112 next) dflt='none' ;;
8113 solaris) # See [perl #66604].
8114 # On Solaris 11, gcc -m64 on amd64
8115 # appears not to understand -G. gcc versions at
8116 # least as old as 3.4.3 support -shared, so just
8117 # use that with Solaris 11 and later, but keep
8118 # the old behavior for older Solaris versions.
8119 case "$gccversion" in
8121 *) case "$osvers" in
8122 2.?|2.10) dflt='-G' ;;
8123 *) dflt='-shared' ;;
8128 sunos) dflt='-assert nodefinitions' ;;
8129 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8133 *) dflt="$lddlflags" ;;
8136 : Only do this for gcc, since, for example, qcc has no concept
8138 if $test "X$sysroot" != X; then
8139 case "$gccversion" in
8142 dflt="$dflt --sysroot $sysroot"
8147 : Try to guess additional flags to pick up local libraries.
8148 : Be careful not to append to a plain 'none'
8152 for thisflag in $ldflags; do
8157 *) dflt="$dflt $thisflag" ;;
8164 ''|' ') dflt='none' ;;
8168 *-fstack-protector*)
8170 *-fstack-protector*) ;; # Don't add it again
8171 *) dflt="$dflt -fstack-protector" ;;
8177 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8180 none) lddlflags=' ' ;;
8181 *) lddlflags="$ans" ;;
8186 Some systems may require passing special flags to $cc to indicate that
8187 the resulting executable will use dynamic linking. To use no flags,
8191 case "$ccdlflags" in
8192 '') case "$osname" in
8193 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8194 next|sunos) dflt='none' ;;
8198 *) dflt="$ccdlflags" ;;
8200 rp="Any special flags to pass to $cc to use dynamic linking?"
8203 none) ccdlflags=' ' ;;
8204 *) ccdlflags="$ans" ;;
8215 ld_can_script="$undef"
8216 case "$bin_ELF$usedl" in
8218 # Abuse try.h and a.out names for neat cleanup
8230 if $cc $cccdlflags $ccdlflags $ccflags \
8231 $ldflags $lddlflags -o a.out try.c \
8232 -Wl,--version-script=try.h >/dev/null 2>&1 \
8233 && $test -s a.out ; then
8234 echo "ld supports scripting" >&4
8235 ld_can_script="$define"
8237 echo "ld does not support scripting" >&4
8243 : Do we want a shared libperl?
8247 # No dynamic loading being used, so don't bother even to prompt.
8250 *) case "$useshrplib" in
8251 '') case "$osname" in
8252 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8254 also='Building a shared libperl is required for dynamic loading to work on your system.'
8259 also='Building a shared libperl is needed for MAB support.'
8277 The perl executable is normally obtained by linking perlmain.c with
8278 libperl${_a}, any static extensions (usually just DynaLoader), and
8279 any other libraries needed on this system (such as -lm, etc.). Since
8280 your system supports dynamic loading, it is probably possible to build
8281 a shared libperl.$so. If you will have more than one executable linked
8282 to libperl.$so, this will significantly reduce the size of each
8283 executable, but it may have a noticeable effect on performance. The
8284 default is probably sensible for your system.
8288 rp="Build a shared libperl.$so (y/n)"
8292 useshrplib='true' ;;
8293 *) useshrplib='false' ;;
8298 case "$useshrplib" in
8300 case "$userelocatableinc" in
8302 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8303 echo "See INSTALL for an explanation why that won't work." >&4
8309 # Figure out a good name for libperl.so. Since it gets stored in
8310 # a version-specific architecture-dependent library, the version
8311 # number isn't really that important, except for making cc/ld happy.
8313 # A name such as libperl.so.10.1
8314 majmin="libperl.$so.$patchlevel.$subversion"
8315 # A name such as libperl.so.100
8316 majonly=`echo $patchlevel $subversion |
8317 $awk '{printf "%d%02d", $1, $2}'`
8318 majonly=libperl.$so.$majonly
8319 # I'd prefer to keep the os-specific stuff here to a minimum, and
8320 # rely on figuring it out from the naming of libc.
8321 case "${osname}${osvers}" in
8324 # XXX How handle the --version stuff for MAB?
8326 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8329 cygwin*) # ld links now against the dll directly
8330 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8331 majonly=`echo $patchlevel $subversion |
8332 $awk '{printf "%03d%03d", $1, $2}'`
8333 majonly=cygperl5.$majonly.$so
8336 *) # Try to guess based on whether libc has major.minor.
8338 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8339 *libc.$so.[0-9]*) dflt=$majonly ;;
8340 *) dflt=libperl.$so ;;
8350 I need to select a good name for the shared libperl. If your system uses
8351 library names with major and minor numbers, then you might want something
8352 like $majmin. Alternatively, if your system uses a single version
8353 number for shared libraries, then you might want to use $majonly.
8354 Or, your system might be quite happy with a simple libperl.$so.
8356 Since the shared libperl will get installed into a version-specific
8357 architecture-dependent directory, the version number of the shared perl
8358 library probably isn't important, so the default should be o.k.
8361 rp='What name do you want to give to the shared libperl?'
8364 echo "Ok, I'll use $libperl"
8367 libperl="libperl${_a}"
8371 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8375 WARNING: Use of the shrpdir variable for the installation location of
8376 the shared $libperl is not supported. It was never documented and
8377 will not work in this version. Let me (perlbug@perl.org)
8378 know of any problems this may cause.
8384 But your current setting of $shrpdir is
8385 the default anyway, so it's harmless.
8390 Further, your current attempted setting of $shrpdir
8391 conflicts with the value of $archlibexp/CORE
8392 that installperl will use.
8399 # How will the perl executable find the installed shared $libperl?
8400 # Add $xxx to ccdlflags.
8401 # If we can't figure out a command-line option, use $shrpenv to
8402 # set env LD_RUN_PATH. The main perl makefile uses this.
8403 shrpdir=$archlibexp/CORE
8406 if "$useshrplib"; then
8409 # We'll set it in Makefile.SH...
8414 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8415 xxx="-Wl,-R$shrpdir"
8417 bsdos|linux|irix*|dec_osf|gnu*)
8418 xxx="-Wl,-rpath,$shrpdir"
8421 # next doesn't like the default...
8424 # Haiku doesn't like the default, either.
8427 # hpux doesn't like the default, either.
8428 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8431 # cygwin needs only ldlibpth
8434 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8440 # Only add $xxx if it isn't already in ccdlflags.
8441 case " $ccdlflags " in
8443 *) ccdlflags="$ccdlflags $xxx"
8446 Adding $xxx to the flags
8447 passed to $ld so that the perl executable will find the
8448 installed shared $libperl.
8456 # Fix ccdlflags in AIX for building external extensions.
8457 # (For building Perl itself bare -bE:perl.exp is needed,
8458 # Makefile.SH takes care of this.)
8460 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8462 # Respect a hint or command-line value.
8464 '') shrpenv="$tmp_shrpenv" ;;
8466 case "$ldlibpthname" in
8467 '') ldlibpthname=LD_LIBRARY_PATH ;;
8468 none) ldlibpthname='' ;;
8471 : determine where manual pages are on this system
8475 syspath='/usr/share/man/man1 /usr/man/man1'
8476 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8477 syspath="$syspath /usr/man/u_man/man1"
8478 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8479 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8480 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8481 sysman=`./loc . /usr/man/man1 $syspath`
8484 if $test -d "$sysman"; then
8485 echo "System manual is in $sysman." >&4
8487 echo "Could not find manual pages in source form." >&4
8490 : determine where manual pages go
8491 set man1dir man1dir none
8495 $spackage has manual pages available in source form.
8499 echo "However, you don't have nroff, so they're probably useless to you."
8501 '') man1dir="none";;
8504 echo "If you don't want the manual sources installed, answer 'none'."
8509 lookpath="$prefixexp/share/man/man1"
8510 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8511 lookpath="$lookpath $prefixexp/man/p_man/man1"
8512 lookpath="$lookpath $prefixexp/man/u_man/man1"
8513 lookpath="$lookpath $prefixexp/man/man.1"
8515 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8516 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8526 rp="Where do the main $spackage manual pages (source) go?"
8528 if $test "X$man1direxp" != "X$ansexp"; then
8539 : What suffix to use on installed man pages
8546 rp="What suffix should be used for the main $spackage man pages?"
8548 '') case "$man1dir" in
8562 *) dflt="$man1ext";;
8569 : see if we can have long filenames
8571 first=123456789abcdef
8573 if (echo hi >$first) 2>/dev/null; then
8574 if $test -f 123456789abcde; then
8575 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8578 echo 'You can have filenames longer than 14 characters.'>&4
8583 You can't have filenames longer than 14 chars.
8584 You can't even think about them!
8590 $rm -rf 123456789abcde*
8592 : determine where library module manual pages go
8593 set man3dir man3dir none
8597 $spackage has manual pages for many of the library modules.
8603 However, you don't have nroff, so they're probably useless to you.
8606 '') man3dir="none";;
8610 case "$d_flexfnam" in
8613 However, your system can't handle the long file names like File::Basename.3.
8616 '') man3dir="none";;
8620 echo "If you don't want the manual sources installed, answer 'none'."
8621 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8623 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8624 if $test -d "$privlib/man/man3"; then
8627 WARNING: Previous versions of perl installed man3 pages into
8628 $privlib/man/man3. This version will suggest a
8629 new default of $dflt.
8633 rp='Do you wish to preserve the old behavior?(y/n)'
8636 y*) dflt="$privlib/man/man3" ;;
8641 *) dflt="$man3dir" ;;
8648 rp="Where do the $package library man pages (source) go?"
8658 : What suffix to use on installed man pages
8664 rp="What suffix should be used for the $package library man pages?"
8666 '') case "$man3dir" in
8680 *) dflt="$man3ext";;
8687 : see if we have to deal with yellow pages, now NIS.
8688 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8689 if $test -f /usr/etc/nibindd; then
8691 echo "I'm fairly confident you're on a NeXT."
8693 rp='Do you get the hosts file via NetInfo?'
8702 y*) hostcat='nidump hosts .';;
8703 *) case "$hostcat" in
8704 nidump*) hostcat='';;
8714 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8722 rp='Are you getting the hosts file via yellow pages?'
8725 y*) hostcat='ypcat hosts';;
8726 *) hostcat='cat /etc/hosts';;
8732 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8735 '') test -f /etc/group && groupcat='cat /etc/group';;
8738 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8741 : now get the host name
8743 echo "Figuring out host name..." >&4
8744 case "$myhostname" in
8746 echo 'Maybe "hostname" will work...'
8747 if tans=`sh -c hostname 2>&1` ; then
8755 if $test "$cont"; then
8757 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8758 if tans=`cat /etc/systemid 2>&1` ; then
8760 phostname='cat /etc/systemid'
8761 echo "Whadyaknow. Xenix always was a bit strange..."
8764 elif $test -r /etc/systemid; then
8765 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8768 if $test "$cont"; then
8769 echo 'No, maybe "uuname -l" will work...'
8770 if tans=`sh -c 'uuname -l' 2>&1` ; then
8772 phostname='uuname -l'
8774 echo 'Strange. Maybe "uname -n" will work...'
8775 if tans=`sh -c 'uname -n' 2>&1` ; then
8777 phostname='uname -n'
8779 echo 'Oh well, maybe I can mine it out of whoami.h...'
8780 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8781 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8782 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8784 case "$myhostname" in
8785 '') echo "Does this machine have an identity crisis or something?"
8788 echo "Well, you said $myhostname before..."
8789 phostname='echo $myhostname';;
8795 case "$myhostname" in
8796 '') myhostname=noname ;;
8798 : you do not want to know about this
8803 if $test "$myhostname" ; then
8805 rp='Your host name appears to be "'$myhostname'".'" Right?"
8813 : bad guess or no guess
8814 while $test "X$myhostname" = X ; do
8816 rp="Please type the (one word) name of your host:"
8821 : translate upper to lower if necessary
8822 case "$myhostname" in
8824 echo "(Normalizing case in your host name)"
8825 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8829 case "$myhostname" in
8831 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8832 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8833 echo "(Trimming domain name from host name--host name is now $myhostname)"
8835 *) case "$mydomain" in
8838 test "X$hostcat" = "Xypcat hosts" &&
8839 ypmatch "$myhostname" hosts 2>/dev/null |\
8840 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8843 test "X$hostcat" != "X" &&
8844 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8845 /[ ]$myhostname[ . ]/p" > hosts
8848 if $test -f hosts; then
8849 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8850 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8851 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8852 hosts | $sort | $uniq | \
8853 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8854 case `$echo X$dflt` in
8855 X*\ *) echo "(Several hosts in the database matched hostname)"
8858 X.) echo "(You do not have fully-qualified names in the hosts database)"
8862 echo "(I cannot locate a hosts database anywhere)"
8867 tans=`./loc resolv.conf X /etc /usr/etc`
8868 if $test -f "$tans"; then
8869 echo "(Attempting domain name extraction from $tans)"
8870 dflt=.`$sed -n -e 's/ / /g' \
8871 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8874 .) dflt=.`$sed -n -e 's/ / /g' \
8875 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8883 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8884 dflt=.`sh -c domainname 2>/dev/null`
8887 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8891 case "$dflt$osname" in
8892 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8893 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8897 .) echo "(Lost all hope -- silly guess then)"
8903 *) dflt="$mydomain";;
8907 rp="What is your domain name?"
8917 : translate upper to lower if necessary
8920 echo "(Normalizing case in your domain name)"
8921 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8925 : a little sanity check here
8926 case "$phostname" in
8929 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8930 $myhostname$mydomain|$myhostname) ;;
8932 case "$phostname" in
8934 echo "(That doesn't agree with your whoami.h file, by the way.)"
8937 echo "(That doesn't agree with your $phostname command, by the way.)"
8945 : determine the e-mail address of the user who is running us
8948 I need to get your e-mail address in Internet format if possible, i.e.
8949 something like user@host.domain. Please answer accurately since I have
8950 no easy means to double check it. The default value provided below
8951 is most probably close to reality but may not be valid from outside
8952 your organization...
8956 while test "$cont"; do
8957 case "$MAILDOMAIN" in
8959 if $test -s /etc/mailname; then
8960 maildomain=`$cat /etc/mailname`
8962 maildomain="$myhostname$mydomain"
8965 *) maildomain="$MAILDOMAIN";;
8968 '') dflt="$cf_by@$maildomain";;
8969 *) dflt="$cf_email";;
8971 rp='What is your e-mail address?'
8977 rp='Address does not look like an Internet one. Use it anyway?'
8991 : Ask e-mail of administrator
8994 If you or somebody else will be maintaining perl at your site, please
8995 fill in the correct e-mail address here so that they may be contacted
8996 if necessary. Currently, the "perlbug" program included with perl
8997 will send mail to this address in addition to perlbug@perl.org. You may
8998 enter "none" for no administrator.
9001 case "$perladmin" in
9002 '') dflt="$cf_email";;
9003 *) dflt="$perladmin";;
9005 rp='Perl administrator e-mail address'
9009 : determine whether to only install version-specific parts.
9012 Do you want to install only the version-specific parts of the perl
9013 distribution? Usually you do *not* want to do this.
9015 case "$versiononly" in
9016 "$define"|[Yy]*|true) dflt='y' ;;
9019 rp="Do you want to install only the version-specific parts of perl?"
9022 [yY]*) val="$define";;
9028 case "$versiononly" in
9029 "$define") inc_version_list=''
9030 inc_version_list_init=0
9034 : figure out how to guarantee perl startup
9035 : XXX Note that this currently takes advantage of the bug that binexp ignores
9036 : the Configure -Dinstallprefix setting, which in turn means that under
9037 : relocatable @INC, initialinstalllocation is what binexp started as.
9038 case "$startperl" in
9040 case "$sharpbang" in
9044 I can use the #! construct to start perl on your system. This will
9045 make startup of perl scripts faster, but may cause problems if you
9046 want to share those scripts and perl is not in a standard place
9047 ($initialinstalllocation/perl) on all your platforms. The alternative
9048 is to force a shell by starting the script with a single ':' character.
9051 case "$versiononly" in
9052 "$define") dflt="$initialinstalllocation/perl$version";;
9053 *) dflt="$initialinstalllocation/perl";;
9055 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9058 none) startperl=": # use perl";;
9059 *) startperl="#!$ans"
9060 if $test 30 -lt `echo "$ans" | wc -c`; then
9063 WARNING: Some systems limit the #! command to 32 characters.
9064 If you experience difficulty running Perl scripts with #!, try
9065 installing Perl in a directory with a shorter pathname.
9071 *) startperl=": # use perl"
9076 echo "I'll use $startperl to start perl scripts."
9078 : figure best path for perl in scripts
9081 case "$versiononly" in
9082 "$define") perlpath="$initialinstalllocation/perl$version";;
9083 *) perlpath="$initialinstalllocation/perl";;
9085 case "$startperl" in
9090 I will use the "eval 'exec'" idiom to start Perl on your system.
9091 I can use the full path of your Perl binary for this purpose, but
9092 doing so may cause problems if you want to share those scripts and
9093 Perl is not always in a standard place ($initialinstalllocation/perl).
9096 dflt="$initialinstalllocation/perl"
9097 rp="What path shall I use in \"eval 'exec'\"?"
9104 case "$startperl" in
9106 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9109 : determine where public executable scripts go
9110 set scriptdir scriptdir
9112 case "$scriptdir" in
9115 : guess some guesses
9116 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9117 $test -d /usr/share/bin && dflt=/usr/share/bin
9118 $test -d /usr/local/script && dflt=/usr/local/script
9119 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9120 $test -d $prefixexp/script && dflt=$prefixexp/script
9124 *) dflt="$scriptdir"
9129 Some installations have a separate directory just for executable scripts so
9130 that they can mount it across multiple architectures but keep the scripts in
9131 one spot. You might, for example, have a subdirectory of /usr/share for this.
9132 Or you might just lump your scripts in with all your other executables.
9136 rp='Where do you keep publicly executable scripts?'
9138 if $test "X$ansexp" != "X$scriptdirexp"; then
9144 : A little fix up for an irregularly named variable.
9145 installscript="$installscriptdir"
9147 : determine where add-on public executables go
9149 '') dflt=$siteprefix/bin ;;
9153 rp='Pathname where the add-on public executables should be installed?'
9158 : determine where add-on html pages go
9159 : There is no standard location, so try to copy the previously-selected
9160 : directory structure for the core html pages.
9161 case "$sitehtml1dir" in
9162 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9163 *) dflt=$sitehtml1dir ;;
9166 ''|' ') dflt=none ;;
9169 rp='Pathname where the site-specific html pages should be installed?'
9171 prefixvar=sitehtml1dir
9174 : determine where add-on library html pages go
9175 : There is no standard location, so try to copy the previously-selected
9176 : directory structure for the core html pages.
9177 case "$sitehtml3dir" in
9178 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9179 *) dflt=$sitehtml3dir ;;
9182 ''|' ') dflt=none ;;
9185 rp='Pathname where the site-specific library html pages should be installed?'
9187 prefixvar=sitehtml3dir
9190 : determine where add-on manual pages go
9191 case "$siteman1dir" in
9192 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9193 *) dflt=$siteman1dir ;;
9196 ''|' ') dflt=none ;;
9199 rp='Pathname where the site-specific manual pages should be installed?'
9201 prefixvar=siteman1dir
9204 : determine where add-on library man pages go
9205 case "$siteman3dir" in
9206 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9207 *) dflt=$siteman3dir ;;
9210 ''|' ') dflt=none ;;
9213 rp='Pathname where the site-specific library manual pages should be installed?'
9215 prefixvar=siteman3dir
9218 : determine where add-on public executable scripts go
9219 case "$sitescript" in
9220 '') dflt=$siteprefix/script
9221 $test -d $dflt || dflt=$sitebin ;;
9222 *) dflt="$sitescript" ;;
9225 rp='Pathname where add-on public executable scripts should be installed?'
9227 prefixvar=sitescript
9230 : Check if faststdio is requested and available
9231 case "$usefaststdio" in
9232 $define|true|[yY]*|'')
9233 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9243 Perl can be built to use 'fast stdio', which means using the stdio
9244 library but also directly manipulating the stdio buffers to enable
9245 faster I/O. Using stdio is better for backward compatibility (especially
9246 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9247 interface has been preferred instead of stdio.
9249 If this doesn't make any sense to you, just accept the default '$dflt'.
9251 rp='Use the "fast stdio" if available?'
9254 y|Y) val="$define" ;;
9261 : define an is-a-typedef? function
9262 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9264 "") inclist="sys/types.h";;
9266 eval "varval=\$$var";
9270 for inc in $inclist; do
9271 echo "#include <$inc>" >>temp.c;
9273 echo "#ifdef $type" >> temp.c;
9274 echo "printf(\"We have $type\");" >> temp.c;
9275 echo "#endif" >> temp.c;
9276 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9277 if $contains $type temp.E >/dev/null 2>&1; then
9283 *) eval "$var=\$varval";;
9286 : define an is-a-typedef? function that prompts if the type is not available.
9287 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9289 "") inclist="sys/types.h";;
9291 eval "varval=\$$var";
9295 for inc in $inclist; do
9296 echo "#include <$inc>" >>temp.c;
9298 echo "#ifdef $type" >> temp.c;
9299 echo "printf(\"We have $type\");" >> temp.c;
9300 echo "#endif" >> temp.c;
9301 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9303 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9304 if $contains $type temp.E >/dev/null 2>&1; then
9305 echo "$type found." >&4;
9308 echo "$type NOT found." >&4;
9314 *) eval "$var=\$varval";;
9317 : see what type lseek is declared as in the kernel
9318 rp="What is the type used for lseek's offset on this system?"
9319 set off_t lseektype long stdio.h sys/types.h
9323 echo "Checking to see how big your file offsets are..." >&4
9325 #include <sys/types.h>
9329 printf("%d\n", (int)sizeof($lseektype));
9334 if eval $compile_ok; then
9335 lseeksize=`$run ./try`
9336 echo "Your file offsets are $lseeksize bytes long."
9340 echo "(I can't seem to compile the test program. Guessing...)"
9341 rp="What is the size of your file offsets (in bytes)?"
9347 : see what type file positions are declared as in the library
9348 rp="What is the type for file position used by fsetpos()?"
9349 set fpos_t fpostype long stdio.h sys/types.h
9352 : Check size for Fpos_t
9355 *_t) zzz="$fpostype" ;;
9358 echo "Checking the size of $zzz..." >&4
9360 #include <sys/types.h>
9367 printf("%d\n", (int)sizeof($fpostype));
9372 if eval $compile_ok; then
9376 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9379 echo "Your $zzz is $fpossize bytes long."
9385 echo "(I can't compile the test program. Guessing...)" >&4
9386 rp="What is the size of your file positions (in bytes)?"
9391 : Check for large file support
9392 # Backward compatibility (uselfs is deprecated).
9394 "$define"|true|[yY]*)
9397 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9399 uselargefiles="$define"
9403 case "$lseeksize:$fpossize" in
9406 You can have files larger than 2 gigabytes.
9409 *) case "$uselargefiles" in
9410 "$undef"|false|[nN]*) dflt='n' ;;
9415 Perl can be built to understand large files (files larger than 2 gigabytes)
9416 on some systems. To do so, Configure can be run with -Duselargefiles.
9418 If this doesn't make any sense to you, just accept the default '$dflt'.
9420 rp='Try to understand large files, if available?'
9423 y|Y) val="$define" ;;
9430 : Look for a hint-file generated 'call-back-unit'. If the
9431 : user has specified that a large files perl is to be built,
9432 : we may need to set or change some other defaults.
9433 if $test -f uselargefiles.cbu; then
9434 echo "Your platform has some specific hints regarding large file builds, using them..."
9435 . ./uselargefiles.cbu
9437 case "$uselargefiles" in
9439 if $test -f uselargefiles.cbu; then
9441 echo "Rechecking to see how big your file offsets are..." >&4
9443 #include <sys/types.h>
9447 printf("%d\n", (int)sizeof($lseektype));
9452 if eval $compile_ok; then
9453 lseeksize=`$run ./try`
9454 $echo "Your file offsets are now $lseeksize bytes long."
9458 echo "(I can't seem to compile the test program. Guessing...)"
9459 rp="What is the size of your file offsets (in bytes)?"
9464 *_t) zzz="$fpostype" ;;
9467 $echo $n "Rechecking the size of $zzz...$c" >&4
9469 #include <sys/types.h>
9476 printf("%d\n", (int)sizeof($fpostype));
9481 if eval $compile_ok; then
9486 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9489 echo " $fpossize bytes." >&4
9495 echo "(I can't compile the test program. Guessing...)" >&4
9496 rp="What is the size of your file positions (in bytes)?"
9505 : Check if we want perlio
9508 : Set the vendorbin variables
9509 case "$vendorprefix" in
9510 '') d_vendorbin="$undef"
9514 *) d_vendorbin="$define"
9515 : determine where vendor-supplied executables go.
9516 case "$vendorbin" in
9517 '') dflt=$vendorprefix/bin ;;
9518 *) dflt="$vendorbin" ;;
9521 rp='Pathname for the vendor-supplied executables directory?'
9524 vendorbinexp="$ansexp"
9530 : Set the vendorhtml1dir variables
9531 case "$vendorprefix" in
9532 '') vendorhtml1dir=''
9533 vendorhtml1direxp=''
9535 *) : determine where vendor-supplied html pages go.
9536 : There is no standard location, so try to copy the previously-selected
9537 : directory structure for the core html pages.
9538 : XXX Better default suggestions would be welcome.
9539 case "$vendorhtml1dir" in
9540 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9541 *) dflt=$vendorhtml1dir ;;
9544 ''|' ') dflt=none ;;
9547 rp='Pathname for the vendor-supplied html pages?'
9549 vendorhtml1dir="$ans"
9550 vendorhtml1direxp="$ansexp"
9553 : Use ' ' for none so value is preserved next time through Configure
9554 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9555 prefixvar=vendorhtml1dir
9558 : Set the vendorhtml3dir variables
9559 case "$vendorprefix" in
9560 '') vendorhtml3dir=''
9561 vendorhtml3direxp=''
9563 *) : determine where vendor-supplied module html pages go.
9564 : There is no standard location, so try to copy the previously-selected
9565 : directory structure for the core html pages.
9566 : XXX Better default suggestions would be welcome.
9567 case "$vendorhtml3dir" in
9568 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9569 *) dflt=$vendorhtml3dir ;;
9572 ''|' ') dflt=none ;;
9575 rp='Pathname for the vendor-supplied html pages?'
9577 vendorhtml3dir="$ans"
9578 vendorhtml3direxp="$ansexp"
9581 : Use ' ' for none so value is preserved next time through Configure
9582 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9583 prefixvar=vendorhtml3dir
9586 : Set the vendorman1dir variables
9587 case "$vendorprefix" in
9588 '') vendorman1dir=''
9591 *) : determine where vendor-supplied manual pages go.
9592 case "$vendorman1dir" in
9593 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9594 *) dflt=$vendorman1dir ;;
9597 ''|' ') dflt=none ;;
9600 rp='Pathname for the vendor-supplied manual section 1 pages?'
9602 vendorman1dir="$ans"
9603 vendorman1direxp="$ansexp"
9606 : Use ' ' for none so value is preserved next time through Configure
9607 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9608 prefixvar=vendorman1dir
9611 : Set the vendorman3dir variables
9612 case "$vendorprefix" in
9613 '') vendorman3dir=''
9616 *) : determine where vendor-supplied module manual pages go.
9617 case "$vendorman3dir" in
9618 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9619 *) dflt=$vendorman3dir ;;
9622 ''|' ') dflt=none ;;
9625 rp='Pathname for the vendor-supplied manual section 3 pages?'
9627 vendorman3dir="$ans"
9628 vendorman3direxp="$ansexp"
9631 : Use ' ' for none so value is preserved next time through Configure
9632 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9633 prefixvar=vendorman3dir
9636 : Set the vendorscript variables
9637 case "$vendorprefix" in
9638 '') d_vendorscript="$undef"
9642 *) d_vendorscript="$define"
9643 : determine where vendor-supplied scripts go.
9644 case "$vendorscript" in
9645 '') dflt=$vendorprefix/script
9646 $test -d $dflt || dflt=$vendorbin ;;
9647 *) dflt="$vendorscript" ;;
9651 The installation process will create a directory for
9652 vendor-supplied scripts.
9656 rp='Pathname for the vendor-supplied scripts directory?'
9659 vendorscriptexp="$ansexp"
9662 prefixvar=vendorscript
9665 : script used to emit important warnings
9668 if test \$# -gt 0; then
9673 echo "*** WARNING:" >&4
9674 sed -e 's/^/*** /' <msg >&4
9676 cat msg >>config.msg
9677 echo " " >>config.msg
9683 : see which of string.h or strings.h is needed
9685 strings=`./findhdr string.h`
9686 if $test "$strings" && $test -r "$strings"; then
9687 echo "Using <string.h> instead of <strings.h>." >&4
9691 strings=`./findhdr strings.h`
9692 if $test "$strings" && $test -r "$strings"; then
9693 echo "Using <strings.h> instead of <string.h>." >&4
9695 ./warn "No string header found -- You'll surely have problems."
9701 "$undef") strings=`./findhdr strings.h`;;
9702 *) strings=`./findhdr string.h`;;
9705 : see if qgcvt exists
9709 : Check print/scan long double stuff
9712 if $test X"$d_longdbl" = X"$define"; then
9714 echo "Checking how to print long doubles..." >&4
9716 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9717 $cat >try.c <<'EOCP'
9718 #include <sys/types.h>
9722 printf("%.3f\n", d);
9726 if eval $compile; then
9730 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9731 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9732 echo "We will use %f."
9738 if $test X"$sPRIfldbl" = X; then
9739 $cat >try.c <<'EOCP'
9740 #include <sys/types.h>
9743 long double d = 123.456;
9744 printf("%.3Lf\n", d);
9748 if eval $compile; then
9752 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9753 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9754 echo "We will use %Lf."
9760 if $test X"$sPRIfldbl" = X; then
9761 $cat >try.c <<'EOCP'
9762 #include <sys/types.h>
9765 long double d = 123.456;
9766 printf("%.3llf\n", d);
9770 if eval $compile; then
9774 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9775 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9776 echo "We will use %llf."
9782 if $test X"$sPRIfldbl" = X; then
9783 $cat >try.c <<'EOCP'
9784 #include <sys/types.h>
9787 long double d = 123.456;
9788 printf("%.3lf\n", d);
9792 if eval $compile; then
9796 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9797 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9798 echo "We will use %lf."
9804 if $test X"$sPRIfldbl" = X; then
9805 echo "Cannot figure out how to print long doubles." >&4
9807 sSCNfldbl=$sPRIfldbl # expect consistency
9814 case "$sPRIfldbl" in
9815 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9816 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9817 d_SCNfldbl="$undef";
9819 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9820 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9821 d_SCNfldbl="$define";
9825 : Check how to convert floats to strings.
9827 if test "X$d_Gconvert" = X; then
9830 echo "Checking for an efficient way to convert floats to strings."
9832 case "$uselongdouble" in
9833 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9835 case "$d_longdbl" in
9836 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9838 case "$d_PRIgldbl" in
9839 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9843 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9844 char *myname = "gconvert";
9847 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9848 char *myname = "gcvt";
9851 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9852 char *myname = "qgcvt";
9853 #define DOUBLETYPE long double
9856 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9858 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9860 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9863 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9865 char *myname = "sprintf";
9869 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9870 #define DOUBLETYPE long double
9872 #define DOUBLETYPE double
9884 # include <string.h>
9886 # include <strings.h>
9889 int checkit(char *expect, char *got)
9891 if (strcmp(expect, got)) {
9892 printf("%s oddity: Expected %s, got %s\n",
9893 myname, expect, got);
9903 /* This must be 1st test on (which?) platform */
9904 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9905 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9906 checkit("0.1", buf);
9908 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9909 checkit("0.01", buf);
9911 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9912 checkit("0.001", buf);
9914 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9915 checkit("0.0001", buf);
9917 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9918 if (strlen(buf) > 5)
9919 checkit("9e-005", buf); /* for Microsoft ?? */
9921 checkit("9e-05", buf);
9923 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9926 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9927 checkit("1.1", buf);
9929 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9930 checkit("1.01", buf);
9932 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9933 checkit("1.001", buf);
9935 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9936 checkit("1.0001", buf);
9938 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9939 checkit("1.00001", buf);
9941 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9942 checkit("1.000001", buf);
9944 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9947 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9950 /* Some Linux gcvt's give 1.e+5 here. */
9951 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9952 checkit("100000", buf);
9954 /* Some Linux gcvt's give -1.e+5 here. */
9955 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9956 checkit("-100000", buf);
9958 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9959 checkit("123.456", buf);
9961 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9962 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9963 /* 34 should be enough to scare even long double
9964 * places into using the e notation. */
9965 if (strlen(buf) > 5)
9966 checkit("1e+034", buf); /* for Microsoft */
9968 checkit("1e+34", buf);
9970 /* For Perl, if you add additional tests here, also add them to
9971 * t/base/num.t for benefit of platforms not using Configure or
9972 * overriding d_Gconvert */
9977 : first add preferred functions to our list
9979 for xxx_convert in $gconvert_preference; do
9980 case $xxx_convert in
9981 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9982 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9985 : then add any others
9986 for xxx_convert in gconvert gcvt sprintf; do
9989 *) xxx_list="$xxx_list $xxx_convert" ;;
9993 case "$d_longdbl$uselongdouble" in
9995 : again, add preferred functions to our list first
9997 for xxx_convert in $gconvert_ld_preference; do
9998 case $xxx_convert in
9999 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10000 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10003 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10004 for xxx_convert in qgcvt sprintf $xxx_list; do
10005 case "$xxx_ld_list" in
10006 $xxx_convert*|*" $xxx_convert"*) ;;
10007 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10010 : if sprintf cannot do long doubles, move it to the end
10011 if test "$d_PRIgldbl" != "$define"; then
10012 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10014 : if no qgcvt, remove it
10015 if test "$d_qgcvt" != "$define"; then
10016 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10019 xxx_list="$xxx_ld_list"
10023 for xxx_convert in $xxx_list; do
10024 echo "Trying $xxx_convert..."
10025 $rm -f try try$_o core
10026 set try -DTRY_$xxx_convert
10027 if eval $compile; then
10028 echo "$xxx_convert() found." >&4
10029 if $run ./try; then
10030 echo "I'll use $xxx_convert to convert floats into a string." >&4
10033 echo "...But $xxx_convert didn't work as I expected."
10037 echo "$xxx_convert NOT found." >&4
10041 if test X$xxx_convert = X; then
10042 echo "*** WHOA THERE!!! ***" >&4
10043 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10044 xxx_convert=sprintf
10047 case "$xxx_convert" in
10048 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10049 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10050 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10051 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10052 "$define$define$define")
10053 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10054 "$define$define$undef")
10055 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10056 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10064 : see if _fwalk exists
10068 : Initialize h_fcntl
10071 : Initialize h_sysfile
10074 : access call always available on UNIX
10075 set access d_access
10078 : locate the flags for 'access()'
10079 case "$d_access" in
10082 $cat >access.c <<EOCP
10083 #include <sys/types.h>
10088 #include <sys/file.h>
10091 #include <unistd.h>
10093 #$i_stdlib I_STDLIB
10095 #include <stdlib.h>
10101 : check sys/file.h first, no particular reason here
10102 if $test `./findhdr sys/file.h` && \
10103 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10105 echo "<sys/file.h> defines the *_OK access constants." >&4
10106 elif $test `./findhdr fcntl.h` && \
10107 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10109 echo "<fcntl.h> defines the *_OK access constants." >&4
10110 elif $test `./findhdr unistd.h` && \
10111 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10112 echo "<unistd.h> defines the *_OK access constants." >&4
10114 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10120 : see if accessx exists
10121 set accessx d_accessx
10124 : see if aintl exists
10128 : see if alarm exists
10132 : see if 64bit time functions exists
10134 set ctime64 d_ctime64
10137 set localtime64 d_localtime64
10140 set gmtime64 d_gmtime64
10143 set mktime64 d_mktime64
10146 set difftime64 d_difftime64
10149 set asctime64 d_asctime64
10152 : see if POSIX threads are available
10153 set pthread.h i_pthread
10156 : define a function to check prototypes
10157 $cat > protochk <<EOSH
10160 optimize="$optimize"
10162 prototype="$prototype"
10165 usethreads=$usethreads
10166 i_pthread=$i_pthread
10167 pthread_h_first=$pthread_h_first
10170 $cat >> protochk <<'EOSH'
10175 while test $# -ge 2; do
10177 $define) echo "#include <$2>" >> try.c ;;
10178 literal) echo "$2" >> try.c ;;
10180 # Extra magic for the benefit of systems that need pthread.h
10181 # to be included early to correctly detect threadsafe functions.
10182 # Such functions must guarantee themselves, though, that the usethreads
10183 # and i_pthread have been defined, before calling protochk.
10184 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10185 echo "#include <pthread.h>" >> try.c
10190 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10191 cat >> try.c <<'EOCP'
10192 #ifdef CAN_PROTOTYPE
10193 #define _(args) args
10198 echo "$foo" >> try.c
10199 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10200 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10206 $eunicefix protochk
10208 : Define hasproto macro for Configure internal use
10209 hasproto='varname=$1; func=$2; shift; shift;
10210 while $test $# -ge 2; do
10212 $define) echo "#include <$2>";;
10216 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10217 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10218 echo "$func() prototype found.";
10221 echo "$func() prototype NOT found.";
10228 : see if sys/types.h has to be included
10229 set sys/types.h i_systypes
10232 : see if sys/select.h has to be included
10233 set sys/select.h i_sysselct
10236 : Define hasfield macro for Configure internal use
10237 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10238 while $test $# -ge 2; do
10240 $define) echo "#include <$2>";;
10244 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10246 if eval $compile; then
10255 : see if we should include time.h, sys/time.h, or both
10257 if test "X$timeincl" = X; then
10258 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10259 $echo $n "I'm now running the test program...$c"
10261 #include <sys/types.h>
10266 #ifdef SYSTIMEKERNEL
10269 #include <sys/time.h>
10272 #include <sys/select.h>
10274 #$i_stdlib I_STDLIB
10276 #include <stdlib.h>
10282 struct timeval bar;
10285 struct timezone tzp;
10287 if (foo.tm_sec == foo.tm_sec)
10290 if (bar.tv_sec == bar.tv_sec)
10297 for s_timezone in '-DS_TIMEZONE' ''; do
10299 for s_timeval in '-DS_TIMEVAL' ''; do
10300 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10301 for i_time in '' '-DI_TIME'; do
10302 for i_systime in '-DI_SYSTIME' ''; do
10305 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10306 if eval $compile; then
10307 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10311 $echo $n "Succeeded with $flags$c"
10323 *SYSTIMEKERNEL*) i_systimek="$define"
10324 timeincl=`./findhdr sys/time.h`
10325 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10326 *) i_systimek="$undef";;
10329 *I_TIME*) i_time="$define"
10330 timeincl=`./findhdr time.h`" $timeincl"
10331 echo "We'll include <time.h>." >&4;;
10332 *) i_time="$undef";;
10335 *I_SYSTIME*) i_systime="$define"
10336 timeincl=`./findhdr sys/time.h`" $timeincl"
10337 echo "We'll include <sys/time.h>." >&4;;
10338 *) i_systime="$undef";;
10342 : see if struct tm knows about tm_zone
10343 case "$i_systime$i_time" in
10346 echo "Checking to see if your struct tm has tm_zone field..." >&4
10347 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10355 case "$d_tm_tm_zone" in
10356 "$define") echo "Yes, it does." ;;
10357 *) echo "No, it doesn't." ;;
10359 : see if struct tm knows about tm_gmtoff
10360 case "$i_systime$i_time" in
10363 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10364 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10372 case "$d_tm_tm_gmtoff" in
10373 "$define") echo "Yes, it does." ;;
10374 *) echo "No, it doesn't." ;;
10377 : see if asctime_r exists
10378 set asctime_r d_asctime_r
10380 case "$d_asctime_r" in
10382 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10383 case "$d_asctime_r_proto:$usethreads" in
10384 ":define") d_asctime_r_proto=define
10385 set d_asctime_r_proto asctime_r $hdrs
10389 case "$d_asctime_r_proto" in
10391 case "$asctime_r_proto" in
10392 ''|0) try='char* asctime_r(const struct tm*, char*);'
10393 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10395 case "$asctime_r_proto" in
10396 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10397 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10399 case "$asctime_r_proto" in
10400 ''|0) try='int asctime_r(const struct tm*, char*);'
10401 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10403 case "$asctime_r_proto" in
10404 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10405 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10407 case "$asctime_r_proto" in
10408 ''|0) d_asctime_r=undef
10410 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10411 * ) case "$asctime_r_proto" in
10412 REENTRANT_PROTO*) ;;
10413 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10415 echo "Prototype: $try" ;;
10418 *) case "$usethreads" in
10419 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10426 *) asctime_r_proto=0
10430 : see if atolf exists
10434 : see if atoll exists
10438 : Look for GCC-style attribute format
10439 case "$d_attribute_format" in
10442 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10443 $cat >attrib.c <<'EOCP'
10445 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10447 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10448 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10449 echo "Your C compiler doesn't support __attribute__((format))."
10452 echo "Your C compiler supports __attribute__((format))."
10456 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10460 *) val="$d_attribute_format" ;;
10462 set d_attribute_format
10466 : Look for GCC-style attribute format with null format allowed
10467 case "$d_printf_format_null" in
10468 '') case "$d_attribute_format" in
10471 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10472 $cat >attrib.c <<EOCP
10474 #$i_stdlib I_STDLIB
10476 #include <stdlib.h>
10478 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10479 int null_printf (char* pat,...) { return (int)pat; }
10480 int main () { exit(null_printf(NULL)); }
10482 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10483 : run the executable in case it produces a run-time warning
10484 if $run ./attrib >>attrib.out 2>&1; then
10485 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10486 echo "Your C compiler doesn't allow __printf__ format to be null."
10489 echo "Your C compiler allows __printf__ format to be null."
10493 echo "Your C compiler executable failed with __printf__ format null."
10497 echo "Your C compiler fails with __printf__ format null."
10504 *) val="$d_printf_format_null" ;;
10506 set d_printf_format_null
10510 : Look for GCC-style attribute malloc
10511 case "$d_attribute_malloc" in
10514 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10515 $cat >attrib.c <<'EOCP'
10517 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10519 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10520 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10521 echo "Your C compiler doesn't support __attribute__((malloc))."
10524 echo "Your C compiler supports __attribute__((malloc))."
10528 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10532 *) val="$d_attribute_malloc" ;;
10534 set d_attribute_malloc
10538 : Look for GCC-style attribute nonnull
10539 case "$d_attribute_nonnull" in
10542 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10543 $cat >attrib.c <<'EOCP'
10545 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10547 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10548 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10549 echo "Your C compiler doesn't support __attribute__((nonnull))."
10552 echo "Your C compiler supports __attribute__((nonnull))."
10556 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10560 *) val="$d_attribute_nonnull" ;;
10562 set d_attribute_nonnull
10566 : Look for GCC-style attribute noreturn
10567 case "$d_attribute_noreturn" in
10570 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10571 $cat >attrib.c <<'EOCP'
10573 void fall_over_dead( void ) __attribute__((noreturn));
10575 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10576 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10577 echo "Your C compiler doesn't support __attribute__((noreturn))."
10580 echo "Your C compiler supports __attribute__((noreturn))."
10584 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10588 *) val="$d_attribute_noreturn" ;;
10590 set d_attribute_noreturn
10594 : Look for GCC-style attribute pure
10595 case "$d_attribute_pure" in
10598 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10599 $cat >attrib.c <<'EOCP'
10601 int square( int n ) __attribute__((pure));
10603 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10604 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10605 echo "Your C compiler doesn't support __attribute__((pure))."
10608 echo "Your C compiler supports __attribute__((pure))."
10612 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10616 *) val="$d_attribute_pure" ;;
10618 set d_attribute_pure
10622 : Look for GCC-style attribute unused
10623 case "$d_attribute_unused" in
10626 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10627 $cat >attrib.c <<'EOCP'
10629 int do_something( int dummy __attribute__((unused)), int n );
10631 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10632 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10633 echo "Your C compiler doesn't support __attribute__((unused))."
10636 echo "Your C compiler supports __attribute__((unused))."
10640 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10644 *) val="$d_attribute_unused" ;;
10646 set d_attribute_unused
10650 : Look for GCC-style attribute deprecated
10651 case "$d_attribute_deprecated" in
10654 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10655 $cat >attrib.c <<'EOCP'
10657 int I_am_deprecated(void) __attribute__((deprecated));
10659 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10660 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10661 echo "Your C compiler doesn't support __attribute__((deprecated))."
10664 echo "Your C compiler supports __attribute__((deprecated))."
10668 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10672 *) val="$d_attribute_deprecated" ;;
10674 set d_attribute_deprecated
10678 : Look for GCC-style attribute warn_unused_result
10679 case "$d_attribute_warn_unused_result" in
10682 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10683 $cat >attrib.c <<'EOCP'
10685 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10687 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10688 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10689 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10692 echo "Your C compiler supports __attribute__((warn_unused_result))."
10696 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10700 *) val="$d_attribute_warn_unused_result" ;;
10702 set d_attribute_warn_unused_result
10706 : see if bcmp exists
10710 : see if bcopy exists
10714 : see if getpgrp exists
10715 set getpgrp d_getpgrp
10718 case "$d_getpgrp" in
10721 echo "Checking to see which flavor of getpgrp is in use..."
10723 #$i_unistd I_UNISTD
10724 #include <sys/types.h>
10726 # include <unistd.h>
10728 #$i_stdlib I_STDLIB
10730 #include <stdlib.h>
10734 if (getuid() == 0) {
10735 printf("(I see you are running Configure as super-user...)\n");
10738 #ifdef TRY_BSD_PGRP
10739 if (getpgrp(1) == 0)
10748 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10749 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10751 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10752 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10755 echo "I can't seem to compile and run the test program."
10757 xxx="a USG one, i.e. you use getpgrp()."
10759 # SVR4 systems can appear rather BSD-ish.
10760 case "$i_unistd" in
10762 xxx="a BSD one, i.e. you use getpgrp(pid)."
10766 xxx="probably a USG one, i.e. you use getpgrp()."
10771 echo "Assuming your getpgrp is $xxx" >&4
10780 : see if setpgrp exists
10781 set setpgrp d_setpgrp
10784 case "$d_setpgrp" in
10787 echo "Checking to see which flavor of setpgrp is in use..."
10789 #$i_unistd I_UNISTD
10790 #include <sys/types.h>
10792 # include <unistd.h>
10794 #$i_stdlib I_STDLIB
10796 #include <stdlib.h>
10800 if (getuid() == 0) {
10801 printf("(I see you are running Configure as super-user...)\n");
10804 #ifdef TRY_BSD_PGRP
10805 if (-1 == setpgrp(1, 1))
10808 if (setpgrp() != -1)
10814 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10815 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10817 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10818 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10821 echo "(I can't seem to compile and run the test program.)"
10823 xxx="a USG one, i.e. you use setpgrp()."
10825 # SVR4 systems can appear rather BSD-ish.
10826 case "$i_unistd" in
10828 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10832 xxx="probably a USG one, i.e. you use setpgrp()."
10837 echo "Assuming your setpgrp is $xxx" >&4
10846 : Look for GCC-style __builtin_choose_expr
10847 case "$d_builtin_choose_expr" in
10850 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10851 $cat >try.c <<'EOCP'
10852 #include <assert.h>
10853 #include <stdlib.h>
10856 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10859 assert( SYRINX(1) == 2112 );
10860 assert( SYRINX(1) != 5150 );
10861 assert( SYRINX(0) == 5150 );
10862 assert( SYRINX(0) != 2112 );
10863 puts( "All good!" );
10869 if eval $compile && $run ./try; then
10870 echo "Your C compiler supports __builtin_choose_expr."
10873 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10877 *) val="$d_builtin_choose_expr" ;;
10880 set d_builtin_choose_expr
10884 : Look for GCC-style __builtin_expect
10885 case "$d_builtin_expect" in
10888 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10889 $cat >try.c <<'EOCP'
10892 if ( __builtin_expect(n, 0) ) n = 1;
10893 /* Remember shell exit code truth is 0, C truth is non-zero */
10898 if eval $compile && $run ./try; then
10899 echo "Your C compiler supports __builtin_expect."
10902 echo "Your C compiler doesn't seem to understand __builtin_expect."
10906 *) val="$d_builtin_expect" ;;
10909 set d_builtin_expect
10913 : see if bzero exists
10917 : see if stdarg is available
10919 if $test `./findhdr stdarg.h`; then
10920 echo "<stdarg.h> found." >&4
10923 echo "<stdarg.h> NOT found." >&4
10927 : see if varargs is available
10929 if $test `./findhdr varargs.h`; then
10930 echo "<varargs.h> found." >&4
10932 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10935 : set up the varargs testing programs
10936 $cat > varargs.c <<EOP
10938 #include <stdarg.h>
10941 #include <varargs.h>
10945 int f(char *p, ...)
10959 p = va_arg(ap, char *);
10965 $cat > varargs <<EOP
10967 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10976 : now check which varargs header should be included
10982 if `./varargs I_STDARG`; then
10984 elif `./varargs I_VARARGS`; then
10989 if `./varargs I_VARARGS`; then
10997 echo "*** WHOA THERE!!! ***" >&4
10998 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10999 case "$knowitall" in
11001 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11005 echo "I could not find the definition for va_dcl... You have problems..." >&4
11006 val="$undef"; set i_stdarg; eval $setvar
11007 val="$undef"; set i_varargs; eval $setvar
11012 case "$i_varhdr" in
11014 val="$define"; set i_stdarg; eval $setvar
11015 val="$undef"; set i_varargs; eval $setvar
11018 val="$undef"; set i_stdarg; eval $setvar
11019 val="$define"; set i_varargs; eval $setvar
11022 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11026 : see if the Compiler supports C99 variadic macros
11027 case "$i_stdarg$i_stdlib" in
11029 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11032 #include <stdarg.h>
11034 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11038 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11044 if eval $compile && $run ./try 2>&1 >/dev/null; then
11045 case "`$run ./try`" in
11047 echo "You have C99 variadic macros." >&4
11048 d_c99_variadic_macros="$define"
11051 echo "You don't have functional C99 variadic macros." >&4
11052 d_c99_variadic_macros="$undef"
11056 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11057 d_c99_variadic_macros="$undef"
11062 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11063 d_c99_variadic_macros="$undef"
11067 : see if signal is declared as pointer to function returning int or void
11069 xxx=`./findhdr signal.h`
11070 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11071 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11072 echo "You have int (*signal())() instead of void." >&4
11074 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11075 echo "You have void (*signal())()." >&4
11077 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11078 echo "You have int (*signal())() instead of void." >&4
11080 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11081 echo "You have void (*signal())()." >&4
11084 case "$d_voidsig" in
11086 echo "I can't determine whether signal handler returns void or int..." >&4
11088 rp="What type does your signal handler return?"
11091 v*) val="$define";;
11095 echo "As you already told me, signal handler returns void." >&4
11098 *) echo "As you already told me, signal handler returns int." >&4
11105 case "$d_voidsig" in
11106 "$define") signal_t="void";;
11107 *) signal_t="int";;
11111 : check for ability to cast large floats to 32-bit ints.
11113 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11114 if $test "$intsize" -ge 4; then
11121 #$i_stdlib I_STDLIB
11123 #include <stdlib.h>
11125 #include <sys/types.h>
11126 #include <signal.h>
11127 $signal_t blech(int s) { exit(3); }
11134 signal(SIGFPE, blech);
11136 /* Don't let compiler optimize the test away. Store the number
11137 in a writable string for gcc to pass to sscanf under HP-UX.
11139 sprintf(str, "2147483647");
11140 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11144 /* x86 processors will probably give 0x8000 0000, which is a
11145 sign change. We don't want that. We want to mimic SPARC
11146 behavior here, which is to preserve the sign and give
11149 if (i32 != ($xxx) f)
11155 if eval $compile_ok; then
11159 echo "(I can't seem to compile the test program--assuming it can't)"
11164 echo "Yup, it can."
11167 echo "Nope, it can't."
11174 : check for ability to cast negative floats to unsigned
11176 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11179 #$i_stdlib I_STDLIB
11181 #include <stdlib.h>
11183 #include <sys/types.h>
11184 #include <signal.h>
11185 $signal_t blech(int s) { exit(7); }
11186 $signal_t blech_in_list(int s) { exit(4); }
11187 unsigned long dummy_long(unsigned long p) { return p; }
11188 unsigned int dummy_int(unsigned int p) { return p; }
11189 unsigned short dummy_short(unsigned short p) { return p; }
11193 unsigned long along;
11195 unsigned short ashort;
11199 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11200 a direct f = -123. assignment. gcc-2.8.0 reportedly
11201 optimized the whole file away
11203 /* Store the number in a writable string for gcc to pass to
11204 sscanf under HP-UX.
11206 sprintf(str, "-123");
11207 sscanf(str, "%lf", &f); /* f = -123.; */
11209 signal(SIGFPE, blech);
11210 along = (unsigned long)f;
11211 aint = (unsigned int)f;
11212 ashort = (unsigned short)f;
11213 if (along != (unsigned long)-123)
11215 if (aint != (unsigned int)-123)
11217 if (ashort != (unsigned short)-123)
11219 sprintf(str, "1073741824.");
11220 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11223 along = (unsigned long)f;
11224 if (along != 0x80000000)
11228 along = (unsigned long)f;
11229 if (along != 0x7fffffff)
11233 along = (unsigned long)f;
11234 if (along != 0x80000001)
11238 signal(SIGFPE, blech_in_list);
11239 sprintf(str, "123.");
11240 sscanf(str, "%lf", &f); /* f = 123.; */
11241 along = dummy_long((unsigned long)f);
11242 aint = dummy_int((unsigned int)f);
11243 ashort = dummy_short((unsigned short)f);
11244 if (along != (unsigned long)123)
11246 if (aint != (unsigned int)123)
11248 if (ashort != (unsigned short)123)
11255 if eval $compile_ok; then
11259 echo "(I can't seem to compile the test program--assuming it can't)"
11262 case "$castflags" in
11264 echo "Yup, it can."
11267 echo "Nope, it can't."
11274 : see if vprintf exists
11276 if set vprintf val -f d_vprintf; eval $csym; $val; then
11277 echo 'vprintf() found.' >&4
11280 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11281 #$i_varargs I_VARARGS
11283 #$i_stdlib I_STDLIB
11284 #$i_unistd I_UNISTD
11287 # include <stdarg.h>
11288 #else /* I_VARARGS */
11289 # include <varargs.h>
11293 # include <unistd.h>
11297 # include <stdlib.h>
11300 #include <stdio.h> /* vsprintf prototype */
11303 void xxx(int n, ...)
11308 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11310 int main() { xxx(1, "foo"); }
11312 #else /* I_VARARGS */
11320 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11322 int main() { xxx("foo"); }
11328 if eval $compile_ok; then
11329 if $run ./try; then
11330 echo "Your vsprintf() returns (int)." >&4
11333 echo "Your vsprintf() returns (char*)." >&4
11337 echo 'I am unable to compile the vsprintf() test program.' >&4
11338 # We shouldn't get here. If we do, assume the standard signature,
11339 # not the old BSD one.
11340 echo 'Guessing that vsprintf() returns (int).' >&4
11344 echo 'vprintf() NOT found.' >&4
11355 : see if chown exists
11359 : see if chroot exists
11360 set chroot d_chroot
11363 : see if chsize exists
11364 set chsize d_chsize
11367 : see if class exists
11371 : see if clearenv exists
11372 set clearenv d_clearenv
11375 : Define hasstruct macro for Configure internal use
11376 hasstruct='varname=$1; struct=$2; shift; shift;
11377 while $test $# -ge 2; do
11379 $define) echo "#include <$2>";;
11383 echo "int main () { struct $struct foo; }" >> try.c;
11385 if eval $compile; then
11394 : see whether socket exists
11398 $echo $n "Hmm... $c" >&4
11399 if set socket val -f d_socket; eval $csym; $val; then
11400 echo "Looks like you have Berkeley networking support." >&4
11402 if set setsockopt val -f; eval $csym; $val; then
11405 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11406 d_oldsock="$define"
11409 if $contains socklib libc.list >/dev/null 2>&1; then
11410 echo "Looks like you have Berkeley networking support." >&4
11412 : we will have to assume that it supports the 4.2 BSD interface
11415 echo "You don't have Berkeley networking in libc$_a..." >&4
11416 if test "X$d_socket" = "X$define"; then
11417 echo "...but you seem to believe that you have sockets." >&4
11419 for net in net socket
11421 if test -f $sysroot/usr/lib/lib$net$_a; then
11422 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11423 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11424 if $contains socket libc.list >/dev/null 2>&1; then
11429 echo "...but the Wollongong group seems to have hacked it in." >&4
11430 sockethdr="-I$sysroot/usr/netinclude"
11433 echo "Found Berkeley sockets interface in lib$net." >&4
11434 if $contains setsockopt libc.list >/dev/null 2>&1; then
11437 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11438 d_oldsock="$define"
11444 if test "X$d_socket" != "X$define"; then
11445 echo "or anywhere else I see." >&4
11453 : see if socketpair exists
11454 set socketpair d_sockpair
11459 echo "Checking the availability sa_len in the sock struct ..." >&4
11461 #include <sys/types.h>
11462 #include <sys/socket.h>
11464 struct sockaddr sa;
11465 return (sa.sa_len);
11469 set try; if eval $compile; then
11472 set d_sockaddr_sa_len; eval $setvar
11476 echo "Checking the availability struct sockaddr_in6 ..." >&4
11478 #include <sys/types.h>
11479 #include <sys/socket.h>
11480 #include <netinet/in.h>
11482 struct sockaddr_in6 sin6;
11483 return (sin6.sin6_family);
11487 set try; if eval $compile; then
11490 set d_sockaddr_in6; eval $setvar
11494 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11496 #include <sys/types.h>
11497 #include <sys/socket.h>
11498 #include <netinet/in.h>
11500 struct sockaddr_in6 sin6;
11501 return (sin6.sin6_scope_id);
11505 set try; if eval $compile; then
11508 set d_sin6_scope_id; eval $setvar
11512 echo "Checking the availability struct ip_mreq ..." >&4
11514 #include <sys/types.h>
11515 #include <sys/socket.h>
11516 #include <netinet/in.h>
11518 struct ip_mreq mreq;
11519 return (mreq.imr_multiaddr.s_addr);
11523 set try; if eval $compile; then
11526 set d_ip_mreq; eval $setvar
11530 echo "Checking the availability struct ip_mreq_source ..." >&4
11532 #include <sys/types.h>
11533 #include <sys/socket.h>
11534 #include <netinet/in.h>
11536 struct ip_mreq_source mreq;
11537 return (mreq.imr_multiaddr.s_addr);
11541 set try; if eval $compile; then
11544 set d_ip_mreq_source; eval $setvar
11548 echo "Checking the availability struct ipv6_mreq ..." >&4
11550 #include <sys/types.h>
11551 #include <sys/socket.h>
11552 #include <netinet/in.h>
11554 struct ipv6_mreq mreq;
11555 return (mreq.ipv6mr_interface);
11559 set try; if eval $compile; then
11562 set d_ipv6_mreq; eval $setvar
11566 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11568 #include <sys/types.h>
11569 #include <sys/socket.h>
11570 #include <netinet/in.h>
11572 struct ipv6_mreq_source mreq;
11573 return (mreq.imr_multiaddr.s_addr);
11577 set try; if eval $compile; then
11580 set d_ipv6_mreq_source; eval $setvar
11584 echo "Checking the availability of certain socket constants..." >&4
11585 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11586 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11588 #include <sys/types.h>
11589 #include <sys/socket.h>
11595 set try; if eval $compile; then
11598 set d_${enum}; eval $setvar
11602 : see if this is a sys/uio.h system
11603 set sys/uio.h i_sysuio
11606 : Check for cmsghdr support
11608 echo "Checking to see if your system supports struct cmsghdr..." >&4
11609 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11611 case "$d_cmsghdr_s" in
11612 "$define") echo "Yes, it does." ;;
11613 *) echo "No, it doesn't." ;;
11617 : check for const keyword
11619 echo 'Checking to see if your C compiler knows about "const"...' >&4
11620 $cat >const.c <<'EOCP'
11621 typedef struct spug { int drokk; } spug;
11625 const spug y = { 0 };
11628 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11630 echo "Yup, it does."
11633 echo "Nope, it doesn't."
11638 : see if copysignl exists
11639 set copysignl d_copysignl
11642 : see if crypt exists
11647 $define) cryptlib='' ;;
11648 *) if set crypt val -f d_crypt; eval $csym; $val; then
11649 echo 'crypt() found.' >&4
11653 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11654 if $test -z "$cryptlib"; then
11655 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11659 if $test -z "$cryptlib"; then
11660 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11664 if $test -z "$cryptlib"; then
11665 cryptlib=`./loc libcrypt$_a "" $libpth`
11669 if $test -z "$cryptlib"; then
11670 echo 'crypt() NOT found.' >&4
11681 : see if this is a crypt.h system
11682 set crypt.h i_crypt
11685 : see if crypt_r exists
11686 set crypt_r d_crypt_r
11688 case "$d_crypt_r" in
11690 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11691 case "$d_crypt_r_proto:$usethreads" in
11692 ":define") d_crypt_r_proto=define
11693 set d_crypt_r_proto crypt_r $hdrs
11697 case "$d_crypt_r_proto" in
11699 case "$crypt_r_proto" in
11700 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11701 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11703 case "$crypt_r_proto" in
11704 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11705 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11707 case "$crypt_r_proto" in
11708 ''|0) d_crypt_r=undef
11710 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11711 * ) case "$crypt_r_proto" in
11712 REENTRANT_PROTO*) ;;
11713 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11715 echo "Prototype: $try" ;;
11718 *) case "$usethreads" in
11719 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11730 : get csh whereabouts
11732 'csh') val="$undef" ;;
11733 *) val="$define" ;;
11737 : Respect a hint or command line value for full_csh.
11738 case "$full_csh" in
11739 '') full_csh=$csh ;;
11742 : see if ctermid exists
11743 set ctermid d_ctermid
11746 : see if ctermid_r exists
11747 set ctermid_r d_ctermid_r
11749 case "$d_ctermid_r" in
11751 hdrs="$i_systypes sys/types.h define stdio.h "
11752 case "$d_ctermid_r_proto:$usethreads" in
11753 ":define") d_ctermid_r_proto=define
11754 set d_ctermid_r_proto ctermid_r $hdrs
11758 case "$d_ctermid_r_proto" in
11760 case "$ctermid_r_proto" in
11761 ''|0) try='char* ctermid_r(char*);'
11762 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11764 case "$ctermid_r_proto" in
11765 ''|0) d_ctermid_r=undef
11767 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11768 * ) case "$ctermid_r_proto" in
11769 REENTRANT_PROTO*) ;;
11770 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11772 echo "Prototype: $try" ;;
11775 *) case "$usethreads" in
11776 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11783 *) ctermid_r_proto=0
11787 : see if ctime_r exists
11788 set ctime_r d_ctime_r
11790 case "$d_ctime_r" in
11792 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11793 case "$d_ctime_r_proto:$usethreads" in
11794 ":define") d_ctime_r_proto=define
11795 set d_ctime_r_proto ctime_r $hdrs
11799 case "$d_ctime_r_proto" in
11801 case "$ctime_r_proto" in
11802 ''|0) try='char* ctime_r(const time_t*, char*);'
11803 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11805 case "$ctime_r_proto" in
11806 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11807 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11809 case "$ctime_r_proto" in
11810 ''|0) try='int ctime_r(const time_t*, char*);'
11811 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11813 case "$ctime_r_proto" in
11814 ''|0) try='int ctime_r(const time_t*, char*, int);'
11815 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11817 case "$ctime_r_proto" in
11818 ''|0) d_ctime_r=undef
11820 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11821 * ) case "$ctime_r_proto" in
11822 REENTRANT_PROTO*) ;;
11823 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11825 echo "Prototype: $try" ;;
11828 *) case "$usethreads" in
11829 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11840 : see if cuserid exists
11841 set cuserid d_cuserid
11844 : see if this is a limits.h system
11845 set limits.h i_limits
11848 : see if this is a float.h system
11849 set float.h i_float
11852 : See if number of significant digits in a double precision number is known
11854 $cat >dbl_dig.c <<EOM
11855 #$i_limits I_LIMITS
11858 #include <limits.h>
11864 printf("Contains DBL_DIG");
11867 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11868 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11869 echo "DBL_DIG found." >&4
11872 echo "DBL_DIG NOT found." >&4
11879 : see if dbm.h is available
11880 : see if dbmclose exists
11881 set dbmclose d_dbmclose
11884 case "$d_dbmclose" in
11894 *) set rpcsvc/dbm.h i_rpcsvcdbm
11899 *) echo "We won't be including <dbm.h>"
11909 : see if prototype for dbminit is available
11911 set d_dbminitproto dbminit $i_dbm dbm.h
11914 : see if difftime exists
11915 set difftime d_difftime
11918 : see if this is a dirent system
11920 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11922 echo "<dirent.h> found." >&4
11925 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11926 echo "<sys/dir.h> found." >&4
11929 xinc=`./findhdr sys/ndir.h`
11931 echo "<dirent.h> NOT found." >&4
11936 : Look for type of directory structure.
11938 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11940 case "$direntrytype" in
11942 case "$i_dirent" in
11943 $define) guess1='struct dirent' ;;
11944 *) guess1='struct direct' ;;
11947 *) guess1="$direntrytype"
11952 'struct dirent') guess2='struct direct' ;;
11953 *) guess2='struct dirent' ;;
11956 if $contains "$guess1" try.c >/dev/null 2>&1; then
11957 direntrytype="$guess1"
11958 echo "Your directory entries are $direntrytype." >&4
11959 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11960 direntrytype="$guess2"
11961 echo "Your directory entries seem to be $direntrytype." >&4
11963 echo "I don't recognize your system's directory entries." >&4
11964 rp="What type is used for directory entries on this system?"
11967 direntrytype="$ans"
11971 : see if the directory entry stores field length
11973 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11974 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11975 echo "Good, your directory entry keeps length information in d_namlen." >&4
11978 echo "Your directory entry does not know about the d_namlen field." >&4
11985 : Look for DIR.dd_fd
11986 case "$i_dirent" in
11988 echo "Checking to see if DIR has a dd_fd member variable" >&4
11990 #$i_stdlib I_STDLIB
11992 #include <stdlib.h>
11994 #include <dirent.h>
12004 if eval $compile; then
12005 echo "Yes, it does."
12008 echo "No, it does not."
12013 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12021 : see if this is an sysdir system
12022 set sys/dir.h i_sysdir
12025 : see if this is an sysndir system
12026 set sys/ndir.h i_sysndir
12031 $cat >dirfd.c <<EOM
12033 #$i_stdlib I_STDLIB
12035 #include <stdlib.h>
12037 #$i_dirent I_DIRENT /**/
12038 #$i_sysdir I_SYS_DIR /**/
12039 #$i_sysndir I_SYS_NDIR /**/
12040 #$i_systypes I_SYS_TYPES /**/
12041 #if defined(I_SYS_TYPES)
12042 #include <sys/types.h>
12044 #if defined(I_DIRENT)
12045 #include <dirent.h>
12046 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12047 #include <sys/dir.h>
12051 #include <sys/ndir.h>
12055 #include <ndir.h> /* may be wrong in the future */
12057 #include <sys/dir.h>
12063 DIR *dirp = opendir(".");
12064 if (dirfd(dirp) >= 0)
12072 if eval $compile; then
12076 $define) echo "dirfd() found." >&4 ;;
12077 *) echo "dirfd() NOT found." >&4 ;;
12083 : see if dlerror exists
12086 set dlerror d_dlerror
12090 : see if dlfcn is available
12091 set dlfcn.h i_dlfcn
12094 : Check what extension to use for shared libs
12099 On a few systems, the dynamically loaded modules that perl generates and uses
12100 will need a different extension than shared libs. The default will probably
12106 *) dflt="$dlext" ;;
12108 rp='What is the extension of dynamically loaded modules'
12117 : Check if dlsym need a leading underscore
12123 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12124 $cat >dyna.c <<'EOM'
12131 #$i_stdlib I_STDLIB
12133 #include <stdlib.h>
12137 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12139 #include <sys/types.h>
12144 extern int fred() ;
12153 int mode = RTLD_LAZY ;
12155 handle = dlopen("./dyna.$dlext", mode) ;
12156 if (handle == NULL) {
12161 symbol = dlsym(handle, "fred") ;
12162 if (symbol == NULL) {
12163 /* try putting a leading underscore */
12164 symbol = dlsym(handle, "_fred") ;
12165 if (symbol == NULL) {
12178 : Call the object file tmp-dyna.o in case dlext=o.
12179 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12180 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12181 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12182 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12185 1) echo "Test program failed using dlopen." >&4
12186 echo "Perhaps you should not use dynamic loading." >&4;;
12187 2) echo "Test program failed using dlsym." >&4
12188 echo "Perhaps you should not use dynamic loading." >&4;;
12189 3) echo "dlsym needs a leading underscore" >&4
12191 4) echo "dlsym doesn't need a leading underscore." >&4;;
12194 echo "I can't compile and run the test program." >&4
12195 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12200 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12205 : see if drand48_r exists
12206 set drand48_r d_drand48_r
12208 case "$d_drand48_r" in
12210 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12211 case "$d_drand48_r_proto:$usethreads" in
12212 ":define") d_drand48_r_proto=define
12213 set d_drand48_r_proto drand48_r $hdrs
12217 case "$d_drand48_r_proto" in
12219 case "$drand48_r_proto" in
12220 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12221 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12223 case "$drand48_r_proto" in
12224 ''|0) d_drand48_r=undef
12226 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12227 * ) case "$drand48_r_proto" in
12228 REENTRANT_PROTO*) ;;
12229 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12231 echo "Prototype: $try" ;;
12234 *) case "$usethreads" in
12235 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12242 *) drand48_r_proto=0
12246 : see if prototype for drand48 is available
12248 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12251 : see if dup2 exists
12255 : see if eaccess exists
12256 set eaccess d_eaccess
12259 : see if endgrent exists
12260 set endgrent d_endgrent
12263 : see if this is an grp system
12269 xxx=`./findhdr grp.h`
12270 $cppstdin $cppflags $cppminus < $xxx >$$.h
12272 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12284 set d_grpasswd; eval $setvar
12288 : see if endgrent_r exists
12289 set endgrent_r d_endgrent_r
12291 case "$d_endgrent_r" in
12293 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12294 case "$d_endgrent_r_proto:$usethreads" in
12295 ":define") d_endgrent_r_proto=define
12296 set d_endgrent_r_proto endgrent_r $hdrs
12300 case "$d_endgrent_r_proto" in
12302 case "$endgrent_r_proto" in
12303 ''|0) try='int endgrent_r(FILE**);'
12304 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12306 case "$endgrent_r_proto" in
12307 ''|0) try='void endgrent_r(FILE**);'
12308 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12310 case "$endgrent_r_proto" in
12311 ''|0) d_endgrent_r=undef
12313 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12314 * ) case "$endgrent_r_proto" in
12315 REENTRANT_PROTO*) ;;
12316 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12318 echo "Prototype: $try" ;;
12321 *) case "$usethreads" in
12322 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12329 *) endgrent_r_proto=0
12333 : see if endhostent exists
12334 set endhostent d_endhent
12337 : see if this is a netdb.h system
12338 set netdb.h i_netdb
12341 : see if endhostent_r exists
12342 set endhostent_r d_endhostent_r
12344 case "$d_endhostent_r" in
12346 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12347 case "$d_endhostent_r_proto:$usethreads" in
12348 ":define") d_endhostent_r_proto=define
12349 set d_endhostent_r_proto endhostent_r $hdrs
12353 case "$d_endhostent_r_proto" in
12355 case "$endhostent_r_proto" in
12356 ''|0) try='int endhostent_r(struct hostent_data*);'
12357 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12359 case "$endhostent_r_proto" in
12360 ''|0) try='void endhostent_r(struct hostent_data*);'
12361 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12363 case "$endhostent_r_proto" in
12364 ''|0) d_endhostent_r=undef
12365 endhostent_r_proto=0
12366 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12367 * ) case "$endhostent_r_proto" in
12368 REENTRANT_PROTO*) ;;
12369 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12371 echo "Prototype: $try" ;;
12374 *) case "$usethreads" in
12375 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12377 d_endhostent_r=undef
12378 endhostent_r_proto=0
12382 *) endhostent_r_proto=0
12386 : see if endnetent exists
12387 set endnetent d_endnent
12390 : see if endnetent_r exists
12391 set endnetent_r d_endnetent_r
12393 case "$d_endnetent_r" in
12395 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12396 case "$d_endnetent_r_proto:$usethreads" in
12397 ":define") d_endnetent_r_proto=define
12398 set d_endnetent_r_proto endnetent_r $hdrs
12402 case "$d_endnetent_r_proto" in
12404 case "$endnetent_r_proto" in
12405 ''|0) try='int endnetent_r(struct netent_data*);'
12406 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12408 case "$endnetent_r_proto" in
12409 ''|0) try='void endnetent_r(struct netent_data*);'
12410 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12412 case "$endnetent_r_proto" in
12413 ''|0) d_endnetent_r=undef
12414 endnetent_r_proto=0
12415 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12416 * ) case "$endnetent_r_proto" in
12417 REENTRANT_PROTO*) ;;
12418 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12420 echo "Prototype: $try" ;;
12423 *) case "$usethreads" in
12424 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12426 d_endnetent_r=undef
12427 endnetent_r_proto=0
12431 *) endnetent_r_proto=0
12435 : see if endprotoent exists
12436 set endprotoent d_endpent
12439 : see if endprotoent_r exists
12440 set endprotoent_r d_endprotoent_r
12442 case "$d_endprotoent_r" in
12444 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12445 case "$d_endprotoent_r_proto:$usethreads" in
12446 ":define") d_endprotoent_r_proto=define
12447 set d_endprotoent_r_proto endprotoent_r $hdrs
12451 case "$d_endprotoent_r_proto" in
12453 case "$endprotoent_r_proto" in
12454 ''|0) try='int endprotoent_r(struct protoent_data*);'
12455 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12457 case "$endprotoent_r_proto" in
12458 ''|0) try='void endprotoent_r(struct protoent_data*);'
12459 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12461 case "$endprotoent_r_proto" in
12462 ''|0) d_endprotoent_r=undef
12463 endprotoent_r_proto=0
12464 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12465 * ) case "$endprotoent_r_proto" in
12466 REENTRANT_PROTO*) ;;
12467 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12469 echo "Prototype: $try" ;;
12472 *) case "$usethreads" in
12473 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12475 d_endprotoent_r=undef
12476 endprotoent_r_proto=0
12480 *) endprotoent_r_proto=0
12484 : see if endpwent exists
12485 set endpwent d_endpwent
12488 : see if this is a pwd.h system
12494 xxx=`./findhdr pwd.h`
12495 $cppstdin $cppflags $cppminus < $xxx >$$.h
12497 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12505 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12513 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12521 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12529 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12537 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12545 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12553 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12565 set d_pwquota; eval $setvar
12566 set d_pwage; eval $setvar
12567 set d_pwchange; eval $setvar
12568 set d_pwclass; eval $setvar
12569 set d_pwexpire; eval $setvar
12570 set d_pwcomment; eval $setvar
12571 set d_pwgecos; eval $setvar
12572 set d_pwpasswd; eval $setvar
12576 : see if endpwent_r exists
12577 set endpwent_r d_endpwent_r
12579 case "$d_endpwent_r" in
12581 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12582 case "$d_endpwent_r_proto:$usethreads" in
12583 ":define") d_endpwent_r_proto=define
12584 set d_endpwent_r_proto endpwent_r $hdrs
12588 case "$d_endpwent_r_proto" in
12590 case "$endpwent_r_proto" in
12591 ''|0) try='int endpwent_r(FILE**);'
12592 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12594 case "$endpwent_r_proto" in
12595 ''|0) try='void endpwent_r(FILE**);'
12596 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12598 case "$endpwent_r_proto" in
12599 ''|0) d_endpwent_r=undef
12601 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12602 * ) case "$endpwent_r_proto" in
12603 REENTRANT_PROTO*) ;;
12604 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12606 echo "Prototype: $try" ;;
12609 *) case "$usethreads" in
12610 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12617 *) endpwent_r_proto=0
12621 : see if endservent exists
12622 set endservent d_endsent
12625 : see if endservent_r exists
12626 set endservent_r d_endservent_r
12628 case "$d_endservent_r" in
12630 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12631 case "$d_endservent_r_proto:$usethreads" in
12632 ":define") d_endservent_r_proto=define
12633 set d_endservent_r_proto endservent_r $hdrs
12637 case "$d_endservent_r_proto" in
12639 case "$endservent_r_proto" in
12640 ''|0) try='int endservent_r(struct servent_data*);'
12641 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12643 case "$endservent_r_proto" in
12644 ''|0) try='void endservent_r(struct servent_data*);'
12645 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12647 case "$endservent_r_proto" in
12648 ''|0) d_endservent_r=undef
12649 endservent_r_proto=0
12650 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12651 * ) case "$endservent_r_proto" in
12652 REENTRANT_PROTO*) ;;
12653 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12655 echo "Prototype: $try" ;;
12658 *) case "$usethreads" in
12659 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12661 d_endservent_r=undef
12662 endservent_r_proto=0
12666 *) endservent_r_proto=0
12670 : Locate the flags for 'open()'
12673 #include <sys/types.h>
12678 #include <sys/file.h>
12680 #$i_stdlib I_STDLIB
12682 #include <stdlib.h>
12693 : check sys/file.h first to get FREAD on Sun
12694 if $test `./findhdr sys/file.h` && \
12695 set try -DI_SYS_FILE && eval $compile; then
12697 echo "<sys/file.h> defines the O_* constants..." >&4
12698 if $run ./try; then
12699 echo "and you have the 3 argument form of open()." >&4
12702 echo "but not the 3 argument form of open(). Oh, well." >&4
12705 elif $test `./findhdr fcntl.h` && \
12706 set try -DI_FCNTL && eval $compile; then
12708 echo "<fcntl.h> defines the O_* constants..." >&4
12709 if $run ./try; then
12710 echo "and you have the 3 argument form of open()." >&4
12713 echo "but not the 3 argument form of open(). Oh, well." >&4
12718 echo "I can't find the O_* constant definitions! You got problems." >&4
12724 : see if this is a sys/file.h system
12729 : do we need to include sys/file.h ?
12733 if $h_sysfile; then
12735 echo "We'll be including <sys/file.h>." >&4
12738 echo "We won't be including <sys/file.h>." >&4
12748 : see if fcntl.h is there
12753 : see if we can include fcntl.h
12759 echo "We'll be including <fcntl.h>." >&4
12762 if $h_sysfile; then
12763 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12765 echo "We won't be including <fcntl.h>." >&4
12777 : see if fork exists
12781 : see if pipe exists
12785 : check for non-blocking I/O stuff
12786 case "$h_sysfile" in
12787 true) echo "#include <sys/file.h>" > head.c;;
12790 true) echo "#include <fcntl.h>" > head.c;;
12791 *) echo "#include <sys/fcntl.h>" > head.c;;
12796 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12797 case "$o_nonblock" in
12799 $cat head.c > try.c
12800 $cat >>try.c <<EOCP
12802 #$i_stdlib I_STDLIB
12804 #include <stdlib.h>
12812 printf("O_NONBLOCK\n");
12816 printf("O_NDELAY\n");
12820 printf("FNDELAY\n");
12827 if eval $compile_ok; then
12828 o_nonblock=`$run ./try`
12829 case "$o_nonblock" in
12830 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12831 *) echo "Seems like we can use $o_nonblock.";;
12834 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12837 *) echo "Using $hint value $o_nonblock.";;
12842 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12845 case "$d_fork:$d_pipe" in
12847 $cat head.c > try.c
12848 $cat >>try.c <<EOCP
12850 #include <sys/types.h>
12851 #include <signal.h>
12853 #$i_stdlib I_STDLIB
12855 #include <stdlib.h>
12861 #define MY_O_NONBLOCK $o_nonblock
12862 #ifndef errno /* XXX need better Configure test */
12865 #$i_unistd I_UNISTD
12867 #include <unistd.h>
12869 #$i_string I_STRING
12871 #include <string.h>
12873 #include <strings.h>
12875 $signal_t blech(int x) { exit(3); }
12877 $cat >> try.c <<'EOCP'
12885 pipe(pd); /* Down: child -> parent */
12886 pipe(pu); /* Up: parent -> child */
12889 close(pd[1]); /* Parent reads from pd[0] */
12890 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12892 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12897 signal(SIGALRM, blech);
12899 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12901 sprintf(string, "%d\n", ret);
12902 write(2, string, strlen(string));
12905 if (errno == EAGAIN) {
12906 printf("EAGAIN\n");
12911 if (errno == EWOULDBLOCK)
12912 printf("EWOULDBLOCK\n");
12915 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12916 sleep(2); /* Give it time to close our pipe */
12918 ret = read(pd[0], buf, 1); /* Should read EOF */
12920 sprintf(string, "%d\n", ret);
12921 write(4, string, strlen(string));
12925 close(pd[0]); /* We write to pd[1] */
12926 close(pu[1]); /* We read from pu[0] */
12927 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12928 close(pd[1]); /* Pipe pd is now fully closed! */
12929 exit(0); /* Bye bye, thank you for playing! */
12933 if eval $compile_ok; then
12934 echo "$startsh" >mtry
12935 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12937 $run ./mtry >/dev/null 2>&1
12939 0) eagain=`$cat try.out`;;
12940 1) echo "Could not perform non-blocking setting!";;
12941 2) echo "I did a successful read() for something that was not there!";;
12942 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12943 4) echo "Could not find F_SETFL!";;
12944 *) echo "Something terribly wrong happened during testing.";;
12946 rd_nodata=`$cat try.ret`
12947 echo "A read() system call with no data present returns $rd_nodata."
12948 case "$rd_nodata" in
12951 echo "(That's peculiar, fixing that to be -1.)"
12957 echo "Forcing errno EAGAIN on read() with no data available."
12961 echo "Your read() sets errno to $eagain when no data is available."
12964 status=`$cat try.err`
12966 0) echo "And it correctly returns 0 to signal EOF.";;
12967 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12968 *) echo "However, your read() returns '$status' on EOF??";;
12971 if test "$status" = "$rd_nodata"; then
12972 echo "WARNING: you can't distinguish between EOF and no data!"
12976 echo "I can't compile the test program--assuming errno EAGAIN will do."
12980 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12989 echo "Using $hint value $eagain."
12990 echo "Your read() returns $rd_nodata when no data is present."
12991 case "$d_eofnblk" in
12992 "$define") echo "And you can see EOF because read() returns 0.";;
12993 "$undef") echo "But you can't see EOF status from read() returned value.";;
12995 echo "(Assuming you can't see EOF status from read anyway.)"
13001 $rm_try head.c mtry
13003 : see if _ptr and _cnt from stdio act std
13006 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13007 echo "(Looks like you have stdio.h from BSD.)"
13008 case "$stdio_ptr" in
13009 '') stdio_ptr='((fp)->_p)'
13012 *) ptr_lval=$d_stdio_ptr_lval;;
13014 case "$stdio_cnt" in
13015 '') stdio_cnt='((fp)->_r)'
13018 *) cnt_lval=$d_stdio_cnt_lval;;
13020 case "$stdio_base" in
13021 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13023 case "$stdio_bufsiz" in
13024 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13026 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13027 echo "(Looks like you have stdio.h from Linux.)"
13028 case "$stdio_ptr" in
13029 '') stdio_ptr='((fp)->_IO_read_ptr)'
13032 *) ptr_lval=$d_stdio_ptr_lval;;
13034 case "$stdio_cnt" in
13035 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13038 *) cnt_lval=$d_stdio_cnt_lval;;
13040 case "$stdio_base" in
13041 '') stdio_base='((fp)->_IO_read_base)';;
13043 case "$stdio_bufsiz" in
13044 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13047 case "$stdio_ptr" in
13048 '') stdio_ptr='((fp)->_ptr)'
13051 *) ptr_lval=$d_stdio_ptr_lval;;
13053 case "$stdio_cnt" in
13054 '') stdio_cnt='((fp)->_cnt)'
13057 *) cnt_lval=$d_stdio_cnt_lval;;
13059 case "$stdio_base" in
13060 '') stdio_base='((fp)->_base)';;
13062 case "$stdio_bufsiz" in
13063 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13067 : test whether _ptr and _cnt really work
13068 echo "Checking how std your stdio is..." >&4
13071 #$i_stdlib I_STDLIB
13073 #include <stdlib.h>
13075 #define FILE_ptr(fp) $stdio_ptr
13076 #define FILE_cnt(fp) $stdio_cnt
13078 FILE *fp = fopen("try.c", "r");
13081 18 <= FILE_cnt(fp) &&
13082 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13090 if eval $compile && $to try.c; then
13091 if $run ./try; then
13092 echo "Your stdio acts pretty std."
13095 echo "Your stdio isn't very std."
13098 echo "Your stdio doesn't appear very std."
13102 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13103 # direct buffer manipulation no longer works. The Configure tests
13104 # should be changed to correctly detect this, but until then,
13105 # the following check should at least let perl compile and run.
13106 # (This quick fix should be updated before 5.8.1.)
13107 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13108 # A. Dougherty, June 3, 2002.
13109 case "$d_gnulibc" in
13111 case "$gnulibc_version" in
13115 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13124 : Can _ptr be used as an lvalue?
13125 case "$d_stdstdio$ptr_lval" in
13126 $define$define) val=$define ;;
13129 set d_stdio_ptr_lval
13132 : Can _cnt be used as an lvalue?
13133 case "$d_stdstdio$cnt_lval" in
13134 $define$define) val=$define ;;
13137 set d_stdio_cnt_lval
13141 : test whether setting _ptr sets _cnt as a side effect
13142 d_stdio_ptr_lval_sets_cnt="$undef"
13143 d_stdio_ptr_lval_nochange_cnt="$undef"
13144 case "$d_stdio_ptr_lval$d_stdstdio" in
13146 echo "Checking to see what happens if we set the stdio ptr..." >&4
13149 /* Can we scream? */
13150 /* Eat dust sed :-) */
13151 /* In the buffer space, no one can hear you scream. */
13152 #$i_stdlib I_STDLIB
13154 #include <stdlib.h>
13156 #define FILE_ptr(fp) $stdio_ptr
13157 #define FILE_cnt(fp) $stdio_cnt
13158 #include <sys/types.h>
13160 FILE *fp = fopen("try.c", "r");
13165 puts("Fail even to read");
13168 c = getc(fp); /* Read away the first # */
13170 puts("Fail even to read");
13174 18 <= FILE_cnt(fp) &&
13175 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13177 puts("Fail even to read");
13180 ptr = (char*) FILE_ptr(fp);
13181 cnt = (size_t)FILE_cnt(fp);
13183 FILE_ptr(fp) += 42;
13185 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13186 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13189 if (FILE_cnt(fp) <= 20) {
13190 printf ("Fail (<20 chars to test)");
13193 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13194 puts("Fail compare");
13197 if (cnt == FILE_cnt(fp)) {
13198 puts("Pass_unchanged");
13201 if (FILE_cnt(fp) == (cnt - 42)) {
13202 puts("Pass_changed");
13205 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13211 if eval $compile && $to try.c; then
13212 case `$run ./try` in
13214 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13215 d_stdio_ptr_lval_sets_cnt="$define" ;;
13217 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13218 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13220 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13222 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13225 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13231 : see if _base is also standard
13233 case "$d_stdstdio" in
13237 #$i_stdlib I_STDLIB
13239 #include <stdlib.h>
13241 #define FILE_base(fp) $stdio_base
13242 #define FILE_bufsiz(fp) $stdio_bufsiz
13244 FILE *fp = fopen("try.c", "r");
13247 19 <= FILE_bufsiz(fp) &&
13248 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13255 if eval $compile && $to try.c; then
13256 if $run ./try; then
13257 echo "And its _base field acts std."
13260 echo "But its _base field isn't std."
13263 echo "However, it seems to be lacking the _base field."
13271 : see if fast_stdio exists
13273 case "$d_stdstdio:$d_stdio_ptr_lval" in
13275 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13277 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13288 : see if fchdir exists
13289 set fchdir d_fchdir
13292 : see if fchmod exists
13293 set fchmod d_fchmod
13296 : see if fchown exists
13297 set fchown d_fchown
13300 : see if this is an fcntl system
13304 : See if fcntl-based locking works.
13307 #$i_stdlib I_STDLIB
13309 #include <stdlib.h>
13311 #include <unistd.h>
13313 #include <signal.h>
13314 $signal_t blech(int x) { exit(3); }
13316 #if defined(F_SETLK) && defined(F_SETLKW)
13317 struct flock flock;
13319 fd = open("try.c", O_RDONLY);
13320 flock.l_type = F_RDLCK;
13321 flock.l_whence = SEEK_SET;
13322 flock.l_start = flock.l_len = 0;
13323 signal(SIGALRM, blech);
13325 retval = fcntl(fd, F_SETLK, &flock);
13327 (retval < 0 ? exit(2) : exit(0));
13333 echo "Checking if fcntl-based file locking works... "
13337 if eval $compile_ok; then
13338 if $run ./try; then
13339 echo "Yes, it seems to work."
13342 echo "Nope, it didn't work."
13347 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13348 *** This is (almost) impossible.
13349 *** If your NFS lock daemons are not feeling well, something like
13350 *** this may happen, please investigate. Cannot continue, aborting.
13358 echo "I'm unable to compile the test program, so I'll assume not."
13363 echo "Nope, since you don't even have fcntl()."
13366 set d_fcntl_can_lock
13370 : check for fd_set items
13373 Checking to see how well your C compiler handles fd_set and friends ...
13376 #$i_stdlib I_STDLIB
13378 #include <stdlib.h>
13380 #$i_systime I_SYS_TIME
13381 #$i_sysselct I_SYS_SELECT
13382 #$d_socket HAS_SOCKET
13383 #include <sys/types.h>
13385 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13388 #include <sys/time.h>
13390 #ifdef I_SYS_SELECT
13391 #include <sys/select.h>
13400 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13408 if eval $compile; then
13409 d_fds_bits="$define"
13411 echo "Well, your system knows about the normal fd_set typedef..." >&4
13412 if $run ./try; then
13413 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13414 d_fd_macros="$define"
13417 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13419 d_fd_macros="$undef"
13423 Hmm, your compiler has some difficulty with fd_set. Checking further...
13426 if eval $compile; then
13427 d_fds_bits="$undef"
13429 echo "Well, your system has some sort of fd_set available..." >&4
13430 if $run ./try; then
13431 echo "and you have the normal fd_set macros." >&4
13432 d_fd_macros="$define"
13435 but not the normal fd_set macros! Gross! More work for me...
13437 d_fd_macros="$undef"
13440 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13442 d_fds_bits="$undef"
13443 d_fd_macros="$undef"
13448 : see if fgetpos exists
13449 set fgetpos d_fgetpos
13452 : see if finite exists
13453 set finite d_finite
13456 : see if finitel exists
13457 set finitel d_finitel
13460 : see if flock exists
13464 : see if prototype for flock is available
13466 set d_flockproto flock $i_sysfile sys/file.h
13469 : see if fp_class exists
13470 set fp_class d_fp_class
13473 : see if pathconf exists
13474 set pathconf d_pathconf
13477 : see if fpathconf exists
13478 set fpathconf d_fpathconf
13481 : see if fpclass exists
13482 set fpclass d_fpclass
13485 : see if fpclassify exists
13486 set fpclassify d_fpclassify
13489 : see if fpclassl exists
13490 set fpclassl d_fpclassl
13493 : check for fpos64_t
13495 echo "Checking to see if you have fpos64_t..." >&4
13498 int main() { fpos64_t x = 7; }
13501 if eval $compile; then
13503 echo "You have fpos64_t."
13506 echo "You do not have fpos64_t."
13507 case "$fpossize" in
13508 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13515 : see if frexpl exists
13516 set frexpl d_frexpl
13519 : see if this is a sys/param system
13520 set sys/param.h i_sysparam
13523 : see if this is a sys/mount.h system
13524 set sys/mount.h i_sysmount
13527 : Check for fs_data_s
13529 echo "Checking to see if your system supports struct fs_data..." >&4
13530 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13532 case "$d_fs_data_s" in
13533 "$define") echo "Yes, it does." ;;
13534 *) echo "No, it doesn't." ;;
13537 : see if fseeko exists
13538 set fseeko d_fseeko
13540 case "$longsize" in
13541 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13544 : see if fsetpos exists
13545 set fsetpos d_fsetpos
13548 : see if fstatfs exists
13549 set fstatfs d_fstatfs
13552 : see if statvfs exists
13553 set statvfs d_statvfs
13556 : see if fstatvfs exists
13557 set fstatvfs d_fstatvfs
13561 : see if fsync exists
13565 : see if ftello exists
13566 set ftello d_ftello
13568 case "$longsize" in
13569 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13572 : check for a working futimes
13575 echo "Checking if you have a working futimes()" >&4
13578 #include <sys/time.h>
13585 fd = open ("try.c", O_RDWR);
13586 if (-1 == fd) exit (1);
13587 rv = futimes (fd, NULL);
13588 exit (rv == -1 ? errno : 0);
13592 if eval $compile; then
13596 0) echo "Yes, you have" >&4
13597 d_futimes="$define"
13599 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13603 echo "No, it does not (probably harmless)" >&4
13607 : see if ndbm.h is available
13610 : Compatibility location for RedHat 7.1
13611 set gdbm/ndbm.h i_gdbmndbm
13613 : Compatibility location for Debian 4.0
13614 set gdbm-ndbm.h i_gdbm_ndbm
13618 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13619 : see if dbm_open exists
13620 set dbm_open d_dbm_open
13622 case "$d_dbm_open" in
13625 i_gdbmndbm="$undef"
13626 i_gdbm_ndbm="$undef"
13627 echo "We won't be including <ndbm.h>"
13637 ndbm_hdr_protochk='name=$1; hdr=$2;
13638 eval "ihdr=\$""i_$name";
13640 if $test "$ihdr" = "$define"; then
13641 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13642 case "$d_cplusplus" in
13643 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13644 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13647 $define) $echo "Your <$hdr> seems to have prototypes";;
13648 *) $echo "Your <$hdr> does not seem to have prototypes";;
13651 set "d_${name}_h_uses_prototypes";
13655 eval $ndbm_hdr_protochk
13656 set gdbmndbm gdbm/ndbm.h
13657 eval $ndbm_hdr_protochk
13658 set gdbm_ndbm gdbm-ndbm.h
13659 eval $ndbm_hdr_protochk
13661 : see if getaddrinfo exists
13662 set getaddrinfo d_getaddrinfo
13665 : see if getcwd exists
13666 set getcwd d_getcwd
13669 : see if getespwnam exists
13670 set getespwnam d_getespwnam
13673 : see if getfsstat exists
13674 set getfsstat d_getfsstat
13677 : see if getgrent exists
13678 set getgrent d_getgrent
13681 : see if getgrent_r exists
13682 set getgrent_r d_getgrent_r
13684 case "$d_getgrent_r" in
13686 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13687 case "$d_getgrent_r_proto:$usethreads" in
13688 ":define") d_getgrent_r_proto=define
13689 set d_getgrent_r_proto getgrent_r $hdrs
13693 case "$d_getgrent_r_proto" in
13695 case "$getgrent_r_proto" in
13696 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13697 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13699 case "$getgrent_r_proto" in
13700 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13701 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13703 case "$getgrent_r_proto" in
13704 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13705 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13707 case "$getgrent_r_proto" in
13708 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13709 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13711 case "$getgrent_r_proto" in
13712 ''|0) try='int getgrent_r(struct group*, char*, int);'
13713 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13715 case "$getgrent_r_proto" in
13716 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13717 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13719 case "$getgrent_r_proto" in
13720 ''|0) d_getgrent_r=undef
13722 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13723 * ) case "$getgrent_r_proto" in
13724 REENTRANT_PROTO*) ;;
13725 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13727 echo "Prototype: $try" ;;
13730 *) case "$usethreads" in
13731 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13738 *) getgrent_r_proto=0
13742 : see if getgrgid_r exists
13743 set getgrgid_r d_getgrgid_r
13745 case "$d_getgrgid_r" in
13747 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13748 case "$d_getgrgid_r_proto:$usethreads" in
13749 ":define") d_getgrgid_r_proto=define
13750 set d_getgrgid_r_proto getgrgid_r $hdrs
13754 case "$d_getgrgid_r_proto" in
13756 case "$getgrgid_r_proto" in
13757 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13758 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13760 case "$getgrgid_r_proto" in
13761 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13762 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13764 case "$getgrgid_r_proto" in
13765 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13766 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13768 case "$getgrgid_r_proto" in
13769 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13770 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13772 case "$getgrgid_r_proto" in
13773 ''|0) d_getgrgid_r=undef
13775 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13776 * ) case "$getgrgid_r_proto" in
13777 REENTRANT_PROTO*) ;;
13778 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13780 echo "Prototype: $try" ;;
13783 *) case "$usethreads" in
13784 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13791 *) getgrgid_r_proto=0
13795 : see if getgrnam_r exists
13796 set getgrnam_r d_getgrnam_r
13798 case "$d_getgrnam_r" in
13800 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13801 case "$d_getgrnam_r_proto:$usethreads" in
13802 ":define") d_getgrnam_r_proto=define
13803 set d_getgrnam_r_proto getgrnam_r $hdrs
13807 case "$d_getgrnam_r_proto" in
13809 case "$getgrnam_r_proto" in
13810 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13811 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13813 case "$getgrnam_r_proto" in
13814 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13815 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13817 case "$getgrnam_r_proto" in
13818 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13819 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13821 case "$getgrnam_r_proto" in
13822 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13823 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13825 case "$getgrnam_r_proto" in
13826 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13827 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13829 case "$getgrnam_r_proto" in
13830 ''|0) d_getgrnam_r=undef
13832 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13833 * ) case "$getgrnam_r_proto" in
13834 REENTRANT_PROTO*) ;;
13835 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13837 echo "Prototype: $try" ;;
13840 *) case "$usethreads" in
13841 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13848 *) getgrnam_r_proto=0
13852 : see if gethostbyaddr exists
13853 set gethostbyaddr d_gethbyaddr
13856 : see if gethostbyname exists
13857 set gethostbyname d_gethbyname
13860 : see if gethostent exists
13861 set gethostent d_gethent
13864 : see how we will look up host name
13867 if set gethostname val -f d_gethname; eval $csym; $val; then
13868 echo 'gethostname() found.' >&4
13869 d_gethname="$define"
13872 if set uname val -f d_uname; eval $csym; $val; then
13875 uname() was found, but you're running xenix, and older versions of xenix
13876 have a broken uname(). If you don't really know whether your xenix is old
13877 enough to have a broken system call, use the default answer.
13882 "$define") dflt=n;;
13884 rp='Is your uname() broken?'
13887 n*) d_uname="$define"; call=uname;;
13890 echo 'uname() found.' >&4
13897 case "$d_gethname" in
13898 '') d_gethname="$undef";;
13901 '') d_uname="$undef";;
13903 case "$d_uname$d_gethname" in
13908 Every now and then someone has a $call() that lies about the hostname
13909 but can't be fixed for political or economic reasons. If you wish, I can
13910 pretend $call() isn't there and maybe compute hostname at run-time
13911 thanks to the '$phostname' command.
13914 rp="Shall I ignore $call() from now on?"
13917 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13920 case "$phostname" in
13921 '') aphostname='';;
13922 *) case "$aphostname" in
13924 *) set X $phostname
13928 file=`./loc $file $file $pth`
13929 aphostname=`echo $file $*`
13934 case "$d_uname$d_gethname" in
13937 case "$phostname" in
13939 echo "There will be no way for $package to get your hostname." >&4;;
13941 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13945 case "$d_phostname" in
13946 '') d_phostname="$undef";;
13949 : see if gethostbyaddr_r exists
13950 set gethostbyaddr_r d_gethostbyaddr_r
13952 case "$d_gethostbyaddr_r" in
13954 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13955 case "$d_gethostbyaddr_r_proto:$usethreads" in
13956 ":define") d_gethostbyaddr_r_proto=define
13957 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13961 case "$d_gethostbyaddr_r_proto" in
13963 case "$gethostbyaddr_r_proto" in
13964 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13965 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13967 case "$gethostbyaddr_r_proto" in
13968 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13969 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13971 case "$gethostbyaddr_r_proto" in
13972 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13973 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13975 case "$gethostbyaddr_r_proto" in
13976 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13977 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13979 case "$gethostbyaddr_r_proto" in
13980 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13981 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13983 case "$gethostbyaddr_r_proto" in
13984 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13985 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13987 case "$gethostbyaddr_r_proto" in
13988 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13989 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13991 case "$gethostbyaddr_r_proto" in
13992 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13993 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13995 case "$gethostbyaddr_r_proto" in
13996 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13997 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13999 case "$gethostbyaddr_r_proto" in
14000 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14001 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14003 case "$gethostbyaddr_r_proto" in
14004 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14005 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14007 case "$gethostbyaddr_r_proto" in
14008 ''|0) d_gethostbyaddr_r=undef
14009 gethostbyaddr_r_proto=0
14010 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14011 * ) case "$gethostbyaddr_r_proto" in
14012 REENTRANT_PROTO*) ;;
14013 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14015 echo "Prototype: $try" ;;
14018 *) case "$usethreads" in
14019 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14021 d_gethostbyaddr_r=undef
14022 gethostbyaddr_r_proto=0
14026 *) gethostbyaddr_r_proto=0
14030 : see if gethostbyname_r exists
14031 set gethostbyname_r d_gethostbyname_r
14033 case "$d_gethostbyname_r" in
14035 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14036 case "$d_gethostbyname_r_proto:$usethreads" in
14037 ":define") d_gethostbyname_r_proto=define
14038 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14042 case "$d_gethostbyname_r_proto" in
14044 case "$gethostbyname_r_proto" in
14045 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14046 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14048 case "$gethostbyname_r_proto" in
14049 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14050 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14052 case "$gethostbyname_r_proto" in
14053 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14054 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14056 case "$gethostbyname_r_proto" in
14057 ''|0) d_gethostbyname_r=undef
14058 gethostbyname_r_proto=0
14059 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14060 * ) case "$gethostbyname_r_proto" in
14061 REENTRANT_PROTO*) ;;
14062 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14064 echo "Prototype: $try" ;;
14067 *) case "$usethreads" in
14068 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14070 d_gethostbyname_r=undef
14071 gethostbyname_r_proto=0
14075 *) gethostbyname_r_proto=0
14079 : see if gethostent_r exists
14080 set gethostent_r d_gethostent_r
14082 case "$d_gethostent_r" in
14084 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14085 case "$d_gethostent_r_proto:$usethreads" in
14086 ":define") d_gethostent_r_proto=define
14087 set d_gethostent_r_proto gethostent_r $hdrs
14091 case "$d_gethostent_r_proto" in
14093 case "$gethostent_r_proto" in
14094 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14095 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14097 case "$gethostent_r_proto" in
14098 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14099 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14101 case "$gethostent_r_proto" in
14102 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14103 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14105 case "$gethostent_r_proto" in
14106 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14107 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14109 case "$gethostent_r_proto" in
14110 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14111 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14113 case "$gethostent_r_proto" in
14114 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14115 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14117 case "$gethostent_r_proto" in
14118 ''|0) d_gethostent_r=undef
14119 gethostent_r_proto=0
14120 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14121 * ) case "$gethostent_r_proto" in
14122 REENTRANT_PROTO*) ;;
14123 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14125 echo "Prototype: $try" ;;
14128 *) case "$usethreads" in
14129 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14131 d_gethostent_r=undef
14132 gethostent_r_proto=0
14136 *) gethostent_r_proto=0
14140 : see if prototypes for various gethostxxx netdb.h functions are available
14142 set d_gethostprotos gethostent $i_netdb netdb.h
14145 : see if getitimer exists
14146 set getitimer d_getitimer
14149 : see if getlogin exists
14150 set getlogin d_getlogin
14153 : see if getlogin_r exists
14154 set getlogin_r d_getlogin_r
14156 case "$d_getlogin_r" in
14158 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14159 case "$d_getlogin_r_proto:$usethreads" in
14160 ":define") d_getlogin_r_proto=define
14161 set d_getlogin_r_proto getlogin_r $hdrs
14165 case "$d_getlogin_r_proto" in
14167 case "$getlogin_r_proto" in
14168 ''|0) try='int getlogin_r(char*, size_t);'
14169 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14171 case "$getlogin_r_proto" in
14172 ''|0) try='int getlogin_r(char*, int);'
14173 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14175 case "$getlogin_r_proto" in
14176 ''|0) try='char* getlogin_r(char*, size_t);'
14177 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14179 case "$getlogin_r_proto" in
14180 ''|0) try='char* getlogin_r(char*, int);'
14181 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14183 case "$getlogin_r_proto" in
14184 ''|0) d_getlogin_r=undef
14186 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14187 * ) case "$getlogin_r_proto" in
14188 REENTRANT_PROTO*) ;;
14189 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14191 echo "Prototype: $try" ;;
14194 *) case "$usethreads" in
14195 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14202 *) getlogin_r_proto=0
14206 : see if getmnt exists
14207 set getmnt d_getmnt
14210 : see if getmntent exists
14211 set getmntent d_getmntent
14214 : see if getnameinfo exists
14215 set getnameinfo d_getnameinfo
14218 : see if getnetbyaddr exists
14219 set getnetbyaddr d_getnbyaddr
14222 : see if getnetbyname exists
14223 set getnetbyname d_getnbyname
14226 : see if getnetent exists
14227 set getnetent d_getnent
14230 : see if getnetbyaddr_r exists
14231 set getnetbyaddr_r d_getnetbyaddr_r
14233 case "$d_getnetbyaddr_r" in
14235 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14236 case "$d_getnetbyaddr_r_proto:$usethreads" in
14237 ":define") d_getnetbyaddr_r_proto=define
14238 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14242 case "$d_getnetbyaddr_r_proto" in
14244 case "$getnetbyaddr_r_proto" in
14245 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14246 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14248 case "$getnetbyaddr_r_proto" in
14249 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14250 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14252 case "$getnetbyaddr_r_proto" in
14253 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14254 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14256 case "$getnetbyaddr_r_proto" in
14257 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14258 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14260 case "$getnetbyaddr_r_proto" in
14261 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14262 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14264 case "$getnetbyaddr_r_proto" in
14265 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14266 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14268 case "$getnetbyaddr_r_proto" in
14269 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14270 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14272 case "$getnetbyaddr_r_proto" in
14273 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14274 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14276 case "$getnetbyaddr_r_proto" in
14277 ''|0) d_getnetbyaddr_r=undef
14278 getnetbyaddr_r_proto=0
14279 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14280 * ) case "$getnetbyaddr_r_proto" in
14281 REENTRANT_PROTO*) ;;
14282 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14284 echo "Prototype: $try" ;;
14287 *) case "$usethreads" in
14288 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14290 d_getnetbyaddr_r=undef
14291 getnetbyaddr_r_proto=0
14295 *) getnetbyaddr_r_proto=0
14299 : see if getnetbyname_r exists
14300 set getnetbyname_r d_getnetbyname_r
14302 case "$d_getnetbyname_r" in
14304 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14305 case "$d_getnetbyname_r_proto:$usethreads" in
14306 ":define") d_getnetbyname_r_proto=define
14307 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14311 case "$d_getnetbyname_r_proto" in
14313 case "$getnetbyname_r_proto" in
14314 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14315 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14317 case "$getnetbyname_r_proto" in
14318 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14319 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14321 case "$getnetbyname_r_proto" in
14322 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14323 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14325 case "$getnetbyname_r_proto" in
14326 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14327 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14329 case "$getnetbyname_r_proto" in
14330 ''|0) d_getnetbyname_r=undef
14331 getnetbyname_r_proto=0
14332 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14333 * ) case "$getnetbyname_r_proto" in
14334 REENTRANT_PROTO*) ;;
14335 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14337 echo "Prototype: $try" ;;
14340 *) case "$usethreads" in
14341 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14343 d_getnetbyname_r=undef
14344 getnetbyname_r_proto=0
14348 *) getnetbyname_r_proto=0
14352 : see if getnetent_r exists
14353 set getnetent_r d_getnetent_r
14355 case "$d_getnetent_r" in
14357 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14358 case "$d_getnetent_r_proto:$usethreads" in
14359 ":define") d_getnetent_r_proto=define
14360 set d_getnetent_r_proto getnetent_r $hdrs
14364 case "$d_getnetent_r_proto" in
14366 case "$getnetent_r_proto" in
14367 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14368 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14370 case "$getnetent_r_proto" in
14371 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14372 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14374 case "$getnetent_r_proto" in
14375 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14376 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14378 case "$getnetent_r_proto" in
14379 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14380 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14382 case "$getnetent_r_proto" in
14383 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14384 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14386 case "$getnetent_r_proto" in
14387 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14388 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14390 case "$getnetent_r_proto" in
14391 ''|0) d_getnetent_r=undef
14392 getnetent_r_proto=0
14393 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14394 * ) case "$getnetent_r_proto" in
14395 REENTRANT_PROTO*) ;;
14396 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14398 echo "Prototype: $try" ;;
14401 *) case "$usethreads" in
14402 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14404 d_getnetent_r=undef
14405 getnetent_r_proto=0
14409 *) getnetent_r_proto=0
14413 : see if prototypes for various getnetxxx netdb.h functions are available
14415 set d_getnetprotos getnetent $i_netdb netdb.h
14418 : see if getpagesize exists
14419 set getpagesize d_getpagsz
14422 : Optional checks for getprotobyname and getprotobynumber
14424 : see if getprotobyname exists
14425 set getprotobyname d_getpbyname
14428 : see if getprotobynumber exists
14429 set getprotobynumber d_getpbynumber
14432 : see if getprotoent exists
14433 set getprotoent d_getpent
14436 : see if getpgid exists
14437 set getpgid d_getpgid
14440 : see if getpgrp2 exists
14441 set getpgrp2 d_getpgrp2
14444 : see if getppid exists
14445 set getppid d_getppid
14448 : see if getpriority exists
14449 set getpriority d_getprior
14452 : see if getprotobyname_r exists
14453 set getprotobyname_r d_getprotobyname_r
14455 case "$d_getprotobyname_r" in
14457 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14458 case "$d_getprotobyname_r_proto:$usethreads" in
14459 ":define") d_getprotobyname_r_proto=define
14460 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14464 case "$d_getprotobyname_r_proto" in
14466 case "$getprotobyname_r_proto" in
14467 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14468 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14470 case "$getprotobyname_r_proto" in
14471 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14472 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14474 case "$getprotobyname_r_proto" in
14475 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14476 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14478 case "$getprotobyname_r_proto" in
14479 ''|0) d_getprotobyname_r=undef
14480 getprotobyname_r_proto=0
14481 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14482 * ) case "$getprotobyname_r_proto" in
14483 REENTRANT_PROTO*) ;;
14484 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14486 echo "Prototype: $try" ;;
14489 *) case "$usethreads" in
14490 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14492 d_getprotobyname_r=undef
14493 getprotobyname_r_proto=0
14497 *) getprotobyname_r_proto=0
14501 : see if getprotobynumber_r exists
14502 set getprotobynumber_r d_getprotobynumber_r
14504 case "$d_getprotobynumber_r" in
14506 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14507 case "$d_getprotobynumber_r_proto:$usethreads" in
14508 ":define") d_getprotobynumber_r_proto=define
14509 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14513 case "$d_getprotobynumber_r_proto" in
14515 case "$getprotobynumber_r_proto" in
14516 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14517 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14519 case "$getprotobynumber_r_proto" in
14520 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14521 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14523 case "$getprotobynumber_r_proto" in
14524 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14525 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14527 case "$getprotobynumber_r_proto" in
14528 ''|0) d_getprotobynumber_r=undef
14529 getprotobynumber_r_proto=0
14530 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14531 * ) case "$getprotobynumber_r_proto" in
14532 REENTRANT_PROTO*) ;;
14533 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14535 echo "Prototype: $try" ;;
14538 *) case "$usethreads" in
14539 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14541 d_getprotobynumber_r=undef
14542 getprotobynumber_r_proto=0
14546 *) getprotobynumber_r_proto=0
14550 : see if getprotoent_r exists
14551 set getprotoent_r d_getprotoent_r
14553 case "$d_getprotoent_r" in
14555 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14556 case "$d_getprotoent_r_proto:$usethreads" in
14557 ":define") d_getprotoent_r_proto=define
14558 set d_getprotoent_r_proto getprotoent_r $hdrs
14562 case "$d_getprotoent_r_proto" in
14564 case "$getprotoent_r_proto" in
14565 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14566 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14568 case "$getprotoent_r_proto" in
14569 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14570 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14572 case "$getprotoent_r_proto" in
14573 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14574 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14576 case "$getprotoent_r_proto" in
14577 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14578 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14580 case "$getprotoent_r_proto" in
14581 ''|0) d_getprotoent_r=undef
14582 getprotoent_r_proto=0
14583 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14584 * ) case "$getprotoent_r_proto" in
14585 REENTRANT_PROTO*) ;;
14586 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14588 echo "Prototype: $try" ;;
14591 *) case "$usethreads" in
14592 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14594 d_getprotoent_r=undef
14595 getprotoent_r_proto=0
14599 *) getprotoent_r_proto=0
14603 : see if prototypes for various getprotoxxx netdb.h functions are available
14605 set d_getprotoprotos getprotoent $i_netdb netdb.h
14608 : see if getprpwnam exists
14609 set getprpwnam d_getprpwnam
14612 : see if getpwent exists
14613 set getpwent d_getpwent
14616 : see if getpwent_r exists
14617 set getpwent_r d_getpwent_r
14619 case "$d_getpwent_r" in
14621 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14622 case "$d_getpwent_r_proto:$usethreads" in
14623 ":define") d_getpwent_r_proto=define
14624 set d_getpwent_r_proto getpwent_r $hdrs
14628 case "$d_getpwent_r_proto" in
14630 case "$getpwent_r_proto" in
14631 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14632 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14634 case "$getpwent_r_proto" in
14635 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14636 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14638 case "$getpwent_r_proto" in
14639 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14640 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14642 case "$getpwent_r_proto" in
14643 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14644 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14646 case "$getpwent_r_proto" in
14647 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14648 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14650 case "$getpwent_r_proto" in
14651 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14652 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14654 case "$getpwent_r_proto" in
14655 ''|0) d_getpwent_r=undef
14657 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14658 * ) case "$getpwent_r_proto" in
14659 REENTRANT_PROTO*) ;;
14660 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14662 echo "Prototype: $try" ;;
14665 *) case "$usethreads" in
14666 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14673 *) getpwent_r_proto=0
14677 : see if getpwnam_r exists
14678 set getpwnam_r d_getpwnam_r
14680 case "$d_getpwnam_r" in
14682 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14683 case "$d_getpwnam_r_proto:$usethreads" in
14684 ":define") d_getpwnam_r_proto=define
14685 set d_getpwnam_r_proto getpwnam_r $hdrs
14689 case "$d_getpwnam_r_proto" in
14691 case "$getpwnam_r_proto" in
14692 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14693 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14695 case "$getpwnam_r_proto" in
14696 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14697 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14699 case "$getpwnam_r_proto" in
14700 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14701 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14703 case "$getpwnam_r_proto" in
14704 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14705 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14707 case "$getpwnam_r_proto" in
14708 ''|0) d_getpwnam_r=undef
14710 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14711 * ) case "$getpwnam_r_proto" in
14712 REENTRANT_PROTO*) ;;
14713 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14715 echo "Prototype: $try" ;;
14718 *) case "$usethreads" in
14719 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14726 *) getpwnam_r_proto=0
14730 : see if getpwuid_r exists
14731 set getpwuid_r d_getpwuid_r
14733 case "$d_getpwuid_r" in
14735 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14736 case "$d_getpwuid_r_proto:$usethreads" in
14737 ":define") d_getpwuid_r_proto=define
14738 set d_getpwuid_r_proto getpwuid_r $hdrs
14742 case "$d_getpwuid_r_proto" in
14744 case "$getpwuid_r_proto" in
14745 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14746 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14748 case "$getpwuid_r_proto" in
14749 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14750 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14752 case "$getpwuid_r_proto" in
14753 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14754 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14756 case "$getpwuid_r_proto" in
14757 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14758 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14760 case "$getpwuid_r_proto" in
14761 ''|0) d_getpwuid_r=undef
14763 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14764 * ) case "$getpwuid_r_proto" in
14765 REENTRANT_PROTO*) ;;
14766 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14768 echo "Prototype: $try" ;;
14771 *) case "$usethreads" in
14772 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14779 *) getpwuid_r_proto=0
14783 : Optional checks for getsbyname and getsbyport
14785 : see if getservbyname exists
14786 set getservbyname d_getsbyname
14789 : see if getservbyport exists
14790 set getservbyport d_getsbyport
14793 : see if getservent exists
14794 set getservent d_getsent
14797 : see if getservbyname_r exists
14798 set getservbyname_r d_getservbyname_r
14800 case "$d_getservbyname_r" in
14802 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14803 case "$d_getservbyname_r_proto:$usethreads" in
14804 ":define") d_getservbyname_r_proto=define
14805 set d_getservbyname_r_proto getservbyname_r $hdrs
14809 case "$d_getservbyname_r_proto" in
14811 case "$getservbyname_r_proto" in
14812 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14813 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14815 case "$getservbyname_r_proto" in
14816 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14817 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14819 case "$getservbyname_r_proto" in
14820 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14821 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14823 case "$getservbyname_r_proto" in
14824 ''|0) d_getservbyname_r=undef
14825 getservbyname_r_proto=0
14826 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14827 * ) case "$getservbyname_r_proto" in
14828 REENTRANT_PROTO*) ;;
14829 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14831 echo "Prototype: $try" ;;
14834 *) case "$usethreads" in
14835 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14837 d_getservbyname_r=undef
14838 getservbyname_r_proto=0
14842 *) getservbyname_r_proto=0
14846 : see if getservbyport_r exists
14847 set getservbyport_r d_getservbyport_r
14849 case "$d_getservbyport_r" in
14851 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14852 case "$d_getservbyport_r_proto:$usethreads" in
14853 ":define") d_getservbyport_r_proto=define
14854 set d_getservbyport_r_proto getservbyport_r $hdrs
14858 case "$d_getservbyport_r_proto" in
14860 case "$getservbyport_r_proto" in
14861 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14862 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14864 case "$getservbyport_r_proto" in
14865 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14866 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14868 case "$getservbyport_r_proto" in
14869 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14870 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14872 case "$getservbyport_r_proto" in
14873 ''|0) d_getservbyport_r=undef
14874 getservbyport_r_proto=0
14875 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14876 * ) case "$getservbyport_r_proto" in
14877 REENTRANT_PROTO*) ;;
14878 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14880 echo "Prototype: $try" ;;
14883 *) case "$usethreads" in
14884 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14886 d_getservbyport_r=undef
14887 getservbyport_r_proto=0
14891 *) getservbyport_r_proto=0
14895 : see if getservent_r exists
14896 set getservent_r d_getservent_r
14898 case "$d_getservent_r" in
14900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14901 case "$d_getservent_r_proto:$usethreads" in
14902 ":define") d_getservent_r_proto=define
14903 set d_getservent_r_proto getservent_r $hdrs
14907 case "$d_getservent_r_proto" in
14909 case "$getservent_r_proto" in
14910 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14911 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14913 case "$getservent_r_proto" in
14914 ''|0) try='int getservent_r(struct servent*, char*, int);'
14915 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14917 case "$getservent_r_proto" in
14918 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14919 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14921 case "$getservent_r_proto" in
14922 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14923 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14925 case "$getservent_r_proto" in
14926 ''|0) d_getservent_r=undef
14927 getservent_r_proto=0
14928 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14929 * ) case "$getservent_r_proto" in
14930 REENTRANT_PROTO*) ;;
14931 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14933 echo "Prototype: $try" ;;
14936 *) case "$usethreads" in
14937 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14939 d_getservent_r=undef
14940 getservent_r_proto=0
14944 *) getservent_r_proto=0
14948 : see if prototypes for various getservxxx netdb.h functions are available
14950 set d_getservprotos getservent $i_netdb netdb.h
14953 : see if getspnam exists
14954 set getspnam d_getspnam
14957 : see if this is a shadow.h system
14958 set shadow.h i_shadow
14961 : see if getspnam_r exists
14962 set getspnam_r d_getspnam_r
14964 case "$d_getspnam_r" in
14966 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14967 case "$d_getspnam_r_proto:$usethreads" in
14968 ":define") d_getspnam_r_proto=define
14969 set d_getspnam_r_proto getspnam_r $hdrs
14973 case "$d_getspnam_r_proto" in
14975 case "$getspnam_r_proto" in
14976 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14977 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14979 case "$getspnam_r_proto" in
14980 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14981 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14983 case "$getspnam_r_proto" in
14984 ''|0) d_getspnam_r=undef
14986 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14987 * ) case "$getspnam_r_proto" in
14988 REENTRANT_PROTO*) ;;
14989 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14991 echo "Prototype: $try" ;;
14994 *) case "$usethreads" in
14995 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15002 *) getspnam_r_proto=0
15006 : see if gettimeofday or ftime exists
15007 set gettimeofday d_gettimeod
15009 case "$d_gettimeod" in
15015 val="$undef"; set d_ftime; eval $setvar
15018 case "$d_gettimeod$d_ftime" in
15021 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15025 : see if gmtime_r exists
15026 set gmtime_r d_gmtime_r
15028 case "$d_gmtime_r" in
15030 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15031 case "$d_gmtime_r_proto:$usethreads" in
15032 ":define") d_gmtime_r_proto=define
15033 set d_gmtime_r_proto gmtime_r $hdrs
15037 case "$d_gmtime_r_proto" in
15039 case "$gmtime_r_proto" in
15040 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15041 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15043 case "$gmtime_r_proto" in
15044 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15045 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15047 case "$gmtime_r_proto" in
15048 ''|0) d_gmtime_r=undef
15050 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15051 * ) case "$gmtime_r_proto" in
15052 REENTRANT_PROTO*) ;;
15053 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15055 echo "Prototype: $try" ;;
15058 *) case "$usethreads" in
15059 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15066 *) gmtime_r_proto=0
15070 : see if hasmntopt exists
15071 set hasmntopt d_hasmntopt
15074 : see if this is a netinet/in.h or sys/in.h system
15075 set netinet/in.h i_niin sys/in.h i_sysin
15078 : see if arpa/inet.h has to be included
15079 set arpa/inet.h i_arpainet
15082 : see if htonl --and friends-- exists
15087 : Maybe they are macros.
15090 $cat >htonl.c <<EOM
15092 #include <sys/types.h>
15093 #$i_niin I_NETINET_IN
15095 #$i_arpainet I_ARPA_INET
15096 #ifdef I_NETINET_IN
15097 #include <netinet/in.h>
15100 #include <sys/in.h>
15103 #include <arpa/inet.h>
15106 printf("Defined as a macro.");
15109 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15110 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15112 echo "But it seems to be defined as a macro." >&4
15120 : see if ilogbl exists
15121 set ilogbl d_ilogbl
15126 if set index val -f; eval $csym; $val; then
15127 if set strchr val -f d_strchr; eval $csym; $val; then
15128 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15131 echo "strchr() found." >&4
15135 echo "index() found." >&4
15140 echo "index() found." >&4
15143 if set strchr val -f d_strchr; eval $csym; $val; then
15146 echo "strchr() found." >&4
15148 echo "No index() or strchr() found!" >&4
15153 set d_strchr; eval $setvar
15155 set d_index; eval $setvar
15157 : check whether inet_aton exists
15158 set inet_aton d_inetaton
15161 : see if inet_ntop exists
15162 set inet_ntop d_inetntop
15165 : see if inet_pton exists
15166 set inet_pton d_inetpton
15171 $cat >isascii.c <<EOCP
15174 #$i_stdlib I_STDLIB
15176 #include <stdlib.h>
15187 if eval $compile; then
15188 echo "isascii() found." >&4
15191 echo "isascii() NOT found." >&4
15200 $cat >isblank.c <<'EOCP'
15211 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15212 echo "isblank() found." >&4
15215 echo "isblank() NOT found." >&4
15222 : see if isfinite exists
15223 set isfinite d_isfinite
15226 : see if isinf exists
15230 : see if isnan exists
15234 : see if isnanl exists
15235 set isnanl d_isnanl
15238 : see if killpg exists
15239 set killpg d_killpg
15242 : see if lchown exists
15244 $cat > try.c <<'EOCP'
15245 /* System header to define __stub macros and hopefully few prototypes,
15246 which can conflict with char lchown(); below. */
15247 #include <assert.h>
15248 /* Override any gcc2 internal prototype to avoid an error. */
15249 /* We use char because int might match the return type of a gcc2
15250 builtin and then its argument prototype would still apply. */
15253 /* The GNU C library defines this for functions which it implements
15254 to always fail with ENOSYS. Some functions are actually named
15255 something starting with __ and the normal name is an alias. */
15256 #if defined (__stub_lchown) || defined (__stub___lchown)
15264 if eval $compile; then
15265 $echo "lchown() found." >&4
15268 $echo "lchown() NOT found." >&4
15274 : See if number of significant digits in a double precision number is known
15276 $cat >ldbl_dig.c <<EOM
15277 #$i_limits I_LIMITS
15280 #include <limits.h>
15286 printf("Contains LDBL_DIG");
15289 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15290 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15291 echo "LDBL_DIG found." >&4
15294 echo "LDBL_DIG NOT found." >&4
15301 : see if this is a math.h system
15305 : check to see if math.h defines _LIB_VERSION
15306 d_libm_lib_version="$undef"
15310 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15312 #include <unistd.h>
15314 int main (int argc, char *argv[])
15316 printf ("%d\n", _LIB_VERSION);
15321 if eval $compile; then
15323 echo "Yes, it does ($foo)" >&4
15324 d_libm_lib_version="$define"
15326 echo "No, it does not (probably harmless)" >&4
15333 : see if link exists
15337 : see if localtime_r exists
15338 set localtime_r d_localtime_r
15340 case "$d_localtime_r" in
15342 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15343 case "$d_localtime_r_proto:$usethreads" in
15344 ":define") d_localtime_r_proto=define
15345 set d_localtime_r_proto localtime_r $hdrs
15349 case "$d_localtime_r_proto" in
15351 case "$localtime_r_proto" in
15352 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15353 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15355 case "$localtime_r_proto" in
15356 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15357 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15359 case "$localtime_r_proto" in
15360 ''|0) d_localtime_r=undef
15361 localtime_r_proto=0
15362 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15363 * ) case "$localtime_r_proto" in
15364 REENTRANT_PROTO*) ;;
15365 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15367 echo "Prototype: $try" ;;
15370 *) case "$usethreads" in
15371 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15373 d_localtime_r=undef
15374 localtime_r_proto=0
15378 *) localtime_r_proto=0
15382 : see if localtime_r calls tzset
15383 case "$localtime_r_proto" in
15386 /* Does our libc's localtime_r call tzset ?
15387 * return 0 if so, 1 otherwise.
15389 #$i_systypes I_SYS_TYPES
15390 #$i_unistd I_UNISTD
15392 #$i_stdlib I_STDLIB
15393 #$i_string I_STRING
15394 #$i_malloc I_MALLOC
15396 # include <sys/types.h>
15399 # include <unistd.h>
15405 #include <stdlib.h>
15408 # include <string.h>
15410 # include <strings.h>
15413 # include <malloc.h>
15417 time_t t = time(0L);
15418 char w_tz[]="TZ" "=GMT+5",
15419 e_tz[]="TZ" "=GMT-5",
15420 *tz_e = (char*)malloc(16),
15421 *tz_w = (char*)malloc(16);
15422 struct tm tm_e, tm_w;
15423 memset(&tm_e,'\0',sizeof(struct tm));
15424 memset(&tm_w,'\0',sizeof(struct tm));
15429 localtime_r(&t, &tm_e);
15432 localtime_r(&t, &tm_w);
15434 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15440 if eval $compile; then
15441 if $run ./try; then
15442 d_localtime_r_needs_tzset=undef;
15444 d_localtime_r_needs_tzset=define;
15447 d_localtime_r_needs_tzset=undef;
15451 d_localtime_r_needs_tzset=undef;
15456 : see if localeconv exists
15457 set localeconv d_locconv
15460 : see if lockf exists
15464 : see if prototype for lseek is available
15466 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15469 : see if lstat exists
15473 : see if madvise exists
15474 set madvise d_madvise
15477 : see if malloc_size exists
15478 set malloc_size d_malloc_size
15481 : see if malloc_size_good exists
15482 set malloc_good_size d_malloc_good_size
15485 : see if mblen exists
15489 : see if mbstowcs exists
15490 set mbstowcs d_mbstowcs
15493 : see if mbtowc exists
15494 set mbtowc d_mbtowc
15497 : see if memchr exists
15498 set memchr d_memchr
15501 : see if memcmp exists
15502 set memcmp d_memcmp
15505 : see if memcpy exists
15506 set memcpy d_memcpy
15509 : see if memmove exists
15510 set memmove d_memmove
15513 : see if memset exists
15514 set memset d_memset
15517 : see if mkdir exists
15521 : see if mkdtemp exists
15522 set mkdtemp d_mkdtemp
15525 : see if mkfifo exists
15526 set mkfifo d_mkfifo
15529 : see if mkstemp exists
15530 set mkstemp d_mkstemp
15533 : see if mkstemps exists
15534 set mkstemps d_mkstemps
15537 : see if mktime exists
15538 set mktime d_mktime
15541 : see if this is a sys/mman.h system
15542 set sys/mman.h i_sysmman
15545 : see if mmap exists
15548 : see what shmat returns
15549 : default to something harmless
15551 case "$i_sysmman$d_mmap" in
15553 $cat >mmap.c <<'END'
15554 #include <sys/mman.h>
15557 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15562 echo "and it returns ($mmaptype)." >&4
15568 : see if sqrtl exists
15572 : see if scalbnl exists
15573 set scalbnl d_scalbnl
15576 : see if modfl exists
15580 : see if prototype for modfl is available
15582 set d_modflproto modfl $i_math math.h
15585 d_modfl_pow32_bug="$undef"
15587 case "$d_longdbl$d_modfl" in
15590 Checking to see whether your modfl() is okay for large values...
15596 if $test "X$d_modflproto" != "X$define"; then
15597 $cat >>try.c <<EOCP
15598 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15599 long double modfl (long double, long double *);
15602 $cat >>try.c <<EOCP
15604 long double nv = 4294967303.15;
15610 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15614 case "$osname:$gccversion" in
15615 aix:) saveccflags="$ccflags"
15616 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15619 if eval $compile; then
15622 *" 4294967303.150000 1.150000 4294967302.000000")
15623 echo >&4 "Your modfl() is broken for large values."
15624 d_modfl_pow32_bug="$define"
15626 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15630 *" 4294967303.150000 0.150000 4294967303.000000")
15631 echo >&4 "Your modfl() seems okay for large values."
15633 *) echo >&4 "I don't understand your modfl() at all."
15639 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15642 case "$osname:$gccversion" in
15643 aix:) ccflags="$saveccflags" ;; # restore
15648 if $test "$uselongdouble" = "$define"; then
15650 if $test "$d_sqrtl" != "$define"; then
15651 message="$message sqrtl"
15653 if $test "$d_modfl" != "$define"; then
15654 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15655 echo "You have both aintl and copysignl, so I can emulate modfl."
15657 message="$message modfl"
15660 if $test "$d_frexpl" != "$define"; then
15661 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15662 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15664 message="$message frexpl"
15668 if $test "$message" != ""; then
15671 *** You requested the use of long doubles but you do not seem to have
15672 *** the following mathematical functions needed for long double support:
15674 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15675 *** Cannot continue, aborting.
15683 : see if mprotect exists
15684 set mprotect d_mprotect
15687 : see if msgctl exists
15688 set msgctl d_msgctl
15691 : see if msgget exists
15692 set msgget d_msgget
15695 : see if msgsnd exists
15696 set msgsnd d_msgsnd
15699 : see if msgrcv exists
15700 set msgrcv d_msgrcv
15703 : see how much of the 'msg*(2)' library is present.
15706 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15707 *"$undef"*) h_msg=false;;
15711 case "`ipcs 2>&1`" in
15712 "SVID messages"*"not configured"*)
15713 echo "Your $osname does not have the msg*(2) configured." >&4
15716 set msgctl d_msgctl
15718 set msgget d_msgget
15720 set msgsnd d_msgsnd
15722 set msgrcv d_msgrcv
15728 : we could also check for sys/ipc.h ...
15729 if $h_msg && $test `./findhdr sys/msg.h`; then
15730 echo "You have the full msg*(2) library." >&4
15733 echo "You don't have the full msg*(2) library." >&4
15739 : Check for msghdr_s
15741 echo "Checking to see if your system supports struct msghdr..." >&4
15742 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15744 case "$d_msghdr_s" in
15745 "$define") echo "Yes, it does." ;;
15746 *) echo "No, it doesn't." ;;
15750 : see if msync exists
15754 : see if munmap exists
15755 set munmap d_munmap
15758 : see if nice exists
15762 : see if this is a langinfo.h system
15763 set langinfo.h i_langinfo
15766 : see if nl_langinfo exists
15767 set nl_langinfo d_nl_langinfo
15770 : check for volatile keyword
15772 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15773 $cat >try.c <<'EOCP'
15776 typedef struct _goo_struct goo_struct;
15777 goo_struct * volatile goo = ((goo_struct *)0);
15778 struct _goo_struct {
15783 typedef unsigned short foo_t;
15784 char *volatile foo;
15786 volatile foo_t blech;
15790 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15792 echo "Yup, it does."
15795 echo "Nope, it doesn't."
15801 : Check basic sizes
15803 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15805 case "$use64bitint:$d_quad:$quadtype" in
15808 uvtype="$uquadtype"
15813 uvtype="unsigned long"
15819 case "$uselongdouble:$d_longdbl" in
15821 nvtype="long double"
15822 nvsize=$longdblsize
15829 $echo "(IV will be "$ivtype", $ivsize bytes)"
15830 $echo "(UV will be "$uvtype", $uvsize bytes)"
15831 $echo "(NV will be "$nvtype", $nvsize bytes)"
15834 #$i_inttypes I_INTTYPES
15836 #include <inttypes.h>
15841 int8_t i = INT8_MAX;
15842 uint8_t u = UINT8_MAX;
15843 printf("int8_t\n");
15846 int16_t i = INT16_MAX;
15847 uint16_t u = UINT16_MAX;
15848 printf("int16_t\n");
15851 int32_t i = INT32_MAX;
15852 uint32_t u = UINT32_MAX;
15853 printf("int32_t\n");
15858 i8type="signed char"
15859 u8type="unsigned char"
15864 '') case "$shortsize" in
15866 u16type="unsigned short"
15874 '') set try -DINT16
15875 if eval $compile; then
15876 case "`$run ./try`" in
15888 '') if $test $shortsize -ge 2; then
15890 u16type="unsigned short"
15898 '') case "$longsize" in
15900 u32type="unsigned long"
15904 *) case "$intsize" in
15906 u32type="unsigned int"
15916 '') set try -DINT32
15917 if eval $compile; then
15918 case "`$run ./try`" in
15930 '') if $test $intsize -ge 4; then
15932 u32type="unsigned int"
15940 '') case "$d_quad:$quadtype" in
15942 i64type="$quadtype"
15943 u64type="$uquadtype"
15951 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15952 : volatile so that the compiler has to store it out to memory.
15953 if test X"$d_volatile" = X"$define"; then
15958 #$i_stdlib I_STDLIB
15960 #include <stdlib.h>
15962 #include <sys/types.h>
15963 #include <signal.h>
15965 $volatile int bletched = 0;
15966 $signal_t blech(int s) { bletched = 1; }
15971 int n = 8 * $uvsize;
15974 signal(SIGFPE, blech);
15977 for (i = 0; i < n; i++) {
15978 u = u << 1 | ($uvtype)1;
15980 if (($uvtype)d != u)
15984 d = ($nvtype)(u - 1);
15985 if (($uvtype)d != (u - 1))
15992 printf("%d\n", ((i == n) ? -n : i));
15998 d_nv_preserves_uv="$undef"
15999 if eval $compile; then
16000 nv_preserves_uv_bits="`$run ./try`"
16002 case "$nv_preserves_uv_bits" in
16004 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16005 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16006 d_nv_preserves_uv="$define"
16008 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16009 d_nv_preserves_uv="$undef" ;;
16010 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16011 nv_preserves_uv_bits="0" ;;
16015 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16016 : volatile so that the compiler has to store it out to memory.
16017 if test X"$d_volatile" = X"$define"; then
16023 typedef $nvtype NV;
16030 while(count < 256) {
16031 $volatile NV up = value + 1.0;
16032 $volatile NV negated = -value;
16033 $volatile NV down = negated - 1.0;
16034 $volatile NV got_up = up - value;
16035 int up_good = got_up == 1.0;
16036 int got_down = down - negated;
16037 int down_good = got_down == -1.0;
16039 if (down_good != up_good) {
16041 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16042 up_good, (double) got_up, down_good, (double) got_down,
16043 count, (double) value);
16050 fputs("256.0", stdout);
16053 fputs("2.0", stdout);
16059 fputs("*", stdout);
16065 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16066 count, (double) value);
16072 nv_overflows_integers_at='0'
16073 if eval $compile; then
16079 The largest integer your NVs can preserve is equal to $xxx
16081 nv_overflows_integers_at="$xxx"
16084 Cannot determine the largest integer value your NVs can hold, unexpected output
16091 Cannot determine the largest integer value your NVs can hold
16098 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16099 : volatile so that the compiler has to store it out to memory.
16100 if test X"$d_volatile" = X"$define"; then
16105 #$i_stdlib I_STDLIB
16107 #include <stdlib.h>
16109 #$i_string I_STRING
16111 # include <string.h>
16113 # include <strings.h>
16115 #include <sys/types.h>
16116 #include <signal.h>
16118 $volatile int bletched = 0;
16119 $signal_t blech(int s) { bletched = 1; }
16122 int checkit($nvtype d, char *where) {
16123 unsigned char *p = (char *)&d;
16124 unsigned char *end = p + sizeof(d);
16134 printf("No - %s: 0x", where);
16136 printf ("%02X", *p++);
16141 int main(int argc, char **argv) {
16144 fail += checkit(d, "0.0");
16146 /* The compiler shouldn't be assuming that bletched is 0 */
16149 fail += checkit(d, "bleched");
16152 signal(SIGFPE, blech);
16155 /* Paranoia - the compiler should have no way of knowing that ANSI says
16156 that argv[argc] will always be NULL. Actually, if it did assume this it
16157 would be buggy, as this is C and main() can be called from elsewhere in
16159 d = argv[argc] ? 1 : 0;
16162 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16165 fail += checkit(d, "ternary");
16167 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16170 printf("No - memset doesn't give 0.0\n");
16171 /* This might just blow up: */
16172 printf("(gives %g)\n", d);
16178 printf("No - something bleched\n");
16183 printf("No - %d fail(s)\n", fail);
16192 d_nv_zero_is_allbits_zero="$undef"
16193 if eval $compile; then
16199 0.0 is represented as all bits zero in memory
16201 d_nv_zero_is_allbits_zero="$define"
16204 0.0 is not represented as all bits zero in memory
16206 d_nv_zero_is_allbits_zero="$undef"
16211 0.0 is not represented as all bits zero in memory
16213 d_nv_zero_is_allbits_zero="$undef"
16219 : check for off64_t
16221 echo "Checking to see if you have off64_t..." >&4
16223 #include <sys/types.h>
16224 #include <unistd.h>
16225 int main() { off64_t x = 7; }
16228 if eval $compile; then
16230 echo "You have off64_t."
16233 echo "You do not have off64_t."
16234 case "$lseeksize" in
16235 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16242 : how to create joinable pthreads
16243 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16245 echo "Checking what constant to use for creating joinable pthreads..." >&4
16246 $cat >try.c <<'EOCP'
16247 #include <pthread.h>
16249 int detachstate = JOINABLE;
16252 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16253 if eval $compile; then
16254 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16255 val="$undef" # Yes, undef.
16256 set d_old_pthread_create_joinable
16259 set old_pthread_create_joinable
16262 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16263 if eval $compile; then
16264 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16266 set d_old_pthread_create_joinable
16268 val=PTHREAD_CREATE_UNDETACHED
16269 set old_pthread_create_joinable
16272 set try -DJOINABLE=__UNDETACHED
16273 if eval $compile; then
16274 echo "You seem to use __UNDETACHED." >&4
16276 set d_old_pthread_create_joinable
16279 set old_pthread_create_joinable
16282 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16284 set d_old_pthread_create_joinable
16287 set old_pthread_create_joinable
16294 d_old_pthread_create_joinable="$undef"
16295 old_pthread_create_joinable=""
16298 : see if pause exists
16302 : see if poll exists
16306 : see if prctl exists
16310 : see if prctl supports PR_SET_NAME
16311 d_prctl_set_name=$undef
16315 #include <sys/prctl.h>
16317 int main (int argc, char *argv[])
16319 return (prctl (PR_SET_NAME, "Test"));
16323 if eval $compile_ok && $run ./try; then
16324 echo "Your prctl (PR_SET_NAME, ...) works"
16325 d_prctl_set_name=$define
16331 : see if readlink exists
16332 set readlink d_readlink
16335 : Check if exe is symlink to abs path of executing program
16339 case "$d_readlink" in
16341 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16342 : more tidy to avoid an extra level of symlink
16343 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16344 while test $# -gt 0; do
16347 if $issymlink $try; then
16348 $ls -l $try > reflect
16349 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16350 echo "You have $type-like $try."
16351 procselfexe='"'$try'"'
16353 : This will break out of the loop
16364 : backward compatibility for d_hvfork
16365 if test X$d_hvfork != X; then
16366 d_vfork="$d_hvfork"
16369 : see if there is a vfork
16374 d_pseudofork=$undef
16376 : Ok, but do we want to use it. vfork is reportedly unreliable in
16377 : perl on Solaris 2.x, and probably elsewhere.
16381 case "$usevfork" in
16387 Perl can only use a vfork() that doesn't suffer from strict
16388 restrictions on calling functions or modifying global data in
16389 the child. For example, glibc-2.1 contains such a vfork()
16390 that is unsuitable. If your system provides a proper fork()
16391 call, chances are that you do NOT want perl to use vfork().
16394 rp="Do you still want to use vfork()?"
16399 echo "Ok, we won't use vfork()."
16408 $define) usevfork='true';;
16409 *) usevfork='false';;
16412 : see whether the pthread_atfork exists
16414 #include <pthread.h>
16417 #ifdef PTHREAD_ATFORK
16418 pthread_atfork(NULL,NULL,NULL);
16423 : see if pthread_atfork exists
16424 set try -DPTHREAD_ATFORK
16425 if eval $compile; then
16430 case "$usethreads" in
16433 $define) echo 'pthread_atfork found.' >&4 ;;
16434 *) echo 'pthread_atfork NOT found.' >&4 ;;
16437 set d_pthread_atfork
16440 : see if pthread_attr_setscope exists
16441 set pthread_attr_setscope d_pthread_attr_setscope
16444 : see whether the various POSIXish _yields exist
16446 #include <pthread.h>
16452 #ifdef PTHREAD_YIELD
16455 #ifdef PTHREAD_YIELD_NULL
16456 pthread_yield(NULL);
16462 : see if sched_yield exists
16463 set try -DSCHED_YIELD
16464 if eval $compile; then
16466 sched_yield='sched_yield()'
16470 case "$usethreads" in
16473 $define) echo 'sched_yield() found.' >&4 ;;
16474 *) echo 'sched_yield() NOT found.' >&4 ;;
16480 : see if pthread_yield exists
16481 set try -DPTHREAD_YIELD
16482 if eval $compile; then
16484 case "$sched_yield" in
16485 '') sched_yield='pthread_yield()' ;;
16488 set try -DPTHREAD_YIELD_NULL
16489 if eval $compile; then
16491 case "$sched_yield" in
16492 '') sched_yield='pthread_yield(NULL)' ;;
16498 case "$usethreads" in
16501 $define) echo 'pthread_yield() found.' >&4 ;;
16502 *) echo 'pthread_yield() NOT found.' >&4 ;;
16506 set d_pthread_yield
16508 case "$sched_yield" in
16509 '') sched_yield=undef ;;
16513 : see if random_r exists
16514 set random_r d_random_r
16516 case "$d_random_r" in
16518 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16519 case "$d_random_r_proto:$usethreads" in
16520 ":define") d_random_r_proto=define
16521 set d_random_r_proto random_r $hdrs
16525 case "$d_random_r_proto" in
16527 case "$random_r_proto" in
16528 ''|0) try='int random_r(int*, struct random_data*);'
16529 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16531 case "$random_r_proto" in
16532 ''|0) try='int random_r(long*, struct random_data*);'
16533 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16535 case "$random_r_proto" in
16536 ''|0) try='int random_r(struct random_data*, int32_t*);'
16537 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16539 case "$random_r_proto" in
16540 ''|0) d_random_r=undef
16542 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16543 * ) case "$random_r_proto" in
16544 REENTRANT_PROTO*) ;;
16545 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16547 echo "Prototype: $try" ;;
16550 *) case "$usethreads" in
16551 define) echo "random_r has no prototype, not using it." >&4 ;;
16558 *) random_r_proto=0
16562 : see if readdir and friends exist
16563 set readdir d_readdir
16565 set seekdir d_seekdir
16567 set telldir d_telldir
16569 set rewinddir d_rewinddir
16572 : see if readdir64_r exists
16573 set readdir64_r d_readdir64_r
16575 case "$d_readdir64_r" in
16577 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16578 case "$d_readdir64_r_proto:$usethreads" in
16579 ":define") d_readdir64_r_proto=define
16580 set d_readdir64_r_proto readdir64_r $hdrs
16584 case "$d_readdir64_r_proto" in
16586 case "$readdir64_r_proto" in
16587 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16588 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16590 case "$readdir64_r_proto" in
16591 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16592 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16594 case "$readdir64_r_proto" in
16595 ''|0) d_readdir64_r=undef
16596 readdir64_r_proto=0
16597 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16598 * ) case "$readdir64_r_proto" in
16599 REENTRANT_PROTO*) ;;
16600 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16602 echo "Prototype: $try" ;;
16605 *) case "$usethreads" in
16606 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16608 d_readdir64_r=undef
16609 readdir64_r_proto=0
16613 *) readdir64_r_proto=0
16617 : see if readdir_r exists
16618 set readdir_r d_readdir_r
16620 case "$d_readdir_r" in
16622 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16623 case "$d_readdir_r_proto:$usethreads" in
16624 ":define") d_readdir_r_proto=define
16625 set d_readdir_r_proto readdir_r $hdrs
16629 case "$d_readdir_r_proto" in
16631 case "$readdir_r_proto" in
16632 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16633 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16635 case "$readdir_r_proto" in
16636 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16637 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16639 case "$readdir_r_proto" in
16640 ''|0) d_readdir_r=undef
16642 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16643 * ) case "$readdir_r_proto" in
16644 REENTRANT_PROTO*) ;;
16645 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16647 echo "Prototype: $try" ;;
16650 *) case "$usethreads" in
16651 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16658 *) readdir_r_proto=0
16662 : see if readv exists
16666 : see if recvmsg exists
16667 set recvmsg d_recvmsg
16670 : see if rename exists
16671 set rename d_rename
16674 : see if rmdir exists
16678 : see if memory.h is available.
16683 : See if it conflicts with string.h
16689 $cppstdin $cppflags $cppminus < $strings > mem.h
16690 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16692 echo "We won't be including <memory.h>."
16702 : can bcopy handle overlapping blocks?
16705 case "$d_memmove" in
16706 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16707 *) case "$d_bcopy" in
16709 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16711 #$i_memory I_MEMORY
16712 #$i_stdlib I_STDLIB
16713 #$i_string I_STRING
16714 #$i_unistd I_UNISTD
16716 $cat >>try.c <<'EOCP'
16719 # include <memory.h>
16722 # include <stdlib.h>
16725 # include <string.h>
16727 # include <strings.h>
16730 # include <unistd.h> /* Needed for NetBSD */
16734 char buf[128], abc[128];
16740 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16741 try to store the string in read-only memory. */
16742 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16744 for (align = 7; align >= 0; align--) {
16745 for (len = 36; len; len--) {
16747 bcopy(abc, b, len);
16748 for (off = 1; off <= len; off++) {
16749 bcopy(b, b+off, len);
16750 bcopy(b+off, b, len);
16751 if (bcmp(b, abc, len))
16760 if eval $compile_ok; then
16761 if $run ./try 2>/dev/null; then
16762 echo "Yes, it can."
16765 echo "It can't, sorry."
16768 echo "(I can't compile the test program, so we'll assume not...)"
16778 : can memcpy handle overlapping blocks?
16781 case "$d_memmove" in
16782 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16783 *) case "$d_memcpy" in
16785 echo "Checking to see if memcpy() can do overlapping copies..." >&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 */
16810 char buf[128], abc[128];
16816 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16817 try to store the string in read-only memory. */
16818 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16820 for (align = 7; align >= 0; align--) {
16821 for (len = 36; len; len--) {
16823 memcpy(b, abc, len);
16824 for (off = 1; off <= len; off++) {
16825 memcpy(b+off, b, len);
16826 memcpy(b, b+off, len);
16827 if (memcmp(b, abc, len))
16836 if eval $compile_ok; then
16837 if $run ./try 2>/dev/null; then
16838 echo "Yes, it can."
16841 echo "It can't, sorry."
16844 echo "(I can't compile the test program, so we'll assume not...)"
16854 : can memcmp be trusted to compare relative magnitude?
16856 case "$d_memcmp" in
16859 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16861 #$i_memory I_MEMORY
16862 #$i_stdlib I_STDLIB
16863 #$i_string I_STRING
16864 #$i_unistd I_UNISTD
16866 $cat >>try.c <<'EOCP'
16869 # include <memory.h>
16872 # include <stdlib.h>
16875 # include <string.h>
16877 # include <strings.h>
16880 # include <unistd.h> /* Needed for NetBSD */
16886 if ((a < b) && memcmp(&a, &b, 1) < 0)
16892 if eval $compile_ok; then
16893 if $run ./try 2>/dev/null; then
16894 echo "Yes, it can."
16897 echo "No, it can't (it uses signed chars)."
16900 echo "(I can't compile the test program, so we'll assume not...)"
16908 : see if prototype for sbrk is available
16910 set d_sbrkproto sbrk $i_unistd unistd.h
16913 : see if select exists
16914 set select d_select
16917 : see if semctl exists
16918 set semctl d_semctl
16921 : see if semget exists
16922 set semget d_semget
16925 : see if semop exists
16929 : see how much of the 'sem*(2)' library is present.
16932 case "$d_semctl$d_semget$d_semop" in
16933 *"$undef"*) h_sem=false;;
16937 case "`ipcs 2>&1`" in
16938 "SVID messages"*"not configured"*)
16939 echo "Your $osname does not have the sem*(2) configured." >&4
16942 set semctl d_semctl
16944 set semget d_semget
16952 : we could also check for sys/ipc.h ...
16953 if $h_sem && $test `./findhdr sys/sem.h`; then
16954 echo "You have the full sem*(2) library." >&4
16957 echo "You don't have the full sem*(2) library." >&4
16963 : see whether sys/sem.h defines union semun
16965 $cat > try.c <<'END'
16966 #include <sys/types.h>
16967 #include <sys/ipc.h>
16968 #include <sys/sem.h>
16969 int main () { union semun semun; semun.buf = 0; }
16972 if eval $compile; then
16973 echo "You have union semun in <sys/sem.h>." >&4
16976 echo "You do not have union semun in <sys/sem.h>." >&4
16983 : see how to do semctl IPC_STAT
16987 $cat > tryh.h <<END
16990 # define S_IRUSR S_IREAD
16991 # define S_IWUSR S_IWRITE
16992 # define S_IXUSR S_IEXEC
16994 # define S_IRUSR 0400
16995 # define S_IWUSR 0200
16996 # define S_IXUSR 0100
16998 # define S_IRGRP (S_IRUSR>>3)
16999 # define S_IWGRP (S_IWUSR>>3)
17000 # define S_IXGRP (S_IXUSR>>3)
17001 # define S_IROTH (S_IRUSR>>6)
17002 # define S_IWOTH (S_IWUSR>>6)
17003 # define S_IXOTH (S_IXUSR>>6)
17006 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17007 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17008 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17011 : see whether semctl IPC_STAT can use union semun
17012 case "$d_semctl_semun" in
17016 #include <sys/types.h>
17017 #include <sys/ipc.h>
17018 #include <sys/sem.h>
17019 #include <sys/stat.h>
17026 #$d_union_semun HAS_UNION_SEMUN
17029 #ifndef HAS_UNION_SEMUN
17032 struct semid_ds *buf;
17033 unsigned short *array;
17039 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17040 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17042 struct semid_ds argbuf;
17045 st = semctl(sem, 0, IPC_STAT, arg);
17049 # endif /* IPC_STAT */
17050 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17052 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17053 # endif /* IPC_RMID */
17054 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17056 #endif /* IPC_PRIVATE && ... */
17057 printf("semget failed: errno = %d\n", errno);
17062 if eval $compile; then
17065 semun) val="$define" ;;
17073 case "$d_semctl_semun" in
17075 echo "You can use union semun for semctl IPC_STAT." >&4
17078 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17083 : see whether semctl IPC_STAT can use struct semid_ds pointer
17084 case "$d_semctl_semid_ds" in
17087 $cat > try.c <<'END'
17088 #include <sys/types.h>
17089 #include <sys/ipc.h>
17090 #include <sys/sem.h>
17091 #include <sys/stat.h>
17099 struct semid_ds arg;
17102 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17103 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17106 st = semctl(sem, 0, IPC_STAT, &arg);
17108 printf("semid_ds\n");
17110 # endif /* IPC_STAT */
17111 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17113 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17114 # endif /* IPC_RMID */
17115 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17117 #endif /* IPC_PRIVATE && ... */
17118 printf("semget failed: errno = %d\n", errno);
17124 if eval $compile; then
17127 semid_ds) val="$define" ;;
17131 set d_semctl_semid_ds
17135 case "$d_semctl_semid_ds" in
17137 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17139 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17145 # We do not have the full sem*(2) library, so assume we can not
17151 set d_semctl_semid_ds
17157 : see if sendmsg exists
17158 set sendmsg d_sendmsg
17161 : see if setegid exists
17162 set setegid d_setegid
17165 : see if seteuid exists
17166 set seteuid d_seteuid
17169 : see if setgrent exists
17170 set setgrent d_setgrent
17173 : see if setgrent_r exists
17174 set setgrent_r d_setgrent_r
17176 case "$d_setgrent_r" in
17178 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17179 case "$d_setgrent_r_proto:$usethreads" in
17180 ":define") d_setgrent_r_proto=define
17181 set d_setgrent_r_proto setgrent_r $hdrs
17185 case "$d_setgrent_r_proto" in
17187 case "$setgrent_r_proto" in
17188 ''|0) try='int setgrent_r(FILE**);'
17189 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17191 case "$setgrent_r_proto" in
17192 ''|0) try='void setgrent_r(FILE**);'
17193 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17195 case "$setgrent_r_proto" in
17196 ''|0) d_setgrent_r=undef
17198 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17199 * ) case "$setgrent_r_proto" in
17200 REENTRANT_PROTO*) ;;
17201 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17203 echo "Prototype: $try" ;;
17206 *) case "$usethreads" in
17207 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17214 *) setgrent_r_proto=0
17218 : see if sethostent exists
17219 set sethostent d_sethent
17222 : see if sethostent_r exists
17223 set sethostent_r d_sethostent_r
17225 case "$d_sethostent_r" in
17227 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17228 case "$d_sethostent_r_proto:$usethreads" in
17229 ":define") d_sethostent_r_proto=define
17230 set d_sethostent_r_proto sethostent_r $hdrs
17234 case "$d_sethostent_r_proto" in
17236 case "$sethostent_r_proto" in
17237 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17238 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17240 case "$sethostent_r_proto" in
17241 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17242 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17244 case "$sethostent_r_proto" in
17245 ''|0) d_sethostent_r=undef
17246 sethostent_r_proto=0
17247 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17248 * ) case "$sethostent_r_proto" in
17249 REENTRANT_PROTO*) ;;
17250 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17252 echo "Prototype: $try" ;;
17255 *) case "$usethreads" in
17256 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17258 d_sethostent_r=undef
17259 sethostent_r_proto=0
17263 *) sethostent_r_proto=0
17267 : see if setitimer exists
17268 set setitimer d_setitimer
17271 : see if setlinebuf exists
17272 set setlinebuf d_setlinebuf
17275 : see if setlocale exists
17276 set setlocale d_setlocale
17279 : see if locale.h is available
17280 set locale.h i_locale
17283 : see if setlocale_r exists
17284 set setlocale_r d_setlocale_r
17286 case "$d_setlocale_r" in
17288 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17289 case "$d_setlocale_r_proto:$usethreads" in
17290 ":define") d_setlocale_r_proto=define
17291 set d_setlocale_r_proto setlocale_r $hdrs
17295 case "$d_setlocale_r_proto" in
17297 case "$setlocale_r_proto" in
17298 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17299 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17301 case "$setlocale_r_proto" in
17302 ''|0) d_setlocale_r=undef
17303 setlocale_r_proto=0
17304 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17305 * ) case "$setlocale_r_proto" in
17306 REENTRANT_PROTO*) ;;
17307 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17309 echo "Prototype: $try" ;;
17312 *) case "$usethreads" in
17313 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17315 d_setlocale_r=undef
17316 setlocale_r_proto=0
17320 *) setlocale_r_proto=0
17324 : see if setnetent exists
17325 set setnetent d_setnent
17328 : see if setnetent_r exists
17329 set setnetent_r d_setnetent_r
17331 case "$d_setnetent_r" in
17333 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17334 case "$d_setnetent_r_proto:$usethreads" in
17335 ":define") d_setnetent_r_proto=define
17336 set d_setnetent_r_proto setnetent_r $hdrs
17340 case "$d_setnetent_r_proto" in
17342 case "$setnetent_r_proto" in
17343 ''|0) try='int setnetent_r(int, struct netent_data*);'
17344 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17346 case "$setnetent_r_proto" in
17347 ''|0) try='void setnetent_r(int, struct netent_data*);'
17348 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17350 case "$setnetent_r_proto" in
17351 ''|0) d_setnetent_r=undef
17352 setnetent_r_proto=0
17353 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17354 * ) case "$setnetent_r_proto" in
17355 REENTRANT_PROTO*) ;;
17356 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17358 echo "Prototype: $try" ;;
17361 *) case "$usethreads" in
17362 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17364 d_setnetent_r=undef
17365 setnetent_r_proto=0
17369 *) setnetent_r_proto=0
17373 : see if setprotoent exists
17374 set setprotoent d_setpent
17377 : see if setpgid exists
17378 set setpgid d_setpgid
17381 : see if setpgrp2 exists
17382 set setpgrp2 d_setpgrp2
17385 : see if setpriority exists
17386 set setpriority d_setprior
17389 : see if setproctitle exists
17390 set setproctitle d_setproctitle
17393 : see if setprotoent_r exists
17394 set setprotoent_r d_setprotoent_r
17396 case "$d_setprotoent_r" in
17398 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17399 case "$d_setprotoent_r_proto:$usethreads" in
17400 ":define") d_setprotoent_r_proto=define
17401 set d_setprotoent_r_proto setprotoent_r $hdrs
17405 case "$d_setprotoent_r_proto" in
17407 case "$setprotoent_r_proto" in
17408 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17409 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17411 case "$setprotoent_r_proto" in
17412 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17413 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17415 case "$setprotoent_r_proto" in
17416 ''|0) d_setprotoent_r=undef
17417 setprotoent_r_proto=0
17418 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17419 * ) case "$setprotoent_r_proto" in
17420 REENTRANT_PROTO*) ;;
17421 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17423 echo "Prototype: $try" ;;
17426 *) case "$usethreads" in
17427 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17429 d_setprotoent_r=undef
17430 setprotoent_r_proto=0
17434 *) setprotoent_r_proto=0
17438 : see if setpwent exists
17439 set setpwent d_setpwent
17442 : see if setpwent_r exists
17443 set setpwent_r d_setpwent_r
17445 case "$d_setpwent_r" in
17447 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17448 case "$d_setpwent_r_proto:$usethreads" in
17449 ":define") d_setpwent_r_proto=define
17450 set d_setpwent_r_proto setpwent_r $hdrs
17454 case "$d_setpwent_r_proto" in
17456 case "$setpwent_r_proto" in
17457 ''|0) try='int setpwent_r(FILE**);'
17458 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17460 case "$setpwent_r_proto" in
17461 ''|0) try='void setpwent_r(FILE**);'
17462 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17464 case "$setpwent_r_proto" in
17465 ''|0) d_setpwent_r=undef
17467 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17468 * ) case "$setpwent_r_proto" in
17469 REENTRANT_PROTO*) ;;
17470 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17472 echo "Prototype: $try" ;;
17475 *) case "$usethreads" in
17476 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17483 *) setpwent_r_proto=0
17487 : see if setregid exists
17488 set setregid d_setregid
17490 set setresgid d_setresgid
17493 : see if setreuid exists
17494 set setreuid d_setreuid
17496 set setresuid d_setresuid
17499 : see if setrgid exists
17500 set setrgid d_setrgid
17503 : see if setruid exists
17504 set setruid d_setruid
17507 : see if setservent exists
17508 set setservent d_setsent
17511 : see if setservent_r exists
17512 set setservent_r d_setservent_r
17514 case "$d_setservent_r" in
17516 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17517 case "$d_setservent_r_proto:$usethreads" in
17518 ":define") d_setservent_r_proto=define
17519 set d_setservent_r_proto setservent_r $hdrs
17523 case "$d_setservent_r_proto" in
17525 case "$setservent_r_proto" in
17526 ''|0) try='int setservent_r(int, struct servent_data*);'
17527 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17529 case "$setservent_r_proto" in
17530 ''|0) try='void setservent_r(int, struct servent_data*);'
17531 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17533 case "$setservent_r_proto" in
17534 ''|0) d_setservent_r=undef
17535 setservent_r_proto=0
17536 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17537 * ) case "$setservent_r_proto" in
17538 REENTRANT_PROTO*) ;;
17539 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17541 echo "Prototype: $try" ;;
17544 *) case "$usethreads" in
17545 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17547 d_setservent_r=undef
17548 setservent_r_proto=0
17552 *) setservent_r_proto=0
17556 : see if setsid exists
17557 set setsid d_setsid
17560 : see if setvbuf exists
17561 set setvbuf d_setvbuf
17564 : see if shmctl exists
17565 set shmctl d_shmctl
17568 : see if shmget exists
17569 set shmget d_shmget
17572 : see if shmat exists
17575 : see what shmat returns
17578 $cat >shmat.c <<'END'
17579 #include <sys/shm.h>
17582 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17587 echo "and it returns ($shmattype)." >&4
17588 : see if a prototype for shmat is available
17589 xxx=`./findhdr sys/shm.h`
17590 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17591 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17602 set d_shmatprototype
17605 : see if shmdt exists
17609 : see how much of the 'shm*(2)' library is present.
17612 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17613 *"$undef"*) h_shm=false;;
17617 case "`ipcs 2>&1`" in
17618 "SVID shared memory"*"not configured"*)
17619 echo "Your $osname does not have the shm*(2) configured." >&4
17622 set shmctl d_shmctl
17624 set shmget d_shmget
17634 : we could also check for sys/ipc.h ...
17635 if $h_shm && $test `./findhdr sys/shm.h`; then
17636 echo "You have the full shm*(2) library." >&4
17639 echo "You don't have the full shm*(2) library." >&4
17645 : see if we have sigaction
17647 if set sigaction val -f d_sigaction; eval $csym; $val; then
17648 echo 'sigaction() found.' >&4
17651 #include <sys/types.h>
17652 #include <signal.h>
17653 #$i_stdlib I_STDLIB
17655 #include <stdlib.h>
17659 struct sigaction act, oact;
17661 oact.sa_handler = 0;
17662 /* so that act and oact are used */
17663 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17667 if eval $compile_ok; then
17670 echo "But you don't seem to have a usable struct sigaction." >&4
17674 echo 'sigaction NOT found.' >&4
17677 set d_sigaction; eval $setvar
17680 : see if this is a sunmath.h system
17681 set sunmath.h i_sunmath
17684 : see if signbit exists
17685 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17688 #$i_sunmath I_SUNMATH
17692 #ifdef I_SUNMATH /* Solaris special math library */
17693 # include <sunmath.h>
17696 int main(int argc, char **argv)
17700 if ((signbit(x) == 0) && (signbit(y) != 0))
17708 if eval $compile; then
17709 if $run ./try; then
17713 $echo "Signbit seems to be available, but doesn't work as I expected."
17714 $echo "I won't use it." >&4
17725 : see if sigprocmask exists
17726 set sigprocmask d_sigprocmask
17729 : see if sigsetjmp exists
17731 case "$d_sigsetjmp" in
17734 #include <setjmp.h>
17735 #$i_stdlib I_STDLIB
17737 #include <stdlib.h>
17743 if (sigsetjmp(env,1))
17746 siglongjmp(env, 1);
17751 if eval $compile; then
17752 if $run ./try >/dev/null 2>&1; then
17753 echo "POSIX sigsetjmp found." >&4
17757 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17763 echo "sigsetjmp not found." >&4
17767 *) val="$d_sigsetjmp"
17768 case "$d_sigsetjmp" in
17769 $define) echo "POSIX sigsetjmp found." >&4;;
17770 $undef) echo "sigsetjmp not found." >&4;;
17778 : see if snprintf exists
17779 set snprintf d_snprintf
17782 : see if vsnprintf exists
17783 set vsnprintf d_vsnprintf
17786 case "$d_snprintf-$d_vsnprintf" in
17789 Checking whether your snprintf() and vsnprintf() work okay...
17791 $cat >try.c <<'EOCP'
17792 /* v?snprintf testing logic courtesy of Russ Allbery.
17793 * According to C99:
17794 * - if the buffer is too short it still must be \0-terminated
17795 * - if the buffer is too short the potentially required length
17796 * must be returned and not -1
17797 * - if the buffer is NULL the potentially required length
17798 * must be returned and not -1 or core dump
17801 #include <stdarg.h>
17805 int test (char *format, ...)
17810 va_start (args, format);
17811 count = vsnprintf (buf, sizeof buf, format, args);
17818 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17819 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17823 if eval $compile; then
17826 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17828 Your snprintf() and snprintf() don't seem to be working okay.
17830 d_snprintf="$undef"
17831 d_vsnprintf="$undef"
17835 echo "(I can't seem to compile the test program--assuming they don't)"
17836 d_snprintf="$undef"
17837 d_vsnprintf="$undef"
17843 : see if sockatmark exists
17844 set sockatmark d_sockatmark
17847 : see if prototype for sockatmark is available
17849 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17852 : see if socks5_init exists
17853 set socks5_init d_socks5_init
17856 : see if sprintf returns the length of the string in the buffer as per ANSI
17857 $echo "Checking whether sprintf returns the length of the string..." >&4
17860 #$i_stdlib I_STDLIB
17862 #include <stdlib.h>
17864 #$i_string I_STRING
17866 # include <string.h>
17868 # include <strings.h>
17877 int check (size_t expect, int test) {
17878 size_t got = strlen(buffer);
17882 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17887 int main(int argc, char **argv) {
17890 check(sprintf(buffer, ""), ++test);
17891 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17892 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17899 if eval $compile; then
17903 sprintf returns the length of the string (as ANSI says it should)
17905 d_sprintf_returns_strlen="$define"
17908 sprintf does not return the length of the string (how old is this system?)
17910 d_sprintf_returns_strlen="$undef"
17914 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17915 d_sprintf_returns_strlen="$undef"
17919 : see if srand48_r exists
17920 set srand48_r d_srand48_r
17922 case "$d_srand48_r" in
17924 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17925 case "$d_srand48_r_proto:$usethreads" in
17926 ":define") d_srand48_r_proto=define
17927 set d_srand48_r_proto srand48_r $hdrs
17931 case "$d_srand48_r_proto" in
17933 case "$srand48_r_proto" in
17934 ''|0) try='int srand48_r(long, struct drand48_data*);'
17935 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17937 case "$srand48_r_proto" in
17938 ''|0) d_srand48_r=undef
17940 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17941 * ) case "$srand48_r_proto" in
17942 REENTRANT_PROTO*) ;;
17943 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17945 echo "Prototype: $try" ;;
17948 *) case "$usethreads" in
17949 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17956 *) srand48_r_proto=0
17960 : see if srandom_r exists
17961 set srandom_r d_srandom_r
17963 case "$d_srandom_r" in
17965 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17966 case "$d_srandom_r_proto:$usethreads" in
17967 ":define") d_srandom_r_proto=define
17968 set d_srandom_r_proto srandom_r $hdrs
17972 case "$d_srandom_r_proto" in
17974 case "$srandom_r_proto" in
17975 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17976 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17978 case "$srandom_r_proto" in
17979 ''|0) d_srandom_r=undef
17981 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17982 * ) case "$srandom_r_proto" in
17983 REENTRANT_PROTO*) ;;
17984 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17986 echo "Prototype: $try" ;;
17989 *) case "$usethreads" in
17990 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17997 *) srandom_r_proto=0
18001 : see if prototype for setresgid is available
18003 set d_sresgproto setresgid $i_unistd unistd.h
18006 : see if prototype for setresuid is available
18008 set d_sresuproto setresuid $i_unistd unistd.h
18011 : see if sys/stat.h is available
18012 set sys/stat.h i_sysstat
18015 : see if stat knows about block sizes
18017 echo "Checking to see if your struct stat has st_blocks field..." >&4
18018 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18021 : see if this is a sys/vfs.h system
18022 set sys/vfs.h i_sysvfs
18025 : see if this is a sys/statfs.h system
18026 set sys/statfs.h i_sysstatfs
18029 : Check for statfs_s
18031 echo "Checking to see if your system supports struct statfs..." >&4
18032 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
18034 case "$d_statfs_s" in
18035 "$define") echo "Yes, it does." ;;
18036 *) echo "No, it doesn't." ;;
18040 : see if struct statfs knows about f_flags
18041 case "$d_statfs_s" in
18044 echo "Checking to see if your struct statfs has f_flags field..." >&4
18045 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
18049 set d_statfs_f_flags
18053 case "$d_statfs_f_flags" in
18054 "$define") echo "Yes, it does." ;;
18055 *) echo "No, it doesn't." ;;
18058 : see what flavor, if any, of static inline is supported
18060 echo "Checking to see if your system supports static inline..."
18061 $cat > try.c <<'EOCP'
18062 #include <stdlib.h>
18063 extern int f_via_a(int x);
18064 extern int f_via_b(int x);
18065 int main(int argc, char **argv)
18074 return EXIT_SUCCESS;
18077 return EXIT_FAILURE;
18081 $cat > a.c <<'EOCP'
18082 static INLINE int f(int x) {
18093 $cat > b.c <<'EOCP'
18094 extern int f(int x);
18102 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18103 case "$perl_static_inline" in
18104 '') # Check the various possibilities, and break out on success.
18105 # For gcc, prefer __inline__, which will still permit
18106 # cflags.SH to add in -ansi.
18107 case "$gccversion" in
18108 '') xxx="inline __inline__ __inline _inline";;
18109 *) xxx="__inline__ inline __inline _inline";;
18111 for inline in $xxx; do
18112 set try -DINLINE=$inline a.c
18113 if eval $compile && $run ./try; then
18114 # Now make sure there is no external linkage of static
18116 set try -DINLINE=$inline -DUSE_B a.c b.c
18117 if eval $compile && $run ./try; then
18118 $echo "Your compiler supports static $inline, " >&4
18119 $echo "but it also creates an external definition," >&4
18120 $echo "so I won't use it." >&4
18123 $echo "Your compiler supports static $inline." >&4
18125 perl_static_inline="static $inline";
18129 $echo "Your compiler does NOT support static $inline." >&4
18134 *inline*) # Some variant of inline exists.
18135 echo "Keeping your $hint value of $perl_static_inline."
18138 static) # No inline capabilities
18139 echo "Keeping your $hint value of $perl_static_inline."
18142 *) # Unrecognized previous value -- blindly trust the supplied
18143 # value and hope it makes sense. Use old value for
18144 # d_static_inline, if there is one.
18145 echo "Keeping your $hint value of $perl_static_inline."
18146 case "$d_static_inline" in
18148 *) val=$d_static_inline ;;
18152 # Fallback to plain 'static' if nothing worked.
18153 case "$perl_static_inline" in
18155 perl_static_inline="static"
18159 set d_static_inline
18161 $rm -f a.[co] b.[co]
18164 : Check stream access
18166 Checking how to access stdio streams by file descriptor number...
18168 case "$stdio_stream_array" in
18169 '') $cat >try.c <<EOCP
18172 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18176 for s in _iob __iob __sF
18178 set try -DSTDIO_STREAM_ARRAY=$s
18179 if eval $compile; then
18180 case "`$run ./try`" in
18181 yes) stdio_stream_array=$s; break ;;
18187 case "$stdio_stream_array" in
18189 I can't figure out how to access stdio streams by file descriptor number.
18191 d_stdio_stream_array="$undef"
18194 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18196 d_stdio_stream_array="$define"
18200 : see if strcoll exists
18201 set strcoll d_strcoll
18204 : check for structure copying
18206 echo "Checking to see if your C compiler can copy structs..." >&4
18207 $cat >try.c <<'EOCP'
18217 if $cc -c try.c >/dev/null 2>&1 ; then
18219 echo "Yup, it can."
18222 echo "Nope, it can't."
18228 : see if strerror and/or sys_errlist[] exist
18230 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18231 if set strerror val -f d_strerror; eval $csym; $val; then
18232 echo 'strerror() found.' >&4
18233 d_strerror="$define"
18234 d_strerrm='strerror(e)'
18235 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18236 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18237 d_syserrlst="$define"
18239 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18240 d_syserrlst="$undef"
18242 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18243 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18244 echo 'strerror() found in string header.' >&4
18245 d_strerror="$define"
18246 d_strerrm='strerror(e)'
18247 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18248 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18249 d_syserrlst="$define"
18251 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18252 d_syserrlst="$undef"
18254 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18255 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18256 d_strerror="$undef"
18257 d_syserrlst="$define"
18258 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18260 echo 'strerror() and sys_errlist[] NOT found.' >&4
18261 d_strerror="$undef"
18262 d_syserrlst="$undef"
18263 d_strerrm='"unknown"'
18267 : see if strerror_r exists
18268 set strerror_r d_strerror_r
18270 case "$d_strerror_r" in
18272 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18273 case "$d_strerror_r_proto:$usethreads" in
18274 ":define") d_strerror_r_proto=define
18275 set d_strerror_r_proto strerror_r $hdrs
18279 case "$d_strerror_r_proto" in
18281 case "$strerror_r_proto" in
18282 ''|0) try='int strerror_r(int, char*, size_t);'
18283 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18285 case "$strerror_r_proto" in
18286 ''|0) try='int strerror_r(int, char*, int);'
18287 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18289 case "$strerror_r_proto" in
18290 ''|0) try='char* strerror_r(int, char*, size_t);'
18291 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18293 case "$strerror_r_proto" in
18294 ''|0) d_strerror_r=undef
18296 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18297 * ) case "$strerror_r_proto" in
18298 REENTRANT_PROTO*) ;;
18299 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18301 echo "Prototype: $try" ;;
18304 *) case "$usethreads" in
18305 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18312 *) strerror_r_proto=0
18316 : see if strftime exists
18317 set strftime d_strftime
18320 : see if strlcat exists
18321 set strlcat d_strlcat
18324 : see if strlcpy exists
18325 set strlcpy d_strlcpy
18328 : see if strtod exists
18329 set strtod d_strtod
18332 : see if strtol exists
18333 set strtol d_strtol
18336 : see if strtold exists
18337 set strtold d_strtold
18340 : see if strtoll exists
18341 set strtoll d_strtoll
18344 case "$d_longlong-$d_strtoll" in
18347 Checking whether your strtoll() works okay...
18349 $cat >try.c <<'EOCP'
18352 #define strtoll __strtoll
18355 #define strtoll _strtoll
18358 extern long long int strtoll(char *s, char **, int);
18359 static int bad = 0;
18360 int check(char *s, long long ell, int een) {
18363 gll = strtoll(s, 0, 10);
18364 if (!((gll == ell) && (errno == een)))
18368 check(" 1", 1LL, 0);
18369 check(" 0", 0LL, 0);
18370 check("-1", -1LL, 0);
18371 check("-9223372036854775808", -9223372036854775808LL, 0);
18372 check("-9223372036854775808", -9223372036854775808LL, 0);
18373 check(" 9223372036854775807", 9223372036854775807LL, 0);
18374 check("-9223372036854775808", -9223372036854775808LL, 0);
18375 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18376 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18382 if eval $compile; then
18385 ok) echo "Your strtoll() seems to be working okay." ;;
18387 Your strtoll() doesn't seem to be working okay.
18393 echo "(I can't seem to compile the test program--assuming it doesn't)"
18399 : see if strtoq exists
18400 set strtoq d_strtoq
18403 : see if strtoul exists
18404 set strtoul d_strtoul
18407 case "$d_strtoul" in
18410 Checking whether your strtoul() works okay...
18412 $cat >try.c <<'EOCP'
18415 extern unsigned long int strtoul(char *s, char **, int);
18416 static int bad = 0;
18417 void check(char *s, unsigned long eul, int een) {
18420 gul = strtoul(s, 0, 10);
18421 if (!((gul == eul) && (errno == een)))
18425 check(" 1", 1L, 0);
18426 check(" 0", 0L, 0);
18428 case "$longsize" in
18430 $cat >>try.c <<'EOCP'
18431 check("18446744073709551615", 18446744073709551615UL, 0);
18432 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18433 #if 0 /* strtoul() for /^-/ strings is undefined. */
18434 check("-1", 18446744073709551615UL, 0);
18435 check("-18446744073709551614", 2, 0);
18436 check("-18446744073709551615", 1, 0);
18437 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18438 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18443 $cat >>try.c <<'EOCP'
18444 check("4294967295", 4294967295UL, 0);
18445 check("4294967296", 4294967295UL, ERANGE);
18446 #if 0 /* strtoul() for /^-/ strings is undefined. */
18447 check("-1", 4294967295UL, 0);
18448 check("-4294967294", 2, 0);
18449 check("-4294967295", 1, 0);
18450 check("-4294967296", 4294967295UL, ERANGE);
18451 check("-4294967297", 4294967295UL, ERANGE);
18456 : Should we write these tests to be more portable by sprintf-ing
18457 : ~0 and then manipulating that char string as input for strtol?
18460 $cat >>try.c <<'EOCP'
18467 if eval $compile; then
18468 case "`$run ./try`" in
18469 ok) echo "Your strtoul() seems to be working okay." ;;
18471 Your strtoul() doesn't seem to be working okay.
18477 echo "(I can't seem to compile the test program--assuming it doesn't)"
18483 : see if strtoull exists
18484 set strtoull d_strtoull
18487 case "$d_longlong-$d_strtoull" in
18490 Checking whether your strtoull() works okay...
18492 $cat >try.c <<'EOCP'
18495 #define strtoull __strtoull
18498 extern unsigned long long int strtoull(char *s, char **, int);
18499 static int bad = 0;
18500 int check(char *s, long long eull, int een) {
18503 gull = strtoull(s, 0, 10);
18504 if (!((gull == eull) && (errno == een)))
18508 check(" 1", 1LL, 0);
18509 check(" 0", 0LL, 0);
18510 check("18446744073709551615", 18446744073709551615ULL, 0);
18511 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18512 #if 0 /* strtoull() for /^-/ strings is undefined. */
18513 check("-1", 18446744073709551615ULL, 0);
18514 check("-18446744073709551614", 2LL, 0);
18515 check("-18446744073709551615", 1LL, 0);
18516 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18517 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18524 if eval $compile; then
18525 case "`$run ./try`" in
18526 ok) echo "Your strtoull() seems to be working okay." ;;
18528 Your strtoull() doesn't seem to be working okay.
18530 d_strtoull="$undef"
18534 echo "(I can't seem to compile the test program--assuming it doesn't)"
18535 d_strtoull="$undef"
18540 : see if strtouq exists
18541 set strtouq d_strtouq
18544 case "$d_strtouq" in
18547 Checking whether your strtouq() works okay...
18549 $cat >try.c <<'EOCP'
18552 extern unsigned long long int strtouq(char *s, char **, int);
18553 static int bad = 0;
18554 void check(char *s, unsigned long long eull, int een) {
18555 unsigned long long gull;
18557 gull = strtouq(s, 0, 10);
18558 if (!((gull == eull) && (errno == een)))
18562 check(" 1", 1LL, 0);
18563 check(" 0", 0LL, 0);
18564 check("18446744073709551615", 18446744073709551615ULL, 0);
18565 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18566 #if 0 /* strtouq() for /^-/ strings is undefined. */
18567 check("-1", 18446744073709551615ULL, 0);
18568 check("-18446744073709551614", 2LL, 0);
18569 check("-18446744073709551615", 1LL, 0);
18570 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18571 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18579 if eval $compile; then
18580 case "`$run ./try`" in
18581 ok) echo "Your strtouq() seems to be working okay." ;;
18583 Your strtouq() doesn't seem to be working okay.
18589 echo "(I can't seem to compile the test program--assuming it doesn't)"
18595 : see if strxfrm exists
18596 set strxfrm d_strxfrm
18599 : see if symlink exists
18600 set symlink d_symlink
18603 : see if syscall exists
18604 set syscall d_syscall
18607 : see if prototype for syscall is available
18609 set d_syscallproto syscall $i_unistd unistd.h
18612 : see if sysconf exists
18613 set sysconf d_sysconf
18616 : see if system exists
18617 set system d_system
18620 : see if tcgetpgrp exists
18621 set tcgetpgrp d_tcgetpgrp
18624 : see if tcsetpgrp exists
18625 set tcsetpgrp d_tcsetpgrp
18628 : see if prototype for telldir is available
18630 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18633 : see if time exists
18635 if test "X$d_time" = X -o X"$timetype" = X; then
18636 if set time val -f d_time; eval $csym; $val; then
18637 echo 'time() found.' >&4
18639 rp="What is the type returned by time() on this system?"
18640 set time_t timetype long stdio.h sys/types.h
18643 echo 'time() not found, hope that will do.' >&4
18651 : see if timegm exists
18652 set timegm d_timegm
18655 : see if this is a sys/times.h system
18656 set sys/times.h i_systimes
18659 : see if times exists
18661 if set times val -f d_times; eval $csym; $val; then
18662 echo 'times() found.' >&4
18665 case "$i_systimes" in
18666 "$define") inc='sys/times.h';;
18668 rp="What is the type returned by times() on this system?"
18669 set clock_t clocktype long stdio.h sys/types.h $inc
18672 echo 'times() NOT found, hope that will do.' >&4
18677 : see if tmpnam_r exists
18678 set tmpnam_r d_tmpnam_r
18680 case "$d_tmpnam_r" in
18682 hdrs="$i_systypes sys/types.h define stdio.h "
18683 case "$d_tmpnam_r_proto:$usethreads" in
18684 ":define") d_tmpnam_r_proto=define
18685 set d_tmpnam_r_proto tmpnam_r $hdrs
18689 case "$d_tmpnam_r_proto" in
18691 case "$tmpnam_r_proto" in
18692 ''|0) try='char* tmpnam_r(char*);'
18693 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18695 case "$tmpnam_r_proto" in
18696 ''|0) d_tmpnam_r=undef
18698 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18699 * ) case "$tmpnam_r_proto" in
18700 REENTRANT_PROTO*) ;;
18701 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18703 echo "Prototype: $try" ;;
18706 *) case "$usethreads" in
18707 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18714 *) tmpnam_r_proto=0
18718 : see if truncate exists
18719 set truncate d_truncate
18722 : see if ttyname_r exists
18723 set ttyname_r d_ttyname_r
18725 case "$d_ttyname_r" in
18727 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18728 case "$d_ttyname_r_proto:$usethreads" in
18729 ":define") d_ttyname_r_proto=define
18730 set d_ttyname_r_proto ttyname_r $hdrs
18734 case "$d_ttyname_r_proto" in
18736 case "$ttyname_r_proto" in
18737 ''|0) try='int ttyname_r(int, char*, size_t);'
18738 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18740 case "$ttyname_r_proto" in
18741 ''|0) try='int ttyname_r(int, char*, int);'
18742 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18744 case "$ttyname_r_proto" in
18745 ''|0) try='char* ttyname_r(int, char*, int);'
18746 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18748 case "$ttyname_r_proto" in
18749 ''|0) d_ttyname_r=undef
18751 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18752 * ) case "$ttyname_r_proto" in
18753 REENTRANT_PROTO*) ;;
18754 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18756 echo "Prototype: $try" ;;
18759 *) case "$usethreads" in
18760 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18767 *) ttyname_r_proto=0
18771 : see if tzname[] exists
18773 if set tzname val -a d_tzname; eval $csym; $val; then
18775 echo 'tzname[] found.' >&4
18778 echo 'tzname[] NOT found.' >&4
18783 : Check if is a multiplatform env
18785 next|darwin) multiarch="$define" ;;
18787 case "$multiarch" in
18788 ''|[nN]*) multiarch="$undef" ;;
18791 : check for ordering of bytes in a UV
18793 case "$multiarch" in
18796 You seem to be doing a multiarchitecture build,
18797 skipping the byteorder check.
18803 case "$byteorder" in
18806 In the following, larger digits indicate more significance. A big-endian
18807 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18808 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18809 machines may have weird orders like 3412. A Cray will report 87654321,
18810 an Alpha will report 12345678. If the test program works the default is
18812 I'm now running the test program...
18816 #$i_stdlib I_STDLIB
18818 #include <stdlib.h>
18820 #include <sys/types.h>
18821 typedef $uvtype UV;
18831 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18833 u.l = (UV)0x04030201;
18834 for (i = 0; i < $uvsize; i++)
18835 printf("%c", u.c[i]+'0');
18842 if eval $compile && $run ./try > /dev/null; then
18845 [1-4][1-4][1-4][1-4]|12345678|87654321)
18846 echo "(The test program ran ok.)"
18847 echo "byteorder=$dflt"
18850 ????|????????) echo "(The test program ran ok.)" ;;
18851 *) echo "(The test program didn't run right for some reason.)" ;;
18856 (I can't seem to compile the test program. Guessing big-endian...)
18859 case "$xxx_prompt" in
18861 rp="What is the order of bytes in $uvtype?"
18874 : Checking 32bit alignedness
18877 Checking to see whether you can access character data unalignedly...
18879 case "$d_u32align" in
18880 '') $cat >try.c <<EOCP
18882 #$i_stdlib I_STDLIB
18884 #include <stdlib.h>
18886 #define U32 $u32type
18887 #define BYTEORDER 0x$byteorder
18889 #include <signal.h>
18891 $signal_t bletch(int s) { exit(4); }
18894 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18895 volatile U8 buf[8];
18899 if (sizeof(U32) != 4) {
18900 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18907 signal(SIGBUS, bletch);
18919 for (i = 0; i < 4; i++) {
18920 up = (U32*)(buf + i);
18921 if (! ((*up == 1 << (8*i)) || /* big-endian */
18922 (*up == 1 << (8*(3-i))) /* little-endian */
18926 printf("read failed (%x)\n", *up);
18932 for (i = 0; i < 4; i++) {
18933 up = (U32*)(buf + i);
18935 if (*up != 0xBeef) {
18936 printf("write failed (%x)\n", *up);
18950 if eval $compile_ok; then
18951 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18952 $run ./try 2>&1 >/dev/null
18955 You can access character data pretty unalignedly.
18957 d_u32align="$undef"
18960 It seems that you must access character data in an aligned manner.
18962 d_u32align="$define"
18966 rp='Can you access character data at unaligned addresses?'
18970 [yY]*) d_u32align="$undef" ;;
18971 *) d_u32align="$define" ;;
18978 : see if ualarm exists
18979 set ualarm d_ualarm
18982 : see if umask exists
18986 : see if unordered exists
18987 set unordered d_unordered
18990 : see if unsetenv exists
18991 set unsetenv d_unsetenv
18994 : see if usleep exists
18995 set usleep d_usleep
18998 : see if prototype for usleep is available
19000 set d_usleepproto usleep $i_unistd unistd.h
19003 : see if ustat exists
19007 : see if closedir exists
19008 set closedir d_closedir
19011 case "$d_closedir" in
19014 echo "Checking whether closedir() returns a status..." >&4
19016 #$i_dirent I_DIRENT /**/
19017 #$i_sysdir I_SYS_DIR /**/
19018 #$i_sysndir I_SYS_NDIR /**/
19019 #$i_systypes I_SYS_TYPES /**/
19021 #if defined(I_SYS_TYPES)
19022 #include <sys/types.h>
19024 #if defined(I_DIRENT)
19025 #include <dirent.h>
19026 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19027 #include <sys/dir.h>
19031 #include <sys/ndir.h>
19035 #include <ndir.h> /* may be wrong in the future */
19037 #include <sys/dir.h>
19042 int main() { return closedir(opendir(".")); }
19045 if eval $compile_ok; then
19046 if $run ./try > /dev/null 2>&1 ; then
19047 echo "Yes, it does."
19050 echo "No, it doesn't."
19054 echo "(I can't seem to compile the test program--assuming it doesn't)"
19062 set d_void_closedir
19066 : see if there is a wait4
19070 : see if waitpid exists
19071 set waitpid d_waitpid
19074 : see if wcstombs exists
19075 set wcstombs d_wcstombs
19078 : see if wctomb exists
19079 set wctomb d_wctomb
19082 : see if writev exists
19083 set writev d_writev
19086 : preserve RCS keywords in files with variable substitution, grrr
19091 Revision='$Revision'
19093 : check for alignment requirements
19095 case "$alignbytes" in
19096 '') echo "Checking alignment constraints..." >&4
19097 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19098 $cat >try.c <<'EOCP'
19099 typedef long double NV;
19102 $cat >try.c <<'EOCP'
19106 $cat >>try.c <<'EOCP'
19114 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19119 if eval $compile_ok; then
19123 echo "(I can't seem to compile the test program...)"
19125 case "$multiarch" in
19127 : The usual safe value is 8, but Darwin with -Duselongdouble
19128 : needs 16. Hence, we will take 8 as a minimum, but allow
19129 : Configure to pick a larger value if needed.
19130 if $test "$dflt" -lt 8; then
19132 echo "Setting alignment to 8 for multiarch support.">&4
19137 *) dflt="$alignbytes"
19140 rp="Doubles must be aligned on a how-many-byte boundary?"
19146 : set the base revision
19149 : Determine if this is an EBCDIC system
19151 echo "Determining whether or not we are on an EBCDIC system..." >&4
19152 $cat >try.c <<'EOM'
19155 if ('M'==0xd4) return 0;
19160 case "$BOOTSTRAP_CHARSET" in
19161 Y|y|define) bootstrap_charset=$define ;;
19162 *) bootstrap_charset=$undef ;;
19167 if eval $compile_ok; then
19168 if $run ./try; then
19169 echo "You seem to speak EBCDIC." >&4
19172 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19175 echo "I'm unable to compile the test program." >&4
19176 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19182 : length of character in bytes. Is always 1, otherwise it is not C
19183 : This used to be a test using sizeof
19186 : Check for the number of bits in a character
19187 case "$charbits" in
19188 '') echo "Checking how long a character is (in bits)..." >&4
19195 for (c = 1, n = 0; c; c <<= 1, n++) ;
19196 printf ("%d\n", n);
19201 if eval $compile_ok; then
19205 echo "(I can't seem to compile the test program. Guessing...)"
19212 rp="What is the length of a character (in bits)?"
19216 case "$charbits" in
19219 Your system has an unsigned character size of $charbits bits, which
19220 is rather unusual (normally it is 8 bits). Perl likely will not work
19221 correctly on your system, with subtle bugs in various places.
19223 rp='Do you really want to continue?'
19227 [yY]) echo >&4 "Okay, continuing." ;;
19232 : how do we concatenate cpp tokens here?
19234 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19235 $cat >cpp_stuff.c <<'EOCP'
19236 #define RCAT(a,b)a/**/b
19237 #define ACAT(a,b)a ## b
19241 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19242 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19243 echo "Oh! Smells like ANSI's been here." >&4
19244 echo "We can catify or stringify, separately or together!"
19246 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19247 echo "Ah, yes! The good old days!" >&4
19248 echo "However, in the good old days we don't know how to stringify and"
19249 echo "catify at the same time."
19253 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19254 You're going to have to edit the values of CAT[2-5] in config.h...
19256 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19260 : see if this is a db.h system
19266 : Check db version.
19268 echo "Checking Berkeley DB version ..." >&4
19274 #include <sys/types.h>
19276 #$i_stdlib I_STDLIB
19278 #include <stdlib.h>
19281 int main(int argc, char *argv[])
19283 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19284 int Major, Minor, Patch ;
19285 unsigned long Version ;
19286 (void)db_version(&Major, &Minor, &Patch) ;
19288 printf("%d %d %d %d %d %d\n",
19289 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19290 Major, Minor, Patch);
19293 printf("You have Berkeley DB Version 2 or greater.\n");
19295 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19296 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19297 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19298 Major, Minor, Patch) ;
19300 /* check that db.h & libdb are compatible */
19301 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19302 printf("db.h and libdb are incompatible.\n") ;
19306 printf("db.h and libdb are compatible.\n") ;
19308 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19309 + DB_VERSION_PATCH ;
19311 /* needs to be >= 2.3.4 */
19312 if (Version < 2003004) {
19313 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19314 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19320 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19325 printf("You have Berkeley DB Version 1.\n");
19326 exit(0); /* DB version < 2: the coast is clear. */
19328 exit(1); /* <db.h> not Berkeley DB? */
19334 if eval $compile_ok && $run ./try; then
19335 echo 'Looks OK.' >&4
19337 db_version_major=$1
19338 db_version_minor=$2
19339 db_version_patch=$3
19341 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19345 : Remove db from list of libraries to use
19346 echo "Removing unusable -ldb from library list" >&4
19347 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19350 echo "libs = $libs" >&4
19360 : Check the return type needed for hash
19362 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19368 #include <sys/types.h>
19371 #ifndef DB_VERSION_MAJOR
19372 u_int32_t hash_cb (ptr, size)
19380 info.hash = hash_cb;
19384 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19385 if $contains warning try.out >>/dev/null 2>&1 ; then
19388 db_hashtype='u_int32_t'
19391 : XXX Maybe we should just give up here.
19392 db_hashtype=u_int32_t
19394 echo "Help: I can't seem to compile the db test program." >&4
19395 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19398 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19400 *) db_hashtype=u_int32_t
19405 : Check the return type needed for prefix
19407 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19413 #include <sys/types.h>
19416 #ifndef DB_VERSION_MAJOR
19417 size_t prefix_cb (key1, key2)
19425 info.prefix = prefix_cb;
19429 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19430 if $contains warning try.out >>/dev/null 2>&1 ; then
19431 db_prefixtype='int'
19433 db_prefixtype='size_t'
19436 db_prefixtype='size_t'
19437 : XXX Maybe we should just give up here.
19439 echo "Help: I can't seem to compile the db test program." >&4
19440 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19443 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19445 *) db_prefixtype='size_t'
19449 : How can we generate normalized random numbers ?
19451 echo "Using our internal random number implementation..." >&4
19454 *-Dmy_rand=*|*-Dmy_srand=*)
19455 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19456 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19457 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19458 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19462 randfunc=Perl_drand48
19463 drand01="Perl_drand48()"
19464 seedfunc="Perl_drand48_init"
19468 : Check how to flush
19471 Checking how to flush all pending stdio output...
19473 # I only know how to find the first 32 possibly open files on SunOS.
19474 # See also hints/sunos_4_1.sh and util.c --AD
19476 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19478 $cat >>try.c <<EOCP
19480 #$i_stdlib I_STDLIB
19482 #include <stdlib.h>
19484 #$i_unistd I_UNISTD
19486 # include <unistd.h>
19488 #$d_sysconf HAS_SYSCONF
19489 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19490 #ifdef HAS_STDIO_STREAM_ARRAY
19491 # define STDIO_STREAM_ARRAY $stdio_stream_array
19496 p = fopen("try.out", "w");
19500 # ifdef TRY_FPRINTF
19504 #ifdef TRY_FFLUSH_NULL
19507 #ifdef TRY_FFLUSH_ALL
19509 long open_max = -1;
19510 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19511 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19513 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19514 open_max = sysconf(_SC_OPEN_MAX);
19517 open_max = FOPEN_MAX;
19520 open_max = OPEN_MAX;
19529 # ifdef HAS_STDIO_STREAM_ARRAY
19530 if (open_max > 0) {
19532 for (i = 0; i < open_max; i++)
19533 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19534 STDIO_STREAM_ARRAY[i]._file < open_max &&
19535 STDIO_STREAM_ARRAY[i]._flag)
19536 fflush(&STDIO_STREAM_ARRAY[i]);
19544 : first we have to find out how _not_ to flush
19546 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19548 set try -DTRY_FPUTC
19549 if eval $compile; then
19550 $run ./try 2>/dev/null
19553 if $test ! -s try.out -a "X$code" = X42; then
19559 set try -DTRY_FPRINTF
19560 if eval $compile; then
19561 $run ./try 2>/dev/null
19564 if $test ! -s try.out -a "X$code" = X42; then
19565 output=-DTRY_FPRINTF
19571 : check for fflush NULL behavior
19572 case "$fflushNULL" in
19573 '') set try -DTRY_FFLUSH_NULL $output
19574 if eval $compile; then
19575 $run ./try 2>/dev/null
19578 if $test -s try.out -a "X$code" = X42; then
19579 fflushNULL="`$cat try.out`"
19581 if $test "X$code" != X42; then
19583 (If this test failed, don't worry, we'll try another method shortly.)
19588 $rm -f core try.core core.try.*
19589 case "$fflushNULL" in
19591 Your fflush(NULL) works okay for output streams.
19592 Let's see if it clobbers input pipes...
19594 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19595 # bug that improperly flushes the input end of pipes. So we avoid the
19596 # autoflush on fork/system/exec support for now. :-(
19597 $cat >tryp.c <<EOCP
19600 main(int argc, char **argv)
19606 while ((i = getc(stdin)) != -1
19607 && (*bp++ = i) != '\n'
19608 && bp < &buf[1024])
19611 fprintf(stdout, "%s", buf);
19619 fflushNULL="$define"
19621 if eval $compile; then
19623 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19624 if $test "X$targethost" != X; then
19626 $run ./tryp \< tryp.c 2>/dev/null > tryp.out
19628 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19630 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19632 fflush(NULL) seems to behave okay with input streams.
19634 fflushNULL="$define"
19637 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19639 fflushNULL="$undef"
19642 $rm -f core tryp.c tryp.core core.tryp.*
19645 Your fflush(NULL) isn't working (contrary to ANSI C).
19647 fflushNULL="$undef"
19650 Cannot figure out whether your fflush(NULL) works or not.
19651 I'm assuming it doesn't (contrary to ANSI C).
19653 fflushNULL="$undef"
19657 $define|true|[yY]*)
19658 fflushNULL="$define"
19661 fflushNULL="$undef"
19664 : check explicit looping only if NULL did not work, and if the pipe
19665 : bug does not show up on an explicit flush too
19666 case "$fflushNULL" in
19668 $cat >tryp.c <<EOCP
19671 main(int argc, char **argv)
19677 while ((i = getc(stdin)) != -1
19678 && (*bp++ = i) != '\n'
19679 && bp < &buf[1024])
19682 fprintf(stdout, "%s", buf);
19691 if eval $compile; then
19693 if $test "X$targethost" != X; then
19695 $run ./tryp \< tryp.c 2>/dev/null > tryp.out
19697 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19699 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19701 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19703 : now check for fflushall behaviour
19704 case "$fflushall" in
19705 '') set try -DTRY_FFLUSH_ALL $output
19706 if eval $compile; then
19708 (Now testing the other method--but note that this also may fail.)
19710 $run ./try 2>/dev/null
19713 if $test -s try.out -a "X$code" = X42; then
19714 fflushall="`$cat try.out`"
19718 case "$fflushall" in
19720 Whew. Flushing explicitly all the stdio streams works.
19722 fflushall="$define"
19725 Sigh. Flushing explicitly all the stdio streams doesn't work.
19730 Cannot figure out whether flushing stdio streams explicitly works or not.
19731 I'm assuming it doesn't.
19737 "$define"|true|[yY]*)
19738 fflushall="$define"
19746 All is futile. Even fflush(stdin) clobbers input pipes!
19753 $rm -f core tryp.c tryp.core core.tryp.*
19755 *) fflushall="$undef"
19759 case "$fflushNULL$fflushall" in
19762 OK, I give up. I cannot figure out how to flush pending stdio output.
19763 We won't be flushing handles at all before fork/exec/popen.
19769 : Store the full pathname to the ar program for use in the C program
19770 : Respect a hint or command line value for full_ar.
19775 : Store the full pathname to the sed program for use in the C program
19778 : see what type gids are declared as in the kernel
19780 echo "Looking for the type for group ids returned by getgid()."
19781 set gid_t gidtype xxx stdio.h sys/types.h
19785 xxx=`./findhdr sys/user.h`
19786 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19788 unsigned) dflt="$1 $2" ;;
19792 *) dflt="$gidtype";;
19795 gid_t) echo "gid_t found." ;;
19796 *) rp="What is the type for group ids returned by getgid()?"
19802 : Check the size of GID
19805 *_t) zzz="$gidtype" ;;
19808 echo "Checking the size of $zzz..." >&4
19810 #include <sys/types.h>
19812 #$i_stdlib I_STDLIB
19814 #include <stdlib.h>
19817 printf("%d\n", (int)sizeof($gidtype));
19822 if eval $compile_ok; then
19826 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19829 echo "Your $zzz is $gidsize bytes long."
19834 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19838 : Check if GID is signed
19841 *_t) zzz="$gidtype" ;;
19844 echo "Checking the sign of $zzz..." >&4
19846 #include <sys/types.h>
19857 if eval $compile; then
19861 echo "(I can't execute the test program--guessing unsigned.)" >&4
19865 1) echo "Your $zzz is unsigned." ;;
19866 -1) echo "Your $zzz is signed." ;;
19872 echo "(I can't compile the test program--guessing unsigned.)" >&4
19876 : Check 64bit sizes
19879 if $test X"$quadtype" != X; then
19881 echo "Checking how to print 64-bit integers..." >&4
19883 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19884 $cat >try.c <<'EOCP'
19885 #include <sys/types.h>
19888 int q = 12345678901;
19889 printf("%ld\n", q);
19893 if eval $compile; then
19897 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19898 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19899 echo "We will use %d."
19905 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19906 $cat >try.c <<'EOCP'
19907 #include <sys/types.h>
19910 long q = 12345678901;
19911 printf("%ld\n", q);
19915 if eval $compile; then
19919 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19920 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19921 echo "We will use %ld."
19927 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19928 $cat >try.c <<'EOCP'
19929 #include <sys/types.h>
19930 #include <inttypes.h>
19933 int64_t q = 12345678901;
19934 printf("%" PRId64 "\n", q);
19938 if eval $compile; then
19942 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19943 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19944 echo "We will use the C9X style."
19950 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19952 #include <sys/types.h>
19955 $quadtype q = 12345678901;
19956 printf("%Ld\n", q);
19960 if eval $compile; then
19964 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19965 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19966 echo "We will use %Ld."
19972 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19973 $cat >try.c <<'EOCP'
19974 #include <sys/types.h>
19977 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19978 printf("%lld\n", q);
19982 if eval $compile; then
19986 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19987 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19988 echo "We will use the %lld style."
19994 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19996 #include <sys/types.h>
19999 $quadtype q = 12345678901;
20000 printf("%qd\n", q);
20004 if eval $compile; then
20008 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20009 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20010 echo "We will use %qd."
20016 if $test X"$sPRId64" = X; then
20017 echo "Cannot figure out how to print 64-bit integers." >&4
20024 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20025 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20027 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20028 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20032 : Check format strings for internal types
20034 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20036 if $test X"$ivsize" = X8; then
20037 ivdformat="$sPRId64"
20038 uvuformat="$sPRIu64"
20039 uvoformat="$sPRIo64"
20040 uvxformat="$sPRIx64"
20041 uvXUformat="$sPRIXU64"
20043 if $test X"$ivsize" = X"$longsize"; then
20050 if $test X"$ivsize" = X"$intsize"; then
20058 if $test X"$ivsize" = X"$shortsize"; then
20069 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20070 nveformat="$sPRIeldbl"
20071 nvfformat="$sPRIfldbl"
20072 nvgformat="$sPRIgldbl"
20073 nvEUformat="$sPRIEUldbl"
20074 nvFUformat="$sPRIFUldbl"
20075 nvGUformat="$sPRIGUldbl"
20085 case "$ivdformat" in
20086 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20091 : Check format string for GID
20094 $echo "Checking the format string to be used for gids..." >&4
20097 -1) if $test X"$gidsize" = X"$ivsize"; then
20098 gidformat="$ivdformat"
20100 if $test X"$gidsize" = X"$longsize"; then
20103 if $test X"$gidsize" = X"$intsize"; then
20106 if $test X"$gidsize" = X"$shortsize"; then
20113 *) if $test X"$gidsize" = X"$uvsize"; then
20114 gidformat="$uvuformat"
20116 if $test X"$gidsize" = X"$longsize"; then
20119 if $test X"$gidsize" = X"$intsize"; then
20122 if $test X"$gidsize" = X"$shortsize"; then
20131 : see if getgroups exists
20132 set getgroups d_getgrps
20135 : see if setgroups exists
20136 set setgroups d_setgrps
20139 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20141 case "$d_getgrps$d_setgrps" in
20143 case "$groupstype" in
20144 '') dflt="$gidtype" ;;
20145 *) dflt="$groupstype" ;;
20148 What type of pointer is the second argument to getgroups() and setgroups()?
20149 Usually this is the same as group ids, $gidtype, but not always.
20152 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20156 *) groupstype="$gidtype";;
20159 : MAD = Misc Attribute Definition
20161 if $test $patchlevel -lt 9; then
20162 : MAD is not available in 5.8.x or earlier.
20166 $define|true|[yY]*) dflt='y' ;;
20171 Would you like to build with Misc Attribute Decoration? This is development
20172 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20173 overhead on the interpreter.
20175 If this doesn't make any sense to you, just accept the default '$dflt'.
20177 rp='Build Perl with MAD?'
20182 madlyh='madly.h madly.act madly.tab'
20184 madlyobj="madly$_o" ;;
20193 : check whether make sets MAKE
20195 echo "Checking if your $make program sets \$(MAKE)..." >&4
20196 case "$make_set_make" in
20198 $sed 's/^X //' > testmake.mak << 'EOF'
20200 X @echo 'maketemp="$(MAKE)"'
20202 case "`$make -f testmake.mak 2>/dev/null`" in
20203 *maketemp=*) make_set_make='#' ;;
20204 *) make_set_make="MAKE=$make" ;;
20206 $rm -f testmake.mak
20209 case "$make_set_make" in
20210 '#') echo "Yup, it does.";;
20211 *) echo "Nope, it doesn't.";;
20214 : see what type is used for mode_t
20215 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20216 set mode_t modetype int stdio.h sys/types.h
20219 : see if we need va_copy
20221 case "$i_stdarg" in
20224 #include <stdarg.h>
20226 #$i_stdlib I_STDLIB
20228 #include <stdlib.h>
20230 #include <signal.h>
20233 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20235 return vfprintf(f, fmt, *valp);
20239 myvfprintf(FILE *f, const char *fmt, va_list val)
20241 return ivfprintf(f, fmt, &val);
20245 myprintf(char *fmt, ...)
20248 va_start(val, fmt);
20249 return myvfprintf(stdout, fmt, val);
20253 main(int ac, char **av)
20255 signal(SIGSEGV, exit);
20257 myprintf("%s%cs all right, then\n", "that", '\'');
20262 if eval $compile && $run ./try 2>&1 >/dev/null; then
20263 case "`$run ./try`" in
20264 "that's all right, then")
20270 yes) echo "It seems that you don't need va_copy()." >&4
20271 need_va_copy="$undef"
20273 *) echo "It seems that va_copy() or similar will be needed." >&4
20274 need_va_copy="$define"
20279 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20280 need_va_copy="$undef"
20284 : see what type is used for size_t
20285 rp="What is the type used for the length parameter for string functions?"
20286 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20289 : check for type of arguments to gethostbyaddr.
20290 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20291 case "$d_gethbyaddr" in
20295 Checking to see what type of arguments are accepted by gethostbyaddr().
20297 hdrs="$define sys/types.h
20298 $d_socket sys/socket.h
20299 $i_niin netinet/in.h
20301 $i_unistd unistd.h"
20302 : The first arg can 'char *' or 'void *'
20303 : The second arg is some of integral type
20304 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20305 for yyy in size_t long int; do
20306 case "$netdb_host_type" in
20307 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20308 if ./protochk "$try" $hdrs; then
20309 echo "Your system accepts $xxx for the first arg."
20310 echo "...and $yyy for the second arg."
20311 netdb_host_type="$xxx"
20312 netdb_hlen_type="$yyy"
20318 : In case none of those worked, prompt the user.
20319 case "$netdb_host_type" in
20320 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20323 netdb_host_type=$ans
20324 rp='What is the type for the 2nd argument to gethostbyaddr?'
20327 netdb_hlen_type=$ans
20331 *) : no gethostbyaddr, so pick harmless defaults
20332 netdb_host_type='char *'
20333 netdb_hlen_type="$sizetype"
20336 # Remove the "const" if needed. -- but then we'll have a
20338 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20341 : check for type of argument to gethostbyname.
20342 if test "X$netdb_name_type" = X ; then
20343 case "$d_gethbyname" in
20347 Checking to see what type of argument is accepted by gethostbyname().
20349 hdrs="$define sys/types.h
20350 $d_socket sys/socket.h
20351 $i_niin netinet/in.h
20353 $i_unistd unistd.h"
20354 for xxx in "const char *" "char *"; do
20355 case "$netdb_name_type" in
20356 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20357 if ./protochk "$try" $hdrs; then
20358 echo "Your system accepts $xxx."
20359 netdb_name_type="$xxx"
20364 : In case none of those worked, prompt the user.
20365 case "$netdb_name_type" in
20366 '') rp='What is the type for the 1st argument to gethostbyname?'
20369 netdb_name_type=$ans
20373 *) : no gethostbyname, so pick harmless default
20374 netdb_name_type='char *'
20379 : check for type of 1st argument to getnetbyaddr.
20380 if test "X$netdb_net_type" = X ; then
20381 case "$d_getnbyaddr" in
20385 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20387 hdrs="$define sys/types.h
20388 $d_socket sys/socket.h
20389 $i_niin netinet/in.h
20391 $i_unistd unistd.h"
20392 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20393 case "$netdb_net_type" in
20394 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20395 if ./protochk "$try" $hdrs; then
20396 echo "Your system accepts $xxx."
20397 netdb_net_type="$xxx"
20402 : In case none of those worked, prompt the user.
20403 case "$netdb_net_type" in
20404 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20407 netdb_net_type=$ans
20411 *) : no getnetbyaddr, so pick harmless default
20412 netdb_net_type='long'
20416 : locate the preferred pager for this system
20423 [a-zA-Z]:/*) dflt=$pg;;
20427 [a-zA-Z]:/*) dflt=$more;;
20431 [a-zA-Z]:/*) dflt=$less;;
20434 '') dflt=/usr/ucb/more;;
20442 rp='What pager is used on your system?'
20446 : see what type pids are declared as in the kernel
20447 rp="What is the type of process ids on this system?"
20448 set pid_t pidtype int stdio.h sys/types.h
20451 : see if ar generates random libraries by itself
20453 echo "Checking how to generate random libraries on your machine..." >&4
20454 echo 'int bar1() { return bar2(); }' > bar1.c
20455 echo 'int bar2() { return 2; }' > bar2.c
20457 #$i_stdlib I_STDLIB
20459 #include <stdlib.h>
20461 int main() { printf("%d\n", bar1()); exit(0); }
20463 $cc $ccflags -c bar1.c >/dev/null 2>&1
20464 $cc $ccflags -c bar2.c >/dev/null 2>&1
20465 $cc $ccflags -c foo.c >/dev/null 2>&1
20466 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20467 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20468 $run ./foobar >/dev/null 2>&1; then
20469 echo "$ar appears to generate random libraries itself."
20471 if [ "X$ranlib" = "X" ]; then
20474 elif $ar s bar$_a >/dev/null 2>&1 &&
20475 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20476 $run ./foobar >/dev/null 2>&1; then
20477 echo "a table of contents needs to be added with '$ar s'."
20480 elif $ar ts bar$_a >/dev/null 2>&1 &&
20481 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20482 $run ./foobar >/dev/null 2>&1; then
20483 echo "a table of contents needs to be added with '$ar ts'."
20490 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20491 $test -f $ranlib || ranlib=''
20494 if $test -n "$ranlib"; then
20495 echo "your system has '$ranlib'; we'll use that."
20498 echo "your system doesn't seem to support random libraries"
20499 echo "so we'll use lorder and tsort to order the libraries."
20506 : see if this is a values.h system
20507 set values.h i_values
20510 : Check the max offset that gmtime and localtime accept
20511 echo "Checking max offsets that gmtime () accepts"
20514 define) yyy="#include <values.h>" ;;
20518 case "$sGMTIME_min/$sGMTIME_max" in
20521 #include <sys/types.h>
20530 void gm_check (time_t t, int min_year, int max_year)
20533 if ( tmp == NULL ||
20534 /* Check tm_year overflow */
20535 tmp->tm_year < min_year || tmp->tm_year > max_year)
20546 gm_check (MAXLONG, 69, 0x7fffffff);
20548 if (tmp == NULL || tmp->tm_year < 0) {
20549 for (i = 63; i >= 0; i--) {
20550 time_t x = pt | ((time_t)1 << i);
20551 if (x < 0 || x < pt) continue;
20552 gm_check (x, 69, 0x7fffffff);
20555 printf ("sGMTIME_max=%ld\n", pt);
20564 gm_check (MINLONG, -1900, 70);
20567 for (i = 36; i >= 0; i--) {
20568 time_t x = pt - ((time_t)1 << i);
20569 if (x > 0) continue;
20570 gm_check (x, -1900, 70);
20573 printf ("sGMTIME_min=%ld\n", pt);
20577 int main (int argc, char *argv[])
20579 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20586 if eval $compile; then
20589 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20595 echo "Checking max offsets that localtime () accepts"
20597 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20600 #include <sys/types.h>
20609 void local_check (time_t t, int min_year, int max_year)
20611 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20614 tmp = localtime (&t);
20615 if ( tmp == NULL ||
20616 /* Check tm_year overflow */
20617 tmp->tm_year < min_year || tmp->tm_year > max_year)
20621 } /* local_check */
20628 local_check (MAXLONG, 69, 0x7fffffff);
20630 if (tmp == NULL || tmp->tm_year < 0) {
20631 for (i = 63; i >= 0; i--) {
20632 time_t x = pt | ((time_t)1 << i);
20633 if (x < 0 || x < pt) continue;
20634 local_check (x, 69, 0x7fffffff);
20637 printf ("sLOCALTIME_max=%ld\n", pt);
20646 local_check (MINLONG, -1900, 70);
20649 for (i = 36; i >= 0; i--) {
20650 time_t x = pt - ((time_t)1 << i);
20651 if (x > 0) continue;
20652 local_check (x, -1900, 70);
20655 printf ("sLOCALTIME_min=%ld\n", pt);
20659 int main (int argc, char *argv[])
20667 if eval $compile; then
20670 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20676 : check for type of arguments to select.
20677 case "$selecttype" in
20678 '') case "$d_select" in
20682 Checking to see what type of arguments are accepted by select().
20684 hdrs="$define sys/types.h
20685 $i_systime sys/time.h
20686 $i_sysselct sys/select.h
20687 $d_socket sys/socket.h"
20688 : The first arg can be int, unsigned, or size_t
20689 : The last arg may or may not be 'const'
20691 : void pointer has been seen but using that
20692 : breaks the selectminbits test
20693 for xxx in 'fd_set *' 'int *'; do
20694 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20695 for tmo in 'struct timeval *' 'const struct timeval *'; do
20697 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20698 if ./protochk "$try" $hdrs; then
20699 echo "Your system accepts $xxx."
20708 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20709 case "$d_fd_set" in
20710 $define) dflt="fd_set *" ;;
20719 *) : no select, so pick a harmless default
20726 : check for the select 'width'
20727 case "$selectminbits" in
20728 '') safebits=`expr $ptrsize \* 8`
20729 case "$d_select" in
20733 Checking to see on how many bits at a time your select() operates...
20736 #include <sys/types.h>
20738 #$i_systime I_SYS_TIME
20739 #$i_systimek I_SYS_TIME_KERNEL
20744 # ifdef I_SYS_TIME_KERNEL
20747 # include <sys/time.h>
20748 # ifdef I_SYS_TIME_KERNEL
20752 #$i_sysselct I_SYS_SELECT
20753 #ifdef I_SYS_SELECT
20754 #include <sys/select.h>
20756 #$d_socket HAS_SOCKET
20758 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20761 #$i_stdlib I_STDLIB
20763 #include <stdlib.h>
20766 #define S sizeof(*(b))
20768 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20769 #define NBITS (NBYTES * 8)
20771 char *s = (char *)malloc(NBYTES);
20780 fp = fopen("try.c", "r");
20786 b = ($selecttype)s;
20787 for (i = 0; i < NBITS; i++)
20791 select(fd + 1, b, 0, 0, &t);
20792 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20794 printf("%d\n", i + 1);
20799 if eval $compile_ok; then
20800 selectminbits=`$run ./try`
20801 case "$selectminbits" in
20803 Cannot figure out on how many bits at a time your select() operates.
20804 I'll play safe and guess it is $safebits bits.
20806 selectminbits=$safebits
20807 bits="$safebits bits"
20810 *) bits="$selectminbits bits" ;;
20812 echo "Your select() operates on $bits at a time." >&4
20814 rp='What is the minimum number of bits your select() operates on?'
20815 case "$byteorder" in
20816 12345678) dflt=64 ;;
20822 selectminbits="$val"
20826 *) : no select, so pick a harmless default
20827 selectminbits=$safebits
20833 : Trace out the files included by signal.h, then look for SIGxxx names.
20834 if [ "X$fieldn" = X ]; then
20835 : Just make some guesses. We check them later.
20836 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
20838 xxx=`echo '#include <signal.h>' |
20839 $cppstdin $cppminus $cppflags 2>/dev/null |
20840 $grep '^[ ]*#.*include' |
20841 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20842 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20845 for xx in $xxx /dev/null ; do
20846 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20848 case "$xxxfiles" in
20849 '') xxxfiles=`./findhdr signal.h` ;;
20852 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20853 print substr($2, 4, 20)
20855 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20856 print substr($3, 4, 20)
20858 : Append some common names just in case the awk scan failed.
20859 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20860 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20861 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20862 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20863 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20865 : generate a few handy files for later
20866 $cat > signal.c <<EOCP
20867 #include <sys/types.h>
20868 #include <signal.h>
20869 #$i_stdlib I_STDLIB
20871 #include <stdlib.h>
20876 /* Strange style to avoid deeply-nested #if/#else/#endif */
20879 # define NSIG (_NSIG)
20885 # define NSIG (SIGMAX+1)
20891 # define NSIG (SIG_MAX+1)
20897 # define NSIG (_SIG_MAX+1)
20903 # define NSIG (MAXSIG+1)
20909 # define NSIG (MAX_SIG+1)
20914 # ifdef SIGARRAYSIZE
20915 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20921 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20925 /* Default to some arbitrary number that's big enough to get most
20926 of the common signals.
20932 printf("NSIG %d\n", NSIG);
20938 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20940 printf "#ifdef SIG"; printf $1; printf "\n"
20941 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20942 printf $1; printf ");\n"
20946 printf "#endif /* JUST_NSIG */\n";
20947 printf "exit(0);\n}\n";
20950 $cat >signal.awk <<'EOP'
20951 BEGIN { ndups = 0 }
20952 $1 ~ /^NSIG$/ { nsig = $2 }
20953 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20954 if ($2 > maxsig) { maxsig = $2 }
20955 if (sig_name[$2]) {
20956 dup_name[ndups] = $1
20957 dup_num[ndups] = $2
20969 printf("NSIG %d\n", nsig);
20970 for (n = 1; n < nsig; n++) {
20972 printf("%s %d\n", sig_name[n], sig_num[n])
20975 printf("NUM%d %d\n", n, n)
20978 for (n = 0; n < ndups; n++) {
20979 printf("%s %d\n", dup_name[n], dup_num[n])
20983 $cat >signal_cmd <<EOS
20985 if $test -s signal.lst; then
20986 echo "Using your existing signal.lst file"
20991 $cat >>signal_cmd <<'EOS'
20994 if eval $compile_ok; then
20995 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20996 $uniq | $awk -f signal.awk >signal.lst
20998 echo "(I can't seem be able to compile the whole test program)" >&4
20999 echo "(I'll try it in little pieces.)" >&4
21000 set signal -DJUST_NSIG
21001 if eval $compile_ok; then
21002 $run ./signal$_exe > signal.nsg
21005 echo "I can't seem to figure out how many signals you have." >&4
21006 echo "Guessing 50." >&4
21007 echo 'NSIG 50' > signal.nsg
21009 : Now look at all the signal names, one at a time.
21010 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21011 $cat > signal.c <<EOCP
21012 #include <sys/types.h>
21013 #include <signal.h>
21016 printf("$xx %d\n", SIG${xx});
21021 if eval $compile; then
21022 echo "SIG${xx} found."
21023 $run ./signal$_exe >> signal.ls1
21025 echo "SIG${xx} NOT found."
21028 if $test -s signal.ls1; then
21029 $cat signal.nsg signal.ls1 |
21030 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21034 if $test -s signal.lst; then
21037 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21038 echo 'kill -l' >signal
21039 set X `csh -f <signal`
21043 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21045 echo $@ | $tr ' ' $trnl | \
21046 $awk '{ printf "%s %d\n", $1, ++s; }
21047 END { printf "NSIG %d\n", ++s }' >signal.lst
21049 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21051 chmod a+x signal_cmd
21052 $eunicefix signal_cmd
21054 : generate list of signal names
21056 case "$sig_name_init" in
21058 *) case "$sig_num_init" in
21059 ''|*,*) doinit=yes ;;
21064 echo "Generating a list of signal names and numbers..." >&4
21066 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21067 sig_name=`$awk 'BEGIN { printf "ZERO " }
21068 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21069 sig_num=`$awk 'BEGIN { printf "0 " }
21070 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21071 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21072 !/^NSIG/ { printf "\"%s\", ", $1 }
21073 END { printf "0\n" }' signal.lst`
21074 sig_num_init=`$awk 'BEGIN { printf "0, " }
21075 !/^NSIG/ { printf "%d, ", $2}
21076 END { printf "0\n"}' signal.lst`
21079 echo "The following $sig_count signals are available:"
21081 echo $sig_name | $awk \
21082 'BEGIN { linelen = 0 }
21084 for (i = 1; i <= NF; i++) {
21085 name = "SIG" $i " "
21086 linelen = linelen + length(name)
21087 if (linelen > 70) {
21089 linelen = length(name)
21095 sig_size=`echo $sig_name | awk '{print NF}'`
21096 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21098 : Check size of size
21100 case "$sizetype" in
21101 *_t) zzz="$sizetype" ;;
21102 *) zzz="filesize" ;;
21104 echo "Checking the size of $zzz..." >&4
21106 #include <sys/types.h>
21108 #$i_stdlib I_STDLIB
21110 #include <stdlib.h>
21113 printf("%d\n", (int)sizeof($sizetype));
21118 if eval $compile_ok; then
21122 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21125 echo "Your $zzz size is $sizesize bytes."
21130 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21134 : check for socklen_t
21136 echo "Checking to see if you have socklen_t..." >&4
21138 #include <sys/types.h>
21139 #$d_socket HAS_SOCKET
21141 #include <sys/socket.h>
21143 int main() { socklen_t x = 16; }
21146 if eval $compile; then
21148 echo "You have socklen_t."
21151 echo "You do not have socklen_t."
21152 case "$sizetype" in
21153 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21160 : see if this is a socks.h system
21161 set socks.h i_socks
21164 : check for type of the size argument to socket calls
21165 case "$d_socket" in
21169 Checking to see what type is the last argument of accept().
21172 case "$d_socklen_t" in
21173 "$define") yyy="$yyy socklen_t"
21175 yyy="$yyy $sizetype int long unsigned"
21176 for xxx in $yyy; do
21177 case "$socksizetype" in
21178 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21179 case "$usesocks" in
21181 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21182 echo "Your system accepts '$xxx *' for the last argument of accept()."
21183 socksizetype="$xxx"
21186 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21187 echo "Your system accepts '$xxx *' for the last argument of accept()."
21188 socksizetype="$xxx"
21195 : In case none of those worked, prompt the user.
21196 case "$socksizetype" in
21197 '') rp='What is the type for socket address structure sizes?'
21204 *) : no sockets, so pick relatively harmless default
21209 : see what type is used for signed size_t
21210 set ssize_t ssizetype int stdio.h sys/types.h
21215 #$i_stdlib I_STDLIB
21217 #include <stdlib.h>
21219 #include <sys/types.h>
21220 #define Size_t $sizetype
21221 #define SSize_t $dflt
21224 if (sizeof(Size_t) == sizeof(SSize_t))
21226 else if (sizeof(Size_t) == sizeof(int))
21235 if eval $compile_ok && $run ./try > /dev/null; then
21236 ssizetype=`$run ./try`
21237 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21240 Help! I can't compile and run the ssize_t test program: please enlighten me!
21241 (This is probably a misconfiguration in your system or libraries, and
21242 you really ought to fix it. Still, I'll try anyway.)
21244 I need a type that is the same size as $sizetype, but is guaranteed to
21245 be signed. Common values are ssize_t, int and long.
21248 rp="What signed type is the same size as $sizetype?"
21254 : Check the size of st_ino
21256 $echo "Checking the size of st_ino..." >&4
21257 $cat > try.c <<EOCP
21258 #include <sys/stat.h>
21260 #$i_stdlib I_STDLIB
21262 #include <stdlib.h>
21266 printf("%d\n", (int)sizeof(st.st_ino));
21271 if eval $compile_ok; then
21275 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21277 *) st_ino_size=$val
21278 $echo "Your st_ino is $st_ino_size bytes long."
21283 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21287 : Check if st_ino is signed
21289 $echo "Checking the sign of st_ino..." >&4
21290 $cat > try.c <<EOCP
21291 #include <sys/stat.h>
21296 if (foo.st_ino < 0)
21303 if eval $compile; then
21307 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21309 *) st_ino_sign=$val
21310 case "$st_ino_sign" in
21311 1) $echo "Your st_ino is unsigned." ;;
21312 -1) $echo "Your st_ino is signed." ;;
21318 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21322 : see what type of char stdio uses.
21324 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21325 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21326 echo "Your stdio uses unsigned chars." >&4
21327 stdchar="unsigned char"
21329 echo "Your stdio uses signed chars." >&4
21334 : see what type uids are declared as in the kernel
21336 echo "Looking for the type for user ids returned by getuid()."
21337 set uid_t uidtype xxx stdio.h sys/types.h
21341 xxx=`./findhdr sys/user.h`
21342 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21344 unsigned) dflt="$1 $2" ;;
21348 *) dflt="$uidtype";;
21351 uid_t) echo "uid_t found." ;;
21352 *) rp="What is the type for user ids returned by getuid()?"
21358 : Check size of UID
21361 *_t) zzz="$uidtype" ;;
21364 echo "Checking the size of $zzz..." >&4
21366 #include <sys/types.h>
21368 #$i_stdlib I_STDLIB
21370 #include <stdlib.h>
21373 printf("%d\n", (int)sizeof($uidtype));
21378 if eval $compile_ok; then
21382 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21385 echo "Your $zzz is $uidsize bytes long."
21390 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21393 : Check if UID is signed
21396 *_t) zzz="$uidtype" ;;
21399 echo "Checking the sign of $zzz..." >&4
21401 #include <sys/types.h>
21412 if eval $compile; then
21416 echo "(I can't execute the test program--guessing unsigned.)" >&4
21420 1) echo "Your $zzz is unsigned." ;;
21421 -1) echo "Your $zzz is signed." ;;
21427 echo "(I can't compile the test program--guessing unsigned.)" >&4
21431 : Check format string for UID
21433 $echo "Checking the format string to be used for uids..." >&4
21436 -1) if $test X"$uidsize" = X"$ivsize"; then
21437 uidformat="$ivdformat"
21439 if $test X"$uidsize" = X"$longsize"; then
21442 if $test X"$uidsize" = X"$intsize"; then
21445 if $test X"$uidsize" = X"$shortsize"; then
21452 *) if $test X"$uidsize" = X"$uvsize"; then
21453 uidformat="$uvuformat"
21455 if $test X"$uidsize" = X"$longsize"; then
21458 if $test X"$uidsize" = X"$intsize"; then
21461 if $test X"$uidsize" = X"$shortsize"; then
21470 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21472 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21473 $cat >try.c <<'EOM'
21474 /* Intentionally a long probe as I'd like to sanity check that the exact
21475 approach is going to work, as thinking it will work, but only having it
21476 part working at runtime is worse than not having it. */
21478 #include <sys/types.h>
21479 #include <sys/sysctl.h>
21480 #include <sys/param.h>
21482 #include <string.h>
21483 #include <stdlib.h>
21484 #include <unistd.h>
21487 main(int argc, char **argv) {
21489 char *argv_leaf = strrchr(argv[0], '/');
21495 mib[1] = KERN_PROC;
21496 mib[2] = KERN_PROC_PATHNAME;
21500 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21504 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21509 if (size < strlen(argv_leaf) + 1) {
21510 fprintf(stderr, "size %lu is too short for a path\n",
21511 (unsigned long) size);
21515 if (size > MAXPATHLEN * MAXPATHLEN) {
21516 fprintf(stderr, "size %lu is too long for a path\n",
21517 (unsigned long) size);
21521 buffer = malloc(size);
21527 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21532 if (strlen(buffer) + 1 != size) {
21533 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21534 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21539 if (*buffer != '/') {
21540 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21544 if (strstr(buffer, "/./")) {
21545 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21549 if (strstr(buffer, "/../")) {
21550 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21554 buffer_leaf = strrchr(buffer, '/');
21555 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21556 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21568 if eval $compile; then
21569 if $run ./try; then
21570 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21573 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21577 echo "I'm unable to compile the test program." >&4
21578 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21582 set usekernprocpathname
21585 : Determine if we can use _NSGetExecutablePath to find executing program
21587 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21588 $cat >try.c <<'EOM'
21589 /* Intentionally a long probe as I'd like to sanity check that the exact
21590 approach is going to work, as thinking it will work, but only having it
21591 part working at runtime is worse than not having it. */
21592 #include <mach-o/dyld.h>
21594 #include <stdlib.h>
21595 #include <sys/param.h>
21596 #include <string.h>
21599 main(int argc, char **argv) {
21601 uint32_t size = sizeof(buf);
21605 char *argv_leaf = strrchr(argv[0], '/');
21609 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21613 _NSGetExecutablePath(buf, &size);
21614 if (size > MAXPATHLEN * MAXPATHLEN) {
21615 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21616 (unsigned int) size);
21620 buffer = malloc(size);
21626 result = _NSGetExecutablePath(buffer, &size);
21628 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21629 result, (unsigned int) size);
21633 tidied = realpath(buffer, NULL);
21635 perror("realpath");
21641 if (*tidied != '/') {
21642 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21646 if (strstr(tidied, "/./")) {
21647 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21651 if (strstr(tidied, "/../")) {
21652 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21656 tidied_leaf = strrchr(tidied, '/');
21657 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21658 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21670 if eval $compile; then
21671 if $run ./try; then
21672 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21675 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21678 echo "I'm unable to compile the test program." >&4
21679 echo "I'll assume no _NSGetExecutablePath here." >&4
21682 set usensgetexecutablepath
21685 : Check if site customization support was requested
21686 case "$usesitecustomize" in
21687 $define|true|[Yy]*)
21688 usesitecustomize="$define"
21691 usesitecustomize="$undef"
21695 : see if prototypes support variable argument declarations
21697 case "$prototype$i_stdarg" in
21699 echo "It appears we'll be able to prototype varargs functions." >&4
21703 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21710 : determine compiler compiler
21719 if $test -f "$byacc$_exe"; then
21721 comp="byacc or $comp"
21723 if $test -f "$bison$_exe"; then
21724 comp="$comp or bison -y"
21726 rp="Which compiler compiler ($comp) shall I use?"
21735 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21741 : see if this is a assert.h system
21742 set assert.h i_assert
21745 : see if this is a fp.h system
21749 : see if this is a fp_class.h system
21750 set fp_class.h i_fp_class
21753 : see if gdbm.h is available
21758 : see if gdbm_open exists
21759 set gdbm_open d_gdbm_open
21761 case "$d_gdbm_open" in
21764 echo "We won't be including <gdbm.h>"
21773 : see if this is a ieeefp.h system
21774 case "$i_ieeefp" in
21775 '' ) set ieeefp.h i_ieeefp
21780 : see if this is a libutil.h system
21781 set libutil.h i_libutil
21784 : see if mach cthreads are available
21785 if test "X$usethreads" = "X$define"; then
21786 set mach/cthreads.h i_machcthr
21789 i_machcthr="$undef"
21792 : see if this is a mntent.h system
21793 set mntent.h i_mntent
21796 : see if net/errno.h is available
21798 set net/errno.h val
21801 : Unfortunately, it causes problems on some systems. Arrgh.
21804 cat > try.c <<'EOM'
21807 #include <net/errno.h>
21813 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21814 echo "We'll be including <net/errno.h>." >&4
21816 echo "We won't be including <net/errno.h>." >&4
21825 : see if netinet/tcp.h is available
21826 set netinet/tcp.h i_netinettcp
21829 : see if this is a poll.h system
21833 : see if this is a prot.h system
21837 : Preprocessor symbols
21839 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21840 $cat <<'EOSH' > Cppsym.know
21841 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21842 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21843 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21844 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21845 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21846 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21847 bull c cadmus clipper CMU COFF COMPILER_VERSION
21848 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21849 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21850 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21851 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21853 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21854 H3050R H3050RX hbullx20 hcx host_mips
21855 hp200 hp300 hp700 HP700 hp800 hp9000
21856 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21857 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21858 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21859 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21860 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21861 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21862 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21863 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21864 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21865 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21866 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21867 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21868 MATH_HAS_NO_SIDE_EFFECTS
21869 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21870 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21871 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21872 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21873 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21874 NetBSD news1500 news1700 news1800 news1900 news3700
21875 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21876 ns32016 ns32332 ns32k nsc32000
21877 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21878 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21879 pc532 pdp11 PGC PIC plexus PORTAR posix
21880 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21881 POSIX_C_SOURCE POSIX_SOURCE POWER
21882 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21883 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21884 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21885 sony sony_news sonyrisc sparc sparclite spectrum
21886 stardent stdc STDC_EXT stratos sun sun3 sun386
21887 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21888 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21889 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21890 sysV68 sysV88 Tek4132 Tek4300 titan
21891 TM3200 TM5400 TM5600
21892 tower tower32 tower32_200 tower32_600 tower32_700
21893 tower32_800 tower32_850 tss
21894 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21895 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21896 unix UNIX95 UNIX99 unixpc unos
21897 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21898 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21899 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21901 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21902 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21903 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21906 # Maybe put other stuff here too.
21907 cat <<EOSH >>Cppsym.know
21910 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21911 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21912 $cat Cppsym.know > Cppsym.c
21913 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21914 $rm -f Cppsym.a Cppsym.b Cppsym.c
21915 cat <<EOSH > Cppsym
21917 if $test \$# -gt 0; then
21918 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21919 if $test -s Cppsym.got; then
21926 $tr " " "$trnl" | ./Cppsym.try
21932 cat <<EOSH > Cppsym.try
21934 cat <<'EOCP' > try.c
21937 #define STRINGIFY(a) "a"
21939 #if cpp_stuff == 42
21940 #define StGiFy(a) #a
21941 #define STRINGIFY(a) StGiFy(a)
21943 #if $cpp_stuff != 1 && $cpp_stuff != 42
21944 # include "Bletch: How does this C preprocessor stringify macros?"
21950 cat <<'EOSH' >> Cppsym.try
21952 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21953 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21954 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21955 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21957 echo 'return 0;}' >> try.c
21959 cat <<EOSH >> Cppsym.try
21961 case "$osname-$gccversion" in
21962 irix-) ccflags="\$ccflags -woff 1178" ;;
21963 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21965 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21967 chmod +x Cppsym.try
21968 $eunicefix Cppsym.try
21969 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21970 : Add in any Linux cpp "predefined macros":
21971 case "$osname::$gccversion" in
21972 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21974 rm -f $tHdrH'.h' $tHdrH
21976 # Filter out macro arguments, such as Linux's __INT8_C(c)
21977 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21978 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21979 if [ -s $tHdrH'_cppsym.real' ]; then
21980 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21983 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21986 : now check the C compiler for additional symbols
21987 postprocess_cc_v=''
21989 aix) postprocess_cc_v="|$tr , ' '" ;;
21996 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21999 -D*) echo "\$i" | $sed 's/^-D//';;
22000 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22005 postprocess_cc_v=''
22008 ./ccsym > ccsym1.raw
22009 if $test -s ccsym1.raw; then
22010 $sort ccsym1.raw | $uniq >ccsym.raw
22012 mv ccsym1.raw ccsym.raw
22015 $awk '/\=/ { print $0; next }
22016 { print $0"=1" }' ccsym.raw >ccsym.list
22017 $comm -13 Cppsym.true ccsym.list >ccsym.own
22018 $comm -12 Cppsym.true ccsym.list >ccsym.com
22019 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22021 if $test -z ccsym.raw; then
22022 echo "Your C compiler doesn't seem to define any symbols!" >&4
22024 echo "However, your C preprocessor defines the following symbols:"
22027 cppsymbols=`$cat Cppsym.true`
22028 cppsymbols=`echo $cppsymbols`
22029 cppccsymbols="$cppsymbols"
22031 if $test -s ccsym.com; then
22032 echo "Your C compiler and pre-processor define these symbols:"
22033 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22036 cppccsymbols=`$cat ccsym.com`
22037 cppccsymbols=`echo $cppccsymbols`
22038 $test "$silent" || sleep 1
22040 if $test -s ccsym.cpp; then
22041 $test "$also" && echo " "
22042 echo "Your C pre-processor ${also}defines the following symbols:"
22043 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22045 cppsymbols=`$cat ccsym.cpp`
22046 cppsymbols=`echo $cppsymbols`
22047 $test "$silent" || sleep 1
22049 if $test -s ccsym.own; then
22050 $test "$also" && echo " "
22051 echo "Your C compiler ${also}defines the following cpp symbols:"
22052 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22053 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22054 ccsymbols=`$cat ccsym.own`
22055 ccsymbols=`echo $ccsymbols`
22056 $test "$silent" || sleep 1
22060 : see if this is a termio system
22064 if $test `./findhdr termios.h`; then
22065 set tcsetattr i_termios
22071 "$define") echo "You have POSIX termios.h... good!" >&4;;
22072 *) if ./Cppsym pyr; then
22073 case "`$run /bin/universe`" in
22074 ucb) if $test `./findhdr sgtty.h`; then
22076 echo "<sgtty.h> found." >&4
22078 echo "System is pyramid with BSD universe."
22079 ./warn "<sgtty.h> not found--you could have problems."
22081 *) if $test `./findhdr termio.h`; then
22083 echo "<termio.h> found." >&4
22085 echo "System is pyramid with USG universe."
22086 ./warn "<termio.h> not found--you could have problems."
22090 if $test `./findhdr termio.h`; then
22091 echo "<termio.h> found." >&4
22093 elif $test `./findhdr sgtty.h`; then
22094 echo "<sgtty.h> found." >&4
22097 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22100 if $test `./findhdr sgtty.h`; then
22101 echo "<sgtty.h> found." >&4
22103 elif $test `./findhdr termio.h`; then
22104 echo "<termio.h> found." >&4
22107 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22111 set i_termio; eval $setvar
22112 val=$val2; set i_sgtty; eval $setvar
22113 val=$val3; set i_termios; eval $setvar
22115 : see if stdbool is available
22116 : we want a real compile instead of Inhdr because some Solaris systems
22117 : have stdbool.h, but it can only be used if the compiler indicates it
22118 : is sufficiently c99-compliant.
22122 #include <stdbool.h>
22127 int main(int argc, char **argv)
22133 if eval $compile; then
22134 echo "<stdbool.h> found." >&4
22137 echo "<stdbool.h> NOT found." >&4
22144 : see if stddef is available
22145 set stddef.h i_stddef
22148 : see if sys/access.h is available
22149 set sys/access.h i_sysaccess
22152 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22153 set sys/filio.h i_sysfilio
22156 if $test `./findhdr sys/ioctl.h`; then
22158 echo '<sys/ioctl.h> found.' >&4
22161 if $test $i_sysfilio = "$define"; then
22162 echo '<sys/ioctl.h> NOT found.' >&4
22164 $test $i_sgtty = "$define" && xxx="sgtty.h"
22165 $test $i_termio = "$define" && xxx="termio.h"
22166 $test $i_termios = "$define" && xxx="termios.h"
22167 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22173 : see if socket ioctl defs are in sys/sockio.h
22175 xxx=`./findhdr sys/sockio.h`
22176 if $test "$xxx"; then
22177 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22179 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22182 echo "No socket ioctls found in <sys/sockio.h>." >&4
22187 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22193 : see if this is a syslog.h system
22194 set syslog.h i_syslog
22197 : see if this is a sys/mode.h system
22198 set sys/mode.h i_sysmode
22201 : see if there is a sys/poll.h file
22202 set sys/poll.h i_syspoll
22205 : see if sys/resource.h has to be included
22206 set sys/resource.h i_sysresrc
22209 : see if sys/security.h is available
22210 set sys/security.h i_syssecrt
22213 : see if this is a sys/statvfs.h system
22214 set sys/statvfs.h i_sysstatvfs
22217 : see if this is a sys/un.h system
22218 set sys/un.h i_sysun
22221 : see if this is a sys/utsname.h system
22222 set sys/utsname.h i_sysutsname
22225 : see if this is a syswait system
22226 set sys/wait.h i_syswait
22229 : see if this is a ustat.h system
22230 set ustat.h i_ustat
22233 : see if this is an utime system
22234 set utime.h i_utime
22237 : see if this is a vfork system
22240 set vfork.h i_vfork
22250 echo "Looking for extensions..." >&4
22251 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22252 : contain old or inaccurate or duplicate values.
22253 nonxs_extensions=''
22255 : We do not use find because it might not be available.
22256 : We do not just use MANIFEST because the user may have dropped
22257 : some additional extensions into the source tree and expect them
22260 : Function to recursively find available extensions, ignoring DynaLoader
22261 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22262 : In 5.10.1 and later, extensions are stored in directories
22263 : like File-Glob instead of the older File/Glob/.
22267 DynaLoader|dynaload) ;;
22269 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22270 case "$this_ext" in
22271 Scalar/List/Utils) this_ext="List/Util" ;;
22272 PathTools) this_ext="Cwd" ;;
22274 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22275 if $contains " $this_ext " $$.tmp; then
22277 echo "Duplicate directories detected for extension $xxx" >&4;
22278 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22279 case "$knowitall" in
22287 echo "Ok. Stopping Configure." >&4;
22288 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22291 echo "Ok. You will need to correct config.sh before running make." >&4;
22293 $ls -1 $xxx > $$.tmp;
22294 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22295 xs_extensions="$xs_extensions $this_ext";
22296 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22297 xs_extensions="$xs_extensions $this_ext";
22298 elif $test -d $xxx; then
22299 nonxs_extensions="$nonxs_extensions $this_ext";
22309 eval $find_extensions
22313 eval $find_extensions
22317 eval $find_extensions
22318 set X $xs_extensions
22320 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22321 set X $nonxs_extensions
22323 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22325 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22327 : Now see which are supported on this system.
22329 for xxx in $xs_extensions ; do
22333 $define) avail_ext="$avail_ext $xxx" ;;
22336 GDBM_File|gdbm_fil)
22338 $define) avail_ext="$avail_ext $xxx" ;;
22341 I18N/Langinfo|i18n_lan)
22342 case "$i_langinfo$d_nl_langinfo" in
22343 $define$define) avail_ext="$avail_ext $xxx" ;;
22347 : XXX Do we need a useipcsysv variable here
22348 case "${d_msg}${d_sem}${d_shm}" in
22349 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22352 NDBM_File|ndbm_fil)
22355 case "$osname-$use64bitint" in
22358 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22361 *) avail_ext="$avail_ext $xxx" ;;
22366 ODBM_File|odbm_fil)
22367 case "${i_dbm}${i_rpcsvcdbm}" in
22369 case "$d_cplusplus" in
22370 define) ;; # delete as a function name will not work
22371 *) case "$osname-$use64bitint" in
22374 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22377 *) avail_ext="$avail_ext $xxx" ;;
22385 case "$useopcode" in
22386 true|define|y) avail_ext="$avail_ext $xxx" ;;
22390 case "$useposix" in
22391 true|define|y) avail_ext="$avail_ext $xxx" ;;
22395 case "$d_socket" in
22396 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22399 Sys/Syslog|sys/syslog)
22400 : XXX syslog requires socket
22401 case "$d_socket" in
22402 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22406 case "$usethreads" in
22408 case "$use5005threads" in
22409 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22413 threads|threads/shared)
22414 # threads and threads::shared are special cases.
22415 # To stop people from asking "Perl 5.8.0 was supposed
22416 # to have this new fancy threads implementation but my
22417 # perl doesn't have it" and from people trying to
22418 # (re)install the threads module using CPAN.pm and
22419 # CPAN.pm then offering to reinstall Perl 5.8.0,
22420 # the threads.pm and threads/shared.pm will always be
22421 # there, croaking informatively ("you need to rebuild
22422 # all of Perl with threads, sorry") when threads haven't
22423 # been compiled in.
22425 avail_ext="$avail_ext $xxx"
22431 cygwin) avail_ext="$avail_ext $xxx" ;;
22434 XS/APItest|xs/apitest)
22435 # This is just for testing. Skip it unless we have dynamic loading.
22438 $define) avail_ext="$avail_ext $xxx" ;;
22441 XS/Typemap|xs/typemap)
22442 # This is just for testing. Skip it unless we have dynamic loading.
22444 $define) avail_ext="$avail_ext $xxx" ;;
22447 *) avail_ext="$avail_ext $xxx"
22456 case "$onlyextensions" in
22458 *) keepextensions=''
22459 echo "You have requested that only certain extensions be included..." >&4
22460 for i in $onlyextensions; do
22461 case " $avail_ext " in
22463 echo "Keeping extension $i."
22464 keepextensions="$keepextensions $i"
22466 *) echo "Ignoring extension $i." ;;
22469 avail_ext="$keepextensions"
22473 case "$noextensions" in
22475 *) keepextensions=''
22476 echo "You have requested that certain extensions be ignored..." >&4
22477 for i in $avail_ext; do
22478 case " $noextensions " in
22479 *" $i "*) echo "Ignoring extension $i." ;;
22480 *) echo "Keeping extension $i.";
22481 keepextensions="$keepextensions $i"
22485 avail_ext="$keepextensions"
22489 : Now see which nonxs extensions are supported on this system.
22490 : For now assume all are.
22492 for xxx in $nonxs_extensions ; do
22496 *) nonxs_ext="$nonxs_ext $xxx"
22508 A number of extensions are supplied with $package. You may choose to
22509 compile these extensions for dynamic loading (the default), compile
22510 them into the $package executable (static loading), or not include
22511 them at all. Answer "none" to include no extensions.
22512 Note that DynaLoader is always built and need not be mentioned here.
22515 case "$dynamic_ext" in
22517 : Exclude those listed in static_ext
22519 for xxx in $avail_ext; do
22520 case " $static_ext " in
22522 *) dflt="$dflt $xxx" ;;
22529 *) dflt="$dynamic_ext"
22530 # Perhaps we are reusing an old out-of-date config.sh.
22533 if test X"$dynamic_ext" != X"$avail_ext"; then
22535 NOTICE: Your previous config.sh list may be incorrect.
22536 The extensions now available to you are
22538 but the default list from your previous config.sh is
22550 rp="What extensions do you wish to load dynamically?"
22553 none) dynamic_ext=' ' ;;
22554 *) dynamic_ext="$ans" ;;
22557 case "$static_ext" in
22559 : Exclude those already listed in dynamic linking
22561 for xxx in $avail_ext; do
22562 case " $dynamic_ext " in
22564 *) dflt="$dflt $xxx" ;;
22571 *) dflt="$static_ext"
22578 rp="What extensions do you wish to load statically?"
22581 none) static_ext=' ' ;;
22582 *) static_ext="$ans" ;;
22587 A number of extensions are supplied with $package. Answer "none"
22588 to include no extensions.
22589 Note that DynaLoader is always built and need not be mentioned here.
22592 case "$static_ext" in
22593 '') dflt="$avail_ext" ;;
22594 *) dflt="$static_ext"
22595 # Perhaps we are reusing an old out-of-date config.sh.
22598 if test X"$static_ext" != X"$avail_ext"; then
22600 NOTICE: Your previous config.sh list may be incorrect.
22601 The extensions now available to you are
22603 but the default list from your previous config.sh is
22612 : Exclude those that are not xs extensions
22616 rp="What extensions do you wish to include?"
22619 none) static_ext=' ' ;;
22620 *) static_ext="$ans" ;;
22625 # Encode is a special case. If we are building Encode as a static
22626 # extension, we need to explicitly list its subextensions as well.
22627 # For other nested extensions, this is handled automatically by
22628 # the appropriate Makefile.PL.
22629 case " $static_ext " in
22630 *" Encode "*) # Add the subextensions of Encode
22632 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22633 static_ext="$static_ext Encode/$xxx"
22634 known_extensions="$known_extensions Encode/$xxx"
22640 set X $dynamic_ext $static_ext $nonxs_ext
22644 # Sanity check: We require an extension suitable for use with
22645 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22646 # should show up as failures in the test suite, but it's helpful to
22647 # catch them now.) The 'extensions' list is normally sorted
22648 # alphabetically, so we need to accept either
22649 # DB_File ... Fcntl ... IO ....
22650 # or something like
22651 # Fcntl ... NDBM_File ... IO ....
22652 case " $extensions" in
22653 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22654 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22655 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22656 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22657 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22661 : Remove libraries needed only for extensions
22662 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22663 : The exception is SunOS 4.x, which needs them.
22664 case "${osname}X${osvers}" in
22668 *) case "$usedl" in
22669 $define|true|[yY]*)
22670 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22674 *) perllibs="$libs"
22680 : Remove build directory name from cppstdin so it can be used from
22681 : either the present location or the final installed location.
22683 : Get out of the UU directory to get correct path name.
22685 case "$cppstdin" in
22687 echo "Stripping down cppstdin path name"
22693 : end of configuration questions
22695 echo "End of configuration questions."
22698 : back to where it started
22699 if test -d ../UU; then
22703 : configuration may be unconditionally patched via a 'config.arch' file
22704 if $test -f config.arch; then
22705 echo "I see a config.arch file, loading it." >&4
22709 : configuration may be patched via a 'config.over' file
22710 if $test -f config.over; then
22713 rp='I see a config.over file. Do you wish to load it?'
22716 n*) echo "OK, I'll ignore it.";;
22718 echo "Configuration override changes have been loaded."
22723 : in case they want portability, strip down executable paths
22724 case "$d_portable" in
22727 echo "Stripping down executable paths..." >&4
22728 for file in $loclist $trylist; do
22730 eval $file=`basename $temp`
22735 : create config.sh file
22737 echo "Creating config.sh..." >&4
22738 $spitshell <<EOT >config.sh
22741 # This file was produced by running the Configure script. It holds all the
22742 # definitions figured out by Configure. Should you modify one of these values,
22743 # do not forget to propagate your changes by running "Configure -der". You may
22744 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22747 # Package name : $package
22748 # Source directory : $src
22749 # Configuration time: $cf_time
22750 # Configured by : $cf_by
22751 # Target system : $myuname
22754 : Add in command line options if available
22755 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22757 $spitshell <<EOT >>config.sh
22766 Revision='$Revision'
22774 alignbytes='$alignbytes'
22775 ansi2knr='$ansi2knr'
22776 aphostname='$aphostname'
22777 api_revision='$api_revision'
22778 api_subversion='$api_subversion'
22779 api_version='$api_version'
22780 api_versionstring='$api_versionstring'
22783 archlibexp='$archlibexp'
22784 archname64='$archname64'
22785 archname='$archname'
22786 archobjs='$archobjs'
22787 asctime_r_proto='$asctime_r_proto'
22795 bootstrap_charset='$bootstrap_charset'
22797 byteorder='$byteorder'
22799 castflags='$castflags'
22802 cccdlflags='$cccdlflags'
22803 ccdlflags='$ccdlflags'
22805 ccflags_uselargefiles='$ccflags_uselargefiles'
22807 ccsymbols='$ccsymbols'
22808 ccversion='$ccversion'
22810 cf_email='$cf_email'
22812 charbits='$charbits'
22813 charsize='$charsize'
22817 clocktype='$clocktype'
22819 compress='$compress'
22820 contains='$contains'
22824 cpp_stuff='$cpp_stuff'
22825 cppccsymbols='$cppccsymbols'
22826 cppflags='$cppflags'
22828 cppminus='$cppminus'
22830 cppstdin='$cppstdin'
22831 cppsymbols='$cppsymbols'
22832 crypt_r_proto='$crypt_r_proto'
22833 cryptlib='$cryptlib'
22835 ctermid_r_proto='$ctermid_r_proto'
22836 ctime_r_proto='$ctime_r_proto'
22837 d_Gconvert='$d_Gconvert'
22838 d_PRIEUldbl='$d_PRIEUldbl'
22839 d_PRIFUldbl='$d_PRIFUldbl'
22840 d_PRIGUldbl='$d_PRIGUldbl'
22841 d_PRIXU64='$d_PRIXU64'
22842 d_PRId64='$d_PRId64'
22843 d_PRIeldbl='$d_PRIeldbl'
22844 d_PRIfldbl='$d_PRIfldbl'
22845 d_PRIgldbl='$d_PRIgldbl'
22846 d_PRIi64='$d_PRIi64'
22847 d_PRIo64='$d_PRIo64'
22848 d_PRIu64='$d_PRIu64'
22849 d_PRIx64='$d_PRIx64'
22850 d_SCNfldbl='$d_SCNfldbl'
22851 d__fwalk='$d__fwalk'
22852 d_access='$d_access'
22853 d_accessx='$d_accessx'
22856 d_archlib='$d_archlib'
22857 d_asctime64='$d_asctime64'
22858 d_asctime_r='$d_asctime_r'
22861 d_attribute_deprecated='$d_attribute_deprecated'
22862 d_attribute_format='$d_attribute_format'
22863 d_attribute_malloc='$d_attribute_malloc'
22864 d_attribute_nonnull='$d_attribute_nonnull'
22865 d_attribute_noreturn='$d_attribute_noreturn'
22866 d_attribute_pure='$d_attribute_pure'
22867 d_attribute_unused='$d_attribute_unused'
22868 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22872 d_bsdgetpgrp='$d_bsdgetpgrp'
22873 d_bsdsetpgrp='$d_bsdsetpgrp'
22874 d_builtin_choose_expr='$d_builtin_choose_expr'
22875 d_builtin_expect='$d_builtin_expect'
22877 d_c99_variadic_macros='$d_c99_variadic_macros'
22878 d_casti32='$d_casti32'
22879 d_castneg='$d_castneg'
22880 d_charvspr='$d_charvspr'
22882 d_chroot='$d_chroot'
22883 d_chsize='$d_chsize'
22885 d_clearenv='$d_clearenv'
22886 d_closedir='$d_closedir'
22887 d_cmsghdr_s='$d_cmsghdr_s'
22889 d_copysignl='$d_copysignl'
22890 d_cplusplus='$d_cplusplus'
22892 d_crypt_r='$d_crypt_r'
22894 d_ctermid='$d_ctermid'
22895 d_ctermid_r='$d_ctermid_r'
22896 d_ctime64='$d_ctime64'
22897 d_ctime_r='$d_ctime_r'
22898 d_cuserid='$d_cuserid'
22899 d_dbl_dig='$d_dbl_dig'
22900 d_dbminitproto='$d_dbminitproto'
22901 d_difftime64='$d_difftime64'
22902 d_difftime='$d_difftime'
22903 d_dir_dd_fd='$d_dir_dd_fd'
22905 d_dirnamlen='$d_dirnamlen'
22906 d_dlerror='$d_dlerror'
22907 d_dlopen='$d_dlopen'
22908 d_dlsymun='$d_dlsymun'
22909 d_dosuid='$d_dosuid'
22910 d_drand48_r='$d_drand48_r'
22911 d_drand48proto='$d_drand48proto'
22913 d_eaccess='$d_eaccess'
22914 d_endgrent='$d_endgrent'
22915 d_endgrent_r='$d_endgrent_r'
22916 d_endhent='$d_endhent'
22917 d_endhostent_r='$d_endhostent_r'
22918 d_endnent='$d_endnent'
22919 d_endnetent_r='$d_endnetent_r'
22920 d_endpent='$d_endpent'
22921 d_endprotoent_r='$d_endprotoent_r'
22922 d_endpwent='$d_endpwent'
22923 d_endpwent_r='$d_endpwent_r'
22924 d_endsent='$d_endsent'
22925 d_endservent_r='$d_endservent_r'
22926 d_eofnblk='$d_eofnblk'
22927 d_eunice='$d_eunice'
22928 d_faststdio='$d_faststdio'
22929 d_fchdir='$d_fchdir'
22930 d_fchmod='$d_fchmod'
22931 d_fchown='$d_fchown'
22933 d_fcntl_can_lock='$d_fcntl_can_lock'
22934 d_fd_macros='$d_fd_macros'
22935 d_fd_set='$d_fd_set'
22936 d_fds_bits='$d_fds_bits'
22937 d_fgetpos='$d_fgetpos'
22938 d_finite='$d_finite'
22939 d_finitel='$d_finitel'
22940 d_flexfnam='$d_flexfnam'
22942 d_flockproto='$d_flockproto'
22944 d_fp_class='$d_fp_class'
22945 d_fpathconf='$d_fpathconf'
22946 d_fpclass='$d_fpclass'
22947 d_fpclassify='$d_fpclassify'
22948 d_fpclassl='$d_fpclassl'
22949 d_fpos64_t='$d_fpos64_t'
22950 d_frexpl='$d_frexpl'
22951 d_fs_data_s='$d_fs_data_s'
22952 d_fseeko='$d_fseeko'
22953 d_fsetpos='$d_fsetpos'
22954 d_fstatfs='$d_fstatfs'
22955 d_fstatvfs='$d_fstatvfs'
22957 d_ftello='$d_ftello'
22959 d_futimes='$d_futimes'
22960 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22961 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22962 d_getaddrinfo='$d_getaddrinfo'
22963 d_getcwd='$d_getcwd'
22964 d_getespwnam='$d_getespwnam'
22965 d_getfsstat='$d_getfsstat'
22966 d_getgrent='$d_getgrent'
22967 d_getgrent_r='$d_getgrent_r'
22968 d_getgrgid_r='$d_getgrgid_r'
22969 d_getgrnam_r='$d_getgrnam_r'
22970 d_getgrps='$d_getgrps'
22971 d_gethbyaddr='$d_gethbyaddr'
22972 d_gethbyname='$d_gethbyname'
22973 d_gethent='$d_gethent'
22974 d_gethname='$d_gethname'
22975 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22976 d_gethostbyname_r='$d_gethostbyname_r'
22977 d_gethostent_r='$d_gethostent_r'
22978 d_gethostprotos='$d_gethostprotos'
22979 d_getitimer='$d_getitimer'
22980 d_getlogin='$d_getlogin'
22981 d_getlogin_r='$d_getlogin_r'
22982 d_getmnt='$d_getmnt'
22983 d_getmntent='$d_getmntent'
22984 d_getnameinfo='$d_getnameinfo'
22985 d_getnbyaddr='$d_getnbyaddr'
22986 d_getnbyname='$d_getnbyname'
22987 d_getnent='$d_getnent'
22988 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22989 d_getnetbyname_r='$d_getnetbyname_r'
22990 d_getnetent_r='$d_getnetent_r'
22991 d_getnetprotos='$d_getnetprotos'
22992 d_getpagsz='$d_getpagsz'
22993 d_getpbyname='$d_getpbyname'
22994 d_getpbynumber='$d_getpbynumber'
22995 d_getpent='$d_getpent'
22996 d_getpgid='$d_getpgid'
22997 d_getpgrp2='$d_getpgrp2'
22998 d_getpgrp='$d_getpgrp'
22999 d_getppid='$d_getppid'
23000 d_getprior='$d_getprior'
23001 d_getprotobyname_r='$d_getprotobyname_r'
23002 d_getprotobynumber_r='$d_getprotobynumber_r'
23003 d_getprotoent_r='$d_getprotoent_r'
23004 d_getprotoprotos='$d_getprotoprotos'
23005 d_getprpwnam='$d_getprpwnam'
23006 d_getpwent='$d_getpwent'
23007 d_getpwent_r='$d_getpwent_r'
23008 d_getpwnam_r='$d_getpwnam_r'
23009 d_getpwuid_r='$d_getpwuid_r'
23010 d_getsbyname='$d_getsbyname'
23011 d_getsbyport='$d_getsbyport'
23012 d_getsent='$d_getsent'
23013 d_getservbyname_r='$d_getservbyname_r'
23014 d_getservbyport_r='$d_getservbyport_r'
23015 d_getservent_r='$d_getservent_r'
23016 d_getservprotos='$d_getservprotos'
23017 d_getspnam='$d_getspnam'
23018 d_getspnam_r='$d_getspnam_r'
23019 d_gettimeod='$d_gettimeod'
23020 d_gmtime64='$d_gmtime64'
23021 d_gmtime_r='$d_gmtime_r'
23022 d_gnulibc='$d_gnulibc'
23023 d_grpasswd='$d_grpasswd'
23024 d_hasmntopt='$d_hasmntopt'
23026 d_ilogbl='$d_ilogbl'
23027 d_inc_version_list='$d_inc_version_list'
23029 d_inetaton='$d_inetaton'
23030 d_inetntop='$d_inetntop'
23031 d_inetpton='$d_inetpton'
23032 d_int64_t='$d_int64_t'
23033 d_ip_mreq='$d_ip_mreq'
23034 d_ip_mreq_source='$d_ip_mreq_source'
23035 d_ipv6_mreq='$d_ipv6_mreq'
23036 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23037 d_isascii='$d_isascii'
23038 d_isblank='$d_isblank'
23039 d_isfinite='$d_isfinite'
23042 d_isnanl='$d_isnanl'
23043 d_killpg='$d_killpg'
23044 d_lchown='$d_lchown'
23045 d_ldbl_dig='$d_ldbl_dig'
23046 d_libm_lib_version='$d_libm_lib_version'
23047 d_libname_unique='$d_libname_unique'
23049 d_localtime64='$d_localtime64'
23050 d_localtime_r='$d_localtime_r'
23051 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23052 d_locconv='$d_locconv'
23054 d_longdbl='$d_longdbl'
23055 d_longlong='$d_longlong'
23056 d_lseekproto='$d_lseekproto'
23058 d_madvise='$d_madvise'
23059 d_malloc_good_size='$d_malloc_good_size'
23060 d_malloc_size='$d_malloc_size'
23062 d_mbstowcs='$d_mbstowcs'
23063 d_mbtowc='$d_mbtowc'
23064 d_memchr='$d_memchr'
23065 d_memcmp='$d_memcmp'
23066 d_memcpy='$d_memcpy'
23067 d_memmove='$d_memmove'
23068 d_memset='$d_memset'
23070 d_mkdtemp='$d_mkdtemp'
23071 d_mkfifo='$d_mkfifo'
23072 d_mkstemp='$d_mkstemp'
23073 d_mkstemps='$d_mkstemps'
23074 d_mktime64='$d_mktime64'
23075 d_mktime='$d_mktime'
23078 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23079 d_modflproto='$d_modflproto'
23080 d_mprotect='$d_mprotect'
23082 d_msg_ctrunc='$d_msg_ctrunc'
23083 d_msg_dontroute='$d_msg_dontroute'
23084 d_msg_oob='$d_msg_oob'
23085 d_msg_peek='$d_msg_peek'
23086 d_msg_proxy='$d_msg_proxy'
23087 d_msgctl='$d_msgctl'
23088 d_msgget='$d_msgget'
23089 d_msghdr_s='$d_msghdr_s'
23090 d_msgrcv='$d_msgrcv'
23091 d_msgsnd='$d_msgsnd'
23093 d_munmap='$d_munmap'
23094 d_mymalloc='$d_mymalloc'
23096 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23098 d_nl_langinfo='$d_nl_langinfo'
23099 d_nv_preserves_uv='$d_nv_preserves_uv'
23100 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23101 d_off64_t='$d_off64_t'
23102 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23103 d_oldpthreads='$d_oldpthreads'
23104 d_oldsock='$d_oldsock'
23106 d_pathconf='$d_pathconf'
23108 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23109 d_phostname='$d_phostname'
23112 d_portable='$d_portable'
23114 d_prctl_set_name='$d_prctl_set_name'
23115 d_printf_format_null='$d_printf_format_null'
23116 d_procselfexe='$d_procselfexe'
23117 d_pseudofork='$d_pseudofork'
23118 d_pthread_atfork='$d_pthread_atfork'
23119 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23120 d_pthread_yield='$d_pthread_yield'
23122 d_pwchange='$d_pwchange'
23123 d_pwclass='$d_pwclass'
23124 d_pwcomment='$d_pwcomment'
23125 d_pwexpire='$d_pwexpire'
23126 d_pwgecos='$d_pwgecos'
23127 d_pwpasswd='$d_pwpasswd'
23128 d_pwquota='$d_pwquota'
23131 d_random_r='$d_random_r'
23132 d_readdir64_r='$d_readdir64_r'
23133 d_readdir='$d_readdir'
23134 d_readdir_r='$d_readdir_r'
23135 d_readlink='$d_readlink'
23137 d_recvmsg='$d_recvmsg'
23138 d_rename='$d_rename'
23139 d_rewinddir='$d_rewinddir'
23141 d_safebcpy='$d_safebcpy'
23142 d_safemcpy='$d_safemcpy'
23143 d_sanemcmp='$d_sanemcmp'
23144 d_sbrkproto='$d_sbrkproto'
23145 d_scalbnl='$d_scalbnl'
23146 d_sched_yield='$d_sched_yield'
23147 d_scm_rights='$d_scm_rights'
23148 d_seekdir='$d_seekdir'
23149 d_select='$d_select'
23151 d_semctl='$d_semctl'
23152 d_semctl_semid_ds='$d_semctl_semid_ds'
23153 d_semctl_semun='$d_semctl_semun'
23154 d_semget='$d_semget'
23156 d_sendmsg='$d_sendmsg'
23157 d_setegid='$d_setegid'
23158 d_seteuid='$d_seteuid'
23159 d_setgrent='$d_setgrent'
23160 d_setgrent_r='$d_setgrent_r'
23161 d_setgrps='$d_setgrps'
23162 d_sethent='$d_sethent'
23163 d_sethostent_r='$d_sethostent_r'
23164 d_setitimer='$d_setitimer'
23165 d_setlinebuf='$d_setlinebuf'
23166 d_setlocale='$d_setlocale'
23167 d_setlocale_r='$d_setlocale_r'
23168 d_setnent='$d_setnent'
23169 d_setnetent_r='$d_setnetent_r'
23170 d_setpent='$d_setpent'
23171 d_setpgid='$d_setpgid'
23172 d_setpgrp2='$d_setpgrp2'
23173 d_setpgrp='$d_setpgrp'
23174 d_setprior='$d_setprior'
23175 d_setproctitle='$d_setproctitle'
23176 d_setprotoent_r='$d_setprotoent_r'
23177 d_setpwent='$d_setpwent'
23178 d_setpwent_r='$d_setpwent_r'
23179 d_setregid='$d_setregid'
23180 d_setresgid='$d_setresgid'
23181 d_setresuid='$d_setresuid'
23182 d_setreuid='$d_setreuid'
23183 d_setrgid='$d_setrgid'
23184 d_setruid='$d_setruid'
23185 d_setsent='$d_setsent'
23186 d_setservent_r='$d_setservent_r'
23187 d_setsid='$d_setsid'
23188 d_setvbuf='$d_setvbuf'
23191 d_shmatprototype='$d_shmatprototype'
23192 d_shmctl='$d_shmctl'
23194 d_shmget='$d_shmget'
23195 d_sigaction='$d_sigaction'
23196 d_signbit='$d_signbit'
23197 d_sigprocmask='$d_sigprocmask'
23198 d_sigsetjmp='$d_sigsetjmp'
23199 d_sin6_scope_id='$d_sin6_scope_id'
23200 d_sitearch='$d_sitearch'
23201 d_snprintf='$d_snprintf'
23202 d_sockaddr_in6='$d_sockaddr_in6'
23203 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23204 d_sockatmark='$d_sockatmark'
23205 d_sockatmarkproto='$d_sockatmarkproto'
23206 d_socket='$d_socket'
23207 d_socklen_t='$d_socklen_t'
23208 d_sockpair='$d_sockpair'
23209 d_socks5_init='$d_socks5_init'
23210 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23212 d_srand48_r='$d_srand48_r'
23213 d_srandom_r='$d_srandom_r'
23214 d_sresgproto='$d_sresgproto'
23215 d_sresuproto='$d_sresuproto'
23216 d_statblks='$d_statblks'
23217 d_statfs_f_flags='$d_statfs_f_flags'
23218 d_statfs_s='$d_statfs_s'
23219 d_static_inline='$d_static_inline'
23220 d_statvfs='$d_statvfs'
23221 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23222 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23223 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23224 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23225 d_stdio_stream_array='$d_stdio_stream_array'
23226 d_stdiobase='$d_stdiobase'
23227 d_stdstdio='$d_stdstdio'
23228 d_strchr='$d_strchr'
23229 d_strcoll='$d_strcoll'
23230 d_strctcpy='$d_strctcpy'
23231 d_strerrm='$d_strerrm'
23232 d_strerror='$d_strerror'
23233 d_strerror_r='$d_strerror_r'
23234 d_strftime='$d_strftime'
23235 d_strlcat='$d_strlcat'
23236 d_strlcpy='$d_strlcpy'
23237 d_strtod='$d_strtod'
23238 d_strtol='$d_strtol'
23239 d_strtold='$d_strtold'
23240 d_strtoll='$d_strtoll'
23241 d_strtoq='$d_strtoq'
23242 d_strtoul='$d_strtoul'
23243 d_strtoull='$d_strtoull'
23244 d_strtouq='$d_strtouq'
23245 d_strxfrm='$d_strxfrm'
23246 d_suidsafe='$d_suidsafe'
23247 d_symlink='$d_symlink'
23248 d_syscall='$d_syscall'
23249 d_syscallproto='$d_syscallproto'
23250 d_sysconf='$d_sysconf'
23251 d_sysernlst='$d_sysernlst'
23252 d_syserrlst='$d_syserrlst'
23253 d_system='$d_system'
23254 d_tcgetpgrp='$d_tcgetpgrp'
23255 d_tcsetpgrp='$d_tcsetpgrp'
23256 d_telldir='$d_telldir'
23257 d_telldirproto='$d_telldirproto'
23259 d_timegm='$d_timegm'
23261 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23262 d_tm_tm_zone='$d_tm_tm_zone'
23263 d_tmpnam_r='$d_tmpnam_r'
23264 d_truncate='$d_truncate'
23265 d_ttyname_r='$d_ttyname_r'
23266 d_tzname='$d_tzname'
23267 d_u32align='$d_u32align'
23268 d_ualarm='$d_ualarm'
23271 d_union_semun='$d_union_semun'
23272 d_unordered='$d_unordered'
23273 d_unsetenv='$d_unsetenv'
23274 d_usleep='$d_usleep'
23275 d_usleepproto='$d_usleepproto'
23277 d_vendorarch='$d_vendorarch'
23278 d_vendorbin='$d_vendorbin'
23279 d_vendorlib='$d_vendorlib'
23280 d_vendorscript='$d_vendorscript'
23282 d_void_closedir='$d_void_closedir'
23283 d_voidsig='$d_voidsig'
23284 d_voidtty='$d_voidtty'
23285 d_volatile='$d_volatile'
23286 d_vprintf='$d_vprintf'
23287 d_vsnprintf='$d_vsnprintf'
23289 d_waitpid='$d_waitpid'
23290 d_wcstombs='$d_wcstombs'
23291 d_wctomb='$d_wctomb'
23292 d_writev='$d_writev'
23295 db_hashtype='$db_hashtype'
23296 db_prefixtype='$db_prefixtype'
23297 db_version_major='$db_version_major'
23298 db_version_minor='$db_version_minor'
23299 db_version_patch='$db_version_patch'
23300 direntrytype='$direntrytype'
23303 doublesize='$doublesize'
23305 drand48_r_proto='$drand48_r_proto'
23307 dynamic_ext='$dynamic_ext'
23313 endgrent_r_proto='$endgrent_r_proto'
23314 endhostent_r_proto='$endhostent_r_proto'
23315 endnetent_r_proto='$endnetent_r_proto'
23316 endprotoent_r_proto='$endprotoent_r_proto'
23317 endpwent_r_proto='$endpwent_r_proto'
23318 endservent_r_proto='$endservent_r_proto'
23319 eunicefix='$eunicefix'
23322 extensions='$extensions'
23323 extern_C='$extern_C'
23325 fflushNULL='$fflushNULL'
23326 fflushall='$fflushall'
23328 firstmakefile='$firstmakefile'
23330 fpossize='$fpossize'
23331 fpostype='$fpostype'
23332 freetype='$freetype'
23335 full_csh='$full_csh'
23336 full_sed='$full_sed'
23337 gccansipedantic='$gccansipedantic'
23338 gccosandvers='$gccosandvers'
23339 gccversion='$gccversion'
23340 getgrent_r_proto='$getgrent_r_proto'
23341 getgrgid_r_proto='$getgrgid_r_proto'
23342 getgrnam_r_proto='$getgrnam_r_proto'
23343 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23344 gethostbyname_r_proto='$gethostbyname_r_proto'
23345 gethostent_r_proto='$gethostent_r_proto'
23346 getlogin_r_proto='$getlogin_r_proto'
23347 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23348 getnetbyname_r_proto='$getnetbyname_r_proto'
23349 getnetent_r_proto='$getnetent_r_proto'
23350 getprotobyname_r_proto='$getprotobyname_r_proto'
23351 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23352 getprotoent_r_proto='$getprotoent_r_proto'
23353 getpwent_r_proto='$getpwent_r_proto'
23354 getpwnam_r_proto='$getpwnam_r_proto'
23355 getpwuid_r_proto='$getpwuid_r_proto'
23356 getservbyname_r_proto='$getservbyname_r_proto'
23357 getservbyport_r_proto='$getservbyport_r_proto'
23358 getservent_r_proto='$getservent_r_proto'
23359 getspnam_r_proto='$getspnam_r_proto'
23360 gidformat='$gidformat'
23366 gmtime_r_proto='$gmtime_r_proto'
23367 gnulibc_version='$gnulibc_version'
23369 groupcat='$groupcat'
23370 groupstype='$groupstype'
23373 h_sysfile='$h_sysfile'
23376 html1dir='$html1dir'
23377 html1direxp='$html1direxp'
23378 html3dir='$html3dir'
23379 html3direxp='$html3direxp'
23388 i_arpainet='$i_arpainet'
23389 i_assert='$i_assert'
23390 i_bsdioctl='$i_bsdioctl'
23394 i_dirent='$i_dirent'
23399 i_fp_class='$i_fp_class'
23401 i_gdbm_ndbm='$i_gdbm_ndbm'
23402 i_gdbmndbm='$i_gdbmndbm'
23404 i_ieeefp='$i_ieeefp'
23405 i_inttypes='$i_inttypes'
23406 i_langinfo='$i_langinfo'
23407 i_libutil='$i_libutil'
23408 i_limits='$i_limits'
23409 i_locale='$i_locale'
23410 i_machcthr='$i_machcthr'
23411 i_malloc='$i_malloc'
23412 i_mallocmalloc='$i_mallocmalloc'
23414 i_memory='$i_memory'
23415 i_mntent='$i_mntent'
23418 i_neterrno='$i_neterrno'
23419 i_netinettcp='$i_netinettcp'
23423 i_pthread='$i_pthread'
23425 i_rpcsvcdbm='$i_rpcsvcdbm'
23427 i_shadow='$i_shadow'
23429 i_stdarg='$i_stdarg'
23430 i_stdbool='$i_stdbool'
23431 i_stddef='$i_stddef'
23432 i_stdlib='$i_stdlib'
23433 i_string='$i_string'
23434 i_sunmath='$i_sunmath'
23435 i_sysaccess='$i_sysaccess'
23436 i_sysdir='$i_sysdir'
23437 i_sysfile='$i_sysfile'
23438 i_sysfilio='$i_sysfilio'
23440 i_sysioctl='$i_sysioctl'
23441 i_syslog='$i_syslog'
23442 i_sysmman='$i_sysmman'
23443 i_sysmode='$i_sysmode'
23444 i_sysmount='$i_sysmount'
23445 i_sysndir='$i_sysndir'
23446 i_sysparam='$i_sysparam'
23447 i_syspoll='$i_syspoll'
23448 i_sysresrc='$i_sysresrc'
23449 i_syssecrt='$i_syssecrt'
23450 i_sysselct='$i_sysselct'
23451 i_syssockio='$i_syssockio'
23452 i_sysstat='$i_sysstat'
23453 i_sysstatfs='$i_sysstatfs'
23454 i_sysstatvfs='$i_sysstatvfs'
23455 i_systime='$i_systime'
23456 i_systimek='$i_systimek'
23457 i_systimes='$i_systimes'
23458 i_systypes='$i_systypes'
23459 i_sysuio='$i_sysuio'
23461 i_sysutsname='$i_sysutsname'
23462 i_sysvfs='$i_sysvfs'
23463 i_syswait='$i_syswait'
23464 i_termio='$i_termio'
23465 i_termios='$i_termios'
23467 i_unistd='$i_unistd'
23470 i_values='$i_values'
23471 i_varargs='$i_varargs'
23472 i_varhdr='$i_varhdr'
23474 ignore_versioned_solibs='$ignore_versioned_solibs'
23475 inc_version_list='$inc_version_list'
23476 inc_version_list_init='$inc_version_list_init'
23479 initialinstalllocation='$initialinstalllocation'
23480 installarchlib='$installarchlib'
23481 installbin='$installbin'
23482 installhtml1dir='$installhtml1dir'
23483 installhtml3dir='$installhtml3dir'
23484 installman1dir='$installman1dir'
23485 installman3dir='$installman3dir'
23486 installprefix='$installprefix'
23487 installprefixexp='$installprefixexp'
23488 installprivlib='$installprivlib'
23489 installscript='$installscript'
23490 installsitearch='$installsitearch'
23491 installsitebin='$installsitebin'
23492 installsitehtml1dir='$installsitehtml1dir'
23493 installsitehtml3dir='$installsitehtml3dir'
23494 installsitelib='$installsitelib'
23495 installsiteman1dir='$installsiteman1dir'
23496 installsiteman3dir='$installsiteman3dir'
23497 installsitescript='$installsitescript'
23498 installstyle='$installstyle'
23499 installusrbinperl='$installusrbinperl'
23500 installvendorarch='$installvendorarch'
23501 installvendorbin='$installvendorbin'
23502 installvendorhtml1dir='$installvendorhtml1dir'
23503 installvendorhtml3dir='$installvendorhtml3dir'
23504 installvendorlib='$installvendorlib'
23505 installvendorman1dir='$installvendorman1dir'
23506 installvendorman3dir='$installvendorman3dir'
23507 installvendorscript='$installvendorscript'
23509 issymlink='$issymlink'
23510 ivdformat='$ivdformat'
23513 known_extensions='$known_extensions'
23516 ld_can_script='$ld_can_script'
23517 lddlflags='$lddlflags'
23519 ldflags_uselargefiles='$ldflags_uselargefiles'
23520 ldlibpthname='$ldlibpthname'
23527 libsdirs='$libsdirs'
23528 libsfiles='$libsfiles'
23529 libsfound='$libsfound'
23530 libspath='$libspath'
23531 libswanted='$libswanted'
23532 libswanted_uselargefiles='$libswanted_uselargefiles'
23538 localtime_r_proto='$localtime_r_proto'
23539 locincpth='$locincpth'
23540 loclibpth='$loclibpth'
23541 longdblsize='$longdblsize'
23542 longlongsize='$longlongsize'
23543 longsize='$longsize'
23547 lseeksize='$lseeksize'
23548 lseektype='$lseektype'
23551 madlyobj='$madlyobj'
23552 madlysrc='$madlysrc'
23556 make_set_make='$make_set_make'
23557 mallocobj='$mallocobj'
23558 mallocsrc='$mallocsrc'
23559 malloctype='$malloctype'
23561 man1direxp='$man1direxp'
23564 man3direxp='$man3direxp'
23566 mips_type='$mips_type'
23567 mistrustnm='$mistrustnm'
23569 mmaptype='$mmaptype'
23570 modetype='$modetype'
23572 multiarch='$multiarch'
23574 myarchname='$myarchname'
23575 mydomain='$mydomain'
23576 myhostname='$myhostname'
23579 need_va_copy='$need_va_copy'
23580 netdb_hlen_type='$netdb_hlen_type'
23581 netdb_host_type='$netdb_host_type'
23582 netdb_name_type='$netdb_name_type'
23583 netdb_net_type='$netdb_net_type'
23586 nm_so_opt='$nm_so_opt'
23587 nonxs_ext='$nonxs_ext'
23589 nvEUformat='$nvEUformat'
23590 nvFUformat='$nvFUformat'
23591 nvGUformat='$nvGUformat'
23592 nv_overflows_integers_at='$nv_overflows_integers_at'
23593 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23594 nveformat='$nveformat'
23595 nvfformat='$nvfformat'
23596 nvgformat='$nvgformat'
23599 o_nonblock='$o_nonblock'
23601 old_pthread_create_joinable='$old_pthread_create_joinable'
23602 optimize='$optimize'
23603 orderlib='$orderlib'
23606 otherlibdirs='$otherlibdirs'
23610 patchlevel='$patchlevel'
23611 path_sep='$path_sep'
23614 perl_patchlevel='$perl_patchlevel'
23615 perl_static_inline='$perl_static_inline'
23616 perladmin='$perladmin'
23617 perllibs='$perllibs'
23618 perlpath='$perlpath'
23620 phostname='$phostname'
23626 prefixexp='$prefixexp'
23628 privlibexp='$privlibexp'
23629 procselfexe='$procselfexe'
23630 prototype='$prototype'
23632 quadkind='$quadkind'
23633 quadtype='$quadtype'
23634 randbits='$randbits'
23635 randfunc='$randfunc'
23636 random_r_proto='$random_r_proto'
23637 randseedtype='$randseedtype'
23639 rd_nodata='$rd_nodata'
23640 readdir64_r_proto='$readdir64_r_proto'
23641 readdir_r_proto='$readdir_r_proto'
23642 revision='$revision'
23648 sGMTIME_max='$sGMTIME_max'
23649 sGMTIME_min='$sGMTIME_min'
23650 sLOCALTIME_max='$sLOCALTIME_max'
23651 sLOCALTIME_min='$sLOCALTIME_min'
23652 sPRIEUldbl='$sPRIEUldbl'
23653 sPRIFUldbl='$sPRIFUldbl'
23654 sPRIGUldbl='$sPRIGUldbl'
23655 sPRIXU64='$sPRIXU64'
23657 sPRIeldbl='$sPRIeldbl'
23658 sPRIfldbl='$sPRIfldbl'
23659 sPRIgldbl='$sPRIgldbl'
23664 sSCNfldbl='$sSCNfldbl'
23665 sched_yield='$sched_yield'
23666 scriptdir='$scriptdir'
23667 scriptdirexp='$scriptdirexp'
23669 seedfunc='$seedfunc'
23670 selectminbits='$selectminbits'
23671 selecttype='$selecttype'
23672 sendmail='$sendmail'
23673 setgrent_r_proto='$setgrent_r_proto'
23674 sethostent_r_proto='$sethostent_r_proto'
23675 setlocale_r_proto='$setlocale_r_proto'
23676 setnetent_r_proto='$setnetent_r_proto'
23677 setprotoent_r_proto='$setprotoent_r_proto'
23678 setpwent_r_proto='$setpwent_r_proto'
23679 setservent_r_proto='$setservent_r_proto'
23682 sharpbang='$sharpbang'
23683 shmattype='$shmattype'
23684 shortsize='$shortsize'
23687 sig_count='$sig_count'
23688 sig_name='$sig_name'
23689 sig_name_init='$sig_name_init'
23691 sig_num_init='$sig_num_init'
23692 sig_size='$sig_size'
23693 signal_t='$signal_t'
23694 sitearch='$sitearch'
23695 sitearchexp='$sitearchexp'
23697 sitebinexp='$sitebinexp'
23698 sitehtml1dir='$sitehtml1dir'
23699 sitehtml1direxp='$sitehtml1direxp'
23700 sitehtml3dir='$sitehtml3dir'
23701 sitehtml3direxp='$sitehtml3direxp'
23703 sitelib_stem='$sitelib_stem'
23704 sitelibexp='$sitelibexp'
23705 siteman1dir='$siteman1dir'
23706 siteman1direxp='$siteman1direxp'
23707 siteman3dir='$siteman3dir'
23708 siteman3direxp='$siteman3direxp'
23709 siteprefix='$siteprefix'
23710 siteprefixexp='$siteprefixexp'
23711 sitescript='$sitescript'
23712 sitescriptexp='$sitescriptexp'
23713 sizesize='$sizesize'
23714 sizetype='$sizetype'
23718 sockethdr='$sockethdr'
23719 socketlib='$socketlib'
23720 socksizetype='$socksizetype'
23722 spackage='$spackage'
23723 spitshell='$spitshell'
23724 srand48_r_proto='$srand48_r_proto'
23725 srandom_r_proto='$srandom_r_proto'
23727 ssizetype='$ssizetype'
23728 st_ino_sign='$st_ino_sign'
23729 st_ino_size='$st_ino_size'
23730 startperl='$startperl'
23732 static_ext='$static_ext'
23734 stdio_base='$stdio_base'
23735 stdio_bufsiz='$stdio_bufsiz'
23736 stdio_cnt='$stdio_cnt'
23737 stdio_filbuf='$stdio_filbuf'
23738 stdio_ptr='$stdio_ptr'
23739 stdio_stream_array='$stdio_stream_array'
23740 strerror_r_proto='$strerror_r_proto'
23743 subversion='$subversion'
23748 targetarch='$targetarch'
23749 targetdir='$targetdir'
23750 targethost='$targethost'
23751 targetport='$targetport'
23755 timeincl='$timeincl'
23756 timetype='$timetype'
23757 tmpnam_r_proto='$tmpnam_r_proto'
23763 ttyname_r_proto='$ttyname_r_proto'
23772 uidformat='$uidformat'
23778 uquadtype='$uquadtype'
23779 use5005threads='$use5005threads'
23780 use64bitall='$use64bitall'
23781 use64bitint='$use64bitint'
23782 usecrosscompile='$usecrosscompile'
23783 usedevel='$usedevel'
23785 usedtrace='$usedtrace'
23786 usefaststdio='$usefaststdio'
23787 useithreads='$useithreads'
23788 usekernprocpathname='$usekernprocpathname'
23789 uselargefiles='$uselargefiles'
23790 uselongdouble='$uselongdouble'
23791 usemallocwrap='$usemallocwrap'
23792 usemorebits='$usemorebits'
23793 usemultiplicity='$usemultiplicity'
23794 usemymalloc='$usemymalloc'
23796 usensgetexecutablepath='$usensgetexecutablepath'
23797 useopcode='$useopcode'
23798 useperlio='$useperlio'
23799 useposix='$useposix'
23800 usereentrant='$usereentrant'
23801 userelocatableinc='$userelocatableinc'
23802 useshrplib='$useshrplib'
23803 usesitecustomize='$usesitecustomize'
23804 usesocks='$usesocks'
23805 usethreads='$usethreads'
23806 usevendorprefix='$usevendorprefix'
23807 useversionedarchname='$useversionedarchname'
23808 usevfork='$usevfork'
23811 uvXUformat='$uvXUformat'
23812 uvoformat='$uvoformat'
23815 uvuformat='$uvuformat'
23816 uvxformat='$uvxformat'
23818 vendorarch='$vendorarch'
23819 vendorarchexp='$vendorarchexp'
23820 vendorbin='$vendorbin'
23821 vendorbinexp='$vendorbinexp'
23822 vendorhtml1dir='$vendorhtml1dir'
23823 vendorhtml1direxp='$vendorhtml1direxp'
23824 vendorhtml3dir='$vendorhtml3dir'
23825 vendorhtml3direxp='$vendorhtml3direxp'
23826 vendorlib='$vendorlib'
23827 vendorlib_stem='$vendorlib_stem'
23828 vendorlibexp='$vendorlibexp'
23829 vendorman1dir='$vendorman1dir'
23830 vendorman1direxp='$vendorman1direxp'
23831 vendorman3dir='$vendorman3dir'
23832 vendorman3direxp='$vendorman3direxp'
23833 vendorprefix='$vendorprefix'
23834 vendorprefixexp='$vendorprefixexp'
23835 vendorscript='$vendorscript'
23836 vendorscriptexp='$vendorscriptexp'
23838 version_patchlevel_string='$version_patchlevel_string'
23839 versiononly='$versiononly'
23843 yaccflags='$yaccflags'
23848 : add special variables
23849 $test -f $src/patchlevel.h && \
23850 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23851 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23852 echo "PERL_CONFIG_SH=true" >>config.sh
23854 : propagate old symbols
23855 if $test -f UU/config.sh; then
23856 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23857 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23858 config.sh config.sh UU/oldconfig.sh |\
23859 $sort | $uniq -u >UU/oldsyms
23860 set X `$cat UU/oldsyms`
23866 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23868 echo ": Variables propagated from previous config.sh file." >>config.sh
23869 for sym in `$cat UU/oldsyms`; do
23870 echo " Propagating $hint variable "'$'"$sym..."
23871 eval 'tmp="$'"${sym}"'"'
23873 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23879 : Finish up by extracting the .SH files
23883 echo "Extraction done."
23893 If you'd like to make any changes to the config.sh file before I begin
23894 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23897 rp="Press return or use a shell escape to edit config.sh:"
23902 *) : in case they cannot read
23903 sh 1>&4 -c "$ans";;
23908 : if this fails, just run all the .SH files by hand
23917 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23924 Now you need to generate make dependencies by running "$make depend".
23925 You might prefer to run it in background: "$make depend > makedepend.out &"
23926 It can take a while, so you might not want to run it right now.
23931 rp="Run $make depend now?"
23935 $make depend && echo "Now you must run '$make'."
23938 echo "You must run '$make depend' then '$make'."
23941 elif test -f [Mm]akefile; then
23943 echo "Now you must run a $make."
23945 echo "Configure done."
23948 if $test -f Policy.sh; then
23951 If you compile $package on a different machine or from a different object
23952 directory, copy the Policy.sh file from this object directory to the
23953 new one before you run Configure -- this will help you with most of
23954 the policy defaults.
23958 if $test -f config.msg; then
23959 echo "Hmm. I also noted the following information while running:"
23961 $cat config.msg >&4
23964 $rm -f kit*isdone ark*isdone