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=''
530 gethostbyaddr_r_proto=''
532 gethostbyname_r_proto=''
534 gethostent_r_proto=''
547 getnetbyaddr_r_proto=''
549 getnetbyname_r_proto=''
563 d_getprotobyname_r=''
564 getprotobyname_r_proto=''
565 d_getprotobynumber_r=''
566 getprotobynumber_r_proto=''
568 getprotoent_r_proto=''
580 getservbyname_r_proto=''
582 getservbyport_r_proto=''
584 getservent_r_proto=''
617 d_lc_monetary_2008=''
622 d_libm_lib_version=''
629 d_localtime_r_needs_tzset=''
649 d_malloc_good_size=''
697 d_old_pthread_create_joinable=''
698 old_pthread_create_joinable=''
700 d_pthread_attr_setscope=''
748 sethostent_r_proto=''
765 setprotoent_r_proto=''
777 setservent_r_proto=''
788 d_siginfo_si_errno=''
792 d_siginfo_si_status=''
794 d_siginfo_si_value=''
806 d_ipv6_mreq_source=''
823 d_sprintf_returns_strlen=''
836 perl_static_inline=''
841 d_stdio_ptr_lval_nochange_cnt=''
842 d_stdio_ptr_lval_sets_cnt=''
994 d_gdbm_ndbm_h_uses_prototypes=''
995 d_gdbmndbm_h_uses_prototypes=''
997 d_ndbm_h_uses_prototypes=''
1073 d_inc_version_list=''
1075 inc_version_list_init=''
1083 installusrbinperl=''
1099 ignore_versioned_solibs=''
1163 d_perl_otherlibdirs=''
1171 api_versionstring=''
1177 version_patchlevel_string=''
1181 d_nv_preserves_uv=''
1182 d_nv_zero_is_allbits_zero=''
1193 nv_overflows_integers_at=''
1194 nv_preserves_uv_bits=''
1267 installsitehtml1dir=''
1270 installsitehtml3dir=''
1277 installsiteman1dir=''
1280 installsiteman3dir=''
1285 installsitescript=''
1303 d_stdio_stream_array=''
1304 stdio_stream_array=''
1323 usekernprocpathname=''
1324 ccflags_uselargefiles=''
1325 ldflags_uselargefiles=''
1326 libswanted_uselargefiles=''
1335 usensgetexecutablepath=''
1349 installvendorarch=''
1356 installvendorhtml1dir=''
1358 vendorhtml1direxp=''
1359 installvendorhtml3dir=''
1361 vendorhtml3direxp=''
1367 installvendorman1dir=''
1370 installvendorman3dir=''
1377 installvendorscript=''
1388 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1391 : We must find out about Eunice early
1393 if test -f /etc/unixtovms; then
1394 eunicefix=/etc/unixtovms
1396 if test -f /etc/unixtovms.exe; then
1397 eunicefix=/etc/unixtovms.exe
1400 : Set executable suffix now -- needed before hints available
1401 if test -f "/libs/version.library"; then
1404 elif test -f "/system/gnu_library/bin/ar.pm"; then
1407 elif test -n "$DJGPP"; then
1410 elif test -f /kern/cookiejar; then
1413 elif test -d c:/. -o -n "$is_os2" ; then
1420 : Trailing extension. Override this in a hint file, if needed.
1421 : Extra object files, if any, needed on this platform.
1424 : Possible local include directories to search.
1425 : Set locincpth to "" in a hint file to defeat local include searches.
1426 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1427 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1429 : no include file wanted by default
1432 : Enable -DEBUGGING and -DDEBUGGING from the command line
1437 : change the next line if compiling for Xenix/286 on Xenix/386
1438 xlibpth='/usr/lib/386 /lib/386'
1439 : Possible local library directories to search.
1440 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1441 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1443 : general looking path for locating libraries
1444 glibpth="/lib /usr/lib $xlibpth"
1445 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1446 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1447 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1448 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1450 : Private path used by Configure to find libraries. Its value
1451 : is prepended to libpth. This variable takes care of special
1452 : machines, like the mips. Usually, it should be empty.
1455 : default library list
1457 : some systems want to use only the non-versioned libso:s
1458 ignore_versioned_solibs=''
1459 : set usethreads on the Configure command line to enable threads.
1460 usereentrant='undef'
1464 : set useposix=false in your hint file to disable the POSIX extension.
1466 : set useopcode=false in your hint file to disable the Opcode extension.
1469 ccflags_uselargefiles=''
1470 ldflags_uselargefiles=''
1471 libswanted_uselargefiles=''
1472 : set usemultiplicity on the Configure command line to enable multiplicity.
1473 : set usesocks on the Configure command line to enable socks.
1474 : List of libraries we want.
1475 : If anyone needs extra -lxxx, put those in a hint file.
1476 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1477 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1478 : We probably want to search /usr/shlib before most other libraries.
1479 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1480 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1481 glibpth="/usr/shlib $glibpth"
1482 : Do not use vfork unless overridden by a hint file.
1485 : Find the basic shell for Bourne shell scripts
1489 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1492 if test -f "$xxx"; then
1495 : Build up a list and do a single loop so we can 'break' out.
1496 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1497 for xxx in sh bash ksh pdksh ash; do
1499 try="$try ${p}/${xxx}"
1503 if test -f "$xxx"; then
1506 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1509 elif test -f "$xxx.exe"; then
1520 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1522 Usually it's in /bin/sh. How did you even get this far?
1523 Please contact me (Perl Maintainers) at perlbug@perl.org and
1524 we'll try to straighten this all out.
1530 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1531 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1534 : see if sh knows # comments
1535 if `$sh -c '#' >/dev/null 2>&1`; then
1539 test -f $xcat$_exe || xcat=/usr/bin/cat
1540 if test ! -f $xcat$_exe; then
1541 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1542 if test -f $p/cat$_exe; then
1547 if test ! -f $xcat$_exe; then
1548 echo "Can't find cat anywhere!"
1552 echo "#!$xcat" >sharp
1555 ./sharp > today 2>/dev/null
1556 if test -s today; then
1559 echo "#! $xcat" > sharp
1562 ./sharp > today 2>/dev/null
1563 if test -s today; then
1571 echo "Your $sh doesn't grok # comments--I will strip them later on."
1574 echo "exec grep -v '^[ ]*#'" >spitshell
1576 $eunicefix spitshell
1577 spitshell=`pwd`/spitshell
1579 echo "I presume that if # doesn't work, #! won't work either!"
1584 : figure out how to guarantee sh startup
1586 '') startsh=${sharpbang}${sh} ;;
1598 : echo "Yup, it does."
1600 echo "Hmm... '$startsh' does not guarantee sh startup..."
1601 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1605 : Save command line options in file UU/cmdline.opt for later use in
1606 : generating config.sh.
1607 cat > cmdline.opt <<EOSH
1608 : Configure command line arguments.
1617 cat >>cmdline.opt <<EOSH
1618 config_arg$argn='$arg'
1620 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1623 arg_exp=`cat cmdl.opt`
1624 args_exp="$args_exp$args_sep'$arg_exp'"
1625 argn=`expr $argn + 1`
1630 : produce awk script to parse command line options
1631 cat >options.awk <<'EOF'
1633 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1635 len = length(optstr);
1636 for (i = 1; i <= len; i++) {
1637 c = substr(optstr, i, 1);
1638 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1649 if (substr(str, 1, 1) != "-") {
1650 printf("'%s'\n", str);
1654 for (i = 2; i <= len; i++) {
1655 c = substr(str, i, 1);
1657 printf("-%s\n", substr(str, i));
1663 printf("'%s'\n", substr(str, i + 1));
1676 : process the command line options
1677 set X `for arg in "$@"; do echo "X$arg"; done |
1678 sed -e s/X// | awk -f options.awk`
1683 : set up default values
1692 rm -f optdef.sh posthint.sh
1693 cat >optdef.sh <<EOS
1699 while test $# -gt 0; do
1701 -d) shift; fastread=yes;;
1702 -e) shift; alldone=cont;;
1706 if test -r "$1"; then
1709 echo "$me: cannot read config file $1." >&2
1715 -h) shift; error=true;;
1716 -r) shift; reuseval=true;;
1717 -s) shift; silent=true; realsilent=true;;
1718 -E) shift; alldone=exit;;
1719 -K) shift; knowitall=true;;
1721 -S) shift; silent=true; extractsh=true;;
1726 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1727 echo "$me: ignoring -D $1" >&2
1730 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1731 *) echo "$1='define'" >> optdef.sh;;
1738 *=) echo "$1" >> optdef.sh;;
1740 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1741 echo "$me: ignoring -U $1" >&2
1743 *) echo "$1='undef'" >> optdef.sh;;
1754 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1758 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1759 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1765 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1766 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1767 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1768 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1769 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1770 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1776 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1778 echo "$yyy=''" >> posthint.sh ;;
1783 echo "$yyy='$zzz'" >> posthint.sh ;;
1785 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1787 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1792 echo "$yyy=$zzz" >> posthint.sh ;;
1793 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1797 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1800 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1808 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1809 [-U symbol] [-U symbol=] [-A command:symbol...]
1810 -d : use defaults for all answers.
1811 -e : go on without questioning past the production of config.sh.
1812 -f : specify an alternate default configuration file.
1813 -h : print this help message and exit (with an error status).
1814 -r : reuse C symbols value if possible (skips costly nm extraction).
1815 -s : silent mode, only echoes questions and essential information.
1816 -D : define symbol to have some value:
1817 -D symbol symbol gets the value 'define'
1818 -D symbol=value symbol gets the value 'value'
1819 common used examples (see INSTALL for more info):
1820 -Duse64bitint use 64bit integers
1821 -Duse64bitall use 64bit integers and pointers
1822 -Dusethreads use thread support
1823 -Dinc_version_list=none do not include older perl trees in @INC
1824 -DEBUGGING=none DEBUGGING options
1825 -Dcc=gcc choose your compiler
1826 -Dprefix=/opt/perl5 choose your destination
1827 -E : stop at the end of questions, after having produced config.sh.
1828 -K : do not use unless you know what you are doing.
1829 -O : ignored for backward compatibility
1830 -S : perform variable substitutions on all .SH files (can mix with -f)
1831 -U : undefine symbol:
1832 -U symbol symbol gets the value 'undef'
1833 -U symbol= symbol gets completely empty
1835 -A : manipulate symbol after the platform specific hints have been applied:
1836 -A append:symbol=value append value to symbol
1837 -A symbol=value like append:, but with a separating space
1838 -A define:symbol=value define symbol to have value
1839 -A clear:symbol define symbol to be ''
1840 -A define:symbol define symbol to be 'define'
1841 -A eval:symbol=value define symbol to be eval of value
1842 -A prepend:symbol=value prepend value to symbol
1843 -A undef:symbol define symbol to be 'undef'
1844 -A undef:symbol= define symbol to be ''
1845 e.g.: -A prepend:libswanted='cl pthread '
1846 -A ccflags=-DSOME_MACRO
1847 -V : print version number and exit (with a zero status).
1854 case "$fastread$alldone" in
1857 case "$extractsh" in
1860 if test ! -t 0; then
1861 echo "Say 'sh Configure', not 'sh <Configure'"
1871 true) exec 1>/dev/null;;
1874 : run the defines and the undefines, if any, but leave the file out there...
1876 grep '\\' optdef.sh >/dev/null 2>&1
1877 if test $? = 0; then
1878 echo "Configure does not support \\ in -D arguments"
1882 : create the posthint manipulation script and leave the file out there...
1887 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1888 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1889 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1890 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1891 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1894 : Some greps do not return status, grrr.
1895 echo "grimblepritz" >grimble
1896 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1898 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1904 : the following should work in any shell
1908 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1909 cat >contains <<'EOSS'
1910 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1915 : Find the path to the source tree
1918 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1922 *) src=`cd ../$src && pwd` ;;
1935 if test -f $rsrc/Configure && \
1936 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1938 : found it, so we are ok.
1941 for src in . .. ../.. ../../.. ../../../..; do
1942 if test -f ../$src/Configure && \
1943 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1954 Sorry, I can't seem to locate the source dir for $package. Please start
1955 Configure with an explicit path -- i.e. /some/path/Configure.
1963 echo "Sources for $package found in \"$src\"." >&4
1967 : script used to extract .SH files with variable substitutions
1968 cat >extract <<'EOS'
1970 echo "Doing variable substitutions on .SH files..."
1971 if test -f MANIFEST; then
1972 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1974 echo "(Looking for .SH files under the source directory.)"
1975 set x `(cd "$src"; find . -name "*.SH" -print)`
1979 0) set x `(cd "$src"; echo *.SH)`; shift;;
1981 if test ! -f "$src/$1"; then
1987 while test $name; do
1988 if test ! -d "$name"; then
1989 create="$name $create";
1990 name=`echo $name | sed -e "s|^[^/]*$||"`;
1991 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1996 for file in $create; do
2005 dir=`expr X$file : 'X\(.*\)/'`
2006 file=`expr X$file : 'X.*/\(.*\)'`
2007 (cd "$dir" && . ./$file)
2017 dir=`expr X$file : 'X\(.*\)/'`
2018 file=`expr X$file : 'X.*/\(.*\)'`
2019 (set x $dir; shift; eval $mkdir_p)
2020 sh <"$src/$dir/$file"
2029 if test -f "$src/config_h.SH"; then
2030 if test ! -f config.h; then
2031 : oops, they left it out of MANIFEST, probably, so do it anyway.
2032 . "$src/config_h.SH"
2037 : extract files and exit if asked to do so
2038 case "$extractsh" in
2040 case "$realsilent" in
2044 case "$config_sh" in
2045 '') config_sh='config.sh';;
2048 echo "Fetching answers from $config_sh..."
2055 echo "Extraction done."
2060 : Eunice requires " " instead of "", can you believe it
2063 echo "Beginning of configuration questions for $package."
2065 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2067 : first determine how to suppress newline on echo command
2069 echo "Checking echo to see how to suppress newlines..."
2070 (echo "hi there\c" ; echo " ") >.echotmp
2071 if $contains c .echotmp >/dev/null 2>&1 ; then
2082 echo $n "The star should be here-->$c"
2086 : Now test for existence of everything in MANIFEST
2088 if test -f "$rsrc/MANIFEST"; then
2089 echo "First let's make sure your kit is complete. Checking..." >&4
2090 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2091 (split -l 50 2>/dev/null || split -50)
2094 for filelist in x??; do
2095 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2096 >/dev/null 2>>"$tmppwd/missing")
2098 if test -s missing; then
2102 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2104 You have the option of continuing the configuration process, despite the
2105 distinct possibility that your kit is damaged, by typing 'y'es. If you
2106 do, don't blame me if something goes wrong. I advise you to type 'n'o
2107 and contact the author (perlbug@perl.org).
2110 echo $n "Continue? [n] $c" >&4
2114 echo "Continuing..." >&4
2118 echo "ABORTING..." >&4
2123 echo "Looks good..."
2126 echo "There is no MANIFEST file. I hope your kit is complete !"
2130 : Find the appropriate value for a newline for tr
2132 if test -n "$DJGPP"; then
2135 if test X"$trnl" = X; then
2136 case "`echo foo|tr '\n' x 2>/dev/null`" in
2140 if test X"$trnl" = X; then
2141 case "`echo foo|tr '\012' x 2>/dev/null`" in
2142 foox) trnl='\012' ;;
2145 if test X"$trnl" = X; then
2146 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2147 fooxy) trnl='\n\r' ;;
2150 if test X"$trnl" = X; then
2153 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2159 : compute the number of columns on the terminal for proper question formatting
2164 : set up the echo used in my read
2165 myecho="case \"\$xxxm\" in
2166 '') echo $n \"\$rp $c\" >&4;;
2168 '') echo $n \"[\$xxxm] $c\";;
2170 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2172 echo $n \"[\$xxxm] $c\" >&4
2174 echo $n \"\$rp [\$xxxm] $c\" >&4
2180 : now set up to do reads with possible shell escape and default assignment
2186 case "\$fastread" in
2187 yes) case "\$dflt" in
2190 case "\$silent-\$rp" in
2195 *) case "\$silent" in
2196 true) case "\$rp" in
2201 while expr "X\$ans" : "X!" >/dev/null; do
2205 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2213 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2222 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2227 echo "(OK, I'll run with -d after this question.)" >&4
2230 echo "*** Sorry, \$1 not supported yet." >&4
2240 echo "*** Substitution done -- please confirm."
2242 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2247 echo "*** Error -- try again."
2254 case "\$ans\$xxxm\$nostick" in
2266 : create .config dir to save info across Configure sessions
2267 test -d ../.config || mkdir ../.config
2268 cat >../.config/README <<EOF
2269 This directory created by Configure to save information that should
2270 persist across sessions for $package.
2272 You may safely delete it if you wish.
2275 : See if we are using a devel version and want that
2276 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2279 usedevel="$define" ;;
2280 *) case "$xversion" in
2283 *** WHOA THERE!!! ***
2285 This is an UNSTABLE DEVELOPMENT release.
2286 The version of this $package distribution is $xversion, that is, odd,
2287 (as opposed to even) and that signifies a development release.
2288 If you want a maintenance release, you want an even-numbered version.
2290 Do ***NOT*** install this into production use.
2291 Data corruption and crashes are possible.
2293 It is most seriously suggested that you do not continue any further
2294 unless you want to help in developing and debugging Perl.
2296 If you *still* want to build perl, you can answer 'y' now,
2297 or pass -Dusedevel to Configure.
2300 rp='Do you really want to continue?'
2304 [yY]) echo >&4 "Okay, continuing."
2305 usedevel="$define" ;;
2306 *) echo >&4 "Okay, bye."
2317 case "$versiononly" in
2318 '') versiononly="$define" ;;
2320 case "$installusrbinperl" in
2321 '') installusrbinperl="$undef" ;;
2326 : general instructions
2329 user=`(logname) 2>/dev/null`
2331 '') user=`whoami 2>&1`;;
2333 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2336 rp='Would you like to see the instructions?'
2347 This installation shell script will examine your system and ask you questions
2348 to determine how the perl5 package should be installed. If you get
2349 stuck on a question, you may use a ! shell escape to start a subshell or
2350 execute a command. Many of the questions will have default answers in square
2351 brackets; typing carriage return will give you the default.
2353 On some of the questions which ask for file or directory names you are allowed
2354 to use the ~name construct to specify the login directory belonging to "name",
2355 even if you don't have a shell which knows about that. Questions where this is
2356 allowed will be marked "(~name ok)".
2360 dflt='Type carriage return to continue'
2364 The prompter used in this script allows you to use shell variables and
2365 backticks in your answers. You may use $1, $2, etc... to refer to the words
2366 in the default answer, as if the default line was a set of arguments given to a
2367 script shell. This means you may also use $* to repeat the whole default line,
2368 so you do not have to re-type everything to add something to the default.
2370 Every time there is a substitution, you will have to confirm. If there is an
2371 error (e.g. an unmatched backtick), the default answer will remain unchanged
2372 and you will be prompted again.
2374 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2375 the questions and use the computed defaults (or the previous answers if there
2376 was already a config.sh file). Type 'Configure -h' for a list of options.
2377 You may also start interactively and then answer '& -d' at any prompt to turn
2378 on the non-interactive behaviour for the remainder of the execution.
2384 Much effort has been expended to ensure that this shell script will run on any
2385 Unix system. If despite that it blows up on yours, your best bet is to edit
2386 Configure and run it again. If you can't run Configure for some reason,
2387 you'll have to generate a config.sh file by hand. Whatever problems you
2388 have, let me (perlbug@perl.org) know how I blew it.
2390 This installation script affects things in two ways:
2392 1) it may do direct variable substitutions on some of the files included
2394 2) it builds a config.h file for inclusion in C programs. You may edit
2395 any of these files as the need arises after running this script.
2397 If you make a mistake on a question, there is no easy way to back up to it
2398 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2399 files. Configure will offer to let you do this before it runs the SH files.
2402 dflt='Type carriage return to continue'
2404 case "$firsttime" in
2405 true) echo $user >>../.config/instruct;;
2409 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2410 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2411 if test "X$sysroot" = X; then
2416 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2417 # _sysroot is used in places where we need --sysroot=foo
2418 # but using the rest of the flags could cause issues.
2419 _sysroot="--sysroot=$sysroot";
2423 ccflags="$ccflags $_sysroot"
2428 ldflags="$ldflags $_sysroot"
2433 cppflags="$cppflags $_sysroot"
2435 # lddlflags updated below in lddlflags section;
2436 # same with cccdlflags
2440 # Adjust some defaults to also use $sysroot
2441 for var in xlibpth loclibpth locincpth glibpth; do
2444 for path in $xxx; do
2445 eval $var=\"\$$var $sysroot$path\"
2451 : find out where common programs are
2453 echo "Locating common programs..." >&4
2466 if test -d \$dir/\$thing; then
2472 for thisthing in \$dir/\$thing; do
2473 : just loop through to pick last item
2475 if test -f \$thisthing; then
2478 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2481 elif test -f \$dir/\$thing.exe; then
2482 if test -n "$DJGPP"; then
2483 echo \$dir/\$thing.exe
2484 elif test "$eunicefix" != ":"; then
2485 : on Eunice apparently
2538 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2539 pth="$pth $sysroot/lib $sysroot/usr/lib"
2540 for file in $loclist; do
2544 if test -f "$xxx"; then
2547 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2548 xxx=`./loc $file $file $pth`
2551 '') xxx=`./loc $file $file $pth`;;
2552 *) xxx=`./loc $xxx $xxx $pth`;;
2554 eval $file=$xxx$_exe
2558 echo $file is in $xxx.
2561 echo $file is in $xxx.
2564 echo "I don't know where '$file' is, and my life depends on it." >&4
2565 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2571 echo "Don't worry if any of the following aren't found..."
2573 for file in $trylist; do
2577 if test -f "$xxx"; then
2580 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2581 xxx=`./loc $file $file $pth`
2584 '') xxx=`./loc $file $file $pth`;;
2585 *) xxx=`./loc $xxx $xxx $pth`;;
2587 eval $file=$xxx$_exe
2591 echo $file is in $xxx.
2594 echo $file is in $xxx.
2597 echo "I don't see $file out there, $say."
2604 echo "Substituting grep for egrep."
2611 *) if $less -R </dev/null >/dev/null 2>&1; then
2612 echo "Substituting less -R for less."
2620 echo "Substituting cp for ln."
2629 echo "I can't find make or gmake, and my life depends on it." >&4
2630 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2638 *) # We can't have osname yet.
2639 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2640 # Assume that gmake, if found, is definitely GNU make
2641 # and prefer it over the system make.
2642 echo "Substituting gmake for make."
2650 echo "Hopefully test is built into your sh."
2653 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2654 echo "Using the test built into your sh."
2662 echo "Hopefully echo is built into your sh."
2667 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2668 $echo $n "hi there$c" >foo1
2669 echo $n "hi there$c" >foo2
2670 if cmp foo1 foo2 >/dev/null 2>&1; then
2671 echo "They are compatible. In fact, they may be identical."
2678 They are not compatible! You are probably running ksh on a non-USG system.
2679 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2680 have echo built in and we may have to run some Bourne shell scripts. That
2681 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2684 $echo $n "The star should be here-->$c"
2691 # This question was auctioned at YAPC::Europe-2007 in Vienna
2692 # I never promised you could answer it. I only auctioned the question.
2694 The following message is sponsored by
2696 Dresden.pm<--The stars should be here.
2698 Dear Perl user, system administrator or package
2699 maintainer, the Perl community sends greetings to
2700 you. Do you (emblematical) greet back [Y/n]? n
2704 : Check what type of C compiler we use
2708 cat <<'EOSC' >>trygcc
2713 int main(int argc, char *argv[]) {
2717 if $cc -o try $ccflags $ldflags try.c; then
2720 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2726 # Skip this test because it gives a false match on output like:
2727 # ./trygcc: line 23: cc: command not found
2728 # case "`$cc -v -c try.c 2>&1`" in
2729 # *gcc*) trygcc=no ;;
2731 if $test X"$trygcc" = Xyes; then
2732 if gcc -o try -c try.c; then
2734 echo "You seem to have a working gcc, though." >&4
2735 # Switching compilers may undo the work of hints files.
2736 # The most common problem is -D_REENTRANT for threads.
2737 # This heuristic catches that case, but gets false positives
2738 # if -Dusethreads was not actually specified. Better to
2739 # bail out here with a useful message than fail
2740 # mysteriously later. Should we perhaps just try to
2741 # re-invoke Configure -Dcc=gcc config_args ?
2742 if $test -f usethreads.cbu; then
2745 *** However, any setting of the C compiler flags (e.g. for thread support)
2746 *** will be lost. It may be necessary for you to restart Configure and
2747 *** add -Dcc=gcc to your Configure command line.
2750 rp="Would you like to go ahead and try gcc anyway?"
2753 rp="Would you like to use it?"
2756 if $test -f myread; then
2759 if $test -f UU/myread; then
2762 echo "Cannot find myread, sorry. Aborting." >&2
2767 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2780 cat <<'EOSC' >>checkcc
2785 int main(int argc, char *argv[]) {
2789 if $cc -o try $ccflags $ldflags try.c; then
2792 if $test X"$despair" = Xyes; then
2793 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2796 You need to find a working C compiler.
2797 Either (purchase and) install the C compiler supplied by your OS vendor,
2798 or for a free C compiler try http://gcc.gnu.org/
2799 I cannot continue any further, aborting.
2808 : determine whether symbolic links are supported
2811 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2812 echo "Symbolic links are supported." >&4
2815 echo "Symbolic links are NOT supported." >&4
2820 : determine whether symbolic links are supported
2824 echo "Checking how to test for symbolic links..." >&4
2826 if $test "X$issymlink" = X; then
2828 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2829 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2831 if test $? = 0; then
2834 echo "Your builtin 'test -h' may be broken." >&4
2837 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2840 if test -f "$p/$test"; then
2849 echo "Trying external '$test -h'." >&4
2850 issymlink="$test -h"
2851 if $test ! -h sym >/dev/null 2>&1; then
2852 echo "External '$test -h' is broken, too." >&4
2860 if $test "X$issymlink" = X; then
2861 if $test -L sym 2>/dev/null; then
2862 issymlink="$test -L"
2863 echo "The builtin '$test -L' worked." >&4
2866 if $test "X$issymlink" != X; then
2867 echo "You can test for symbolic links with '$issymlink'." >&4
2869 echo "I do not know how you can test for symbolic links." >&4
2873 *) echo "No symbolic links, so not testing for their testing..." >&4
2878 : Make symlinks util
2879 case "$mksymlinks" in
2882 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2885 *) case "$lns:$issymlink" in
2886 *"ln"*" -s:"*"test -"?)
2887 echo "Creating the symbolic links..." >&4
2889 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2899 print "# dir = ", dir, "file = ", file
2900 mf[dir] = mf[dir]" "source"/"dir"/"file;
2903 if (d != ".") { print("mkdir -p "d) }
2904 print("ln -sf "mf[d]" "d);
2906 }' source="$src" > UU/mksymlinks.$$
2910 if test ! -d t/base; then
2911 echo "Failed to create the subdirectories. Aborting." >&4
2915 if test ! -f t/base/lex.t; then
2916 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2919 if test ! -f win32/win32.c; then
2920 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2925 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2933 : Check for Cross-Compilation
2934 if $test "X$targethost" = "X"; then
2937 if $test "X$targetenv" = "X"; then
2940 case "$usecrosscompile" in
2942 $echo "Cross-compiling..."
2945 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2946 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2947 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2948 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2949 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2950 # leave out ld, choosing it is more complex
2951 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2952 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2953 # We are in a weird spot. Just before us, some values
2954 # were 'saved', to be restored after the hints are
2955 # run. This means that the changes we made to ar,
2956 # nm and ranlib will get reverted.
2957 # To avoid that, we hijack the saving mechanism and
2958 # have it save our new values.
2959 for file in ar nm ranlib; do
2961 eval $file=$xxx$_exe
2966 case "$targetarch" in
2967 '') echo "Targetarch not defined." >&4; croak=y ;;
2968 *) echo "Using targetarch $targetarch." >&4 ;;
2970 case "$targethost" in
2971 '') echo "Targethost not defined." >&4; croak=y ;;
2972 *) echo "Using targethost $targethost." >&4
2977 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2979 : compile a host miniperl and generate_uudmap, unless we got passed them
2980 if $test "X$hostperl" = X; then
2981 echo "Building host miniperl and generate_uudmap binaries" >&4
2989 $src/Configure -des -Dusedevel -Dmksymlinks
2991 case "$hostgenerate" in
2992 '') $make generate_uudmap
2993 hostgenerate=$src/host/generate_uudmap
2995 "$undef") hostgenerate=''
2998 hostperl=$src/host/miniperl
3001 hostosname=`$hostperl -le 'print $^O'`
3004 usecrosscompile="$undef"
3008 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3009 case "$targethost" in
3010 '') echo "Checking for cross-compile" >&4
3011 case "$usecrosscompile$multiarch" in
3012 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3013 if [ -f Makefile ]; then
3015 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3017 echo "Configure done."
3021 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3028 *) echo "Using targethost $targethost." >&4
3030 /*) run=$src/Cross/run
3031 targetmkdir=$src/Cross/mkdir
3033 from=$src/Cross/from
3035 *) pwd=`$test -f ../Configure & cd ..; pwd`
3037 targetmkdir=$pwd/Cross/mkdir
3039 from=$pwd/Cross/from
3042 case "$targetrun" in
3043 '') targetrun=ssh ;;
3048 case "$targetfrom" in
3049 '') targetfrom=scp ;;
3053 from=$from-$targetfrom
3054 case "$targetdir" in
3056 echo "Guessing targetdir $targetdir." >&4
3059 case "$targetuser" in
3061 echo "Guessing targetuser $targetuser." >&4
3064 case "$targetport" in
3066 echo "Guessing targetport $targetport." >&4
3069 case "$targetfrom" in
3073 case "$targetrun" in
3093 '') cwd=$targetdir ;;
3098 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3104 *) echo "Unknown targetrun '$targetrun'" >&4
3108 case "$targetmkdir" in
3110 cat >$targetmkdir <<EOF
3112 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3114 $chmod a+rx $targetmkdir
3116 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3128 $targetmkdir \`dirname \$f\`
3129 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3132 $targetmkdir $targetdir/\`dirname \$f\`
3133 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3146 $mkdir -p $targetdir/\`dirname \$f\`
3147 $cp \$f $targetdir/\$f || exit 1
3150 $targetmkdir $targetdir/\`dirname \$f\`
3151 $cp \$f $targetdir/\$f || exit 1
3158 *) echo "Unknown targetto '$targetto'" >&4
3162 case "$targetfrom" in
3169 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3174 cp) cat >$from <<EOF
3179 cp $targetdir/\$f . || exit 1
3184 *) echo "Unknown targetfrom '$targetfrom'" >&4
3188 if $test ! -f $run; then
3189 echo "Target 'run' script '$run' not found." >&4
3193 if $test ! -f $to; then
3194 echo "Target 'to' script '$to' not found." >&4
3198 if $test ! -f $from; then
3199 echo "Target 'from' script '$from' not found." >&4
3203 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3207 Using '$run' for remote execution,
3208 and '$from' and '$to'
3209 for remote file transfer.
3215 usecrosscompile="$undef"
3220 : see whether [:lower:] and [:upper:] are supported character classes
3222 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3224 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3228 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3229 # (0xd9 and 0xe2), therefore that is a nice testing point.
3230 if test "X$up" = X -o "X$low" = X; then
3231 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3237 if test "X$up" = X -o "X$low" = X; then
3238 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3244 if test "X$up" = X -o "X$low" = X; then
3245 case "`echo RS | od -x 2>/dev/null`" in
3247 echo "Hey, this might be EBCDIC." >&4
3248 if test "X$up" = X -o "X$low" = X; then
3249 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3250 rs) up='[A-IJ-RS-Z]'
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3266 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3268 echo "Using $up and $low to convert case." >&4
3271 echo "I don't know how to translate letters from upper to lower case." >&4
3272 echo "Your tr is not acting any way I know of." >&4
3276 : set up the translation script tr, must be called with ./tr of course
3280 '[A-Z][a-z]') exec $tr '$up' '$low';;
3281 '[a-z][A-Z]') exec $tr '$low' '$up';;
3288 : Try to determine whether config.sh was made on this system
3289 case "$config_sh" in
3291 myuname=`$uname -a 2>/dev/null`
3292 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3293 # Downcase everything to avoid ambiguity.
3294 # Remove slashes and single quotes so we can use parts of this in
3295 # directory and file names.
3296 # Remove newlines so myuname is sane to use elsewhere.
3297 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3298 # because the A-Z/a-z are not consecutive.
3299 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3300 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3301 newmyuname="$myuname"
3303 case "$knowitall" in
3305 if test -f ../config.sh; then
3306 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3307 eval "`grep myuname= ../config.sh`"
3309 if test "X$myuname" = "X$newmyuname"; then
3317 : Get old answers from old config file if Configure was run on the
3318 : same system, otherwise use the hints.
3321 if test -f config.sh; then
3323 rp="I see a config.sh file. Shall I use it to set the defaults?"
3326 n*|N*) echo "OK, I'll ignore it."
3327 mv config.sh config.sh.old
3328 myuname="$newmyuname"
3330 *) echo "Fetching default answers from your old config.sh file..." >&4
3338 : Older versions did not always set $sh. Catch re-use of such
3348 if test ! -f config.sh; then
3351 First time through, eh? I have some defaults handy for some systems
3352 that need some extra help getting the Configure answers right:
3355 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3357 : Half the following guesses are probably wrong... If you have better
3358 : tests or hints, please send them to perlbug@perl.org
3359 : The metaconfig authors would also appreciate a copy...
3360 $test -f /irix && osname=irix
3361 $test -f /xenix && osname=sco_xenix
3362 $test -f /dynix && osname=dynix
3363 $test -f /dnix && osname=dnix
3364 $test -f /lynx.os && osname=lynxos
3365 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3366 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3367 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3368 $test -f /bin/mips && /bin/mips && osname=mips
3369 $test -d /usr/apollo/bin && osname=apollo
3370 $test -f /etc/saf/_sactab && osname=svr4
3371 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3372 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3373 $test -f /sys/utilities/MultiView && osname=amigaos
3374 if $test -d /MachTen -o -d /MachTen_Folder; then
3376 if $test -x /sbin/version; then
3377 osvers=`/sbin/version | $awk '{print $2}' |
3378 $sed -e 's/[A-Za-z]$//'`
3379 elif $test -x /usr/etc/version; then
3380 osvers=`/usr/etc/version | $awk '{print $2}' |
3381 $sed -e 's/[A-Za-z]$//'`
3387 $test -f /sys/posix.dll &&
3388 $test -f /usr/bin/what &&
3389 set X `/usr/bin/what /sys/posix.dll` &&
3390 $test "$3" = UWIN &&
3394 if $test -f $uname; then
3402 umips) osname=umips ;;
3405 [23]100) osname=mips ;;
3407 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3408 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3411 elif $test -f /etc/kconfig; then
3413 if test "$lns" = "$ln -s"; then
3415 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3417 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3424 if test -n "$DJGPP"; then
3433 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3435 # oslevel can fail with:
3436 # oslevel: Unable to acquire lock.
3437 *not\ found) osvers="$4"."$3" ;;
3438 '<3240'|'<>3240') osvers=3.2.0 ;;
3439 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3440 '=3250'|'>3250') osvers=3.2.5 ;;
3444 bitrig) osname=bitrig
3447 bsd386) osname=bsd386
3450 cygwin*) osname=cygwin
3453 *dc.osx) osname=dcosx
3459 domainos) osname=apollo
3465 dragonfly) osname=dragonfly
3468 dynixptx*) osname=dynixptx
3469 osvers=`echo "$4"|sed 's/^v//'`
3471 freebsd) osname=freebsd
3473 genix) osname=genix ;;
3477 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3490 $test -f /system/lib/libandroid.so && osname=linux-android
3494 netbsd*) osname=netbsd
3497 news-os) osvers="$3"
3499 4*) osname=newsos4 ;;
3503 nonstop-ux) osname=nonstopux ;;
3504 openbsd) osname=openbsd
3510 POSIX-BC | posix-bc ) osname=posix-bc
3513 powerux | power_ux | powermax_os | powermaxos | \
3514 powerunix | power_unix) osname=powerux
3520 solaris) osname=solaris
3522 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3529 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3533 titanos) osname=titanos
3542 ultrix) osname=ultrix
3545 osf1|mls+) case "$5" in
3548 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3551 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3554 hp*) osname=hp_osf1 ;;
3555 mips) osname=mips_osf1 ;;
3558 # UnixWare 7.1.2 is known as Open UNIX 8
3559 openunix|unixware) osname=svr5
3567 $2) case "$osname" in
3571 : svr4.x or possibly later
3581 if test -f /stand/boot ; then
3582 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3583 if test -n "$INITPROG" -a -f "$INITPROG"; then
3584 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3585 if test -n "$isesix"; then
3593 *) if test -f /etc/systemid; then
3595 set `echo $3 | $sed 's/\./ /g'` $4
3596 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3598 elif $test -f $src/hints/sco_$1_$2.sh; then
3600 elif $test -f $src/hints/sco_$1.sh; then
3605 '') : Still unknown. Probably a generic Sys V.
3614 *) case "$osname" in
3615 '') : Still unknown. Probably a generic BSD.
3623 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3624 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3625 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3628 $rm -f UU/kernel.what
3629 elif test -d c:/. -o -n "$is_os2" ; then
3636 case "$targetarch" in
3639 case "$targetarch" in
3641 # Will load qnx.sh, which should change osname to nto
3646 # Catch arm-linux-androideabi, mipsel-linux-android,
3647 # and i686-linux-android
3648 osname=linux-android
3652 # Something like arm-linux-gnueabihf is really just
3659 # XXX perhaps we should just assume
3660 # osvers to be 2, or maybe take the value
3661 # from targetarch. Using $run before the
3662 # hints are run is somewhat icky.
3663 set X `$run $uname -a 2>/dev/null`
3666 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3671 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3678 : Now look for a hint file osname_osvers, unless one has been
3679 : specified already.
3682 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3683 : Also try without trailing minor version numbers.
3684 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3685 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3686 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3687 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3690 *) case "$osvers" in
3693 *) if $test -f $src/hints/$file.sh ; then
3695 elif $test -f $src/hints/$xfile.sh ; then
3697 elif $test -f $src/hints/$xxfile.sh ; then
3699 elif $test -f $src/hints/$xxxfile.sh ; then
3701 elif $test -f $src/hints/$xxxxfile.sh ; then
3703 elif $test -f "$src/hints/${osname}.sh" ; then
3712 if $test -f Policy.sh ; then
3715 none) dflt="Policy" ;;
3716 *) dflt="Policy $dflt" ;;
3721 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3725 if $test -f Policy.sh ; then
3728 There's also a Policy hint file available, which should make the
3729 site-specific (policy) questions easier to answer.
3736 You may give one or more space-separated answers, or "none" if appropriate.
3737 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3738 previous run of Configure, you may specify it as well as or instead of
3739 OS-specific hints. If hints are provided for your OS, you should use them:
3740 although Perl can probably be built without hints on many platforms, using
3741 hints often improve performance and may enable features that Configure can't
3742 set up on its own. If there are no hints that match your OS, specify "none";
3743 DO NOT give a wrong version or a wrong OS.
3747 rp="Which of these apply, if any?"
3750 for file in $tans; do
3751 if $test X$file = XPolicy -a -f Policy.sh; then
3753 $cat Policy.sh >> UU/config.sh
3754 elif $test -f $src/hints/$file.sh; then
3755 . $src/hints/$file.sh
3756 $cat $src/hints/$file.sh >> UU/config.sh
3757 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3760 : Give one chance to correct a possible typo.
3761 echo "$file.sh does not exist"
3763 rp="hint to use instead?"
3765 for file in $ans; do
3766 if $test -f "$src/hints/$file.sh"; then
3767 . $src/hints/$file.sh
3768 $cat $src/hints/$file.sh >> UU/config.sh
3769 elif $test X$ans = X -o X$ans = Xnone ; then
3772 echo "$file.sh does not exist -- ignored."
3779 : Remember our hint file for later.
3780 if $test -f "$src/hints/$file.sh" ; then
3790 echo "Fetching default answers from $config_sh..." >&4
3794 cp $config_sh config.sh 2>/dev/null
3806 : Restore computed paths
3807 for file in $loclist $trylist; do
3808 eval $file="\$_$file"
3813 Configure uses the operating system name and version to set some defaults.
3814 The default value is probably right if the name rings a bell. Otherwise,
3815 since spelling matters for me, either accept the default or answer "none"
3822 ''|' '|none) dflt=none ;;
3823 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3826 *) dflt="$osname" ;;
3828 rp="Operating system name?"
3832 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3838 ''|' '|none) dflt=none ;;
3839 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3840 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3842 ''|' ') dflt=none ;;
3847 *) dflt="$osvers" ;;
3849 rp="Operating system version?"
3859 : who configured the system
3860 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3863 cf_by=`(logname) 2>/dev/null`
3866 cf_by=`(whoami) 2>/dev/null`
3868 "") cf_by=unknown ;;
3873 : decide how portable to be. Allow command line overrides.
3874 case "$d_portable" in
3876 *) d_portable="$define" ;;
3879 : set up shell script to do ~ expansion
3885 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3888 if $test -f /bin/csh; then
3889 /bin/csh -f -c "glob \$1"
3894 name=\`$expr x\$1 : '..\([^/]*\)'\`
3895 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3896 if $test ! -d "\$dir"; then
3898 echo "\$me: can't locate home directory for: \$name" >&2
3903 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3919 : now set up to get a file name
3923 cat <<'EOSC' >>getfile
3939 : getfile will accept an answer from the comma-separated list
3940 : enclosed in parentheses even if it does not meet other criteria.
3941 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3942 fn=`echo $fn | sed 's/(.*)//'`
3948 loc_file=`expr $fn : '.*:\(.*\)'`
3949 fn=`expr $fn : '\(.*\):.*'`
3957 */*) fullpath=true;;
3966 *e*) exp_file=true;;
3969 *p*) nopath_ok=true;;
3974 *d*) type='Directory';;
3975 *l*) type='Locate';;
3980 Locate) what='File';;
3985 case "$d_portable" in
3993 while test "$type"; do
3998 true) rp="$rp (~name ok)";;
4001 if test -f UU/getfile.ok && \
4002 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4021 value=`UU/filexp $ans`
4024 if test "$ans" != "$value"; then
4025 echo "(That expands to $value on this system.)"
4039 /*) value="$ansexp" ;;
4040 [a-zA-Z]:/*) value="$ansexp" ;;
4045 echo "I shall only accept a full path name, as in /bin/ls." >&4
4046 echo "Use a ! shell escape if you wish to check pathnames." >&4
4049 echo "Please give a full path name, starting with slash." >&4
4052 echo "Note that using ~name is ok provided it expands well." >&4
4065 for fp in $gfpth; do
4066 if test "X$fp" = X.; then
4071 if test -f "$pf"; then
4073 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4075 echo "($value is not a plain file, but that's ok.)"
4078 if test X"$type" = X; then
4085 for fp in $gfpth; do
4086 if test "X$fp" = X.; then
4091 direxp="$fp/$ansexp"
4093 if test -d "$direxp"; then
4101 if test -d "$ansexp"; then
4102 echo "(Looking for $loc_file in directory $value.)"
4103 value="$value/$loc_file"
4104 ansexp="$ansexp/$loc_file"
4106 if test -f "$ansexp"; then
4109 case "$nopath_ok" in
4110 true) case "$value" in
4112 *) echo "Assuming $value will be in people's path."
4128 if test "$fastread" = yes; then
4133 rp="$what $value doesn't exist. Use that name anyway?"
4152 test "X$gfpthkeep" != Xy && gfpth=""
4155 : determine root of directory hierarchy where package will be installed.
4158 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4161 dflt=`echo "$prefix" | sed 's/.$//'`
4169 By default, $package will be installed in $dflt/bin, manual pages
4170 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4171 installation directories. Typically this is something like /usr/local.
4172 If you wish to have binaries under /usr/bin but other parts of the
4173 installation under /usr/local, that's ok: you will be prompted
4174 separately for each of the installation directories, the prefix being
4175 only used to set the defaults.
4179 rp='Installation prefix to use?'
4187 *) oldprefix="$prefix";;
4194 : allow them to override the AFS root
4197 *) afsroot=$afsroot ;;
4203 $define|true) afs=true ;;
4204 $undef|false) afs=false ;;
4205 *) if $test -d $afsroot; then
4213 echo "AFS may be running... I'll be extra cautious then..." >&4
4215 echo "AFS does not seem to be running..." >&4
4218 : determine installation prefix for where package is to be installed.
4222 Since you are running AFS, I need to distinguish the directory in which
4223 files will reside from the directory in which they are installed (and from
4224 which they are presumably copied to the former directory by occult means).
4227 case "$installprefix" in
4228 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4229 *) dflt="$installprefix";;
4234 In some special cases, particularly when building $package for distribution,
4235 it is convenient to distinguish the directory in which files should be
4236 installed from the directory ($prefix) in which they will
4237 eventually reside. For most users, these two directories are the same.
4240 case "$installprefix" in
4242 *) dflt=$installprefix;;
4246 rp='What installation prefix should I use for installing files?'
4248 installprefix="$ans"
4249 installprefixexp="$ansexp"
4251 : Perform the prefixexp/installprefixexp correction if necessary
4252 cat <<EOS >installprefix
4255 cat <<'EOSC' >>installprefix
4256 : Change installation prefix, if necessary.
4257 if $test X"$prefix" != X"$installprefix"; then
4258 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4260 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4263 chmod +x installprefix
4264 $eunicefix installprefix
4266 : Set variables such as privlib and privlibexp from the output of ./getfile
4267 : performing the prefixexp/installprefixexp correction if necessary.
4268 cat <<EOS >setprefixvar
4271 cat <<'EOSC' >>setprefixvar
4272 eval "${prefixvar}=\"\$ans\""
4273 eval "${prefixvar}exp=\"\$ansexp\""
4276 chmod +x setprefixvar
4277 $eunicefix setprefixvar
4279 : set up the script used to warn in case of inconsistency
4288 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4290 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4291 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4296 echo "*** WHOA THERE!!! ***" >&4
4297 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4300 rp=" Keep the $hint value?"
4303 y) td=$was; tu=$was;;
4307 : function used to set '$1' to '$val'
4308 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4310 $define$undef) . ./whoa; eval "$var=\$td";;
4311 $undef$define) . ./whoa; eval "$var=\$tu";;
4312 *) eval "$var=$val";;
4315 : get the patchlevel
4317 echo "Getting the current patchlevel..." >&4
4318 if $test -r $rsrc/patchlevel.h;then
4319 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4320 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4321 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4322 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4323 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4324 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4325 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4334 $echo "(You do not have patchlevel.h. Eek.)"
4336 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4337 version_patchlevel_string="version $patchlevel subversion $subversion"
4338 case "$perl_patchlevel" in
4340 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4341 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4345 $echo "(You have $package $version_patchlevel_string.)"
4349 : XXX Should be a Configure test for double-dots in filenames.
4350 version=`echo $revision $patchlevel $subversion | \
4351 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4352 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4353 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4356 version=`echo $revision $patchlevel $subversion | \
4357 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4358 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4359 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4362 : Special case the 5.005_xx maintenance series, which used 5.005
4363 : without any subversion label as a subdirectory in $sitelib
4364 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4365 api_versionstring='5.005'
4368 : Do we want threads support and if so, what type
4369 case "$usethreads" in
4370 $define|true|[yY]*) dflt='y';;
4371 *) # Catch case where user specified ithreads or 5005threads but
4372 # forgot -Dusethreads (A.D. 4/2002)
4373 case "$useithreads$use5005threads" in
4374 *$define*) dflt='y';;
4381 Perl can be built to offer a form of threading support on some systems
4382 To do so, Configure can be run with -Dusethreads.
4384 Note that Perl built with threading support runs slightly slower
4385 and uses slightly more memory than plain Perl.
4387 If this doesn't make any sense to you, just accept the default '$dflt'.
4389 rp='Build a threading Perl?'
4392 y|Y) val="$define" ;;
4398 if $test $patchlevel -lt 9; then
4399 case "$usethreads" in
4401 : Default to ithreads unless overridden on command line or with
4404 case "$use5005threads" in
4406 echo "5.005 threads are no longer supported"
4410 case "$useithreads" in
4411 $undef|false|[nN]*) dflt='n';;
4413 rp='Use the newer interpreter-based ithreads?'
4416 y|Y) val="$define" ;;
4421 : Now set use5005threads to the opposite value.
4422 case "$useithreads" in
4423 $define) val="$undef" ;;
4430 useithreads="$undef"
4431 use5005threads="$undef"
4435 case "$useithreads$use5005threads" in
4439 You cannot have both the ithreads and the 5.005 threads enabled
4440 at the same time. Disabling the 5.005 threads since they are
4441 much less stable than the ithreads.
4444 use5005threads="$undef"
4449 : perl-5.9.x and later
4451 if test X"$usethreads" = "X$define"; then
4452 case "$use5005threads" in
4456 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4463 use5005threads="$undef"
4464 useithreads="$usethreads"
4467 case "$d_oldpthreads" in
4468 '') : Configure tests would be welcome here. For now, assume undef.
4470 *) val="$d_oldpthreads" ;;
4476 : Look for a hint-file generated 'call-back-unit'. If the
4477 : user has specified that a threading perl is to be built,
4478 : we may need to set or change some other defaults.
4479 if $test -f usethreads.cbu; then
4480 echo "Your platform has some specific hints regarding threaded builds, using them..."
4483 case "$usethreads" in
4484 "$define"|true|[yY]*)
4486 (Your platform does not have any specific hints for threaded builds.
4487 Assuming POSIX threads, then.)
4493 : Check if multiplicity is required
4496 Perl can be built so that multiple Perl interpreters can coexist
4497 within the same Perl executable.
4500 case "$useithreads" in
4503 This multiple interpreter support is required for interpreter-based threads.
4507 *) case "$usemultiplicity" in
4508 $define|true|[yY]*) dflt='y';;
4512 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4513 rp='Build Perl for multiplicity?'
4516 y|Y) val="$define" ;;
4524 : Check if morebits is requested
4525 case "$usemorebits" in
4526 "$define"|true|[yY]*)
4527 use64bitint="$define"
4528 uselongdouble="$define"
4529 usemorebits="$define"
4531 *) usemorebits="$undef"
4535 : Determine the C compiler to be used
4541 rp="Use which C compiler?"
4545 : See whether they have no cc but they do have gcc
4547 if $test -f cc.cbu; then
4552 : make some quick guesses about what we are up against
4554 $echo $n "Hmm... $c"
4564 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4565 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4567 echo "Looks kind of like an OSF/1 system, but we'll see..."
4569 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4570 xxx=`./loc addbib blurfl $pth`
4571 if $test -f $xxx; then
4572 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4576 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4577 echo "Looks kind of like an extended USG system, but we'll see..."
4579 echo "Looks kind of like a USG system, but we'll see..."
4583 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4584 echo "Looks kind of like a BSD system, but we'll see..."
4588 echo "Looks kind of like a Version 7 system, but we'll see..."
4591 case "$eunicefix" in
4594 There is, however, a strange, musty smell in the air that reminds me of
4595 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4599 : it so happens the Eunice I know will not run shell scripts in Unix format
4603 echo "Congratulations. You aren't running Eunice."
4607 : Detect OS2. The p_ variable is set above in the Head.U unit.
4608 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4609 : semicolon as a patch separator
4614 I have the feeling something is not exactly right, however...don't tell me...
4615 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4616 (Or you may be running DOS with DJGPP.)
4621 if test -f /xenix; then
4622 echo "Actually, this looks more like a XENIX system..."
4627 echo "It's not Xenix..."
4632 if test -f /venix; then
4633 echo "Actually, this looks more like a VENIX system..."
4640 echo "Nor is it Venix..."
4643 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4644 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4647 : Check if we are using GNU gcc and what its version is
4649 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4653 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4655 printf("%s\n", __VERSION__);
4657 printf("%s\n", "1");
4663 if $cc -o try $ccflags $ldflags try.c; then
4664 gccversion=`$run ./try`
4665 case "$gccversion" in
4666 '') echo "You are not using GNU cc." ;;
4667 *) echo "You are using GNU cc $gccversion."
4673 echo "*** WHOA THERE!!! ***" >&4
4674 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4675 case "$knowitall" in
4677 echo " You'd better start hunting for one and let me know about it." >&4
4683 case "$gccversion" in
4684 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4686 case "$gccversion" in
4687 '') gccosandvers='' ;;
4688 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4689 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4691 case "$gccosandvers" in
4692 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4693 $osname$osvers) ;; # looking good
4694 $osname*) cat <<EOM >&4
4696 *** WHOA THERE!!! ***
4698 Your gcc has not been compiled for the exact release of
4699 your operating system ($gccosandvers versus $osname$osvers).
4701 In general it is a good idea to keep gcc synchronized with
4702 the operating system because otherwise serious problems
4703 may ensue when trying to compile software, like Perl.
4705 I'm trying to be optimistic here, though, and will continue.
4706 If later during the configuration and build icky compilation
4707 problems appear (headerfile conflicts being the most common
4708 manifestation), I suggest reinstalling the gcc to match
4709 your operating system release.
4713 *) gccosandvers='' ;; # failed to parse, better be silent
4721 # gcc 3.* complain about adding -Idirectories that they already know about,
4722 # so we will take those off from locincpth.
4723 case "$gccversion" in
4725 echo "main(){}">try.c
4726 for incdir in $locincpth; do
4727 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4728 grep '^c[cp]p*[01]: warning: changing search order '`
4729 if test "X$warn" != X; then
4730 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4736 # gcc 4.9 by default does some optimizations that break perl.
4737 # see ticket 121505.
4739 # The -fwrapv disables those optimizations (and probably others,) so
4740 # for gcc 4.9 (and later, since the optimizations probably won't go
4741 # away), add -fwrapv unless the user requests -fno-wrapv, which
4742 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4743 # which turns the overflows -fwrapv ignores into runtime errors.
4744 case "$gccversion" in
4745 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4747 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4748 *) ccflags="$ccflags -fwrapv" ;;
4752 : What should the include directory be ?
4753 : Use sysroot if set, so findhdr looks in the right place.
4755 $echo $n "Hmm... $c"
4756 dflt="$sysroot/usr/include"
4759 if $test -f /bin/mips && /bin/mips; then
4760 echo "Looks like a MIPS system..."
4761 $cat >usr.c <<'EOCP'
4762 #ifdef SYSTYPE_BSD43
4766 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4767 dflt='/bsd43/usr/include'
4771 mips_type='System V'
4773 $rm -f usr.c usr.out
4774 echo "and you're compiling with the $mips_type compiler and libraries."
4778 echo "Doesn't look like a MIPS system."
4788 case "$xxx_prompt" in
4791 rp='Where are the include files you want to use?'
4799 : see how we invoke the C preprocessor
4801 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4802 cat <<'EOT' >testcpp.c
4808 if test ! -f cppstdin; then
4809 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4810 # AIX cc -E doesn't show the absolute headerfile
4811 # locations but we'll cheat by using the -M flag.
4812 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
4814 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4817 echo "Keeping your $hint cppstdin wrapper."
4820 wrapper=`pwd`/cppstdin
4824 if $test "X$cppstdin" != "X" && \
4825 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4826 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4828 echo "You used to use $cppstdin $cppminus so we'll use that again."
4830 '') echo "But let's see if we can live without a wrapper..." ;;
4832 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4835 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4838 echo "(However, $cpprun $cpplast does not work, let's see...)"
4846 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4853 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4854 $cc -E <testcpp.c >testcpp.out 2>&1; \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4856 echo "Yup, it does."
4857 x_cpp="$cc $cppflags -E"
4859 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4860 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4862 echo "Yup, it does."
4863 x_cpp="$cc $cppflags -E"
4865 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4866 $cc -P <testcpp.c >testcpp.out 2>&1; \
4867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4868 echo "Yipee, that works!"
4869 x_cpp="$cc $cppflags -P"
4871 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4872 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4874 echo "At long last!"
4875 x_cpp="$cc $cppflags -P"
4877 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4878 $cpp <testcpp.c >testcpp.out 2>&1; \
4879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 x_cpp="$cpp $cppflags"
4883 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4884 $cpp - <testcpp.c >testcpp.out 2>&1; \
4885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4886 echo "Hooray, it works! I was beginning to wonder."
4887 x_cpp="$cpp $cppflags"
4889 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4890 $wrapper <testcpp.c >testcpp.out 2>&1; \
4891 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4897 rp="No dice. I can't find a C preprocessor. Name one:"
4901 $x_cpp <testcpp.c >testcpp.out 2>&1
4902 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4903 echo "OK, that will do." >&4
4905 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4920 echo "Perhaps can we force $cc -E using a wrapper..."
4921 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4922 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4928 echo "Nope, we'll have to live without it..."
4942 "$wrapper"|'cppstdin') ;;
4943 *) $rm -f $wrapper;;
4945 $rm -f testcpp.c testcpp.out
4947 : Adjust cppfilter for path component separator
4949 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4950 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4954 : Use gcc to determine libpth and incpth
4955 # If using gcc or clang, we can get better values for libpth, incpth
4956 # and usrinc directly from the compiler.
4957 # Note that ccname for clang is also gcc.
4960 $echo 'extern int foo;' > try.c
4961 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4963 if $test $# -gt 0; then
4965 incpth="`$echo $incpth|$sed 's/^ //'`"
4967 j="`$echo $i|$sed 's,/include$,/lib,'`"
4968 if $test -d $j; then
4972 libpth="`$echo $libpth|$sed 's/^ //'`"
4973 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4974 if $test -d $xxx; then
4977 *) libpth="$libpth $xxx";;
4984 '') for i in $incpth; do
4985 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4993 case "$usecrosscompile" in
4996 '') echo "Incpth not defined." >&4; croak=y ;;
4997 *) echo "Using incpth '$incpth'." >&4 ;;
5000 '') echo "Libpth not defined." >&4; croak=y ;;
5001 *) echo "Using libpth '$libpth'." >&4 ;;
5004 '') echo "Usrinc not defined." >&4; croak=y ;;
5005 *) echo "Using usrinc $usrinc." >&4 ;;
5009 if test "X$sysroot" = X; then
5010 echo "Cannot continue, aborting." >&4; exit 1
5012 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5021 : Default value for incpth is just usrinc
5023 '') incpth="$usrinc";;
5026 : Set private lib path
5029 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5034 '') dlist="$loclibpth $plibpth $glibpth";;
5035 *) dlist="$libpth";;
5038 : Now check and see which directories actually exist, avoiding duplicates
5041 if $test -d $xxx; then
5044 *) libpth="$libpth $xxx";;
5050 Some systems have incompatible or broken versions of libraries. Among
5051 the directories listed in the question below, please remove any you
5052 know not to be holding relevant libraries, and add any that are needed.
5053 Say "none" for none.
5057 if test "X$sysroot" != X; then
5059 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5072 rp="Directories to use for library searches?"
5079 : compute shared library extension
5082 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5092 On some systems, shared libraries may be available. Answer 'none' if
5093 you want to suppress searching of shared libraries for the remainder
5094 of this configuration.
5097 rp='What is the file extension used for shared libraries?'
5101 : Does target system insist that shared library basenames are unique
5104 Some dynamic loaders assume that the *basename* of shared library filenames
5105 are globally unique. We'll default this to undef as we assume your system
5106 is not this weird. Set to defined if you're on one of them.
5111 rp='Make shared library basenames unique?'
5114 y|Y) val="$define" ;;
5117 set d_libname_unique
5120 : Define several unixisms.
5121 : Hints files or command line option can be used to override them.
5122 : The convoluted testing is in case hints files set either the old
5125 '') case "$exe_ext" in
5127 *) _exe="$exe_ext" ;;
5132 '') case "$lib_ext" in
5139 '') case "$obj_ext" in
5146 '') case "$path_sep" in
5157 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5159 : Which makefile gets called first. This is used by make depend.
5160 case "$firstmakefile" in
5161 '') firstmakefile='makefile';;
5164 : Check is we will use socks
5166 $define|true|[yY]*) dflt='y';;
5171 Perl can be built to use the SOCKS proxy protocol library. To do so,
5172 Configure must be run with -Dusesocks. If you use SOCKS you also need
5173 to use the PerlIO abstraction layer, this will be implicitly selected.
5175 If this doesn't make any sense to you, just accept the default '$dflt'.
5177 rp='Build Perl for SOCKS?'
5180 y|Y) val="$define" ;;
5186 : Check for uselongdouble support
5188 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5191 case "$uselongdouble" in
5192 $define|true|[yY]*) dflt='y';;
5197 Perl can be built to take advantage of long doubles which
5198 (if available) may give more accuracy and range for floating point numbers.
5200 If this doesn't make any sense to you, just accept the default '$dflt'.
5202 rp='Try to use long doubles if available?'
5205 y|Y) val="$define" ;;
5211 case "$uselongdouble" in
5212 true|[yY]*) uselongdouble="$define" ;;
5215 : Look for a hint-file generated 'call-back-unit'. If the
5216 : user has specified that long doubles should be used,
5217 : we may need to set or change some other defaults.
5218 if $test -f uselongdouble.cbu; then
5219 echo "Your platform has some specific hints regarding long doubles, using them..."
5220 . ./uselongdouble.cbu
5222 case "$uselongdouble" in
5225 (Your platform does not have any specific hints for long doubles.)
5231 : Check if quadmath is requested
5232 case "$usequadmath" in
5233 "$define"|true|[yY]*) usequadmath="$define" ;;
5234 *) usequadmath="$undef" ;;
5237 : Looking for optional libraries
5239 echo "Checking for optional libraries..." >&4
5244 case "$libswanted" in
5245 '') libswanted='c_s';;
5248 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5250 case "$usecbacktrace" in
5251 "$define") libswanted="$libswanted bfd" ;;
5253 case "$usequadmath" in
5254 "$define") libswanted="$libswanted quadmath" ;;
5260 for thisdir in $libpth $xlibpth; do
5261 test -d $thisdir && libspath="$libspath $thisdir"
5263 for thislib in $libswanted; do
5264 for thisdir in $libspath; do
5266 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5267 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5268 $test -f "$xxx" && eval $libscheck
5269 $test -f "$xxx" && libstyle=shared
5270 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5271 $test -f "$xxx" && eval $libscheck
5272 $test -f "$xxx" && libstyle=shared
5274 if test ! -f "$xxx"; then
5275 xxx=$thisdir/lib$thislib.$so
5276 $test -f "$xxx" && eval $libscheck
5277 $test -f "$xxx" && libstyle=shared
5279 if test ! -f "$xxx"; then
5280 xxx=$thisdir/lib$thislib$_a
5281 $test -f "$xxx" && eval $libscheck
5282 $test -f "$xxx" && libstyle=static
5284 if test ! -f "$xxx"; then
5285 xxx=$thisdir/$thislib$_a
5286 $test -f "$xxx" && eval $libscheck
5287 $test -f "$xxx" && libstyle=static
5289 if test ! -f "$xxx"; then
5290 xxx=$thisdir/lib${thislib}_s$_a
5291 $test -f "$xxx" && eval $libscheck
5292 $test -f "$xxx" && libstyle=static
5293 $test -f "$xxx" && thislib=${thislib}_s
5295 if test ! -f "$xxx"; then
5296 xxx=$thisdir/Slib$thislib$_a
5297 $test -f "$xxx" && eval $libscheck
5298 $test -f "$xxx" && libstyle=static
5300 if $test -f "$xxx"; then
5302 shared) echo "Found -l$thislib (shared)." ;;
5303 static) echo "Found -l$thislib." ;;
5304 *) echo "Found -l$thislib ($libstyle)." ;;
5308 *) dflt="$dflt -l$thislib"
5309 libsfound="$libsfound $xxx"
5311 libsfiles="$libsfiles $yyy"
5312 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5313 case " $libsdirs " in
5315 *) libsdirs="$libsdirs $yyy" ;;
5322 if $test ! -f "$xxx"; then
5323 echo "No -l$thislib."
5334 ' '|'') dflt='none';;
5339 In order to compile $package on your machine, a number of libraries
5340 are usually needed. Include any other special libraries here as well.
5341 Say "none" for none. The default list is almost always right.
5345 rp="What libraries to use?"
5352 : determine optimization, if desired, or use for debug flag also
5354 ' '|$undef) dflt='none';;
5356 *) dflt="$optimize";;
5360 By default, $package compiles with the -O flag to use the optimizer.
5361 Alternately, you might want to use the symbolic debugger, which uses
5362 the -g flag (on traditional Unix systems). Either flag can be
5363 specified here. To use neither flag, specify the word "none".
5366 rp="What optimizer/debugger flag should be used?"
5370 'none') optimize=" ";;
5373 : Check what DEBUGGING is required from the command line
5374 : -DEBUGGING or -DDEBUGGING or
5375 : -DEBUGGING=both = -g + -DDEBUGGING
5376 : -DEBUGGING=-g or -Doptimize=-g = -g
5377 : -DEBUGGING=none or -UDEBUGGING =
5378 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5381 *) DEBUGGING=$EBUGGING ;;
5384 case "$DEBUGGING" in
5388 *) optimize="$optimize -g" ;;
5392 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5400 case "$DEBUGGING" in
5401 both|$define) dflt='-DDEBUGGING'
5404 : argument order is deliberate, as the flag will start with - which set could
5405 : think is an option
5406 checkccflag='check=$1; flag=$2; callback=$3;
5408 echo "Checking if your compiler accepts $flag" 2>&1;
5409 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5410 echo "int main(void) { return 0; }" > gcctest.c;
5411 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5412 echo "Yes, it does." 2>&1;
5413 if $test -s gcctest.out ; then
5414 echo "But your platform does not like it:";
5419 echo "Leaving current flags $ccflags alone." 2>&1
5421 *) dflt="$dflt $flag";
5427 echo "Nope, it does not, but that is ok." 2>&1;
5431 : We will not override a previous value, but we might want to
5432 : augment a hint file
5434 default|recommended)
5435 case "$gccversion" in
5436 1*) dflt="$dflt -fpcc-struct-return" ;;
5438 case "$optimize:$DEBUGGING" in
5439 *-g*:old) dflt="$dflt -DDEBUGGING";;
5441 case "$gccversion" in
5442 2*) if $test -d /etc/conf/kconfig.d &&
5443 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5445 # Interactive Systems (ISC) POSIX mode.
5450 case "$gccversion" in
5453 ?*) set strict-aliasing -fno-strict-aliasing
5457 # For gcc, adding -pipe speeds up compilations for some, but apparently
5458 # some assemblers can't read from stdin. (It also slows down compilations
5459 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5460 case "$gccversion" in
5466 # on x86_64 (at least) we require an extra library (libssp) in the
5467 # link command line. This library is not named, so I infer that it is
5468 # an implementation detail that may change. Hence the safest approach
5469 # is to add the flag to the flags passed to the compiler at link time,
5470 # as that way the compiler can do the right implementation dependant
5473 amigaos) ;; # -fstack-protector builds but doesn't work
5474 *) case "$gccversion" in
5475 ?*) set stack-protector-strong -fstack-protector-strong
5478 *-fstack-protector-strong*) ;; # It got added.
5479 *) # Try the plain/older -fstack-protector.
5480 set stack-protector -fstack-protector
5491 case "$mips_type" in
5492 *BSD*|'') inclwanted="$locincpth $usrinc";;
5493 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5495 for thisincl in $inclwanted; do
5496 if $test -d $thisincl; then
5497 if $test x$thisincl != x$usrinc; then
5499 *" -I$thisincl "*);;
5500 *) dflt="$dflt -I$thisincl ";;
5506 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5508 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5516 *) dflt="$dflt -D$2";;
5520 set signal.h LANGUAGE_C; eval $inctest
5524 ccflags="$ccflags -DSOCKS"
5529 default|recommended) dflt="$ccflags $dflt" ;;
5530 *) dflt="$ccflags";;
5539 Your C compiler may want other flags. For this question you should include
5540 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5541 but you should NOT include libraries or ld flags like -lwhatever. If you
5542 want $package to honor its debug switch, you should include -DDEBUGGING here.
5543 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5545 To use no flags, specify the word "none".
5551 rp="Any additional cc flags?"
5558 : the following weeds options from ccflags that are of no interest to cpp
5560 '') cppflags="$ccflags" ;;
5561 *) set X $ccflags; shift
5562 case " $cppflags " in
5563 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5564 *) cppflags="$cppflags $ccflags" ;;
5568 case "$gccversion" in
5569 1*) cppflags="$cppflags -D__GNUC__"
5571 case "$mips_type" in
5573 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5579 echo "Let me guess what the preprocessor flags are..." >&4
5593 *) ftry="$previous $flag";;
5595 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5596 >cpp1.out 2>/dev/null && \
5597 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5598 >cpp2.out 2>/dev/null && \
5599 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5600 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5602 cppflags="$cppflags $ftry"
5612 *-*) echo "They appear to be: $cppflags";;
5614 $rm -f cpp.c cpp?.out
5618 : flags used in final linking phase
5620 '') if ./venix; then
5626 *-posix*) dflt="$dflt -posix" ;;
5629 *) dflt="$ldflags";;
5631 # See note above about -fstack-protector
5633 *-fstack-protector-strong*)
5635 *-fstack-protector-strong*) ;; # Don't add it again
5636 *) dflt="$dflt -fstack-protector-strong" ;;
5639 *-fstack-protector*)
5641 *-fstack-protector*) ;; # Don't add it again
5642 *) dflt="$dflt -fstack-protector" ;;
5647 : Try to guess additional flags to pick up local libraries.
5648 for thislibdir in $libpth; do
5649 case " $loclibpth " in
5652 *"-L$thislibdir "*) ;;
5653 *) dflt="$dflt -L$thislibdir" ;;
5665 Your C linker may need flags. For this question you should
5666 include -L/whatever and any other flags used by the C linker, but you
5667 should NOT include libraries like -lwhatever.
5669 Make sure you include the appropriate -L/path flags if your C linker
5670 does not normally search all of the directories you specified above,
5673 To use no flags, specify the word "none".
5677 rp="Any additional ld flags (NOT including libraries)?"
5683 rmlist="$rmlist pdp11"
5687 echo "Checking your choice of C compiler and flags for coherency..." >&4
5688 $cat > try.c <<'EOF'
5690 int main() { printf("Ok\n"); return(0); }
5692 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5694 $cat >try.msg <<'EOM'
5695 I've tried to compile and run the following simple program:
5698 $cat try.c >> try.msg
5700 $cat >> try.msg <<EOM
5707 and I got the following output:
5711 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5712 if $sh -c "$run ./try " >>try.msg 2>&1; then
5716 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5719 echo "The program compiled OK, but exited with status $?." >>try.msg
5720 rp="You have a problem. Shall I abort Configure"
5724 echo "I can't compile the test program." >>try.msg
5725 rp="You have a BIG problem. Shall I abort Configure"
5731 case "$knowitall" in
5733 echo "(The supplied flags or libraries might be incorrect.)"
5741 *) echo "Ok. Stopping Configure." >&4
5746 n) echo "OK, that should do.";;
5748 $rm_try gcctest gcctest.out
5750 : define a shorthand compile call
5754 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5755 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5759 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5760 : define a shorthand compile call for compilations that should be ok.
5764 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5766 : determine filename position in cpp output
5768 echo "Computing filename position in cpp output for #include directives..." >&4
5770 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5775 vos) testaccess=-e ;;
5778 echo '#include <stdio.h>' > foo.c
5781 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5782 $grep '^[ ]*#.*stdio\.h' | \
5783 while read cline; do
5786 while $test \$# -gt 0; do
5787 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5792 pos=\`expr \$pos + 1\`
5806 *) pos="${fieldn}th";;
5808 echo "Your cpp writes the filename in the $pos field of the line."
5810 : locate header file
5815 for usrincdir in $incpth
5817 if test -f \$usrincdir/\$wanted; then
5818 echo "\$usrincdir/\$wanted"
5822 awkprg='{ print \$$fieldn }'
5823 echo "#include <\$wanted>" > foo\$\$.c
5824 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5825 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5826 while read cline; do
5827 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5829 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5830 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5835 # status = 0: grep returned 0 lines, case statement not executed
5836 # status = 1: headerfile found
5837 # status = 2: while loop executed, no headerfile found
5841 if test \$status -eq 1; then
5848 : define an alternate in-header-list? function
5849 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5850 cont=true; xxf="echo \"<\$1> found.\" >&4";
5851 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5852 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5854 case $# in 4) instead=instead;; *) instead="at last";; esac;
5855 while $test "$cont"; do
5857 var=$2; eval "was=\$$2";
5858 if $test "$xxx" && $test -r "$xxx";
5860 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5863 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5864 set $yyy; shift; shift; yyy=$@;
5865 case $# in 0) cont="";;
5866 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5867 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5868 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5869 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5873 do set $yyy; var=$2; eval "was=\$$2";
5874 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5875 set $yyy; shift; shift; yyy=$@;
5878 : see if stdlib is available
5879 set stdlib.h i_stdlib
5882 : check for lengths of integral types
5886 echo "Checking to see how big your integers are..." >&4
5895 printf("intsize=%d;\n", (int)sizeof(int));
5896 printf("longsize=%d;\n", (int)sizeof(long));
5897 printf("shortsize=%d;\n", (int)sizeof(short));
5902 if eval $compile_ok && $run ./try > /dev/null; then
5904 echo "Your integers are $intsize bytes long."
5905 echo "Your long integers are $longsize bytes long."
5906 echo "Your short integers are $shortsize bytes long."
5910 Help! I can't compile and run the intsize test program: please enlighten me!
5911 (This is probably a misconfiguration in your system or libraries, and
5912 you really ought to fix it. Still, I'll try anyway.)
5916 rp="What is the size of an integer (in bytes)?"
5920 rp="What is the size of a long integer (in bytes)?"
5924 rp="What is the size of a short integer (in bytes)?"
5932 : check for long long
5934 echo "Checking to see if you have long long..." >&4
5935 echo 'int main() { long long x = 7; return 0; }' > try.c
5937 if eval $compile; then
5939 echo "You have long long."
5942 echo "You do not have long long."
5948 : check for length of long long
5949 case "${d_longlong}${longlongsize}" in
5952 echo "Checking to see how big your long longs are..." >&4
5953 $cat >try.c <<'EOCP'
5957 printf("%d\n", (int)sizeof(long long));
5962 if eval $compile_ok; then
5963 longlongsize=`$run ./try`
5964 echo "Your long longs are $longlongsize bytes long."
5968 echo "(I can't seem to compile the test program. Guessing...)"
5969 rp="What is the size of a long long (in bytes)?"
5973 if $test "X$longsize" = "X$longlongsize"; then
5974 echo "(That isn't any different from an ordinary long.)"
5980 : see if inttypes.h is available
5981 : we want a real compile instead of Inhdr because some systems
5982 : have an inttypes.h which includes non-existent headers
5985 #include <inttypes.h>
5987 static int32_t foo32 = 0x12345678;
5991 if eval $compile; then
5992 echo "<inttypes.h> found." >&4
5995 echo "<inttypes.h> NOT found." >&4
6004 echo "Checking to see if you have int64_t..." >&4
6006 #include <sys/types.h>
6007 #$i_inttypes I_INTTYPES
6009 #include <inttypes.h>
6011 int main() { int64_t x = 7; }
6014 if eval $compile; then
6016 echo "You have int64_t."
6019 echo "You do not have int64_t."
6025 : Check if 64bit ints have a quad type
6027 echo "Checking which 64-bit integer type we could use..." >&4
6033 val='"unsigned int"'
6038 *) case "$longsize" in
6042 val='"unsigned long"'
6047 *) case "$d_longlong:$longlongsize" in
6052 val='"unsigned long long"'
6057 *) case "$d_int64_t" in
6076 '') echo "Alas, no 64-bit integer types in sight." >&4
6079 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6084 : Do we want 64bit support
6085 case "$uselonglong" in
6086 "$define"|true|[yY]*)
6089 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6091 use64bitint="$define"
6094 case "$use64bits" in
6095 "$define"|true|[yY]*)
6098 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6100 use64bitint="$define"
6103 case "$use64bitints" in
6104 "$define"|true|[yY]*)
6107 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6109 use64bitint="$define"
6112 case "$use64bitsint" in
6113 "$define"|true|[yY]*)
6116 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6118 use64bitint="$define"
6121 case "$uselonglongs" in
6122 "$define"|true|[yY]*)
6125 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6127 use64bitint="$define"
6130 case "$use64bitsall" in
6131 "$define"|true|[yY]*)
6134 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6136 use64bitall="$define"
6141 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6143 case "$use64bitall" in
6144 "$define"|true|[yY]*) use64bitint="$define" ;;
6150 You have natively 64-bit long integers.
6154 *) case "$use64bitint" in
6155 "$define"|true|[yY]*) dflt='y';;
6164 Perl can be built to take advantage of 64-bit integer types
6165 on some systems. To do so, Configure can be run with -Duse64bitint.
6166 Choosing this option will most probably introduce binary incompatibilities.
6168 If this doesn't make any sense to you, just accept the default '$dflt'.
6169 (The default has been chosen based on your configuration.)
6171 rp='Try to use 64-bit integers, if available?'
6174 [yY]*) val="$define" ;;
6182 case "$use64bitall" in
6183 "$define"|true|[yY]*) dflt='y' ;;
6184 *) case "$longsize" in
6192 You may also choose to try maximal 64-bitness. It means using as much
6193 64-bitness as possible on the platform. This in turn means even more
6194 binary incompatibilities. On the other hand, your platform may not
6195 have any more 64-bitness available than what you already have chosen.
6197 If this doesn't make any sense to you, just accept the default '$dflt'.
6198 (The default has been chosen based on your configuration.)
6200 rp='Try to use maximal 64-bit support, if available?'
6203 [yY]*) val="$define" ;;
6208 case "$use64bitall" in
6210 case "$use64bitint" in
6214 Since you have chosen a maximally 64-bit build, I'm also turning on
6215 the use of 64-bit integers.
6217 use64bitint="$define" ;;
6222 : Look for a hint-file generated 'call-back-unit'. If the
6223 : user has specified that a 64-bit perl is to be built,
6224 : we may need to set or change some other defaults.
6225 if $test -f use64bitint.cbu; then
6226 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6229 case "$use64bitint" in
6230 "$define"|true|[yY]*)
6231 : This test was common to all the OpenBSD forks, and seems harmless for
6234 echo "Checking if your C library has broken 64-bit functions..." >&4
6237 typedef $uquadtype myULL;
6244 {4294967303.15, 4294967303ULL},
6245 {4294967294.2, 4294967294ULL},
6246 {4294967295.7, 4294967295ULL},
6249 for (p = test; p->u; p++) {
6250 myULL x = (myULL)p->d;
6261 if eval $compile_ok; then
6262 libcquad=`$run ./try`
6263 echo "Your C library's 64-bit functions are $libcquad."
6265 echo "(I can't seem to compile the test program.)"
6266 echo "Assuming that your C library's 64-bit functions are ok."
6275 *** You have a C library with broken 64-bit functions.
6276 *** 64-bit support does not work reliably in this configuration.
6277 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6278 *** Cannot continue, aborting.
6285 4) case "$archname64" in
6286 '') archname64=64int ;;
6293 : Look for a hint-file generated 'call-back-unit'. If the
6294 : user has specified that a maximally 64-bit perl is to be built,
6295 : we may need to set or change some other defaults.
6296 if $test -f use64bitall.cbu; then
6297 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6300 case "$use64bitall" in
6301 "$define"|true|[yY]*)
6303 4) case "$archname64" in
6304 ''|64int) archname64=64all ;;
6311 case "$d_quad:$use64bitint" in
6315 *** You have chosen to use 64-bit integers,
6316 *** but none can be found.
6317 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6318 *** Cannot continue, aborting.
6325 : Check if we are using the GNU C library
6327 echo "Checking for GNU C Library..." >&4
6329 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6330 alone are insufficient to distinguish different versions, such as
6331 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6332 libc version 2.1.0. A. Dougherty, June 3, 2002.
6338 # ifdef __GLIBC_MINOR__
6339 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6340 # include <gnu/libc-version.h>
6341 printf("%s\n", gnu_get_libc_version());
6343 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6346 printf("%d\n", __GLIBC__);
6355 if eval $compile_ok && $run ./try > glibc.ver; then
6357 gnulibc_version=`$cat glibc.ver`
6358 echo "You are using the GNU C Library version $gnulibc_version"
6362 echo "You are not using the GNU C Library"
6368 : see if nm is to be used to determine whether a symbol is defined or not
6372 case "$d_gnulibc" in
6375 echo "nm probably won't work on the GNU C Library." >&4
6381 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6383 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6384 echo "'nm' won't be sufficient on this system." >&4
6390 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6391 if $test $dflt -gt 20; then
6401 true|$define) dflt=y;;
6408 I can use $nm to extract the symbols from your C libraries. This
6409 is a time consuming task which may generate huge output on the disk (up
6410 to 3 megabytes) but that should make the symbols extraction faster. The
6411 alternative is to skip the 'nm' extraction part and to compile a small
6412 test program instead to determine whether each symbol is present. If
6413 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6414 this may be the best solution.
6416 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6419 rp="Shall I use $nm to extract C symbols from the libraries?"
6422 [Nn]*) usenm=false;;
6431 : nm options which may be necessary
6433 '') if $test -f /mach_boot; then
6435 elif $test -d /usr/ccs/lib; then
6436 nm_opt='-p' # Solaris (and SunOS?)
6437 elif $test -f /dgux; then
6439 elif $test -f /lib64/rld; then
6440 nm_opt='-p' # 64-bit Irix
6446 : nm options which may be necessary for shared libraries but illegal
6447 : for archive libraries. Thank you, Linux.
6448 case "$nm_so_opt" in
6449 '') case "$myuname" in
6451 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6452 nm_so_opt='--dynamic'
6459 : Figure out where the libc is located
6462 : get list of predefined functions in a handy place
6467 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6473 *) for thislib in $libs; do
6476 : Handle C library specially below.
6479 thislib=`echo $thislib | $sed -e 's/^-l//'`
6480 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6482 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6484 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6486 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6488 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6490 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6492 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6497 libnames="$libnames $try"
6499 *) libnames="$libnames $thislib" ;;
6508 for xxx in $libpth; do
6509 $test -r $1 || set $xxx/libc.$so
6510 : The messy sed command sorts on library version numbers.
6512 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6513 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6515 s/[0-9][0-9]*/0000&/g
6516 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6519 $sort | $sed -e 's/^.* //'`
6522 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6523 $test -r $1 || set $sysroot/lib/libsys_s$_a
6529 if $test -r "$1"; then
6530 echo "Your (shared) C library seems to be in $1."
6532 elif $test -r /lib/libc && $test -r /lib/clib; then
6533 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6535 libc='/lib/clib /lib/libc'
6536 if $test -r /lib/syslib; then
6537 echo "(Your math library is in /lib/syslib.)"
6538 libc="$libc /lib/syslib"
6540 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6541 echo "Your C library seems to be in $libc, as you said before."
6542 elif $test -r $incpath/usr/lib/libc$_a; then
6543 libc=$incpath/usr/lib/libc$_a;
6544 echo "Your C library seems to be in $libc. That's fine."
6545 elif $test -r /lib/libc$_a; then
6547 echo "Your C library seems to be in $libc. You're normal."
6549 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6551 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6552 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6553 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6555 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6557 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6560 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6562 if $test -r "$tans"; then
6563 echo "Your C library seems to be in $tans, of all places."
6569 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6573 If the guess above is wrong (which it might be if you're using a strange
6574 compiler, or your machine supports multiple models), you can override it here.
6579 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6581 I can't seem to find your C library. I've looked in the following places:
6584 $sed 's/^/ /' libpath
6587 None of these seems to contain your C library. I need to get its name...
6592 rp='Where is your C library?'
6597 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6598 set X `cat libnames`
6601 case $# in 1) xxx=file; esac
6602 echo "Extracting names from the following $xxx for later perusal:" >&4
6604 $sed 's/^/ /' libnames >&4
6606 $echo $n "This may take a while...$c" >&4
6610 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6611 *) $nm $nm_opt $file 2>/dev/null;;
6616 $grep fprintf libc.tmp > libc.ptf
6617 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6618 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6620 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6624 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6628 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6632 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6636 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6645 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 $nm -p $* 2>/dev/null >libc.tmp
6679 $grep fprintf libc.tmp > libc.ptf
6680 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6681 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6687 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6689 if $ar t $libc > libc.tmp && \
6690 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6692 for thisname in $libnames $libc; do
6693 $ar t $thisname >>libc.tmp
6695 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6697 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6698 for thisname in $libnames $libc; do
6699 $ar tv $thisname >>libc.tmp
6700 emximp -o tmp.imp $thisname \
6702 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6703 < tmp.imp >>libc.tmp
6706 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6709 echo "$ar didn't seem to work right." >&4
6710 echo "Maybe this is a Cray...trying bld instead..." >&4
6712 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6715 for thisname in $libnames; do
6717 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6718 $ar t $thisname >>libc.tmp
6722 echo "That didn't work either. Giving up." >&4
6732 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6733 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6735 *) if $test -f /lib/syscalls.exp; then
6737 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6738 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6739 /lib/syscalls.exp >>libc.list
6745 $rm -f libnames libpath
6747 : Check if we are using C++
6749 echo "Checking for C++..." >&4
6750 $cat >try.c <<'EOCP'
6762 if eval $compile_ok && $run ./try; then
6764 echo "You are using a C++ compiler."
6767 echo "You are not using a C++ compiler."
6773 : is a C symbol defined?
6776 -v) tf=libc.tmp; tdc="";;
6777 -a) tf=libc.tmp; tdc="[]";;
6778 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6780 case "$d_cplusplus" in
6781 $define) extern_C="extern \"C\"" ;;
6782 *) extern_C="extern" ;;
6785 case "$reuseval-$4" in
6787 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6792 if $test "$runnm" = true; then
6793 if $contains $tlook $tf >/dev/null 2>&1; then
6795 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6796 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;
6797 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6798 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6802 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;
6803 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6809 $define) tval=true;;
6816 : define an is-in-libc? function
6817 inlibc='echo " "; td=$define; tu=$undef;
6818 sym=$1; var=$2; eval "was=\$$2";
6820 case "$reuseval$was" in
6830 echo "$sym() found." >&4;
6831 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6833 echo "$sym() NOT found." >&4;
6834 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6838 $define) echo "$sym() found." >&4;;
6839 *) echo "$sym() NOT found." >&4;;
6843 : check for length of double
6845 case "$doublesize" in
6847 echo "Checking to see how big your double precision numbers are..." >&4
6856 printf("%d\n", (int)sizeof(double));
6861 if eval $compile_ok; then
6862 doublesize=`$run ./try`
6863 echo "Your double is $doublesize bytes long."
6866 echo "(I can't seem to compile the test program. Guessing...)"
6867 rp="What is the size of a double precision number (in bytes)?"
6875 : see if this is a float.h system
6879 : check for long doubles
6881 echo "Checking to see if you have long double..." >&4
6882 echo 'int main() { long double x = 7.0; }' > try.c
6884 if eval $compile; then
6886 echo "You have long double."
6889 echo "You do not have long double."
6895 : see if ldexpl exists
6899 : check for length of long double
6900 case "${d_longdbl}${longdblsize}" in
6903 echo "Checking to see how big your long doubles are..." >&4
6904 $cat >try.c <<'EOCP'
6908 printf("%d\n", sizeof(long double));
6913 if eval $compile; then
6914 longdblsize=`$run ./try`
6915 echo "Your long doubles are $longdblsize bytes long."
6919 echo "(I can't seem to compile the test program. Guessing...)" >&4
6920 rp="What is the size of a long double (in bytes)?"
6924 if $test "X$doublesize" = "X$longdblsize"; then
6925 echo "That isn't any different from an ordinary double."
6926 echo "I'll keep your setting anyway, but you may see some"
6927 echo "harmless compilation warnings."
6933 $echo "Checking the kind of long doubles you have..." >&4
6934 case "$d_longdbl" in
6939 #define LONGDBLSIZE $longdblsize
6940 #define DOUBLESIZE $doublesize
6948 static const long double d = -0.1L;
6950 unsigned const char* b = (unsigned const char*)(&d);
6951 #if DOUBLESIZE == LONGDBLSIZE
6952 printf("0\n"); /* if it floats like double */
6955 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6956 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6957 /* IEEE 754 128-bit little-endian */
6961 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6962 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6967 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6968 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6969 * cannot be trusted. */
6970 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6971 if (b[0] == 0xCD && b[9] == 0xBF) {
6972 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6973 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6974 * Also known as "extended precision". */
6978 if (b[0] == 0xBF && b[9] == 0xCD) {
6979 /* Is there ever big-endian 80-bit, really?
6981 * The Motorola 68881 had another "extended precision" format:
6982 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6983 * for total of 96 bits of bytes. The zero bits were unused.
6984 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6985 * If it ever becomes relevant, this format should be allocated
6986 * a new doublekind code since it's quite different from the Intel x87.
6992 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6993 /* software "double double", the 106 is 53+53.
6994 * but irix thinks it is 107. */
6995 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6996 /* double double 128-bit fully little-endian,
6997 * little-endian doubles in little-endian order,
6998 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7002 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7003 /* double double 128-bit fully big-endian,
7004 * big-endian doubles in big-endian order,
7005 * e.g. PPC/Power and MIPS:
7006 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7010 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7011 /* double double 128-bit mixed endian.
7012 * little-endian doubles in big-endian order,
7014 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7018 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7019 /* double double 128-bit mixed endian,
7020 * big-endian doubles in little-endian order,
7021 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7026 printf("-1\n"); /* unknown */
7031 if eval $compile; then
7032 longdblkind=`$run ./try`
7039 case "$longdblkind" in
7040 0) echo "Your long doubles are doubles." >&4 ;;
7041 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7042 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7043 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7044 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7045 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7046 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7047 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7048 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7049 *) echo "Cannot figure out your long double." >&4 ;;
7053 : determine the architecture name
7055 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7056 tarch=`arch`"-$osname"
7057 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7058 if uname -m > tmparch 2>&1 ; then
7059 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7060 -e 's/$/'"-$osname/" tmparch`
7068 case "$myarchname" in
7071 echo "(Your architecture name used to be $myarchname.)"
7075 case "$targetarch" in
7077 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7082 *) dflt="$archname";;
7084 rp='What is your architecture name'
7088 : optionally add API version to the architecture for versioned archlibs
7089 case "$useversionedarchname" in
7090 $define|true|[yY]*) dflt='y';;
7093 rp='Add the Perl API version to your archname?'
7096 y|Y) useversionedarchname="$define" ;;
7097 *) useversionedarchname="$undef" ;;
7099 case "$useversionedarchname" in
7102 *-$api_versionstring)
7103 echo "...and architecture name already has -$api_versionstring" >&4
7106 archname="$archname-$api_versionstring"
7107 echo "...setting architecture name to $archname." >&4
7113 case "$usethreads" in
7115 echo "Threads selected." >&4
7117 *-thread*) echo "...and architecture name already has -thread." >&4
7119 *) archname="$archname-thread"
7120 echo "...setting architecture name to $archname." >&4
7125 case "$usemultiplicity" in
7127 echo "Multiplicity selected." >&4
7129 *-multi*) echo "...and architecture name already has -multi." >&4
7131 *) archname="$archname-multi"
7132 echo "...setting architecture name to $archname." >&4
7137 case "$use64bitint$use64bitall" in
7139 case "$archname64" in
7141 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7144 case "$use64bitint" in
7145 "$define") echo "64 bit integers selected." >&4 ;;
7147 case "$use64bitall" in
7148 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7151 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7153 *) archname="$archname-$archname64"
7154 echo "...setting architecture name to $archname." >&4
7160 case "$uselongdouble" in
7162 echo "Long doubles selected." >&4
7163 case "$longdblsize" in
7165 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7169 *-ld*) echo "...and architecture name already has -ld." >&4
7171 *) archname="$archname-ld"
7172 echo "...setting architecture name to $archname." >&4
7179 case "$usequadmath" in
7181 echo "quadmath selected." >&4
7183 *-ld*) echo "...and architecture name already has -quadmath." >&4
7185 *) archname="$archname-quadmath"
7186 echo "...setting architecture name to $archname." >&4
7191 if $test -f archname.cbu; then
7192 echo "Your platform has some specific hints for architecture name, using them..."
7196 : set the prefixit variable, to compute a suitable default value
7197 prefixit='case "$3" in
7199 case "$oldprefix" in
7200 "") eval "$1=\"\$$2\"";;
7207 ""|" ") eval "$1=\"\$$2\"";;
7213 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7215 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7216 /*-$oldprefix/*|\~*-$oldprefix/*)
7217 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7218 *) eval "$1=\"\$$2\"";;
7222 : determine installation style
7223 : For now, try to deduce it from prefix unless it is already set.
7224 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7225 case "$installstyle" in
7226 '') case "$prefix" in
7227 *perl*) dflt='lib';;
7228 *) dflt='lib/perl5' ;;
7231 *) dflt="$installstyle" ;;
7233 : Probably not worth prompting for this since we prompt for all
7234 : the directories individually, and the prompt would be too long and
7238 : determine where public executables go
7243 rp='Pathname where the public executables will reside?'
7245 if $test "X$ansexp" != "X$binexp"; then
7249 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7250 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7251 : this via initialinstalllocation
7254 case "$userelocatableinc" in
7255 $define|true|[yY]*) dflt='y' ;;
7260 Would you like to build Perl so that the installation is relocatable, so that
7261 library paths in @INC are determined relative to the path of the perl binary?
7262 This is not advised for system Perl installs, or if you need to run setid
7263 scripts or scripts under taint mode.
7265 If this doesn't make any sense to you, just accept the default '$dflt'.
7267 rp='Use relocatable @INC?'
7270 y|Y) val="$define" ;;
7273 set userelocatableinc
7276 initialinstalllocation="$binexp"
7277 : Default prefix is now "up one level from where the binaries are"
7278 case "$userelocatableinc" in
7284 installprefixexp=".../.."
7288 : determine where private library files go
7289 : Usual default is /usr/local/lib/perl5/$version.
7290 : Also allow things like /opt/perl/lib/$version, since
7291 : /opt/perl/lib/perl5... would be redundant.
7292 : The default "style" setting is made in installstyle.U
7293 case "$installstyle" in
7294 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7295 *) set dflt privlib lib/$version ;;
7300 There are some auxiliary files for $package that need to be put into a
7301 private library directory that is accessible by everyone.
7306 rp='Pathname where the private library files will reside?'
7311 : set the prefixup variable, to restore leading tilda escape
7312 prefixup='case "$prefixexp" in
7314 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7317 : determine where public architecture dependent libraries go
7320 : privlib default is /usr/local/lib/$package/$version
7321 : archlib default is /usr/local/lib/$package/$version/$archname
7322 : privlib may have an optional trailing /share.
7323 tdflt=`echo $privlib | $sed 's,/share$,,'`
7324 tdflt=$tdflt/$archname
7333 $spackage contains architecture-dependent library files. If you are
7334 sharing libraries in a heterogeneous environment, you might store
7335 these files in a separate location. Otherwise, you can just include
7336 them with the rest of the public library files.
7341 rp='Where do you want to put the public architecture-dependent libraries?'
7345 if $test X"$archlib" = X"$privlib"; then
7351 : see if setuid scripts can be secure
7354 Some kernels have a bug that prevents setuid #! scripts from being
7355 secure. Some sites have disabled setuid #! scripts because of this.
7357 First let's decide if your kernel supports secure setuid #! scripts.
7358 (If setuid #! scripts would be secure but have been disabled anyway,
7359 don't say that they are secure if asked.)
7364 if $test -d /dev/fd; then
7365 echo "#!$ls" >reflect
7366 chmod +x,u+s reflect
7367 ./reflect >flect 2>&1
7368 if $contains "/dev/fd" flect >/dev/null; then
7369 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7373 If you are not sure if they are secure, I can check but I'll need a
7374 username and password different from the one you are using right now.
7375 If you don't have such a username or don't want me to test, simply
7379 rp='Other username to test security of setuid scripts with?'
7384 case "$d_suidsafe" in
7385 '') echo "I'll assume setuid scripts are *not* secure." >&4
7388 echo "Well, the $hint value is *not* secure." >&4
7390 *) echo "Well, the $hint value *is* secure." >&4
7395 $rm -f reflect flect
7396 echo "#!$ls" >reflect
7397 chmod +x,u+s reflect
7400 echo '"su" will (probably) prompt you for '"$ans's password."
7401 su $ans -c './reflect >flect'
7402 if $contains "/dev/fd" flect >/dev/null; then
7403 echo "Okay, it looks like setuid scripts are secure." >&4
7406 echo "I don't think setuid scripts are secure." >&4
7411 rp='Does your kernel have *secure* setuid scripts?'
7414 [yY]*) val="$define";;
7419 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7420 echo "(That's for file descriptors, not floppy disks.)"
7426 $rm -f reflect flect
7428 : now see if they want to do setuid emulation
7429 if $test $patchlevel -lt 11; then
7432 case "$d_suidsafe" in
7435 echo "No need to emulate SUID scripts since they are secure here." >&4
7439 Some systems have disabled setuid scripts, especially systems where
7440 setuid scripts cannot be secure. On systems where setuid scripts have
7441 been disabled, the setuid/setgid bits on scripts are currently
7442 useless. It is possible for $package to detect those bits and emulate
7443 setuid/setgid in a secure fashion. This emulation will only work if
7444 setuid scripts have been disabled in your kernel.
7448 "$define") dflt=y ;;
7451 rp="Do you want to do setuid/setgid emulation?"
7454 [yY]*) val="$define";;
7466 SUID emulation has been removed for 5.12
7467 Please re-run Configure without -Dd_dosuid
7476 : Find perl5.005 or later.
7477 echo "Looking for a previously installed perl5.005 or later... "
7479 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7480 : Check if this perl is recent and can load a simple module
7481 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7484 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7494 '') echo "None found. That's ok.";;
7495 *) echo "Using $perl5." ;;
7498 : Set the siteprefix variables
7501 After $package is installed, you may wish to install various
7502 add-on modules and utilities. Typically, these add-ons will
7503 be installed under $prefix with the rest
7504 of this package. However, you may wish to install such add-ons
7505 elsewhere under a different prefix.
7507 If you do not wish to put everything under a single prefix, that's
7508 ok. You will be prompted for the individual locations; this siteprefix
7509 is only used to suggest the defaults.
7511 The default should be fine for most people.
7515 rp='Installation prefix to use for add-on modules and utilities?'
7516 : XXX Here might be another good place for an installstyle setting.
7517 case "$siteprefix" in
7519 *) dflt=$siteprefix ;;
7522 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7524 case "$siteprefix" in
7528 *) oldsiteprefix="$prefix";;
7533 siteprefixexp="$ansexp"
7535 : determine where site specific libraries go.
7536 : Usual default is /usr/local/lib/perl5/site_perl/$version
7537 : The default "style" setting is made in installstyle.U
7538 : XXX No longer works with Prefixit stuff.
7539 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7541 '') case "$installstyle" in
7542 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7543 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7551 The installation process will create a directory for
7552 site-specific extensions and modules. Most users find it convenient
7553 to place all site-specific files in this directory rather than in the
7554 main distribution directory.
7558 rp='Pathname for the site-specific library files?'
7562 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7564 : Determine list of previous versions to include in @INC
7565 $cat > getverlist <<EOPL
7568 \$api_versionstring = "$api_versionstring";
7569 \$version = "$version";
7570 \$stem = "$sitelib_stem";
7571 \$archname = "$archname";
7573 $cat >> getverlist <<'EOPL'
7574 # The list found is store twice for each entry: the original name, and
7575 # the binary broken down version as pack "sss", so sorting is easy and
7576 # unambiguous. This will work for all versions that have a maximum of
7577 # three digit groups, separate by '.'s or '_'s. Names are extended with
7578 # ".0.0" to ensure at least three elements for the pack.
7579 # -- H.Merijn Brand (m)'06 23-10-2006
7581 # Can't have leading @ because metaconfig interprets it as a command!
7582 ;@inc_version_list=();
7583 # XXX Redo to do opendir/readdir?
7586 ;@candidates = map {
7587 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7588 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7594 ($pversion, $aversion, $vsn5005) = map {
7595 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7596 foreach $d (@candidates) {
7597 if ($d->[1] lt $pversion) {
7598 if ($d->[1] ge $aversion) {
7599 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7601 elsif ($d->[1] ge $vsn5005) {
7602 unshift(@inc_version_list, grep { -d } $d->[0]);
7606 # Skip newer version. I.e. don't look in
7607 # 5.7.0 if we're installing 5.6.1.
7611 if (@inc_version_list) {
7612 print join(' ', @inc_version_list);
7615 # Blank space to preserve value for next Configure run.
7620 case "$inc_version_list" in
7621 '') if test -x "$perl5$exe_ext"; then
7622 dflt=`$perl5 getverlist`
7627 $undef) dflt='none' ;;
7628 *) eval dflt=\"$inc_version_list\" ;;
7631 ''|' ') dflt=none ;;
7638 In order to ease the process of upgrading, this version of perl
7639 can be configured to use modules built and installed with earlier
7640 versions of perl that were installed under $prefix. Specify here
7641 the list of earlier versions that this version of perl should check.
7642 If Configure detected no earlier versions of perl installed under
7643 $prefix, then the list will be empty. Answer 'none' to tell perl
7644 to not search earlier versions.
7646 The default should almost always be sensible, so if you're not sure,
7647 just accept the default.
7650 rp='List of earlier versions to include in @INC?'
7653 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7654 *) inc_version_list="$ans" ;;
7656 case "$inc_version_list" in
7658 inc_version_list_init='0'
7659 d_inc_version_list="$undef"
7661 *) inc_version_list_init=`echo $inc_version_list |
7662 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7663 d_inc_version_list="$define"
7668 : see if malloc/malloc.h has to be included
7669 set malloc/malloc.h i_mallocmalloc
7672 : see if this is a malloc.h system
7673 : we want a real compile instead of Inhdr because some systems have a
7674 : malloc.h that just gives a compile error saying to use stdlib.h instead
7679 #$i_mallocmalloc I_MALLOCMALLOC
7680 #ifdef I_MALLOCMALLOC
7681 # include <malloc/malloc.h>
7684 int main () { return 0; }
7687 if eval $compile; then
7688 echo "<malloc.h> found." >&4
7691 echo "<malloc.h> NOT found." >&4
7698 : check for length of pointer
7702 echo "Checking to see how big your pointers are..." >&4
7711 printf("%d\n", (int)sizeof(void *));
7716 if eval $compile_ok; then
7717 ptrsize=`$run ./try`
7718 echo "Your pointers are $ptrsize bytes long."
7721 echo "(I can't seem to compile the test program. Guessing...)" >&4
7722 rp="What is the size of a pointer (in bytes)?"
7729 case "$use64bitall" in
7730 "$define"|true|[yY]*)
7734 *** You have chosen a maximally 64-bit build,
7735 *** but your pointers are only 4 bytes wide.
7736 *** Please rerun Configure without -Duse64bitall.
7741 *** Since you have quads, you could possibly try with -Duse64bitint.
7746 *** Cannot continue, aborting.
7757 : determine whether to use malloc wrapping
7759 case "$usemallocwrap" in
7760 [yY]*|true|$define) dflt='y' ;;
7761 [nN]*|false|$undef) dflt='n' ;;
7762 *) case "$usedevel" in
7763 [yY]*|true|$define) dflt='y' ;;
7768 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7770 usemallocwrap="$ans"
7773 usemallocwrap="$define" ;;
7775 usemallocwrap="$undef" ;;
7778 : determine which malloc to compile in
7780 case "$usemymalloc" in
7781 [yY]*|true|$define) dflt='y' ;;
7782 [nN]*|false|$undef) dflt='n' ;;
7783 *) case "$ptrsize" in
7787 if test "$useithreads" = "$define"; then dflt='n'; fi
7790 rp="Do you wish to attempt to use the malloc that comes with $package?"
7796 mallocsrc='malloc.c'
7797 mallocobj="malloc$_o"
7798 d_mymalloc="$define"
7801 : Remove malloc from list of libraries to use
7802 echo "Removing unneeded -lmalloc from library list" >&4
7803 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7806 echo "libs = $libs" >&4
7818 : compute the return types of malloc and free
7820 $cat >malloc.c <<END
7824 #include <sys/types.h>
7838 case "$malloctype" in
7840 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7847 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7851 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7858 echo "Your system uses $freetype free(), it would seem." >&4
7860 : determine where site specific architecture-dependent libraries go.
7861 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7862 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7863 : sitelib may have an optional trailing /share.
7865 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7866 dflt="$dflt/$archname"
7871 set sitearch sitearch none
7875 The installation process will also create a directory for
7876 architecture-dependent site-specific extensions and modules.
7880 rp='Pathname for the site-specific architecture-dependent library files?'
7884 if $test X"$sitearch" = X"$sitelib"; then
7887 d_sitearch="$define"
7890 : Set the vendorprefix variables
7893 The installation process will also create a directory for
7894 vendor-supplied add-ons. Vendors who supply perl with their system
7895 may find it convenient to place all vendor-supplied files in this
7896 directory rather than in the main distribution directory. This will
7897 ease upgrades between binary-compatible maintenance versions of perl.
7899 Of course you may also use these directories in whatever way you see
7900 fit. For example, you might use them to access modules shared over a
7901 company-wide network.
7903 The default answer should be fine for most people.
7904 This causes further questions about vendor add-ons to be skipped
7905 and no vendor-specific directories will be configured for perl.
7908 rp='Do you want to configure vendor-specific add-on directories?'
7909 case "$usevendorprefix" in
7910 define|true|[yY]*) dflt=y ;;
7911 *) : User may have set vendorprefix directly on Configure command line.
7912 case "$vendorprefix" in
7921 rp='Installation prefix to use for vendor-supplied add-ons?'
7922 case "$vendorprefix" in
7923 '') dflt="$prefix" ;;
7924 *) dflt=$vendorprefix ;;
7927 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7929 case "$vendorprefix" in
7933 *) oldvendorprefix="$prefix";;
7937 usevendorprefix="$define"
7939 vendorprefixexp="$ansexp"
7941 *) usevendorprefix="$undef"
7947 : Set the vendorlib variables
7948 case "$vendorprefix" in
7949 '') d_vendorlib="$undef"
7953 *) d_vendorlib="$define"
7954 : determine where vendor-supplied modules go.
7955 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7956 case "$vendorlib" in
7958 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7959 case "$installstyle" in
7960 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7961 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7964 *) dflt="$vendorlib"
7968 rp='Pathname for the vendor-supplied library files?'
7971 vendorlibexp="$ansexp"
7974 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7978 : Set the vendorarch variables
7979 case "$vendorprefix" in
7980 '') d_vendorarch="$undef"
7984 *) d_vendorarch="$define"
7985 : determine where vendor-supplied architecture-dependent libraries go.
7986 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7987 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7988 : vendorlib may have an optional trailing /share.
7989 case "$vendorarch" in
7990 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7991 dflt="$dflt/$archname"
7993 *) dflt="$vendorarch" ;;
7996 rp='Pathname for vendor-supplied architecture-dependent files?'
7999 vendorarchexp="$ansexp"
8002 prefixvar=vendorarch
8004 if $test X"$vendorarch" = X"$vendorlib"; then
8005 d_vendorarch="$undef"
8007 d_vendorarch="$define"
8010 : Final catch-all directories to search
8013 Lastly, you can have perl look in other directories for extensions and
8014 modules in addition to those already specified.
8015 These directories will be searched after
8019 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8020 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8022 case "$otherlibdirs" in
8023 ''|' ') dflt='none' ;;
8024 *) dflt="$otherlibdirs" ;;
8027 Enter a colon-separated set of extra paths to include in perl's @INC
8028 search path, or enter 'none' for no extra paths.
8032 rp='Colon-separated list of additional directories for perl to search?'
8035 ' '|''|none) otherlibdirs=' ' ;;
8036 *) otherlibdirs="$ans" ;;
8038 case "$otherlibdirs" in
8042 set d_perl_otherlibdirs
8045 : Cruising for prototypes
8047 echo "Checking out function prototypes..." >&4
8048 $cat >prototype.c <<EOCP
8053 int main(int argc, char *argv[]) {
8056 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8057 echo "Your C compiler appears to support function prototypes."
8060 echo "Your C compiler doesn't seem to understand function prototypes."
8067 : Check if ansi2knr is required
8068 case "$prototype" in
8070 *) ansi2knr='ansi2knr'
8075 This version of $package can only be compiled by a compiler that
8076 understands function prototypes. Unfortunately, your C compiler
8078 doesn't seem to understand them. Sorry about that.
8080 If GNU cc is available for your system, perhaps you could try that instead.
8082 Eventually, we hope to support building Perl with pre-ANSI compilers.
8083 If you would like to help in that effort, please contact <perlbug@perl.org>.
8085 Aborting Configure now.
8092 dflt_dtrace='/usr/sbin/dtrace'
8093 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8097 Perl can be built to support DTrace on platforms that support it.
8098 DTrace is a diagnosis and performance analysis tool from Sun.
8100 If this doesn't make any sense to you, just accept the default.
8104 case "$usedtrace" in
8110 dflt_dtrace=$usedtrace
8117 rp='Support DTrace if available?'
8120 y|Y) val="$define" ;;
8126 test "X$usedtrace" != "X$define" && break
8129 rp='Where is the dtrace executable?'
8138 if $dtrace -h -s ../perldtrace.d \
8139 -o perldtrace.tmp >/dev/null 2>&1 \
8140 && rm -f perldtrace.tmp
8143 echo "Good: your $dtrace knows about the -h flag."
8147 *** $me: Fatal Error: $dtrace doesn't support -h flag
8149 *** Your installed dtrace doesn't support the -h switch to compile a D
8150 *** program into a C header. Can't continue.
8162 *** $me: Fatal Error: $dtrace not found.
8169 echo "*** $dtrace was not found."
8175 case "$usedtrace" in
8177 case "$dtraceobject" in
8179 dtraceobject=$define
8182 $dtrace -h -s ../perldtrace.d -o perldtrace.h
8184 #include "perldtrace.h"
8186 PERL_LOADED_FILE("dummy");
8191 if $cc -c -o try.o $optimize $ccflags try.c \
8192 && $dtrace -G -s ../perldtrace.d try.o ; then
8193 dtraceobject=$define
8194 echo "Your dtrace builds an object file"
8196 $rm -f try.c try.o perldtrace.o
8198 *) dtraceobject=$undef ;;
8202 : See if we want extra modules installed
8209 Perl can be built with extra modules or bundles of modules which
8210 will be fetched from the CPAN and installed alongside Perl.
8212 Notice that you will need access to the CPAN; either via the Internet,
8213 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8214 be asked later to configure the CPAN.pm module which will in turn do
8215 the installation of the rest of the extra modules or bundles.)
8217 Notice also that if the modules require any external software such as
8218 libraries and headers (the libz library and the zlib.h header for the
8219 Compress::Zlib module, for example) you MUST have any such software
8220 already installed, this configuration process will NOT install such
8223 If this doesn't make any sense to you, just accept the default '$dflt'.
8225 rp='Install any extra modules (y or n)?'
8231 Please list any extra modules or bundles to be installed from CPAN,
8232 with spaces between the names. The names can be in any format the
8233 'install' command of CPAN.pm will understand. (Answer 'none',
8234 without the quotes, to install no extra modules or bundles.)
8244 $rm -f ../extras.lst
8246 *) echo "(Saving the list of extras for later...)"
8247 echo "$extras" > ../extras.lst
8255 : determine where html pages for programs go
8256 set html1dir html1dir none
8260 If you wish to install html files for programs in $spackage, indicate
8261 the appropriate directory here. To skip installing html files,
8265 ''|none|$undef|' ') dflt=none ;;
8266 *) dflt=$html1dir ;;
8269 rp="Directory for the main $spackage html pages?"
8273 : Use ' ' for none so value is preserved next time through Configure
8274 $test X"$html1dir" = "X" && html1dir=' '
8276 : determine where html pages for libraries and modules go
8277 set html3dir html3dir none
8281 If you wish to install html files for modules associated with $spackage,
8282 indicate the appropriate directory here. To skip installing html files,
8285 : There is no obvious default. If they have specified html1dir, then
8286 : try to key off that, possibly changing .../html1 into .../html3.
8288 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8289 *) dflt=$html3dir ;;
8292 rp="Directory for the $spackage module html pages?"
8296 : Use ' ' for none so value is preserved next time through Configure
8297 $test X"$html3dir" = "X" && html3dir=' '
8299 : determine whether to install perl also as /usr/bin/perl
8302 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8304 Many scripts expect perl to be installed as /usr/bin/perl.
8306 If you want to, I can install the perl you are about to compile
8307 as /usr/bin/perl (in addition to $bin/perl).
8309 if test -f /usr/bin/perl; then
8312 However, please note that because you already have a /usr/bin/perl,
8313 overwriting that with a new Perl would very probably cause problems.
8314 Therefore I'm assuming you don't want to do that (unless you insist).
8317 case "$installusrbinperl" in
8318 "$define"|[yY]*) dflt='y';;
8324 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8327 case "$installusrbinperl" in
8328 "$undef"|[nN]*) dflt='n';;
8332 rp="Do you want to install perl as /usr/bin/perl?"
8335 [yY]*) val="$define";;
8341 set installusrbinperl
8344 : see if dlopen exists
8346 xxx_ccflags="$ccflags"
8348 : with g++ one needs -shared to get is-in-libc to work for dlopen
8349 case "$gccversion" in
8352 *) case "$d_cplusplus" in
8353 "$define") ccflags="$ccflags -shared" ;;
8360 ccflags="$xxx_ccflags"
8362 : see if this is a unistd.h system
8363 set unistd.h i_unistd
8366 : determine which dynamic loading, if any, to compile in
8368 dldir="ext/DynaLoader"
8381 $define) dflt='y' ;;
8383 : Does a dl_xxx.xs file exist for this operating system
8384 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8387 rp="Do you wish to use dynamic loading?"
8394 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8395 dflt="$dldir/dl_${osname}.xs"
8396 elif $test "$d_dlopen" = "$define" ; then
8397 dflt="$dldir/dl_dlopen.xs"
8402 *) dflt="$dldir/$dlsrc"
8405 echo "The following dynamic loading files are available:"
8406 : Can not go over to $dldir because getfile has path hard-coded in.
8407 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8408 rp="Source file to use for dynamic loading"
8414 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8418 Some systems may require passing special flags to $cc -c to
8419 compile modules that will be used to create a shared library.
8420 To use no flags, say "none".
8423 case "$cccdlflags" in
8424 '') case "$gccversion" in
8425 '') case "$osname" in
8427 irix*) dflt='-KPIC' ;;
8428 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8429 sunos) dflt='-pic' ;;
8433 *) case "$osname" in
8434 darwin) dflt='none' ;;
8435 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8440 *) dflt="$cccdlflags" ;;
8447 # If -Dsysroot was specified, now's the time to add it
8449 if test "X$sysroot" != X; then
8450 case "$gccversion" in
8455 dflt="$dflt --sysroot=$sysroot" ;;
8465 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8468 none) cccdlflags=' ' ;;
8469 *) cccdlflags="$ans" ;;
8474 Some systems use ld to create libraries that can be dynamically loaded,
8475 while other systems (such as those using ELF) use $cc.
8479 : Determine if this is ELF
8481 /* Test for whether ELF binaries are produced */
8493 int i = open("a.out",O_RDONLY);
8496 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8497 exit(0); /* succeed (yes, it is ELF) */
8501 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8507 '') if $test $bin_ELF = "$define"; then
8509 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8513 echo "I'll use ld to build dynamic libraries."
8521 rp="What command should be used to create dynamic libraries?"
8527 Some systems may require passing special flags to $ld to create a
8528 library that can be dynamically loaded. If your ld flags include
8529 -L/other/path options to locate libraries outside your loader's normal
8530 search path, you may need to specify those -L options here as well. To
8531 use no flags, say "none".
8534 case "$lddlflags" in
8535 '') case "$osname" in
8536 haiku) dflt='-shared' ;;
8538 case "$gccversion" in
8539 '') dflt="$dflt +vnocompatwarnings" ;;
8542 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8543 solaris) # See [perl #66604].
8544 # On Solaris 11, gcc -m64 on amd64
8545 # appears not to understand -G. gcc versions at
8546 # least as old as 3.4.3 support -shared, so just
8547 # use that with Solaris 11 and later, but keep
8548 # the old behavior for older Solaris versions.
8549 case "$gccversion" in
8551 *) case "$osvers" in
8552 2.?|2.10) dflt='-G' ;;
8553 *) dflt='-shared' ;;
8558 sunos) dflt='-assert nodefinitions' ;;
8559 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8563 *) dflt="$lddlflags" ;;
8566 : Only do this for gcc, since, for example, qcc has no concept
8568 if $test "X$sysroot" != X; then
8569 case "$gccversion" in
8571 *) dflt="$dflt --sysroot $sysroot" ;;
8575 : Try to guess additional flags to pick up local libraries.
8576 : Be careful not to append to a plain 'none'
8580 for thisflag in $ldflags; do
8585 *) dflt="$dflt $thisflag" ;;
8592 ''|' ') dflt='none' ;;
8596 *-fstack-protector-strong*)
8598 *-fstack-protector-strong*) ;; # Don't add it again
8599 *) dflt="$dflt -fstack-protector-strong" ;;
8602 *-fstack-protector*)
8604 *-fstack-protector*) ;; # Don't add it again
8605 *) dflt="$dflt -fstack-protector" ;;
8610 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8613 none) lddlflags=' ' ;;
8614 *) lddlflags="$ans" ;;
8619 Some systems may require passing special flags to $cc to indicate that
8620 the resulting executable will use dynamic linking. To use no flags,
8624 case "$ccdlflags" in
8625 '') case "$osname" in
8626 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8627 sunos) dflt='none' ;;
8631 *) dflt="$ccdlflags" ;;
8633 rp="Any special flags to pass to $cc to use dynamic linking?"
8636 none) ccdlflags=' ' ;;
8637 *) ccdlflags="$ans" ;;
8649 ld_can_script="$undef"
8650 case "$bin_ELF$usedl" in
8652 # Abuse try.h and a.out names for neat cleanup
8664 if $cc $cccdlflags $ccdlflags $ccflags \
8665 $ldflags $lddlflags -o a.out try.c \
8666 -Wl,--version-script=try.h >/dev/null 2>&1 \
8667 && $test -s a.out ; then
8668 echo "ld supports scripting" >&4
8669 ld_can_script="$define"
8671 echo "ld does not support scripting" >&4
8677 : Do we want a shared libperl?
8681 # No dynamic loading being used, so don't bother even to prompt.
8684 *) case "$useshrplib" in
8685 '') case "$osname" in
8686 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8688 also='Building a shared libperl is required for dynamic loading to work on your system.'
8702 The perl executable is normally obtained by linking perlmain.c with
8703 libperl${_a}, any static extensions (usually just DynaLoader), and
8704 any other libraries needed on this system (such as -lm, etc.). Since
8705 your system supports dynamic loading, it is probably possible to build
8706 a shared libperl.$so. If you will have more than one executable linked
8707 to libperl.$so, this will significantly reduce the size of each
8708 executable, but it may have a noticeable effect on performance. The
8709 default is probably sensible for your system.
8713 rp="Build a shared libperl.$so (y/n)"
8717 useshrplib='true' ;;
8718 *) useshrplib='false' ;;
8723 case "$useshrplib" in
8725 case "$userelocatableinc" in
8727 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8728 echo "See INSTALL for an explanation why that won't work." >&4
8734 # Figure out a good name for libperl.so. Since it gets stored in
8735 # a version-specific architecture-dependent library, the version
8736 # number isn't really that important, except for making cc/ld happy.
8738 # A name such as libperl.so.10.1
8739 majmin="libperl.$so.$patchlevel.$subversion"
8740 # A name such as libperl.so.100
8741 majonly=`echo $patchlevel $subversion |
8742 $awk '{printf "%d%02d", $1, $2}'`
8743 majonly=libperl.$so.$majonly
8744 # I'd prefer to keep the os-specific stuff here to a minimum, and
8745 # rely on figuring it out from the naming of libc.
8746 case "${osname}${osvers}" in
8747 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8750 cygwin*) # ld links now against the dll directly
8751 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8752 majonly=`echo $patchlevel $subversion |
8753 $awk '{printf "%03d%03d", $1, $2}'`
8754 majonly=cygperl5.$majonly.$so
8757 *) # Try to guess based on whether libc has major.minor.
8759 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8760 *libc.$so.[0-9]*) dflt=$majonly ;;
8761 *) dflt=libperl.$so ;;
8771 I need to select a good name for the shared libperl. If your system uses
8772 library names with major and minor numbers, then you might want something
8773 like $majmin. Alternatively, if your system uses a single version
8774 number for shared libraries, then you might want to use $majonly.
8775 Or, your system might be quite happy with a simple libperl.$so.
8777 Since the shared libperl will get installed into a version-specific
8778 architecture-dependent directory, the version number of the shared perl
8779 library probably isn't important, so the default should be o.k.
8782 rp='What name do you want to give to the shared libperl?'
8785 echo "Ok, I'll use $libperl"
8788 libperl="libperl${_a}"
8792 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8796 WARNING: Use of the shrpdir variable for the installation location of
8797 the shared $libperl is not supported. It was never documented and
8798 will not work in this version. Let me (perlbug@perl.org)
8799 know of any problems this may cause.
8805 But your current setting of $shrpdir is
8806 the default anyway, so it's harmless.
8811 Further, your current attempted setting of $shrpdir
8812 conflicts with the value of $archlibexp/CORE
8813 that installperl will use.
8820 # How will the perl executable find the installed shared $libperl?
8821 # Add $xxx to ccdlflags.
8822 # If we can't figure out a command-line option, use $shrpenv to
8823 # set env LD_RUN_PATH. The main perl makefile uses this.
8824 shrpdir=$archlibexp/CORE
8827 if "$useshrplib"; then
8830 # We'll set it in Makefile.SH...
8835 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8836 xxx="-Wl,-R$shrpdir"
8838 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8839 xxx="-Wl,-rpath,$shrpdir"
8842 # hpux doesn't like the default, either.
8843 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8846 # cygwin needs only ldlibpth
8849 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8855 # Only add $xxx if it isn't already in ccdlflags.
8856 case " $ccdlflags " in
8858 *) ccdlflags="$ccdlflags $xxx"
8861 Adding $xxx to the flags
8862 passed to $ld so that the perl executable will find the
8863 installed shared $libperl.
8871 # Fix ccdlflags in AIX for building external extensions.
8872 # (For building Perl itself bare -bE:perl.exp is needed,
8873 # Makefile.SH takes care of this.)
8875 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8877 # Respect a hint or command-line value.
8879 '') shrpenv="$tmp_shrpenv" ;;
8881 case "$ldlibpthname" in
8882 '') ldlibpthname=LD_LIBRARY_PATH ;;
8883 none) ldlibpthname='' ;;
8886 : determine where manual pages are on this system
8890 syspath='/usr/share/man/man1 /usr/man/man1'
8891 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8892 syspath="$syspath /usr/man/u_man/man1"
8893 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8894 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8895 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8896 sysman=`./loc . /usr/man/man1 $syspath`
8899 if $test -d "$sysman"; then
8900 echo "System manual is in $sysman." >&4
8902 echo "Could not find manual pages in source form." >&4
8905 : determine where manual pages go
8906 set man1dir man1dir none
8910 $spackage has manual pages available in source form.
8914 echo "However, you don't have nroff, so they're probably useless to you."
8916 '') man1dir="none";;
8919 echo "If you don't want the manual sources installed, answer 'none'."
8924 lookpath="$prefixexp/share/man/man1"
8925 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8926 lookpath="$lookpath $prefixexp/man/p_man/man1"
8927 lookpath="$lookpath $prefixexp/man/u_man/man1"
8928 lookpath="$lookpath $prefixexp/man/man.1"
8930 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8931 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8941 rp="Where do the main $spackage manual pages (source) go?"
8943 if $test "X$man1direxp" != "X$ansexp"; then
8954 : What suffix to use on installed man pages
8961 rp="What suffix should be used for the main $spackage man pages?"
8963 '') case "$man1dir" in
8977 *) dflt="$man1ext";;
8984 : see if we can have long filenames
8986 first=123456789abcdef
8988 if (echo hi >$first) 2>/dev/null; then
8989 if $test -f 123456789abcde; then
8990 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8993 echo 'You can have filenames longer than 14 characters.'>&4
8998 You can't have filenames longer than 14 chars.
8999 You can't even think about them!
9005 $rm -rf 123456789abcde*
9007 : determine where library module manual pages go
9008 set man3dir man3dir none
9012 $spackage has manual pages for many of the library modules.
9018 However, you don't have nroff, so they're probably useless to you.
9021 '') man3dir="none";;
9025 case "$d_flexfnam" in
9028 However, your system can't handle the long file names like File::Basename.3.
9031 '') man3dir="none";;
9035 echo "If you don't want the manual sources installed, answer 'none'."
9036 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9038 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9039 if $test -d "$privlib/man/man3"; then
9042 WARNING: Previous versions of perl installed man3 pages into
9043 $privlib/man/man3. This version will suggest a
9044 new default of $dflt.
9048 rp='Do you wish to preserve the old behavior?(y/n)'
9051 y*) dflt="$privlib/man/man3" ;;
9056 *) dflt="$man3dir" ;;
9063 rp="Where do the $package library man pages (source) go?"
9073 : What suffix to use on installed man pages
9079 rp="What suffix should be used for the $package library man pages?"
9081 '') case "$man3dir" in
9095 *) dflt="$man3ext";;
9102 : see if we have to deal with yellow pages, now NIS.
9103 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9109 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9117 rp='Are you getting the hosts file via yellow pages?'
9120 y*) hostcat='ypcat hosts';;
9121 *) hostcat='cat /etc/hosts';;
9127 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9130 '') test -f /etc/group && groupcat='cat /etc/group';;
9133 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9136 : now get the host name
9138 echo "Figuring out host name..." >&4
9139 case "$myhostname" in
9141 echo 'Maybe "hostname" will work...'
9142 if tans=`sh -c hostname 2>&1` ; then
9150 if $test "$cont"; then
9152 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9153 if tans=`cat /etc/systemid 2>&1` ; then
9155 phostname='cat /etc/systemid'
9156 echo "Whadyaknow. Xenix always was a bit strange..."
9159 elif $test -r /etc/systemid; then
9160 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9163 if $test "$cont"; then
9164 echo 'No, maybe "uuname -l" will work...'
9165 if tans=`sh -c 'uuname -l' 2>&1` ; then
9167 phostname='uuname -l'
9169 echo 'Strange. Maybe "uname -n" will work...'
9170 if tans=`sh -c 'uname -n' 2>&1` ; then
9172 phostname='uname -n'
9174 echo 'Oh well, maybe I can mine it out of whoami.h...'
9175 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9176 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9177 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9179 case "$myhostname" in
9180 '') echo "Does this machine have an identity crisis or something?"
9183 echo "Well, you said $myhostname before..."
9184 phostname='echo $myhostname';;
9190 case "$myhostname" in
9191 '') myhostname=noname ;;
9193 : you do not want to know about this
9198 if $test "$myhostname" ; then
9200 rp='Your host name appears to be "'$myhostname'".'" Right?"
9208 : bad guess or no guess
9209 while $test "X$myhostname" = X ; do
9211 rp="Please type the (one word) name of your host:"
9216 : translate upper to lower if necessary
9217 case "$myhostname" in
9219 echo "(Normalizing case in your host name)"
9220 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9224 case "$myhostname" in
9226 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9227 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9228 echo "(Trimming domain name from host name--host name is now $myhostname)"
9230 *) case "$mydomain" in
9233 test "X$hostcat" = "Xypcat hosts" &&
9234 ypmatch "$myhostname" hosts 2>/dev/null |\
9235 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9238 test "X$hostcat" != "X" &&
9239 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9240 /[ ]$myhostname[ . ]/p" > hosts
9243 if $test -f hosts; then
9244 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9245 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9246 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9247 hosts | $sort | $uniq | \
9248 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9249 case `$echo X$dflt` in
9250 X*\ *) echo "(Several hosts in the database matched hostname)"
9253 X.) echo "(You do not have fully-qualified names in the hosts database)"
9257 echo "(I cannot locate a hosts database anywhere)"
9262 tans=`./loc resolv.conf X /etc /usr/etc`
9263 if $test -f "$tans"; then
9264 echo "(Attempting domain name extraction from $tans)"
9265 dflt=.`$sed -n -e 's/ / /g' \
9266 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9269 .) dflt=.`$sed -n -e 's/ / /g' \
9270 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9278 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9279 dflt=.`sh -c domainname 2>/dev/null`
9282 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9286 case "$dflt$osname" in
9287 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9288 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9292 .) echo "(Lost all hope -- silly guess then)"
9298 *) dflt="$mydomain";;
9302 rp="What is your domain name?"
9312 : translate upper to lower if necessary
9315 echo "(Normalizing case in your domain name)"
9316 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9320 : a little sanity check here
9321 case "$phostname" in
9324 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9325 $myhostname$mydomain|$myhostname) ;;
9327 case "$phostname" in
9329 echo "(That doesn't agree with your whoami.h file, by the way.)"
9332 echo "(That doesn't agree with your $phostname command, by the way.)"
9340 : determine the e-mail address of the user who is running us
9343 I need to get your e-mail address in Internet format if possible, i.e.
9344 something like user@host.domain. Please answer accurately since I have
9345 no easy means to double check it. The default value provided below
9346 is most probably close to reality but may not be valid from outside
9347 your organization...
9351 while test "$cont"; do
9352 case "$MAILDOMAIN" in
9354 if $test -s /etc/mailname; then
9355 maildomain=`$cat /etc/mailname`
9357 maildomain="$myhostname$mydomain"
9360 *) maildomain="$MAILDOMAIN";;
9363 '') dflt="$cf_by@$maildomain";;
9364 *) dflt="$cf_email";;
9366 rp='What is your e-mail address?'
9372 rp='Address does not look like an Internet one. Use it anyway?'
9386 : Ask e-mail of administrator
9389 If you or somebody else will be maintaining perl at your site, please
9390 fill in the correct e-mail address here so that they may be contacted
9391 if necessary. Currently, the "perlbug" program included with perl
9392 will send mail to this address in addition to perlbug@perl.org. You may
9393 enter "none" for no administrator.
9396 case "$perladmin" in
9397 '') dflt="$cf_email";;
9398 *) dflt="$perladmin";;
9400 rp='Perl administrator e-mail address'
9404 : determine whether to only install version-specific parts.
9407 Do you want to install only the version-specific parts of the perl
9408 distribution? Usually you do *not* want to do this.
9410 case "$versiononly" in
9411 "$define"|[Yy]*|true) dflt='y' ;;
9414 rp="Do you want to install only the version-specific parts of perl?"
9417 [yY]*) val="$define";;
9423 case "$versiononly" in
9424 "$define") inc_version_list=''
9425 inc_version_list_init=0
9429 : figure out how to guarantee perl startup
9430 : XXX Note that this currently takes advantage of the bug that binexp ignores
9431 : the Configure -Dinstallprefix setting, which in turn means that under
9432 : relocatable @INC, initialinstalllocation is what binexp started as.
9433 case "$startperl" in
9435 case "$sharpbang" in
9439 I can use the #! construct to start perl on your system. This will
9440 make startup of perl scripts faster, but may cause problems if you
9441 want to share those scripts and perl is not in a standard place
9442 ($initialinstalllocation/perl) on all your platforms. The alternative
9443 is to force a shell by starting the script with a single ':' character.
9446 case "$versiononly" in
9447 "$define") dflt="$initialinstalllocation/perl$version";;
9448 *) dflt="$initialinstalllocation/perl";;
9450 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9453 none) startperl=": # use perl";;
9454 *) startperl="#!$ans"
9455 if $test 30 -lt `echo "$ans" | wc -c`; then
9458 WARNING: Some systems limit the #! command to 32 characters.
9459 If you experience difficulty running Perl scripts with #!, try
9460 installing Perl in a directory with a shorter pathname.
9466 *) startperl=": # use perl"
9471 echo "I'll use $startperl to start perl scripts."
9473 : figure best path for perl in scripts
9476 case "$versiononly" in
9477 "$define") perlpath="$initialinstalllocation/perl$version";;
9478 *) perlpath="$initialinstalllocation/perl";;
9480 case "$startperl" in
9485 I will use the "eval 'exec'" idiom to start Perl on your system.
9486 I can use the full path of your Perl binary for this purpose, but
9487 doing so may cause problems if you want to share those scripts and
9488 Perl is not always in a standard place ($initialinstalllocation/perl).
9491 dflt="$initialinstalllocation/perl"
9492 rp="What path shall I use in \"eval 'exec'\"?"
9499 case "$startperl" in
9501 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9504 : determine where public executable scripts go
9505 set scriptdir scriptdir
9507 case "$scriptdir" in
9510 : guess some guesses
9511 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9512 $test -d /usr/share/bin && dflt=/usr/share/bin
9513 $test -d /usr/local/script && dflt=/usr/local/script
9514 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9515 $test -d $prefixexp/script && dflt=$prefixexp/script
9519 *) dflt="$scriptdir"
9524 Some installations have a separate directory just for executable scripts so
9525 that they can mount it across multiple architectures but keep the scripts in
9526 one spot. You might, for example, have a subdirectory of /usr/share for this.
9527 Or you might just lump your scripts in with all your other executables.
9531 rp='Where do you keep publicly executable scripts?'
9533 if $test "X$ansexp" != "X$scriptdirexp"; then
9539 : A little fix up for an irregularly named variable.
9540 installscript="$installscriptdir"
9542 : determine where add-on public executables go
9544 '') dflt=$siteprefix/bin ;;
9548 rp='Pathname where the add-on public executables should be installed?'
9553 : determine where add-on html pages go
9554 : There is no standard location, so try to copy the previously-selected
9555 : directory structure for the core html pages.
9556 case "$sitehtml1dir" in
9557 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9558 *) dflt=$sitehtml1dir ;;
9561 ''|' ') dflt=none ;;
9564 rp='Pathname where the site-specific html pages should be installed?'
9566 prefixvar=sitehtml1dir
9569 : determine where add-on library html pages go
9570 : There is no standard location, so try to copy the previously-selected
9571 : directory structure for the core html pages.
9572 case "$sitehtml3dir" in
9573 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9574 *) dflt=$sitehtml3dir ;;
9577 ''|' ') dflt=none ;;
9580 rp='Pathname where the site-specific library html pages should be installed?'
9582 prefixvar=sitehtml3dir
9585 : determine where add-on manual pages go
9586 case "$siteman1dir" in
9587 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9588 *) dflt=$siteman1dir ;;
9591 ''|' ') dflt=none ;;
9594 rp='Pathname where the site-specific manual pages should be installed?'
9596 prefixvar=siteman1dir
9599 : determine where add-on library man pages go
9600 case "$siteman3dir" in
9601 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9602 *) dflt=$siteman3dir ;;
9605 ''|' ') dflt=none ;;
9608 rp='Pathname where the site-specific library manual pages should be installed?'
9610 prefixvar=siteman3dir
9613 : determine where add-on public executable scripts go
9614 case "$sitescript" in
9615 '') dflt=$siteprefix/script
9616 $test -d $dflt || dflt=$sitebin ;;
9617 *) dflt="$sitescript" ;;
9620 rp='Pathname where add-on public executable scripts should be installed?'
9622 prefixvar=sitescript
9625 : see if backtrace exists
9626 set backtrace d_backtrace
9629 : add flags if using c backtrace
9630 case "$usecbacktrace" in
9631 "") usecbacktrace=$undef ;;
9633 case "$d_backtrace" in
9635 case " $ccflags " in
9636 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9637 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9641 echo "This system does not support backtrace" >&4
9642 usecbacktrace=$undef
9648 : Check if faststdio is requested and available
9649 case "$usefaststdio" in
9650 $define|true|[yY]*|'')
9651 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9661 Perl can be built to use 'fast stdio', which means using the stdio
9662 library but also directly manipulating the stdio buffers to enable
9663 faster I/O. Using stdio is better for backward compatibility (especially
9664 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9665 interface has been preferred instead of stdio.
9667 If this doesn't make any sense to you, just accept the default '$dflt'.
9669 rp='Use the "fast stdio" if available?'
9672 y|Y) val="$define" ;;
9679 : define an is-a-typedef? function
9680 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9682 "") inclist="sys/types.h";;
9684 eval "varval=\$$var";
9688 for inc in $inclist; do
9689 echo "#include <$inc>" >>temp.c;
9691 echo "#ifdef $type" >> temp.c;
9692 echo "printf(\"We have $type\");" >> temp.c;
9693 echo "#endif" >> temp.c;
9694 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9695 if $contains $type temp.E >/dev/null 2>&1; then
9701 *) eval "$var=\$varval";;
9704 : define an is-a-typedef? function that prompts if the type is not available.
9705 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9707 "") inclist="sys/types.h";;
9709 eval "varval=\$$var";
9713 for inc in $inclist; do
9714 echo "#include <$inc>" >>temp.c;
9716 echo "#ifdef $type" >> temp.c;
9717 echo "printf(\"We have $type\");" >> temp.c;
9718 echo "#endif" >> temp.c;
9719 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9721 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9722 if $contains $type temp.E >/dev/null 2>&1; then
9723 echo "$type found." >&4;
9726 echo "$type NOT found." >&4;
9732 *) eval "$var=\$varval";;
9735 : see what type lseek is declared as in the kernel
9736 rp="What is the type used for lseek's offset on this system?"
9737 set off_t lseektype long stdio.h sys/types.h
9741 echo "Checking to see how big your file offsets are..." >&4
9743 #include <sys/types.h>
9747 printf("%d\n", (int)sizeof($lseektype));
9752 if eval $compile_ok; then
9753 lseeksize=`$run ./try`
9754 echo "Your file offsets are $lseeksize bytes long."
9758 echo "(I can't seem to compile the test program. Guessing...)"
9759 rp="What is the size of your file offsets (in bytes)?"
9765 : see what type file positions are declared as in the library
9766 rp="What is the type for file position used by fsetpos()?"
9767 set fpos_t fpostype long stdio.h sys/types.h
9770 : Check size for Fpos_t
9773 *_t) zzz="$fpostype" ;;
9776 echo "Checking the size of $zzz..." >&4
9778 #include <sys/types.h>
9785 printf("%d\n", (int)sizeof($fpostype));
9790 if eval $compile_ok; then
9794 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9797 echo "Your $zzz is $fpossize bytes long."
9803 echo "(I can't compile the test program. Guessing...)" >&4
9804 rp="What is the size of your file positions (in bytes)?"
9809 : Check for large file support
9810 # Backward compatibility (uselfs is deprecated).
9812 "$define"|true|[yY]*)
9815 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9817 uselargefiles="$define"
9821 case "$lseeksize:$fpossize" in
9824 You can have files larger than 2 gigabytes.
9827 *) case "$uselargefiles" in
9828 "$undef"|false|[nN]*) dflt='n' ;;
9833 Perl can be built to understand large files (files larger than 2 gigabytes)
9834 on some systems. To do so, Configure can be run with -Duselargefiles.
9836 If this doesn't make any sense to you, just accept the default '$dflt'.
9838 rp='Try to understand large files, if available?'
9841 y|Y) val="$define" ;;
9848 : Look for a hint-file generated 'call-back-unit'. If the
9849 : user has specified that a large files perl is to be built,
9850 : we may need to set or change some other defaults.
9851 if $test -f uselargefiles.cbu; then
9852 echo "Your platform has some specific hints regarding large file builds, using them..."
9853 . ./uselargefiles.cbu
9855 case "$uselargefiles" in
9857 if $test -f uselargefiles.cbu; then
9859 echo "Rechecking to see how big your file offsets are..." >&4
9861 #include <sys/types.h>
9865 printf("%d\n", (int)sizeof($lseektype));
9870 if eval $compile_ok; then
9871 lseeksize=`$run ./try`
9872 $echo "Your file offsets are now $lseeksize bytes long."
9876 echo "(I can't seem to compile the test program. Guessing...)"
9877 rp="What is the size of your file offsets (in bytes)?"
9882 *_t) zzz="$fpostype" ;;
9885 $echo $n "Rechecking the size of $zzz...$c" >&4
9887 #include <sys/types.h>
9894 printf("%d\n", (int)sizeof($fpostype));
9899 if eval $compile_ok; then
9904 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9907 echo " $fpossize bytes." >&4
9913 echo "(I can't compile the test program. Guessing...)" >&4
9914 rp="What is the size of your file positions (in bytes)?"
9923 : Check if we want perlio
9926 : Set the vendorbin variables
9927 case "$vendorprefix" in
9928 '') d_vendorbin="$undef"
9932 *) d_vendorbin="$define"
9933 : determine where vendor-supplied executables go.
9934 case "$vendorbin" in
9935 '') dflt=$vendorprefix/bin ;;
9936 *) dflt="$vendorbin" ;;
9939 rp='Pathname for the vendor-supplied executables directory?'
9942 vendorbinexp="$ansexp"
9948 : Set the vendorhtml1dir variables
9949 case "$vendorprefix" in
9950 '') vendorhtml1dir=''
9951 vendorhtml1direxp=''
9953 *) : determine where vendor-supplied html pages go.
9954 : There is no standard location, so try to copy the previously-selected
9955 : directory structure for the core html pages.
9956 : XXX Better default suggestions would be welcome.
9957 case "$vendorhtml1dir" in
9958 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9959 *) dflt=$vendorhtml1dir ;;
9962 ''|' ') dflt=none ;;
9965 rp='Pathname for the vendor-supplied html pages?'
9967 vendorhtml1dir="$ans"
9968 vendorhtml1direxp="$ansexp"
9971 : Use ' ' for none so value is preserved next time through Configure
9972 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9973 prefixvar=vendorhtml1dir
9976 : Set the vendorhtml3dir variables
9977 case "$vendorprefix" in
9978 '') vendorhtml3dir=''
9979 vendorhtml3direxp=''
9981 *) : determine where vendor-supplied module html pages go.
9982 : There is no standard location, so try to copy the previously-selected
9983 : directory structure for the core html pages.
9984 : XXX Better default suggestions would be welcome.
9985 case "$vendorhtml3dir" in
9986 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9987 *) dflt=$vendorhtml3dir ;;
9990 ''|' ') dflt=none ;;
9993 rp='Pathname for the vendor-supplied html pages?'
9995 vendorhtml3dir="$ans"
9996 vendorhtml3direxp="$ansexp"
9999 : Use ' ' for none so value is preserved next time through Configure
10000 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10001 prefixvar=vendorhtml3dir
10004 : Set the vendorman1dir variables
10005 case "$vendorprefix" in
10006 '') vendorman1dir=''
10007 vendorman1direxp=''
10009 *) : determine where vendor-supplied manual pages go.
10010 case "$vendorman1dir" in
10011 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10012 *) dflt=$vendorman1dir ;;
10015 ''|' ') dflt=none ;;
10018 rp='Pathname for the vendor-supplied manual section 1 pages?'
10020 vendorman1dir="$ans"
10021 vendorman1direxp="$ansexp"
10024 : Use ' ' for none so value is preserved next time through Configure
10025 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10026 prefixvar=vendorman1dir
10029 : Set the vendorman3dir variables
10030 case "$vendorprefix" in
10031 '') vendorman3dir=''
10032 vendorman3direxp=''
10034 *) : determine where vendor-supplied module manual pages go.
10035 case "$vendorman3dir" in
10036 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10037 *) dflt=$vendorman3dir ;;
10040 ''|' ') dflt=none ;;
10043 rp='Pathname for the vendor-supplied manual section 3 pages?'
10045 vendorman3dir="$ans"
10046 vendorman3direxp="$ansexp"
10049 : Use ' ' for none so value is preserved next time through Configure
10050 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10051 prefixvar=vendorman3dir
10054 : Set the vendorscript variables
10055 case "$vendorprefix" in
10056 '') d_vendorscript="$undef"
10060 *) d_vendorscript="$define"
10061 : determine where vendor-supplied scripts go.
10062 case "$vendorscript" in
10063 '') dflt=$vendorprefix/script
10064 $test -d $dflt || dflt=$vendorbin ;;
10065 *) dflt="$vendorscript" ;;
10069 The installation process will create a directory for
10070 vendor-supplied scripts.
10074 rp='Pathname for the vendor-supplied scripts directory?'
10076 vendorscript="$ans"
10077 vendorscriptexp="$ansexp"
10080 prefixvar=vendorscript
10083 : script used to emit important warnings
10086 if test \$# -gt 0; then
10091 echo "*** WARNING:" >&4
10092 sed -e 's/^/*** /' <msg >&4
10094 cat msg >>config.msg
10095 echo " " >>config.msg
10101 : see which of string.h or strings.h is needed
10103 strings=`./findhdr string.h`
10104 if $test "$strings" && $test -r "$strings"; then
10105 echo "Using <string.h> instead of <strings.h>." >&4
10109 strings=`./findhdr strings.h`
10110 if $test "$strings" && $test -r "$strings"; then
10111 echo "Using <strings.h> instead of <string.h>." >&4
10113 ./warn "No string header found -- You'll surely have problems."
10118 case "$i_string" in
10119 "$undef") strings=`./findhdr strings.h`;;
10120 *) strings=`./findhdr string.h`;;
10123 : see if qgcvt exists
10127 : Check what kind of doubles your system has
10128 $echo "Checking the kind of doubles you have..." >&4
10130 #$i_stdlib I_STDLIB
10131 #define DOUBLESIZE $doublesize
10133 #include <stdlib.h>
10136 static const double d = -0.1;
10138 unsigned const char* b = (unsigned const char*)(&d);
10139 #if DOUBLESIZE == 4
10140 if (b[0] == 0xCD && b[3] == 0xBD) {
10141 /* IEEE 754 32-bit little-endian */
10145 if (b[0] == 0xBD && b[3] == 0xCD) {
10146 /* IEEE 754 32-bit big-endian */
10151 #if DOUBLESIZE == 8
10152 if (b[0] == 0x9A && b[7] == 0xBF) {
10153 /* IEEE 754 64-bit little-endian */
10157 if (b[0] == 0xBF && b[7] == 0x9A) {
10158 /* IEEE 754 64-bit big-endian */
10162 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10163 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10164 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10165 * 99 99 b9 bf 9a 99 99 99 */
10169 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10170 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10171 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10172 * 99 99 99 9a bf b9 99 99 */
10177 #if DOUBLESIZE == 16
10178 if (b[0] == 0x9A && b[15] == 0xBF) {
10179 /* IEEE 754 128-bit little-endian */
10183 if (b[0] == 0xBF && b[15] == 0x9A) {
10184 /* IEEE 754 128-bit big-endian */
10189 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10190 * Whether those environments can still build Perl is debatable. */
10191 printf("-1\n"); /* unknown */
10196 if eval $compile; then
10197 doublekind=`$run ./try`
10201 case "$doublekind" in
10202 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10203 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10204 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10205 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10206 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10207 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10208 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10209 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10210 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10214 : Check print/scan long double stuff
10217 if $test X"$d_longdbl" = X"$define"; then
10219 echo "Checking how to print long doubles..." >&4
10221 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10222 $cat >try.c <<'EOCP'
10223 #include <sys/types.h>
10226 double d = 123.456;
10227 printf("%.3f\n", d);
10231 if eval $compile; then
10235 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10236 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10237 echo "We will use %f."
10243 if $test X"$sPRIfldbl" = X; then
10244 $cat >try.c <<'EOCP'
10245 #include <sys/types.h>
10248 long double d = 123.456;
10249 printf("%.3Lf\n", d);
10253 if eval $compile; then
10257 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10258 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10259 echo "We will use %Lf."
10265 if $test X"$sPRIfldbl" = X; then
10266 $cat >try.c <<'EOCP'
10267 #include <sys/types.h>
10270 long double d = 123.456;
10271 printf("%.3llf\n", d);
10275 if eval $compile; then
10279 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10280 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10281 echo "We will use %llf."
10287 if $test X"$sPRIfldbl" = X; then
10288 $cat >try.c <<'EOCP'
10289 #include <sys/types.h>
10292 long double d = 123.456;
10293 printf("%.3lf\n", d);
10297 if eval $compile; then
10301 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10302 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10303 echo "We will use %lf."
10309 if $test X"$sPRIfldbl" = X; then
10310 echo "Cannot figure out how to print long doubles." >&4
10312 sSCNfldbl=$sPRIfldbl # expect consistency
10319 case "$sPRIfldbl" in
10320 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10321 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10322 d_SCNfldbl="$undef";
10324 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10325 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10326 d_SCNfldbl="$define";
10330 : Before committing on uselongdouble, see whether that looks sane.
10331 if $test "$uselongdouble" = "$define"; then
10334 echo "Checking if your long double math functions work right..." >&4
10339 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10342 case "$osname:$gccversion" in
10343 aix:) saveccflags="$ccflags"
10344 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10347 if eval $compile_ok; then
10351 3) echo "Your long double math functions are working correctly." >&4 ;;
10352 *) echo "Your long double math functions are broken, not using long doubles." >&4
10353 uselongdouble=$undef
10357 case "$osname:$gccversion" in
10358 aix:) ccflags="$saveccflags" ;; # restore
10362 : Check how to convert floats to strings.
10364 if test "X$d_Gconvert" = X; then
10367 echo "Checking for an efficient way to convert floats to strings."
10369 case "$uselongdouble" in
10370 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10372 case "$d_longdbl" in
10373 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10375 case "$d_PRIgldbl" in
10376 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10379 #ifdef TRY_gconvert
10380 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10381 char *myname = "gconvert";
10384 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10385 char *myname = "gcvt";
10388 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10389 char *myname = "qgcvt";
10390 #define DOUBLETYPE long double
10393 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10394 #ifdef HAS_PRIgldbl
10395 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10397 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10400 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10402 char *myname = "sprintf";
10406 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10407 #define DOUBLETYPE long double
10409 #define DOUBLETYPE double
10415 #$i_stdlib I_STDLIB
10417 #include <stdlib.h>
10419 #$i_string I_STRING
10421 # include <string.h>
10423 # include <strings.h>
10426 int checkit(char *expect, char *got)
10428 if (strcmp(expect, got)) {
10429 printf("%s oddity: Expected %s, got %s\n",
10430 myname, expect, got);
10440 /* This must be 1st test on (which?) platform */
10441 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10442 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10443 checkit("0.1", buf);
10445 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10446 checkit("0.01", buf);
10448 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10449 checkit("0.001", buf);
10451 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10452 checkit("0.0001", buf);
10454 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10455 if (strlen(buf) > 5)
10456 checkit("9e-005", buf); /* for Microsoft ?? */
10458 checkit("9e-05", buf);
10460 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10463 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10464 checkit("1.1", buf);
10466 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10467 checkit("1.01", buf);
10469 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10470 checkit("1.001", buf);
10472 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10473 checkit("1.0001", buf);
10475 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10476 checkit("1.00001", buf);
10478 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10479 checkit("1.000001", buf);
10481 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10484 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10485 checkit("-1", buf);
10487 /* Some Linux gcvt's give 1.e+5 here. */
10488 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10489 checkit("100000", buf);
10491 /* Some Linux gcvt's give -1.e+5 here. */
10492 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10493 checkit("-100000", buf);
10495 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10496 checkit("123.456", buf);
10498 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10499 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10500 /* 34 should be enough to scare even long double
10501 * places into using the e notation. */
10502 if (strlen(buf) > 5)
10503 checkit("1e+034", buf); /* for Microsoft */
10505 checkit("1e+34", buf);
10507 /* For Perl, if you add additional tests here, also add them to
10508 * t/base/num.t for benefit of platforms not using Configure or
10509 * overriding d_Gconvert */
10514 : first add preferred functions to our list
10516 for xxx_convert in $gconvert_preference; do
10517 case $xxx_convert in
10518 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10519 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10522 : then add any others
10523 for xxx_convert in gconvert gcvt sprintf; do
10524 case "$xxx_list" in
10526 *) xxx_list="$xxx_list $xxx_convert" ;;
10530 case "$d_longdbl$uselongdouble" in
10532 : again, add preferred functions to our list first
10534 for xxx_convert in $gconvert_ld_preference; do
10535 case $xxx_convert in
10536 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10537 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10540 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10541 for xxx_convert in qgcvt sprintf $xxx_list; do
10542 case "$xxx_ld_list" in
10543 $xxx_convert*|*" $xxx_convert"*) ;;
10544 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10547 : if sprintf cannot do long doubles, move it to the end
10548 if test "$d_PRIgldbl" != "$define"; then
10549 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10551 : if no qgcvt, remove it
10552 if test "$d_qgcvt" != "$define"; then
10553 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10556 xxx_list="$xxx_ld_list"
10560 for xxx_convert in $xxx_list; do
10561 echo "Trying $xxx_convert..."
10562 $rm -f try try$_o core
10563 set try -DTRY_$xxx_convert
10564 if eval $compile; then
10565 echo "$xxx_convert() found." >&4
10566 if $run ./try; then
10567 echo "I'll use $xxx_convert to convert floats into a string." >&4
10570 echo "...But $xxx_convert didn't work as I expected."
10574 echo "$xxx_convert NOT found." >&4
10578 if test X$xxx_convert = X; then
10579 echo "*** WHOA THERE!!! ***" >&4
10580 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10581 xxx_convert=sprintf
10584 case "$xxx_convert" in
10585 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10586 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10587 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10588 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10589 "$define$define$define")
10590 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10591 "$define$define$undef")
10592 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10593 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10601 : see if _fwalk exists
10605 : Initialize h_fcntl
10608 : Initialize h_sysfile
10611 : access call always available on UNIX
10612 set access d_access
10615 : locate the flags for 'access()'
10616 case "$d_access" in
10619 $cat >access.c <<EOCP
10620 #include <sys/types.h>
10625 #include <sys/file.h>
10628 #include <unistd.h>
10630 #$i_stdlib I_STDLIB
10632 #include <stdlib.h>
10638 : check sys/file.h first, no particular reason here
10639 if $test `./findhdr sys/file.h` && \
10640 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10642 echo "<sys/file.h> defines the *_OK access constants." >&4
10643 elif $test `./findhdr fcntl.h` && \
10644 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10646 echo "<fcntl.h> defines the *_OK access constants." >&4
10647 elif $test `./findhdr unistd.h` && \
10648 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10649 echo "<unistd.h> defines the *_OK access constants." >&4
10651 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10657 : see if accessx exists
10658 set accessx d_accessx
10661 : see if acosh exists
10665 : see if aintl exists
10669 : see if alarm exists
10673 : see if 64bit time functions exists
10675 set ctime64 d_ctime64
10678 set localtime64 d_localtime64
10681 set gmtime64 d_gmtime64
10684 set mktime64 d_mktime64
10687 set difftime64 d_difftime64
10690 set asctime64 d_asctime64
10693 : see if POSIX threads are available
10694 set pthread.h i_pthread
10697 : define a function to check prototypes
10698 $cat > protochk <<EOSH
10701 optimize="$optimize"
10703 prototype="$prototype"
10706 usethreads=$usethreads
10707 i_pthread=$i_pthread
10708 pthread_h_first=$pthread_h_first
10711 $cat >> protochk <<'EOSH'
10716 while test $# -ge 2; do
10718 $define) echo "#include <$2>" >> try.c ;;
10719 literal) echo "$2" >> try.c ;;
10721 # Extra magic for the benefit of systems that need pthread.h
10722 # to be included early to correctly detect threadsafe functions.
10723 # Such functions must guarantee themselves, though, that the usethreads
10724 # and i_pthread have been defined, before calling protochk.
10725 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10726 echo "#include <pthread.h>" >> try.c
10731 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10732 cat >> try.c <<'EOCP'
10733 #ifdef CAN_PROTOTYPE
10734 #define _(args) args
10739 echo "$foo" >> try.c
10740 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10741 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10747 $eunicefix protochk
10749 : Define hasproto macro for Configure internal use
10750 hasproto='varname=$1; func=$2; shift; shift;
10751 while $test $# -ge 2; do
10753 $define) echo "#include <$2>";;
10757 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10758 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10759 echo "$func() prototype found.";
10762 echo "$func() prototype NOT found.";
10769 : see if sys/types.h has to be included
10770 set sys/types.h i_systypes
10773 : see if sys/select.h has to be included
10774 set sys/select.h i_sysselct
10777 : Define hasfield macro for Configure internal use
10778 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10779 while $test $# -ge 2; do
10781 $define) echo "#include <$2>";;
10785 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10787 if eval $compile; then
10796 : Define hasfield_t macro for Configure internal use
10797 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
10798 while $test $# -ge 2; do
10800 $define) echo "#include <$2>";;
10804 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
10806 if eval $compile; then
10815 : see if we should include time.h, sys/time.h, or both
10817 if test "X$timeincl" = X; then
10818 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10819 $echo $n "I'm now running the test program...$c"
10821 #include <sys/types.h>
10826 #ifdef SYSTIMEKERNEL
10829 #include <sys/time.h>
10832 #include <sys/select.h>
10834 #$i_stdlib I_STDLIB
10836 #include <stdlib.h>
10842 struct timeval bar;
10845 struct timezone tzp;
10847 if (foo.tm_sec == foo.tm_sec)
10850 if (bar.tv_sec == bar.tv_sec)
10857 for s_timezone in '-DS_TIMEZONE' ''; do
10859 for s_timeval in '-DS_TIMEVAL' ''; do
10860 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10861 for i_time in '' '-DI_TIME'; do
10862 for i_systime in '-DI_SYSTIME' ''; do
10865 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10866 if eval $compile; then
10867 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10871 $echo $n "Succeeded with $flags$c"
10883 *SYSTIMEKERNEL*) i_systimek="$define"
10884 timeincl=`./findhdr sys/time.h`
10885 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10886 *) i_systimek="$undef";;
10889 *I_TIME*) i_time="$define"
10890 timeincl=`./findhdr time.h`" $timeincl"
10891 echo "We'll include <time.h>." >&4;;
10892 *) i_time="$undef";;
10895 *I_SYSTIME*) i_systime="$define"
10896 timeincl=`./findhdr sys/time.h`" $timeincl"
10897 echo "We'll include <sys/time.h>." >&4;;
10898 *) i_systime="$undef";;
10902 : see if struct tm knows about tm_zone
10903 case "$i_systime$i_time" in
10906 echo "Checking to see if your struct tm has tm_zone field..." >&4
10907 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10915 case "$d_tm_tm_zone" in
10916 "$define") echo "Yes, it does." ;;
10917 *) echo "No, it doesn't." ;;
10919 : see if struct tm knows about tm_gmtoff
10920 case "$i_systime$i_time" in
10923 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10924 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10932 case "$d_tm_tm_gmtoff" in
10933 "$define") echo "Yes, it does." ;;
10934 *) echo "No, it doesn't." ;;
10937 : see if asctime_r exists
10938 set asctime_r d_asctime_r
10940 case "$d_asctime_r" in
10942 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10943 case "$d_asctime_r_proto:$usethreads" in
10944 ":define") d_asctime_r_proto=define
10945 set d_asctime_r_proto asctime_r $hdrs
10949 case "$d_asctime_r_proto" in
10951 case "$asctime_r_proto" in
10952 ''|0) try='char* asctime_r(const struct tm*, char*);'
10953 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10955 case "$asctime_r_proto" in
10956 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10957 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10959 case "$asctime_r_proto" in
10960 ''|0) try='int asctime_r(const struct tm*, char*);'
10961 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10963 case "$asctime_r_proto" in
10964 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10965 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10967 case "$asctime_r_proto" in
10968 ''|0) d_asctime_r=undef
10970 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10971 * ) case "$asctime_r_proto" in
10972 REENTRANT_PROTO*) ;;
10973 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10975 echo "Prototype: $try" ;;
10978 *) case "$usethreads" in
10979 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10986 *) asctime_r_proto=0
10990 : see if asinh exists
10994 : see if atanh exists
10998 : see if atolf exists
11002 : see if atoll exists
11006 : Look for GCC-style attribute format
11007 case "$d_attribute_format" in
11010 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11011 $cat >attrib.c <<'EOCP'
11013 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11015 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11016 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11017 echo "Your C compiler doesn't support __attribute__((format))."
11020 echo "Your C compiler supports __attribute__((format))."
11024 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11028 *) val="$d_attribute_format" ;;
11030 set d_attribute_format
11034 : Look for GCC-style attribute format with null format allowed
11035 case "$d_printf_format_null" in
11036 '') case "$d_attribute_format" in
11039 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11040 $cat >attrib.c <<EOCP
11042 #$i_stdlib I_STDLIB
11044 #include <stdlib.h>
11046 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11047 int null_printf (char* pat,...) { return (int)pat; }
11048 int main () { exit(null_printf(NULL)); }
11050 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11051 : run the executable in case it produces a run-time warning
11052 if $run ./attrib >>attrib.out 2>&1; then
11053 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11054 echo "Your C compiler doesn't allow __printf__ format to be null."
11057 echo "Your C compiler allows __printf__ format to be null."
11061 echo "Your C compiler executable failed with __printf__ format null."
11065 echo "Your C compiler fails with __printf__ format null."
11072 *) val="$d_printf_format_null" ;;
11074 set d_printf_format_null
11078 : Look for GCC-style attribute malloc
11079 case "$d_attribute_malloc" in
11082 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11083 $cat >attrib.c <<'EOCP'
11085 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
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__((malloc))."
11092 echo "Your C compiler supports __attribute__((malloc))."
11096 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11100 *) val="$d_attribute_malloc" ;;
11102 set d_attribute_malloc
11106 : Look for GCC-style attribute nonnull
11107 case "$d_attribute_nonnull" in
11110 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11111 $cat >attrib.c <<'EOCP'
11113 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
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__((nonnull))."
11120 echo "Your C compiler supports __attribute__((nonnull))."
11124 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11128 *) val="$d_attribute_nonnull" ;;
11130 set d_attribute_nonnull
11134 : Look for GCC-style attribute noreturn
11135 case "$d_attribute_noreturn" in
11138 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11139 $cat >attrib.c <<'EOCP'
11141 void fall_over_dead( void ) __attribute__((noreturn));
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__((noreturn))."
11148 echo "Your C compiler supports __attribute__((noreturn))."
11152 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11156 *) val="$d_attribute_noreturn" ;;
11158 set d_attribute_noreturn
11162 : Look for GCC-style attribute pure
11163 case "$d_attribute_pure" in
11166 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11167 $cat >attrib.c <<'EOCP'
11169 int square( int n ) __attribute__((pure));
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__((pure))."
11176 echo "Your C compiler supports __attribute__((pure))."
11180 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11184 *) val="$d_attribute_pure" ;;
11186 set d_attribute_pure
11190 : Look for GCC-style attribute unused
11191 case "$d_attribute_unused" in
11194 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11195 $cat >attrib.c <<'EOCP'
11197 int do_something( int dummy __attribute__((unused)), int n );
11199 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11200 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11201 echo "Your C compiler doesn't support __attribute__((unused))."
11204 echo "Your C compiler supports __attribute__((unused))."
11208 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11212 *) val="$d_attribute_unused" ;;
11214 set d_attribute_unused
11218 : Look for GCC-style attribute deprecated
11219 case "$d_attribute_deprecated" in
11222 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11223 $cat >attrib.c <<'EOCP'
11225 int I_am_deprecated(void) __attribute__((deprecated));
11227 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11228 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11229 echo "Your C compiler doesn't support __attribute__((deprecated))."
11232 echo "Your C compiler supports __attribute__((deprecated))."
11236 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11240 *) val="$d_attribute_deprecated" ;;
11242 set d_attribute_deprecated
11246 : Look for GCC-style attribute warn_unused_result
11247 case "$d_attribute_warn_unused_result" in
11250 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11251 $cat >attrib.c <<'EOCP'
11253 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11255 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11256 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11257 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11260 echo "Your C compiler supports __attribute__((warn_unused_result))."
11264 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11268 *) val="$d_attribute_warn_unused_result" ;;
11270 set d_attribute_warn_unused_result
11274 : see if bcmp exists
11278 : see if bcopy exists
11282 : see if getpgrp exists
11283 set getpgrp d_getpgrp
11286 case "$d_getpgrp" in
11289 echo "Checking to see which flavor of getpgrp is in use..."
11291 #$i_unistd I_UNISTD
11292 #include <sys/types.h>
11294 # include <unistd.h>
11296 #$i_stdlib I_STDLIB
11298 #include <stdlib.h>
11302 if (getuid() == 0) {
11303 printf("(I see you are running Configure as super-user...)\n");
11306 #ifdef TRY_BSD_PGRP
11307 if (getpgrp(1) == 0)
11316 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11317 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11319 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11320 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11323 echo "I can't seem to compile and run the test program."
11325 xxx="a USG one, i.e. you use getpgrp()."
11327 # SVR4 systems can appear rather BSD-ish.
11328 case "$i_unistd" in
11330 xxx="a BSD one, i.e. you use getpgrp(pid)."
11334 xxx="probably a USG one, i.e. you use getpgrp()."
11339 echo "Assuming your getpgrp is $xxx" >&4
11348 : see if setpgrp exists
11349 set setpgrp d_setpgrp
11352 case "$d_setpgrp" in
11355 echo "Checking to see which flavor of setpgrp is in use..."
11357 #$i_unistd I_UNISTD
11358 #include <sys/types.h>
11360 # include <unistd.h>
11362 #$i_stdlib I_STDLIB
11364 #include <stdlib.h>
11368 if (getuid() == 0) {
11369 printf("(I see you are running Configure as super-user...)\n");
11372 #ifdef TRY_BSD_PGRP
11373 if (-1 == setpgrp(1, 1))
11376 if (setpgrp() != -1)
11382 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11383 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11385 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11386 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11389 echo "(I can't seem to compile and run the test program.)"
11391 xxx="a USG one, i.e. you use setpgrp()."
11393 # SVR4 systems can appear rather BSD-ish.
11394 case "$i_unistd" in
11396 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11400 xxx="probably a USG one, i.e. you use setpgrp()."
11405 echo "Assuming your setpgrp is $xxx" >&4
11414 : Look for GCC-style __builtin_choose_expr
11415 case "$d_builtin_choose_expr" in
11418 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11419 $cat >try.c <<'EOCP'
11420 #include <assert.h>
11421 #include <stdlib.h>
11424 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11427 assert( SYRINX(1) == 2112 );
11428 assert( SYRINX(1) != 5150 );
11429 assert( SYRINX(0) == 5150 );
11430 assert( SYRINX(0) != 2112 );
11431 puts( "All good!" );
11437 if eval $compile && $run ./try; then
11438 echo "Your C compiler supports __builtin_choose_expr."
11441 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11445 *) val="$d_builtin_choose_expr" ;;
11448 set d_builtin_choose_expr
11452 : Look for GCC-style __builtin_expect
11453 case "$d_builtin_expect" in
11456 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11457 $cat >try.c <<'EOCP'
11460 if ( __builtin_expect(n, 0) ) n = 1;
11461 /* Remember shell exit code truth is 0, C truth is non-zero */
11466 if eval $compile && $run ./try; then
11467 echo "Your C compiler supports __builtin_expect."
11470 echo "Your C compiler doesn't seem to understand __builtin_expect."
11474 *) val="$d_builtin_expect" ;;
11477 set d_builtin_expect
11481 : see if bzero exists
11485 : see if stdarg is available
11487 if $test `./findhdr stdarg.h`; then
11488 echo "<stdarg.h> found." >&4
11491 echo "<stdarg.h> NOT found." >&4
11495 : see if varargs is available
11497 if $test `./findhdr varargs.h`; then
11498 echo "<varargs.h> found." >&4
11500 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11503 : set up the varargs testing programs
11504 $cat > varargs.c <<EOP
11506 #include <stdarg.h>
11509 #include <varargs.h>
11513 int f(char *p, ...)
11527 p = va_arg(ap, char *);
11533 $cat > varargs <<EOP
11535 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11544 : now check which varargs header should be included
11550 if `./varargs I_STDARG`; then
11552 elif `./varargs I_VARARGS`; then
11557 if `./varargs I_VARARGS`; then
11565 echo "*** WHOA THERE!!! ***" >&4
11566 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11567 case "$knowitall" in
11569 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11573 echo "I could not find the definition for va_dcl... You have problems..." >&4
11574 val="$undef"; set i_stdarg; eval $setvar
11575 val="$undef"; set i_varargs; eval $setvar
11580 case "$i_varhdr" in
11582 val="$define"; set i_stdarg; eval $setvar
11583 val="$undef"; set i_varargs; eval $setvar
11586 val="$undef"; set i_stdarg; eval $setvar
11587 val="$define"; set i_varargs; eval $setvar
11590 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11594 : see if the Compiler supports C99 variadic macros
11595 case "$i_stdarg$i_stdlib" in
11597 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11600 #include <stdarg.h>
11602 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11606 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11612 if eval $compile && $run ./try 2>&1 >/dev/null; then
11613 case "`$run ./try`" in
11615 echo "You have C99 variadic macros." >&4
11616 d_c99_variadic_macros="$define"
11619 echo "You don't have functional C99 variadic macros." >&4
11620 d_c99_variadic_macros="$undef"
11624 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11625 d_c99_variadic_macros="$undef"
11630 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11631 d_c99_variadic_macros="$undef"
11635 : see if signal is declared as pointer to function returning int or void
11637 xxx=`./findhdr signal.h`
11638 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11639 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11640 echo "You have int (*signal())() instead of void." >&4
11642 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11643 echo "You have void (*signal())()." >&4
11645 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11646 echo "You have int (*signal())() instead of void." >&4
11648 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11649 echo "You have void (*signal())()." >&4
11652 case "$d_voidsig" in
11654 echo "I can't determine whether signal handler returns void or int..." >&4
11656 rp="What type does your signal handler return?"
11659 v*) val="$define";;
11663 echo "As you already told me, signal handler returns void." >&4
11666 *) echo "As you already told me, signal handler returns int." >&4
11673 case "$d_voidsig" in
11674 "$define") signal_t="void";;
11675 *) signal_t="int";;
11679 : check for ability to cast large floats to 32-bit ints.
11681 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11682 if $test "$intsize" -ge 4; then
11689 #$i_stdlib I_STDLIB
11691 #include <stdlib.h>
11693 #include <sys/types.h>
11694 #include <signal.h>
11695 $signal_t blech(int s) { exit(3); }
11702 signal(SIGFPE, blech);
11704 /* Don't let compiler optimize the test away. Store the number
11705 in a writable string for gcc to pass to sscanf under HP-UX.
11707 sprintf(str, "2147483647");
11708 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11712 /* x86 processors will probably give 0x8000 0000, which is a
11713 sign change. We don't want that. We want to mimic SPARC
11714 behavior here, which is to preserve the sign and give
11717 if (i32 != ($xxx) f)
11723 if eval $compile_ok; then
11724 $run ./try 2>/dev/null
11727 echo "(I can't seem to compile the test program--assuming it can't)"
11732 echo "Yup, it can."
11735 echo "Nope, it can't."
11742 : check for ability to cast negative floats to unsigned
11744 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11747 #$i_stdlib I_STDLIB
11749 #include <stdlib.h>
11751 #include <sys/types.h>
11752 #include <signal.h>
11753 $signal_t blech(int s) { exit(7); }
11754 $signal_t blech_in_list(int s) { exit(4); }
11755 unsigned long dummy_long(unsigned long p) { return p; }
11756 unsigned int dummy_int(unsigned int p) { return p; }
11757 unsigned short dummy_short(unsigned short p) { return p; }
11761 unsigned long along;
11763 unsigned short ashort;
11767 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11768 a direct f = -123. assignment. gcc-2.8.0 reportedly
11769 optimized the whole file away
11771 /* Store the number in a writable string for gcc to pass to
11772 sscanf under HP-UX.
11774 sprintf(str, "-123");
11775 sscanf(str, "%lf", &f); /* f = -123.; */
11777 signal(SIGFPE, blech);
11778 along = (unsigned long)f;
11779 aint = (unsigned int)f;
11780 ashort = (unsigned short)f;
11781 if (along != (unsigned long)-123)
11783 if (aint != (unsigned int)-123)
11785 if (ashort != (unsigned short)-123)
11787 sprintf(str, "1073741824.");
11788 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11791 along = (unsigned long)f;
11792 if (along != 0x80000000)
11796 along = (unsigned long)f;
11797 if (along != 0x7fffffff)
11801 along = (unsigned long)f;
11802 if (along != 0x80000001)
11806 signal(SIGFPE, blech_in_list);
11807 sprintf(str, "123.");
11808 sscanf(str, "%lf", &f); /* f = 123.; */
11809 along = dummy_long((unsigned long)f);
11810 aint = dummy_int((unsigned int)f);
11811 ashort = dummy_short((unsigned short)f);
11812 if (along != (unsigned long)123)
11814 if (aint != (unsigned int)123)
11816 if (ashort != (unsigned short)123)
11823 if eval $compile_ok; then
11824 $run ./try 2>/dev/null
11827 echo "(I can't seem to compile the test program--assuming it can't)"
11830 case "$castflags" in
11832 echo "Yup, it can."
11835 echo "Nope, it can't."
11842 : see if cbrt exists
11846 : see if vprintf exists
11848 if set vprintf val -f d_vprintf; eval $csym; $val; then
11849 echo 'vprintf() found.' >&4
11852 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11853 #$i_varargs I_VARARGS
11855 #$i_stdlib I_STDLIB
11856 #$i_unistd I_UNISTD
11859 # include <stdarg.h>
11860 #else /* I_VARARGS */
11861 # include <varargs.h>
11865 # include <unistd.h>
11869 # include <stdlib.h>
11872 #include <stdio.h> /* vsprintf prototype */
11875 void xxx(int n, ...)
11880 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11882 int main() { xxx(1, "foo"); }
11884 #else /* I_VARARGS */
11892 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11894 int main() { xxx("foo"); }
11900 if eval $compile_ok; then
11901 if $run ./try; then
11902 echo "Your vsprintf() returns (int)." >&4
11905 echo "Your vsprintf() returns (char*)." >&4
11909 echo 'I am unable to compile the vsprintf() test program.' >&4
11910 # We shouldn't get here. If we do, assume the standard signature,
11911 # not the old BSD one.
11912 echo 'Guessing that vsprintf() returns (int).' >&4
11916 echo 'vprintf() NOT found.' >&4
11927 : see if chown exists
11931 : see if chroot exists
11932 set chroot d_chroot
11935 : see if chsize exists
11936 set chsize d_chsize
11939 : see if class exists
11943 : see if clearenv exists
11944 set clearenv d_clearenv
11947 : Define hasstruct macro for Configure internal use
11948 hasstruct='varname=$1; struct=$2; shift; shift;
11949 while $test $# -ge 2; do
11951 $define) echo "#include <$2>";;
11955 echo "int main () { struct $struct foo; }" >> try.c;
11957 if eval $compile; then
11966 : see whether socket exists
11970 $echo $n "Hmm... $c" >&4
11971 if set socket val -f d_socket; eval $csym; $val; then
11972 echo "Looks like you have Berkeley networking support." >&4
11974 if set setsockopt val -f; eval $csym; $val; then
11977 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11978 d_oldsock="$define"
11981 if $contains socklib libc.list >/dev/null 2>&1; then
11982 echo "Looks like you have Berkeley networking support." >&4
11984 : we will have to assume that it supports the 4.2 BSD interface
11987 echo "You don't have Berkeley networking in libc$_a..." >&4
11988 if test "X$d_socket" = "X$define"; then
11989 echo "...but you seem to believe that you have sockets." >&4
11991 for net in net socket
11993 if test -f $sysroot/usr/lib/lib$net$_a; then
11994 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11995 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11996 if $contains socket libc.list >/dev/null 2>&1; then
12001 echo "...but the Wollongong group seems to have hacked it in." >&4
12002 sockethdr="-I$sysroot/usr/netinclude"
12005 echo "Found Berkeley sockets interface in lib$net." >&4
12006 if $contains setsockopt libc.list >/dev/null 2>&1; then
12009 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12010 d_oldsock="$define"
12016 if test "X$d_socket" != "X$define"; then
12017 echo "or anywhere else I see." >&4
12025 : see if socketpair exists
12026 set socketpair d_sockpair
12031 echo "Checking the availability sa_len in the sock struct ..." >&4
12033 #include <sys/types.h>
12034 #include <sys/socket.h>
12036 struct sockaddr sa;
12037 return (sa.sa_len);
12041 set try; if eval $compile; then
12044 set d_sockaddr_sa_len; eval $setvar
12048 echo "Checking the availability struct sockaddr_in6 ..." >&4
12050 #include <sys/types.h>
12051 #include <sys/socket.h>
12052 #include <netinet/in.h>
12054 struct sockaddr_in6 sin6;
12055 return (sin6.sin6_family);
12059 set try; if eval $compile; then
12062 set d_sockaddr_in6; eval $setvar
12066 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12068 #include <sys/types.h>
12069 #include <sys/socket.h>
12070 #include <netinet/in.h>
12072 struct sockaddr_in6 sin6;
12073 return (sin6.sin6_scope_id);
12077 set try; if eval $compile; then
12080 set d_sin6_scope_id; eval $setvar
12084 echo "Checking the availability struct ip_mreq ..." >&4
12086 #include <sys/types.h>
12087 #include <sys/socket.h>
12088 #include <netinet/in.h>
12090 struct ip_mreq mreq;
12091 return (mreq.imr_multiaddr.s_addr);
12095 set try; if eval $compile; then
12098 set d_ip_mreq; eval $setvar
12102 echo "Checking the availability struct ip_mreq_source ..." >&4
12104 #include <sys/types.h>
12105 #include <sys/socket.h>
12106 #include <netinet/in.h>
12108 struct ip_mreq_source mreq;
12109 return (mreq.imr_multiaddr.s_addr);
12113 set try; if eval $compile; then
12116 set d_ip_mreq_source; eval $setvar
12120 echo "Checking the availability struct ipv6_mreq ..." >&4
12122 #include <sys/types.h>
12123 #include <sys/socket.h>
12124 #include <netinet/in.h>
12126 struct ipv6_mreq mreq;
12127 return (mreq.ipv6mr_interface);
12131 set try; if eval $compile; then
12134 set d_ipv6_mreq; eval $setvar
12138 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12140 #include <sys/types.h>
12141 #include <sys/socket.h>
12142 #include <netinet/in.h>
12144 struct ipv6_mreq_source mreq;
12145 return (mreq.imr_multiaddr.s_addr);
12149 set try; if eval $compile; then
12152 set d_ipv6_mreq_source; eval $setvar
12156 echo "Checking the availability of certain socket constants..." >&4
12157 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12158 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12160 #include <sys/types.h>
12161 #include <sys/socket.h>
12167 set try; if eval $compile; then
12170 set d_${enum}; eval $setvar
12174 : see if this is a sys/uio.h system
12175 set sys/uio.h i_sysuio
12178 : Check for cmsghdr support
12180 echo "Checking to see if your system supports struct cmsghdr..." >&4
12181 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12183 case "$d_cmsghdr_s" in
12184 "$define") echo "Yes, it does." ;;
12185 *) echo "No, it doesn't." ;;
12189 : check for const keyword
12191 echo 'Checking to see if your C compiler knows about "const"...' >&4
12192 $cat >const.c <<'EOCP'
12193 typedef struct spug { int drokk; } spug;
12197 const spug y = { 0 };
12200 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12202 echo "Yup, it does."
12205 echo "Nope, it doesn't."
12210 : see if copysign exists
12211 set copysign d_copysign
12214 : see if copysignl exists
12215 set copysignl d_copysignl
12218 : see if crypt exists
12223 $define) cryptlib='' ;;
12224 *) if set crypt val -f d_crypt; eval $csym; $val; then
12225 echo 'crypt() found.' >&4
12229 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12230 if $test -z "$cryptlib"; then
12231 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12235 if $test -z "$cryptlib"; then
12236 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12240 if $test -z "$cryptlib"; then
12241 cryptlib=`./loc libcrypt$_a "" $libpth`
12245 if $test -z "$cryptlib"; then
12246 echo 'crypt() NOT found.' >&4
12257 : see if this is a crypt.h system
12258 set crypt.h i_crypt
12261 : see if crypt_r exists
12262 set crypt_r d_crypt_r
12264 case "$d_crypt_r" in
12266 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12267 case "$d_crypt_r_proto:$usethreads" in
12268 ":define") d_crypt_r_proto=define
12269 set d_crypt_r_proto crypt_r $hdrs
12273 case "$d_crypt_r_proto" in
12275 case "$crypt_r_proto" in
12276 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12277 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12279 case "$crypt_r_proto" in
12280 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12281 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12283 case "$crypt_r_proto" in
12284 ''|0) d_crypt_r=undef
12286 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12287 * ) case "$crypt_r_proto" in
12288 REENTRANT_PROTO*) ;;
12289 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12291 echo "Prototype: $try" ;;
12294 *) case "$usethreads" in
12295 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12306 : get csh whereabouts
12308 'csh') val="$undef" ;;
12309 *) val="$define" ;;
12313 : Respect a hint or command line value for full_csh.
12314 case "$full_csh" in
12315 '') full_csh=$csh ;;
12318 : see if ctermid exists
12319 set ctermid d_ctermid
12322 : see if ctermid_r exists
12323 set ctermid_r d_ctermid_r
12325 case "$d_ctermid_r" in
12327 hdrs="$i_systypes sys/types.h define stdio.h "
12328 case "$d_ctermid_r_proto:$usethreads" in
12329 ":define") d_ctermid_r_proto=define
12330 set d_ctermid_r_proto ctermid_r $hdrs
12334 case "$d_ctermid_r_proto" in
12336 case "$ctermid_r_proto" in
12337 ''|0) try='char* ctermid_r(char*);'
12338 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12340 case "$ctermid_r_proto" in
12341 ''|0) d_ctermid_r=undef
12343 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12344 * ) case "$ctermid_r_proto" in
12345 REENTRANT_PROTO*) ;;
12346 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12348 echo "Prototype: $try" ;;
12351 *) case "$usethreads" in
12352 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12359 *) ctermid_r_proto=0
12363 : see if ctime_r exists
12364 set ctime_r d_ctime_r
12366 case "$d_ctime_r" in
12368 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12369 case "$d_ctime_r_proto:$usethreads" in
12370 ":define") d_ctime_r_proto=define
12371 set d_ctime_r_proto ctime_r $hdrs
12375 case "$d_ctime_r_proto" in
12377 case "$ctime_r_proto" in
12378 ''|0) try='char* ctime_r(const time_t*, char*);'
12379 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12381 case "$ctime_r_proto" in
12382 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12383 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12385 case "$ctime_r_proto" in
12386 ''|0) try='int ctime_r(const time_t*, char*);'
12387 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12389 case "$ctime_r_proto" in
12390 ''|0) try='int ctime_r(const time_t*, char*, int);'
12391 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12393 case "$ctime_r_proto" in
12394 ''|0) d_ctime_r=undef
12396 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12397 * ) case "$ctime_r_proto" in
12398 REENTRANT_PROTO*) ;;
12399 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12401 echo "Prototype: $try" ;;
12404 *) case "$usethreads" in
12405 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12416 : see if cuserid exists
12417 set cuserid d_cuserid
12420 : see if this is a limits.h system
12421 set limits.h i_limits
12424 : See if number of significant digits in a double precision number is known
12426 $cat >dbl_dig.c <<EOM
12427 #$i_limits I_LIMITS
12430 #include <limits.h>
12436 printf("Contains DBL_DIG");
12439 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12440 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12441 echo "DBL_DIG found." >&4
12444 echo "DBL_DIG NOT found." >&4
12451 : see if dbm.h is available
12452 : see if dbmclose exists
12453 set dbmclose d_dbmclose
12456 case "$d_dbmclose" in
12466 *) set rpcsvc/dbm.h i_rpcsvcdbm
12471 *) echo "We won't be including <dbm.h>"
12481 : see if prototype for dbminit is available
12483 set d_dbminitproto dbminit $i_dbm dbm.h
12486 : see if difftime exists
12487 set difftime d_difftime
12490 : see if this is a dirent system
12492 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12494 echo "<dirent.h> found." >&4
12497 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12498 echo "<sys/dir.h> found." >&4
12501 xinc=`./findhdr sys/ndir.h`
12503 echo "<dirent.h> NOT found." >&4
12508 : Look for type of directory structure.
12510 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12512 case "$direntrytype" in
12514 case "$i_dirent" in
12515 $define) guess1='struct dirent' ;;
12516 *) guess1='struct direct' ;;
12519 *) guess1="$direntrytype"
12524 'struct dirent') guess2='struct direct' ;;
12525 *) guess2='struct dirent' ;;
12528 if $contains "$guess1" try.c >/dev/null 2>&1; then
12529 direntrytype="$guess1"
12530 echo "Your directory entries are $direntrytype." >&4
12531 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12532 direntrytype="$guess2"
12533 echo "Your directory entries seem to be $direntrytype." >&4
12535 echo "I don't recognize your system's directory entries." >&4
12536 rp="What type is used for directory entries on this system?"
12539 direntrytype="$ans"
12543 : see if the directory entry stores field length
12545 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12546 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12547 echo "Good, your directory entry keeps length information in d_namlen." >&4
12550 echo "Your directory entry does not know about the d_namlen field." >&4
12557 : Look for DIR.dd_fd
12558 case "$i_dirent" in
12560 echo "Checking to see if DIR has a dd_fd member variable" >&4
12562 #$i_stdlib I_STDLIB
12564 #include <stdlib.h>
12566 #include <dirent.h>
12576 if eval $compile; then
12577 echo "Yes, it does."
12580 echo "No, it does not."
12585 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12593 : see if this is an sysdir system
12594 set sys/dir.h i_sysdir
12597 : see if this is an sysndir system
12598 set sys/ndir.h i_sysndir
12603 $cat >dirfd.c <<EOM
12605 #$i_stdlib I_STDLIB
12607 #include <stdlib.h>
12609 #$i_dirent I_DIRENT /**/
12610 #$i_sysdir I_SYS_DIR /**/
12611 #$i_sysndir I_SYS_NDIR /**/
12612 #$i_systypes I_SYS_TYPES /**/
12613 #if defined(I_SYS_TYPES)
12614 #include <sys/types.h>
12616 #if defined(I_DIRENT)
12617 #include <dirent.h>
12620 #include <sys/ndir.h>
12624 #include <ndir.h> /* may be wrong in the future */
12626 #include <sys/dir.h>
12632 DIR *dirp = opendir(".");
12633 if (dirfd(dirp) >= 0)
12641 if eval $compile; then
12645 $define) echo "dirfd() found." >&4 ;;
12646 *) echo "dirfd() NOT found." >&4 ;;
12652 : see if dladdr exists
12653 set dladdr d_dladdr
12656 : see if dlerror exists
12659 set dlerror d_dlerror
12663 : see if dlfcn is available
12664 set dlfcn.h i_dlfcn
12667 : Check what extension to use for shared libs
12672 On a few systems, the dynamically loaded modules that perl generates and uses
12673 will need a different extension than shared libs. The default will probably
12679 *) dflt="$dlext" ;;
12681 rp='What is the extension of dynamically loaded modules'
12690 : Check if dlsym need a leading underscore
12696 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12697 $cat >dyna.c <<'EOM'
12704 #$i_stdlib I_STDLIB
12706 #include <stdlib.h>
12710 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12712 #include <sys/types.h>
12717 extern int fred() ;
12726 int mode = RTLD_LAZY ;
12728 handle = dlopen("./dyna.$dlext", mode) ;
12729 if (handle == NULL) {
12734 symbol = dlsym(handle, "fred") ;
12735 if (symbol == NULL) {
12736 /* try putting a leading underscore */
12737 symbol = dlsym(handle, "_fred") ;
12738 if (symbol == NULL) {
12751 : Call the object file tmp-dyna.o in case dlext=o.
12752 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12753 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12754 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12755 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12758 1) echo "Test program failed using dlopen." >&4
12759 echo "Perhaps you should not use dynamic loading." >&4;;
12760 2) echo "Test program failed using dlsym." >&4
12761 echo "Perhaps you should not use dynamic loading." >&4;;
12762 3) echo "dlsym needs a leading underscore" >&4
12764 4) echo "dlsym doesn't need a leading underscore." >&4;;
12767 echo "I can't compile and run the test program." >&4
12768 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12773 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12778 : see if drand48_r exists
12779 set drand48_r d_drand48_r
12781 case "$d_drand48_r" in
12783 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12784 case "$d_drand48_r_proto:$usethreads" in
12785 ":define") d_drand48_r_proto=define
12786 set d_drand48_r_proto drand48_r $hdrs
12790 case "$d_drand48_r_proto" in
12792 case "$drand48_r_proto" in
12793 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12794 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12796 case "$drand48_r_proto" in
12797 ''|0) d_drand48_r=undef
12799 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12800 * ) case "$drand48_r_proto" in
12801 REENTRANT_PROTO*) ;;
12802 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12804 echo "Prototype: $try" ;;
12807 *) case "$usethreads" in
12808 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12815 *) drand48_r_proto=0
12819 : see if prototype for drand48 is available
12821 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12824 : see if dup2 exists
12828 : see if eaccess exists
12829 set eaccess d_eaccess
12832 : see if endgrent exists
12833 set endgrent d_endgrent
12836 : see if this is an grp system
12842 xxx=`./findhdr grp.h`
12843 $cppstdin $cppflags $cppminus < $xxx >$$.h
12845 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12857 set d_grpasswd; eval $setvar
12861 : see if endgrent_r exists
12862 set endgrent_r d_endgrent_r
12864 case "$d_endgrent_r" in
12866 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12867 case "$d_endgrent_r_proto:$usethreads" in
12868 ":define") d_endgrent_r_proto=define
12869 set d_endgrent_r_proto endgrent_r $hdrs
12873 case "$d_endgrent_r_proto" in
12875 case "$endgrent_r_proto" in
12876 ''|0) try='int endgrent_r(FILE**);'
12877 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12879 case "$endgrent_r_proto" in
12880 ''|0) try='void endgrent_r(FILE**);'
12881 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12883 case "$endgrent_r_proto" in
12884 ''|0) d_endgrent_r=undef
12886 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12887 * ) case "$endgrent_r_proto" in
12888 REENTRANT_PROTO*) ;;
12889 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12891 echo "Prototype: $try" ;;
12894 *) case "$usethreads" in
12895 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12902 *) endgrent_r_proto=0
12906 : see if endhostent exists
12907 set endhostent d_endhent
12910 : see if this is a netdb.h system
12911 set netdb.h i_netdb
12914 : see if endhostent_r exists
12915 set endhostent_r d_endhostent_r
12917 case "$d_endhostent_r" in
12919 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12920 case "$d_endhostent_r_proto:$usethreads" in
12921 ":define") d_endhostent_r_proto=define
12922 set d_endhostent_r_proto endhostent_r $hdrs
12926 case "$d_endhostent_r_proto" in
12928 case "$endhostent_r_proto" in
12929 ''|0) try='int endhostent_r(struct hostent_data*);'
12930 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12932 case "$endhostent_r_proto" in
12933 ''|0) try='void endhostent_r(struct hostent_data*);'
12934 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12936 case "$endhostent_r_proto" in
12937 ''|0) d_endhostent_r=undef
12938 endhostent_r_proto=0
12939 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12940 * ) case "$endhostent_r_proto" in
12941 REENTRANT_PROTO*) ;;
12942 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12944 echo "Prototype: $try" ;;
12947 *) case "$usethreads" in
12948 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12950 d_endhostent_r=undef
12951 endhostent_r_proto=0
12955 *) endhostent_r_proto=0
12959 : see if endnetent exists
12960 set endnetent d_endnent
12963 : see if endnetent_r exists
12964 set endnetent_r d_endnetent_r
12966 case "$d_endnetent_r" in
12968 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12969 case "$d_endnetent_r_proto:$usethreads" in
12970 ":define") d_endnetent_r_proto=define
12971 set d_endnetent_r_proto endnetent_r $hdrs
12975 case "$d_endnetent_r_proto" in
12977 case "$endnetent_r_proto" in
12978 ''|0) try='int endnetent_r(struct netent_data*);'
12979 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12981 case "$endnetent_r_proto" in
12982 ''|0) try='void endnetent_r(struct netent_data*);'
12983 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12985 case "$endnetent_r_proto" in
12986 ''|0) d_endnetent_r=undef
12987 endnetent_r_proto=0
12988 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12989 * ) case "$endnetent_r_proto" in
12990 REENTRANT_PROTO*) ;;
12991 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12993 echo "Prototype: $try" ;;
12996 *) case "$usethreads" in
12997 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12999 d_endnetent_r=undef
13000 endnetent_r_proto=0
13004 *) endnetent_r_proto=0
13008 : see if endprotoent exists
13009 set endprotoent d_endpent
13012 : see if endprotoent_r exists
13013 set endprotoent_r d_endprotoent_r
13015 case "$d_endprotoent_r" in
13017 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13018 case "$d_endprotoent_r_proto:$usethreads" in
13019 ":define") d_endprotoent_r_proto=define
13020 set d_endprotoent_r_proto endprotoent_r $hdrs
13024 case "$d_endprotoent_r_proto" in
13026 case "$endprotoent_r_proto" in
13027 ''|0) try='int endprotoent_r(struct protoent_data*);'
13028 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13030 case "$endprotoent_r_proto" in
13031 ''|0) try='void endprotoent_r(struct protoent_data*);'
13032 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13034 case "$endprotoent_r_proto" in
13035 ''|0) d_endprotoent_r=undef
13036 endprotoent_r_proto=0
13037 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13038 * ) case "$endprotoent_r_proto" in
13039 REENTRANT_PROTO*) ;;
13040 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13042 echo "Prototype: $try" ;;
13045 *) case "$usethreads" in
13046 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13048 d_endprotoent_r=undef
13049 endprotoent_r_proto=0
13053 *) endprotoent_r_proto=0
13057 : see if endpwent exists
13058 set endpwent d_endpwent
13061 : see if this is a pwd.h system
13067 xxx=`./findhdr pwd.h`
13068 $cppstdin $cppflags $cppminus < $xxx >$$.h
13070 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13078 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13086 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13094 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13102 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13110 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13118 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13126 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13138 set d_pwquota; eval $setvar
13139 set d_pwage; eval $setvar
13140 set d_pwchange; eval $setvar
13141 set d_pwclass; eval $setvar
13142 set d_pwexpire; eval $setvar
13143 set d_pwcomment; eval $setvar
13144 set d_pwgecos; eval $setvar
13145 set d_pwpasswd; eval $setvar
13149 : see if endpwent_r exists
13150 set endpwent_r d_endpwent_r
13152 case "$d_endpwent_r" in
13154 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13155 case "$d_endpwent_r_proto:$usethreads" in
13156 ":define") d_endpwent_r_proto=define
13157 set d_endpwent_r_proto endpwent_r $hdrs
13161 case "$d_endpwent_r_proto" in
13163 case "$endpwent_r_proto" in
13164 ''|0) try='int endpwent_r(FILE**);'
13165 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13167 case "$endpwent_r_proto" in
13168 ''|0) try='void endpwent_r(FILE**);'
13169 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13171 case "$endpwent_r_proto" in
13172 ''|0) d_endpwent_r=undef
13174 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13175 * ) case "$endpwent_r_proto" in
13176 REENTRANT_PROTO*) ;;
13177 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13179 echo "Prototype: $try" ;;
13182 *) case "$usethreads" in
13183 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13190 *) endpwent_r_proto=0
13194 : see if endservent exists
13195 set endservent d_endsent
13198 : see if endservent_r exists
13199 set endservent_r d_endservent_r
13201 case "$d_endservent_r" in
13203 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13204 case "$d_endservent_r_proto:$usethreads" in
13205 ":define") d_endservent_r_proto=define
13206 set d_endservent_r_proto endservent_r $hdrs
13210 case "$d_endservent_r_proto" in
13212 case "$endservent_r_proto" in
13213 ''|0) try='int endservent_r(struct servent_data*);'
13214 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13216 case "$endservent_r_proto" in
13217 ''|0) try='void endservent_r(struct servent_data*);'
13218 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13220 case "$endservent_r_proto" in
13221 ''|0) d_endservent_r=undef
13222 endservent_r_proto=0
13223 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13224 * ) case "$endservent_r_proto" in
13225 REENTRANT_PROTO*) ;;
13226 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13228 echo "Prototype: $try" ;;
13231 *) case "$usethreads" in
13232 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13234 d_endservent_r=undef
13235 endservent_r_proto=0
13239 *) endservent_r_proto=0
13243 : Locate the flags for 'open()'
13246 #include <sys/types.h>
13251 #include <sys/file.h>
13253 #$i_stdlib I_STDLIB
13255 #include <stdlib.h>
13266 : check sys/file.h first to get FREAD on Sun
13267 if $test `./findhdr sys/file.h` && \
13268 set try -DI_SYS_FILE && eval $compile; then
13270 echo "<sys/file.h> defines the O_* constants..." >&4
13271 if $run ./try; then
13272 echo "and you have the 3 argument form of open()." >&4
13275 echo "but not the 3 argument form of open(). Oh, well." >&4
13278 elif $test `./findhdr fcntl.h` && \
13279 set try -DI_FCNTL && eval $compile; then
13281 echo "<fcntl.h> defines the O_* constants..." >&4
13282 if $run ./try; then
13283 echo "and you have the 3 argument form of open()." >&4
13286 echo "but not the 3 argument form of open(). Oh, well." >&4
13291 echo "I can't find the O_* constant definitions! You got problems." >&4
13297 : see if this is a sys/file.h system
13302 : do we need to include sys/file.h ?
13306 if $h_sysfile; then
13308 echo "We'll be including <sys/file.h>." >&4
13311 echo "We won't be including <sys/file.h>." >&4
13321 : see if fcntl.h is there
13326 : see if we can include fcntl.h
13332 echo "We'll be including <fcntl.h>." >&4
13335 if $h_sysfile; then
13336 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13338 echo "We won't be including <fcntl.h>." >&4
13350 : see if fork exists
13354 : see if pipe exists
13358 : check for non-blocking I/O stuff
13359 case "$h_sysfile" in
13360 true) echo "#include <sys/file.h>" > head.c;;
13363 true) echo "#include <fcntl.h>" > head.c;;
13364 *) echo "#include <sys/fcntl.h>" > head.c;;
13369 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13370 case "$o_nonblock" in
13372 $cat head.c > try.c
13373 $cat >>try.c <<EOCP
13375 #$i_stdlib I_STDLIB
13377 #include <stdlib.h>
13385 printf("O_NONBLOCK\n");
13389 printf("O_NDELAY\n");
13393 printf("FNDELAY\n");
13400 if eval $compile_ok; then
13401 o_nonblock=`$run ./try`
13402 case "$o_nonblock" in
13403 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13404 *) echo "Seems like we can use $o_nonblock.";;
13407 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13410 *) echo "Using $hint value $o_nonblock.";;
13415 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13418 case "$d_fork:$d_pipe:$d_alarm" in
13419 define:define:define)
13420 $cat head.c > try.c
13421 $cat >>try.c <<EOCP
13423 #include <sys/types.h>
13424 #include <signal.h>
13426 #$i_stdlib I_STDLIB
13428 #include <stdlib.h>
13434 #define MY_O_NONBLOCK $o_nonblock
13435 #ifndef errno /* XXX need better Configure test */
13438 #$i_unistd I_UNISTD
13440 #include <unistd.h>
13442 #$i_string I_STRING
13444 #include <string.h>
13446 #include <strings.h>
13448 $signal_t blech(int x) { exit(3); }
13450 $cat >> try.c <<'EOCP'
13459 ret = pipe(pd); /* Down: child -> parent */
13462 ret = pipe(pu); /* Up: parent -> child */
13466 close(pd[1]); /* Parent reads from pd[0] */
13467 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13469 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13474 signal(SIGALRM, blech);
13476 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13478 sprintf(string, "%d\n", ret);
13479 ret = write(2, string, strlen(string));
13480 if (ret != strlen(string))
13484 if (errno == EAGAIN) {
13485 printf("EAGAIN\n");
13490 if (errno == EWOULDBLOCK)
13491 printf("EWOULDBLOCK\n");
13494 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13497 sleep(2); /* Give it time to close our pipe */
13499 ret = read(pd[0], buf, 1); /* Should read EOF */
13501 sprintf(string, "%d\n", ret);
13502 ret = write(4, string, strlen(string));
13503 if (ret != strlen(string))
13508 close(pd[0]); /* We write to pd[1] */
13509 close(pu[1]); /* We read from pu[0] */
13510 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13513 close(pd[1]); /* Pipe pd is now fully closed! */
13514 exit(0); /* Bye bye, thank you for playing! */
13518 if eval $compile_ok; then
13519 echo "$startsh" >mtry
13520 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13522 $run ./mtry >/dev/null 2>&1
13524 0) eagain=`$cat try.out`;;
13525 1) echo "Could not perform non-blocking setting!";;
13526 2) echo "I did a successful read() for something that was not there!";;
13527 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13528 4) echo "Could not find F_SETFL!";;
13529 *) echo "Something terribly wrong happened during testing.";;
13531 rd_nodata=`$cat try.ret`
13532 echo "A read() system call with no data present returns $rd_nodata."
13533 case "$rd_nodata" in
13536 echo "(That's peculiar, fixing that to be -1.)"
13542 echo "Forcing errno EAGAIN on read() with no data available."
13546 echo "Your read() sets errno to $eagain when no data is available."
13549 status=`$cat try.err`
13551 0) echo "And it correctly returns 0 to signal EOF.";;
13552 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13553 *) echo "However, your read() returns '$status' on EOF??";;
13556 if test "$status" = "$rd_nodata"; then
13557 echo "WARNING: you can't distinguish between EOF and no data!"
13561 echo "I can't compile the test program--assuming errno EAGAIN will do."
13565 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13574 echo "Using $hint value $eagain."
13575 echo "Your read() returns $rd_nodata when no data is present."
13576 case "$d_eofnblk" in
13577 "$define") echo "And you can see EOF because read() returns 0.";;
13578 "$undef") echo "But you can't see EOF status from read() returned value.";;
13580 echo "(Assuming you can't see EOF status from read anyway.)"
13586 $rm_try head.c mtry
13588 : see if erf exists
13592 : see if erfc exists
13596 : see if exp2 exists
13600 : see if expm1 exists
13604 : see if _ptr and _cnt from stdio act std
13607 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13608 echo "(Looks like you have stdio.h from BSD.)"
13609 case "$stdio_ptr" in
13610 '') stdio_ptr='((fp)->_p)'
13613 *) ptr_lval=$d_stdio_ptr_lval;;
13615 case "$stdio_cnt" in
13616 '') stdio_cnt='((fp)->_r)'
13619 *) cnt_lval=$d_stdio_cnt_lval;;
13621 case "$stdio_base" in
13622 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13624 case "$stdio_bufsiz" in
13625 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13627 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13628 echo "(Looks like you have stdio.h from Linux.)"
13629 case "$stdio_ptr" in
13630 '') stdio_ptr='((fp)->_IO_read_ptr)'
13633 *) ptr_lval=$d_stdio_ptr_lval;;
13635 case "$stdio_cnt" in
13636 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13639 *) cnt_lval=$d_stdio_cnt_lval;;
13641 case "$stdio_base" in
13642 '') stdio_base='((fp)->_IO_read_base)';;
13644 case "$stdio_bufsiz" in
13645 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13648 case "$stdio_ptr" in
13649 '') stdio_ptr='((fp)->_ptr)'
13652 *) ptr_lval=$d_stdio_ptr_lval;;
13654 case "$stdio_cnt" in
13655 '') stdio_cnt='((fp)->_cnt)'
13658 *) cnt_lval=$d_stdio_cnt_lval;;
13660 case "$stdio_base" in
13661 '') stdio_base='((fp)->_base)';;
13663 case "$stdio_bufsiz" in
13664 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13668 : test whether _ptr and _cnt really work
13669 echo "Checking how std your stdio is..." >&4
13672 #$i_stdlib I_STDLIB
13674 #include <stdlib.h>
13676 #define FILE_ptr(fp) $stdio_ptr
13677 #define FILE_cnt(fp) $stdio_cnt
13679 FILE *fp = fopen("try.c", "r");
13682 18 <= FILE_cnt(fp) &&
13683 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13691 if eval $compile && $to try.c; then
13692 if $run ./try; then
13693 echo "Your stdio acts pretty std."
13696 echo "Your stdio isn't very std."
13699 echo "Your stdio doesn't appear very std."
13703 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13704 # direct buffer manipulation no longer works. The Configure tests
13705 # should be changed to correctly detect this, but until then,
13706 # the following check should at least let perl compile and run.
13707 # (This quick fix should be updated before 5.8.1.)
13708 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13709 # A. Dougherty, June 3, 2002.
13710 case "$d_gnulibc" in
13712 case "$gnulibc_version" in
13716 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13725 : Can _ptr be used as an lvalue?
13726 case "$d_stdstdio$ptr_lval" in
13727 $define$define) val=$define ;;
13730 set d_stdio_ptr_lval
13733 : Can _cnt be used as an lvalue?
13734 case "$d_stdstdio$cnt_lval" in
13735 $define$define) val=$define ;;
13738 set d_stdio_cnt_lval
13742 : test whether setting _ptr sets _cnt as a side effect
13743 d_stdio_ptr_lval_sets_cnt="$undef"
13744 d_stdio_ptr_lval_nochange_cnt="$undef"
13745 case "$d_stdio_ptr_lval$d_stdstdio" in
13747 echo "Checking to see what happens if we set the stdio ptr..." >&4
13750 /* Can we scream? */
13751 /* Eat dust sed :-) */
13752 /* In the buffer space, no one can hear you scream. */
13753 #$i_stdlib I_STDLIB
13755 #include <stdlib.h>
13757 #define FILE_ptr(fp) $stdio_ptr
13758 #define FILE_cnt(fp) $stdio_cnt
13759 #include <sys/types.h>
13761 FILE *fp = fopen("try.c", "r");
13766 puts("Fail even to read");
13769 c = getc(fp); /* Read away the first # */
13771 puts("Fail even to read");
13775 18 <= FILE_cnt(fp) &&
13776 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13778 puts("Fail even to read");
13781 ptr = (char*) FILE_ptr(fp);
13782 cnt = (size_t)FILE_cnt(fp);
13784 FILE_ptr(fp) += 42;
13786 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13787 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13790 if (FILE_cnt(fp) <= 20) {
13791 printf ("Fail (<20 chars to test)");
13794 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13795 puts("Fail compare");
13798 if (cnt == FILE_cnt(fp)) {
13799 puts("Pass_unchanged");
13802 if (FILE_cnt(fp) == (cnt - 42)) {
13803 puts("Pass_changed");
13806 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13812 if eval $compile && $to try.c; then
13813 case `$run ./try` in
13815 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13816 d_stdio_ptr_lval_sets_cnt="$define" ;;
13818 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13819 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13821 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13823 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13826 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13832 : see if _base is also standard
13834 case "$d_stdstdio" in
13838 #$i_stdlib I_STDLIB
13840 #include <stdlib.h>
13842 #define FILE_base(fp) $stdio_base
13843 #define FILE_bufsiz(fp) $stdio_bufsiz
13845 FILE *fp = fopen("try.c", "r");
13848 19 <= FILE_bufsiz(fp) &&
13849 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13856 if eval $compile && $to try.c; then
13857 if $run ./try; then
13858 echo "And its _base field acts std."
13861 echo "But its _base field isn't std."
13864 echo "However, it seems to be lacking the _base field."
13872 : see if fast_stdio exists
13874 case "$d_stdstdio:$d_stdio_ptr_lval" in
13876 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13878 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13889 : see if fchdir exists
13890 set fchdir d_fchdir
13893 : see if fchmod exists
13894 set fchmod d_fchmod
13897 : see if fchown exists
13898 set fchown d_fchown
13901 : see if this is an fcntl system
13905 : See if fcntl-based locking works.
13908 #$i_stdlib I_STDLIB
13910 #include <stdlib.h>
13912 #include <unistd.h>
13914 #include <signal.h>
13915 $signal_t blech(int x) { exit(3); }
13917 #if defined(F_SETLK) && defined(F_SETLKW)
13918 struct flock flock;
13920 fd = open("try.c", O_RDONLY);
13921 flock.l_type = F_RDLCK;
13922 flock.l_whence = SEEK_SET;
13923 flock.l_start = flock.l_len = 0;
13924 signal(SIGALRM, blech);
13926 retval = fcntl(fd, F_SETLK, &flock);
13928 (retval < 0 ? exit(2) : exit(0));
13934 echo "Checking if fcntl-based file locking works... "
13938 if eval $compile_ok; then
13939 if $run ./try; then
13940 echo "Yes, it seems to work."
13943 echo "Nope, it didn't work."
13948 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13949 *** This is (almost) impossible.
13950 *** If your NFS lock daemons are not feeling well, something like
13951 *** this may happen, please investigate. Cannot continue, aborting.
13959 echo "I'm unable to compile the test program, so I'll assume not."
13964 echo "Nope, since you don't even have fcntl()."
13967 set d_fcntl_can_lock
13971 : check for fd_set items
13974 Checking to see how well your C compiler handles fd_set and friends ...
13977 #$i_stdlib I_STDLIB
13979 #include <stdlib.h>
13981 #$i_systime I_SYS_TIME
13982 #$i_sysselct I_SYS_SELECT
13983 #$d_socket HAS_SOCKET
13984 #include <sys/types.h>
13986 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13989 #include <sys/time.h>
13991 #ifdef I_SYS_SELECT
13992 #include <sys/select.h>
14001 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14009 if eval $compile; then
14010 d_fds_bits="$define"
14012 echo "Well, your system knows about the normal fd_set typedef..." >&4
14013 if $run ./try; then
14014 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14015 d_fd_macros="$define"
14018 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14020 d_fd_macros="$undef"
14024 Hmm, your compiler has some difficulty with fd_set. Checking further...
14027 if eval $compile; then
14028 d_fds_bits="$undef"
14030 echo "Well, your system has some sort of fd_set available..." >&4
14031 if $run ./try; then
14032 echo "and you have the normal fd_set macros." >&4
14033 d_fd_macros="$define"
14036 but not the normal fd_set macros! Gross! More work for me...
14038 d_fd_macros="$undef"
14041 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14043 d_fds_bits="$undef"
14044 d_fd_macros="$undef"
14049 : see if fdclose exists
14050 set fdclose d_fdclose
14053 : see if fdim exists
14057 : see if fegetround exists
14058 set fegetround d_fegetround
14061 : see if fgetpos exists
14062 set fgetpos d_fgetpos
14065 : see if finite exists
14066 set finite d_finite
14069 : see if finitel exists
14070 set finitel d_finitel
14073 : see if flock exists
14077 : see if prototype for flock is available
14079 set d_flockproto flock $i_sysfile sys/file.h
14082 : see if fma exists
14086 : see if fmax exists
14090 : see if fmin exists
14094 : see if fp_class exists
14095 set fp_class d_fp_class
14098 : see if this is a math.h system
14102 : check for fpclassify
14103 echo "Checking to see if you have fpclassify..." >&4
14109 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14112 if eval $compile; then
14114 echo "You have fpclassify."
14117 echo "You do not have fpclassify."
14123 : see if fp_classify exists
14124 set fp_classify d_fp_classify
14127 : see if fp_classl exists
14128 set fp_classl d_fp_classl
14131 : see if pathconf exists
14132 set pathconf d_pathconf
14135 : see if fpathconf exists
14136 set fpathconf d_fpathconf
14139 : see if fpclass exists
14140 set fpclass d_fpclass
14143 : see if fpclassl exists
14144 set fpclassl d_fpclassl
14147 : see if fpgetround exists
14148 set fpgetround d_fpgetround
14151 : check for fpos64_t
14153 echo "Checking to see if you have fpos64_t..." >&4
14156 int main() { fpos64_t x = 7; }
14159 if eval $compile; then
14161 echo "You have fpos64_t."
14164 echo "You do not have fpos64_t."
14165 case "$fpossize" in
14166 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14173 : see if frexpl exists
14174 set frexpl d_frexpl
14177 : see if this is a sys/param system
14178 set sys/param.h i_sysparam
14181 : see if this is a sys/mount.h system
14182 set sys/mount.h i_sysmount
14185 : Check for fs_data_s
14187 echo "Checking to see if your system supports struct fs_data..." >&4
14188 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14190 case "$d_fs_data_s" in
14191 "$define") echo "Yes, it does." ;;
14192 *) echo "No, it doesn't." ;;
14195 : see if fseeko exists
14196 set fseeko d_fseeko
14198 case "$longsize" in
14199 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14202 : see if fsetpos exists
14203 set fsetpos d_fsetpos
14206 : see if fstatfs exists
14207 set fstatfs d_fstatfs
14210 : see if statvfs exists
14211 set statvfs d_statvfs
14214 : see if fstatvfs exists
14215 set fstatvfs d_fstatvfs
14219 : see if fsync exists
14223 : see if ftello exists
14224 set ftello d_ftello
14226 case "$longsize" in
14227 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14230 : check for a working futimes
14233 echo "Checking if you have a working futimes()" >&4
14236 #include <sys/time.h>
14243 fd = open ("try.c", O_RDWR);
14244 if (-1 == fd) exit (1);
14245 rv = futimes (fd, NULL);
14246 exit (rv == -1 ? errno : 0);
14250 if eval $compile; then
14254 0) echo "Yes, you have" >&4
14255 d_futimes="$define"
14257 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14261 echo "No, it does not (probably harmless)" >&4
14265 : see if ndbm.h is available
14268 : Compatibility location for RedHat 7.1
14269 set gdbm/ndbm.h i_gdbmndbm
14271 : Compatibility location for Debian 4.0
14272 set gdbm-ndbm.h i_gdbm_ndbm
14276 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14277 : see if dbm_open exists
14278 set dbm_open d_dbm_open
14280 case "$d_dbm_open" in
14283 i_gdbmndbm="$undef"
14284 i_gdbm_ndbm="$undef"
14285 echo "We won't be including <ndbm.h>"
14295 ndbm_hdr_protochk='name=$1; hdr=$2;
14296 eval "ihdr=\$""i_$name";
14298 if $test "$ihdr" = "$define"; then
14299 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14300 case "$d_cplusplus" in
14301 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14302 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14305 $define) $echo "Your <$hdr> seems to have prototypes";;
14306 *) $echo "Your <$hdr> does not seem to have prototypes";;
14309 set "d_${name}_h_uses_prototypes";
14313 eval $ndbm_hdr_protochk
14314 set gdbmndbm gdbm/ndbm.h
14315 eval $ndbm_hdr_protochk
14316 set gdbm_ndbm gdbm-ndbm.h
14317 eval $ndbm_hdr_protochk
14319 : see if getaddrinfo exists
14320 set getaddrinfo d_getaddrinfo
14323 : see if getcwd exists
14324 set getcwd d_getcwd
14327 : see if getespwnam exists
14328 set getespwnam d_getespwnam
14331 : see if getfsstat exists
14332 set getfsstat d_getfsstat
14335 : see if getgrent exists
14336 set getgrent d_getgrent
14339 : see if getgrent_r exists
14340 set getgrent_r d_getgrent_r
14342 case "$d_getgrent_r" in
14344 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14345 case "$d_getgrent_r_proto:$usethreads" in
14346 ":define") d_getgrent_r_proto=define
14347 set d_getgrent_r_proto getgrent_r $hdrs
14351 case "$d_getgrent_r_proto" in
14353 case "$getgrent_r_proto" in
14354 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14355 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14357 case "$getgrent_r_proto" in
14358 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14359 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14361 case "$getgrent_r_proto" in
14362 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14363 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14365 case "$getgrent_r_proto" in
14366 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14367 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14369 case "$getgrent_r_proto" in
14370 ''|0) try='int getgrent_r(struct group*, char*, int);'
14371 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14373 case "$getgrent_r_proto" in
14374 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14375 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14377 case "$getgrent_r_proto" in
14378 ''|0) d_getgrent_r=undef
14380 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14381 * ) case "$getgrent_r_proto" in
14382 REENTRANT_PROTO*) ;;
14383 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14385 echo "Prototype: $try" ;;
14388 *) case "$usethreads" in
14389 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14396 *) getgrent_r_proto=0
14400 : see if getgrgid_r exists
14401 set getgrgid_r d_getgrgid_r
14403 case "$d_getgrgid_r" in
14405 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14406 case "$d_getgrgid_r_proto:$usethreads" in
14407 ":define") d_getgrgid_r_proto=define
14408 set d_getgrgid_r_proto getgrgid_r $hdrs
14412 case "$d_getgrgid_r_proto" in
14414 case "$getgrgid_r_proto" in
14415 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14416 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14418 case "$getgrgid_r_proto" in
14419 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14420 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14422 case "$getgrgid_r_proto" in
14423 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14424 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14426 case "$getgrgid_r_proto" in
14427 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14428 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14430 case "$getgrgid_r_proto" in
14431 ''|0) d_getgrgid_r=undef
14433 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14434 * ) case "$getgrgid_r_proto" in
14435 REENTRANT_PROTO*) ;;
14436 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14438 echo "Prototype: $try" ;;
14441 *) case "$usethreads" in
14442 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14449 *) getgrgid_r_proto=0
14453 : see if getgrnam_r exists
14454 set getgrnam_r d_getgrnam_r
14456 case "$d_getgrnam_r" in
14458 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14459 case "$d_getgrnam_r_proto:$usethreads" in
14460 ":define") d_getgrnam_r_proto=define
14461 set d_getgrnam_r_proto getgrnam_r $hdrs
14465 case "$d_getgrnam_r_proto" in
14467 case "$getgrnam_r_proto" in
14468 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14469 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14471 case "$getgrnam_r_proto" in
14472 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14473 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14475 case "$getgrnam_r_proto" in
14476 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14477 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14479 case "$getgrnam_r_proto" in
14480 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14481 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14483 case "$getgrnam_r_proto" in
14484 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14485 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14487 case "$getgrnam_r_proto" in
14488 ''|0) d_getgrnam_r=undef
14490 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14491 * ) case "$getgrnam_r_proto" in
14492 REENTRANT_PROTO*) ;;
14493 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14495 echo "Prototype: $try" ;;
14498 *) case "$usethreads" in
14499 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14506 *) getgrnam_r_proto=0
14510 : see if gethostbyaddr exists
14511 set gethostbyaddr d_gethbyaddr
14514 : see if gethostbyname exists
14515 set gethostbyname d_gethbyname
14518 : see if gethostent exists
14519 set gethostent d_gethent
14522 : see how we will look up host name
14525 if set gethostname val -f d_gethname; eval $csym; $val; then
14526 echo 'gethostname() found.' >&4
14527 d_gethname="$define"
14530 if set uname val -f d_uname; eval $csym; $val; then
14533 uname() was found, but you're running xenix, and older versions of xenix
14534 have a broken uname(). If you don't really know whether your xenix is old
14535 enough to have a broken system call, use the default answer.
14540 "$define") dflt=n;;
14542 rp='Is your uname() broken?'
14545 n*) d_uname="$define"; call=uname;;
14548 echo 'uname() found.' >&4
14555 case "$d_gethname" in
14556 '') d_gethname="$undef";;
14559 '') d_uname="$undef";;
14561 case "$d_uname$d_gethname" in
14566 Every now and then someone has a $call() that lies about the hostname
14567 but can't be fixed for political or economic reasons. If you wish, I can
14568 pretend $call() isn't there and maybe compute hostname at run-time
14569 thanks to the '$phostname' command.
14572 rp="Shall I ignore $call() from now on?"
14575 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14578 case "$phostname" in
14579 '') aphostname='';;
14580 *) case "$aphostname" in
14582 *) set X $phostname
14586 file=`./loc $file $file $pth`
14587 aphostname=`echo $file $*`
14592 case "$d_uname$d_gethname" in
14595 case "$phostname" in
14597 echo "There will be no way for $package to get your hostname." >&4;;
14599 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14603 case "$d_phostname" in
14604 '') d_phostname="$undef";;
14607 : see if gethostbyaddr_r exists
14608 set gethostbyaddr_r d_gethostbyaddr_r
14610 case "$d_gethostbyaddr_r" in
14612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14613 case "$d_gethostbyaddr_r_proto:$usethreads" in
14614 ":define") d_gethostbyaddr_r_proto=define
14615 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14619 case "$d_gethostbyaddr_r_proto" in
14621 case "$gethostbyaddr_r_proto" in
14622 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14623 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14625 case "$gethostbyaddr_r_proto" in
14626 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14627 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14629 case "$gethostbyaddr_r_proto" in
14630 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14631 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14633 case "$gethostbyaddr_r_proto" in
14634 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14637 case "$gethostbyaddr_r_proto" in
14638 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14639 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14641 case "$gethostbyaddr_r_proto" in
14642 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14645 case "$gethostbyaddr_r_proto" in
14646 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14647 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14649 case "$gethostbyaddr_r_proto" in
14650 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14651 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14653 case "$gethostbyaddr_r_proto" in
14654 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14655 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14657 case "$gethostbyaddr_r_proto" in
14658 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14659 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14661 case "$gethostbyaddr_r_proto" in
14662 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14663 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14665 case "$gethostbyaddr_r_proto" in
14666 ''|0) d_gethostbyaddr_r=undef
14667 gethostbyaddr_r_proto=0
14668 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14669 * ) case "$gethostbyaddr_r_proto" in
14670 REENTRANT_PROTO*) ;;
14671 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14673 echo "Prototype: $try" ;;
14676 *) case "$usethreads" in
14677 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14679 d_gethostbyaddr_r=undef
14680 gethostbyaddr_r_proto=0
14684 *) gethostbyaddr_r_proto=0
14688 : see if gethostbyname_r exists
14689 set gethostbyname_r d_gethostbyname_r
14691 case "$d_gethostbyname_r" in
14693 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14694 case "$d_gethostbyname_r_proto:$usethreads" in
14695 ":define") d_gethostbyname_r_proto=define
14696 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14700 case "$d_gethostbyname_r_proto" in
14702 case "$gethostbyname_r_proto" in
14703 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14704 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14706 case "$gethostbyname_r_proto" in
14707 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14708 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14710 case "$gethostbyname_r_proto" in
14711 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14712 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14714 case "$gethostbyname_r_proto" in
14715 ''|0) d_gethostbyname_r=undef
14716 gethostbyname_r_proto=0
14717 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14718 * ) case "$gethostbyname_r_proto" in
14719 REENTRANT_PROTO*) ;;
14720 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14722 echo "Prototype: $try" ;;
14725 *) case "$usethreads" in
14726 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14728 d_gethostbyname_r=undef
14729 gethostbyname_r_proto=0
14733 *) gethostbyname_r_proto=0
14737 : see if gethostent_r exists
14738 set gethostent_r d_gethostent_r
14740 case "$d_gethostent_r" in
14742 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14743 case "$d_gethostent_r_proto:$usethreads" in
14744 ":define") d_gethostent_r_proto=define
14745 set d_gethostent_r_proto gethostent_r $hdrs
14749 case "$d_gethostent_r_proto" in
14751 case "$gethostent_r_proto" in
14752 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14753 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14755 case "$gethostent_r_proto" in
14756 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14757 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14759 case "$gethostent_r_proto" in
14760 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14761 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14763 case "$gethostent_r_proto" in
14764 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14765 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14767 case "$gethostent_r_proto" in
14768 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14769 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14771 case "$gethostent_r_proto" in
14772 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14773 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14775 case "$gethostent_r_proto" in
14776 ''|0) d_gethostent_r=undef
14777 gethostent_r_proto=0
14778 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14779 * ) case "$gethostent_r_proto" in
14780 REENTRANT_PROTO*) ;;
14781 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14783 echo "Prototype: $try" ;;
14786 *) case "$usethreads" in
14787 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14789 d_gethostent_r=undef
14790 gethostent_r_proto=0
14794 *) gethostent_r_proto=0
14798 : see if prototypes for various gethostxxx netdb.h functions are available
14800 set d_gethostprotos gethostent $i_netdb netdb.h
14803 : see if getitimer exists
14804 set getitimer d_getitimer
14807 : see if getlogin exists
14808 set getlogin d_getlogin
14811 : see if getlogin_r exists
14812 set getlogin_r d_getlogin_r
14814 case "$d_getlogin_r" in
14816 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14817 case "$d_getlogin_r_proto:$usethreads" in
14818 ":define") d_getlogin_r_proto=define
14819 set d_getlogin_r_proto getlogin_r $hdrs
14823 case "$d_getlogin_r_proto" in
14825 case "$getlogin_r_proto" in
14826 ''|0) try='int getlogin_r(char*, size_t);'
14827 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14829 case "$getlogin_r_proto" in
14830 ''|0) try='int getlogin_r(char*, int);'
14831 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14833 case "$getlogin_r_proto" in
14834 ''|0) try='char* getlogin_r(char*, size_t);'
14835 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14837 case "$getlogin_r_proto" in
14838 ''|0) try='char* getlogin_r(char*, int);'
14839 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14841 case "$getlogin_r_proto" in
14842 ''|0) d_getlogin_r=undef
14844 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14845 * ) case "$getlogin_r_proto" in
14846 REENTRANT_PROTO*) ;;
14847 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14849 echo "Prototype: $try" ;;
14852 *) case "$usethreads" in
14853 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14860 *) getlogin_r_proto=0
14864 : see if getmnt exists
14865 set getmnt d_getmnt
14868 : see if getmntent exists
14869 set getmntent d_getmntent
14872 : see if getnameinfo exists
14873 set getnameinfo d_getnameinfo
14876 : see if getnetbyaddr exists
14877 set getnetbyaddr d_getnbyaddr
14880 : see if getnetbyname exists
14881 set getnetbyname d_getnbyname
14884 : see if getnetent exists
14885 set getnetent d_getnent
14888 : see if getnetbyaddr_r exists
14889 set getnetbyaddr_r d_getnetbyaddr_r
14891 case "$d_getnetbyaddr_r" in
14893 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14894 case "$d_getnetbyaddr_r_proto:$usethreads" in
14895 ":define") d_getnetbyaddr_r_proto=define
14896 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14900 case "$d_getnetbyaddr_r_proto" in
14902 case "$getnetbyaddr_r_proto" in
14903 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14904 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14906 case "$getnetbyaddr_r_proto" in
14907 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14908 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14910 case "$getnetbyaddr_r_proto" in
14911 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14912 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14914 case "$getnetbyaddr_r_proto" in
14915 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14916 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14918 case "$getnetbyaddr_r_proto" in
14919 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14920 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14922 case "$getnetbyaddr_r_proto" in
14923 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14924 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14926 case "$getnetbyaddr_r_proto" in
14927 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14928 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14930 case "$getnetbyaddr_r_proto" in
14931 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14932 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14934 case "$getnetbyaddr_r_proto" in
14935 ''|0) d_getnetbyaddr_r=undef
14936 getnetbyaddr_r_proto=0
14937 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14938 * ) case "$getnetbyaddr_r_proto" in
14939 REENTRANT_PROTO*) ;;
14940 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14942 echo "Prototype: $try" ;;
14945 *) case "$usethreads" in
14946 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14948 d_getnetbyaddr_r=undef
14949 getnetbyaddr_r_proto=0
14953 *) getnetbyaddr_r_proto=0
14957 : see if getnetbyname_r exists
14958 set getnetbyname_r d_getnetbyname_r
14960 case "$d_getnetbyname_r" in
14962 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14963 case "$d_getnetbyname_r_proto:$usethreads" in
14964 ":define") d_getnetbyname_r_proto=define
14965 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14969 case "$d_getnetbyname_r_proto" in
14971 case "$getnetbyname_r_proto" in
14972 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14973 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14975 case "$getnetbyname_r_proto" in
14976 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14977 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14979 case "$getnetbyname_r_proto" in
14980 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14981 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14983 case "$getnetbyname_r_proto" in
14984 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14985 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14987 case "$getnetbyname_r_proto" in
14988 ''|0) d_getnetbyname_r=undef
14989 getnetbyname_r_proto=0
14990 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14991 * ) case "$getnetbyname_r_proto" in
14992 REENTRANT_PROTO*) ;;
14993 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14995 echo "Prototype: $try" ;;
14998 *) case "$usethreads" in
14999 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15001 d_getnetbyname_r=undef
15002 getnetbyname_r_proto=0
15006 *) getnetbyname_r_proto=0
15010 : see if getnetent_r exists
15011 set getnetent_r d_getnetent_r
15013 case "$d_getnetent_r" in
15015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15016 case "$d_getnetent_r_proto:$usethreads" in
15017 ":define") d_getnetent_r_proto=define
15018 set d_getnetent_r_proto getnetent_r $hdrs
15022 case "$d_getnetent_r_proto" in
15024 case "$getnetent_r_proto" in
15025 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15026 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15028 case "$getnetent_r_proto" in
15029 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15030 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15032 case "$getnetent_r_proto" in
15033 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15034 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15036 case "$getnetent_r_proto" in
15037 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15038 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15040 case "$getnetent_r_proto" in
15041 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15042 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15044 case "$getnetent_r_proto" in
15045 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15046 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15048 case "$getnetent_r_proto" in
15049 ''|0) d_getnetent_r=undef
15050 getnetent_r_proto=0
15051 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15052 * ) case "$getnetent_r_proto" in
15053 REENTRANT_PROTO*) ;;
15054 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15056 echo "Prototype: $try" ;;
15059 *) case "$usethreads" in
15060 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15062 d_getnetent_r=undef
15063 getnetent_r_proto=0
15067 *) getnetent_r_proto=0
15071 : see if prototypes for various getnetxxx netdb.h functions are available
15073 set d_getnetprotos getnetent $i_netdb netdb.h
15076 : see if getpagesize exists
15077 set getpagesize d_getpagsz
15080 : Optional checks for getprotobyname and getprotobynumber
15082 : see if getprotobyname exists
15083 set getprotobyname d_getpbyname
15086 : see if getprotobynumber exists
15087 set getprotobynumber d_getpbynumber
15090 : see if getprotoent exists
15091 set getprotoent d_getpent
15094 : see if getpgid exists
15095 set getpgid d_getpgid
15098 : see if getpgrp2 exists
15099 set getpgrp2 d_getpgrp2
15102 : see if getppid exists
15103 set getppid d_getppid
15106 : see if getpriority exists
15107 set getpriority d_getprior
15110 : see if getprotobyname_r exists
15111 set getprotobyname_r d_getprotobyname_r
15113 case "$d_getprotobyname_r" in
15115 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15116 case "$d_getprotobyname_r_proto:$usethreads" in
15117 ":define") d_getprotobyname_r_proto=define
15118 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15122 case "$d_getprotobyname_r_proto" in
15124 case "$getprotobyname_r_proto" in
15125 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15126 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15128 case "$getprotobyname_r_proto" in
15129 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15130 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15132 case "$getprotobyname_r_proto" in
15133 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15134 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15136 case "$getprotobyname_r_proto" in
15137 ''|0) d_getprotobyname_r=undef
15138 getprotobyname_r_proto=0
15139 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15140 * ) case "$getprotobyname_r_proto" in
15141 REENTRANT_PROTO*) ;;
15142 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15144 echo "Prototype: $try" ;;
15147 *) case "$usethreads" in
15148 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15150 d_getprotobyname_r=undef
15151 getprotobyname_r_proto=0
15155 *) getprotobyname_r_proto=0
15159 : see if getprotobynumber_r exists
15160 set getprotobynumber_r d_getprotobynumber_r
15162 case "$d_getprotobynumber_r" in
15164 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15165 case "$d_getprotobynumber_r_proto:$usethreads" in
15166 ":define") d_getprotobynumber_r_proto=define
15167 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15171 case "$d_getprotobynumber_r_proto" in
15173 case "$getprotobynumber_r_proto" in
15174 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15175 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15177 case "$getprotobynumber_r_proto" in
15178 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15179 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15181 case "$getprotobynumber_r_proto" in
15182 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15183 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15185 case "$getprotobynumber_r_proto" in
15186 ''|0) d_getprotobynumber_r=undef
15187 getprotobynumber_r_proto=0
15188 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15189 * ) case "$getprotobynumber_r_proto" in
15190 REENTRANT_PROTO*) ;;
15191 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15193 echo "Prototype: $try" ;;
15196 *) case "$usethreads" in
15197 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15199 d_getprotobynumber_r=undef
15200 getprotobynumber_r_proto=0
15204 *) getprotobynumber_r_proto=0
15208 : see if getprotoent_r exists
15209 set getprotoent_r d_getprotoent_r
15211 case "$d_getprotoent_r" in
15213 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15214 case "$d_getprotoent_r_proto:$usethreads" in
15215 ":define") d_getprotoent_r_proto=define
15216 set d_getprotoent_r_proto getprotoent_r $hdrs
15220 case "$d_getprotoent_r_proto" in
15222 case "$getprotoent_r_proto" in
15223 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15224 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15226 case "$getprotoent_r_proto" in
15227 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15228 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15230 case "$getprotoent_r_proto" in
15231 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15232 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15234 case "$getprotoent_r_proto" in
15235 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15236 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15238 case "$getprotoent_r_proto" in
15239 ''|0) d_getprotoent_r=undef
15240 getprotoent_r_proto=0
15241 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15242 * ) case "$getprotoent_r_proto" in
15243 REENTRANT_PROTO*) ;;
15244 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15246 echo "Prototype: $try" ;;
15249 *) case "$usethreads" in
15250 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15252 d_getprotoent_r=undef
15253 getprotoent_r_proto=0
15257 *) getprotoent_r_proto=0
15261 : see if prototypes for various getprotoxxx netdb.h functions are available
15263 set d_getprotoprotos getprotoent $i_netdb netdb.h
15266 : see if getprpwnam exists
15267 set getprpwnam d_getprpwnam
15270 : see if getpwent exists
15271 set getpwent d_getpwent
15274 : see if getpwent_r exists
15275 set getpwent_r d_getpwent_r
15277 case "$d_getpwent_r" in
15279 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15280 case "$d_getpwent_r_proto:$usethreads" in
15281 ":define") d_getpwent_r_proto=define
15282 set d_getpwent_r_proto getpwent_r $hdrs
15286 case "$d_getpwent_r_proto" in
15288 case "$getpwent_r_proto" in
15289 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15290 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15292 case "$getpwent_r_proto" in
15293 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15294 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15296 case "$getpwent_r_proto" in
15297 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15298 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15300 case "$getpwent_r_proto" in
15301 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15302 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15304 case "$getpwent_r_proto" in
15305 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15306 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15308 case "$getpwent_r_proto" in
15309 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15310 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15312 case "$getpwent_r_proto" in
15313 ''|0) d_getpwent_r=undef
15315 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15316 * ) case "$getpwent_r_proto" in
15317 REENTRANT_PROTO*) ;;
15318 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15320 echo "Prototype: $try" ;;
15323 *) case "$usethreads" in
15324 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15331 *) getpwent_r_proto=0
15335 : see if getpwnam_r exists
15336 set getpwnam_r d_getpwnam_r
15338 case "$d_getpwnam_r" in
15340 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15341 case "$d_getpwnam_r_proto:$usethreads" in
15342 ":define") d_getpwnam_r_proto=define
15343 set d_getpwnam_r_proto getpwnam_r $hdrs
15347 case "$d_getpwnam_r_proto" in
15349 case "$getpwnam_r_proto" in
15350 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15351 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15353 case "$getpwnam_r_proto" in
15354 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15355 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15357 case "$getpwnam_r_proto" in
15358 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15359 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15361 case "$getpwnam_r_proto" in
15362 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15363 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15365 case "$getpwnam_r_proto" in
15366 ''|0) d_getpwnam_r=undef
15368 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15369 * ) case "$getpwnam_r_proto" in
15370 REENTRANT_PROTO*) ;;
15371 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15373 echo "Prototype: $try" ;;
15376 *) case "$usethreads" in
15377 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15384 *) getpwnam_r_proto=0
15388 : see if getpwuid_r exists
15389 set getpwuid_r d_getpwuid_r
15391 case "$d_getpwuid_r" in
15393 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15394 case "$d_getpwuid_r_proto:$usethreads" in
15395 ":define") d_getpwuid_r_proto=define
15396 set d_getpwuid_r_proto getpwuid_r $hdrs
15400 case "$d_getpwuid_r_proto" in
15402 case "$getpwuid_r_proto" in
15403 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15404 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15406 case "$getpwuid_r_proto" in
15407 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15408 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15410 case "$getpwuid_r_proto" in
15411 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15412 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15414 case "$getpwuid_r_proto" in
15415 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15416 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15418 case "$getpwuid_r_proto" in
15419 ''|0) d_getpwuid_r=undef
15421 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15422 * ) case "$getpwuid_r_proto" in
15423 REENTRANT_PROTO*) ;;
15424 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15426 echo "Prototype: $try" ;;
15429 *) case "$usethreads" in
15430 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15437 *) getpwuid_r_proto=0
15441 : Optional checks for getsbyname and getsbyport
15443 : see if getservbyname exists
15444 set getservbyname d_getsbyname
15447 : see if getservbyport exists
15448 set getservbyport d_getsbyport
15451 : see if getservent exists
15452 set getservent d_getsent
15455 : see if getservbyname_r exists
15456 set getservbyname_r d_getservbyname_r
15458 case "$d_getservbyname_r" in
15460 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15461 case "$d_getservbyname_r_proto:$usethreads" in
15462 ":define") d_getservbyname_r_proto=define
15463 set d_getservbyname_r_proto getservbyname_r $hdrs
15467 case "$d_getservbyname_r_proto" in
15469 case "$getservbyname_r_proto" in
15470 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15471 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15473 case "$getservbyname_r_proto" in
15474 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15475 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15477 case "$getservbyname_r_proto" in
15478 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15479 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15481 case "$getservbyname_r_proto" in
15482 ''|0) d_getservbyname_r=undef
15483 getservbyname_r_proto=0
15484 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15485 * ) case "$getservbyname_r_proto" in
15486 REENTRANT_PROTO*) ;;
15487 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15489 echo "Prototype: $try" ;;
15492 *) case "$usethreads" in
15493 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15495 d_getservbyname_r=undef
15496 getservbyname_r_proto=0
15500 *) getservbyname_r_proto=0
15504 : see if getservbyport_r exists
15505 set getservbyport_r d_getservbyport_r
15507 case "$d_getservbyport_r" in
15509 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15510 case "$d_getservbyport_r_proto:$usethreads" in
15511 ":define") d_getservbyport_r_proto=define
15512 set d_getservbyport_r_proto getservbyport_r $hdrs
15516 case "$d_getservbyport_r_proto" in
15518 case "$getservbyport_r_proto" in
15519 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15520 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15522 case "$getservbyport_r_proto" in
15523 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15524 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15526 case "$getservbyport_r_proto" in
15527 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15528 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15530 case "$getservbyport_r_proto" in
15531 ''|0) d_getservbyport_r=undef
15532 getservbyport_r_proto=0
15533 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15534 * ) case "$getservbyport_r_proto" in
15535 REENTRANT_PROTO*) ;;
15536 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15538 echo "Prototype: $try" ;;
15541 *) case "$usethreads" in
15542 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15544 d_getservbyport_r=undef
15545 getservbyport_r_proto=0
15549 *) getservbyport_r_proto=0
15553 : see if getservent_r exists
15554 set getservent_r d_getservent_r
15556 case "$d_getservent_r" in
15558 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15559 case "$d_getservent_r_proto:$usethreads" in
15560 ":define") d_getservent_r_proto=define
15561 set d_getservent_r_proto getservent_r $hdrs
15565 case "$d_getservent_r_proto" in
15567 case "$getservent_r_proto" in
15568 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15569 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15571 case "$getservent_r_proto" in
15572 ''|0) try='int getservent_r(struct servent*, char*, int);'
15573 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15575 case "$getservent_r_proto" in
15576 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15577 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15579 case "$getservent_r_proto" in
15580 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15581 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15583 case "$getservent_r_proto" in
15584 ''|0) d_getservent_r=undef
15585 getservent_r_proto=0
15586 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15587 * ) case "$getservent_r_proto" in
15588 REENTRANT_PROTO*) ;;
15589 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15591 echo "Prototype: $try" ;;
15594 *) case "$usethreads" in
15595 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15597 d_getservent_r=undef
15598 getservent_r_proto=0
15602 *) getservent_r_proto=0
15606 : see if prototypes for various getservxxx netdb.h functions are available
15608 set d_getservprotos getservent $i_netdb netdb.h
15611 : see if getspnam exists
15612 set getspnam d_getspnam
15615 : see if this is a shadow.h system
15616 set shadow.h i_shadow
15619 : see if getspnam_r exists
15620 set getspnam_r d_getspnam_r
15622 case "$d_getspnam_r" in
15624 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15625 case "$d_getspnam_r_proto:$usethreads" in
15626 ":define") d_getspnam_r_proto=define
15627 set d_getspnam_r_proto getspnam_r $hdrs
15631 case "$d_getspnam_r_proto" in
15633 case "$getspnam_r_proto" in
15634 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15635 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15637 case "$getspnam_r_proto" in
15638 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15639 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15641 case "$getspnam_r_proto" in
15642 ''|0) d_getspnam_r=undef
15644 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15645 * ) case "$getspnam_r_proto" in
15646 REENTRANT_PROTO*) ;;
15647 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15649 echo "Prototype: $try" ;;
15652 *) case "$usethreads" in
15653 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15660 *) getspnam_r_proto=0
15664 : see if gettimeofday or ftime exists
15665 set gettimeofday d_gettimeod
15667 case "$d_gettimeod" in
15673 val="$undef"; set d_ftime; eval $setvar
15676 case "$d_gettimeod$d_ftime" in
15679 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15683 : see if gmtime_r exists
15684 set gmtime_r d_gmtime_r
15686 case "$d_gmtime_r" in
15688 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15689 case "$d_gmtime_r_proto:$usethreads" in
15690 ":define") d_gmtime_r_proto=define
15691 set d_gmtime_r_proto gmtime_r $hdrs
15695 case "$d_gmtime_r_proto" in
15697 case "$gmtime_r_proto" in
15698 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15699 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15701 case "$gmtime_r_proto" in
15702 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15703 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15705 case "$gmtime_r_proto" in
15706 ''|0) d_gmtime_r=undef
15708 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15709 * ) case "$gmtime_r_proto" in
15710 REENTRANT_PROTO*) ;;
15711 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15713 echo "Prototype: $try" ;;
15716 *) case "$usethreads" in
15717 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15724 *) gmtime_r_proto=0
15728 : see if hasmntopt exists
15729 set hasmntopt d_hasmntopt
15732 : see if this is a netinet/in.h or sys/in.h system
15733 set netinet/in.h i_niin sys/in.h i_sysin
15736 : see if arpa/inet.h has to be included
15737 set arpa/inet.h i_arpainet
15740 : see if htonl --and friends-- exists
15745 : Maybe they are macros.
15748 $cat >htonl.c <<EOM
15750 #include <sys/types.h>
15751 #$i_niin I_NETINET_IN
15753 #$i_arpainet I_ARPA_INET
15754 #ifdef I_NETINET_IN
15755 #include <netinet/in.h>
15758 #include <sys/in.h>
15761 #include <arpa/inet.h>
15764 printf("Defined as a macro.");
15767 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15768 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15770 echo "But it seems to be defined as a macro." >&4
15778 : see if hypot exists
15782 : see if ilogb exists
15786 : see if ilogbl exists
15787 set ilogbl d_ilogbl
15792 if set index val -f; eval $csym; $val; then
15793 if set strchr val -f d_strchr; eval $csym; $val; then
15794 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15797 echo "strchr() found." >&4
15801 echo "index() found." >&4
15806 echo "index() found." >&4
15809 if set strchr val -f d_strchr; eval $csym; $val; then
15812 echo "strchr() found." >&4
15814 echo "No index() or strchr() found!" >&4
15819 set d_strchr; eval $setvar
15821 set d_index; eval $setvar
15823 : check whether inet_aton exists
15824 set inet_aton d_inetaton
15827 : see if inet_ntop exists
15828 set inet_ntop d_inetntop
15831 : see if inet_pton exists
15832 set inet_pton d_inetpton
15837 $cat >isascii.c <<EOCP
15840 #$i_stdlib I_STDLIB
15842 #include <stdlib.h>
15853 if eval $compile; then
15854 echo "isascii() found." >&4
15857 echo "isascii() NOT found." >&4
15866 $cat >isblank.c <<'EOCP'
15877 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15878 echo "isblank() found." >&4
15881 echo "isblank() NOT found." >&4
15888 : check for isfinite
15889 echo "Checking to see if you have isfinite..." >&4
15895 int main() { return isfinite(0.0); }
15898 if eval $compile; then
15900 echo "You have isfinite."
15903 echo "You do not have isfinite."
15909 : see if isfinitel exists
15910 set isfinitel d_isfinitel
15914 echo "Checking to see if you have isinf..." >&4
15920 int main() { return isinf(0.0); }
15923 if eval $compile; then
15925 echo "You have isinf."
15928 echo "You do not have isinf."
15934 : see if isinfl exists
15935 set isinfl d_isinfl
15939 echo "Checking to see if you have isless..." >&4
15945 int main() { return isless(0.0); }
15948 if eval $compile; then
15950 echo "You have isless."
15953 echo "You do not have isless."
15960 echo "Checking to see if you have isnan..." >&4
15966 int main() { return isnan(0.0); }
15969 if eval $compile; then
15971 echo "You have isnan."
15974 echo "You do not have isnan."
15980 : see if isnanl exists
15981 set isnanl d_isnanl
15984 : check for isnormal
15985 echo "Checking to see if you have isnormal..." >&4
15991 int main() { return isnormal(0.0); }
15994 if eval $compile; then
15996 echo "You have isnormal."
15999 echo "You do not have isnormal."
16009 : see if j0l exists
16013 : see if killpg exists
16014 set killpg d_killpg
16017 : see if localeconv exists
16018 set localeconv d_locconv
16021 : see if libc has the POSIX.1-2008 currency locale rules
16022 case "$d_locconv:$d_lc_monetary_2008" in
16025 #include <locale.h>
16027 struct lconv *lc = localeconv();
16028 char int_p_cs_precedes = lc->int_p_cs_precedes;
16033 if eval $compile; then
16034 d_lc_monetary_2008="$define"
16036 d_lc_monetary_2008="$undef"
16042 : see if lchown exists
16044 $cat > try.c <<'EOCP'
16045 /* System header to define __stub macros and hopefully few prototypes,
16046 which can conflict with char lchown(); below. */
16047 #include <assert.h>
16048 /* Override any gcc2 internal prototype to avoid an error. */
16049 /* We use char because int might match the return type of a gcc2
16050 builtin and then its argument prototype would still apply. */
16053 /* The GNU C library defines this for functions which it implements
16054 to always fail with ENOSYS. Some functions are actually named
16055 something starting with __ and the normal name is an alias. */
16056 #if defined (__stub_lchown) || defined (__stub___lchown)
16064 if eval $compile; then
16065 $echo "lchown() found." >&4
16068 $echo "lchown() NOT found." >&4
16074 : See if number of significant digits in a double precision number is known
16076 $cat >ldbl_dig.c <<EOM
16077 #$i_limits I_LIMITS
16080 #include <limits.h>
16086 printf("Contains LDBL_DIG");
16089 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16090 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16091 echo "LDBL_DIG found." >&4
16094 echo "LDBL_DIG NOT found." >&4
16101 : see if lgamma exists
16102 set lgamma d_lgamma
16105 : see if lgamma_r exists
16106 set lgamma_r d_lgamma_r
16109 : check to see if math.h defines _LIB_VERSION
16110 d_libm_lib_version="$undef"
16114 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16116 #include <unistd.h>
16118 int main (int argc, char *argv[])
16120 printf ("%d\n", _LIB_VERSION);
16125 if eval $compile; then
16127 echo "Yes, it does ($foo)" >&4
16128 d_libm_lib_version="$define"
16130 echo "No, it does not (probably harmless)" >&4
16137 : see if link exists
16141 : see if llrint exists
16142 set llrint d_llrint
16145 : see if llrintl exists
16146 set llrintl d_llrintl
16149 : see if llround exists
16150 set llround d_llround
16153 : see if llroundl exists
16154 set llroundl d_llroundl
16157 : see if localtime_r exists
16158 set localtime_r d_localtime_r
16160 case "$d_localtime_r" in
16162 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16163 case "$d_localtime_r_proto:$usethreads" in
16164 ":define") d_localtime_r_proto=define
16165 set d_localtime_r_proto localtime_r $hdrs
16169 case "$d_localtime_r_proto" in
16171 case "$localtime_r_proto" in
16172 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16173 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16175 case "$localtime_r_proto" in
16176 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16177 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16179 case "$localtime_r_proto" in
16180 ''|0) d_localtime_r=undef
16181 localtime_r_proto=0
16182 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16183 * ) case "$localtime_r_proto" in
16184 REENTRANT_PROTO*) ;;
16185 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16187 echo "Prototype: $try" ;;
16190 *) case "$usethreads" in
16191 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16193 d_localtime_r=undef
16194 localtime_r_proto=0
16198 *) localtime_r_proto=0
16202 : see if localtime_r calls tzset
16203 case "$localtime_r_proto" in
16206 /* Does our libc's localtime_r call tzset ?
16207 * return 0 if so, 1 otherwise.
16209 #$i_systypes I_SYS_TYPES
16210 #$i_unistd I_UNISTD
16212 #$i_stdlib I_STDLIB
16213 #$i_string I_STRING
16214 #$i_malloc I_MALLOC
16216 # include <sys/types.h>
16219 # include <unistd.h>
16225 #include <stdlib.h>
16228 # include <string.h>
16230 # include <strings.h>
16233 # include <malloc.h>
16237 time_t t = time(0L);
16238 char w_tz[]="TZ" "=GMT+5",
16239 e_tz[]="TZ" "=GMT-5",
16240 *tz_e = (char*)malloc(16),
16241 *tz_w = (char*)malloc(16);
16242 struct tm tm_e, tm_w;
16243 memset(&tm_e,'\0',sizeof(struct tm));
16244 memset(&tm_w,'\0',sizeof(struct tm));
16249 localtime_r(&t, &tm_e);
16252 localtime_r(&t, &tm_w);
16254 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16260 if eval $compile; then
16261 if $run ./try; then
16262 d_localtime_r_needs_tzset=undef;
16264 d_localtime_r_needs_tzset=define;
16267 d_localtime_r_needs_tzset=undef;
16271 d_localtime_r_needs_tzset=undef;
16276 : see if lockf exists
16280 : see if log1p exists
16284 : see if log2 exists
16288 : see if logb exists
16292 : see if lrint exists
16296 : see if lrintl exists
16297 set lrintl d_lrintl
16300 : see if lround exists
16301 set lround d_lround
16304 : see if lroundl exists
16305 set lroundl d_lroundl
16308 : see if prototype for lseek is available
16310 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16313 : see if lstat exists
16317 : see if madvise exists
16318 set madvise d_madvise
16321 : see if malloc_size exists
16322 set malloc_size d_malloc_size
16325 : see if malloc_size_good exists
16326 set malloc_good_size d_malloc_good_size
16329 : see if mblen exists
16333 : see if mbstowcs exists
16334 set mbstowcs d_mbstowcs
16337 : see if mbtowc exists
16338 set mbtowc d_mbtowc
16341 : see if memchr exists
16342 set memchr d_memchr
16345 : see if memcmp exists
16346 set memcmp d_memcmp
16349 : see if memcpy exists
16350 set memcpy d_memcpy
16353 : see if memmove exists
16354 set memmove d_memmove
16357 : see if memset exists
16358 set memset d_memset
16361 : see if mkdir exists
16365 : see if mkdtemp exists
16366 set mkdtemp d_mkdtemp
16369 : see if mkfifo exists
16370 set mkfifo d_mkfifo
16373 : see if mkstemp exists
16374 set mkstemp d_mkstemp
16377 : see if mkstemps exists
16378 set mkstemps d_mkstemps
16381 : see if mktime exists
16382 set mktime d_mktime
16385 : see if this is a sys/mman.h system
16386 set sys/mman.h i_sysmman
16389 : see if mmap exists
16392 : see what shmat returns
16393 : default to something harmless
16395 case "$i_sysmman$d_mmap" in
16397 $cat >mmap.c <<'END'
16398 #include <sys/mman.h>
16401 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16406 echo "and it returns ($mmaptype)." >&4
16412 : see if sqrtl exists
16416 : see if scalbnl exists
16417 set scalbnl d_scalbnl
16420 : see if truncl exists
16421 set truncl d_truncl
16424 : see if modfl exists
16428 : see if prototype for modfl is available
16430 set d_modflproto modfl $i_math math.h
16433 d_modfl_pow32_bug="$undef"
16435 case "$d_longdbl$d_modfl" in
16438 Checking to see whether your modfl() is okay for large values...
16444 if $test "X$d_modflproto" != "X$define"; then
16445 $cat >>try.c <<EOCP
16446 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16447 long double modfl (long double, long double *);
16450 $cat >>try.c <<EOCP
16452 long double nv = 4294967303.15;
16458 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16462 case "$osname:$gccversion" in
16463 aix:) saveccflags="$ccflags"
16464 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16467 if eval $compile; then
16470 *" 4294967303.150000 1.150000 4294967302.000000")
16471 echo >&4 "Your modfl() is broken for large values."
16472 d_modfl_pow32_bug="$define"
16474 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16478 *" 4294967303.150000 0.150000 4294967303.000000")
16479 echo >&4 "Your modfl() seems okay for large values."
16481 *) echo >&4 "I don't understand your modfl() at all."
16487 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16490 case "$osname:$gccversion" in
16491 aix:) ccflags="$saveccflags" ;; # restore
16496 if $test "$uselongdouble" = "$define"; then
16498 if $test "$d_sqrtl" != "$define"; then
16499 message="$message sqrtl"
16501 if $test "$d_modfl" != "$define"; then
16502 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16503 echo "You have both truncl and copysignl, so I can emulate modfl."
16505 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16506 echo "You have both aintl and copysignl, so I can emulate modfl."
16508 message="$message modfl"
16512 if $test "$d_frexpl" != "$define"; then
16513 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16514 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16516 message="$message frexpl"
16519 if $test "$d_ldexpl" != "$define"; then
16520 message="$message ldexpl"
16523 if $test "$message" != ""; then
16526 *** You requested the use of long doubles but you do not seem to have
16527 *** the following mathematical functions needed for long double support:
16529 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16530 *** Cannot continue, aborting.
16538 : see if mprotect exists
16539 set mprotect d_mprotect
16542 : see if msgctl exists
16543 set msgctl d_msgctl
16546 : see if msgget exists
16547 set msgget d_msgget
16550 : see if msgsnd exists
16551 set msgsnd d_msgsnd
16554 : see if msgrcv exists
16555 set msgrcv d_msgrcv
16558 : see how much of the 'msg*(2)' library is present.
16561 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16562 *"$undef"*) h_msg=false;;
16566 case "`ipcs 2>&1`" in
16567 "SVID messages"*"not configured"*)
16568 echo "Your $osname does not have the msg*(2) configured." >&4
16571 set msgctl d_msgctl
16573 set msgget d_msgget
16575 set msgsnd d_msgsnd
16577 set msgrcv d_msgrcv
16583 : we could also check for sys/ipc.h ...
16584 if $h_msg && $test `./findhdr sys/msg.h`; then
16585 echo "You have the full msg*(2) library." >&4
16588 echo "You don't have the full msg*(2) library." >&4
16594 : Check for msghdr_s
16596 echo "Checking to see if your system supports struct msghdr..." >&4
16597 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16599 case "$d_msghdr_s" in
16600 "$define") echo "Yes, it does." ;;
16601 *) echo "No, it doesn't." ;;
16605 : see if msync exists
16609 : see if munmap exists
16610 set munmap d_munmap
16613 : see if nan exists
16617 : see if nearbyint exists
16618 set nearbyint d_nearbyint
16621 : see if nextafter exists
16622 set nextafter d_nextafter
16625 : see if nexttoward exists
16626 set nexttoward d_nexttoward
16629 : see if nice exists
16633 : see if this is a langinfo.h system
16634 set langinfo.h i_langinfo
16637 : see if nl_langinfo exists
16638 set nl_langinfo d_nl_langinfo
16641 : see if this is a quadmath.h system
16642 set quadmath.h i_quadmath
16645 : check for volatile keyword
16647 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16648 $cat >try.c <<'EOCP'
16651 typedef struct _goo_struct goo_struct;
16652 goo_struct * volatile goo = ((goo_struct *)0);
16653 struct _goo_struct {
16658 typedef unsigned short foo_t;
16659 char *volatile foo;
16661 volatile foo_t blech;
16665 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16667 echo "Yup, it does."
16670 echo "Nope, it doesn't."
16676 : Check basic sizes
16678 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16680 case "$use64bitint:$d_quad:$quadtype" in
16683 uvtype="$uquadtype"
16688 uvtype="unsigned long"
16694 case "$uselongdouble:$d_longdbl" in
16696 nvtype="long double"
16697 nvsize=$longdblsize
16704 case "$usequadmath:$i_quadmath" in
16706 nvtype="__float128"
16712 *** You requested the use of the quadmath library, but you
16713 *** do not seem to have the quadmath library installed.
16714 *** Cannot continue, aborting.
16720 define:*) $cat <<EOM >&4
16722 *** You requested the use of the quadmath library, but you
16723 *** do not seem to have the required header, <quadmath.h>.
16725 case "$gccversion" in
16728 *** Your gcc looks a bit old:
16734 *** You are not running a gcc.
16739 *** For the quadmath library you need at least gcc 4.6.
16740 *** Cannot continue, aborting.
16746 $echo "(IV will be "$ivtype", $ivsize bytes)"
16747 $echo "(UV will be "$uvtype", $uvsize bytes)"
16748 $echo "(NV will be "$nvtype", $nvsize bytes)"
16751 #$i_inttypes I_INTTYPES
16753 #include <inttypes.h>
16758 int8_t i = INT8_MAX;
16759 uint8_t u = UINT8_MAX;
16760 printf("int8_t\n");
16763 int16_t i = INT16_MAX;
16764 uint16_t u = UINT16_MAX;
16765 printf("int16_t\n");
16768 int32_t i = INT32_MAX;
16769 uint32_t u = UINT32_MAX;
16770 printf("int32_t\n");
16775 i8type="signed char"
16776 u8type="unsigned char"
16781 '') case "$shortsize" in
16783 u16type="unsigned short"
16791 '') set try -DINT16
16792 if eval $compile; then
16793 case "`$run ./try`" in
16805 '') if $test $shortsize -ge 2; then
16807 u16type="unsigned short"
16815 '') case "$longsize" in
16817 u32type="unsigned long"
16821 *) case "$intsize" in
16823 u32type="unsigned int"
16833 '') set try -DINT32
16834 if eval $compile; then
16835 case "`$run ./try`" in
16847 '') if $test $intsize -ge 4; then
16849 u32type="unsigned int"
16857 '') case "$d_quad:$quadtype" in
16859 i64type="$quadtype"
16860 u64type="$uquadtype"
16868 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16869 : volatile so that the compiler has to store it out to memory.
16870 if test X"$d_volatile" = X"$define"; then
16875 #$i_stdlib I_STDLIB
16877 #include <stdlib.h>
16879 #include <sys/types.h>
16880 #include <signal.h>
16882 $volatile int bletched = 0;
16883 $signal_t blech(int s) { bletched = 1; }
16888 int n = 8 * $uvsize;
16891 signal(SIGFPE, blech);
16894 for (i = 0; i < n; i++) {
16895 u = u << 1 | ($uvtype)1;
16897 if (($uvtype)d != u)
16901 d = ($nvtype)(u - 1);
16902 if (($uvtype)d != (u - 1))
16909 printf("%d\n", ((i == n) ? -n : i));
16915 d_nv_preserves_uv="$undef"
16916 if eval $compile; then
16917 nv_preserves_uv_bits="`$run ./try`"
16919 case "$nv_preserves_uv_bits" in
16921 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16922 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16923 d_nv_preserves_uv="$define"
16925 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16926 d_nv_preserves_uv="$undef" ;;
16927 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16928 nv_preserves_uv_bits="0" ;;
16932 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16933 : volatile so that the compiler has to store it out to memory.
16934 if test X"$d_volatile" = X"$define"; then
16940 typedef $nvtype NV;
16947 while(count < 256) {
16948 $volatile NV up = value + 1.0;
16949 $volatile NV negated = -value;
16950 $volatile NV down = negated - 1.0;
16951 $volatile NV got_up = up - value;
16952 int up_good = got_up == 1.0;
16953 int got_down = down - negated;
16954 int down_good = got_down == -1.0;
16956 if (down_good != up_good) {
16958 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16959 up_good, (double) got_up, down_good, (double) got_down,
16960 count, (double) value);
16967 fputs("256.0", stdout);
16970 fputs("2.0", stdout);
16976 fputs("*", stdout);
16982 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16983 count, (double) value);
16989 nv_overflows_integers_at='0'
16990 if eval $compile; then
16996 The largest integer your NVs can preserve is equal to $xxx
16998 nv_overflows_integers_at="$xxx"
17001 Cannot determine the largest integer value your NVs can hold, unexpected output
17008 Cannot determine the largest integer value your NVs can hold
17015 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17016 : volatile so that the compiler has to store it out to memory.
17017 if test X"$d_volatile" = X"$define"; then
17022 #$i_stdlib I_STDLIB
17024 #include <stdlib.h>
17026 #$i_string I_STRING
17028 # include <string.h>
17030 # include <strings.h>
17032 #include <sys/types.h>
17033 #include <signal.h>
17035 $volatile int bletched = 0;
17036 $signal_t blech(int s) { bletched = 1; }
17039 int checkit($nvtype d, char *where) {
17040 unsigned char *p = (char *)&d;
17041 unsigned char *end = p + sizeof(d);
17051 printf("No - %s: 0x", where);
17053 printf ("%02X", *p++);
17058 int main(int argc, char **argv) {
17061 fail += checkit(d, "0.0");
17063 /* The compiler shouldn't be assuming that bletched is 0 */
17066 fail += checkit(d, "bleched");
17069 signal(SIGFPE, blech);
17072 /* Paranoia - the compiler should have no way of knowing that ANSI says
17073 that argv[argc] will always be NULL. Actually, if it did assume this it
17074 would be buggy, as this is C and main() can be called from elsewhere in
17076 d = argv[argc] ? 1 : 0;
17079 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17082 fail += checkit(d, "ternary");
17084 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17087 printf("No - memset doesn't give 0.0\n");
17088 /* This might just blow up: */
17089 printf("(gives %g)\n", d);
17095 printf("No - something bleched\n");
17100 printf("No - %d fail(s)\n", fail);
17109 d_nv_zero_is_allbits_zero="$undef"
17110 if eval $compile; then
17116 0.0 is represented as all bits zero in memory
17118 d_nv_zero_is_allbits_zero="$define"
17121 0.0 is not represented as all bits zero in memory
17123 d_nv_zero_is_allbits_zero="$undef"
17128 0.0 is not represented as all bits zero in memory
17130 d_nv_zero_is_allbits_zero="$undef"
17136 : check for off64_t
17138 echo "Checking to see if you have off64_t..." >&4
17140 #include <sys/types.h>
17141 #include <unistd.h>
17142 int main() { off64_t x = 7; }
17145 if eval $compile; then
17147 echo "You have off64_t."
17150 echo "You do not have off64_t."
17151 case "$lseeksize" in
17152 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17159 : how to create joinable pthreads
17160 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17162 echo "Checking what constant to use for creating joinable pthreads..." >&4
17163 $cat >try.c <<'EOCP'
17164 #include <pthread.h>
17166 int detachstate = JOINABLE;
17169 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17170 if eval $compile; then
17171 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17172 val="$undef" # Yes, undef.
17173 set d_old_pthread_create_joinable
17176 set old_pthread_create_joinable
17179 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17180 if eval $compile; then
17181 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17183 set d_old_pthread_create_joinable
17185 val=PTHREAD_CREATE_UNDETACHED
17186 set old_pthread_create_joinable
17189 set try -DJOINABLE=__UNDETACHED
17190 if eval $compile; then
17191 echo "You seem to use __UNDETACHED." >&4
17193 set d_old_pthread_create_joinable
17196 set old_pthread_create_joinable
17199 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17201 set d_old_pthread_create_joinable
17204 set old_pthread_create_joinable
17211 d_old_pthread_create_joinable="$undef"
17212 old_pthread_create_joinable=""
17215 : see if pause exists
17219 : see if poll exists
17223 : see if prctl exists
17227 : see if prctl supports PR_SET_NAME
17228 d_prctl_set_name=$undef
17233 #include <unistd.h>
17235 #include <sys/prctl.h>
17237 int main (int argc, char *argv[])
17239 return (prctl (PR_SET_NAME, "Test"));
17243 if eval $compile_ok && $run ./try; then
17244 echo "Your prctl (PR_SET_NAME, ...) works"
17245 d_prctl_set_name=$define
17251 : see if readlink exists
17252 set readlink d_readlink
17255 : Check if there is a /proc symlink to the abs path of
17256 : the executing program. We will honor hints of d_procselfexe=$undef
17257 : or procselfexe being non-empty, otherwise will try to determine both
17258 : if we have readlink.
17259 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17260 : referenced, and AmigaOS does not have a proc filesystem anyway.
17263 if $test "X$d_procselfexe" = Xundef; then
17265 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17267 elif $test "X$d_readlink" = Xdefine; then
17268 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17269 : and it feels more tidy to avoid an extra level of symlink
17270 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17271 while test $# -gt 0; do
17274 if $issymlink $try; then
17275 $ls -l $try > reflect
17276 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17277 echo "You have $type-like $try."
17278 procselfexe='"'$try'"'
17280 : This will break out of the loop
17290 : backward compatibility for d_hvfork
17291 if test X$d_hvfork != X; then
17292 d_vfork="$d_hvfork"
17295 : see if there is a vfork
17300 d_pseudofork=$undef
17302 : Ok, but do we want to use it. vfork is reportedly unreliable in
17303 : perl on Solaris 2.x, and probably elsewhere.
17307 case "$usevfork" in
17313 Perl can only use a vfork() that doesn't suffer from strict
17314 restrictions on calling functions or modifying global data in
17315 the child. For example, glibc-2.1 contains such a vfork()
17316 that is unsuitable. If your system provides a proper fork()
17317 call, chances are that you do NOT want perl to use vfork().
17320 rp="Do you still want to use vfork()?"
17325 echo "Ok, we won't use vfork()."
17334 $define) usevfork='true';;
17335 *) usevfork='false';;
17338 : see whether the pthread_atfork exists
17340 #include <pthread.h>
17343 #ifdef PTHREAD_ATFORK
17344 pthread_atfork(NULL,NULL,NULL);
17349 : see if pthread_atfork exists
17350 set try -DPTHREAD_ATFORK
17351 if eval $compile; then
17356 case "$usethreads" in
17359 $define) echo 'pthread_atfork found.' >&4 ;;
17360 *) echo 'pthread_atfork NOT found.' >&4 ;;
17363 set d_pthread_atfork
17366 : see if pthread_attr_setscope exists
17367 set pthread_attr_setscope d_pthread_attr_setscope
17370 : see whether the various POSIXish _yields exist
17372 #include <pthread.h>
17378 #ifdef PTHREAD_YIELD
17381 #ifdef PTHREAD_YIELD_NULL
17382 pthread_yield(NULL);
17388 : see if sched_yield exists
17389 set try -DSCHED_YIELD
17390 if eval $compile; then
17392 sched_yield='sched_yield()'
17396 case "$usethreads" in
17399 $define) echo 'sched_yield() found.' >&4 ;;
17400 *) echo 'sched_yield() NOT found.' >&4 ;;
17406 : see if pthread_yield exists
17407 set try -DPTHREAD_YIELD
17408 if eval $compile; then
17410 case "$sched_yield" in
17411 '') sched_yield='pthread_yield()' ;;
17414 set try -DPTHREAD_YIELD_NULL
17415 if eval $compile; then
17417 case "$sched_yield" in
17418 '') sched_yield='pthread_yield(NULL)' ;;
17424 case "$usethreads" in
17427 $define) echo 'pthread_yield() found.' >&4 ;;
17428 *) echo 'pthread_yield() NOT found.' >&4 ;;
17432 set d_pthread_yield
17434 case "$sched_yield" in
17435 '') sched_yield=undef ;;
17439 : check for ptrdiff_t
17441 echo "Checking to see if you have ptrdiff_t..." >&4
17443 #include <stddef.h>
17444 int main() { ptrdiff_t x = 7; }
17447 if eval $compile; then
17449 echo "You have ptrdiff_t."
17452 echo "You do not have ptrdiff_t."
17458 : see if random_r exists
17459 set random_r d_random_r
17461 case "$d_random_r" in
17463 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17464 case "$d_random_r_proto:$usethreads" in
17465 ":define") d_random_r_proto=define
17466 set d_random_r_proto random_r $hdrs
17470 case "$d_random_r_proto" in
17472 case "$random_r_proto" in
17473 ''|0) try='int random_r(int*, struct random_data*);'
17474 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17476 case "$random_r_proto" in
17477 ''|0) try='int random_r(long*, struct random_data*);'
17478 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17480 case "$random_r_proto" in
17481 ''|0) try='int random_r(struct random_data*, int32_t*);'
17482 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17484 case "$random_r_proto" in
17485 ''|0) d_random_r=undef
17487 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17488 * ) case "$random_r_proto" in
17489 REENTRANT_PROTO*) ;;
17490 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17492 echo "Prototype: $try" ;;
17495 *) case "$usethreads" in
17496 define) echo "random_r has no prototype, not using it." >&4 ;;
17503 *) random_r_proto=0
17507 : see if readdir and friends exist
17508 set readdir d_readdir
17510 set seekdir d_seekdir
17512 set telldir d_telldir
17514 set rewinddir d_rewinddir
17517 : see if readdir64_r exists
17518 set readdir64_r d_readdir64_r
17520 case "$d_readdir64_r" in
17522 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17523 case "$d_readdir64_r_proto:$usethreads" in
17524 ":define") d_readdir64_r_proto=define
17525 set d_readdir64_r_proto readdir64_r $hdrs
17529 case "$d_readdir64_r_proto" in
17531 case "$readdir64_r_proto" in
17532 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17533 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17535 case "$readdir64_r_proto" in
17536 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17537 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17539 case "$readdir64_r_proto" in
17540 ''|0) d_readdir64_r=undef
17541 readdir64_r_proto=0
17542 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17543 * ) case "$readdir64_r_proto" in
17544 REENTRANT_PROTO*) ;;
17545 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17547 echo "Prototype: $try" ;;
17550 *) case "$usethreads" in
17551 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17553 d_readdir64_r=undef
17554 readdir64_r_proto=0
17558 *) readdir64_r_proto=0
17562 : see if readdir_r exists
17563 set readdir_r d_readdir_r
17565 case "$d_readdir_r" in
17567 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17568 case "$d_readdir_r_proto:$usethreads" in
17569 ":define") d_readdir_r_proto=define
17570 set d_readdir_r_proto readdir_r $hdrs
17574 case "$d_readdir_r_proto" in
17576 case "$readdir_r_proto" in
17577 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17578 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17580 case "$readdir_r_proto" in
17581 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17582 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17584 case "$readdir_r_proto" in
17585 ''|0) d_readdir_r=undef
17587 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17588 * ) case "$readdir_r_proto" in
17589 REENTRANT_PROTO*) ;;
17590 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17592 echo "Prototype: $try" ;;
17595 *) case "$usethreads" in
17596 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17603 *) readdir_r_proto=0
17607 : see if readv exists
17611 : see if recvmsg exists
17612 set recvmsg d_recvmsg
17615 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17617 if set regcomp val -f d_regcomp; eval $csym; $val; then
17618 echo 'regcomp() found.' >&4
17619 d_regcomp="$define"
17622 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17623 echo 'regcmp() found.' >&4
17627 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17628 echo 're_comp() found, assuming re_exec() also exists.' >&4
17629 d_re_comp="$define"
17634 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17641 : see if remainder exists
17642 set remainder d_remainder
17645 : see if remquo exists
17646 set remquo d_remquo
17649 : see if rename exists
17650 set rename d_rename
17653 : see if rint exists
17657 : see if rmdir exists
17661 : see if round exists
17665 : see if memory.h is available.
17670 : See if it conflicts with string.h
17676 $cppstdin $cppflags $cppminus < $strings > mem.h
17677 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17679 echo "We won't be including <memory.h>."
17689 : can bcopy handle overlapping blocks?
17692 case "$d_memmove" in
17693 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17694 *) case "$d_bcopy" in
17696 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17698 #$i_memory I_MEMORY
17699 #$i_stdlib I_STDLIB
17700 #$i_string I_STRING
17701 #$i_unistd I_UNISTD
17703 $cat >>try.c <<'EOCP'
17706 # include <memory.h>
17709 # include <stdlib.h>
17712 # include <string.h>
17714 # include <strings.h>
17717 # include <unistd.h> /* Needed for NetBSD */
17721 char buf[128], abc[128];
17727 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17728 try to store the string in read-only memory. */
17729 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17731 for (align = 7; align >= 0; align--) {
17732 for (len = 36; len; len--) {
17734 bcopy(abc, b, len);
17735 for (off = 1; off <= len; off++) {
17736 bcopy(b, b+off, len);
17737 bcopy(b+off, b, len);
17738 if (bcmp(b, abc, len))
17747 if eval $compile_ok; then
17748 if $run ./try 2>/dev/null; then
17749 echo "Yes, it can."
17752 echo "It can't, sorry."
17755 echo "(I can't compile the test program, so we'll assume not...)"
17765 : can memcpy handle overlapping blocks?
17768 case "$d_memmove" in
17769 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17770 *) case "$d_memcpy" in
17772 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17774 #$i_memory I_MEMORY
17775 #$i_stdlib I_STDLIB
17776 #$i_string I_STRING
17777 #$i_unistd I_UNISTD
17779 $cat >>try.c <<'EOCP'
17782 # include <memory.h>
17785 # include <stdlib.h>
17788 # include <string.h>
17790 # include <strings.h>
17793 # include <unistd.h> /* Needed for NetBSD */
17797 char buf[128], abc[128];
17803 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17804 try to store the string in read-only memory. */
17805 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17807 for (align = 7; align >= 0; align--) {
17808 for (len = 36; len; len--) {
17810 memcpy(b, abc, len);
17811 for (off = 1; off <= len; off++) {
17812 memcpy(b+off, b, len);
17813 memcpy(b, b+off, len);
17814 if (memcmp(b, abc, len))
17823 if eval $compile_ok; then
17824 if $run ./try 2>/dev/null; then
17825 echo "Yes, it can."
17828 echo "It can't, sorry."
17831 echo "(I can't compile the test program, so we'll assume not...)"
17841 : can memcmp be trusted to compare relative magnitude?
17843 case "$d_memcmp" in
17846 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17848 #$i_memory I_MEMORY
17849 #$i_stdlib I_STDLIB
17850 #$i_string I_STRING
17851 #$i_unistd I_UNISTD
17853 $cat >>try.c <<'EOCP'
17856 # include <memory.h>
17859 # include <stdlib.h>
17862 # include <string.h>
17864 # include <strings.h>
17867 # include <unistd.h> /* Needed for NetBSD */
17873 if ((a < b) && memcmp(&a, &b, 1) < 0)
17879 if eval $compile_ok; then
17880 if $run ./try 2>/dev/null; then
17881 echo "Yes, it can."
17884 echo "No, it can't (it uses signed chars)."
17887 echo "(I can't compile the test program, so we'll assume not...)"
17895 : see if prototype for sbrk is available
17897 set d_sbrkproto sbrk $i_unistd unistd.h
17900 : see if scalbn exists
17901 set scalbn d_scalbn
17904 : see if select exists
17905 set select d_select
17908 : see if semctl exists
17909 set semctl d_semctl
17912 : see if semget exists
17913 set semget d_semget
17916 : see if semop exists
17920 : see how much of the 'sem*(2)' library is present.
17923 case "$d_semctl$d_semget$d_semop" in
17924 *"$undef"*) h_sem=false;;
17928 case "`ipcs 2>&1`" in
17929 "SVID messages"*"not configured"*)
17930 echo "Your $osname does not have the sem*(2) configured." >&4
17933 set semctl d_semctl
17935 set semget d_semget
17943 : we could also check for sys/ipc.h ...
17944 if $h_sem && $test `./findhdr sys/sem.h`; then
17945 echo "You have the full sem*(2) library." >&4
17948 echo "You don't have the full sem*(2) library." >&4
17954 : see whether sys/sem.h defines union semun
17956 $cat > try.c <<'END'
17957 #include <sys/types.h>
17958 #include <sys/ipc.h>
17959 #include <sys/sem.h>
17960 int main () { union semun semun; semun.buf = 0; }
17963 if eval $compile; then
17964 echo "You have union semun in <sys/sem.h>." >&4
17967 echo "You do not have union semun in <sys/sem.h>." >&4
17974 : see how to do semctl IPC_STAT
17978 $cat > tryh.h <<END
17981 # define S_IRUSR S_IREAD
17982 # define S_IWUSR S_IWRITE
17983 # define S_IXUSR S_IEXEC
17985 # define S_IRUSR 0400
17986 # define S_IWUSR 0200
17987 # define S_IXUSR 0100
17989 # define S_IRGRP (S_IRUSR>>3)
17990 # define S_IWGRP (S_IWUSR>>3)
17991 # define S_IXGRP (S_IXUSR>>3)
17992 # define S_IROTH (S_IRUSR>>6)
17993 # define S_IWOTH (S_IWUSR>>6)
17994 # define S_IXOTH (S_IXUSR>>6)
17997 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17998 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17999 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18002 : see whether semctl IPC_STAT can use union semun
18003 case "$d_semctl_semun" in
18007 #include <sys/types.h>
18008 #include <sys/ipc.h>
18009 #include <sys/sem.h>
18010 #include <sys/stat.h>
18017 #$d_union_semun HAS_UNION_SEMUN
18020 #ifndef HAS_UNION_SEMUN
18023 struct semid_ds *buf;
18024 unsigned short *array;
18030 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18031 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18033 struct semid_ds argbuf;
18036 st = semctl(sem, 0, IPC_STAT, arg);
18040 # endif /* IPC_STAT */
18041 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18043 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18044 # endif /* IPC_RMID */
18045 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18047 #endif /* IPC_PRIVATE && ... */
18048 printf("semget failed: errno = %d\n", errno);
18053 if eval $compile; then
18056 semun) val="$define" ;;
18064 case "$d_semctl_semun" in
18066 echo "You can use union semun for semctl IPC_STAT." >&4
18069 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18074 : see whether semctl IPC_STAT can use struct semid_ds pointer
18075 case "$d_semctl_semid_ds" in
18078 $cat > try.c <<'END'
18079 #include <sys/types.h>
18080 #include <sys/ipc.h>
18081 #include <sys/sem.h>
18082 #include <sys/stat.h>
18090 struct semid_ds arg;
18093 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18094 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18097 st = semctl(sem, 0, IPC_STAT, &arg);
18099 printf("semid_ds\n");
18101 # endif /* IPC_STAT */
18102 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18104 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18105 # endif /* IPC_RMID */
18106 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18108 #endif /* IPC_PRIVATE && ... */
18109 printf("semget failed: errno = %d\n", errno);
18115 if eval $compile; then
18118 semid_ds) val="$define" ;;
18122 set d_semctl_semid_ds
18126 case "$d_semctl_semid_ds" in
18128 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18130 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18136 # We do not have the full sem*(2) library, so assume we can not
18142 set d_semctl_semid_ds
18148 : see if sendmsg exists
18149 set sendmsg d_sendmsg
18152 : see if setegid exists
18153 set setegid d_setegid
18156 : see if seteuid exists
18157 set seteuid d_seteuid
18160 : see if setgrent exists
18161 set setgrent d_setgrent
18164 : see if setgrent_r exists
18165 set setgrent_r d_setgrent_r
18167 case "$d_setgrent_r" in
18169 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18170 case "$d_setgrent_r_proto:$usethreads" in
18171 ":define") d_setgrent_r_proto=define
18172 set d_setgrent_r_proto setgrent_r $hdrs
18176 case "$d_setgrent_r_proto" in
18178 case "$setgrent_r_proto" in
18179 ''|0) try='int setgrent_r(FILE**);'
18180 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18182 case "$setgrent_r_proto" in
18183 ''|0) try='void setgrent_r(FILE**);'
18184 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18186 case "$setgrent_r_proto" in
18187 ''|0) d_setgrent_r=undef
18189 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18190 * ) case "$setgrent_r_proto" in
18191 REENTRANT_PROTO*) ;;
18192 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18194 echo "Prototype: $try" ;;
18197 *) case "$usethreads" in
18198 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18205 *) setgrent_r_proto=0
18209 : see if sethostent exists
18210 set sethostent d_sethent
18213 : see if sethostent_r exists
18214 set sethostent_r d_sethostent_r
18216 case "$d_sethostent_r" in
18218 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18219 case "$d_sethostent_r_proto:$usethreads" in
18220 ":define") d_sethostent_r_proto=define
18221 set d_sethostent_r_proto sethostent_r $hdrs
18225 case "$d_sethostent_r_proto" in
18227 case "$sethostent_r_proto" in
18228 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18229 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18231 case "$sethostent_r_proto" in
18232 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18233 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18235 case "$sethostent_r_proto" in
18236 ''|0) d_sethostent_r=undef
18237 sethostent_r_proto=0
18238 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18239 * ) case "$sethostent_r_proto" in
18240 REENTRANT_PROTO*) ;;
18241 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18243 echo "Prototype: $try" ;;
18246 *) case "$usethreads" in
18247 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18249 d_sethostent_r=undef
18250 sethostent_r_proto=0
18254 *) sethostent_r_proto=0
18258 : see if setitimer exists
18259 set setitimer d_setitimer
18262 : see if setlinebuf exists
18263 set setlinebuf d_setlinebuf
18266 : see if setlocale exists
18267 set setlocale d_setlocale
18270 : see if locale.h is available
18271 set locale.h i_locale
18274 : see if setlocale_r exists
18275 set setlocale_r d_setlocale_r
18277 case "$d_setlocale_r" in
18279 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18280 case "$d_setlocale_r_proto:$usethreads" in
18281 ":define") d_setlocale_r_proto=define
18282 set d_setlocale_r_proto setlocale_r $hdrs
18286 case "$d_setlocale_r_proto" in
18288 case "$setlocale_r_proto" in
18289 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18290 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18292 case "$setlocale_r_proto" in
18293 ''|0) d_setlocale_r=undef
18294 setlocale_r_proto=0
18295 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18296 * ) case "$setlocale_r_proto" in
18297 REENTRANT_PROTO*) ;;
18298 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18300 echo "Prototype: $try" ;;
18303 *) case "$usethreads" in
18304 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18306 d_setlocale_r=undef
18307 setlocale_r_proto=0
18311 *) setlocale_r_proto=0
18315 : see if setnetent exists
18316 set setnetent d_setnent
18319 : see if setnetent_r exists
18320 set setnetent_r d_setnetent_r
18322 case "$d_setnetent_r" in
18324 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18325 case "$d_setnetent_r_proto:$usethreads" in
18326 ":define") d_setnetent_r_proto=define
18327 set d_setnetent_r_proto setnetent_r $hdrs
18331 case "$d_setnetent_r_proto" in
18333 case "$setnetent_r_proto" in
18334 ''|0) try='int setnetent_r(int, struct netent_data*);'
18335 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18337 case "$setnetent_r_proto" in
18338 ''|0) try='void setnetent_r(int, struct netent_data*);'
18339 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18341 case "$setnetent_r_proto" in
18342 ''|0) d_setnetent_r=undef
18343 setnetent_r_proto=0
18344 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18345 * ) case "$setnetent_r_proto" in
18346 REENTRANT_PROTO*) ;;
18347 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18349 echo "Prototype: $try" ;;
18352 *) case "$usethreads" in
18353 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18355 d_setnetent_r=undef
18356 setnetent_r_proto=0
18360 *) setnetent_r_proto=0
18364 : see if setprotoent exists
18365 set setprotoent d_setpent
18368 : see if setpgid exists
18369 set setpgid d_setpgid
18372 : see if setpgrp2 exists
18373 set setpgrp2 d_setpgrp2
18376 : see if setpriority exists
18377 set setpriority d_setprior
18380 : see if setproctitle exists
18381 set setproctitle d_setproctitle
18384 : see if setprotoent_r exists
18385 set setprotoent_r d_setprotoent_r
18387 case "$d_setprotoent_r" in
18389 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18390 case "$d_setprotoent_r_proto:$usethreads" in
18391 ":define") d_setprotoent_r_proto=define
18392 set d_setprotoent_r_proto setprotoent_r $hdrs
18396 case "$d_setprotoent_r_proto" in
18398 case "$setprotoent_r_proto" in
18399 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18400 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18402 case "$setprotoent_r_proto" in
18403 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18404 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18406 case "$setprotoent_r_proto" in
18407 ''|0) d_setprotoent_r=undef
18408 setprotoent_r_proto=0
18409 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18410 * ) case "$setprotoent_r_proto" in
18411 REENTRANT_PROTO*) ;;
18412 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18414 echo "Prototype: $try" ;;
18417 *) case "$usethreads" in
18418 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18420 d_setprotoent_r=undef
18421 setprotoent_r_proto=0
18425 *) setprotoent_r_proto=0
18429 : see if setpwent exists
18430 set setpwent d_setpwent
18433 : see if setpwent_r exists
18434 set setpwent_r d_setpwent_r
18436 case "$d_setpwent_r" in
18438 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18439 case "$d_setpwent_r_proto:$usethreads" in
18440 ":define") d_setpwent_r_proto=define
18441 set d_setpwent_r_proto setpwent_r $hdrs
18445 case "$d_setpwent_r_proto" in
18447 case "$setpwent_r_proto" in
18448 ''|0) try='int setpwent_r(FILE**);'
18449 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18451 case "$setpwent_r_proto" in
18452 ''|0) try='void setpwent_r(FILE**);'
18453 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18455 case "$setpwent_r_proto" in
18456 ''|0) d_setpwent_r=undef
18458 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18459 * ) case "$setpwent_r_proto" in
18460 REENTRANT_PROTO*) ;;
18461 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18463 echo "Prototype: $try" ;;
18466 *) case "$usethreads" in
18467 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18474 *) setpwent_r_proto=0
18478 : see if setregid exists
18479 set setregid d_setregid
18481 set setresgid d_setresgid
18484 : see if setreuid exists
18485 set setreuid d_setreuid
18487 set setresuid d_setresuid
18490 : see if setrgid exists
18491 set setrgid d_setrgid
18494 : see if setruid exists
18495 set setruid d_setruid
18498 : see if setservent exists
18499 set setservent d_setsent
18502 : see if setservent_r exists
18503 set setservent_r d_setservent_r
18505 case "$d_setservent_r" in
18507 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18508 case "$d_setservent_r_proto:$usethreads" in
18509 ":define") d_setservent_r_proto=define
18510 set d_setservent_r_proto setservent_r $hdrs
18514 case "$d_setservent_r_proto" in
18516 case "$setservent_r_proto" in
18517 ''|0) try='int setservent_r(int, struct servent_data*);'
18518 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18520 case "$setservent_r_proto" in
18521 ''|0) try='void setservent_r(int, struct servent_data*);'
18522 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18524 case "$setservent_r_proto" in
18525 ''|0) d_setservent_r=undef
18526 setservent_r_proto=0
18527 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18528 * ) case "$setservent_r_proto" in
18529 REENTRANT_PROTO*) ;;
18530 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18532 echo "Prototype: $try" ;;
18535 *) case "$usethreads" in
18536 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18538 d_setservent_r=undef
18539 setservent_r_proto=0
18543 *) setservent_r_proto=0
18547 : see if setsid exists
18548 set setsid d_setsid
18551 : see if setvbuf exists
18552 set setvbuf d_setvbuf
18555 : see if shmctl exists
18556 set shmctl d_shmctl
18559 : see if shmget exists
18560 set shmget d_shmget
18563 : see if shmat exists
18566 : see what shmat returns
18569 $cat >shmat.c <<'END'
18570 #include <sys/shm.h>
18573 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18578 echo "and it returns ($shmattype)." >&4
18579 : see if a prototype for shmat is available
18580 xxx=`./findhdr sys/shm.h`
18581 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18582 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18593 set d_shmatprototype
18596 : see if shmdt exists
18600 : see how much of the 'shm*(2)' library is present.
18603 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18604 *"$undef"*) h_shm=false;;
18608 case "`ipcs 2>&1`" in
18609 "SVID shared memory"*"not configured"*)
18610 echo "Your $osname does not have the shm*(2) configured." >&4
18613 set shmctl d_shmctl
18615 set shmget d_shmget
18625 : we could also check for sys/ipc.h ...
18626 if $h_shm && $test `./findhdr sys/shm.h`; then
18627 echo "You have the full shm*(2) library." >&4
18630 echo "You don't have the full shm*(2) library." >&4
18636 : see if we have sigaction
18638 if set sigaction val -f d_sigaction; eval $csym; $val; then
18639 echo 'sigaction() found.' >&4
18642 #include <sys/types.h>
18643 #include <signal.h>
18644 #$i_stdlib I_STDLIB
18646 #include <stdlib.h>
18650 struct sigaction act, oact;
18652 oact.sa_handler = 0;
18653 /* so that act and oact are used */
18654 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18658 if eval $compile_ok; then
18661 echo "But you don't seem to have a usable struct sigaction." >&4
18665 echo 'sigaction NOT found.' >&4
18668 set d_sigaction; eval $setvar
18671 : see if this is a sunmath.h system
18672 set sunmath.h i_sunmath
18675 : see if signbit exists
18676 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18679 #$i_sunmath I_SUNMATH
18683 #ifdef I_SUNMATH /* Solaris special math library */
18684 # include <sunmath.h>
18687 int main(int argc, char **argv)
18691 if ((signbit(x) == 0) && (signbit(y) != 0))
18699 if eval $compile; then
18700 if $run ./try; then
18704 $echo "Signbit seems to be available, but doesn't work as I expected."
18705 $echo "I won't use it." >&4
18716 : see if sigprocmask exists
18717 set sigprocmask d_sigprocmask
18720 : see if sigsetjmp exists
18722 case "$d_sigsetjmp" in
18725 #include <setjmp.h>
18726 #$i_stdlib I_STDLIB
18728 #include <stdlib.h>
18734 if (sigsetjmp(env,1))
18737 siglongjmp(env, 1);
18742 if eval $compile; then
18743 if $run ./try >/dev/null 2>&1; then
18744 echo "POSIX sigsetjmp found." >&4
18748 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18754 echo "sigsetjmp not found." >&4
18758 *) val="$d_sigsetjmp"
18759 case "$d_sigsetjmp" in
18760 $define) echo "POSIX sigsetjmp found." >&4;;
18761 $undef) echo "sigsetjmp not found." >&4;;
18769 : see if snprintf exists
18770 set snprintf d_snprintf
18773 : see if vsnprintf exists
18774 set vsnprintf d_vsnprintf
18777 case "$d_snprintf-$d_vsnprintf" in
18780 Checking whether your snprintf() and vsnprintf() work okay...
18782 $cat >try.c <<'EOCP'
18783 /* v?snprintf testing logic courtesy of Russ Allbery.
18784 * According to C99:
18785 * - if the buffer is too short it still must be \0-terminated
18786 * - if the buffer is too short the potentially required length
18787 * must be returned and not -1
18788 * - if the buffer is NULL the potentially required length
18789 * must be returned and not -1 or core dump
18792 #include <stdarg.h>
18796 int test (char *format, ...)
18801 va_start (args, format);
18802 count = vsnprintf (buf, sizeof buf, format, args);
18809 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18810 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18814 if eval $compile; then
18817 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18819 Your snprintf() and snprintf() don't seem to be working okay.
18821 d_snprintf="$undef"
18822 d_vsnprintf="$undef"
18826 echo "(I can't seem to compile the test program--assuming they don't)"
18827 d_snprintf="$undef"
18828 d_vsnprintf="$undef"
18834 : see if sockatmark exists
18835 set sockatmark d_sockatmark
18838 : see if prototype for sockatmark is available
18840 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18843 : see if socks5_init exists
18844 set socks5_init d_socks5_init
18847 : see if sprintf returns the length of the string in the buffer as per ANSI
18848 $echo "Checking whether sprintf returns the length of the string..." >&4
18851 #$i_stdlib I_STDLIB
18853 #include <stdlib.h>
18855 #$i_string I_STRING
18857 # include <string.h>
18859 # include <strings.h>
18868 int check (size_t expect, int test) {
18869 size_t got = strlen(buffer);
18873 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18878 int main(int argc, char **argv) {
18881 check(sprintf(buffer, ""), ++test);
18882 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18883 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18890 if eval $compile; then
18894 sprintf returns the length of the string (as ANSI says it should)
18896 d_sprintf_returns_strlen="$define"
18899 sprintf does not return the length of the string (how old is this system?)
18901 d_sprintf_returns_strlen="$undef"
18905 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18906 d_sprintf_returns_strlen="$undef"
18910 : see if srand48_r exists
18911 set srand48_r d_srand48_r
18913 case "$d_srand48_r" in
18915 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18916 case "$d_srand48_r_proto:$usethreads" in
18917 ":define") d_srand48_r_proto=define
18918 set d_srand48_r_proto srand48_r $hdrs
18922 case "$d_srand48_r_proto" in
18924 case "$srand48_r_proto" in
18925 ''|0) try='int srand48_r(long, struct drand48_data*);'
18926 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18928 case "$srand48_r_proto" in
18929 ''|0) d_srand48_r=undef
18931 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18932 * ) case "$srand48_r_proto" in
18933 REENTRANT_PROTO*) ;;
18934 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18936 echo "Prototype: $try" ;;
18939 *) case "$usethreads" in
18940 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18947 *) srand48_r_proto=0
18951 : see if srandom_r exists
18952 set srandom_r d_srandom_r
18954 case "$d_srandom_r" in
18956 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18957 case "$d_srandom_r_proto:$usethreads" in
18958 ":define") d_srandom_r_proto=define
18959 set d_srandom_r_proto srandom_r $hdrs
18963 case "$d_srandom_r_proto" in
18965 case "$srandom_r_proto" in
18966 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18967 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18969 case "$srandom_r_proto" in
18970 ''|0) d_srandom_r=undef
18972 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18973 * ) case "$srandom_r_proto" in
18974 REENTRANT_PROTO*) ;;
18975 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18977 echo "Prototype: $try" ;;
18980 *) case "$usethreads" in
18981 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18988 *) srandom_r_proto=0
18992 : see if prototype for setresgid is available
18994 set d_sresgproto setresgid $i_unistd unistd.h
18997 : see if prototype for setresuid is available
18999 set d_sresuproto setresuid $i_unistd unistd.h
19002 : see if stat exists
19006 : see if sys/stat.h is available
19007 set sys/stat.h i_sysstat
19010 : see if stat knows about block sizes
19012 echo "Checking to see if your struct stat has st_blocks field..." >&4
19013 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19016 : see if this is a sys/vfs.h system
19017 set sys/vfs.h i_sysvfs
19020 : see if this is a sys/statfs.h system
19021 set sys/statfs.h i_sysstatfs
19024 : Check for statfs_s
19026 echo "Checking to see if your system supports struct statfs..." >&4
19027 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
19029 case "$d_statfs_s" in
19030 "$define") echo "Yes, it does." ;;
19031 *) echo "No, it doesn't." ;;
19035 : see if struct statfs knows about f_flags
19036 case "$d_statfs_s" in
19039 echo "Checking to see if your struct statfs has f_flags field..." >&4
19040 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
19044 set d_statfs_f_flags
19048 case "$d_statfs_f_flags" in
19049 "$define") echo "Yes, it does." ;;
19050 *) echo "No, it doesn't." ;;
19053 : see what flavor, if any, of static inline is supported
19055 echo "Checking to see if your system supports static inline..."
19056 $cat > try.c <<'EOCP'
19057 #include <stdlib.h>
19058 extern int f_via_a(int x);
19059 extern int f_via_b(int x);
19060 int main(int argc, char **argv)
19069 return EXIT_SUCCESS;
19072 return EXIT_FAILURE;
19076 $cat > a.c <<'EOCP'
19077 static INLINE int f(int x) {
19088 $cat > b.c <<'EOCP'
19089 extern int f(int x);
19097 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19098 case "$perl_static_inline" in
19099 '') # Check the various possibilities, and break out on success.
19100 # For gcc, prefer __inline__, which will still permit
19101 # cflags.SH to add in -ansi.
19102 case "$gccversion" in
19103 '') xxx="inline __inline__ __inline _inline";;
19104 *) xxx="__inline__ inline __inline _inline";;
19106 for inline in $xxx; do
19107 set try -DINLINE=$inline a.c
19108 if eval $compile && $run ./try; then
19109 # Now make sure there is no external linkage of static
19111 set try -DINLINE=$inline -DUSE_B a.c b.c
19112 if eval $compile && $run ./try; then
19113 $echo "Your compiler supports static $inline, " >&4
19114 $echo "but it also creates an external definition," >&4
19115 $echo "so I won't use it." >&4
19118 $echo "Your compiler supports static $inline." >&4
19120 perl_static_inline="static $inline";
19124 $echo "Your compiler does NOT support static $inline." >&4
19129 *inline*) # Some variant of inline exists.
19130 echo "Keeping your $hint value of $perl_static_inline."
19133 static) # No inline capabilities
19134 echo "Keeping your $hint value of $perl_static_inline."
19137 *) # Unrecognized previous value -- blindly trust the supplied
19138 # value and hope it makes sense. Use old value for
19139 # d_static_inline, if there is one.
19140 echo "Keeping your $hint value of $perl_static_inline."
19141 case "$d_static_inline" in
19143 *) val=$d_static_inline ;;
19147 # Fallback to plain 'static' if nothing worked.
19148 case "$perl_static_inline" in
19150 perl_static_inline="static"
19154 set d_static_inline
19156 $rm -f a.[co] b.[co]
19159 : Check stream access
19161 Checking how to access stdio streams by file descriptor number...
19163 case "$stdio_stream_array" in
19164 '') $cat >try.c <<EOCP
19167 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19171 for s in _iob __iob __sF
19173 set try -DSTDIO_STREAM_ARRAY=$s
19174 if eval $compile; then
19175 case "`$run ./try`" in
19176 yes) stdio_stream_array=$s; break ;;
19182 case "$stdio_stream_array" in
19184 I can't figure out how to access stdio streams by file descriptor number.
19186 d_stdio_stream_array="$undef"
19189 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19191 d_stdio_stream_array="$define"
19195 : see if strcoll exists
19196 set strcoll d_strcoll
19199 : check for structure copying
19201 echo "Checking to see if your C compiler can copy structs..." >&4
19202 $cat >try.c <<'EOCP'
19212 if $cc -c try.c >/dev/null 2>&1 ; then
19214 echo "Yup, it can."
19217 echo "Nope, it can't."
19223 : see if strerror and/or sys_errlist[] exist
19225 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19226 if set strerror val -f d_strerror; eval $csym; $val; then
19227 echo 'strerror() found.' >&4
19228 d_strerror="$define"
19229 d_strerrm='strerror(e)'
19230 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19231 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19232 d_syserrlst="$define"
19234 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19235 d_syserrlst="$undef"
19237 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19238 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19239 echo 'strerror() found in string header.' >&4
19240 d_strerror="$define"
19241 d_strerrm='strerror(e)'
19242 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19243 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19244 d_syserrlst="$define"
19246 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19247 d_syserrlst="$undef"
19249 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19250 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19251 d_strerror="$undef"
19252 d_syserrlst="$define"
19253 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19255 echo 'strerror() and sys_errlist[] NOT found.' >&4
19256 d_strerror="$undef"
19257 d_syserrlst="$undef"
19258 d_strerrm='"unknown"'
19262 : see if strerror_r exists
19263 set strerror_r d_strerror_r
19265 case "$d_strerror_r" in
19267 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19268 case "$d_strerror_r_proto:$usethreads" in
19269 ":define") d_strerror_r_proto=define
19270 set d_strerror_r_proto strerror_r $hdrs
19274 case "$d_strerror_r_proto" in
19276 case "$strerror_r_proto" in
19277 ''|0) try='int strerror_r(int, char*, size_t);'
19278 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19280 case "$strerror_r_proto" in
19281 ''|0) try='int strerror_r(int, char*, int);'
19282 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19284 case "$strerror_r_proto" in
19285 ''|0) try='char* strerror_r(int, char*, size_t);'
19286 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19288 case "$strerror_r_proto" in
19289 ''|0) d_strerror_r=undef
19291 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19292 * ) case "$strerror_r_proto" in
19293 REENTRANT_PROTO*) ;;
19294 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19296 echo "Prototype: $try" ;;
19299 *) case "$usethreads" in
19300 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19307 *) strerror_r_proto=0
19311 : see if strftime exists
19312 set strftime d_strftime
19315 : see if strlcat exists
19316 set strlcat d_strlcat
19319 : see if strlcpy exists
19320 set strlcpy d_strlcpy
19323 : see if strtod exists
19324 set strtod d_strtod
19327 : see if strtol exists
19328 set strtol d_strtol
19331 : see if strtold exists
19332 set strtold d_strtold
19335 : see if strtoll exists
19336 set strtoll d_strtoll
19339 case "$d_longlong-$d_strtoll" in
19342 Checking whether your strtoll() works okay...
19344 $cat >try.c <<'EOCP'
19347 #define strtoll __strtoll
19350 #define strtoll _strtoll
19353 extern long long int strtoll(char *s, char **, int);
19354 static int bad = 0;
19355 int check(char *s, long long ell, int een) {
19358 gll = strtoll(s, 0, 10);
19359 if (!((gll == ell) && (errno == een)))
19363 check(" 1", 1LL, 0);
19364 check(" 0", 0LL, 0);
19365 check("-1", -1LL, 0);
19366 check("-9223372036854775808", -9223372036854775808LL, 0);
19367 check("-9223372036854775808", -9223372036854775808LL, 0);
19368 check(" 9223372036854775807", 9223372036854775807LL, 0);
19369 check("-9223372036854775808", -9223372036854775808LL, 0);
19370 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19371 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19377 if eval $compile; then
19380 ok) echo "Your strtoll() seems to be working okay." ;;
19382 Your strtoll() doesn't seem to be working okay.
19388 echo "(I can't seem to compile the test program--assuming it doesn't)"
19394 : see if strtoq exists
19395 set strtoq d_strtoq
19398 : see if strtoul exists
19399 set strtoul d_strtoul
19402 case "$d_strtoul" in
19405 Checking whether your strtoul() works okay...
19407 $cat >try.c <<'EOCP'
19410 extern unsigned long int strtoul(char *s, char **, int);
19411 static int bad = 0;
19412 void check(char *s, unsigned long eul, int een) {
19415 gul = strtoul(s, 0, 10);
19416 if (!((gul == eul) && (errno == een)))
19420 check(" 1", 1L, 0);
19421 check(" 0", 0L, 0);
19423 case "$longsize" in
19425 $cat >>try.c <<'EOCP'
19426 check("18446744073709551615", 18446744073709551615UL, 0);
19427 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19428 #if 0 /* strtoul() for /^-/ strings is undefined. */
19429 check("-1", 18446744073709551615UL, 0);
19430 check("-18446744073709551614", 2, 0);
19431 check("-18446744073709551615", 1, 0);
19432 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19433 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19438 $cat >>try.c <<'EOCP'
19439 check("4294967295", 4294967295UL, 0);
19440 check("4294967296", 4294967295UL, ERANGE);
19441 #if 0 /* strtoul() for /^-/ strings is undefined. */
19442 check("-1", 4294967295UL, 0);
19443 check("-4294967294", 2, 0);
19444 check("-4294967295", 1, 0);
19445 check("-4294967296", 4294967295UL, ERANGE);
19446 check("-4294967297", 4294967295UL, ERANGE);
19451 : Should we write these tests to be more portable by sprintf-ing
19452 : ~0 and then manipulating that char string as input for strtol?
19455 $cat >>try.c <<'EOCP'
19462 if eval $compile; then
19463 case "`$run ./try`" in
19464 ok) echo "Your strtoul() seems to be working okay." ;;
19466 Your strtoul() doesn't seem to be working okay.
19472 echo "(I can't seem to compile the test program--assuming it doesn't)"
19478 : see if strtoull exists
19479 set strtoull d_strtoull
19482 case "$d_longlong-$d_strtoull" in
19485 Checking whether your strtoull() works okay...
19487 $cat >try.c <<'EOCP'
19490 #define strtoull __strtoull
19493 extern unsigned long long int strtoull(char *s, char **, int);
19494 static int bad = 0;
19495 int check(char *s, long long eull, int een) {
19498 gull = strtoull(s, 0, 10);
19499 if (!((gull == eull) && (errno == een)))
19503 check(" 1", 1LL, 0);
19504 check(" 0", 0LL, 0);
19505 check("18446744073709551615", 18446744073709551615ULL, 0);
19506 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19507 #if 0 /* strtoull() for /^-/ strings is undefined. */
19508 check("-1", 18446744073709551615ULL, 0);
19509 check("-18446744073709551614", 2LL, 0);
19510 check("-18446744073709551615", 1LL, 0);
19511 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19512 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19519 if eval $compile; then
19520 case "`$run ./try`" in
19521 ok) echo "Your strtoull() seems to be working okay." ;;
19523 Your strtoull() doesn't seem to be working okay.
19525 d_strtoull="$undef"
19529 echo "(I can't seem to compile the test program--assuming it doesn't)"
19530 d_strtoull="$undef"
19535 : see if strtouq exists
19536 set strtouq d_strtouq
19539 case "$d_strtouq" in
19542 Checking whether your strtouq() works okay...
19544 $cat >try.c <<'EOCP'
19547 extern unsigned long long int strtouq(char *s, char **, int);
19548 static int bad = 0;
19549 void check(char *s, unsigned long long eull, int een) {
19550 unsigned long long gull;
19552 gull = strtouq(s, 0, 10);
19553 if (!((gull == eull) && (errno == een)))
19557 check(" 1", 1LL, 0);
19558 check(" 0", 0LL, 0);
19559 check("18446744073709551615", 18446744073709551615ULL, 0);
19560 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19561 #if 0 /* strtouq() for /^-/ strings is undefined. */
19562 check("-1", 18446744073709551615ULL, 0);
19563 check("-18446744073709551614", 2LL, 0);
19564 check("-18446744073709551615", 1LL, 0);
19565 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19566 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19574 if eval $compile; then
19575 case "`$run ./try`" in
19576 ok) echo "Your strtouq() seems to be working okay." ;;
19578 Your strtouq() doesn't seem to be working okay.
19584 echo "(I can't seem to compile the test program--assuming it doesn't)"
19590 : see if strxfrm exists
19591 set strxfrm d_strxfrm
19594 : see if symlink exists
19595 set symlink d_symlink
19598 : see if syscall exists
19599 set syscall d_syscall
19602 : see if prototype for syscall is available
19604 set d_syscallproto syscall $i_unistd unistd.h
19607 : see if sysconf exists
19608 set sysconf d_sysconf
19611 : see if system exists
19612 set system d_system
19615 : see if tcgetpgrp exists
19616 set tcgetpgrp d_tcgetpgrp
19619 : see if tcsetpgrp exists
19620 set tcsetpgrp d_tcsetpgrp
19623 : see if prototype for telldir is available
19625 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19628 : see if tgamma exists
19629 set tgamma d_tgamma
19632 : see if time exists
19634 if test "X$d_time" = X -o X"$timetype" = X; then
19635 if set time val -f d_time; eval $csym; $val; then
19636 echo 'time() found.' >&4
19638 rp="What is the type returned by time() on this system?"
19639 set time_t timetype long stdio.h sys/types.h
19642 echo 'time() not found, hope that will do.' >&4
19650 : see if timegm exists
19651 set timegm d_timegm
19654 : see if this is a sys/times.h system
19655 set sys/times.h i_systimes
19658 : see if times exists
19660 if set times val -f d_times; eval $csym; $val; then
19661 echo 'times() found.' >&4
19664 case "$i_systimes" in
19665 "$define") inc='sys/times.h';;
19667 rp="What is the type returned by times() on this system?"
19668 set clock_t clocktype long stdio.h sys/types.h $inc
19671 echo 'times() NOT found, hope that will do.' >&4
19676 : see if tmpnam_r exists
19677 set tmpnam_r d_tmpnam_r
19679 case "$d_tmpnam_r" in
19681 hdrs="$i_systypes sys/types.h define stdio.h "
19682 case "$d_tmpnam_r_proto:$usethreads" in
19683 ":define") d_tmpnam_r_proto=define
19684 set d_tmpnam_r_proto tmpnam_r $hdrs
19688 case "$d_tmpnam_r_proto" in
19690 case "$tmpnam_r_proto" in
19691 ''|0) try='char* tmpnam_r(char*);'
19692 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19694 case "$tmpnam_r_proto" in
19695 ''|0) d_tmpnam_r=undef
19697 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19698 * ) case "$tmpnam_r_proto" in
19699 REENTRANT_PROTO*) ;;
19700 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19702 echo "Prototype: $try" ;;
19705 *) case "$usethreads" in
19706 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19713 *) tmpnam_r_proto=0
19717 : see if trunc exists
19721 : see if truncate exists
19722 set truncate d_truncate
19725 : see if ttyname_r exists
19726 set ttyname_r d_ttyname_r
19728 case "$d_ttyname_r" in
19730 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19731 case "$d_ttyname_r_proto:$usethreads" in
19732 ":define") d_ttyname_r_proto=define
19733 set d_ttyname_r_proto ttyname_r $hdrs
19737 case "$d_ttyname_r_proto" in
19739 case "$ttyname_r_proto" in
19740 ''|0) try='int ttyname_r(int, char*, size_t);'
19741 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19743 case "$ttyname_r_proto" in
19744 ''|0) try='int ttyname_r(int, char*, int);'
19745 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19747 case "$ttyname_r_proto" in
19748 ''|0) try='char* ttyname_r(int, char*, int);'
19749 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19751 case "$ttyname_r_proto" in
19752 ''|0) d_ttyname_r=undef
19754 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19755 * ) case "$ttyname_r_proto" in
19756 REENTRANT_PROTO*) ;;
19757 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19759 echo "Prototype: $try" ;;
19762 *) case "$usethreads" in
19763 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19770 *) ttyname_r_proto=0
19774 : see if tzname[] exists
19776 if set tzname val -a d_tzname; eval $csym; $val; then
19778 echo 'tzname[] found.' >&4
19781 echo 'tzname[] NOT found.' >&4
19786 : Check if is a multiplatform env
19788 darwin) multiarch="$define" ;;
19790 case "$multiarch" in
19791 ''|[nN]*) multiarch="$undef" ;;
19794 : check for ordering of bytes in a UV
19796 case "$multiarch" in
19799 You seem to be doing a multiarchitecture build,
19800 skipping the byteorder check.
19806 case "$byteorder" in
19809 In the following, larger digits indicate more significance. A big-endian
19810 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19811 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19812 machines may have weird orders like 3412. A Cray will report 87654321,
19813 an Alpha will report 12345678. If the test program works the default is
19815 I'm now running the test program...
19819 #$i_stdlib I_STDLIB
19821 #include <stdlib.h>
19823 #include <sys/types.h>
19824 typedef $uvtype UV;
19834 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19836 u.l = (UV)0x04030201;
19837 for (i = 0; i < $uvsize; i++)
19838 printf("%c", u.c[i]+'0');
19845 if eval $compile && $run ./try > /dev/null; then
19848 [1-4][1-4][1-4][1-4]|12345678|87654321)
19849 echo "(The test program ran ok.)"
19850 echo "byteorder=$dflt"
19853 ????|????????) echo "(The test program ran ok.)" ;;
19854 *) echo "(The test program didn't run right for some reason.)" ;;
19859 (I can't seem to compile the test program. Guessing big-endian...)
19862 case "$xxx_prompt" in
19864 rp="What is the order of bytes in $uvtype?"
19877 : Checking 32bit alignedness
19880 Checking to see whether you can access character data unalignedly...
19882 case "$d_u32align" in
19883 '') $cat >try.c <<EOCP
19885 #$i_stdlib I_STDLIB
19887 #include <stdlib.h>
19889 #define U32 $u32type
19890 #define BYTEORDER 0x$byteorder
19892 #include <signal.h>
19894 $signal_t bletch(int s) { exit(4); }
19897 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19898 volatile U8 buf[8];
19902 if (sizeof(U32) != 4) {
19903 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19910 signal(SIGBUS, bletch);
19922 for (i = 0; i < 4; i++) {
19923 up = (U32*)(buf + i);
19924 if (! ((*up == 1 << (8*i)) || /* big-endian */
19925 (*up == 1 << (8*(3-i))) /* little-endian */
19929 printf("read failed (%x)\n", *up);
19935 for (i = 0; i < 4; i++) {
19936 up = (U32*)(buf + i);
19938 if (*up != 0xBeef) {
19939 printf("write failed (%x)\n", *up);
19953 if eval $compile_ok; then
19954 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19955 $run ./try 2>&1 >/dev/null
19958 You can access character data pretty unalignedly.
19960 d_u32align="$undef"
19963 It seems that you must access character data in an aligned manner.
19965 d_u32align="$define"
19969 rp='Can you access character data at unaligned addresses?'
19973 [yY]*) d_u32align="$undef" ;;
19974 *) d_u32align="$define" ;;
19981 : see if ualarm exists
19982 set ualarm d_ualarm
19985 : see if umask exists
19989 : see if unordered exists
19990 set unordered d_unordered
19993 : see if unsetenv exists
19994 set unsetenv d_unsetenv
19997 : see if usleep exists
19998 set usleep d_usleep
20001 : see if prototype for usleep is available
20003 set d_usleepproto usleep $i_unistd unistd.h
20006 : see if ustat exists
20010 : see if closedir exists
20011 set closedir d_closedir
20014 case "$d_closedir" in
20017 echo "Checking whether closedir() returns a status..." >&4
20019 #$i_dirent I_DIRENT /**/
20020 #$i_sysdir I_SYS_DIR /**/
20021 #$i_sysndir I_SYS_NDIR /**/
20022 #$i_systypes I_SYS_TYPES /**/
20024 #if defined(I_SYS_TYPES)
20025 #include <sys/types.h>
20027 #if defined(I_DIRENT)
20028 #include <dirent.h>
20031 #include <sys/ndir.h>
20035 #include <ndir.h> /* may be wrong in the future */
20037 #include <sys/dir.h>
20042 int main() { return closedir(opendir(".")); }
20045 if eval $compile_ok; then
20046 if $run ./try > /dev/null 2>&1 ; then
20047 echo "Yes, it does."
20050 echo "No, it doesn't."
20054 echo "(I can't seem to compile the test program--assuming it doesn't)"
20062 set d_void_closedir
20066 : see if there is a wait4
20070 : see if waitpid exists
20071 set waitpid d_waitpid
20076 $cat >try.c <<'EOCP'
20082 return (wcscmp (s, s) ? 1 : 0);
20087 if eval $compile; then
20090 0) echo "A working wcscmp() found." >&4
20092 *) echo "wcscmp() found, but it doesn't work" >&4
20096 echo "wcscmp() NOT found." >&4
20102 : see if wcstombs exists
20103 set wcstombs d_wcstombs
20108 $cat >try.c <<'EOCP'
20113 wchar_t dst[4], *src = L" ";
20115 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20120 if eval $compile; then
20123 0) echo "A working wcsxfrm() found." >&4
20125 *) echo "wcsxfrm() found, but it doesn't work" >&4
20129 echo "wcsxfrm() NOT found." >&4
20135 : see if wctomb exists
20136 set wctomb d_wctomb
20139 : see if writev exists
20140 set writev d_writev
20143 : check for alignment requirements
20145 case "$alignbytes" in
20146 '') echo "Checking alignment constraints..." >&4
20147 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20148 $cat >try.c <<'EOCP'
20149 typedef long double NV;
20152 $cat >try.c <<'EOCP'
20156 $cat >>try.c <<'EOCP'
20164 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20169 if eval $compile_ok; then
20173 echo "(I can't seem to compile the test program...)"
20175 case "$multiarch" in
20177 : The usual safe value is 8, but Darwin with -Duselongdouble
20178 : needs 16. Hence, we will take 8 as a minimum, but allow
20179 : Configure to pick a larger value if needed.
20180 if $test "$dflt" -lt 8; then
20182 echo "Setting alignment to 8 for multiarch support.">&4
20187 *) dflt="$alignbytes"
20190 rp="Doubles must be aligned on a how-many-byte boundary?"
20195 : set the base revision
20198 : length of character in bytes. Is always 1, otherwise it is not C
20199 : This used to be a test using sizeof
20202 : Check for the number of bits in a character
20203 case "$charbits" in
20204 '') echo "Checking how long a character is (in bits)..." >&4
20211 for (c = 1, n = 0; c; c <<= 1, n++) ;
20212 printf ("%d\n", n);
20217 if eval $compile_ok; then
20221 echo "(I can't seem to compile the test program. Guessing...)"
20228 rp="What is the length of a character (in bits)?"
20232 case "$charbits" in
20235 Your system has an unsigned character size of $charbits bits, which
20236 is rather unusual (normally it is 8 bits). Perl likely will not work
20237 correctly on your system, with subtle bugs in various places.
20239 rp='Do you really want to continue?'
20243 [yY]) echo >&4 "Okay, continuing." ;;
20248 : how do we concatenate cpp tokens here?
20250 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20251 $cat >cpp_stuff.c <<'EOCP'
20252 #define RCAT(a,b)a/**/b
20253 #define ACAT(a,b)a ## b
20257 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20258 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20259 echo "Oh! Smells like ANSI's been here." >&4
20260 echo "We can catify or stringify, separately or together!"
20262 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20263 echo "Ah, yes! The good old days!" >&4
20264 echo "However, in the good old days we don't know how to stringify and"
20265 echo "catify at the same time."
20269 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20270 You're going to have to edit the values of CAT[2-5] in config.h...
20272 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20276 : see if this is a db.h system
20282 : Check db version.
20284 echo "Checking Berkeley DB version ..." >&4
20290 #include <sys/types.h>
20292 #$i_stdlib I_STDLIB
20294 #include <stdlib.h>
20297 int main(int argc, char *argv[])
20299 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20300 int Major, Minor, Patch ;
20301 unsigned long Version ;
20302 (void)db_version(&Major, &Minor, &Patch) ;
20304 printf("%d %d %d %d %d %d\n",
20305 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20306 Major, Minor, Patch);
20309 printf("You have Berkeley DB Version 2 or greater.\n");
20311 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20312 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20313 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20314 Major, Minor, Patch) ;
20316 /* check that db.h & libdb are compatible */
20317 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20318 printf("db.h and libdb are incompatible.\n") ;
20322 printf("db.h and libdb are compatible.\n") ;
20324 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20325 + DB_VERSION_PATCH ;
20327 /* needs to be >= 2.3.4 */
20328 if (Version < 2003004) {
20329 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20330 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20336 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20341 printf("You have Berkeley DB Version 1.\n");
20342 exit(0); /* DB version < 2: the coast is clear. */
20344 exit(1); /* <db.h> not Berkeley DB? */
20350 if eval $compile_ok && $run ./try; then
20351 echo 'Looks OK.' >&4
20353 db_version_major=$1
20354 db_version_minor=$2
20355 db_version_patch=$3
20357 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20361 : Remove db from list of libraries to use
20362 echo "Removing unusable -ldb from library list" >&4
20363 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20366 echo "libs = $libs" >&4
20376 : Check the return type needed for hash
20378 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20384 #include <sys/types.h>
20387 #ifndef DB_VERSION_MAJOR
20388 u_int32_t hash_cb (const void* ptr, size_t size)
20394 info.hash = hash_cb;
20398 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20399 if $contains warning try.out >>/dev/null 2>&1 ; then
20402 db_hashtype='u_int32_t'
20405 : XXX Maybe we should just give up here.
20406 db_hashtype=u_int32_t
20408 echo "Help: I can't seem to compile the db test program." >&4
20409 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20412 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20414 *) db_hashtype=u_int32_t
20419 : Check the return type needed for prefix
20421 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20427 #include <sys/types.h>
20430 #ifndef DB_VERSION_MAJOR
20431 size_t prefix_cb (const DBT *key1, const DBT *key2)
20437 info.prefix = prefix_cb;
20441 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20442 if $contains warning try.out >>/dev/null 2>&1 ; then
20443 db_prefixtype='int'
20445 db_prefixtype='size_t'
20448 db_prefixtype='size_t'
20449 : XXX Maybe we should just give up here.
20451 echo "Help: I can't seem to compile the db test program." >&4
20452 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20455 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20457 *) db_prefixtype='size_t'
20461 : Check what kind of inf/nan your system has
20462 $echo "Checking the kind of infinities and nans you have..." >&4
20464 #define DOUBLESIZE $doublesize
20465 #$d_longdbl HAS_LONG_DOUBLE
20466 #ifdef HAS_LONG_DOUBLE
20467 #define LONGDBLSIZE $longdblsize
20468 #define LONGDBLKIND $longdblkind
20475 /* Note that whether the sign bit is on or off
20476 * for NaN depends on the CPU/FPU, and possibly
20477 * can be affected by the build toolchain.
20479 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20480 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20481 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20482 * (respectively) as opposed to the more usual
20483 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20485 static void bytes(unsigned char *p, unsigned int n) {
20487 for (i = 0; i < n; i++) {
20488 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20491 int main(int argc, char *argv[]) {
20492 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20493 * because some compilers are 'smart' and not only warn but refuse to
20494 * compile such 'illegal' values. */
20495 double dinf = exp(1e9);
20496 double dnan = sqrt(-1.0);
20497 #ifdef HAS_LONG_DOUBLE
20498 long double ldinf = (long double)exp(1e9);
20499 long double ldnan = (long double)sqrt(-1.0);
20502 switch (argv[1][0]) {
20503 case '1': bytes(&dinf, sizeof(dinf)); break;
20504 case '2': bytes(&dnan, sizeof(dnan)); break;
20505 #ifdef HAS_LONG_DOUBLE
20506 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20507 /* the 80-bit long doubles might have garbage in their excess bytes */
20508 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20510 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20511 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20519 if eval $compile; then
20520 doubleinfbytes=`$run ./try 1`
20521 doublenanbytes=`$run ./try 2`
20522 case "$d_longdbl" in
20524 longdblinfbytes=`$run ./try 3`
20525 longdblnanbytes=`$run ./try 4`
20529 # Defaults in case the above test program failed.
20530 case "$doublekind" in
20531 1) # IEEE 754 32-bit LE
20532 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20533 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20535 2) # IEEE 754 32-bit BE
20536 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20537 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20539 3) # IEEE 754 64-bit LE
20540 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20541 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20543 4) # IEEE 754 64-bit BE
20544 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20545 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20547 5) # IEEE 754 128-bit LE
20548 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20549 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20551 6) # IEEE 754 128-bit BE
20552 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20553 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20555 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20556 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20557 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20559 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20560 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20561 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20564 doubleinfbytes=$undef
20565 doublenanbytes=$undef
20568 case "$longdblkind" in
20569 1) # IEEE 754 128-bit LE
20570 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20571 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20573 2) # IEEE 754 128-bit BE
20574 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20575 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20577 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20578 case "$longdblsize" in
20579 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20580 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20581 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20584 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20585 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20588 longdblinfbytes=$undef
20589 longdblnanbytes=$undef
20593 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20594 case "$longdblsize" in
20595 12) # 32-bit system
20596 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20597 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20599 16) # 64-bit system
20600 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20601 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20604 longdblinfbytes=$undef
20605 longdblnanbytes=$undef
20609 5) # 128-bit LE-LE "double double"
20610 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20611 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20613 6) # 128-bit BE-BE "double double"
20614 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20615 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20617 7) # 128-bit LE-BE "double double"
20618 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20619 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20621 8) # 128-bit BE-LE "double double"
20622 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20623 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20626 longdblinfbytes=$undef
20627 longdblnanbytes=$undef
20633 : Check the length of the double mantissa
20634 $echo "Checking how many mantissa bits your doubles have..." >&4
20637 #$i_sunmath I_SUNMATH
20639 # include <float.h>
20642 # include <sunmath.h>
20644 #ifdef DBL_MANT_DIG
20645 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20648 int main(int argc, char *argv[]) {
20650 printf("%d\n", BITS);
20656 if eval $compile; then
20657 doublemantbits=`$run ./try`
20659 doublemantbits="$undef"
20663 : Check the length of the longdouble mantissa
20664 $echo "Checking how many mantissa bits your long doubles have..." >&4
20667 #$i_sunmath I_SUNMATH
20669 # include <float.h>
20672 # include <sunmath.h>
20674 #$d_longdbl HAS_LONG_DOUBLE
20675 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20676 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20677 /* This format has no implicit bit. Beware, however, that for
20678 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20679 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20680 * and the top bit must have been one since 387, zero is plain invalid.
20681 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20682 # define BITS LDBL_MANT_DIG
20683 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20684 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20685 * reason e.g. Irix thinks 107. But in any case, we want only
20686 * the number of real bits, the implicit bits are of no interest. */
20687 # define BITS 2 * (DBL_MANT_DIG - 1)
20689 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20693 int main(int argc, char *argv[]) {
20695 printf("%d\n", BITS);
20701 if eval $compile; then
20702 longdblmantbits=`$run ./try`
20704 longdblmantbits="$undef"
20708 : Check the length of the NV mantissa
20709 $echo "Checking how many mantissa bits your NVs have..." >&4
20710 if test "X$usequadmath" = "X$define"; then
20711 nvmantbits=112 # 128-1-15
20713 if test "X$nvsize" = "X$doublesize"; then
20714 nvmantbits="$doublemantbits"
20716 if test "X$nvsize" = "X$longdblsize"; then
20717 nvmantbits="$longdblmantbits"
20719 nvmantbits="$undef"
20724 : How can we generate normalized random numbers ?
20726 echo "Using our internal random number implementation..." >&4
20729 *-Dmy_rand=*|*-Dmy_srand=*)
20730 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20731 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20732 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20733 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20737 randfunc=Perl_drand48
20738 drand01="Perl_drand48()"
20739 seedfunc="Perl_drand48_init"
20743 : Determine if this is an EBCDIC system
20745 echo "Determining whether or not we are on an EBCDIC system..." >&4
20746 $cat >try.c <<'EOM'
20749 if ('M'==0xd4) return 0;
20756 if eval $compile_ok; then
20757 if $run ./try; then
20758 echo "You seem to speak EBCDIC." >&4
20761 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20764 echo "I'm unable to compile the test program." >&4
20765 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20771 : Check how to flush
20774 Checking how to flush all pending stdio output...
20776 # I only know how to find the first 32 possibly open files on SunOS.
20777 # See also hints/sunos_4_1.sh and util.c --AD
20779 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20781 $cat >>try.c <<EOCP
20783 #$i_stdlib I_STDLIB
20785 #include <stdlib.h>
20787 #$i_unistd I_UNISTD
20789 # include <unistd.h>
20791 #$d_sysconf HAS_SYSCONF
20792 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20793 #ifdef HAS_STDIO_STREAM_ARRAY
20794 # define STDIO_STREAM_ARRAY $stdio_stream_array
20799 p = fopen("try.out", "w");
20803 # ifdef TRY_FPRINTF
20807 #ifdef TRY_FFLUSH_NULL
20810 #ifdef TRY_FFLUSH_ALL
20812 long open_max = -1;
20813 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20814 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20816 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20817 open_max = sysconf(_SC_OPEN_MAX);
20820 open_max = FOPEN_MAX;
20823 open_max = OPEN_MAX;
20832 # ifdef HAS_STDIO_STREAM_ARRAY
20833 if (open_max > 0) {
20835 for (i = 0; i < open_max; i++)
20836 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20837 STDIO_STREAM_ARRAY[i]._file < open_max &&
20838 STDIO_STREAM_ARRAY[i]._flag)
20839 fflush(&STDIO_STREAM_ARRAY[i]);
20847 : first we have to find out how _not_ to flush
20849 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20851 set try -DTRY_FPUTC
20852 if eval $compile; then
20853 $run ./try 2>/dev/null
20856 if $test ! -s try.out -a "X$code" = X42; then
20862 set try -DTRY_FPRINTF
20863 if eval $compile; then
20864 $run ./try 2>/dev/null
20867 if $test ! -s try.out -a "X$code" = X42; then
20868 output=-DTRY_FPRINTF
20874 : check for fflush NULL behavior
20875 case "$fflushNULL" in
20876 '') set try -DTRY_FFLUSH_NULL $output
20877 if eval $compile; then
20878 $run ./try 2>/dev/null
20881 if $test -s try.out -a "X$code" = X42; then
20882 fflushNULL="`$cat try.out`"
20884 if $test "X$code" != X42; then
20886 (If this test failed, don't worry, we'll try another method shortly.)
20891 $rm -f core try.core core.try.*
20892 case "$fflushNULL" in
20894 Your fflush(NULL) works okay for output streams.
20895 Let's see if it clobbers input pipes...
20897 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20898 # bug that improperly flushes the input end of pipes. So we avoid the
20899 # autoflush on fork/system/exec support for now. :-(
20900 $cat >tryp.c <<EOCP
20903 main(int argc, char **argv)
20909 while ((i = getc(stdin)) != -1
20910 && (*bp++ = i) != '\n'
20911 && bp < &buf[1024])
20914 fprintf(stdout, "%s", buf);
20922 fflushNULL="$define"
20924 if eval $compile; then
20926 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20927 if $test "X$targethost" != X; then
20930 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20932 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20934 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20936 fflush(NULL) seems to behave okay with input streams.
20938 fflushNULL="$define"
20941 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20943 fflushNULL="$undef"
20946 $rm -f core tryp.c tryp.core core.tryp.*
20949 Your fflush(NULL) isn't working (contrary to ANSI C).
20951 fflushNULL="$undef"
20954 Cannot figure out whether your fflush(NULL) works or not.
20955 I'm assuming it doesn't (contrary to ANSI C).
20957 fflushNULL="$undef"
20961 $define|true|[yY]*)
20962 fflushNULL="$define"
20965 fflushNULL="$undef"
20968 : check explicit looping only if NULL did not work, and if the pipe
20969 : bug does not show up on an explicit flush too
20970 case "$fflushNULL" in
20972 $cat >tryp.c <<EOCP
20975 main(int argc, char **argv)
20981 while ((i = getc(stdin)) != -1
20982 && (*bp++ = i) != '\n'
20983 && bp < &buf[1024])
20986 fprintf(stdout, "%s", buf);
20995 if eval $compile; then
20997 if $test "X$targethost" != X; then
21000 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21002 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21004 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21006 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21008 : now check for fflushall behaviour
21009 case "$fflushall" in
21010 '') set try -DTRY_FFLUSH_ALL $output
21011 if eval $compile; then
21013 (Now testing the other method--but note that this also may fail.)
21015 $run ./try 2>/dev/null
21018 if $test -s try.out -a "X$code" = X42; then
21019 fflushall="`$cat try.out`"
21023 case "$fflushall" in
21025 Whew. Flushing explicitly all the stdio streams works.
21027 fflushall="$define"
21030 Sigh. Flushing explicitly all the stdio streams doesn't work.
21035 Cannot figure out whether flushing stdio streams explicitly works or not.
21036 I'm assuming it doesn't.
21042 "$define"|true|[yY]*)
21043 fflushall="$define"
21051 All is futile. Even fflush(stdin) clobbers input pipes!
21058 $rm -f core tryp.c tryp.core core.tryp.*
21060 *) fflushall="$undef"
21064 case "$fflushNULL$fflushall" in
21067 OK, I give up. I cannot figure out how to flush pending stdio output.
21068 We won't be flushing handles at all before fork/exec/popen.
21074 : Store the full pathname to the ar program for use in the C program
21075 : Respect a hint or command line value for full_ar.
21080 : Store the full pathname to the sed program for use in the C program
21083 : see what type gids are declared as in the kernel
21085 echo "Looking for the type for group ids returned by getgid()."
21086 set gid_t gidtype xxx stdio.h sys/types.h
21090 xxx=`./findhdr sys/user.h`
21091 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21093 unsigned) dflt="$1 $2" ;;
21097 *) dflt="$gidtype";;
21100 gid_t) echo "gid_t found." ;;
21101 *) rp="What is the type for group ids returned by getgid()?"
21107 : Check the size of GID
21110 *_t) zzz="$gidtype" ;;
21113 echo "Checking the size of $zzz..." >&4
21115 #include <sys/types.h>
21117 #$i_stdlib I_STDLIB
21119 #include <stdlib.h>
21122 printf("%d\n", (int)sizeof($gidtype));
21127 if eval $compile_ok; then
21131 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21134 echo "Your $zzz is $gidsize bytes long."
21139 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21143 : Check if GID is signed
21146 *_t) zzz="$gidtype" ;;
21149 echo "Checking the sign of $zzz..." >&4
21151 #include <sys/types.h>
21162 if eval $compile; then
21166 echo "(I can't execute the test program--guessing unsigned.)" >&4
21170 1) echo "Your $zzz is unsigned." ;;
21171 -1) echo "Your $zzz is signed." ;;
21177 echo "(I can't compile the test program--guessing unsigned.)" >&4
21181 : Check 64bit sizes
21184 if $test X"$quadtype" != X; then
21186 echo "Checking how to print 64-bit integers..." >&4
21188 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21189 $cat >try.c <<'EOCP'
21190 #include <sys/types.h>
21193 int q = 12345678901;
21194 printf("%ld\n", q);
21198 if eval $compile; then
21202 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21203 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21204 echo "We will use %d."
21210 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21211 $cat >try.c <<'EOCP'
21212 #include <sys/types.h>
21215 long q = 12345678901;
21216 printf("%ld\n", q);
21220 if eval $compile; then
21224 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21225 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21226 echo "We will use %ld."
21232 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21233 $cat >try.c <<'EOCP'
21234 #include <sys/types.h>
21235 #include <inttypes.h>
21238 int64_t q = 12345678901;
21239 printf("%" PRId64 "\n", q);
21243 if eval $compile; then
21247 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21248 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21249 echo "We will use the C9X style."
21255 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21257 #include <sys/types.h>
21260 $quadtype q = 12345678901;
21261 printf("%Ld\n", q);
21265 if eval $compile; then
21269 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21270 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21271 echo "We will use %Ld."
21277 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21278 $cat >try.c <<'EOCP'
21279 #include <sys/types.h>
21282 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21283 printf("%lld\n", q);
21287 if eval $compile; then
21291 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21292 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21293 echo "We will use the %lld style."
21299 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21301 #include <sys/types.h>
21304 $quadtype q = 12345678901;
21305 printf("%qd\n", q);
21309 if eval $compile; then
21313 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21314 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21315 echo "We will use %qd."
21321 if $test X"$sPRId64" = X; then
21322 echo "Cannot figure out how to print 64-bit integers." >&4
21329 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21330 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21332 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21333 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21337 : Check format strings for internal types
21339 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21341 if $test X"$ivsize" = X8; then
21342 ivdformat="$sPRId64"
21343 uvuformat="$sPRIu64"
21344 uvoformat="$sPRIo64"
21345 uvxformat="$sPRIx64"
21346 uvXUformat="$sPRIXU64"
21348 if $test X"$ivsize" = X"$longsize"; then
21355 if $test X"$ivsize" = X"$intsize"; then
21363 if $test X"$ivsize" = X"$shortsize"; then
21374 if $test X"$usequadmath" = X"$define"; then
21382 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21383 nveformat="$sPRIeldbl"
21384 nvfformat="$sPRIfldbl"
21385 nvgformat="$sPRIgldbl"
21386 nvEUformat="$sPRIEUldbl"
21387 nvFUformat="$sPRIFUldbl"
21388 nvGUformat="$sPRIGUldbl"
21399 case "$ivdformat" in
21400 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21405 : Check format string for GID
21408 $echo "Checking the format string to be used for gids..." >&4
21411 -1) if $test X"$gidsize" = X"$ivsize"; then
21412 gidformat="$ivdformat"
21414 if $test X"$gidsize" = X"$longsize"; then
21417 if $test X"$gidsize" = X"$intsize"; then
21420 if $test X"$gidsize" = X"$shortsize"; then
21427 *) if $test X"$gidsize" = X"$uvsize"; then
21428 gidformat="$uvuformat"
21430 if $test X"$gidsize" = X"$longsize"; then
21433 if $test X"$gidsize" = X"$intsize"; then
21436 if $test X"$gidsize" = X"$shortsize"; then
21445 : see if getgroups exists
21446 set getgroups d_getgrps
21449 : see if setgroups exists
21450 set setgroups d_setgrps
21453 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21455 case "$d_getgrps$d_setgrps" in
21457 case "$groupstype" in
21458 '') dflt="$gidtype" ;;
21459 *) dflt="$groupstype" ;;
21462 What type of pointer is the second argument to getgroups() and setgroups()?
21463 Usually this is the same as group ids, $gidtype, but not always.
21466 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21470 *) groupstype="$gidtype";;
21473 : check whether make sets MAKE
21475 echo "Checking if your $make program sets \$(MAKE)..." >&4
21476 case "$make_set_make" in
21478 $sed 's/^X //' > testmake.mak << 'EOF'
21480 X @echo 'maketemp="$(MAKE)"'
21482 case "`$make -f testmake.mak 2>/dev/null`" in
21483 *maketemp=*) make_set_make='#' ;;
21484 *) make_set_make="MAKE=$make" ;;
21486 $rm -f testmake.mak
21489 case "$make_set_make" in
21490 '#') echo "Yup, it does.";;
21491 *) echo "Nope, it doesn't.";;
21494 : see what type is used for mode_t
21495 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21496 set mode_t modetype int stdio.h sys/types.h
21499 : see if we need va_copy
21501 case "$i_stdarg" in
21504 #include <stdarg.h>
21506 #$i_stdlib I_STDLIB
21508 #include <stdlib.h>
21510 #include <signal.h>
21513 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21515 return vfprintf(f, fmt, *valp);
21519 myvfprintf(FILE *f, const char *fmt, va_list val)
21521 return ivfprintf(f, fmt, &val);
21525 myprintf(char *fmt, ...)
21528 va_start(val, fmt);
21529 return myvfprintf(stdout, fmt, val);
21533 main(int ac, char **av)
21535 signal(SIGSEGV, exit);
21537 myprintf("%s%cs all right, then\n", "that", '\'');
21542 if eval $compile && $run ./try 2>&1 >/dev/null; then
21543 case "`$run ./try`" in
21544 "that's all right, then")
21550 yes) echo "It seems that you don't need va_copy()." >&4
21551 need_va_copy="$undef"
21553 *) echo "It seems that va_copy() or similar will be needed." >&4
21554 need_va_copy="$define"
21559 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21560 need_va_copy="$undef"
21564 : see what type is used for size_t
21565 rp="What is the type used for the length parameter for string functions?"
21566 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21569 : check for type of arguments to gethostbyaddr.
21570 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21571 case "$d_gethbyaddr" in
21575 Checking to see what type of arguments are accepted by gethostbyaddr().
21577 hdrs="$define sys/types.h
21578 $d_socket sys/socket.h
21579 $i_niin netinet/in.h
21581 $i_unistd unistd.h"
21582 : The first arg can 'char *' or 'void *'
21583 : The second arg is some of integral type
21584 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21585 for yyy in size_t long int; do
21586 case "$netdb_host_type" in
21587 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21588 if ./protochk "$try" $hdrs; then
21589 echo "Your system accepts $xxx for the first arg."
21590 echo "...and $yyy for the second arg."
21591 netdb_host_type="$xxx"
21592 netdb_hlen_type="$yyy"
21598 : In case none of those worked, prompt the user.
21599 case "$netdb_host_type" in
21600 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21603 netdb_host_type=$ans
21604 rp='What is the type for the 2nd argument to gethostbyaddr?'
21607 netdb_hlen_type=$ans
21611 *) : no gethostbyaddr, so pick harmless defaults
21612 netdb_host_type='char *'
21613 netdb_hlen_type="$sizetype"
21616 # Remove the "const" if needed. -- but then we'll have a
21618 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21621 : check for type of argument to gethostbyname.
21622 if test "X$netdb_name_type" = X ; then
21623 case "$d_gethbyname" in
21627 Checking to see what type of argument is accepted by gethostbyname().
21629 hdrs="$define sys/types.h
21630 $d_socket sys/socket.h
21631 $i_niin netinet/in.h
21633 $i_unistd unistd.h"
21634 for xxx in "const char *" "char *"; do
21635 case "$netdb_name_type" in
21636 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21637 if ./protochk "$try" $hdrs; then
21638 echo "Your system accepts $xxx."
21639 netdb_name_type="$xxx"
21644 : In case none of those worked, prompt the user.
21645 case "$netdb_name_type" in
21646 '') rp='What is the type for the 1st argument to gethostbyname?'
21649 netdb_name_type=$ans
21653 *) : no gethostbyname, so pick harmless default
21654 netdb_name_type='char *'
21659 : check for type of 1st argument to getnetbyaddr.
21660 if test "X$netdb_net_type" = X ; then
21661 case "$d_getnbyaddr" in
21665 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21667 hdrs="$define sys/types.h
21668 $d_socket sys/socket.h
21669 $i_niin netinet/in.h
21671 $i_unistd unistd.h"
21672 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21673 case "$netdb_net_type" in
21674 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21675 if ./protochk "$try" $hdrs; then
21676 echo "Your system accepts $xxx."
21677 netdb_net_type="$xxx"
21682 : In case none of those worked, prompt the user.
21683 case "$netdb_net_type" in
21684 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21687 netdb_net_type=$ans
21691 *) : no getnetbyaddr, so pick harmless default
21692 netdb_net_type='long'
21696 : locate the preferred pager for this system
21703 [a-zA-Z]:/*) dflt=$pg;;
21707 [a-zA-Z]:/*) dflt=$more;;
21711 [a-zA-Z]:/*) dflt=$less;;
21714 '') dflt=/usr/ucb/more;;
21722 rp='What pager is used on your system?'
21726 : see what type pids are declared as in the kernel
21727 rp="What is the type of process ids on this system?"
21728 set pid_t pidtype int stdio.h sys/types.h
21731 : see if ar generates random libraries by itself
21733 echo "Checking how to generate random libraries on your machine..." >&4
21734 echo 'int bar1() { return bar2(); }' > bar1.c
21735 echo 'int bar2() { return 2; }' > bar2.c
21737 #$i_stdlib I_STDLIB
21739 #include <stdlib.h>
21741 int main() { printf("%d\n", bar1()); exit(0); }
21743 $cc $ccflags -c bar1.c >/dev/null 2>&1
21744 $cc $ccflags -c bar2.c >/dev/null 2>&1
21745 $cc $ccflags -c foo.c >/dev/null 2>&1
21746 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21747 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21748 $run ./foobar >/dev/null 2>&1; then
21749 echo "$ar appears to generate random libraries itself."
21751 if [ "X$ranlib" = "X" ]; then
21754 elif $ar s bar$_a >/dev/null 2>&1 &&
21755 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21756 $run ./foobar >/dev/null 2>&1; then
21757 echo "a table of contents needs to be added with '$ar s'."
21760 elif $ar ts bar$_a >/dev/null 2>&1 &&
21761 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21762 $run ./foobar >/dev/null 2>&1; then
21763 echo "a table of contents needs to be added with '$ar ts'."
21770 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21771 $test -f $ranlib || ranlib=''
21774 if $test -n "$ranlib"; then
21775 echo "your system has '$ranlib'; we'll use that."
21778 echo "your system doesn't seem to support random libraries"
21779 echo "so we'll use lorder and tsort to order the libraries."
21786 : see if this is a values.h system
21787 set values.h i_values
21790 : Check the max offset that gmtime and localtime accept
21791 echo "Checking max offsets that gmtime () accepts"
21794 define) yyy="#include <values.h>" ;;
21798 case "$sGMTIME_min/$sGMTIME_max" in
21801 #include <sys/types.h>
21810 void gm_check (time_t t, int min_year, int max_year)
21813 if ( tmp == NULL ||
21814 /* Check tm_year overflow */
21815 tmp->tm_year < min_year || tmp->tm_year > max_year)
21826 gm_check (MAXLONG, 69, 0x7fffffff);
21828 if (tmp == NULL || tmp->tm_year < 0) {
21829 for (i = 63; i >= 0; i--) {
21830 time_t x = pt | ((time_t)1 << i);
21831 if (x < 0 || x < pt) continue;
21832 gm_check (x, 69, 0x7fffffff);
21835 printf ("sGMTIME_max=%ld\n", pt);
21844 gm_check (MINLONG, -1900, 70);
21847 for (i = 36; i >= 0; i--) {
21848 time_t x = pt - ((time_t)1 << i);
21849 if (x > 0) continue;
21850 gm_check (x, -1900, 70);
21853 printf ("sGMTIME_min=%ld\n", pt);
21857 int main (int argc, char *argv[])
21859 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21866 if eval $compile; then
21867 eval `$run ./try 2>/dev/null`
21869 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21875 echo "Checking max offsets that localtime () accepts"
21877 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21880 #include <sys/types.h>
21889 void local_check (time_t t, int min_year, int max_year)
21891 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21894 tmp = localtime (&t);
21895 if ( tmp == NULL ||
21896 /* Check tm_year overflow */
21897 tmp->tm_year < min_year || tmp->tm_year > max_year)
21901 } /* local_check */
21908 local_check (MAXLONG, 69, 0x7fffffff);
21910 if (tmp == NULL || tmp->tm_year < 0) {
21911 for (i = 63; i >= 0; i--) {
21912 time_t x = pt | ((time_t)1 << i);
21913 if (x < 0 || x < pt) continue;
21914 local_check (x, 69, 0x7fffffff);
21917 printf ("sLOCALTIME_max=%ld\n", pt);
21926 local_check (MINLONG, -1900, 70);
21929 for (i = 36; i >= 0; i--) {
21930 time_t x = pt - ((time_t)1 << i);
21931 if (x > 0) continue;
21932 local_check (x, -1900, 70);
21935 printf ("sLOCALTIME_min=%ld\n", pt);
21939 int main (int argc, char *argv[])
21947 if eval $compile; then
21948 eval `$run ./try 2>/dev/null`
21950 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21956 : check for type of arguments to select.
21957 case "$selecttype" in
21958 '') case "$d_select" in
21962 Checking to see what type of arguments are accepted by select().
21964 hdrs="$define sys/types.h
21965 $i_systime sys/time.h
21966 $i_sysselct sys/select.h
21967 $d_socket sys/socket.h"
21968 : The first arg can be int, unsigned, or size_t
21969 : The last arg may or may not be 'const'
21971 : void pointer has been seen but using that
21972 : breaks the selectminbits test
21973 for xxx in 'fd_set *' 'int *'; do
21974 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21975 for tmo in 'struct timeval *' 'const struct timeval *'; do
21977 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21978 if ./protochk "$try" $hdrs; then
21979 echo "Your system accepts $xxx."
21988 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21989 case "$d_fd_set" in
21990 $define) dflt="fd_set *" ;;
21999 *) : no select, so pick a harmless default
22006 : check for the select 'width'
22007 case "$selectminbits" in
22008 '') safebits=`expr $ptrsize \* 8`
22009 case "$d_select" in
22013 Checking to see on how many bits at a time your select() operates...
22016 #include <sys/types.h>
22018 #$i_systime I_SYS_TIME
22019 #$i_systimek I_SYS_TIME_KERNEL
22024 # ifdef I_SYS_TIME_KERNEL
22027 # include <sys/time.h>
22028 # ifdef I_SYS_TIME_KERNEL
22032 #$i_sysselct I_SYS_SELECT
22033 #ifdef I_SYS_SELECT
22034 #include <sys/select.h>
22036 #$d_socket HAS_SOCKET
22038 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22041 #$i_stdlib I_STDLIB
22043 #include <stdlib.h>
22046 #define S sizeof(*(b))
22048 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22049 #define NBITS (NBYTES * 8)
22051 char *s = (char *)malloc(NBYTES);
22060 fp = fopen("try.c", "r");
22066 b = ($selecttype)s;
22067 for (i = 0; i < NBITS; i++)
22071 select(fd + 1, b, 0, 0, &t);
22072 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22074 printf("%d\n", i + 1);
22079 if eval $compile_ok; then
22080 selectminbits=`$run ./try 2>/dev/null`
22081 case "$selectminbits" in
22083 Cannot figure out on how many bits at a time your select() operates.
22084 I'll play safe and guess it is $safebits bits.
22086 selectminbits=$safebits
22087 bits="$safebits bits"
22090 *) bits="$selectminbits bits" ;;
22092 echo "Your select() operates on $bits at a time." >&4
22094 rp='What is the minimum number of bits your select() operates on?'
22095 case "$byteorder" in
22096 12345678) dflt=64 ;;
22102 selectminbits="$val"
22106 *) : no select, so pick a harmless default
22107 selectminbits=$safebits
22113 : Trace out the files included by signal.h, then look for SIGxxx names.
22114 case "$sig_num_init" in
22116 if [ "X$fieldn" = X ]; then
22117 : Just make some guesses. We check them later.
22118 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22120 xxx=`echo '#include <signal.h>' |
22121 $cppstdin $cppminus $cppflags 2>/dev/null |
22122 $grep '^[ ]*#.*include' |
22123 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22124 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22127 for xx in $xxx /dev/null ; do
22128 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22130 case "$xxxfiles" in
22131 '') xxxfiles=`./findhdr signal.h` ;;
22134 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22135 print substr($2, 4, 20)
22137 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22138 print substr($3, 4, 20)
22140 : Append some common names just in case the awk scan failed.
22141 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22142 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22143 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22144 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22145 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22147 : generate a few handy files for later
22148 $cat > signal.c <<EOCP
22149 #include <sys/types.h>
22150 #include <signal.h>
22151 #$i_stdlib I_STDLIB
22153 #include <stdlib.h>
22158 /* Strange style to avoid deeply-nested #if/#else/#endif */
22161 # define NSIG (_NSIG)
22167 # define NSIG (SIGMAX+1)
22173 # define NSIG (SIG_MAX+1)
22179 # define NSIG (_SIG_MAX+1)
22185 # define NSIG (MAXSIG+1)
22191 # define NSIG (MAX_SIG+1)
22196 # ifdef SIGARRAYSIZE
22197 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22203 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22207 /* Default to some arbitrary number that's big enough to get most
22208 of the common signals.
22214 printf("NSIG %d\n", NSIG);
22220 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22222 printf "#ifdef SIG"; printf $1; printf "\n"
22223 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22224 printf $1; printf ");\n"
22228 printf "#endif /* JUST_NSIG */\n";
22229 printf "exit(0);\n}\n";
22232 $cat >signal.awk <<'EOP'
22233 BEGIN { ndups = 0 }
22234 $1 ~ /^NSIG$/ { nsig = $2 }
22235 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22236 if ($2 > maxsig) { maxsig = $2 }
22237 if (sig_name[$2]) {
22238 dup_name[ndups] = $1
22239 dup_num[ndups] = $2
22251 printf("NSIG %d\n", nsig);
22252 for (n = 1; n < nsig; n++) {
22254 printf("%s %d\n", sig_name[n], sig_num[n])
22257 printf("NUM%d %d\n", n, n)
22260 for (n = 0; n < ndups; n++) {
22261 printf("%s %d\n", dup_name[n], dup_num[n])
22265 $cat >signal_cmd <<EOS
22267 if $test -s signal.lst; then
22268 echo "Using your existing signal.lst file"
22273 $cat >>signal_cmd <<'EOS'
22276 if eval $compile_ok; then
22277 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22278 $uniq | $awk -f signal.awk >signal.lst
22280 echo "(I can't seem be able to compile the whole test program)" >&4
22281 echo "(I'll try it in little pieces.)" >&4
22282 set signal -DJUST_NSIG
22283 if eval $compile_ok; then
22284 $run ./signal$_exe > signal.nsg
22287 echo "I can't seem to figure out how many signals you have." >&4
22288 echo "Guessing 50." >&4
22289 echo 'NSIG 50' > signal.nsg
22291 : Now look at all the signal names, one at a time.
22292 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22293 $cat > signal.c <<EOCP
22294 #include <sys/types.h>
22295 #include <signal.h>
22298 printf("$xx %d\n", SIG${xx});
22303 if eval $compile; then
22304 echo "SIG${xx} found."
22305 $run ./signal$_exe >> signal.ls1
22307 echo "SIG${xx} NOT found."
22310 if $test -s signal.ls1; then
22311 $cat signal.nsg signal.ls1 |
22312 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22316 if $test -s signal.lst; then
22319 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22320 echo 'kill -l' >signal
22321 set X `csh -f <signal`
22325 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22327 echo $@ | $tr ' ' $trnl | \
22328 $awk '{ printf "%s %d\n", $1, ++s; }
22329 END { printf "NSIG %d\n", ++s }' >signal.lst
22331 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22333 chmod a+x signal_cmd
22334 $eunicefix signal_cmd
22336 : generate list of signal names
22338 case "$sig_name_init" in
22340 *) case "$sig_num_init" in
22341 ''|*,*) doinit=yes ;;
22346 echo "Generating a list of signal names and numbers..." >&4
22348 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22349 sig_name=`$awk 'BEGIN { printf "ZERO " }
22350 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22351 sig_num=`$awk 'BEGIN { printf "0 " }
22352 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22353 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22354 !/^NSIG/ { printf "\"%s\", ", $1 }
22355 END { printf "0\n" }' signal.lst`
22356 sig_num_init=`$awk 'BEGIN { printf "0, " }
22357 !/^NSIG/ { printf "%d, ", $2}
22358 END { printf "0\n"}' signal.lst`
22361 echo "The following $sig_count signals are available:"
22363 echo $sig_name | $awk \
22364 'BEGIN { linelen = 0 }
22366 for (i = 1; i <= NF; i++) {
22367 name = "SIG" $i " "
22368 linelen = linelen + length(name)
22369 if (linelen > 70) {
22371 linelen = length(name)
22377 sig_size=`echo $sig_name | awk '{print NF}'`
22378 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22382 : Check size of size
22384 case "$sizetype" in
22385 *_t) zzz="$sizetype" ;;
22386 *) zzz="filesize" ;;
22388 echo "Checking the size of $zzz..." >&4
22390 #include <sys/types.h>
22392 #$i_stdlib I_STDLIB
22394 #include <stdlib.h>
22397 printf("%d\n", (int)sizeof($sizetype));
22402 if eval $compile_ok; then
22406 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22409 echo "Your $zzz size is $sizesize bytes."
22414 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22418 : check for socklen_t
22420 echo "Checking to see if you have socklen_t..." >&4
22422 #include <sys/types.h>
22423 #$d_socket HAS_SOCKET
22425 #include <sys/socket.h>
22427 int main() { socklen_t x = 16; }
22430 if eval $compile; then
22432 echo "You have socklen_t."
22435 echo "You do not have socklen_t."
22436 case "$sizetype" in
22437 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22444 : see if this is a socks.h system
22445 set socks.h i_socks
22448 : check for type of the size argument to socket calls
22449 case "$d_socket" in
22453 Checking to see what type is the last argument of accept().
22456 case "$d_socklen_t" in
22457 "$define") yyy="$yyy socklen_t"
22459 yyy="$yyy $sizetype int long unsigned"
22460 for xxx in $yyy; do
22461 case "$socksizetype" in
22462 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22463 case "$usesocks" in
22465 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22466 echo "Your system accepts '$xxx *' for the last argument of accept()."
22467 socksizetype="$xxx"
22470 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22471 echo "Your system accepts '$xxx *' for the last argument of accept()."
22472 socksizetype="$xxx"
22479 : In case none of those worked, prompt the user.
22480 case "$socksizetype" in
22481 '') rp='What is the type for socket address structure sizes?'
22488 *) : no sockets, so pick relatively harmless default
22493 : see what type is used for signed size_t
22494 set ssize_t ssizetype int stdio.h sys/types.h
22499 #$i_stdlib I_STDLIB
22501 #include <stdlib.h>
22503 #include <sys/types.h>
22504 #define Size_t $sizetype
22505 #define SSize_t $dflt
22508 if (sizeof(Size_t) == sizeof(SSize_t))
22510 else if (sizeof(Size_t) == sizeof(int))
22519 if eval $compile_ok && $run ./try > /dev/null; then
22520 ssizetype=`$run ./try`
22521 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22524 Help! I can't compile and run the ssize_t test program: please enlighten me!
22525 (This is probably a misconfiguration in your system or libraries, and
22526 you really ought to fix it. Still, I'll try anyway.)
22528 I need a type that is the same size as $sizetype, but is guaranteed to
22529 be signed. Common values are ssize_t, int and long.
22532 rp="What signed type is the same size as $sizetype?"
22538 : Check the size of st_ino
22540 $echo "Checking the size of st_ino..." >&4
22541 $cat > try.c <<EOCP
22542 #include <sys/stat.h>
22544 #$i_stdlib I_STDLIB
22546 #include <stdlib.h>
22550 printf("%d\n", (int)sizeof(st.st_ino));
22555 if eval $compile_ok; then
22559 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22561 *) st_ino_size=$val
22562 $echo "Your st_ino is $st_ino_size bytes long."
22567 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22571 : Check if st_ino is signed
22573 $echo "Checking the sign of st_ino..." >&4
22574 $cat > try.c <<EOCP
22575 #include <sys/stat.h>
22580 if (foo.st_ino < 0)
22587 if eval $compile; then
22591 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22593 *) st_ino_sign=$val
22594 case "$st_ino_sign" in
22595 1) $echo "Your st_ino is unsigned." ;;
22596 -1) $echo "Your st_ino is signed." ;;
22602 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22606 : see what type of char stdio uses.
22608 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22609 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22610 echo "Your stdio uses unsigned chars." >&4
22611 stdchar="unsigned char"
22613 echo "Your stdio uses signed chars." >&4
22618 : see what type uids are declared as in the kernel
22620 echo "Looking for the type for user ids returned by getuid()."
22621 set uid_t uidtype xxx stdio.h sys/types.h
22625 xxx=`./findhdr sys/user.h`
22626 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22628 unsigned) dflt="$1 $2" ;;
22632 *) dflt="$uidtype";;
22635 uid_t) echo "uid_t found." ;;
22636 *) rp="What is the type for user ids returned by getuid()?"
22642 : Check size of UID
22645 *_t) zzz="$uidtype" ;;
22648 echo "Checking the size of $zzz..." >&4
22650 #include <sys/types.h>
22652 #$i_stdlib I_STDLIB
22654 #include <stdlib.h>
22657 printf("%d\n", (int)sizeof($uidtype));
22662 if eval $compile_ok; then
22666 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22669 echo "Your $zzz is $uidsize bytes long."
22674 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22677 : Check if UID is signed
22680 *_t) zzz="$uidtype" ;;
22683 echo "Checking the sign of $zzz..." >&4
22685 #include <sys/types.h>
22696 if eval $compile; then
22700 echo "(I can't execute the test program--guessing unsigned.)" >&4
22704 1) echo "Your $zzz is unsigned." ;;
22705 -1) echo "Your $zzz is signed." ;;
22711 echo "(I can't compile the test program--guessing unsigned.)" >&4
22715 : Check format string for UID
22717 $echo "Checking the format string to be used for uids..." >&4
22720 -1) if $test X"$uidsize" = X"$ivsize"; then
22721 uidformat="$ivdformat"
22723 if $test X"$uidsize" = X"$longsize"; then
22726 if $test X"$uidsize" = X"$intsize"; then
22729 if $test X"$uidsize" = X"$shortsize"; then
22736 *) if $test X"$uidsize" = X"$uvsize"; then
22737 uidformat="$uvuformat"
22739 if $test X"$uidsize" = X"$longsize"; then
22742 if $test X"$uidsize" = X"$intsize"; then
22745 if $test X"$uidsize" = X"$shortsize"; then
22754 : see what siginfo fields we have
22755 case "$d_sigaction" in
22757 echo "Checking if your siginfo_t has si_errno field...">&4
22758 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
22761 echo "Checking if your siginfo_t has si_pid field...">&4
22762 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
22765 echo "Checking if your siginfo_t has si_uid field...">&4
22766 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
22769 echo "Checking if your siginfo_t has si_addr field...">&4
22770 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
22773 echo "Checking if your siginfo_t has si_status field...">&4
22774 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
22777 echo "Checking if your siginfo_t has si_band field...">&4
22778 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
22781 echo "Checking if your siginfo_t has si_value field...">&4
22782 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
22787 d_siginfo_si_errno="$undef"
22788 d_siginfo_si_pid="$undef"
22789 d_siginfo_si_uid="$undef"
22790 d_siginfo_si_addr="$undef"
22791 d_siginfo_si_status="$undef"
22792 d_siginfo_si_band="$undef"
22793 d_siginfo_si_value="$undef"
22797 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22799 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22800 $cat >try.c <<'EOM'
22801 /* Intentionally a long probe as I'd like to sanity check that the exact
22802 approach is going to work, as thinking it will work, but only having it
22803 part working at runtime is worse than not having it. */
22805 #include <sys/types.h>
22806 #include <sys/sysctl.h>
22807 #include <sys/param.h>
22809 #include <string.h>
22810 #include <stdlib.h>
22811 #include <unistd.h>
22814 main(int argc, char **argv) {
22816 char *argv_leaf = strrchr(argv[0], '/');
22822 mib[1] = KERN_PROC;
22823 mib[2] = KERN_PROC_PATHNAME;
22827 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22831 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22836 if (size < strlen(argv_leaf) + 1) {
22837 fprintf(stderr, "size %lu is too short for a path\n",
22838 (unsigned long) size);
22842 if (size > MAXPATHLEN * MAXPATHLEN) {
22843 fprintf(stderr, "size %lu is too long for a path\n",
22844 (unsigned long) size);
22848 buffer = malloc(size);
22854 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22859 if (strlen(buffer) + 1 != size) {
22860 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22861 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22866 if (*buffer != '/') {
22867 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22871 if (strstr(buffer, "/./")) {
22872 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22876 if (strstr(buffer, "/../")) {
22877 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22881 buffer_leaf = strrchr(buffer, '/');
22882 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22883 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22895 if eval $compile; then
22896 if $run ./try; then
22897 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22900 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22904 echo "I'm unable to compile the test program." >&4
22905 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22909 set usekernprocpathname
22912 : Determine if we can use _NSGetExecutablePath to find executing program
22914 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22915 $cat >try.c <<'EOM'
22916 /* Intentionally a long probe as I'd like to sanity check that the exact
22917 approach is going to work, as thinking it will work, but only having it
22918 part working at runtime is worse than not having it. */
22919 #include <mach-o/dyld.h>
22921 #include <stdlib.h>
22922 #include <sys/param.h>
22923 #include <string.h>
22926 main(int argc, char **argv) {
22928 uint32_t size = sizeof(buf);
22932 char *argv_leaf = strrchr(argv[0], '/');
22936 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22940 _NSGetExecutablePath(buf, &size);
22941 if (size > MAXPATHLEN * MAXPATHLEN) {
22942 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22943 (unsigned int) size);
22947 buffer = malloc(size);
22953 result = _NSGetExecutablePath(buffer, &size);
22955 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22956 result, (unsigned int) size);
22960 tidied = realpath(buffer, NULL);
22962 perror("realpath");
22968 if (*tidied != '/') {
22969 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22973 if (strstr(tidied, "/./")) {
22974 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22978 if (strstr(tidied, "/../")) {
22979 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22983 tidied_leaf = strrchr(tidied, '/');
22984 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22985 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22997 if eval $compile; then
22998 if $run ./try; then
22999 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23002 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23005 echo "I'm unable to compile the test program." >&4
23006 echo "I'll assume no _NSGetExecutablePath here." >&4
23009 set usensgetexecutablepath
23012 : Check if site customization support was requested
23013 case "$usesitecustomize" in
23014 $define|true|[Yy]*)
23015 usesitecustomize="$define"
23018 usesitecustomize="$undef"
23022 : see if prototypes support variable argument declarations
23024 case "$prototype$i_stdarg" in
23026 echo "It appears we'll be able to prototype varargs functions." >&4
23030 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23037 : determine compiler compiler
23046 if $test -f "$byacc$_exe"; then
23048 comp="byacc or $comp"
23050 if $test -f "$bison$_exe"; then
23051 comp="$comp or bison -y"
23053 rp="Which compiler compiler ($comp) shall I use?"
23062 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23068 : see if this is a assert.h system
23069 set assert.h i_assert
23072 : see if this is a bfd.h system
23076 : see if this is an execinfo.h system
23077 set execinfo.h i_execinfo
23080 : see if this is a fenv.h system
23084 : see if this is a fp.h system
23088 : see if this is a fp_class.h system
23089 set fp_class.h i_fp_class
23092 : see if gdbm.h is available
23097 : see if gdbm_open exists
23098 set gdbm_open d_gdbm_open
23100 case "$d_gdbm_open" in
23103 echo "We won't be including <gdbm.h>"
23112 : see if this is a ieeefp.h system
23113 case "$i_ieeefp" in
23114 '' ) set ieeefp.h i_ieeefp
23119 : see if this is a libutil.h system
23120 set libutil.h i_libutil
23123 : see if mach cthreads are available
23124 if test "X$usethreads" = "X$define"; then
23125 set mach/cthreads.h i_machcthr
23128 i_machcthr="$undef"
23131 : see if this is a mntent.h system
23132 set mntent.h i_mntent
23135 : see if net/errno.h is available
23137 set net/errno.h val
23140 : Unfortunately, it causes problems on some systems. Arrgh.
23143 cat > try.c <<'EOM'
23146 #include <net/errno.h>
23152 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23153 echo "We'll be including <net/errno.h>." >&4
23155 echo "We won't be including <net/errno.h>." >&4
23164 : see if netinet/tcp.h is available
23165 set netinet/tcp.h i_netinettcp
23168 : see if this is a poll.h system
23172 : see if this is a prot.h system
23176 : Preprocessor symbols
23178 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23179 $cat <<'EOSH' > Cppsym.know
23180 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23181 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23182 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23183 arch_pwr ardent ARM ARM32 atarist att386 att3b
23184 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23185 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23186 byteorder byte_order
23187 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23188 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23189 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23190 ELF encore EPI EXTENSIONS
23191 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23192 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23193 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23194 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23195 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23196 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23197 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23198 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23199 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23201 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23202 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23203 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23205 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23206 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23207 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23208 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23209 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23210 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23211 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23212 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23213 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23214 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23215 ns32000 ns32016 ns32332 ns32k nsc32000
23216 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23217 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23218 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23219 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23221 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23222 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23223 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23224 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23225 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23226 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23227 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23228 SYSV4 SYSV5 sysV68 sysV88
23229 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23230 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23231 tower32_800 tower32_850 tss
23232 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23233 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23234 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23235 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23236 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23237 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23239 vax venix VMESA vms
23240 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23241 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23244 # Maybe put other stuff here too.
23245 ./tr '-' '_' <<EOSH >>Cppsym.know
23248 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23249 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23250 $cat Cppsym.know > Cppsym.c
23251 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23252 $rm -f Cppsym.a Cppsym.b Cppsym.c
23253 cat <<EOSH > Cppsym
23255 if $test \$# -gt 0; then
23256 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23257 if $test -s Cppsym.got; then
23264 $tr " " "$trnl" | ./Cppsym.try
23270 cat <<EOSH > Cppsym.try
23272 cat <<'EOCP' > try.c
23275 #define STRINGIFY(a) "a"
23277 #if cpp_stuff == 42
23278 #define StGiFy(a) #a
23279 #define STRINGIFY(a) StGiFy(a)
23281 #if $cpp_stuff != 1 && $cpp_stuff != 42
23282 # include "Bletch: How does this C preprocessor stringify macros?"
23288 cat <<'EOSH' >> Cppsym.try
23290 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23291 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23292 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23293 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23295 echo 'return 0;}' >> try.c
23297 cat <<EOSH >> Cppsym.try
23299 case "$osname-$gccversion" in
23300 irix-) ccflags="\$ccflags -woff 1178" ;;
23301 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23303 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23305 chmod +x Cppsym.try
23306 $eunicefix Cppsym.try
23307 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23308 : Add in any Linux cpp "predefined macros":
23309 case "$osname::$gccversion" in
23310 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23312 rm -f $tHdrH'.h' $tHdrH
23314 # Filter out macro arguments, such as Linux's __INT8_C(c)
23315 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23316 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23317 if [ -s $tHdrH'_cppsym.real' ]; then
23318 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23321 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23324 : now check the C compiler for additional symbols
23325 postprocess_cc_v=''
23327 aix) postprocess_cc_v="|$tr , ' '" ;;
23334 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23337 -D*) echo "\$i" | $sed 's/^-D//';;
23338 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23343 postprocess_cc_v=''
23346 ./ccsym > ccsym1.raw
23347 if $test -s ccsym1.raw; then
23348 $sort ccsym1.raw | $uniq >ccsym.raw
23350 mv ccsym1.raw ccsym.raw
23353 $awk '/\=/ { print $0; next }
23354 { print $0"=1" }' ccsym.raw >ccsym.list
23355 $comm -13 Cppsym.true ccsym.list >ccsym.own
23356 $comm -12 Cppsym.true ccsym.list >ccsym.com
23357 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23359 if $test -z ccsym.raw; then
23360 echo "Your C compiler doesn't seem to define any symbols!" >&4
23362 echo "However, your C preprocessor defines the following symbols:"
23365 cppsymbols=`$cat Cppsym.true`
23366 cppsymbols=`echo $cppsymbols`
23367 cppccsymbols="$cppsymbols"
23369 if $test -s ccsym.com; then
23370 echo "Your C compiler and pre-processor define these symbols:"
23371 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23374 cppccsymbols=`$cat ccsym.com`
23375 cppccsymbols=`echo $cppccsymbols`
23376 $test "$silent" || sleep 1
23378 if $test -s ccsym.cpp; then
23379 $test "$also" && echo " "
23380 echo "Your C pre-processor ${also}defines the following symbols:"
23381 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23383 cppsymbols=`$cat ccsym.cpp`
23384 cppsymbols=`echo $cppsymbols`
23385 $test "$silent" || sleep 1
23387 if $test -s ccsym.own; then
23388 $test "$also" && echo " "
23389 echo "Your C compiler ${also}defines the following cpp symbols:"
23390 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23391 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23392 ccsymbols=`$cat ccsym.own`
23393 ccsymbols=`echo $ccsymbols`
23394 $test "$silent" || sleep 1
23398 : add -D_FORTIFY_SOURCE if feasible and not already there
23399 case "$gccversion" in
23400 [45].*) case "$optimize$ccflags" in
23401 *-O*) case "$ccflags$cppsymbols" in
23402 *_FORTIFY_SOURCE=*) # Don't add it again.
23403 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23405 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23406 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23410 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23414 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23418 : see if this is a termio system
23422 if $test `./findhdr termios.h`; then
23423 set tcsetattr i_termios
23429 "$define") echo "You have POSIX termios.h... good!" >&4;;
23430 *) if ./Cppsym pyr; then
23431 case "`$run /bin/universe`" in
23432 ucb) if $test `./findhdr sgtty.h`; then
23434 echo "<sgtty.h> found." >&4
23436 echo "System is pyramid with BSD universe."
23437 ./warn "<sgtty.h> not found--you could have problems."
23439 *) if $test `./findhdr termio.h`; then
23441 echo "<termio.h> found." >&4
23443 echo "System is pyramid with USG universe."
23444 ./warn "<termio.h> not found--you could have problems."
23448 if $test `./findhdr termio.h`; then
23449 echo "<termio.h> found." >&4
23451 elif $test `./findhdr sgtty.h`; then
23452 echo "<sgtty.h> found." >&4
23455 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23458 if $test `./findhdr sgtty.h`; then
23459 echo "<sgtty.h> found." >&4
23461 elif $test `./findhdr termio.h`; then
23462 echo "<termio.h> found." >&4
23465 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23469 set i_termio; eval $setvar
23470 val=$val2; set i_sgtty; eval $setvar
23471 val=$val3; set i_termios; eval $setvar
23473 : see if stdbool is available
23474 : we want a real compile instead of Inhdr because some Solaris systems
23475 : have stdbool.h, but it can only be used if the compiler indicates it
23476 : is sufficiently c99-compliant.
23480 #include <stdbool.h>
23485 int main(int argc, char **argv)
23491 if eval $compile; then
23492 echo "<stdbool.h> found." >&4
23495 echo "<stdbool.h> NOT found." >&4
23502 : see if stddef is available
23503 set stddef.h i_stddef
23506 : see if stdint is available
23507 set stdint.h i_stdint
23510 : see if sys/access.h is available
23511 set sys/access.h i_sysaccess
23514 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23515 set sys/filio.h i_sysfilio
23518 if $test `./findhdr sys/ioctl.h`; then
23520 echo '<sys/ioctl.h> found.' >&4
23523 if $test $i_sysfilio = "$define"; then
23524 echo '<sys/ioctl.h> NOT found.' >&4
23526 $test $i_sgtty = "$define" && xxx="sgtty.h"
23527 $test $i_termio = "$define" && xxx="termio.h"
23528 $test $i_termios = "$define" && xxx="termios.h"
23529 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23535 : see if socket ioctl defs are in sys/sockio.h
23537 xxx=`./findhdr sys/sockio.h`
23538 if $test "$xxx"; then
23539 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23541 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23544 echo "No socket ioctls found in <sys/sockio.h>." >&4
23549 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23555 : see if this is a syslog.h system
23556 set syslog.h i_syslog
23559 : see if this is a sys/mode.h system
23560 set sys/mode.h i_sysmode
23563 : see if there is a sys/poll.h file
23564 set sys/poll.h i_syspoll
23567 : see if sys/resource.h has to be included
23568 set sys/resource.h i_sysresrc
23571 : see if sys/security.h is available
23572 set sys/security.h i_syssecrt
23575 : see if this is a sys/statvfs.h system
23576 set sys/statvfs.h i_sysstatvfs
23579 : see if this is a sys/un.h system
23580 set sys/un.h i_sysun
23583 : see if this is a sys/utsname.h system
23584 set sys/utsname.h i_sysutsname
23587 : see if this is a syswait system
23588 set sys/wait.h i_syswait
23591 : see if this is a ustat.h system
23592 set ustat.h i_ustat
23595 : see if this is an utime system
23596 set utime.h i_utime
23599 : see if this is a vfork system
23602 set vfork.h i_vfork
23612 echo "Looking for extensions..." >&4
23613 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23614 : contain old or inaccurate or duplicate values.
23615 nonxs_extensions=''
23617 : We do not use find because it might not be available.
23618 : We do not just use MANIFEST because the user may have dropped
23619 : some additional extensions into the source tree and expect them
23622 : Function to recursively find available extensions, ignoring DynaLoader
23623 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23624 : In 5.10.1 and later, extensions are stored in directories
23625 : like File-Glob instead of the older File/Glob/.
23629 DynaLoader|dynaload) ;;
23631 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23632 case "$this_ext" in
23633 Scalar/List/Utils) this_ext="List/Util" ;;
23634 PathTools) this_ext="Cwd" ;;
23636 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23637 if $contains " $this_ext " "$tdir/$$.tmp"; then
23639 echo "Duplicate directories detected for extension $xxx" >&4;
23640 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23641 case "$knowitall" in
23649 echo "Ok. Stopping Configure." >&4;
23650 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23653 echo "Ok. You will need to correct config.sh before running make." >&4;
23655 $ls -1 "$xxx" > "$tdir/$$.tmp";
23656 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23657 xs_extensions="$xs_extensions $this_ext";
23658 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23659 xs_extensions="$xs_extensions $this_ext";
23660 elif $test -d "$xxx"; then
23661 nonxs_extensions="$nonxs_extensions $this_ext";
23663 $rm -f "$tdir/$$.tmp";
23671 eval $find_extensions
23675 eval $find_extensions
23679 eval $find_extensions
23680 set X $xs_extensions
23682 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23683 set X $nonxs_extensions
23685 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23687 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23689 : Now see which are supported on this system.
23691 for xxx in $xs_extensions ; do
23695 amigaos) avail_ext="$avail_ext $xxx" ;;
23700 $define) avail_ext="$avail_ext $xxx" ;;
23703 GDBM_File|gdbm_fil)
23705 $define) avail_ext="$avail_ext $xxx" ;;
23708 I18N/Langinfo|i18n_lan)
23709 case "$i_langinfo$d_nl_langinfo" in
23710 $define$define) avail_ext="$avail_ext $xxx" ;;
23714 : XXX Do we need a useipcsysv variable here
23715 case "${d_msg}${d_sem}${d_shm}" in
23716 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23719 NDBM_File|ndbm_fil)
23722 case "$osname-$use64bitint" in
23725 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23728 *) avail_ext="$avail_ext $xxx" ;;
23733 ODBM_File|odbm_fil)
23734 case "${i_dbm}${i_rpcsvcdbm}" in
23736 case "$d_cplusplus" in
23737 define) ;; # delete as a function name will not work
23738 *) case "$osname-$use64bitint" in
23741 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23744 *) avail_ext="$avail_ext $xxx" ;;
23752 case "$useopcode" in
23753 true|define|y) avail_ext="$avail_ext $xxx" ;;
23757 case "$useposix" in
23758 true|define|y) avail_ext="$avail_ext $xxx" ;;
23762 case "$d_socket" in
23763 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23766 Sys/Syslog|sys/syslog)
23768 amigaos) ;; # not really very useful on AmigaOS
23770 : XXX syslog requires socket
23771 case "$d_socket" in
23772 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23778 case "$usethreads" in
23780 case "$use5005threads" in
23781 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23785 threads|threads/shared)
23786 # threads and threads::shared are special cases.
23787 # To stop people from asking "Perl 5.8.0 was supposed
23788 # to have this new fancy threads implementation but my
23789 # perl doesn't have it" and from people trying to
23790 # (re)install the threads module using CPAN.pm and
23791 # CPAN.pm then offering to reinstall Perl 5.8.0,
23792 # the threads.pm and threads/shared.pm will always be
23793 # there, croaking informatively ("you need to rebuild
23794 # all of Perl with threads, sorry") when threads haven't
23795 # been compiled in.
23797 avail_ext="$avail_ext $xxx"
23803 cygwin) avail_ext="$avail_ext $xxx" ;;
23806 XS/APItest|xs/apitest)
23807 # This is just for testing. Skip it unless we have dynamic loading.
23810 $define) avail_ext="$avail_ext $xxx" ;;
23813 XS/Typemap|xs/typemap)
23814 # This is just for testing. Skip it unless we have dynamic loading.
23816 $define) avail_ext="$avail_ext $xxx" ;;
23819 *) avail_ext="$avail_ext $xxx"
23828 case "$onlyextensions" in
23830 *) keepextensions=''
23831 echo "You have requested that only certain extensions be included..." >&4
23832 for i in $onlyextensions; do
23833 case " $avail_ext " in
23835 echo "Keeping extension $i."
23836 keepextensions="$keepextensions $i"
23838 *) echo "Ignoring extension $i." ;;
23841 avail_ext="$keepextensions"
23845 case "$noextensions" in
23847 *) keepextensions=''
23848 echo "You have requested that certain extensions be ignored..." >&4
23849 for i in $avail_ext; do
23850 case " $noextensions " in
23851 *" $i "*) echo "Ignoring extension $i." ;;
23852 *) echo "Keeping extension $i.";
23853 keepextensions="$keepextensions $i"
23857 avail_ext="$keepextensions"
23861 : Now see which nonxs extensions are supported on this system.
23862 : For now assume all are.
23864 for xxx in $nonxs_extensions ; do
23868 *) nonxs_ext="$nonxs_ext $xxx"
23880 A number of extensions are supplied with $package. You may choose to
23881 compile these extensions for dynamic loading (the default), compile
23882 them into the $package executable (static loading), or not include
23883 them at all. Answer "none" to include no extensions.
23884 Note that DynaLoader is always built and need not be mentioned here.
23887 case "$dynamic_ext" in
23889 : Exclude those listed in static_ext
23891 for xxx in $avail_ext; do
23892 case " $static_ext " in
23894 *) dflt="$dflt $xxx" ;;
23901 *) dflt="$dynamic_ext"
23902 # Perhaps we are reusing an old out-of-date config.sh.
23905 if test X"$dynamic_ext" != X"$avail_ext"; then
23907 NOTICE: Your previous config.sh list may be incorrect.
23908 The extensions now available to you are
23910 but the default list from your previous config.sh is
23922 rp="What extensions do you wish to load dynamically?"
23925 none) dynamic_ext=' ' ;;
23926 *) dynamic_ext="$ans" ;;
23929 case "$static_ext" in
23931 : Exclude those already listed in dynamic linking
23933 for xxx in $avail_ext; do
23934 case " $dynamic_ext " in
23936 *) dflt="$dflt $xxx" ;;
23943 *) dflt="$static_ext"
23950 rp="What extensions do you wish to load statically?"
23953 none) static_ext=' ' ;;
23954 *) static_ext="$ans" ;;
23959 A number of extensions are supplied with $package. Answer "none"
23960 to include no extensions.
23961 Note that DynaLoader is always built and need not be mentioned here.
23964 case "$static_ext" in
23965 '') dflt="$avail_ext" ;;
23966 *) dflt="$static_ext"
23967 # Perhaps we are reusing an old out-of-date config.sh.
23970 if test X"$static_ext" != X"$avail_ext"; then
23972 NOTICE: Your previous config.sh list may be incorrect.
23973 The extensions now available to you are
23975 but the default list from your previous config.sh is
23984 : Exclude those that are not xs extensions
23988 rp="What extensions do you wish to include?"
23991 none) static_ext=' ' ;;
23992 *) static_ext="$ans" ;;
23997 # Encode is a special case. If we are building Encode as a static
23998 # extension, we need to explicitly list its subextensions as well.
23999 # For other nested extensions, this is handled automatically by
24000 # the appropriate Makefile.PL.
24001 case " $static_ext " in
24002 *" Encode "*) # Add the subextensions of Encode
24004 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24005 static_ext="$static_ext Encode/$xxx"
24006 known_extensions="$known_extensions Encode/$xxx"
24012 set X $dynamic_ext $static_ext $nonxs_ext
24016 # Sanity check: We require an extension suitable for use with
24017 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24018 # should show up as failures in the test suite, but it's helpful to
24019 # catch them now.) The 'extensions' list is normally sorted
24020 # alphabetically, so we need to accept either
24021 # DB_File ... Fcntl ... IO ....
24022 # or something like
24023 # Fcntl ... NDBM_File ... IO ....
24024 case " $extensions" in
24025 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24026 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24027 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24028 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24029 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24033 : Remove libraries needed only for extensions
24034 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24035 : The exception is SunOS 4.x, which needs them.
24036 case "${osname}X${osvers}" in
24040 *) case "$usedl" in
24041 $define|true|[yY]*)
24042 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24046 *) perllibs="$libs"
24052 : Remove build directory name from cppstdin so it can be used from
24053 : either the present location or the final installed location.
24055 : Get out of the UU directory to get correct path name.
24057 case "$cppstdin" in
24059 echo "Stripping down cppstdin path name"
24065 : end of configuration questions
24067 echo "End of configuration questions."
24070 : back to where it started
24071 if test -d ../UU; then
24075 : configuration may be unconditionally patched via a 'config.arch' file
24076 if $test -f config.arch; then
24077 echo "I see a config.arch file, loading it." >&4
24081 : configuration may be patched via a 'config.over' file
24082 if $test -f config.over; then
24085 rp='I see a config.over file. Do you wish to load it?'
24088 n*) echo "OK, I'll ignore it.";;
24090 echo "Configuration override changes have been loaded."
24095 : in case they want portability, strip down executable paths
24096 case "$d_portable" in
24099 echo "Stripping down executable paths..." >&4
24100 for file in $loclist $trylist; do
24102 eval $file=`basename $temp`
24107 : create config.sh file
24109 echo "Creating config.sh..." >&4
24110 $spitshell <<EOT >config.sh
24113 # This file was produced by running the Configure script. It holds all the
24114 # definitions figured out by Configure. Should you modify one of these values,
24115 # do not forget to propagate your changes by running "Configure -der". You may
24116 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24119 # Package name : $package
24120 # Source directory : $src
24121 # Configuration time: $cf_time
24122 # Configured by : $cf_by
24123 # Target system : $myuname
24126 : Add in command line options if available
24127 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24129 $spitshell <<EOT >>config.sh
24138 Revision='$Revision'
24146 alignbytes='$alignbytes'
24147 ansi2knr='$ansi2knr'
24148 aphostname='$aphostname'
24149 api_revision='$api_revision'
24150 api_subversion='$api_subversion'
24151 api_version='$api_version'
24152 api_versionstring='$api_versionstring'
24155 archlibexp='$archlibexp'
24156 archname64='$archname64'
24157 archname='$archname'
24158 archobjs='$archobjs'
24159 asctime_r_proto='$asctime_r_proto'
24168 byteorder='$byteorder'
24170 castflags='$castflags'
24173 cccdlflags='$cccdlflags'
24174 ccdlflags='$ccdlflags'
24176 ccflags_uselargefiles='$ccflags_uselargefiles'
24178 ccsymbols='$ccsymbols'
24179 ccversion='$ccversion'
24181 cf_email='$cf_email'
24183 charbits='$charbits'
24184 charsize='$charsize'
24188 clocktype='$clocktype'
24190 compress='$compress'
24191 contains='$contains'
24195 cpp_stuff='$cpp_stuff'
24196 cppccsymbols='$cppccsymbols'
24197 cppflags='$cppflags'
24199 cppminus='$cppminus'
24201 cppstdin='$cppstdin'
24202 cppsymbols='$cppsymbols'
24203 crypt_r_proto='$crypt_r_proto'
24204 cryptlib='$cryptlib'
24206 ctermid_r_proto='$ctermid_r_proto'
24207 ctime_r_proto='$ctime_r_proto'
24208 d_Gconvert='$d_Gconvert'
24209 d_PRIEUldbl='$d_PRIEUldbl'
24210 d_PRIFUldbl='$d_PRIFUldbl'
24211 d_PRIGUldbl='$d_PRIGUldbl'
24212 d_PRIXU64='$d_PRIXU64'
24213 d_PRId64='$d_PRId64'
24214 d_PRIeldbl='$d_PRIeldbl'
24215 d_PRIfldbl='$d_PRIfldbl'
24216 d_PRIgldbl='$d_PRIgldbl'
24217 d_PRIi64='$d_PRIi64'
24218 d_PRIo64='$d_PRIo64'
24219 d_PRIu64='$d_PRIu64'
24220 d_PRIx64='$d_PRIx64'
24221 d_SCNfldbl='$d_SCNfldbl'
24222 d__fwalk='$d__fwalk'
24223 d_access='$d_access'
24224 d_accessx='$d_accessx'
24228 d_archlib='$d_archlib'
24229 d_asctime64='$d_asctime64'
24230 d_asctime_r='$d_asctime_r'
24235 d_attribute_deprecated='$d_attribute_deprecated'
24236 d_attribute_format='$d_attribute_format'
24237 d_attribute_malloc='$d_attribute_malloc'
24238 d_attribute_nonnull='$d_attribute_nonnull'
24239 d_attribute_noreturn='$d_attribute_noreturn'
24240 d_attribute_pure='$d_attribute_pure'
24241 d_attribute_unused='$d_attribute_unused'
24242 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24243 d_backtrace='$d_backtrace'
24247 d_bsdgetpgrp='$d_bsdgetpgrp'
24248 d_bsdsetpgrp='$d_bsdsetpgrp'
24249 d_builtin_choose_expr='$d_builtin_choose_expr'
24250 d_builtin_expect='$d_builtin_expect'
24252 d_c99_variadic_macros='$d_c99_variadic_macros'
24253 d_casti32='$d_casti32'
24254 d_castneg='$d_castneg'
24256 d_charvspr='$d_charvspr'
24258 d_chroot='$d_chroot'
24259 d_chsize='$d_chsize'
24261 d_clearenv='$d_clearenv'
24262 d_closedir='$d_closedir'
24263 d_cmsghdr_s='$d_cmsghdr_s'
24265 d_copysign='$d_copysign'
24266 d_copysignl='$d_copysignl'
24267 d_cplusplus='$d_cplusplus'
24269 d_crypt_r='$d_crypt_r'
24271 d_ctermid='$d_ctermid'
24272 d_ctermid_r='$d_ctermid_r'
24273 d_ctime64='$d_ctime64'
24274 d_ctime_r='$d_ctime_r'
24275 d_cuserid='$d_cuserid'
24276 d_dbl_dig='$d_dbl_dig'
24277 d_dbminitproto='$d_dbminitproto'
24278 d_difftime64='$d_difftime64'
24279 d_difftime='$d_difftime'
24280 d_dir_dd_fd='$d_dir_dd_fd'
24282 d_dirnamlen='$d_dirnamlen'
24283 d_dladdr='$d_dladdr'
24284 d_dlerror='$d_dlerror'
24285 d_dlopen='$d_dlopen'
24286 d_dlsymun='$d_dlsymun'
24287 d_dosuid='$d_dosuid'
24288 d_drand48_r='$d_drand48_r'
24289 d_drand48proto='$d_drand48proto'
24291 d_eaccess='$d_eaccess'
24292 d_endgrent='$d_endgrent'
24293 d_endgrent_r='$d_endgrent_r'
24294 d_endhent='$d_endhent'
24295 d_endhostent_r='$d_endhostent_r'
24296 d_endnent='$d_endnent'
24297 d_endnetent_r='$d_endnetent_r'
24298 d_endpent='$d_endpent'
24299 d_endprotoent_r='$d_endprotoent_r'
24300 d_endpwent='$d_endpwent'
24301 d_endpwent_r='$d_endpwent_r'
24302 d_endsent='$d_endsent'
24303 d_endservent_r='$d_endservent_r'
24304 d_eofnblk='$d_eofnblk'
24307 d_eunice='$d_eunice'
24310 d_faststdio='$d_faststdio'
24311 d_fchdir='$d_fchdir'
24312 d_fchmod='$d_fchmod'
24313 d_fchown='$d_fchown'
24315 d_fcntl_can_lock='$d_fcntl_can_lock'
24316 d_fd_macros='$d_fd_macros'
24317 d_fd_set='$d_fd_set'
24318 d_fdclose='$d_fdclose'
24320 d_fds_bits='$d_fds_bits'
24321 d_fegetround='$d_fegetround'
24322 d_fgetpos='$d_fgetpos'
24323 d_finite='$d_finite'
24324 d_finitel='$d_finitel'
24325 d_flexfnam='$d_flexfnam'
24327 d_flockproto='$d_flockproto'
24332 d_fp_class='$d_fp_class'
24333 d_fp_classify='$d_fp_classify'
24334 d_fp_classl='$d_fp_classl'
24335 d_fpathconf='$d_fpathconf'
24336 d_fpclass='$d_fpclass'
24337 d_fpclassify='$d_fpclassify'
24338 d_fpclassl='$d_fpclassl'
24339 d_fpgetround='$d_fpgetround'
24340 d_fpos64_t='$d_fpos64_t'
24341 d_frexpl='$d_frexpl'
24342 d_fs_data_s='$d_fs_data_s'
24343 d_fseeko='$d_fseeko'
24344 d_fsetpos='$d_fsetpos'
24345 d_fstatfs='$d_fstatfs'
24346 d_fstatvfs='$d_fstatvfs'
24348 d_ftello='$d_ftello'
24350 d_futimes='$d_futimes'
24351 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24352 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24353 d_getaddrinfo='$d_getaddrinfo'
24354 d_getcwd='$d_getcwd'
24355 d_getespwnam='$d_getespwnam'
24356 d_getfsstat='$d_getfsstat'
24357 d_getgrent='$d_getgrent'
24358 d_getgrent_r='$d_getgrent_r'
24359 d_getgrgid_r='$d_getgrgid_r'
24360 d_getgrnam_r='$d_getgrnam_r'
24361 d_getgrps='$d_getgrps'
24362 d_gethbyaddr='$d_gethbyaddr'
24363 d_gethbyname='$d_gethbyname'
24364 d_gethent='$d_gethent'
24365 d_gethname='$d_gethname'
24366 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24367 d_gethostbyname_r='$d_gethostbyname_r'
24368 d_gethostent_r='$d_gethostent_r'
24369 d_gethostprotos='$d_gethostprotos'
24370 d_getitimer='$d_getitimer'
24371 d_getlogin='$d_getlogin'
24372 d_getlogin_r='$d_getlogin_r'
24373 d_getmnt='$d_getmnt'
24374 d_getmntent='$d_getmntent'
24375 d_getnameinfo='$d_getnameinfo'
24376 d_getnbyaddr='$d_getnbyaddr'
24377 d_getnbyname='$d_getnbyname'
24378 d_getnent='$d_getnent'
24379 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24380 d_getnetbyname_r='$d_getnetbyname_r'
24381 d_getnetent_r='$d_getnetent_r'
24382 d_getnetprotos='$d_getnetprotos'
24383 d_getpagsz='$d_getpagsz'
24384 d_getpbyname='$d_getpbyname'
24385 d_getpbynumber='$d_getpbynumber'
24386 d_getpent='$d_getpent'
24387 d_getpgid='$d_getpgid'
24388 d_getpgrp2='$d_getpgrp2'
24389 d_getpgrp='$d_getpgrp'
24390 d_getppid='$d_getppid'
24391 d_getprior='$d_getprior'
24392 d_getprotobyname_r='$d_getprotobyname_r'
24393 d_getprotobynumber_r='$d_getprotobynumber_r'
24394 d_getprotoent_r='$d_getprotoent_r'
24395 d_getprotoprotos='$d_getprotoprotos'
24396 d_getprpwnam='$d_getprpwnam'
24397 d_getpwent='$d_getpwent'
24398 d_getpwent_r='$d_getpwent_r'
24399 d_getpwnam_r='$d_getpwnam_r'
24400 d_getpwuid_r='$d_getpwuid_r'
24401 d_getsbyname='$d_getsbyname'
24402 d_getsbyport='$d_getsbyport'
24403 d_getsent='$d_getsent'
24404 d_getservbyname_r='$d_getservbyname_r'
24405 d_getservbyport_r='$d_getservbyport_r'
24406 d_getservent_r='$d_getservent_r'
24407 d_getservprotos='$d_getservprotos'
24408 d_getspnam='$d_getspnam'
24409 d_getspnam_r='$d_getspnam_r'
24410 d_gettimeod='$d_gettimeod'
24411 d_gmtime64='$d_gmtime64'
24412 d_gmtime_r='$d_gmtime_r'
24413 d_gnulibc='$d_gnulibc'
24414 d_grpasswd='$d_grpasswd'
24415 d_hasmntopt='$d_hasmntopt'
24419 d_ilogbl='$d_ilogbl'
24420 d_inc_version_list='$d_inc_version_list'
24422 d_inetaton='$d_inetaton'
24423 d_inetntop='$d_inetntop'
24424 d_inetpton='$d_inetpton'
24425 d_int64_t='$d_int64_t'
24426 d_ip_mreq='$d_ip_mreq'
24427 d_ip_mreq_source='$d_ip_mreq_source'
24428 d_ipv6_mreq='$d_ipv6_mreq'
24429 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24430 d_isascii='$d_isascii'
24431 d_isblank='$d_isblank'
24432 d_isfinite='$d_isfinite'
24433 d_isfinitel='$d_isfinitel'
24435 d_isinfl='$d_isinfl'
24436 d_isless='$d_isless'
24438 d_isnanl='$d_isnanl'
24439 d_isnormal='$d_isnormal'
24442 d_killpg='$d_killpg'
24443 d_lc_monetary_2008='$d_lc_monetary_2008'
24444 d_lchown='$d_lchown'
24445 d_ldbl_dig='$d_ldbl_dig'
24446 d_ldexpl='$d_ldexpl'
24447 d_lgamma='$d_lgamma'
24448 d_lgamma_r='$d_lgamma_r'
24449 d_libm_lib_version='$d_libm_lib_version'
24450 d_libname_unique='$d_libname_unique'
24452 d_llrint='$d_llrint'
24453 d_llrintl='$d_llrintl'
24454 d_llround='$d_llround'
24455 d_llroundl='$d_llroundl'
24456 d_localtime64='$d_localtime64'
24457 d_localtime_r='$d_localtime_r'
24458 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24459 d_locconv='$d_locconv'
24464 d_longdbl='$d_longdbl'
24465 d_longlong='$d_longlong'
24467 d_lrintl='$d_lrintl'
24468 d_lround='$d_lround'
24469 d_lroundl='$d_lroundl'
24470 d_lseekproto='$d_lseekproto'
24472 d_madvise='$d_madvise'
24473 d_malloc_good_size='$d_malloc_good_size'
24474 d_malloc_size='$d_malloc_size'
24476 d_mbstowcs='$d_mbstowcs'
24477 d_mbtowc='$d_mbtowc'
24478 d_memchr='$d_memchr'
24479 d_memcmp='$d_memcmp'
24480 d_memcpy='$d_memcpy'
24481 d_memmove='$d_memmove'
24482 d_memset='$d_memset'
24484 d_mkdtemp='$d_mkdtemp'
24485 d_mkfifo='$d_mkfifo'
24486 d_mkstemp='$d_mkstemp'
24487 d_mkstemps='$d_mkstemps'
24488 d_mktime64='$d_mktime64'
24489 d_mktime='$d_mktime'
24492 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24493 d_modflproto='$d_modflproto'
24494 d_mprotect='$d_mprotect'
24496 d_msg_ctrunc='$d_msg_ctrunc'
24497 d_msg_dontroute='$d_msg_dontroute'
24498 d_msg_oob='$d_msg_oob'
24499 d_msg_peek='$d_msg_peek'
24500 d_msg_proxy='$d_msg_proxy'
24501 d_msgctl='$d_msgctl'
24502 d_msgget='$d_msgget'
24503 d_msghdr_s='$d_msghdr_s'
24504 d_msgrcv='$d_msgrcv'
24505 d_msgsnd='$d_msgsnd'
24507 d_munmap='$d_munmap'
24508 d_mymalloc='$d_mymalloc'
24511 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24512 d_nearbyint='$d_nearbyint'
24513 d_nextafter='$d_nextafter'
24514 d_nexttoward='$d_nexttoward'
24516 d_nl_langinfo='$d_nl_langinfo'
24517 d_nv_preserves_uv='$d_nv_preserves_uv'
24518 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24519 d_off64_t='$d_off64_t'
24520 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24521 d_oldpthreads='$d_oldpthreads'
24522 d_oldsock='$d_oldsock'
24524 d_pathconf='$d_pathconf'
24526 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24527 d_phostname='$d_phostname'
24530 d_portable='$d_portable'
24532 d_prctl_set_name='$d_prctl_set_name'
24533 d_printf_format_null='$d_printf_format_null'
24534 d_procselfexe='$d_procselfexe'
24535 d_pseudofork='$d_pseudofork'
24536 d_pthread_atfork='$d_pthread_atfork'
24537 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24538 d_pthread_yield='$d_pthread_yield'
24539 d_ptrdiff_t='$d_ptrdiff_t'
24541 d_pwchange='$d_pwchange'
24542 d_pwclass='$d_pwclass'
24543 d_pwcomment='$d_pwcomment'
24544 d_pwexpire='$d_pwexpire'
24545 d_pwgecos='$d_pwgecos'
24546 d_pwpasswd='$d_pwpasswd'
24547 d_pwquota='$d_pwquota'
24550 d_random_r='$d_random_r'
24551 d_re_comp='$d_re_comp'
24552 d_readdir64_r='$d_readdir64_r'
24553 d_readdir='$d_readdir'
24554 d_readdir_r='$d_readdir_r'
24555 d_readlink='$d_readlink'
24557 d_recvmsg='$d_recvmsg'
24558 d_regcmp='$d_regcmp'
24559 d_regcomp='$d_regcomp'
24560 d_remainder='$d_remainder'
24561 d_remquo='$d_remquo'
24562 d_rename='$d_rename'
24563 d_rewinddir='$d_rewinddir'
24567 d_safebcpy='$d_safebcpy'
24568 d_safemcpy='$d_safemcpy'
24569 d_sanemcmp='$d_sanemcmp'
24570 d_sbrkproto='$d_sbrkproto'
24571 d_scalbn='$d_scalbn'
24572 d_scalbnl='$d_scalbnl'
24573 d_sched_yield='$d_sched_yield'
24574 d_scm_rights='$d_scm_rights'
24575 d_seekdir='$d_seekdir'
24576 d_select='$d_select'
24578 d_semctl='$d_semctl'
24579 d_semctl_semid_ds='$d_semctl_semid_ds'
24580 d_semctl_semun='$d_semctl_semun'
24581 d_semget='$d_semget'
24583 d_sendmsg='$d_sendmsg'
24584 d_setegid='$d_setegid'
24585 d_seteuid='$d_seteuid'
24586 d_setgrent='$d_setgrent'
24587 d_setgrent_r='$d_setgrent_r'
24588 d_setgrps='$d_setgrps'
24589 d_sethent='$d_sethent'
24590 d_sethostent_r='$d_sethostent_r'
24591 d_setitimer='$d_setitimer'
24592 d_setlinebuf='$d_setlinebuf'
24593 d_setlocale='$d_setlocale'
24594 d_setlocale_r='$d_setlocale_r'
24595 d_setnent='$d_setnent'
24596 d_setnetent_r='$d_setnetent_r'
24597 d_setpent='$d_setpent'
24598 d_setpgid='$d_setpgid'
24599 d_setpgrp2='$d_setpgrp2'
24600 d_setpgrp='$d_setpgrp'
24601 d_setprior='$d_setprior'
24602 d_setproctitle='$d_setproctitle'
24603 d_setprotoent_r='$d_setprotoent_r'
24604 d_setpwent='$d_setpwent'
24605 d_setpwent_r='$d_setpwent_r'
24606 d_setregid='$d_setregid'
24607 d_setresgid='$d_setresgid'
24608 d_setresuid='$d_setresuid'
24609 d_setreuid='$d_setreuid'
24610 d_setrgid='$d_setrgid'
24611 d_setruid='$d_setruid'
24612 d_setsent='$d_setsent'
24613 d_setservent_r='$d_setservent_r'
24614 d_setsid='$d_setsid'
24615 d_setvbuf='$d_setvbuf'
24618 d_shmatprototype='$d_shmatprototype'
24619 d_shmctl='$d_shmctl'
24621 d_shmget='$d_shmget'
24622 d_sigaction='$d_sigaction'
24623 d_siginfo_si_errno='$d_siginfo_si_errno'
24624 d_siginfo_si_pid='$d_siginfo_si_pid'
24625 d_siginfo_si_uid='$d_siginfo_si_uid'
24626 d_siginfo_si_addr='$d_siginfo_si_addr'
24627 d_siginfo_si_status='$d_siginfo_si_status'
24628 d_siginfo_si_band='$d_siginfo_si_band'
24629 d_siginfo_si_value='$d_siginfo_si_value'
24630 d_signbit='$d_signbit'
24631 d_sigprocmask='$d_sigprocmask'
24632 d_sigsetjmp='$d_sigsetjmp'
24633 d_sin6_scope_id='$d_sin6_scope_id'
24634 d_sitearch='$d_sitearch'
24635 d_snprintf='$d_snprintf'
24636 d_sockaddr_in6='$d_sockaddr_in6'
24637 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24638 d_sockatmark='$d_sockatmark'
24639 d_sockatmarkproto='$d_sockatmarkproto'
24640 d_socket='$d_socket'
24641 d_socklen_t='$d_socklen_t'
24642 d_sockpair='$d_sockpair'
24643 d_socks5_init='$d_socks5_init'
24644 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24646 d_srand48_r='$d_srand48_r'
24647 d_srandom_r='$d_srandom_r'
24648 d_sresgproto='$d_sresgproto'
24649 d_sresuproto='$d_sresuproto'
24651 d_statblks='$d_statblks'
24652 d_statfs_f_flags='$d_statfs_f_flags'
24653 d_statfs_s='$d_statfs_s'
24654 d_static_inline='$d_static_inline'
24655 d_statvfs='$d_statvfs'
24656 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24657 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24658 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24659 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24660 d_stdio_stream_array='$d_stdio_stream_array'
24661 d_stdiobase='$d_stdiobase'
24662 d_stdstdio='$d_stdstdio'
24663 d_strchr='$d_strchr'
24664 d_strcoll='$d_strcoll'
24665 d_strctcpy='$d_strctcpy'
24666 d_strerrm='$d_strerrm'
24667 d_strerror='$d_strerror'
24668 d_strerror_r='$d_strerror_r'
24669 d_strftime='$d_strftime'
24670 d_strlcat='$d_strlcat'
24671 d_strlcpy='$d_strlcpy'
24672 d_strtod='$d_strtod'
24673 d_strtol='$d_strtol'
24674 d_strtold='$d_strtold'
24675 d_strtoll='$d_strtoll'
24676 d_strtoq='$d_strtoq'
24677 d_strtoul='$d_strtoul'
24678 d_strtoull='$d_strtoull'
24679 d_strtouq='$d_strtouq'
24680 d_strxfrm='$d_strxfrm'
24681 d_suidsafe='$d_suidsafe'
24682 d_symlink='$d_symlink'
24683 d_syscall='$d_syscall'
24684 d_syscallproto='$d_syscallproto'
24685 d_sysconf='$d_sysconf'
24686 d_sysernlst='$d_sysernlst'
24687 d_syserrlst='$d_syserrlst'
24688 d_system='$d_system'
24689 d_tcgetpgrp='$d_tcgetpgrp'
24690 d_tcsetpgrp='$d_tcsetpgrp'
24691 d_telldir='$d_telldir'
24692 d_telldirproto='$d_telldirproto'
24693 d_tgamma='$d_tgamma'
24695 d_timegm='$d_timegm'
24697 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24698 d_tm_tm_zone='$d_tm_tm_zone'
24699 d_tmpnam_r='$d_tmpnam_r'
24701 d_truncate='$d_truncate'
24702 d_truncl='$d_truncl'
24703 d_ttyname_r='$d_ttyname_r'
24704 d_tzname='$d_tzname'
24705 d_u32align='$d_u32align'
24706 d_ualarm='$d_ualarm'
24709 d_union_semun='$d_union_semun'
24710 d_unordered='$d_unordered'
24711 d_unsetenv='$d_unsetenv'
24712 d_usleep='$d_usleep'
24713 d_usleepproto='$d_usleepproto'
24715 d_vendorarch='$d_vendorarch'
24716 d_vendorbin='$d_vendorbin'
24717 d_vendorlib='$d_vendorlib'
24718 d_vendorscript='$d_vendorscript'
24720 d_void_closedir='$d_void_closedir'
24721 d_voidsig='$d_voidsig'
24722 d_voidtty='$d_voidtty'
24723 d_volatile='$d_volatile'
24724 d_vprintf='$d_vprintf'
24725 d_vsnprintf='$d_vsnprintf'
24727 d_waitpid='$d_waitpid'
24728 d_wcscmp='$d_wcscmp'
24729 d_wcstombs='$d_wcstombs'
24730 d_wcsxfrm='$d_wcsxfrm'
24731 d_wctomb='$d_wctomb'
24732 d_writev='$d_writev'
24735 db_hashtype='$db_hashtype'
24736 db_prefixtype='$db_prefixtype'
24737 db_version_major='$db_version_major'
24738 db_version_minor='$db_version_minor'
24739 db_version_patch='$db_version_patch'
24740 direntrytype='$direntrytype'
24743 doubleinfbytes='$doubleinfbytes'
24744 doublekind='$doublekind'
24745 doublemantbits='$doublemantbits'
24746 doublenanbytes='$doublenanbytes'
24747 doublesize='$doublesize'
24749 drand48_r_proto='$drand48_r_proto'
24751 dtraceobject='$dtraceobject'
24752 dynamic_ext='$dynamic_ext'
24758 endgrent_r_proto='$endgrent_r_proto'
24759 endhostent_r_proto='$endhostent_r_proto'
24760 endnetent_r_proto='$endnetent_r_proto'
24761 endprotoent_r_proto='$endprotoent_r_proto'
24762 endpwent_r_proto='$endpwent_r_proto'
24763 endservent_r_proto='$endservent_r_proto'
24764 eunicefix='$eunicefix'
24767 extensions='$extensions'
24768 extern_C='$extern_C'
24770 fflushNULL='$fflushNULL'
24771 fflushall='$fflushall'
24773 firstmakefile='$firstmakefile'
24775 fpossize='$fpossize'
24776 fpostype='$fpostype'
24777 freetype='$freetype'
24780 full_csh='$full_csh'
24781 full_sed='$full_sed'
24782 gccansipedantic='$gccansipedantic'
24783 gccosandvers='$gccosandvers'
24784 gccversion='$gccversion'
24785 getgrent_r_proto='$getgrent_r_proto'
24786 getgrgid_r_proto='$getgrgid_r_proto'
24787 getgrnam_r_proto='$getgrnam_r_proto'
24788 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24789 gethostbyname_r_proto='$gethostbyname_r_proto'
24790 gethostent_r_proto='$gethostent_r_proto'
24791 getlogin_r_proto='$getlogin_r_proto'
24792 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24793 getnetbyname_r_proto='$getnetbyname_r_proto'
24794 getnetent_r_proto='$getnetent_r_proto'
24795 getprotobyname_r_proto='$getprotobyname_r_proto'
24796 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24797 getprotoent_r_proto='$getprotoent_r_proto'
24798 getpwent_r_proto='$getpwent_r_proto'
24799 getpwnam_r_proto='$getpwnam_r_proto'
24800 getpwuid_r_proto='$getpwuid_r_proto'
24801 getservbyname_r_proto='$getservbyname_r_proto'
24802 getservbyport_r_proto='$getservbyport_r_proto'
24803 getservent_r_proto='$getservent_r_proto'
24804 getspnam_r_proto='$getspnam_r_proto'
24805 gidformat='$gidformat'
24811 gmtime_r_proto='$gmtime_r_proto'
24812 gnulibc_version='$gnulibc_version'
24814 groupcat='$groupcat'
24815 groupstype='$groupstype'
24818 h_sysfile='$h_sysfile'
24821 hostgenerate='$hostgenerate'
24822 hostosname='$hostosname'
24823 hostperl='$hostperl'
24824 html1dir='$html1dir'
24825 html1direxp='$html1direxp'
24826 html3dir='$html3dir'
24827 html3direxp='$html3direxp'
24836 i_arpainet='$i_arpainet'
24837 i_assert='$i_assert'
24839 i_bsdioctl='$i_bsdioctl'
24843 i_dirent='$i_dirent'
24845 i_execinfo='$i_execinfo'
24850 i_fp_class='$i_fp_class'
24852 i_gdbm_ndbm='$i_gdbm_ndbm'
24853 i_gdbmndbm='$i_gdbmndbm'
24855 i_ieeefp='$i_ieeefp'
24856 i_inttypes='$i_inttypes'
24857 i_langinfo='$i_langinfo'
24858 i_libutil='$i_libutil'
24859 i_limits='$i_limits'
24860 i_locale='$i_locale'
24861 i_machcthr='$i_machcthr'
24862 i_malloc='$i_malloc'
24863 i_mallocmalloc='$i_mallocmalloc'
24865 i_memory='$i_memory'
24866 i_mntent='$i_mntent'
24869 i_neterrno='$i_neterrno'
24870 i_netinettcp='$i_netinettcp'
24874 i_pthread='$i_pthread'
24876 i_quadmath='$i_quadmath'
24877 i_rpcsvcdbm='$i_rpcsvcdbm'
24879 i_shadow='$i_shadow'
24881 i_stdarg='$i_stdarg'
24882 i_stdbool='$i_stdbool'
24883 i_stddef='$i_stddef'
24884 i_stdint='$i_stdint'
24885 i_stdlib='$i_stdlib'
24886 i_string='$i_string'
24887 i_sunmath='$i_sunmath'
24888 i_sysaccess='$i_sysaccess'
24889 i_sysdir='$i_sysdir'
24890 i_sysfile='$i_sysfile'
24891 i_sysfilio='$i_sysfilio'
24893 i_sysioctl='$i_sysioctl'
24894 i_syslog='$i_syslog'
24895 i_sysmman='$i_sysmman'
24896 i_sysmode='$i_sysmode'
24897 i_sysmount='$i_sysmount'
24898 i_sysndir='$i_sysndir'
24899 i_sysparam='$i_sysparam'
24900 i_syspoll='$i_syspoll'
24901 i_sysresrc='$i_sysresrc'
24902 i_syssecrt='$i_syssecrt'
24903 i_sysselct='$i_sysselct'
24904 i_syssockio='$i_syssockio'
24905 i_sysstat='$i_sysstat'
24906 i_sysstatfs='$i_sysstatfs'
24907 i_sysstatvfs='$i_sysstatvfs'
24908 i_systime='$i_systime'
24909 i_systimek='$i_systimek'
24910 i_systimes='$i_systimes'
24911 i_systypes='$i_systypes'
24912 i_sysuio='$i_sysuio'
24914 i_sysutsname='$i_sysutsname'
24915 i_sysvfs='$i_sysvfs'
24916 i_syswait='$i_syswait'
24917 i_termio='$i_termio'
24918 i_termios='$i_termios'
24920 i_unistd='$i_unistd'
24923 i_values='$i_values'
24924 i_varargs='$i_varargs'
24925 i_varhdr='$i_varhdr'
24927 ignore_versioned_solibs='$ignore_versioned_solibs'
24928 inc_version_list='$inc_version_list'
24929 inc_version_list_init='$inc_version_list_init'
24933 initialinstalllocation='$initialinstalllocation'
24934 installarchlib='$installarchlib'
24935 installbin='$installbin'
24936 installhtml1dir='$installhtml1dir'
24937 installhtml3dir='$installhtml3dir'
24938 installman1dir='$installman1dir'
24939 installman3dir='$installman3dir'
24940 installprefix='$installprefix'
24941 installprefixexp='$installprefixexp'
24942 installprivlib='$installprivlib'
24943 installscript='$installscript'
24944 installsitearch='$installsitearch'
24945 installsitebin='$installsitebin'
24946 installsitehtml1dir='$installsitehtml1dir'
24947 installsitehtml3dir='$installsitehtml3dir'
24948 installsitelib='$installsitelib'
24949 installsiteman1dir='$installsiteman1dir'
24950 installsiteman3dir='$installsiteman3dir'
24951 installsitescript='$installsitescript'
24952 installstyle='$installstyle'
24953 installusrbinperl='$installusrbinperl'
24954 installvendorarch='$installvendorarch'
24955 installvendorbin='$installvendorbin'
24956 installvendorhtml1dir='$installvendorhtml1dir'
24957 installvendorhtml3dir='$installvendorhtml3dir'
24958 installvendorlib='$installvendorlib'
24959 installvendorman1dir='$installvendorman1dir'
24960 installvendorman3dir='$installvendorman3dir'
24961 installvendorscript='$installvendorscript'
24963 issymlink='$issymlink'
24964 ivdformat='$ivdformat'
24967 known_extensions='$known_extensions'
24970 ld_can_script='$ld_can_script'
24971 lddlflags='$lddlflags'
24973 ldflags_uselargefiles='$ldflags_uselargefiles'
24974 ldlibpthname='$ldlibpthname'
24981 libsdirs='$libsdirs'
24982 libsfiles='$libsfiles'
24983 libsfound='$libsfound'
24984 libspath='$libspath'
24985 libswanted='$libswanted'
24986 libswanted_uselargefiles='$libswanted_uselargefiles'
24992 localtime_r_proto='$localtime_r_proto'
24993 locincpth='$locincpth'
24994 loclibpth='$loclibpth'
24995 longdblinfbytes='$longdblinfbytes'
24996 longdblkind='$longdblkind'
24997 longdblmantbits='$longdblmantbits'
24998 longdblnanbytes='$longdblnanbytes'
24999 longdblsize='$longdblsize'
25000 longlongsize='$longlongsize'
25001 longsize='$longsize'
25005 lseeksize='$lseeksize'
25006 lseektype='$lseektype'
25010 make_set_make='$make_set_make'
25011 mallocobj='$mallocobj'
25012 mallocsrc='$mallocsrc'
25013 malloctype='$malloctype'
25015 man1direxp='$man1direxp'
25018 man3direxp='$man3direxp'
25020 mips_type='$mips_type'
25021 mistrustnm='$mistrustnm'
25023 mmaptype='$mmaptype'
25024 modetype='$modetype'
25026 multiarch='$multiarch'
25028 myarchname='$myarchname'
25029 mydomain='$mydomain'
25030 myhostname='$myhostname'
25033 need_va_copy='$need_va_copy'
25034 netdb_hlen_type='$netdb_hlen_type'
25035 netdb_host_type='$netdb_host_type'
25036 netdb_name_type='$netdb_name_type'
25037 netdb_net_type='$netdb_net_type'
25040 nm_so_opt='$nm_so_opt'
25041 nonxs_ext='$nonxs_ext'
25043 nvEUformat='$nvEUformat'
25044 nvFUformat='$nvFUformat'
25045 nvGUformat='$nvGUformat'
25046 nv_overflows_integers_at='$nv_overflows_integers_at'
25047 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25048 nveformat='$nveformat'
25049 nvfformat='$nvfformat'
25050 nvgformat='$nvgformat'
25051 nvmantbits='$nvmantbits'
25054 o_nonblock='$o_nonblock'
25056 old_pthread_create_joinable='$old_pthread_create_joinable'
25057 optimize='$optimize'
25058 orderlib='$orderlib'
25061 otherlibdirs='$otherlibdirs'
25065 patchlevel='$patchlevel'
25066 path_sep='$path_sep'
25069 perl_patchlevel='$perl_patchlevel'
25070 perl_static_inline='$perl_static_inline'
25071 perladmin='$perladmin'
25072 perllibs='$perllibs'
25073 perlpath='$perlpath'
25075 phostname='$phostname'
25081 prefixexp='$prefixexp'
25083 privlibexp='$privlibexp'
25084 procselfexe='$procselfexe'
25085 prototype='$prototype'
25087 quadkind='$quadkind'
25088 quadtype='$quadtype'
25089 randbits='$randbits'
25090 randfunc='$randfunc'
25091 random_r_proto='$random_r_proto'
25092 randseedtype='$randseedtype'
25094 rd_nodata='$rd_nodata'
25095 readdir64_r_proto='$readdir64_r_proto'
25096 readdir_r_proto='$readdir_r_proto'
25097 revision='$revision'
25103 sGMTIME_max='$sGMTIME_max'
25104 sGMTIME_min='$sGMTIME_min'
25105 sLOCALTIME_max='$sLOCALTIME_max'
25106 sLOCALTIME_min='$sLOCALTIME_min'
25107 sPRIEUldbl='$sPRIEUldbl'
25108 sPRIFUldbl='$sPRIFUldbl'
25109 sPRIGUldbl='$sPRIGUldbl'
25110 sPRIXU64='$sPRIXU64'
25112 sPRIeldbl='$sPRIeldbl'
25113 sPRIfldbl='$sPRIfldbl'
25114 sPRIgldbl='$sPRIgldbl'
25119 sSCNfldbl='$sSCNfldbl'
25120 sched_yield='$sched_yield'
25121 scriptdir='$scriptdir'
25122 scriptdirexp='$scriptdirexp'
25124 seedfunc='$seedfunc'
25125 selectminbits='$selectminbits'
25126 selecttype='$selecttype'
25127 sendmail='$sendmail'
25128 setgrent_r_proto='$setgrent_r_proto'
25129 sethostent_r_proto='$sethostent_r_proto'
25130 setlocale_r_proto='$setlocale_r_proto'
25131 setnetent_r_proto='$setnetent_r_proto'
25132 setprotoent_r_proto='$setprotoent_r_proto'
25133 setpwent_r_proto='$setpwent_r_proto'
25134 setservent_r_proto='$setservent_r_proto'
25137 sharpbang='$sharpbang'
25138 shmattype='$shmattype'
25139 shortsize='$shortsize'
25142 sig_count='$sig_count'
25143 sig_name='$sig_name'
25144 sig_name_init='$sig_name_init'
25146 sig_num_init='$sig_num_init'
25147 sig_size='$sig_size'
25148 signal_t='$signal_t'
25149 sitearch='$sitearch'
25150 sitearchexp='$sitearchexp'
25152 sitebinexp='$sitebinexp'
25153 sitehtml1dir='$sitehtml1dir'
25154 sitehtml1direxp='$sitehtml1direxp'
25155 sitehtml3dir='$sitehtml3dir'
25156 sitehtml3direxp='$sitehtml3direxp'
25158 sitelib_stem='$sitelib_stem'
25159 sitelibexp='$sitelibexp'
25160 siteman1dir='$siteman1dir'
25161 siteman1direxp='$siteman1direxp'
25162 siteman3dir='$siteman3dir'
25163 siteman3direxp='$siteman3direxp'
25164 siteprefix='$siteprefix'
25165 siteprefixexp='$siteprefixexp'
25166 sitescript='$sitescript'
25167 sitescriptexp='$sitescriptexp'
25168 sizesize='$sizesize'
25169 sizetype='$sizetype'
25173 sockethdr='$sockethdr'
25174 socketlib='$socketlib'
25175 socksizetype='$socksizetype'
25177 spackage='$spackage'
25178 spitshell='$spitshell'
25179 srand48_r_proto='$srand48_r_proto'
25180 srandom_r_proto='$srandom_r_proto'
25182 ssizetype='$ssizetype'
25183 st_ino_sign='$st_ino_sign'
25184 st_ino_size='$st_ino_size'
25185 startperl='$startperl'
25187 static_ext='$static_ext'
25189 stdio_base='$stdio_base'
25190 stdio_bufsiz='$stdio_bufsiz'
25191 stdio_cnt='$stdio_cnt'
25192 stdio_filbuf='$stdio_filbuf'
25193 stdio_ptr='$stdio_ptr'
25194 stdio_stream_array='$stdio_stream_array'
25195 strerror_r_proto='$strerror_r_proto'
25198 subversion='$subversion'
25203 targetarch='$targetarch'
25204 targetdir='$targetdir'
25205 targetenv='$targetenv'
25206 targethost='$targethost'
25207 targetmkdir='$targetmkdir'
25208 targetport='$targetport'
25209 targetsh='$targetsh'
25213 timeincl='$timeincl'
25214 timetype='$timetype'
25215 tmpnam_r_proto='$tmpnam_r_proto'
25221 ttyname_r_proto='$ttyname_r_proto'
25230 uidformat='$uidformat'
25236 uquadtype='$uquadtype'
25237 use5005threads='$use5005threads'
25238 use64bitall='$use64bitall'
25239 use64bitint='$use64bitint'
25240 usecbacktrace='$usecbacktrace'
25241 usecrosscompile='$usecrosscompile'
25242 usedevel='$usedevel'
25244 usedtrace='$usedtrace'
25245 usefaststdio='$usefaststdio'
25246 useithreads='$useithreads'
25247 usekernprocpathname='$usekernprocpathname'
25248 uselargefiles='$uselargefiles'
25249 uselongdouble='$uselongdouble'
25250 usemallocwrap='$usemallocwrap'
25251 usemorebits='$usemorebits'
25252 usemultiplicity='$usemultiplicity'
25253 usemymalloc='$usemymalloc'
25255 usensgetexecutablepath='$usensgetexecutablepath'
25256 useopcode='$useopcode'
25257 useperlio='$useperlio'
25258 useposix='$useposix'
25259 usequadmath='$usequadmath'
25260 usereentrant='$usereentrant'
25261 userelocatableinc='$userelocatableinc'
25262 useshrplib='$useshrplib'
25263 usesitecustomize='$usesitecustomize'
25264 usesocks='$usesocks'
25265 usethreads='$usethreads'
25266 usevendorprefix='$usevendorprefix'
25267 useversionedarchname='$useversionedarchname'
25268 usevfork='$usevfork'
25271 uvXUformat='$uvXUformat'
25272 uvoformat='$uvoformat'
25275 uvuformat='$uvuformat'
25276 uvxformat='$uvxformat'
25278 vendorarch='$vendorarch'
25279 vendorarchexp='$vendorarchexp'
25280 vendorbin='$vendorbin'
25281 vendorbinexp='$vendorbinexp'
25282 vendorhtml1dir='$vendorhtml1dir'
25283 vendorhtml1direxp='$vendorhtml1direxp'
25284 vendorhtml3dir='$vendorhtml3dir'
25285 vendorhtml3direxp='$vendorhtml3direxp'
25286 vendorlib='$vendorlib'
25287 vendorlib_stem='$vendorlib_stem'
25288 vendorlibexp='$vendorlibexp'
25289 vendorman1dir='$vendorman1dir'
25290 vendorman1direxp='$vendorman1direxp'
25291 vendorman3dir='$vendorman3dir'
25292 vendorman3direxp='$vendorman3direxp'
25293 vendorprefix='$vendorprefix'
25294 vendorprefixexp='$vendorprefixexp'
25295 vendorscript='$vendorscript'
25296 vendorscriptexp='$vendorscriptexp'
25298 version_patchlevel_string='$version_patchlevel_string'
25299 versiononly='$versiononly'
25303 yaccflags='$yaccflags'
25308 : add special variables
25309 $test -f $src/patchlevel.h && \
25310 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25311 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25312 echo "PERL_CONFIG_SH=true" >>config.sh
25314 : propagate old symbols
25315 if $test -f UU/config.sh; then
25316 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25317 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25318 config.sh config.sh UU/oldconfig.sh |\
25319 $sort | $uniq -u >UU/oldsyms
25320 set X `$cat UU/oldsyms`
25326 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25328 echo ": Variables propagated from previous config.sh file." >>config.sh
25329 for sym in `$cat UU/oldsyms`; do
25330 echo " Propagating $hint variable "'$'"$sym..."
25331 eval 'tmp="$'"${sym}"'"'
25333 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25339 : preserve RCS keywords in files with variable substitution, grrr
25342 : Finish up by extracting the .SH files
25346 echo "Extraction done."
25356 If you'd like to make any changes to the config.sh file before I begin
25357 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25360 rp="Press return or use a shell escape to edit config.sh:"
25365 *) : in case they cannot read
25366 sh 1>&4 -c "$ans";;
25371 : if this fails, just run all the .SH files by hand
25380 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25387 Now you need to generate make dependencies by running "$make depend".
25388 You might prefer to run it in background: "$make depend > makedepend.out &"
25389 It can take a while, so you might not want to run it right now.
25394 rp="Run $make depend now?"
25398 $make depend && echo "Now you must run '$make'."
25401 echo "You must run '$make depend' then '$make'."
25404 elif test -f [Mm]akefile; then
25406 echo "Now you must run a $make."
25408 echo "Configure done."
25411 if $test -f Policy.sh; then
25414 If you compile $package on a different machine or from a different object
25415 directory, copy the Policy.sh file from this object directory to the
25416 new one before you run Configure -- this will help you with most of
25417 the policy defaults.
25421 if $test -f config.msg; then
25422 echo "Hmm. I also noted the following information while running:"
25424 $cat config.msg >&4
25427 $rm -f kit*isdone ark*isdone