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 by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
529 gethostbyaddr_r_proto=''
531 gethostbyname_r_proto=''
533 gethostent_r_proto=''
546 getnetbyaddr_r_proto=''
548 getnetbyname_r_proto=''
562 d_getprotobyname_r=''
563 getprotobyname_r_proto=''
564 d_getprotobynumber_r=''
565 getprotobynumber_r_proto=''
567 getprotoent_r_proto=''
579 getservbyname_r_proto=''
581 getservbyport_r_proto=''
583 getservent_r_proto=''
616 d_lc_monetary_2008=''
621 d_libm_lib_version=''
628 d_localtime_r_needs_tzset=''
648 d_malloc_good_size=''
696 d_old_pthread_create_joinable=''
697 old_pthread_create_joinable=''
699 d_pthread_attr_setscope=''
747 sethostent_r_proto=''
764 setprotoent_r_proto=''
776 setservent_r_proto=''
798 d_ipv6_mreq_source=''
815 d_sprintf_returns_strlen=''
828 perl_static_inline=''
833 d_stdio_ptr_lval_nochange_cnt=''
834 d_stdio_ptr_lval_sets_cnt=''
986 d_gdbm_ndbm_h_uses_prototypes=''
987 d_gdbmndbm_h_uses_prototypes=''
989 d_ndbm_h_uses_prototypes=''
1065 d_inc_version_list=''
1067 inc_version_list_init=''
1075 installusrbinperl=''
1091 ignore_versioned_solibs=''
1155 d_perl_otherlibdirs=''
1163 api_versionstring=''
1169 version_patchlevel_string=''
1173 d_nv_preserves_uv=''
1174 d_nv_zero_is_allbits_zero=''
1185 nv_overflows_integers_at=''
1186 nv_preserves_uv_bits=''
1259 installsitehtml1dir=''
1262 installsitehtml3dir=''
1269 installsiteman1dir=''
1272 installsiteman3dir=''
1277 installsitescript=''
1295 d_stdio_stream_array=''
1296 stdio_stream_array=''
1314 usekernprocpathname=''
1315 ccflags_uselargefiles=''
1316 ldflags_uselargefiles=''
1317 libswanted_uselargefiles=''
1326 usensgetexecutablepath=''
1340 installvendorarch=''
1347 installvendorhtml1dir=''
1349 vendorhtml1direxp=''
1350 installvendorhtml3dir=''
1352 vendorhtml3direxp=''
1358 installvendorman1dir=''
1361 installvendorman3dir=''
1368 installvendorscript=''
1379 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1382 : We must find out about Eunice early
1384 if test -f /etc/unixtovms; then
1385 eunicefix=/etc/unixtovms
1387 if test -f /etc/unixtovms.exe; then
1388 eunicefix=/etc/unixtovms.exe
1391 : Set executable suffix now -- needed before hints available
1392 if test -f "/libs/version.library"; then
1395 elif test -f "/system/gnu_library/bin/ar.pm"; then
1398 elif test -n "$DJGPP"; then
1401 elif test -f /kern/cookiejar; then
1404 elif test -d c:/. -o -n "$is_os2" ; then
1411 : Trailing extension. Override this in a hint file, if needed.
1412 : Extra object files, if any, needed on this platform.
1415 : Possible local include directories to search.
1416 : Set locincpth to "" in a hint file to defeat local include searches.
1417 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1418 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1420 : no include file wanted by default
1423 : Enable -DEBUGGING and -DDEBUGGING from the command line
1428 : change the next line if compiling for Xenix/286 on Xenix/386
1429 xlibpth='/usr/lib/386 /lib/386'
1430 : Possible local library directories to search.
1431 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1432 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1434 : general looking path for locating libraries
1435 glibpth="/lib /usr/lib $xlibpth"
1436 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1437 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1438 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1439 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1441 : Private path used by Configure to find libraries. Its value
1442 : is prepended to libpth. This variable takes care of special
1443 : machines, like the mips. Usually, it should be empty.
1446 : default library list
1448 : some systems want to use only the non-versioned libso:s
1449 ignore_versioned_solibs=''
1450 : set usethreads on the Configure command line to enable threads.
1451 usereentrant='undef'
1455 : set useposix=false in your hint file to disable the POSIX extension.
1457 : set useopcode=false in your hint file to disable the Opcode extension.
1460 ccflags_uselargefiles=''
1461 ldflags_uselargefiles=''
1462 libswanted_uselargefiles=''
1463 : set usemultiplicity on the Configure command line to enable multiplicity.
1464 : set usesocks on the Configure command line to enable socks.
1465 : List of libraries we want.
1466 : If anyone needs extra -lxxx, put those in a hint file.
1467 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1468 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1469 : We probably want to search /usr/shlib before most other libraries.
1470 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1471 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1472 glibpth="/usr/shlib $glibpth"
1473 : Do not use vfork unless overridden by a hint file.
1476 : Find the basic shell for Bourne shell scripts
1480 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1483 if test -f "$xxx"; then
1486 : Build up a list and do a single loop so we can 'break' out.
1487 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1488 for xxx in sh bash ksh pdksh ash; do
1490 try="$try ${p}/${xxx}"
1494 if test -f "$xxx"; then
1497 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1500 elif test -f "$xxx.exe"; then
1511 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1513 Usually it's in /bin/sh. How did you even get this far?
1514 Please contact me (Perl Maintainers) at perlbug@perl.org and
1515 we'll try to straighten this all out.
1521 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1522 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1525 : see if sh knows # comments
1526 if `$sh -c '#' >/dev/null 2>&1`; then
1530 test -f $xcat$_exe || xcat=/usr/bin/cat
1531 if test ! -f $xcat$_exe; then
1532 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1533 if test -f $p/cat$_exe; then
1538 if test ! -f $xcat$_exe; then
1539 echo "Can't find cat anywhere!"
1543 echo "#!$xcat" >sharp
1546 ./sharp > today 2>/dev/null
1547 if test -s today; then
1550 echo "#! $xcat" > sharp
1553 ./sharp > today 2>/dev/null
1554 if test -s today; then
1562 echo "Your $sh doesn't grok # comments--I will strip them later on."
1565 echo "exec grep -v '^[ ]*#'" >spitshell
1567 $eunicefix spitshell
1568 spitshell=`pwd`/spitshell
1570 echo "I presume that if # doesn't work, #! won't work either!"
1575 : figure out how to guarantee sh startup
1577 '') startsh=${sharpbang}${sh} ;;
1589 : echo "Yup, it does."
1591 echo "Hmm... '$startsh' does not guarantee sh startup..."
1592 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1596 : Save command line options in file UU/cmdline.opt for later use in
1597 : generating config.sh.
1598 cat > cmdline.opt <<EOSH
1599 : Configure command line arguments.
1608 cat >>cmdline.opt <<EOSH
1609 config_arg$argn='$arg'
1611 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1614 arg_exp=`cat cmdl.opt`
1615 args_exp="$args_exp$args_sep'$arg_exp'"
1616 argn=`expr $argn + 1`
1621 : produce awk script to parse command line options
1622 cat >options.awk <<'EOF'
1624 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1626 len = length(optstr);
1627 for (i = 1; i <= len; i++) {
1628 c = substr(optstr, i, 1);
1629 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1640 if (substr(str, 1, 1) != "-") {
1641 printf("'%s'\n", str);
1645 for (i = 2; i <= len; i++) {
1646 c = substr(str, i, 1);
1648 printf("-%s\n", substr(str, i));
1654 printf("'%s'\n", substr(str, i + 1));
1667 : process the command line options
1668 set X `for arg in "$@"; do echo "X$arg"; done |
1669 sed -e s/X// | awk -f options.awk`
1674 : set up default values
1683 rm -f optdef.sh posthint.sh
1684 cat >optdef.sh <<EOS
1690 while test $# -gt 0; do
1692 -d) shift; fastread=yes;;
1693 -e) shift; alldone=cont;;
1697 if test -r "$1"; then
1700 echo "$me: cannot read config file $1." >&2
1706 -h) shift; error=true;;
1707 -r) shift; reuseval=true;;
1708 -s) shift; silent=true; realsilent=true;;
1709 -E) shift; alldone=exit;;
1710 -K) shift; knowitall=true;;
1712 -S) shift; silent=true; extractsh=true;;
1717 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1718 echo "$me: ignoring -D $1" >&2
1721 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1722 *) echo "$1='define'" >> optdef.sh;;
1729 *=) echo "$1" >> optdef.sh;;
1731 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1732 echo "$me: ignoring -U $1" >&2
1734 *) echo "$1='undef'" >> optdef.sh;;
1745 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1749 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1750 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1756 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1757 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1758 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1759 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1760 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1761 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1767 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1769 echo "$yyy=''" >> posthint.sh ;;
1774 echo "$yyy='$zzz'" >> posthint.sh ;;
1776 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1778 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1783 echo "$yyy=$zzz" >> posthint.sh ;;
1784 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1788 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1791 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1799 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1800 [-U symbol] [-U symbol=] [-A command:symbol...]
1801 -d : use defaults for all answers.
1802 -e : go on without questioning past the production of config.sh.
1803 -f : specify an alternate default configuration file.
1804 -h : print this help message and exit (with an error status).
1805 -r : reuse C symbols value if possible (skips costly nm extraction).
1806 -s : silent mode, only echoes questions and essential information.
1807 -D : define symbol to have some value:
1808 -D symbol symbol gets the value 'define'
1809 -D symbol=value symbol gets the value 'value'
1810 common used examples (see INSTALL for more info):
1811 -Duse64bitint use 64bit integers
1812 -Duse64bitall use 64bit integers and pointers
1813 -Dusethreads use thread support
1814 -Dinc_version_list=none do not include older perl trees in @INC
1815 -DEBUGGING=none DEBUGGING options
1816 -Dcc=gcc choose your compiler
1817 -Dprefix=/opt/perl5 choose your destination
1818 -E : stop at the end of questions, after having produced config.sh.
1819 -K : do not use unless you know what you are doing.
1820 -O : ignored for backward compatibility
1821 -S : perform variable substitutions on all .SH files (can mix with -f)
1822 -U : undefine symbol:
1823 -U symbol symbol gets the value 'undef'
1824 -U symbol= symbol gets completely empty
1826 -A : manipulate symbol after the platform specific hints have been applied:
1827 -A append:symbol=value append value to symbol
1828 -A symbol=value like append:, but with a separating space
1829 -A define:symbol=value define symbol to have value
1830 -A clear:symbol define symbol to be ''
1831 -A define:symbol define symbol to be 'define'
1832 -A eval:symbol=value define symbol to be eval of value
1833 -A prepend:symbol=value prepend value to symbol
1834 -A undef:symbol define symbol to be 'undef'
1835 -A undef:symbol= define symbol to be ''
1836 e.g.: -A prepend:libswanted='cl pthread '
1837 -A ccflags=-DSOME_MACRO
1838 -V : print version number and exit (with a zero status).
1845 case "$fastread$alldone" in
1848 case "$extractsh" in
1851 if test ! -t 0; then
1852 echo "Say 'sh Configure', not 'sh <Configure'"
1862 true) exec 1>/dev/null;;
1865 : run the defines and the undefines, if any, but leave the file out there...
1867 grep -q '\\' optdef.sh
1868 if test $? = 0; then
1869 echo "Configure does not support \\ in -D arguments"
1873 : create the posthint manipulation script and leave the file out there...
1878 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1879 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1880 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1881 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1882 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1885 : Some greps do not return status, grrr.
1886 echo "grimblepritz" >grimble
1887 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1889 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1895 : the following should work in any shell
1899 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1900 cat >contains <<'EOSS'
1901 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1906 : Find the path to the source tree
1909 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1913 *) src=`cd ../$src && pwd` ;;
1926 if test -f $rsrc/Configure && \
1927 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1929 : found it, so we are ok.
1932 for src in . .. ../.. ../../.. ../../../..; do
1933 if test -f ../$src/Configure && \
1934 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1945 Sorry, I can't seem to locate the source dir for $package. Please start
1946 Configure with an explicit path -- i.e. /some/path/Configure.
1954 echo "Sources for $package found in \"$src\"." >&4
1958 : script used to extract .SH files with variable substitutions
1959 cat >extract <<'EOS'
1961 echo "Doing variable substitutions on .SH files..."
1962 if test -f MANIFEST; then
1963 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1965 echo "(Looking for .SH files under the source directory.)"
1966 set x `(cd "$src"; find . -name "*.SH" -print)`
1970 0) set x `(cd "$src"; echo *.SH)`; shift;;
1972 if test ! -f "$src/$1"; then
1978 while test $name; do
1979 if test ! -d "$name"; then
1980 create="$name $create";
1981 name=`echo $name | sed -e "s|^[^/]*$||"`;
1982 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1987 for file in $create; do
1996 dir=`expr X$file : 'X\(.*\)/'`
1997 file=`expr X$file : 'X.*/\(.*\)'`
1998 (cd "$dir" && . ./$file)
2008 dir=`expr X$file : 'X\(.*\)/'`
2009 file=`expr X$file : 'X.*/\(.*\)'`
2010 (set x $dir; shift; eval $mkdir_p)
2011 sh <"$src/$dir/$file"
2020 if test -f "$src/config_h.SH"; then
2021 if test ! -f config.h; then
2022 : oops, they left it out of MANIFEST, probably, so do it anyway.
2023 . "$src/config_h.SH"
2028 : extract files and exit if asked to do so
2029 case "$extractsh" in
2031 case "$realsilent" in
2035 case "$config_sh" in
2036 '') config_sh='config.sh';;
2039 echo "Fetching answers from $config_sh..."
2046 echo "Extraction done."
2051 : Eunice requires " " instead of "", can you believe it
2054 echo "Beginning of configuration questions for $package."
2056 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2058 : first determine how to suppress newline on echo command
2060 echo "Checking echo to see how to suppress newlines..."
2061 (echo "hi there\c" ; echo " ") >.echotmp
2062 if $contains c .echotmp >/dev/null 2>&1 ; then
2073 echo $n "The star should be here-->$c"
2077 : Now test for existence of everything in MANIFEST
2079 if test -f "$rsrc/MANIFEST"; then
2080 echo "First let's make sure your kit is complete. Checking..." >&4
2081 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2082 (split -l 50 2>/dev/null || split -50)
2085 for filelist in x??; do
2086 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2087 >/dev/null 2>>"$tmppwd/missing")
2089 if test -s missing; then
2093 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2095 You have the option of continuing the configuration process, despite the
2096 distinct possibility that your kit is damaged, by typing 'y'es. If you
2097 do, don't blame me if something goes wrong. I advise you to type 'n'o
2098 and contact the author (perlbug@perl.org).
2101 echo $n "Continue? [n] $c" >&4
2105 echo "Continuing..." >&4
2109 echo "ABORTING..." >&4
2114 echo "Looks good..."
2117 echo "There is no MANIFEST file. I hope your kit is complete !"
2121 : Find the appropriate value for a newline for tr
2123 if test -n "$DJGPP"; then
2126 if test X"$trnl" = X; then
2127 case "`echo foo|tr '\n' x 2>/dev/null`" in
2131 if test X"$trnl" = X; then
2132 case "`echo foo|tr '\012' x 2>/dev/null`" in
2133 foox) trnl='\012' ;;
2136 if test X"$trnl" = X; then
2137 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2138 fooxy) trnl='\n\r' ;;
2141 if test X"$trnl" = X; then
2144 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2150 : compute the number of columns on the terminal for proper question formatting
2155 : set up the echo used in my read
2156 myecho="case \"\$xxxm\" in
2157 '') echo $n \"\$rp $c\" >&4;;
2159 '') echo $n \"[\$xxxm] $c\";;
2161 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2163 echo $n \"[\$xxxm] $c\" >&4
2165 echo $n \"\$rp [\$xxxm] $c\" >&4
2171 : now set up to do reads with possible shell escape and default assignment
2177 case "\$fastread" in
2178 yes) case "\$dflt" in
2181 case "\$silent-\$rp" in
2186 *) case "\$silent" in
2187 true) case "\$rp" in
2192 while expr "X\$ans" : "X!" >/dev/null; do
2196 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2204 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2213 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2218 echo "(OK, I'll run with -d after this question.)" >&4
2221 echo "*** Sorry, \$1 not supported yet." >&4
2231 echo "*** Substitution done -- please confirm."
2233 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2238 echo "*** Error -- try again."
2245 case "\$ans\$xxxm\$nostick" in
2257 : create .config dir to save info across Configure sessions
2258 test -d ../.config || mkdir ../.config
2259 cat >../.config/README <<EOF
2260 This directory created by Configure to save information that should
2261 persist across sessions for $package.
2263 You may safely delete it if you wish.
2266 : See if we are using a devel version and want that
2267 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2270 usedevel="$define" ;;
2271 *) case "$xversion" in
2274 *** WHOA THERE!!! ***
2276 This is an UNSTABLE DEVELOPMENT release.
2277 The version of this $package distribution is $xversion, that is, odd,
2278 (as opposed to even) and that signifies a development release.
2279 If you want a maintenance release, you want an even-numbered version.
2281 Do ***NOT*** install this into production use.
2282 Data corruption and crashes are possible.
2284 It is most seriously suggested that you do not continue any further
2285 unless you want to help in developing and debugging Perl.
2287 If you *still* want to build perl, you can answer 'y' now,
2288 or pass -Dusedevel to Configure.
2291 rp='Do you really want to continue?'
2295 [yY]) echo >&4 "Okay, continuing."
2296 usedevel="$define" ;;
2297 *) echo >&4 "Okay, bye."
2308 case "$versiononly" in
2309 '') versiononly="$define" ;;
2311 case "$installusrbinperl" in
2312 '') installusrbinperl="$undef" ;;
2317 : general instructions
2320 user=`(logname) 2>/dev/null`
2322 '') user=`whoami 2>&1`;;
2324 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2327 rp='Would you like to see the instructions?'
2338 This installation shell script will examine your system and ask you questions
2339 to determine how the perl5 package should be installed. If you get
2340 stuck on a question, you may use a ! shell escape to start a subshell or
2341 execute a command. Many of the questions will have default answers in square
2342 brackets; typing carriage return will give you the default.
2344 On some of the questions which ask for file or directory names you are allowed
2345 to use the ~name construct to specify the login directory belonging to "name",
2346 even if you don't have a shell which knows about that. Questions where this is
2347 allowed will be marked "(~name ok)".
2351 dflt='Type carriage return to continue'
2355 The prompter used in this script allows you to use shell variables and
2356 backticks in your answers. You may use $1, $2, etc... to refer to the words
2357 in the default answer, as if the default line was a set of arguments given to a
2358 script shell. This means you may also use $* to repeat the whole default line,
2359 so you do not have to re-type everything to add something to the default.
2361 Every time there is a substitution, you will have to confirm. If there is an
2362 error (e.g. an unmatched backtick), the default answer will remain unchanged
2363 and you will be prompted again.
2365 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2366 the questions and use the computed defaults (or the previous answers if there
2367 was already a config.sh file). Type 'Configure -h' for a list of options.
2368 You may also start interactively and then answer '& -d' at any prompt to turn
2369 on the non-interactive behaviour for the remainder of the execution.
2375 Much effort has been expended to ensure that this shell script will run on any
2376 Unix system. If despite that it blows up on yours, your best bet is to edit
2377 Configure and run it again. If you can't run Configure for some reason,
2378 you'll have to generate a config.sh file by hand. Whatever problems you
2379 have, let me (perlbug@perl.org) know how I blew it.
2381 This installation script affects things in two ways:
2383 1) it may do direct variable substitutions on some of the files included
2385 2) it builds a config.h file for inclusion in C programs. You may edit
2386 any of these files as the need arises after running this script.
2388 If you make a mistake on a question, there is no easy way to back up to it
2389 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2390 files. Configure will offer to let you do this before it runs the SH files.
2393 dflt='Type carriage return to continue'
2395 case "$firsttime" in
2396 true) echo $user >>../.config/instruct;;
2400 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2401 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2402 if test "X$sysroot" = X; then
2407 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2408 # _sysroot is used in places where we need --sysroot=foo
2409 # but using the rest of the flags could cause issues.
2410 _sysroot="--sysroot=$sysroot";
2414 ccflags="$ccflags $_sysroot"
2419 ldflags="$ldflags $_sysroot"
2424 cppflags="$cppflags $_sysroot"
2426 # lddlflags updated below in lddlflags section;
2427 # same with cccdlflags
2431 # Adjust some defaults to also use $sysroot
2432 for var in xlibpth loclibpth locincpth glibpth; do
2435 for path in $xxx; do
2436 eval $var=\"\$$var $sysroot$path\"
2442 : find out where common programs are
2444 echo "Locating common programs..." >&4
2457 if test -d \$dir/\$thing; then
2463 for thisthing in \$dir/\$thing; do
2464 : just loop through to pick last item
2466 if test -f \$thisthing; then
2469 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2472 elif test -f \$dir/\$thing.exe; then
2473 if test -n "$DJGPP"; then
2474 echo \$dir/\$thing.exe
2475 elif test "$eunicefix" != ":"; then
2476 : on Eunice apparently
2529 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2530 pth="$pth $sysroot/lib $sysroot/usr/lib"
2531 for file in $loclist; do
2535 if test -f "$xxx"; then
2538 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2539 xxx=`./loc $file $file $pth`
2542 '') xxx=`./loc $file $file $pth`;;
2543 *) xxx=`./loc $xxx $xxx $pth`;;
2545 eval $file=$xxx$_exe
2549 echo $file is in $xxx.
2552 echo $file is in $xxx.
2555 echo "I don't know where '$file' is, and my life depends on it." >&4
2556 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2562 echo "Don't worry if any of the following aren't found..."
2564 for file in $trylist; do
2568 if test -f "$xxx"; then
2571 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2572 xxx=`./loc $file $file $pth`
2575 '') xxx=`./loc $file $file $pth`;;
2576 *) xxx=`./loc $xxx $xxx $pth`;;
2578 eval $file=$xxx$_exe
2582 echo $file is in $xxx.
2585 echo $file is in $xxx.
2588 echo "I don't see $file out there, $say."
2595 echo "Substituting grep for egrep."
2602 *) if $less -R </dev/null >/dev/null 2>&1; then
2603 echo "Substituting less -R for less."
2611 echo "Substituting cp for ln."
2620 echo "I can't find make or gmake, and my life depends on it." >&4
2621 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2629 *) # We can't have osname yet.
2630 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2631 # Assume that gmake, if found, is definitely GNU make
2632 # and prefer it over the system make.
2633 echo "Substituting gmake for make."
2641 echo "Hopefully test is built into your sh."
2644 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2645 echo "Using the test built into your sh."
2653 echo "Hopefully echo is built into your sh."
2658 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2659 $echo $n "hi there$c" >foo1
2660 echo $n "hi there$c" >foo2
2661 if cmp foo1 foo2 >/dev/null 2>&1; then
2662 echo "They are compatible. In fact, they may be identical."
2669 They are not compatible! You are probably running ksh on a non-USG system.
2670 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2671 have echo built in and we may have to run some Bourne shell scripts. That
2672 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2675 $echo $n "The star should be here-->$c"
2682 # This question was auctioned at YAPC::Europe-2007 in Vienna
2683 # I never promised you could answer it. I only auctioned the question.
2685 The following message is sponsored by
2687 Dresden.pm<--The stars should be here.
2689 Dear Perl user, system administrator or package
2690 maintainer, the Perl community sends greetings to
2691 you. Do you (emblematical) greet back [Y/n]? n
2695 : Check what type of C compiler we use
2699 cat <<'EOSC' >>trygcc
2704 int main(int argc, char *argv[]) {
2708 if $cc -o try $ccflags $ldflags try.c; then
2711 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2717 # Skip this test because it gives a false match on output like:
2718 # ./trygcc: line 23: cc: command not found
2719 # case "`$cc -v -c try.c 2>&1`" in
2720 # *gcc*) trygcc=no ;;
2722 if $test X"$trygcc" = Xyes; then
2723 if gcc -o try -c try.c; then
2725 echo "You seem to have a working gcc, though." >&4
2726 # Switching compilers may undo the work of hints files.
2727 # The most common problem is -D_REENTRANT for threads.
2728 # This heuristic catches that case, but gets false positives
2729 # if -Dusethreads was not actually specified. Better to
2730 # bail out here with a useful message than fail
2731 # mysteriously later. Should we perhaps just try to
2732 # re-invoke Configure -Dcc=gcc config_args ?
2733 if $test -f usethreads.cbu; then
2736 *** However, any setting of the C compiler flags (e.g. for thread support)
2737 *** will be lost. It may be necessary for you to restart Configure and
2738 *** add -Dcc=gcc to your Configure command line.
2741 rp="Would you like to go ahead and try gcc anyway?"
2744 rp="Would you like to use it?"
2747 if $test -f myread; then
2750 if $test -f UU/myread; then
2753 echo "Cannot find myread, sorry. Aborting." >&2
2758 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2771 cat <<'EOSC' >>checkcc
2776 int main(int argc, char *argv[]) {
2780 if $cc -o try $ccflags $ldflags try.c; then
2783 if $test X"$despair" = Xyes; then
2784 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2787 You need to find a working C compiler.
2788 Either (purchase and) install the C compiler supplied by your OS vendor,
2789 or for a free C compiler try http://gcc.gnu.org/
2790 I cannot continue any further, aborting.
2799 : determine whether symbolic links are supported
2802 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2803 echo "Symbolic links are supported." >&4
2806 echo "Symbolic links are NOT supported." >&4
2811 : determine whether symbolic links are supported
2815 echo "Checking how to test for symbolic links..." >&4
2817 if $test "X$issymlink" = X; then
2819 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2820 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2822 if test $? = 0; then
2825 echo "Your builtin 'test -h' may be broken." >&4
2828 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2831 if test -f "$p/$test"; then
2840 echo "Trying external '$test -h'." >&4
2841 issymlink="$test -h"
2842 if $test ! -h sym >/dev/null 2>&1; then
2843 echo "External '$test -h' is broken, too." >&4
2851 if $test "X$issymlink" = X; then
2852 if $test -L sym 2>/dev/null; then
2853 issymlink="$test -L"
2854 echo "The builtin '$test -L' worked." >&4
2857 if $test "X$issymlink" != X; then
2858 echo "You can test for symbolic links with '$issymlink'." >&4
2860 echo "I do not know how you can test for symbolic links." >&4
2864 *) echo "No symbolic links, so not testing for their testing..." >&4
2869 : Make symlinks util
2870 case "$mksymlinks" in
2873 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2876 *) case "$lns:$issymlink" in
2877 *"ln"*" -s:"*"test -"?)
2878 echo "Creating the symbolic links..." >&4
2880 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2890 print "# dir = ", dir, "file = ", file
2891 mf[dir] = mf[dir]" "source"/"dir"/"file;
2894 if (d != ".") { print("mkdir -p "d) }
2895 print("ln -sf "mf[d]" "d);
2897 }' source="$src" > UU/mksymlinks.$$
2901 if test ! -d t/base; then
2902 echo "Failed to create the subdirectories. Aborting." >&4
2906 if test ! -f t/base/lex.t; then
2907 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2910 if test ! -f win32/win32.c; then
2911 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2916 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2924 : Check for Cross-Compilation
2925 if $test "X$targethost" = "X"; then
2928 if $test "X$targetenv" = "X"; then
2931 case "$usecrosscompile" in
2933 $echo "Cross-compiling..."
2936 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2937 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2938 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2939 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2940 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2941 # leave out ld, choosing it is more complex
2942 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2943 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2944 # We are in a weird spot. Just before us, some values
2945 # were 'saved', to be restored after the hints are
2946 # run. This means that the changes we made to ar,
2947 # nm and ranlib will get reverted.
2948 # To avoid that, we hijack the saving mechanism and
2949 # have it save our new values.
2950 for file in ar nm ranlib; do
2952 eval $file=$xxx$_exe
2957 case "$targetarch" in
2958 '') echo "Targetarch not defined." >&4; croak=y ;;
2959 *) echo "Using targetarch $targetarch." >&4 ;;
2961 case "$targethost" in
2962 '') echo "Targethost not defined." >&4; croak=y ;;
2963 *) echo "Using targethost $targethost." >&4
2968 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2970 : compile a host miniperl and generate_uudmap, unless we got passed them
2971 if $test "X$hostperl" = X; then
2972 echo "Building host miniperl and generate_uudmap binaries" >&4
2980 $src/Configure -des -Dusedevel -Dmksymlinks
2982 case "$hostgenerate" in
2983 '') $make generate_uudmap
2984 hostgenerate=$src/host/generate_uudmap
2986 "$undef") hostgenerate=''
2989 hostperl=$src/host/miniperl
2992 hostosname=`$hostperl -le 'print $^O'`
2995 usecrosscompile="$undef"
2999 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3000 case "$targethost" in
3001 '') echo "Checking for cross-compile" >&4
3002 case "$usecrosscompile$multiarch" in
3003 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3004 if [ -f Makefile ]; then
3006 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3008 echo "Configure done."
3012 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3019 *) echo "Using targethost $targethost." >&4
3021 /*) run=$src/Cross/run
3022 targetmkdir=$src/Cross/mkdir
3024 from=$src/Cross/from
3026 *) pwd=`$test -f ../Configure & cd ..; pwd`
3028 targetmkdir=$pwd/Cross/mkdir
3030 from=$pwd/Cross/from
3033 case "$targetrun" in
3034 '') targetrun=ssh ;;
3039 case "$targetfrom" in
3040 '') targetfrom=scp ;;
3044 from=$from-$targetfrom
3045 case "$targetdir" in
3047 echo "Guessing targetdir $targetdir." >&4
3050 case "$targetuser" in
3052 echo "Guessing targetuser $targetuser." >&4
3055 case "$targetport" in
3057 echo "Guessing targetport $targetport." >&4
3060 case "$targetfrom" in
3064 case "$targetrun" in
3084 '') cwd=$targetdir ;;
3089 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3095 *) echo "Unknown targetrun '$targetrun'" >&4
3099 case "$targetmkdir" in
3101 cat >$targetmkdir <<EOF
3103 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3105 $chmod a+rx $targetmkdir
3107 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3119 $targetmkdir \`dirname \$f\`
3120 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3123 $targetmkdir $targetdir/\`dirname \$f\`
3124 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3137 $mkdir -p $targetdir/\`dirname \$f\`
3138 $cp \$f $targetdir/\$f || exit 1
3141 $targetmkdir $targetdir/\`dirname \$f\`
3142 $cp \$f $targetdir/\$f || exit 1
3149 *) echo "Unknown targetto '$targetto'" >&4
3153 case "$targetfrom" in
3160 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3165 cp) cat >$from <<EOF
3170 cp $targetdir/\$f . || exit 1
3175 *) echo "Unknown targetfrom '$targetfrom'" >&4
3179 if $test ! -f $run; then
3180 echo "Target 'run' script '$run' not found." >&4
3184 if $test ! -f $to; then
3185 echo "Target 'to' script '$to' not found." >&4
3189 if $test ! -f $from; then
3190 echo "Target 'from' script '$from' not found." >&4
3194 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3198 Using '$run' for remote execution,
3199 and '$from' and '$to'
3200 for remote file transfer.
3206 usecrosscompile="$undef"
3211 : see whether [:lower:] and [:upper:] are supported character classes
3213 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3215 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3219 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3220 # (0xd9 and 0xe2), therefore that is a nice testing point.
3221 if test "X$up" = X -o "X$low" = X; then
3222 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3228 if test "X$up" = X -o "X$low" = X; then
3229 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3235 if test "X$up" = X -o "X$low" = X; then
3236 case "`echo RS | od -x 2>/dev/null`" in
3238 echo "Hey, this might be EBCDIC." >&4
3239 if test "X$up" = X -o "X$low" = X; then
3240 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3241 rs) up='[A-IJ-RS-Z]'
3246 if test "X$up" = X -o "X$low" = X; then
3247 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3257 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3259 echo "Using $up and $low to convert case." >&4
3262 echo "I don't know how to translate letters from upper to lower case." >&4
3263 echo "Your tr is not acting any way I know of." >&4
3267 : set up the translation script tr, must be called with ./tr of course
3271 '[A-Z][a-z]') exec $tr '$up' '$low';;
3272 '[a-z][A-Z]') exec $tr '$low' '$up';;
3279 : Try to determine whether config.sh was made on this system
3280 case "$config_sh" in
3282 myuname=`$uname -a 2>/dev/null`
3283 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3284 # Downcase everything to avoid ambiguity.
3285 # Remove slashes and single quotes so we can use parts of this in
3286 # directory and file names.
3287 # Remove newlines so myuname is sane to use elsewhere.
3288 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3289 # because the A-Z/a-z are not consecutive.
3290 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3291 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3292 newmyuname="$myuname"
3294 case "$knowitall" in
3296 if test -f ../config.sh; then
3297 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3298 eval "`grep myuname= ../config.sh`"
3300 if test "X$myuname" = "X$newmyuname"; then
3308 : Get old answers from old config file if Configure was run on the
3309 : same system, otherwise use the hints.
3312 if test -f config.sh; then
3314 rp="I see a config.sh file. Shall I use it to set the defaults?"
3317 n*|N*) echo "OK, I'll ignore it."
3318 mv config.sh config.sh.old
3319 myuname="$newmyuname"
3321 *) echo "Fetching default answers from your old config.sh file..." >&4
3329 : Older versions did not always set $sh. Catch re-use of such
3339 if test ! -f config.sh; then
3342 First time through, eh? I have some defaults handy for some systems
3343 that need some extra help getting the Configure answers right:
3346 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3348 : Half the following guesses are probably wrong... If you have better
3349 : tests or hints, please send them to perlbug@perl.org
3350 : The metaconfig authors would also appreciate a copy...
3351 $test -f /irix && osname=irix
3352 $test -f /xenix && osname=sco_xenix
3353 $test -f /dynix && osname=dynix
3354 $test -f /dnix && osname=dnix
3355 $test -f /lynx.os && osname=lynxos
3356 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3357 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3358 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3359 $test -f /bin/mips && /bin/mips && osname=mips
3360 $test -d /usr/apollo/bin && osname=apollo
3361 $test -f /etc/saf/_sactab && osname=svr4
3362 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3363 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3364 $test -f /sys/utilities/MultiView && osname=amigaos
3365 if $test -d /MachTen -o -d /MachTen_Folder; then
3367 if $test -x /sbin/version; then
3368 osvers=`/sbin/version | $awk '{print $2}' |
3369 $sed -e 's/[A-Za-z]$//'`
3370 elif $test -x /usr/etc/version; then
3371 osvers=`/usr/etc/version | $awk '{print $2}' |
3372 $sed -e 's/[A-Za-z]$//'`
3378 $test -f /sys/posix.dll &&
3379 $test -f /usr/bin/what &&
3380 set X `/usr/bin/what /sys/posix.dll` &&
3381 $test "$3" = UWIN &&
3385 if $test -f $uname; then
3393 umips) osname=umips ;;
3396 [23]100) osname=mips ;;
3398 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3399 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3402 elif $test -f /etc/kconfig; then
3404 if test "$lns" = "$ln -s"; then
3406 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3408 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3415 if test -n "$DJGPP"; then
3424 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3426 # oslevel can fail with:
3427 # oslevel: Unable to acquire lock.
3428 *not\ found) osvers="$4"."$3" ;;
3429 '<3240'|'<>3240') osvers=3.2.0 ;;
3430 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3431 '=3250'|'>3250') osvers=3.2.5 ;;
3435 bitrig) osname=bitrig
3438 bsd386) osname=bsd386
3441 cygwin*) osname=cygwin
3444 *dc.osx) osname=dcosx
3450 domainos) osname=apollo
3456 dragonfly) osname=dragonfly
3459 dynixptx*) osname=dynixptx
3460 osvers=`echo "$4"|sed 's/^v//'`
3462 freebsd) osname=freebsd
3464 genix) osname=genix ;;
3468 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3481 $test -f /system/lib/libandroid.so && osname=linux-android
3485 netbsd*) osname=netbsd
3488 news-os) osvers="$3"
3490 4*) osname=newsos4 ;;
3494 nonstop-ux) osname=nonstopux ;;
3495 openbsd) osname=openbsd
3501 POSIX-BC | posix-bc ) osname=posix-bc
3504 powerux | power_ux | powermax_os | powermaxos | \
3505 powerunix | power_unix) osname=powerux
3511 solaris) osname=solaris
3513 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3520 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3524 titanos) osname=titanos
3533 ultrix) osname=ultrix
3536 osf1|mls+) case "$5" in
3539 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3542 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3545 hp*) osname=hp_osf1 ;;
3546 mips) osname=mips_osf1 ;;
3549 # UnixWare 7.1.2 is known as Open UNIX 8
3550 openunix|unixware) osname=svr5
3558 $2) case "$osname" in
3562 : svr4.x or possibly later
3572 if test -f /stand/boot ; then
3573 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3574 if test -n "$INITPROG" -a -f "$INITPROG"; then
3575 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3576 if test -n "$isesix"; then
3584 *) if test -f /etc/systemid; then
3586 set `echo $3 | $sed 's/\./ /g'` $4
3587 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3589 elif $test -f $src/hints/sco_$1_$2.sh; then
3591 elif $test -f $src/hints/sco_$1.sh; then
3596 '') : Still unknown. Probably a generic Sys V.
3605 *) case "$osname" in
3606 '') : Still unknown. Probably a generic BSD.
3614 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3615 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3616 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3619 $rm -f UU/kernel.what
3620 elif test -d c:/. -o -n "$is_os2" ; then
3627 case "$targetarch" in
3630 case "$targetarch" in
3632 # Will load qnx.sh, which should change osname to nto
3637 # Catch arm-linux-androideabi, mipsel-linux-android,
3638 # and i686-linux-android
3639 osname=linux-android
3643 # Something like arm-linux-gnueabihf is really just
3650 # XXX perhaps we should just assume
3651 # osvers to be 2, or maybe take the value
3652 # from targetarch. Using $run before the
3653 # hints are run is somewhat icky.
3654 set X `$run $uname -a 2>/dev/null`
3657 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3662 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3669 : Now look for a hint file osname_osvers, unless one has been
3670 : specified already.
3673 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3674 : Also try without trailing minor version numbers.
3675 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3676 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3677 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3678 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3681 *) case "$osvers" in
3684 *) if $test -f $src/hints/$file.sh ; then
3686 elif $test -f $src/hints/$xfile.sh ; then
3688 elif $test -f $src/hints/$xxfile.sh ; then
3690 elif $test -f $src/hints/$xxxfile.sh ; then
3692 elif $test -f $src/hints/$xxxxfile.sh ; then
3694 elif $test -f "$src/hints/${osname}.sh" ; then
3703 if $test -f Policy.sh ; then
3706 none) dflt="Policy" ;;
3707 *) dflt="Policy $dflt" ;;
3712 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3716 if $test -f Policy.sh ; then
3719 There's also a Policy hint file available, which should make the
3720 site-specific (policy) questions easier to answer.
3727 You may give one or more space-separated answers, or "none" if appropriate.
3728 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3729 previous run of Configure, you may specify it as well as or instead of
3730 OS-specific hints. If hints are provided for your OS, you should use them:
3731 although Perl can probably be built without hints on many platforms, using
3732 hints often improve performance and may enable features that Configure can't
3733 set up on its own. If there are no hints that match your OS, specify "none";
3734 DO NOT give a wrong version or a wrong OS.
3738 rp="Which of these apply, if any?"
3741 for file in $tans; do
3742 if $test X$file = XPolicy -a -f Policy.sh; then
3744 $cat Policy.sh >> UU/config.sh
3745 elif $test -f $src/hints/$file.sh; then
3746 . $src/hints/$file.sh
3747 $cat $src/hints/$file.sh >> UU/config.sh
3748 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3751 : Give one chance to correct a possible typo.
3752 echo "$file.sh does not exist"
3754 rp="hint to use instead?"
3756 for file in $ans; do
3757 if $test -f "$src/hints/$file.sh"; then
3758 . $src/hints/$file.sh
3759 $cat $src/hints/$file.sh >> UU/config.sh
3760 elif $test X$ans = X -o X$ans = Xnone ; then
3763 echo "$file.sh does not exist -- ignored."
3770 : Remember our hint file for later.
3771 if $test -f "$src/hints/$file.sh" ; then
3781 echo "Fetching default answers from $config_sh..." >&4
3785 cp $config_sh config.sh 2>/dev/null
3797 : Restore computed paths
3798 for file in $loclist $trylist; do
3799 eval $file="\$_$file"
3804 Configure uses the operating system name and version to set some defaults.
3805 The default value is probably right if the name rings a bell. Otherwise,
3806 since spelling matters for me, either accept the default or answer "none"
3813 ''|' '|none) dflt=none ;;
3814 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3817 *) dflt="$osname" ;;
3819 rp="Operating system name?"
3823 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3829 ''|' '|none) dflt=none ;;
3830 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3831 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3833 ''|' ') dflt=none ;;
3838 *) dflt="$osvers" ;;
3840 rp="Operating system version?"
3850 : who configured the system
3851 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3854 cf_by=`(logname) 2>/dev/null`
3857 cf_by=`(whoami) 2>/dev/null`
3859 "") cf_by=unknown ;;
3864 : decide how portable to be. Allow command line overrides.
3865 case "$d_portable" in
3867 *) d_portable="$define" ;;
3870 : set up shell script to do ~ expansion
3876 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3879 if $test -f /bin/csh; then
3880 /bin/csh -f -c "glob \$1"
3885 name=\`$expr x\$1 : '..\([^/]*\)'\`
3886 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3887 if $test ! -d "\$dir"; then
3889 echo "\$me: can't locate home directory for: \$name" >&2
3894 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3910 : now set up to get a file name
3914 cat <<'EOSC' >>getfile
3930 : getfile will accept an answer from the comma-separated list
3931 : enclosed in parentheses even if it does not meet other criteria.
3932 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3933 fn=`echo $fn | sed 's/(.*)//'`
3939 loc_file=`expr $fn : '.*:\(.*\)'`
3940 fn=`expr $fn : '\(.*\):.*'`
3948 */*) fullpath=true;;
3957 *e*) exp_file=true;;
3960 *p*) nopath_ok=true;;
3965 *d*) type='Directory';;
3966 *l*) type='Locate';;
3971 Locate) what='File';;
3976 case "$d_portable" in
3984 while test "$type"; do
3989 true) rp="$rp (~name ok)";;
3992 if test -f UU/getfile.ok && \
3993 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4012 value=`UU/filexp $ans`
4015 if test "$ans" != "$value"; then
4016 echo "(That expands to $value on this system.)"
4030 /*) value="$ansexp" ;;
4031 [a-zA-Z]:/*) value="$ansexp" ;;
4036 echo "I shall only accept a full path name, as in /bin/ls." >&4
4037 echo "Use a ! shell escape if you wish to check pathnames." >&4
4040 echo "Please give a full path name, starting with slash." >&4
4043 echo "Note that using ~name is ok provided it expands well." >&4
4056 for fp in $gfpth; do
4057 if test "X$fp" = X.; then
4062 if test -f "$pf"; then
4064 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4066 echo "($value is not a plain file, but that's ok.)"
4069 if test X"$type" = X; then
4076 for fp in $gfpth; do
4077 if test "X$fp" = X.; then
4082 direxp="$fp/$ansexp"
4084 if test -d "$direxp"; then
4092 if test -d "$ansexp"; then
4093 echo "(Looking for $loc_file in directory $value.)"
4094 value="$value/$loc_file"
4095 ansexp="$ansexp/$loc_file"
4097 if test -f "$ansexp"; then
4100 case "$nopath_ok" in
4101 true) case "$value" in
4103 *) echo "Assuming $value will be in people's path."
4119 if test "$fastread" = yes; then
4124 rp="$what $value doesn't exist. Use that name anyway?"
4143 test "X$gfpthkeep" != Xy && gfpth=""
4146 : determine root of directory hierarchy where package will be installed.
4149 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4152 dflt=`echo "$prefix" | sed 's/.$//'`
4160 By default, $package will be installed in $dflt/bin, manual pages
4161 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4162 installation directories. Typically this is something like /usr/local.
4163 If you wish to have binaries under /usr/bin but other parts of the
4164 installation under /usr/local, that's ok: you will be prompted
4165 separately for each of the installation directories, the prefix being
4166 only used to set the defaults.
4170 rp='Installation prefix to use?'
4178 *) oldprefix="$prefix";;
4185 : allow them to override the AFS root
4188 *) afsroot=$afsroot ;;
4194 $define|true) afs=true ;;
4195 $undef|false) afs=false ;;
4196 *) if $test -d $afsroot; then
4204 echo "AFS may be running... I'll be extra cautious then..." >&4
4206 echo "AFS does not seem to be running..." >&4
4209 : determine installation prefix for where package is to be installed.
4213 Since you are running AFS, I need to distinguish the directory in which
4214 files will reside from the directory in which they are installed (and from
4215 which they are presumably copied to the former directory by occult means).
4218 case "$installprefix" in
4219 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4220 *) dflt="$installprefix";;
4225 In some special cases, particularly when building $package for distribution,
4226 it is convenient to distinguish the directory in which files should be
4227 installed from the directory ($prefix) in which they will
4228 eventually reside. For most users, these two directories are the same.
4231 case "$installprefix" in
4233 *) dflt=$installprefix;;
4237 rp='What installation prefix should I use for installing files?'
4239 installprefix="$ans"
4240 installprefixexp="$ansexp"
4242 : Perform the prefixexp/installprefixexp correction if necessary
4243 cat <<EOS >installprefix
4246 cat <<'EOSC' >>installprefix
4247 : Change installation prefix, if necessary.
4248 if $test X"$prefix" != X"$installprefix"; then
4249 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4251 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4254 chmod +x installprefix
4255 $eunicefix installprefix
4257 : Set variables such as privlib and privlibexp from the output of ./getfile
4258 : performing the prefixexp/installprefixexp correction if necessary.
4259 cat <<EOS >setprefixvar
4262 cat <<'EOSC' >>setprefixvar
4263 eval "${prefixvar}=\"\$ans\""
4264 eval "${prefixvar}exp=\"\$ansexp\""
4267 chmod +x setprefixvar
4268 $eunicefix setprefixvar
4270 : set up the script used to warn in case of inconsistency
4279 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4281 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4282 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4287 echo "*** WHOA THERE!!! ***" >&4
4288 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4291 rp=" Keep the $hint value?"
4294 y) td=$was; tu=$was;;
4298 : function used to set '$1' to '$val'
4299 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4301 $define$undef) . ./whoa; eval "$var=\$td";;
4302 $undef$define) . ./whoa; eval "$var=\$tu";;
4303 *) eval "$var=$val";;
4306 : get the patchlevel
4308 echo "Getting the current patchlevel..." >&4
4309 if $test -r $rsrc/patchlevel.h;then
4310 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4311 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4312 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4313 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4314 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4315 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4316 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4325 $echo "(You do not have patchlevel.h. Eek.)"
4327 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4328 version_patchlevel_string="version $patchlevel subversion $subversion"
4329 case "$perl_patchlevel" in
4331 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4332 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4336 $echo "(You have $package $version_patchlevel_string.)"
4340 : XXX Should be a Configure test for double-dots in filenames.
4341 version=`echo $revision $patchlevel $subversion | \
4342 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4343 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4344 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4347 version=`echo $revision $patchlevel $subversion | \
4348 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4349 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4350 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4353 : Special case the 5.005_xx maintenance series, which used 5.005
4354 : without any subversion label as a subdirectory in $sitelib
4355 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4356 api_versionstring='5.005'
4359 : Do we want threads support and if so, what type
4360 case "$usethreads" in
4361 $define|true|[yY]*) dflt='y';;
4362 *) # Catch case where user specified ithreads or 5005threads but
4363 # forgot -Dusethreads (A.D. 4/2002)
4364 case "$useithreads$use5005threads" in
4365 *$define*) dflt='y';;
4372 Perl can be built to offer a form of threading support on some systems
4373 To do so, Configure can be run with -Dusethreads.
4375 Note that Perl built with threading support runs slightly slower
4376 and uses slightly more memory than plain Perl.
4378 If this doesn't make any sense to you, just accept the default '$dflt'.
4380 rp='Build a threading Perl?'
4383 y|Y) val="$define" ;;
4389 if $test $patchlevel -lt 9; then
4390 case "$usethreads" in
4392 : Default to ithreads unless overridden on command line or with
4395 case "$use5005threads" in
4397 echo "5.005 threads are no longer supported"
4401 case "$useithreads" in
4402 $undef|false|[nN]*) dflt='n';;
4404 rp='Use the newer interpreter-based ithreads?'
4407 y|Y) val="$define" ;;
4412 : Now set use5005threads to the opposite value.
4413 case "$useithreads" in
4414 $define) val="$undef" ;;
4421 useithreads="$undef"
4422 use5005threads="$undef"
4426 case "$useithreads$use5005threads" in
4430 You cannot have both the ithreads and the 5.005 threads enabled
4431 at the same time. Disabling the 5.005 threads since they are
4432 much less stable than the ithreads.
4435 use5005threads="$undef"
4440 : perl-5.9.x and later
4442 if test X"$usethreads" = "X$define"; then
4443 case "$use5005threads" in
4447 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4454 use5005threads="$undef"
4455 useithreads="$usethreads"
4458 case "$d_oldpthreads" in
4459 '') : Configure tests would be welcome here. For now, assume undef.
4461 *) val="$d_oldpthreads" ;;
4467 : Look for a hint-file generated 'call-back-unit'. If the
4468 : user has specified that a threading perl is to be built,
4469 : we may need to set or change some other defaults.
4470 if $test -f usethreads.cbu; then
4471 echo "Your platform has some specific hints regarding threaded builds, using them..."
4474 case "$usethreads" in
4475 "$define"|true|[yY]*)
4477 (Your platform does not have any specific hints for threaded builds.
4478 Assuming POSIX threads, then.)
4484 : Check if multiplicity is required
4487 Perl can be built so that multiple Perl interpreters can coexist
4488 within the same Perl executable.
4491 case "$useithreads" in
4494 This multiple interpreter support is required for interpreter-based threads.
4498 *) case "$usemultiplicity" in
4499 $define|true|[yY]*) dflt='y';;
4503 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4504 rp='Build Perl for multiplicity?'
4507 y|Y) val="$define" ;;
4515 : Check if morebits is requested
4516 case "$usemorebits" in
4517 "$define"|true|[yY]*)
4518 use64bitint="$define"
4519 uselongdouble="$define"
4520 usemorebits="$define"
4522 *) usemorebits="$undef"
4526 : Determine the C compiler to be used
4532 rp="Use which C compiler?"
4536 : See whether they have no cc but they do have gcc
4538 if $test -f cc.cbu; then
4543 : make some quick guesses about what we are up against
4545 $echo $n "Hmm... $c"
4555 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4556 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4558 echo "Looks kind of like an OSF/1 system, but we'll see..."
4560 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4561 xxx=`./loc addbib blurfl $pth`
4562 if $test -f $xxx; then
4563 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4567 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4568 echo "Looks kind of like an extended USG system, but we'll see..."
4570 echo "Looks kind of like a USG system, but we'll see..."
4574 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4575 echo "Looks kind of like a BSD system, but we'll see..."
4579 echo "Looks kind of like a Version 7 system, but we'll see..."
4582 case "$eunicefix" in
4585 There is, however, a strange, musty smell in the air that reminds me of
4586 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4590 : it so happens the Eunice I know will not run shell scripts in Unix format
4594 echo "Congratulations. You aren't running Eunice."
4598 : Detect OS2. The p_ variable is set above in the Head.U unit.
4599 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4600 : semicolon as a patch separator
4605 I have the feeling something is not exactly right, however...don't tell me...
4606 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4607 (Or you may be running DOS with DJGPP.)
4612 if test -f /xenix; then
4613 echo "Actually, this looks more like a XENIX system..."
4618 echo "It's not Xenix..."
4623 if test -f /venix; then
4624 echo "Actually, this looks more like a VENIX system..."
4631 echo "Nor is it Venix..."
4634 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4635 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4638 : Check if we are using GNU gcc and what its version is
4640 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4644 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4646 printf("%s\n", __VERSION__);
4648 printf("%s\n", "1");
4654 if $cc -o try $ccflags $ldflags try.c; then
4655 gccversion=`$run ./try`
4656 case "$gccversion" in
4657 '') echo "You are not using GNU cc." ;;
4658 *) echo "You are using GNU cc $gccversion."
4664 echo "*** WHOA THERE!!! ***" >&4
4665 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4666 case "$knowitall" in
4668 echo " You'd better start hunting for one and let me know about it." >&4
4674 case "$gccversion" in
4675 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4677 case "$gccversion" in
4678 '') gccosandvers='' ;;
4679 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4680 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4682 case "$gccosandvers" in
4683 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4684 $osname$osvers) ;; # looking good
4685 $osname*) cat <<EOM >&4
4687 *** WHOA THERE!!! ***
4689 Your gcc has not been compiled for the exact release of
4690 your operating system ($gccosandvers versus $osname$osvers).
4692 In general it is a good idea to keep gcc synchronized with
4693 the operating system because otherwise serious problems
4694 may ensue when trying to compile software, like Perl.
4696 I'm trying to be optimistic here, though, and will continue.
4697 If later during the configuration and build icky compilation
4698 problems appear (headerfile conflicts being the most common
4699 manifestation), I suggest reinstalling the gcc to match
4700 your operating system release.
4704 *) gccosandvers='' ;; # failed to parse, better be silent
4712 # gcc 3.* complain about adding -Idirectories that they already know about,
4713 # so we will take those off from locincpth.
4714 case "$gccversion" in
4716 echo "main(){}">try.c
4717 for incdir in $locincpth; do
4718 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4719 grep '^c[cp]p*[01]: warning: changing search order '`
4720 if test "X$warn" != X; then
4721 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4727 # gcc 4.9 by default does some optimizations that break perl.
4728 # see ticket 121505.
4730 # The -fwrapv disables those optimizations (and probably others,) so
4731 # for gcc 4.9 (and later, since the optimizations probably won't go
4732 # away), add -fwrapv unless the user requests -fno-wrapv, which
4733 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4734 # which turns the overflows -fwrapv ignores into runtime errors.
4735 case "$gccversion" in
4736 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4738 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4739 *) ccflags="$ccflags -fwrapv" ;;
4743 : What should the include directory be ?
4744 : Use sysroot if set, so findhdr looks in the right place.
4746 $echo $n "Hmm... $c"
4747 dflt="$sysroot/usr/include"
4750 if $test -f /bin/mips && /bin/mips; then
4751 echo "Looks like a MIPS system..."
4752 $cat >usr.c <<'EOCP'
4753 #ifdef SYSTYPE_BSD43
4757 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4758 dflt='/bsd43/usr/include'
4762 mips_type='System V'
4764 $rm -f usr.c usr.out
4765 echo "and you're compiling with the $mips_type compiler and libraries."
4769 echo "Doesn't look like a MIPS system."
4779 case "$xxx_prompt" in
4782 rp='Where are the include files you want to use?'
4790 : see how we invoke the C preprocessor
4792 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4793 cat <<'EOT' >testcpp.c
4799 if test ! -f cppstdin; then
4800 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4801 # AIX cc -E doesn't show the absolute headerfile
4802 # locations but we'll cheat by using the -M flag.
4803 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
4805 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4808 echo "Keeping your $hint cppstdin wrapper."
4811 wrapper=`pwd`/cppstdin
4815 if $test "X$cppstdin" != "X" && \
4816 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4817 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4819 echo "You used to use $cppstdin $cppminus so we'll use that again."
4821 '') echo "But let's see if we can live without a wrapper..." ;;
4823 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4824 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4826 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4829 echo "(However, $cpprun $cpplast does not work, let's see...)"
4837 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4844 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4845 $cc -E <testcpp.c >testcpp.out 2>&1; \
4846 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4847 echo "Yup, it does."
4848 x_cpp="$cc $cppflags -E"
4850 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4851 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4852 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4853 echo "Yup, it does."
4854 x_cpp="$cc $cppflags -E"
4856 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4857 $cc -P <testcpp.c >testcpp.out 2>&1; \
4858 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4859 echo "Yipee, that works!"
4860 x_cpp="$cc $cppflags -P"
4862 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4863 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4864 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4865 echo "At long last!"
4866 x_cpp="$cc $cppflags -P"
4868 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4869 $cpp <testcpp.c >testcpp.out 2>&1; \
4870 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 x_cpp="$cpp $cppflags"
4874 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4875 $cpp - <testcpp.c >testcpp.out 2>&1; \
4876 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4877 echo "Hooray, it works! I was beginning to wonder."
4878 x_cpp="$cpp $cppflags"
4880 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4881 $wrapper <testcpp.c >testcpp.out 2>&1; \
4882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4888 rp="No dice. I can't find a C preprocessor. Name one:"
4892 $x_cpp <testcpp.c >testcpp.out 2>&1
4893 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4894 echo "OK, that will do." >&4
4896 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4911 echo "Perhaps can we force $cc -E using a wrapper..."
4912 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4913 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4919 echo "Nope, we'll have to live without it..."
4933 "$wrapper"|'cppstdin') ;;
4934 *) $rm -f $wrapper;;
4936 $rm -f testcpp.c testcpp.out
4938 : Adjust cppfilter for path component separator
4940 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4941 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4945 : Use gcc to determine libpth and incpth
4946 # If using gcc or clang, we can get better values for libpth, incpth
4947 # and usrinc directly from the compiler.
4948 # Note that ccname for clang is also gcc.
4951 $echo 'extern int foo;' > try.c
4952 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4954 if $test $# -gt 0; then
4956 incpth="`$echo $incpth|$sed 's/^ //'`"
4958 j="`$echo $i|$sed 's,/include$,/lib,'`"
4959 if $test -d $j; then
4963 libpth="`$echo $libpth|$sed 's/^ //'`"
4964 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4965 if $test -d $xxx; then
4968 *) libpth="$libpth $xxx";;
4975 '') for i in $incpth; do
4976 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4984 case "$usecrosscompile" in
4987 '') echo "Incpth not defined." >&4; croak=y ;;
4988 *) echo "Using incpth '$incpth'." >&4 ;;
4991 '') echo "Libpth not defined." >&4; croak=y ;;
4992 *) echo "Using libpth '$libpth'." >&4 ;;
4995 '') echo "Usrinc not defined." >&4; croak=y ;;
4996 *) echo "Using usrinc $usrinc." >&4 ;;
5000 if test "X$sysroot" = X; then
5001 echo "Cannot continue, aborting." >&4; exit 1
5003 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5012 : Default value for incpth is just usrinc
5014 '') incpth="$usrinc";;
5017 : Set private lib path
5020 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5025 '') dlist="$loclibpth $plibpth $glibpth";;
5026 *) dlist="$libpth";;
5029 : Now check and see which directories actually exist, avoiding duplicates
5032 if $test -d $xxx; then
5035 *) libpth="$libpth $xxx";;
5041 Some systems have incompatible or broken versions of libraries. Among
5042 the directories listed in the question below, please remove any you
5043 know not to be holding relevant libraries, and add any that are needed.
5044 Say "none" for none.
5048 if test "X$sysroot" != X; then
5050 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5063 rp="Directories to use for library searches?"
5070 : compute shared library extension
5073 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5083 On some systems, shared libraries may be available. Answer 'none' if
5084 you want to suppress searching of shared libraries for the remainder
5085 of this configuration.
5088 rp='What is the file extension used for shared libraries?'
5092 : Does target system insist that shared library basenames are unique
5095 Some dynamic loaders assume that the *basename* of shared library filenames
5096 are globally unique. We'll default this to undef as we assume your system
5097 is not this weird. Set to defined if you're on one of them.
5102 rp='Make shared library basenames unique?'
5105 y|Y) val="$define" ;;
5108 set d_libname_unique
5111 : Define several unixisms.
5112 : Hints files or command line option can be used to override them.
5113 : The convoluted testing is in case hints files set either the old
5116 '') case "$exe_ext" in
5118 *) _exe="$exe_ext" ;;
5123 '') case "$lib_ext" in
5130 '') case "$obj_ext" in
5137 '') case "$path_sep" in
5148 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5150 : Which makefile gets called first. This is used by make depend.
5151 case "$firstmakefile" in
5152 '') firstmakefile='makefile';;
5155 : Check is we will use socks
5157 $define|true|[yY]*) dflt='y';;
5162 Perl can be built to use the SOCKS proxy protocol library. To do so,
5163 Configure must be run with -Dusesocks. If you use SOCKS you also need
5164 to use the PerlIO abstraction layer, this will be implicitly selected.
5166 If this doesn't make any sense to you, just accept the default '$dflt'.
5168 rp='Build Perl for SOCKS?'
5171 y|Y) val="$define" ;;
5177 : Check for uselongdouble support
5179 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5182 case "$uselongdouble" in
5183 $define|true|[yY]*) dflt='y';;
5188 Perl can be built to take advantage of long doubles which
5189 (if available) may give more accuracy and range for floating point numbers.
5191 If this doesn't make any sense to you, just accept the default '$dflt'.
5193 rp='Try to use long doubles if available?'
5196 y|Y) val="$define" ;;
5202 case "$uselongdouble" in
5203 true|[yY]*) uselongdouble="$define" ;;
5206 : Look for a hint-file generated 'call-back-unit'. If the
5207 : user has specified that long doubles should be used,
5208 : we may need to set or change some other defaults.
5209 if $test -f uselongdouble.cbu; then
5210 echo "Your platform has some specific hints regarding long doubles, using them..."
5211 . ./uselongdouble.cbu
5213 case "$uselongdouble" in
5216 (Your platform does not have any specific hints for long doubles.)
5222 : Check if quadmath is requested
5223 case "$usequadmath" in
5224 "$define"|true|[yY]*) usequadmath="$define" ;;
5225 *) usequadmath="$undef" ;;
5228 : Looking for optional libraries
5230 echo "Checking for optional libraries..." >&4
5235 case "$libswanted" in
5236 '') libswanted='c_s';;
5239 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5241 case "$usecbacktrace" in
5242 "$define") libswanted="$libswanted bfd" ;;
5244 case "$usequadmath" in
5245 "$define") libswanted="$libswanted quadmath" ;;
5251 for thisdir in $libpth $xlibpth; do
5252 test -d $thisdir && libspath="$libspath $thisdir"
5254 for thislib in $libswanted; do
5255 for thisdir in $libspath; do
5257 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5258 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5259 $test -f "$xxx" && eval $libscheck
5260 $test -f "$xxx" && libstyle=shared
5261 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5262 $test -f "$xxx" && eval $libscheck
5263 $test -f "$xxx" && libstyle=shared
5265 if test ! -f "$xxx"; then
5266 xxx=$thisdir/lib$thislib.$so
5267 $test -f "$xxx" && eval $libscheck
5268 $test -f "$xxx" && libstyle=shared
5270 if test ! -f "$xxx"; then
5271 xxx=$thisdir/lib$thislib$_a
5272 $test -f "$xxx" && eval $libscheck
5273 $test -f "$xxx" && libstyle=static
5275 if test ! -f "$xxx"; then
5276 xxx=$thisdir/$thislib$_a
5277 $test -f "$xxx" && eval $libscheck
5278 $test -f "$xxx" && libstyle=static
5280 if test ! -f "$xxx"; then
5281 xxx=$thisdir/lib${thislib}_s$_a
5282 $test -f "$xxx" && eval $libscheck
5283 $test -f "$xxx" && libstyle=static
5284 $test -f "$xxx" && thislib=${thislib}_s
5286 if test ! -f "$xxx"; then
5287 xxx=$thisdir/Slib$thislib$_a
5288 $test -f "$xxx" && eval $libscheck
5289 $test -f "$xxx" && libstyle=static
5291 if $test -f "$xxx"; then
5293 shared) echo "Found -l$thislib (shared)." ;;
5294 static) echo "Found -l$thislib." ;;
5295 *) echo "Found -l$thislib ($libstyle)." ;;
5299 *) dflt="$dflt -l$thislib"
5300 libsfound="$libsfound $xxx"
5302 libsfiles="$libsfiles $yyy"
5303 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5304 case " $libsdirs " in
5306 *) libsdirs="$libsdirs $yyy" ;;
5313 if $test ! -f "$xxx"; then
5314 echo "No -l$thislib."
5325 ' '|'') dflt='none';;
5330 In order to compile $package on your machine, a number of libraries
5331 are usually needed. Include any other special libraries here as well.
5332 Say "none" for none. The default list is almost always right.
5336 rp="What libraries to use?"
5343 : determine optimization, if desired, or use for debug flag also
5345 ' '|$undef) dflt='none';;
5347 *) dflt="$optimize";;
5351 By default, $package compiles with the -O flag to use the optimizer.
5352 Alternately, you might want to use the symbolic debugger, which uses
5353 the -g flag (on traditional Unix systems). Either flag can be
5354 specified here. To use neither flag, specify the word "none".
5357 rp="What optimizer/debugger flag should be used?"
5361 'none') optimize=" ";;
5364 : Check what DEBUGGING is required from the command line
5365 : -DEBUGGING or -DDEBUGGING or
5366 : -DEBUGGING=both = -g + -DDEBUGGING
5367 : -DEBUGGING=-g or -Doptimize=-g = -g
5368 : -DEBUGGING=none or -UDEBUGGING =
5369 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5372 *) DEBUGGING=$EBUGGING ;;
5375 case "$DEBUGGING" in
5379 *) optimize="$optimize -g" ;;
5383 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5391 case "$DEBUGGING" in
5392 both|$define) dflt='-DDEBUGGING'
5395 : argument order is deliberate, as the flag will start with - which set could
5396 : think is an option
5397 checkccflag='check=$1; flag=$2; callback=$3;
5399 echo "Checking if your compiler accepts $flag" 2>&1;
5400 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5401 echo "int main(void) { return 0; }" > gcctest.c;
5402 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5403 echo "Yes, it does." 2>&1;
5404 if $test -s gcctest.out ; then
5405 echo "But your platform does not like it:";
5410 echo "Leaving current flags $ccflags alone." 2>&1
5412 *) dflt="$dflt $flag";
5418 echo "Nope, it does not, but that is ok." 2>&1;
5422 : We will not override a previous value, but we might want to
5423 : augment a hint file
5425 default|recommended)
5426 case "$gccversion" in
5427 1*) dflt="$dflt -fpcc-struct-return" ;;
5429 case "$optimize:$DEBUGGING" in
5430 *-g*:old) dflt="$dflt -DDEBUGGING";;
5432 case "$gccversion" in
5433 2*) if $test -d /etc/conf/kconfig.d &&
5434 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5436 # Interactive Systems (ISC) POSIX mode.
5441 case "$gccversion" in
5444 ?*) set strict-aliasing -fno-strict-aliasing
5448 # For gcc, adding -pipe speeds up compilations for some, but apparently
5449 # some assemblers can't read from stdin. (It also slows down compilations
5450 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5451 case "$gccversion" in
5457 # on x86_64 (at least) we require an extra library (libssp) in the
5458 # link command line. This library is not named, so I infer that it is
5459 # an implementation detail that may change. Hence the safest approach
5460 # is to add the flag to the flags passed to the compiler at link time,
5461 # as that way the compiler can do the right implementation dependant
5464 amigaos) ;; # -fstack-protector builds but doesn't work
5465 *) case "$gccversion" in
5466 ?*) set stack-protector-strong -fstack-protector-strong
5469 *-fstack-protector-strong*) ;; # It got added.
5470 *) # Try the plain/older -fstack-protector.
5471 set stack-protector -fstack-protector
5482 case "$mips_type" in
5483 *BSD*|'') inclwanted="$locincpth $usrinc";;
5484 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5486 for thisincl in $inclwanted; do
5487 if $test -d $thisincl; then
5488 if $test x$thisincl != x$usrinc; then
5490 *" -I$thisincl "*);;
5491 *) dflt="$dflt -I$thisincl ";;
5497 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5499 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5507 *) dflt="$dflt -D$2";;
5511 set signal.h LANGUAGE_C; eval $inctest
5515 ccflags="$ccflags -DSOCKS"
5520 default|recommended) dflt="$ccflags $dflt" ;;
5521 *) dflt="$ccflags";;
5530 Your C compiler may want other flags. For this question you should include
5531 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5532 but you should NOT include libraries or ld flags like -lwhatever. If you
5533 want $package to honor its debug switch, you should include -DDEBUGGING here.
5534 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5536 To use no flags, specify the word "none".
5542 rp="Any additional cc flags?"
5549 : the following weeds options from ccflags that are of no interest to cpp
5551 '') cppflags="$ccflags" ;;
5552 *) set X $ccflags; shift
5553 case " $cppflags " in
5554 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5555 *) cppflags="$cppflags $ccflags" ;;
5559 case "$gccversion" in
5560 1*) cppflags="$cppflags -D__GNUC__"
5562 case "$mips_type" in
5564 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5570 echo "Let me guess what the preprocessor flags are..." >&4
5584 *) ftry="$previous $flag";;
5586 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5587 >cpp1.out 2>/dev/null && \
5588 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5589 >cpp2.out 2>/dev/null && \
5590 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5591 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5593 cppflags="$cppflags $ftry"
5603 *-*) echo "They appear to be: $cppflags";;
5605 $rm -f cpp.c cpp?.out
5609 : flags used in final linking phase
5611 '') if ./venix; then
5617 *-posix*) dflt="$dflt -posix" ;;
5620 *) dflt="$ldflags";;
5622 # See note above about -fstack-protector
5624 *-fstack-protector-strong*)
5626 *-fstack-protector-strong*) ;; # Don't add it again
5627 *) dflt="$dflt -fstack-protector-strong" ;;
5630 *-fstack-protector*)
5632 *-fstack-protector*) ;; # Don't add it again
5633 *) dflt="$dflt -fstack-protector" ;;
5638 : Try to guess additional flags to pick up local libraries.
5639 for thislibdir in $libpth; do
5640 case " $loclibpth " in
5643 *"-L$thislibdir "*) ;;
5644 *) dflt="$dflt -L$thislibdir" ;;
5656 Your C linker may need flags. For this question you should
5657 include -L/whatever and any other flags used by the C linker, but you
5658 should NOT include libraries like -lwhatever.
5660 Make sure you include the appropriate -L/path flags if your C linker
5661 does not normally search all of the directories you specified above,
5664 To use no flags, specify the word "none".
5668 rp="Any additional ld flags (NOT including libraries)?"
5674 rmlist="$rmlist pdp11"
5678 echo "Checking your choice of C compiler and flags for coherency..." >&4
5679 $cat > try.c <<'EOF'
5681 int main() { printf("Ok\n"); return(0); }
5683 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5685 $cat >try.msg <<'EOM'
5686 I've tried to compile and run the following simple program:
5689 $cat try.c >> try.msg
5691 $cat >> try.msg <<EOM
5698 and I got the following output:
5702 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5703 if $sh -c "$run ./try " >>try.msg 2>&1; then
5707 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5710 echo "The program compiled OK, but exited with status $?." >>try.msg
5711 rp="You have a problem. Shall I abort Configure"
5715 echo "I can't compile the test program." >>try.msg
5716 rp="You have a BIG problem. Shall I abort Configure"
5722 case "$knowitall" in
5724 echo "(The supplied flags or libraries might be incorrect.)"
5732 *) echo "Ok. Stopping Configure." >&4
5737 n) echo "OK, that should do.";;
5739 $rm_try gcctest gcctest.out
5741 : define a shorthand compile call
5745 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5746 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5750 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5751 : define a shorthand compile call for compilations that should be ok.
5755 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5757 : determine filename position in cpp output
5759 echo "Computing filename position in cpp output for #include directives..." >&4
5761 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5766 vos) testaccess=-e ;;
5769 echo '#include <stdio.h>' > foo.c
5772 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5773 $grep '^[ ]*#.*stdio\.h' | \
5774 while read cline; do
5777 while $test \$# -gt 0; do
5778 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5783 pos=\`expr \$pos + 1\`
5797 *) pos="${fieldn}th";;
5799 echo "Your cpp writes the filename in the $pos field of the line."
5801 : locate header file
5806 for usrincdir in $incpth
5808 if test -f \$usrincdir/\$wanted; then
5809 echo "\$usrincdir/\$wanted"
5813 awkprg='{ print \$$fieldn }'
5814 echo "#include <\$wanted>" > foo\$\$.c
5815 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5816 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5817 while read cline; do
5818 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5820 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5821 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5826 # status = 0: grep returned 0 lines, case statement not executed
5827 # status = 1: headerfile found
5828 # status = 2: while loop executed, no headerfile found
5832 if test \$status -eq 1; then
5839 : define an alternate in-header-list? function
5840 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5841 cont=true; xxf="echo \"<\$1> found.\" >&4";
5842 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5843 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5845 case $# in 4) instead=instead;; *) instead="at last";; esac;
5846 while $test "$cont"; do
5848 var=$2; eval "was=\$$2";
5849 if $test "$xxx" && $test -r "$xxx";
5851 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5854 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5855 set $yyy; shift; shift; yyy=$@;
5856 case $# in 0) cont="";;
5857 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5858 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5859 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5860 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5864 do set $yyy; var=$2; eval "was=\$$2";
5865 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5866 set $yyy; shift; shift; yyy=$@;
5869 : see if stdlib is available
5870 set stdlib.h i_stdlib
5873 : check for lengths of integral types
5877 echo "Checking to see how big your integers are..." >&4
5886 printf("intsize=%d;\n", (int)sizeof(int));
5887 printf("longsize=%d;\n", (int)sizeof(long));
5888 printf("shortsize=%d;\n", (int)sizeof(short));
5893 if eval $compile_ok && $run ./try > /dev/null; then
5895 echo "Your integers are $intsize bytes long."
5896 echo "Your long integers are $longsize bytes long."
5897 echo "Your short integers are $shortsize bytes long."
5901 Help! I can't compile and run the intsize test program: please enlighten me!
5902 (This is probably a misconfiguration in your system or libraries, and
5903 you really ought to fix it. Still, I'll try anyway.)
5907 rp="What is the size of an integer (in bytes)?"
5911 rp="What is the size of a long integer (in bytes)?"
5915 rp="What is the size of a short integer (in bytes)?"
5923 : check for long long
5925 echo "Checking to see if you have long long..." >&4
5926 echo 'int main() { long long x = 7; return 0; }' > try.c
5928 if eval $compile; then
5930 echo "You have long long."
5933 echo "You do not have long long."
5939 : check for length of long long
5940 case "${d_longlong}${longlongsize}" in
5943 echo "Checking to see how big your long longs are..." >&4
5944 $cat >try.c <<'EOCP'
5948 printf("%d\n", (int)sizeof(long long));
5953 if eval $compile_ok; then
5954 longlongsize=`$run ./try`
5955 echo "Your long longs are $longlongsize bytes long."
5959 echo "(I can't seem to compile the test program. Guessing...)"
5960 rp="What is the size of a long long (in bytes)?"
5964 if $test "X$longsize" = "X$longlongsize"; then
5965 echo "(That isn't any different from an ordinary long.)"
5971 : see if inttypes.h is available
5972 : we want a real compile instead of Inhdr because some systems
5973 : have an inttypes.h which includes non-existent headers
5976 #include <inttypes.h>
5978 static int32_t foo32 = 0x12345678;
5982 if eval $compile; then
5983 echo "<inttypes.h> found." >&4
5986 echo "<inttypes.h> NOT found." >&4
5995 echo "Checking to see if you have int64_t..." >&4
5997 #include <sys/types.h>
5998 #$i_inttypes I_INTTYPES
6000 #include <inttypes.h>
6002 int main() { int64_t x = 7; }
6005 if eval $compile; then
6007 echo "You have int64_t."
6010 echo "You do not have int64_t."
6016 : Check if 64bit ints have a quad type
6018 echo "Checking which 64-bit integer type we could use..." >&4
6024 val='"unsigned int"'
6029 *) case "$longsize" in
6033 val='"unsigned long"'
6038 *) case "$d_longlong:$longlongsize" in
6043 val='"unsigned long long"'
6048 *) case "$d_int64_t" in
6067 '') echo "Alas, no 64-bit integer types in sight." >&4
6070 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6075 : Do we want 64bit support
6076 case "$uselonglong" in
6077 "$define"|true|[yY]*)
6080 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6082 use64bitint="$define"
6085 case "$use64bits" in
6086 "$define"|true|[yY]*)
6089 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6091 use64bitint="$define"
6094 case "$use64bitints" in
6095 "$define"|true|[yY]*)
6098 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6100 use64bitint="$define"
6103 case "$use64bitsint" in
6104 "$define"|true|[yY]*)
6107 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6109 use64bitint="$define"
6112 case "$uselonglongs" in
6113 "$define"|true|[yY]*)
6116 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6118 use64bitint="$define"
6121 case "$use64bitsall" in
6122 "$define"|true|[yY]*)
6125 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6127 use64bitall="$define"
6132 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6134 case "$use64bitall" in
6135 "$define"|true|[yY]*) use64bitint="$define" ;;
6141 You have natively 64-bit long integers.
6145 *) case "$use64bitint" in
6146 "$define"|true|[yY]*) dflt='y';;
6155 Perl can be built to take advantage of 64-bit integer types
6156 on some systems. To do so, Configure can be run with -Duse64bitint.
6157 Choosing this option will most probably introduce binary incompatibilities.
6159 If this doesn't make any sense to you, just accept the default '$dflt'.
6160 (The default has been chosen based on your configuration.)
6162 rp='Try to use 64-bit integers, if available?'
6165 [yY]*) val="$define" ;;
6173 case "$use64bitall" in
6174 "$define"|true|[yY]*) dflt='y' ;;
6175 *) case "$longsize" in
6183 You may also choose to try maximal 64-bitness. It means using as much
6184 64-bitness as possible on the platform. This in turn means even more
6185 binary incompatibilities. On the other hand, your platform may not
6186 have any more 64-bitness available than what you already have chosen.
6188 If this doesn't make any sense to you, just accept the default '$dflt'.
6189 (The default has been chosen based on your configuration.)
6191 rp='Try to use maximal 64-bit support, if available?'
6194 [yY]*) val="$define" ;;
6199 case "$use64bitall" in
6201 case "$use64bitint" in
6205 Since you have chosen a maximally 64-bit build, I'm also turning on
6206 the use of 64-bit integers.
6208 use64bitint="$define" ;;
6213 : Look for a hint-file generated 'call-back-unit'. If the
6214 : user has specified that a 64-bit perl is to be built,
6215 : we may need to set or change some other defaults.
6216 if $test -f use64bitint.cbu; then
6217 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6220 case "$use64bitint" in
6221 "$define"|true|[yY]*)
6222 : This test was common to all the OpenBSD forks, and seems harmless for
6225 echo "Checking if your C library has broken 64-bit functions..." >&4
6228 typedef $uquadtype myULL;
6235 {4294967303.15, 4294967303ULL},
6236 {4294967294.2, 4294967294ULL},
6237 {4294967295.7, 4294967295ULL},
6240 for (p = test; p->u; p++) {
6241 myULL x = (myULL)p->d;
6252 if eval $compile_ok; then
6253 libcquad=`$run ./try`
6254 echo "Your C library's 64-bit functions are $libcquad."
6256 echo "(I can't seem to compile the test program.)"
6257 echo "Assuming that your C library's 64-bit functions are ok."
6266 *** You have a C library with broken 64-bit functions.
6267 *** 64-bit support does not work reliably in this configuration.
6268 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6269 *** Cannot continue, aborting.
6276 4) case "$archname64" in
6277 '') archname64=64int ;;
6284 : Look for a hint-file generated 'call-back-unit'. If the
6285 : user has specified that a maximally 64-bit perl is to be built,
6286 : we may need to set or change some other defaults.
6287 if $test -f use64bitall.cbu; then
6288 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6291 case "$use64bitall" in
6292 "$define"|true|[yY]*)
6294 4) case "$archname64" in
6295 ''|64int) archname64=64all ;;
6302 case "$d_quad:$use64bitint" in
6306 *** You have chosen to use 64-bit integers,
6307 *** but none can be found.
6308 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6309 *** Cannot continue, aborting.
6316 : Check if we are using the GNU C library
6318 echo "Checking for GNU C Library..." >&4
6320 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6321 alone are insufficient to distinguish different versions, such as
6322 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6323 libc version 2.1.0. A. Dougherty, June 3, 2002.
6329 # ifdef __GLIBC_MINOR__
6330 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6331 # include <gnu/libc-version.h>
6332 printf("%s\n", gnu_get_libc_version());
6334 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6337 printf("%d\n", __GLIBC__);
6346 if eval $compile_ok && $run ./try > glibc.ver; then
6348 gnulibc_version=`$cat glibc.ver`
6349 echo "You are using the GNU C Library version $gnulibc_version"
6353 echo "You are not using the GNU C Library"
6359 : see if nm is to be used to determine whether a symbol is defined or not
6363 case "$d_gnulibc" in
6366 echo "nm probably won't work on the GNU C Library." >&4
6372 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6374 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6375 echo "'nm' won't be sufficient on this system." >&4
6381 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6382 if $test $dflt -gt 20; then
6392 true|$define) dflt=y;;
6399 I can use $nm to extract the symbols from your C libraries. This
6400 is a time consuming task which may generate huge output on the disk (up
6401 to 3 megabytes) but that should make the symbols extraction faster. The
6402 alternative is to skip the 'nm' extraction part and to compile a small
6403 test program instead to determine whether each symbol is present. If
6404 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6405 this may be the best solution.
6407 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6410 rp="Shall I use $nm to extract C symbols from the libraries?"
6413 [Nn]*) usenm=false;;
6422 : nm options which may be necessary
6424 '') if $test -f /mach_boot; then
6426 elif $test -d /usr/ccs/lib; then
6427 nm_opt='-p' # Solaris (and SunOS?)
6428 elif $test -f /dgux; then
6430 elif $test -f /lib64/rld; then
6431 nm_opt='-p' # 64-bit Irix
6437 : nm options which may be necessary for shared libraries but illegal
6438 : for archive libraries. Thank you, Linux.
6439 case "$nm_so_opt" in
6440 '') case "$myuname" in
6442 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6443 nm_so_opt='--dynamic'
6450 : Figure out where the libc is located
6453 : get list of predefined functions in a handy place
6458 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6464 *) for thislib in $libs; do
6467 : Handle C library specially below.
6470 thislib=`echo $thislib | $sed -e 's/^-l//'`
6471 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6473 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6475 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6477 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6479 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6481 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6483 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6488 libnames="$libnames $try"
6490 *) libnames="$libnames $thislib" ;;
6499 for xxx in $libpth; do
6500 $test -r $1 || set $xxx/libc.$so
6501 : The messy sed command sorts on library version numbers.
6503 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6504 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6506 s/[0-9][0-9]*/0000&/g
6507 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6510 $sort | $sed -e 's/^.* //'`
6513 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6514 $test -r $1 || set $sysroot/lib/libsys_s$_a
6520 if $test -r "$1"; then
6521 echo "Your (shared) C library seems to be in $1."
6523 elif $test -r /lib/libc && $test -r /lib/clib; then
6524 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6526 libc='/lib/clib /lib/libc'
6527 if $test -r /lib/syslib; then
6528 echo "(Your math library is in /lib/syslib.)"
6529 libc="$libc /lib/syslib"
6531 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6532 echo "Your C library seems to be in $libc, as you said before."
6533 elif $test -r $incpath/usr/lib/libc$_a; then
6534 libc=$incpath/usr/lib/libc$_a;
6535 echo "Your C library seems to be in $libc. That's fine."
6536 elif $test -r /lib/libc$_a; then
6538 echo "Your C library seems to be in $libc. You're normal."
6540 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6542 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6543 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6544 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6546 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6548 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6551 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6553 if $test -r "$tans"; then
6554 echo "Your C library seems to be in $tans, of all places."
6560 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6564 If the guess above is wrong (which it might be if you're using a strange
6565 compiler, or your machine supports multiple models), you can override it here.
6570 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6572 I can't seem to find your C library. I've looked in the following places:
6575 $sed 's/^/ /' libpath
6578 None of these seems to contain your C library. I need to get its name...
6583 rp='Where is your C library?'
6588 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6589 set X `cat libnames`
6592 case $# in 1) xxx=file; esac
6593 echo "Extracting names from the following $xxx for later perusal:" >&4
6595 $sed 's/^/ /' libnames >&4
6597 $echo $n "This may take a while...$c" >&4
6601 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6602 *) $nm $nm_opt $file 2>/dev/null;;
6607 $grep fprintf libc.tmp > libc.ptf
6608 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6609 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6611 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6615 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6619 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6623 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6627 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6631 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6635 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6636 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 $nm -p $* 2>/dev/null >libc.tmp
6670 $grep fprintf libc.tmp > libc.ptf
6671 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6672 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6678 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6680 if $ar t $libc > libc.tmp && \
6681 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6683 for thisname in $libnames $libc; do
6684 $ar t $thisname >>libc.tmp
6686 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6688 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6689 for thisname in $libnames $libc; do
6690 $ar tv $thisname >>libc.tmp
6691 emximp -o tmp.imp $thisname \
6693 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6694 < tmp.imp >>libc.tmp
6697 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6700 echo "$ar didn't seem to work right." >&4
6701 echo "Maybe this is a Cray...trying bld instead..." >&4
6703 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6706 for thisname in $libnames; do
6708 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6709 $ar t $thisname >>libc.tmp
6713 echo "That didn't work either. Giving up." >&4
6723 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6724 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6726 *) if $test -f /lib/syscalls.exp; then
6728 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6729 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6730 /lib/syscalls.exp >>libc.list
6736 $rm -f libnames libpath
6738 : Check if we are using C++
6740 echo "Checking for C++..." >&4
6741 $cat >try.c <<'EOCP'
6753 if eval $compile_ok && $run ./try; then
6755 echo "You are using a C++ compiler."
6758 echo "You are not using a C++ compiler."
6764 : is a C symbol defined?
6767 -v) tf=libc.tmp; tdc="";;
6768 -a) tf=libc.tmp; tdc="[]";;
6769 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6771 case "$d_cplusplus" in
6772 $define) extern_C="extern \"C\"" ;;
6773 *) extern_C="extern" ;;
6776 case "$reuseval-$4" in
6778 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6783 if $test "$runnm" = true; then
6784 if $contains $tlook $tf >/dev/null 2>&1; then
6786 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6787 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6788 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6789 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6793 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6794 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6800 $define) tval=true;;
6807 : define an is-in-libc? function
6808 inlibc='echo " "; td=$define; tu=$undef;
6809 sym=$1; var=$2; eval "was=\$$2";
6811 case "$reuseval$was" in
6821 echo "$sym() found." >&4;
6822 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6824 echo "$sym() NOT found." >&4;
6825 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6829 $define) echo "$sym() found." >&4;;
6830 *) echo "$sym() NOT found." >&4;;
6834 : check for length of double
6836 case "$doublesize" in
6838 echo "Checking to see how big your double precision numbers are..." >&4
6847 printf("%d\n", (int)sizeof(double));
6852 if eval $compile_ok; then
6853 doublesize=`$run ./try`
6854 echo "Your double is $doublesize bytes long."
6857 echo "(I can't seem to compile the test program. Guessing...)"
6858 rp="What is the size of a double precision number (in bytes)?"
6866 : see if this is a float.h system
6870 : check for long doubles
6872 echo "Checking to see if you have long double..." >&4
6873 echo 'int main() { long double x = 7.0; }' > try.c
6875 if eval $compile; then
6877 echo "You have long double."
6880 echo "You do not have long double."
6886 : see if ldexpl exists
6890 : check for length of long double
6891 case "${d_longdbl}${longdblsize}" in
6894 echo "Checking to see how big your long doubles are..." >&4
6895 $cat >try.c <<'EOCP'
6899 printf("%d\n", sizeof(long double));
6904 if eval $compile; then
6905 longdblsize=`$run ./try`
6906 echo "Your long doubles are $longdblsize bytes long."
6910 echo "(I can't seem to compile the test program. Guessing...)" >&4
6911 rp="What is the size of a long double (in bytes)?"
6915 if $test "X$doublesize" = "X$longdblsize"; then
6916 echo "That isn't any different from an ordinary double."
6917 echo "I'll keep your setting anyway, but you may see some"
6918 echo "harmless compilation warnings."
6924 $echo "Checking the kind of long doubles you have..." >&4
6925 case "$d_longdbl" in
6930 #define LONGDBLSIZE $longdblsize
6931 #define DOUBLESIZE $doublesize
6939 static const long double d = -0.1L;
6941 unsigned const char* b = (unsigned const char*)(&d);
6942 #if DOUBLESIZE == LONGDBLSIZE
6943 printf("0\n"); /* if it floats like double */
6946 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6947 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6948 /* IEEE 754 128-bit little-endian */
6952 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6953 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6958 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6959 * while 64-bits platforms have it in 16 bytes. */
6960 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6961 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6962 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6963 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6964 * Also known as "extended precision". */
6968 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6969 /* is there ever big-endian 80-bit, really? */
6974 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6975 /* software "double double", the 106 is 53+53.
6976 * but irix thinks it is 107. */
6977 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6978 /* double double 128-bit little-endian,
6979 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6983 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6984 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6985 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6990 printf("-1\n"); /* unknown */
6995 if eval $compile; then
6996 longdblkind=`$run ./try`
7003 case "$longdblkind" in
7004 0) echo "Your long doubles are doubles." >&4 ;;
7005 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7006 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7007 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7008 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7009 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
7010 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
7011 *) echo "Cannot figure out your long double." >&4 ;;
7015 : determine the architecture name
7017 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7018 tarch=`arch`"-$osname"
7019 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7020 if uname -m > tmparch 2>&1 ; then
7021 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7022 -e 's/$/'"-$osname/" tmparch`
7030 case "$myarchname" in
7033 echo "(Your architecture name used to be $myarchname.)"
7037 case "$targetarch" in
7039 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7044 *) dflt="$archname";;
7046 rp='What is your architecture name'
7050 : optionally add API version to the architecture for versioned archlibs
7051 case "$useversionedarchname" in
7052 $define|true|[yY]*) dflt='y';;
7055 rp='Add the Perl API version to your archname?'
7058 y|Y) useversionedarchname="$define" ;;
7059 *) useversionedarchname="$undef" ;;
7061 case "$useversionedarchname" in
7064 *-$api_versionstring)
7065 echo "...and architecture name already has -$api_versionstring" >&4
7068 archname="$archname-$api_versionstring"
7069 echo "...setting architecture name to $archname." >&4
7075 case "$usethreads" in
7077 echo "Threads selected." >&4
7079 *-thread*) echo "...and architecture name already has -thread." >&4
7081 *) archname="$archname-thread"
7082 echo "...setting architecture name to $archname." >&4
7087 case "$usemultiplicity" in
7089 echo "Multiplicity selected." >&4
7091 *-multi*) echo "...and architecture name already has -multi." >&4
7093 *) archname="$archname-multi"
7094 echo "...setting architecture name to $archname." >&4
7099 case "$use64bitint$use64bitall" in
7101 case "$archname64" in
7103 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7106 case "$use64bitint" in
7107 "$define") echo "64 bit integers selected." >&4 ;;
7109 case "$use64bitall" in
7110 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7113 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7115 *) archname="$archname-$archname64"
7116 echo "...setting architecture name to $archname." >&4
7122 case "$uselongdouble" in
7124 echo "Long doubles selected." >&4
7125 case "$longdblsize" in
7127 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7131 *-ld*) echo "...and architecture name already has -ld." >&4
7133 *) archname="$archname-ld"
7134 echo "...setting architecture name to $archname." >&4
7141 case "$usequadmath" in
7143 echo "quadmath selected." >&4
7145 *-ld*) echo "...and architecture name already has -quadmath." >&4
7147 *) archname="$archname-quadmath"
7148 echo "...setting architecture name to $archname." >&4
7153 if $test -f archname.cbu; then
7154 echo "Your platform has some specific hints for architecture name, using them..."
7158 : set the prefixit variable, to compute a suitable default value
7159 prefixit='case "$3" in
7161 case "$oldprefix" in
7162 "") eval "$1=\"\$$2\"";;
7169 ""|" ") eval "$1=\"\$$2\"";;
7175 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7177 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7178 /*-$oldprefix/*|\~*-$oldprefix/*)
7179 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7180 *) eval "$1=\"\$$2\"";;
7184 : determine installation style
7185 : For now, try to deduce it from prefix unless it is already set.
7186 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7187 case "$installstyle" in
7188 '') case "$prefix" in
7189 *perl*) dflt='lib';;
7190 *) dflt='lib/perl5' ;;
7193 *) dflt="$installstyle" ;;
7195 : Probably not worth prompting for this since we prompt for all
7196 : the directories individually, and the prompt would be too long and
7200 : determine where public executables go
7205 rp='Pathname where the public executables will reside?'
7207 if $test "X$ansexp" != "X$binexp"; then
7211 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7212 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7213 : this via initialinstalllocation
7216 case "$userelocatableinc" in
7217 $define|true|[yY]*) dflt='y' ;;
7222 Would you like to build Perl so that the installation is relocatable, so that
7223 library paths in @INC are determined relative to the path of the perl binary?
7224 This is not advised for system Perl installs, or if you need to run setid
7225 scripts or scripts under taint mode.
7227 If this doesn't make any sense to you, just accept the default '$dflt'.
7229 rp='Use relocatable @INC?'
7232 y|Y) val="$define" ;;
7235 set userelocatableinc
7238 initialinstalllocation="$binexp"
7239 : Default prefix is now "up one level from where the binaries are"
7240 case "$userelocatableinc" in
7246 installprefixexp=".../.."
7250 : determine where private library files go
7251 : Usual default is /usr/local/lib/perl5/$version.
7252 : Also allow things like /opt/perl/lib/$version, since
7253 : /opt/perl/lib/perl5... would be redundant.
7254 : The default "style" setting is made in installstyle.U
7255 case "$installstyle" in
7256 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7257 *) set dflt privlib lib/$version ;;
7262 There are some auxiliary files for $package that need to be put into a
7263 private library directory that is accessible by everyone.
7268 rp='Pathname where the private library files will reside?'
7273 : set the prefixup variable, to restore leading tilda escape
7274 prefixup='case "$prefixexp" in
7276 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7279 : determine where public architecture dependent libraries go
7282 : privlib default is /usr/local/lib/$package/$version
7283 : archlib default is /usr/local/lib/$package/$version/$archname
7284 : privlib may have an optional trailing /share.
7285 tdflt=`echo $privlib | $sed 's,/share$,,'`
7286 tdflt=$tdflt/$archname
7295 $spackage contains architecture-dependent library files. If you are
7296 sharing libraries in a heterogeneous environment, you might store
7297 these files in a separate location. Otherwise, you can just include
7298 them with the rest of the public library files.
7303 rp='Where do you want to put the public architecture-dependent libraries?'
7307 if $test X"$archlib" = X"$privlib"; then
7313 : see if setuid scripts can be secure
7316 Some kernels have a bug that prevents setuid #! scripts from being
7317 secure. Some sites have disabled setuid #! scripts because of this.
7319 First let's decide if your kernel supports secure setuid #! scripts.
7320 (If setuid #! scripts would be secure but have been disabled anyway,
7321 don't say that they are secure if asked.)
7326 if $test -d /dev/fd; then
7327 echo "#!$ls" >reflect
7328 chmod +x,u+s reflect
7329 ./reflect >flect 2>&1
7330 if $contains "/dev/fd" flect >/dev/null; then
7331 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7335 If you are not sure if they are secure, I can check but I'll need a
7336 username and password different from the one you are using right now.
7337 If you don't have such a username or don't want me to test, simply
7341 rp='Other username to test security of setuid scripts with?'
7346 case "$d_suidsafe" in
7347 '') echo "I'll assume setuid scripts are *not* secure." >&4
7350 echo "Well, the $hint value is *not* secure." >&4
7352 *) echo "Well, the $hint value *is* secure." >&4
7357 $rm -f reflect flect
7358 echo "#!$ls" >reflect
7359 chmod +x,u+s reflect
7362 echo '"su" will (probably) prompt you for '"$ans's password."
7363 su $ans -c './reflect >flect'
7364 if $contains "/dev/fd" flect >/dev/null; then
7365 echo "Okay, it looks like setuid scripts are secure." >&4
7368 echo "I don't think setuid scripts are secure." >&4
7373 rp='Does your kernel have *secure* setuid scripts?'
7376 [yY]*) val="$define";;
7381 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7382 echo "(That's for file descriptors, not floppy disks.)"
7388 $rm -f reflect flect
7390 : now see if they want to do setuid emulation
7391 if $test $patchlevel -lt 11; then
7394 case "$d_suidsafe" in
7397 echo "No need to emulate SUID scripts since they are secure here." >&4
7401 Some systems have disabled setuid scripts, especially systems where
7402 setuid scripts cannot be secure. On systems where setuid scripts have
7403 been disabled, the setuid/setgid bits on scripts are currently
7404 useless. It is possible for $package to detect those bits and emulate
7405 setuid/setgid in a secure fashion. This emulation will only work if
7406 setuid scripts have been disabled in your kernel.
7410 "$define") dflt=y ;;
7413 rp="Do you want to do setuid/setgid emulation?"
7416 [yY]*) val="$define";;
7428 SUID emulation has been removed for 5.12
7429 Please re-run Configure without -Dd_dosuid
7438 : Find perl5.005 or later.
7439 echo "Looking for a previously installed perl5.005 or later... "
7441 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7442 : Check if this perl is recent and can load a simple module
7443 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7446 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7456 '') echo "None found. That's ok.";;
7457 *) echo "Using $perl5." ;;
7460 : Set the siteprefix variables
7463 After $package is installed, you may wish to install various
7464 add-on modules and utilities. Typically, these add-ons will
7465 be installed under $prefix with the rest
7466 of this package. However, you may wish to install such add-ons
7467 elsewhere under a different prefix.
7469 If you do not wish to put everything under a single prefix, that's
7470 ok. You will be prompted for the individual locations; this siteprefix
7471 is only used to suggest the defaults.
7473 The default should be fine for most people.
7477 rp='Installation prefix to use for add-on modules and utilities?'
7478 : XXX Here might be another good place for an installstyle setting.
7479 case "$siteprefix" in
7481 *) dflt=$siteprefix ;;
7484 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7486 case "$siteprefix" in
7490 *) oldsiteprefix="$prefix";;
7495 siteprefixexp="$ansexp"
7497 : determine where site specific libraries go.
7498 : Usual default is /usr/local/lib/perl5/site_perl/$version
7499 : The default "style" setting is made in installstyle.U
7500 : XXX No longer works with Prefixit stuff.
7501 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7503 '') case "$installstyle" in
7504 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7505 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7513 The installation process will create a directory for
7514 site-specific extensions and modules. Most users find it convenient
7515 to place all site-specific files in this directory rather than in the
7516 main distribution directory.
7520 rp='Pathname for the site-specific library files?'
7524 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7526 : Determine list of previous versions to include in @INC
7527 $cat > getverlist <<EOPL
7530 \$api_versionstring = "$api_versionstring";
7531 \$version = "$version";
7532 \$stem = "$sitelib_stem";
7533 \$archname = "$archname";
7535 $cat >> getverlist <<'EOPL'
7536 # The list found is store twice for each entry: the original name, and
7537 # the binary broken down version as pack "sss", so sorting is easy and
7538 # unambiguous. This will work for all versions that have a maximum of
7539 # three digit groups, separate by '.'s or '_'s. Names are extended with
7540 # ".0.0" to ensure at least three elements for the pack.
7541 # -- H.Merijn Brand (m)'06 23-10-2006
7543 # Can't have leading @ because metaconfig interprets it as a command!
7544 ;@inc_version_list=();
7545 # XXX Redo to do opendir/readdir?
7548 ;@candidates = map {
7549 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7550 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7556 ($pversion, $aversion, $vsn5005) = map {
7557 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7558 foreach $d (@candidates) {
7559 if ($d->[1] lt $pversion) {
7560 if ($d->[1] ge $aversion) {
7561 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7563 elsif ($d->[1] ge $vsn5005) {
7564 unshift(@inc_version_list, grep { -d } $d->[0]);
7568 # Skip newer version. I.e. don't look in
7569 # 5.7.0 if we're installing 5.6.1.
7573 if (@inc_version_list) {
7574 print join(' ', @inc_version_list);
7577 # Blank space to preserve value for next Configure run.
7582 case "$inc_version_list" in
7583 '') if test -x "$perl5$exe_ext"; then
7584 dflt=`$perl5 getverlist`
7589 $undef) dflt='none' ;;
7590 *) eval dflt=\"$inc_version_list\" ;;
7593 ''|' ') dflt=none ;;
7600 In order to ease the process of upgrading, this version of perl
7601 can be configured to use modules built and installed with earlier
7602 versions of perl that were installed under $prefix. Specify here
7603 the list of earlier versions that this version of perl should check.
7604 If Configure detected no earlier versions of perl installed under
7605 $prefix, then the list will be empty. Answer 'none' to tell perl
7606 to not search earlier versions.
7608 The default should almost always be sensible, so if you're not sure,
7609 just accept the default.
7612 rp='List of earlier versions to include in @INC?'
7615 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7616 *) inc_version_list="$ans" ;;
7618 case "$inc_version_list" in
7620 inc_version_list_init='0'
7621 d_inc_version_list="$undef"
7623 *) inc_version_list_init=`echo $inc_version_list |
7624 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7625 d_inc_version_list="$define"
7630 : see if malloc/malloc.h has to be included
7631 set malloc/malloc.h i_mallocmalloc
7634 : see if this is a malloc.h system
7635 : we want a real compile instead of Inhdr because some systems have a
7636 : malloc.h that just gives a compile error saying to use stdlib.h instead
7641 #$i_mallocmalloc I_MALLOCMALLOC
7642 #ifdef I_MALLOCMALLOC
7643 # include <malloc/malloc.h>
7646 int main () { return 0; }
7649 if eval $compile; then
7650 echo "<malloc.h> found." >&4
7653 echo "<malloc.h> NOT found." >&4
7660 : check for length of pointer
7664 echo "Checking to see how big your pointers are..." >&4
7673 printf("%d\n", (int)sizeof(void *));
7678 if eval $compile_ok; then
7679 ptrsize=`$run ./try`
7680 echo "Your pointers are $ptrsize bytes long."
7683 echo "(I can't seem to compile the test program. Guessing...)" >&4
7684 rp="What is the size of a pointer (in bytes)?"
7691 case "$use64bitall" in
7692 "$define"|true|[yY]*)
7696 *** You have chosen a maximally 64-bit build,
7697 *** but your pointers are only 4 bytes wide.
7698 *** Please rerun Configure without -Duse64bitall.
7703 *** Since you have quads, you could possibly try with -Duse64bitint.
7708 *** Cannot continue, aborting.
7719 : determine whether to use malloc wrapping
7721 case "$usemallocwrap" in
7722 [yY]*|true|$define) dflt='y' ;;
7723 [nN]*|false|$undef) dflt='n' ;;
7724 *) case "$usedevel" in
7725 [yY]*|true|$define) dflt='y' ;;
7730 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7732 usemallocwrap="$ans"
7735 usemallocwrap="$define" ;;
7737 usemallocwrap="$undef" ;;
7740 : determine which malloc to compile in
7742 case "$usemymalloc" in
7743 [yY]*|true|$define) dflt='y' ;;
7744 [nN]*|false|$undef) dflt='n' ;;
7745 *) case "$ptrsize" in
7749 if test "$useithreads" = "$define"; then dflt='n'; fi
7752 rp="Do you wish to attempt to use the malloc that comes with $package?"
7758 mallocsrc='malloc.c'
7759 mallocobj="malloc$_o"
7760 d_mymalloc="$define"
7763 : Remove malloc from list of libraries to use
7764 echo "Removing unneeded -lmalloc from library list" >&4
7765 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7768 echo "libs = $libs" >&4
7780 : compute the return types of malloc and free
7782 $cat >malloc.c <<END
7786 #include <sys/types.h>
7800 case "$malloctype" in
7802 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7809 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7813 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7820 echo "Your system uses $freetype free(), it would seem." >&4
7822 : determine where site specific architecture-dependent libraries go.
7823 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7824 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7825 : sitelib may have an optional trailing /share.
7827 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7828 dflt="$dflt/$archname"
7833 set sitearch sitearch none
7837 The installation process will also create a directory for
7838 architecture-dependent site-specific extensions and modules.
7842 rp='Pathname for the site-specific architecture-dependent library files?'
7846 if $test X"$sitearch" = X"$sitelib"; then
7849 d_sitearch="$define"
7852 : Set the vendorprefix variables
7855 The installation process will also create a directory for
7856 vendor-supplied add-ons. Vendors who supply perl with their system
7857 may find it convenient to place all vendor-supplied files in this
7858 directory rather than in the main distribution directory. This will
7859 ease upgrades between binary-compatible maintenance versions of perl.
7861 Of course you may also use these directories in whatever way you see
7862 fit. For example, you might use them to access modules shared over a
7863 company-wide network.
7865 The default answer should be fine for most people.
7866 This causes further questions about vendor add-ons to be skipped
7867 and no vendor-specific directories will be configured for perl.
7870 rp='Do you want to configure vendor-specific add-on directories?'
7871 case "$usevendorprefix" in
7872 define|true|[yY]*) dflt=y ;;
7873 *) : User may have set vendorprefix directly on Configure command line.
7874 case "$vendorprefix" in
7883 rp='Installation prefix to use for vendor-supplied add-ons?'
7884 case "$vendorprefix" in
7885 '') dflt="$prefix" ;;
7886 *) dflt=$vendorprefix ;;
7889 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7891 case "$vendorprefix" in
7895 *) oldvendorprefix="$prefix";;
7899 usevendorprefix="$define"
7901 vendorprefixexp="$ansexp"
7903 *) usevendorprefix="$undef"
7909 : Set the vendorlib variables
7910 case "$vendorprefix" in
7911 '') d_vendorlib="$undef"
7915 *) d_vendorlib="$define"
7916 : determine where vendor-supplied modules go.
7917 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7918 case "$vendorlib" in
7920 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7921 case "$installstyle" in
7922 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7923 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7926 *) dflt="$vendorlib"
7930 rp='Pathname for the vendor-supplied library files?'
7933 vendorlibexp="$ansexp"
7936 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7940 : Set the vendorarch variables
7941 case "$vendorprefix" in
7942 '') d_vendorarch="$undef"
7946 *) d_vendorarch="$define"
7947 : determine where vendor-supplied architecture-dependent libraries go.
7948 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7949 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7950 : vendorlib may have an optional trailing /share.
7951 case "$vendorarch" in
7952 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7953 dflt="$dflt/$archname"
7955 *) dflt="$vendorarch" ;;
7958 rp='Pathname for vendor-supplied architecture-dependent files?'
7961 vendorarchexp="$ansexp"
7964 prefixvar=vendorarch
7966 if $test X"$vendorarch" = X"$vendorlib"; then
7967 d_vendorarch="$undef"
7969 d_vendorarch="$define"
7972 : Final catch-all directories to search
7975 Lastly, you can have perl look in other directories for extensions and
7976 modules in addition to those already specified.
7977 These directories will be searched after
7981 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7982 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7984 case "$otherlibdirs" in
7985 ''|' ') dflt='none' ;;
7986 *) dflt="$otherlibdirs" ;;
7989 Enter a colon-separated set of extra paths to include in perl's @INC
7990 search path, or enter 'none' for no extra paths.
7994 rp='Colon-separated list of additional directories for perl to search?'
7997 ' '|''|none) otherlibdirs=' ' ;;
7998 *) otherlibdirs="$ans" ;;
8000 case "$otherlibdirs" in
8004 set d_perl_otherlibdirs
8007 : Cruising for prototypes
8009 echo "Checking out function prototypes..." >&4
8010 $cat >prototype.c <<EOCP
8015 int main(int argc, char *argv[]) {
8018 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8019 echo "Your C compiler appears to support function prototypes."
8022 echo "Your C compiler doesn't seem to understand function prototypes."
8029 : Check if ansi2knr is required
8030 case "$prototype" in
8032 *) ansi2knr='ansi2knr'
8037 This version of $package can only be compiled by a compiler that
8038 understands function prototypes. Unfortunately, your C compiler
8040 doesn't seem to understand them. Sorry about that.
8042 If GNU cc is available for your system, perhaps you could try that instead.
8044 Eventually, we hope to support building Perl with pre-ANSI compilers.
8045 If you would like to help in that effort, please contact <perlbug@perl.org>.
8047 Aborting Configure now.
8054 dflt_dtrace='/usr/sbin/dtrace'
8055 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8059 Perl can be built to support DTrace on platforms that support it.
8060 DTrace is a diagnosis and performance analysis tool from Sun.
8062 If this doesn't make any sense to you, just accept the default.
8066 case "$usedtrace" in
8072 dflt_dtrace=$usedtrace
8079 rp='Support DTrace if available?'
8082 y|Y) val="$define" ;;
8088 test "X$usedtrace" != "X$define" && break
8091 rp='Where is the dtrace executable?'
8100 if $dtrace -h -s ../perldtrace.d \
8101 -o perldtrace.tmp >/dev/null 2>&1 \
8102 && rm -f perldtrace.tmp
8105 echo "Good: your $dtrace knows about the -h flag."
8109 *** $me: Fatal Error: $dtrace doesn't support -h flag
8111 *** Your installed dtrace doesn't support the -h switch to compile a D
8112 *** program into a C header. Can't continue.
8124 *** $me: Fatal Error: $dtrace not found.
8131 echo "*** $dtrace was not found."
8137 : See if we want extra modules installed
8144 Perl can be built with extra modules or bundles of modules which
8145 will be fetched from the CPAN and installed alongside Perl.
8147 Notice that you will need access to the CPAN; either via the Internet,
8148 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8149 be asked later to configure the CPAN.pm module which will in turn do
8150 the installation of the rest of the extra modules or bundles.)
8152 Notice also that if the modules require any external software such as
8153 libraries and headers (the libz library and the zlib.h header for the
8154 Compress::Zlib module, for example) you MUST have any such software
8155 already installed, this configuration process will NOT install such
8158 If this doesn't make any sense to you, just accept the default '$dflt'.
8160 rp='Install any extra modules (y or n)?'
8166 Please list any extra modules or bundles to be installed from CPAN,
8167 with spaces between the names. The names can be in any format the
8168 'install' command of CPAN.pm will understand. (Answer 'none',
8169 without the quotes, to install no extra modules or bundles.)
8179 $rm -f ../extras.lst
8181 *) echo "(Saving the list of extras for later...)"
8182 echo "$extras" > ../extras.lst
8190 : determine where html pages for programs go
8191 set html1dir html1dir none
8195 If you wish to install html files for programs in $spackage, indicate
8196 the appropriate directory here. To skip installing html files,
8200 ''|none|$undef|' ') dflt=none ;;
8201 *) dflt=$html1dir ;;
8204 rp="Directory for the main $spackage html pages?"
8208 : Use ' ' for none so value is preserved next time through Configure
8209 $test X"$html1dir" = "X" && html1dir=' '
8211 : determine where html pages for libraries and modules go
8212 set html3dir html3dir none
8216 If you wish to install html files for modules associated with $spackage,
8217 indicate the appropriate directory here. To skip installing html files,
8220 : There is no obvious default. If they have specified html1dir, then
8221 : try to key off that, possibly changing .../html1 into .../html3.
8223 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8224 *) dflt=$html3dir ;;
8227 rp="Directory for the $spackage module html pages?"
8231 : Use ' ' for none so value is preserved next time through Configure
8232 $test X"$html3dir" = "X" && html3dir=' '
8234 : determine whether to install perl also as /usr/bin/perl
8237 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8239 Many scripts expect perl to be installed as /usr/bin/perl.
8241 If you want to, I can install the perl you are about to compile
8242 as /usr/bin/perl (in addition to $bin/perl).
8244 if test -f /usr/bin/perl; then
8247 However, please note that because you already have a /usr/bin/perl,
8248 overwriting that with a new Perl would very probably cause problems.
8249 Therefore I'm assuming you don't want to do that (unless you insist).
8252 case "$installusrbinperl" in
8253 "$define"|[yY]*) dflt='y';;
8259 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8262 case "$installusrbinperl" in
8263 "$undef"|[nN]*) dflt='n';;
8267 rp="Do you want to install perl as /usr/bin/perl?"
8270 [yY]*) val="$define";;
8276 set installusrbinperl
8279 : see if dlopen exists
8281 xxx_ccflags="$ccflags"
8283 : with g++ one needs -shared to get is-in-libc to work for dlopen
8284 case "$gccversion" in
8287 *) case "$d_cplusplus" in
8288 "$define") ccflags="$ccflags -shared" ;;
8295 ccflags="$xxx_ccflags"
8297 : see if this is a unistd.h system
8298 set unistd.h i_unistd
8301 : determine which dynamic loading, if any, to compile in
8303 dldir="ext/DynaLoader"
8316 $define) dflt='y' ;;
8318 : Does a dl_xxx.xs file exist for this operating system
8319 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8322 rp="Do you wish to use dynamic loading?"
8329 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8330 dflt="$dldir/dl_${osname}.xs"
8331 elif $test "$d_dlopen" = "$define" ; then
8332 dflt="$dldir/dl_dlopen.xs"
8337 *) dflt="$dldir/$dlsrc"
8340 echo "The following dynamic loading files are available:"
8341 : Can not go over to $dldir because getfile has path hard-coded in.
8342 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8343 rp="Source file to use for dynamic loading"
8349 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8353 Some systems may require passing special flags to $cc -c to
8354 compile modules that will be used to create a shared library.
8355 To use no flags, say "none".
8358 case "$cccdlflags" in
8359 '') case "$gccversion" in
8360 '') case "$osname" in
8362 irix*) dflt='-KPIC' ;;
8363 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8364 sunos) dflt='-pic' ;;
8368 *) case "$osname" in
8369 darwin) dflt='none' ;;
8370 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8375 *) dflt="$cccdlflags" ;;
8382 # If -Dsysroot was specified, now's the time to add it
8384 if test "X$sysroot" != X; then
8385 case "$gccversion" in
8390 dflt="$dflt --sysroot=$sysroot" ;;
8400 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8403 none) cccdlflags=' ' ;;
8404 *) cccdlflags="$ans" ;;
8409 Some systems use ld to create libraries that can be dynamically loaded,
8410 while other systems (such as those using ELF) use $cc.
8414 : Determine if this is ELF
8416 /* Test for whether ELF binaries are produced */
8428 int i = open("a.out",O_RDONLY);
8431 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8432 exit(0); /* succeed (yes, it is ELF) */
8436 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8442 '') if $test $bin_ELF = "$define"; then
8444 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8448 echo "I'll use ld to build dynamic libraries."
8456 rp="What command should be used to create dynamic libraries?"
8462 Some systems may require passing special flags to $ld to create a
8463 library that can be dynamically loaded. If your ld flags include
8464 -L/other/path options to locate libraries outside your loader's normal
8465 search path, you may need to specify those -L options here as well. To
8466 use no flags, say "none".
8469 case "$lddlflags" in
8470 '') case "$osname" in
8471 haiku) dflt='-shared' ;;
8473 case "$gccversion" in
8474 '') dflt="$dflt +vnocompatwarnings" ;;
8477 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8478 solaris) # See [perl #66604].
8479 # On Solaris 11, gcc -m64 on amd64
8480 # appears not to understand -G. gcc versions at
8481 # least as old as 3.4.3 support -shared, so just
8482 # use that with Solaris 11 and later, but keep
8483 # the old behavior for older Solaris versions.
8484 case "$gccversion" in
8486 *) case "$osvers" in
8487 2.?|2.10) dflt='-G' ;;
8488 *) dflt='-shared' ;;
8493 sunos) dflt='-assert nodefinitions' ;;
8494 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8498 *) dflt="$lddlflags" ;;
8501 : Only do this for gcc, since, for example, qcc has no concept
8503 if $test "X$sysroot" != X; then
8504 case "$gccversion" in
8506 *) dflt="$dflt --sysroot $sysroot" ;;
8510 : Try to guess additional flags to pick up local libraries.
8511 : Be careful not to append to a plain 'none'
8515 for thisflag in $ldflags; do
8520 *) dflt="$dflt $thisflag" ;;
8527 ''|' ') dflt='none' ;;
8531 *-fstack-protector-strong*)
8533 *-fstack-protector-strong*) ;; # Don't add it again
8534 *) dflt="$dflt -fstack-protector-strong" ;;
8537 *-fstack-protector*)
8539 *-fstack-protector*) ;; # Don't add it again
8540 *) dflt="$dflt -fstack-protector" ;;
8545 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8548 none) lddlflags=' ' ;;
8549 *) lddlflags="$ans" ;;
8554 Some systems may require passing special flags to $cc to indicate that
8555 the resulting executable will use dynamic linking. To use no flags,
8559 case "$ccdlflags" in
8560 '') case "$osname" in
8561 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8562 sunos) dflt='none' ;;
8566 *) dflt="$ccdlflags" ;;
8568 rp="Any special flags to pass to $cc to use dynamic linking?"
8571 none) ccdlflags=' ' ;;
8572 *) ccdlflags="$ans" ;;
8584 ld_can_script="$undef"
8585 case "$bin_ELF$usedl" in
8587 # Abuse try.h and a.out names for neat cleanup
8599 if $cc $cccdlflags $ccdlflags $ccflags \
8600 $ldflags $lddlflags -o a.out try.c \
8601 -Wl,--version-script=try.h >/dev/null 2>&1 \
8602 && $test -s a.out ; then
8603 echo "ld supports scripting" >&4
8604 ld_can_script="$define"
8606 echo "ld does not support scripting" >&4
8612 : Do we want a shared libperl?
8616 # No dynamic loading being used, so don't bother even to prompt.
8619 *) case "$useshrplib" in
8620 '') case "$osname" in
8621 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8623 also='Building a shared libperl is required for dynamic loading to work on your system.'
8637 The perl executable is normally obtained by linking perlmain.c with
8638 libperl${_a}, any static extensions (usually just DynaLoader), and
8639 any other libraries needed on this system (such as -lm, etc.). Since
8640 your system supports dynamic loading, it is probably possible to build
8641 a shared libperl.$so. If you will have more than one executable linked
8642 to libperl.$so, this will significantly reduce the size of each
8643 executable, but it may have a noticeable effect on performance. The
8644 default is probably sensible for your system.
8648 rp="Build a shared libperl.$so (y/n)"
8652 useshrplib='true' ;;
8653 *) useshrplib='false' ;;
8658 case "$useshrplib" in
8660 case "$userelocatableinc" in
8662 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8663 echo "See INSTALL for an explanation why that won't work." >&4
8669 # Figure out a good name for libperl.so. Since it gets stored in
8670 # a version-specific architecture-dependent library, the version
8671 # number isn't really that important, except for making cc/ld happy.
8673 # A name such as libperl.so.10.1
8674 majmin="libperl.$so.$patchlevel.$subversion"
8675 # A name such as libperl.so.100
8676 majonly=`echo $patchlevel $subversion |
8677 $awk '{printf "%d%02d", $1, $2}'`
8678 majonly=libperl.$so.$majonly
8679 # I'd prefer to keep the os-specific stuff here to a minimum, and
8680 # rely on figuring it out from the naming of libc.
8681 case "${osname}${osvers}" in
8682 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8685 cygwin*) # ld links now against the dll directly
8686 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8687 majonly=`echo $patchlevel $subversion |
8688 $awk '{printf "%03d%03d", $1, $2}'`
8689 majonly=cygperl5.$majonly.$so
8692 *) # Try to guess based on whether libc has major.minor.
8694 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8695 *libc.$so.[0-9]*) dflt=$majonly ;;
8696 *) dflt=libperl.$so ;;
8706 I need to select a good name for the shared libperl. If your system uses
8707 library names with major and minor numbers, then you might want something
8708 like $majmin. Alternatively, if your system uses a single version
8709 number for shared libraries, then you might want to use $majonly.
8710 Or, your system might be quite happy with a simple libperl.$so.
8712 Since the shared libperl will get installed into a version-specific
8713 architecture-dependent directory, the version number of the shared perl
8714 library probably isn't important, so the default should be o.k.
8717 rp='What name do you want to give to the shared libperl?'
8720 echo "Ok, I'll use $libperl"
8723 libperl="libperl${_a}"
8727 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8731 WARNING: Use of the shrpdir variable for the installation location of
8732 the shared $libperl is not supported. It was never documented and
8733 will not work in this version. Let me (perlbug@perl.org)
8734 know of any problems this may cause.
8740 But your current setting of $shrpdir is
8741 the default anyway, so it's harmless.
8746 Further, your current attempted setting of $shrpdir
8747 conflicts with the value of $archlibexp/CORE
8748 that installperl will use.
8755 # How will the perl executable find the installed shared $libperl?
8756 # Add $xxx to ccdlflags.
8757 # If we can't figure out a command-line option, use $shrpenv to
8758 # set env LD_RUN_PATH. The main perl makefile uses this.
8759 shrpdir=$archlibexp/CORE
8762 if "$useshrplib"; then
8765 # We'll set it in Makefile.SH...
8770 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8771 xxx="-Wl,-R$shrpdir"
8773 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8774 xxx="-Wl,-rpath,$shrpdir"
8777 # hpux doesn't like the default, either.
8778 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8781 # cygwin needs only ldlibpth
8784 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8790 # Only add $xxx if it isn't already in ccdlflags.
8791 case " $ccdlflags " in
8793 *) ccdlflags="$ccdlflags $xxx"
8796 Adding $xxx to the flags
8797 passed to $ld so that the perl executable will find the
8798 installed shared $libperl.
8806 # Fix ccdlflags in AIX for building external extensions.
8807 # (For building Perl itself bare -bE:perl.exp is needed,
8808 # Makefile.SH takes care of this.)
8810 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8812 # Respect a hint or command-line value.
8814 '') shrpenv="$tmp_shrpenv" ;;
8816 case "$ldlibpthname" in
8817 '') ldlibpthname=LD_LIBRARY_PATH ;;
8818 none) ldlibpthname='' ;;
8821 : determine where manual pages are on this system
8825 syspath='/usr/share/man/man1 /usr/man/man1'
8826 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8827 syspath="$syspath /usr/man/u_man/man1"
8828 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8829 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8830 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8831 sysman=`./loc . /usr/man/man1 $syspath`
8834 if $test -d "$sysman"; then
8835 echo "System manual is in $sysman." >&4
8837 echo "Could not find manual pages in source form." >&4
8840 : determine where manual pages go
8841 set man1dir man1dir none
8845 $spackage has manual pages available in source form.
8849 echo "However, you don't have nroff, so they're probably useless to you."
8851 '') man1dir="none";;
8854 echo "If you don't want the manual sources installed, answer 'none'."
8859 lookpath="$prefixexp/share/man/man1"
8860 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8861 lookpath="$lookpath $prefixexp/man/p_man/man1"
8862 lookpath="$lookpath $prefixexp/man/u_man/man1"
8863 lookpath="$lookpath $prefixexp/man/man.1"
8865 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8866 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8876 rp="Where do the main $spackage manual pages (source) go?"
8878 if $test "X$man1direxp" != "X$ansexp"; then
8889 : What suffix to use on installed man pages
8896 rp="What suffix should be used for the main $spackage man pages?"
8898 '') case "$man1dir" in
8912 *) dflt="$man1ext";;
8919 : see if we can have long filenames
8921 first=123456789abcdef
8923 if (echo hi >$first) 2>/dev/null; then
8924 if $test -f 123456789abcde; then
8925 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8928 echo 'You can have filenames longer than 14 characters.'>&4
8933 You can't have filenames longer than 14 chars.
8934 You can't even think about them!
8940 $rm -rf 123456789abcde*
8942 : determine where library module manual pages go
8943 set man3dir man3dir none
8947 $spackage has manual pages for many of the library modules.
8953 However, you don't have nroff, so they're probably useless to you.
8956 '') man3dir="none";;
8960 case "$d_flexfnam" in
8963 However, your system can't handle the long file names like File::Basename.3.
8966 '') man3dir="none";;
8970 echo "If you don't want the manual sources installed, answer 'none'."
8971 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8973 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8974 if $test -d "$privlib/man/man3"; then
8977 WARNING: Previous versions of perl installed man3 pages into
8978 $privlib/man/man3. This version will suggest a
8979 new default of $dflt.
8983 rp='Do you wish to preserve the old behavior?(y/n)'
8986 y*) dflt="$privlib/man/man3" ;;
8991 *) dflt="$man3dir" ;;
8998 rp="Where do the $package library man pages (source) go?"
9008 : What suffix to use on installed man pages
9014 rp="What suffix should be used for the $package library man pages?"
9016 '') case "$man3dir" in
9030 *) dflt="$man3ext";;
9037 : see if we have to deal with yellow pages, now NIS.
9038 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9044 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9052 rp='Are you getting the hosts file via yellow pages?'
9055 y*) hostcat='ypcat hosts';;
9056 *) hostcat='cat /etc/hosts';;
9062 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9065 '') test -f /etc/group && groupcat='cat /etc/group';;
9068 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9071 : now get the host name
9073 echo "Figuring out host name..." >&4
9074 case "$myhostname" in
9076 echo 'Maybe "hostname" will work...'
9077 if tans=`sh -c hostname 2>&1` ; then
9085 if $test "$cont"; then
9087 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9088 if tans=`cat /etc/systemid 2>&1` ; then
9090 phostname='cat /etc/systemid'
9091 echo "Whadyaknow. Xenix always was a bit strange..."
9094 elif $test -r /etc/systemid; then
9095 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9098 if $test "$cont"; then
9099 echo 'No, maybe "uuname -l" will work...'
9100 if tans=`sh -c 'uuname -l' 2>&1` ; then
9102 phostname='uuname -l'
9104 echo 'Strange. Maybe "uname -n" will work...'
9105 if tans=`sh -c 'uname -n' 2>&1` ; then
9107 phostname='uname -n'
9109 echo 'Oh well, maybe I can mine it out of whoami.h...'
9110 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9111 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9112 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9114 case "$myhostname" in
9115 '') echo "Does this machine have an identity crisis or something?"
9118 echo "Well, you said $myhostname before..."
9119 phostname='echo $myhostname';;
9125 case "$myhostname" in
9126 '') myhostname=noname ;;
9128 : you do not want to know about this
9133 if $test "$myhostname" ; then
9135 rp='Your host name appears to be "'$myhostname'".'" Right?"
9143 : bad guess or no guess
9144 while $test "X$myhostname" = X ; do
9146 rp="Please type the (one word) name of your host:"
9151 : translate upper to lower if necessary
9152 case "$myhostname" in
9154 echo "(Normalizing case in your host name)"
9155 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9159 case "$myhostname" in
9161 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9162 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9163 echo "(Trimming domain name from host name--host name is now $myhostname)"
9165 *) case "$mydomain" in
9168 test "X$hostcat" = "Xypcat hosts" &&
9169 ypmatch "$myhostname" hosts 2>/dev/null |\
9170 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9173 test "X$hostcat" != "X" &&
9174 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9175 /[ ]$myhostname[ . ]/p" > hosts
9178 if $test -f hosts; then
9179 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9180 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9181 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9182 hosts | $sort | $uniq | \
9183 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9184 case `$echo X$dflt` in
9185 X*\ *) echo "(Several hosts in the database matched hostname)"
9188 X.) echo "(You do not have fully-qualified names in the hosts database)"
9192 echo "(I cannot locate a hosts database anywhere)"
9197 tans=`./loc resolv.conf X /etc /usr/etc`
9198 if $test -f "$tans"; then
9199 echo "(Attempting domain name extraction from $tans)"
9200 dflt=.`$sed -n -e 's/ / /g' \
9201 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9204 .) dflt=.`$sed -n -e 's/ / /g' \
9205 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9213 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9214 dflt=.`sh -c domainname 2>/dev/null`
9217 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9221 case "$dflt$osname" in
9222 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9223 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9227 .) echo "(Lost all hope -- silly guess then)"
9233 *) dflt="$mydomain";;
9237 rp="What is your domain name?"
9247 : translate upper to lower if necessary
9250 echo "(Normalizing case in your domain name)"
9251 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9255 : a little sanity check here
9256 case "$phostname" in
9259 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9260 $myhostname$mydomain|$myhostname) ;;
9262 case "$phostname" in
9264 echo "(That doesn't agree with your whoami.h file, by the way.)"
9267 echo "(That doesn't agree with your $phostname command, by the way.)"
9275 : determine the e-mail address of the user who is running us
9278 I need to get your e-mail address in Internet format if possible, i.e.
9279 something like user@host.domain. Please answer accurately since I have
9280 no easy means to double check it. The default value provided below
9281 is most probably close to reality but may not be valid from outside
9282 your organization...
9286 while test "$cont"; do
9287 case "$MAILDOMAIN" in
9289 if $test -s /etc/mailname; then
9290 maildomain=`$cat /etc/mailname`
9292 maildomain="$myhostname$mydomain"
9295 *) maildomain="$MAILDOMAIN";;
9298 '') dflt="$cf_by@$maildomain";;
9299 *) dflt="$cf_email";;
9301 rp='What is your e-mail address?'
9307 rp='Address does not look like an Internet one. Use it anyway?'
9321 : Ask e-mail of administrator
9324 If you or somebody else will be maintaining perl at your site, please
9325 fill in the correct e-mail address here so that they may be contacted
9326 if necessary. Currently, the "perlbug" program included with perl
9327 will send mail to this address in addition to perlbug@perl.org. You may
9328 enter "none" for no administrator.
9331 case "$perladmin" in
9332 '') dflt="$cf_email";;
9333 *) dflt="$perladmin";;
9335 rp='Perl administrator e-mail address'
9339 : determine whether to only install version-specific parts.
9342 Do you want to install only the version-specific parts of the perl
9343 distribution? Usually you do *not* want to do this.
9345 case "$versiononly" in
9346 "$define"|[Yy]*|true) dflt='y' ;;
9349 rp="Do you want to install only the version-specific parts of perl?"
9352 [yY]*) val="$define";;
9358 case "$versiononly" in
9359 "$define") inc_version_list=''
9360 inc_version_list_init=0
9364 : figure out how to guarantee perl startup
9365 : XXX Note that this currently takes advantage of the bug that binexp ignores
9366 : the Configure -Dinstallprefix setting, which in turn means that under
9367 : relocatable @INC, initialinstalllocation is what binexp started as.
9368 case "$startperl" in
9370 case "$sharpbang" in
9374 I can use the #! construct to start perl on your system. This will
9375 make startup of perl scripts faster, but may cause problems if you
9376 want to share those scripts and perl is not in a standard place
9377 ($initialinstalllocation/perl) on all your platforms. The alternative
9378 is to force a shell by starting the script with a single ':' character.
9381 case "$versiononly" in
9382 "$define") dflt="$initialinstalllocation/perl$version";;
9383 *) dflt="$initialinstalllocation/perl";;
9385 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9388 none) startperl=": # use perl";;
9389 *) startperl="#!$ans"
9390 if $test 30 -lt `echo "$ans" | wc -c`; then
9393 WARNING: Some systems limit the #! command to 32 characters.
9394 If you experience difficulty running Perl scripts with #!, try
9395 installing Perl in a directory with a shorter pathname.
9401 *) startperl=": # use perl"
9406 echo "I'll use $startperl to start perl scripts."
9408 : figure best path for perl in scripts
9411 case "$versiononly" in
9412 "$define") perlpath="$initialinstalllocation/perl$version";;
9413 *) perlpath="$initialinstalllocation/perl";;
9415 case "$startperl" in
9420 I will use the "eval 'exec'" idiom to start Perl on your system.
9421 I can use the full path of your Perl binary for this purpose, but
9422 doing so may cause problems if you want to share those scripts and
9423 Perl is not always in a standard place ($initialinstalllocation/perl).
9426 dflt="$initialinstalllocation/perl"
9427 rp="What path shall I use in \"eval 'exec'\"?"
9434 case "$startperl" in
9436 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9439 : determine where public executable scripts go
9440 set scriptdir scriptdir
9442 case "$scriptdir" in
9445 : guess some guesses
9446 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9447 $test -d /usr/share/bin && dflt=/usr/share/bin
9448 $test -d /usr/local/script && dflt=/usr/local/script
9449 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9450 $test -d $prefixexp/script && dflt=$prefixexp/script
9454 *) dflt="$scriptdir"
9459 Some installations have a separate directory just for executable scripts so
9460 that they can mount it across multiple architectures but keep the scripts in
9461 one spot. You might, for example, have a subdirectory of /usr/share for this.
9462 Or you might just lump your scripts in with all your other executables.
9466 rp='Where do you keep publicly executable scripts?'
9468 if $test "X$ansexp" != "X$scriptdirexp"; then
9474 : A little fix up for an irregularly named variable.
9475 installscript="$installscriptdir"
9477 : determine where add-on public executables go
9479 '') dflt=$siteprefix/bin ;;
9483 rp='Pathname where the add-on public executables should be installed?'
9488 : determine where add-on html pages go
9489 : There is no standard location, so try to copy the previously-selected
9490 : directory structure for the core html pages.
9491 case "$sitehtml1dir" in
9492 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9493 *) dflt=$sitehtml1dir ;;
9496 ''|' ') dflt=none ;;
9499 rp='Pathname where the site-specific html pages should be installed?'
9501 prefixvar=sitehtml1dir
9504 : determine where add-on library html pages go
9505 : There is no standard location, so try to copy the previously-selected
9506 : directory structure for the core html pages.
9507 case "$sitehtml3dir" in
9508 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9509 *) dflt=$sitehtml3dir ;;
9512 ''|' ') dflt=none ;;
9515 rp='Pathname where the site-specific library html pages should be installed?'
9517 prefixvar=sitehtml3dir
9520 : determine where add-on manual pages go
9521 case "$siteman1dir" in
9522 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9523 *) dflt=$siteman1dir ;;
9526 ''|' ') dflt=none ;;
9529 rp='Pathname where the site-specific manual pages should be installed?'
9531 prefixvar=siteman1dir
9534 : determine where add-on library man pages go
9535 case "$siteman3dir" in
9536 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9537 *) dflt=$siteman3dir ;;
9540 ''|' ') dflt=none ;;
9543 rp='Pathname where the site-specific library manual pages should be installed?'
9545 prefixvar=siteman3dir
9548 : determine where add-on public executable scripts go
9549 case "$sitescript" in
9550 '') dflt=$siteprefix/script
9551 $test -d $dflt || dflt=$sitebin ;;
9552 *) dflt="$sitescript" ;;
9555 rp='Pathname where add-on public executable scripts should be installed?'
9557 prefixvar=sitescript
9560 : see if backtrace exists
9561 set backtrace d_backtrace
9564 : add flags if using c backtrace
9565 case "$usecbacktrace" in
9566 "") usecbacktrace=$undef ;;
9568 case "$d_backtrace" in
9570 case " $ccflags " in
9571 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9572 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9576 echo "This system does not support backtrace" >&4
9577 usecbacktrace=$undef
9583 : Check if faststdio is requested and available
9584 case "$usefaststdio" in
9585 $define|true|[yY]*|'')
9586 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9596 Perl can be built to use 'fast stdio', which means using the stdio
9597 library but also directly manipulating the stdio buffers to enable
9598 faster I/O. Using stdio is better for backward compatibility (especially
9599 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9600 interface has been preferred instead of stdio.
9602 If this doesn't make any sense to you, just accept the default '$dflt'.
9604 rp='Use the "fast stdio" if available?'
9607 y|Y) val="$define" ;;
9614 : define an is-a-typedef? function
9615 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9617 "") inclist="sys/types.h";;
9619 eval "varval=\$$var";
9623 for inc in $inclist; do
9624 echo "#include <$inc>" >>temp.c;
9626 echo "#ifdef $type" >> temp.c;
9627 echo "printf(\"We have $type\");" >> temp.c;
9628 echo "#endif" >> temp.c;
9629 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9630 if $contains $type temp.E >/dev/null 2>&1; then
9636 *) eval "$var=\$varval";;
9639 : define an is-a-typedef? function that prompts if the type is not available.
9640 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9642 "") inclist="sys/types.h";;
9644 eval "varval=\$$var";
9648 for inc in $inclist; do
9649 echo "#include <$inc>" >>temp.c;
9651 echo "#ifdef $type" >> temp.c;
9652 echo "printf(\"We have $type\");" >> temp.c;
9653 echo "#endif" >> temp.c;
9654 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9656 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9657 if $contains $type temp.E >/dev/null 2>&1; then
9658 echo "$type found." >&4;
9661 echo "$type NOT found." >&4;
9667 *) eval "$var=\$varval";;
9670 : see what type lseek is declared as in the kernel
9671 rp="What is the type used for lseek's offset on this system?"
9672 set off_t lseektype long stdio.h sys/types.h
9676 echo "Checking to see how big your file offsets are..." >&4
9678 #include <sys/types.h>
9682 printf("%d\n", (int)sizeof($lseektype));
9687 if eval $compile_ok; then
9688 lseeksize=`$run ./try`
9689 echo "Your file offsets are $lseeksize bytes long."
9693 echo "(I can't seem to compile the test program. Guessing...)"
9694 rp="What is the size of your file offsets (in bytes)?"
9700 : see what type file positions are declared as in the library
9701 rp="What is the type for file position used by fsetpos()?"
9702 set fpos_t fpostype long stdio.h sys/types.h
9705 : Check size for Fpos_t
9708 *_t) zzz="$fpostype" ;;
9711 echo "Checking the size of $zzz..." >&4
9713 #include <sys/types.h>
9720 printf("%d\n", (int)sizeof($fpostype));
9725 if eval $compile_ok; then
9729 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9732 echo "Your $zzz is $fpossize bytes long."
9738 echo "(I can't compile the test program. Guessing...)" >&4
9739 rp="What is the size of your file positions (in bytes)?"
9744 : Check for large file support
9745 # Backward compatibility (uselfs is deprecated).
9747 "$define"|true|[yY]*)
9750 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9752 uselargefiles="$define"
9756 case "$lseeksize:$fpossize" in
9759 You can have files larger than 2 gigabytes.
9762 *) case "$uselargefiles" in
9763 "$undef"|false|[nN]*) dflt='n' ;;
9768 Perl can be built to understand large files (files larger than 2 gigabytes)
9769 on some systems. To do so, Configure can be run with -Duselargefiles.
9771 If this doesn't make any sense to you, just accept the default '$dflt'.
9773 rp='Try to understand large files, if available?'
9776 y|Y) val="$define" ;;
9783 : Look for a hint-file generated 'call-back-unit'. If the
9784 : user has specified that a large files perl is to be built,
9785 : we may need to set or change some other defaults.
9786 if $test -f uselargefiles.cbu; then
9787 echo "Your platform has some specific hints regarding large file builds, using them..."
9788 . ./uselargefiles.cbu
9790 case "$uselargefiles" in
9792 if $test -f uselargefiles.cbu; then
9794 echo "Rechecking to see how big your file offsets are..." >&4
9796 #include <sys/types.h>
9800 printf("%d\n", (int)sizeof($lseektype));
9805 if eval $compile_ok; then
9806 lseeksize=`$run ./try`
9807 $echo "Your file offsets are now $lseeksize bytes long."
9811 echo "(I can't seem to compile the test program. Guessing...)"
9812 rp="What is the size of your file offsets (in bytes)?"
9817 *_t) zzz="$fpostype" ;;
9820 $echo $n "Rechecking the size of $zzz...$c" >&4
9822 #include <sys/types.h>
9829 printf("%d\n", (int)sizeof($fpostype));
9834 if eval $compile_ok; then
9839 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9842 echo " $fpossize bytes." >&4
9848 echo "(I can't compile the test program. Guessing...)" >&4
9849 rp="What is the size of your file positions (in bytes)?"
9858 : Check if we want perlio
9861 : Set the vendorbin variables
9862 case "$vendorprefix" in
9863 '') d_vendorbin="$undef"
9867 *) d_vendorbin="$define"
9868 : determine where vendor-supplied executables go.
9869 case "$vendorbin" in
9870 '') dflt=$vendorprefix/bin ;;
9871 *) dflt="$vendorbin" ;;
9874 rp='Pathname for the vendor-supplied executables directory?'
9877 vendorbinexp="$ansexp"
9883 : Set the vendorhtml1dir variables
9884 case "$vendorprefix" in
9885 '') vendorhtml1dir=''
9886 vendorhtml1direxp=''
9888 *) : determine where vendor-supplied html pages go.
9889 : There is no standard location, so try to copy the previously-selected
9890 : directory structure for the core html pages.
9891 : XXX Better default suggestions would be welcome.
9892 case "$vendorhtml1dir" in
9893 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9894 *) dflt=$vendorhtml1dir ;;
9897 ''|' ') dflt=none ;;
9900 rp='Pathname for the vendor-supplied html pages?'
9902 vendorhtml1dir="$ans"
9903 vendorhtml1direxp="$ansexp"
9906 : Use ' ' for none so value is preserved next time through Configure
9907 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9908 prefixvar=vendorhtml1dir
9911 : Set the vendorhtml3dir variables
9912 case "$vendorprefix" in
9913 '') vendorhtml3dir=''
9914 vendorhtml3direxp=''
9916 *) : determine where vendor-supplied module html pages go.
9917 : There is no standard location, so try to copy the previously-selected
9918 : directory structure for the core html pages.
9919 : XXX Better default suggestions would be welcome.
9920 case "$vendorhtml3dir" in
9921 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9922 *) dflt=$vendorhtml3dir ;;
9925 ''|' ') dflt=none ;;
9928 rp='Pathname for the vendor-supplied html pages?'
9930 vendorhtml3dir="$ans"
9931 vendorhtml3direxp="$ansexp"
9934 : Use ' ' for none so value is preserved next time through Configure
9935 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9936 prefixvar=vendorhtml3dir
9939 : Set the vendorman1dir variables
9940 case "$vendorprefix" in
9941 '') vendorman1dir=''
9944 *) : determine where vendor-supplied manual pages go.
9945 case "$vendorman1dir" in
9946 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9947 *) dflt=$vendorman1dir ;;
9950 ''|' ') dflt=none ;;
9953 rp='Pathname for the vendor-supplied manual section 1 pages?'
9955 vendorman1dir="$ans"
9956 vendorman1direxp="$ansexp"
9959 : Use ' ' for none so value is preserved next time through Configure
9960 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9961 prefixvar=vendorman1dir
9964 : Set the vendorman3dir variables
9965 case "$vendorprefix" in
9966 '') vendorman3dir=''
9969 *) : determine where vendor-supplied module manual pages go.
9970 case "$vendorman3dir" in
9971 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9972 *) dflt=$vendorman3dir ;;
9975 ''|' ') dflt=none ;;
9978 rp='Pathname for the vendor-supplied manual section 3 pages?'
9980 vendorman3dir="$ans"
9981 vendorman3direxp="$ansexp"
9984 : Use ' ' for none so value is preserved next time through Configure
9985 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9986 prefixvar=vendorman3dir
9989 : Set the vendorscript variables
9990 case "$vendorprefix" in
9991 '') d_vendorscript="$undef"
9995 *) d_vendorscript="$define"
9996 : determine where vendor-supplied scripts go.
9997 case "$vendorscript" in
9998 '') dflt=$vendorprefix/script
9999 $test -d $dflt || dflt=$vendorbin ;;
10000 *) dflt="$vendorscript" ;;
10004 The installation process will create a directory for
10005 vendor-supplied scripts.
10009 rp='Pathname for the vendor-supplied scripts directory?'
10011 vendorscript="$ans"
10012 vendorscriptexp="$ansexp"
10015 prefixvar=vendorscript
10018 : script used to emit important warnings
10021 if test \$# -gt 0; then
10026 echo "*** WARNING:" >&4
10027 sed -e 's/^/*** /' <msg >&4
10029 cat msg >>config.msg
10030 echo " " >>config.msg
10036 : see which of string.h or strings.h is needed
10038 strings=`./findhdr string.h`
10039 if $test "$strings" && $test -r "$strings"; then
10040 echo "Using <string.h> instead of <strings.h>." >&4
10044 strings=`./findhdr strings.h`
10045 if $test "$strings" && $test -r "$strings"; then
10046 echo "Using <strings.h> instead of <string.h>." >&4
10048 ./warn "No string header found -- You'll surely have problems."
10053 case "$i_string" in
10054 "$undef") strings=`./findhdr strings.h`;;
10055 *) strings=`./findhdr string.h`;;
10058 : see if qgcvt exists
10062 : Check what kind of doubles your system has
10063 $echo "Checking the kind of doubles you have..." >&4
10065 #$i_stdlib I_STDLIB
10066 #define DOUBLESIZE $doublesize
10068 #include <stdlib.h>
10071 static const double d = -0.1;
10073 unsigned const char* b = (unsigned const char*)(&d);
10074 #if DOUBLESIZE == 4
10075 if (b[0] == 0xCD && b[3] == 0xBD) {
10076 /* IEEE 754 32-bit little-endian */
10080 if (b[0] == 0xBD && b[3] == 0xCD) {
10081 /* IEEE 754 32-bit big-endian */
10086 #if DOUBLESIZE == 8
10087 if (b[0] == 0x9A && b[7] == 0xBF) {
10088 /* IEEE 754 64-bit little-endian */
10092 if (b[0] == 0xBF && b[7] == 0x9A) {
10093 /* IEEE 754 64-bit big-endian */
10097 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10098 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10099 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10100 * 99 99 b9 bf 9a 99 99 99 */
10104 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10105 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10106 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10107 * 99 99 99 9a bf b9 99 99 */
10112 #if DOUBLESIZE == 16
10113 if (b[0] == 0x9A && b[15] == 0xBF) {
10114 /* IEEE 754 128-bit little-endian */
10118 if (b[0] == 0xBF && b[15] == 0x9A) {
10119 /* IEEE 754 128-bit big-endian */
10124 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10125 * Whether those environments can still build Perl is debatable. */
10126 printf("-1\n"); /* unknown */
10131 if eval $compile; then
10132 doublekind=`$run ./try`
10136 case "$doublekind" in
10137 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10138 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10139 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10140 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10141 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10142 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10143 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10144 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10145 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10149 : Check print/scan long double stuff
10152 if $test X"$d_longdbl" = X"$define"; then
10154 echo "Checking how to print long doubles..." >&4
10156 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10157 $cat >try.c <<'EOCP'
10158 #include <sys/types.h>
10161 double d = 123.456;
10162 printf("%.3f\n", d);
10166 if eval $compile; then
10170 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10171 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10172 echo "We will use %f."
10178 if $test X"$sPRIfldbl" = X; then
10179 $cat >try.c <<'EOCP'
10180 #include <sys/types.h>
10183 long double d = 123.456;
10184 printf("%.3Lf\n", d);
10188 if eval $compile; then
10192 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10193 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10194 echo "We will use %Lf."
10200 if $test X"$sPRIfldbl" = X; then
10201 $cat >try.c <<'EOCP'
10202 #include <sys/types.h>
10205 long double d = 123.456;
10206 printf("%.3llf\n", d);
10210 if eval $compile; then
10214 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10215 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10216 echo "We will use %llf."
10222 if $test X"$sPRIfldbl" = X; then
10223 $cat >try.c <<'EOCP'
10224 #include <sys/types.h>
10227 long double d = 123.456;
10228 printf("%.3lf\n", d);
10232 if eval $compile; then
10236 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10237 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10238 echo "We will use %lf."
10244 if $test X"$sPRIfldbl" = X; then
10245 echo "Cannot figure out how to print long doubles." >&4
10247 sSCNfldbl=$sPRIfldbl # expect consistency
10254 case "$sPRIfldbl" in
10255 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10256 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10257 d_SCNfldbl="$undef";
10259 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10260 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10261 d_SCNfldbl="$define";
10265 : Before committing on uselongdouble, see whether that looks sane.
10266 if $test "$uselongdouble" = "$define"; then
10269 echo "Checking if your long double math functions work right..." >&4
10274 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10277 case "$osname:$gccversion" in
10278 aix:) saveccflags="$ccflags"
10279 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10282 if eval $compile_ok; then
10286 3) echo "Your long double math functions are working correctly." >&4 ;;
10287 *) echo "Your long double math functions are broken, not using long doubles." >&4
10288 uselongdouble=$undef
10292 case "$osname:$gccversion" in
10293 aix:) ccflags="$saveccflags" ;; # restore
10297 : Check how to convert floats to strings.
10299 if test "X$d_Gconvert" = X; then
10302 echo "Checking for an efficient way to convert floats to strings."
10304 case "$uselongdouble" in
10305 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10307 case "$d_longdbl" in
10308 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10310 case "$d_PRIgldbl" in
10311 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10314 #ifdef TRY_gconvert
10315 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10316 char *myname = "gconvert";
10319 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10320 char *myname = "gcvt";
10323 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10324 char *myname = "qgcvt";
10325 #define DOUBLETYPE long double
10328 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10329 #ifdef HAS_PRIgldbl
10330 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10332 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10335 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10337 char *myname = "sprintf";
10341 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10342 #define DOUBLETYPE long double
10344 #define DOUBLETYPE double
10350 #$i_stdlib I_STDLIB
10352 #include <stdlib.h>
10354 #$i_string I_STRING
10356 # include <string.h>
10358 # include <strings.h>
10361 int checkit(char *expect, char *got)
10363 if (strcmp(expect, got)) {
10364 printf("%s oddity: Expected %s, got %s\n",
10365 myname, expect, got);
10375 /* This must be 1st test on (which?) platform */
10376 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10377 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10378 checkit("0.1", buf);
10380 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10381 checkit("0.01", buf);
10383 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10384 checkit("0.001", buf);
10386 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10387 checkit("0.0001", buf);
10389 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10390 if (strlen(buf) > 5)
10391 checkit("9e-005", buf); /* for Microsoft ?? */
10393 checkit("9e-05", buf);
10395 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10398 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10399 checkit("1.1", buf);
10401 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10402 checkit("1.01", buf);
10404 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10405 checkit("1.001", buf);
10407 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10408 checkit("1.0001", buf);
10410 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10411 checkit("1.00001", buf);
10413 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10414 checkit("1.000001", buf);
10416 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10419 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10420 checkit("-1", buf);
10422 /* Some Linux gcvt's give 1.e+5 here. */
10423 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10424 checkit("100000", buf);
10426 /* Some Linux gcvt's give -1.e+5 here. */
10427 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10428 checkit("-100000", buf);
10430 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10431 checkit("123.456", buf);
10433 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10434 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10435 /* 34 should be enough to scare even long double
10436 * places into using the e notation. */
10437 if (strlen(buf) > 5)
10438 checkit("1e+034", buf); /* for Microsoft */
10440 checkit("1e+34", buf);
10442 /* For Perl, if you add additional tests here, also add them to
10443 * t/base/num.t for benefit of platforms not using Configure or
10444 * overriding d_Gconvert */
10449 : first add preferred functions to our list
10451 for xxx_convert in $gconvert_preference; do
10452 case $xxx_convert in
10453 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10454 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10457 : then add any others
10458 for xxx_convert in gconvert gcvt sprintf; do
10459 case "$xxx_list" in
10461 *) xxx_list="$xxx_list $xxx_convert" ;;
10465 case "$d_longdbl$uselongdouble" in
10467 : again, add preferred functions to our list first
10469 for xxx_convert in $gconvert_ld_preference; do
10470 case $xxx_convert in
10471 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10472 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10475 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10476 for xxx_convert in qgcvt sprintf $xxx_list; do
10477 case "$xxx_ld_list" in
10478 $xxx_convert*|*" $xxx_convert"*) ;;
10479 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10482 : if sprintf cannot do long doubles, move it to the end
10483 if test "$d_PRIgldbl" != "$define"; then
10484 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10486 : if no qgcvt, remove it
10487 if test "$d_qgcvt" != "$define"; then
10488 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10491 xxx_list="$xxx_ld_list"
10495 for xxx_convert in $xxx_list; do
10496 echo "Trying $xxx_convert..."
10497 $rm -f try try$_o core
10498 set try -DTRY_$xxx_convert
10499 if eval $compile; then
10500 echo "$xxx_convert() found." >&4
10501 if $run ./try; then
10502 echo "I'll use $xxx_convert to convert floats into a string." >&4
10505 echo "...But $xxx_convert didn't work as I expected."
10509 echo "$xxx_convert NOT found." >&4
10513 if test X$xxx_convert = X; then
10514 echo "*** WHOA THERE!!! ***" >&4
10515 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10516 xxx_convert=sprintf
10519 case "$xxx_convert" in
10520 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10521 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10522 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10523 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10524 "$define$define$define")
10525 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10526 "$define$define$undef")
10527 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10528 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10536 : see if _fwalk exists
10540 : Initialize h_fcntl
10543 : Initialize h_sysfile
10546 : access call always available on UNIX
10547 set access d_access
10550 : locate the flags for 'access()'
10551 case "$d_access" in
10554 $cat >access.c <<EOCP
10555 #include <sys/types.h>
10560 #include <sys/file.h>
10563 #include <unistd.h>
10565 #$i_stdlib I_STDLIB
10567 #include <stdlib.h>
10573 : check sys/file.h first, no particular reason here
10574 if $test `./findhdr sys/file.h` && \
10575 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10577 echo "<sys/file.h> defines the *_OK access constants." >&4
10578 elif $test `./findhdr fcntl.h` && \
10579 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10581 echo "<fcntl.h> defines the *_OK access constants." >&4
10582 elif $test `./findhdr unistd.h` && \
10583 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10584 echo "<unistd.h> defines the *_OK access constants." >&4
10586 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10592 : see if accessx exists
10593 set accessx d_accessx
10596 : see if acosh exists
10600 : see if aintl exists
10604 : see if alarm exists
10608 : see if 64bit time functions exists
10610 set ctime64 d_ctime64
10613 set localtime64 d_localtime64
10616 set gmtime64 d_gmtime64
10619 set mktime64 d_mktime64
10622 set difftime64 d_difftime64
10625 set asctime64 d_asctime64
10628 : see if POSIX threads are available
10629 set pthread.h i_pthread
10632 : define a function to check prototypes
10633 $cat > protochk <<EOSH
10636 optimize="$optimize"
10638 prototype="$prototype"
10641 usethreads=$usethreads
10642 i_pthread=$i_pthread
10643 pthread_h_first=$pthread_h_first
10646 $cat >> protochk <<'EOSH'
10651 while test $# -ge 2; do
10653 $define) echo "#include <$2>" >> try.c ;;
10654 literal) echo "$2" >> try.c ;;
10656 # Extra magic for the benefit of systems that need pthread.h
10657 # to be included early to correctly detect threadsafe functions.
10658 # Such functions must guarantee themselves, though, that the usethreads
10659 # and i_pthread have been defined, before calling protochk.
10660 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10661 echo "#include <pthread.h>" >> try.c
10666 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10667 cat >> try.c <<'EOCP'
10668 #ifdef CAN_PROTOTYPE
10669 #define _(args) args
10674 echo "$foo" >> try.c
10675 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10676 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10682 $eunicefix protochk
10684 : Define hasproto macro for Configure internal use
10685 hasproto='varname=$1; func=$2; shift; shift;
10686 while $test $# -ge 2; do
10688 $define) echo "#include <$2>";;
10692 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10693 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10694 echo "$func() prototype found.";
10697 echo "$func() prototype NOT found.";
10704 : see if sys/types.h has to be included
10705 set sys/types.h i_systypes
10708 : see if sys/select.h has to be included
10709 set sys/select.h i_sysselct
10712 : Define hasfield macro for Configure internal use
10713 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10714 while $test $# -ge 2; do
10716 $define) echo "#include <$2>";;
10720 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10722 if eval $compile; then
10731 : see if we should include time.h, sys/time.h, or both
10733 if test "X$timeincl" = X; then
10734 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10735 $echo $n "I'm now running the test program...$c"
10737 #include <sys/types.h>
10742 #ifdef SYSTIMEKERNEL
10745 #include <sys/time.h>
10748 #include <sys/select.h>
10750 #$i_stdlib I_STDLIB
10752 #include <stdlib.h>
10758 struct timeval bar;
10761 struct timezone tzp;
10763 if (foo.tm_sec == foo.tm_sec)
10766 if (bar.tv_sec == bar.tv_sec)
10773 for s_timezone in '-DS_TIMEZONE' ''; do
10775 for s_timeval in '-DS_TIMEVAL' ''; do
10776 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10777 for i_time in '' '-DI_TIME'; do
10778 for i_systime in '-DI_SYSTIME' ''; do
10781 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10782 if eval $compile; then
10783 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10787 $echo $n "Succeeded with $flags$c"
10799 *SYSTIMEKERNEL*) i_systimek="$define"
10800 timeincl=`./findhdr sys/time.h`
10801 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10802 *) i_systimek="$undef";;
10805 *I_TIME*) i_time="$define"
10806 timeincl=`./findhdr time.h`" $timeincl"
10807 echo "We'll include <time.h>." >&4;;
10808 *) i_time="$undef";;
10811 *I_SYSTIME*) i_systime="$define"
10812 timeincl=`./findhdr sys/time.h`" $timeincl"
10813 echo "We'll include <sys/time.h>." >&4;;
10814 *) i_systime="$undef";;
10818 : see if struct tm knows about tm_zone
10819 case "$i_systime$i_time" in
10822 echo "Checking to see if your struct tm has tm_zone field..." >&4
10823 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10831 case "$d_tm_tm_zone" in
10832 "$define") echo "Yes, it does." ;;
10833 *) echo "No, it doesn't." ;;
10835 : see if struct tm knows about tm_gmtoff
10836 case "$i_systime$i_time" in
10839 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10840 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10848 case "$d_tm_tm_gmtoff" in
10849 "$define") echo "Yes, it does." ;;
10850 *) echo "No, it doesn't." ;;
10853 : see if asctime_r exists
10854 set asctime_r d_asctime_r
10856 case "$d_asctime_r" in
10858 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10859 case "$d_asctime_r_proto:$usethreads" in
10860 ":define") d_asctime_r_proto=define
10861 set d_asctime_r_proto asctime_r $hdrs
10865 case "$d_asctime_r_proto" in
10867 case "$asctime_r_proto" in
10868 ''|0) try='char* asctime_r(const struct tm*, char*);'
10869 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10871 case "$asctime_r_proto" in
10872 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10873 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10875 case "$asctime_r_proto" in
10876 ''|0) try='int asctime_r(const struct tm*, char*);'
10877 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10879 case "$asctime_r_proto" in
10880 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10881 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10883 case "$asctime_r_proto" in
10884 ''|0) d_asctime_r=undef
10886 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10887 * ) case "$asctime_r_proto" in
10888 REENTRANT_PROTO*) ;;
10889 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10891 echo "Prototype: $try" ;;
10894 *) case "$usethreads" in
10895 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10902 *) asctime_r_proto=0
10906 : see if asinh exists
10910 : see if atanh exists
10914 : see if atolf exists
10918 : see if atoll exists
10922 : Look for GCC-style attribute format
10923 case "$d_attribute_format" in
10926 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10927 $cat >attrib.c <<'EOCP'
10929 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10931 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10932 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10933 echo "Your C compiler doesn't support __attribute__((format))."
10936 echo "Your C compiler supports __attribute__((format))."
10940 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10944 *) val="$d_attribute_format" ;;
10946 set d_attribute_format
10950 : Look for GCC-style attribute format with null format allowed
10951 case "$d_printf_format_null" in
10952 '') case "$d_attribute_format" in
10955 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10956 $cat >attrib.c <<EOCP
10958 #$i_stdlib I_STDLIB
10960 #include <stdlib.h>
10962 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10963 int null_printf (char* pat,...) { return (int)pat; }
10964 int main () { exit(null_printf(NULL)); }
10966 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10967 : run the executable in case it produces a run-time warning
10968 if $run ./attrib >>attrib.out 2>&1; then
10969 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10970 echo "Your C compiler doesn't allow __printf__ format to be null."
10973 echo "Your C compiler allows __printf__ format to be null."
10977 echo "Your C compiler executable failed with __printf__ format null."
10981 echo "Your C compiler fails with __printf__ format null."
10988 *) val="$d_printf_format_null" ;;
10990 set d_printf_format_null
10994 : Look for GCC-style attribute malloc
10995 case "$d_attribute_malloc" in
10998 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10999 $cat >attrib.c <<'EOCP'
11001 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11003 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11004 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11005 echo "Your C compiler doesn't support __attribute__((malloc))."
11008 echo "Your C compiler supports __attribute__((malloc))."
11012 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11016 *) val="$d_attribute_malloc" ;;
11018 set d_attribute_malloc
11022 : Look for GCC-style attribute nonnull
11023 case "$d_attribute_nonnull" in
11026 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11027 $cat >attrib.c <<'EOCP'
11029 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11031 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11032 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11033 echo "Your C compiler doesn't support __attribute__((nonnull))."
11036 echo "Your C compiler supports __attribute__((nonnull))."
11040 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11044 *) val="$d_attribute_nonnull" ;;
11046 set d_attribute_nonnull
11050 : Look for GCC-style attribute noreturn
11051 case "$d_attribute_noreturn" in
11054 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11055 $cat >attrib.c <<'EOCP'
11057 void fall_over_dead( void ) __attribute__((noreturn));
11059 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11060 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11061 echo "Your C compiler doesn't support __attribute__((noreturn))."
11064 echo "Your C compiler supports __attribute__((noreturn))."
11068 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11072 *) val="$d_attribute_noreturn" ;;
11074 set d_attribute_noreturn
11078 : Look for GCC-style attribute pure
11079 case "$d_attribute_pure" in
11082 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11083 $cat >attrib.c <<'EOCP'
11085 int square( int n ) __attribute__((pure));
11087 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11088 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11089 echo "Your C compiler doesn't support __attribute__((pure))."
11092 echo "Your C compiler supports __attribute__((pure))."
11096 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11100 *) val="$d_attribute_pure" ;;
11102 set d_attribute_pure
11106 : Look for GCC-style attribute unused
11107 case "$d_attribute_unused" in
11110 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11111 $cat >attrib.c <<'EOCP'
11113 int do_something( int dummy __attribute__((unused)), int n );
11115 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11116 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11117 echo "Your C compiler doesn't support __attribute__((unused))."
11120 echo "Your C compiler supports __attribute__((unused))."
11124 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11128 *) val="$d_attribute_unused" ;;
11130 set d_attribute_unused
11134 : Look for GCC-style attribute deprecated
11135 case "$d_attribute_deprecated" in
11138 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11139 $cat >attrib.c <<'EOCP'
11141 int I_am_deprecated(void) __attribute__((deprecated));
11143 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11144 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11145 echo "Your C compiler doesn't support __attribute__((deprecated))."
11148 echo "Your C compiler supports __attribute__((deprecated))."
11152 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11156 *) val="$d_attribute_deprecated" ;;
11158 set d_attribute_deprecated
11162 : Look for GCC-style attribute warn_unused_result
11163 case "$d_attribute_warn_unused_result" in
11166 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11167 $cat >attrib.c <<'EOCP'
11169 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11171 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11172 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11173 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11176 echo "Your C compiler supports __attribute__((warn_unused_result))."
11180 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11184 *) val="$d_attribute_warn_unused_result" ;;
11186 set d_attribute_warn_unused_result
11190 : see if bcmp exists
11194 : see if bcopy exists
11198 : see if getpgrp exists
11199 set getpgrp d_getpgrp
11202 case "$d_getpgrp" in
11205 echo "Checking to see which flavor of getpgrp is in use..."
11207 #$i_unistd I_UNISTD
11208 #include <sys/types.h>
11210 # include <unistd.h>
11212 #$i_stdlib I_STDLIB
11214 #include <stdlib.h>
11218 if (getuid() == 0) {
11219 printf("(I see you are running Configure as super-user...)\n");
11222 #ifdef TRY_BSD_PGRP
11223 if (getpgrp(1) == 0)
11232 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11233 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11235 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11236 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11239 echo "I can't seem to compile and run the test program."
11241 xxx="a USG one, i.e. you use getpgrp()."
11243 # SVR4 systems can appear rather BSD-ish.
11244 case "$i_unistd" in
11246 xxx="a BSD one, i.e. you use getpgrp(pid)."
11250 xxx="probably a USG one, i.e. you use getpgrp()."
11255 echo "Assuming your getpgrp is $xxx" >&4
11264 : see if setpgrp exists
11265 set setpgrp d_setpgrp
11268 case "$d_setpgrp" in
11271 echo "Checking to see which flavor of setpgrp is in use..."
11273 #$i_unistd I_UNISTD
11274 #include <sys/types.h>
11276 # include <unistd.h>
11278 #$i_stdlib I_STDLIB
11280 #include <stdlib.h>
11284 if (getuid() == 0) {
11285 printf("(I see you are running Configure as super-user...)\n");
11288 #ifdef TRY_BSD_PGRP
11289 if (-1 == setpgrp(1, 1))
11292 if (setpgrp() != -1)
11298 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11299 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11301 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11302 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11305 echo "(I can't seem to compile and run the test program.)"
11307 xxx="a USG one, i.e. you use setpgrp()."
11309 # SVR4 systems can appear rather BSD-ish.
11310 case "$i_unistd" in
11312 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11316 xxx="probably a USG one, i.e. you use setpgrp()."
11321 echo "Assuming your setpgrp is $xxx" >&4
11330 : Look for GCC-style __builtin_choose_expr
11331 case "$d_builtin_choose_expr" in
11334 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11335 $cat >try.c <<'EOCP'
11336 #include <assert.h>
11337 #include <stdlib.h>
11340 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11343 assert( SYRINX(1) == 2112 );
11344 assert( SYRINX(1) != 5150 );
11345 assert( SYRINX(0) == 5150 );
11346 assert( SYRINX(0) != 2112 );
11347 puts( "All good!" );
11353 if eval $compile && $run ./try; then
11354 echo "Your C compiler supports __builtin_choose_expr."
11357 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11361 *) val="$d_builtin_choose_expr" ;;
11364 set d_builtin_choose_expr
11368 : Look for GCC-style __builtin_expect
11369 case "$d_builtin_expect" in
11372 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11373 $cat >try.c <<'EOCP'
11376 if ( __builtin_expect(n, 0) ) n = 1;
11377 /* Remember shell exit code truth is 0, C truth is non-zero */
11382 if eval $compile && $run ./try; then
11383 echo "Your C compiler supports __builtin_expect."
11386 echo "Your C compiler doesn't seem to understand __builtin_expect."
11390 *) val="$d_builtin_expect" ;;
11393 set d_builtin_expect
11397 : see if bzero exists
11401 : see if stdarg is available
11403 if $test `./findhdr stdarg.h`; then
11404 echo "<stdarg.h> found." >&4
11407 echo "<stdarg.h> NOT found." >&4
11411 : see if varargs is available
11413 if $test `./findhdr varargs.h`; then
11414 echo "<varargs.h> found." >&4
11416 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11419 : set up the varargs testing programs
11420 $cat > varargs.c <<EOP
11422 #include <stdarg.h>
11425 #include <varargs.h>
11429 int f(char *p, ...)
11443 p = va_arg(ap, char *);
11449 $cat > varargs <<EOP
11451 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11460 : now check which varargs header should be included
11466 if `./varargs I_STDARG`; then
11468 elif `./varargs I_VARARGS`; then
11473 if `./varargs I_VARARGS`; then
11481 echo "*** WHOA THERE!!! ***" >&4
11482 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11483 case "$knowitall" in
11485 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11489 echo "I could not find the definition for va_dcl... You have problems..." >&4
11490 val="$undef"; set i_stdarg; eval $setvar
11491 val="$undef"; set i_varargs; eval $setvar
11496 case "$i_varhdr" in
11498 val="$define"; set i_stdarg; eval $setvar
11499 val="$undef"; set i_varargs; eval $setvar
11502 val="$undef"; set i_stdarg; eval $setvar
11503 val="$define"; set i_varargs; eval $setvar
11506 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11510 : see if the Compiler supports C99 variadic macros
11511 case "$i_stdarg$i_stdlib" in
11513 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11516 #include <stdarg.h>
11518 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11522 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11528 if eval $compile && $run ./try 2>&1 >/dev/null; then
11529 case "`$run ./try`" in
11531 echo "You have C99 variadic macros." >&4
11532 d_c99_variadic_macros="$define"
11535 echo "You don't have functional C99 variadic macros." >&4
11536 d_c99_variadic_macros="$undef"
11540 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11541 d_c99_variadic_macros="$undef"
11546 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11547 d_c99_variadic_macros="$undef"
11551 : see if signal is declared as pointer to function returning int or void
11553 xxx=`./findhdr signal.h`
11554 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11555 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11556 echo "You have int (*signal())() instead of void." >&4
11558 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11559 echo "You have void (*signal())()." >&4
11561 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11562 echo "You have int (*signal())() instead of void." >&4
11564 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11565 echo "You have void (*signal())()." >&4
11568 case "$d_voidsig" in
11570 echo "I can't determine whether signal handler returns void or int..." >&4
11572 rp="What type does your signal handler return?"
11575 v*) val="$define";;
11579 echo "As you already told me, signal handler returns void." >&4
11582 *) echo "As you already told me, signal handler returns int." >&4
11589 case "$d_voidsig" in
11590 "$define") signal_t="void";;
11591 *) signal_t="int";;
11595 : check for ability to cast large floats to 32-bit ints.
11597 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11598 if $test "$intsize" -ge 4; then
11605 #$i_stdlib I_STDLIB
11607 #include <stdlib.h>
11609 #include <sys/types.h>
11610 #include <signal.h>
11611 $signal_t blech(int s) { exit(3); }
11618 signal(SIGFPE, blech);
11620 /* Don't let compiler optimize the test away. Store the number
11621 in a writable string for gcc to pass to sscanf under HP-UX.
11623 sprintf(str, "2147483647");
11624 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11628 /* x86 processors will probably give 0x8000 0000, which is a
11629 sign change. We don't want that. We want to mimic SPARC
11630 behavior here, which is to preserve the sign and give
11633 if (i32 != ($xxx) f)
11639 if eval $compile_ok; then
11640 $run ./try 2>/dev/null
11643 echo "(I can't seem to compile the test program--assuming it can't)"
11648 echo "Yup, it can."
11651 echo "Nope, it can't."
11658 : check for ability to cast negative floats to unsigned
11660 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11663 #$i_stdlib I_STDLIB
11665 #include <stdlib.h>
11667 #include <sys/types.h>
11668 #include <signal.h>
11669 $signal_t blech(int s) { exit(7); }
11670 $signal_t blech_in_list(int s) { exit(4); }
11671 unsigned long dummy_long(unsigned long p) { return p; }
11672 unsigned int dummy_int(unsigned int p) { return p; }
11673 unsigned short dummy_short(unsigned short p) { return p; }
11677 unsigned long along;
11679 unsigned short ashort;
11683 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11684 a direct f = -123. assignment. gcc-2.8.0 reportedly
11685 optimized the whole file away
11687 /* Store the number in a writable string for gcc to pass to
11688 sscanf under HP-UX.
11690 sprintf(str, "-123");
11691 sscanf(str, "%lf", &f); /* f = -123.; */
11693 signal(SIGFPE, blech);
11694 along = (unsigned long)f;
11695 aint = (unsigned int)f;
11696 ashort = (unsigned short)f;
11697 if (along != (unsigned long)-123)
11699 if (aint != (unsigned int)-123)
11701 if (ashort != (unsigned short)-123)
11703 sprintf(str, "1073741824.");
11704 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11707 along = (unsigned long)f;
11708 if (along != 0x80000000)
11712 along = (unsigned long)f;
11713 if (along != 0x7fffffff)
11717 along = (unsigned long)f;
11718 if (along != 0x80000001)
11722 signal(SIGFPE, blech_in_list);
11723 sprintf(str, "123.");
11724 sscanf(str, "%lf", &f); /* f = 123.; */
11725 along = dummy_long((unsigned long)f);
11726 aint = dummy_int((unsigned int)f);
11727 ashort = dummy_short((unsigned short)f);
11728 if (along != (unsigned long)123)
11730 if (aint != (unsigned int)123)
11732 if (ashort != (unsigned short)123)
11739 if eval $compile_ok; then
11740 $run ./try 2>/dev/null
11743 echo "(I can't seem to compile the test program--assuming it can't)"
11746 case "$castflags" in
11748 echo "Yup, it can."
11751 echo "Nope, it can't."
11758 : see if cbrt exists
11762 : see if vprintf exists
11764 if set vprintf val -f d_vprintf; eval $csym; $val; then
11765 echo 'vprintf() found.' >&4
11768 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11769 #$i_varargs I_VARARGS
11771 #$i_stdlib I_STDLIB
11772 #$i_unistd I_UNISTD
11775 # include <stdarg.h>
11776 #else /* I_VARARGS */
11777 # include <varargs.h>
11781 # include <unistd.h>
11785 # include <stdlib.h>
11788 #include <stdio.h> /* vsprintf prototype */
11791 void xxx(int n, ...)
11796 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11798 int main() { xxx(1, "foo"); }
11800 #else /* I_VARARGS */
11808 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11810 int main() { xxx("foo"); }
11816 if eval $compile_ok; then
11817 if $run ./try; then
11818 echo "Your vsprintf() returns (int)." >&4
11821 echo "Your vsprintf() returns (char*)." >&4
11825 echo 'I am unable to compile the vsprintf() test program.' >&4
11826 # We shouldn't get here. If we do, assume the standard signature,
11827 # not the old BSD one.
11828 echo 'Guessing that vsprintf() returns (int).' >&4
11832 echo 'vprintf() NOT found.' >&4
11843 : see if chown exists
11847 : see if chroot exists
11848 set chroot d_chroot
11851 : see if chsize exists
11852 set chsize d_chsize
11855 : see if class exists
11859 : see if clearenv exists
11860 set clearenv d_clearenv
11863 : Define hasstruct macro for Configure internal use
11864 hasstruct='varname=$1; struct=$2; shift; shift;
11865 while $test $# -ge 2; do
11867 $define) echo "#include <$2>";;
11871 echo "int main () { struct $struct foo; }" >> try.c;
11873 if eval $compile; then
11882 : see whether socket exists
11886 $echo $n "Hmm... $c" >&4
11887 if set socket val -f d_socket; eval $csym; $val; then
11888 echo "Looks like you have Berkeley networking support." >&4
11890 if set setsockopt val -f; eval $csym; $val; then
11893 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11894 d_oldsock="$define"
11897 if $contains socklib libc.list >/dev/null 2>&1; then
11898 echo "Looks like you have Berkeley networking support." >&4
11900 : we will have to assume that it supports the 4.2 BSD interface
11903 echo "You don't have Berkeley networking in libc$_a..." >&4
11904 if test "X$d_socket" = "X$define"; then
11905 echo "...but you seem to believe that you have sockets." >&4
11907 for net in net socket
11909 if test -f $sysroot/usr/lib/lib$net$_a; then
11910 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11911 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11912 if $contains socket libc.list >/dev/null 2>&1; then
11917 echo "...but the Wollongong group seems to have hacked it in." >&4
11918 sockethdr="-I$sysroot/usr/netinclude"
11921 echo "Found Berkeley sockets interface in lib$net." >&4
11922 if $contains setsockopt libc.list >/dev/null 2>&1; then
11925 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11926 d_oldsock="$define"
11932 if test "X$d_socket" != "X$define"; then
11933 echo "or anywhere else I see." >&4
11941 : see if socketpair exists
11942 set socketpair d_sockpair
11947 echo "Checking the availability sa_len in the sock struct ..." >&4
11949 #include <sys/types.h>
11950 #include <sys/socket.h>
11952 struct sockaddr sa;
11953 return (sa.sa_len);
11957 set try; if eval $compile; then
11960 set d_sockaddr_sa_len; eval $setvar
11964 echo "Checking the availability struct sockaddr_in6 ..." >&4
11966 #include <sys/types.h>
11967 #include <sys/socket.h>
11968 #include <netinet/in.h>
11970 struct sockaddr_in6 sin6;
11971 return (sin6.sin6_family);
11975 set try; if eval $compile; then
11978 set d_sockaddr_in6; eval $setvar
11982 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11984 #include <sys/types.h>
11985 #include <sys/socket.h>
11986 #include <netinet/in.h>
11988 struct sockaddr_in6 sin6;
11989 return (sin6.sin6_scope_id);
11993 set try; if eval $compile; then
11996 set d_sin6_scope_id; eval $setvar
12000 echo "Checking the availability struct ip_mreq ..." >&4
12002 #include <sys/types.h>
12003 #include <sys/socket.h>
12004 #include <netinet/in.h>
12006 struct ip_mreq mreq;
12007 return (mreq.imr_multiaddr.s_addr);
12011 set try; if eval $compile; then
12014 set d_ip_mreq; eval $setvar
12018 echo "Checking the availability struct ip_mreq_source ..." >&4
12020 #include <sys/types.h>
12021 #include <sys/socket.h>
12022 #include <netinet/in.h>
12024 struct ip_mreq_source mreq;
12025 return (mreq.imr_multiaddr.s_addr);
12029 set try; if eval $compile; then
12032 set d_ip_mreq_source; eval $setvar
12036 echo "Checking the availability struct ipv6_mreq ..." >&4
12038 #include <sys/types.h>
12039 #include <sys/socket.h>
12040 #include <netinet/in.h>
12042 struct ipv6_mreq mreq;
12043 return (mreq.ipv6mr_interface);
12047 set try; if eval $compile; then
12050 set d_ipv6_mreq; eval $setvar
12054 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12056 #include <sys/types.h>
12057 #include <sys/socket.h>
12058 #include <netinet/in.h>
12060 struct ipv6_mreq_source mreq;
12061 return (mreq.imr_multiaddr.s_addr);
12065 set try; if eval $compile; then
12068 set d_ipv6_mreq_source; eval $setvar
12072 echo "Checking the availability of certain socket constants..." >&4
12073 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12074 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12076 #include <sys/types.h>
12077 #include <sys/socket.h>
12083 set try; if eval $compile; then
12086 set d_${enum}; eval $setvar
12090 : see if this is a sys/uio.h system
12091 set sys/uio.h i_sysuio
12094 : Check for cmsghdr support
12096 echo "Checking to see if your system supports struct cmsghdr..." >&4
12097 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12099 case "$d_cmsghdr_s" in
12100 "$define") echo "Yes, it does." ;;
12101 *) echo "No, it doesn't." ;;
12105 : check for const keyword
12107 echo 'Checking to see if your C compiler knows about "const"...' >&4
12108 $cat >const.c <<'EOCP'
12109 typedef struct spug { int drokk; } spug;
12113 const spug y = { 0 };
12116 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12118 echo "Yup, it does."
12121 echo "Nope, it doesn't."
12126 : see if copysign exists
12127 set copysign d_copysign
12130 : see if copysignl exists
12131 set copysignl d_copysignl
12134 : see if crypt exists
12139 $define) cryptlib='' ;;
12140 *) if set crypt val -f d_crypt; eval $csym; $val; then
12141 echo 'crypt() found.' >&4
12145 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12146 if $test -z "$cryptlib"; then
12147 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12151 if $test -z "$cryptlib"; then
12152 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12156 if $test -z "$cryptlib"; then
12157 cryptlib=`./loc libcrypt$_a "" $libpth`
12161 if $test -z "$cryptlib"; then
12162 echo 'crypt() NOT found.' >&4
12173 : see if this is a crypt.h system
12174 set crypt.h i_crypt
12177 : see if crypt_r exists
12178 set crypt_r d_crypt_r
12180 case "$d_crypt_r" in
12182 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12183 case "$d_crypt_r_proto:$usethreads" in
12184 ":define") d_crypt_r_proto=define
12185 set d_crypt_r_proto crypt_r $hdrs
12189 case "$d_crypt_r_proto" in
12191 case "$crypt_r_proto" in
12192 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12193 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12195 case "$crypt_r_proto" in
12196 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12197 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12199 case "$crypt_r_proto" in
12200 ''|0) d_crypt_r=undef
12202 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12203 * ) case "$crypt_r_proto" in
12204 REENTRANT_PROTO*) ;;
12205 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12207 echo "Prototype: $try" ;;
12210 *) case "$usethreads" in
12211 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12222 : get csh whereabouts
12224 'csh') val="$undef" ;;
12225 *) val="$define" ;;
12229 : Respect a hint or command line value for full_csh.
12230 case "$full_csh" in
12231 '') full_csh=$csh ;;
12234 : see if ctermid exists
12235 set ctermid d_ctermid
12238 : see if ctermid_r exists
12239 set ctermid_r d_ctermid_r
12241 case "$d_ctermid_r" in
12243 hdrs="$i_systypes sys/types.h define stdio.h "
12244 case "$d_ctermid_r_proto:$usethreads" in
12245 ":define") d_ctermid_r_proto=define
12246 set d_ctermid_r_proto ctermid_r $hdrs
12250 case "$d_ctermid_r_proto" in
12252 case "$ctermid_r_proto" in
12253 ''|0) try='char* ctermid_r(char*);'
12254 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12256 case "$ctermid_r_proto" in
12257 ''|0) d_ctermid_r=undef
12259 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12260 * ) case "$ctermid_r_proto" in
12261 REENTRANT_PROTO*) ;;
12262 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12264 echo "Prototype: $try" ;;
12267 *) case "$usethreads" in
12268 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12275 *) ctermid_r_proto=0
12279 : see if ctime_r exists
12280 set ctime_r d_ctime_r
12282 case "$d_ctime_r" in
12284 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12285 case "$d_ctime_r_proto:$usethreads" in
12286 ":define") d_ctime_r_proto=define
12287 set d_ctime_r_proto ctime_r $hdrs
12291 case "$d_ctime_r_proto" in
12293 case "$ctime_r_proto" in
12294 ''|0) try='char* ctime_r(const time_t*, char*);'
12295 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12297 case "$ctime_r_proto" in
12298 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12299 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12301 case "$ctime_r_proto" in
12302 ''|0) try='int ctime_r(const time_t*, char*);'
12303 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12305 case "$ctime_r_proto" in
12306 ''|0) try='int ctime_r(const time_t*, char*, int);'
12307 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12309 case "$ctime_r_proto" in
12310 ''|0) d_ctime_r=undef
12312 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12313 * ) case "$ctime_r_proto" in
12314 REENTRANT_PROTO*) ;;
12315 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12317 echo "Prototype: $try" ;;
12320 *) case "$usethreads" in
12321 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12332 : see if cuserid exists
12333 set cuserid d_cuserid
12336 : see if this is a limits.h system
12337 set limits.h i_limits
12340 : See if number of significant digits in a double precision number is known
12342 $cat >dbl_dig.c <<EOM
12343 #$i_limits I_LIMITS
12346 #include <limits.h>
12352 printf("Contains DBL_DIG");
12355 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12356 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12357 echo "DBL_DIG found." >&4
12360 echo "DBL_DIG NOT found." >&4
12367 : see if dbm.h is available
12368 : see if dbmclose exists
12369 set dbmclose d_dbmclose
12372 case "$d_dbmclose" in
12382 *) set rpcsvc/dbm.h i_rpcsvcdbm
12387 *) echo "We won't be including <dbm.h>"
12397 : see if prototype for dbminit is available
12399 set d_dbminitproto dbminit $i_dbm dbm.h
12402 : see if difftime exists
12403 set difftime d_difftime
12406 : see if this is a dirent system
12408 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12410 echo "<dirent.h> found." >&4
12413 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12414 echo "<sys/dir.h> found." >&4
12417 xinc=`./findhdr sys/ndir.h`
12419 echo "<dirent.h> NOT found." >&4
12424 : Look for type of directory structure.
12426 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12428 case "$direntrytype" in
12430 case "$i_dirent" in
12431 $define) guess1='struct dirent' ;;
12432 *) guess1='struct direct' ;;
12435 *) guess1="$direntrytype"
12440 'struct dirent') guess2='struct direct' ;;
12441 *) guess2='struct dirent' ;;
12444 if $contains "$guess1" try.c >/dev/null 2>&1; then
12445 direntrytype="$guess1"
12446 echo "Your directory entries are $direntrytype." >&4
12447 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12448 direntrytype="$guess2"
12449 echo "Your directory entries seem to be $direntrytype." >&4
12451 echo "I don't recognize your system's directory entries." >&4
12452 rp="What type is used for directory entries on this system?"
12455 direntrytype="$ans"
12459 : see if the directory entry stores field length
12461 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12462 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12463 echo "Good, your directory entry keeps length information in d_namlen." >&4
12466 echo "Your directory entry does not know about the d_namlen field." >&4
12473 : Look for DIR.dd_fd
12474 case "$i_dirent" in
12476 echo "Checking to see if DIR has a dd_fd member variable" >&4
12478 #$i_stdlib I_STDLIB
12480 #include <stdlib.h>
12482 #include <dirent.h>
12492 if eval $compile; then
12493 echo "Yes, it does."
12496 echo "No, it does not."
12501 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12509 : see if this is an sysdir system
12510 set sys/dir.h i_sysdir
12513 : see if this is an sysndir system
12514 set sys/ndir.h i_sysndir
12519 $cat >dirfd.c <<EOM
12521 #$i_stdlib I_STDLIB
12523 #include <stdlib.h>
12525 #$i_dirent I_DIRENT /**/
12526 #$i_sysdir I_SYS_DIR /**/
12527 #$i_sysndir I_SYS_NDIR /**/
12528 #$i_systypes I_SYS_TYPES /**/
12529 #if defined(I_SYS_TYPES)
12530 #include <sys/types.h>
12532 #if defined(I_DIRENT)
12533 #include <dirent.h>
12536 #include <sys/ndir.h>
12540 #include <ndir.h> /* may be wrong in the future */
12542 #include <sys/dir.h>
12548 DIR *dirp = opendir(".");
12549 if (dirfd(dirp) >= 0)
12557 if eval $compile; then
12561 $define) echo "dirfd() found." >&4 ;;
12562 *) echo "dirfd() NOT found." >&4 ;;
12568 : see if dladdr exists
12569 set dladdr d_dladdr
12572 : see if dlerror exists
12575 set dlerror d_dlerror
12579 : see if dlfcn is available
12580 set dlfcn.h i_dlfcn
12583 : Check what extension to use for shared libs
12588 On a few systems, the dynamically loaded modules that perl generates and uses
12589 will need a different extension than shared libs. The default will probably
12595 *) dflt="$dlext" ;;
12597 rp='What is the extension of dynamically loaded modules'
12606 : Check if dlsym need a leading underscore
12612 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12613 $cat >dyna.c <<'EOM'
12620 #$i_stdlib I_STDLIB
12622 #include <stdlib.h>
12626 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12628 #include <sys/types.h>
12633 extern int fred() ;
12642 int mode = RTLD_LAZY ;
12644 handle = dlopen("./dyna.$dlext", mode) ;
12645 if (handle == NULL) {
12650 symbol = dlsym(handle, "fred") ;
12651 if (symbol == NULL) {
12652 /* try putting a leading underscore */
12653 symbol = dlsym(handle, "_fred") ;
12654 if (symbol == NULL) {
12667 : Call the object file tmp-dyna.o in case dlext=o.
12668 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12669 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12670 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12671 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12674 1) echo "Test program failed using dlopen." >&4
12675 echo "Perhaps you should not use dynamic loading." >&4;;
12676 2) echo "Test program failed using dlsym." >&4
12677 echo "Perhaps you should not use dynamic loading." >&4;;
12678 3) echo "dlsym needs a leading underscore" >&4
12680 4) echo "dlsym doesn't need a leading underscore." >&4;;
12683 echo "I can't compile and run the test program." >&4
12684 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12689 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12694 : see if drand48_r exists
12695 set drand48_r d_drand48_r
12697 case "$d_drand48_r" in
12699 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12700 case "$d_drand48_r_proto:$usethreads" in
12701 ":define") d_drand48_r_proto=define
12702 set d_drand48_r_proto drand48_r $hdrs
12706 case "$d_drand48_r_proto" in
12708 case "$drand48_r_proto" in
12709 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12710 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12712 case "$drand48_r_proto" in
12713 ''|0) d_drand48_r=undef
12715 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12716 * ) case "$drand48_r_proto" in
12717 REENTRANT_PROTO*) ;;
12718 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12720 echo "Prototype: $try" ;;
12723 *) case "$usethreads" in
12724 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12731 *) drand48_r_proto=0
12735 : see if prototype for drand48 is available
12737 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12740 : see if dup2 exists
12744 : see if eaccess exists
12745 set eaccess d_eaccess
12748 : see if endgrent exists
12749 set endgrent d_endgrent
12752 : see if this is an grp system
12758 xxx=`./findhdr grp.h`
12759 $cppstdin $cppflags $cppminus < $xxx >$$.h
12761 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12773 set d_grpasswd; eval $setvar
12777 : see if endgrent_r exists
12778 set endgrent_r d_endgrent_r
12780 case "$d_endgrent_r" in
12782 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12783 case "$d_endgrent_r_proto:$usethreads" in
12784 ":define") d_endgrent_r_proto=define
12785 set d_endgrent_r_proto endgrent_r $hdrs
12789 case "$d_endgrent_r_proto" in
12791 case "$endgrent_r_proto" in
12792 ''|0) try='int endgrent_r(FILE**);'
12793 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12795 case "$endgrent_r_proto" in
12796 ''|0) try='void endgrent_r(FILE**);'
12797 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12799 case "$endgrent_r_proto" in
12800 ''|0) d_endgrent_r=undef
12802 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12803 * ) case "$endgrent_r_proto" in
12804 REENTRANT_PROTO*) ;;
12805 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12807 echo "Prototype: $try" ;;
12810 *) case "$usethreads" in
12811 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12818 *) endgrent_r_proto=0
12822 : see if endhostent exists
12823 set endhostent d_endhent
12826 : see if this is a netdb.h system
12827 set netdb.h i_netdb
12830 : see if endhostent_r exists
12831 set endhostent_r d_endhostent_r
12833 case "$d_endhostent_r" in
12835 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12836 case "$d_endhostent_r_proto:$usethreads" in
12837 ":define") d_endhostent_r_proto=define
12838 set d_endhostent_r_proto endhostent_r $hdrs
12842 case "$d_endhostent_r_proto" in
12844 case "$endhostent_r_proto" in
12845 ''|0) try='int endhostent_r(struct hostent_data*);'
12846 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12848 case "$endhostent_r_proto" in
12849 ''|0) try='void endhostent_r(struct hostent_data*);'
12850 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12852 case "$endhostent_r_proto" in
12853 ''|0) d_endhostent_r=undef
12854 endhostent_r_proto=0
12855 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12856 * ) case "$endhostent_r_proto" in
12857 REENTRANT_PROTO*) ;;
12858 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12860 echo "Prototype: $try" ;;
12863 *) case "$usethreads" in
12864 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12866 d_endhostent_r=undef
12867 endhostent_r_proto=0
12871 *) endhostent_r_proto=0
12875 : see if endnetent exists
12876 set endnetent d_endnent
12879 : see if endnetent_r exists
12880 set endnetent_r d_endnetent_r
12882 case "$d_endnetent_r" in
12884 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12885 case "$d_endnetent_r_proto:$usethreads" in
12886 ":define") d_endnetent_r_proto=define
12887 set d_endnetent_r_proto endnetent_r $hdrs
12891 case "$d_endnetent_r_proto" in
12893 case "$endnetent_r_proto" in
12894 ''|0) try='int endnetent_r(struct netent_data*);'
12895 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12897 case "$endnetent_r_proto" in
12898 ''|0) try='void endnetent_r(struct netent_data*);'
12899 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12901 case "$endnetent_r_proto" in
12902 ''|0) d_endnetent_r=undef
12903 endnetent_r_proto=0
12904 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12905 * ) case "$endnetent_r_proto" in
12906 REENTRANT_PROTO*) ;;
12907 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12909 echo "Prototype: $try" ;;
12912 *) case "$usethreads" in
12913 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12915 d_endnetent_r=undef
12916 endnetent_r_proto=0
12920 *) endnetent_r_proto=0
12924 : see if endprotoent exists
12925 set endprotoent d_endpent
12928 : see if endprotoent_r exists
12929 set endprotoent_r d_endprotoent_r
12931 case "$d_endprotoent_r" in
12933 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12934 case "$d_endprotoent_r_proto:$usethreads" in
12935 ":define") d_endprotoent_r_proto=define
12936 set d_endprotoent_r_proto endprotoent_r $hdrs
12940 case "$d_endprotoent_r_proto" in
12942 case "$endprotoent_r_proto" in
12943 ''|0) try='int endprotoent_r(struct protoent_data*);'
12944 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12946 case "$endprotoent_r_proto" in
12947 ''|0) try='void endprotoent_r(struct protoent_data*);'
12948 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12950 case "$endprotoent_r_proto" in
12951 ''|0) d_endprotoent_r=undef
12952 endprotoent_r_proto=0
12953 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12954 * ) case "$endprotoent_r_proto" in
12955 REENTRANT_PROTO*) ;;
12956 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12958 echo "Prototype: $try" ;;
12961 *) case "$usethreads" in
12962 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12964 d_endprotoent_r=undef
12965 endprotoent_r_proto=0
12969 *) endprotoent_r_proto=0
12973 : see if endpwent exists
12974 set endpwent d_endpwent
12977 : see if this is a pwd.h system
12983 xxx=`./findhdr pwd.h`
12984 $cppstdin $cppflags $cppminus < $xxx >$$.h
12986 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12994 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13002 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13010 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13018 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13026 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13034 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13042 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13054 set d_pwquota; eval $setvar
13055 set d_pwage; eval $setvar
13056 set d_pwchange; eval $setvar
13057 set d_pwclass; eval $setvar
13058 set d_pwexpire; eval $setvar
13059 set d_pwcomment; eval $setvar
13060 set d_pwgecos; eval $setvar
13061 set d_pwpasswd; eval $setvar
13065 : see if endpwent_r exists
13066 set endpwent_r d_endpwent_r
13068 case "$d_endpwent_r" in
13070 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13071 case "$d_endpwent_r_proto:$usethreads" in
13072 ":define") d_endpwent_r_proto=define
13073 set d_endpwent_r_proto endpwent_r $hdrs
13077 case "$d_endpwent_r_proto" in
13079 case "$endpwent_r_proto" in
13080 ''|0) try='int endpwent_r(FILE**);'
13081 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13083 case "$endpwent_r_proto" in
13084 ''|0) try='void endpwent_r(FILE**);'
13085 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13087 case "$endpwent_r_proto" in
13088 ''|0) d_endpwent_r=undef
13090 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13091 * ) case "$endpwent_r_proto" in
13092 REENTRANT_PROTO*) ;;
13093 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13095 echo "Prototype: $try" ;;
13098 *) case "$usethreads" in
13099 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13106 *) endpwent_r_proto=0
13110 : see if endservent exists
13111 set endservent d_endsent
13114 : see if endservent_r exists
13115 set endservent_r d_endservent_r
13117 case "$d_endservent_r" in
13119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13120 case "$d_endservent_r_proto:$usethreads" in
13121 ":define") d_endservent_r_proto=define
13122 set d_endservent_r_proto endservent_r $hdrs
13126 case "$d_endservent_r_proto" in
13128 case "$endservent_r_proto" in
13129 ''|0) try='int endservent_r(struct servent_data*);'
13130 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13132 case "$endservent_r_proto" in
13133 ''|0) try='void endservent_r(struct servent_data*);'
13134 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13136 case "$endservent_r_proto" in
13137 ''|0) d_endservent_r=undef
13138 endservent_r_proto=0
13139 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13140 * ) case "$endservent_r_proto" in
13141 REENTRANT_PROTO*) ;;
13142 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13144 echo "Prototype: $try" ;;
13147 *) case "$usethreads" in
13148 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13150 d_endservent_r=undef
13151 endservent_r_proto=0
13155 *) endservent_r_proto=0
13159 : Locate the flags for 'open()'
13162 #include <sys/types.h>
13167 #include <sys/file.h>
13169 #$i_stdlib I_STDLIB
13171 #include <stdlib.h>
13182 : check sys/file.h first to get FREAD on Sun
13183 if $test `./findhdr sys/file.h` && \
13184 set try -DI_SYS_FILE && eval $compile; then
13186 echo "<sys/file.h> defines the O_* constants..." >&4
13187 if $run ./try; then
13188 echo "and you have the 3 argument form of open()." >&4
13191 echo "but not the 3 argument form of open(). Oh, well." >&4
13194 elif $test `./findhdr fcntl.h` && \
13195 set try -DI_FCNTL && eval $compile; then
13197 echo "<fcntl.h> defines the O_* constants..." >&4
13198 if $run ./try; then
13199 echo "and you have the 3 argument form of open()." >&4
13202 echo "but not the 3 argument form of open(). Oh, well." >&4
13207 echo "I can't find the O_* constant definitions! You got problems." >&4
13213 : see if this is a sys/file.h system
13218 : do we need to include sys/file.h ?
13222 if $h_sysfile; then
13224 echo "We'll be including <sys/file.h>." >&4
13227 echo "We won't be including <sys/file.h>." >&4
13237 : see if fcntl.h is there
13242 : see if we can include fcntl.h
13248 echo "We'll be including <fcntl.h>." >&4
13251 if $h_sysfile; then
13252 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13254 echo "We won't be including <fcntl.h>." >&4
13266 : see if fork exists
13270 : see if pipe exists
13274 : check for non-blocking I/O stuff
13275 case "$h_sysfile" in
13276 true) echo "#include <sys/file.h>" > head.c;;
13279 true) echo "#include <fcntl.h>" > head.c;;
13280 *) echo "#include <sys/fcntl.h>" > head.c;;
13285 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13286 case "$o_nonblock" in
13288 $cat head.c > try.c
13289 $cat >>try.c <<EOCP
13291 #$i_stdlib I_STDLIB
13293 #include <stdlib.h>
13301 printf("O_NONBLOCK\n");
13305 printf("O_NDELAY\n");
13309 printf("FNDELAY\n");
13316 if eval $compile_ok; then
13317 o_nonblock=`$run ./try`
13318 case "$o_nonblock" in
13319 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13320 *) echo "Seems like we can use $o_nonblock.";;
13323 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13326 *) echo "Using $hint value $o_nonblock.";;
13331 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13334 case "$d_fork:$d_pipe:$d_alarm" in
13335 define:define:define)
13336 $cat head.c > try.c
13337 $cat >>try.c <<EOCP
13339 #include <sys/types.h>
13340 #include <signal.h>
13342 #$i_stdlib I_STDLIB
13344 #include <stdlib.h>
13350 #define MY_O_NONBLOCK $o_nonblock
13351 #ifndef errno /* XXX need better Configure test */
13354 #$i_unistd I_UNISTD
13356 #include <unistd.h>
13358 #$i_string I_STRING
13360 #include <string.h>
13362 #include <strings.h>
13364 $signal_t blech(int x) { exit(3); }
13366 $cat >> try.c <<'EOCP'
13375 ret = pipe(pd); /* Down: child -> parent */
13378 ret = pipe(pu); /* Up: parent -> child */
13382 close(pd[1]); /* Parent reads from pd[0] */
13383 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13385 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13390 signal(SIGALRM, blech);
13392 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13394 sprintf(string, "%d\n", ret);
13395 ret = write(2, string, strlen(string));
13396 if (ret != strlen(string))
13400 if (errno == EAGAIN) {
13401 printf("EAGAIN\n");
13406 if (errno == EWOULDBLOCK)
13407 printf("EWOULDBLOCK\n");
13410 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13413 sleep(2); /* Give it time to close our pipe */
13415 ret = read(pd[0], buf, 1); /* Should read EOF */
13417 sprintf(string, "%d\n", ret);
13418 ret = write(4, string, strlen(string));
13419 if (ret != strlen(string))
13424 close(pd[0]); /* We write to pd[1] */
13425 close(pu[1]); /* We read from pu[0] */
13426 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13429 close(pd[1]); /* Pipe pd is now fully closed! */
13430 exit(0); /* Bye bye, thank you for playing! */
13434 if eval $compile_ok; then
13435 echo "$startsh" >mtry
13436 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13438 $run ./mtry >/dev/null 2>&1
13440 0) eagain=`$cat try.out`;;
13441 1) echo "Could not perform non-blocking setting!";;
13442 2) echo "I did a successful read() for something that was not there!";;
13443 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13444 4) echo "Could not find F_SETFL!";;
13445 *) echo "Something terribly wrong happened during testing.";;
13447 rd_nodata=`$cat try.ret`
13448 echo "A read() system call with no data present returns $rd_nodata."
13449 case "$rd_nodata" in
13452 echo "(That's peculiar, fixing that to be -1.)"
13458 echo "Forcing errno EAGAIN on read() with no data available."
13462 echo "Your read() sets errno to $eagain when no data is available."
13465 status=`$cat try.err`
13467 0) echo "And it correctly returns 0 to signal EOF.";;
13468 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13469 *) echo "However, your read() returns '$status' on EOF??";;
13472 if test "$status" = "$rd_nodata"; then
13473 echo "WARNING: you can't distinguish between EOF and no data!"
13477 echo "I can't compile the test program--assuming errno EAGAIN will do."
13481 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13490 echo "Using $hint value $eagain."
13491 echo "Your read() returns $rd_nodata when no data is present."
13492 case "$d_eofnblk" in
13493 "$define") echo "And you can see EOF because read() returns 0.";;
13494 "$undef") echo "But you can't see EOF status from read() returned value.";;
13496 echo "(Assuming you can't see EOF status from read anyway.)"
13502 $rm_try head.c mtry
13504 : see if erf exists
13508 : see if erfc exists
13512 : see if exp2 exists
13516 : see if expm1 exists
13520 : see if _ptr and _cnt from stdio act std
13523 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13524 echo "(Looks like you have stdio.h from BSD.)"
13525 case "$stdio_ptr" in
13526 '') stdio_ptr='((fp)->_p)'
13529 *) ptr_lval=$d_stdio_ptr_lval;;
13531 case "$stdio_cnt" in
13532 '') stdio_cnt='((fp)->_r)'
13535 *) cnt_lval=$d_stdio_cnt_lval;;
13537 case "$stdio_base" in
13538 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13540 case "$stdio_bufsiz" in
13541 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13543 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13544 echo "(Looks like you have stdio.h from Linux.)"
13545 case "$stdio_ptr" in
13546 '') stdio_ptr='((fp)->_IO_read_ptr)'
13549 *) ptr_lval=$d_stdio_ptr_lval;;
13551 case "$stdio_cnt" in
13552 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13555 *) cnt_lval=$d_stdio_cnt_lval;;
13557 case "$stdio_base" in
13558 '') stdio_base='((fp)->_IO_read_base)';;
13560 case "$stdio_bufsiz" in
13561 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13564 case "$stdio_ptr" in
13565 '') stdio_ptr='((fp)->_ptr)'
13568 *) ptr_lval=$d_stdio_ptr_lval;;
13570 case "$stdio_cnt" in
13571 '') stdio_cnt='((fp)->_cnt)'
13574 *) cnt_lval=$d_stdio_cnt_lval;;
13576 case "$stdio_base" in
13577 '') stdio_base='((fp)->_base)';;
13579 case "$stdio_bufsiz" in
13580 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13584 : test whether _ptr and _cnt really work
13585 echo "Checking how std your stdio is..." >&4
13588 #$i_stdlib I_STDLIB
13590 #include <stdlib.h>
13592 #define FILE_ptr(fp) $stdio_ptr
13593 #define FILE_cnt(fp) $stdio_cnt
13595 FILE *fp = fopen("try.c", "r");
13598 18 <= FILE_cnt(fp) &&
13599 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13607 if eval $compile && $to try.c; then
13608 if $run ./try; then
13609 echo "Your stdio acts pretty std."
13612 echo "Your stdio isn't very std."
13615 echo "Your stdio doesn't appear very std."
13619 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13620 # direct buffer manipulation no longer works. The Configure tests
13621 # should be changed to correctly detect this, but until then,
13622 # the following check should at least let perl compile and run.
13623 # (This quick fix should be updated before 5.8.1.)
13624 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13625 # A. Dougherty, June 3, 2002.
13626 case "$d_gnulibc" in
13628 case "$gnulibc_version" in
13632 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13641 : Can _ptr be used as an lvalue?
13642 case "$d_stdstdio$ptr_lval" in
13643 $define$define) val=$define ;;
13646 set d_stdio_ptr_lval
13649 : Can _cnt be used as an lvalue?
13650 case "$d_stdstdio$cnt_lval" in
13651 $define$define) val=$define ;;
13654 set d_stdio_cnt_lval
13658 : test whether setting _ptr sets _cnt as a side effect
13659 d_stdio_ptr_lval_sets_cnt="$undef"
13660 d_stdio_ptr_lval_nochange_cnt="$undef"
13661 case "$d_stdio_ptr_lval$d_stdstdio" in
13663 echo "Checking to see what happens if we set the stdio ptr..." >&4
13666 /* Can we scream? */
13667 /* Eat dust sed :-) */
13668 /* In the buffer space, no one can hear you scream. */
13669 #$i_stdlib I_STDLIB
13671 #include <stdlib.h>
13673 #define FILE_ptr(fp) $stdio_ptr
13674 #define FILE_cnt(fp) $stdio_cnt
13675 #include <sys/types.h>
13677 FILE *fp = fopen("try.c", "r");
13682 puts("Fail even to read");
13685 c = getc(fp); /* Read away the first # */
13687 puts("Fail even to read");
13691 18 <= FILE_cnt(fp) &&
13692 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13694 puts("Fail even to read");
13697 ptr = (char*) FILE_ptr(fp);
13698 cnt = (size_t)FILE_cnt(fp);
13700 FILE_ptr(fp) += 42;
13702 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13703 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13706 if (FILE_cnt(fp) <= 20) {
13707 printf ("Fail (<20 chars to test)");
13710 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13711 puts("Fail compare");
13714 if (cnt == FILE_cnt(fp)) {
13715 puts("Pass_unchanged");
13718 if (FILE_cnt(fp) == (cnt - 42)) {
13719 puts("Pass_changed");
13722 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13728 if eval $compile && $to try.c; then
13729 case `$run ./try` in
13731 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13732 d_stdio_ptr_lval_sets_cnt="$define" ;;
13734 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13735 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13737 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13739 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13742 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13748 : see if _base is also standard
13750 case "$d_stdstdio" in
13754 #$i_stdlib I_STDLIB
13756 #include <stdlib.h>
13758 #define FILE_base(fp) $stdio_base
13759 #define FILE_bufsiz(fp) $stdio_bufsiz
13761 FILE *fp = fopen("try.c", "r");
13764 19 <= FILE_bufsiz(fp) &&
13765 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13772 if eval $compile && $to try.c; then
13773 if $run ./try; then
13774 echo "And its _base field acts std."
13777 echo "But its _base field isn't std."
13780 echo "However, it seems to be lacking the _base field."
13788 : see if fast_stdio exists
13790 case "$d_stdstdio:$d_stdio_ptr_lval" in
13792 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13794 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13805 : see if fchdir exists
13806 set fchdir d_fchdir
13809 : see if fchmod exists
13810 set fchmod d_fchmod
13813 : see if fchown exists
13814 set fchown d_fchown
13817 : see if this is an fcntl system
13821 : See if fcntl-based locking works.
13824 #$i_stdlib I_STDLIB
13826 #include <stdlib.h>
13828 #include <unistd.h>
13830 #include <signal.h>
13831 $signal_t blech(int x) { exit(3); }
13833 #if defined(F_SETLK) && defined(F_SETLKW)
13834 struct flock flock;
13836 fd = open("try.c", O_RDONLY);
13837 flock.l_type = F_RDLCK;
13838 flock.l_whence = SEEK_SET;
13839 flock.l_start = flock.l_len = 0;
13840 signal(SIGALRM, blech);
13842 retval = fcntl(fd, F_SETLK, &flock);
13844 (retval < 0 ? exit(2) : exit(0));
13850 echo "Checking if fcntl-based file locking works... "
13854 if eval $compile_ok; then
13855 if $run ./try; then
13856 echo "Yes, it seems to work."
13859 echo "Nope, it didn't work."
13864 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13865 *** This is (almost) impossible.
13866 *** If your NFS lock daemons are not feeling well, something like
13867 *** this may happen, please investigate. Cannot continue, aborting.
13875 echo "I'm unable to compile the test program, so I'll assume not."
13880 echo "Nope, since you don't even have fcntl()."
13883 set d_fcntl_can_lock
13887 : check for fd_set items
13890 Checking to see how well your C compiler handles fd_set and friends ...
13893 #$i_stdlib I_STDLIB
13895 #include <stdlib.h>
13897 #$i_systime I_SYS_TIME
13898 #$i_sysselct I_SYS_SELECT
13899 #$d_socket HAS_SOCKET
13900 #include <sys/types.h>
13902 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13905 #include <sys/time.h>
13907 #ifdef I_SYS_SELECT
13908 #include <sys/select.h>
13917 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13925 if eval $compile; then
13926 d_fds_bits="$define"
13928 echo "Well, your system knows about the normal fd_set typedef..." >&4
13929 if $run ./try; then
13930 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13931 d_fd_macros="$define"
13934 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13936 d_fd_macros="$undef"
13940 Hmm, your compiler has some difficulty with fd_set. Checking further...
13943 if eval $compile; then
13944 d_fds_bits="$undef"
13946 echo "Well, your system has some sort of fd_set available..." >&4
13947 if $run ./try; then
13948 echo "and you have the normal fd_set macros." >&4
13949 d_fd_macros="$define"
13952 but not the normal fd_set macros! Gross! More work for me...
13954 d_fd_macros="$undef"
13957 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13959 d_fds_bits="$undef"
13960 d_fd_macros="$undef"
13965 : see if fdim exists
13969 : see if fegetround exists
13970 set fegetround d_fegetround
13973 : see if fgetpos exists
13974 set fgetpos d_fgetpos
13977 : see if finite exists
13978 set finite d_finite
13981 : see if finitel exists
13982 set finitel d_finitel
13985 : see if flock exists
13989 : see if prototype for flock is available
13991 set d_flockproto flock $i_sysfile sys/file.h
13994 : see if fma exists
13998 : see if fmax exists
14002 : see if fmin exists
14006 : see if fp_class exists
14007 set fp_class d_fp_class
14010 : see if this is a math.h system
14014 : check for fpclassify
14015 echo "Checking to see if you have fpclassify..." >&4
14021 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14024 if eval $compile; then
14026 echo "You have fpclassify."
14029 echo "You do not have fpclassify."
14035 : see if fp_classify exists
14036 set fp_classify d_fp_classify
14039 : see if fp_classl exists
14040 set fp_classl d_fp_classl
14043 : see if pathconf exists
14044 set pathconf d_pathconf
14047 : see if fpathconf exists
14048 set fpathconf d_fpathconf
14051 : see if fpclass exists
14052 set fpclass d_fpclass
14055 : see if fpclassl exists
14056 set fpclassl d_fpclassl
14059 : see if fpgetround exists
14060 set fpgetround d_fpgetround
14063 : check for fpos64_t
14065 echo "Checking to see if you have fpos64_t..." >&4
14068 int main() { fpos64_t x = 7; }
14071 if eval $compile; then
14073 echo "You have fpos64_t."
14076 echo "You do not have fpos64_t."
14077 case "$fpossize" in
14078 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14085 : see if frexpl exists
14086 set frexpl d_frexpl
14089 : see if this is a sys/param system
14090 set sys/param.h i_sysparam
14093 : see if this is a sys/mount.h system
14094 set sys/mount.h i_sysmount
14097 : Check for fs_data_s
14099 echo "Checking to see if your system supports struct fs_data..." >&4
14100 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14102 case "$d_fs_data_s" in
14103 "$define") echo "Yes, it does." ;;
14104 *) echo "No, it doesn't." ;;
14107 : see if fseeko exists
14108 set fseeko d_fseeko
14110 case "$longsize" in
14111 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14114 : see if fsetpos exists
14115 set fsetpos d_fsetpos
14118 : see if fstatfs exists
14119 set fstatfs d_fstatfs
14122 : see if statvfs exists
14123 set statvfs d_statvfs
14126 : see if fstatvfs exists
14127 set fstatvfs d_fstatvfs
14131 : see if fsync exists
14135 : see if ftello exists
14136 set ftello d_ftello
14138 case "$longsize" in
14139 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14142 : check for a working futimes
14145 echo "Checking if you have a working futimes()" >&4
14148 #include <sys/time.h>
14155 fd = open ("try.c", O_RDWR);
14156 if (-1 == fd) exit (1);
14157 rv = futimes (fd, NULL);
14158 exit (rv == -1 ? errno : 0);
14162 if eval $compile; then
14166 0) echo "Yes, you have" >&4
14167 d_futimes="$define"
14169 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14173 echo "No, it does not (probably harmless)" >&4
14177 : see if ndbm.h is available
14180 : Compatibility location for RedHat 7.1
14181 set gdbm/ndbm.h i_gdbmndbm
14183 : Compatibility location for Debian 4.0
14184 set gdbm-ndbm.h i_gdbm_ndbm
14188 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14189 : see if dbm_open exists
14190 set dbm_open d_dbm_open
14192 case "$d_dbm_open" in
14195 i_gdbmndbm="$undef"
14196 i_gdbm_ndbm="$undef"
14197 echo "We won't be including <ndbm.h>"
14207 ndbm_hdr_protochk='name=$1; hdr=$2;
14208 eval "ihdr=\$""i_$name";
14210 if $test "$ihdr" = "$define"; then
14211 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14212 case "$d_cplusplus" in
14213 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14214 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14217 $define) $echo "Your <$hdr> seems to have prototypes";;
14218 *) $echo "Your <$hdr> does not seem to have prototypes";;
14221 set "d_${name}_h_uses_prototypes";
14225 eval $ndbm_hdr_protochk
14226 set gdbmndbm gdbm/ndbm.h
14227 eval $ndbm_hdr_protochk
14228 set gdbm_ndbm gdbm-ndbm.h
14229 eval $ndbm_hdr_protochk
14231 : see if getaddrinfo exists
14232 set getaddrinfo d_getaddrinfo
14235 : see if getcwd exists
14236 set getcwd d_getcwd
14239 : see if getespwnam exists
14240 set getespwnam d_getespwnam
14243 : see if getfsstat exists
14244 set getfsstat d_getfsstat
14247 : see if getgrent exists
14248 set getgrent d_getgrent
14251 : see if getgrent_r exists
14252 set getgrent_r d_getgrent_r
14254 case "$d_getgrent_r" in
14256 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14257 case "$d_getgrent_r_proto:$usethreads" in
14258 ":define") d_getgrent_r_proto=define
14259 set d_getgrent_r_proto getgrent_r $hdrs
14263 case "$d_getgrent_r_proto" in
14265 case "$getgrent_r_proto" in
14266 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14267 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14269 case "$getgrent_r_proto" in
14270 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14271 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14273 case "$getgrent_r_proto" in
14274 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14275 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14277 case "$getgrent_r_proto" in
14278 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14279 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14281 case "$getgrent_r_proto" in
14282 ''|0) try='int getgrent_r(struct group*, char*, int);'
14283 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14285 case "$getgrent_r_proto" in
14286 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14287 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14289 case "$getgrent_r_proto" in
14290 ''|0) d_getgrent_r=undef
14292 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14293 * ) case "$getgrent_r_proto" in
14294 REENTRANT_PROTO*) ;;
14295 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14297 echo "Prototype: $try" ;;
14300 *) case "$usethreads" in
14301 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14308 *) getgrent_r_proto=0
14312 : see if getgrgid_r exists
14313 set getgrgid_r d_getgrgid_r
14315 case "$d_getgrgid_r" in
14317 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14318 case "$d_getgrgid_r_proto:$usethreads" in
14319 ":define") d_getgrgid_r_proto=define
14320 set d_getgrgid_r_proto getgrgid_r $hdrs
14324 case "$d_getgrgid_r_proto" in
14326 case "$getgrgid_r_proto" in
14327 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14328 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14330 case "$getgrgid_r_proto" in
14331 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14332 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14334 case "$getgrgid_r_proto" in
14335 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14336 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14338 case "$getgrgid_r_proto" in
14339 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14340 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14342 case "$getgrgid_r_proto" in
14343 ''|0) d_getgrgid_r=undef
14345 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14346 * ) case "$getgrgid_r_proto" in
14347 REENTRANT_PROTO*) ;;
14348 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14350 echo "Prototype: $try" ;;
14353 *) case "$usethreads" in
14354 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14361 *) getgrgid_r_proto=0
14365 : see if getgrnam_r exists
14366 set getgrnam_r d_getgrnam_r
14368 case "$d_getgrnam_r" in
14370 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14371 case "$d_getgrnam_r_proto:$usethreads" in
14372 ":define") d_getgrnam_r_proto=define
14373 set d_getgrnam_r_proto getgrnam_r $hdrs
14377 case "$d_getgrnam_r_proto" in
14379 case "$getgrnam_r_proto" in
14380 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14381 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14383 case "$getgrnam_r_proto" in
14384 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14385 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14387 case "$getgrnam_r_proto" in
14388 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14389 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14391 case "$getgrnam_r_proto" in
14392 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14393 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14395 case "$getgrnam_r_proto" in
14396 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14397 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14399 case "$getgrnam_r_proto" in
14400 ''|0) d_getgrnam_r=undef
14402 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14403 * ) case "$getgrnam_r_proto" in
14404 REENTRANT_PROTO*) ;;
14405 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14407 echo "Prototype: $try" ;;
14410 *) case "$usethreads" in
14411 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14418 *) getgrnam_r_proto=0
14422 : see if gethostbyaddr exists
14423 set gethostbyaddr d_gethbyaddr
14426 : see if gethostbyname exists
14427 set gethostbyname d_gethbyname
14430 : see if gethostent exists
14431 set gethostent d_gethent
14434 : see how we will look up host name
14437 if set gethostname val -f d_gethname; eval $csym; $val; then
14438 echo 'gethostname() found.' >&4
14439 d_gethname="$define"
14442 if set uname val -f d_uname; eval $csym; $val; then
14445 uname() was found, but you're running xenix, and older versions of xenix
14446 have a broken uname(). If you don't really know whether your xenix is old
14447 enough to have a broken system call, use the default answer.
14452 "$define") dflt=n;;
14454 rp='Is your uname() broken?'
14457 n*) d_uname="$define"; call=uname;;
14460 echo 'uname() found.' >&4
14467 case "$d_gethname" in
14468 '') d_gethname="$undef";;
14471 '') d_uname="$undef";;
14473 case "$d_uname$d_gethname" in
14478 Every now and then someone has a $call() that lies about the hostname
14479 but can't be fixed for political or economic reasons. If you wish, I can
14480 pretend $call() isn't there and maybe compute hostname at run-time
14481 thanks to the '$phostname' command.
14484 rp="Shall I ignore $call() from now on?"
14487 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14490 case "$phostname" in
14491 '') aphostname='';;
14492 *) case "$aphostname" in
14494 *) set X $phostname
14498 file=`./loc $file $file $pth`
14499 aphostname=`echo $file $*`
14504 case "$d_uname$d_gethname" in
14507 case "$phostname" in
14509 echo "There will be no way for $package to get your hostname." >&4;;
14511 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14515 case "$d_phostname" in
14516 '') d_phostname="$undef";;
14519 : see if gethostbyaddr_r exists
14520 set gethostbyaddr_r d_gethostbyaddr_r
14522 case "$d_gethostbyaddr_r" in
14524 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14525 case "$d_gethostbyaddr_r_proto:$usethreads" in
14526 ":define") d_gethostbyaddr_r_proto=define
14527 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14531 case "$d_gethostbyaddr_r_proto" in
14533 case "$gethostbyaddr_r_proto" in
14534 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14535 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14537 case "$gethostbyaddr_r_proto" in
14538 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14539 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14541 case "$gethostbyaddr_r_proto" in
14542 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14543 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14545 case "$gethostbyaddr_r_proto" in
14546 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14547 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14549 case "$gethostbyaddr_r_proto" in
14550 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14551 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14553 case "$gethostbyaddr_r_proto" in
14554 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14555 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14557 case "$gethostbyaddr_r_proto" in
14558 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14559 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14561 case "$gethostbyaddr_r_proto" in
14562 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14563 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14565 case "$gethostbyaddr_r_proto" in
14566 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14567 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14569 case "$gethostbyaddr_r_proto" in
14570 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14571 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14573 case "$gethostbyaddr_r_proto" in
14574 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14575 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14577 case "$gethostbyaddr_r_proto" in
14578 ''|0) d_gethostbyaddr_r=undef
14579 gethostbyaddr_r_proto=0
14580 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14581 * ) case "$gethostbyaddr_r_proto" in
14582 REENTRANT_PROTO*) ;;
14583 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14585 echo "Prototype: $try" ;;
14588 *) case "$usethreads" in
14589 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14591 d_gethostbyaddr_r=undef
14592 gethostbyaddr_r_proto=0
14596 *) gethostbyaddr_r_proto=0
14600 : see if gethostbyname_r exists
14601 set gethostbyname_r d_gethostbyname_r
14603 case "$d_gethostbyname_r" in
14605 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14606 case "$d_gethostbyname_r_proto:$usethreads" in
14607 ":define") d_gethostbyname_r_proto=define
14608 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14612 case "$d_gethostbyname_r_proto" in
14614 case "$gethostbyname_r_proto" in
14615 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14616 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14618 case "$gethostbyname_r_proto" in
14619 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14620 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14622 case "$gethostbyname_r_proto" in
14623 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14624 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14626 case "$gethostbyname_r_proto" in
14627 ''|0) d_gethostbyname_r=undef
14628 gethostbyname_r_proto=0
14629 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14630 * ) case "$gethostbyname_r_proto" in
14631 REENTRANT_PROTO*) ;;
14632 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14634 echo "Prototype: $try" ;;
14637 *) case "$usethreads" in
14638 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14640 d_gethostbyname_r=undef
14641 gethostbyname_r_proto=0
14645 *) gethostbyname_r_proto=0
14649 : see if gethostent_r exists
14650 set gethostent_r d_gethostent_r
14652 case "$d_gethostent_r" in
14654 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14655 case "$d_gethostent_r_proto:$usethreads" in
14656 ":define") d_gethostent_r_proto=define
14657 set d_gethostent_r_proto gethostent_r $hdrs
14661 case "$d_gethostent_r_proto" in
14663 case "$gethostent_r_proto" in
14664 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14665 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14667 case "$gethostent_r_proto" in
14668 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14669 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14671 case "$gethostent_r_proto" in
14672 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14673 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14675 case "$gethostent_r_proto" in
14676 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14677 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14679 case "$gethostent_r_proto" in
14680 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14681 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14683 case "$gethostent_r_proto" in
14684 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14685 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14687 case "$gethostent_r_proto" in
14688 ''|0) d_gethostent_r=undef
14689 gethostent_r_proto=0
14690 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14691 * ) case "$gethostent_r_proto" in
14692 REENTRANT_PROTO*) ;;
14693 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14695 echo "Prototype: $try" ;;
14698 *) case "$usethreads" in
14699 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14701 d_gethostent_r=undef
14702 gethostent_r_proto=0
14706 *) gethostent_r_proto=0
14710 : see if prototypes for various gethostxxx netdb.h functions are available
14712 set d_gethostprotos gethostent $i_netdb netdb.h
14715 : see if getitimer exists
14716 set getitimer d_getitimer
14719 : see if getlogin exists
14720 set getlogin d_getlogin
14723 : see if getlogin_r exists
14724 set getlogin_r d_getlogin_r
14726 case "$d_getlogin_r" in
14728 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14729 case "$d_getlogin_r_proto:$usethreads" in
14730 ":define") d_getlogin_r_proto=define
14731 set d_getlogin_r_proto getlogin_r $hdrs
14735 case "$d_getlogin_r_proto" in
14737 case "$getlogin_r_proto" in
14738 ''|0) try='int getlogin_r(char*, size_t);'
14739 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14741 case "$getlogin_r_proto" in
14742 ''|0) try='int getlogin_r(char*, int);'
14743 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14745 case "$getlogin_r_proto" in
14746 ''|0) try='char* getlogin_r(char*, size_t);'
14747 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14749 case "$getlogin_r_proto" in
14750 ''|0) try='char* getlogin_r(char*, int);'
14751 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14753 case "$getlogin_r_proto" in
14754 ''|0) d_getlogin_r=undef
14756 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14757 * ) case "$getlogin_r_proto" in
14758 REENTRANT_PROTO*) ;;
14759 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14761 echo "Prototype: $try" ;;
14764 *) case "$usethreads" in
14765 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14772 *) getlogin_r_proto=0
14776 : see if getmnt exists
14777 set getmnt d_getmnt
14780 : see if getmntent exists
14781 set getmntent d_getmntent
14784 : see if getnameinfo exists
14785 set getnameinfo d_getnameinfo
14788 : see if getnetbyaddr exists
14789 set getnetbyaddr d_getnbyaddr
14792 : see if getnetbyname exists
14793 set getnetbyname d_getnbyname
14796 : see if getnetent exists
14797 set getnetent d_getnent
14800 : see if getnetbyaddr_r exists
14801 set getnetbyaddr_r d_getnetbyaddr_r
14803 case "$d_getnetbyaddr_r" in
14805 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14806 case "$d_getnetbyaddr_r_proto:$usethreads" in
14807 ":define") d_getnetbyaddr_r_proto=define
14808 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14812 case "$d_getnetbyaddr_r_proto" in
14814 case "$getnetbyaddr_r_proto" in
14815 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14816 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14818 case "$getnetbyaddr_r_proto" in
14819 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14820 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14822 case "$getnetbyaddr_r_proto" in
14823 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14824 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14826 case "$getnetbyaddr_r_proto" in
14827 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14828 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14830 case "$getnetbyaddr_r_proto" in
14831 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14832 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14834 case "$getnetbyaddr_r_proto" in
14835 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14836 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14838 case "$getnetbyaddr_r_proto" in
14839 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14840 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14842 case "$getnetbyaddr_r_proto" in
14843 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14844 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14846 case "$getnetbyaddr_r_proto" in
14847 ''|0) d_getnetbyaddr_r=undef
14848 getnetbyaddr_r_proto=0
14849 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14850 * ) case "$getnetbyaddr_r_proto" in
14851 REENTRANT_PROTO*) ;;
14852 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14854 echo "Prototype: $try" ;;
14857 *) case "$usethreads" in
14858 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14860 d_getnetbyaddr_r=undef
14861 getnetbyaddr_r_proto=0
14865 *) getnetbyaddr_r_proto=0
14869 : see if getnetbyname_r exists
14870 set getnetbyname_r d_getnetbyname_r
14872 case "$d_getnetbyname_r" in
14874 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14875 case "$d_getnetbyname_r_proto:$usethreads" in
14876 ":define") d_getnetbyname_r_proto=define
14877 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14881 case "$d_getnetbyname_r_proto" in
14883 case "$getnetbyname_r_proto" in
14884 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14885 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14887 case "$getnetbyname_r_proto" in
14888 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14889 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14891 case "$getnetbyname_r_proto" in
14892 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14893 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14895 case "$getnetbyname_r_proto" in
14896 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14897 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14899 case "$getnetbyname_r_proto" in
14900 ''|0) d_getnetbyname_r=undef
14901 getnetbyname_r_proto=0
14902 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14903 * ) case "$getnetbyname_r_proto" in
14904 REENTRANT_PROTO*) ;;
14905 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14907 echo "Prototype: $try" ;;
14910 *) case "$usethreads" in
14911 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14913 d_getnetbyname_r=undef
14914 getnetbyname_r_proto=0
14918 *) getnetbyname_r_proto=0
14922 : see if getnetent_r exists
14923 set getnetent_r d_getnetent_r
14925 case "$d_getnetent_r" in
14927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14928 case "$d_getnetent_r_proto:$usethreads" in
14929 ":define") d_getnetent_r_proto=define
14930 set d_getnetent_r_proto getnetent_r $hdrs
14934 case "$d_getnetent_r_proto" in
14936 case "$getnetent_r_proto" in
14937 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14938 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14940 case "$getnetent_r_proto" in
14941 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14942 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14944 case "$getnetent_r_proto" in
14945 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14946 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14948 case "$getnetent_r_proto" in
14949 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14950 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14952 case "$getnetent_r_proto" in
14953 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14954 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14956 case "$getnetent_r_proto" in
14957 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14958 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14960 case "$getnetent_r_proto" in
14961 ''|0) d_getnetent_r=undef
14962 getnetent_r_proto=0
14963 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14964 * ) case "$getnetent_r_proto" in
14965 REENTRANT_PROTO*) ;;
14966 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14968 echo "Prototype: $try" ;;
14971 *) case "$usethreads" in
14972 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14974 d_getnetent_r=undef
14975 getnetent_r_proto=0
14979 *) getnetent_r_proto=0
14983 : see if prototypes for various getnetxxx netdb.h functions are available
14985 set d_getnetprotos getnetent $i_netdb netdb.h
14988 : see if getpagesize exists
14989 set getpagesize d_getpagsz
14992 : Optional checks for getprotobyname and getprotobynumber
14994 : see if getprotobyname exists
14995 set getprotobyname d_getpbyname
14998 : see if getprotobynumber exists
14999 set getprotobynumber d_getpbynumber
15002 : see if getprotoent exists
15003 set getprotoent d_getpent
15006 : see if getpgid exists
15007 set getpgid d_getpgid
15010 : see if getpgrp2 exists
15011 set getpgrp2 d_getpgrp2
15014 : see if getppid exists
15015 set getppid d_getppid
15018 : see if getpriority exists
15019 set getpriority d_getprior
15022 : see if getprotobyname_r exists
15023 set getprotobyname_r d_getprotobyname_r
15025 case "$d_getprotobyname_r" in
15027 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15028 case "$d_getprotobyname_r_proto:$usethreads" in
15029 ":define") d_getprotobyname_r_proto=define
15030 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15034 case "$d_getprotobyname_r_proto" in
15036 case "$getprotobyname_r_proto" in
15037 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15038 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15040 case "$getprotobyname_r_proto" in
15041 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15042 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15044 case "$getprotobyname_r_proto" in
15045 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15046 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15048 case "$getprotobyname_r_proto" in
15049 ''|0) d_getprotobyname_r=undef
15050 getprotobyname_r_proto=0
15051 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15052 * ) case "$getprotobyname_r_proto" in
15053 REENTRANT_PROTO*) ;;
15054 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15056 echo "Prototype: $try" ;;
15059 *) case "$usethreads" in
15060 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15062 d_getprotobyname_r=undef
15063 getprotobyname_r_proto=0
15067 *) getprotobyname_r_proto=0
15071 : see if getprotobynumber_r exists
15072 set getprotobynumber_r d_getprotobynumber_r
15074 case "$d_getprotobynumber_r" in
15076 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15077 case "$d_getprotobynumber_r_proto:$usethreads" in
15078 ":define") d_getprotobynumber_r_proto=define
15079 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15083 case "$d_getprotobynumber_r_proto" in
15085 case "$getprotobynumber_r_proto" in
15086 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15087 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15089 case "$getprotobynumber_r_proto" in
15090 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15091 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15093 case "$getprotobynumber_r_proto" in
15094 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15095 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15097 case "$getprotobynumber_r_proto" in
15098 ''|0) d_getprotobynumber_r=undef
15099 getprotobynumber_r_proto=0
15100 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15101 * ) case "$getprotobynumber_r_proto" in
15102 REENTRANT_PROTO*) ;;
15103 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15105 echo "Prototype: $try" ;;
15108 *) case "$usethreads" in
15109 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15111 d_getprotobynumber_r=undef
15112 getprotobynumber_r_proto=0
15116 *) getprotobynumber_r_proto=0
15120 : see if getprotoent_r exists
15121 set getprotoent_r d_getprotoent_r
15123 case "$d_getprotoent_r" in
15125 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15126 case "$d_getprotoent_r_proto:$usethreads" in
15127 ":define") d_getprotoent_r_proto=define
15128 set d_getprotoent_r_proto getprotoent_r $hdrs
15132 case "$d_getprotoent_r_proto" in
15134 case "$getprotoent_r_proto" in
15135 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15136 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15138 case "$getprotoent_r_proto" in
15139 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15140 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15142 case "$getprotoent_r_proto" in
15143 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15144 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15146 case "$getprotoent_r_proto" in
15147 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15148 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15150 case "$getprotoent_r_proto" in
15151 ''|0) d_getprotoent_r=undef
15152 getprotoent_r_proto=0
15153 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15154 * ) case "$getprotoent_r_proto" in
15155 REENTRANT_PROTO*) ;;
15156 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15158 echo "Prototype: $try" ;;
15161 *) case "$usethreads" in
15162 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15164 d_getprotoent_r=undef
15165 getprotoent_r_proto=0
15169 *) getprotoent_r_proto=0
15173 : see if prototypes for various getprotoxxx netdb.h functions are available
15175 set d_getprotoprotos getprotoent $i_netdb netdb.h
15178 : see if getprpwnam exists
15179 set getprpwnam d_getprpwnam
15182 : see if getpwent exists
15183 set getpwent d_getpwent
15186 : see if getpwent_r exists
15187 set getpwent_r d_getpwent_r
15189 case "$d_getpwent_r" in
15191 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15192 case "$d_getpwent_r_proto:$usethreads" in
15193 ":define") d_getpwent_r_proto=define
15194 set d_getpwent_r_proto getpwent_r $hdrs
15198 case "$d_getpwent_r_proto" in
15200 case "$getpwent_r_proto" in
15201 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15202 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15204 case "$getpwent_r_proto" in
15205 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15206 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15208 case "$getpwent_r_proto" in
15209 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15210 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15212 case "$getpwent_r_proto" in
15213 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15214 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15216 case "$getpwent_r_proto" in
15217 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15218 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15220 case "$getpwent_r_proto" in
15221 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15222 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15224 case "$getpwent_r_proto" in
15225 ''|0) d_getpwent_r=undef
15227 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15228 * ) case "$getpwent_r_proto" in
15229 REENTRANT_PROTO*) ;;
15230 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15232 echo "Prototype: $try" ;;
15235 *) case "$usethreads" in
15236 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15243 *) getpwent_r_proto=0
15247 : see if getpwnam_r exists
15248 set getpwnam_r d_getpwnam_r
15250 case "$d_getpwnam_r" in
15252 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15253 case "$d_getpwnam_r_proto:$usethreads" in
15254 ":define") d_getpwnam_r_proto=define
15255 set d_getpwnam_r_proto getpwnam_r $hdrs
15259 case "$d_getpwnam_r_proto" in
15261 case "$getpwnam_r_proto" in
15262 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15263 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15265 case "$getpwnam_r_proto" in
15266 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15267 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15269 case "$getpwnam_r_proto" in
15270 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15271 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15273 case "$getpwnam_r_proto" in
15274 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15275 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15277 case "$getpwnam_r_proto" in
15278 ''|0) d_getpwnam_r=undef
15280 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15281 * ) case "$getpwnam_r_proto" in
15282 REENTRANT_PROTO*) ;;
15283 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15285 echo "Prototype: $try" ;;
15288 *) case "$usethreads" in
15289 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15296 *) getpwnam_r_proto=0
15300 : see if getpwuid_r exists
15301 set getpwuid_r d_getpwuid_r
15303 case "$d_getpwuid_r" in
15305 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15306 case "$d_getpwuid_r_proto:$usethreads" in
15307 ":define") d_getpwuid_r_proto=define
15308 set d_getpwuid_r_proto getpwuid_r $hdrs
15312 case "$d_getpwuid_r_proto" in
15314 case "$getpwuid_r_proto" in
15315 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15316 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15318 case "$getpwuid_r_proto" in
15319 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15320 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15322 case "$getpwuid_r_proto" in
15323 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15324 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15326 case "$getpwuid_r_proto" in
15327 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15328 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15330 case "$getpwuid_r_proto" in
15331 ''|0) d_getpwuid_r=undef
15333 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15334 * ) case "$getpwuid_r_proto" in
15335 REENTRANT_PROTO*) ;;
15336 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15338 echo "Prototype: $try" ;;
15341 *) case "$usethreads" in
15342 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15349 *) getpwuid_r_proto=0
15353 : Optional checks for getsbyname and getsbyport
15355 : see if getservbyname exists
15356 set getservbyname d_getsbyname
15359 : see if getservbyport exists
15360 set getservbyport d_getsbyport
15363 : see if getservent exists
15364 set getservent d_getsent
15367 : see if getservbyname_r exists
15368 set getservbyname_r d_getservbyname_r
15370 case "$d_getservbyname_r" in
15372 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15373 case "$d_getservbyname_r_proto:$usethreads" in
15374 ":define") d_getservbyname_r_proto=define
15375 set d_getservbyname_r_proto getservbyname_r $hdrs
15379 case "$d_getservbyname_r_proto" in
15381 case "$getservbyname_r_proto" in
15382 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15383 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15385 case "$getservbyname_r_proto" in
15386 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15387 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15389 case "$getservbyname_r_proto" in
15390 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15391 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15393 case "$getservbyname_r_proto" in
15394 ''|0) d_getservbyname_r=undef
15395 getservbyname_r_proto=0
15396 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15397 * ) case "$getservbyname_r_proto" in
15398 REENTRANT_PROTO*) ;;
15399 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15401 echo "Prototype: $try" ;;
15404 *) case "$usethreads" in
15405 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15407 d_getservbyname_r=undef
15408 getservbyname_r_proto=0
15412 *) getservbyname_r_proto=0
15416 : see if getservbyport_r exists
15417 set getservbyport_r d_getservbyport_r
15419 case "$d_getservbyport_r" in
15421 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15422 case "$d_getservbyport_r_proto:$usethreads" in
15423 ":define") d_getservbyport_r_proto=define
15424 set d_getservbyport_r_proto getservbyport_r $hdrs
15428 case "$d_getservbyport_r_proto" in
15430 case "$getservbyport_r_proto" in
15431 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15432 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15434 case "$getservbyport_r_proto" in
15435 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15436 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15438 case "$getservbyport_r_proto" in
15439 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15440 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15442 case "$getservbyport_r_proto" in
15443 ''|0) d_getservbyport_r=undef
15444 getservbyport_r_proto=0
15445 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15446 * ) case "$getservbyport_r_proto" in
15447 REENTRANT_PROTO*) ;;
15448 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15450 echo "Prototype: $try" ;;
15453 *) case "$usethreads" in
15454 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15456 d_getservbyport_r=undef
15457 getservbyport_r_proto=0
15461 *) getservbyport_r_proto=0
15465 : see if getservent_r exists
15466 set getservent_r d_getservent_r
15468 case "$d_getservent_r" in
15470 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15471 case "$d_getservent_r_proto:$usethreads" in
15472 ":define") d_getservent_r_proto=define
15473 set d_getservent_r_proto getservent_r $hdrs
15477 case "$d_getservent_r_proto" in
15479 case "$getservent_r_proto" in
15480 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15481 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15483 case "$getservent_r_proto" in
15484 ''|0) try='int getservent_r(struct servent*, char*, int);'
15485 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15487 case "$getservent_r_proto" in
15488 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15489 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15491 case "$getservent_r_proto" in
15492 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15493 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15495 case "$getservent_r_proto" in
15496 ''|0) d_getservent_r=undef
15497 getservent_r_proto=0
15498 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15499 * ) case "$getservent_r_proto" in
15500 REENTRANT_PROTO*) ;;
15501 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15503 echo "Prototype: $try" ;;
15506 *) case "$usethreads" in
15507 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15509 d_getservent_r=undef
15510 getservent_r_proto=0
15514 *) getservent_r_proto=0
15518 : see if prototypes for various getservxxx netdb.h functions are available
15520 set d_getservprotos getservent $i_netdb netdb.h
15523 : see if getspnam exists
15524 set getspnam d_getspnam
15527 : see if this is a shadow.h system
15528 set shadow.h i_shadow
15531 : see if getspnam_r exists
15532 set getspnam_r d_getspnam_r
15534 case "$d_getspnam_r" in
15536 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15537 case "$d_getspnam_r_proto:$usethreads" in
15538 ":define") d_getspnam_r_proto=define
15539 set d_getspnam_r_proto getspnam_r $hdrs
15543 case "$d_getspnam_r_proto" in
15545 case "$getspnam_r_proto" in
15546 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15547 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15549 case "$getspnam_r_proto" in
15550 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15551 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15553 case "$getspnam_r_proto" in
15554 ''|0) d_getspnam_r=undef
15556 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15557 * ) case "$getspnam_r_proto" in
15558 REENTRANT_PROTO*) ;;
15559 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15561 echo "Prototype: $try" ;;
15564 *) case "$usethreads" in
15565 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15572 *) getspnam_r_proto=0
15576 : see if gettimeofday or ftime exists
15577 set gettimeofday d_gettimeod
15579 case "$d_gettimeod" in
15585 val="$undef"; set d_ftime; eval $setvar
15588 case "$d_gettimeod$d_ftime" in
15591 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15595 : see if gmtime_r exists
15596 set gmtime_r d_gmtime_r
15598 case "$d_gmtime_r" in
15600 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15601 case "$d_gmtime_r_proto:$usethreads" in
15602 ":define") d_gmtime_r_proto=define
15603 set d_gmtime_r_proto gmtime_r $hdrs
15607 case "$d_gmtime_r_proto" in
15609 case "$gmtime_r_proto" in
15610 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15611 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15613 case "$gmtime_r_proto" in
15614 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15615 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15617 case "$gmtime_r_proto" in
15618 ''|0) d_gmtime_r=undef
15620 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15621 * ) case "$gmtime_r_proto" in
15622 REENTRANT_PROTO*) ;;
15623 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15625 echo "Prototype: $try" ;;
15628 *) case "$usethreads" in
15629 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15636 *) gmtime_r_proto=0
15640 : see if hasmntopt exists
15641 set hasmntopt d_hasmntopt
15644 : see if this is a netinet/in.h or sys/in.h system
15645 set netinet/in.h i_niin sys/in.h i_sysin
15648 : see if arpa/inet.h has to be included
15649 set arpa/inet.h i_arpainet
15652 : see if htonl --and friends-- exists
15657 : Maybe they are macros.
15660 $cat >htonl.c <<EOM
15662 #include <sys/types.h>
15663 #$i_niin I_NETINET_IN
15665 #$i_arpainet I_ARPA_INET
15666 #ifdef I_NETINET_IN
15667 #include <netinet/in.h>
15670 #include <sys/in.h>
15673 #include <arpa/inet.h>
15676 printf("Defined as a macro.");
15679 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15680 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15682 echo "But it seems to be defined as a macro." >&4
15690 : see if hypot exists
15694 : see if ilogb exists
15698 : see if ilogbl exists
15699 set ilogbl d_ilogbl
15704 if set index val -f; eval $csym; $val; then
15705 if set strchr val -f d_strchr; eval $csym; $val; then
15706 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15709 echo "strchr() found." >&4
15713 echo "index() found." >&4
15718 echo "index() found." >&4
15721 if set strchr val -f d_strchr; eval $csym; $val; then
15724 echo "strchr() found." >&4
15726 echo "No index() or strchr() found!" >&4
15731 set d_strchr; eval $setvar
15733 set d_index; eval $setvar
15735 : check whether inet_aton exists
15736 set inet_aton d_inetaton
15739 : see if inet_ntop exists
15740 set inet_ntop d_inetntop
15743 : see if inet_pton exists
15744 set inet_pton d_inetpton
15749 $cat >isascii.c <<EOCP
15752 #$i_stdlib I_STDLIB
15754 #include <stdlib.h>
15765 if eval $compile; then
15766 echo "isascii() found." >&4
15769 echo "isascii() NOT found." >&4
15778 $cat >isblank.c <<'EOCP'
15789 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15790 echo "isblank() found." >&4
15793 echo "isblank() NOT found." >&4
15800 : check for isfinite
15801 echo "Checking to see if you have isfinite..." >&4
15807 int main() { return isfinite(0.0); }
15810 if eval $compile; then
15812 echo "You have isfinite."
15815 echo "You do not have isfinite."
15821 : see if isfinitel exists
15822 set isfinitel d_isfinitel
15826 echo "Checking to see if you have isinf..." >&4
15832 int main() { return isinf(0.0); }
15835 if eval $compile; then
15837 echo "You have isinf."
15840 echo "You do not have isinf."
15846 : see if isinfl exists
15847 set isinfl d_isinfl
15851 echo "Checking to see if you have isless..." >&4
15857 int main() { return isless(0.0); }
15860 if eval $compile; then
15862 echo "You have isless."
15865 echo "You do not have isless."
15872 echo "Checking to see if you have isnan..." >&4
15878 int main() { return isnan(0.0); }
15881 if eval $compile; then
15883 echo "You have isnan."
15886 echo "You do not have isnan."
15892 : see if isnanl exists
15893 set isnanl d_isnanl
15896 : check for isnormal
15897 echo "Checking to see if you have isnormal..." >&4
15903 int main() { return isnormal(0.0); }
15906 if eval $compile; then
15908 echo "You have isnormal."
15911 echo "You do not have isnormal."
15921 : see if j0l exists
15925 : see if killpg exists
15926 set killpg d_killpg
15929 : see if localeconv exists
15930 set localeconv d_locconv
15933 : see if libc has the POSIX.1-2008 currency locale rules
15934 case "$d_locconv:$d_lc_monetary_2008" in
15937 #include <locale.h>
15939 struct lconv *lc = localeconv();
15940 char int_p_cs_precedes = lc->int_p_cs_precedes;
15945 if eval $compile; then
15946 d_lc_monetary_2008="$define"
15948 d_lc_monetary_2008="$undef"
15954 : see if lchown exists
15956 $cat > try.c <<'EOCP'
15957 /* System header to define __stub macros and hopefully few prototypes,
15958 which can conflict with char lchown(); below. */
15959 #include <assert.h>
15960 /* Override any gcc2 internal prototype to avoid an error. */
15961 /* We use char because int might match the return type of a gcc2
15962 builtin and then its argument prototype would still apply. */
15965 /* The GNU C library defines this for functions which it implements
15966 to always fail with ENOSYS. Some functions are actually named
15967 something starting with __ and the normal name is an alias. */
15968 #if defined (__stub_lchown) || defined (__stub___lchown)
15976 if eval $compile; then
15977 $echo "lchown() found." >&4
15980 $echo "lchown() NOT found." >&4
15986 : See if number of significant digits in a double precision number is known
15988 $cat >ldbl_dig.c <<EOM
15989 #$i_limits I_LIMITS
15992 #include <limits.h>
15998 printf("Contains LDBL_DIG");
16001 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16002 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16003 echo "LDBL_DIG found." >&4
16006 echo "LDBL_DIG NOT found." >&4
16013 : see if lgamma exists
16014 set lgamma d_lgamma
16017 : see if lgamma_r exists
16018 set lgamma_r d_lgamma_r
16021 : check to see if math.h defines _LIB_VERSION
16022 d_libm_lib_version="$undef"
16026 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16028 #include <unistd.h>
16030 int main (int argc, char *argv[])
16032 printf ("%d\n", _LIB_VERSION);
16037 if eval $compile; then
16039 echo "Yes, it does ($foo)" >&4
16040 d_libm_lib_version="$define"
16042 echo "No, it does not (probably harmless)" >&4
16049 : see if link exists
16053 : see if llrint exists
16054 set llrint d_llrint
16057 : see if llrintl exists
16058 set llrintl d_llrintl
16061 : see if llround exists
16062 set llround d_llround
16065 : see if llroundl exists
16066 set llroundl d_llroundl
16069 : see if localtime_r exists
16070 set localtime_r d_localtime_r
16072 case "$d_localtime_r" in
16074 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16075 case "$d_localtime_r_proto:$usethreads" in
16076 ":define") d_localtime_r_proto=define
16077 set d_localtime_r_proto localtime_r $hdrs
16081 case "$d_localtime_r_proto" in
16083 case "$localtime_r_proto" in
16084 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16085 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16087 case "$localtime_r_proto" in
16088 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16089 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16091 case "$localtime_r_proto" in
16092 ''|0) d_localtime_r=undef
16093 localtime_r_proto=0
16094 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16095 * ) case "$localtime_r_proto" in
16096 REENTRANT_PROTO*) ;;
16097 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16099 echo "Prototype: $try" ;;
16102 *) case "$usethreads" in
16103 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16105 d_localtime_r=undef
16106 localtime_r_proto=0
16110 *) localtime_r_proto=0
16114 : see if localtime_r calls tzset
16115 case "$localtime_r_proto" in
16118 /* Does our libc's localtime_r call tzset ?
16119 * return 0 if so, 1 otherwise.
16121 #$i_systypes I_SYS_TYPES
16122 #$i_unistd I_UNISTD
16124 #$i_stdlib I_STDLIB
16125 #$i_string I_STRING
16126 #$i_malloc I_MALLOC
16128 # include <sys/types.h>
16131 # include <unistd.h>
16137 #include <stdlib.h>
16140 # include <string.h>
16142 # include <strings.h>
16145 # include <malloc.h>
16149 time_t t = time(0L);
16150 char w_tz[]="TZ" "=GMT+5",
16151 e_tz[]="TZ" "=GMT-5",
16152 *tz_e = (char*)malloc(16),
16153 *tz_w = (char*)malloc(16);
16154 struct tm tm_e, tm_w;
16155 memset(&tm_e,'\0',sizeof(struct tm));
16156 memset(&tm_w,'\0',sizeof(struct tm));
16161 localtime_r(&t, &tm_e);
16164 localtime_r(&t, &tm_w);
16166 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16172 if eval $compile; then
16173 if $run ./try; then
16174 d_localtime_r_needs_tzset=undef;
16176 d_localtime_r_needs_tzset=define;
16179 d_localtime_r_needs_tzset=undef;
16183 d_localtime_r_needs_tzset=undef;
16188 : see if lockf exists
16192 : see if log1p exists
16196 : see if log2 exists
16200 : see if logb exists
16204 : see if lrint exists
16208 : see if lrintl exists
16209 set lrintl d_lrintl
16212 : see if lround exists
16213 set lround d_lround
16216 : see if lroundl exists
16217 set lroundl d_lroundl
16220 : see if prototype for lseek is available
16222 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16225 : see if lstat exists
16229 : see if madvise exists
16230 set madvise d_madvise
16233 : see if malloc_size exists
16234 set malloc_size d_malloc_size
16237 : see if malloc_size_good exists
16238 set malloc_good_size d_malloc_good_size
16241 : see if mblen exists
16245 : see if mbstowcs exists
16246 set mbstowcs d_mbstowcs
16249 : see if mbtowc exists
16250 set mbtowc d_mbtowc
16253 : see if memchr exists
16254 set memchr d_memchr
16257 : see if memcmp exists
16258 set memcmp d_memcmp
16261 : see if memcpy exists
16262 set memcpy d_memcpy
16265 : see if memmove exists
16266 set memmove d_memmove
16269 : see if memset exists
16270 set memset d_memset
16273 : see if mkdir exists
16277 : see if mkdtemp exists
16278 set mkdtemp d_mkdtemp
16281 : see if mkfifo exists
16282 set mkfifo d_mkfifo
16285 : see if mkstemp exists
16286 set mkstemp d_mkstemp
16289 : see if mkstemps exists
16290 set mkstemps d_mkstemps
16293 : see if mktime exists
16294 set mktime d_mktime
16297 : see if this is a sys/mman.h system
16298 set sys/mman.h i_sysmman
16301 : see if mmap exists
16304 : see what shmat returns
16305 : default to something harmless
16307 case "$i_sysmman$d_mmap" in
16309 $cat >mmap.c <<'END'
16310 #include <sys/mman.h>
16313 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16318 echo "and it returns ($mmaptype)." >&4
16324 : see if sqrtl exists
16328 : see if scalbnl exists
16329 set scalbnl d_scalbnl
16332 : see if truncl exists
16333 set truncl d_truncl
16336 : see if modfl exists
16340 : see if prototype for modfl is available
16342 set d_modflproto modfl $i_math math.h
16345 d_modfl_pow32_bug="$undef"
16347 case "$d_longdbl$d_modfl" in
16350 Checking to see whether your modfl() is okay for large values...
16356 if $test "X$d_modflproto" != "X$define"; then
16357 $cat >>try.c <<EOCP
16358 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16359 long double modfl (long double, long double *);
16362 $cat >>try.c <<EOCP
16364 long double nv = 4294967303.15;
16370 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16374 case "$osname:$gccversion" in
16375 aix:) saveccflags="$ccflags"
16376 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16379 if eval $compile; then
16382 *" 4294967303.150000 1.150000 4294967302.000000")
16383 echo >&4 "Your modfl() is broken for large values."
16384 d_modfl_pow32_bug="$define"
16386 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16390 *" 4294967303.150000 0.150000 4294967303.000000")
16391 echo >&4 "Your modfl() seems okay for large values."
16393 *) echo >&4 "I don't understand your modfl() at all."
16399 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16402 case "$osname:$gccversion" in
16403 aix:) ccflags="$saveccflags" ;; # restore
16408 if $test "$uselongdouble" = "$define"; then
16410 if $test "$d_sqrtl" != "$define"; then
16411 message="$message sqrtl"
16413 if $test "$d_modfl" != "$define"; then
16414 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16415 echo "You have both truncl and copysignl, so I can emulate modfl."
16417 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16418 echo "You have both aintl and copysignl, so I can emulate modfl."
16420 message="$message modfl"
16424 if $test "$d_frexpl" != "$define"; then
16425 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16426 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16428 message="$message frexpl"
16431 if $test "$d_ldexpl" != "$define"; then
16432 message="$message ldexpl"
16435 if $test "$message" != ""; then
16438 *** You requested the use of long doubles but you do not seem to have
16439 *** the following mathematical functions needed for long double support:
16441 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16442 *** Cannot continue, aborting.
16450 : see if mprotect exists
16451 set mprotect d_mprotect
16454 : see if msgctl exists
16455 set msgctl d_msgctl
16458 : see if msgget exists
16459 set msgget d_msgget
16462 : see if msgsnd exists
16463 set msgsnd d_msgsnd
16466 : see if msgrcv exists
16467 set msgrcv d_msgrcv
16470 : see how much of the 'msg*(2)' library is present.
16473 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16474 *"$undef"*) h_msg=false;;
16478 case "`ipcs 2>&1`" in
16479 "SVID messages"*"not configured"*)
16480 echo "Your $osname does not have the msg*(2) configured." >&4
16483 set msgctl d_msgctl
16485 set msgget d_msgget
16487 set msgsnd d_msgsnd
16489 set msgrcv d_msgrcv
16495 : we could also check for sys/ipc.h ...
16496 if $h_msg && $test `./findhdr sys/msg.h`; then
16497 echo "You have the full msg*(2) library." >&4
16500 echo "You don't have the full msg*(2) library." >&4
16506 : Check for msghdr_s
16508 echo "Checking to see if your system supports struct msghdr..." >&4
16509 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16511 case "$d_msghdr_s" in
16512 "$define") echo "Yes, it does." ;;
16513 *) echo "No, it doesn't." ;;
16517 : see if msync exists
16521 : see if munmap exists
16522 set munmap d_munmap
16525 : see if nan exists
16529 : see if nearbyint exists
16530 set nearbyint d_nearbyint
16533 : see if nextafter exists
16534 set nextafter d_nextafter
16537 : see if nexttoward exists
16538 set nexttoward d_nexttoward
16541 : see if nice exists
16545 : see if this is a langinfo.h system
16546 set langinfo.h i_langinfo
16549 : see if nl_langinfo exists
16550 set nl_langinfo d_nl_langinfo
16553 : see if this is a quadmath.h system
16554 set quadmath.h i_quadmath
16557 : check for volatile keyword
16559 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16560 $cat >try.c <<'EOCP'
16563 typedef struct _goo_struct goo_struct;
16564 goo_struct * volatile goo = ((goo_struct *)0);
16565 struct _goo_struct {
16570 typedef unsigned short foo_t;
16571 char *volatile foo;
16573 volatile foo_t blech;
16577 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16579 echo "Yup, it does."
16582 echo "Nope, it doesn't."
16588 : Check basic sizes
16590 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16592 case "$use64bitint:$d_quad:$quadtype" in
16595 uvtype="$uquadtype"
16600 uvtype="unsigned long"
16606 case "$uselongdouble:$d_longdbl" in
16608 nvtype="long double"
16609 nvsize=$longdblsize
16616 case "$usequadmath:$i_quadmath" in
16618 nvtype="__float128"
16624 *** You requested the use of the quadmath library, but you
16625 *** do not seem to have the quadmath library installed.
16626 *** Cannot continue, aborting.
16632 define:*) $cat <<EOM >&4
16634 *** You requested the use of the quadmath library, but you
16635 *** do not seem to have the required header, <quadmath.h>.
16637 case "$gccversion" in
16640 *** Your gcc looks a bit old:
16646 *** You are not running a gcc.
16651 *** For the quadmath library you need at least gcc 4.6.
16652 *** Cannot continue, aborting.
16658 $echo "(IV will be "$ivtype", $ivsize bytes)"
16659 $echo "(UV will be "$uvtype", $uvsize bytes)"
16660 $echo "(NV will be "$nvtype", $nvsize bytes)"
16663 #$i_inttypes I_INTTYPES
16665 #include <inttypes.h>
16670 int8_t i = INT8_MAX;
16671 uint8_t u = UINT8_MAX;
16672 printf("int8_t\n");
16675 int16_t i = INT16_MAX;
16676 uint16_t u = UINT16_MAX;
16677 printf("int16_t\n");
16680 int32_t i = INT32_MAX;
16681 uint32_t u = UINT32_MAX;
16682 printf("int32_t\n");
16687 i8type="signed char"
16688 u8type="unsigned char"
16693 '') case "$shortsize" in
16695 u16type="unsigned short"
16703 '') set try -DINT16
16704 if eval $compile; then
16705 case "`$run ./try`" in
16717 '') if $test $shortsize -ge 2; then
16719 u16type="unsigned short"
16727 '') case "$longsize" in
16729 u32type="unsigned long"
16733 *) case "$intsize" in
16735 u32type="unsigned int"
16745 '') set try -DINT32
16746 if eval $compile; then
16747 case "`$run ./try`" in
16759 '') if $test $intsize -ge 4; then
16761 u32type="unsigned int"
16769 '') case "$d_quad:$quadtype" in
16771 i64type="$quadtype"
16772 u64type="$uquadtype"
16780 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16781 : volatile so that the compiler has to store it out to memory.
16782 if test X"$d_volatile" = X"$define"; then
16787 #$i_stdlib I_STDLIB
16789 #include <stdlib.h>
16791 #include <sys/types.h>
16792 #include <signal.h>
16794 $volatile int bletched = 0;
16795 $signal_t blech(int s) { bletched = 1; }
16800 int n = 8 * $uvsize;
16803 signal(SIGFPE, blech);
16806 for (i = 0; i < n; i++) {
16807 u = u << 1 | ($uvtype)1;
16809 if (($uvtype)d != u)
16813 d = ($nvtype)(u - 1);
16814 if (($uvtype)d != (u - 1))
16821 printf("%d\n", ((i == n) ? -n : i));
16827 d_nv_preserves_uv="$undef"
16828 if eval $compile; then
16829 nv_preserves_uv_bits="`$run ./try`"
16831 case "$nv_preserves_uv_bits" in
16833 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16834 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16835 d_nv_preserves_uv="$define"
16837 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16838 d_nv_preserves_uv="$undef" ;;
16839 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16840 nv_preserves_uv_bits="0" ;;
16844 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16845 : volatile so that the compiler has to store it out to memory.
16846 if test X"$d_volatile" = X"$define"; then
16852 typedef $nvtype NV;
16859 while(count < 256) {
16860 $volatile NV up = value + 1.0;
16861 $volatile NV negated = -value;
16862 $volatile NV down = negated - 1.0;
16863 $volatile NV got_up = up - value;
16864 int up_good = got_up == 1.0;
16865 int got_down = down - negated;
16866 int down_good = got_down == -1.0;
16868 if (down_good != up_good) {
16870 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16871 up_good, (double) got_up, down_good, (double) got_down,
16872 count, (double) value);
16879 fputs("256.0", stdout);
16882 fputs("2.0", stdout);
16888 fputs("*", stdout);
16894 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16895 count, (double) value);
16901 nv_overflows_integers_at='0'
16902 if eval $compile; then
16908 The largest integer your NVs can preserve is equal to $xxx
16910 nv_overflows_integers_at="$xxx"
16913 Cannot determine the largest integer value your NVs can hold, unexpected output
16920 Cannot determine the largest integer value your NVs can hold
16927 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16928 : volatile so that the compiler has to store it out to memory.
16929 if test X"$d_volatile" = X"$define"; then
16934 #$i_stdlib I_STDLIB
16936 #include <stdlib.h>
16938 #$i_string I_STRING
16940 # include <string.h>
16942 # include <strings.h>
16944 #include <sys/types.h>
16945 #include <signal.h>
16947 $volatile int bletched = 0;
16948 $signal_t blech(int s) { bletched = 1; }
16951 int checkit($nvtype d, char *where) {
16952 unsigned char *p = (char *)&d;
16953 unsigned char *end = p + sizeof(d);
16963 printf("No - %s: 0x", where);
16965 printf ("%02X", *p++);
16970 int main(int argc, char **argv) {
16973 fail += checkit(d, "0.0");
16975 /* The compiler shouldn't be assuming that bletched is 0 */
16978 fail += checkit(d, "bleched");
16981 signal(SIGFPE, blech);
16984 /* Paranoia - the compiler should have no way of knowing that ANSI says
16985 that argv[argc] will always be NULL. Actually, if it did assume this it
16986 would be buggy, as this is C and main() can be called from elsewhere in
16988 d = argv[argc] ? 1 : 0;
16991 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16994 fail += checkit(d, "ternary");
16996 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16999 printf("No - memset doesn't give 0.0\n");
17000 /* This might just blow up: */
17001 printf("(gives %g)\n", d);
17007 printf("No - something bleched\n");
17012 printf("No - %d fail(s)\n", fail);
17021 d_nv_zero_is_allbits_zero="$undef"
17022 if eval $compile; then
17028 0.0 is represented as all bits zero in memory
17030 d_nv_zero_is_allbits_zero="$define"
17033 0.0 is not represented as all bits zero in memory
17035 d_nv_zero_is_allbits_zero="$undef"
17040 0.0 is not represented as all bits zero in memory
17042 d_nv_zero_is_allbits_zero="$undef"
17048 : check for off64_t
17050 echo "Checking to see if you have off64_t..." >&4
17052 #include <sys/types.h>
17053 #include <unistd.h>
17054 int main() { off64_t x = 7; }
17057 if eval $compile; then
17059 echo "You have off64_t."
17062 echo "You do not have off64_t."
17063 case "$lseeksize" in
17064 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17071 : how to create joinable pthreads
17072 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17074 echo "Checking what constant to use for creating joinable pthreads..." >&4
17075 $cat >try.c <<'EOCP'
17076 #include <pthread.h>
17078 int detachstate = JOINABLE;
17081 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17082 if eval $compile; then
17083 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17084 val="$undef" # Yes, undef.
17085 set d_old_pthread_create_joinable
17088 set old_pthread_create_joinable
17091 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17092 if eval $compile; then
17093 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17095 set d_old_pthread_create_joinable
17097 val=PTHREAD_CREATE_UNDETACHED
17098 set old_pthread_create_joinable
17101 set try -DJOINABLE=__UNDETACHED
17102 if eval $compile; then
17103 echo "You seem to use __UNDETACHED." >&4
17105 set d_old_pthread_create_joinable
17108 set old_pthread_create_joinable
17111 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17113 set d_old_pthread_create_joinable
17116 set old_pthread_create_joinable
17123 d_old_pthread_create_joinable="$undef"
17124 old_pthread_create_joinable=""
17127 : see if pause exists
17131 : see if poll exists
17135 : see if prctl exists
17139 : see if prctl supports PR_SET_NAME
17140 d_prctl_set_name=$undef
17145 #include <unistd.h>
17147 #include <sys/prctl.h>
17149 int main (int argc, char *argv[])
17151 return (prctl (PR_SET_NAME, "Test"));
17155 if eval $compile_ok && $run ./try; then
17156 echo "Your prctl (PR_SET_NAME, ...) works"
17157 d_prctl_set_name=$define
17163 : see if readlink exists
17164 set readlink d_readlink
17167 : Check if there is a /proc symlink to the abs path of
17168 : the executing program. We will honor hints of d_procselfexe=$undef
17169 : or procselfexe being non-empty, otherwise will try to determine both
17170 : if we have readlink.
17171 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17172 : referenced, and AmigaOS does not have a proc filesystem anyway.
17175 if $test "X$d_procselfexe" = Xundef; then
17177 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17179 elif $test "X$d_readlink" = Xdefine; then
17180 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17181 : and it feels more tidy to avoid an extra level of symlink
17182 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17183 while test $# -gt 0; do
17186 if $issymlink $try; then
17187 $ls -l $try > reflect
17188 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17189 echo "You have $type-like $try."
17190 procselfexe='"'$try'"'
17192 : This will break out of the loop
17202 : backward compatibility for d_hvfork
17203 if test X$d_hvfork != X; then
17204 d_vfork="$d_hvfork"
17207 : see if there is a vfork
17212 d_pseudofork=$undef
17214 : Ok, but do we want to use it. vfork is reportedly unreliable in
17215 : perl on Solaris 2.x, and probably elsewhere.
17219 case "$usevfork" in
17225 Perl can only use a vfork() that doesn't suffer from strict
17226 restrictions on calling functions or modifying global data in
17227 the child. For example, glibc-2.1 contains such a vfork()
17228 that is unsuitable. If your system provides a proper fork()
17229 call, chances are that you do NOT want perl to use vfork().
17232 rp="Do you still want to use vfork()?"
17237 echo "Ok, we won't use vfork()."
17246 $define) usevfork='true';;
17247 *) usevfork='false';;
17250 : see whether the pthread_atfork exists
17252 #include <pthread.h>
17255 #ifdef PTHREAD_ATFORK
17256 pthread_atfork(NULL,NULL,NULL);
17261 : see if pthread_atfork exists
17262 set try -DPTHREAD_ATFORK
17263 if eval $compile; then
17268 case "$usethreads" in
17271 $define) echo 'pthread_atfork found.' >&4 ;;
17272 *) echo 'pthread_atfork NOT found.' >&4 ;;
17275 set d_pthread_atfork
17278 : see if pthread_attr_setscope exists
17279 set pthread_attr_setscope d_pthread_attr_setscope
17282 : see whether the various POSIXish _yields exist
17284 #include <pthread.h>
17290 #ifdef PTHREAD_YIELD
17293 #ifdef PTHREAD_YIELD_NULL
17294 pthread_yield(NULL);
17300 : see if sched_yield exists
17301 set try -DSCHED_YIELD
17302 if eval $compile; then
17304 sched_yield='sched_yield()'
17308 case "$usethreads" in
17311 $define) echo 'sched_yield() found.' >&4 ;;
17312 *) echo 'sched_yield() NOT found.' >&4 ;;
17318 : see if pthread_yield exists
17319 set try -DPTHREAD_YIELD
17320 if eval $compile; then
17322 case "$sched_yield" in
17323 '') sched_yield='pthread_yield()' ;;
17326 set try -DPTHREAD_YIELD_NULL
17327 if eval $compile; then
17329 case "$sched_yield" in
17330 '') sched_yield='pthread_yield(NULL)' ;;
17336 case "$usethreads" in
17339 $define) echo 'pthread_yield() found.' >&4 ;;
17340 *) echo 'pthread_yield() NOT found.' >&4 ;;
17344 set d_pthread_yield
17346 case "$sched_yield" in
17347 '') sched_yield=undef ;;
17351 : check for ptrdiff_t
17353 echo "Checking to see if you have ptrdiff_t..." >&4
17355 #include <stddef.h>
17356 int main() { ptrdiff_t x = 7; }
17359 if eval $compile; then
17361 echo "You have ptrdiff_t."
17364 echo "You do not have ptrdiff_t."
17370 : see if random_r exists
17371 set random_r d_random_r
17373 case "$d_random_r" in
17375 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17376 case "$d_random_r_proto:$usethreads" in
17377 ":define") d_random_r_proto=define
17378 set d_random_r_proto random_r $hdrs
17382 case "$d_random_r_proto" in
17384 case "$random_r_proto" in
17385 ''|0) try='int random_r(int*, struct random_data*);'
17386 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17388 case "$random_r_proto" in
17389 ''|0) try='int random_r(long*, struct random_data*);'
17390 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17392 case "$random_r_proto" in
17393 ''|0) try='int random_r(struct random_data*, int32_t*);'
17394 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17396 case "$random_r_proto" in
17397 ''|0) d_random_r=undef
17399 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17400 * ) case "$random_r_proto" in
17401 REENTRANT_PROTO*) ;;
17402 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17404 echo "Prototype: $try" ;;
17407 *) case "$usethreads" in
17408 define) echo "random_r has no prototype, not using it." >&4 ;;
17415 *) random_r_proto=0
17419 : see if readdir and friends exist
17420 set readdir d_readdir
17422 set seekdir d_seekdir
17424 set telldir d_telldir
17426 set rewinddir d_rewinddir
17429 : see if readdir64_r exists
17430 set readdir64_r d_readdir64_r
17432 case "$d_readdir64_r" in
17434 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17435 case "$d_readdir64_r_proto:$usethreads" in
17436 ":define") d_readdir64_r_proto=define
17437 set d_readdir64_r_proto readdir64_r $hdrs
17441 case "$d_readdir64_r_proto" in
17443 case "$readdir64_r_proto" in
17444 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17445 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17447 case "$readdir64_r_proto" in
17448 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17449 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17451 case "$readdir64_r_proto" in
17452 ''|0) d_readdir64_r=undef
17453 readdir64_r_proto=0
17454 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17455 * ) case "$readdir64_r_proto" in
17456 REENTRANT_PROTO*) ;;
17457 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17459 echo "Prototype: $try" ;;
17462 *) case "$usethreads" in
17463 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17465 d_readdir64_r=undef
17466 readdir64_r_proto=0
17470 *) readdir64_r_proto=0
17474 : see if readdir_r exists
17475 set readdir_r d_readdir_r
17477 case "$d_readdir_r" in
17479 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17480 case "$d_readdir_r_proto:$usethreads" in
17481 ":define") d_readdir_r_proto=define
17482 set d_readdir_r_proto readdir_r $hdrs
17486 case "$d_readdir_r_proto" in
17488 case "$readdir_r_proto" in
17489 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17490 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17492 case "$readdir_r_proto" in
17493 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17494 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17496 case "$readdir_r_proto" in
17497 ''|0) d_readdir_r=undef
17499 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17500 * ) case "$readdir_r_proto" in
17501 REENTRANT_PROTO*) ;;
17502 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17504 echo "Prototype: $try" ;;
17507 *) case "$usethreads" in
17508 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17515 *) readdir_r_proto=0
17519 : see if readv exists
17523 : see if recvmsg exists
17524 set recvmsg d_recvmsg
17527 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17529 if set regcomp val -f d_regcomp; eval $csym; $val; then
17530 echo 'regcomp() found.' >&4
17531 d_regcomp="$define"
17534 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17535 echo 'regcmp() found.' >&4
17539 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17540 echo 're_comp() found, assuming re_exec() also exists.' >&4
17541 d_re_comp="$define"
17546 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17553 : see if remainder exists
17554 set remainder d_remainder
17557 : see if remquo exists
17558 set remquo d_remquo
17561 : see if rename exists
17562 set rename d_rename
17565 : see if rint exists
17569 : see if rmdir exists
17573 : see if round exists
17577 : see if memory.h is available.
17582 : See if it conflicts with string.h
17588 $cppstdin $cppflags $cppminus < $strings > mem.h
17589 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17591 echo "We won't be including <memory.h>."
17601 : can bcopy handle overlapping blocks?
17604 case "$d_memmove" in
17605 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17606 *) case "$d_bcopy" in
17608 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17610 #$i_memory I_MEMORY
17611 #$i_stdlib I_STDLIB
17612 #$i_string I_STRING
17613 #$i_unistd I_UNISTD
17615 $cat >>try.c <<'EOCP'
17618 # include <memory.h>
17621 # include <stdlib.h>
17624 # include <string.h>
17626 # include <strings.h>
17629 # include <unistd.h> /* Needed for NetBSD */
17633 char buf[128], abc[128];
17639 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17640 try to store the string in read-only memory. */
17641 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17643 for (align = 7; align >= 0; align--) {
17644 for (len = 36; len; len--) {
17646 bcopy(abc, b, len);
17647 for (off = 1; off <= len; off++) {
17648 bcopy(b, b+off, len);
17649 bcopy(b+off, b, len);
17650 if (bcmp(b, abc, len))
17659 if eval $compile_ok; then
17660 if $run ./try 2>/dev/null; then
17661 echo "Yes, it can."
17664 echo "It can't, sorry."
17667 echo "(I can't compile the test program, so we'll assume not...)"
17677 : can memcpy handle overlapping blocks?
17680 case "$d_memmove" in
17681 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17682 *) case "$d_memcpy" in
17684 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17686 #$i_memory I_MEMORY
17687 #$i_stdlib I_STDLIB
17688 #$i_string I_STRING
17689 #$i_unistd I_UNISTD
17691 $cat >>try.c <<'EOCP'
17694 # include <memory.h>
17697 # include <stdlib.h>
17700 # include <string.h>
17702 # include <strings.h>
17705 # include <unistd.h> /* Needed for NetBSD */
17709 char buf[128], abc[128];
17715 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17716 try to store the string in read-only memory. */
17717 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17719 for (align = 7; align >= 0; align--) {
17720 for (len = 36; len; len--) {
17722 memcpy(b, abc, len);
17723 for (off = 1; off <= len; off++) {
17724 memcpy(b+off, b, len);
17725 memcpy(b, b+off, len);
17726 if (memcmp(b, abc, len))
17735 if eval $compile_ok; then
17736 if $run ./try 2>/dev/null; then
17737 echo "Yes, it can."
17740 echo "It can't, sorry."
17743 echo "(I can't compile the test program, so we'll assume not...)"
17753 : can memcmp be trusted to compare relative magnitude?
17755 case "$d_memcmp" in
17758 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17760 #$i_memory I_MEMORY
17761 #$i_stdlib I_STDLIB
17762 #$i_string I_STRING
17763 #$i_unistd I_UNISTD
17765 $cat >>try.c <<'EOCP'
17768 # include <memory.h>
17771 # include <stdlib.h>
17774 # include <string.h>
17776 # include <strings.h>
17779 # include <unistd.h> /* Needed for NetBSD */
17785 if ((a < b) && memcmp(&a, &b, 1) < 0)
17791 if eval $compile_ok; then
17792 if $run ./try 2>/dev/null; then
17793 echo "Yes, it can."
17796 echo "No, it can't (it uses signed chars)."
17799 echo "(I can't compile the test program, so we'll assume not...)"
17807 : see if prototype for sbrk is available
17809 set d_sbrkproto sbrk $i_unistd unistd.h
17812 : see if scalbn exists
17813 set scalbn d_scalbn
17816 : see if select exists
17817 set select d_select
17820 : see if semctl exists
17821 set semctl d_semctl
17824 : see if semget exists
17825 set semget d_semget
17828 : see if semop exists
17832 : see how much of the 'sem*(2)' library is present.
17835 case "$d_semctl$d_semget$d_semop" in
17836 *"$undef"*) h_sem=false;;
17840 case "`ipcs 2>&1`" in
17841 "SVID messages"*"not configured"*)
17842 echo "Your $osname does not have the sem*(2) configured." >&4
17845 set semctl d_semctl
17847 set semget d_semget
17855 : we could also check for sys/ipc.h ...
17856 if $h_sem && $test `./findhdr sys/sem.h`; then
17857 echo "You have the full sem*(2) library." >&4
17860 echo "You don't have the full sem*(2) library." >&4
17866 : see whether sys/sem.h defines union semun
17868 $cat > try.c <<'END'
17869 #include <sys/types.h>
17870 #include <sys/ipc.h>
17871 #include <sys/sem.h>
17872 int main () { union semun semun; semun.buf = 0; }
17875 if eval $compile; then
17876 echo "You have union semun in <sys/sem.h>." >&4
17879 echo "You do not have union semun in <sys/sem.h>." >&4
17886 : see how to do semctl IPC_STAT
17890 $cat > tryh.h <<END
17893 # define S_IRUSR S_IREAD
17894 # define S_IWUSR S_IWRITE
17895 # define S_IXUSR S_IEXEC
17897 # define S_IRUSR 0400
17898 # define S_IWUSR 0200
17899 # define S_IXUSR 0100
17901 # define S_IRGRP (S_IRUSR>>3)
17902 # define S_IWGRP (S_IWUSR>>3)
17903 # define S_IXGRP (S_IXUSR>>3)
17904 # define S_IROTH (S_IRUSR>>6)
17905 # define S_IWOTH (S_IWUSR>>6)
17906 # define S_IXOTH (S_IXUSR>>6)
17909 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17910 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17911 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17914 : see whether semctl IPC_STAT can use union semun
17915 case "$d_semctl_semun" in
17919 #include <sys/types.h>
17920 #include <sys/ipc.h>
17921 #include <sys/sem.h>
17922 #include <sys/stat.h>
17929 #$d_union_semun HAS_UNION_SEMUN
17932 #ifndef HAS_UNION_SEMUN
17935 struct semid_ds *buf;
17936 unsigned short *array;
17942 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17943 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17945 struct semid_ds argbuf;
17948 st = semctl(sem, 0, IPC_STAT, arg);
17952 # endif /* IPC_STAT */
17953 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17955 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17956 # endif /* IPC_RMID */
17957 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17959 #endif /* IPC_PRIVATE && ... */
17960 printf("semget failed: errno = %d\n", errno);
17965 if eval $compile; then
17968 semun) val="$define" ;;
17976 case "$d_semctl_semun" in
17978 echo "You can use union semun for semctl IPC_STAT." >&4
17981 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17986 : see whether semctl IPC_STAT can use struct semid_ds pointer
17987 case "$d_semctl_semid_ds" in
17990 $cat > try.c <<'END'
17991 #include <sys/types.h>
17992 #include <sys/ipc.h>
17993 #include <sys/sem.h>
17994 #include <sys/stat.h>
18002 struct semid_ds arg;
18005 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18006 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18009 st = semctl(sem, 0, IPC_STAT, &arg);
18011 printf("semid_ds\n");
18013 # endif /* IPC_STAT */
18014 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18016 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18017 # endif /* IPC_RMID */
18018 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18020 #endif /* IPC_PRIVATE && ... */
18021 printf("semget failed: errno = %d\n", errno);
18027 if eval $compile; then
18030 semid_ds) val="$define" ;;
18034 set d_semctl_semid_ds
18038 case "$d_semctl_semid_ds" in
18040 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18042 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18048 # We do not have the full sem*(2) library, so assume we can not
18054 set d_semctl_semid_ds
18060 : see if sendmsg exists
18061 set sendmsg d_sendmsg
18064 : see if setegid exists
18065 set setegid d_setegid
18068 : see if seteuid exists
18069 set seteuid d_seteuid
18072 : see if setgrent exists
18073 set setgrent d_setgrent
18076 : see if setgrent_r exists
18077 set setgrent_r d_setgrent_r
18079 case "$d_setgrent_r" in
18081 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18082 case "$d_setgrent_r_proto:$usethreads" in
18083 ":define") d_setgrent_r_proto=define
18084 set d_setgrent_r_proto setgrent_r $hdrs
18088 case "$d_setgrent_r_proto" in
18090 case "$setgrent_r_proto" in
18091 ''|0) try='int setgrent_r(FILE**);'
18092 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18094 case "$setgrent_r_proto" in
18095 ''|0) try='void setgrent_r(FILE**);'
18096 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18098 case "$setgrent_r_proto" in
18099 ''|0) d_setgrent_r=undef
18101 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18102 * ) case "$setgrent_r_proto" in
18103 REENTRANT_PROTO*) ;;
18104 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18106 echo "Prototype: $try" ;;
18109 *) case "$usethreads" in
18110 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18117 *) setgrent_r_proto=0
18121 : see if sethostent exists
18122 set sethostent d_sethent
18125 : see if sethostent_r exists
18126 set sethostent_r d_sethostent_r
18128 case "$d_sethostent_r" in
18130 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18131 case "$d_sethostent_r_proto:$usethreads" in
18132 ":define") d_sethostent_r_proto=define
18133 set d_sethostent_r_proto sethostent_r $hdrs
18137 case "$d_sethostent_r_proto" in
18139 case "$sethostent_r_proto" in
18140 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18141 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18143 case "$sethostent_r_proto" in
18144 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18145 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18147 case "$sethostent_r_proto" in
18148 ''|0) d_sethostent_r=undef
18149 sethostent_r_proto=0
18150 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18151 * ) case "$sethostent_r_proto" in
18152 REENTRANT_PROTO*) ;;
18153 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18155 echo "Prototype: $try" ;;
18158 *) case "$usethreads" in
18159 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18161 d_sethostent_r=undef
18162 sethostent_r_proto=0
18166 *) sethostent_r_proto=0
18170 : see if setitimer exists
18171 set setitimer d_setitimer
18174 : see if setlinebuf exists
18175 set setlinebuf d_setlinebuf
18178 : see if setlocale exists
18179 set setlocale d_setlocale
18182 : see if locale.h is available
18183 set locale.h i_locale
18186 : see if setlocale_r exists
18187 set setlocale_r d_setlocale_r
18189 case "$d_setlocale_r" in
18191 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18192 case "$d_setlocale_r_proto:$usethreads" in
18193 ":define") d_setlocale_r_proto=define
18194 set d_setlocale_r_proto setlocale_r $hdrs
18198 case "$d_setlocale_r_proto" in
18200 case "$setlocale_r_proto" in
18201 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18202 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18204 case "$setlocale_r_proto" in
18205 ''|0) d_setlocale_r=undef
18206 setlocale_r_proto=0
18207 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18208 * ) case "$setlocale_r_proto" in
18209 REENTRANT_PROTO*) ;;
18210 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18212 echo "Prototype: $try" ;;
18215 *) case "$usethreads" in
18216 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18218 d_setlocale_r=undef
18219 setlocale_r_proto=0
18223 *) setlocale_r_proto=0
18227 : see if setnetent exists
18228 set setnetent d_setnent
18231 : see if setnetent_r exists
18232 set setnetent_r d_setnetent_r
18234 case "$d_setnetent_r" in
18236 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18237 case "$d_setnetent_r_proto:$usethreads" in
18238 ":define") d_setnetent_r_proto=define
18239 set d_setnetent_r_proto setnetent_r $hdrs
18243 case "$d_setnetent_r_proto" in
18245 case "$setnetent_r_proto" in
18246 ''|0) try='int setnetent_r(int, struct netent_data*);'
18247 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18249 case "$setnetent_r_proto" in
18250 ''|0) try='void setnetent_r(int, struct netent_data*);'
18251 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18253 case "$setnetent_r_proto" in
18254 ''|0) d_setnetent_r=undef
18255 setnetent_r_proto=0
18256 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18257 * ) case "$setnetent_r_proto" in
18258 REENTRANT_PROTO*) ;;
18259 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18261 echo "Prototype: $try" ;;
18264 *) case "$usethreads" in
18265 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18267 d_setnetent_r=undef
18268 setnetent_r_proto=0
18272 *) setnetent_r_proto=0
18276 : see if setprotoent exists
18277 set setprotoent d_setpent
18280 : see if setpgid exists
18281 set setpgid d_setpgid
18284 : see if setpgrp2 exists
18285 set setpgrp2 d_setpgrp2
18288 : see if setpriority exists
18289 set setpriority d_setprior
18292 : see if setproctitle exists
18293 set setproctitle d_setproctitle
18296 : see if setprotoent_r exists
18297 set setprotoent_r d_setprotoent_r
18299 case "$d_setprotoent_r" in
18301 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18302 case "$d_setprotoent_r_proto:$usethreads" in
18303 ":define") d_setprotoent_r_proto=define
18304 set d_setprotoent_r_proto setprotoent_r $hdrs
18308 case "$d_setprotoent_r_proto" in
18310 case "$setprotoent_r_proto" in
18311 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18312 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18314 case "$setprotoent_r_proto" in
18315 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18316 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18318 case "$setprotoent_r_proto" in
18319 ''|0) d_setprotoent_r=undef
18320 setprotoent_r_proto=0
18321 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18322 * ) case "$setprotoent_r_proto" in
18323 REENTRANT_PROTO*) ;;
18324 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18326 echo "Prototype: $try" ;;
18329 *) case "$usethreads" in
18330 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18332 d_setprotoent_r=undef
18333 setprotoent_r_proto=0
18337 *) setprotoent_r_proto=0
18341 : see if setpwent exists
18342 set setpwent d_setpwent
18345 : see if setpwent_r exists
18346 set setpwent_r d_setpwent_r
18348 case "$d_setpwent_r" in
18350 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18351 case "$d_setpwent_r_proto:$usethreads" in
18352 ":define") d_setpwent_r_proto=define
18353 set d_setpwent_r_proto setpwent_r $hdrs
18357 case "$d_setpwent_r_proto" in
18359 case "$setpwent_r_proto" in
18360 ''|0) try='int setpwent_r(FILE**);'
18361 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18363 case "$setpwent_r_proto" in
18364 ''|0) try='void setpwent_r(FILE**);'
18365 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18367 case "$setpwent_r_proto" in
18368 ''|0) d_setpwent_r=undef
18370 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18371 * ) case "$setpwent_r_proto" in
18372 REENTRANT_PROTO*) ;;
18373 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18375 echo "Prototype: $try" ;;
18378 *) case "$usethreads" in
18379 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18386 *) setpwent_r_proto=0
18390 : see if setregid exists
18391 set setregid d_setregid
18393 set setresgid d_setresgid
18396 : see if setreuid exists
18397 set setreuid d_setreuid
18399 set setresuid d_setresuid
18402 : see if setrgid exists
18403 set setrgid d_setrgid
18406 : see if setruid exists
18407 set setruid d_setruid
18410 : see if setservent exists
18411 set setservent d_setsent
18414 : see if setservent_r exists
18415 set setservent_r d_setservent_r
18417 case "$d_setservent_r" in
18419 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18420 case "$d_setservent_r_proto:$usethreads" in
18421 ":define") d_setservent_r_proto=define
18422 set d_setservent_r_proto setservent_r $hdrs
18426 case "$d_setservent_r_proto" in
18428 case "$setservent_r_proto" in
18429 ''|0) try='int setservent_r(int, struct servent_data*);'
18430 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18432 case "$setservent_r_proto" in
18433 ''|0) try='void setservent_r(int, struct servent_data*);'
18434 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18436 case "$setservent_r_proto" in
18437 ''|0) d_setservent_r=undef
18438 setservent_r_proto=0
18439 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18440 * ) case "$setservent_r_proto" in
18441 REENTRANT_PROTO*) ;;
18442 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18444 echo "Prototype: $try" ;;
18447 *) case "$usethreads" in
18448 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18450 d_setservent_r=undef
18451 setservent_r_proto=0
18455 *) setservent_r_proto=0
18459 : see if setsid exists
18460 set setsid d_setsid
18463 : see if setvbuf exists
18464 set setvbuf d_setvbuf
18467 : see if shmctl exists
18468 set shmctl d_shmctl
18471 : see if shmget exists
18472 set shmget d_shmget
18475 : see if shmat exists
18478 : see what shmat returns
18481 $cat >shmat.c <<'END'
18482 #include <sys/shm.h>
18485 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18490 echo "and it returns ($shmattype)." >&4
18491 : see if a prototype for shmat is available
18492 xxx=`./findhdr sys/shm.h`
18493 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18494 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18505 set d_shmatprototype
18508 : see if shmdt exists
18512 : see how much of the 'shm*(2)' library is present.
18515 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18516 *"$undef"*) h_shm=false;;
18520 case "`ipcs 2>&1`" in
18521 "SVID shared memory"*"not configured"*)
18522 echo "Your $osname does not have the shm*(2) configured." >&4
18525 set shmctl d_shmctl
18527 set shmget d_shmget
18537 : we could also check for sys/ipc.h ...
18538 if $h_shm && $test `./findhdr sys/shm.h`; then
18539 echo "You have the full shm*(2) library." >&4
18542 echo "You don't have the full shm*(2) library." >&4
18548 : see if we have sigaction
18550 if set sigaction val -f d_sigaction; eval $csym; $val; then
18551 echo 'sigaction() found.' >&4
18554 #include <sys/types.h>
18555 #include <signal.h>
18556 #$i_stdlib I_STDLIB
18558 #include <stdlib.h>
18562 struct sigaction act, oact;
18564 oact.sa_handler = 0;
18565 /* so that act and oact are used */
18566 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18570 if eval $compile_ok; then
18573 echo "But you don't seem to have a usable struct sigaction." >&4
18577 echo 'sigaction NOT found.' >&4
18580 set d_sigaction; eval $setvar
18583 : see if this is a sunmath.h system
18584 set sunmath.h i_sunmath
18587 : see if signbit exists
18588 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18591 #$i_sunmath I_SUNMATH
18595 #ifdef I_SUNMATH /* Solaris special math library */
18596 # include <sunmath.h>
18599 int main(int argc, char **argv)
18603 if ((signbit(x) == 0) && (signbit(y) != 0))
18611 if eval $compile; then
18612 if $run ./try; then
18616 $echo "Signbit seems to be available, but doesn't work as I expected."
18617 $echo "I won't use it." >&4
18628 : see if sigprocmask exists
18629 set sigprocmask d_sigprocmask
18632 : see if sigsetjmp exists
18634 case "$d_sigsetjmp" in
18637 #include <setjmp.h>
18638 #$i_stdlib I_STDLIB
18640 #include <stdlib.h>
18646 if (sigsetjmp(env,1))
18649 siglongjmp(env, 1);
18654 if eval $compile; then
18655 if $run ./try >/dev/null 2>&1; then
18656 echo "POSIX sigsetjmp found." >&4
18660 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18666 echo "sigsetjmp not found." >&4
18670 *) val="$d_sigsetjmp"
18671 case "$d_sigsetjmp" in
18672 $define) echo "POSIX sigsetjmp found." >&4;;
18673 $undef) echo "sigsetjmp not found." >&4;;
18681 : see if snprintf exists
18682 set snprintf d_snprintf
18685 : see if vsnprintf exists
18686 set vsnprintf d_vsnprintf
18689 case "$d_snprintf-$d_vsnprintf" in
18692 Checking whether your snprintf() and vsnprintf() work okay...
18694 $cat >try.c <<'EOCP'
18695 /* v?snprintf testing logic courtesy of Russ Allbery.
18696 * According to C99:
18697 * - if the buffer is too short it still must be \0-terminated
18698 * - if the buffer is too short the potentially required length
18699 * must be returned and not -1
18700 * - if the buffer is NULL the potentially required length
18701 * must be returned and not -1 or core dump
18704 #include <stdarg.h>
18708 int test (char *format, ...)
18713 va_start (args, format);
18714 count = vsnprintf (buf, sizeof buf, format, args);
18721 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18722 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18726 if eval $compile; then
18729 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18731 Your snprintf() and snprintf() don't seem to be working okay.
18733 d_snprintf="$undef"
18734 d_vsnprintf="$undef"
18738 echo "(I can't seem to compile the test program--assuming they don't)"
18739 d_snprintf="$undef"
18740 d_vsnprintf="$undef"
18746 : see if sockatmark exists
18747 set sockatmark d_sockatmark
18750 : see if prototype for sockatmark is available
18752 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18755 : see if socks5_init exists
18756 set socks5_init d_socks5_init
18759 : see if sprintf returns the length of the string in the buffer as per ANSI
18760 $echo "Checking whether sprintf returns the length of the string..." >&4
18763 #$i_stdlib I_STDLIB
18765 #include <stdlib.h>
18767 #$i_string I_STRING
18769 # include <string.h>
18771 # include <strings.h>
18780 int check (size_t expect, int test) {
18781 size_t got = strlen(buffer);
18785 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18790 int main(int argc, char **argv) {
18793 check(sprintf(buffer, ""), ++test);
18794 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18795 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18802 if eval $compile; then
18806 sprintf returns the length of the string (as ANSI says it should)
18808 d_sprintf_returns_strlen="$define"
18811 sprintf does not return the length of the string (how old is this system?)
18813 d_sprintf_returns_strlen="$undef"
18817 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18818 d_sprintf_returns_strlen="$undef"
18822 : see if srand48_r exists
18823 set srand48_r d_srand48_r
18825 case "$d_srand48_r" in
18827 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18828 case "$d_srand48_r_proto:$usethreads" in
18829 ":define") d_srand48_r_proto=define
18830 set d_srand48_r_proto srand48_r $hdrs
18834 case "$d_srand48_r_proto" in
18836 case "$srand48_r_proto" in
18837 ''|0) try='int srand48_r(long, struct drand48_data*);'
18838 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18840 case "$srand48_r_proto" in
18841 ''|0) d_srand48_r=undef
18843 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18844 * ) case "$srand48_r_proto" in
18845 REENTRANT_PROTO*) ;;
18846 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18848 echo "Prototype: $try" ;;
18851 *) case "$usethreads" in
18852 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18859 *) srand48_r_proto=0
18863 : see if srandom_r exists
18864 set srandom_r d_srandom_r
18866 case "$d_srandom_r" in
18868 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18869 case "$d_srandom_r_proto:$usethreads" in
18870 ":define") d_srandom_r_proto=define
18871 set d_srandom_r_proto srandom_r $hdrs
18875 case "$d_srandom_r_proto" in
18877 case "$srandom_r_proto" in
18878 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18879 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18881 case "$srandom_r_proto" in
18882 ''|0) d_srandom_r=undef
18884 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18885 * ) case "$srandom_r_proto" in
18886 REENTRANT_PROTO*) ;;
18887 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18889 echo "Prototype: $try" ;;
18892 *) case "$usethreads" in
18893 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18900 *) srandom_r_proto=0
18904 : see if prototype for setresgid is available
18906 set d_sresgproto setresgid $i_unistd unistd.h
18909 : see if prototype for setresuid is available
18911 set d_sresuproto setresuid $i_unistd unistd.h
18914 : see if stat exists
18918 : see if sys/stat.h is available
18919 set sys/stat.h i_sysstat
18922 : see if stat knows about block sizes
18924 echo "Checking to see if your struct stat has st_blocks field..." >&4
18925 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18928 : see if this is a sys/vfs.h system
18929 set sys/vfs.h i_sysvfs
18932 : see if this is a sys/statfs.h system
18933 set sys/statfs.h i_sysstatfs
18936 : Check for statfs_s
18938 echo "Checking to see if your system supports struct statfs..." >&4
18939 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
18941 case "$d_statfs_s" in
18942 "$define") echo "Yes, it does." ;;
18943 *) echo "No, it doesn't." ;;
18947 : see if struct statfs knows about f_flags
18948 case "$d_statfs_s" in
18951 echo "Checking to see if your struct statfs has f_flags field..." >&4
18952 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
18956 set d_statfs_f_flags
18960 case "$d_statfs_f_flags" in
18961 "$define") echo "Yes, it does." ;;
18962 *) echo "No, it doesn't." ;;
18965 : see what flavor, if any, of static inline is supported
18967 echo "Checking to see if your system supports static inline..."
18968 $cat > try.c <<'EOCP'
18969 #include <stdlib.h>
18970 extern int f_via_a(int x);
18971 extern int f_via_b(int x);
18972 int main(int argc, char **argv)
18981 return EXIT_SUCCESS;
18984 return EXIT_FAILURE;
18988 $cat > a.c <<'EOCP'
18989 static INLINE int f(int x) {
19000 $cat > b.c <<'EOCP'
19001 extern int f(int x);
19009 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19010 case "$perl_static_inline" in
19011 '') # Check the various possibilities, and break out on success.
19012 # For gcc, prefer __inline__, which will still permit
19013 # cflags.SH to add in -ansi.
19014 case "$gccversion" in
19015 '') xxx="inline __inline__ __inline _inline";;
19016 *) xxx="__inline__ inline __inline _inline";;
19018 for inline in $xxx; do
19019 set try -DINLINE=$inline a.c
19020 if eval $compile && $run ./try; then
19021 # Now make sure there is no external linkage of static
19023 set try -DINLINE=$inline -DUSE_B a.c b.c
19024 if eval $compile && $run ./try; then
19025 $echo "Your compiler supports static $inline, " >&4
19026 $echo "but it also creates an external definition," >&4
19027 $echo "so I won't use it." >&4
19030 $echo "Your compiler supports static $inline." >&4
19032 perl_static_inline="static $inline";
19036 $echo "Your compiler does NOT support static $inline." >&4
19041 *inline*) # Some variant of inline exists.
19042 echo "Keeping your $hint value of $perl_static_inline."
19045 static) # No inline capabilities
19046 echo "Keeping your $hint value of $perl_static_inline."
19049 *) # Unrecognized previous value -- blindly trust the supplied
19050 # value and hope it makes sense. Use old value for
19051 # d_static_inline, if there is one.
19052 echo "Keeping your $hint value of $perl_static_inline."
19053 case "$d_static_inline" in
19055 *) val=$d_static_inline ;;
19059 # Fallback to plain 'static' if nothing worked.
19060 case "$perl_static_inline" in
19062 perl_static_inline="static"
19066 set d_static_inline
19068 $rm -f a.[co] b.[co]
19071 : Check stream access
19073 Checking how to access stdio streams by file descriptor number...
19075 case "$stdio_stream_array" in
19076 '') $cat >try.c <<EOCP
19079 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19083 for s in _iob __iob __sF
19085 set try -DSTDIO_STREAM_ARRAY=$s
19086 if eval $compile; then
19087 case "`$run ./try`" in
19088 yes) stdio_stream_array=$s; break ;;
19094 case "$stdio_stream_array" in
19096 I can't figure out how to access stdio streams by file descriptor number.
19098 d_stdio_stream_array="$undef"
19101 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19103 d_stdio_stream_array="$define"
19107 : see if strcoll exists
19108 set strcoll d_strcoll
19111 : check for structure copying
19113 echo "Checking to see if your C compiler can copy structs..." >&4
19114 $cat >try.c <<'EOCP'
19124 if $cc -c try.c >/dev/null 2>&1 ; then
19126 echo "Yup, it can."
19129 echo "Nope, it can't."
19135 : see if strerror and/or sys_errlist[] exist
19137 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19138 if set strerror val -f d_strerror; eval $csym; $val; then
19139 echo 'strerror() found.' >&4
19140 d_strerror="$define"
19141 d_strerrm='strerror(e)'
19142 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19143 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19144 d_syserrlst="$define"
19146 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19147 d_syserrlst="$undef"
19149 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19150 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19151 echo 'strerror() found in string header.' >&4
19152 d_strerror="$define"
19153 d_strerrm='strerror(e)'
19154 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19155 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19156 d_syserrlst="$define"
19158 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19159 d_syserrlst="$undef"
19161 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19162 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19163 d_strerror="$undef"
19164 d_syserrlst="$define"
19165 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19167 echo 'strerror() and sys_errlist[] NOT found.' >&4
19168 d_strerror="$undef"
19169 d_syserrlst="$undef"
19170 d_strerrm='"unknown"'
19174 : see if strerror_r exists
19175 set strerror_r d_strerror_r
19177 case "$d_strerror_r" in
19179 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19180 case "$d_strerror_r_proto:$usethreads" in
19181 ":define") d_strerror_r_proto=define
19182 set d_strerror_r_proto strerror_r $hdrs
19186 case "$d_strerror_r_proto" in
19188 case "$strerror_r_proto" in
19189 ''|0) try='int strerror_r(int, char*, size_t);'
19190 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19192 case "$strerror_r_proto" in
19193 ''|0) try='int strerror_r(int, char*, int);'
19194 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19196 case "$strerror_r_proto" in
19197 ''|0) try='char* strerror_r(int, char*, size_t);'
19198 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19200 case "$strerror_r_proto" in
19201 ''|0) d_strerror_r=undef
19203 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19204 * ) case "$strerror_r_proto" in
19205 REENTRANT_PROTO*) ;;
19206 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19208 echo "Prototype: $try" ;;
19211 *) case "$usethreads" in
19212 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19219 *) strerror_r_proto=0
19223 : see if strftime exists
19224 set strftime d_strftime
19227 : see if strlcat exists
19228 set strlcat d_strlcat
19231 : see if strlcpy exists
19232 set strlcpy d_strlcpy
19235 : see if strtod exists
19236 set strtod d_strtod
19239 : see if strtol exists
19240 set strtol d_strtol
19243 : see if strtold exists
19244 set strtold d_strtold
19247 : see if strtoll exists
19248 set strtoll d_strtoll
19251 case "$d_longlong-$d_strtoll" in
19254 Checking whether your strtoll() works okay...
19256 $cat >try.c <<'EOCP'
19259 #define strtoll __strtoll
19262 #define strtoll _strtoll
19265 extern long long int strtoll(char *s, char **, int);
19266 static int bad = 0;
19267 int check(char *s, long long ell, int een) {
19270 gll = strtoll(s, 0, 10);
19271 if (!((gll == ell) && (errno == een)))
19275 check(" 1", 1LL, 0);
19276 check(" 0", 0LL, 0);
19277 check("-1", -1LL, 0);
19278 check("-9223372036854775808", -9223372036854775808LL, 0);
19279 check("-9223372036854775808", -9223372036854775808LL, 0);
19280 check(" 9223372036854775807", 9223372036854775807LL, 0);
19281 check("-9223372036854775808", -9223372036854775808LL, 0);
19282 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19283 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19289 if eval $compile; then
19292 ok) echo "Your strtoll() seems to be working okay." ;;
19294 Your strtoll() doesn't seem to be working okay.
19300 echo "(I can't seem to compile the test program--assuming it doesn't)"
19306 : see if strtoq exists
19307 set strtoq d_strtoq
19310 : see if strtoul exists
19311 set strtoul d_strtoul
19314 case "$d_strtoul" in
19317 Checking whether your strtoul() works okay...
19319 $cat >try.c <<'EOCP'
19322 extern unsigned long int strtoul(char *s, char **, int);
19323 static int bad = 0;
19324 void check(char *s, unsigned long eul, int een) {
19327 gul = strtoul(s, 0, 10);
19328 if (!((gul == eul) && (errno == een)))
19332 check(" 1", 1L, 0);
19333 check(" 0", 0L, 0);
19335 case "$longsize" in
19337 $cat >>try.c <<'EOCP'
19338 check("18446744073709551615", 18446744073709551615UL, 0);
19339 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19340 #if 0 /* strtoul() for /^-/ strings is undefined. */
19341 check("-1", 18446744073709551615UL, 0);
19342 check("-18446744073709551614", 2, 0);
19343 check("-18446744073709551615", 1, 0);
19344 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19345 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19350 $cat >>try.c <<'EOCP'
19351 check("4294967295", 4294967295UL, 0);
19352 check("4294967296", 4294967295UL, ERANGE);
19353 #if 0 /* strtoul() for /^-/ strings is undefined. */
19354 check("-1", 4294967295UL, 0);
19355 check("-4294967294", 2, 0);
19356 check("-4294967295", 1, 0);
19357 check("-4294967296", 4294967295UL, ERANGE);
19358 check("-4294967297", 4294967295UL, ERANGE);
19363 : Should we write these tests to be more portable by sprintf-ing
19364 : ~0 and then manipulating that char string as input for strtol?
19367 $cat >>try.c <<'EOCP'
19374 if eval $compile; then
19375 case "`$run ./try`" in
19376 ok) echo "Your strtoul() seems to be working okay." ;;
19378 Your strtoul() doesn't seem to be working okay.
19384 echo "(I can't seem to compile the test program--assuming it doesn't)"
19390 : see if strtoull exists
19391 set strtoull d_strtoull
19394 case "$d_longlong-$d_strtoull" in
19397 Checking whether your strtoull() works okay...
19399 $cat >try.c <<'EOCP'
19402 #define strtoull __strtoull
19405 extern unsigned long long int strtoull(char *s, char **, int);
19406 static int bad = 0;
19407 int check(char *s, long long eull, int een) {
19410 gull = strtoull(s, 0, 10);
19411 if (!((gull == eull) && (errno == een)))
19415 check(" 1", 1LL, 0);
19416 check(" 0", 0LL, 0);
19417 check("18446744073709551615", 18446744073709551615ULL, 0);
19418 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19419 #if 0 /* strtoull() for /^-/ strings is undefined. */
19420 check("-1", 18446744073709551615ULL, 0);
19421 check("-18446744073709551614", 2LL, 0);
19422 check("-18446744073709551615", 1LL, 0);
19423 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19424 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19431 if eval $compile; then
19432 case "`$run ./try`" in
19433 ok) echo "Your strtoull() seems to be working okay." ;;
19435 Your strtoull() doesn't seem to be working okay.
19437 d_strtoull="$undef"
19441 echo "(I can't seem to compile the test program--assuming it doesn't)"
19442 d_strtoull="$undef"
19447 : see if strtouq exists
19448 set strtouq d_strtouq
19451 case "$d_strtouq" in
19454 Checking whether your strtouq() works okay...
19456 $cat >try.c <<'EOCP'
19459 extern unsigned long long int strtouq(char *s, char **, int);
19460 static int bad = 0;
19461 void check(char *s, unsigned long long eull, int een) {
19462 unsigned long long gull;
19464 gull = strtouq(s, 0, 10);
19465 if (!((gull == eull) && (errno == een)))
19469 check(" 1", 1LL, 0);
19470 check(" 0", 0LL, 0);
19471 check("18446744073709551615", 18446744073709551615ULL, 0);
19472 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19473 #if 0 /* strtouq() for /^-/ strings is undefined. */
19474 check("-1", 18446744073709551615ULL, 0);
19475 check("-18446744073709551614", 2LL, 0);
19476 check("-18446744073709551615", 1LL, 0);
19477 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19478 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19486 if eval $compile; then
19487 case "`$run ./try`" in
19488 ok) echo "Your strtouq() seems to be working okay." ;;
19490 Your strtouq() doesn't seem to be working okay.
19496 echo "(I can't seem to compile the test program--assuming it doesn't)"
19502 : see if strxfrm exists
19503 set strxfrm d_strxfrm
19506 : see if symlink exists
19507 set symlink d_symlink
19510 : see if syscall exists
19511 set syscall d_syscall
19514 : see if prototype for syscall is available
19516 set d_syscallproto syscall $i_unistd unistd.h
19519 : see if sysconf exists
19520 set sysconf d_sysconf
19523 : see if system exists
19524 set system d_system
19527 : see if tcgetpgrp exists
19528 set tcgetpgrp d_tcgetpgrp
19531 : see if tcsetpgrp exists
19532 set tcsetpgrp d_tcsetpgrp
19535 : see if prototype for telldir is available
19537 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19540 : see if tgamma exists
19541 set tgamma d_tgamma
19544 : see if time exists
19546 if test "X$d_time" = X -o X"$timetype" = X; then
19547 if set time val -f d_time; eval $csym; $val; then
19548 echo 'time() found.' >&4
19550 rp="What is the type returned by time() on this system?"
19551 set time_t timetype long stdio.h sys/types.h
19554 echo 'time() not found, hope that will do.' >&4
19562 : see if timegm exists
19563 set timegm d_timegm
19566 : see if this is a sys/times.h system
19567 set sys/times.h i_systimes
19570 : see if times exists
19572 if set times val -f d_times; eval $csym; $val; then
19573 echo 'times() found.' >&4
19576 case "$i_systimes" in
19577 "$define") inc='sys/times.h';;
19579 rp="What is the type returned by times() on this system?"
19580 set clock_t clocktype long stdio.h sys/types.h $inc
19583 echo 'times() NOT found, hope that will do.' >&4
19588 : see if tmpnam_r exists
19589 set tmpnam_r d_tmpnam_r
19591 case "$d_tmpnam_r" in
19593 hdrs="$i_systypes sys/types.h define stdio.h "
19594 case "$d_tmpnam_r_proto:$usethreads" in
19595 ":define") d_tmpnam_r_proto=define
19596 set d_tmpnam_r_proto tmpnam_r $hdrs
19600 case "$d_tmpnam_r_proto" in
19602 case "$tmpnam_r_proto" in
19603 ''|0) try='char* tmpnam_r(char*);'
19604 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19606 case "$tmpnam_r_proto" in
19607 ''|0) d_tmpnam_r=undef
19609 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19610 * ) case "$tmpnam_r_proto" in
19611 REENTRANT_PROTO*) ;;
19612 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19614 echo "Prototype: $try" ;;
19617 *) case "$usethreads" in
19618 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19625 *) tmpnam_r_proto=0
19629 : see if trunc exists
19633 : see if truncate exists
19634 set truncate d_truncate
19637 : see if ttyname_r exists
19638 set ttyname_r d_ttyname_r
19640 case "$d_ttyname_r" in
19642 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19643 case "$d_ttyname_r_proto:$usethreads" in
19644 ":define") d_ttyname_r_proto=define
19645 set d_ttyname_r_proto ttyname_r $hdrs
19649 case "$d_ttyname_r_proto" in
19651 case "$ttyname_r_proto" in
19652 ''|0) try='int ttyname_r(int, char*, size_t);'
19653 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19655 case "$ttyname_r_proto" in
19656 ''|0) try='int ttyname_r(int, char*, int);'
19657 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19659 case "$ttyname_r_proto" in
19660 ''|0) try='char* ttyname_r(int, char*, int);'
19661 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19663 case "$ttyname_r_proto" in
19664 ''|0) d_ttyname_r=undef
19666 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19667 * ) case "$ttyname_r_proto" in
19668 REENTRANT_PROTO*) ;;
19669 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19671 echo "Prototype: $try" ;;
19674 *) case "$usethreads" in
19675 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19682 *) ttyname_r_proto=0
19686 : see if tzname[] exists
19688 if set tzname val -a d_tzname; eval $csym; $val; then
19690 echo 'tzname[] found.' >&4
19693 echo 'tzname[] NOT found.' >&4
19698 : Check if is a multiplatform env
19700 darwin) multiarch="$define" ;;
19702 case "$multiarch" in
19703 ''|[nN]*) multiarch="$undef" ;;
19706 : check for ordering of bytes in a UV
19708 case "$multiarch" in
19711 You seem to be doing a multiarchitecture build,
19712 skipping the byteorder check.
19718 case "$byteorder" in
19721 In the following, larger digits indicate more significance. A big-endian
19722 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19723 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19724 machines may have weird orders like 3412. A Cray will report 87654321,
19725 an Alpha will report 12345678. If the test program works the default is
19727 I'm now running the test program...
19731 #$i_stdlib I_STDLIB
19733 #include <stdlib.h>
19735 #include <sys/types.h>
19736 typedef $uvtype UV;
19746 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19748 u.l = (UV)0x04030201;
19749 for (i = 0; i < $uvsize; i++)
19750 printf("%c", u.c[i]+'0');
19757 if eval $compile && $run ./try > /dev/null; then
19760 [1-4][1-4][1-4][1-4]|12345678|87654321)
19761 echo "(The test program ran ok.)"
19762 echo "byteorder=$dflt"
19765 ????|????????) echo "(The test program ran ok.)" ;;
19766 *) echo "(The test program didn't run right for some reason.)" ;;
19771 (I can't seem to compile the test program. Guessing big-endian...)
19774 case "$xxx_prompt" in
19776 rp="What is the order of bytes in $uvtype?"
19789 : Checking 32bit alignedness
19792 Checking to see whether you can access character data unalignedly...
19794 case "$d_u32align" in
19795 '') $cat >try.c <<EOCP
19797 #$i_stdlib I_STDLIB
19799 #include <stdlib.h>
19801 #define U32 $u32type
19802 #define BYTEORDER 0x$byteorder
19804 #include <signal.h>
19806 $signal_t bletch(int s) { exit(4); }
19809 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19810 volatile U8 buf[8];
19814 if (sizeof(U32) != 4) {
19815 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19822 signal(SIGBUS, bletch);
19834 for (i = 0; i < 4; i++) {
19835 up = (U32*)(buf + i);
19836 if (! ((*up == 1 << (8*i)) || /* big-endian */
19837 (*up == 1 << (8*(3-i))) /* little-endian */
19841 printf("read failed (%x)\n", *up);
19847 for (i = 0; i < 4; i++) {
19848 up = (U32*)(buf + i);
19850 if (*up != 0xBeef) {
19851 printf("write failed (%x)\n", *up);
19865 if eval $compile_ok; then
19866 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19867 $run ./try 2>&1 >/dev/null
19870 You can access character data pretty unalignedly.
19872 d_u32align="$undef"
19875 It seems that you must access character data in an aligned manner.
19877 d_u32align="$define"
19881 rp='Can you access character data at unaligned addresses?'
19885 [yY]*) d_u32align="$undef" ;;
19886 *) d_u32align="$define" ;;
19893 : see if ualarm exists
19894 set ualarm d_ualarm
19897 : see if umask exists
19901 : see if unordered exists
19902 set unordered d_unordered
19905 : see if unsetenv exists
19906 set unsetenv d_unsetenv
19909 : see if usleep exists
19910 set usleep d_usleep
19913 : see if prototype for usleep is available
19915 set d_usleepproto usleep $i_unistd unistd.h
19918 : see if ustat exists
19922 : see if closedir exists
19923 set closedir d_closedir
19926 case "$d_closedir" in
19929 echo "Checking whether closedir() returns a status..." >&4
19931 #$i_dirent I_DIRENT /**/
19932 #$i_sysdir I_SYS_DIR /**/
19933 #$i_sysndir I_SYS_NDIR /**/
19934 #$i_systypes I_SYS_TYPES /**/
19936 #if defined(I_SYS_TYPES)
19937 #include <sys/types.h>
19939 #if defined(I_DIRENT)
19940 #include <dirent.h>
19943 #include <sys/ndir.h>
19947 #include <ndir.h> /* may be wrong in the future */
19949 #include <sys/dir.h>
19954 int main() { return closedir(opendir(".")); }
19957 if eval $compile_ok; then
19958 if $run ./try > /dev/null 2>&1 ; then
19959 echo "Yes, it does."
19962 echo "No, it doesn't."
19966 echo "(I can't seem to compile the test program--assuming it doesn't)"
19974 set d_void_closedir
19978 : see if there is a wait4
19982 : see if waitpid exists
19983 set waitpid d_waitpid
19988 $cat >try.c <<'EOCP'
19994 return (wcscmp (s, s) ? 1 : 0);
19999 if eval $compile; then
20002 0) echo "A working wcscmp() found." >&4
20004 *) echo "wcscmp() found, but it doesn't work" >&4
20008 echo "wcscmp() NOT found." >&4
20014 : see if wcstombs exists
20015 set wcstombs d_wcstombs
20020 $cat >try.c <<'EOCP'
20025 wchar_t dst[4], *src = L" ";
20027 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20032 if eval $compile; then
20035 0) echo "A working wcsxfrm() found." >&4
20037 *) echo "wcsxfrm() found, but it doesn't work" >&4
20041 echo "wcsxfrm() NOT found." >&4
20047 : see if wctomb exists
20048 set wctomb d_wctomb
20051 : see if writev exists
20052 set writev d_writev
20055 : check for alignment requirements
20057 case "$alignbytes" in
20058 '') echo "Checking alignment constraints..." >&4
20059 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20060 $cat >try.c <<'EOCP'
20061 typedef long double NV;
20064 $cat >try.c <<'EOCP'
20068 $cat >>try.c <<'EOCP'
20076 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20081 if eval $compile_ok; then
20085 echo "(I can't seem to compile the test program...)"
20087 case "$multiarch" in
20089 : The usual safe value is 8, but Darwin with -Duselongdouble
20090 : needs 16. Hence, we will take 8 as a minimum, but allow
20091 : Configure to pick a larger value if needed.
20092 if $test "$dflt" -lt 8; then
20094 echo "Setting alignment to 8 for multiarch support.">&4
20099 *) dflt="$alignbytes"
20102 rp="Doubles must be aligned on a how-many-byte boundary?"
20107 : set the base revision
20110 : length of character in bytes. Is always 1, otherwise it is not C
20111 : This used to be a test using sizeof
20114 : Check for the number of bits in a character
20115 case "$charbits" in
20116 '') echo "Checking how long a character is (in bits)..." >&4
20123 for (c = 1, n = 0; c; c <<= 1, n++) ;
20124 printf ("%d\n", n);
20129 if eval $compile_ok; then
20133 echo "(I can't seem to compile the test program. Guessing...)"
20140 rp="What is the length of a character (in bits)?"
20144 case "$charbits" in
20147 Your system has an unsigned character size of $charbits bits, which
20148 is rather unusual (normally it is 8 bits). Perl likely will not work
20149 correctly on your system, with subtle bugs in various places.
20151 rp='Do you really want to continue?'
20155 [yY]) echo >&4 "Okay, continuing." ;;
20160 : how do we concatenate cpp tokens here?
20162 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20163 $cat >cpp_stuff.c <<'EOCP'
20164 #define RCAT(a,b)a/**/b
20165 #define ACAT(a,b)a ## b
20169 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20170 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20171 echo "Oh! Smells like ANSI's been here." >&4
20172 echo "We can catify or stringify, separately or together!"
20174 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20175 echo "Ah, yes! The good old days!" >&4
20176 echo "However, in the good old days we don't know how to stringify and"
20177 echo "catify at the same time."
20181 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20182 You're going to have to edit the values of CAT[2-5] in config.h...
20184 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20188 : see if this is a db.h system
20194 : Check db version.
20196 echo "Checking Berkeley DB version ..." >&4
20202 #include <sys/types.h>
20204 #$i_stdlib I_STDLIB
20206 #include <stdlib.h>
20209 int main(int argc, char *argv[])
20211 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20212 int Major, Minor, Patch ;
20213 unsigned long Version ;
20214 (void)db_version(&Major, &Minor, &Patch) ;
20216 printf("%d %d %d %d %d %d\n",
20217 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20218 Major, Minor, Patch);
20221 printf("You have Berkeley DB Version 2 or greater.\n");
20223 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20224 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20225 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20226 Major, Minor, Patch) ;
20228 /* check that db.h & libdb are compatible */
20229 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20230 printf("db.h and libdb are incompatible.\n") ;
20234 printf("db.h and libdb are compatible.\n") ;
20236 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20237 + DB_VERSION_PATCH ;
20239 /* needs to be >= 2.3.4 */
20240 if (Version < 2003004) {
20241 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20242 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20248 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20253 printf("You have Berkeley DB Version 1.\n");
20254 exit(0); /* DB version < 2: the coast is clear. */
20256 exit(1); /* <db.h> not Berkeley DB? */
20262 if eval $compile_ok && $run ./try; then
20263 echo 'Looks OK.' >&4
20265 db_version_major=$1
20266 db_version_minor=$2
20267 db_version_patch=$3
20269 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20273 : Remove db from list of libraries to use
20274 echo "Removing unusable -ldb from library list" >&4
20275 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20278 echo "libs = $libs" >&4
20288 : Check the return type needed for hash
20290 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20296 #include <sys/types.h>
20299 #ifndef DB_VERSION_MAJOR
20300 u_int32_t hash_cb (const void* ptr, size_t size)
20306 info.hash = hash_cb;
20310 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20311 if $contains warning try.out >>/dev/null 2>&1 ; then
20314 db_hashtype='u_int32_t'
20317 : XXX Maybe we should just give up here.
20318 db_hashtype=u_int32_t
20320 echo "Help: I can't seem to compile the db test program." >&4
20321 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20324 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20326 *) db_hashtype=u_int32_t
20331 : Check the return type needed for prefix
20333 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20339 #include <sys/types.h>
20342 #ifndef DB_VERSION_MAJOR
20343 size_t prefix_cb (const DBT *key1, const DBT *key2)
20349 info.prefix = prefix_cb;
20353 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20354 if $contains warning try.out >>/dev/null 2>&1 ; then
20355 db_prefixtype='int'
20357 db_prefixtype='size_t'
20360 db_prefixtype='size_t'
20361 : XXX Maybe we should just give up here.
20363 echo "Help: I can't seem to compile the db test program." >&4
20364 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20367 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20369 *) db_prefixtype='size_t'
20373 : Check what kind of inf/nan your system has
20374 $echo "Checking the kind of infinities and nans you have..." >&4
20376 #define DOUBLESIZE $doublesize
20377 #$d_longdbl HAS_LONG_DOUBLE
20378 #ifdef HAS_LONG_DOUBLE
20379 #define LONGDBLSIZE $longdblsize
20380 #define LONGDBLKIND $longdblkind
20387 /* Note that whether the sign bit is on or off
20388 * for NaN depends on the CPU/FPU, and possibly
20389 * can be affected by the build toolchain.
20391 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20392 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20393 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20394 * (respectively) as opposed to the more usual
20395 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20397 static void bytes(unsigned char *p, unsigned int n) {
20399 for (i = 0; i < n; i++) {
20400 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20403 int main(int argc, char *argv[]) {
20404 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20405 * because some compilers are 'smart' and not only warn but refuse to
20406 * compile such 'illegal' values. */
20407 double dinf = exp(1e9);
20408 double dnan = sqrt(-1.0);
20409 #ifdef HAS_LONG_DOUBLE
20410 long double ldinf = (long double)exp(1e9);
20411 long double ldnan = (long double)sqrt(-1.0);
20414 switch (argv[1][0]) {
20415 case '1': bytes(&dinf, sizeof(dinf)); break;
20416 case '2': bytes(&dnan, sizeof(dnan)); break;
20417 #ifdef HAS_LONG_DOUBLE
20418 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20419 /* the 80-bit long doubles might have garbage in their excess bytes */
20420 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20422 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20423 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20431 if eval $compile; then
20432 doubleinfbytes=`$run ./try 1`
20433 doublenanbytes=`$run ./try 2`
20434 case "$d_longdbl" in
20436 longdblinfbytes=`$run ./try 3`
20437 longdblnanbytes=`$run ./try 4`
20441 # Defaults in case the above test program failed.
20442 case "$doublekind" in
20443 1) # IEEE 754 32-bit LE
20444 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20445 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20447 2) # IEEE 754 32-bit BE
20448 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20449 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20451 3) # IEEE 754 64-bit LE
20452 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20453 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20455 4) # IEEE 754 64-bit BE
20456 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20457 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20459 5) # IEEE 754 128-bit LE
20460 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20461 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20463 6) # IEEE 754 128-bit BE
20464 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20465 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20467 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20468 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20469 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20471 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20472 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20473 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20476 doubleinfbytes=$undef
20477 doublenanbytes=$undef
20480 case "$longdblkind" in
20481 1) # IEEE 754 128-bit LE
20482 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20483 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20485 2) # IEEE 754 128-bit BE
20486 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20487 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20489 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20490 case "$longdblsize" in
20491 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20492 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20493 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20496 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20497 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20500 longdblinfbytes=$undef
20501 longdblnanbytes=$undef
20505 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20506 case "$longdblsize" in
20507 12) # 32-bit system
20508 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20509 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20511 16) # 64-bit system
20512 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20513 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20516 longdblinfbytes=$undef
20517 longdblnanbytes=$undef
20521 5) # 128-bit LE "double double"
20522 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20523 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20525 6) # 128-bit BE "double double"
20526 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20527 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20530 longdblinfbytes=$undef
20531 longdblnanbytes=$undef
20537 : Check the length of the double mantissa
20538 $echo "Checking how many mantissa bits your doubles have..." >&4
20541 #$i_sunmath I_SUNMATH
20543 # include <float.h>
20546 # include <sunmath.h>
20548 #ifdef DBL_MANT_DIG
20549 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20552 int main(int argc, char *argv[]) {
20554 printf("%d\n", BITS);
20560 if eval $compile; then
20561 doublemantbits=`$run ./try`
20563 doublemantbits="$undef"
20567 : Check the length of the longdouble mantissa
20568 $echo "Checking how many mantissa bits your long doubles have..." >&4
20571 #$i_sunmath I_SUNMATH
20573 # include <float.h>
20576 # include <sunmath.h>
20578 #$d_longdbl HAS_LONG_DOUBLE
20579 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20580 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20581 /* This format has no implicit bit. Beware, however, that for
20582 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20583 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20584 * and the top bit must have been one since 387, zero is plain invalid.
20585 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20586 # define BITS LDBL_MANT_DIG
20587 # elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
20588 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20589 * reason e.g. Irix thinks 107. But in any case, we want only
20590 * the number of real bits, the implicit bits are of no interest. */
20591 # define BITS 2 * (DBL_MANT_DIG - 1)
20593 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20597 int main(int argc, char *argv[]) {
20599 printf("%d\n", BITS);
20605 if eval $compile; then
20606 longdblmantbits=`$run ./try`
20608 longdblmantbits="$undef"
20612 : Check the length of the NV mantissa
20613 $echo "Checking how many mantissa bits your NVs have..." >&4
20614 if test "X$usequadmath" = "X$define"; then
20615 nvmantbits=112 # 128-1-15
20617 if test "X$nvsize" = "X$doublesize"; then
20618 nvmantbits="$doublemantbits"
20620 if test "X$nvsize" = "X$longdblsize"; then
20621 nvmantbits="$longdblmantbits"
20623 nvmantbits="$undef"
20628 : How can we generate normalized random numbers ?
20630 echo "Using our internal random number implementation..." >&4
20633 *-Dmy_rand=*|*-Dmy_srand=*)
20634 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20635 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20636 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20637 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20641 randfunc=Perl_drand48
20642 drand01="Perl_drand48()"
20643 seedfunc="Perl_drand48_init"
20647 : Determine if this is an EBCDIC system
20649 echo "Determining whether or not we are on an EBCDIC system..." >&4
20650 $cat >try.c <<'EOM'
20653 if ('M'==0xd4) return 0;
20660 if eval $compile_ok; then
20661 if $run ./try; then
20662 echo "You seem to speak EBCDIC." >&4
20665 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20668 echo "I'm unable to compile the test program." >&4
20669 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20675 : Check how to flush
20678 Checking how to flush all pending stdio output...
20680 # I only know how to find the first 32 possibly open files on SunOS.
20681 # See also hints/sunos_4_1.sh and util.c --AD
20683 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20685 $cat >>try.c <<EOCP
20687 #$i_stdlib I_STDLIB
20689 #include <stdlib.h>
20691 #$i_unistd I_UNISTD
20693 # include <unistd.h>
20695 #$d_sysconf HAS_SYSCONF
20696 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20697 #ifdef HAS_STDIO_STREAM_ARRAY
20698 # define STDIO_STREAM_ARRAY $stdio_stream_array
20703 p = fopen("try.out", "w");
20707 # ifdef TRY_FPRINTF
20711 #ifdef TRY_FFLUSH_NULL
20714 #ifdef TRY_FFLUSH_ALL
20716 long open_max = -1;
20717 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20718 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20720 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20721 open_max = sysconf(_SC_OPEN_MAX);
20724 open_max = FOPEN_MAX;
20727 open_max = OPEN_MAX;
20736 # ifdef HAS_STDIO_STREAM_ARRAY
20737 if (open_max > 0) {
20739 for (i = 0; i < open_max; i++)
20740 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20741 STDIO_STREAM_ARRAY[i]._file < open_max &&
20742 STDIO_STREAM_ARRAY[i]._flag)
20743 fflush(&STDIO_STREAM_ARRAY[i]);
20751 : first we have to find out how _not_ to flush
20753 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20755 set try -DTRY_FPUTC
20756 if eval $compile; then
20757 $run ./try 2>/dev/null
20760 if $test ! -s try.out -a "X$code" = X42; then
20766 set try -DTRY_FPRINTF
20767 if eval $compile; then
20768 $run ./try 2>/dev/null
20771 if $test ! -s try.out -a "X$code" = X42; then
20772 output=-DTRY_FPRINTF
20778 : check for fflush NULL behavior
20779 case "$fflushNULL" in
20780 '') set try -DTRY_FFLUSH_NULL $output
20781 if eval $compile; then
20782 $run ./try 2>/dev/null
20785 if $test -s try.out -a "X$code" = X42; then
20786 fflushNULL="`$cat try.out`"
20788 if $test "X$code" != X42; then
20790 (If this test failed, don't worry, we'll try another method shortly.)
20795 $rm -f core try.core core.try.*
20796 case "$fflushNULL" in
20798 Your fflush(NULL) works okay for output streams.
20799 Let's see if it clobbers input pipes...
20801 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20802 # bug that improperly flushes the input end of pipes. So we avoid the
20803 # autoflush on fork/system/exec support for now. :-(
20804 $cat >tryp.c <<EOCP
20807 main(int argc, char **argv)
20813 while ((i = getc(stdin)) != -1
20814 && (*bp++ = i) != '\n'
20815 && bp < &buf[1024])
20818 fprintf(stdout, "%s", buf);
20826 fflushNULL="$define"
20828 if eval $compile; then
20830 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20831 if $test "X$targethost" != X; then
20834 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20836 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20838 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20840 fflush(NULL) seems to behave okay with input streams.
20842 fflushNULL="$define"
20845 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20847 fflushNULL="$undef"
20850 $rm -f core tryp.c tryp.core core.tryp.*
20853 Your fflush(NULL) isn't working (contrary to ANSI C).
20855 fflushNULL="$undef"
20858 Cannot figure out whether your fflush(NULL) works or not.
20859 I'm assuming it doesn't (contrary to ANSI C).
20861 fflushNULL="$undef"
20865 $define|true|[yY]*)
20866 fflushNULL="$define"
20869 fflushNULL="$undef"
20872 : check explicit looping only if NULL did not work, and if the pipe
20873 : bug does not show up on an explicit flush too
20874 case "$fflushNULL" in
20876 $cat >tryp.c <<EOCP
20879 main(int argc, char **argv)
20885 while ((i = getc(stdin)) != -1
20886 && (*bp++ = i) != '\n'
20887 && bp < &buf[1024])
20890 fprintf(stdout, "%s", buf);
20899 if eval $compile; then
20901 if $test "X$targethost" != X; then
20904 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20906 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20908 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20910 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20912 : now check for fflushall behaviour
20913 case "$fflushall" in
20914 '') set try -DTRY_FFLUSH_ALL $output
20915 if eval $compile; then
20917 (Now testing the other method--but note that this also may fail.)
20919 $run ./try 2>/dev/null
20922 if $test -s try.out -a "X$code" = X42; then
20923 fflushall="`$cat try.out`"
20927 case "$fflushall" in
20929 Whew. Flushing explicitly all the stdio streams works.
20931 fflushall="$define"
20934 Sigh. Flushing explicitly all the stdio streams doesn't work.
20939 Cannot figure out whether flushing stdio streams explicitly works or not.
20940 I'm assuming it doesn't.
20946 "$define"|true|[yY]*)
20947 fflushall="$define"
20955 All is futile. Even fflush(stdin) clobbers input pipes!
20962 $rm -f core tryp.c tryp.core core.tryp.*
20964 *) fflushall="$undef"
20968 case "$fflushNULL$fflushall" in
20971 OK, I give up. I cannot figure out how to flush pending stdio output.
20972 We won't be flushing handles at all before fork/exec/popen.
20978 : Store the full pathname to the ar program for use in the C program
20979 : Respect a hint or command line value for full_ar.
20984 : Store the full pathname to the sed program for use in the C program
20987 : see what type gids are declared as in the kernel
20989 echo "Looking for the type for group ids returned by getgid()."
20990 set gid_t gidtype xxx stdio.h sys/types.h
20994 xxx=`./findhdr sys/user.h`
20995 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20997 unsigned) dflt="$1 $2" ;;
21001 *) dflt="$gidtype";;
21004 gid_t) echo "gid_t found." ;;
21005 *) rp="What is the type for group ids returned by getgid()?"
21011 : Check the size of GID
21014 *_t) zzz="$gidtype" ;;
21017 echo "Checking the size of $zzz..." >&4
21019 #include <sys/types.h>
21021 #$i_stdlib I_STDLIB
21023 #include <stdlib.h>
21026 printf("%d\n", (int)sizeof($gidtype));
21031 if eval $compile_ok; then
21035 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21038 echo "Your $zzz is $gidsize bytes long."
21043 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21047 : Check if GID is signed
21050 *_t) zzz="$gidtype" ;;
21053 echo "Checking the sign of $zzz..." >&4
21055 #include <sys/types.h>
21066 if eval $compile; then
21070 echo "(I can't execute the test program--guessing unsigned.)" >&4
21074 1) echo "Your $zzz is unsigned." ;;
21075 -1) echo "Your $zzz is signed." ;;
21081 echo "(I can't compile the test program--guessing unsigned.)" >&4
21085 : Check 64bit sizes
21088 if $test X"$quadtype" != X; then
21090 echo "Checking how to print 64-bit integers..." >&4
21092 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21093 $cat >try.c <<'EOCP'
21094 #include <sys/types.h>
21097 int q = 12345678901;
21098 printf("%ld\n", q);
21102 if eval $compile; then
21106 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21107 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21108 echo "We will use %d."
21114 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21115 $cat >try.c <<'EOCP'
21116 #include <sys/types.h>
21119 long q = 12345678901;
21120 printf("%ld\n", q);
21124 if eval $compile; then
21128 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21129 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21130 echo "We will use %ld."
21136 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21137 $cat >try.c <<'EOCP'
21138 #include <sys/types.h>
21139 #include <inttypes.h>
21142 int64_t q = 12345678901;
21143 printf("%" PRId64 "\n", q);
21147 if eval $compile; then
21151 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21152 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21153 echo "We will use the C9X style."
21159 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21161 #include <sys/types.h>
21164 $quadtype q = 12345678901;
21165 printf("%Ld\n", q);
21169 if eval $compile; then
21173 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21174 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21175 echo "We will use %Ld."
21181 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21182 $cat >try.c <<'EOCP'
21183 #include <sys/types.h>
21186 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21187 printf("%lld\n", q);
21191 if eval $compile; then
21195 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21196 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21197 echo "We will use the %lld style."
21203 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21205 #include <sys/types.h>
21208 $quadtype q = 12345678901;
21209 printf("%qd\n", q);
21213 if eval $compile; then
21217 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21218 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21219 echo "We will use %qd."
21225 if $test X"$sPRId64" = X; then
21226 echo "Cannot figure out how to print 64-bit integers." >&4
21233 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21234 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21236 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21237 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21241 : Check format strings for internal types
21243 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21245 if $test X"$ivsize" = X8; then
21246 ivdformat="$sPRId64"
21247 uvuformat="$sPRIu64"
21248 uvoformat="$sPRIo64"
21249 uvxformat="$sPRIx64"
21250 uvXUformat="$sPRIXU64"
21252 if $test X"$ivsize" = X"$longsize"; then
21259 if $test X"$ivsize" = X"$intsize"; then
21267 if $test X"$ivsize" = X"$shortsize"; then
21278 if $test X"$usequadmath" = X"$define"; then
21286 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21287 nveformat="$sPRIeldbl"
21288 nvfformat="$sPRIfldbl"
21289 nvgformat="$sPRIgldbl"
21290 nvEUformat="$sPRIEUldbl"
21291 nvFUformat="$sPRIFUldbl"
21292 nvGUformat="$sPRIGUldbl"
21303 case "$ivdformat" in
21304 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21309 : Check format string for GID
21312 $echo "Checking the format string to be used for gids..." >&4
21315 -1) if $test X"$gidsize" = X"$ivsize"; then
21316 gidformat="$ivdformat"
21318 if $test X"$gidsize" = X"$longsize"; then
21321 if $test X"$gidsize" = X"$intsize"; then
21324 if $test X"$gidsize" = X"$shortsize"; then
21331 *) if $test X"$gidsize" = X"$uvsize"; then
21332 gidformat="$uvuformat"
21334 if $test X"$gidsize" = X"$longsize"; then
21337 if $test X"$gidsize" = X"$intsize"; then
21340 if $test X"$gidsize" = X"$shortsize"; then
21349 : see if getgroups exists
21350 set getgroups d_getgrps
21353 : see if setgroups exists
21354 set setgroups d_setgrps
21357 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21359 case "$d_getgrps$d_setgrps" in
21361 case "$groupstype" in
21362 '') dflt="$gidtype" ;;
21363 *) dflt="$groupstype" ;;
21366 What type of pointer is the second argument to getgroups() and setgroups()?
21367 Usually this is the same as group ids, $gidtype, but not always.
21370 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21374 *) groupstype="$gidtype";;
21377 : check whether make sets MAKE
21379 echo "Checking if your $make program sets \$(MAKE)..." >&4
21380 case "$make_set_make" in
21382 $sed 's/^X //' > testmake.mak << 'EOF'
21384 X @echo 'maketemp="$(MAKE)"'
21386 case "`$make -f testmake.mak 2>/dev/null`" in
21387 *maketemp=*) make_set_make='#' ;;
21388 *) make_set_make="MAKE=$make" ;;
21390 $rm -f testmake.mak
21393 case "$make_set_make" in
21394 '#') echo "Yup, it does.";;
21395 *) echo "Nope, it doesn't.";;
21398 : see what type is used for mode_t
21399 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21400 set mode_t modetype int stdio.h sys/types.h
21403 : see if we need va_copy
21405 case "$i_stdarg" in
21408 #include <stdarg.h>
21410 #$i_stdlib I_STDLIB
21412 #include <stdlib.h>
21414 #include <signal.h>
21417 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21419 return vfprintf(f, fmt, *valp);
21423 myvfprintf(FILE *f, const char *fmt, va_list val)
21425 return ivfprintf(f, fmt, &val);
21429 myprintf(char *fmt, ...)
21432 va_start(val, fmt);
21433 return myvfprintf(stdout, fmt, val);
21437 main(int ac, char **av)
21439 signal(SIGSEGV, exit);
21441 myprintf("%s%cs all right, then\n", "that", '\'');
21446 if eval $compile && $run ./try 2>&1 >/dev/null; then
21447 case "`$run ./try`" in
21448 "that's all right, then")
21454 yes) echo "It seems that you don't need va_copy()." >&4
21455 need_va_copy="$undef"
21457 *) echo "It seems that va_copy() or similar will be needed." >&4
21458 need_va_copy="$define"
21463 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21464 need_va_copy="$undef"
21468 : see what type is used for size_t
21469 rp="What is the type used for the length parameter for string functions?"
21470 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21473 : check for type of arguments to gethostbyaddr.
21474 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21475 case "$d_gethbyaddr" in
21479 Checking to see what type of arguments are accepted by gethostbyaddr().
21481 hdrs="$define sys/types.h
21482 $d_socket sys/socket.h
21483 $i_niin netinet/in.h
21485 $i_unistd unistd.h"
21486 : The first arg can 'char *' or 'void *'
21487 : The second arg is some of integral type
21488 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21489 for yyy in size_t long int; do
21490 case "$netdb_host_type" in
21491 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21492 if ./protochk "$try" $hdrs; then
21493 echo "Your system accepts $xxx for the first arg."
21494 echo "...and $yyy for the second arg."
21495 netdb_host_type="$xxx"
21496 netdb_hlen_type="$yyy"
21502 : In case none of those worked, prompt the user.
21503 case "$netdb_host_type" in
21504 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21507 netdb_host_type=$ans
21508 rp='What is the type for the 2nd argument to gethostbyaddr?'
21511 netdb_hlen_type=$ans
21515 *) : no gethostbyaddr, so pick harmless defaults
21516 netdb_host_type='char *'
21517 netdb_hlen_type="$sizetype"
21520 # Remove the "const" if needed. -- but then we'll have a
21522 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21525 : check for type of argument to gethostbyname.
21526 if test "X$netdb_name_type" = X ; then
21527 case "$d_gethbyname" in
21531 Checking to see what type of argument is accepted by gethostbyname().
21533 hdrs="$define sys/types.h
21534 $d_socket sys/socket.h
21535 $i_niin netinet/in.h
21537 $i_unistd unistd.h"
21538 for xxx in "const char *" "char *"; do
21539 case "$netdb_name_type" in
21540 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21541 if ./protochk "$try" $hdrs; then
21542 echo "Your system accepts $xxx."
21543 netdb_name_type="$xxx"
21548 : In case none of those worked, prompt the user.
21549 case "$netdb_name_type" in
21550 '') rp='What is the type for the 1st argument to gethostbyname?'
21553 netdb_name_type=$ans
21557 *) : no gethostbyname, so pick harmless default
21558 netdb_name_type='char *'
21563 : check for type of 1st argument to getnetbyaddr.
21564 if test "X$netdb_net_type" = X ; then
21565 case "$d_getnbyaddr" in
21569 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21571 hdrs="$define sys/types.h
21572 $d_socket sys/socket.h
21573 $i_niin netinet/in.h
21575 $i_unistd unistd.h"
21576 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21577 case "$netdb_net_type" in
21578 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21579 if ./protochk "$try" $hdrs; then
21580 echo "Your system accepts $xxx."
21581 netdb_net_type="$xxx"
21586 : In case none of those worked, prompt the user.
21587 case "$netdb_net_type" in
21588 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21591 netdb_net_type=$ans
21595 *) : no getnetbyaddr, so pick harmless default
21596 netdb_net_type='long'
21600 : locate the preferred pager for this system
21607 [a-zA-Z]:/*) dflt=$pg;;
21611 [a-zA-Z]:/*) dflt=$more;;
21615 [a-zA-Z]:/*) dflt=$less;;
21618 '') dflt=/usr/ucb/more;;
21626 rp='What pager is used on your system?'
21630 : see what type pids are declared as in the kernel
21631 rp="What is the type of process ids on this system?"
21632 set pid_t pidtype int stdio.h sys/types.h
21635 : see if ar generates random libraries by itself
21637 echo "Checking how to generate random libraries on your machine..." >&4
21638 echo 'int bar1() { return bar2(); }' > bar1.c
21639 echo 'int bar2() { return 2; }' > bar2.c
21641 #$i_stdlib I_STDLIB
21643 #include <stdlib.h>
21645 int main() { printf("%d\n", bar1()); exit(0); }
21647 $cc $ccflags -c bar1.c >/dev/null 2>&1
21648 $cc $ccflags -c bar2.c >/dev/null 2>&1
21649 $cc $ccflags -c foo.c >/dev/null 2>&1
21650 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21651 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21652 $run ./foobar >/dev/null 2>&1; then
21653 echo "$ar appears to generate random libraries itself."
21655 if [ "X$ranlib" = "X" ]; then
21658 elif $ar s bar$_a >/dev/null 2>&1 &&
21659 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21660 $run ./foobar >/dev/null 2>&1; then
21661 echo "a table of contents needs to be added with '$ar s'."
21664 elif $ar ts bar$_a >/dev/null 2>&1 &&
21665 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21666 $run ./foobar >/dev/null 2>&1; then
21667 echo "a table of contents needs to be added with '$ar ts'."
21674 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21675 $test -f $ranlib || ranlib=''
21678 if $test -n "$ranlib"; then
21679 echo "your system has '$ranlib'; we'll use that."
21682 echo "your system doesn't seem to support random libraries"
21683 echo "so we'll use lorder and tsort to order the libraries."
21690 : see if this is a values.h system
21691 set values.h i_values
21694 : Check the max offset that gmtime and localtime accept
21695 echo "Checking max offsets that gmtime () accepts"
21698 define) yyy="#include <values.h>" ;;
21702 case "$sGMTIME_min/$sGMTIME_max" in
21705 #include <sys/types.h>
21714 void gm_check (time_t t, int min_year, int max_year)
21717 if ( tmp == NULL ||
21718 /* Check tm_year overflow */
21719 tmp->tm_year < min_year || tmp->tm_year > max_year)
21730 gm_check (MAXLONG, 69, 0x7fffffff);
21732 if (tmp == NULL || tmp->tm_year < 0) {
21733 for (i = 63; i >= 0; i--) {
21734 time_t x = pt | ((time_t)1 << i);
21735 if (x < 0 || x < pt) continue;
21736 gm_check (x, 69, 0x7fffffff);
21739 printf ("sGMTIME_max=%ld\n", pt);
21748 gm_check (MINLONG, -1900, 70);
21751 for (i = 36; i >= 0; i--) {
21752 time_t x = pt - ((time_t)1 << i);
21753 if (x > 0) continue;
21754 gm_check (x, -1900, 70);
21757 printf ("sGMTIME_min=%ld\n", pt);
21761 int main (int argc, char *argv[])
21763 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21770 if eval $compile; then
21771 eval `$run ./try 2>/dev/null`
21773 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21779 echo "Checking max offsets that localtime () accepts"
21781 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21784 #include <sys/types.h>
21793 void local_check (time_t t, int min_year, int max_year)
21795 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21798 tmp = localtime (&t);
21799 if ( tmp == NULL ||
21800 /* Check tm_year overflow */
21801 tmp->tm_year < min_year || tmp->tm_year > max_year)
21805 } /* local_check */
21812 local_check (MAXLONG, 69, 0x7fffffff);
21814 if (tmp == NULL || tmp->tm_year < 0) {
21815 for (i = 63; i >= 0; i--) {
21816 time_t x = pt | ((time_t)1 << i);
21817 if (x < 0 || x < pt) continue;
21818 local_check (x, 69, 0x7fffffff);
21821 printf ("sLOCALTIME_max=%ld\n", pt);
21830 local_check (MINLONG, -1900, 70);
21833 for (i = 36; i >= 0; i--) {
21834 time_t x = pt - ((time_t)1 << i);
21835 if (x > 0) continue;
21836 local_check (x, -1900, 70);
21839 printf ("sLOCALTIME_min=%ld\n", pt);
21843 int main (int argc, char *argv[])
21851 if eval $compile; then
21852 eval `$run ./try 2>/dev/null`
21854 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21860 : check for type of arguments to select.
21861 case "$selecttype" in
21862 '') case "$d_select" in
21866 Checking to see what type of arguments are accepted by select().
21868 hdrs="$define sys/types.h
21869 $i_systime sys/time.h
21870 $i_sysselct sys/select.h
21871 $d_socket sys/socket.h"
21872 : The first arg can be int, unsigned, or size_t
21873 : The last arg may or may not be 'const'
21875 : void pointer has been seen but using that
21876 : breaks the selectminbits test
21877 for xxx in 'fd_set *' 'int *'; do
21878 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21879 for tmo in 'struct timeval *' 'const struct timeval *'; do
21881 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21882 if ./protochk "$try" $hdrs; then
21883 echo "Your system accepts $xxx."
21892 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21893 case "$d_fd_set" in
21894 $define) dflt="fd_set *" ;;
21903 *) : no select, so pick a harmless default
21910 : check for the select 'width'
21911 case "$selectminbits" in
21912 '') safebits=`expr $ptrsize \* 8`
21913 case "$d_select" in
21917 Checking to see on how many bits at a time your select() operates...
21920 #include <sys/types.h>
21922 #$i_systime I_SYS_TIME
21923 #$i_systimek I_SYS_TIME_KERNEL
21928 # ifdef I_SYS_TIME_KERNEL
21931 # include <sys/time.h>
21932 # ifdef I_SYS_TIME_KERNEL
21936 #$i_sysselct I_SYS_SELECT
21937 #ifdef I_SYS_SELECT
21938 #include <sys/select.h>
21940 #$d_socket HAS_SOCKET
21942 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21945 #$i_stdlib I_STDLIB
21947 #include <stdlib.h>
21950 #define S sizeof(*(b))
21952 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21953 #define NBITS (NBYTES * 8)
21955 char *s = (char *)malloc(NBYTES);
21964 fp = fopen("try.c", "r");
21970 b = ($selecttype)s;
21971 for (i = 0; i < NBITS; i++)
21975 select(fd + 1, b, 0, 0, &t);
21976 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21978 printf("%d\n", i + 1);
21983 if eval $compile_ok; then
21984 selectminbits=`$run ./try 2>/dev/null`
21985 case "$selectminbits" in
21987 Cannot figure out on how many bits at a time your select() operates.
21988 I'll play safe and guess it is $safebits bits.
21990 selectminbits=$safebits
21991 bits="$safebits bits"
21994 *) bits="$selectminbits bits" ;;
21996 echo "Your select() operates on $bits at a time." >&4
21998 rp='What is the minimum number of bits your select() operates on?'
21999 case "$byteorder" in
22000 12345678) dflt=64 ;;
22006 selectminbits="$val"
22010 *) : no select, so pick a harmless default
22011 selectminbits=$safebits
22017 : Trace out the files included by signal.h, then look for SIGxxx names.
22018 case "$sig_num_init" in
22020 if [ "X$fieldn" = X ]; then
22021 : Just make some guesses. We check them later.
22022 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22024 xxx=`echo '#include <signal.h>' |
22025 $cppstdin $cppminus $cppflags 2>/dev/null |
22026 $grep '^[ ]*#.*include' |
22027 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22028 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22031 for xx in $xxx /dev/null ; do
22032 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22034 case "$xxxfiles" in
22035 '') xxxfiles=`./findhdr signal.h` ;;
22038 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22039 print substr($2, 4, 20)
22041 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22042 print substr($3, 4, 20)
22044 : Append some common names just in case the awk scan failed.
22045 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22046 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22047 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22048 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22049 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22051 : generate a few handy files for later
22052 $cat > signal.c <<EOCP
22053 #include <sys/types.h>
22054 #include <signal.h>
22055 #$i_stdlib I_STDLIB
22057 #include <stdlib.h>
22062 /* Strange style to avoid deeply-nested #if/#else/#endif */
22065 # define NSIG (_NSIG)
22071 # define NSIG (SIGMAX+1)
22077 # define NSIG (SIG_MAX+1)
22083 # define NSIG (_SIG_MAX+1)
22089 # define NSIG (MAXSIG+1)
22095 # define NSIG (MAX_SIG+1)
22100 # ifdef SIGARRAYSIZE
22101 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22107 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22111 /* Default to some arbitrary number that's big enough to get most
22112 of the common signals.
22118 printf("NSIG %d\n", NSIG);
22124 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22126 printf "#ifdef SIG"; printf $1; printf "\n"
22127 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22128 printf $1; printf ");\n"
22132 printf "#endif /* JUST_NSIG */\n";
22133 printf "exit(0);\n}\n";
22136 $cat >signal.awk <<'EOP'
22137 BEGIN { ndups = 0 }
22138 $1 ~ /^NSIG$/ { nsig = $2 }
22139 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22140 if ($2 > maxsig) { maxsig = $2 }
22141 if (sig_name[$2]) {
22142 dup_name[ndups] = $1
22143 dup_num[ndups] = $2
22155 printf("NSIG %d\n", nsig);
22156 for (n = 1; n < nsig; n++) {
22158 printf("%s %d\n", sig_name[n], sig_num[n])
22161 printf("NUM%d %d\n", n, n)
22164 for (n = 0; n < ndups; n++) {
22165 printf("%s %d\n", dup_name[n], dup_num[n])
22169 $cat >signal_cmd <<EOS
22171 if $test -s signal.lst; then
22172 echo "Using your existing signal.lst file"
22177 $cat >>signal_cmd <<'EOS'
22180 if eval $compile_ok; then
22181 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22182 $uniq | $awk -f signal.awk >signal.lst
22184 echo "(I can't seem be able to compile the whole test program)" >&4
22185 echo "(I'll try it in little pieces.)" >&4
22186 set signal -DJUST_NSIG
22187 if eval $compile_ok; then
22188 $run ./signal$_exe > signal.nsg
22191 echo "I can't seem to figure out how many signals you have." >&4
22192 echo "Guessing 50." >&4
22193 echo 'NSIG 50' > signal.nsg
22195 : Now look at all the signal names, one at a time.
22196 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22197 $cat > signal.c <<EOCP
22198 #include <sys/types.h>
22199 #include <signal.h>
22202 printf("$xx %d\n", SIG${xx});
22207 if eval $compile; then
22208 echo "SIG${xx} found."
22209 $run ./signal$_exe >> signal.ls1
22211 echo "SIG${xx} NOT found."
22214 if $test -s signal.ls1; then
22215 $cat signal.nsg signal.ls1 |
22216 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22220 if $test -s signal.lst; then
22223 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22224 echo 'kill -l' >signal
22225 set X `csh -f <signal`
22229 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22231 echo $@ | $tr ' ' $trnl | \
22232 $awk '{ printf "%s %d\n", $1, ++s; }
22233 END { printf "NSIG %d\n", ++s }' >signal.lst
22235 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22237 chmod a+x signal_cmd
22238 $eunicefix signal_cmd
22240 : generate list of signal names
22242 case "$sig_name_init" in
22244 *) case "$sig_num_init" in
22245 ''|*,*) doinit=yes ;;
22250 echo "Generating a list of signal names and numbers..." >&4
22252 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22253 sig_name=`$awk 'BEGIN { printf "ZERO " }
22254 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22255 sig_num=`$awk 'BEGIN { printf "0 " }
22256 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22257 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22258 !/^NSIG/ { printf "\"%s\", ", $1 }
22259 END { printf "0\n" }' signal.lst`
22260 sig_num_init=`$awk 'BEGIN { printf "0, " }
22261 !/^NSIG/ { printf "%d, ", $2}
22262 END { printf "0\n"}' signal.lst`
22265 echo "The following $sig_count signals are available:"
22267 echo $sig_name | $awk \
22268 'BEGIN { linelen = 0 }
22270 for (i = 1; i <= NF; i++) {
22271 name = "SIG" $i " "
22272 linelen = linelen + length(name)
22273 if (linelen > 70) {
22275 linelen = length(name)
22281 sig_size=`echo $sig_name | awk '{print NF}'`
22282 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22286 : Check size of size
22288 case "$sizetype" in
22289 *_t) zzz="$sizetype" ;;
22290 *) zzz="filesize" ;;
22292 echo "Checking the size of $zzz..." >&4
22294 #include <sys/types.h>
22296 #$i_stdlib I_STDLIB
22298 #include <stdlib.h>
22301 printf("%d\n", (int)sizeof($sizetype));
22306 if eval $compile_ok; then
22310 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22313 echo "Your $zzz size is $sizesize bytes."
22318 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22322 : check for socklen_t
22324 echo "Checking to see if you have socklen_t..." >&4
22326 #include <sys/types.h>
22327 #$d_socket HAS_SOCKET
22329 #include <sys/socket.h>
22331 int main() { socklen_t x = 16; }
22334 if eval $compile; then
22336 echo "You have socklen_t."
22339 echo "You do not have socklen_t."
22340 case "$sizetype" in
22341 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22348 : see if this is a socks.h system
22349 set socks.h i_socks
22352 : check for type of the size argument to socket calls
22353 case "$d_socket" in
22357 Checking to see what type is the last argument of accept().
22360 case "$d_socklen_t" in
22361 "$define") yyy="$yyy socklen_t"
22363 yyy="$yyy $sizetype int long unsigned"
22364 for xxx in $yyy; do
22365 case "$socksizetype" in
22366 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22367 case "$usesocks" in
22369 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22370 echo "Your system accepts '$xxx *' for the last argument of accept()."
22371 socksizetype="$xxx"
22374 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22375 echo "Your system accepts '$xxx *' for the last argument of accept()."
22376 socksizetype="$xxx"
22383 : In case none of those worked, prompt the user.
22384 case "$socksizetype" in
22385 '') rp='What is the type for socket address structure sizes?'
22392 *) : no sockets, so pick relatively harmless default
22397 : see what type is used for signed size_t
22398 set ssize_t ssizetype int stdio.h sys/types.h
22403 #$i_stdlib I_STDLIB
22405 #include <stdlib.h>
22407 #include <sys/types.h>
22408 #define Size_t $sizetype
22409 #define SSize_t $dflt
22412 if (sizeof(Size_t) == sizeof(SSize_t))
22414 else if (sizeof(Size_t) == sizeof(int))
22423 if eval $compile_ok && $run ./try > /dev/null; then
22424 ssizetype=`$run ./try`
22425 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22428 Help! I can't compile and run the ssize_t test program: please enlighten me!
22429 (This is probably a misconfiguration in your system or libraries, and
22430 you really ought to fix it. Still, I'll try anyway.)
22432 I need a type that is the same size as $sizetype, but is guaranteed to
22433 be signed. Common values are ssize_t, int and long.
22436 rp="What signed type is the same size as $sizetype?"
22442 : Check the size of st_ino
22444 $echo "Checking the size of st_ino..." >&4
22445 $cat > try.c <<EOCP
22446 #include <sys/stat.h>
22448 #$i_stdlib I_STDLIB
22450 #include <stdlib.h>
22454 printf("%d\n", (int)sizeof(st.st_ino));
22459 if eval $compile_ok; then
22463 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22465 *) st_ino_size=$val
22466 $echo "Your st_ino is $st_ino_size bytes long."
22471 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22475 : Check if st_ino is signed
22477 $echo "Checking the sign of st_ino..." >&4
22478 $cat > try.c <<EOCP
22479 #include <sys/stat.h>
22484 if (foo.st_ino < 0)
22491 if eval $compile; then
22495 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22497 *) st_ino_sign=$val
22498 case "$st_ino_sign" in
22499 1) $echo "Your st_ino is unsigned." ;;
22500 -1) $echo "Your st_ino is signed." ;;
22506 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22510 : see what type of char stdio uses.
22512 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22513 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22514 echo "Your stdio uses unsigned chars." >&4
22515 stdchar="unsigned char"
22517 echo "Your stdio uses signed chars." >&4
22522 : see what type uids are declared as in the kernel
22524 echo "Looking for the type for user ids returned by getuid()."
22525 set uid_t uidtype xxx stdio.h sys/types.h
22529 xxx=`./findhdr sys/user.h`
22530 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22532 unsigned) dflt="$1 $2" ;;
22536 *) dflt="$uidtype";;
22539 uid_t) echo "uid_t found." ;;
22540 *) rp="What is the type for user ids returned by getuid()?"
22546 : Check size of UID
22549 *_t) zzz="$uidtype" ;;
22552 echo "Checking the size of $zzz..." >&4
22554 #include <sys/types.h>
22556 #$i_stdlib I_STDLIB
22558 #include <stdlib.h>
22561 printf("%d\n", (int)sizeof($uidtype));
22566 if eval $compile_ok; then
22570 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22573 echo "Your $zzz is $uidsize bytes long."
22578 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22581 : Check if UID is signed
22584 *_t) zzz="$uidtype" ;;
22587 echo "Checking the sign of $zzz..." >&4
22589 #include <sys/types.h>
22600 if eval $compile; then
22604 echo "(I can't execute the test program--guessing unsigned.)" >&4
22608 1) echo "Your $zzz is unsigned." ;;
22609 -1) echo "Your $zzz is signed." ;;
22615 echo "(I can't compile the test program--guessing unsigned.)" >&4
22619 : Check format string for UID
22621 $echo "Checking the format string to be used for uids..." >&4
22624 -1) if $test X"$uidsize" = X"$ivsize"; then
22625 uidformat="$ivdformat"
22627 if $test X"$uidsize" = X"$longsize"; then
22630 if $test X"$uidsize" = X"$intsize"; then
22633 if $test X"$uidsize" = X"$shortsize"; then
22640 *) if $test X"$uidsize" = X"$uvsize"; then
22641 uidformat="$uvuformat"
22643 if $test X"$uidsize" = X"$longsize"; then
22646 if $test X"$uidsize" = X"$intsize"; then
22649 if $test X"$uidsize" = X"$shortsize"; then
22658 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22660 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22661 $cat >try.c <<'EOM'
22662 /* Intentionally a long probe as I'd like to sanity check that the exact
22663 approach is going to work, as thinking it will work, but only having it
22664 part working at runtime is worse than not having it. */
22666 #include <sys/types.h>
22667 #include <sys/sysctl.h>
22668 #include <sys/param.h>
22670 #include <string.h>
22671 #include <stdlib.h>
22672 #include <unistd.h>
22675 main(int argc, char **argv) {
22677 char *argv_leaf = strrchr(argv[0], '/');
22683 mib[1] = KERN_PROC;
22684 mib[2] = KERN_PROC_PATHNAME;
22688 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22692 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22697 if (size < strlen(argv_leaf) + 1) {
22698 fprintf(stderr, "size %lu is too short for a path\n",
22699 (unsigned long) size);
22703 if (size > MAXPATHLEN * MAXPATHLEN) {
22704 fprintf(stderr, "size %lu is too long for a path\n",
22705 (unsigned long) size);
22709 buffer = malloc(size);
22715 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22720 if (strlen(buffer) + 1 != size) {
22721 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22722 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22727 if (*buffer != '/') {
22728 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22732 if (strstr(buffer, "/./")) {
22733 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22737 if (strstr(buffer, "/../")) {
22738 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22742 buffer_leaf = strrchr(buffer, '/');
22743 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22744 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22756 if eval $compile; then
22757 if $run ./try; then
22758 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22761 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22765 echo "I'm unable to compile the test program." >&4
22766 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22770 set usekernprocpathname
22773 : Determine if we can use _NSGetExecutablePath to find executing program
22775 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22776 $cat >try.c <<'EOM'
22777 /* Intentionally a long probe as I'd like to sanity check that the exact
22778 approach is going to work, as thinking it will work, but only having it
22779 part working at runtime is worse than not having it. */
22780 #include <mach-o/dyld.h>
22782 #include <stdlib.h>
22783 #include <sys/param.h>
22784 #include <string.h>
22787 main(int argc, char **argv) {
22789 uint32_t size = sizeof(buf);
22793 char *argv_leaf = strrchr(argv[0], '/');
22797 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22801 _NSGetExecutablePath(buf, &size);
22802 if (size > MAXPATHLEN * MAXPATHLEN) {
22803 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22804 (unsigned int) size);
22808 buffer = malloc(size);
22814 result = _NSGetExecutablePath(buffer, &size);
22816 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22817 result, (unsigned int) size);
22821 tidied = realpath(buffer, NULL);
22823 perror("realpath");
22829 if (*tidied != '/') {
22830 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22834 if (strstr(tidied, "/./")) {
22835 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22839 if (strstr(tidied, "/../")) {
22840 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22844 tidied_leaf = strrchr(tidied, '/');
22845 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22846 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22858 if eval $compile; then
22859 if $run ./try; then
22860 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22863 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22866 echo "I'm unable to compile the test program." >&4
22867 echo "I'll assume no _NSGetExecutablePath here." >&4
22870 set usensgetexecutablepath
22873 : Check if site customization support was requested
22874 case "$usesitecustomize" in
22875 $define|true|[Yy]*)
22876 usesitecustomize="$define"
22879 usesitecustomize="$undef"
22883 : see if prototypes support variable argument declarations
22885 case "$prototype$i_stdarg" in
22887 echo "It appears we'll be able to prototype varargs functions." >&4
22891 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22898 : determine compiler compiler
22907 if $test -f "$byacc$_exe"; then
22909 comp="byacc or $comp"
22911 if $test -f "$bison$_exe"; then
22912 comp="$comp or bison -y"
22914 rp="Which compiler compiler ($comp) shall I use?"
22923 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22929 : see if this is a assert.h system
22930 set assert.h i_assert
22933 : see if this is a bfd.h system
22937 : see if this is an execinfo.h system
22938 set execinfo.h i_execinfo
22941 : see if this is a fenv.h system
22945 : see if this is a fp.h system
22949 : see if this is a fp_class.h system
22950 set fp_class.h i_fp_class
22953 : see if gdbm.h is available
22958 : see if gdbm_open exists
22959 set gdbm_open d_gdbm_open
22961 case "$d_gdbm_open" in
22964 echo "We won't be including <gdbm.h>"
22973 : see if this is a ieeefp.h system
22974 case "$i_ieeefp" in
22975 '' ) set ieeefp.h i_ieeefp
22980 : see if this is a libutil.h system
22981 set libutil.h i_libutil
22984 : see if mach cthreads are available
22985 if test "X$usethreads" = "X$define"; then
22986 set mach/cthreads.h i_machcthr
22989 i_machcthr="$undef"
22992 : see if this is a mntent.h system
22993 set mntent.h i_mntent
22996 : see if net/errno.h is available
22998 set net/errno.h val
23001 : Unfortunately, it causes problems on some systems. Arrgh.
23004 cat > try.c <<'EOM'
23007 #include <net/errno.h>
23013 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23014 echo "We'll be including <net/errno.h>." >&4
23016 echo "We won't be including <net/errno.h>." >&4
23025 : see if netinet/tcp.h is available
23026 set netinet/tcp.h i_netinettcp
23029 : see if this is a poll.h system
23033 : see if this is a prot.h system
23037 : Preprocessor symbols
23039 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23040 $cat <<'EOSH' > Cppsym.know
23041 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23042 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23043 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23044 arch_pwr ardent ARM ARM32 atarist att386 att3b
23045 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23046 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23047 byteorder byte_order
23048 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23049 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23050 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23051 ELF encore EPI EXTENSIONS
23052 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23053 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23054 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23055 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23056 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23057 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23058 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23059 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23060 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23062 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23063 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23064 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23066 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23067 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23068 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23069 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23070 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23071 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23072 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23073 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23074 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23075 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23076 ns32000 ns32016 ns32332 ns32k nsc32000
23077 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23078 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23079 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23080 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23082 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23083 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23084 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23085 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23086 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23087 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23088 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23089 SYSV4 SYSV5 sysV68 sysV88
23090 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23091 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23092 tower32_800 tower32_850 tss
23093 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23094 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23095 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23096 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23097 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23098 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23100 vax venix VMESA vms
23101 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23102 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23105 # Maybe put other stuff here too.
23106 ./tr '-' '_' <<EOSH >>Cppsym.know
23109 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23110 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23111 $cat Cppsym.know > Cppsym.c
23112 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23113 $rm -f Cppsym.a Cppsym.b Cppsym.c
23114 cat <<EOSH > Cppsym
23116 if $test \$# -gt 0; then
23117 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23118 if $test -s Cppsym.got; then
23125 $tr " " "$trnl" | ./Cppsym.try
23131 cat <<EOSH > Cppsym.try
23133 cat <<'EOCP' > try.c
23136 #define STRINGIFY(a) "a"
23138 #if cpp_stuff == 42
23139 #define StGiFy(a) #a
23140 #define STRINGIFY(a) StGiFy(a)
23142 #if $cpp_stuff != 1 && $cpp_stuff != 42
23143 # include "Bletch: How does this C preprocessor stringify macros?"
23149 cat <<'EOSH' >> Cppsym.try
23151 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23152 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23153 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23154 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23156 echo 'return 0;}' >> try.c
23158 cat <<EOSH >> Cppsym.try
23160 case "$osname-$gccversion" in
23161 irix-) ccflags="\$ccflags -woff 1178" ;;
23162 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23164 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
23166 chmod +x Cppsym.try
23167 $eunicefix Cppsym.try
23168 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23169 : Add in any Linux cpp "predefined macros":
23170 case "$osname::$gccversion" in
23171 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23173 rm -f $tHdrH'.h' $tHdrH
23175 # Filter out macro arguments, such as Linux's __INT8_C(c)
23176 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23177 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23178 if [ -s $tHdrH'_cppsym.real' ]; then
23179 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23182 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23185 : now check the C compiler for additional symbols
23186 postprocess_cc_v=''
23188 aix) postprocess_cc_v="|$tr , ' '" ;;
23195 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23198 -D*) echo "\$i" | $sed 's/^-D//';;
23199 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23204 postprocess_cc_v=''
23207 ./ccsym > ccsym1.raw
23208 if $test -s ccsym1.raw; then
23209 $sort ccsym1.raw | $uniq >ccsym.raw
23211 mv ccsym1.raw ccsym.raw
23214 $awk '/\=/ { print $0; next }
23215 { print $0"=1" }' ccsym.raw >ccsym.list
23216 $comm -13 Cppsym.true ccsym.list >ccsym.own
23217 $comm -12 Cppsym.true ccsym.list >ccsym.com
23218 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23220 if $test -z ccsym.raw; then
23221 echo "Your C compiler doesn't seem to define any symbols!" >&4
23223 echo "However, your C preprocessor defines the following symbols:"
23226 cppsymbols=`$cat Cppsym.true`
23227 cppsymbols=`echo $cppsymbols`
23228 cppccsymbols="$cppsymbols"
23230 if $test -s ccsym.com; then
23231 echo "Your C compiler and pre-processor define these symbols:"
23232 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23235 cppccsymbols=`$cat ccsym.com`
23236 cppccsymbols=`echo $cppccsymbols`
23237 $test "$silent" || sleep 1
23239 if $test -s ccsym.cpp; then
23240 $test "$also" && echo " "
23241 echo "Your C pre-processor ${also}defines the following symbols:"
23242 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23244 cppsymbols=`$cat ccsym.cpp`
23245 cppsymbols=`echo $cppsymbols`
23246 $test "$silent" || sleep 1
23248 if $test -s ccsym.own; then
23249 $test "$also" && echo " "
23250 echo "Your C compiler ${also}defines the following cpp symbols:"
23251 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23252 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23253 ccsymbols=`$cat ccsym.own`
23254 ccsymbols=`echo $ccsymbols`
23255 $test "$silent" || sleep 1
23259 : add -D_FORTIFY_SOURCE if feasible and not already there
23260 case "$gccversion" in
23261 [45].*) case "$optimize$ccflags" in
23262 *-O*) case "$ccflags$cppsymbols" in
23263 *_FORTIFY_SOURCE=*) # Don't add it again.
23264 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23266 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23267 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23271 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23275 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23279 : see if this is a termio system
23283 if $test `./findhdr termios.h`; then
23284 set tcsetattr i_termios
23290 "$define") echo "You have POSIX termios.h... good!" >&4;;
23291 *) if ./Cppsym pyr; then
23292 case "`$run /bin/universe`" in
23293 ucb) if $test `./findhdr sgtty.h`; then
23295 echo "<sgtty.h> found." >&4
23297 echo "System is pyramid with BSD universe."
23298 ./warn "<sgtty.h> not found--you could have problems."
23300 *) if $test `./findhdr termio.h`; then
23302 echo "<termio.h> found." >&4
23304 echo "System is pyramid with USG universe."
23305 ./warn "<termio.h> not found--you could have problems."
23309 if $test `./findhdr termio.h`; then
23310 echo "<termio.h> found." >&4
23312 elif $test `./findhdr sgtty.h`; then
23313 echo "<sgtty.h> found." >&4
23316 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23319 if $test `./findhdr sgtty.h`; then
23320 echo "<sgtty.h> found." >&4
23322 elif $test `./findhdr termio.h`; then
23323 echo "<termio.h> found." >&4
23326 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23330 set i_termio; eval $setvar
23331 val=$val2; set i_sgtty; eval $setvar
23332 val=$val3; set i_termios; eval $setvar
23334 : see if stdbool is available
23335 : we want a real compile instead of Inhdr because some Solaris systems
23336 : have stdbool.h, but it can only be used if the compiler indicates it
23337 : is sufficiently c99-compliant.
23341 #include <stdbool.h>
23346 int main(int argc, char **argv)
23352 if eval $compile; then
23353 echo "<stdbool.h> found." >&4
23356 echo "<stdbool.h> NOT found." >&4
23363 : see if stddef is available
23364 set stddef.h i_stddef
23367 : see if stdint is available
23368 set stdint.h i_stdint
23371 : see if sys/access.h is available
23372 set sys/access.h i_sysaccess
23375 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23376 set sys/filio.h i_sysfilio
23379 if $test `./findhdr sys/ioctl.h`; then
23381 echo '<sys/ioctl.h> found.' >&4
23384 if $test $i_sysfilio = "$define"; then
23385 echo '<sys/ioctl.h> NOT found.' >&4
23387 $test $i_sgtty = "$define" && xxx="sgtty.h"
23388 $test $i_termio = "$define" && xxx="termio.h"
23389 $test $i_termios = "$define" && xxx="termios.h"
23390 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23396 : see if socket ioctl defs are in sys/sockio.h
23398 xxx=`./findhdr sys/sockio.h`
23399 if $test "$xxx"; then
23400 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23402 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23405 echo "No socket ioctls found in <sys/sockio.h>." >&4
23410 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23416 : see if this is a syslog.h system
23417 set syslog.h i_syslog
23420 : see if this is a sys/mode.h system
23421 set sys/mode.h i_sysmode
23424 : see if there is a sys/poll.h file
23425 set sys/poll.h i_syspoll
23428 : see if sys/resource.h has to be included
23429 set sys/resource.h i_sysresrc
23432 : see if sys/security.h is available
23433 set sys/security.h i_syssecrt
23436 : see if this is a sys/statvfs.h system
23437 set sys/statvfs.h i_sysstatvfs
23440 : see if this is a sys/un.h system
23441 set sys/un.h i_sysun
23444 : see if this is a sys/utsname.h system
23445 set sys/utsname.h i_sysutsname
23448 : see if this is a syswait system
23449 set sys/wait.h i_syswait
23452 : see if this is a ustat.h system
23453 set ustat.h i_ustat
23456 : see if this is an utime system
23457 set utime.h i_utime
23460 : see if this is a vfork system
23463 set vfork.h i_vfork
23473 echo "Looking for extensions..." >&4
23474 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23475 : contain old or inaccurate or duplicate values.
23476 nonxs_extensions=''
23478 : We do not use find because it might not be available.
23479 : We do not just use MANIFEST because the user may have dropped
23480 : some additional extensions into the source tree and expect them
23483 : Function to recursively find available extensions, ignoring DynaLoader
23484 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23485 : In 5.10.1 and later, extensions are stored in directories
23486 : like File-Glob instead of the older File/Glob/.
23490 DynaLoader|dynaload) ;;
23492 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23493 case "$this_ext" in
23494 Scalar/List/Utils) this_ext="List/Util" ;;
23495 PathTools) this_ext="Cwd" ;;
23497 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23498 if $contains " $this_ext " "$tdir/$$.tmp"; then
23500 echo "Duplicate directories detected for extension $xxx" >&4;
23501 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23502 case "$knowitall" in
23510 echo "Ok. Stopping Configure." >&4;
23511 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23514 echo "Ok. You will need to correct config.sh before running make." >&4;
23516 $ls -1 "$xxx" > "$tdir/$$.tmp";
23517 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23518 xs_extensions="$xs_extensions $this_ext";
23519 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23520 xs_extensions="$xs_extensions $this_ext";
23521 elif $test -d "$xxx"; then
23522 nonxs_extensions="$nonxs_extensions $this_ext";
23524 $rm -f "$tdir/$$.tmp";
23532 eval $find_extensions
23536 eval $find_extensions
23540 eval $find_extensions
23541 set X $xs_extensions
23543 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23544 set X $nonxs_extensions
23546 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23548 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23550 : Now see which are supported on this system.
23552 for xxx in $xs_extensions ; do
23556 amigaos) avail_ext="$avail_ext $xxx" ;;
23561 $define) avail_ext="$avail_ext $xxx" ;;
23564 GDBM_File|gdbm_fil)
23566 $define) avail_ext="$avail_ext $xxx" ;;
23569 I18N/Langinfo|i18n_lan)
23570 case "$i_langinfo$d_nl_langinfo" in
23571 $define$define) avail_ext="$avail_ext $xxx" ;;
23575 : XXX Do we need a useipcsysv variable here
23576 case "${d_msg}${d_sem}${d_shm}" in
23577 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23580 NDBM_File|ndbm_fil)
23583 case "$osname-$use64bitint" in
23586 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23589 *) avail_ext="$avail_ext $xxx" ;;
23594 ODBM_File|odbm_fil)
23595 case "${i_dbm}${i_rpcsvcdbm}" in
23597 case "$d_cplusplus" in
23598 define) ;; # delete as a function name will not work
23599 *) case "$osname-$use64bitint" in
23602 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23605 *) avail_ext="$avail_ext $xxx" ;;
23613 case "$useopcode" in
23614 true|define|y) avail_ext="$avail_ext $xxx" ;;
23618 case "$useposix" in
23619 true|define|y) avail_ext="$avail_ext $xxx" ;;
23623 case "$d_socket" in
23624 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23627 Sys/Syslog|sys/syslog)
23629 amigaos) ;; # not really very useful on AmigaOS
23631 : XXX syslog requires socket
23632 case "$d_socket" in
23633 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23639 case "$usethreads" in
23641 case "$use5005threads" in
23642 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23646 threads|threads/shared)
23647 # threads and threads::shared are special cases.
23648 # To stop people from asking "Perl 5.8.0 was supposed
23649 # to have this new fancy threads implementation but my
23650 # perl doesn't have it" and from people trying to
23651 # (re)install the threads module using CPAN.pm and
23652 # CPAN.pm then offering to reinstall Perl 5.8.0,
23653 # the threads.pm and threads/shared.pm will always be
23654 # there, croaking informatively ("you need to rebuild
23655 # all of Perl with threads, sorry") when threads haven't
23656 # been compiled in.
23658 avail_ext="$avail_ext $xxx"
23664 cygwin) avail_ext="$avail_ext $xxx" ;;
23667 XS/APItest|xs/apitest)
23668 # This is just for testing. Skip it unless we have dynamic loading.
23671 $define) avail_ext="$avail_ext $xxx" ;;
23674 XS/Typemap|xs/typemap)
23675 # This is just for testing. Skip it unless we have dynamic loading.
23677 $define) avail_ext="$avail_ext $xxx" ;;
23680 *) avail_ext="$avail_ext $xxx"
23689 case "$onlyextensions" in
23691 *) keepextensions=''
23692 echo "You have requested that only certain extensions be included..." >&4
23693 for i in $onlyextensions; do
23694 case " $avail_ext " in
23696 echo "Keeping extension $i."
23697 keepextensions="$keepextensions $i"
23699 *) echo "Ignoring extension $i." ;;
23702 avail_ext="$keepextensions"
23706 case "$noextensions" in
23708 *) keepextensions=''
23709 echo "You have requested that certain extensions be ignored..." >&4
23710 for i in $avail_ext; do
23711 case " $noextensions " in
23712 *" $i "*) echo "Ignoring extension $i." ;;
23713 *) echo "Keeping extension $i.";
23714 keepextensions="$keepextensions $i"
23718 avail_ext="$keepextensions"
23722 : Now see which nonxs extensions are supported on this system.
23723 : For now assume all are.
23725 for xxx in $nonxs_extensions ; do
23729 *) nonxs_ext="$nonxs_ext $xxx"
23741 A number of extensions are supplied with $package. You may choose to
23742 compile these extensions for dynamic loading (the default), compile
23743 them into the $package executable (static loading), or not include
23744 them at all. Answer "none" to include no extensions.
23745 Note that DynaLoader is always built and need not be mentioned here.
23748 case "$dynamic_ext" in
23750 : Exclude those listed in static_ext
23752 for xxx in $avail_ext; do
23753 case " $static_ext " in
23755 *) dflt="$dflt $xxx" ;;
23762 *) dflt="$dynamic_ext"
23763 # Perhaps we are reusing an old out-of-date config.sh.
23766 if test X"$dynamic_ext" != X"$avail_ext"; then
23768 NOTICE: Your previous config.sh list may be incorrect.
23769 The extensions now available to you are
23771 but the default list from your previous config.sh is
23783 rp="What extensions do you wish to load dynamically?"
23786 none) dynamic_ext=' ' ;;
23787 *) dynamic_ext="$ans" ;;
23790 case "$static_ext" in
23792 : Exclude those already listed in dynamic linking
23794 for xxx in $avail_ext; do
23795 case " $dynamic_ext " in
23797 *) dflt="$dflt $xxx" ;;
23804 *) dflt="$static_ext"
23811 rp="What extensions do you wish to load statically?"
23814 none) static_ext=' ' ;;
23815 *) static_ext="$ans" ;;
23820 A number of extensions are supplied with $package. Answer "none"
23821 to include no extensions.
23822 Note that DynaLoader is always built and need not be mentioned here.
23825 case "$static_ext" in
23826 '') dflt="$avail_ext" ;;
23827 *) dflt="$static_ext"
23828 # Perhaps we are reusing an old out-of-date config.sh.
23831 if test X"$static_ext" != X"$avail_ext"; then
23833 NOTICE: Your previous config.sh list may be incorrect.
23834 The extensions now available to you are
23836 but the default list from your previous config.sh is
23845 : Exclude those that are not xs extensions
23849 rp="What extensions do you wish to include?"
23852 none) static_ext=' ' ;;
23853 *) static_ext="$ans" ;;
23858 # Encode is a special case. If we are building Encode as a static
23859 # extension, we need to explicitly list its subextensions as well.
23860 # For other nested extensions, this is handled automatically by
23861 # the appropriate Makefile.PL.
23862 case " $static_ext " in
23863 *" Encode "*) # Add the subextensions of Encode
23865 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23866 static_ext="$static_ext Encode/$xxx"
23867 known_extensions="$known_extensions Encode/$xxx"
23873 set X $dynamic_ext $static_ext $nonxs_ext
23877 # Sanity check: We require an extension suitable for use with
23878 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23879 # should show up as failures in the test suite, but it's helpful to
23880 # catch them now.) The 'extensions' list is normally sorted
23881 # alphabetically, so we need to accept either
23882 # DB_File ... Fcntl ... IO ....
23883 # or something like
23884 # Fcntl ... NDBM_File ... IO ....
23885 case " $extensions" in
23886 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23887 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23888 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23889 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23890 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23894 : Remove libraries needed only for extensions
23895 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23896 : The exception is SunOS 4.x, which needs them.
23897 case "${osname}X${osvers}" in
23901 *) case "$usedl" in
23902 $define|true|[yY]*)
23903 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23907 *) perllibs="$libs"
23913 : Remove build directory name from cppstdin so it can be used from
23914 : either the present location or the final installed location.
23916 : Get out of the UU directory to get correct path name.
23918 case "$cppstdin" in
23920 echo "Stripping down cppstdin path name"
23926 : end of configuration questions
23928 echo "End of configuration questions."
23931 : back to where it started
23932 if test -d ../UU; then
23936 : configuration may be unconditionally patched via a 'config.arch' file
23937 if $test -f config.arch; then
23938 echo "I see a config.arch file, loading it." >&4
23942 : configuration may be patched via a 'config.over' file
23943 if $test -f config.over; then
23946 rp='I see a config.over file. Do you wish to load it?'
23949 n*) echo "OK, I'll ignore it.";;
23951 echo "Configuration override changes have been loaded."
23956 : in case they want portability, strip down executable paths
23957 case "$d_portable" in
23960 echo "Stripping down executable paths..." >&4
23961 for file in $loclist $trylist; do
23963 eval $file=`basename $temp`
23968 : create config.sh file
23970 echo "Creating config.sh..." >&4
23971 $spitshell <<EOT >config.sh
23974 # This file was produced by running the Configure script. It holds all the
23975 # definitions figured out by Configure. Should you modify one of these values,
23976 # do not forget to propagate your changes by running "Configure -der". You may
23977 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23980 # Package name : $package
23981 # Source directory : $src
23982 # Configuration time: $cf_time
23983 # Configured by : $cf_by
23984 # Target system : $myuname
23987 : Add in command line options if available
23988 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23990 $spitshell <<EOT >>config.sh
23999 Revision='$Revision'
24007 alignbytes='$alignbytes'
24008 ansi2knr='$ansi2knr'
24009 aphostname='$aphostname'
24010 api_revision='$api_revision'
24011 api_subversion='$api_subversion'
24012 api_version='$api_version'
24013 api_versionstring='$api_versionstring'
24016 archlibexp='$archlibexp'
24017 archname64='$archname64'
24018 archname='$archname'
24019 archobjs='$archobjs'
24020 asctime_r_proto='$asctime_r_proto'
24029 byteorder='$byteorder'
24031 castflags='$castflags'
24034 cccdlflags='$cccdlflags'
24035 ccdlflags='$ccdlflags'
24037 ccflags_uselargefiles='$ccflags_uselargefiles'
24039 ccsymbols='$ccsymbols'
24040 ccversion='$ccversion'
24042 cf_email='$cf_email'
24044 charbits='$charbits'
24045 charsize='$charsize'
24049 clocktype='$clocktype'
24051 compress='$compress'
24052 contains='$contains'
24056 cpp_stuff='$cpp_stuff'
24057 cppccsymbols='$cppccsymbols'
24058 cppflags='$cppflags'
24060 cppminus='$cppminus'
24062 cppstdin='$cppstdin'
24063 cppsymbols='$cppsymbols'
24064 crypt_r_proto='$crypt_r_proto'
24065 cryptlib='$cryptlib'
24067 ctermid_r_proto='$ctermid_r_proto'
24068 ctime_r_proto='$ctime_r_proto'
24069 d_Gconvert='$d_Gconvert'
24070 d_PRIEUldbl='$d_PRIEUldbl'
24071 d_PRIFUldbl='$d_PRIFUldbl'
24072 d_PRIGUldbl='$d_PRIGUldbl'
24073 d_PRIXU64='$d_PRIXU64'
24074 d_PRId64='$d_PRId64'
24075 d_PRIeldbl='$d_PRIeldbl'
24076 d_PRIfldbl='$d_PRIfldbl'
24077 d_PRIgldbl='$d_PRIgldbl'
24078 d_PRIi64='$d_PRIi64'
24079 d_PRIo64='$d_PRIo64'
24080 d_PRIu64='$d_PRIu64'
24081 d_PRIx64='$d_PRIx64'
24082 d_SCNfldbl='$d_SCNfldbl'
24083 d__fwalk='$d__fwalk'
24084 d_access='$d_access'
24085 d_accessx='$d_accessx'
24089 d_archlib='$d_archlib'
24090 d_asctime64='$d_asctime64'
24091 d_asctime_r='$d_asctime_r'
24096 d_attribute_deprecated='$d_attribute_deprecated'
24097 d_attribute_format='$d_attribute_format'
24098 d_attribute_malloc='$d_attribute_malloc'
24099 d_attribute_nonnull='$d_attribute_nonnull'
24100 d_attribute_noreturn='$d_attribute_noreturn'
24101 d_attribute_pure='$d_attribute_pure'
24102 d_attribute_unused='$d_attribute_unused'
24103 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24104 d_backtrace='$d_backtrace'
24108 d_bsdgetpgrp='$d_bsdgetpgrp'
24109 d_bsdsetpgrp='$d_bsdsetpgrp'
24110 d_builtin_choose_expr='$d_builtin_choose_expr'
24111 d_builtin_expect='$d_builtin_expect'
24113 d_c99_variadic_macros='$d_c99_variadic_macros'
24114 d_casti32='$d_casti32'
24115 d_castneg='$d_castneg'
24117 d_charvspr='$d_charvspr'
24119 d_chroot='$d_chroot'
24120 d_chsize='$d_chsize'
24122 d_clearenv='$d_clearenv'
24123 d_closedir='$d_closedir'
24124 d_cmsghdr_s='$d_cmsghdr_s'
24126 d_copysign='$d_copysign'
24127 d_copysignl='$d_copysignl'
24128 d_cplusplus='$d_cplusplus'
24130 d_crypt_r='$d_crypt_r'
24132 d_ctermid='$d_ctermid'
24133 d_ctermid_r='$d_ctermid_r'
24134 d_ctime64='$d_ctime64'
24135 d_ctime_r='$d_ctime_r'
24136 d_cuserid='$d_cuserid'
24137 d_dbl_dig='$d_dbl_dig'
24138 d_dbminitproto='$d_dbminitproto'
24139 d_difftime64='$d_difftime64'
24140 d_difftime='$d_difftime'
24141 d_dir_dd_fd='$d_dir_dd_fd'
24143 d_dirnamlen='$d_dirnamlen'
24144 d_dladdr='$d_dladdr'
24145 d_dlerror='$d_dlerror'
24146 d_dlopen='$d_dlopen'
24147 d_dlsymun='$d_dlsymun'
24148 d_dosuid='$d_dosuid'
24149 d_drand48_r='$d_drand48_r'
24150 d_drand48proto='$d_drand48proto'
24152 d_eaccess='$d_eaccess'
24153 d_endgrent='$d_endgrent'
24154 d_endgrent_r='$d_endgrent_r'
24155 d_endhent='$d_endhent'
24156 d_endhostent_r='$d_endhostent_r'
24157 d_endnent='$d_endnent'
24158 d_endnetent_r='$d_endnetent_r'
24159 d_endpent='$d_endpent'
24160 d_endprotoent_r='$d_endprotoent_r'
24161 d_endpwent='$d_endpwent'
24162 d_endpwent_r='$d_endpwent_r'
24163 d_endsent='$d_endsent'
24164 d_endservent_r='$d_endservent_r'
24165 d_eofnblk='$d_eofnblk'
24168 d_eunice='$d_eunice'
24171 d_faststdio='$d_faststdio'
24172 d_fchdir='$d_fchdir'
24173 d_fchmod='$d_fchmod'
24174 d_fchown='$d_fchown'
24176 d_fcntl_can_lock='$d_fcntl_can_lock'
24177 d_fd_macros='$d_fd_macros'
24178 d_fd_set='$d_fd_set'
24180 d_fds_bits='$d_fds_bits'
24181 d_fegetround='$d_fegetround'
24182 d_fgetpos='$d_fgetpos'
24183 d_finite='$d_finite'
24184 d_finitel='$d_finitel'
24185 d_flexfnam='$d_flexfnam'
24187 d_flockproto='$d_flockproto'
24192 d_fp_class='$d_fp_class'
24193 d_fp_classify='$d_fp_classify'
24194 d_fp_classl='$d_fp_classl'
24195 d_fpathconf='$d_fpathconf'
24196 d_fpclass='$d_fpclass'
24197 d_fpclassify='$d_fpclassify'
24198 d_fpclassl='$d_fpclassl'
24199 d_fpgetround='$d_fpgetround'
24200 d_fpos64_t='$d_fpos64_t'
24201 d_frexpl='$d_frexpl'
24202 d_fs_data_s='$d_fs_data_s'
24203 d_fseeko='$d_fseeko'
24204 d_fsetpos='$d_fsetpos'
24205 d_fstatfs='$d_fstatfs'
24206 d_fstatvfs='$d_fstatvfs'
24208 d_ftello='$d_ftello'
24210 d_futimes='$d_futimes'
24211 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24212 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24213 d_getaddrinfo='$d_getaddrinfo'
24214 d_getcwd='$d_getcwd'
24215 d_getespwnam='$d_getespwnam'
24216 d_getfsstat='$d_getfsstat'
24217 d_getgrent='$d_getgrent'
24218 d_getgrent_r='$d_getgrent_r'
24219 d_getgrgid_r='$d_getgrgid_r'
24220 d_getgrnam_r='$d_getgrnam_r'
24221 d_getgrps='$d_getgrps'
24222 d_gethbyaddr='$d_gethbyaddr'
24223 d_gethbyname='$d_gethbyname'
24224 d_gethent='$d_gethent'
24225 d_gethname='$d_gethname'
24226 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24227 d_gethostbyname_r='$d_gethostbyname_r'
24228 d_gethostent_r='$d_gethostent_r'
24229 d_gethostprotos='$d_gethostprotos'
24230 d_getitimer='$d_getitimer'
24231 d_getlogin='$d_getlogin'
24232 d_getlogin_r='$d_getlogin_r'
24233 d_getmnt='$d_getmnt'
24234 d_getmntent='$d_getmntent'
24235 d_getnameinfo='$d_getnameinfo'
24236 d_getnbyaddr='$d_getnbyaddr'
24237 d_getnbyname='$d_getnbyname'
24238 d_getnent='$d_getnent'
24239 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24240 d_getnetbyname_r='$d_getnetbyname_r'
24241 d_getnetent_r='$d_getnetent_r'
24242 d_getnetprotos='$d_getnetprotos'
24243 d_getpagsz='$d_getpagsz'
24244 d_getpbyname='$d_getpbyname'
24245 d_getpbynumber='$d_getpbynumber'
24246 d_getpent='$d_getpent'
24247 d_getpgid='$d_getpgid'
24248 d_getpgrp2='$d_getpgrp2'
24249 d_getpgrp='$d_getpgrp'
24250 d_getppid='$d_getppid'
24251 d_getprior='$d_getprior'
24252 d_getprotobyname_r='$d_getprotobyname_r'
24253 d_getprotobynumber_r='$d_getprotobynumber_r'
24254 d_getprotoent_r='$d_getprotoent_r'
24255 d_getprotoprotos='$d_getprotoprotos'
24256 d_getprpwnam='$d_getprpwnam'
24257 d_getpwent='$d_getpwent'
24258 d_getpwent_r='$d_getpwent_r'
24259 d_getpwnam_r='$d_getpwnam_r'
24260 d_getpwuid_r='$d_getpwuid_r'
24261 d_getsbyname='$d_getsbyname'
24262 d_getsbyport='$d_getsbyport'
24263 d_getsent='$d_getsent'
24264 d_getservbyname_r='$d_getservbyname_r'
24265 d_getservbyport_r='$d_getservbyport_r'
24266 d_getservent_r='$d_getservent_r'
24267 d_getservprotos='$d_getservprotos'
24268 d_getspnam='$d_getspnam'
24269 d_getspnam_r='$d_getspnam_r'
24270 d_gettimeod='$d_gettimeod'
24271 d_gmtime64='$d_gmtime64'
24272 d_gmtime_r='$d_gmtime_r'
24273 d_gnulibc='$d_gnulibc'
24274 d_grpasswd='$d_grpasswd'
24275 d_hasmntopt='$d_hasmntopt'
24279 d_ilogbl='$d_ilogbl'
24280 d_inc_version_list='$d_inc_version_list'
24282 d_inetaton='$d_inetaton'
24283 d_inetntop='$d_inetntop'
24284 d_inetpton='$d_inetpton'
24285 d_int64_t='$d_int64_t'
24286 d_ip_mreq='$d_ip_mreq'
24287 d_ip_mreq_source='$d_ip_mreq_source'
24288 d_ipv6_mreq='$d_ipv6_mreq'
24289 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24290 d_isascii='$d_isascii'
24291 d_isblank='$d_isblank'
24292 d_isfinite='$d_isfinite'
24293 d_isfinitel='$d_isfinitel'
24295 d_isinfl='$d_isinfl'
24296 d_isless='$d_isless'
24298 d_isnanl='$d_isnanl'
24299 d_isnormal='$d_isnormal'
24302 d_killpg='$d_killpg'
24303 d_lc_monetary_2008='$d_lc_monetary_2008'
24304 d_lchown='$d_lchown'
24305 d_ldbl_dig='$d_ldbl_dig'
24306 d_ldexpl='$d_ldexpl'
24307 d_lgamma='$d_lgamma'
24308 d_lgamma_r='$d_lgamma_r'
24309 d_libm_lib_version='$d_libm_lib_version'
24310 d_libname_unique='$d_libname_unique'
24312 d_llrint='$d_llrint'
24313 d_llrintl='$d_llrintl'
24314 d_llround='$d_llround'
24315 d_llroundl='$d_llroundl'
24316 d_localtime64='$d_localtime64'
24317 d_localtime_r='$d_localtime_r'
24318 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24319 d_locconv='$d_locconv'
24324 d_longdbl='$d_longdbl'
24325 d_longlong='$d_longlong'
24327 d_lrintl='$d_lrintl'
24328 d_lround='$d_lround'
24329 d_lroundl='$d_lroundl'
24330 d_lseekproto='$d_lseekproto'
24332 d_madvise='$d_madvise'
24333 d_malloc_good_size='$d_malloc_good_size'
24334 d_malloc_size='$d_malloc_size'
24336 d_mbstowcs='$d_mbstowcs'
24337 d_mbtowc='$d_mbtowc'
24338 d_memchr='$d_memchr'
24339 d_memcmp='$d_memcmp'
24340 d_memcpy='$d_memcpy'
24341 d_memmove='$d_memmove'
24342 d_memset='$d_memset'
24344 d_mkdtemp='$d_mkdtemp'
24345 d_mkfifo='$d_mkfifo'
24346 d_mkstemp='$d_mkstemp'
24347 d_mkstemps='$d_mkstemps'
24348 d_mktime64='$d_mktime64'
24349 d_mktime='$d_mktime'
24352 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24353 d_modflproto='$d_modflproto'
24354 d_mprotect='$d_mprotect'
24356 d_msg_ctrunc='$d_msg_ctrunc'
24357 d_msg_dontroute='$d_msg_dontroute'
24358 d_msg_oob='$d_msg_oob'
24359 d_msg_peek='$d_msg_peek'
24360 d_msg_proxy='$d_msg_proxy'
24361 d_msgctl='$d_msgctl'
24362 d_msgget='$d_msgget'
24363 d_msghdr_s='$d_msghdr_s'
24364 d_msgrcv='$d_msgrcv'
24365 d_msgsnd='$d_msgsnd'
24367 d_munmap='$d_munmap'
24368 d_mymalloc='$d_mymalloc'
24371 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24372 d_nearbyint='$d_nearbyint'
24373 d_nextafter='$d_nextafter'
24374 d_nexttoward='$d_nexttoward'
24376 d_nl_langinfo='$d_nl_langinfo'
24377 d_nv_preserves_uv='$d_nv_preserves_uv'
24378 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24379 d_off64_t='$d_off64_t'
24380 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24381 d_oldpthreads='$d_oldpthreads'
24382 d_oldsock='$d_oldsock'
24384 d_pathconf='$d_pathconf'
24386 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24387 d_phostname='$d_phostname'
24390 d_portable='$d_portable'
24392 d_prctl_set_name='$d_prctl_set_name'
24393 d_printf_format_null='$d_printf_format_null'
24394 d_procselfexe='$d_procselfexe'
24395 d_pseudofork='$d_pseudofork'
24396 d_pthread_atfork='$d_pthread_atfork'
24397 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24398 d_pthread_yield='$d_pthread_yield'
24399 d_ptrdiff_t='$d_ptrdiff_t'
24401 d_pwchange='$d_pwchange'
24402 d_pwclass='$d_pwclass'
24403 d_pwcomment='$d_pwcomment'
24404 d_pwexpire='$d_pwexpire'
24405 d_pwgecos='$d_pwgecos'
24406 d_pwpasswd='$d_pwpasswd'
24407 d_pwquota='$d_pwquota'
24410 d_random_r='$d_random_r'
24411 d_re_comp='$d_re_comp'
24412 d_readdir64_r='$d_readdir64_r'
24413 d_readdir='$d_readdir'
24414 d_readdir_r='$d_readdir_r'
24415 d_readlink='$d_readlink'
24417 d_recvmsg='$d_recvmsg'
24418 d_regcmp='$d_regcmp'
24419 d_regcomp='$d_regcomp'
24420 d_remainder='$d_remainder'
24421 d_remquo='$d_remquo'
24422 d_rename='$d_rename'
24423 d_rewinddir='$d_rewinddir'
24427 d_safebcpy='$d_safebcpy'
24428 d_safemcpy='$d_safemcpy'
24429 d_sanemcmp='$d_sanemcmp'
24430 d_sbrkproto='$d_sbrkproto'
24431 d_scalbn='$d_scalbn'
24432 d_scalbnl='$d_scalbnl'
24433 d_sched_yield='$d_sched_yield'
24434 d_scm_rights='$d_scm_rights'
24435 d_seekdir='$d_seekdir'
24436 d_select='$d_select'
24438 d_semctl='$d_semctl'
24439 d_semctl_semid_ds='$d_semctl_semid_ds'
24440 d_semctl_semun='$d_semctl_semun'
24441 d_semget='$d_semget'
24443 d_sendmsg='$d_sendmsg'
24444 d_setegid='$d_setegid'
24445 d_seteuid='$d_seteuid'
24446 d_setgrent='$d_setgrent'
24447 d_setgrent_r='$d_setgrent_r'
24448 d_setgrps='$d_setgrps'
24449 d_sethent='$d_sethent'
24450 d_sethostent_r='$d_sethostent_r'
24451 d_setitimer='$d_setitimer'
24452 d_setlinebuf='$d_setlinebuf'
24453 d_setlocale='$d_setlocale'
24454 d_setlocale_r='$d_setlocale_r'
24455 d_setnent='$d_setnent'
24456 d_setnetent_r='$d_setnetent_r'
24457 d_setpent='$d_setpent'
24458 d_setpgid='$d_setpgid'
24459 d_setpgrp2='$d_setpgrp2'
24460 d_setpgrp='$d_setpgrp'
24461 d_setprior='$d_setprior'
24462 d_setproctitle='$d_setproctitle'
24463 d_setprotoent_r='$d_setprotoent_r'
24464 d_setpwent='$d_setpwent'
24465 d_setpwent_r='$d_setpwent_r'
24466 d_setregid='$d_setregid'
24467 d_setresgid='$d_setresgid'
24468 d_setresuid='$d_setresuid'
24469 d_setreuid='$d_setreuid'
24470 d_setrgid='$d_setrgid'
24471 d_setruid='$d_setruid'
24472 d_setsent='$d_setsent'
24473 d_setservent_r='$d_setservent_r'
24474 d_setsid='$d_setsid'
24475 d_setvbuf='$d_setvbuf'
24478 d_shmatprototype='$d_shmatprototype'
24479 d_shmctl='$d_shmctl'
24481 d_shmget='$d_shmget'
24482 d_sigaction='$d_sigaction'
24483 d_signbit='$d_signbit'
24484 d_sigprocmask='$d_sigprocmask'
24485 d_sigsetjmp='$d_sigsetjmp'
24486 d_sin6_scope_id='$d_sin6_scope_id'
24487 d_sitearch='$d_sitearch'
24488 d_snprintf='$d_snprintf'
24489 d_sockaddr_in6='$d_sockaddr_in6'
24490 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24491 d_sockatmark='$d_sockatmark'
24492 d_sockatmarkproto='$d_sockatmarkproto'
24493 d_socket='$d_socket'
24494 d_socklen_t='$d_socklen_t'
24495 d_sockpair='$d_sockpair'
24496 d_socks5_init='$d_socks5_init'
24497 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24499 d_srand48_r='$d_srand48_r'
24500 d_srandom_r='$d_srandom_r'
24501 d_sresgproto='$d_sresgproto'
24502 d_sresuproto='$d_sresuproto'
24504 d_statblks='$d_statblks'
24505 d_statfs_f_flags='$d_statfs_f_flags'
24506 d_statfs_s='$d_statfs_s'
24507 d_static_inline='$d_static_inline'
24508 d_statvfs='$d_statvfs'
24509 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24510 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24511 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24512 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24513 d_stdio_stream_array='$d_stdio_stream_array'
24514 d_stdiobase='$d_stdiobase'
24515 d_stdstdio='$d_stdstdio'
24516 d_strchr='$d_strchr'
24517 d_strcoll='$d_strcoll'
24518 d_strctcpy='$d_strctcpy'
24519 d_strerrm='$d_strerrm'
24520 d_strerror='$d_strerror'
24521 d_strerror_r='$d_strerror_r'
24522 d_strftime='$d_strftime'
24523 d_strlcat='$d_strlcat'
24524 d_strlcpy='$d_strlcpy'
24525 d_strtod='$d_strtod'
24526 d_strtol='$d_strtol'
24527 d_strtold='$d_strtold'
24528 d_strtoll='$d_strtoll'
24529 d_strtoq='$d_strtoq'
24530 d_strtoul='$d_strtoul'
24531 d_strtoull='$d_strtoull'
24532 d_strtouq='$d_strtouq'
24533 d_strxfrm='$d_strxfrm'
24534 d_suidsafe='$d_suidsafe'
24535 d_symlink='$d_symlink'
24536 d_syscall='$d_syscall'
24537 d_syscallproto='$d_syscallproto'
24538 d_sysconf='$d_sysconf'
24539 d_sysernlst='$d_sysernlst'
24540 d_syserrlst='$d_syserrlst'
24541 d_system='$d_system'
24542 d_tcgetpgrp='$d_tcgetpgrp'
24543 d_tcsetpgrp='$d_tcsetpgrp'
24544 d_telldir='$d_telldir'
24545 d_telldirproto='$d_telldirproto'
24546 d_tgamma='$d_tgamma'
24548 d_timegm='$d_timegm'
24550 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24551 d_tm_tm_zone='$d_tm_tm_zone'
24552 d_tmpnam_r='$d_tmpnam_r'
24554 d_truncate='$d_truncate'
24555 d_truncl='$d_truncl'
24556 d_ttyname_r='$d_ttyname_r'
24557 d_tzname='$d_tzname'
24558 d_u32align='$d_u32align'
24559 d_ualarm='$d_ualarm'
24562 d_union_semun='$d_union_semun'
24563 d_unordered='$d_unordered'
24564 d_unsetenv='$d_unsetenv'
24565 d_usleep='$d_usleep'
24566 d_usleepproto='$d_usleepproto'
24568 d_vendorarch='$d_vendorarch'
24569 d_vendorbin='$d_vendorbin'
24570 d_vendorlib='$d_vendorlib'
24571 d_vendorscript='$d_vendorscript'
24573 d_void_closedir='$d_void_closedir'
24574 d_voidsig='$d_voidsig'
24575 d_voidtty='$d_voidtty'
24576 d_volatile='$d_volatile'
24577 d_vprintf='$d_vprintf'
24578 d_vsnprintf='$d_vsnprintf'
24580 d_waitpid='$d_waitpid'
24581 d_wcscmp='$d_wcscmp'
24582 d_wcstombs='$d_wcstombs'
24583 d_wcsxfrm='$d_wcsxfrm'
24584 d_wctomb='$d_wctomb'
24585 d_writev='$d_writev'
24588 db_hashtype='$db_hashtype'
24589 db_prefixtype='$db_prefixtype'
24590 db_version_major='$db_version_major'
24591 db_version_minor='$db_version_minor'
24592 db_version_patch='$db_version_patch'
24593 direntrytype='$direntrytype'
24596 doubleinfbytes='$doubleinfbytes'
24597 doublekind='$doublekind'
24598 doublemantbits='$doublemantbits'
24599 doublenanbytes='$doublenanbytes'
24600 doublesize='$doublesize'
24602 drand48_r_proto='$drand48_r_proto'
24604 dynamic_ext='$dynamic_ext'
24610 endgrent_r_proto='$endgrent_r_proto'
24611 endhostent_r_proto='$endhostent_r_proto'
24612 endnetent_r_proto='$endnetent_r_proto'
24613 endprotoent_r_proto='$endprotoent_r_proto'
24614 endpwent_r_proto='$endpwent_r_proto'
24615 endservent_r_proto='$endservent_r_proto'
24616 eunicefix='$eunicefix'
24619 extensions='$extensions'
24620 extern_C='$extern_C'
24622 fflushNULL='$fflushNULL'
24623 fflushall='$fflushall'
24625 firstmakefile='$firstmakefile'
24627 fpossize='$fpossize'
24628 fpostype='$fpostype'
24629 freetype='$freetype'
24632 full_csh='$full_csh'
24633 full_sed='$full_sed'
24634 gccansipedantic='$gccansipedantic'
24635 gccosandvers='$gccosandvers'
24636 gccversion='$gccversion'
24637 getgrent_r_proto='$getgrent_r_proto'
24638 getgrgid_r_proto='$getgrgid_r_proto'
24639 getgrnam_r_proto='$getgrnam_r_proto'
24640 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24641 gethostbyname_r_proto='$gethostbyname_r_proto'
24642 gethostent_r_proto='$gethostent_r_proto'
24643 getlogin_r_proto='$getlogin_r_proto'
24644 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24645 getnetbyname_r_proto='$getnetbyname_r_proto'
24646 getnetent_r_proto='$getnetent_r_proto'
24647 getprotobyname_r_proto='$getprotobyname_r_proto'
24648 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24649 getprotoent_r_proto='$getprotoent_r_proto'
24650 getpwent_r_proto='$getpwent_r_proto'
24651 getpwnam_r_proto='$getpwnam_r_proto'
24652 getpwuid_r_proto='$getpwuid_r_proto'
24653 getservbyname_r_proto='$getservbyname_r_proto'
24654 getservbyport_r_proto='$getservbyport_r_proto'
24655 getservent_r_proto='$getservent_r_proto'
24656 getspnam_r_proto='$getspnam_r_proto'
24657 gidformat='$gidformat'
24663 gmtime_r_proto='$gmtime_r_proto'
24664 gnulibc_version='$gnulibc_version'
24666 groupcat='$groupcat'
24667 groupstype='$groupstype'
24670 h_sysfile='$h_sysfile'
24673 hostgenerate='$hostgenerate'
24674 hostosname='$hostosname'
24675 hostperl='$hostperl'
24676 html1dir='$html1dir'
24677 html1direxp='$html1direxp'
24678 html3dir='$html3dir'
24679 html3direxp='$html3direxp'
24688 i_arpainet='$i_arpainet'
24689 i_assert='$i_assert'
24691 i_bsdioctl='$i_bsdioctl'
24695 i_dirent='$i_dirent'
24697 i_execinfo='$i_execinfo'
24702 i_fp_class='$i_fp_class'
24704 i_gdbm_ndbm='$i_gdbm_ndbm'
24705 i_gdbmndbm='$i_gdbmndbm'
24707 i_ieeefp='$i_ieeefp'
24708 i_inttypes='$i_inttypes'
24709 i_langinfo='$i_langinfo'
24710 i_libutil='$i_libutil'
24711 i_limits='$i_limits'
24712 i_locale='$i_locale'
24713 i_machcthr='$i_machcthr'
24714 i_malloc='$i_malloc'
24715 i_mallocmalloc='$i_mallocmalloc'
24717 i_memory='$i_memory'
24718 i_mntent='$i_mntent'
24721 i_neterrno='$i_neterrno'
24722 i_netinettcp='$i_netinettcp'
24726 i_pthread='$i_pthread'
24728 i_quadmath='$i_quadmath'
24729 i_rpcsvcdbm='$i_rpcsvcdbm'
24731 i_shadow='$i_shadow'
24733 i_stdarg='$i_stdarg'
24734 i_stdbool='$i_stdbool'
24735 i_stddef='$i_stddef'
24736 i_stdint='$i_stdint'
24737 i_stdlib='$i_stdlib'
24738 i_string='$i_string'
24739 i_sunmath='$i_sunmath'
24740 i_sysaccess='$i_sysaccess'
24741 i_sysdir='$i_sysdir'
24742 i_sysfile='$i_sysfile'
24743 i_sysfilio='$i_sysfilio'
24745 i_sysioctl='$i_sysioctl'
24746 i_syslog='$i_syslog'
24747 i_sysmman='$i_sysmman'
24748 i_sysmode='$i_sysmode'
24749 i_sysmount='$i_sysmount'
24750 i_sysndir='$i_sysndir'
24751 i_sysparam='$i_sysparam'
24752 i_syspoll='$i_syspoll'
24753 i_sysresrc='$i_sysresrc'
24754 i_syssecrt='$i_syssecrt'
24755 i_sysselct='$i_sysselct'
24756 i_syssockio='$i_syssockio'
24757 i_sysstat='$i_sysstat'
24758 i_sysstatfs='$i_sysstatfs'
24759 i_sysstatvfs='$i_sysstatvfs'
24760 i_systime='$i_systime'
24761 i_systimek='$i_systimek'
24762 i_systimes='$i_systimes'
24763 i_systypes='$i_systypes'
24764 i_sysuio='$i_sysuio'
24766 i_sysutsname='$i_sysutsname'
24767 i_sysvfs='$i_sysvfs'
24768 i_syswait='$i_syswait'
24769 i_termio='$i_termio'
24770 i_termios='$i_termios'
24772 i_unistd='$i_unistd'
24775 i_values='$i_values'
24776 i_varargs='$i_varargs'
24777 i_varhdr='$i_varhdr'
24779 ignore_versioned_solibs='$ignore_versioned_solibs'
24780 inc_version_list='$inc_version_list'
24781 inc_version_list_init='$inc_version_list_init'
24785 initialinstalllocation='$initialinstalllocation'
24786 installarchlib='$installarchlib'
24787 installbin='$installbin'
24788 installhtml1dir='$installhtml1dir'
24789 installhtml3dir='$installhtml3dir'
24790 installman1dir='$installman1dir'
24791 installman3dir='$installman3dir'
24792 installprefix='$installprefix'
24793 installprefixexp='$installprefixexp'
24794 installprivlib='$installprivlib'
24795 installscript='$installscript'
24796 installsitearch='$installsitearch'
24797 installsitebin='$installsitebin'
24798 installsitehtml1dir='$installsitehtml1dir'
24799 installsitehtml3dir='$installsitehtml3dir'
24800 installsitelib='$installsitelib'
24801 installsiteman1dir='$installsiteman1dir'
24802 installsiteman3dir='$installsiteman3dir'
24803 installsitescript='$installsitescript'
24804 installstyle='$installstyle'
24805 installusrbinperl='$installusrbinperl'
24806 installvendorarch='$installvendorarch'
24807 installvendorbin='$installvendorbin'
24808 installvendorhtml1dir='$installvendorhtml1dir'
24809 installvendorhtml3dir='$installvendorhtml3dir'
24810 installvendorlib='$installvendorlib'
24811 installvendorman1dir='$installvendorman1dir'
24812 installvendorman3dir='$installvendorman3dir'
24813 installvendorscript='$installvendorscript'
24815 issymlink='$issymlink'
24816 ivdformat='$ivdformat'
24819 known_extensions='$known_extensions'
24822 ld_can_script='$ld_can_script'
24823 lddlflags='$lddlflags'
24825 ldflags_uselargefiles='$ldflags_uselargefiles'
24826 ldlibpthname='$ldlibpthname'
24833 libsdirs='$libsdirs'
24834 libsfiles='$libsfiles'
24835 libsfound='$libsfound'
24836 libspath='$libspath'
24837 libswanted='$libswanted'
24838 libswanted_uselargefiles='$libswanted_uselargefiles'
24844 localtime_r_proto='$localtime_r_proto'
24845 locincpth='$locincpth'
24846 loclibpth='$loclibpth'
24847 longdblinfbytes='$longdblinfbytes'
24848 longdblkind='$longdblkind'
24849 longdblmantbits='$longdblmantbits'
24850 longdblnanbytes='$longdblnanbytes'
24851 longdblsize='$longdblsize'
24852 longlongsize='$longlongsize'
24853 longsize='$longsize'
24857 lseeksize='$lseeksize'
24858 lseektype='$lseektype'
24862 make_set_make='$make_set_make'
24863 mallocobj='$mallocobj'
24864 mallocsrc='$mallocsrc'
24865 malloctype='$malloctype'
24867 man1direxp='$man1direxp'
24870 man3direxp='$man3direxp'
24872 mips_type='$mips_type'
24873 mistrustnm='$mistrustnm'
24875 mmaptype='$mmaptype'
24876 modetype='$modetype'
24878 multiarch='$multiarch'
24880 myarchname='$myarchname'
24881 mydomain='$mydomain'
24882 myhostname='$myhostname'
24885 need_va_copy='$need_va_copy'
24886 netdb_hlen_type='$netdb_hlen_type'
24887 netdb_host_type='$netdb_host_type'
24888 netdb_name_type='$netdb_name_type'
24889 netdb_net_type='$netdb_net_type'
24892 nm_so_opt='$nm_so_opt'
24893 nonxs_ext='$nonxs_ext'
24895 nvEUformat='$nvEUformat'
24896 nvFUformat='$nvFUformat'
24897 nvGUformat='$nvGUformat'
24898 nv_overflows_integers_at='$nv_overflows_integers_at'
24899 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24900 nveformat='$nveformat'
24901 nvfformat='$nvfformat'
24902 nvgformat='$nvgformat'
24903 nvmantbits='$nvmantbits'
24906 o_nonblock='$o_nonblock'
24908 old_pthread_create_joinable='$old_pthread_create_joinable'
24909 optimize='$optimize'
24910 orderlib='$orderlib'
24913 otherlibdirs='$otherlibdirs'
24917 patchlevel='$patchlevel'
24918 path_sep='$path_sep'
24921 perl_patchlevel='$perl_patchlevel'
24922 perl_static_inline='$perl_static_inline'
24923 perladmin='$perladmin'
24924 perllibs='$perllibs'
24925 perlpath='$perlpath'
24927 phostname='$phostname'
24933 prefixexp='$prefixexp'
24935 privlibexp='$privlibexp'
24936 procselfexe='$procselfexe'
24937 prototype='$prototype'
24939 quadkind='$quadkind'
24940 quadtype='$quadtype'
24941 randbits='$randbits'
24942 randfunc='$randfunc'
24943 random_r_proto='$random_r_proto'
24944 randseedtype='$randseedtype'
24946 rd_nodata='$rd_nodata'
24947 readdir64_r_proto='$readdir64_r_proto'
24948 readdir_r_proto='$readdir_r_proto'
24949 revision='$revision'
24955 sGMTIME_max='$sGMTIME_max'
24956 sGMTIME_min='$sGMTIME_min'
24957 sLOCALTIME_max='$sLOCALTIME_max'
24958 sLOCALTIME_min='$sLOCALTIME_min'
24959 sPRIEUldbl='$sPRIEUldbl'
24960 sPRIFUldbl='$sPRIFUldbl'
24961 sPRIGUldbl='$sPRIGUldbl'
24962 sPRIXU64='$sPRIXU64'
24964 sPRIeldbl='$sPRIeldbl'
24965 sPRIfldbl='$sPRIfldbl'
24966 sPRIgldbl='$sPRIgldbl'
24971 sSCNfldbl='$sSCNfldbl'
24972 sched_yield='$sched_yield'
24973 scriptdir='$scriptdir'
24974 scriptdirexp='$scriptdirexp'
24976 seedfunc='$seedfunc'
24977 selectminbits='$selectminbits'
24978 selecttype='$selecttype'
24979 sendmail='$sendmail'
24980 setgrent_r_proto='$setgrent_r_proto'
24981 sethostent_r_proto='$sethostent_r_proto'
24982 setlocale_r_proto='$setlocale_r_proto'
24983 setnetent_r_proto='$setnetent_r_proto'
24984 setprotoent_r_proto='$setprotoent_r_proto'
24985 setpwent_r_proto='$setpwent_r_proto'
24986 setservent_r_proto='$setservent_r_proto'
24989 sharpbang='$sharpbang'
24990 shmattype='$shmattype'
24991 shortsize='$shortsize'
24994 sig_count='$sig_count'
24995 sig_name='$sig_name'
24996 sig_name_init='$sig_name_init'
24998 sig_num_init='$sig_num_init'
24999 sig_size='$sig_size'
25000 signal_t='$signal_t'
25001 sitearch='$sitearch'
25002 sitearchexp='$sitearchexp'
25004 sitebinexp='$sitebinexp'
25005 sitehtml1dir='$sitehtml1dir'
25006 sitehtml1direxp='$sitehtml1direxp'
25007 sitehtml3dir='$sitehtml3dir'
25008 sitehtml3direxp='$sitehtml3direxp'
25010 sitelib_stem='$sitelib_stem'
25011 sitelibexp='$sitelibexp'
25012 siteman1dir='$siteman1dir'
25013 siteman1direxp='$siteman1direxp'
25014 siteman3dir='$siteman3dir'
25015 siteman3direxp='$siteman3direxp'
25016 siteprefix='$siteprefix'
25017 siteprefixexp='$siteprefixexp'
25018 sitescript='$sitescript'
25019 sitescriptexp='$sitescriptexp'
25020 sizesize='$sizesize'
25021 sizetype='$sizetype'
25025 sockethdr='$sockethdr'
25026 socketlib='$socketlib'
25027 socksizetype='$socksizetype'
25029 spackage='$spackage'
25030 spitshell='$spitshell'
25031 srand48_r_proto='$srand48_r_proto'
25032 srandom_r_proto='$srandom_r_proto'
25034 ssizetype='$ssizetype'
25035 st_ino_sign='$st_ino_sign'
25036 st_ino_size='$st_ino_size'
25037 startperl='$startperl'
25039 static_ext='$static_ext'
25041 stdio_base='$stdio_base'
25042 stdio_bufsiz='$stdio_bufsiz'
25043 stdio_cnt='$stdio_cnt'
25044 stdio_filbuf='$stdio_filbuf'
25045 stdio_ptr='$stdio_ptr'
25046 stdio_stream_array='$stdio_stream_array'
25047 strerror_r_proto='$strerror_r_proto'
25050 subversion='$subversion'
25055 targetarch='$targetarch'
25056 targetdir='$targetdir'
25057 targetenv='$targetenv'
25058 targethost='$targethost'
25059 targetmkdir='$targetmkdir'
25060 targetport='$targetport'
25061 targetsh='$targetsh'
25065 timeincl='$timeincl'
25066 timetype='$timetype'
25067 tmpnam_r_proto='$tmpnam_r_proto'
25073 ttyname_r_proto='$ttyname_r_proto'
25082 uidformat='$uidformat'
25088 uquadtype='$uquadtype'
25089 use5005threads='$use5005threads'
25090 use64bitall='$use64bitall'
25091 use64bitint='$use64bitint'
25092 usecbacktrace='$usecbacktrace'
25093 usecrosscompile='$usecrosscompile'
25094 usedevel='$usedevel'
25096 usedtrace='$usedtrace'
25097 usefaststdio='$usefaststdio'
25098 useithreads='$useithreads'
25099 usekernprocpathname='$usekernprocpathname'
25100 uselargefiles='$uselargefiles'
25101 uselongdouble='$uselongdouble'
25102 usemallocwrap='$usemallocwrap'
25103 usemorebits='$usemorebits'
25104 usemultiplicity='$usemultiplicity'
25105 usemymalloc='$usemymalloc'
25107 usensgetexecutablepath='$usensgetexecutablepath'
25108 useopcode='$useopcode'
25109 useperlio='$useperlio'
25110 useposix='$useposix'
25111 usequadmath='$usequadmath'
25112 usereentrant='$usereentrant'
25113 userelocatableinc='$userelocatableinc'
25114 useshrplib='$useshrplib'
25115 usesitecustomize='$usesitecustomize'
25116 usesocks='$usesocks'
25117 usethreads='$usethreads'
25118 usevendorprefix='$usevendorprefix'
25119 useversionedarchname='$useversionedarchname'
25120 usevfork='$usevfork'
25123 uvXUformat='$uvXUformat'
25124 uvoformat='$uvoformat'
25127 uvuformat='$uvuformat'
25128 uvxformat='$uvxformat'
25130 vendorarch='$vendorarch'
25131 vendorarchexp='$vendorarchexp'
25132 vendorbin='$vendorbin'
25133 vendorbinexp='$vendorbinexp'
25134 vendorhtml1dir='$vendorhtml1dir'
25135 vendorhtml1direxp='$vendorhtml1direxp'
25136 vendorhtml3dir='$vendorhtml3dir'
25137 vendorhtml3direxp='$vendorhtml3direxp'
25138 vendorlib='$vendorlib'
25139 vendorlib_stem='$vendorlib_stem'
25140 vendorlibexp='$vendorlibexp'
25141 vendorman1dir='$vendorman1dir'
25142 vendorman1direxp='$vendorman1direxp'
25143 vendorman3dir='$vendorman3dir'
25144 vendorman3direxp='$vendorman3direxp'
25145 vendorprefix='$vendorprefix'
25146 vendorprefixexp='$vendorprefixexp'
25147 vendorscript='$vendorscript'
25148 vendorscriptexp='$vendorscriptexp'
25150 version_patchlevel_string='$version_patchlevel_string'
25151 versiononly='$versiononly'
25155 yaccflags='$yaccflags'
25160 : add special variables
25161 $test -f $src/patchlevel.h && \
25162 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25163 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25164 echo "PERL_CONFIG_SH=true" >>config.sh
25166 : propagate old symbols
25167 if $test -f UU/config.sh; then
25168 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25169 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25170 config.sh config.sh UU/oldconfig.sh |\
25171 $sort | $uniq -u >UU/oldsyms
25172 set X `$cat UU/oldsyms`
25178 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25180 echo ": Variables propagated from previous config.sh file." >>config.sh
25181 for sym in `$cat UU/oldsyms`; do
25182 echo " Propagating $hint variable "'$'"$sym..."
25183 eval 'tmp="$'"${sym}"'"'
25185 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25191 : preserve RCS keywords in files with variable substitution, grrr
25194 : Finish up by extracting the .SH files
25198 echo "Extraction done."
25208 If you'd like to make any changes to the config.sh file before I begin
25209 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25212 rp="Press return or use a shell escape to edit config.sh:"
25217 *) : in case they cannot read
25218 sh 1>&4 -c "$ans";;
25223 : if this fails, just run all the .SH files by hand
25232 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25239 Now you need to generate make dependencies by running "$make depend".
25240 You might prefer to run it in background: "$make depend > makedepend.out &"
25241 It can take a while, so you might not want to run it right now.
25246 rp="Run $make depend now?"
25250 $make depend && echo "Now you must run '$make'."
25253 echo "You must run '$make depend' then '$make'."
25256 elif test -f [Mm]akefile; then
25258 echo "Now you must run a $make."
25260 echo "Configure done."
25263 if $test -f Policy.sh; then
25266 If you compile $package on a different machine or from a different object
25267 directory, copy the Policy.sh file from this object directory to the
25268 new one before you run Configure -- this will help you with most of
25269 the policy defaults.
25273 if $test -f config.msg; then
25274 echo "Hmm. I also noted the following information while running:"
25276 $cat config.msg >&4
25279 $rm -f kit*isdone ark*isdone