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=''
531 gethostbyaddr_r_proto=''
533 gethostbyname_r_proto=''
535 gethostent_r_proto=''
548 getnetbyaddr_r_proto=''
550 getnetbyname_r_proto=''
564 d_getprotobyname_r=''
565 getprotobyname_r_proto=''
566 d_getprotobynumber_r=''
567 getprotobynumber_r_proto=''
569 getprotoent_r_proto=''
581 getservbyname_r_proto=''
583 getservbyport_r_proto=''
585 getservent_r_proto=''
618 d_lc_monetary_2008=''
623 d_libm_lib_version=''
630 d_localtime_r_needs_tzset=''
638 d_long_double_style_ieee=''
639 d_long_double_style_ieee_doubledouble=''
640 d_long_double_style_ieee_extended=''
641 d_long_double_style_ieee_std=''
642 d_long_double_style_vax=''
655 d_malloc_good_size=''
709 d_old_pthread_create_joinable=''
710 old_pthread_create_joinable=''
712 d_pthread_attr_setscope=''
760 sethostent_r_proto=''
777 setprotoent_r_proto=''
789 setservent_r_proto=''
802 d_siginfo_si_errno=''
805 d_siginfo_si_status=''
807 d_siginfo_si_value=''
819 d_ipv6_mreq_source=''
836 d_sprintf_returns_strlen=''
849 perl_static_inline=''
854 d_stdio_ptr_lval_nochange_cnt=''
855 d_stdio_ptr_lval_sets_cnt=''
940 default_inc_excludes_dot='undef'
1010 d_gdbm_ndbm_h_uses_prototypes=''
1011 d_gdbmndbm_h_uses_prototypes=''
1013 d_ndbm_h_uses_prototypes=''
1089 d_inc_version_list=''
1091 inc_version_list_init=''
1099 installusrbinperl=''
1115 ignore_versioned_solibs=''
1131 d_double_has_negative_zero=''
1132 d_double_has_subnormals=''
1133 d_double_style_cray=''
1134 d_double_style_ibm=''
1135 d_double_style_ieee=''
1136 d_double_style_vax=''
1187 d_perl_otherlibdirs=''
1195 api_versionstring=''
1201 version_patchlevel_string=''
1205 d_nv_preserves_uv=''
1206 d_nv_zero_is_allbits_zero=''
1217 nv_overflows_integers_at=''
1218 nv_preserves_uv_bits=''
1291 installsitehtml1dir=''
1294 installsitehtml3dir=''
1301 installsiteman1dir=''
1304 installsiteman3dir=''
1309 installsitescript=''
1327 d_stdio_stream_array=''
1328 stdio_stream_array=''
1346 usekernprocpathname=''
1347 ccflags_uselargefiles=''
1348 ldflags_uselargefiles=''
1349 libswanted_uselargefiles=''
1358 usensgetexecutablepath=''
1372 installvendorarch=''
1379 installvendorhtml1dir=''
1381 vendorhtml1direxp=''
1382 installvendorhtml3dir=''
1384 vendorhtml3direxp=''
1390 installvendorman1dir=''
1393 installvendorman3dir=''
1400 installvendorscript=''
1411 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1414 : We must find out about Eunice early
1416 if test -f /etc/unixtovms; then
1417 eunicefix=/etc/unixtovms
1419 if test -f /etc/unixtovms.exe; then
1420 eunicefix=/etc/unixtovms.exe
1423 : Set executable suffix now -- needed before hints available
1424 if test -f "/libs/version.library"; then
1427 elif test -f "/system/gnu_library/bin/ar.pm"; then
1430 elif test -n "$DJGPP"; then
1433 elif test -f /kern/cookiejar; then
1436 elif test -d c:/. -o -n "$is_os2" ; then
1443 : Possible local include directories to search.
1444 : Set locincpth to "" in a hint file to defeat local include searches.
1445 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1446 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1448 : no include file wanted by default
1451 : Enable -DEBUGGING and -DDEBUGGING from the command line
1455 : Trailing extension. Override this in a hint file, if needed.
1456 : Extra object files, if any, needed on this platform.
1459 : change the next line if compiling for Xenix/286 on Xenix/386
1460 xlibpth='/usr/lib/386 /lib/386'
1461 : Possible local library directories to search.
1462 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1463 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1465 : general looking path for locating libraries
1466 glibpth="/lib /usr/lib $xlibpth"
1467 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1468 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1469 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1470 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1472 : Private path used by Configure to find libraries. Its value
1473 : is prepended to libpth. This variable takes care of special
1474 : machines, like the mips. Usually, it should be empty.
1477 : default library list
1479 : some systems want to use only the non-versioned libso:s
1480 ignore_versioned_solibs=''
1484 : set useposix=false in your hint file to disable the POSIX extension.
1486 : set useopcode=false in your hint file to disable the Opcode extension.
1489 ccflags_uselargefiles=''
1490 ldflags_uselargefiles=''
1491 libswanted_uselargefiles=''
1492 : set usemultiplicity on the Configure command line to enable multiplicity.
1493 : set usesocks on the Configure command line to enable socks.
1495 : set usethreads on the Configure command line to enable threads.
1496 usereentrant='undef'
1497 : List of libraries we want.
1498 : If anyone needs extra -lxxx, put those in a hint file.
1499 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1500 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1501 : We probably want to search /usr/shlib before most other libraries.
1502 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1503 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1504 glibpth="/usr/shlib $glibpth"
1505 : Do not use vfork unless overridden by a hint file.
1508 : Find the basic shell for Bourne shell scripts
1512 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1515 if test -f "$xxx"; then
1518 : Build up a list and do a single loop so we can 'break' out.
1519 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1520 for xxx in sh bash ksh pdksh ash; do
1522 try="$try ${p}/${xxx}"
1526 if test -f "$xxx"; then
1529 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1532 elif test -f "$xxx.exe"; then
1543 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1545 Usually it's in /bin/sh. How did you even get this far?
1546 Please contact me (Perl Maintainers) at perlbug@perl.org and
1547 we'll try to straighten this all out.
1553 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1554 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1557 : see if sh knows # comments
1558 if `$sh -c '#' >/dev/null 2>&1`; then
1562 test -f $xcat$_exe || xcat=/usr/bin/cat
1563 if test ! -f $xcat$_exe; then
1564 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1565 if test -f $p/cat$_exe; then
1570 if test ! -f $xcat$_exe; then
1571 echo "Can't find cat anywhere!"
1575 echo "#!$xcat" >sharp
1578 ./sharp > today 2>/dev/null
1579 if test -s today; then
1582 echo "#! $xcat" > sharp
1585 ./sharp > today 2>/dev/null
1586 if test -s today; then
1594 echo "Your $sh doesn't grok # comments--I will strip them later on."
1597 echo "exec grep -v '^[ ]*#'" >spitshell
1599 $eunicefix spitshell
1600 spitshell=`pwd`/spitshell
1602 echo "I presume that if # doesn't work, #! won't work either!"
1607 : figure out how to guarantee sh startup
1609 '') startsh=${sharpbang}${sh} ;;
1621 : echo "Yup, it does."
1623 echo "Hmm... '$startsh' does not guarantee sh startup..."
1624 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1628 : Save command line options in file UU/cmdline.opt for later use in
1629 : generating config.sh.
1630 cat > cmdline.opt <<EOSH
1631 : Configure command line arguments.
1640 cat >>cmdline.opt <<EOSH
1641 config_arg$argn='$arg'
1643 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1646 arg_exp=`cat cmdl.opt`
1647 args_exp="$args_exp$args_sep'$arg_exp'"
1648 argn=`expr $argn + 1`
1653 : produce awk script to parse command line options
1654 cat >options.awk <<'EOF'
1656 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1658 len = length(optstr);
1659 for (i = 1; i <= len; i++) {
1660 c = substr(optstr, i, 1);
1661 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1672 if (substr(str, 1, 1) != "-") {
1673 printf("'%s'\n", str);
1677 for (i = 2; i <= len; i++) {
1678 c = substr(str, i, 1);
1680 printf("-%s\n", substr(str, i));
1686 printf("'%s'\n", substr(str, i + 1));
1699 : process the command line options
1700 set X `for arg in "$@"; do echo "X$arg"; done |
1701 sed -e s/X// | awk -f options.awk`
1706 : set up default values
1715 rm -f optdef.sh posthint.sh
1716 cat >optdef.sh <<EOS
1722 while test $# -gt 0; do
1724 -d) shift; fastread=yes;;
1725 -e) shift; alldone=cont;;
1729 if test -r "$1"; then
1732 echo "$me: cannot read config file $1." >&2
1738 -h) shift; error=true;;
1739 -r) shift; reuseval=true;;
1740 -s) shift; silent=true; realsilent=true;;
1741 -E) shift; alldone=exit;;
1742 -K) shift; knowitall=true;;
1744 -S) shift; silent=true; extractsh=true;;
1749 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1750 echo "$me: ignoring -D $1" >&2
1753 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1754 *) echo "$1='define'" >> optdef.sh;;
1761 *=) echo "$1" >> optdef.sh;;
1763 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1764 echo "$me: ignoring -U $1" >&2
1766 *) echo "$1='undef'" >> optdef.sh;;
1777 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1781 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1782 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1788 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1789 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1790 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1791 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1792 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1793 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1799 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1801 echo "$yyy=''" >> posthint.sh ;;
1806 echo "$yyy='$zzz'" >> posthint.sh ;;
1808 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1810 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1815 echo "$yyy=$zzz" >> posthint.sh ;;
1816 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1820 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1823 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1831 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1832 [-U symbol] [-U symbol=] [-A command:symbol...]
1833 -d : use defaults for all answers.
1834 -e : go on without questioning past the production of config.sh.
1835 -f : specify an alternate default configuration file.
1836 -h : print this help message and exit (with an error status).
1837 -r : reuse C symbols value if possible (skips costly nm extraction).
1838 -s : silent mode, only echoes questions and essential information.
1839 -D : define symbol to have some value:
1840 -D symbol symbol gets the value 'define'
1841 -D symbol=value symbol gets the value 'value'
1842 common used examples (see INSTALL for more info):
1843 -Duse64bitint use 64bit integers
1844 -Duse64bitall use 64bit integers and pointers
1845 -Dusethreads use thread support
1846 -Dinc_version_list=none do not include older perl trees in @INC
1847 -DEBUGGING=none DEBUGGING options
1848 -Dcc=gcc choose your compiler
1849 -Dprefix=/opt/perl5 choose your destination
1850 -E : stop at the end of questions, after having produced config.sh.
1851 -K : do not use unless you know what you are doing.
1852 -O : ignored for backward compatibility
1853 -S : perform variable substitutions on all .SH files (can mix with -f)
1854 -U : undefine symbol:
1855 -U symbol symbol gets the value 'undef'
1856 -U symbol= symbol gets completely empty
1858 -A : manipulate symbol after the platform specific hints have been applied:
1859 -A append:symbol=value append value to symbol
1860 -A symbol=value like append:, but with a separating space
1861 -A define:symbol=value define symbol to have value
1862 -A clear:symbol define symbol to be ''
1863 -A define:symbol define symbol to be 'define'
1864 -A eval:symbol=value define symbol to be eval of value
1865 -A prepend:symbol=value prepend value to symbol
1866 -A undef:symbol define symbol to be 'undef'
1867 -A undef:symbol= define symbol to be ''
1868 e.g.: -A prepend:libswanted='cl pthread '
1869 -A ccflags=-DSOME_MACRO
1870 -V : print version number and exit (with a zero status).
1877 case "$fastread$alldone" in
1880 case "$extractsh" in
1883 if test ! -t 0; then
1884 echo "Say 'sh Configure', not 'sh <Configure'"
1894 true) exec 1>/dev/null;;
1897 : run the defines and the undefines, if any, but leave the file out there...
1899 grep '\\' optdef.sh >/dev/null 2>&1
1900 if test $? = 0; then
1901 echo "Configure does not support \\ in -D arguments"
1905 : create the posthint manipulation script and leave the file out there...
1910 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1911 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1912 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1913 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1914 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1917 : Some greps do not return status, grrr.
1918 echo "grimblepritz" >grimble
1919 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1921 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1927 : the following should work in any shell
1931 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1932 cat >contains <<'EOSS'
1933 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1938 : Find the path to the source tree
1941 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1945 *) src=`cd ../$src && pwd` ;;
1958 if test -f $rsrc/Configure && \
1959 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1961 : found it, so we are ok.
1964 for src in . .. ../.. ../../.. ../../../..; do
1965 if test -f ../$src/Configure && \
1966 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1977 Sorry, I can't seem to locate the source dir for $package. Please start
1978 Configure with an explicit path -- i.e. /some/path/Configure.
1986 echo "Sources for $package found in \"$src\"." >&4
1990 : script used to extract .SH files with variable substitutions
1991 cat >extract <<'EOS'
1993 echo "Doing variable substitutions on .SH files..."
1994 if test -f MANIFEST; then
1995 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1997 echo "(Looking for .SH files under the source directory.)"
1998 set x `(cd "$src"; find . -name "*.SH" -print)`
2002 0) set x `(cd "$src"; echo *.SH)`; shift;;
2004 if test ! -f "$src/$1"; then
2010 while test $name; do
2011 if test ! -d "$name"; then
2012 create="$name $create";
2013 name=`echo $name | sed -e "s|^[^/]*$||"`;
2014 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2019 for file in $create; do
2028 dir=`expr X$file : 'X\(.*\)/'`
2029 file=`expr X$file : 'X.*/\(.*\)'`
2030 (cd "$dir" && . ./$file)
2040 dir=`expr X$file : 'X\(.*\)/'`
2041 file=`expr X$file : 'X.*/\(.*\)'`
2042 (set x $dir; shift; eval $mkdir_p)
2043 sh <"$src/$dir/$file"
2052 if test -f "$src/config_h.SH"; then
2053 if test ! -f config.h; then
2054 : oops, they left it out of MANIFEST, probably, so do it anyway.
2055 . "$src/config_h.SH"
2060 : extract files and exit if asked to do so
2061 case "$extractsh" in
2063 case "$realsilent" in
2067 case "$config_sh" in
2068 '') config_sh='config.sh';;
2071 echo "Fetching answers from $config_sh..."
2078 echo "Extraction done."
2083 : Eunice requires " " instead of "", can you believe it
2086 echo "Beginning of configuration questions for $package."
2088 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2090 : first determine how to suppress newline on echo command
2092 echo "Checking echo to see how to suppress newlines..."
2093 (echo "hi there\c" ; echo " ") >.echotmp
2094 if $contains c .echotmp >/dev/null 2>&1 ; then
2105 echo $n "The star should be here-->$c"
2109 : Now test for existence of everything in MANIFEST
2111 if test -f "$rsrc/MANIFEST"; then
2112 echo "First let's make sure your kit is complete. Checking..." >&4
2113 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2114 (split -l 50 2>/dev/null || split -50)
2117 for filelist in x??; do
2118 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2119 >/dev/null 2>>"$tmppwd/missing")
2121 if test -s missing; then
2125 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2127 You have the option of continuing the configuration process, despite the
2128 distinct possibility that your kit is damaged, by typing 'y'es. If you
2129 do, don't blame me if something goes wrong. I advise you to type 'n'o
2130 and contact the author (perlbug@perl.org).
2133 echo $n "Continue? [n] $c" >&4
2137 echo "Continuing..." >&4
2141 echo "ABORTING..." >&4
2146 echo "Looks good..."
2149 echo "There is no MANIFEST file. I hope your kit is complete !"
2153 : Find the appropriate value for a newline for tr
2154 if test -n "$DJGPP"; then
2157 if test X"$trnl" = X; then
2158 case "`echo foo | tr '\n' x 2>/dev/null`" in
2162 if test X"$trnl" = X; then
2163 case "`echo foo | tr '\012' x 2>/dev/null`" in
2164 foox) trnl='\012' ;;
2167 if test X"$trnl" = X; then
2168 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2169 fooxy) trnl='\n\r' ;;
2172 if test X"$trnl" = X; then
2175 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2181 : compute the number of columns on the terminal for proper question formatting
2186 : set up the echo used in my read
2187 myecho="case \"\$xxxm\" in
2188 '') echo $n \"\$rp $c\" >&4;;
2190 '') echo $n \"[\$xxxm] $c\";;
2192 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2194 echo $n \"[\$xxxm] $c\" >&4
2196 echo $n \"\$rp [\$xxxm] $c\" >&4
2202 : now set up to do reads with possible shell escape and default assignment
2208 case "\$fastread" in
2209 yes) case "\$dflt" in
2212 case "\$silent-\$rp" in
2217 *) case "\$silent" in
2218 true) case "\$rp" in
2223 while expr "X\$ans" : "X!" >/dev/null; do
2227 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2235 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2244 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2249 echo "(OK, I'll run with -d after this question.)" >&4
2252 echo "*** Sorry, \$1 not supported yet." >&4
2262 echo "*** Substitution done -- please confirm."
2264 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2269 echo "*** Error -- try again."
2276 case "\$ans\$xxxm\$nostick" in
2288 : create .config dir to save info across Configure sessions
2289 test -d ../.config || mkdir ../.config
2290 cat >../.config/README <<EOF
2291 This directory created by Configure to save information that should
2292 persist across sessions for $package.
2294 You may safely delete it if you wish.
2297 : See if we are using a devel version and want that
2298 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2301 usedevel="$define" ;;
2302 *) case "$xversion" in
2305 *** WHOA THERE!!! ***
2307 This is an UNSTABLE DEVELOPMENT release.
2308 The version of this $package distribution is $xversion, that is, odd,
2309 (as opposed to even) and that signifies a development release.
2310 If you want a maintenance release, you want an even-numbered version.
2312 Do ***NOT*** install this into production use.
2313 Data corruption and crashes are possible.
2315 It is most seriously suggested that you do not continue any further
2316 unless you want to help in developing and debugging Perl.
2318 If you *still* want to build perl, you can answer 'y' now,
2319 or pass -Dusedevel to Configure.
2322 rp='Do you really want to continue?'
2326 [yY]) echo >&4 "Okay, continuing."
2327 usedevel="$define" ;;
2328 *) echo >&4 "Okay, bye."
2339 case "$versiononly" in
2340 '') versiononly="$define" ;;
2342 case "$installusrbinperl" in
2343 '') installusrbinperl="$undef" ;;
2348 : general instructions
2351 user=`(logname) 2>/dev/null`
2353 '') user=`whoami 2>&1`;;
2355 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2358 rp='Would you like to see the instructions?'
2369 This installation shell script will examine your system and ask you questions
2370 to determine how the perl5 package should be installed. If you get
2371 stuck on a question, you may use a ! shell escape to start a subshell or
2372 execute a command. Many of the questions will have default answers in square
2373 brackets; typing carriage return will give you the default.
2375 On some of the questions which ask for file or directory names you are allowed
2376 to use the ~name construct to specify the login directory belonging to "name",
2377 even if you don't have a shell which knows about that. Questions where this is
2378 allowed will be marked "(~name ok)".
2382 dflt='Type carriage return to continue'
2386 The prompter used in this script allows you to use shell variables and
2387 backticks in your answers. You may use $1, $2, etc... to refer to the words
2388 in the default answer, as if the default line was a set of arguments given to a
2389 script shell. This means you may also use $* to repeat the whole default line,
2390 so you do not have to re-type everything to add something to the default.
2392 Every time there is a substitution, you will have to confirm. If there is an
2393 error (e.g. an unmatched backtick), the default answer will remain unchanged
2394 and you will be prompted again.
2396 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2397 the questions and use the computed defaults (or the previous answers if there
2398 was already a config.sh file). Type 'Configure -h' for a list of options.
2399 You may also start interactively and then answer '& -d' at any prompt to turn
2400 on the non-interactive behaviour for the remainder of the execution.
2406 Much effort has been expended to ensure that this shell script will run on any
2407 Unix system. If despite that it blows up on yours, your best bet is to edit
2408 Configure and run it again. If you can't run Configure for some reason,
2409 you'll have to generate a config.sh file by hand. Whatever problems you
2410 have, let me (perlbug@perl.org) know how I blew it.
2412 This installation script affects things in two ways:
2414 1) it may do direct variable substitutions on some of the files included
2416 2) it builds a config.h file for inclusion in C programs. You may edit
2417 any of these files as the need arises after running this script.
2419 If you make a mistake on a question, there is no easy way to back up to it
2420 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2421 files. Configure will offer to let you do this before it runs the SH files.
2424 dflt='Type carriage return to continue'
2426 case "$firsttime" in
2427 true) echo $user >>../.config/instruct;;
2431 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2432 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2433 if test "X$sysroot" = X; then
2438 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2439 # _sysroot is used in places where we need --sysroot=foo
2440 # but using the rest of the flags could cause issues.
2441 _sysroot="--sysroot=$sysroot";
2445 ccflags="$ccflags $_sysroot"
2450 ldflags="$ldflags $_sysroot"
2455 cppflags="$cppflags $_sysroot"
2457 # lddlflags updated below in lddlflags section;
2458 # same with cccdlflags
2462 # Adjust some defaults to also use $sysroot
2463 for var in xlibpth loclibpth locincpth glibpth; do
2466 for path in $xxx; do
2467 eval $var=\"\$$var $sysroot$path\"
2473 : find out where common programs are
2475 echo "Locating common programs..." >&4
2488 if test -d \$dir/\$thing; then
2494 for thisthing in \$dir/\$thing; do
2495 : just loop through to pick last item
2497 if test -f \$thisthing; then
2500 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2503 elif test -f \$dir/\$thing.exe; then
2504 if test -n "$DJGPP"; then
2505 echo \$dir/\$thing.exe
2506 elif test "$eunicefix" != ":"; then
2507 : on Eunice apparently
2560 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2561 pth="$pth $sysroot/lib $sysroot/usr/lib"
2562 for file in $loclist; do
2566 if test -f "$xxx"; then
2569 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2570 xxx=`./loc $file $file $pth`
2573 '') xxx=`./loc $file $file $pth`;;
2574 *) xxx=`./loc $xxx $xxx $pth`;;
2576 eval $file=$xxx$_exe
2580 echo $file is in $xxx.
2583 echo $file is in $xxx.
2586 echo "I don't know where '$file' is, and my life depends on it." >&4
2587 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2593 echo "Don't worry if any of the following aren't found..."
2595 for file in $trylist; do
2599 if test -f "$xxx"; then
2602 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2603 xxx=`./loc $file $file $pth`
2606 '') xxx=`./loc $file $file $pth`;;
2607 *) xxx=`./loc $xxx $xxx $pth`;;
2609 eval $file=$xxx$_exe
2613 echo $file is in $xxx.
2616 echo $file is in $xxx.
2619 echo "I don't see $file out there, $say."
2626 echo "Substituting grep for egrep."
2633 *) if $less -R </dev/null >/dev/null 2>&1; then
2634 echo "Substituting less -R for less."
2642 echo "Substituting cp for ln."
2651 echo "I can't find make or gmake, and my life depends on it." >&4
2652 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2660 *) # We can't have osname yet.
2661 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2662 # Assume that gmake, if found, is definitely GNU make
2663 # and prefer it over the system make.
2664 echo "Substituting gmake for make."
2672 echo "Hopefully test is built into your sh."
2675 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2676 echo "Using the test built into your sh."
2684 echo "Hopefully echo is built into your sh."
2689 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2690 $echo $n "hi there$c" >foo1
2691 echo $n "hi there$c" >foo2
2692 if cmp foo1 foo2 >/dev/null 2>&1; then
2693 echo "They are compatible. In fact, they may be identical."
2700 They are not compatible! You are probably running ksh on a non-USG system.
2701 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2702 have echo built in and we may have to run some Bourne shell scripts. That
2703 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2706 $echo $n "The star should be here-->$c"
2713 # This question was auctioned at YAPC::Europe-2007 in Vienna
2714 # I never promised you could answer it. I only auctioned the question.
2716 The following message is sponsored by
2718 Dresden.pm<--The stars should be here.
2720 Dear Perl user, system administrator or package
2721 maintainer, the Perl community sends greetings to
2722 you. Do you (emblematical) greet back [Y/n]? n
2726 : Check what type of C compiler we use
2730 cat <<'EOSC' >>trygcc
2735 int main(int argc, char *argv[]) {
2739 if $cc -o try $ccflags $ldflags try.c; then
2742 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2748 # Skip this test because it gives a false match on output like:
2749 # ./trygcc: line 23: cc: command not found
2750 # case "`$cc -v -c try.c 2>&1`" in
2751 # *gcc*) trygcc=no ;;
2753 if $test X"$trygcc" = Xyes; then
2754 if gcc -o try -c try.c; then
2756 echo "You seem to have a working gcc, though." >&4
2757 # Switching compilers may undo the work of hints files.
2758 # The most common problem is -D_REENTRANT for threads.
2759 # This heuristic catches that case, but gets false positives
2760 # if -Dusethreads was not actually specified. Better to
2761 # bail out here with a useful message than fail
2762 # mysteriously later. Should we perhaps just try to
2763 # re-invoke Configure -Dcc=gcc config_args ?
2764 if $test -f usethreads.cbu; then
2767 *** However, any setting of the C compiler flags (e.g. for thread support)
2768 *** will be lost. It may be necessary for you to restart Configure and
2769 *** add -Dcc=gcc to your Configure command line.
2772 rp="Would you like to go ahead and try gcc anyway?"
2775 rp="Would you like to use it?"
2778 if $test -f myread; then
2781 if $test -f UU/myread; then
2784 echo "Cannot find myread, sorry. Aborting." >&2
2789 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2802 cat <<'EOSC' >>checkcc
2807 int main(int argc, char *argv[]) {
2811 if $cc -o try $ccflags $ldflags try.c; then
2814 if $test X"$despair" = Xyes; then
2815 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2818 You need to find a working C compiler.
2819 Either (purchase and) install the C compiler supplied by your OS vendor,
2820 or for a free C compiler try http://gcc.gnu.org/
2821 I cannot continue any further, aborting.
2830 : determine whether symbolic links are supported
2833 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2834 echo "Symbolic links are supported." >&4
2837 echo "Symbolic links are NOT supported." >&4
2842 : determine whether symbolic links are supported
2846 echo "Checking how to test for symbolic links..." >&4
2848 if $test "X$issymlink" = X; then
2850 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2851 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2853 if test $? = 0; then
2856 echo "Your builtin 'test -h' may be broken." >&4
2859 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2862 if test -f "$p/$test"; then
2871 echo "Trying external '$test -h'." >&4
2872 issymlink="$test -h"
2873 if $test ! -h sym >/dev/null 2>&1; then
2874 echo "External '$test -h' is broken, too." >&4
2882 if $test "X$issymlink" = X; then
2883 if $test -L sym 2>/dev/null; then
2884 issymlink="$test -L"
2885 echo "The builtin '$test -L' worked." >&4
2888 if $test "X$issymlink" != X; then
2889 echo "You can test for symbolic links with '$issymlink'." >&4
2891 echo "I do not know how you can test for symbolic links." >&4
2895 *) echo "No symbolic links, so not testing for their testing..." >&4
2900 : Make symlinks util
2901 case "$mksymlinks" in
2904 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2907 *) case "$lns:$issymlink" in
2908 *"ln"*" -s:"*"test -"?)
2909 echo "Creating the symbolic links..." >&4
2911 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2921 print "# dir = ", dir, "file = ", file
2922 mf[dir] = mf[dir]" "source"/"dir"/"file;
2925 if (d != ".") { print("mkdir -p "d) }
2926 print("ln -sf "mf[d]" "d);
2928 }' source="$src" > UU/mksymlinks.$$
2932 if test ! -d t/base; then
2933 echo "Failed to create the subdirectories. Aborting." >&4
2937 if test ! -f t/base/lex.t; then
2938 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2941 if test ! -f win32/win32.c; then
2942 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2947 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2955 : Check for Cross-Compilation
2956 if $test "X$targethost" = "X"; then
2959 if $test "X$targetenv" = "X"; then
2962 case "$usecrosscompile" in
2964 $echo "Cross-compiling..."
2967 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2968 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2969 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2970 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2971 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2972 # leave out ld, choosing it is more complex
2973 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2974 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2975 # We are in a weird spot. Just before us, some values
2976 # were 'saved', to be restored after the hints are
2977 # run. This means that the changes we made to ar,
2978 # nm and ranlib will get reverted.
2979 # To avoid that, we hijack the saving mechanism and
2980 # have it save our new values.
2981 for file in ar nm ranlib; do
2983 eval $file=$xxx$_exe
2988 case "$targetarch" in
2989 '') echo "Targetarch not defined." >&4; croak=y ;;
2990 *) echo "Using targetarch $targetarch." >&4 ;;
2992 case "$targethost" in
2993 '') echo "Targethost not defined." >&4; croak=n ;;
2994 *) echo "Using targethost $targethost." >&4
2999 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3001 : compile a host miniperl and generate_uudmap, unless we got passed them
3002 if $test "X$hostperl" = X; then
3003 echo "Building host miniperl and generate_uudmap binaries" >&4
3011 $src/Configure -des -Dusedevel -Dmksymlinks
3013 case "$hostgenerate" in
3014 '') $make generate_uudmap
3015 hostgenerate=$src/host/generate_uudmap
3017 "$undef") hostgenerate=''
3020 hostperl=$src/host/miniperl
3023 hostosname=`$hostperl -le 'print $^O'`
3026 usecrosscompile="$undef"
3030 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3031 case "$targethost" in
3032 '') echo "Checking for cross-compile" >&4
3033 case "$usecrosscompile$multiarch" in
3034 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3035 if [ -f Makefile ]; then
3037 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3039 echo "Configure done."
3043 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3050 *) echo "Using targethost $targethost." >&4
3052 /*) run=$src/Cross/run
3053 targetmkdir=$src/Cross/mkdir
3055 from=$src/Cross/from
3057 *) pwd=`$test -f ../Configure & cd ..; pwd`
3059 targetmkdir=$pwd/Cross/mkdir
3061 from=$pwd/Cross/from
3064 case "$targetrun" in
3065 '') targetrun=ssh ;;
3070 case "$targetfrom" in
3071 '') targetfrom=scp ;;
3075 from=$from-$targetfrom
3076 case "$targetdir" in
3078 echo "Guessing targetdir $targetdir." >&4
3081 case "$targetuser" in
3083 echo "Guessing targetuser $targetuser." >&4
3086 case "$targetport" in
3088 echo "Guessing targetport $targetport." >&4
3091 case "$targetfrom" in
3095 case "$targetrun" in
3115 '') cwd=$targetdir ;;
3120 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3126 *) echo "Unknown targetrun '$targetrun'" >&4
3130 case "$targetmkdir" in
3132 cat >$targetmkdir <<EOF
3134 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3136 $chmod a+rx $targetmkdir
3138 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3150 $targetmkdir \`dirname \$f\`
3151 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3154 $targetmkdir $targetdir/\`dirname \$f\`
3155 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3168 $mkdir -p $targetdir/\`dirname \$f\`
3169 $cp \$f $targetdir/\$f || exit 1
3172 $targetmkdir $targetdir/\`dirname \$f\`
3173 $cp \$f $targetdir/\$f || exit 1
3180 *) echo "Unknown targetto '$targetto'" >&4
3184 case "$targetfrom" in
3191 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3196 cp) cat >$from <<EOF
3201 cp $targetdir/\$f . || exit 1
3206 *) echo "Unknown targetfrom '$targetfrom'" >&4
3210 if $test ! -f $run; then
3211 echo "Target 'run' script '$run' not found." >&4
3215 if $test ! -f $to; then
3216 echo "Target 'to' script '$to' not found." >&4
3220 if $test ! -f $from; then
3221 echo "Target 'from' script '$from' not found." >&4
3225 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3229 Using '$run' for remote execution,
3230 and '$from' and '$to'
3231 for remote file transfer.
3237 usecrosscompile="$undef"
3242 : see whether [:lower:] and [:upper:] are supported character classes
3244 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3246 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3250 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3251 # (0xd9 and 0xe2), therefore that is a nice testing point.
3252 if test "X$up" = X -o "X$low" = X; then
3253 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3259 if test "X$up" = X -o "X$low" = X; then
3260 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3266 if test "X$up" = X -o "X$low" = X; then
3267 case "`echo RS | od -x 2>/dev/null`" in
3269 echo "Hey, this might be EBCDIC." >&4
3270 if test "X$up" = X -o "X$low" = X; then
3271 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3272 rs) up='[A-IJ-RS-Z]'
3277 if test "X$up" = X -o "X$low" = X; then
3278 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3288 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3290 echo "Using $up and $low to convert case." >&4
3293 echo "I don't know how to translate letters from upper to lower case." >&4
3294 echo "Your tr is not acting any way I know of." >&4
3298 : set up the translation script tr, must be called with ./tr of course
3302 '[A-Z][a-z]') exec $tr '$up' '$low';;
3303 '[a-z][A-Z]') exec $tr '$low' '$up';;
3310 : Try to determine whether config.sh was made on this system
3311 case "$config_sh" in
3313 myuname=`$uname -a 2>/dev/null`
3314 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3315 # Downcase everything to avoid ambiguity.
3316 # Remove slashes and single quotes so we can use parts of this in
3317 # directory and file names.
3318 # Remove newlines so myuname is sane to use elsewhere.
3319 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3320 # because the A-Z/a-z are not consecutive.
3321 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3322 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3323 newmyuname="$myuname"
3325 case "$knowitall" in
3327 if test -f ../config.sh; then
3328 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3329 eval "`grep myuname= ../config.sh`"
3331 if test "X$myuname" = "X$newmyuname"; then
3339 : Get old answers from old config file if Configure was run on the
3340 : same system, otherwise use the hints.
3343 if test -f config.sh; then
3345 rp="I see a config.sh file. Shall I use it to set the defaults?"
3348 n*|N*) echo "OK, I'll ignore it."
3349 mv config.sh config.sh.old
3350 myuname="$newmyuname"
3352 *) echo "Fetching default answers from your old config.sh file..." >&4
3360 : Older versions did not always set $sh. Catch re-use of such
3370 if test ! -f config.sh; then
3373 First time through, eh? I have some defaults handy for some systems
3374 that need some extra help getting the Configure answers right:
3377 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3379 : Half the following guesses are probably wrong... If you have better
3380 : tests or hints, please send them to perlbug@perl.org
3381 : The metaconfig authors would also appreciate a copy...
3382 $test -f /irix && osname=irix
3383 $test -f /xenix && osname=sco_xenix
3384 $test -f /dynix && osname=dynix
3385 $test -f /dnix && osname=dnix
3386 $test -f /lynx.os && osname=lynxos
3387 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3388 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3389 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3390 $test -f /bin/mips && /bin/mips && osname=mips
3391 $test -d /usr/apollo/bin && osname=apollo
3392 $test -f /etc/saf/_sactab && osname=svr4
3393 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3394 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3395 $test -f /sys/utilities/MultiView && osname=amigaos
3396 if $test -d /MachTen -o -d /MachTen_Folder; then
3398 if $test -x /sbin/version; then
3399 osvers=`/sbin/version | $awk '{print $2}' |
3400 $sed -e 's/[A-Za-z]$//'`
3401 elif $test -x /usr/etc/version; then
3402 osvers=`/usr/etc/version | $awk '{print $2}' |
3403 $sed -e 's/[A-Za-z]$//'`
3409 $test -f /sys/posix.dll &&
3410 $test -f /usr/bin/what &&
3411 set X `/usr/bin/what /sys/posix.dll` &&
3412 $test "$3" = UWIN &&
3416 if $test -f $uname; then
3424 umips) osname=umips ;;
3427 [23]100) osname=mips ;;
3429 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3430 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3433 elif $test -f /etc/kconfig; then
3435 if test "$lns" = "$ln -s"; then
3437 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3439 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3446 if test -n "$DJGPP"; then
3455 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3457 # oslevel can fail with:
3458 # oslevel: Unable to acquire lock.
3459 *not\ found) osvers="$4"."$3" ;;
3460 '<3240'|'<>3240') osvers=3.2.0 ;;
3461 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3462 '=3250'|'>3250') osvers=3.2.5 ;;
3466 bitrig) osname=bitrig
3469 bsd386) osname=bsd386
3472 cygwin*) osname=cygwin
3475 *dc.osx) osname=dcosx
3481 domainos) osname=apollo
3487 dragonfly) osname=dragonfly
3490 dynixptx*) osname=dynixptx
3491 osvers=`echo "$4"|sed 's/^v//'`
3493 freebsd) osname=freebsd
3495 genix) osname=genix ;;
3499 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3512 $test -f /system/lib/libandroid.so && osname=linux-android
3516 netbsd*) osname=netbsd
3519 news-os) osvers="$3"
3521 4*) osname=newsos4 ;;
3525 nonstop-ux) osname=nonstopux ;;
3526 openbsd) osname=openbsd
3532 POSIX-BC | posix-bc ) osname=posix-bc
3535 powerux | power_ux | powermax_os | powermaxos | \
3536 powerunix | power_unix) osname=powerux
3542 solaris) osname=solaris
3544 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3551 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3555 titanos) osname=titanos
3564 ultrix) osname=ultrix
3567 osf1|mls+) case "$5" in
3570 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3573 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3576 hp*) osname=hp_osf1 ;;
3577 mips) osname=mips_osf1 ;;
3580 # UnixWare 7.1.2 is known as Open UNIX 8
3581 openunix|unixware) osname=svr5
3589 $2) case "$osname" in
3593 : svr4.x or possibly later
3603 if test -f /stand/boot ; then
3604 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3605 if test -n "$INITPROG" -a -f "$INITPROG"; then
3606 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3607 if test -n "$isesix"; then
3615 *) if test -f /etc/systemid; then
3617 set `echo $3 | $sed 's/\./ /g'` $4
3618 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3620 elif $test -f $src/hints/sco_$1_$2.sh; then
3622 elif $test -f $src/hints/sco_$1.sh; then
3627 '') : Still unknown. Probably a generic Sys V.
3636 *) case "$osname" in
3637 '') : Still unknown. Probably a generic BSD.
3645 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3646 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3647 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3650 $rm -f UU/kernel.what
3651 elif test -d c:/. -o -n "$is_os2" ; then
3658 case "$targetarch" in
3661 case "$targetarch" in
3663 # Will load qnx.sh, which should change osname to nto
3668 # Catch arm-linux-androideabi, mipsel-linux-android,
3669 # and i686-linux-android
3670 osname=linux-android
3674 # Something like arm-linux-gnueabihf is really just
3681 # XXX perhaps we should just assume
3682 # osvers to be 2, or maybe take the value
3683 # from targetarch. Using $run before the
3684 # hints are run is somewhat icky.
3685 set X `$run $uname -a 2>/dev/null`
3688 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3693 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3700 : Now look for a hint file osname_osvers, unless one has been
3701 : specified already.
3704 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3705 : Also try without trailing minor version numbers.
3706 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3707 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3708 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3709 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3712 *) case "$osvers" in
3715 *) if $test -f $src/hints/$file.sh ; then
3717 elif $test -f $src/hints/$xfile.sh ; then
3719 elif $test -f $src/hints/$xxfile.sh ; then
3721 elif $test -f $src/hints/$xxxfile.sh ; then
3723 elif $test -f $src/hints/$xxxxfile.sh ; then
3725 elif $test -f "$src/hints/${osname}.sh" ; then
3734 if $test -f Policy.sh ; then
3737 none) dflt="Policy" ;;
3738 *) dflt="Policy $dflt" ;;
3743 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3747 if $test -f Policy.sh ; then
3750 There's also a Policy hint file available, which should make the
3751 site-specific (policy) questions easier to answer.
3758 You may give one or more space-separated answers, or "none" if appropriate.
3759 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3760 previous run of Configure, you may specify it as well as or instead of
3761 OS-specific hints. If hints are provided for your OS, you should use them:
3762 although Perl can probably be built without hints on many platforms, using
3763 hints often improve performance and may enable features that Configure can't
3764 set up on its own. If there are no hints that match your OS, specify "none";
3765 DO NOT give a wrong version or a wrong OS.
3769 rp="Which of these apply, if any?"
3772 for file in $tans; do
3773 if $test X$file = XPolicy -a -f Policy.sh; then
3775 $cat Policy.sh >> UU/config.sh
3776 elif $test -f $src/hints/$file.sh; then
3777 . $src/hints/$file.sh
3778 $cat $src/hints/$file.sh >> UU/config.sh
3779 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3782 : Give one chance to correct a possible typo.
3783 echo "$file.sh does not exist"
3785 rp="hint to use instead?"
3787 for file in $ans; do
3788 if $test -f "$src/hints/$file.sh"; then
3789 . $src/hints/$file.sh
3790 $cat $src/hints/$file.sh >> UU/config.sh
3791 elif $test X$ans = X -o X$ans = Xnone ; then
3794 echo "$file.sh does not exist -- ignored."
3801 : Remember our hint file for later.
3802 if $test -f "$src/hints/$file.sh" ; then
3812 echo "Fetching default answers from $config_sh..." >&4
3816 cp $config_sh config.sh 2>/dev/null
3828 : Restore computed paths
3829 for file in $loclist $trylist; do
3830 eval $file="\$_$file"
3835 Configure uses the operating system name and version to set some defaults.
3836 The default value is probably right if the name rings a bell. Otherwise,
3837 since spelling matters for me, either accept the default or answer "none"
3844 ''|' '|none) dflt=none ;;
3845 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3848 *) dflt="$osname" ;;
3850 rp="Operating system name?"
3854 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3860 ''|' '|none) dflt=none ;;
3861 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3862 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3864 ''|' ') dflt=none ;;
3869 *) dflt="$osvers" ;;
3871 rp="Operating system version?"
3881 : who configured the system
3882 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3885 cf_by=`(logname) 2>/dev/null`
3888 cf_by=`(whoami) 2>/dev/null`
3890 "") cf_by=unknown ;;
3895 : decide how portable to be. Allow command line overrides.
3896 case "$d_portable" in
3898 *) d_portable="$define" ;;
3901 : set up shell script to do ~ expansion
3907 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3910 if $test -f /bin/csh; then
3911 /bin/csh -f -c "glob \$1"
3916 name=\`$expr x\$1 : '..\([^/]*\)'\`
3917 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3918 if $test ! -d "\$dir"; then
3920 echo "\$me: can't locate home directory for: \$name" >&2
3925 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3941 : now set up to get a file name
3945 cat <<'EOSC' >>getfile
3961 : getfile will accept an answer from the comma-separated list
3962 : enclosed in parentheses even if it does not meet other criteria.
3963 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3964 fn=`echo $fn | sed 's/(.*)//'`
3970 loc_file=`expr $fn : '.*:\(.*\)'`
3971 fn=`expr $fn : '\(.*\):.*'`
3979 */*) fullpath=true;;
3988 *e*) exp_file=true;;
3991 *p*) nopath_ok=true;;
3996 *d*) type='Directory';;
3997 *l*) type='Locate';;
4002 Locate) what='File';;
4007 case "$d_portable" in
4015 while test "$type"; do
4020 true) rp="$rp (~name ok)";;
4023 if test -f UU/getfile.ok && \
4024 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4043 value=`UU/filexp $ans`
4046 if test "$ans" != "$value"; then
4047 echo "(That expands to $value on this system.)"
4061 /*) value="$ansexp" ;;
4062 [a-zA-Z]:/*) value="$ansexp" ;;
4067 echo "I shall only accept a full path name, as in /bin/ls." >&4
4068 echo "Use a ! shell escape if you wish to check pathnames." >&4
4071 echo "Please give a full path name, starting with slash." >&4
4074 echo "Note that using ~name is ok provided it expands well." >&4
4087 for fp in $gfpth; do
4088 if test "X$fp" = X.; then
4093 if test -f "$pf"; then
4095 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4097 echo "($value is not a plain file, but that's ok.)"
4100 if test X"$type" = X; then
4107 for fp in $gfpth; do
4108 if test "X$fp" = X.; then
4113 direxp="$fp/$ansexp"
4115 if test -d "$direxp"; then
4123 if test -d "$ansexp"; then
4124 echo "(Looking for $loc_file in directory $value.)"
4125 value="$value/$loc_file"
4126 ansexp="$ansexp/$loc_file"
4128 if test -f "$ansexp"; then
4131 case "$nopath_ok" in
4132 true) case "$value" in
4134 *) echo "Assuming $value will be in people's path."
4150 if test "$fastread" = yes; then
4155 rp="$what $value doesn't exist. Use that name anyway?"
4174 test "X$gfpthkeep" != Xy && gfpth=""
4177 : determine root of directory hierarchy where package will be installed.
4180 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4183 dflt=`echo "$prefix" | sed 's/.$//'`
4191 By default, $package will be installed in $dflt/bin, manual pages
4192 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4193 installation directories. Typically this is something like /usr/local.
4194 If you wish to have binaries under /usr/bin but other parts of the
4195 installation under /usr/local, that's ok: you will be prompted
4196 separately for each of the installation directories, the prefix being
4197 only used to set the defaults.
4201 rp='Installation prefix to use?'
4209 *) oldprefix="$prefix";;
4216 : allow them to override the AFS root
4219 *) afsroot=$afsroot ;;
4225 $define|true) afs=true ;;
4226 $undef|false) afs=false ;;
4227 *) if $test -d $afsroot; then
4235 echo "AFS may be running... I'll be extra cautious then..." >&4
4237 echo "AFS does not seem to be running..." >&4
4240 : determine installation prefix for where package is to be installed.
4244 Since you are running AFS, I need to distinguish the directory in which
4245 files will reside from the directory in which they are installed (and from
4246 which they are presumably copied to the former directory by occult means).
4249 case "$installprefix" in
4250 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4251 *) dflt="$installprefix";;
4256 In some special cases, particularly when building $package for distribution,
4257 it is convenient to distinguish the directory in which files should be
4258 installed from the directory ($prefix) in which they will
4259 eventually reside. For most users, these two directories are the same.
4262 case "$installprefix" in
4264 *) dflt=$installprefix;;
4268 rp='What installation prefix should I use for installing files?'
4270 installprefix="$ans"
4271 installprefixexp="$ansexp"
4273 : Perform the prefixexp/installprefixexp correction if necessary
4274 cat <<EOS >installprefix
4277 cat <<'EOSC' >>installprefix
4278 : Change installation prefix, if necessary.
4279 if $test X"$prefix" != X"$installprefix"; then
4280 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4282 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4285 chmod +x installprefix
4286 $eunicefix installprefix
4288 : Set variables such as privlib and privlibexp from the output of ./getfile
4289 : performing the prefixexp/installprefixexp correction if necessary.
4290 cat <<EOS >setprefixvar
4293 cat <<'EOSC' >>setprefixvar
4294 eval "${prefixvar}=\"\$ans\""
4295 eval "${prefixvar}exp=\"\$ansexp\""
4298 chmod +x setprefixvar
4299 $eunicefix setprefixvar
4301 : set up the script used to warn in case of inconsistency
4310 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4312 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4313 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4318 echo "*** WHOA THERE!!! ***" >&4
4319 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4322 rp=" Keep the $hint value?"
4325 y) td=$was; tu=$was;;
4329 : function used to set '$1' to '$val'
4330 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4332 $define$undef) . ./whoa; eval "$var=\$td";;
4333 $undef$define) . ./whoa; eval "$var=\$tu";;
4334 *) eval "$var=$val";;
4337 : get the patchlevel
4339 echo "Getting the current patchlevel..." >&4
4340 if $test -r $rsrc/patchlevel.h;then
4341 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4342 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4343 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4344 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4345 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4346 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4347 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4356 $echo "(You do not have patchlevel.h. Eek.)"
4358 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4359 version_patchlevel_string="version $patchlevel subversion $subversion"
4360 case "$perl_patchlevel" in
4362 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4363 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4367 $echo "(You have $package $version_patchlevel_string.)"
4371 : XXX Should be a Configure test for double-dots in filenames.
4372 version=`echo $revision $patchlevel $subversion | \
4373 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4374 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4375 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4378 version=`echo $revision $patchlevel $subversion | \
4379 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4380 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4381 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4384 : Special case the 5.005_xx maintenance series, which used 5.005
4385 : without any subversion label as a subdirectory in $sitelib
4386 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4387 api_versionstring='5.005'
4390 : Do we want threads support and if so, what type
4391 case "$usethreads" in
4392 $define|true|[yY]*) dflt='y';;
4393 *) # Catch case where user specified ithreads or 5005threads but
4394 # forgot -Dusethreads (A.D. 4/2002)
4395 case "$useithreads$use5005threads" in
4396 *$define*) dflt='y';;
4403 Perl can be built to offer a form of threading support on some systems
4404 To do so, Configure can be run with -Dusethreads.
4406 Note that Perl built with threading support runs slightly slower
4407 and uses slightly more memory than plain Perl.
4409 If this doesn't make any sense to you, just accept the default '$dflt'.
4411 rp='Build a threading Perl?'
4414 y|Y) val="$define" ;;
4420 if $test $patchlevel -lt 9; then
4421 case "$usethreads" in
4423 : Default to ithreads unless overridden on command line or with
4426 case "$use5005threads" in
4428 echo "5.005 threads are no longer supported"
4432 case "$useithreads" in
4433 $undef|false|[nN]*) dflt='n';;
4435 rp='Use the newer interpreter-based ithreads?'
4438 y|Y) val="$define" ;;
4443 : Now set use5005threads to the opposite value.
4444 case "$useithreads" in
4445 $define) val="$undef" ;;
4452 useithreads="$undef"
4453 use5005threads="$undef"
4457 case "$useithreads$use5005threads" in
4461 You cannot have both the ithreads and the 5.005 threads enabled
4462 at the same time. Disabling the 5.005 threads since they are
4463 much less stable than the ithreads.
4466 use5005threads="$undef"
4471 : perl-5.9.x and later
4473 if test X"$usethreads" = "X$define"; then
4474 case "$use5005threads" in
4478 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4485 use5005threads="$undef"
4486 useithreads="$usethreads"
4489 case "$d_oldpthreads" in
4490 '') : Configure tests would be welcome here. For now, assume undef.
4492 *) val="$d_oldpthreads" ;;
4498 : Look for a hint-file generated 'call-back-unit'. If the
4499 : user has specified that a threading perl is to be built,
4500 : we may need to set or change some other defaults.
4501 if $test -f usethreads.cbu; then
4502 echo "Your platform has some specific hints regarding threaded builds, using them..."
4505 case "$usethreads" in
4506 "$define"|true|[yY]*)
4508 (Your platform does not have any specific hints for threaded builds.
4509 Assuming POSIX threads, then.)
4515 : Check if multiplicity is required
4518 Perl can be built so that multiple Perl interpreters can coexist
4519 within the same Perl executable.
4522 case "$useithreads" in
4525 This multiple interpreter support is required for interpreter-based threads.
4529 *) case "$usemultiplicity" in
4530 $define|true|[yY]*) dflt='y';;
4534 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4535 rp='Build Perl for multiplicity?'
4538 y|Y) val="$define" ;;
4546 : Check if morebits is requested
4547 case "$usemorebits" in
4548 "$define"|true|[yY]*)
4549 use64bitint="$define"
4550 uselongdouble="$define"
4551 usemorebits="$define"
4553 *) usemorebits="$undef"
4557 : Determine the C compiler to be used
4563 rp="Use which C compiler?"
4567 : See whether they have no cc but they do have gcc
4569 if $test -f cc.cbu; then
4574 : make some quick guesses about what we are up against
4576 $echo $n "Hmm... $c"
4586 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4587 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4589 echo "Looks kind of like an OSF/1 system, but we'll see..."
4591 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4592 xxx=`./loc addbib blurfl $pth`
4593 if $test -f $xxx; then
4594 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4598 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4599 echo "Looks kind of like an extended USG system, but we'll see..."
4601 echo "Looks kind of like a USG system, but we'll see..."
4605 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4606 echo "Looks kind of like a BSD system, but we'll see..."
4610 echo "Looks kind of like a Version 7 system, but we'll see..."
4613 case "$eunicefix" in
4616 There is, however, a strange, musty smell in the air that reminds me of
4617 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4621 : it so happens the Eunice I know will not run shell scripts in Unix format
4625 echo "Congratulations. You aren't running Eunice."
4629 : Detect OS2. The p_ variable is set above in the Head.U unit.
4630 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4631 : semicolon as a patch separator
4636 I have the feeling something is not exactly right, however...don't tell me...
4637 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4638 (Or you may be running DOS with DJGPP.)
4643 if test -f /xenix; then
4644 echo "Actually, this looks more like a XENIX system..."
4649 echo "It's not Xenix..."
4654 if test -f /venix; then
4655 echo "Actually, this looks more like a VENIX system..."
4662 echo "Nor is it Venix..."
4665 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4666 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4669 : Check if we are using GNU gcc and what its version is
4671 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4675 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4677 printf("%s\n", __VERSION__);
4679 printf("%s\n", "1");
4685 if $cc -o try $ccflags $ldflags try.c; then
4686 gccversion=`$run ./try`
4687 case "$gccversion" in
4688 '') echo "You are not using GNU cc." ;;
4689 *) echo "You are using GNU cc $gccversion."
4695 echo "*** WHOA THERE!!! ***" >&4
4696 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4697 case "$knowitall" in
4699 echo " You'd better start hunting for one and let me know about it." >&4
4705 case "$gccversion" in
4706 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4708 case "$gccversion" in
4709 '') gccosandvers='' ;;
4710 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4711 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4713 case "$gccosandvers" in
4714 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4715 $osname$osvers) ;; # looking good
4716 $osname*) cat <<EOM >&4
4718 *** WHOA THERE!!! ***
4720 Your gcc has not been compiled for the exact release of
4721 your operating system ($gccosandvers versus $osname$osvers).
4723 In general it is a good idea to keep gcc synchronized with
4724 the operating system because otherwise serious problems
4725 may ensue when trying to compile software, like Perl.
4727 I'm trying to be optimistic here, though, and will continue.
4728 If later during the configuration and build icky compilation
4729 problems appear (headerfile conflicts being the most common
4730 manifestation), I suggest reinstalling the gcc to match
4731 your operating system release.
4735 *) gccosandvers='' ;; # failed to parse, better be silent
4743 # gcc 3.* complain about adding -Idirectories that they already know about,
4744 # so we will take those off from locincpth.
4745 case "$gccversion" in
4747 echo "main(){}">try.c
4748 for incdir in $locincpth; do
4749 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4750 grep '^c[cp]p*[01]: warning: changing search order '`
4751 if test "X$warn" != X; then
4752 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4758 # gcc 4.9 by default does some optimizations that break perl.
4759 # see ticket 121505.
4761 # The -fwrapv disables those optimizations (and probably others,) so
4762 # for gcc 4.9 (and later, since the optimizations probably won't go
4763 # away), add -fwrapv unless the user requests -fno-wrapv, which
4764 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4765 # which turns the overflows -fwrapv ignores into runtime errors.
4766 case "$gccversion" in
4767 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4769 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4770 *) ccflags="$ccflags -fwrapv" ;;
4774 : What should the include directory be ?
4775 : Use sysroot if set, so findhdr looks in the right place.
4777 $echo $n "Hmm... $c"
4778 dflt="$sysroot/usr/include"
4781 if $test -f /bin/mips && /bin/mips; then
4782 echo "Looks like a MIPS system..."
4783 $cat >usr.c <<'EOCP'
4784 #ifdef SYSTYPE_BSD43
4788 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4789 dflt='/bsd43/usr/include'
4793 mips_type='System V'
4795 $rm -f usr.c usr.out
4796 echo "and you're compiling with the $mips_type compiler and libraries."
4800 echo "Doesn't look like a MIPS system."
4810 case "$xxx_prompt" in
4813 rp='Where are the include files you want to use?'
4821 : see how we invoke the C preprocessor
4823 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4824 cat <<'EOT' >testcpp.c
4830 if test ! -f cppstdin; then
4831 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4832 # AIX cc -E doesn't show the absolute headerfile
4833 # locations but we'll cheat by using the -M flag.
4834 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
4836 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4839 echo "Keeping your $hint cppstdin wrapper."
4842 wrapper=`pwd`/cppstdin
4846 if $test "X$cppstdin" != "X" && \
4847 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4848 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4850 echo "You used to use $cppstdin $cppminus so we'll use that again."
4852 '') echo "But let's see if we can live without a wrapper..." ;;
4854 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4857 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4860 echo "(However, $cpprun $cpplast does not work, let's see...)"
4868 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4875 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4876 $cc -E <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4878 echo "Yup, it does."
4879 x_cpp="$cc $cppflags -E"
4881 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4882 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4884 echo "Yup, it does."
4885 x_cpp="$cc $cppflags -E"
4887 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4888 $cc -P <testcpp.c >testcpp.out 2>&1; \
4889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4890 echo "Yipee, that works!"
4891 x_cpp="$cc $cppflags -P"
4893 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4894 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4895 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4896 echo "At long last!"
4897 x_cpp="$cc $cppflags -P"
4899 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4900 $cpp <testcpp.c >testcpp.out 2>&1; \
4901 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4903 x_cpp="$cpp $cppflags"
4905 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4906 $cpp - <testcpp.c >testcpp.out 2>&1; \
4907 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4908 echo "Hooray, it works! I was beginning to wonder."
4909 x_cpp="$cpp $cppflags"
4911 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4912 $wrapper <testcpp.c >testcpp.out 2>&1; \
4913 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4919 rp="No dice. I can't find a C preprocessor. Name one:"
4923 $x_cpp <testcpp.c >testcpp.out 2>&1
4924 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4925 echo "OK, that will do." >&4
4927 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4942 echo "Perhaps can we force $cc -E using a wrapper..."
4943 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4944 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4950 echo "Nope, we'll have to live without it..."
4964 "$wrapper"|'cppstdin') ;;
4965 *) $rm -f $wrapper;;
4967 $rm -f testcpp.c testcpp.out
4969 : Adjust cppfilter for path component separator
4971 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4972 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4976 : Use gcc to determine libpth and incpth
4977 # If using gcc or clang, we can get better values for libpth, incpth
4978 # and usrinc directly from the compiler.
4979 # Note that ccname for clang is also gcc.
4982 $echo 'extern int foo;' > try.c
4983 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4985 if $test $# -gt 0; then
4987 incpth="`$echo $incpth|$sed 's/^ //'`"
4989 j="`$echo $i|$sed 's,/include$,/lib,'`"
4990 if $test -d $j; then
4994 libpth="`$echo $libpth|$sed 's/^ //'`"
4995 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4996 if $test -d $xxx; then
4999 *) libpth="$libpth $xxx";;
5006 '') for i in $incpth; do
5007 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5015 case "$usecrosscompile" in
5018 '') echo "Incpth not defined." >&4; croak=y ;;
5019 *) echo "Using incpth '$incpth'." >&4 ;;
5022 '') echo "Libpth not defined." >&4; croak=y ;;
5023 *) echo "Using libpth '$libpth'." >&4 ;;
5026 '') echo "Usrinc not defined." >&4; croak=y ;;
5027 *) echo "Using usrinc $usrinc." >&4 ;;
5031 if test "X$sysroot" = X; then
5032 echo "Cannot continue, aborting." >&4; exit 1
5034 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5043 : Default value for incpth is just usrinc
5045 '') incpth="$usrinc";;
5048 : Set private lib path
5051 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5056 '') dlist="$loclibpth $plibpth $glibpth";;
5057 *) dlist="$libpth";;
5060 : Now check and see which directories actually exist, avoiding duplicates
5063 if $test -d $xxx; then
5066 *) libpth="$libpth $xxx";;
5072 Some systems have incompatible or broken versions of libraries. Among
5073 the directories listed in the question below, please remove any you
5074 know not to be holding relevant libraries, and add any that are needed.
5075 Say "none" for none.
5079 if test "X$sysroot" != X; then
5081 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5094 rp="Directories to use for library searches?"
5101 : compute shared library extension
5104 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5114 On some systems, shared libraries may be available. Answer 'none' if
5115 you want to suppress searching of shared libraries for the remainder
5116 of this configuration.
5119 rp='What is the file extension used for shared libraries?'
5123 : Does target system insist that shared library basenames are unique
5126 Some dynamic loaders assume that the *basename* of shared library filenames
5127 are globally unique. We'll default this to undef as we assume your system
5128 is not this weird. Set to defined if you're on one of them.
5133 rp='Make shared library basenames unique?'
5136 y|Y) val="$define" ;;
5139 set d_libname_unique
5142 : Define several unixisms.
5143 : Hints files or command line option can be used to override them.
5144 : The convoluted testing is in case hints files set either the old
5147 '') case "$exe_ext" in
5149 *) _exe="$exe_ext" ;;
5154 '') case "$lib_ext" in
5161 '') case "$obj_ext" in
5168 '') case "$path_sep" in
5179 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5181 : Which makefile gets called first. This is used by make depend.
5182 case "$firstmakefile" in
5183 '') firstmakefile='makefile';;
5186 : Check is we will use socks
5188 $define|true|[yY]*) dflt='y';;
5193 Perl can be built to use the SOCKS proxy protocol library. To do so,
5194 Configure must be run with -Dusesocks. If you use SOCKS you also need
5195 to use the PerlIO abstraction layer, this will be implicitly selected.
5197 If this doesn't make any sense to you, just accept the default '$dflt'.
5199 rp='Build Perl for SOCKS?'
5202 y|Y) val="$define" ;;
5208 : Check for uselongdouble support
5210 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5213 case "$uselongdouble" in
5214 $define|true|[yY]*) dflt='y';;
5219 Perl can be built to take advantage of long doubles which
5220 (if available) may give more accuracy and range for floating point numbers.
5222 If this doesn't make any sense to you, just accept the default '$dflt'.
5224 rp='Try to use long doubles if available?'
5227 y|Y) val="$define" ;;
5233 case "$uselongdouble" in
5234 true|[yY]*) uselongdouble="$define" ;;
5237 : Look for a hint-file generated 'call-back-unit'. If the
5238 : user has specified that long doubles should be used,
5239 : we may need to set or change some other defaults.
5240 if $test -f uselongdouble.cbu; then
5241 echo "Your platform has some specific hints regarding long doubles, using them..."
5242 . ./uselongdouble.cbu
5244 case "$uselongdouble" in
5247 (Your platform does not have any specific hints for long doubles.)
5253 : Check if quadmath is requested
5254 case "$usequadmath" in
5255 "$define"|true|[yY]*) usequadmath="$define" ;;
5256 *) usequadmath="$undef" ;;
5259 : Fail if both uselongdouble and usequadmath are requested
5260 case "$usequadmath:$uselongdouble" in
5264 *** You requested the use of the quadmath library and use
5265 *** of long doubles.
5267 *** Please select one or the other.
5273 : Looking for optional libraries
5275 echo "Checking for optional libraries..." >&4
5280 case "$libswanted" in
5281 '') libswanted='c_s';;
5284 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5286 case "$usecbacktrace" in
5287 "$define") libswanted="$libswanted bfd" ;;
5289 case "$usequadmath" in
5290 "$define") libswanted="$libswanted quadmath" ;;
5296 for thisdir in $libpth $xlibpth; do
5297 test -d $thisdir && libspath="$libspath $thisdir"
5299 for thislib in $libswanted; do
5300 for thisdir in $libspath; do
5302 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5303 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5304 $test -f "$xxx" && eval $libscheck
5305 $test -f "$xxx" && libstyle=shared
5306 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5307 $test -f "$xxx" && eval $libscheck
5308 $test -f "$xxx" && libstyle=shared
5310 if test ! -f "$xxx"; then
5311 xxx=$thisdir/lib$thislib.$so
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=shared
5315 if test ! -f "$xxx"; then
5316 xxx=$thisdir/lib$thislib$_a
5317 $test -f "$xxx" && eval $libscheck
5318 $test -f "$xxx" && libstyle=static
5320 if test ! -f "$xxx"; then
5321 xxx=$thisdir/$thislib$_a
5322 $test -f "$xxx" && eval $libscheck
5323 $test -f "$xxx" && libstyle=static
5325 if test ! -f "$xxx"; then
5326 xxx=$thisdir/lib${thislib}_s$_a
5327 $test -f "$xxx" && eval $libscheck
5328 $test -f "$xxx" && libstyle=static
5329 $test -f "$xxx" && thislib=${thislib}_s
5331 if test ! -f "$xxx"; then
5332 xxx=$thisdir/Slib$thislib$_a
5333 $test -f "$xxx" && eval $libscheck
5334 $test -f "$xxx" && libstyle=static
5336 if $test -f "$xxx"; then
5338 shared) echo "Found -l$thislib (shared)." ;;
5339 static) echo "Found -l$thislib." ;;
5340 *) echo "Found -l$thislib ($libstyle)." ;;
5344 *) dflt="$dflt -l$thislib"
5345 libsfound="$libsfound $xxx"
5347 libsfiles="$libsfiles $yyy"
5348 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5349 case " $libsdirs " in
5351 *) libsdirs="$libsdirs $yyy" ;;
5358 if $test ! -f "$xxx"; then
5359 echo "No -l$thislib."
5370 ' '|'') dflt='none';;
5375 In order to compile $package on your machine, a number of libraries
5376 are usually needed. Include any other special libraries here as well.
5377 Say "none" for none. The default list is almost always right.
5381 rp="What libraries to use?"
5388 : determine optimization, if desired, or use for debug flag also
5390 ' '|$undef) dflt='none';;
5392 *) dflt="$optimize";;
5396 By default, $package compiles with the -O flag to use the optimizer.
5397 Alternately, you might want to use the symbolic debugger, which uses
5398 the -g flag (on traditional Unix systems). Either flag can be
5399 specified here. To use neither flag, specify the word "none".
5402 rp="What optimizer/debugger flag should be used?"
5406 'none') optimize=" ";;
5409 : Check what DEBUGGING is required from the command line
5410 : -DEBUGGING or -DDEBUGGING or
5411 : -DEBUGGING=both = -g + -DDEBUGGING
5412 : -DEBUGGING=-g or -Doptimize=-g = -g
5413 : -DEBUGGING=none or -UDEBUGGING =
5414 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5417 *) DEBUGGING=$EBUGGING ;;
5420 case "$DEBUGGING" in
5424 *) optimize="$optimize -g" ;;
5428 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5436 case "$DEBUGGING" in
5437 both|$define) dflt='-DDEBUGGING'
5440 : argument order is deliberate, as the flag will start with - which set could
5441 : think is an option
5442 checkccflag='check=$1; flag=$2; callback=$3;
5444 echo "Checking if your compiler accepts $flag" 2>&1;
5445 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5446 echo "int main(void) { return 0; }" > gcctest.c;
5447 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5448 echo "Yes, it does." 2>&1;
5449 if $test -s gcctest.out ; then
5450 echo "But your platform does not like it:";
5455 echo "Leaving current flags $ccflags alone." 2>&1
5457 *) dflt="$dflt $flag";
5463 echo "Nope, it does not, but that is ok." 2>&1;
5467 : We will not override a previous value, but we might want to
5468 : augment a hint file
5470 default|recommended)
5471 case "$gccversion" in
5472 1*) dflt="$dflt -fpcc-struct-return" ;;
5474 case "$optimize:$DEBUGGING" in
5475 *-g*:old) dflt="$dflt -DDEBUGGING";;
5477 case "$gccversion" in
5478 2*) if $test -d /etc/conf/kconfig.d &&
5479 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5481 # Interactive Systems (ISC) POSIX mode.
5486 case "$gccversion" in
5489 ?*) set strict-aliasing -fno-strict-aliasing
5493 # For gcc, adding -pipe speeds up compilations for some, but apparently
5494 # some assemblers can't read from stdin. (It also slows down compilations
5495 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5496 case "$gccversion" in
5502 # on x86_64 (at least) we require an extra library (libssp) in the
5503 # link command line. This library is not named, so I infer that it is
5504 # an implementation detail that may change. Hence the safest approach
5505 # is to add the flag to the flags passed to the compiler at link time,
5506 # as that way the compiler can do the right implementation dependant
5509 amigaos) ;; # -fstack-protector builds but doesn't work
5510 *) case "$gccversion" in
5511 ?*) set stack-protector-strong -fstack-protector-strong
5514 *-fstack-protector-strong*) ;; # It got added.
5515 *) # Try the plain/older -fstack-protector.
5516 set stack-protector -fstack-protector
5527 case "$mips_type" in
5528 *BSD*|'') inclwanted="$locincpth $usrinc";;
5529 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5531 for thisincl in $inclwanted; do
5532 if $test -d $thisincl; then
5533 if $test x$thisincl != x$usrinc; then
5535 *" -I$thisincl "*);;
5536 *) dflt="$dflt -I$thisincl ";;
5542 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5544 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5552 *) dflt="$dflt -D$2";;
5556 set signal.h LANGUAGE_C; eval $inctest
5560 ccflags="$ccflags -DSOCKS"
5565 default|recommended) dflt="$ccflags $dflt" ;;
5566 *) dflt="$ccflags";;
5575 Your C compiler may want other flags. For this question you should include
5576 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5577 but you should NOT include libraries or ld flags like -lwhatever. If you
5578 want $package to honor its debug switch, you should include -DDEBUGGING here.
5579 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5581 To use no flags, specify the word "none".
5587 rp="Any additional cc flags?"
5594 : the following weeds options from ccflags that are of no interest to cpp
5596 '') cppflags="$ccflags" ;;
5597 *) set X $ccflags; shift
5598 case " $cppflags " in
5599 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5600 *) cppflags="$cppflags $ccflags" ;;
5604 case "$gccversion" in
5605 1*) cppflags="$cppflags -D__GNUC__"
5607 case "$mips_type" in
5609 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5615 echo "Let me guess what the preprocessor flags are..." >&4
5629 *) ftry="$previous $flag";;
5631 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5632 >cpp1.out 2>/dev/null && \
5633 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5634 >cpp2.out 2>/dev/null && \
5635 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5636 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5638 cppflags="$cppflags $ftry"
5648 *-*) echo "They appear to be: $cppflags";;
5650 $rm -f cpp.c cpp?.out
5654 : flags used in final linking phase
5656 '') if ./venix; then
5662 *-posix*) dflt="$dflt -posix" ;;
5665 *) dflt="$ldflags";;
5667 # See note above about -fstack-protector
5669 *-fstack-protector-strong*)
5671 *-fstack-protector-strong*) ;; # Don't add it again
5672 *) dflt="$dflt -fstack-protector-strong" ;;
5675 *-fstack-protector*)
5677 *-fstack-protector*) ;; # Don't add it again
5678 *) dflt="$dflt -fstack-protector" ;;
5683 : Try to guess additional flags to pick up local libraries.
5684 for thislibdir in $libpth; do
5685 case " $loclibpth " in
5688 *"-L$thislibdir "*) ;;
5689 *) dflt="$dflt -L$thislibdir" ;;
5701 Your C linker may need flags. For this question you should
5702 include -L/whatever and any other flags used by the C linker, but you
5703 should NOT include libraries like -lwhatever.
5705 Make sure you include the appropriate -L/path flags if your C linker
5706 does not normally search all of the directories you specified above,
5709 To use no flags, specify the word "none".
5713 rp="Any additional ld flags (NOT including libraries)?"
5719 rmlist="$rmlist pdp11"
5723 echo "Checking your choice of C compiler and flags for coherency..." >&4
5724 $cat > try.c <<'EOF'
5726 int main() { printf("Ok\n"); return(0); }
5728 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5730 $cat >try.msg <<'EOM'
5731 I've tried to compile and run the following simple program:
5734 $cat try.c >> try.msg
5736 $cat >> try.msg <<EOM
5743 and I got the following output:
5747 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5748 if $sh -c "$run ./try " >>try.msg 2>&1; then
5752 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5755 echo "The program compiled OK, but exited with status $?." >>try.msg
5756 rp="You have a problem. Shall I abort Configure"
5760 echo "I can't compile the test program." >>try.msg
5761 rp="You have a BIG problem. Shall I abort Configure"
5767 case "$knowitall" in
5769 echo "(The supplied flags or libraries might be incorrect.)"
5777 *) echo "Ok. Stopping Configure." >&4
5782 n) echo "OK, that should do.";;
5784 $rm_try gcctest gcctest.out
5786 : define a shorthand compile call
5790 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5791 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5795 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5796 : define a shorthand compile call for compilations that should be ok.
5800 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5802 : determine filename position in cpp output
5804 echo "Computing filename position in cpp output for #include directives..." >&4
5806 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5811 vos) testaccess=-e ;;
5814 echo '#include <stdio.h>' > foo.c
5817 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5818 $grep '^[ ]*#.*stdio\.h' | \
5819 while read cline; do
5822 while $test \$# -gt 0; do
5823 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5828 pos=\`expr \$pos + 1\`
5842 *) pos="${fieldn}th";;
5844 echo "Your cpp writes the filename in the $pos field of the line."
5846 : locate header file
5851 for usrincdir in $incpth
5853 if test -f \$usrincdir/\$wanted; then
5854 echo "\$usrincdir/\$wanted"
5858 awkprg='{ print \$$fieldn }'
5859 echo "#include <\$wanted>" > foo\$\$.c
5860 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5861 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5862 while read cline; do
5863 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5865 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5866 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5871 # status = 0: grep returned 0 lines, case statement not executed
5872 # status = 1: headerfile found
5873 # status = 2: while loop executed, no headerfile found
5877 if test \$status -eq 1; then
5884 : define an alternate in-header-list? function
5885 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5886 cont=true; xxf="echo \"<\$1> found.\" >&4";
5887 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5888 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5890 case $# in 4) instead=instead;; *) instead="at last";; esac;
5891 while $test "$cont"; do
5893 var=$2; eval "was=\$$2";
5894 if $test "$xxx" && $test -r "$xxx";
5896 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5899 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5900 set $yyy; shift; shift; yyy=$@;
5901 case $# in 0) cont="";;
5902 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5903 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5904 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5905 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5909 do set $yyy; var=$2; eval "was=\$$2";
5910 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5911 set $yyy; shift; shift; yyy=$@;
5914 : see if stdlib is available
5915 set stdlib.h i_stdlib
5918 : check for lengths of integral types
5922 echo "Checking to see how big your integers are..." >&4
5931 printf("intsize=%d;\n", (int)sizeof(int));
5932 printf("longsize=%d;\n", (int)sizeof(long));
5933 printf("shortsize=%d;\n", (int)sizeof(short));
5938 if eval $compile_ok && $run ./try > /dev/null; then
5940 echo "Your integers are $intsize bytes long."
5941 echo "Your long integers are $longsize bytes long."
5942 echo "Your short integers are $shortsize bytes long."
5946 Help! I can't compile and run the intsize test program: please enlighten me!
5947 (This is probably a misconfiguration in your system or libraries, and
5948 you really ought to fix it. Still, I'll try anyway.)
5952 rp="What is the size of an integer (in bytes)?"
5956 rp="What is the size of a long integer (in bytes)?"
5960 rp="What is the size of a short integer (in bytes)?"
5968 : check for long long
5970 echo "Checking to see if you have long long..." >&4
5971 echo 'int main() { long long x = 7; return 0; }' > try.c
5973 if eval $compile; then
5975 echo "You have long long."
5978 echo "You do not have long long."
5984 : check for length of long long
5985 case "${d_longlong}${longlongsize}" in
5988 echo "Checking to see how big your long longs are..." >&4
5989 $cat >try.c <<'EOCP'
5993 printf("%d\n", (int)sizeof(long long));
5998 if eval $compile_ok; then
5999 longlongsize=`$run ./try`
6000 echo "Your long longs are $longlongsize bytes long."
6004 echo "(I can't seem to compile the test program. Guessing...)"
6005 rp="What is the size of a long long (in bytes)?"
6009 if $test "X$longsize" = "X$longlongsize"; then
6010 echo "(That isn't any different from an ordinary long.)"
6016 : see if inttypes.h is available
6017 : we want a real compile instead of Inhdr because some systems
6018 : have an inttypes.h which includes non-existent headers
6021 #include <inttypes.h>
6023 static int32_t foo32 = 0x12345678;
6027 if eval $compile; then
6028 echo "<inttypes.h> found." >&4
6031 echo "<inttypes.h> NOT found." >&4
6040 echo "Checking to see if you have int64_t..." >&4
6042 #include <sys/types.h>
6043 #$i_inttypes I_INTTYPES
6045 #include <inttypes.h>
6047 int main() { int64_t x = 7; }
6050 if eval $compile; then
6052 echo "You have int64_t."
6055 echo "You do not have int64_t."
6061 : Check if 64bit ints have a quad type
6063 echo "Checking which 64-bit integer type we could use..." >&4
6069 val='"unsigned int"'
6074 *) case "$longsize" in
6078 val='"unsigned long"'
6083 *) case "$d_longlong:$longlongsize" in
6088 val='"unsigned long long"'
6093 *) case "$d_int64_t" in
6112 '') echo "Alas, no 64-bit integer types in sight." >&4
6115 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6120 : Do we want 64bit support
6121 case "$uselonglong" in
6122 "$define"|true|[yY]*)
6125 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6127 use64bitint="$define"
6130 case "$use64bits" in
6131 "$define"|true|[yY]*)
6134 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6136 use64bitint="$define"
6139 case "$use64bitints" in
6140 "$define"|true|[yY]*)
6143 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6145 use64bitint="$define"
6148 case "$use64bitsint" in
6149 "$define"|true|[yY]*)
6152 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6154 use64bitint="$define"
6157 case "$uselonglongs" in
6158 "$define"|true|[yY]*)
6161 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6163 use64bitint="$define"
6166 case "$use64bitsall" in
6167 "$define"|true|[yY]*)
6170 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6172 use64bitall="$define"
6177 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6179 case "$use64bitall" in
6180 "$define"|true|[yY]*) use64bitint="$define" ;;
6186 You have natively 64-bit long integers.
6190 *) case "$use64bitint" in
6191 "$define"|true|[yY]*) dflt='y';;
6200 Perl can be built to take advantage of 64-bit integer types
6201 on some systems. To do so, Configure can be run with -Duse64bitint.
6202 Choosing this option will most probably introduce binary incompatibilities.
6204 If this doesn't make any sense to you, just accept the default '$dflt'.
6205 (The default has been chosen based on your configuration.)
6207 rp='Try to use 64-bit integers, if available?'
6210 [yY]*) val="$define" ;;
6218 case "$use64bitall" in
6219 "$define"|true|[yY]*) dflt='y' ;;
6220 *) case "$longsize" in
6228 You may also choose to try maximal 64-bitness. It means using as much
6229 64-bitness as possible on the platform. This in turn means even more
6230 binary incompatibilities. On the other hand, your platform may not
6231 have any more 64-bitness available than what you already have chosen.
6233 If this doesn't make any sense to you, just accept the default '$dflt'.
6234 (The default has been chosen based on your configuration.)
6236 rp='Try to use maximal 64-bit support, if available?'
6239 [yY]*) val="$define" ;;
6244 case "$use64bitall" in
6246 case "$use64bitint" in
6250 Since you have chosen a maximally 64-bit build, I'm also turning on
6251 the use of 64-bit integers.
6253 use64bitint="$define" ;;
6258 : Look for a hint-file generated 'call-back-unit'. If the
6259 : user has specified that a 64-bit perl is to be built,
6260 : we may need to set or change some other defaults.
6261 if $test -f use64bitint.cbu; then
6262 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6265 case "$use64bitint" in
6266 "$define"|true|[yY]*)
6267 : This test was common to all the OpenBSD forks, and seems harmless for
6270 echo "Checking if your C library has broken 64-bit functions..." >&4
6273 typedef $uquadtype myULL;
6280 {4294967303.15, 4294967303ULL},
6281 {4294967294.2, 4294967294ULL},
6282 {4294967295.7, 4294967295ULL},
6285 for (p = test; p->u; p++) {
6286 myULL x = (myULL)p->d;
6297 if eval $compile_ok; then
6298 libcquad=`$run ./try`
6299 echo "Your C library's 64-bit functions are $libcquad."
6301 echo "(I can't seem to compile the test program.)"
6302 echo "Assuming that your C library's 64-bit functions are ok."
6311 *** You have a C library with broken 64-bit functions.
6312 *** 64-bit support does not work reliably in this configuration.
6313 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6314 *** Cannot continue, aborting.
6321 4) case "$archname64" in
6322 '') archname64=64int ;;
6329 : Look for a hint-file generated 'call-back-unit'. If the
6330 : user has specified that a maximally 64-bit perl is to be built,
6331 : we may need to set or change some other defaults.
6332 if $test -f use64bitall.cbu; then
6333 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6336 case "$use64bitall" in
6337 "$define"|true|[yY]*)
6339 4) case "$archname64" in
6340 ''|64int) archname64=64all ;;
6347 case "$d_quad:$use64bitint" in
6351 *** You have chosen to use 64-bit integers,
6352 *** but none can be found.
6353 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6354 *** Cannot continue, aborting.
6361 : Check if we are using the GNU C library
6363 echo "Checking for GNU C Library..." >&4
6365 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6366 alone are insufficient to distinguish different versions, such as
6367 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6368 libc version 2.1.0. A. Dougherty, June 3, 2002.
6374 # ifdef __GLIBC_MINOR__
6375 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6376 # include <gnu/libc-version.h>
6377 printf("%s\n", gnu_get_libc_version());
6379 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6382 printf("%d\n", __GLIBC__);
6391 if eval $compile_ok && $run ./try > glibc.ver; then
6393 gnulibc_version=`$cat glibc.ver`
6394 echo "You are using the GNU C Library version $gnulibc_version"
6398 echo "You are not using the GNU C Library"
6404 : see if nm is to be used to determine whether a symbol is defined or not
6408 case "$d_gnulibc" in
6411 echo "nm probably won't work on the GNU C Library." >&4
6417 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6419 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6420 echo "'nm' won't be sufficient on this system." >&4
6426 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6427 if $test $dflt -gt 20; then
6437 true|$define) dflt=y;;
6444 I can use $nm to extract the symbols from your C libraries. This
6445 is a time consuming task which may generate huge output on the disk (up
6446 to 3 megabytes) but that should make the symbols extraction faster. The
6447 alternative is to skip the 'nm' extraction part and to compile a small
6448 test program instead to determine whether each symbol is present. If
6449 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6450 this may be the best solution.
6452 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6455 rp="Shall I use $nm to extract C symbols from the libraries?"
6458 [Nn]*) usenm=false;;
6467 : nm options which may be necessary
6469 '') if $test -f /mach_boot; then
6471 elif $test -d /usr/ccs/lib; then
6472 nm_opt='-p' # Solaris (and SunOS?)
6473 elif $test -f /dgux; then
6475 elif $test -f /lib64/rld; then
6476 nm_opt='-p' # 64-bit Irix
6482 : nm options which may be necessary for shared libraries but illegal
6483 : for archive libraries. Thank you, Linux.
6484 case "$nm_so_opt" in
6485 '') case "$myuname" in
6487 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6488 nm_so_opt='--dynamic'
6495 : Figure out where the libc is located
6498 : get list of predefined functions in a handy place
6503 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6509 *) for thislib in $libs; do
6512 : Handle C library specially below.
6515 thislib=`echo $thislib | $sed -e 's/^-l//'`
6516 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6518 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6520 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6522 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6524 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6526 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6528 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6533 libnames="$libnames $try"
6535 *) libnames="$libnames $thislib" ;;
6544 for xxx in $libpth; do
6545 $test -r $1 || set $xxx/libc.$so
6546 : The messy sed command sorts on library version numbers.
6548 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6549 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6551 s/[0-9][0-9]*/0000&/g
6552 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6555 $sort | $sed -e 's/^.* //'`
6558 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6559 $test -r $1 || set $sysroot/lib/libsys_s$_a
6565 if $test -r "$1"; then
6566 echo "Your (shared) C library seems to be in $1."
6568 elif $test -r /lib/libc && $test -r /lib/clib; then
6569 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6571 libc='/lib/clib /lib/libc'
6572 if $test -r /lib/syslib; then
6573 echo "(Your math library is in /lib/syslib.)"
6574 libc="$libc /lib/syslib"
6576 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6577 echo "Your C library seems to be in $libc, as you said before."
6578 elif $test -r $incpath/usr/lib/libc$_a; then
6579 libc=$incpath/usr/lib/libc$_a;
6580 echo "Your C library seems to be in $libc. That's fine."
6581 elif $test -r /lib/libc$_a; then
6583 echo "Your C library seems to be in $libc. You're normal."
6585 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6587 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6588 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6589 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6591 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6593 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6596 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6598 if $test -r "$tans"; then
6599 echo "Your C library seems to be in $tans, of all places."
6605 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6609 If the guess above is wrong (which it might be if you're using a strange
6610 compiler, or your machine supports multiple models), you can override it here.
6615 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6617 I can't seem to find your C library. I've looked in the following places:
6620 $sed 's/^/ /' libpath
6623 None of these seems to contain your C library. I need to get its name...
6628 rp='Where is your C library?'
6633 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6634 set X `cat libnames`
6637 case $# in 1) xxx=file; esac
6638 echo "Extracting names from the following $xxx for later perusal:" >&4
6640 $sed 's/^/ /' libnames >&4
6642 $echo $n "This may take a while...$c" >&4
6646 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6647 *) $nm $nm_opt $file 2>/dev/null;;
6652 $grep fprintf libc.tmp > libc.ptf
6653 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6654 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6656 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6676 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6680 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6681 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6697 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6701 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6705 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6707 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6709 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6711 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6714 $nm -p $* 2>/dev/null >libc.tmp
6715 $grep fprintf libc.tmp > libc.ptf
6716 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6717 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6723 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6725 if $ar t $libc > libc.tmp && \
6726 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6728 for thisname in $libnames $libc; do
6729 $ar t $thisname >>libc.tmp
6731 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6733 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6734 for thisname in $libnames $libc; do
6735 $ar tv $thisname >>libc.tmp
6736 emximp -o tmp.imp $thisname \
6738 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6739 < tmp.imp >>libc.tmp
6742 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6745 echo "$ar didn't seem to work right." >&4
6746 echo "Maybe this is a Cray...trying bld instead..." >&4
6748 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6751 for thisname in $libnames; do
6753 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6754 $ar t $thisname >>libc.tmp
6758 echo "That didn't work either. Giving up." >&4
6768 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6769 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6771 *) if $test -f /lib/syscalls.exp; then
6773 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6774 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6775 /lib/syscalls.exp >>libc.list
6781 $rm -f libnames libpath
6783 : Check if we are using C++
6785 echo "Checking for C++..." >&4
6786 $cat >try.c <<'EOCP'
6798 if eval $compile_ok && $run ./try; then
6800 echo "You are using a C++ compiler."
6803 echo "You are not using a C++ compiler."
6809 : is a C symbol defined?
6812 -v) tf=libc.tmp; tdc="";;
6813 -a) tf=libc.tmp; tdc="[]";;
6814 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6816 case "$d_cplusplus" in
6817 $define) extern_C="extern \"C\"" ;;
6818 *) extern_C="extern" ;;
6821 case "$reuseval-$4" in
6823 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6828 if $test "$runnm" = true; then
6829 if $contains $tlook $tf >/dev/null 2>&1; then
6831 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6832 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6833 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6834 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6838 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6839 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6845 $define) tval=true;;
6852 : define an is-in-libc? function
6853 inlibc='echo " "; td=$define; tu=$undef;
6854 sym=$1; var=$2; eval "was=\$$2";
6856 case "$reuseval$was" in
6866 echo "$sym() found." >&4;
6867 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6869 echo "$sym() NOT found." >&4;
6870 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6874 $define) echo "$sym() found." >&4;;
6875 *) echo "$sym() NOT found." >&4;;
6879 : check for length of double
6881 case "$doublesize" in
6883 echo "Checking to see how big your double precision numbers are..." >&4
6892 printf("%d\n", (int)sizeof(double));
6897 if eval $compile_ok; then
6898 doublesize=`$run ./try`
6899 echo "Your double is $doublesize bytes long."
6902 echo "(I can't seem to compile the test program. Guessing...)"
6903 rp="What is the size of a double precision number (in bytes)?"
6911 : see if this is a float.h system
6915 : check for long doubles
6917 echo "Checking to see if you have long double..." >&4
6918 echo 'int main() { long double x = 7.0; }' > try.c
6920 if eval $compile; then
6922 echo "You have long double."
6925 echo "You do not have long double."
6931 : see if ldexpl exists
6935 : check for length of long double
6936 case "${d_longdbl}${longdblsize}" in
6939 echo "Checking to see how big your long doubles are..." >&4
6940 $cat >try.c <<'EOCP'
6944 printf("%d\n", sizeof(long double));
6949 if eval $compile; then
6950 longdblsize=`$run ./try`
6951 echo "Your long doubles are $longdblsize bytes long."
6955 echo "(I can't seem to compile the test program. Guessing...)" >&4
6956 rp="What is the size of a long double (in bytes)?"
6960 if $test "X$doublesize" = "X$longdblsize"; then
6961 echo "That isn't any different from an ordinary double."
6962 echo "I'll keep your setting anyway, but you may see some"
6963 echo "harmless compilation warnings."
6969 $echo "Checking the kind of long doubles you have..." >&4
6970 case "$d_longdbl" in
6975 #define LONGDBLSIZE $longdblsize
6976 #define DOUBLESIZE $doublesize
6984 static const long double d = -0.1L;
6986 unsigned const char* b = (unsigned const char*)(&d);
6987 #if DOUBLESIZE == LONGDBLSIZE
6988 printf("0\n"); /* if it floats like double */
6991 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6992 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6993 /* IEEE 754 128-bit little-endian */
6997 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6998 /* IEEE 128-bit big-endian, e.g. solaris sparc */
7003 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
7004 * while 64-bits platforms have it in 16 bytes. The trailing bytes
7005 * cannot be trusted. */
7006 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
7007 if (b[0] == 0xCD && b[9] == 0xBF) {
7008 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7009 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7010 * Also known as "extended precision". */
7014 if (b[0] == 0xBF && b[9] == 0xCD) {
7015 /* Is there ever big-endian 80-bit, really?
7017 * The Motorola 68881 had another "extended precision" format:
7018 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7019 * for total of 96 bits of bytes. The zero bits were unused.
7020 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7021 * If it ever becomes relevant, this format should be allocated
7022 * a new doublekind code since it's quite different from the Intel x87.
7028 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7029 /* software "double double", the 106 is 53+53.
7030 * but irix thinks it is 107. */
7031 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7032 /* double double 128-bit fully little-endian,
7033 * little-endian doubles in little-endian order,
7034 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7038 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7039 /* double double 128-bit fully big-endian,
7040 * big-endian doubles in big-endian order,
7041 * e.g. PPC/Power and MIPS:
7042 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7046 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7047 /* double double 128-bit mixed endian.
7048 * little-endian doubles in big-endian order,
7050 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7054 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7055 /* double double 128-bit mixed endian,
7056 * big-endian doubles in little-endian order,
7057 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7062 /* We are largely making this up because it may well be
7063 * that the VAX format H was never made available to C,
7064 * only to Fortran. */
7065 #if LONGDBLSIZE == 16 && defined(__vax__)
7066 if (b[0] == 0xFD && b[15] == 0x99) {
7067 /* VAX format H, PDP-11 mixed endian. */
7072 printf("-1\n"); /* unknown */
7077 if eval $compile; then
7078 longdblkind=`$run ./try`
7085 case "$longdblkind" in
7086 0) echo "Your long doubles are doubles." >&4 ;;
7087 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7088 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7089 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7090 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7091 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7092 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7093 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7094 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7095 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7096 *) echo "Cannot figure out your long double." >&4 ;;
7098 d_long_double_style_ieee=$undef
7099 d_long_double_style_ieee_std=$undef
7100 d_long_double_style_ieee_extended=$undef
7101 d_long_double_style_ieee_doubledouble=$undef
7102 d_long_double_style_vax=$undef
7103 case "$longdblkind" in
7104 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7106 case "$longdblkind" in
7107 1|2) d_long_double_style_ieee_std=$define ;;
7109 case "$longdblkind" in
7110 3|4) d_long_double_style_ieee_extended=$define ;;
7112 case "$longdblkind" in
7113 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7115 case "$longdblkind" in
7116 9) d_long_double_style_vax=$define ;;
7120 : determine the architecture name
7122 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7123 tarch=`arch`"-$osname"
7124 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7125 if uname -m > tmparch 2>&1 ; then
7126 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7127 -e 's/$/'"-$osname/" tmparch`
7135 case "$myarchname" in
7138 echo "(Your architecture name used to be $myarchname.)"
7142 case "$targetarch" in
7144 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7149 *) dflt="$archname";;
7151 rp='What is your architecture name'
7155 : optionally add API version to the architecture for versioned archlibs
7156 case "$useversionedarchname" in
7157 $define|true|[yY]*) dflt='y';;
7160 rp='Add the Perl API version to your archname?'
7163 y|Y) useversionedarchname="$define" ;;
7164 *) useversionedarchname="$undef" ;;
7166 case "$useversionedarchname" in
7169 *-$api_versionstring)
7170 echo "...and architecture name already has -$api_versionstring" >&4
7173 archname="$archname-$api_versionstring"
7174 echo "...setting architecture name to $archname." >&4
7180 case "$usethreads" in
7182 echo "Threads selected." >&4
7184 *-thread*) echo "...and architecture name already has -thread." >&4
7186 *) archname="$archname-thread"
7187 echo "...setting architecture name to $archname." >&4
7192 case "$usemultiplicity" in
7194 echo "Multiplicity selected." >&4
7196 *-multi*) echo "...and architecture name already has -multi." >&4
7198 *) archname="$archname-multi"
7199 echo "...setting architecture name to $archname." >&4
7204 case "$use64bitint$use64bitall" in
7206 case "$archname64" in
7208 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7211 case "$use64bitint" in
7212 "$define") echo "64 bit integers selected." >&4 ;;
7214 case "$use64bitall" in
7215 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7218 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7220 *) archname="$archname-$archname64"
7221 echo "...setting architecture name to $archname." >&4
7227 case "$uselongdouble" in
7229 echo "Long doubles selected." >&4
7230 case "$longdblsize" in
7232 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7236 *-ld*) echo "...and architecture name already has -ld." >&4
7238 *) archname="$archname-ld"
7239 echo "...setting architecture name to $archname." >&4
7246 case "$usequadmath" in
7248 echo "quadmath selected." >&4
7250 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7252 *) archname="$archname-quadmath"
7253 echo "...setting architecture name to $archname." >&4
7258 if $test -f archname.cbu; then
7259 echo "Your platform has some specific hints for architecture name, using them..."
7263 : set the prefixit variable, to compute a suitable default value
7264 prefixit='case "$3" in
7266 case "$oldprefix" in
7267 "") eval "$1=\"\$$2\"";;
7274 ""|" ") eval "$1=\"\$$2\"";;
7280 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7282 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7283 /*-$oldprefix/*|\~*-$oldprefix/*)
7284 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7285 *) eval "$1=\"\$$2\"";;
7289 : determine installation style
7290 : For now, try to deduce it from prefix unless it is already set.
7291 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7292 case "$installstyle" in
7293 '') case "$prefix" in
7294 *perl*) dflt='lib';;
7295 *) dflt='lib/perl5' ;;
7298 *) dflt="$installstyle" ;;
7300 : Probably not worth prompting for this since we prompt for all
7301 : the directories individually, and the prompt would be too long and
7305 : determine where public executables go
7310 rp='Pathname where the public executables will reside?'
7312 if $test "X$ansexp" != "X$binexp"; then
7316 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7317 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7318 : this via initialinstalllocation
7321 case "$userelocatableinc" in
7322 $define|true|[yY]*) dflt='y' ;;
7327 Would you like to build Perl so that the installation is relocatable, so that
7328 library paths in @INC are determined relative to the path of the perl binary?
7329 This is not advised for system Perl installs, or if you need to run setid
7330 scripts or scripts under taint mode.
7332 If this doesn't make any sense to you, just accept the default '$dflt'.
7334 rp='Use relocatable @INC?'
7337 y|Y) val="$define" ;;
7340 set userelocatableinc
7343 initialinstalllocation="$binexp"
7344 : Default prefix is now "up one level from where the binaries are"
7345 case "$userelocatableinc" in
7351 installprefixexp=".../.."
7355 : determine where private library files go
7356 : Usual default is /usr/local/lib/perl5/$version.
7357 : Also allow things like /opt/perl/lib/$version, since
7358 : /opt/perl/lib/perl5... would be redundant.
7359 : The default "style" setting is made in installstyle.U
7360 case "$installstyle" in
7361 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7362 *) set dflt privlib lib/$version ;;
7367 There are some auxiliary files for $package that need to be put into a
7368 private library directory that is accessible by everyone.
7373 rp='Pathname where the private library files will reside?'
7378 : set the prefixup variable, to restore leading tilda escape
7379 prefixup='case "$prefixexp" in
7381 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7384 : determine where public architecture dependent libraries go
7387 : privlib default is /usr/local/lib/$package/$version
7388 : archlib default is /usr/local/lib/$package/$version/$archname
7389 : privlib may have an optional trailing /share.
7390 tdflt=`echo $privlib | $sed 's,/share$,,'`
7391 tdflt=$tdflt/$archname
7400 $spackage contains architecture-dependent library files. If you are
7401 sharing libraries in a heterogeneous environment, you might store
7402 these files in a separate location. Otherwise, you can just include
7403 them with the rest of the public library files.
7408 rp='Where do you want to put the public architecture-dependent libraries?'
7412 if $test X"$archlib" = X"$privlib"; then
7418 : see if setuid scripts can be secure
7421 Some kernels have a bug that prevents setuid #! scripts from being
7422 secure. Some sites have disabled setuid #! scripts because of this.
7424 First let's decide if your kernel supports secure setuid #! scripts.
7425 (If setuid #! scripts would be secure but have been disabled anyway,
7426 don't say that they are secure if asked.)
7431 if $test -d /dev/fd; then
7432 echo "#!$ls" >reflect
7433 chmod +x,u+s reflect
7434 ./reflect >flect 2>&1
7435 if $contains "/dev/fd" flect >/dev/null; then
7436 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7440 If you are not sure if they are secure, I can check but I'll need a
7441 username and password different from the one you are using right now.
7442 If you don't have such a username or don't want me to test, simply
7446 rp='Other username to test security of setuid scripts with?'
7451 case "$d_suidsafe" in
7452 '') echo "I'll assume setuid scripts are *not* secure." >&4
7455 echo "Well, the $hint value is *not* secure." >&4
7457 *) echo "Well, the $hint value *is* secure." >&4
7462 $rm -f reflect flect
7463 echo "#!$ls" >reflect
7464 chmod +x,u+s reflect
7467 echo '"su" will (probably) prompt you for '"$ans's password."
7468 su $ans -c './reflect >flect'
7469 if $contains "/dev/fd" flect >/dev/null; then
7470 echo "Okay, it looks like setuid scripts are secure." >&4
7473 echo "I don't think setuid scripts are secure." >&4
7478 rp='Does your kernel have *secure* setuid scripts?'
7481 [yY]*) val="$define";;
7486 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7487 echo "(That's for file descriptors, not floppy disks.)"
7493 $rm -f reflect flect
7495 : now see if they want to do setuid emulation
7496 if $test $patchlevel -lt 11; then
7499 case "$d_suidsafe" in
7502 echo "No need to emulate SUID scripts since they are secure here." >&4
7506 Some systems have disabled setuid scripts, especially systems where
7507 setuid scripts cannot be secure. On systems where setuid scripts have
7508 been disabled, the setuid/setgid bits on scripts are currently
7509 useless. It is possible for $package to detect those bits and emulate
7510 setuid/setgid in a secure fashion. This emulation will only work if
7511 setuid scripts have been disabled in your kernel.
7515 "$define") dflt=y ;;
7518 rp="Do you want to do setuid/setgid emulation?"
7521 [yY]*) val="$define";;
7533 SUID emulation has been removed for 5.12
7534 Please re-run Configure without -Dd_dosuid
7543 : Find perl5.005 or later.
7544 echo "Looking for a previously installed perl5.005 or later... "
7546 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7547 : Check if this perl is recent and can load a simple module
7548 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7551 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7561 '') echo "None found. That's ok.";;
7562 *) echo "Using $perl5." ;;
7565 : Set the siteprefix variables
7568 After $package is installed, you may wish to install various
7569 add-on modules and utilities. Typically, these add-ons will
7570 be installed under $prefix with the rest
7571 of this package. However, you may wish to install such add-ons
7572 elsewhere under a different prefix.
7574 If you do not wish to put everything under a single prefix, that's
7575 ok. You will be prompted for the individual locations; this siteprefix
7576 is only used to suggest the defaults.
7578 The default should be fine for most people.
7582 rp='Installation prefix to use for add-on modules and utilities?'
7583 : XXX Here might be another good place for an installstyle setting.
7584 case "$siteprefix" in
7586 *) dflt=$siteprefix ;;
7589 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7591 case "$siteprefix" in
7595 *) oldsiteprefix="$prefix";;
7600 siteprefixexp="$ansexp"
7602 : determine where site specific libraries go.
7603 : Usual default is /usr/local/lib/perl5/site_perl/$version
7604 : The default "style" setting is made in installstyle.U
7605 : XXX No longer works with Prefixit stuff.
7606 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7608 '') case "$installstyle" in
7609 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7610 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7618 The installation process will create a directory for
7619 site-specific extensions and modules. Most users find it convenient
7620 to place all site-specific files in this directory rather than in the
7621 main distribution directory.
7625 rp='Pathname for the site-specific library files?'
7629 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7631 : Determine list of previous versions to include in @INC
7632 $cat > getverlist <<EOPL
7635 \$api_versionstring = "$api_versionstring";
7636 \$version = "$version";
7637 \$stem = "$sitelib_stem";
7638 \$archname = "$archname";
7640 $cat >> getverlist <<'EOPL'
7641 # The list found is store twice for each entry: the original name, and
7642 # the binary broken down version as pack "sss", so sorting is easy and
7643 # unambiguous. This will work for all versions that have a maximum of
7644 # three digit groups, separate by '.'s or '_'s. Names are extended with
7645 # ".0.0" to ensure at least three elements for the pack.
7646 # -- H.Merijn Brand (m)'06 23-10-2006
7648 # Can't have leading @ because metaconfig interprets it as a command!
7649 ;@inc_version_list=();
7650 # XXX Redo to do opendir/readdir?
7653 ;@candidates = map {
7654 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7655 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7661 ($pversion, $aversion, $vsn5005) = map {
7662 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7663 foreach $d (@candidates) {
7664 if ($d->[1] lt $pversion) {
7665 if ($d->[1] ge $aversion) {
7666 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7668 elsif ($d->[1] ge $vsn5005) {
7669 unshift(@inc_version_list, grep { -d } $d->[0]);
7673 # Skip newer version. I.e. don't look in
7674 # 5.7.0 if we're installing 5.6.1.
7678 if (@inc_version_list) {
7679 print join(' ', @inc_version_list);
7682 # Blank space to preserve value for next Configure run.
7687 case "$inc_version_list" in
7688 '') if test -x "$perl5$exe_ext"; then
7689 dflt=`$perl5 getverlist`
7694 $undef) dflt='none' ;;
7695 *) eval dflt=\"$inc_version_list\" ;;
7698 ''|' ') dflt=none ;;
7705 In order to ease the process of upgrading, this version of perl
7706 can be configured to use modules built and installed with earlier
7707 versions of perl that were installed under $prefix. Specify here
7708 the list of earlier versions that this version of perl should check.
7709 If Configure detected no earlier versions of perl installed under
7710 $prefix, then the list will be empty. Answer 'none' to tell perl
7711 to not search earlier versions.
7713 The default should almost always be sensible, so if you're not sure,
7714 just accept the default.
7717 rp='List of earlier versions to include in @INC?'
7720 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7721 *) inc_version_list="$ans" ;;
7723 case "$inc_version_list" in
7725 inc_version_list_init='0'
7726 d_inc_version_list="$undef"
7728 *) inc_version_list_init=`echo $inc_version_list |
7729 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7730 d_inc_version_list="$define"
7735 : see if malloc/malloc.h has to be included
7736 set malloc/malloc.h i_mallocmalloc
7739 : see if this is a malloc.h system
7740 : we want a real compile instead of Inhdr because some systems have a
7741 : malloc.h that just gives a compile error saying to use stdlib.h instead
7746 #$i_mallocmalloc I_MALLOCMALLOC
7747 #ifdef I_MALLOCMALLOC
7748 # include <malloc/malloc.h>
7751 int main () { return 0; }
7754 if eval $compile; then
7755 echo "<malloc.h> found." >&4
7758 echo "<malloc.h> NOT found." >&4
7765 : check for length of pointer
7769 echo "Checking to see how big your pointers are..." >&4
7778 printf("%d\n", (int)sizeof(void *));
7783 if eval $compile_ok; then
7784 ptrsize=`$run ./try`
7785 echo "Your pointers are $ptrsize bytes long."
7788 echo "(I can't seem to compile the test program. Guessing...)" >&4
7789 rp="What is the size of a pointer (in bytes)?"
7796 case "$use64bitall" in
7797 "$define"|true|[yY]*)
7801 *** You have chosen a maximally 64-bit build,
7802 *** but your pointers are only 4 bytes wide.
7803 *** Please rerun Configure without -Duse64bitall.
7808 *** Since you have quads, you could possibly try with -Duse64bitint.
7813 *** Cannot continue, aborting.
7824 : determine whether to use malloc wrapping
7826 case "$usemallocwrap" in
7827 [yY]*|true|$define) dflt='y' ;;
7828 [nN]*|false|$undef) dflt='n' ;;
7829 *) case "$usedevel" in
7830 [yY]*|true|$define) dflt='y' ;;
7835 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7837 usemallocwrap="$ans"
7840 usemallocwrap="$define" ;;
7842 usemallocwrap="$undef" ;;
7845 : determine which malloc to compile in
7847 case "$usemymalloc" in
7848 [yY]*|true|$define) dflt='y' ;;
7849 [nN]*|false|$undef) dflt='n' ;;
7850 *) case "$ptrsize" in
7854 if test "$useithreads" = "$define"; then dflt='n'; fi
7857 rp="Do you wish to attempt to use the malloc that comes with $package?"
7863 mallocsrc='malloc.c'
7864 mallocobj="malloc$_o"
7865 d_mymalloc="$define"
7868 : Remove malloc from list of libraries to use
7869 echo "Removing unneeded -lmalloc from library list" >&4
7870 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7873 echo "libs = $libs" >&4
7885 : compute the return types of malloc and free
7887 $cat >malloc.c <<END
7891 #include <sys/types.h>
7905 case "$malloctype" in
7907 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7914 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7918 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7925 echo "Your system uses $freetype free(), it would seem." >&4
7927 : determine where site specific architecture-dependent libraries go.
7928 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7929 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7930 : sitelib may have an optional trailing /share.
7932 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7933 dflt="$dflt/$archname"
7938 set sitearch sitearch none
7942 The installation process will also create a directory for
7943 architecture-dependent site-specific extensions and modules.
7947 rp='Pathname for the site-specific architecture-dependent library files?'
7951 if $test X"$sitearch" = X"$sitelib"; then
7954 d_sitearch="$define"
7957 : Set the vendorprefix variables
7960 The installation process will also create a directory for
7961 vendor-supplied add-ons. Vendors who supply perl with their system
7962 may find it convenient to place all vendor-supplied files in this
7963 directory rather than in the main distribution directory. This will
7964 ease upgrades between binary-compatible maintenance versions of perl.
7966 Of course you may also use these directories in whatever way you see
7967 fit. For example, you might use them to access modules shared over a
7968 company-wide network.
7970 The default answer should be fine for most people.
7971 This causes further questions about vendor add-ons to be skipped
7972 and no vendor-specific directories will be configured for perl.
7975 rp='Do you want to configure vendor-specific add-on directories?'
7976 case "$usevendorprefix" in
7977 define|true|[yY]*) dflt=y ;;
7978 *) : User may have set vendorprefix directly on Configure command line.
7979 case "$vendorprefix" in
7988 rp='Installation prefix to use for vendor-supplied add-ons?'
7989 case "$vendorprefix" in
7990 '') dflt="$prefix" ;;
7991 *) dflt=$vendorprefix ;;
7994 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7996 case "$vendorprefix" in
8000 *) oldvendorprefix="$prefix";;
8004 usevendorprefix="$define"
8006 vendorprefixexp="$ansexp"
8008 *) usevendorprefix="$undef"
8014 : Set the vendorlib variables
8015 case "$vendorprefix" in
8016 '') d_vendorlib="$undef"
8020 *) d_vendorlib="$define"
8021 : determine where vendor-supplied modules go.
8022 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8023 case "$vendorlib" in
8025 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8026 case "$installstyle" in
8027 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8028 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8031 *) dflt="$vendorlib"
8035 rp='Pathname for the vendor-supplied library files?'
8038 vendorlibexp="$ansexp"
8041 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8045 : Set the vendorarch variables
8046 case "$vendorprefix" in
8047 '') d_vendorarch="$undef"
8051 *) d_vendorarch="$define"
8052 : determine where vendor-supplied architecture-dependent libraries go.
8053 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8054 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8055 : vendorlib may have an optional trailing /share.
8056 case "$vendorarch" in
8057 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8058 dflt="$dflt/$archname"
8060 *) dflt="$vendorarch" ;;
8063 rp='Pathname for vendor-supplied architecture-dependent files?'
8066 vendorarchexp="$ansexp"
8069 prefixvar=vendorarch
8071 if $test X"$vendorarch" = X"$vendorlib"; then
8072 d_vendorarch="$undef"
8074 d_vendorarch="$define"
8077 : Final catch-all directories to search
8080 Lastly, you can have perl look in other directories for extensions and
8081 modules in addition to those already specified.
8082 These directories will be searched after
8086 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8087 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8089 case "$otherlibdirs" in
8090 ''|' ') dflt='none' ;;
8091 *) dflt="$otherlibdirs" ;;
8094 Enter a colon-separated set of extra paths to include in perl's @INC
8095 search path, or enter 'none' for no extra paths.
8099 rp='Colon-separated list of additional directories for perl to search?'
8102 ' '|''|none) otherlibdirs=' ' ;;
8103 *) otherlibdirs="$ans" ;;
8105 case "$otherlibdirs" in
8109 set d_perl_otherlibdirs
8112 : Cruising for prototypes
8114 echo "Checking out function prototypes..." >&4
8115 $cat >prototype.c <<EOCP
8120 int main(int argc, char *argv[]) {
8123 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8124 echo "Your C compiler appears to support function prototypes."
8127 echo "Your C compiler doesn't seem to understand function prototypes."
8134 : Check if ansi2knr is required
8135 case "$prototype" in
8137 *) ansi2knr='ansi2knr'
8142 This version of $package can only be compiled by a compiler that
8143 understands function prototypes. Unfortunately, your C compiler
8145 doesn't seem to understand them. Sorry about that.
8147 If GNU cc is available for your system, perhaps you could try that instead.
8149 Eventually, we hope to support building Perl with pre-ANSI compilers.
8150 If you would like to help in that effort, please contact <perlbug@perl.org>.
8152 Aborting Configure now.
8159 dflt_dtrace='/usr/sbin/dtrace'
8160 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8164 Perl can be built to support DTrace on platforms that support it.
8165 DTrace is a diagnosis and performance analysis tool from Sun.
8167 If this doesn't make any sense to you, just accept the default.
8171 case "$usedtrace" in
8177 dflt_dtrace=$usedtrace
8184 rp='Support DTrace if available?'
8187 y|Y) val="$define" ;;
8193 test "X$usedtrace" != "X$define" && break
8196 rp='Where is the dtrace executable?'
8205 if $dtrace -h -s ../perldtrace.d \
8206 -o perldtrace.tmp >/dev/null 2>&1 \
8207 && rm -f perldtrace.tmp
8210 echo "Good: your $dtrace knows about the -h flag."
8214 *** $me: Fatal Error: $dtrace doesn't support -h flag
8216 *** Your installed dtrace doesn't support the -h switch to compile a D
8217 *** program into a C header. Can't continue.
8229 *** $me: Fatal Error: $dtrace not found.
8236 echo "*** $dtrace was not found."
8242 : See if we want extra modules installed
8249 Perl can be built with extra modules or bundles of modules which
8250 will be fetched from the CPAN and installed alongside Perl.
8252 Notice that you will need access to the CPAN; either via the Internet,
8253 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8254 be asked later to configure the CPAN.pm module which will in turn do
8255 the installation of the rest of the extra modules or bundles.)
8257 Notice also that if the modules require any external software such as
8258 libraries and headers (the libz library and the zlib.h header for the
8259 Compress::Zlib module, for example) you MUST have any such software
8260 already installed, this configuration process will NOT install such
8263 If this doesn't make any sense to you, just accept the default '$dflt'.
8265 rp='Install any extra modules (y or n)?'
8271 Please list any extra modules or bundles to be installed from CPAN,
8272 with spaces between the names. The names can be in any format the
8273 'install' command of CPAN.pm will understand. (Answer 'none',
8274 without the quotes, to install no extra modules or bundles.)
8284 $rm -f ../extras.lst
8286 *) echo "(Saving the list of extras for later...)"
8287 echo "$extras" > ../extras.lst
8295 : determine where html pages for programs go
8296 set html1dir html1dir none
8300 If you wish to install html files for programs in $spackage, indicate
8301 the appropriate directory here. To skip installing html files,
8305 ''|none|$undef|' ') dflt=none ;;
8306 *) dflt=$html1dir ;;
8309 rp="Directory for the main $spackage html pages?"
8313 : Use ' ' for none so value is preserved next time through Configure
8314 $test X"$html1dir" = "X" && html1dir=' '
8316 : determine where html pages for libraries and modules go
8317 set html3dir html3dir none
8321 If you wish to install html files for modules associated with $spackage,
8322 indicate the appropriate directory here. To skip installing html files,
8325 : There is no obvious default. If they have specified html1dir, then
8326 : try to key off that, possibly changing .../html1 into .../html3.
8328 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8329 *) dflt=$html3dir ;;
8332 rp="Directory for the $spackage module html pages?"
8336 : Use ' ' for none so value is preserved next time through Configure
8337 $test X"$html3dir" = "X" && html3dir=' '
8339 : determine whether to install perl also as /usr/bin/perl
8342 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8344 Many scripts expect perl to be installed as /usr/bin/perl.
8346 If you want to, I can install the perl you are about to compile
8347 as /usr/bin/perl (in addition to $bin/perl).
8349 if test -f /usr/bin/perl; then
8352 However, please note that because you already have a /usr/bin/perl,
8353 overwriting that with a new Perl would very probably cause problems.
8354 Therefore I'm assuming you don't want to do that (unless you insist).
8357 case "$installusrbinperl" in
8358 "$define"|[yY]*) dflt='y';;
8364 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8367 case "$installusrbinperl" in
8368 "$undef"|[nN]*) dflt='n';;
8372 rp="Do you want to install perl as /usr/bin/perl?"
8375 [yY]*) val="$define";;
8381 set installusrbinperl
8384 : see if dlopen exists
8386 xxx_ccflags="$ccflags"
8388 : with g++ one needs -shared to get is-in-libc to work for dlopen
8389 case "$gccversion" in
8392 *) case "$d_cplusplus" in
8393 "$define") ccflags="$ccflags -shared" ;;
8400 ccflags="$xxx_ccflags"
8402 : see if this is a unistd.h system
8403 set unistd.h i_unistd
8406 : determine which dynamic loading, if any, to compile in
8408 dldir="ext/DynaLoader"
8421 $define) dflt='y' ;;
8423 : Does a dl_xxx.xs file exist for this operating system
8424 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8427 rp="Do you wish to use dynamic loading?"
8434 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8435 dflt="$dldir/dl_${osname}.xs"
8436 elif $test "$d_dlopen" = "$define" ; then
8437 dflt="$dldir/dl_dlopen.xs"
8442 *) dflt="$dldir/$dlsrc"
8445 echo "The following dynamic loading files are available:"
8446 : Can not go over to $dldir because getfile has path hard-coded in.
8447 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8448 rp="Source file to use for dynamic loading"
8454 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8458 Some systems may require passing special flags to $cc -c to
8459 compile modules that will be used to create a shared library.
8460 To use no flags, say "none".
8463 case "$cccdlflags" in
8464 '') case "$gccversion" in
8465 '') case "$osname" in
8467 irix*) dflt='-KPIC' ;;
8468 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8469 sunos) dflt='-pic' ;;
8473 *) case "$osname" in
8474 darwin) dflt='none' ;;
8475 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8480 *) dflt="$cccdlflags" ;;
8487 # If -Dsysroot was specified, now's the time to add it
8489 if test "X$sysroot" != X; then
8490 case "$gccversion" in
8495 dflt="$dflt --sysroot=$sysroot" ;;
8505 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8508 none) cccdlflags=' ' ;;
8509 *) cccdlflags="$ans" ;;
8514 Some systems use ld to create libraries that can be dynamically loaded,
8515 while other systems (such as those using ELF) use $cc.
8519 : Determine if this is ELF
8521 /* Test for whether ELF binaries are produced */
8533 int i = open("a.out",O_RDONLY);
8536 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8537 exit(0); /* succeed (yes, it is ELF) */
8541 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8547 '') if $test $bin_ELF = "$define"; then
8549 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8553 echo "I'll use ld to build dynamic libraries."
8561 rp="What command should be used to create dynamic libraries?"
8567 Some systems may require passing special flags to $ld to create a
8568 library that can be dynamically loaded. If your ld flags include
8569 -L/other/path options to locate libraries outside your loader's normal
8570 search path, you may need to specify those -L options here as well. To
8571 use no flags, say "none".
8574 case "$lddlflags" in
8575 '') case "$osname" in
8576 haiku) dflt='-shared' ;;
8578 case "$gccversion" in
8579 '') dflt="$dflt +vnocompatwarnings" ;;
8582 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8583 solaris) # See [perl #66604].
8584 # On Solaris 11, gcc -m64 on amd64
8585 # appears not to understand -G. gcc versions at
8586 # least as old as 3.4.3 support -shared, so just
8587 # use that with Solaris 11 and later, but keep
8588 # the old behavior for older Solaris versions.
8589 case "$gccversion" in
8591 *) case "$osvers" in
8592 2.?|2.10) dflt='-G' ;;
8593 *) dflt='-shared' ;;
8598 sunos) dflt='-assert nodefinitions' ;;
8599 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8603 *) dflt="$lddlflags" ;;
8606 : Only do this for gcc, since, for example, qcc has no concept
8608 if $test "X$sysroot" != X; then
8609 case "$gccversion" in
8611 *) dflt="$dflt --sysroot $sysroot" ;;
8615 : Try to guess additional flags to pick up local libraries.
8616 : Be careful not to append to a plain 'none'
8620 for thisflag in $ldflags; do
8625 *) dflt="$dflt $thisflag" ;;
8632 ''|' ') dflt='none' ;;
8636 *-fstack-protector-strong*)
8638 *-fstack-protector-strong*) ;; # Don't add it again
8639 *) dflt="$dflt -fstack-protector-strong" ;;
8642 *-fstack-protector*)
8644 *-fstack-protector*) ;; # Don't add it again
8645 *) dflt="$dflt -fstack-protector" ;;
8650 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8653 none) lddlflags=' ' ;;
8654 *) lddlflags="$ans" ;;
8659 Some systems may require passing special flags to $cc to indicate that
8660 the resulting executable will use dynamic linking. To use no flags,
8664 case "$ccdlflags" in
8665 '') case "$osname" in
8666 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8667 sunos) dflt='none' ;;
8671 *) dflt="$ccdlflags" ;;
8673 rp="Any special flags to pass to $cc to use dynamic linking?"
8676 none) ccdlflags=' ' ;;
8677 *) ccdlflags="$ans" ;;
8689 ld_can_script="$undef"
8690 case "$bin_ELF$usedl" in
8692 # Abuse try.h and a.out names for neat cleanup
8704 if $cc $cccdlflags $ccdlflags $ccflags \
8705 $ldflags $lddlflags -o a.out try.c \
8706 -Wl,--version-script=try.h >/dev/null 2>&1 \
8707 && $test -s a.out ; then
8708 echo "ld supports scripting" >&4
8709 ld_can_script="$define"
8711 echo "ld does not support scripting" >&4
8717 : Do we want a shared libperl?
8721 # No dynamic loading being used, so don't bother even to prompt.
8724 *) case "$useshrplib" in
8725 '') case "$osname" in
8726 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8728 also='Building a shared libperl is required for dynamic loading to work on your system.'
8742 The perl executable is normally obtained by linking perlmain.c with
8743 libperl${_a}, any static extensions (usually just DynaLoader), and
8744 any other libraries needed on this system (such as -lm, etc.). Since
8745 your system supports dynamic loading, it is probably possible to build
8746 a shared libperl.$so. If you will have more than one executable linked
8747 to libperl.$so, this will significantly reduce the size of each
8748 executable, but it may have a noticeable effect on performance. The
8749 default is probably sensible for your system.
8753 rp="Build a shared libperl.$so (y/n)"
8757 useshrplib='true' ;;
8758 *) useshrplib='false' ;;
8763 case "$useshrplib" in
8765 case "$userelocatableinc" in
8767 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8768 echo "See INSTALL for an explanation why that won't work." >&4
8774 # Figure out a good name for libperl.so. Since it gets stored in
8775 # a version-specific architecture-dependent library, the version
8776 # number isn't really that important, except for making cc/ld happy.
8778 # A name such as libperl.so.10.1
8779 majmin="libperl.$so.$patchlevel.$subversion"
8780 # A name such as libperl.so.100
8781 majonly=`echo $patchlevel $subversion |
8782 $awk '{printf "%d%02d", $1, $2}'`
8783 majonly=libperl.$so.$majonly
8784 # I'd prefer to keep the os-specific stuff here to a minimum, and
8785 # rely on figuring it out from the naming of libc.
8786 case "${osname}${osvers}" in
8787 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8790 cygwin*) # ld links now against the dll directly
8791 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8792 majonly=`echo $patchlevel $subversion |
8793 $awk '{printf "%03d%03d", $1, $2}'`
8794 majonly=cygperl5.$majonly.$so
8797 *) # Try to guess based on whether libc has major.minor.
8799 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8800 *libc.$so.[0-9]*) dflt=$majonly ;;
8801 *) dflt=libperl.$so ;;
8811 I need to select a good name for the shared libperl. If your system uses
8812 library names with major and minor numbers, then you might want something
8813 like $majmin. Alternatively, if your system uses a single version
8814 number for shared libraries, then you might want to use $majonly.
8815 Or, your system might be quite happy with a simple libperl.$so.
8817 Since the shared libperl will get installed into a version-specific
8818 architecture-dependent directory, the version number of the shared perl
8819 library probably isn't important, so the default should be o.k.
8822 rp='What name do you want to give to the shared libperl?'
8825 echo "Ok, I'll use $libperl"
8828 libperl="libperl${_a}"
8832 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8836 WARNING: Use of the shrpdir variable for the installation location of
8837 the shared $libperl is not supported. It was never documented and
8838 will not work in this version. Let me (perlbug@perl.org)
8839 know of any problems this may cause.
8845 But your current setting of $shrpdir is
8846 the default anyway, so it's harmless.
8851 Further, your current attempted setting of $shrpdir
8852 conflicts with the value of $archlibexp/CORE
8853 that installperl will use.
8860 # How will the perl executable find the installed shared $libperl?
8861 # Add $xxx to ccdlflags.
8862 # If we can't figure out a command-line option, use $shrpenv to
8863 # set env LD_RUN_PATH. The main perl makefile uses this.
8864 shrpdir=$archlibexp/CORE
8867 if "$useshrplib"; then
8870 # We'll set it in Makefile.SH...
8875 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8876 xxx="-Wl,-R$shrpdir"
8878 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8879 xxx="-Wl,-rpath,$shrpdir"
8882 # hpux doesn't like the default, either.
8883 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8886 # cygwin needs only ldlibpth
8889 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8895 # Only add $xxx if it isn't already in ccdlflags.
8896 case " $ccdlflags " in
8898 *) ccdlflags="$ccdlflags $xxx"
8901 Adding $xxx to the flags
8902 passed to $ld so that the perl executable will find the
8903 installed shared $libperl.
8911 # Fix ccdlflags in AIX for building external extensions.
8912 # (For building Perl itself bare -bE:perl.exp is needed,
8913 # Makefile.SH takes care of this.)
8915 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8917 # Respect a hint or command-line value.
8919 '') shrpenv="$tmp_shrpenv" ;;
8921 case "$ldlibpthname" in
8922 '') ldlibpthname=LD_LIBRARY_PATH ;;
8923 none) ldlibpthname='' ;;
8926 : determine where manual pages are on this system
8930 syspath='/usr/share/man/man1 /usr/man/man1'
8931 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8932 syspath="$syspath /usr/man/u_man/man1"
8933 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8934 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8935 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8936 sysman=`./loc . /usr/man/man1 $syspath`
8939 if $test -d "$sysman"; then
8940 echo "System manual is in $sysman." >&4
8942 echo "Could not find manual pages in source form." >&4
8945 : determine where manual pages go
8946 set man1dir man1dir none
8950 $spackage has manual pages available in source form.
8954 echo "However, you don't have nroff, so they're probably useless to you."
8956 '') man1dir="none";;
8959 echo "If you don't want the manual sources installed, answer 'none'."
8964 lookpath="$prefixexp/share/man/man1"
8965 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8966 lookpath="$lookpath $prefixexp/man/p_man/man1"
8967 lookpath="$lookpath $prefixexp/man/u_man/man1"
8968 lookpath="$lookpath $prefixexp/man/man.1"
8970 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8971 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8981 rp="Where do the main $spackage manual pages (source) go?"
8983 if $test "X$man1direxp" != "X$ansexp"; then
8994 : What suffix to use on installed man pages
9001 rp="What suffix should be used for the main $spackage man pages?"
9003 '') case "$man1dir" in
9017 *) dflt="$man1ext";;
9024 : see if we can have long filenames
9026 first=123456789abcdef
9028 if (echo hi >$first) 2>/dev/null; then
9029 if $test -f 123456789abcde; then
9030 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
9033 echo 'You can have filenames longer than 14 characters.'>&4
9038 You can't have filenames longer than 14 chars.
9039 You can't even think about them!
9045 $rm -rf 123456789abcde*
9047 : determine where library module manual pages go
9048 set man3dir man3dir none
9052 $spackage has manual pages for many of the library modules.
9058 However, you don't have nroff, so they're probably useless to you.
9061 '') man3dir="none";;
9065 case "$d_flexfnam" in
9068 However, your system can't handle the long file names like File::Basename.3.
9071 '') man3dir="none";;
9075 echo "If you don't want the manual sources installed, answer 'none'."
9076 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9078 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9079 if $test -d "$privlib/man/man3"; then
9082 WARNING: Previous versions of perl installed man3 pages into
9083 $privlib/man/man3. This version will suggest a
9084 new default of $dflt.
9088 rp='Do you wish to preserve the old behavior?(y/n)'
9091 y*) dflt="$privlib/man/man3" ;;
9096 *) dflt="$man3dir" ;;
9103 rp="Where do the $package library man pages (source) go?"
9113 : What suffix to use on installed man pages
9119 rp="What suffix should be used for the $package library man pages?"
9121 '') case "$man3dir" in
9135 *) dflt="$man3ext";;
9142 : see if we have to deal with yellow pages, now NIS.
9143 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9149 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9157 rp='Are you getting the hosts file via yellow pages?'
9160 y*) hostcat='ypcat hosts';;
9161 *) hostcat='cat /etc/hosts';;
9167 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9170 '') test -f /etc/group && groupcat='cat /etc/group';;
9173 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9176 : now get the host name
9178 echo "Figuring out host name..." >&4
9179 case "$myhostname" in
9181 echo 'Maybe "hostname" will work...'
9182 if tans=`sh -c hostname 2>&1` ; then
9190 if $test "$cont"; then
9192 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9193 if tans=`cat /etc/systemid 2>&1` ; then
9195 phostname='cat /etc/systemid'
9196 echo "Whadyaknow. Xenix always was a bit strange..."
9199 elif $test -r /etc/systemid; then
9200 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9203 if $test "$cont"; then
9204 echo 'No, maybe "uuname -l" will work...'
9205 if tans=`sh -c 'uuname -l' 2>&1` ; then
9207 phostname='uuname -l'
9209 echo 'Strange. Maybe "uname -n" will work...'
9210 if tans=`sh -c 'uname -n' 2>&1` ; then
9212 phostname='uname -n'
9214 echo 'Oh well, maybe I can mine it out of whoami.h...'
9215 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9216 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9217 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9219 case "$myhostname" in
9220 '') echo "Does this machine have an identity crisis or something?"
9223 echo "Well, you said $myhostname before..."
9224 phostname='echo $myhostname';;
9230 case "$myhostname" in
9231 '') myhostname=noname ;;
9233 : you do not want to know about this
9238 if $test "$myhostname" ; then
9240 rp='Your host name appears to be "'$myhostname'".'" Right?"
9248 : bad guess or no guess
9249 while $test "X$myhostname" = X ; do
9251 rp="Please type the (one word) name of your host:"
9256 : translate upper to lower if necessary
9257 case "$myhostname" in
9259 echo "(Normalizing case in your host name)"
9260 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9264 case "$myhostname" in
9266 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9267 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9268 echo "(Trimming domain name from host name--host name is now $myhostname)"
9270 *) case "$mydomain" in
9273 test "X$hostcat" = "Xypcat hosts" &&
9274 ypmatch "$myhostname" hosts 2>/dev/null |\
9275 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9278 test "X$hostcat" != "X" &&
9279 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9280 /[ ]$myhostname[ . ]/p" > hosts
9283 if $test -f hosts; then
9284 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9285 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9286 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9287 hosts | $sort | $uniq | \
9288 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9289 case `$echo X$dflt` in
9290 X*\ *) echo "(Several hosts in the database matched hostname)"
9293 X.) echo "(You do not have fully-qualified names in the hosts database)"
9297 echo "(I cannot locate a hosts database anywhere)"
9302 tans=`./loc resolv.conf X /etc /usr/etc`
9303 if $test -f "$tans"; then
9304 echo "(Attempting domain name extraction from $tans)"
9305 dflt=.`$sed -n -e 's/ / /g' \
9306 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9309 .) dflt=.`$sed -n -e 's/ / /g' \
9310 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9318 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9319 dflt=.`sh -c domainname 2>/dev/null`
9322 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9326 case "$dflt$osname" in
9327 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9328 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9332 .) echo "(Lost all hope -- silly guess then)"
9338 *) dflt="$mydomain";;
9342 rp="What is your domain name?"
9352 : translate upper to lower if necessary
9355 echo "(Normalizing case in your domain name)"
9356 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9360 : a little sanity check here
9361 case "$phostname" in
9364 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9365 $myhostname$mydomain|$myhostname) ;;
9367 case "$phostname" in
9369 echo "(That doesn't agree with your whoami.h file, by the way.)"
9372 echo "(That doesn't agree with your $phostname command, by the way.)"
9380 : determine the e-mail address of the user who is running us
9383 I need to get your e-mail address in Internet format if possible, i.e.
9384 something like user@host.domain. Please answer accurately since I have
9385 no easy means to double check it. The default value provided below
9386 is most probably close to reality but may not be valid from outside
9387 your organization...
9391 while test "$cont"; do
9392 case "$MAILDOMAIN" in
9394 if $test -s /etc/mailname; then
9395 maildomain=`$cat /etc/mailname`
9397 maildomain="$myhostname$mydomain"
9400 *) maildomain="$MAILDOMAIN";;
9403 '') dflt="$cf_by@$maildomain";;
9404 *) dflt="$cf_email";;
9406 rp='What is your e-mail address?'
9412 rp='Address does not look like an Internet one. Use it anyway?'
9426 : Ask e-mail of administrator
9429 If you or somebody else will be maintaining perl at your site, please
9430 fill in the correct e-mail address here so that they may be contacted
9431 if necessary. Currently, the "perlbug" program included with perl
9432 will send mail to this address in addition to perlbug@perl.org. You may
9433 enter "none" for no administrator.
9436 case "$perladmin" in
9437 '') dflt="$cf_email";;
9438 *) dflt="$perladmin";;
9440 rp='Perl administrator e-mail address'
9444 : determine whether to use a version number suffix for installed binaries
9447 Do you want to use a version number suffix for installed binaries? This
9448 will install 'perl$version' instead of 'perl', and likewise for other
9449 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9450 to be installed side-by-side. Unless you are a developer, you probably
9451 do *not* want to do this.
9453 case "$versiononly" in
9454 "$define"|[Yy]*|true) dflt='y' ;;
9457 rp="Do you want to use a version number suffix for installed binaries?"
9460 [yY]*) val="$define";;
9466 case "$versiononly" in
9467 "$define") inc_version_list=''
9468 inc_version_list_init=0
9472 : figure out how to guarantee perl startup
9473 : XXX Note that this currently takes advantage of the bug that binexp ignores
9474 : the Configure -Dinstallprefix setting, which in turn means that under
9475 : relocatable @INC, initialinstalllocation is what binexp started as.
9476 case "$startperl" in
9478 case "$sharpbang" in
9482 I can use the #! construct to start perl on your system. This will
9483 make startup of perl scripts faster, but may cause problems if you
9484 want to share those scripts and perl is not in a standard place
9485 ($initialinstalllocation/perl) on all your platforms. The alternative
9486 is to force a shell by starting the script with a single ':' character.
9489 case "$versiononly" in
9490 "$define") dflt="$initialinstalllocation/perl$version";;
9491 *) dflt="$initialinstalllocation/perl";;
9493 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9496 none) startperl=": # use perl";;
9497 *) startperl="#!$ans"
9498 if $test 30 -lt `echo "$ans" | wc -c`; then
9501 WARNING: Some systems limit the #! command to 32 characters.
9502 If you experience difficulty running Perl scripts with #!, try
9503 installing Perl in a directory with a shorter pathname.
9509 *) startperl=": # use perl"
9514 echo "I'll use $startperl to start perl scripts."
9516 : figure best path for perl in scripts
9519 case "$versiononly" in
9520 "$define") perlpath="$initialinstalllocation/perl$version";;
9521 *) perlpath="$initialinstalllocation/perl";;
9523 case "$startperl" in
9528 I will use the "eval 'exec'" idiom to start Perl on your system.
9529 I can use the full path of your Perl binary for this purpose, but
9530 doing so may cause problems if you want to share those scripts and
9531 Perl is not always in a standard place ($initialinstalllocation/perl).
9534 dflt="$initialinstalllocation/perl"
9535 rp="What path shall I use in \"eval 'exec'\"?"
9542 case "$startperl" in
9544 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9547 : determine where public executable scripts go
9548 set scriptdir scriptdir
9550 case "$scriptdir" in
9553 : guess some guesses
9554 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9555 $test -d /usr/share/bin && dflt=/usr/share/bin
9556 $test -d /usr/local/script && dflt=/usr/local/script
9557 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9558 $test -d $prefixexp/script && dflt=$prefixexp/script
9562 *) dflt="$scriptdir"
9567 Some installations have a separate directory just for executable scripts so
9568 that they can mount it across multiple architectures but keep the scripts in
9569 one spot. You might, for example, have a subdirectory of /usr/share for this.
9570 Or you might just lump your scripts in with all your other executables.
9574 rp='Where do you keep publicly executable scripts?'
9576 if $test "X$ansexp" != "X$scriptdirexp"; then
9582 : A little fix up for an irregularly named variable.
9583 installscript="$installscriptdir"
9585 : determine where add-on public executables go
9587 '') dflt=$siteprefix/bin ;;
9591 rp='Pathname where the add-on public executables should be installed?'
9596 : determine where add-on html pages go
9597 : There is no standard location, so try to copy the previously-selected
9598 : directory structure for the core html pages.
9599 case "$sitehtml1dir" in
9600 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9601 *) dflt=$sitehtml1dir ;;
9604 ''|' ') dflt=none ;;
9607 rp='Pathname where the site-specific html pages should be installed?'
9609 prefixvar=sitehtml1dir
9612 : determine where add-on library html pages go
9613 : There is no standard location, so try to copy the previously-selected
9614 : directory structure for the core html pages.
9615 case "$sitehtml3dir" in
9616 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9617 *) dflt=$sitehtml3dir ;;
9620 ''|' ') dflt=none ;;
9623 rp='Pathname where the site-specific library html pages should be installed?'
9625 prefixvar=sitehtml3dir
9628 : determine where add-on manual pages go
9629 case "$siteman1dir" in
9630 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9631 *) dflt=$siteman1dir ;;
9634 ''|' ') dflt=none ;;
9637 rp='Pathname where the site-specific manual pages should be installed?'
9639 prefixvar=siteman1dir
9642 : determine where add-on library man pages go
9643 case "$siteman3dir" in
9644 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9645 *) dflt=$siteman3dir ;;
9648 ''|' ') dflt=none ;;
9651 rp='Pathname where the site-specific library manual pages should be installed?'
9653 prefixvar=siteman3dir
9656 : determine where add-on public executable scripts go
9657 case "$sitescript" in
9658 '') dflt=$siteprefix/script
9659 $test -d $dflt || dflt=$sitebin ;;
9660 *) dflt="$sitescript" ;;
9663 rp='Pathname where add-on public executable scripts should be installed?'
9665 prefixvar=sitescript
9668 : see if backtrace exists
9669 set backtrace d_backtrace
9672 : add flags if using c backtrace
9673 case "$usecbacktrace" in
9674 "") usecbacktrace=$undef ;;
9676 case "$d_backtrace" in
9678 case " $ccflags " in
9679 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9680 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9684 echo "This system does not support backtrace" >&4
9685 usecbacktrace=$undef
9691 : Check if faststdio is requested and available
9692 case "$usefaststdio" in
9693 $define|true|[yY]*|'')
9694 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9704 Perl can be built to use 'fast stdio', which means using the stdio
9705 library but also directly manipulating the stdio buffers to enable
9706 faster I/O. Using stdio is better for backward compatibility (especially
9707 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9708 interface has been preferred instead of stdio.
9710 If this doesn't make any sense to you, just accept the default '$dflt'.
9712 rp='Use the "fast stdio" if available?'
9715 y|Y) val="$define" ;;
9722 : define an is-a-typedef? function
9723 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9725 "") inclist="sys/types.h";;
9727 eval "varval=\$$var";
9731 for inc in $inclist; do
9732 echo "#include <$inc>" >>temp.c;
9734 echo "#ifdef $type" >> temp.c;
9735 echo "printf(\"We have $type\");" >> temp.c;
9736 echo "#endif" >> temp.c;
9737 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9738 if $contains $type temp.E >/dev/null 2>&1; then
9744 *) eval "$var=\$varval";;
9747 : define an is-a-typedef? function that prompts if the type is not available.
9748 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9750 "") inclist="sys/types.h";;
9752 eval "varval=\$$var";
9756 for inc in $inclist; do
9757 echo "#include <$inc>" >>temp.c;
9759 echo "#ifdef $type" >> temp.c;
9760 echo "printf(\"We have $type\");" >> temp.c;
9761 echo "#endif" >> temp.c;
9762 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9764 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9765 if $contains $type temp.E >/dev/null 2>&1; then
9766 echo "$type found." >&4;
9769 echo "$type NOT found." >&4;
9775 *) eval "$var=\$varval";;
9778 : see what type lseek is declared as in the kernel
9779 rp="What is the type used for lseek's offset on this system?"
9780 set off_t lseektype long stdio.h sys/types.h
9784 echo "Checking to see how big your file offsets are..." >&4
9786 #include <sys/types.h>
9790 printf("%d\n", (int)sizeof($lseektype));
9795 if eval $compile_ok; then
9796 lseeksize=`$run ./try`
9797 echo "Your file offsets are $lseeksize bytes long."
9801 echo "(I can't seem to compile the test program. Guessing...)"
9802 rp="What is the size of your file offsets (in bytes)?"
9808 : see what type file positions are declared as in the library
9809 rp="What is the type for file position used by fsetpos()?"
9810 set fpos_t fpostype long stdio.h sys/types.h
9813 : Check size for Fpos_t
9816 *_t) zzz="$fpostype" ;;
9819 echo "Checking the size of $zzz..." >&4
9821 #include <sys/types.h>
9828 printf("%d\n", (int)sizeof($fpostype));
9833 if eval $compile_ok; then
9837 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9840 echo "Your $zzz is $fpossize bytes long."
9846 echo "(I can't compile the test program. Guessing...)" >&4
9847 rp="What is the size of your file positions (in bytes)?"
9852 : Check for large file support
9853 # Backward compatibility (uselfs is deprecated).
9855 "$define"|true|[yY]*)
9858 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9860 uselargefiles="$define"
9864 case "$lseeksize:$fpossize" in
9867 You can have files larger than 2 gigabytes.
9870 *) case "$uselargefiles" in
9871 "$undef"|false|[nN]*) dflt='n' ;;
9876 Perl can be built to understand large files (files larger than 2 gigabytes)
9877 on some systems. To do so, Configure can be run with -Duselargefiles.
9879 If this doesn't make any sense to you, just accept the default '$dflt'.
9881 rp='Try to understand large files, if available?'
9884 y|Y) val="$define" ;;
9891 : Look for a hint-file generated 'call-back-unit'. If the
9892 : user has specified that a large files perl is to be built,
9893 : we may need to set or change some other defaults.
9894 if $test -f uselargefiles.cbu; then
9895 echo "Your platform has some specific hints regarding large file builds, using them..."
9896 . ./uselargefiles.cbu
9898 case "$uselargefiles" in
9900 if $test -f uselargefiles.cbu; then
9902 echo "Rechecking to see how big your file offsets are..." >&4
9904 #include <sys/types.h>
9908 printf("%d\n", (int)sizeof($lseektype));
9913 if eval $compile_ok; then
9914 lseeksize=`$run ./try`
9915 $echo "Your file offsets are now $lseeksize bytes long."
9919 echo "(I can't seem to compile the test program. Guessing...)"
9920 rp="What is the size of your file offsets (in bytes)?"
9925 *_t) zzz="$fpostype" ;;
9928 $echo $n "Rechecking the size of $zzz...$c" >&4
9930 #include <sys/types.h>
9937 printf("%d\n", (int)sizeof($fpostype));
9942 if eval $compile_ok; then
9947 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9950 echo " $fpossize bytes." >&4
9956 echo "(I can't compile the test program. Guessing...)" >&4
9957 rp="What is the size of your file positions (in bytes)?"
9966 : Check if we want perlio
9969 : Set the vendorbin variables
9970 case "$vendorprefix" in
9971 '') d_vendorbin="$undef"
9975 *) d_vendorbin="$define"
9976 : determine where vendor-supplied executables go.
9977 case "$vendorbin" in
9978 '') dflt=$vendorprefix/bin ;;
9979 *) dflt="$vendorbin" ;;
9982 rp='Pathname for the vendor-supplied executables directory?'
9985 vendorbinexp="$ansexp"
9991 : Set the vendorhtml1dir variables
9992 case "$vendorprefix" in
9993 '') vendorhtml1dir=''
9994 vendorhtml1direxp=''
9996 *) : determine where vendor-supplied html pages go.
9997 : There is no standard location, so try to copy the previously-selected
9998 : directory structure for the core html pages.
9999 : XXX Better default suggestions would be welcome.
10000 case "$vendorhtml1dir" in
10001 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10002 *) dflt=$vendorhtml1dir ;;
10005 ''|' ') dflt=none ;;
10008 rp='Pathname for the vendor-supplied html pages?'
10010 vendorhtml1dir="$ans"
10011 vendorhtml1direxp="$ansexp"
10014 : Use ' ' for none so value is preserved next time through Configure
10015 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
10016 prefixvar=vendorhtml1dir
10019 : Set the vendorhtml3dir variables
10020 case "$vendorprefix" in
10021 '') vendorhtml3dir=''
10022 vendorhtml3direxp=''
10024 *) : determine where vendor-supplied module html pages go.
10025 : There is no standard location, so try to copy the previously-selected
10026 : directory structure for the core html pages.
10027 : XXX Better default suggestions would be welcome.
10028 case "$vendorhtml3dir" in
10029 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10030 *) dflt=$vendorhtml3dir ;;
10033 ''|' ') dflt=none ;;
10036 rp='Pathname for the vendor-supplied html pages?'
10038 vendorhtml3dir="$ans"
10039 vendorhtml3direxp="$ansexp"
10042 : Use ' ' for none so value is preserved next time through Configure
10043 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10044 prefixvar=vendorhtml3dir
10047 : Set the vendorman1dir variables
10048 case "$vendorprefix" in
10049 '') vendorman1dir=''
10050 vendorman1direxp=''
10052 *) : determine where vendor-supplied manual pages go.
10053 case "$vendorman1dir" in
10054 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10055 *) dflt=$vendorman1dir ;;
10058 ''|' ') dflt=none ;;
10061 rp='Pathname for the vendor-supplied manual section 1 pages?'
10063 vendorman1dir="$ans"
10064 vendorman1direxp="$ansexp"
10067 : Use ' ' for none so value is preserved next time through Configure
10068 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10069 prefixvar=vendorman1dir
10072 : Set the vendorman3dir variables
10073 case "$vendorprefix" in
10074 '') vendorman3dir=''
10075 vendorman3direxp=''
10077 *) : determine where vendor-supplied module manual pages go.
10078 case "$vendorman3dir" in
10079 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10080 *) dflt=$vendorman3dir ;;
10083 ''|' ') dflt=none ;;
10086 rp='Pathname for the vendor-supplied manual section 3 pages?'
10088 vendorman3dir="$ans"
10089 vendorman3direxp="$ansexp"
10092 : Use ' ' for none so value is preserved next time through Configure
10093 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10094 prefixvar=vendorman3dir
10097 : Set the vendorscript variables
10098 case "$vendorprefix" in
10099 '') d_vendorscript="$undef"
10103 *) d_vendorscript="$define"
10104 : determine where vendor-supplied scripts go.
10105 case "$vendorscript" in
10106 '') dflt=$vendorprefix/script
10107 $test -d $dflt || dflt=$vendorbin ;;
10108 *) dflt="$vendorscript" ;;
10112 The installation process will create a directory for
10113 vendor-supplied scripts.
10117 rp='Pathname for the vendor-supplied scripts directory?'
10119 vendorscript="$ans"
10120 vendorscriptexp="$ansexp"
10123 prefixvar=vendorscript
10126 : script used to emit important warnings
10129 if test \$# -gt 0; then
10134 echo "*** WARNING:" >&4
10135 sed -e 's/^/*** /' <msg >&4
10137 cat msg >>config.msg
10138 echo " " >>config.msg
10144 : see which of string.h or strings.h is needed
10146 strings=`./findhdr string.h`
10147 if $test "$strings" && $test -r "$strings"; then
10148 echo "Using <string.h> instead of <strings.h>." >&4
10152 strings=`./findhdr strings.h`
10153 if $test "$strings" && $test -r "$strings"; then
10154 echo "Using <strings.h> instead of <string.h>." >&4
10156 ./warn "No string header found -- You'll surely have problems."
10161 case "$i_string" in
10162 "$undef") strings=`./findhdr strings.h`;;
10163 *) strings=`./findhdr string.h`;;
10166 : see if qgcvt exists
10170 : Check what kind of doubles your system has
10171 $echo "Checking the kind of doubles you have..." >&4
10173 #$i_stdlib I_STDLIB
10174 #define DOUBLESIZE $doublesize
10176 #include <stdlib.h>
10179 static const double d = -0.1;
10181 unsigned const char* b = (unsigned const char*)(&d);
10182 #if DOUBLESIZE == 4
10183 if (b[0] == 0xCD && b[3] == 0xBD) {
10184 /* IEEE 754 32-bit little-endian */
10188 if (b[0] == 0xBD && b[3] == 0xCD) {
10189 /* IEEE 754 32-bit big-endian */
10193 if (b[0] == 0xCC && b[3] == 0xCC) {
10194 /* VAX format F, 32-bit PDP-style mixed endian. */
10198 if (b[0] == 0xC0 && b[3] == 0x9A) {
10199 /* IBM single 32-bit */
10204 #if DOUBLESIZE == 8
10205 if (b[0] == 0x9A && b[7] == 0xBF) {
10206 /* IEEE 754 64-bit little-endian */
10210 if (b[0] == 0xBF && b[7] == 0x9A) {
10211 /* IEEE 754 64-bit big-endian */
10215 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10216 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10217 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10218 * 99 99 b9 bf 9a 99 99 99 */
10222 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10223 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10224 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10225 * 99 99 99 9a bf b9 99 99 */
10229 if (b[0] == 0xCC && b[7] == 0xCC) {
10230 /* VAX format D, 64-bit PDP-style mixed endian. */
10234 if (b[0] == 0xD9 && b[7] == 0x99) {
10235 /* VAX format G, 64-bit PDP-style mixed endian. */
10239 if (b[0] == 0xC0 && b[7] == 0x9A) {
10240 /* IBM double 64-bit */
10244 if (b[0] == 0xBF && b[7] == 0xCD) {
10245 /* CRAY single 64-bit */
10250 #if DOUBLESIZE == 16
10251 if (b[0] == 0x9A && b[15] == 0xBF) {
10252 /* IEEE 754 128-bit little-endian */
10256 if (b[0] == 0xBF && b[15] == 0x9A) {
10257 /* IEEE 754 128-bit big-endian */
10262 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10263 * Whether those environments can still build Perl is debatable. */
10264 printf("-1\n"); /* unknown */
10269 if eval $compile; then
10270 doublekind=`$run ./try`
10274 case "$doublekind" in
10275 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10276 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10277 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10278 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10279 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10280 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10281 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10282 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10283 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10284 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10285 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10286 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10287 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10288 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10289 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10291 d_double_style_ieee=$undef
10292 d_double_style_vax=$undef
10293 d_double_style_ibm=$undef
10294 d_double_style_cray=$undef
10295 case "$doublekind" in
10296 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10297 9|10|11) d_double_style_vax=$define ;;
10298 12|13) d_double_style_ibm=$define ;;
10299 14) d_double_style_cray=$define ;;
10301 case "$d_double_style_ieee" in
10303 d_double_has_inf=$define
10304 d_double_has_nan=$define
10305 d_double_has_negative_zero=$define
10306 d_double_has_subnormals=$define
10309 d_double_has_inf=$undef
10310 d_double_has_nan=$undef
10311 d_double_has_negative_zero=$undef
10312 d_double_has_subnormals=$undef
10317 : Check print/scan long double stuff
10320 if $test X"$d_longdbl" = X"$define"; then
10322 echo "Checking how to print long doubles..." >&4
10324 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10325 $cat >try.c <<'EOCP'
10326 #include <sys/types.h>
10329 double d = 123.456;
10330 printf("%.3f\n", d);
10334 if eval $compile; then
10338 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10339 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10340 echo "We will use %f."
10346 if $test X"$sPRIfldbl" = X; then
10347 $cat >try.c <<'EOCP'
10348 #include <sys/types.h>
10351 long double d = 123.456;
10352 printf("%.3Lf\n", d);
10356 if eval $compile; then
10360 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10361 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10362 echo "We will use %Lf."
10368 if $test X"$sPRIfldbl" = X; then
10369 $cat >try.c <<'EOCP'
10370 #include <sys/types.h>
10373 long double d = 123.456;
10374 printf("%.3llf\n", d);
10378 if eval $compile; then
10382 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10383 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10384 echo "We will use %llf."
10390 if $test X"$sPRIfldbl" = X; then
10391 $cat >try.c <<'EOCP'
10392 #include <sys/types.h>
10395 long double d = 123.456;
10396 printf("%.3lf\n", d);
10400 if eval $compile; then
10404 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10405 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10406 echo "We will use %lf."
10412 if $test X"$sPRIfldbl" = X; then
10413 echo "Cannot figure out how to print long doubles." >&4
10415 sSCNfldbl=$sPRIfldbl # expect consistency
10422 case "$sPRIfldbl" in
10423 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10424 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10425 d_SCNfldbl="$undef";
10427 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10428 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10429 d_SCNfldbl="$define";
10433 : Before committing on uselongdouble, see whether that looks sane.
10434 if $test "$uselongdouble" = "$define"; then
10437 echo "Checking if your long double math functions work right..." >&4
10442 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10445 case "$osname:$gccversion" in
10446 aix:) saveccflags="$ccflags"
10447 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10450 if eval $compile_ok; then
10454 3) echo "Your long double math functions are working correctly." >&4 ;;
10455 *) echo "Your long double math functions are broken, not using long doubles." >&4
10456 uselongdouble=$undef
10460 case "$osname:$gccversion" in
10461 aix:) ccflags="$saveccflags" ;; # restore
10465 : Check how to convert floats to strings.
10467 if test "X$d_Gconvert" = X; then
10470 echo "Checking for an efficient way to convert floats to strings."
10472 case "$uselongdouble" in
10473 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10475 case "$d_longdbl" in
10476 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10478 case "$d_PRIgldbl" in
10479 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10482 #ifdef TRY_gconvert
10483 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10484 char *myname = "gconvert";
10487 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10488 char *myname = "gcvt";
10491 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10492 char *myname = "qgcvt";
10493 #define DOUBLETYPE long double
10496 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10497 #ifdef HAS_PRIgldbl
10498 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10500 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10503 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10505 char *myname = "sprintf";
10509 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10510 #define DOUBLETYPE long double
10512 #define DOUBLETYPE double
10518 #$i_stdlib I_STDLIB
10520 #include <stdlib.h>
10522 #$i_string I_STRING
10524 # include <string.h>
10526 # include <strings.h>
10529 int checkit(char *expect, char *got)
10531 if (strcmp(expect, got)) {
10532 printf("%s oddity: Expected %s, got %s\n",
10533 myname, expect, got);
10543 /* This must be 1st test on (which?) platform */
10544 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10545 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10546 checkit("0.1", buf);
10548 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10549 checkit("0.01", buf);
10551 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10552 checkit("0.001", buf);
10554 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10555 checkit("0.0001", buf);
10557 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10558 if (strlen(buf) > 5)
10559 checkit("9e-005", buf); /* for Microsoft ?? */
10561 checkit("9e-05", buf);
10563 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10566 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10567 checkit("1.1", buf);
10569 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10570 checkit("1.01", buf);
10572 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10573 checkit("1.001", buf);
10575 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10576 checkit("1.0001", buf);
10578 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10579 checkit("1.00001", buf);
10581 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10582 checkit("1.000001", buf);
10584 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10587 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10588 checkit("-1", buf);
10590 /* Some Linux gcvt's give 1.e+5 here. */
10591 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10592 checkit("100000", buf);
10594 /* Some Linux gcvt's give -1.e+5 here. */
10595 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10596 checkit("-100000", buf);
10598 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10599 checkit("123.456", buf);
10601 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10602 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10603 /* 34 should be enough to scare even long double
10604 * places into using the e notation. */
10605 if (strlen(buf) > 5)
10606 checkit("1e+034", buf); /* for Microsoft */
10608 checkit("1e+34", buf);
10610 /* For Perl, if you add additional tests here, also add them to
10611 * t/base/num.t for benefit of platforms not using Configure or
10612 * overriding d_Gconvert */
10617 : first add preferred functions to our list
10619 for xxx_convert in $gconvert_preference; do
10620 case $xxx_convert in
10621 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10622 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10625 : then add any others
10626 for xxx_convert in gconvert gcvt sprintf; do
10627 case "$xxx_list" in
10629 *) xxx_list="$xxx_list $xxx_convert" ;;
10633 case "$d_longdbl$uselongdouble" in
10635 : again, add preferred functions to our list first
10637 for xxx_convert in $gconvert_ld_preference; do
10638 case $xxx_convert in
10639 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10640 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10643 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10644 for xxx_convert in qgcvt sprintf $xxx_list; do
10645 case "$xxx_ld_list" in
10646 $xxx_convert*|*" $xxx_convert"*) ;;
10647 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10650 : if sprintf cannot do long doubles, move it to the end
10651 if test "$d_PRIgldbl" != "$define"; then
10652 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10654 : if no qgcvt, remove it
10655 if test "$d_qgcvt" != "$define"; then
10656 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10659 xxx_list="$xxx_ld_list"
10663 for xxx_convert in $xxx_list; do
10664 echo "Trying $xxx_convert..."
10665 $rm -f try try$_o core
10666 set try -DTRY_$xxx_convert
10667 if eval $compile; then
10668 echo "$xxx_convert() found." >&4
10669 if $run ./try; then
10670 echo "I'll use $xxx_convert to convert floats into a string." >&4
10673 echo "...But $xxx_convert didn't work as I expected."
10677 echo "$xxx_convert NOT found." >&4
10681 if test X$xxx_convert = X; then
10682 echo "*** WHOA THERE!!! ***" >&4
10683 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10684 xxx_convert=sprintf
10687 case "$xxx_convert" in
10688 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10689 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10690 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10691 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10692 "$define$define$define")
10693 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10694 "$define$define$undef")
10695 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10696 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10704 : see if _fwalk exists
10708 : Initialize h_fcntl
10711 : Initialize h_sysfile
10714 : access call always available on UNIX
10715 set access d_access
10718 : locate the flags for 'access()'
10719 case "$d_access" in
10722 $cat >access.c <<EOCP
10723 #include <sys/types.h>
10728 #include <sys/file.h>
10731 #include <unistd.h>
10733 #$i_stdlib I_STDLIB
10735 #include <stdlib.h>
10741 : check sys/file.h first, no particular reason here
10742 if $test `./findhdr sys/file.h` && \
10743 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10745 echo "<sys/file.h> defines the *_OK access constants." >&4
10746 elif $test `./findhdr fcntl.h` && \
10747 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10749 echo "<fcntl.h> defines the *_OK access constants." >&4
10750 elif $test `./findhdr unistd.h` && \
10751 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10752 echo "<unistd.h> defines the *_OK access constants." >&4
10754 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10760 : see if accessx exists
10761 set accessx d_accessx
10764 : see if acosh exists
10768 : see if aintl exists
10772 : see if alarm exists
10776 : see if 64bit time functions exists
10778 set ctime64 d_ctime64
10781 set localtime64 d_localtime64
10784 set gmtime64 d_gmtime64
10787 set mktime64 d_mktime64
10790 set difftime64 d_difftime64
10793 set asctime64 d_asctime64
10796 : see if POSIX threads are available
10797 set pthread.h i_pthread
10800 : define a function to check prototypes
10801 $cat > protochk <<EOSH
10804 optimize="$optimize"
10806 prototype="$prototype"
10809 usethreads=$usethreads
10810 i_pthread=$i_pthread
10811 pthread_h_first=$pthread_h_first
10814 $cat >> protochk <<'EOSH'
10819 while test $# -ge 2; do
10821 $define) echo "#include <$2>" >> try.c ;;
10822 literal) echo "$2" >> try.c ;;
10824 # Extra magic for the benefit of systems that need pthread.h
10825 # to be included early to correctly detect threadsafe functions.
10826 # Such functions must guarantee themselves, though, that the usethreads
10827 # and i_pthread have been defined, before calling protochk.
10828 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10829 echo "#include <pthread.h>" >> try.c
10834 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10835 cat >> try.c <<'EOCP'
10836 #ifdef CAN_PROTOTYPE
10837 #define _(args) args
10842 echo "$foo" >> try.c
10843 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10844 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10850 $eunicefix protochk
10852 : Define hasproto macro for Configure internal use
10853 hasproto='varname=$1; func=$2; shift; shift;
10854 while $test $# -ge 2; do
10856 $define) echo "#include <$2>";;
10860 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10861 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10862 echo "$func() prototype found.";
10865 echo "$func() prototype NOT found.";
10872 : see if sys/types.h has to be included
10873 set sys/types.h i_systypes
10876 : see if sys/select.h has to be included
10877 set sys/select.h i_sysselct
10880 : Define hasfield macro for Configure internal use
10881 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10882 while $test $# -ge 2; do
10884 $define) echo "#include <$2>";;
10888 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10890 if eval $compile; then
10899 : see if we should include time.h, sys/time.h, or both
10901 if test "X$timeincl" = X; then
10902 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10903 $echo $n "I'm now running the test program...$c"
10905 #include <sys/types.h>
10910 #ifdef SYSTIMEKERNEL
10913 #include <sys/time.h>
10916 #include <sys/select.h>
10918 #$i_stdlib I_STDLIB
10920 #include <stdlib.h>
10926 struct timeval bar;
10929 struct timezone tzp;
10931 if (foo.tm_sec == foo.tm_sec)
10934 if (bar.tv_sec == bar.tv_sec)
10941 for s_timezone in '-DS_TIMEZONE' ''; do
10943 for s_timeval in '-DS_TIMEVAL' ''; do
10944 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10945 for i_time in '' '-DI_TIME'; do
10946 for i_systime in '-DI_SYSTIME' ''; do
10949 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10950 if eval $compile; then
10951 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10955 $echo $n "Succeeded with $flags$c"
10967 *SYSTIMEKERNEL*) i_systimek="$define"
10968 timeincl=`./findhdr sys/time.h`
10969 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10970 *) i_systimek="$undef";;
10973 *I_TIME*) i_time="$define"
10974 timeincl=`./findhdr time.h`" $timeincl"
10975 echo "We'll include <time.h>." >&4;;
10976 *) i_time="$undef";;
10979 *I_SYSTIME*) i_systime="$define"
10980 timeincl=`./findhdr sys/time.h`" $timeincl"
10981 echo "We'll include <sys/time.h>." >&4;;
10982 *) i_systime="$undef";;
10986 : see if struct tm knows about tm_zone
10987 case "$i_systime$i_time" in
10990 echo "Checking to see if your struct tm has tm_zone field..." >&4
10991 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10999 case "$d_tm_tm_zone" in
11000 "$define") echo "Yes, it does." ;;
11001 *) echo "No, it doesn't." ;;
11003 : see if struct tm knows about tm_gmtoff
11004 case "$i_systime$i_time" in
11007 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
11008 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
11016 case "$d_tm_tm_gmtoff" in
11017 "$define") echo "Yes, it does." ;;
11018 *) echo "No, it doesn't." ;;
11021 : see if asctime_r exists
11022 set asctime_r d_asctime_r
11024 case "$d_asctime_r" in
11026 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11027 case "$d_asctime_r_proto:$usethreads" in
11028 ":define") d_asctime_r_proto=define
11029 set d_asctime_r_proto asctime_r $hdrs
11033 case "$d_asctime_r_proto" in
11035 case "$asctime_r_proto" in
11036 ''|0) try='char* asctime_r(const struct tm*, char*);'
11037 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
11039 case "$asctime_r_proto" in
11040 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
11041 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
11043 case "$asctime_r_proto" in
11044 ''|0) try='int asctime_r(const struct tm*, char*);'
11045 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
11047 case "$asctime_r_proto" in
11048 ''|0) try='int asctime_r(const struct tm*, char*, int);'
11049 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
11051 case "$asctime_r_proto" in
11052 ''|0) d_asctime_r=undef
11054 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
11055 * ) case "$asctime_r_proto" in
11056 REENTRANT_PROTO*) ;;
11057 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
11059 echo "Prototype: $try" ;;
11062 *) case "$usethreads" in
11063 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11070 *) asctime_r_proto=0
11074 : see if asinh exists
11078 : see if atanh exists
11082 : see if atolf exists
11086 : see if atoll exists
11090 : Look for GCC-style attribute format
11091 case "$d_attribute_format" in
11094 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11095 $cat >attrib.c <<'EOCP'
11097 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11099 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11100 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11101 echo "Your C compiler doesn't support __attribute__((format))."
11104 echo "Your C compiler supports __attribute__((format))."
11108 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11112 *) val="$d_attribute_format" ;;
11114 set d_attribute_format
11118 : Look for GCC-style attribute format with null format allowed
11119 case "$d_printf_format_null" in
11120 '') case "$d_attribute_format" in
11123 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11124 $cat >attrib.c <<EOCP
11126 #$i_stdlib I_STDLIB
11128 #include <stdlib.h>
11130 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11131 int null_printf (char* pat,...) { return (int)pat; }
11132 int main () { exit(null_printf(NULL)); }
11134 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11135 : run the executable in case it produces a run-time warning
11136 if $run ./attrib >>attrib.out 2>&1; then
11137 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11138 echo "Your C compiler doesn't allow __printf__ format to be null."
11141 echo "Your C compiler allows __printf__ format to be null."
11145 echo "Your C compiler executable failed with __printf__ format null."
11149 echo "Your C compiler fails with __printf__ format null."
11156 *) val="$d_printf_format_null" ;;
11158 set d_printf_format_null
11162 : Look for GCC-style attribute malloc
11163 case "$d_attribute_malloc" in
11166 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11167 $cat >attrib.c <<'EOCP'
11169 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
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__((malloc))."
11176 echo "Your C compiler supports __attribute__((malloc))."
11180 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11184 *) val="$d_attribute_malloc" ;;
11186 set d_attribute_malloc
11190 : Look for GCC-style attribute nonnull
11191 case "$d_attribute_nonnull" in
11194 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11195 $cat >attrib.c <<'EOCP'
11197 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
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__((nonnull))."
11204 echo "Your C compiler supports __attribute__((nonnull))."
11208 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11212 *) val="$d_attribute_nonnull" ;;
11214 set d_attribute_nonnull
11218 : Look for GCC-style attribute noreturn
11219 case "$d_attribute_noreturn" in
11222 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11223 $cat >attrib.c <<'EOCP'
11225 void fall_over_dead( void ) __attribute__((noreturn));
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__((noreturn))."
11232 echo "Your C compiler supports __attribute__((noreturn))."
11236 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11240 *) val="$d_attribute_noreturn" ;;
11242 set d_attribute_noreturn
11246 : Look for GCC-style attribute pure
11247 case "$d_attribute_pure" in
11250 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11251 $cat >attrib.c <<'EOCP'
11253 int square( int n ) __attribute__((pure));
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__((pure))."
11260 echo "Your C compiler supports __attribute__((pure))."
11264 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11268 *) val="$d_attribute_pure" ;;
11270 set d_attribute_pure
11274 : Look for GCC-style attribute unused
11275 case "$d_attribute_unused" in
11278 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11279 $cat >attrib.c <<'EOCP'
11281 int do_something( int dummy __attribute__((unused)), int n );
11283 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11284 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11285 echo "Your C compiler doesn't support __attribute__((unused))."
11288 echo "Your C compiler supports __attribute__((unused))."
11292 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11296 *) val="$d_attribute_unused" ;;
11298 set d_attribute_unused
11302 : Look for GCC-style attribute deprecated
11303 case "$d_attribute_deprecated" in
11306 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11307 $cat >attrib.c <<'EOCP'
11309 int I_am_deprecated(void) __attribute__((deprecated));
11311 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11312 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11313 echo "Your C compiler doesn't support __attribute__((deprecated))."
11316 echo "Your C compiler supports __attribute__((deprecated))."
11320 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11324 *) val="$d_attribute_deprecated" ;;
11326 set d_attribute_deprecated
11330 : Look for GCC-style attribute warn_unused_result
11331 case "$d_attribute_warn_unused_result" in
11334 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11335 $cat >attrib.c <<'EOCP'
11337 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11339 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11340 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11341 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11344 echo "Your C compiler supports __attribute__((warn_unused_result))."
11348 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11352 *) val="$d_attribute_warn_unused_result" ;;
11354 set d_attribute_warn_unused_result
11358 : see if bcmp exists
11362 : see if bcopy exists
11366 : see if getpgrp exists
11367 set getpgrp d_getpgrp
11370 case "$d_getpgrp" in
11373 echo "Checking to see which flavor of getpgrp is in use..."
11375 #$i_unistd I_UNISTD
11376 #include <sys/types.h>
11378 # include <unistd.h>
11380 #$i_stdlib I_STDLIB
11382 #include <stdlib.h>
11386 if (getuid() == 0) {
11387 printf("(I see you are running Configure as super-user...)\n");
11390 #ifdef TRY_BSD_PGRP
11391 if (getpgrp(1) == 0)
11400 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11401 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11403 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11404 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11407 echo "I can't seem to compile and run the test program."
11409 xxx="a USG one, i.e. you use getpgrp()."
11411 # SVR4 systems can appear rather BSD-ish.
11412 case "$i_unistd" in
11414 xxx="a BSD one, i.e. you use getpgrp(pid)."
11418 xxx="probably a USG one, i.e. you use getpgrp()."
11423 echo "Assuming your getpgrp is $xxx" >&4
11432 : see if setpgrp exists
11433 set setpgrp d_setpgrp
11436 case "$d_setpgrp" in
11439 echo "Checking to see which flavor of setpgrp is in use..."
11441 #$i_unistd I_UNISTD
11442 #include <sys/types.h>
11444 # include <unistd.h>
11446 #$i_stdlib I_STDLIB
11448 #include <stdlib.h>
11452 if (getuid() == 0) {
11453 printf("(I see you are running Configure as super-user...)\n");
11456 #ifdef TRY_BSD_PGRP
11457 if (-1 == setpgrp(1, 1))
11460 if (setpgrp() != -1)
11466 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11467 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11469 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11470 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11473 echo "(I can't seem to compile and run the test program.)"
11475 xxx="a USG one, i.e. you use setpgrp()."
11477 # SVR4 systems can appear rather BSD-ish.
11478 case "$i_unistd" in
11480 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11484 xxx="probably a USG one, i.e. you use setpgrp()."
11489 echo "Assuming your setpgrp is $xxx" >&4
11498 : Look for GCC-style __builtin_choose_expr
11499 case "$d_builtin_choose_expr" in
11502 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11503 $cat >try.c <<'EOCP'
11504 #include <assert.h>
11505 #include <stdlib.h>
11508 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11511 assert( SYRINX(1) == 2112 );
11512 assert( SYRINX(1) != 5150 );
11513 assert( SYRINX(0) == 5150 );
11514 assert( SYRINX(0) != 2112 );
11515 puts( "All good!" );
11521 if eval $compile && $run ./try; then
11522 echo "Your C compiler supports __builtin_choose_expr."
11525 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11529 *) val="$d_builtin_choose_expr" ;;
11532 set d_builtin_choose_expr
11536 : Look for GCC-style __builtin_expect
11537 case "$d_builtin_expect" in
11540 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11541 $cat >try.c <<'EOCP'
11544 if ( __builtin_expect(n, 0) ) n = 1;
11545 /* Remember shell exit code truth is 0, C truth is non-zero */
11550 if eval $compile && $run ./try; then
11551 echo "Your C compiler supports __builtin_expect."
11554 echo "Your C compiler doesn't seem to understand __builtin_expect."
11558 *) val="$d_builtin_expect" ;;
11561 set d_builtin_expect
11565 : see if bzero exists
11569 : see if stdarg is available
11571 if $test `./findhdr stdarg.h`; then
11572 echo "<stdarg.h> found." >&4
11575 echo "<stdarg.h> NOT found." >&4
11579 : see if varargs is available
11581 if $test `./findhdr varargs.h`; then
11582 echo "<varargs.h> found." >&4
11584 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11587 : set up the varargs testing programs
11588 $cat > varargs.c <<EOP
11590 #include <stdarg.h>
11593 #include <varargs.h>
11597 int f(char *p, ...)
11611 p = va_arg(ap, char *);
11617 $cat > varargs <<EOP
11619 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11628 : now check which varargs header should be included
11634 if `./varargs I_STDARG`; then
11636 elif `./varargs I_VARARGS`; then
11641 if `./varargs I_VARARGS`; then
11649 echo "*** WHOA THERE!!! ***" >&4
11650 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11651 case "$knowitall" in
11653 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11657 echo "I could not find the definition for va_dcl... You have problems..." >&4
11658 val="$undef"; set i_stdarg; eval $setvar
11659 val="$undef"; set i_varargs; eval $setvar
11664 case "$i_varhdr" in
11666 val="$define"; set i_stdarg; eval $setvar
11667 val="$undef"; set i_varargs; eval $setvar
11670 val="$undef"; set i_stdarg; eval $setvar
11671 val="$define"; set i_varargs; eval $setvar
11674 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11678 : see if the Compiler supports C99 variadic macros
11679 case "$i_stdarg$i_stdlib" in
11681 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11684 #include <stdarg.h>
11686 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11690 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11696 if eval $compile && $run ./try 2>&1 >/dev/null; then
11697 case "`$run ./try`" in
11699 echo "You have C99 variadic macros." >&4
11700 d_c99_variadic_macros="$define"
11703 echo "You don't have functional C99 variadic macros." >&4
11704 d_c99_variadic_macros="$undef"
11708 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11709 d_c99_variadic_macros="$undef"
11714 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11715 d_c99_variadic_macros="$undef"
11719 : see if signal is declared as pointer to function returning int or void
11721 xxx=`./findhdr signal.h`
11722 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11723 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11724 echo "You have int (*signal())() instead of void." >&4
11726 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11727 echo "You have void (*signal())()." >&4
11729 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11730 echo "You have int (*signal())() instead of void." >&4
11732 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11733 echo "You have void (*signal())()." >&4
11736 case "$d_voidsig" in
11738 echo "I can't determine whether signal handler returns void or int..." >&4
11740 rp="What type does your signal handler return?"
11743 v*) val="$define";;
11747 echo "As you already told me, signal handler returns void." >&4
11750 *) echo "As you already told me, signal handler returns int." >&4
11757 case "$d_voidsig" in
11758 "$define") signal_t="void";;
11759 *) signal_t="int";;
11763 : check for ability to cast large floats to 32-bit ints.
11765 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11766 if $test "$intsize" -ge 4; then
11773 #$i_stdlib I_STDLIB
11775 #include <stdlib.h>
11777 #include <sys/types.h>
11778 #include <signal.h>
11779 $signal_t blech(int s) { exit(3); }
11786 signal(SIGFPE, blech);
11788 /* Don't let compiler optimize the test away. Store the number
11789 in a writable string for gcc to pass to sscanf under HP-UX.
11791 sprintf(str, "2147483647");
11792 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11796 /* x86 processors will probably give 0x8000 0000, which is a
11797 sign change. We don't want that. We want to mimic SPARC
11798 behavior here, which is to preserve the sign and give
11801 if (i32 != ($xxx) f)
11807 if eval $compile_ok; then
11808 $run ./try 2>/dev/null
11811 echo "(I can't seem to compile the test program--assuming it can't)"
11816 echo "Yup, it can."
11819 echo "Nope, it can't."
11826 : check for ability to cast negative floats to unsigned
11828 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11831 #$i_stdlib I_STDLIB
11833 #include <stdlib.h>
11835 #include <sys/types.h>
11836 #include <signal.h>
11837 $signal_t blech(int s) { exit(7); }
11838 $signal_t blech_in_list(int s) { exit(4); }
11839 unsigned long dummy_long(unsigned long p) { return p; }
11840 unsigned int dummy_int(unsigned int p) { return p; }
11841 unsigned short dummy_short(unsigned short p) { return p; }
11845 unsigned long along;
11847 unsigned short ashort;
11851 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11852 a direct f = -123. assignment. gcc-2.8.0 reportedly
11853 optimized the whole file away
11855 /* Store the number in a writable string for gcc to pass to
11856 sscanf under HP-UX.
11858 sprintf(str, "-123");
11859 sscanf(str, "%lf", &f); /* f = -123.; */
11861 signal(SIGFPE, blech);
11862 along = (unsigned long)f;
11863 aint = (unsigned int)f;
11864 ashort = (unsigned short)f;
11865 if (along != (unsigned long)-123)
11867 if (aint != (unsigned int)-123)
11869 if (ashort != (unsigned short)-123)
11871 sprintf(str, "1073741824.");
11872 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11875 along = (unsigned long)f;
11876 if (along != 0x80000000)
11880 along = (unsigned long)f;
11881 if (along != 0x7fffffff)
11885 along = (unsigned long)f;
11886 if (along != 0x80000001)
11890 signal(SIGFPE, blech_in_list);
11891 sprintf(str, "123.");
11892 sscanf(str, "%lf", &f); /* f = 123.; */
11893 along = dummy_long((unsigned long)f);
11894 aint = dummy_int((unsigned int)f);
11895 ashort = dummy_short((unsigned short)f);
11896 if (along != (unsigned long)123)
11898 if (aint != (unsigned int)123)
11900 if (ashort != (unsigned short)123)
11907 if eval $compile_ok; then
11908 $run ./try 2>/dev/null
11911 echo "(I can't seem to compile the test program--assuming it can't)"
11914 case "$castflags" in
11916 echo "Yup, it can."
11919 echo "Nope, it can't."
11926 : see if cbrt exists
11930 : see if vprintf exists
11932 if set vprintf val -f d_vprintf; eval $csym; $val; then
11933 echo 'vprintf() found.' >&4
11936 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11937 #$i_varargs I_VARARGS
11939 #$i_stdlib I_STDLIB
11940 #$i_unistd I_UNISTD
11943 # include <stdarg.h>
11944 #else /* I_VARARGS */
11945 # include <varargs.h>
11949 # include <unistd.h>
11953 # include <stdlib.h>
11956 #include <stdio.h> /* vsprintf prototype */
11959 void xxx(int n, ...)
11964 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11966 int main() { xxx(1, "foo"); }
11968 #else /* I_VARARGS */
11976 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11978 int main() { xxx("foo"); }
11984 if eval $compile_ok; then
11985 if $run ./try; then
11986 echo "Your vsprintf() returns (int)." >&4
11989 echo "Your vsprintf() returns (char*)." >&4
11993 echo 'I am unable to compile the vsprintf() test program.' >&4
11994 # We shouldn't get here. If we do, assume the standard signature,
11995 # not the old BSD one.
11996 echo 'Guessing that vsprintf() returns (int).' >&4
12000 echo 'vprintf() NOT found.' >&4
12011 : see if chown exists
12015 : see if chroot exists
12016 set chroot d_chroot
12019 : see if chsize exists
12020 set chsize d_chsize
12023 : see if class exists
12027 : see if clearenv exists
12028 set clearenv d_clearenv
12031 : Define hasstruct macro for Configure internal use
12032 hasstruct='varname=$1; struct=$2; shift; shift;
12033 while $test $# -ge 2; do
12035 $define) echo "#include <$2>";;
12039 echo "int main () { struct $struct foo; }" >> try.c;
12041 if eval $compile; then
12050 : see whether socket exists
12054 $echo $n "Hmm... $c" >&4
12055 if set socket val -f d_socket; eval $csym; $val; then
12056 echo "Looks like you have Berkeley networking support." >&4
12058 if set setsockopt val -f; eval $csym; $val; then
12061 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
12062 d_oldsock="$define"
12065 if $contains socklib libc.list >/dev/null 2>&1; then
12066 echo "Looks like you have Berkeley networking support." >&4
12068 : we will have to assume that it supports the 4.2 BSD interface
12071 echo "You don't have Berkeley networking in libc$_a..." >&4
12072 if test "X$d_socket" = "X$define"; then
12073 echo "...but you seem to believe that you have sockets." >&4
12075 for net in net socket
12077 if test -f $sysroot/usr/lib/lib$net$_a; then
12078 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12079 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12080 if $contains socket libc.list >/dev/null 2>&1; then
12085 echo "...but the Wollongong group seems to have hacked it in." >&4
12086 sockethdr="-I$sysroot/usr/netinclude"
12089 echo "Found Berkeley sockets interface in lib$net." >&4
12090 if $contains setsockopt libc.list >/dev/null 2>&1; then
12093 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12094 d_oldsock="$define"
12100 if test "X$d_socket" != "X$define"; then
12101 echo "or anywhere else I see." >&4
12109 : see if socketpair exists
12110 set socketpair d_sockpair
12115 echo "Checking the availability sa_len in the sock struct ..." >&4
12117 #include <sys/types.h>
12118 #include <sys/socket.h>
12120 struct sockaddr sa;
12121 return (sa.sa_len);
12125 set try; if eval $compile; then
12128 set d_sockaddr_sa_len; eval $setvar
12132 echo "Checking the availability struct sockaddr_in6 ..." >&4
12134 #include <sys/types.h>
12135 #include <sys/socket.h>
12136 #include <netinet/in.h>
12138 struct sockaddr_in6 sin6;
12139 return (sin6.sin6_family);
12143 set try; if eval $compile; then
12146 set d_sockaddr_in6; eval $setvar
12150 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12152 #include <sys/types.h>
12153 #include <sys/socket.h>
12154 #include <netinet/in.h>
12156 struct sockaddr_in6 sin6;
12157 return (sin6.sin6_scope_id);
12161 set try; if eval $compile; then
12164 set d_sin6_scope_id; eval $setvar
12168 echo "Checking the availability struct ip_mreq ..." >&4
12170 #include <sys/types.h>
12171 #include <sys/socket.h>
12172 #include <netinet/in.h>
12174 struct ip_mreq mreq;
12175 return (mreq.imr_multiaddr.s_addr);
12179 set try; if eval $compile; then
12182 set d_ip_mreq; eval $setvar
12186 echo "Checking the availability struct ip_mreq_source ..." >&4
12188 #include <sys/types.h>
12189 #include <sys/socket.h>
12190 #include <netinet/in.h>
12192 struct ip_mreq_source mreq;
12193 return (mreq.imr_multiaddr.s_addr);
12197 set try; if eval $compile; then
12200 set d_ip_mreq_source; eval $setvar
12204 echo "Checking the availability struct ipv6_mreq ..." >&4
12206 #include <sys/types.h>
12207 #include <sys/socket.h>
12208 #include <netinet/in.h>
12210 struct ipv6_mreq mreq;
12211 return (mreq.ipv6mr_interface);
12215 set try; if eval $compile; then
12218 set d_ipv6_mreq; eval $setvar
12222 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12224 #include <sys/types.h>
12225 #include <sys/socket.h>
12226 #include <netinet/in.h>
12228 struct ipv6_mreq_source mreq;
12229 return (mreq.imr_multiaddr.s_addr);
12233 set try; if eval $compile; then
12236 set d_ipv6_mreq_source; eval $setvar
12240 echo "Checking the availability of certain socket constants..." >&4
12241 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12242 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12244 #include <sys/types.h>
12245 #include <sys/socket.h>
12251 set try; if eval $compile; then
12254 set d_${enum}; eval $setvar
12258 : see if this is a sys/uio.h system
12259 set sys/uio.h i_sysuio
12262 : Check for cmsghdr support
12264 echo "Checking to see if your system supports struct cmsghdr..." >&4
12265 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12267 case "$d_cmsghdr_s" in
12268 "$define") echo "Yes, it does." ;;
12269 *) echo "No, it doesn't." ;;
12273 : check for const keyword
12275 echo 'Checking to see if your C compiler knows about "const"...' >&4
12276 $cat >const.c <<'EOCP'
12277 typedef struct spug { int drokk; } spug;
12281 const spug y = { 0 };
12284 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12286 echo "Yup, it does."
12289 echo "Nope, it doesn't."
12294 : see if copysign exists
12295 set copysign d_copysign
12298 : see if copysignl exists
12299 set copysignl d_copysignl
12302 : see if crypt exists
12307 $define) cryptlib='' ;;
12308 *) if set crypt val -f d_crypt; eval $csym; $val; then
12309 echo 'crypt() found.' >&4
12313 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12314 if $test -z "$cryptlib"; then
12315 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12319 if $test -z "$cryptlib"; then
12320 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12324 if $test -z "$cryptlib"; then
12325 cryptlib=`./loc libcrypt$_a "" $libpth`
12329 if $test -z "$cryptlib"; then
12330 echo 'crypt() NOT found.' >&4
12341 : see if this is a crypt.h system
12342 set crypt.h i_crypt
12345 : see if crypt_r exists
12346 set crypt_r d_crypt_r
12348 case "$d_crypt_r" in
12350 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12351 case "$d_crypt_r_proto:$usethreads" in
12352 ":define") d_crypt_r_proto=define
12353 set d_crypt_r_proto crypt_r $hdrs
12357 case "$d_crypt_r_proto" in
12359 case "$crypt_r_proto" in
12360 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12361 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12363 case "$crypt_r_proto" in
12364 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12365 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12367 case "$crypt_r_proto" in
12368 ''|0) d_crypt_r=undef
12370 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12371 * ) case "$crypt_r_proto" in
12372 REENTRANT_PROTO*) ;;
12373 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12375 echo "Prototype: $try" ;;
12378 *) case "$usethreads" in
12379 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12390 : get csh whereabouts
12392 'csh') val="$undef" ;;
12393 *) val="$define" ;;
12397 : Respect a hint or command line value for full_csh.
12398 case "$full_csh" in
12399 '') full_csh=$csh ;;
12402 : see if ctermid exists
12403 set ctermid d_ctermid
12406 : see if ctermid_r exists
12407 set ctermid_r d_ctermid_r
12409 case "$d_ctermid_r" in
12411 hdrs="$i_systypes sys/types.h define stdio.h "
12412 case "$d_ctermid_r_proto:$usethreads" in
12413 ":define") d_ctermid_r_proto=define
12414 set d_ctermid_r_proto ctermid_r $hdrs
12418 case "$d_ctermid_r_proto" in
12420 case "$ctermid_r_proto" in
12421 ''|0) try='char* ctermid_r(char*);'
12422 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12424 case "$ctermid_r_proto" in
12425 ''|0) d_ctermid_r=undef
12427 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12428 * ) case "$ctermid_r_proto" in
12429 REENTRANT_PROTO*) ;;
12430 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12432 echo "Prototype: $try" ;;
12435 *) case "$usethreads" in
12436 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12443 *) ctermid_r_proto=0
12447 : see if ctime_r exists
12448 set ctime_r d_ctime_r
12450 case "$d_ctime_r" in
12452 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12453 case "$d_ctime_r_proto:$usethreads" in
12454 ":define") d_ctime_r_proto=define
12455 set d_ctime_r_proto ctime_r $hdrs
12459 case "$d_ctime_r_proto" in
12461 case "$ctime_r_proto" in
12462 ''|0) try='char* ctime_r(const time_t*, char*);'
12463 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12465 case "$ctime_r_proto" in
12466 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12467 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12469 case "$ctime_r_proto" in
12470 ''|0) try='int ctime_r(const time_t*, char*);'
12471 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12473 case "$ctime_r_proto" in
12474 ''|0) try='int ctime_r(const time_t*, char*, int);'
12475 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12477 case "$ctime_r_proto" in
12478 ''|0) d_ctime_r=undef
12480 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12481 * ) case "$ctime_r_proto" in
12482 REENTRANT_PROTO*) ;;
12483 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12485 echo "Prototype: $try" ;;
12488 *) case "$usethreads" in
12489 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12500 : see if cuserid exists
12501 set cuserid d_cuserid
12504 : see if this is a limits.h system
12505 set limits.h i_limits
12508 : See if number of significant digits in a double precision number is known
12510 $cat >dbl_dig.c <<EOM
12511 #$i_limits I_LIMITS
12514 #include <limits.h>
12520 printf("Contains DBL_DIG");
12523 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12524 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12525 echo "DBL_DIG found." >&4
12528 echo "DBL_DIG NOT found." >&4
12535 : see if dbm.h is available
12536 : see if dbmclose exists
12537 set dbmclose d_dbmclose
12540 case "$d_dbmclose" in
12550 *) set rpcsvc/dbm.h i_rpcsvcdbm
12555 *) echo "We won't be including <dbm.h>"
12565 : see if prototype for dbminit is available
12567 set d_dbminitproto dbminit $i_dbm dbm.h
12570 : see if difftime exists
12571 set difftime d_difftime
12574 : see if this is a dirent system
12576 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12578 echo "<dirent.h> found." >&4
12581 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12582 echo "<sys/dir.h> found." >&4
12585 xinc=`./findhdr sys/ndir.h`
12587 echo "<dirent.h> NOT found." >&4
12592 : Look for type of directory structure.
12594 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12596 case "$direntrytype" in
12598 case "$i_dirent" in
12599 $define) guess1='struct dirent' ;;
12600 *) guess1='struct direct' ;;
12603 *) guess1="$direntrytype"
12608 'struct dirent') guess2='struct direct' ;;
12609 *) guess2='struct dirent' ;;
12612 if $contains "$guess1" try.c >/dev/null 2>&1; then
12613 direntrytype="$guess1"
12614 echo "Your directory entries are $direntrytype." >&4
12615 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12616 direntrytype="$guess2"
12617 echo "Your directory entries seem to be $direntrytype." >&4
12619 echo "I don't recognize your system's directory entries." >&4
12620 rp="What type is used for directory entries on this system?"
12623 direntrytype="$ans"
12627 : see if the directory entry stores field length
12629 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12630 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12631 echo "Good, your directory entry keeps length information in d_namlen." >&4
12634 echo "Your directory entry does not know about the d_namlen field." >&4
12641 : Look for DIR.dd_fd
12642 case "$i_dirent" in
12644 echo "Checking to see if DIR has a dd_fd member variable" >&4
12646 #$i_stdlib I_STDLIB
12648 #include <stdlib.h>
12650 #include <dirent.h>
12660 if eval $compile; then
12661 echo "Yes, it does."
12664 echo "No, it does not."
12669 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12677 : see if this is an sysdir system
12678 set sys/dir.h i_sysdir
12681 : see if this is an sysndir system
12682 set sys/ndir.h i_sysndir
12687 $cat >dirfd.c <<EOM
12689 #$i_stdlib I_STDLIB
12691 #include <stdlib.h>
12693 #$i_dirent I_DIRENT /**/
12694 #$i_sysdir I_SYS_DIR /**/
12695 #$i_sysndir I_SYS_NDIR /**/
12696 #$i_systypes I_SYS_TYPES /**/
12697 #if defined(I_SYS_TYPES)
12698 #include <sys/types.h>
12700 #if defined(I_DIRENT)
12701 #include <dirent.h>
12704 #include <sys/ndir.h>
12708 #include <ndir.h> /* may be wrong in the future */
12710 #include <sys/dir.h>
12716 DIR *dirp = opendir(".");
12717 if (dirfd(dirp) >= 0)
12725 if eval $compile; then
12729 $define) echo "dirfd() found." >&4 ;;
12730 *) echo "dirfd() NOT found." >&4 ;;
12736 : see if dladdr exists
12737 set dladdr d_dladdr
12740 : see if dlerror exists
12743 set dlerror d_dlerror
12747 : see if dlfcn is available
12748 set dlfcn.h i_dlfcn
12751 : Check what extension to use for shared libs
12756 On a few systems, the dynamically loaded modules that perl generates and uses
12757 will need a different extension than shared libs. The default will probably
12763 *) dflt="$dlext" ;;
12765 rp='What is the extension of dynamically loaded modules'
12774 : Check if dlsym need a leading underscore
12780 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12781 $cat >dyna.c <<'EOM'
12788 #$i_stdlib I_STDLIB
12790 #include <stdlib.h>
12794 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12796 #include <sys/types.h>
12801 extern int fred() ;
12810 int mode = RTLD_LAZY ;
12812 handle = dlopen("./dyna.$dlext", mode) ;
12813 if (handle == NULL) {
12818 symbol = dlsym(handle, "fred") ;
12819 if (symbol == NULL) {
12820 /* try putting a leading underscore */
12821 symbol = dlsym(handle, "_fred") ;
12822 if (symbol == NULL) {
12835 : Call the object file tmp-dyna.o in case dlext=o.
12836 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12837 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12838 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12839 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12842 1) echo "Test program failed using dlopen." >&4
12843 echo "Perhaps you should not use dynamic loading." >&4;;
12844 2) echo "Test program failed using dlsym." >&4
12845 echo "Perhaps you should not use dynamic loading." >&4;;
12846 3) echo "dlsym needs a leading underscore" >&4
12848 4) echo "dlsym doesn't need a leading underscore." >&4;;
12851 echo "I can't compile and run the test program." >&4
12852 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12857 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12862 : see if drand48_r exists
12863 set drand48_r d_drand48_r
12865 case "$d_drand48_r" in
12867 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12868 case "$d_drand48_r_proto:$usethreads" in
12869 ":define") d_drand48_r_proto=define
12870 set d_drand48_r_proto drand48_r $hdrs
12874 case "$d_drand48_r_proto" in
12876 case "$drand48_r_proto" in
12877 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12878 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12880 case "$drand48_r_proto" in
12881 ''|0) d_drand48_r=undef
12883 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12884 * ) case "$drand48_r_proto" in
12885 REENTRANT_PROTO*) ;;
12886 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12888 echo "Prototype: $try" ;;
12891 *) case "$usethreads" in
12892 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12899 *) drand48_r_proto=0
12903 : see if prototype for drand48 is available
12905 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12908 : see if dup2 exists
12912 : see if eaccess exists
12913 set eaccess d_eaccess
12916 : see if endgrent exists
12917 set endgrent d_endgrent
12920 : see if this is an grp system
12926 xxx=`./findhdr grp.h`
12927 $cppstdin $cppflags $cppminus < $xxx >$$.h
12929 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12941 set d_grpasswd; eval $setvar
12945 : see if endgrent_r exists
12946 set endgrent_r d_endgrent_r
12948 case "$d_endgrent_r" in
12950 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12951 case "$d_endgrent_r_proto:$usethreads" in
12952 ":define") d_endgrent_r_proto=define
12953 set d_endgrent_r_proto endgrent_r $hdrs
12957 case "$d_endgrent_r_proto" in
12959 case "$endgrent_r_proto" in
12960 ''|0) try='int endgrent_r(FILE**);'
12961 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12963 case "$endgrent_r_proto" in
12964 ''|0) try='void endgrent_r(FILE**);'
12965 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12967 case "$endgrent_r_proto" in
12968 ''|0) d_endgrent_r=undef
12970 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12971 * ) case "$endgrent_r_proto" in
12972 REENTRANT_PROTO*) ;;
12973 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12975 echo "Prototype: $try" ;;
12978 *) case "$usethreads" in
12979 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12986 *) endgrent_r_proto=0
12990 : see if endhostent exists
12991 set endhostent d_endhent
12994 : see if this is a netdb.h system
12995 set netdb.h i_netdb
12998 : see if endhostent_r exists
12999 set endhostent_r d_endhostent_r
13001 case "$d_endhostent_r" in
13003 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13004 case "$d_endhostent_r_proto:$usethreads" in
13005 ":define") d_endhostent_r_proto=define
13006 set d_endhostent_r_proto endhostent_r $hdrs
13010 case "$d_endhostent_r_proto" in
13012 case "$endhostent_r_proto" in
13013 ''|0) try='int endhostent_r(struct hostent_data*);'
13014 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
13016 case "$endhostent_r_proto" in
13017 ''|0) try='void endhostent_r(struct hostent_data*);'
13018 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
13020 case "$endhostent_r_proto" in
13021 ''|0) d_endhostent_r=undef
13022 endhostent_r_proto=0
13023 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
13024 * ) case "$endhostent_r_proto" in
13025 REENTRANT_PROTO*) ;;
13026 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
13028 echo "Prototype: $try" ;;
13031 *) case "$usethreads" in
13032 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
13034 d_endhostent_r=undef
13035 endhostent_r_proto=0
13039 *) endhostent_r_proto=0
13043 : see if endnetent exists
13044 set endnetent d_endnent
13047 : see if endnetent_r exists
13048 set endnetent_r d_endnetent_r
13050 case "$d_endnetent_r" in
13052 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13053 case "$d_endnetent_r_proto:$usethreads" in
13054 ":define") d_endnetent_r_proto=define
13055 set d_endnetent_r_proto endnetent_r $hdrs
13059 case "$d_endnetent_r_proto" in
13061 case "$endnetent_r_proto" in
13062 ''|0) try='int endnetent_r(struct netent_data*);'
13063 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13065 case "$endnetent_r_proto" in
13066 ''|0) try='void endnetent_r(struct netent_data*);'
13067 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13069 case "$endnetent_r_proto" in
13070 ''|0) d_endnetent_r=undef
13071 endnetent_r_proto=0
13072 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13073 * ) case "$endnetent_r_proto" in
13074 REENTRANT_PROTO*) ;;
13075 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13077 echo "Prototype: $try" ;;
13080 *) case "$usethreads" in
13081 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13083 d_endnetent_r=undef
13084 endnetent_r_proto=0
13088 *) endnetent_r_proto=0
13092 : see if endprotoent exists
13093 set endprotoent d_endpent
13096 : see if endprotoent_r exists
13097 set endprotoent_r d_endprotoent_r
13099 case "$d_endprotoent_r" in
13101 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13102 case "$d_endprotoent_r_proto:$usethreads" in
13103 ":define") d_endprotoent_r_proto=define
13104 set d_endprotoent_r_proto endprotoent_r $hdrs
13108 case "$d_endprotoent_r_proto" in
13110 case "$endprotoent_r_proto" in
13111 ''|0) try='int endprotoent_r(struct protoent_data*);'
13112 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13114 case "$endprotoent_r_proto" in
13115 ''|0) try='void endprotoent_r(struct protoent_data*);'
13116 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13118 case "$endprotoent_r_proto" in
13119 ''|0) d_endprotoent_r=undef
13120 endprotoent_r_proto=0
13121 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13122 * ) case "$endprotoent_r_proto" in
13123 REENTRANT_PROTO*) ;;
13124 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13126 echo "Prototype: $try" ;;
13129 *) case "$usethreads" in
13130 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13132 d_endprotoent_r=undef
13133 endprotoent_r_proto=0
13137 *) endprotoent_r_proto=0
13141 : see if endpwent exists
13142 set endpwent d_endpwent
13145 : see if this is a pwd.h system
13151 xxx=`./findhdr pwd.h`
13152 $cppstdin $cppflags $cppminus < $xxx >$$.h
13154 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13162 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13170 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13178 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13186 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13194 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13202 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13210 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13222 set d_pwquota; eval $setvar
13223 set d_pwage; eval $setvar
13224 set d_pwchange; eval $setvar
13225 set d_pwclass; eval $setvar
13226 set d_pwexpire; eval $setvar
13227 set d_pwcomment; eval $setvar
13228 set d_pwgecos; eval $setvar
13229 set d_pwpasswd; eval $setvar
13233 : see if endpwent_r exists
13234 set endpwent_r d_endpwent_r
13236 case "$d_endpwent_r" in
13238 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13239 case "$d_endpwent_r_proto:$usethreads" in
13240 ":define") d_endpwent_r_proto=define
13241 set d_endpwent_r_proto endpwent_r $hdrs
13245 case "$d_endpwent_r_proto" in
13247 case "$endpwent_r_proto" in
13248 ''|0) try='int endpwent_r(FILE**);'
13249 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13251 case "$endpwent_r_proto" in
13252 ''|0) try='void endpwent_r(FILE**);'
13253 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13255 case "$endpwent_r_proto" in
13256 ''|0) d_endpwent_r=undef
13258 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13259 * ) case "$endpwent_r_proto" in
13260 REENTRANT_PROTO*) ;;
13261 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13263 echo "Prototype: $try" ;;
13266 *) case "$usethreads" in
13267 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13274 *) endpwent_r_proto=0
13278 : see if endservent exists
13279 set endservent d_endsent
13282 : see if endservent_r exists
13283 set endservent_r d_endservent_r
13285 case "$d_endservent_r" in
13287 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13288 case "$d_endservent_r_proto:$usethreads" in
13289 ":define") d_endservent_r_proto=define
13290 set d_endservent_r_proto endservent_r $hdrs
13294 case "$d_endservent_r_proto" in
13296 case "$endservent_r_proto" in
13297 ''|0) try='int endservent_r(struct servent_data*);'
13298 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13300 case "$endservent_r_proto" in
13301 ''|0) try='void endservent_r(struct servent_data*);'
13302 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13304 case "$endservent_r_proto" in
13305 ''|0) d_endservent_r=undef
13306 endservent_r_proto=0
13307 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13308 * ) case "$endservent_r_proto" in
13309 REENTRANT_PROTO*) ;;
13310 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13312 echo "Prototype: $try" ;;
13315 *) case "$usethreads" in
13316 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13318 d_endservent_r=undef
13319 endservent_r_proto=0
13323 *) endservent_r_proto=0
13327 : Locate the flags for 'open()'
13330 #include <sys/types.h>
13335 #include <sys/file.h>
13337 #$i_stdlib I_STDLIB
13339 #include <stdlib.h>
13350 : check sys/file.h first to get FREAD on Sun
13351 if $test `./findhdr sys/file.h` && \
13352 set try -DI_SYS_FILE && eval $compile; then
13354 echo "<sys/file.h> defines the O_* constants..." >&4
13355 if $run ./try; then
13356 echo "and you have the 3 argument form of open()." >&4
13359 echo "but not the 3 argument form of open(). Oh, well." >&4
13362 elif $test `./findhdr fcntl.h` && \
13363 set try -DI_FCNTL && eval $compile; then
13365 echo "<fcntl.h> defines the O_* constants..." >&4
13366 if $run ./try; then
13367 echo "and you have the 3 argument form of open()." >&4
13370 echo "but not the 3 argument form of open(). Oh, well." >&4
13375 echo "I can't find the O_* constant definitions! You got problems." >&4
13381 : see if this is a sys/file.h system
13386 : do we need to include sys/file.h ?
13390 if $h_sysfile; then
13392 echo "We'll be including <sys/file.h>." >&4
13395 echo "We won't be including <sys/file.h>." >&4
13405 : see if fcntl.h is there
13410 : see if we can include fcntl.h
13416 echo "We'll be including <fcntl.h>." >&4
13419 if $h_sysfile; then
13420 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13422 echo "We won't be including <fcntl.h>." >&4
13434 : see if fork exists
13438 : see if pipe exists
13442 : check for non-blocking I/O stuff
13443 case "$h_sysfile" in
13444 true) echo "#include <sys/file.h>" > head.c;;
13447 true) echo "#include <fcntl.h>" > head.c;;
13448 *) echo "#include <sys/fcntl.h>" > head.c;;
13453 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13454 case "$o_nonblock" in
13456 $cat head.c > try.c
13457 $cat >>try.c <<EOCP
13459 #$i_stdlib I_STDLIB
13461 #include <stdlib.h>
13469 printf("O_NONBLOCK\n");
13473 printf("O_NDELAY\n");
13477 printf("FNDELAY\n");
13484 if eval $compile_ok; then
13485 o_nonblock=`$run ./try`
13486 case "$o_nonblock" in
13487 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13488 *) echo "Seems like we can use $o_nonblock.";;
13491 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13494 *) echo "Using $hint value $o_nonblock.";;
13499 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13502 case "$d_fork:$d_pipe:$d_alarm" in
13503 define:define:define)
13504 $cat head.c > try.c
13505 $cat >>try.c <<EOCP
13507 #include <sys/types.h>
13508 #include <signal.h>
13510 #$i_stdlib I_STDLIB
13512 #include <stdlib.h>
13518 #define MY_O_NONBLOCK $o_nonblock
13519 #ifndef errno /* XXX need better Configure test */
13522 #$i_unistd I_UNISTD
13524 #include <unistd.h>
13526 #$i_string I_STRING
13528 #include <string.h>
13530 #include <strings.h>
13532 $signal_t blech(int x) { exit(3); }
13534 $cat >> try.c <<'EOCP'
13543 ret = pipe(pd); /* Down: child -> parent */
13546 ret = pipe(pu); /* Up: parent -> child */
13550 close(pd[1]); /* Parent reads from pd[0] */
13551 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13553 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13558 signal(SIGALRM, blech);
13560 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13562 sprintf(string, "%d\n", ret);
13563 ret = write(2, string, strlen(string));
13564 if (ret != strlen(string))
13568 if (errno == EAGAIN) {
13569 printf("EAGAIN\n");
13574 if (errno == EWOULDBLOCK)
13575 printf("EWOULDBLOCK\n");
13578 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13581 sleep(2); /* Give it time to close our pipe */
13583 ret = read(pd[0], buf, 1); /* Should read EOF */
13585 sprintf(string, "%d\n", ret);
13586 ret = write(4, string, strlen(string));
13587 if (ret != strlen(string))
13592 close(pd[0]); /* We write to pd[1] */
13593 close(pu[1]); /* We read from pu[0] */
13594 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13597 close(pd[1]); /* Pipe pd is now fully closed! */
13598 exit(0); /* Bye bye, thank you for playing! */
13602 if eval $compile_ok; then
13603 echo "$startsh" >mtry
13604 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13606 $run ./mtry >/dev/null 2>&1
13608 0) eagain=`$cat try.out`;;
13609 1) echo "Could not perform non-blocking setting!";;
13610 2) echo "I did a successful read() for something that was not there!";;
13611 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13612 4) echo "Could not find F_SETFL!";;
13613 *) echo "Something terribly wrong happened during testing.";;
13615 rd_nodata=`$cat try.ret`
13616 echo "A read() system call with no data present returns $rd_nodata."
13617 case "$rd_nodata" in
13620 echo "(That's peculiar, fixing that to be -1.)"
13626 echo "Forcing errno EAGAIN on read() with no data available."
13630 echo "Your read() sets errno to $eagain when no data is available."
13633 status=`$cat try.err`
13635 0) echo "And it correctly returns 0 to signal EOF.";;
13636 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13637 *) echo "However, your read() returns '$status' on EOF??";;
13640 if test "$status" = "$rd_nodata"; then
13641 echo "WARNING: you can't distinguish between EOF and no data!"
13645 echo "I can't compile the test program--assuming errno EAGAIN will do."
13649 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13658 echo "Using $hint value $eagain."
13659 echo "Your read() returns $rd_nodata when no data is present."
13660 case "$d_eofnblk" in
13661 "$define") echo "And you can see EOF because read() returns 0.";;
13662 "$undef") echo "But you can't see EOF status from read() returned value.";;
13664 echo "(Assuming you can't see EOF status from read anyway.)"
13670 $rm_try head.c mtry
13672 : see if erf exists
13676 : see if erfc exists
13680 : see if exp2 exists
13684 : see if expm1 exists
13688 : see if _ptr and _cnt from stdio act std
13691 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13692 echo "(Looks like you have stdio.h from BSD.)"
13693 case "$stdio_ptr" in
13694 '') stdio_ptr='((fp)->_p)'
13697 *) ptr_lval=$d_stdio_ptr_lval;;
13699 case "$stdio_cnt" in
13700 '') stdio_cnt='((fp)->_r)'
13703 *) cnt_lval=$d_stdio_cnt_lval;;
13705 case "$stdio_base" in
13706 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13708 case "$stdio_bufsiz" in
13709 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13711 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13712 echo "(Looks like you have stdio.h from Linux.)"
13713 case "$stdio_ptr" in
13714 '') stdio_ptr='((fp)->_IO_read_ptr)'
13717 *) ptr_lval=$d_stdio_ptr_lval;;
13719 case "$stdio_cnt" in
13720 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13723 *) cnt_lval=$d_stdio_cnt_lval;;
13725 case "$stdio_base" in
13726 '') stdio_base='((fp)->_IO_read_base)';;
13728 case "$stdio_bufsiz" in
13729 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13732 case "$stdio_ptr" in
13733 '') stdio_ptr='((fp)->_ptr)'
13736 *) ptr_lval=$d_stdio_ptr_lval;;
13738 case "$stdio_cnt" in
13739 '') stdio_cnt='((fp)->_cnt)'
13742 *) cnt_lval=$d_stdio_cnt_lval;;
13744 case "$stdio_base" in
13745 '') stdio_base='((fp)->_base)';;
13747 case "$stdio_bufsiz" in
13748 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13752 : test whether _ptr and _cnt really work
13753 echo "Checking how std your stdio is..." >&4
13756 #$i_stdlib I_STDLIB
13758 #include <stdlib.h>
13760 #define FILE_ptr(fp) $stdio_ptr
13761 #define FILE_cnt(fp) $stdio_cnt
13763 FILE *fp = fopen("try.c", "r");
13766 18 <= FILE_cnt(fp) &&
13767 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13775 if eval $compile && $to try.c; then
13776 if $run ./try; then
13777 echo "Your stdio acts pretty std."
13780 echo "Your stdio isn't very std."
13783 echo "Your stdio doesn't appear very std."
13787 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13788 # direct buffer manipulation no longer works. The Configure tests
13789 # should be changed to correctly detect this, but until then,
13790 # the following check should at least let perl compile and run.
13791 # (This quick fix should be updated before 5.8.1.)
13792 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13793 # A. Dougherty, June 3, 2002.
13794 case "$d_gnulibc" in
13796 case "$gnulibc_version" in
13800 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13809 : Can _ptr be used as an lvalue?
13810 case "$d_stdstdio$ptr_lval" in
13811 $define$define) val=$define ;;
13814 set d_stdio_ptr_lval
13817 : Can _cnt be used as an lvalue?
13818 case "$d_stdstdio$cnt_lval" in
13819 $define$define) val=$define ;;
13822 set d_stdio_cnt_lval
13826 : test whether setting _ptr sets _cnt as a side effect
13827 d_stdio_ptr_lval_sets_cnt="$undef"
13828 d_stdio_ptr_lval_nochange_cnt="$undef"
13829 case "$d_stdio_ptr_lval$d_stdstdio" in
13831 echo "Checking to see what happens if we set the stdio ptr..." >&4
13834 /* Can we scream? */
13835 /* Eat dust sed :-) */
13836 /* In the buffer space, no one can hear you scream. */
13837 #$i_stdlib I_STDLIB
13839 #include <stdlib.h>
13841 #define FILE_ptr(fp) $stdio_ptr
13842 #define FILE_cnt(fp) $stdio_cnt
13843 #include <sys/types.h>
13845 FILE *fp = fopen("try.c", "r");
13850 puts("Fail even to read");
13853 c = getc(fp); /* Read away the first # */
13855 puts("Fail even to read");
13859 18 <= FILE_cnt(fp) &&
13860 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13862 puts("Fail even to read");
13865 ptr = (char*) FILE_ptr(fp);
13866 cnt = (size_t)FILE_cnt(fp);
13868 FILE_ptr(fp) += 42;
13870 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13871 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13874 if (FILE_cnt(fp) <= 20) {
13875 printf ("Fail (<20 chars to test)");
13878 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13879 puts("Fail compare");
13882 if (cnt == FILE_cnt(fp)) {
13883 puts("Pass_unchanged");
13886 if (FILE_cnt(fp) == (cnt - 42)) {
13887 puts("Pass_changed");
13890 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13896 if eval $compile && $to try.c; then
13897 case `$run ./try` in
13899 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13900 d_stdio_ptr_lval_sets_cnt="$define" ;;
13902 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13903 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13905 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13907 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13910 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13916 : see if _base is also standard
13918 case "$d_stdstdio" in
13922 #$i_stdlib I_STDLIB
13924 #include <stdlib.h>
13926 #define FILE_base(fp) $stdio_base
13927 #define FILE_bufsiz(fp) $stdio_bufsiz
13929 FILE *fp = fopen("try.c", "r");
13932 19 <= FILE_bufsiz(fp) &&
13933 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13940 if eval $compile && $to try.c; then
13941 if $run ./try; then
13942 echo "And its _base field acts std."
13945 echo "But its _base field isn't std."
13948 echo "However, it seems to be lacking the _base field."
13956 : see if fast_stdio exists
13958 case "$d_stdstdio:$d_stdio_ptr_lval" in
13960 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13962 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13973 : see if fchdir exists
13974 set fchdir d_fchdir
13977 : see if fchmod exists
13978 set fchmod d_fchmod
13981 : see if fchown exists
13982 set fchown d_fchown
13985 : see if this is an fcntl system
13989 : See if fcntl-based locking works.
13992 #$i_stdlib I_STDLIB
13994 #include <stdlib.h>
13996 #include <unistd.h>
13998 #include <signal.h>
13999 $signal_t blech(int x) { exit(3); }
14001 #if defined(F_SETLK) && defined(F_SETLKW)
14002 struct flock flock;
14004 fd = open("try.c", O_RDONLY);
14005 flock.l_type = F_RDLCK;
14006 flock.l_whence = SEEK_SET;
14007 flock.l_start = flock.l_len = 0;
14008 signal(SIGALRM, blech);
14010 retval = fcntl(fd, F_SETLK, &flock);
14012 (retval < 0 ? exit(2) : exit(0));
14018 echo "Checking if fcntl-based file locking works... "
14022 if eval $compile_ok; then
14023 if $run ./try; then
14024 echo "Yes, it seems to work."
14027 echo "Nope, it didn't work."
14032 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
14033 *** This is (almost) impossible.
14034 *** If your NFS lock daemons are not feeling well, something like
14035 *** this may happen, please investigate. Cannot continue, aborting.
14043 echo "I'm unable to compile the test program, so I'll assume not."
14048 echo "Nope, since you don't even have fcntl()."
14051 set d_fcntl_can_lock
14055 : check for fd_set items
14058 Checking to see how well your C compiler handles fd_set and friends ...
14061 #$i_stdlib I_STDLIB
14063 #include <stdlib.h>
14065 #$i_systime I_SYS_TIME
14066 #$i_sysselct I_SYS_SELECT
14067 #$d_socket HAS_SOCKET
14068 #include <sys/types.h>
14070 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14073 #include <sys/time.h>
14075 #ifdef I_SYS_SELECT
14076 #include <sys/select.h>
14085 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14093 if eval $compile; then
14094 d_fds_bits="$define"
14096 echo "Well, your system knows about the normal fd_set typedef..." >&4
14097 if $run ./try; then
14098 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14099 d_fd_macros="$define"
14102 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14104 d_fd_macros="$undef"
14108 Hmm, your compiler has some difficulty with fd_set. Checking further...
14111 if eval $compile; then
14112 d_fds_bits="$undef"
14114 echo "Well, your system has some sort of fd_set available..." >&4
14115 if $run ./try; then
14116 echo "and you have the normal fd_set macros." >&4
14117 d_fd_macros="$define"
14120 but not the normal fd_set macros! Gross! More work for me...
14122 d_fd_macros="$undef"
14125 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14127 d_fds_bits="$undef"
14128 d_fd_macros="$undef"
14133 : see if fdclose exists
14134 set fdclose d_fdclose
14137 : see if fdim exists
14141 : see if fegetround exists
14142 set fegetround d_fegetround
14145 : see if fgetpos exists
14146 set fgetpos d_fgetpos
14149 : see if finite exists
14150 set finite d_finite
14153 : see if finitel exists
14154 set finitel d_finitel
14157 : see if flock exists
14161 : see if prototype for flock is available
14163 set d_flockproto flock $i_sysfile sys/file.h
14166 : see if fma exists
14170 : see if fmax exists
14174 : see if fmin exists
14178 : see if fp_class exists
14179 set fp_class d_fp_class
14182 : see if this is a math.h system
14186 : check for fpclassify
14187 echo "Checking to see if you have fpclassify..." >&4
14193 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14196 if eval $compile; then
14198 echo "You have fpclassify."
14201 echo "You do not have fpclassify."
14207 : see if fp_classify exists
14208 set fp_classify d_fp_classify
14211 : see if fp_classl exists
14212 set fp_classl d_fp_classl
14215 : see if pathconf exists
14216 set pathconf d_pathconf
14219 : see if fpathconf exists
14220 set fpathconf d_fpathconf
14223 : see if fpclass exists
14224 set fpclass d_fpclass
14227 : see if fpclassl exists
14228 set fpclassl d_fpclassl
14231 : see if fpgetround exists
14232 set fpgetround d_fpgetround
14235 : check for fpos64_t
14237 echo "Checking to see if you have fpos64_t..." >&4
14240 int main() { fpos64_t x = 7; }
14243 if eval $compile; then
14245 echo "You have fpos64_t."
14248 echo "You do not have fpos64_t."
14249 case "$fpossize" in
14250 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14257 : see if this is an xlocale.h system
14258 set xlocale.h i_xlocale
14261 : see if newlocale exists
14262 set newlocale d_newlocale
14265 : see if freelocale exists
14266 set freelocale d_freelocale
14269 : see if uselocale exists
14270 set uselocale d_uselocale
14273 : see if duplocale exists
14274 set duplocale d_duplocale
14277 : see if querylocale exists
14278 set querylocale d_querylocale
14281 : see if frexpl exists
14282 set frexpl d_frexpl
14285 : see if this is a sys/param system
14286 set sys/param.h i_sysparam
14289 : see if this is a sys/mount.h system
14290 set sys/mount.h i_sysmount
14293 : Check for fs_data_s
14295 echo "Checking to see if your system supports struct fs_data..." >&4
14296 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14298 case "$d_fs_data_s" in
14299 "$define") echo "Yes, it does." ;;
14300 *) echo "No, it doesn't." ;;
14303 : see if fseeko exists
14304 set fseeko d_fseeko
14306 case "$longsize" in
14307 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14310 : see if fsetpos exists
14311 set fsetpos d_fsetpos
14314 : see if fstatfs exists
14315 set fstatfs d_fstatfs
14318 : see if statvfs exists
14319 set statvfs d_statvfs
14322 : see if fstatvfs exists
14323 set fstatvfs d_fstatvfs
14327 : see if fsync exists
14331 : see if ftello exists
14332 set ftello d_ftello
14334 case "$longsize" in
14335 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14338 : check for a working futimes
14341 echo "Checking if you have a working futimes()" >&4
14344 #include <sys/time.h>
14351 fd = open ("try.c", O_RDWR);
14352 if (-1 == fd) exit (1);
14353 rv = futimes (fd, NULL);
14354 exit (rv == -1 ? errno : 0);
14358 if eval $compile; then
14362 0) echo "Yes, you have" >&4
14363 d_futimes="$define"
14365 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14369 echo "No, it does not (probably harmless)" >&4
14373 : look for gai_strerror
14375 $cat >try.c <<'EOCP'
14376 #include <sys/types.h>
14377 #include <sys/socket.h>
14381 return (gai_strerror (0) ? 0 : 1);
14386 if eval $compile; then
14389 0) echo "A working gai_strerror() found." >&4
14391 *) echo "gai_strerror() found, but it doesn't work" >&4
14395 echo "gai_strerror() NOT found." >&4
14401 : see if ndbm.h is available
14404 : Compatibility location for RedHat 7.1
14405 set gdbm/ndbm.h i_gdbmndbm
14407 : Compatibility location for Debian 4.0
14408 set gdbm-ndbm.h i_gdbm_ndbm
14412 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14413 : see if dbm_open exists
14414 set dbm_open d_dbm_open
14416 case "$d_dbm_open" in
14419 i_gdbmndbm="$undef"
14420 i_gdbm_ndbm="$undef"
14421 echo "We won't be including <ndbm.h>"
14431 ndbm_hdr_protochk='name=$1; hdr=$2;
14432 eval "ihdr=\$""i_$name";
14434 if $test "$ihdr" = "$define"; then
14435 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14436 case "$d_cplusplus" in
14437 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14438 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14441 $define) $echo "Your <$hdr> seems to have prototypes";;
14442 *) $echo "Your <$hdr> does not seem to have prototypes";;
14445 set "d_${name}_h_uses_prototypes";
14449 eval $ndbm_hdr_protochk
14450 set gdbmndbm gdbm/ndbm.h
14451 eval $ndbm_hdr_protochk
14452 set gdbm_ndbm gdbm-ndbm.h
14453 eval $ndbm_hdr_protochk
14455 : see if getaddrinfo exists
14456 set getaddrinfo d_getaddrinfo
14459 : see if getcwd exists
14460 set getcwd d_getcwd
14463 : see if getespwnam exists
14464 set getespwnam d_getespwnam
14467 : see if getfsstat exists
14468 set getfsstat d_getfsstat
14471 : see if getgrent exists
14472 set getgrent d_getgrent
14475 : see if getgrent_r exists
14476 set getgrent_r d_getgrent_r
14478 case "$d_getgrent_r" in
14480 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14481 case "$d_getgrent_r_proto:$usethreads" in
14482 ":define") d_getgrent_r_proto=define
14483 set d_getgrent_r_proto getgrent_r $hdrs
14487 case "$d_getgrent_r_proto" in
14489 case "$getgrent_r_proto" in
14490 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14491 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14493 case "$getgrent_r_proto" in
14494 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14495 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14497 case "$getgrent_r_proto" in
14498 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14499 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14501 case "$getgrent_r_proto" in
14502 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14503 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14505 case "$getgrent_r_proto" in
14506 ''|0) try='int getgrent_r(struct group*, char*, int);'
14507 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14509 case "$getgrent_r_proto" in
14510 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14511 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14513 case "$getgrent_r_proto" in
14514 ''|0) d_getgrent_r=undef
14516 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14517 * ) case "$getgrent_r_proto" in
14518 REENTRANT_PROTO*) ;;
14519 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14521 echo "Prototype: $try" ;;
14524 *) case "$usethreads" in
14525 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14532 *) getgrent_r_proto=0
14536 : see if getgrgid_r exists
14537 set getgrgid_r d_getgrgid_r
14539 case "$d_getgrgid_r" in
14541 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14542 case "$d_getgrgid_r_proto:$usethreads" in
14543 ":define") d_getgrgid_r_proto=define
14544 set d_getgrgid_r_proto getgrgid_r $hdrs
14548 case "$d_getgrgid_r_proto" in
14550 case "$getgrgid_r_proto" in
14551 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14552 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14554 case "$getgrgid_r_proto" in
14555 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14556 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14558 case "$getgrgid_r_proto" in
14559 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14560 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14562 case "$getgrgid_r_proto" in
14563 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14564 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14566 case "$getgrgid_r_proto" in
14567 ''|0) d_getgrgid_r=undef
14569 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14570 * ) case "$getgrgid_r_proto" in
14571 REENTRANT_PROTO*) ;;
14572 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14574 echo "Prototype: $try" ;;
14577 *) case "$usethreads" in
14578 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14585 *) getgrgid_r_proto=0
14589 : see if getgrnam_r exists
14590 set getgrnam_r d_getgrnam_r
14592 case "$d_getgrnam_r" in
14594 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14595 case "$d_getgrnam_r_proto:$usethreads" in
14596 ":define") d_getgrnam_r_proto=define
14597 set d_getgrnam_r_proto getgrnam_r $hdrs
14601 case "$d_getgrnam_r_proto" in
14603 case "$getgrnam_r_proto" in
14604 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14605 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14607 case "$getgrnam_r_proto" in
14608 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14609 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14611 case "$getgrnam_r_proto" in
14612 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14613 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14615 case "$getgrnam_r_proto" in
14616 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14617 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14619 case "$getgrnam_r_proto" in
14620 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14621 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14623 case "$getgrnam_r_proto" in
14624 ''|0) d_getgrnam_r=undef
14626 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14627 * ) case "$getgrnam_r_proto" in
14628 REENTRANT_PROTO*) ;;
14629 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14631 echo "Prototype: $try" ;;
14634 *) case "$usethreads" in
14635 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14642 *) getgrnam_r_proto=0
14646 : see if gethostbyaddr exists
14647 set gethostbyaddr d_gethbyaddr
14650 : see if gethostbyname exists
14651 set gethostbyname d_gethbyname
14654 : see if gethostent exists
14655 set gethostent d_gethent
14658 : see how we will look up host name
14661 if set gethostname val -f d_gethname; eval $csym; $val; then
14662 echo 'gethostname() found.' >&4
14663 d_gethname="$define"
14666 if set uname val -f d_uname; eval $csym; $val; then
14669 uname() was found, but you're running xenix, and older versions of xenix
14670 have a broken uname(). If you don't really know whether your xenix is old
14671 enough to have a broken system call, use the default answer.
14676 "$define") dflt=n;;
14678 rp='Is your uname() broken?'
14681 n*) d_uname="$define"; call=uname;;
14684 echo 'uname() found.' >&4
14691 case "$d_gethname" in
14692 '') d_gethname="$undef";;
14695 '') d_uname="$undef";;
14697 case "$d_uname$d_gethname" in
14702 Every now and then someone has a $call() that lies about the hostname
14703 but can't be fixed for political or economic reasons. If you wish, I can
14704 pretend $call() isn't there and maybe compute hostname at run-time
14705 thanks to the '$phostname' command.
14708 rp="Shall I ignore $call() from now on?"
14711 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14714 case "$phostname" in
14715 '') aphostname='';;
14716 *) case "$aphostname" in
14718 *) set X $phostname
14722 file=`./loc $file $file $pth`
14723 aphostname=`echo $file $*`
14728 case "$d_uname$d_gethname" in
14731 case "$phostname" in
14733 echo "There will be no way for $package to get your hostname." >&4;;
14735 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14739 case "$d_phostname" in
14740 '') d_phostname="$undef";;
14743 : see if gethostbyaddr_r exists
14744 set gethostbyaddr_r d_gethostbyaddr_r
14746 case "$d_gethostbyaddr_r" in
14748 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14749 case "$d_gethostbyaddr_r_proto:$usethreads" in
14750 ":define") d_gethostbyaddr_r_proto=define
14751 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14755 case "$d_gethostbyaddr_r_proto" in
14757 case "$gethostbyaddr_r_proto" in
14758 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14759 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14761 case "$gethostbyaddr_r_proto" in
14762 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14763 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14765 case "$gethostbyaddr_r_proto" in
14766 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14767 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14769 case "$gethostbyaddr_r_proto" in
14770 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14771 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14773 case "$gethostbyaddr_r_proto" in
14774 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14775 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14777 case "$gethostbyaddr_r_proto" in
14778 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14779 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14781 case "$gethostbyaddr_r_proto" in
14782 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14783 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14785 case "$gethostbyaddr_r_proto" in
14786 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14787 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14789 case "$gethostbyaddr_r_proto" in
14790 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14791 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14793 case "$gethostbyaddr_r_proto" in
14794 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14795 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14797 case "$gethostbyaddr_r_proto" in
14798 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14799 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14801 case "$gethostbyaddr_r_proto" in
14802 ''|0) d_gethostbyaddr_r=undef
14803 gethostbyaddr_r_proto=0
14804 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14805 * ) case "$gethostbyaddr_r_proto" in
14806 REENTRANT_PROTO*) ;;
14807 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14809 echo "Prototype: $try" ;;
14812 *) case "$usethreads" in
14813 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14815 d_gethostbyaddr_r=undef
14816 gethostbyaddr_r_proto=0
14820 *) gethostbyaddr_r_proto=0
14824 : see if gethostbyname_r exists
14825 set gethostbyname_r d_gethostbyname_r
14827 case "$d_gethostbyname_r" in
14829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14830 case "$d_gethostbyname_r_proto:$usethreads" in
14831 ":define") d_gethostbyname_r_proto=define
14832 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14836 case "$d_gethostbyname_r_proto" in
14838 case "$gethostbyname_r_proto" in
14839 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14840 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14842 case "$gethostbyname_r_proto" in
14843 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14844 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14846 case "$gethostbyname_r_proto" in
14847 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14848 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14850 case "$gethostbyname_r_proto" in
14851 ''|0) d_gethostbyname_r=undef
14852 gethostbyname_r_proto=0
14853 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14854 * ) case "$gethostbyname_r_proto" in
14855 REENTRANT_PROTO*) ;;
14856 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14858 echo "Prototype: $try" ;;
14861 *) case "$usethreads" in
14862 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14864 d_gethostbyname_r=undef
14865 gethostbyname_r_proto=0
14869 *) gethostbyname_r_proto=0
14873 : see if gethostent_r exists
14874 set gethostent_r d_gethostent_r
14876 case "$d_gethostent_r" in
14878 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14879 case "$d_gethostent_r_proto:$usethreads" in
14880 ":define") d_gethostent_r_proto=define
14881 set d_gethostent_r_proto gethostent_r $hdrs
14885 case "$d_gethostent_r_proto" in
14887 case "$gethostent_r_proto" in
14888 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14889 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14891 case "$gethostent_r_proto" in
14892 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14893 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14895 case "$gethostent_r_proto" in
14896 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14897 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14899 case "$gethostent_r_proto" in
14900 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14901 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14903 case "$gethostent_r_proto" in
14904 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14905 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14907 case "$gethostent_r_proto" in
14908 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14909 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14911 case "$gethostent_r_proto" in
14912 ''|0) d_gethostent_r=undef
14913 gethostent_r_proto=0
14914 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14915 * ) case "$gethostent_r_proto" in
14916 REENTRANT_PROTO*) ;;
14917 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14919 echo "Prototype: $try" ;;
14922 *) case "$usethreads" in
14923 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14925 d_gethostent_r=undef
14926 gethostent_r_proto=0
14930 *) gethostent_r_proto=0
14934 : see if prototypes for various gethostxxx netdb.h functions are available
14936 set d_gethostprotos gethostent $i_netdb netdb.h
14939 : see if getitimer exists
14940 set getitimer d_getitimer
14943 : see if getlogin exists
14944 set getlogin d_getlogin
14947 : see if getlogin_r exists
14948 set getlogin_r d_getlogin_r
14950 case "$d_getlogin_r" in
14952 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14953 case "$d_getlogin_r_proto:$usethreads" in
14954 ":define") d_getlogin_r_proto=define
14955 set d_getlogin_r_proto getlogin_r $hdrs
14959 case "$d_getlogin_r_proto" in
14961 case "$getlogin_r_proto" in
14962 ''|0) try='int getlogin_r(char*, size_t);'
14963 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14965 case "$getlogin_r_proto" in
14966 ''|0) try='int getlogin_r(char*, int);'
14967 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14969 case "$getlogin_r_proto" in
14970 ''|0) try='char* getlogin_r(char*, size_t);'
14971 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14973 case "$getlogin_r_proto" in
14974 ''|0) try='char* getlogin_r(char*, int);'
14975 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14977 case "$getlogin_r_proto" in
14978 ''|0) d_getlogin_r=undef
14980 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14981 * ) case "$getlogin_r_proto" in
14982 REENTRANT_PROTO*) ;;
14983 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14985 echo "Prototype: $try" ;;
14988 *) case "$usethreads" in
14989 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14996 *) getlogin_r_proto=0
15000 : see if getmnt exists
15001 set getmnt d_getmnt
15004 : see if getmntent exists
15005 set getmntent d_getmntent
15008 : see if getnameinfo exists
15009 set getnameinfo d_getnameinfo
15012 : see if getnetbyaddr exists
15013 set getnetbyaddr d_getnbyaddr
15016 : see if getnetbyname exists
15017 set getnetbyname d_getnbyname
15020 : see if getnetent exists
15021 set getnetent d_getnent
15024 : see if getnetbyaddr_r exists
15025 set getnetbyaddr_r d_getnetbyaddr_r
15027 case "$d_getnetbyaddr_r" in
15029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15030 case "$d_getnetbyaddr_r_proto:$usethreads" in
15031 ":define") d_getnetbyaddr_r_proto=define
15032 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15036 case "$d_getnetbyaddr_r_proto" in
15038 case "$getnetbyaddr_r_proto" in
15039 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15040 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15042 case "$getnetbyaddr_r_proto" in
15043 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15044 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15046 case "$getnetbyaddr_r_proto" in
15047 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15048 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15050 case "$getnetbyaddr_r_proto" in
15051 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15052 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15054 case "$getnetbyaddr_r_proto" in
15055 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15056 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15058 case "$getnetbyaddr_r_proto" in
15059 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15060 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15062 case "$getnetbyaddr_r_proto" in
15063 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15064 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15066 case "$getnetbyaddr_r_proto" in
15067 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15068 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15070 case "$getnetbyaddr_r_proto" in
15071 ''|0) d_getnetbyaddr_r=undef
15072 getnetbyaddr_r_proto=0
15073 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15074 * ) case "$getnetbyaddr_r_proto" in
15075 REENTRANT_PROTO*) ;;
15076 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15078 echo "Prototype: $try" ;;
15081 *) case "$usethreads" in
15082 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15084 d_getnetbyaddr_r=undef
15085 getnetbyaddr_r_proto=0
15089 *) getnetbyaddr_r_proto=0
15093 : see if getnetbyname_r exists
15094 set getnetbyname_r d_getnetbyname_r
15096 case "$d_getnetbyname_r" in
15098 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15099 case "$d_getnetbyname_r_proto:$usethreads" in
15100 ":define") d_getnetbyname_r_proto=define
15101 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15105 case "$d_getnetbyname_r_proto" in
15107 case "$getnetbyname_r_proto" in
15108 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15109 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15111 case "$getnetbyname_r_proto" in
15112 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15113 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15115 case "$getnetbyname_r_proto" in
15116 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15117 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15119 case "$getnetbyname_r_proto" in
15120 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15121 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15123 case "$getnetbyname_r_proto" in
15124 ''|0) d_getnetbyname_r=undef
15125 getnetbyname_r_proto=0
15126 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15127 * ) case "$getnetbyname_r_proto" in
15128 REENTRANT_PROTO*) ;;
15129 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15131 echo "Prototype: $try" ;;
15134 *) case "$usethreads" in
15135 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15137 d_getnetbyname_r=undef
15138 getnetbyname_r_proto=0
15142 *) getnetbyname_r_proto=0
15146 : see if getnetent_r exists
15147 set getnetent_r d_getnetent_r
15149 case "$d_getnetent_r" in
15151 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15152 case "$d_getnetent_r_proto:$usethreads" in
15153 ":define") d_getnetent_r_proto=define
15154 set d_getnetent_r_proto getnetent_r $hdrs
15158 case "$d_getnetent_r_proto" in
15160 case "$getnetent_r_proto" in
15161 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15162 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15164 case "$getnetent_r_proto" in
15165 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15166 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15168 case "$getnetent_r_proto" in
15169 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15170 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15172 case "$getnetent_r_proto" in
15173 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15174 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15176 case "$getnetent_r_proto" in
15177 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15178 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15180 case "$getnetent_r_proto" in
15181 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15182 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15184 case "$getnetent_r_proto" in
15185 ''|0) d_getnetent_r=undef
15186 getnetent_r_proto=0
15187 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15188 * ) case "$getnetent_r_proto" in
15189 REENTRANT_PROTO*) ;;
15190 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15192 echo "Prototype: $try" ;;
15195 *) case "$usethreads" in
15196 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15198 d_getnetent_r=undef
15199 getnetent_r_proto=0
15203 *) getnetent_r_proto=0
15207 : see if prototypes for various getnetxxx netdb.h functions are available
15209 set d_getnetprotos getnetent $i_netdb netdb.h
15212 : see if getpagesize exists
15213 set getpagesize d_getpagsz
15216 : Optional checks for getprotobyname and getprotobynumber
15218 : see if getprotobyname exists
15219 set getprotobyname d_getpbyname
15222 : see if getprotobynumber exists
15223 set getprotobynumber d_getpbynumber
15226 : see if getprotoent exists
15227 set getprotoent d_getpent
15230 : see if getpgid exists
15231 set getpgid d_getpgid
15234 : see if getpgrp2 exists
15235 set getpgrp2 d_getpgrp2
15238 : see if getppid exists
15239 set getppid d_getppid
15242 : see if getpriority exists
15243 set getpriority d_getprior
15246 : see if getprotobyname_r exists
15247 set getprotobyname_r d_getprotobyname_r
15249 case "$d_getprotobyname_r" in
15251 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15252 case "$d_getprotobyname_r_proto:$usethreads" in
15253 ":define") d_getprotobyname_r_proto=define
15254 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15258 case "$d_getprotobyname_r_proto" in
15260 case "$getprotobyname_r_proto" in
15261 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15262 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15264 case "$getprotobyname_r_proto" in
15265 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15266 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15268 case "$getprotobyname_r_proto" in
15269 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15270 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15272 case "$getprotobyname_r_proto" in
15273 ''|0) d_getprotobyname_r=undef
15274 getprotobyname_r_proto=0
15275 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15276 * ) case "$getprotobyname_r_proto" in
15277 REENTRANT_PROTO*) ;;
15278 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15280 echo "Prototype: $try" ;;
15283 *) case "$usethreads" in
15284 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15286 d_getprotobyname_r=undef
15287 getprotobyname_r_proto=0
15291 *) getprotobyname_r_proto=0
15295 : see if getprotobynumber_r exists
15296 set getprotobynumber_r d_getprotobynumber_r
15298 case "$d_getprotobynumber_r" in
15300 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15301 case "$d_getprotobynumber_r_proto:$usethreads" in
15302 ":define") d_getprotobynumber_r_proto=define
15303 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15307 case "$d_getprotobynumber_r_proto" in
15309 case "$getprotobynumber_r_proto" in
15310 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15311 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15313 case "$getprotobynumber_r_proto" in
15314 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15315 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15317 case "$getprotobynumber_r_proto" in
15318 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15319 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15321 case "$getprotobynumber_r_proto" in
15322 ''|0) d_getprotobynumber_r=undef
15323 getprotobynumber_r_proto=0
15324 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15325 * ) case "$getprotobynumber_r_proto" in
15326 REENTRANT_PROTO*) ;;
15327 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15329 echo "Prototype: $try" ;;
15332 *) case "$usethreads" in
15333 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15335 d_getprotobynumber_r=undef
15336 getprotobynumber_r_proto=0
15340 *) getprotobynumber_r_proto=0
15344 : see if getprotoent_r exists
15345 set getprotoent_r d_getprotoent_r
15347 case "$d_getprotoent_r" in
15349 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15350 case "$d_getprotoent_r_proto:$usethreads" in
15351 ":define") d_getprotoent_r_proto=define
15352 set d_getprotoent_r_proto getprotoent_r $hdrs
15356 case "$d_getprotoent_r_proto" in
15358 case "$getprotoent_r_proto" in
15359 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15360 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15362 case "$getprotoent_r_proto" in
15363 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15364 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15366 case "$getprotoent_r_proto" in
15367 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15368 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15370 case "$getprotoent_r_proto" in
15371 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15372 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15374 case "$getprotoent_r_proto" in
15375 ''|0) d_getprotoent_r=undef
15376 getprotoent_r_proto=0
15377 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15378 * ) case "$getprotoent_r_proto" in
15379 REENTRANT_PROTO*) ;;
15380 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15382 echo "Prototype: $try" ;;
15385 *) case "$usethreads" in
15386 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15388 d_getprotoent_r=undef
15389 getprotoent_r_proto=0
15393 *) getprotoent_r_proto=0
15397 : see if prototypes for various getprotoxxx netdb.h functions are available
15399 set d_getprotoprotos getprotoent $i_netdb netdb.h
15402 : see if getprpwnam exists
15403 set getprpwnam d_getprpwnam
15406 : see if getpwent exists
15407 set getpwent d_getpwent
15410 : see if getpwent_r exists
15411 set getpwent_r d_getpwent_r
15413 case "$d_getpwent_r" in
15415 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15416 case "$d_getpwent_r_proto:$usethreads" in
15417 ":define") d_getpwent_r_proto=define
15418 set d_getpwent_r_proto getpwent_r $hdrs
15422 case "$d_getpwent_r_proto" in
15424 case "$getpwent_r_proto" in
15425 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15426 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15428 case "$getpwent_r_proto" in
15429 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15430 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15432 case "$getpwent_r_proto" in
15433 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15434 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15436 case "$getpwent_r_proto" in
15437 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15438 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15440 case "$getpwent_r_proto" in
15441 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15442 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15444 case "$getpwent_r_proto" in
15445 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15446 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15448 case "$getpwent_r_proto" in
15449 ''|0) d_getpwent_r=undef
15451 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15452 * ) case "$getpwent_r_proto" in
15453 REENTRANT_PROTO*) ;;
15454 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15456 echo "Prototype: $try" ;;
15459 *) case "$usethreads" in
15460 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15467 *) getpwent_r_proto=0
15471 : see if getpwnam_r exists
15472 set getpwnam_r d_getpwnam_r
15474 case "$d_getpwnam_r" in
15476 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15477 case "$d_getpwnam_r_proto:$usethreads" in
15478 ":define") d_getpwnam_r_proto=define
15479 set d_getpwnam_r_proto getpwnam_r $hdrs
15483 case "$d_getpwnam_r_proto" in
15485 case "$getpwnam_r_proto" in
15486 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15487 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15489 case "$getpwnam_r_proto" in
15490 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15491 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15493 case "$getpwnam_r_proto" in
15494 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15495 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15497 case "$getpwnam_r_proto" in
15498 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15499 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15501 case "$getpwnam_r_proto" in
15502 ''|0) d_getpwnam_r=undef
15504 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15505 * ) case "$getpwnam_r_proto" in
15506 REENTRANT_PROTO*) ;;
15507 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15509 echo "Prototype: $try" ;;
15512 *) case "$usethreads" in
15513 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15520 *) getpwnam_r_proto=0
15524 : see if getpwuid_r exists
15525 set getpwuid_r d_getpwuid_r
15527 case "$d_getpwuid_r" in
15529 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15530 case "$d_getpwuid_r_proto:$usethreads" in
15531 ":define") d_getpwuid_r_proto=define
15532 set d_getpwuid_r_proto getpwuid_r $hdrs
15536 case "$d_getpwuid_r_proto" in
15538 case "$getpwuid_r_proto" in
15539 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15540 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15542 case "$getpwuid_r_proto" in
15543 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15544 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15546 case "$getpwuid_r_proto" in
15547 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15548 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15550 case "$getpwuid_r_proto" in
15551 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15552 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15554 case "$getpwuid_r_proto" in
15555 ''|0) d_getpwuid_r=undef
15557 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15558 * ) case "$getpwuid_r_proto" in
15559 REENTRANT_PROTO*) ;;
15560 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15562 echo "Prototype: $try" ;;
15565 *) case "$usethreads" in
15566 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15573 *) getpwuid_r_proto=0
15577 : Optional checks for getsbyname and getsbyport
15579 : see if getservbyname exists
15580 set getservbyname d_getsbyname
15583 : see if getservbyport exists
15584 set getservbyport d_getsbyport
15587 : see if getservent exists
15588 set getservent d_getsent
15591 : see if getservbyname_r exists
15592 set getservbyname_r d_getservbyname_r
15594 case "$d_getservbyname_r" in
15596 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15597 case "$d_getservbyname_r_proto:$usethreads" in
15598 ":define") d_getservbyname_r_proto=define
15599 set d_getservbyname_r_proto getservbyname_r $hdrs
15603 case "$d_getservbyname_r_proto" in
15605 case "$getservbyname_r_proto" in
15606 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15607 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15609 case "$getservbyname_r_proto" in
15610 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15611 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15613 case "$getservbyname_r_proto" in
15614 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15615 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15617 case "$getservbyname_r_proto" in
15618 ''|0) d_getservbyname_r=undef
15619 getservbyname_r_proto=0
15620 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15621 * ) case "$getservbyname_r_proto" in
15622 REENTRANT_PROTO*) ;;
15623 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15625 echo "Prototype: $try" ;;
15628 *) case "$usethreads" in
15629 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15631 d_getservbyname_r=undef
15632 getservbyname_r_proto=0
15636 *) getservbyname_r_proto=0
15640 : see if getservbyport_r exists
15641 set getservbyport_r d_getservbyport_r
15643 case "$d_getservbyport_r" in
15645 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15646 case "$d_getservbyport_r_proto:$usethreads" in
15647 ":define") d_getservbyport_r_proto=define
15648 set d_getservbyport_r_proto getservbyport_r $hdrs
15652 case "$d_getservbyport_r_proto" in
15654 case "$getservbyport_r_proto" in
15655 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15656 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15658 case "$getservbyport_r_proto" in
15659 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15660 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15662 case "$getservbyport_r_proto" in
15663 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15664 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15666 case "$getservbyport_r_proto" in
15667 ''|0) d_getservbyport_r=undef
15668 getservbyport_r_proto=0
15669 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15670 * ) case "$getservbyport_r_proto" in
15671 REENTRANT_PROTO*) ;;
15672 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15674 echo "Prototype: $try" ;;
15677 *) case "$usethreads" in
15678 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15680 d_getservbyport_r=undef
15681 getservbyport_r_proto=0
15685 *) getservbyport_r_proto=0
15689 : see if getservent_r exists
15690 set getservent_r d_getservent_r
15692 case "$d_getservent_r" in
15694 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15695 case "$d_getservent_r_proto:$usethreads" in
15696 ":define") d_getservent_r_proto=define
15697 set d_getservent_r_proto getservent_r $hdrs
15701 case "$d_getservent_r_proto" in
15703 case "$getservent_r_proto" in
15704 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15705 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15707 case "$getservent_r_proto" in
15708 ''|0) try='int getservent_r(struct servent*, char*, int);'
15709 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15711 case "$getservent_r_proto" in
15712 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15713 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15715 case "$getservent_r_proto" in
15716 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15717 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15719 case "$getservent_r_proto" in
15720 ''|0) d_getservent_r=undef
15721 getservent_r_proto=0
15722 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15723 * ) case "$getservent_r_proto" in
15724 REENTRANT_PROTO*) ;;
15725 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15727 echo "Prototype: $try" ;;
15730 *) case "$usethreads" in
15731 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15733 d_getservent_r=undef
15734 getservent_r_proto=0
15738 *) getservent_r_proto=0
15742 : see if prototypes for various getservxxx netdb.h functions are available
15744 set d_getservprotos getservent $i_netdb netdb.h
15747 : see if getspnam exists
15748 set getspnam d_getspnam
15751 : see if this is a shadow.h system
15752 set shadow.h i_shadow
15755 : see if getspnam_r exists
15756 set getspnam_r d_getspnam_r
15758 case "$d_getspnam_r" in
15760 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15761 case "$d_getspnam_r_proto:$usethreads" in
15762 ":define") d_getspnam_r_proto=define
15763 set d_getspnam_r_proto getspnam_r $hdrs
15767 case "$d_getspnam_r_proto" in
15769 case "$getspnam_r_proto" in
15770 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15771 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15773 case "$getspnam_r_proto" in
15774 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15775 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15777 case "$getspnam_r_proto" in
15778 ''|0) d_getspnam_r=undef
15780 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15781 * ) case "$getspnam_r_proto" in
15782 REENTRANT_PROTO*) ;;
15783 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15785 echo "Prototype: $try" ;;
15788 *) case "$usethreads" in
15789 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15796 *) getspnam_r_proto=0
15800 : see if gettimeofday or ftime exists
15801 set gettimeofday d_gettimeod
15803 case "$d_gettimeod" in
15809 val="$undef"; set d_ftime; eval $setvar
15812 case "$d_gettimeod$d_ftime" in
15815 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15819 : see if gmtime_r exists
15820 set gmtime_r d_gmtime_r
15822 case "$d_gmtime_r" in
15824 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15825 case "$d_gmtime_r_proto:$usethreads" in
15826 ":define") d_gmtime_r_proto=define
15827 set d_gmtime_r_proto gmtime_r $hdrs
15831 case "$d_gmtime_r_proto" in
15833 case "$gmtime_r_proto" in
15834 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15835 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15837 case "$gmtime_r_proto" in
15838 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15839 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15841 case "$gmtime_r_proto" in
15842 ''|0) d_gmtime_r=undef
15844 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15845 * ) case "$gmtime_r_proto" in
15846 REENTRANT_PROTO*) ;;
15847 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15849 echo "Prototype: $try" ;;
15852 *) case "$usethreads" in
15853 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15860 *) gmtime_r_proto=0
15864 : see if hasmntopt exists
15865 set hasmntopt d_hasmntopt
15868 : see if this is a netinet/in.h or sys/in.h system
15869 set netinet/in.h i_niin sys/in.h i_sysin
15872 : see if arpa/inet.h has to be included
15873 set arpa/inet.h i_arpainet
15876 : see if htonl --and friends-- exists
15881 : Maybe they are macros.
15884 $cat >htonl.c <<EOM
15886 #include <sys/types.h>
15887 #$i_niin I_NETINET_IN
15889 #$i_arpainet I_ARPA_INET
15890 #ifdef I_NETINET_IN
15891 #include <netinet/in.h>
15894 #include <sys/in.h>
15897 #include <arpa/inet.h>
15900 printf("Defined as a macro.");
15903 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15904 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15906 echo "But it seems to be defined as a macro." >&4
15914 : see if hypot exists
15918 : see if ilogb exists
15922 : see if ilogbl exists
15923 set ilogbl d_ilogbl
15928 if set index val -f; eval $csym; $val; then
15929 if set strchr val -f d_strchr; eval $csym; $val; then
15930 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15933 echo "strchr() found." >&4
15937 echo "index() found." >&4
15942 echo "index() found." >&4
15945 if set strchr val -f d_strchr; eval $csym; $val; then
15948 echo "strchr() found." >&4
15950 echo "No index() or strchr() found!" >&4
15955 set d_strchr; eval $setvar
15957 set d_index; eval $setvar
15959 : check whether inet_aton exists
15960 set inet_aton d_inetaton
15963 : see if inet_ntop exists
15964 set inet_ntop d_inetntop
15967 : see if inet_pton exists
15968 set inet_pton d_inetpton
15973 $cat >isascii.c <<EOCP
15976 #$i_stdlib I_STDLIB
15978 #include <stdlib.h>
15989 if eval $compile; then
15990 echo "isascii() found." >&4
15993 echo "isascii() NOT found." >&4
16002 $cat >isblank.c <<'EOCP'
16013 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
16014 echo "isblank() found." >&4
16017 echo "isblank() NOT found." >&4
16024 : check for isfinite
16025 echo "Checking to see if you have isfinite..." >&4
16031 int main() { return isfinite(0.0); }
16034 if eval $compile; then
16036 echo "You have isfinite."
16039 echo "You do not have isfinite."
16045 : see if isfinitel exists
16046 set isfinitel d_isfinitel
16050 echo "Checking to see if you have isinf..." >&4
16056 int main() { return isinf(0.0); }
16059 if eval $compile; then
16061 echo "You have isinf."
16064 echo "You do not have isinf."
16070 : see if isinfl exists
16071 set isinfl d_isinfl
16075 echo "Checking to see if you have isless..." >&4
16081 int main() { return isless(0.0); }
16084 if eval $compile; then
16086 echo "You have isless."
16089 echo "You do not have isless."
16096 echo "Checking to see if you have isnan..." >&4
16102 int main() { return isnan(0.0); }
16105 if eval $compile; then
16107 echo "You have isnan."
16110 echo "You do not have isnan."
16116 : see if isnanl exists
16117 set isnanl d_isnanl
16120 : check for isnormal
16121 echo "Checking to see if you have isnormal..." >&4
16127 int main() { return isnormal(0.0); }
16130 if eval $compile; then
16132 echo "You have isnormal."
16135 echo "You do not have isnormal."
16145 : see if j0l exists
16149 : see if killpg exists
16150 set killpg d_killpg
16153 : see if localeconv exists
16154 set localeconv d_locconv
16157 : see if libc has the POSIX.1-2008 currency locale rules
16158 case "$d_locconv:$d_lc_monetary_2008" in
16161 #include <locale.h>
16163 struct lconv *lc = localeconv();
16164 char int_p_cs_precedes = lc->int_p_cs_precedes;
16169 if eval $compile; then
16170 d_lc_monetary_2008="$define"
16172 d_lc_monetary_2008="$undef"
16178 : see if lchown exists
16180 $cat > try.c <<'EOCP'
16181 /* System header to define __stub macros and hopefully few prototypes,
16182 which can conflict with char lchown(); below. */
16183 #include <assert.h>
16184 /* Override any gcc2 internal prototype to avoid an error. */
16185 /* We use char because int might match the return type of a gcc2
16186 builtin and then its argument prototype would still apply. */
16189 /* The GNU C library defines this for functions which it implements
16190 to always fail with ENOSYS. Some functions are actually named
16191 something starting with __ and the normal name is an alias. */
16192 #if defined (__stub_lchown) || defined (__stub___lchown)
16200 if eval $compile; then
16201 $echo "lchown() found." >&4
16204 $echo "lchown() NOT found." >&4
16210 : See if number of significant digits in a double precision number is known
16212 $cat >ldbl_dig.c <<EOM
16213 #$i_limits I_LIMITS
16216 #include <limits.h>
16222 printf("Contains LDBL_DIG");
16225 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16226 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16227 echo "LDBL_DIG found." >&4
16230 echo "LDBL_DIG NOT found." >&4
16237 : see if lgamma exists
16238 set lgamma d_lgamma
16241 : see if lgamma_r exists
16242 set lgamma_r d_lgamma_r
16245 : check to see if math.h defines _LIB_VERSION
16246 d_libm_lib_version="$undef"
16250 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16252 #include <unistd.h>
16254 int main (int argc, char *argv[])
16256 printf ("%d\n", _LIB_VERSION);
16261 if eval $compile; then
16263 echo "Yes, it does ($foo)" >&4
16264 d_libm_lib_version="$define"
16266 echo "No, it does not (probably harmless)" >&4
16273 : see if link exists
16277 : see if llrint exists
16278 set llrint d_llrint
16281 : see if llrintl exists
16282 set llrintl d_llrintl
16285 : see if llround exists
16286 set llround d_llround
16289 : see if llroundl exists
16290 set llroundl d_llroundl
16293 : see if localtime_r exists
16294 set localtime_r d_localtime_r
16296 case "$d_localtime_r" in
16298 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16299 case "$d_localtime_r_proto:$usethreads" in
16300 ":define") d_localtime_r_proto=define
16301 set d_localtime_r_proto localtime_r $hdrs
16305 case "$d_localtime_r_proto" in
16307 case "$localtime_r_proto" in
16308 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16309 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16311 case "$localtime_r_proto" in
16312 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16313 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16315 case "$localtime_r_proto" in
16316 ''|0) d_localtime_r=undef
16317 localtime_r_proto=0
16318 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16319 * ) case "$localtime_r_proto" in
16320 REENTRANT_PROTO*) ;;
16321 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16323 echo "Prototype: $try" ;;
16326 *) case "$usethreads" in
16327 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16329 d_localtime_r=undef
16330 localtime_r_proto=0
16334 *) localtime_r_proto=0
16338 : see if localtime_r calls tzset
16339 case "$localtime_r_proto" in
16342 /* Does our libc's localtime_r call tzset ?
16343 * return 0 if so, 1 otherwise.
16345 #$i_systypes I_SYS_TYPES
16346 #$i_unistd I_UNISTD
16348 #$i_stdlib I_STDLIB
16349 #$i_string I_STRING
16350 #$i_malloc I_MALLOC
16352 # include <sys/types.h>
16355 # include <unistd.h>
16361 #include <stdlib.h>
16364 # include <string.h>
16366 # include <strings.h>
16369 # include <malloc.h>
16373 time_t t = time(0L);
16374 char w_tz[]="TZ" "=GMT+5",
16375 e_tz[]="TZ" "=GMT-5",
16376 *tz_e = (char*)malloc(16),
16377 *tz_w = (char*)malloc(16);
16378 struct tm tm_e, tm_w;
16379 memset(&tm_e,'\0',sizeof(struct tm));
16380 memset(&tm_w,'\0',sizeof(struct tm));
16385 localtime_r(&t, &tm_e);
16388 localtime_r(&t, &tm_w);
16390 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16396 if eval $compile; then
16397 if $run ./try; then
16398 d_localtime_r_needs_tzset=undef;
16400 d_localtime_r_needs_tzset=define;
16403 d_localtime_r_needs_tzset=undef;
16407 d_localtime_r_needs_tzset=undef;
16412 : see if lockf exists
16416 : see if log1p exists
16420 : see if log2 exists
16424 : see if logb exists
16428 : see if lrint exists
16432 : see if lrintl exists
16433 set lrintl d_lrintl
16436 : see if lround exists
16437 set lround d_lround
16440 : see if lroundl exists
16441 set lroundl d_lroundl
16444 : see if prototype for lseek is available
16446 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16449 : see if lstat exists
16453 : see if madvise exists
16454 set madvise d_madvise
16457 : see if malloc_size exists
16458 set malloc_size d_malloc_size
16461 : see if malloc_size_good exists
16462 set malloc_good_size d_malloc_good_size
16465 : see if mblen exists
16469 : see if mbstowcs exists
16470 set mbstowcs d_mbstowcs
16473 : see if mbtowc exists
16474 set mbtowc d_mbtowc
16477 : see if memchr exists
16478 set memchr d_memchr
16481 : see if memcmp exists
16482 set memcmp d_memcmp
16485 : see if memcpy exists
16486 set memcpy d_memcpy
16489 : see if memmem exists
16490 set memmem d_memmem
16493 : see if memmove exists
16494 set memmove d_memmove
16497 : see if memset exists
16498 set memset d_memset
16501 : see if mkdir exists
16505 : see if mkdtemp exists
16506 set mkdtemp d_mkdtemp
16509 : see if mkfifo exists
16510 set mkfifo d_mkfifo
16513 : see if mkstemp exists
16514 set mkstemp d_mkstemp
16517 : see if mkstemps exists
16518 set mkstemps d_mkstemps
16521 : see if mktime exists
16522 set mktime d_mktime
16525 : see if this is a sys/mman.h system
16526 set sys/mman.h i_sysmman
16529 : see if mmap exists
16532 : see what shmat returns
16533 : default to something harmless
16535 case "$i_sysmman$d_mmap" in
16537 $cat >mmap.c <<'END'
16538 #include <sys/mman.h>
16541 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16546 echo "and it returns ($mmaptype)." >&4
16552 : see if sqrtl exists
16556 : see if scalbnl exists
16557 set scalbnl d_scalbnl
16560 : see if truncl exists
16561 set truncl d_truncl
16564 : see if modfl exists
16568 : see if prototype for modfl is available
16570 set d_modflproto modfl $i_math math.h
16573 if $test "$uselongdouble" = "$define"; then
16575 if $test "$d_sqrtl" != "$define"; then
16576 message="$message sqrtl"
16578 if $test "$d_modfl" != "$define"; then
16579 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16580 echo "You have both truncl and copysignl, so I can emulate modfl."
16582 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16583 echo "You have both aintl and copysignl, so I can emulate modfl."
16585 message="$message modfl"
16589 if $test "$d_frexpl" != "$define"; then
16590 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16591 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16593 message="$message frexpl"
16596 if $test "$d_ldexpl" != "$define"; then
16597 message="$message ldexpl"
16600 if $test "$message" != ""; then
16603 *** You requested the use of long doubles but you do not seem to have
16604 *** the following mathematical functions needed for long double support:
16606 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16607 *** Cannot continue, aborting.
16615 : see if mprotect exists
16616 set mprotect d_mprotect
16619 : see if msgctl exists
16620 set msgctl d_msgctl
16623 : see if msgget exists
16624 set msgget d_msgget
16627 : see if msgsnd exists
16628 set msgsnd d_msgsnd
16631 : see if msgrcv exists
16632 set msgrcv d_msgrcv
16635 : see how much of the 'msg*(2)' library is present.
16638 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16639 *"$undef"*) h_msg=false;;
16643 case "`ipcs 2>&1`" in
16644 "SVID messages"*"not configured"*)
16645 echo "Your $osname does not have the msg*(2) configured." >&4
16648 set msgctl d_msgctl
16650 set msgget d_msgget
16652 set msgsnd d_msgsnd
16654 set msgrcv d_msgrcv
16660 : we could also check for sys/ipc.h ...
16661 if $h_msg && $test `./findhdr sys/msg.h`; then
16662 echo "You have the full msg*(2) library." >&4
16665 echo "You don't have the full msg*(2) library." >&4
16671 : Check for msghdr_s
16673 echo "Checking to see if your system supports struct msghdr..." >&4
16674 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16676 case "$d_msghdr_s" in
16677 "$define") echo "Yes, it does." ;;
16678 *) echo "No, it doesn't." ;;
16682 : see if msync exists
16686 : see if munmap exists
16687 set munmap d_munmap
16690 : see if nan exists
16694 : see if nearbyint exists
16695 set nearbyint d_nearbyint
16698 : see if nextafter exists
16699 set nextafter d_nextafter
16702 : see if nexttoward exists
16703 set nexttoward d_nexttoward
16706 : see if nice exists
16710 : see if this is a langinfo.h system
16711 set langinfo.h i_langinfo
16714 : see if nl_langinfo exists
16715 set nl_langinfo d_nl_langinfo
16718 : see if this is a quadmath.h system
16719 set quadmath.h i_quadmath
16722 : check for volatile keyword
16724 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16725 $cat >try.c <<'EOCP'
16728 typedef struct _goo_struct goo_struct;
16729 goo_struct * volatile goo = ((goo_struct *)0);
16730 struct _goo_struct {
16735 typedef unsigned short foo_t;
16736 char *volatile foo;
16738 volatile foo_t blech;
16742 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16744 echo "Yup, it does."
16747 echo "Nope, it doesn't."
16753 : Check basic sizes
16755 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16757 case "$use64bitint:$d_quad:$quadtype" in
16760 uvtype="$uquadtype"
16765 uvtype="unsigned long"
16771 case "$uselongdouble:$d_longdbl" in
16773 nvtype="long double"
16774 nvsize=$longdblsize
16781 case "$usequadmath:$i_quadmath" in
16783 nvtype="__float128"
16789 *** You requested the use of the quadmath library, but you
16790 *** do not seem to have the quadmath library installed.
16791 *** Cannot continue, aborting.
16797 define:*) $cat <<EOM >&4
16799 *** You requested the use of the quadmath library, but you
16800 *** do not seem to have the required header, <quadmath.h>.
16802 case "$gccversion" in
16805 *** Your gcc looks a bit old:
16811 *** You are not running a gcc.
16816 *** For the quadmath library you need at least gcc 4.6.
16817 *** Cannot continue, aborting.
16823 $echo "(IV will be "$ivtype", $ivsize bytes)"
16824 $echo "(UV will be "$uvtype", $uvsize bytes)"
16825 $echo "(NV will be "$nvtype", $nvsize bytes)"
16828 #$i_inttypes I_INTTYPES
16830 #include <inttypes.h>
16835 int8_t i = INT8_MAX;
16836 uint8_t u = UINT8_MAX;
16837 printf("int8_t\n");
16840 int16_t i = INT16_MAX;
16841 uint16_t u = UINT16_MAX;
16842 printf("int16_t\n");
16845 int32_t i = INT32_MAX;
16846 uint32_t u = UINT32_MAX;
16847 printf("int32_t\n");
16852 i8type="signed char"
16853 u8type="unsigned char"
16858 '') case "$shortsize" in
16860 u16type="unsigned short"
16868 '') set try -DINT16
16869 if eval $compile; then
16870 case "`$run ./try`" in
16882 '') if $test $shortsize -ge 2; then
16884 u16type="unsigned short"
16892 '') case "$longsize" in
16894 u32type="unsigned long"
16898 *) case "$intsize" in
16900 u32type="unsigned int"
16910 '') set try -DINT32
16911 if eval $compile; then
16912 case "`$run ./try`" in
16924 '') if $test $intsize -ge 4; then
16926 u32type="unsigned int"
16934 '') case "$d_quad:$quadtype" in
16936 i64type="$quadtype"
16937 u64type="$uquadtype"
16945 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16946 : volatile so that the compiler has to store it out to memory.
16947 if test X"$d_volatile" = X"$define"; then
16952 #$i_stdlib I_STDLIB
16954 #include <stdlib.h>
16956 #include <sys/types.h>
16957 #include <signal.h>
16959 $volatile int bletched = 0;
16960 $signal_t blech(int s) { bletched = 1; }
16965 int n = 8 * $uvsize;
16968 signal(SIGFPE, blech);
16971 for (i = 0; i < n; i++) {
16972 u = u << 1 | ($uvtype)1;
16974 if (($uvtype)d != u)
16978 d = ($nvtype)(u - 1);
16979 if (($uvtype)d != (u - 1))
16986 printf("%d\n", ((i == n) ? -n : i));
16992 d_nv_preserves_uv="$undef"
16993 if eval $compile; then
16994 nv_preserves_uv_bits="`$run ./try`"
16996 case "$nv_preserves_uv_bits" in
16998 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16999 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
17000 d_nv_preserves_uv="$define"
17002 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
17003 d_nv_preserves_uv="$undef" ;;
17004 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
17005 nv_preserves_uv_bits="0" ;;
17009 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17010 : volatile so that the compiler has to store it out to memory.
17011 if test X"$d_volatile" = X"$define"; then
17017 typedef $nvtype NV;
17024 while(count < 256) {
17025 $volatile NV up = value + 1.0;
17026 $volatile NV negated = -value;
17027 $volatile NV down = negated - 1.0;
17028 $volatile NV got_up = up - value;
17029 int up_good = got_up == 1.0;
17030 int got_down = down - negated;
17031 int down_good = got_down == -1.0;
17033 if (down_good != up_good) {
17035 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17036 up_good, (double) got_up, down_good, (double) got_down,
17037 count, (double) value);
17044 fputs("256.0", stdout);
17047 fputs("2.0", stdout);
17053 fputs("*", stdout);
17059 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17060 count, (double) value);
17066 nv_overflows_integers_at='0'
17067 if eval $compile; then
17073 The largest integer your NVs can preserve is equal to $xxx
17075 nv_overflows_integers_at="$xxx"
17078 Cannot determine the largest integer value your NVs can hold, unexpected output
17085 Cannot determine the largest integer value your NVs can hold
17092 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17093 : volatile so that the compiler has to store it out to memory.
17094 if test X"$d_volatile" = X"$define"; then
17099 #$i_stdlib I_STDLIB
17101 #include <stdlib.h>
17103 #$i_string I_STRING
17105 # include <string.h>
17107 # include <strings.h>
17109 #include <sys/types.h>
17110 #include <signal.h>
17112 $volatile int bletched = 0;
17113 $signal_t blech(int s) { bletched = 1; }
17116 int checkit($nvtype d, char *where) {
17117 unsigned char *p = (char *)&d;
17118 unsigned char *end = p + sizeof(d);
17128 printf("No - %s: 0x", where);
17130 printf ("%02X", *p++);
17135 int main(int argc, char **argv) {
17138 fail += checkit(d, "0.0");
17140 /* The compiler shouldn't be assuming that bletched is 0 */
17143 fail += checkit(d, "bleched");
17146 signal(SIGFPE, blech);
17149 /* Paranoia - the compiler should have no way of knowing that ANSI says
17150 that argv[argc] will always be NULL. Actually, if it did assume this it
17151 would be buggy, as this is C and main() can be called from elsewhere in
17153 d = argv[argc] ? 1 : 0;
17156 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17159 fail += checkit(d, "ternary");
17161 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17164 printf("No - memset doesn't give 0.0\n");
17165 /* This might just blow up: */
17166 printf("(gives %g)\n", d);
17172 printf("No - something bleched\n");
17177 printf("No - %d fail(s)\n", fail);
17186 d_nv_zero_is_allbits_zero="$undef"
17187 if eval $compile; then
17193 0.0 is represented as all bits zero in memory
17195 d_nv_zero_is_allbits_zero="$define"
17198 0.0 is not represented as all bits zero in memory
17200 d_nv_zero_is_allbits_zero="$undef"
17205 0.0 is not represented as all bits zero in memory
17207 d_nv_zero_is_allbits_zero="$undef"
17213 : check for off64_t
17215 echo "Checking to see if you have off64_t..." >&4
17217 #include <sys/types.h>
17218 #include <unistd.h>
17219 int main() { off64_t x = 7; }
17222 if eval $compile; then
17224 echo "You have off64_t."
17227 echo "You do not have off64_t."
17228 case "$lseeksize" in
17229 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17236 : how to create joinable pthreads
17237 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17239 echo "Checking what constant to use for creating joinable pthreads..." >&4
17240 $cat >try.c <<'EOCP'
17241 #include <pthread.h>
17243 int detachstate = JOINABLE;
17246 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17247 if eval $compile; then
17248 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17249 val="$undef" # Yes, undef.
17250 set d_old_pthread_create_joinable
17253 set old_pthread_create_joinable
17256 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17257 if eval $compile; then
17258 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17260 set d_old_pthread_create_joinable
17262 val=PTHREAD_CREATE_UNDETACHED
17263 set old_pthread_create_joinable
17266 set try -DJOINABLE=__UNDETACHED
17267 if eval $compile; then
17268 echo "You seem to use __UNDETACHED." >&4
17270 set d_old_pthread_create_joinable
17273 set old_pthread_create_joinable
17276 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17278 set d_old_pthread_create_joinable
17281 set old_pthread_create_joinable
17288 d_old_pthread_create_joinable="$undef"
17289 old_pthread_create_joinable=""
17292 : see if pause exists
17296 : see if poll exists
17300 : see if prctl exists
17304 : see if prctl supports PR_SET_NAME
17305 d_prctl_set_name=$undef
17310 #include <unistd.h>
17312 #include <sys/prctl.h>
17314 int main (int argc, char *argv[])
17316 return (prctl (PR_SET_NAME, "Test"));
17320 if eval $compile_ok && $run ./try; then
17321 echo "Your prctl (PR_SET_NAME, ...) works"
17322 d_prctl_set_name=$define
17328 : see if readlink exists
17329 set readlink d_readlink
17332 : Check if there is a /proc symlink to the abs path of
17333 : the executing program. We will honor hints of d_procselfexe=$undef
17334 : or procselfexe being non-empty, otherwise will try to determine both
17335 : if we have readlink.
17336 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17337 : referenced, and AmigaOS does not have a proc filesystem anyway.
17340 if $test "X$d_procselfexe" = Xundef; then
17342 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17344 elif $test "X$d_readlink" = Xdefine; then
17345 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17346 : and it feels more tidy to avoid an extra level of symlink
17347 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17348 while test $# -gt 0; do
17351 if $issymlink $try; then
17352 $ls -l $try > reflect
17353 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17354 echo "You have $type-like $try."
17355 procselfexe='"'$try'"'
17357 : This will break out of the loop
17367 : backward compatibility for d_hvfork
17368 if test X$d_hvfork != X; then
17369 d_vfork="$d_hvfork"
17372 : see if there is a vfork
17377 d_pseudofork=$undef
17379 : Ok, but do we want to use it. vfork is reportedly unreliable in
17380 : perl on Solaris 2.x, and probably elsewhere.
17384 case "$usevfork" in
17390 Perl can only use a vfork() that doesn't suffer from strict
17391 restrictions on calling functions or modifying global data in
17392 the child. For example, glibc-2.1 contains such a vfork()
17393 that is unsuitable. If your system provides a proper fork()
17394 call, chances are that you do NOT want perl to use vfork().
17397 rp="Do you still want to use vfork()?"
17402 echo "Ok, we won't use vfork()."
17411 $define) usevfork='true';;
17412 *) usevfork='false';;
17415 : see whether the pthread_atfork exists
17417 #include <pthread.h>
17420 #ifdef PTHREAD_ATFORK
17421 pthread_atfork(NULL,NULL,NULL);
17426 : see if pthread_atfork exists
17427 set try -DPTHREAD_ATFORK
17428 if eval $compile; then
17433 case "$usethreads" in
17436 $define) echo 'pthread_atfork found.' >&4 ;;
17437 *) echo 'pthread_atfork NOT found.' >&4 ;;
17440 set d_pthread_atfork
17443 : see if pthread_attr_setscope exists
17444 set pthread_attr_setscope d_pthread_attr_setscope
17447 : see whether the various POSIXish _yields exist
17449 #include <pthread.h>
17455 #ifdef PTHREAD_YIELD
17458 #ifdef PTHREAD_YIELD_NULL
17459 pthread_yield(NULL);
17465 : see if sched_yield exists
17466 set try -DSCHED_YIELD
17467 if eval $compile; then
17469 sched_yield='sched_yield()'
17473 case "$usethreads" in
17476 $define) echo 'sched_yield() found.' >&4 ;;
17477 *) echo 'sched_yield() NOT found.' >&4 ;;
17483 : see if pthread_yield exists
17484 set try -DPTHREAD_YIELD
17485 if eval $compile; then
17487 case "$sched_yield" in
17488 '') sched_yield='pthread_yield()' ;;
17491 set try -DPTHREAD_YIELD_NULL
17492 if eval $compile; then
17494 case "$sched_yield" in
17495 '') sched_yield='pthread_yield(NULL)' ;;
17501 case "$usethreads" in
17504 $define) echo 'pthread_yield() found.' >&4 ;;
17505 *) echo 'pthread_yield() NOT found.' >&4 ;;
17509 set d_pthread_yield
17511 case "$sched_yield" in
17512 '') sched_yield=undef ;;
17516 : check for ptrdiff_t
17518 echo "Checking to see if you have ptrdiff_t..." >&4
17520 #include <stddef.h>
17521 int main() { ptrdiff_t x = 7; }
17524 if eval $compile; then
17526 echo "You have ptrdiff_t."
17529 echo "You do not have ptrdiff_t."
17535 : see if random_r exists
17536 set random_r d_random_r
17538 case "$d_random_r" in
17540 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17541 case "$d_random_r_proto:$usethreads" in
17542 ":define") d_random_r_proto=define
17543 set d_random_r_proto random_r $hdrs
17547 case "$d_random_r_proto" in
17549 case "$random_r_proto" in
17550 ''|0) try='int random_r(int*, struct random_data*);'
17551 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17553 case "$random_r_proto" in
17554 ''|0) try='int random_r(long*, struct random_data*);'
17555 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17557 case "$random_r_proto" in
17558 ''|0) try='int random_r(struct random_data*, int32_t*);'
17559 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17561 case "$random_r_proto" in
17562 ''|0) d_random_r=undef
17564 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17565 * ) case "$random_r_proto" in
17566 REENTRANT_PROTO*) ;;
17567 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17569 echo "Prototype: $try" ;;
17572 *) case "$usethreads" in
17573 define) echo "random_r has no prototype, not using it." >&4 ;;
17580 *) random_r_proto=0
17584 : see if readdir and friends exist
17585 set readdir d_readdir
17587 set seekdir d_seekdir
17589 set telldir d_telldir
17591 set rewinddir d_rewinddir
17594 : see if readdir64_r exists
17595 set readdir64_r d_readdir64_r
17597 case "$d_readdir64_r" in
17599 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17600 case "$d_readdir64_r_proto:$usethreads" in
17601 ":define") d_readdir64_r_proto=define
17602 set d_readdir64_r_proto readdir64_r $hdrs
17606 case "$d_readdir64_r_proto" in
17608 case "$readdir64_r_proto" in
17609 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17610 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17612 case "$readdir64_r_proto" in
17613 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17614 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17616 case "$readdir64_r_proto" in
17617 ''|0) d_readdir64_r=undef
17618 readdir64_r_proto=0
17619 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17620 * ) case "$readdir64_r_proto" in
17621 REENTRANT_PROTO*) ;;
17622 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17624 echo "Prototype: $try" ;;
17627 *) case "$usethreads" in
17628 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17630 d_readdir64_r=undef
17631 readdir64_r_proto=0
17635 *) readdir64_r_proto=0
17639 : see if readdir_r exists
17640 set readdir_r d_readdir_r
17642 case "$d_readdir_r" in
17644 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17645 case "$d_readdir_r_proto:$usethreads" in
17646 ":define") d_readdir_r_proto=define
17647 set d_readdir_r_proto readdir_r $hdrs
17651 case "$d_readdir_r_proto" in
17653 case "$readdir_r_proto" in
17654 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17655 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17657 case "$readdir_r_proto" in
17658 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17659 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17661 case "$readdir_r_proto" in
17662 ''|0) d_readdir_r=undef
17664 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17665 * ) case "$readdir_r_proto" in
17666 REENTRANT_PROTO*) ;;
17667 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17669 echo "Prototype: $try" ;;
17672 *) case "$usethreads" in
17673 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17680 *) readdir_r_proto=0
17684 : see if readv exists
17688 : see if recvmsg exists
17689 set recvmsg d_recvmsg
17692 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17694 if set regcomp val -f d_regcomp; eval $csym; $val; then
17695 echo 'regcomp() found.' >&4
17696 d_regcomp="$define"
17699 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17700 echo 'regcmp() found.' >&4
17704 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17705 echo 're_comp() found, assuming re_exec() also exists.' >&4
17706 d_re_comp="$define"
17711 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17718 : see if remainder exists
17719 set remainder d_remainder
17722 : see if remquo exists
17723 set remquo d_remquo
17726 : see if rename exists
17727 set rename d_rename
17730 : see if rint exists
17734 : see if rmdir exists
17738 : see if round exists
17742 : see if memory.h is available.
17747 : See if it conflicts with string.h
17753 $cppstdin $cppflags $cppminus < $strings > mem.h
17754 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17756 echo "We won't be including <memory.h>."
17766 : can bcopy handle overlapping blocks?
17769 case "$d_memmove" in
17770 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17771 *) case "$d_bcopy" in
17773 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17775 #$i_memory I_MEMORY
17776 #$i_stdlib I_STDLIB
17777 #$i_string I_STRING
17778 #$i_unistd I_UNISTD
17780 $cat >>try.c <<'EOCP'
17783 # include <memory.h>
17786 # include <stdlib.h>
17789 # include <string.h>
17791 # include <strings.h>
17794 # include <unistd.h> /* Needed for NetBSD */
17798 char buf[128], abc[128];
17804 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17805 try to store the string in read-only memory. */
17806 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17808 for (align = 7; align >= 0; align--) {
17809 for (len = 36; len; len--) {
17811 bcopy(abc, b, len);
17812 for (off = 1; off <= len; off++) {
17813 bcopy(b, b+off, len);
17814 bcopy(b+off, b, len);
17815 if (bcmp(b, abc, len))
17824 if eval $compile_ok; then
17825 if $run ./try 2>/dev/null; then
17826 echo "Yes, it can."
17829 echo "It can't, sorry."
17832 echo "(I can't compile the test program, so we'll assume not...)"
17842 : can memcpy handle overlapping blocks?
17845 case "$d_memmove" in
17846 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17847 *) case "$d_memcpy" in
17849 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17851 #$i_memory I_MEMORY
17852 #$i_stdlib I_STDLIB
17853 #$i_string I_STRING
17854 #$i_unistd I_UNISTD
17856 $cat >>try.c <<'EOCP'
17859 # include <memory.h>
17862 # include <stdlib.h>
17865 # include <string.h>
17867 # include <strings.h>
17870 # include <unistd.h> /* Needed for NetBSD */
17874 char buf[128], abc[128];
17880 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17881 try to store the string in read-only memory. */
17882 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17884 for (align = 7; align >= 0; align--) {
17885 for (len = 36; len; len--) {
17887 memcpy(b, abc, len);
17888 for (off = 1; off <= len; off++) {
17889 memcpy(b+off, b, len);
17890 memcpy(b, b+off, len);
17891 if (memcmp(b, abc, len))
17900 if eval $compile_ok; then
17901 if $run ./try 2>/dev/null; then
17902 echo "Yes, it can."
17905 echo "It can't, sorry."
17908 echo "(I can't compile the test program, so we'll assume not...)"
17918 : can memcmp be trusted to compare relative magnitude?
17920 case "$d_memcmp" in
17923 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17925 #$i_memory I_MEMORY
17926 #$i_stdlib I_STDLIB
17927 #$i_string I_STRING
17928 #$i_unistd I_UNISTD
17930 $cat >>try.c <<'EOCP'
17933 # include <memory.h>
17936 # include <stdlib.h>
17939 # include <string.h>
17941 # include <strings.h>
17944 # include <unistd.h> /* Needed for NetBSD */
17950 if ((a < b) && memcmp(&a, &b, 1) < 0)
17956 if eval $compile_ok; then
17957 if $run ./try 2>/dev/null; then
17958 echo "Yes, it can."
17961 echo "No, it can't (it uses signed chars)."
17964 echo "(I can't compile the test program, so we'll assume not...)"
17972 : see if prototype for sbrk is available
17974 set d_sbrkproto sbrk $i_unistd unistd.h
17977 : see if scalbn exists
17978 set scalbn d_scalbn
17981 : see if select exists
17982 set select d_select
17985 : see if semctl exists
17986 set semctl d_semctl
17989 : see if semget exists
17990 set semget d_semget
17993 : see if semop exists
17997 : see how much of the 'sem*(2)' library is present.
18000 case "$d_semctl$d_semget$d_semop" in
18001 *"$undef"*) h_sem=false;;
18005 case "`ipcs 2>&1`" in
18006 "SVID messages"*"not configured"*)
18007 echo "Your $osname does not have the sem*(2) configured." >&4
18010 set semctl d_semctl
18012 set semget d_semget
18020 : we could also check for sys/ipc.h ...
18021 if $h_sem && $test `./findhdr sys/sem.h`; then
18022 echo "You have the full sem*(2) library." >&4
18025 echo "You don't have the full sem*(2) library." >&4
18031 : see whether sys/sem.h defines union semun
18033 $cat > try.c <<'END'
18034 #include <sys/types.h>
18035 #include <sys/ipc.h>
18036 #include <sys/sem.h>
18037 int main () { union semun semun; semun.buf = 0; }
18040 if eval $compile; then
18041 echo "You have union semun in <sys/sem.h>." >&4
18044 echo "You do not have union semun in <sys/sem.h>." >&4
18051 : see how to do semctl IPC_STAT
18055 $cat > tryh.h <<END
18058 # define S_IRUSR S_IREAD
18059 # define S_IWUSR S_IWRITE
18060 # define S_IXUSR S_IEXEC
18062 # define S_IRUSR 0400
18063 # define S_IWUSR 0200
18064 # define S_IXUSR 0100
18066 # define S_IRGRP (S_IRUSR>>3)
18067 # define S_IWGRP (S_IWUSR>>3)
18068 # define S_IXGRP (S_IXUSR>>3)
18069 # define S_IROTH (S_IRUSR>>6)
18070 # define S_IWOTH (S_IWUSR>>6)
18071 # define S_IXOTH (S_IXUSR>>6)
18074 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18075 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18076 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18079 : see whether semctl IPC_STAT can use union semun
18080 case "$d_semctl_semun" in
18084 #include <sys/types.h>
18085 #include <sys/ipc.h>
18086 #include <sys/sem.h>
18087 #include <sys/stat.h>
18094 #$d_union_semun HAS_UNION_SEMUN
18097 #ifndef HAS_UNION_SEMUN
18100 struct semid_ds *buf;
18101 unsigned short *array;
18107 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18108 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18110 struct semid_ds argbuf;
18113 st = semctl(sem, 0, IPC_STAT, arg);
18117 # endif /* IPC_STAT */
18118 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18120 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18121 # endif /* IPC_RMID */
18122 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18124 #endif /* IPC_PRIVATE && ... */
18125 printf("semget failed: errno = %d\n", errno);
18130 if eval $compile; then
18133 semun) val="$define" ;;
18141 case "$d_semctl_semun" in
18143 echo "You can use union semun for semctl IPC_STAT." >&4
18146 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18151 : see whether semctl IPC_STAT can use struct semid_ds pointer
18152 case "$d_semctl_semid_ds" in
18155 $cat > try.c <<'END'
18156 #include <sys/types.h>
18157 #include <sys/ipc.h>
18158 #include <sys/sem.h>
18159 #include <sys/stat.h>
18167 struct semid_ds arg;
18170 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18171 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18174 st = semctl(sem, 0, IPC_STAT, &arg);
18176 printf("semid_ds\n");
18178 # endif /* IPC_STAT */
18179 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18181 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18182 # endif /* IPC_RMID */
18183 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18185 #endif /* IPC_PRIVATE && ... */
18186 printf("semget failed: errno = %d\n", errno);
18192 if eval $compile; then
18195 semid_ds) val="$define" ;;
18199 set d_semctl_semid_ds
18203 case "$d_semctl_semid_ds" in
18205 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18207 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18213 # We do not have the full sem*(2) library, so assume we can not
18219 set d_semctl_semid_ds
18225 : see if sendmsg exists
18226 set sendmsg d_sendmsg
18229 : see if setegid exists
18230 set setegid d_setegid
18233 : see if seteuid exists
18234 set seteuid d_seteuid
18237 : see if setgrent exists
18238 set setgrent d_setgrent
18241 : see if setgrent_r exists
18242 set setgrent_r d_setgrent_r
18244 case "$d_setgrent_r" in
18246 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18247 case "$d_setgrent_r_proto:$usethreads" in
18248 ":define") d_setgrent_r_proto=define
18249 set d_setgrent_r_proto setgrent_r $hdrs
18253 case "$d_setgrent_r_proto" in
18255 case "$setgrent_r_proto" in
18256 ''|0) try='int setgrent_r(FILE**);'
18257 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18259 case "$setgrent_r_proto" in
18260 ''|0) try='void setgrent_r(FILE**);'
18261 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18263 case "$setgrent_r_proto" in
18264 ''|0) d_setgrent_r=undef
18266 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18267 * ) case "$setgrent_r_proto" in
18268 REENTRANT_PROTO*) ;;
18269 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18271 echo "Prototype: $try" ;;
18274 *) case "$usethreads" in
18275 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18282 *) setgrent_r_proto=0
18286 : see if sethostent exists
18287 set sethostent d_sethent
18290 : see if sethostent_r exists
18291 set sethostent_r d_sethostent_r
18293 case "$d_sethostent_r" in
18295 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18296 case "$d_sethostent_r_proto:$usethreads" in
18297 ":define") d_sethostent_r_proto=define
18298 set d_sethostent_r_proto sethostent_r $hdrs
18302 case "$d_sethostent_r_proto" in
18304 case "$sethostent_r_proto" in
18305 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18306 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18308 case "$sethostent_r_proto" in
18309 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18310 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18312 case "$sethostent_r_proto" in
18313 ''|0) d_sethostent_r=undef
18314 sethostent_r_proto=0
18315 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18316 * ) case "$sethostent_r_proto" in
18317 REENTRANT_PROTO*) ;;
18318 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18320 echo "Prototype: $try" ;;
18323 *) case "$usethreads" in
18324 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18326 d_sethostent_r=undef
18327 sethostent_r_proto=0
18331 *) sethostent_r_proto=0
18335 : see if setitimer exists
18336 set setitimer d_setitimer
18339 : see if setlinebuf exists
18340 set setlinebuf d_setlinebuf
18343 : see if setlocale exists
18344 set setlocale d_setlocale
18347 : see if locale.h is available
18348 set locale.h i_locale
18351 : see if setlocale_r exists
18352 set setlocale_r d_setlocale_r
18354 case "$d_setlocale_r" in
18356 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18357 case "$d_setlocale_r_proto:$usethreads" in
18358 ":define") d_setlocale_r_proto=define
18359 set d_setlocale_r_proto setlocale_r $hdrs
18363 case "$d_setlocale_r_proto" in
18365 case "$setlocale_r_proto" in
18366 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18367 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18369 case "$setlocale_r_proto" in
18370 ''|0) d_setlocale_r=undef
18371 setlocale_r_proto=0
18372 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18373 * ) case "$setlocale_r_proto" in
18374 REENTRANT_PROTO*) ;;
18375 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18377 echo "Prototype: $try" ;;
18380 *) case "$usethreads" in
18381 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18383 d_setlocale_r=undef
18384 setlocale_r_proto=0
18388 *) setlocale_r_proto=0
18392 : see if setnetent exists
18393 set setnetent d_setnent
18396 : see if setnetent_r exists
18397 set setnetent_r d_setnetent_r
18399 case "$d_setnetent_r" in
18401 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18402 case "$d_setnetent_r_proto:$usethreads" in
18403 ":define") d_setnetent_r_proto=define
18404 set d_setnetent_r_proto setnetent_r $hdrs
18408 case "$d_setnetent_r_proto" in
18410 case "$setnetent_r_proto" in
18411 ''|0) try='int setnetent_r(int, struct netent_data*);'
18412 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18414 case "$setnetent_r_proto" in
18415 ''|0) try='void setnetent_r(int, struct netent_data*);'
18416 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18418 case "$setnetent_r_proto" in
18419 ''|0) d_setnetent_r=undef
18420 setnetent_r_proto=0
18421 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18422 * ) case "$setnetent_r_proto" in
18423 REENTRANT_PROTO*) ;;
18424 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18426 echo "Prototype: $try" ;;
18429 *) case "$usethreads" in
18430 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18432 d_setnetent_r=undef
18433 setnetent_r_proto=0
18437 *) setnetent_r_proto=0
18441 : see if setprotoent exists
18442 set setprotoent d_setpent
18445 : see if setpgid exists
18446 set setpgid d_setpgid
18449 : see if setpgrp2 exists
18450 set setpgrp2 d_setpgrp2
18453 : see if setpriority exists
18454 set setpriority d_setprior
18457 : see if setproctitle exists
18458 set setproctitle d_setproctitle
18461 : see if setprotoent_r exists
18462 set setprotoent_r d_setprotoent_r
18464 case "$d_setprotoent_r" in
18466 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18467 case "$d_setprotoent_r_proto:$usethreads" in
18468 ":define") d_setprotoent_r_proto=define
18469 set d_setprotoent_r_proto setprotoent_r $hdrs
18473 case "$d_setprotoent_r_proto" in
18475 case "$setprotoent_r_proto" in
18476 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18477 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18479 case "$setprotoent_r_proto" in
18480 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18481 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18483 case "$setprotoent_r_proto" in
18484 ''|0) d_setprotoent_r=undef
18485 setprotoent_r_proto=0
18486 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18487 * ) case "$setprotoent_r_proto" in
18488 REENTRANT_PROTO*) ;;
18489 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18491 echo "Prototype: $try" ;;
18494 *) case "$usethreads" in
18495 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18497 d_setprotoent_r=undef
18498 setprotoent_r_proto=0
18502 *) setprotoent_r_proto=0
18506 : see if setpwent exists
18507 set setpwent d_setpwent
18510 : see if setpwent_r exists
18511 set setpwent_r d_setpwent_r
18513 case "$d_setpwent_r" in
18515 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18516 case "$d_setpwent_r_proto:$usethreads" in
18517 ":define") d_setpwent_r_proto=define
18518 set d_setpwent_r_proto setpwent_r $hdrs
18522 case "$d_setpwent_r_proto" in
18524 case "$setpwent_r_proto" in
18525 ''|0) try='int setpwent_r(FILE**);'
18526 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18528 case "$setpwent_r_proto" in
18529 ''|0) try='void setpwent_r(FILE**);'
18530 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18532 case "$setpwent_r_proto" in
18533 ''|0) d_setpwent_r=undef
18535 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18536 * ) case "$setpwent_r_proto" in
18537 REENTRANT_PROTO*) ;;
18538 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18540 echo "Prototype: $try" ;;
18543 *) case "$usethreads" in
18544 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18551 *) setpwent_r_proto=0
18555 : see if setregid exists
18556 set setregid d_setregid
18558 set setresgid d_setresgid
18561 : see if setreuid exists
18562 set setreuid d_setreuid
18564 set setresuid d_setresuid
18567 : see if setrgid exists
18568 set setrgid d_setrgid
18571 : see if setruid exists
18572 set setruid d_setruid
18575 : see if setservent exists
18576 set setservent d_setsent
18579 : see if setservent_r exists
18580 set setservent_r d_setservent_r
18582 case "$d_setservent_r" in
18584 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18585 case "$d_setservent_r_proto:$usethreads" in
18586 ":define") d_setservent_r_proto=define
18587 set d_setservent_r_proto setservent_r $hdrs
18591 case "$d_setservent_r_proto" in
18593 case "$setservent_r_proto" in
18594 ''|0) try='int setservent_r(int, struct servent_data*);'
18595 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18597 case "$setservent_r_proto" in
18598 ''|0) try='void setservent_r(int, struct servent_data*);'
18599 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18601 case "$setservent_r_proto" in
18602 ''|0) d_setservent_r=undef
18603 setservent_r_proto=0
18604 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18605 * ) case "$setservent_r_proto" in
18606 REENTRANT_PROTO*) ;;
18607 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18609 echo "Prototype: $try" ;;
18612 *) case "$usethreads" in
18613 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18615 d_setservent_r=undef
18616 setservent_r_proto=0
18620 *) setservent_r_proto=0
18624 : see if setsid exists
18625 set setsid d_setsid
18628 : see if setvbuf exists
18629 set setvbuf d_setvbuf
18632 : see if shmctl exists
18633 set shmctl d_shmctl
18636 : see if shmget exists
18637 set shmget d_shmget
18640 : see if shmat exists
18643 : see what shmat returns
18646 $cat >shmat.c <<'END'
18647 #include <sys/shm.h>
18650 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18655 echo "and it returns ($shmattype)." >&4
18656 : see if a prototype for shmat is available
18657 xxx=`./findhdr sys/shm.h`
18658 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18659 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18670 set d_shmatprototype
18673 : see if shmdt exists
18677 : see how much of the 'shm*(2)' library is present.
18680 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18681 *"$undef"*) h_shm=false;;
18685 case "`ipcs 2>&1`" in
18686 "SVID shared memory"*"not configured"*)
18687 echo "Your $osname does not have the shm*(2) configured." >&4
18690 set shmctl d_shmctl
18692 set shmget d_shmget
18702 : we could also check for sys/ipc.h ...
18703 if $h_shm && $test `./findhdr sys/shm.h`; then
18704 echo "You have the full shm*(2) library." >&4
18707 echo "You don't have the full shm*(2) library." >&4
18713 : see if we have sigaction
18715 if set sigaction val -f d_sigaction; eval $csym; $val; then
18716 echo 'sigaction() found.' >&4
18719 #include <sys/types.h>
18720 #include <signal.h>
18721 #$i_stdlib I_STDLIB
18723 #include <stdlib.h>
18727 struct sigaction act, oact;
18729 oact.sa_handler = 0;
18730 /* so that act and oact are used */
18731 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18735 if eval $compile_ok; then
18738 echo "But you don't seem to have a usable struct sigaction." >&4
18742 echo 'sigaction NOT found.' >&4
18745 set d_sigaction; eval $setvar
18748 : see what type pids are declared as in the kernel
18749 rp="What is the type of process ids on this system?"
18750 set pid_t pidtype int stdio.h sys/types.h
18753 : see what type uids are declared as in the kernel
18755 echo "Looking for the type for user ids returned by getuid()."
18756 set uid_t uidtype xxx stdio.h sys/types.h
18760 xxx=`./findhdr sys/user.h`
18761 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18763 unsigned) dflt="$1 $2" ;;
18767 *) dflt="$uidtype";;
18770 uid_t) echo "uid_t found." ;;
18771 *) rp="What is the type for user ids returned by getuid()?"
18777 : Define hasfield_t macro for Configure internal use
18778 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18779 while $test $# -ge 2; do
18781 $define) echo "#include <$2>";;
18785 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18787 if eval $compile; then
18796 : see what siginfo fields we have
18797 case "$d_sigaction" in
18799 echo "Checking if your siginfo_t has si_errno field...">&4
18800 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18803 echo "Checking if your siginfo_t has si_pid field...">&4
18804 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18807 echo "Checking if your siginfo_t has si_uid field...">&4
18808 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18811 echo "Checking if your siginfo_t has si_addr field...">&4
18812 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18815 echo "Checking if your siginfo_t has si_status field...">&4
18816 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18819 echo "Checking if your siginfo_t has si_band field...">&4
18820 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18823 echo "Checking if your siginfo_t has si_value field...">&4
18824 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18827 echo "Checking if your siginfo_t has si_fd field...">&4
18828 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18833 d_siginfo_si_errno="$undef"
18834 d_siginfo_si_pid="$undef"
18835 d_siginfo_si_uid="$undef"
18836 d_siginfo_si_addr="$undef"
18837 d_siginfo_si_status="$undef"
18838 d_siginfo_si_band="$undef"
18839 d_siginfo_si_value="$undef"
18840 d_siginfo_si_fd="$undef"
18844 : see if this is a sunmath.h system
18845 set sunmath.h i_sunmath
18848 : see if signbit exists
18849 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18852 #$i_sunmath I_SUNMATH
18856 #ifdef I_SUNMATH /* Solaris special math library */
18857 # include <sunmath.h>
18860 int main(int argc, char **argv)
18864 if ((signbit(x) == 0) && (signbit(y) != 0))
18872 if eval $compile; then
18873 if $run ./try; then
18877 $echo "Signbit seems to be available, but doesn't work as I expected."
18878 $echo "I won't use it." >&4
18889 : see if sigprocmask exists
18890 set sigprocmask d_sigprocmask
18893 : see if sigsetjmp exists
18895 case "$d_sigsetjmp" in
18898 #include <setjmp.h>
18899 #$i_stdlib I_STDLIB
18901 #include <stdlib.h>
18907 if (sigsetjmp(env,1))
18910 siglongjmp(env, 1);
18915 if eval $compile; then
18916 if $run ./try >/dev/null 2>&1; then
18917 echo "POSIX sigsetjmp found." >&4
18921 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18927 echo "sigsetjmp not found." >&4
18931 *) val="$d_sigsetjmp"
18932 case "$d_sigsetjmp" in
18933 $define) echo "POSIX sigsetjmp found." >&4;;
18934 $undef) echo "sigsetjmp not found." >&4;;
18942 : see if snprintf exists
18943 set snprintf d_snprintf
18946 : see if vsnprintf exists
18947 set vsnprintf d_vsnprintf
18950 case "$d_snprintf-$d_vsnprintf" in
18953 Checking whether your snprintf() and vsnprintf() work okay...
18955 $cat >try.c <<'EOCP'
18956 /* v?snprintf testing logic courtesy of Russ Allbery.
18957 * According to C99:
18958 * - if the buffer is too short it still must be \0-terminated
18959 * - if the buffer is too short the potentially required length
18960 * must be returned and not -1
18961 * - if the buffer is NULL the potentially required length
18962 * must be returned and not -1 or core dump
18965 #include <stdarg.h>
18969 int test (char *format, ...)
18974 va_start (args, format);
18975 count = vsnprintf (buf, sizeof buf, format, args);
18982 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18983 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18987 if eval $compile; then
18990 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18992 Your snprintf() and snprintf() don't seem to be working okay.
18994 d_snprintf="$undef"
18995 d_vsnprintf="$undef"
18999 echo "(I can't seem to compile the test program--assuming they don't)"
19000 d_snprintf="$undef"
19001 d_vsnprintf="$undef"
19007 : see if sockatmark exists
19008 set sockatmark d_sockatmark
19011 : see if prototype for sockatmark is available
19013 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19016 : see if socks5_init exists
19017 set socks5_init d_socks5_init
19020 : see if sprintf returns the length of the string in the buffer as per ANSI
19021 $echo "Checking whether sprintf returns the length of the string..." >&4
19024 #$i_stdlib I_STDLIB
19026 #include <stdlib.h>
19028 #$i_string I_STRING
19030 # include <string.h>
19032 # include <strings.h>
19041 int check (size_t expect, int test) {
19042 size_t got = strlen(buffer);
19046 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
19051 int main(int argc, char **argv) {
19054 check(sprintf(buffer, ""), ++test);
19055 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
19056 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
19063 if eval $compile; then
19067 sprintf returns the length of the string (as ANSI says it should)
19069 d_sprintf_returns_strlen="$define"
19072 sprintf does not return the length of the string (how old is this system?)
19074 d_sprintf_returns_strlen="$undef"
19078 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
19079 d_sprintf_returns_strlen="$undef"
19083 : see if srand48_r exists
19084 set srand48_r d_srand48_r
19086 case "$d_srand48_r" in
19088 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19089 case "$d_srand48_r_proto:$usethreads" in
19090 ":define") d_srand48_r_proto=define
19091 set d_srand48_r_proto srand48_r $hdrs
19095 case "$d_srand48_r_proto" in
19097 case "$srand48_r_proto" in
19098 ''|0) try='int srand48_r(long, struct drand48_data*);'
19099 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19101 case "$srand48_r_proto" in
19102 ''|0) d_srand48_r=undef
19104 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19105 * ) case "$srand48_r_proto" in
19106 REENTRANT_PROTO*) ;;
19107 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19109 echo "Prototype: $try" ;;
19112 *) case "$usethreads" in
19113 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19120 *) srand48_r_proto=0
19124 : see if srandom_r exists
19125 set srandom_r d_srandom_r
19127 case "$d_srandom_r" in
19129 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19130 case "$d_srandom_r_proto:$usethreads" in
19131 ":define") d_srandom_r_proto=define
19132 set d_srandom_r_proto srandom_r $hdrs
19136 case "$d_srandom_r_proto" in
19138 case "$srandom_r_proto" in
19139 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19140 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19142 case "$srandom_r_proto" in
19143 ''|0) d_srandom_r=undef
19145 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19146 * ) case "$srandom_r_proto" in
19147 REENTRANT_PROTO*) ;;
19148 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19150 echo "Prototype: $try" ;;
19153 *) case "$usethreads" in
19154 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19161 *) srandom_r_proto=0
19165 : see if prototype for setresgid is available
19167 set d_sresgproto setresgid $i_unistd unistd.h
19170 : see if prototype for setresuid is available
19172 set d_sresuproto setresuid $i_unistd unistd.h
19175 : see if stat exists
19179 : see if sys/stat.h is available
19180 set sys/stat.h i_sysstat
19183 : see if stat knows about block sizes
19185 echo "Checking to see if your struct stat has st_blocks field..." >&4
19186 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19189 : see if this is a sys/vfs.h system
19190 set sys/vfs.h i_sysvfs
19193 : see if this is a sys/statfs.h system
19194 set sys/statfs.h i_sysstatfs
19197 : Check for statfs_s
19199 echo "Checking to see if your system supports struct statfs..." >&4
19200 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
19202 case "$d_statfs_s" in
19203 "$define") echo "Yes, it does." ;;
19204 *) echo "No, it doesn't." ;;
19208 : see if struct statfs knows about f_flags
19209 case "$d_statfs_s" in
19212 echo "Checking to see if your struct statfs has f_flags field..." >&4
19213 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
19217 set d_statfs_f_flags
19221 case "$d_statfs_f_flags" in
19222 "$define") echo "Yes, it does." ;;
19223 *) echo "No, it doesn't." ;;
19226 : see what flavor, if any, of static inline is supported
19228 echo "Checking to see if your system supports static inline..."
19229 $cat > try.c <<'EOCP'
19230 #include <stdlib.h>
19231 extern int f_via_a(int x);
19232 extern int f_via_b(int x);
19233 int main(int argc, char **argv)
19242 return EXIT_SUCCESS;
19245 return EXIT_FAILURE;
19249 $cat > a.c <<'EOCP'
19250 static INLINE int f(int x) {
19261 $cat > b.c <<'EOCP'
19262 extern int f(int x);
19270 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19271 case "$perl_static_inline" in
19272 '') # Check the various possibilities, and break out on success.
19273 # For gcc, prefer __inline__, which will still permit
19274 # cflags.SH to add in -ansi.
19275 case "$gccversion" in
19276 '') xxx="inline __inline__ __inline _inline";;
19277 *) xxx="__inline__ inline __inline _inline";;
19279 for inline in $xxx; do
19280 set try -DINLINE=$inline a.c
19281 if eval $compile && $run ./try; then
19282 # Now make sure there is no external linkage of static
19284 set try -DINLINE=$inline -DUSE_B a.c b.c
19285 if eval $compile && $run ./try; then
19286 $echo "Your compiler supports static $inline, " >&4
19287 $echo "but it also creates an external definition," >&4
19288 $echo "so I won't use it." >&4
19291 $echo "Your compiler supports static $inline." >&4
19293 perl_static_inline="static $inline";
19297 $echo "Your compiler does NOT support static $inline." >&4
19302 *inline*) # Some variant of inline exists.
19303 echo "Keeping your $hint value of $perl_static_inline."
19306 static) # No inline capabilities
19307 echo "Keeping your $hint value of $perl_static_inline."
19310 *) # Unrecognized previous value -- blindly trust the supplied
19311 # value and hope it makes sense. Use old value for
19312 # d_static_inline, if there is one.
19313 echo "Keeping your $hint value of $perl_static_inline."
19314 case "$d_static_inline" in
19316 *) val=$d_static_inline ;;
19320 # Fallback to plain 'static' if nothing worked.
19321 case "$perl_static_inline" in
19323 perl_static_inline="static"
19327 set d_static_inline
19329 $rm -f a.[co] b.[co]
19332 : Check stream access
19334 Checking how to access stdio streams by file descriptor number...
19336 case "$stdio_stream_array" in
19337 '') $cat >try.c <<EOCP
19340 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19344 for s in _iob __iob __sF
19346 set try -DSTDIO_STREAM_ARRAY=$s
19347 if eval $compile; then
19348 case "`$run ./try`" in
19349 yes) stdio_stream_array=$s; break ;;
19355 case "$stdio_stream_array" in
19357 I can't figure out how to access stdio streams by file descriptor number.
19359 d_stdio_stream_array="$undef"
19362 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19364 d_stdio_stream_array="$define"
19368 : see if strcoll exists
19369 set strcoll d_strcoll
19372 : check for structure copying
19374 echo "Checking to see if your C compiler can copy structs..." >&4
19375 $cat >try.c <<'EOCP'
19385 if $cc -c try.c >/dev/null 2>&1 ; then
19387 echo "Yup, it can."
19390 echo "Nope, it can't."
19396 : see if strerror and/or sys_errlist[] exist
19398 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19399 if set strerror val -f d_strerror; eval $csym; $val; then
19400 echo 'strerror() found.' >&4
19401 d_strerror="$define"
19402 d_strerrm='strerror(e)'
19403 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19404 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19405 d_syserrlst="$define"
19407 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19408 d_syserrlst="$undef"
19410 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19411 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19412 echo 'strerror() found in string header.' >&4
19413 d_strerror="$define"
19414 d_strerrm='strerror(e)'
19415 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19416 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19417 d_syserrlst="$define"
19419 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19420 d_syserrlst="$undef"
19422 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19423 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19424 d_strerror="$undef"
19425 d_syserrlst="$define"
19426 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19428 echo 'strerror() and sys_errlist[] NOT found.' >&4
19429 d_strerror="$undef"
19430 d_syserrlst="$undef"
19431 d_strerrm='"unknown"'
19435 : see if strerror_l exists
19436 set strerror_l d_strerror_l
19439 : see if strerror_r exists
19440 set strerror_r d_strerror_r
19442 case "$d_strerror_r" in
19444 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19445 case "$d_strerror_r_proto:$usethreads" in
19446 ":define") d_strerror_r_proto=define
19447 set d_strerror_r_proto strerror_r $hdrs
19451 case "$d_strerror_r_proto" in
19453 case "$strerror_r_proto" in
19454 ''|0) try='int strerror_r(int, char*, size_t);'
19455 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19457 case "$strerror_r_proto" in
19458 ''|0) try='int strerror_r(int, char*, int);'
19459 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19461 case "$strerror_r_proto" in
19462 ''|0) try='char* strerror_r(int, char*, size_t);'
19463 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19465 case "$strerror_r_proto" in
19466 ''|0) d_strerror_r=undef
19468 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19469 * ) case "$strerror_r_proto" in
19470 REENTRANT_PROTO*) ;;
19471 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19473 echo "Prototype: $try" ;;
19476 *) case "$usethreads" in
19477 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19484 *) strerror_r_proto=0
19488 : see if strftime exists
19489 set strftime d_strftime
19492 : see if strlcat exists
19493 set strlcat d_strlcat
19496 : see if strlcpy exists
19497 set strlcpy d_strlcpy
19500 : see if strtod exists
19501 set strtod d_strtod
19504 : see if strtol exists
19505 set strtol d_strtol
19508 : see if strtold exists
19509 set strtold d_strtold
19512 : see if strtoll exists
19513 set strtoll d_strtoll
19516 case "$d_longlong-$d_strtoll" in
19519 Checking whether your strtoll() works okay...
19521 $cat >try.c <<'EOCP'
19524 #define strtoll __strtoll
19527 #define strtoll _strtoll
19530 extern long long int strtoll(char *s, char **, int);
19531 static int bad = 0;
19532 int check(char *s, long long ell, int een) {
19535 gll = strtoll(s, 0, 10);
19536 if (!((gll == ell) && (errno == een)))
19540 check(" 1", 1LL, 0);
19541 check(" 0", 0LL, 0);
19542 check("-1", -1LL, 0);
19543 check("-9223372036854775808", -9223372036854775808LL, 0);
19544 check("-9223372036854775808", -9223372036854775808LL, 0);
19545 check(" 9223372036854775807", 9223372036854775807LL, 0);
19546 check("-9223372036854775808", -9223372036854775808LL, 0);
19547 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19548 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19554 if eval $compile; then
19557 ok) echo "Your strtoll() seems to be working okay." ;;
19559 Your strtoll() doesn't seem to be working okay.
19565 echo "(I can't seem to compile the test program--assuming it doesn't)"
19571 : see if strtoq exists
19572 set strtoq d_strtoq
19575 : see if strtoul exists
19576 set strtoul d_strtoul
19579 case "$d_strtoul" in
19582 Checking whether your strtoul() works okay...
19584 $cat >try.c <<'EOCP'
19587 extern unsigned long int strtoul(char *s, char **, int);
19588 static int bad = 0;
19589 void check(char *s, unsigned long eul, int een) {
19592 gul = strtoul(s, 0, 10);
19593 if (!((gul == eul) && (errno == een)))
19597 check(" 1", 1L, 0);
19598 check(" 0", 0L, 0);
19600 case "$longsize" in
19602 $cat >>try.c <<'EOCP'
19603 check("18446744073709551615", 18446744073709551615UL, 0);
19604 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19605 #if 0 /* strtoul() for /^-/ strings is undefined. */
19606 check("-1", 18446744073709551615UL, 0);
19607 check("-18446744073709551614", 2, 0);
19608 check("-18446744073709551615", 1, 0);
19609 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19610 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19615 $cat >>try.c <<'EOCP'
19616 check("4294967295", 4294967295UL, 0);
19617 check("4294967296", 4294967295UL, ERANGE);
19618 #if 0 /* strtoul() for /^-/ strings is undefined. */
19619 check("-1", 4294967295UL, 0);
19620 check("-4294967294", 2, 0);
19621 check("-4294967295", 1, 0);
19622 check("-4294967296", 4294967295UL, ERANGE);
19623 check("-4294967297", 4294967295UL, ERANGE);
19628 : Should we write these tests to be more portable by sprintf-ing
19629 : ~0 and then manipulating that char string as input for strtol?
19632 $cat >>try.c <<'EOCP'
19639 if eval $compile; then
19640 case "`$run ./try`" in
19641 ok) echo "Your strtoul() seems to be working okay." ;;
19643 Your strtoul() doesn't seem to be working okay.
19649 echo "(I can't seem to compile the test program--assuming it doesn't)"
19655 : see if strtoull exists
19656 set strtoull d_strtoull
19659 case "$d_longlong-$d_strtoull" in
19662 Checking whether your strtoull() works okay...
19664 $cat >try.c <<'EOCP'
19667 #define strtoull __strtoull
19670 extern unsigned long long int strtoull(char *s, char **, int);
19671 static int bad = 0;
19672 int check(char *s, long long eull, int een) {
19675 gull = strtoull(s, 0, 10);
19676 if (!((gull == eull) && (errno == een)))
19680 check(" 1", 1LL, 0);
19681 check(" 0", 0LL, 0);
19682 check("18446744073709551615", 18446744073709551615ULL, 0);
19683 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19684 #if 0 /* strtoull() for /^-/ strings is undefined. */
19685 check("-1", 18446744073709551615ULL, 0);
19686 check("-18446744073709551614", 2LL, 0);
19687 check("-18446744073709551615", 1LL, 0);
19688 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19689 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19696 if eval $compile; then
19697 case "`$run ./try`" in
19698 ok) echo "Your strtoull() seems to be working okay." ;;
19700 Your strtoull() doesn't seem to be working okay.
19702 d_strtoull="$undef"
19706 echo "(I can't seem to compile the test program--assuming it doesn't)"
19707 d_strtoull="$undef"
19712 : see if strtouq exists
19713 set strtouq d_strtouq
19716 case "$d_strtouq" in
19719 Checking whether your strtouq() works okay...
19721 $cat >try.c <<'EOCP'
19724 extern unsigned long long int strtouq(char *s, char **, int);
19725 static int bad = 0;
19726 void check(char *s, unsigned long long eull, int een) {
19727 unsigned long long gull;
19729 gull = strtouq(s, 0, 10);
19730 if (!((gull == eull) && (errno == een)))
19734 check(" 1", 1LL, 0);
19735 check(" 0", 0LL, 0);
19736 check("18446744073709551615", 18446744073709551615ULL, 0);
19737 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19738 #if 0 /* strtouq() for /^-/ strings is undefined. */
19739 check("-1", 18446744073709551615ULL, 0);
19740 check("-18446744073709551614", 2LL, 0);
19741 check("-18446744073709551615", 1LL, 0);
19742 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19743 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19751 if eval $compile; then
19752 case "`$run ./try`" in
19753 ok) echo "Your strtouq() seems to be working okay." ;;
19755 Your strtouq() doesn't seem to be working okay.
19761 echo "(I can't seem to compile the test program--assuming it doesn't)"
19767 : see if strxfrm exists
19768 set strxfrm d_strxfrm
19771 : see if symlink exists
19772 set symlink d_symlink
19775 : see if syscall exists
19776 set syscall d_syscall
19779 : see if prototype for syscall is available
19781 set d_syscallproto syscall $i_unistd unistd.h
19784 : see if sysconf exists
19785 set sysconf d_sysconf
19788 : see if system exists
19789 set system d_system
19792 : see if tcgetpgrp exists
19793 set tcgetpgrp d_tcgetpgrp
19796 : see if tcsetpgrp exists
19797 set tcsetpgrp d_tcsetpgrp
19800 : see if prototype for telldir is available
19802 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19805 : see if tgamma exists
19806 set tgamma d_tgamma
19809 : see if time exists
19811 if test "X$d_time" = X -o X"$timetype" = X; then
19812 if set time val -f d_time; eval $csym; $val; then
19813 echo 'time() found.' >&4
19815 rp="What is the type returned by time() on this system?"
19816 set time_t timetype long stdio.h sys/types.h
19819 echo 'time() not found, hope that will do.' >&4
19827 : see if timegm exists
19828 set timegm d_timegm
19831 : see if this is a sys/times.h system
19832 set sys/times.h i_systimes
19835 : see if times exists
19837 if set times val -f d_times; eval $csym; $val; then
19838 echo 'times() found.' >&4
19841 case "$i_systimes" in
19842 "$define") inc='sys/times.h';;
19844 rp="What is the type returned by times() on this system?"
19845 set clock_t clocktype long stdio.h sys/types.h $inc
19848 echo 'times() NOT found, hope that will do.' >&4
19853 : see if tmpnam_r exists
19854 set tmpnam_r d_tmpnam_r
19856 case "$d_tmpnam_r" in
19858 hdrs="$i_systypes sys/types.h define stdio.h "
19859 case "$d_tmpnam_r_proto:$usethreads" in
19860 ":define") d_tmpnam_r_proto=define
19861 set d_tmpnam_r_proto tmpnam_r $hdrs
19865 case "$d_tmpnam_r_proto" in
19867 case "$tmpnam_r_proto" in
19868 ''|0) try='char* tmpnam_r(char*);'
19869 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19871 case "$tmpnam_r_proto" in
19872 ''|0) d_tmpnam_r=undef
19874 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19875 * ) case "$tmpnam_r_proto" in
19876 REENTRANT_PROTO*) ;;
19877 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19879 echo "Prototype: $try" ;;
19882 *) case "$usethreads" in
19883 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19890 *) tmpnam_r_proto=0
19894 : see if trunc exists
19898 : see if truncate exists
19899 set truncate d_truncate
19902 : see if ttyname_r exists
19903 set ttyname_r d_ttyname_r
19905 case "$d_ttyname_r" in
19907 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19908 case "$d_ttyname_r_proto:$usethreads" in
19909 ":define") d_ttyname_r_proto=define
19910 set d_ttyname_r_proto ttyname_r $hdrs
19914 case "$d_ttyname_r_proto" in
19916 case "$ttyname_r_proto" in
19917 ''|0) try='int ttyname_r(int, char*, size_t);'
19918 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19920 case "$ttyname_r_proto" in
19921 ''|0) try='int ttyname_r(int, char*, int);'
19922 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19924 case "$ttyname_r_proto" in
19925 ''|0) try='char* ttyname_r(int, char*, int);'
19926 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19928 case "$ttyname_r_proto" in
19929 ''|0) d_ttyname_r=undef
19931 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19932 * ) case "$ttyname_r_proto" in
19933 REENTRANT_PROTO*) ;;
19934 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19936 echo "Prototype: $try" ;;
19939 *) case "$usethreads" in
19940 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19947 *) ttyname_r_proto=0
19951 : see if tzname[] exists
19953 if set tzname val -a d_tzname; eval $csym; $val; then
19955 echo 'tzname[] found.' >&4
19958 echo 'tzname[] NOT found.' >&4
19963 : Check if is a multiplatform env
19965 darwin) multiarch="$define" ;;
19967 case "$multiarch" in
19968 ''|[nN]*) multiarch="$undef" ;;
19971 : check for ordering of bytes in a UV
19973 case "$multiarch" in
19976 You seem to be doing a multiarchitecture build,
19977 skipping the byteorder check.
19983 case "$byteorder" in
19986 In the following, larger digits indicate more significance. A big-endian
19987 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19988 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19989 machines may have weird orders like 3412. A Cray will report 87654321,
19990 an Alpha will report 12345678. If the test program works the default is
19992 I'm now running the test program...
19996 #$i_stdlib I_STDLIB
19998 #include <stdlib.h>
20000 #include <sys/types.h>
20001 typedef $uvtype UV;
20011 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20013 u.l = (UV)0x04030201;
20014 for (i = 0; i < $uvsize; i++)
20015 printf("%c", u.c[i]+'0');
20022 if eval $compile && $run ./try > /dev/null; then
20025 [1-4][1-4][1-4][1-4]|12345678|87654321)
20026 echo "(The test program ran ok.)"
20027 echo "byteorder=$dflt"
20030 ????|????????) echo "(The test program ran ok.)" ;;
20031 *) echo "(The test program didn't run right for some reason.)" ;;
20036 (I can't seem to compile the test program. Guessing big-endian...)
20039 case "$xxx_prompt" in
20041 rp="What is the order of bytes in $uvtype?"
20054 : Checking 32bit alignedness
20057 Checking to see whether you can access character data unalignedly...
20059 case "$d_u32align" in
20060 '') $cat >try.c <<EOCP
20062 #$i_stdlib I_STDLIB
20064 #include <stdlib.h>
20066 #define U32 $u32type
20067 #define BYTEORDER 0x$byteorder
20069 #include <signal.h>
20071 $signal_t bletch(int s) { exit(4); }
20074 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20075 volatile U8 buf[8];
20079 if (sizeof(U32) != 4) {
20080 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20087 signal(SIGBUS, bletch);
20099 for (i = 0; i < 4; i++) {
20100 up = (U32*)(buf + i);
20101 if (! ((*up == 1 << (8*i)) || /* big-endian */
20102 (*up == 1 << (8*(3-i))) /* little-endian */
20106 printf("read failed (%x)\n", *up);
20112 for (i = 0; i < 4; i++) {
20113 up = (U32*)(buf + i);
20115 if (*up != 0xBeef) {
20116 printf("write failed (%x)\n", *up);
20130 if eval $compile_ok; then
20131 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20132 $run ./try 2>&1 >/dev/null
20135 You can access character data pretty unalignedly.
20137 d_u32align="$undef"
20140 It seems that you must access character data in an aligned manner.
20142 d_u32align="$define"
20146 rp='Can you access character data at unaligned addresses?'
20150 [yY]*) d_u32align="$undef" ;;
20151 *) d_u32align="$define" ;;
20158 : see if ualarm exists
20159 set ualarm d_ualarm
20162 : see if umask exists
20166 : see if unordered exists
20167 set unordered d_unordered
20170 : see if unsetenv exists
20171 set unsetenv d_unsetenv
20174 : see if usleep exists
20175 set usleep d_usleep
20178 : see if prototype for usleep is available
20180 set d_usleepproto usleep $i_unistd unistd.h
20183 : see if ustat exists
20187 : see if closedir exists
20188 set closedir d_closedir
20191 case "$d_closedir" in
20194 echo "Checking whether closedir() returns a status..." >&4
20196 #$i_dirent I_DIRENT /**/
20197 #$i_sysdir I_SYS_DIR /**/
20198 #$i_sysndir I_SYS_NDIR /**/
20199 #$i_systypes I_SYS_TYPES /**/
20201 #if defined(I_SYS_TYPES)
20202 #include <sys/types.h>
20204 #if defined(I_DIRENT)
20205 #include <dirent.h>
20208 #include <sys/ndir.h>
20212 #include <ndir.h> /* may be wrong in the future */
20214 #include <sys/dir.h>
20219 int main() { return closedir(opendir(".")); }
20222 if eval $compile_ok; then
20223 if $run ./try > /dev/null 2>&1 ; then
20224 echo "Yes, it does."
20227 echo "No, it doesn't."
20231 echo "(I can't seem to compile the test program--assuming it doesn't)"
20239 set d_void_closedir
20243 : see if there is a wait4
20247 : see if waitpid exists
20248 set waitpid d_waitpid
20253 $cat >try.c <<'EOCP'
20259 return (wcscmp (s, s) ? 1 : 0);
20264 if eval $compile; then
20267 0) echo "A working wcscmp() found." >&4
20269 *) echo "wcscmp() found, but it doesn't work" >&4
20273 echo "wcscmp() NOT found." >&4
20279 : see if wcstombs exists
20280 set wcstombs d_wcstombs
20285 $cat >try.c <<'EOCP'
20290 wchar_t dst[4], *src = L" ";
20292 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20297 if eval $compile; then
20300 0) echo "A working wcsxfrm() found." >&4
20302 *) echo "wcsxfrm() found, but it doesn't work" >&4
20306 echo "wcsxfrm() NOT found." >&4
20312 : see if wctomb exists
20313 set wctomb d_wctomb
20316 : see if writev exists
20317 set writev d_writev
20320 : check for alignment requirements
20322 case "$alignbytes" in
20323 '') echo "Checking alignment constraints..." >&4
20332 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20337 if eval $compile_ok; then
20341 echo "(I can't seem to compile the test program...)"
20343 case "$multiarch" in
20345 : The usual safe value is 8, but Darwin with -Duselongdouble
20346 : needs 16. Hence, we will take 8 as a minimum, but allow
20347 : Configure to pick a larger value if needed.
20348 if $test "$dflt" -lt 8; then
20350 echo "Setting alignment to 8 for multiarch support.">&4
20355 *) dflt="$alignbytes"
20358 rp="Doubles must be aligned on a how-many-byte boundary?"
20363 : set the base revision
20366 : length of character in bytes. Is always 1, otherwise it is not C
20367 : This used to be a test using sizeof
20370 : Check for the number of bits in a character
20371 case "$charbits" in
20372 '') echo "Checking how long a character is (in bits)..." >&4
20379 for (c = 1, n = 0; c; c <<= 1, n++) ;
20380 printf ("%d\n", n);
20385 if eval $compile_ok; then
20389 echo "(I can't seem to compile the test program. Guessing...)"
20396 rp="What is the length of a character (in bits)?"
20400 case "$charbits" in
20403 Your system has an unsigned character size of $charbits bits, which
20404 is rather unusual (normally it is 8 bits). Perl likely will not work
20405 correctly on your system, with subtle bugs in various places.
20407 rp='Do you really want to continue?'
20411 [yY]) echo >&4 "Okay, continuing." ;;
20416 : how do we concatenate cpp tokens here?
20418 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20419 $cat >cpp_stuff.c <<'EOCP'
20420 #define RCAT(a,b)a/**/b
20421 #define ACAT(a,b)a ## b
20425 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20426 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20427 echo "Oh! Smells like ANSI's been here." >&4
20428 echo "We can catify or stringify, separately or together!"
20430 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20431 echo "Ah, yes! The good old days!" >&4
20432 echo "However, in the good old days we don't know how to stringify and"
20433 echo "catify at the same time."
20437 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20438 You're going to have to edit the values of CAT[2-5] in config.h...
20440 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20444 : see if this is a db.h system
20450 : Check db version.
20452 echo "Checking Berkeley DB version ..." >&4
20458 #include <sys/types.h>
20460 #$i_stdlib I_STDLIB
20462 #include <stdlib.h>
20465 int main(int argc, char *argv[])
20467 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20468 int Major, Minor, Patch ;
20469 unsigned long Version ;
20470 (void)db_version(&Major, &Minor, &Patch) ;
20472 printf("%d %d %d %d %d %d\n",
20473 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20474 Major, Minor, Patch);
20477 printf("You have Berkeley DB Version 2 or greater.\n");
20479 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20480 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20481 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20482 Major, Minor, Patch) ;
20484 /* check that db.h & libdb are compatible */
20485 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20486 printf("db.h and libdb are incompatible.\n") ;
20490 printf("db.h and libdb are compatible.\n") ;
20492 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20493 + DB_VERSION_PATCH ;
20495 /* needs to be >= 2.3.4 */
20496 if (Version < 2003004) {
20497 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20498 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20504 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20509 printf("You have Berkeley DB Version 1.\n");
20510 exit(0); /* DB version < 2: the coast is clear. */
20512 exit(1); /* <db.h> not Berkeley DB? */
20518 if eval $compile_ok && $run ./try; then
20519 echo 'Looks OK.' >&4
20521 db_version_major=$1
20522 db_version_minor=$2
20523 db_version_patch=$3
20525 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20529 : Remove db from list of libraries to use
20530 echo "Removing unusable -ldb from library list" >&4
20531 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20534 echo "libs = $libs" >&4
20544 : Check the return type needed for hash
20546 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20552 #include <sys/types.h>
20555 #ifndef DB_VERSION_MAJOR
20556 u_int32_t hash_cb (const void* ptr, size_t size)
20562 info.hash = hash_cb;
20566 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20567 if $contains warning try.out >>/dev/null 2>&1 ; then
20570 db_hashtype='u_int32_t'
20573 : XXX Maybe we should just give up here.
20574 db_hashtype=u_int32_t
20576 echo "Help: I can't seem to compile the db test program." >&4
20577 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20580 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20582 *) db_hashtype=u_int32_t
20587 : Check the return type needed for prefix
20589 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20595 #include <sys/types.h>
20598 #ifndef DB_VERSION_MAJOR
20599 size_t prefix_cb (const DBT *key1, const DBT *key2)
20605 info.prefix = prefix_cb;
20609 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20610 if $contains warning try.out >>/dev/null 2>&1 ; then
20611 db_prefixtype='int'
20613 db_prefixtype='size_t'
20616 db_prefixtype='size_t'
20617 : XXX Maybe we should just give up here.
20619 echo "Help: I can't seem to compile the db test program." >&4
20620 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20623 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20625 *) db_prefixtype='size_t'
20629 : Include . in @INC
20632 Historically Perl has provided a final fallback of the current working
20633 directory '.' when searching for a library. This, however, can lead to
20634 problems when a Perl program which loads optional modules is called from
20635 a shared directory. This can lead to executing unexpected code.
20639 # When changing to exclude by default:
20640 #case "$default_inc_excludes_dot" in
20641 # $undef|false|[nN]*) dflt="n" ;;
20645 case "$default_inc_excludes_dot" in
20646 $define|true|[yY]*) dflt="y" ;;
20650 rp='Exclude '.' from @INC by default? '
20653 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20654 *) default_inc_excludes_dot="$define" ;;
20657 : Check what kind of inf/nan your system has
20658 $echo "Checking the kind of infinities and nans you have..." >&4
20659 $echo "(The following tests may crash. That's okay.)" >&4
20661 #define DOUBLESIZE $doublesize
20662 #$d_longdbl HAS_LONG_DOUBLE
20663 #ifdef HAS_LONG_DOUBLE
20664 #define LONG_DOUBLESIZE $longdblsize
20665 #define LONG_DOUBLEKIND $longdblkind
20672 /* Note that whether the sign bit is on or off
20673 * for NaN depends on the CPU/FPU, and possibly
20674 * can be affected by the build toolchain.
20676 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20677 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20678 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20679 * (respectively) as opposed to the more usual
20680 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20682 * Pre-IEEE-754 floating point format do not even have inf/nan support
20683 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20684 * to even mention, causing immediate SIGFPE or equivalent: this is
20685 * the case with VAX floating point, for example.
20687 static void bytes(unsigned char *p, unsigned int n) {
20689 for (i = 0; i < n; i++) {
20690 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20693 int main(int argc, char *argv[]) {
20694 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20695 * because some compilers are 'smart' and not only warn but refuse to
20696 * compile such 'illegal' values. */
20697 double dinf = exp(1e9);
20698 double dnan = sqrt(-1.0);
20699 #ifdef HAS_LONG_DOUBLE
20700 long double ldinf = (long double)exp(1e9);
20701 long double ldnan = (long double)sqrt(-1.0);
20702 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20703 /* the 80-bit long doubles might have garbage in their excess bytes */
20704 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20705 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20708 switch (argv[1][0]) {
20709 case '1': bytes(&dinf, sizeof(dinf)); break;
20710 case '2': bytes(&dnan, sizeof(dnan)); break;
20711 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20712 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20720 if eval $compile; then
20721 doubleinfbytes=`$run ./try 1`
20722 doublenanbytes=`$run ./try 2`
20723 case "$d_longdbl" in
20725 longdblinfbytes=`$run ./try 3`
20726 longdblnanbytes=`$run ./try 4`
20730 # Defaults in case the above test program failed.
20731 case "$doublekind" in
20732 1) # IEEE 754 32-bit LE
20733 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20734 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20736 2) # IEEE 754 32-bit BE
20737 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20738 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20740 3) # IEEE 754 64-bit LE
20741 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20742 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20744 4) # IEEE 754 64-bit BE
20745 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20746 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20748 5) # IEEE 754 128-bit LE
20749 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20750 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20752 6) # IEEE 754 128-bit BE
20753 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20754 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20756 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20757 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20758 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20760 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20761 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20762 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20764 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20765 doubleinfbytes=$undef
20766 doublenanbytes=$undef
20769 doubleinfbytes=$undef
20770 doublenanbytes=$undef
20773 case "$longdblkind" in
20774 1) # IEEE 754 128-bit LE
20775 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20776 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20778 2) # IEEE 754 128-bit BE
20779 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20780 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20782 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20783 case "$longdblsize" in
20784 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20785 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20786 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20789 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20790 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20793 longdblinfbytes=$undef
20794 longdblnanbytes=$undef
20798 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20799 case "$longdblsize" in
20800 12) # 32-bit system
20801 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20802 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20804 16) # 64-bit system
20805 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20806 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20809 longdblinfbytes=$undef
20810 longdblnanbytes=$undef
20814 5) # 128-bit LE-LE "double double"
20815 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20816 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20818 6) # 128-bit BE-BE "double double"
20819 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20820 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20822 7) # 128-bit LE-BE "double double"
20823 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20824 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20826 8) # 128-bit BE-LE "double double"
20827 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20828 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20830 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20831 longdblinfbytes=$undef
20832 longdblnanbytes=$undef
20835 longdblinfbytes=$undef
20836 longdblnanbytes=$undef
20840 # In case the program crashed the values are empty, turn them undef.
20841 case "$doubleinfbytes" in
20842 '') doubleinfbytes=$undef ;;
20844 case "$doublenanbytes" in
20845 '') doublenanbytes=$undef ;;
20847 case "$longdblinfbytes" in
20848 '') longdblinfbytes=$undef ;;
20850 case "$longdblnanbytes" in
20851 '') longdblnanbytes=$undef ;;
20855 : Check the length of the double mantissa
20856 $echo "Checking how many mantissa bits your doubles have..." >&4
20859 #$i_sunmath I_SUNMATH
20861 # include <float.h>
20864 # include <sunmath.h>
20866 #ifdef DBL_MANT_DIG
20867 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20870 int main(int argc, char *argv[]) {
20872 printf("%d\n", BITS);
20878 if eval $compile; then
20879 doublemantbits=`$run ./try`
20881 doublemantbits="$undef"
20885 : Check the length of the longdouble mantissa
20886 $echo "Checking how many mantissa bits your long doubles have..." >&4
20889 #$i_sunmath I_SUNMATH
20891 # include <float.h>
20894 # include <sunmath.h>
20896 #$d_longdbl HAS_LONG_DOUBLE
20897 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20898 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20899 /* This format has no implicit bit. Beware, however, that for
20900 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20901 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20902 * and the top bit must have been one since 387, zero is plain invalid.
20903 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20904 # define BITS LDBL_MANT_DIG
20905 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20906 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20907 * reason e.g. Irix thinks 107. But in any case, we want only
20908 * the number of real bits, the implicit bits are of no interest. */
20909 # define BITS 2 * (DBL_MANT_DIG - 1)
20911 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20915 int main(int argc, char *argv[]) {
20917 printf("%d\n", BITS);
20923 if eval $compile; then
20924 longdblmantbits=`$run ./try`
20926 longdblmantbits="$undef"
20930 : Check the length of the NV mantissa
20931 $echo "Checking how many mantissa bits your NVs have..." >&4
20932 if test "X$usequadmath" = "X$define"; then
20933 nvmantbits=112 # 128-1-15
20935 if test "X$nvsize" = "X$doublesize"; then
20936 nvmantbits="$doublemantbits"
20938 if test "X$nvsize" = "X$longdblsize"; then
20939 nvmantbits="$longdblmantbits"
20941 nvmantbits="$undef"
20946 : How can we generate normalized random numbers ?
20948 echo "Using our internal random number implementation..." >&4
20951 *-Dmy_rand=*|*-Dmy_srand=*)
20952 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20953 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20954 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20955 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20959 randfunc=Perl_drand48
20960 drand01="Perl_drand48()"
20961 seedfunc="Perl_drand48_init"
20965 : Probe whether dtrace builds an object, as newer Illumos requires an input
20966 : object file that uses at least one of the probes defined in the .d file
20967 case "$usedtrace" in
20969 case "$dtraceobject" in
20970 $define|true|[yY]*)
20971 dtraceobject=$define
20974 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20976 #include "perldtrace.h"
20978 PERL_LOADED_FILE("dummy");
20982 dtraceobject=$undef
20983 if $cc -c -o try.o $optimize $ccflags try.c \
20984 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
20985 dtraceobject=$define
20986 echo "Your dtrace builds an object file"
20988 $rm -f try.c try.o perldtrace.o
20990 *) dtraceobject=$undef ;;
20994 : Determine if this is an EBCDIC system
20996 echo "Determining whether or not we are on an EBCDIC system..." >&4
20997 $cat >try.c <<'EOM'
21000 if ('M'==0xd4) return 0;
21007 if eval $compile_ok; then
21008 if $run ./try; then
21009 echo "You seem to speak EBCDIC." >&4
21012 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21015 echo "I'm unable to compile the test program." >&4
21016 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21022 : Check how to flush
21025 Checking how to flush all pending stdio output...
21027 # I only know how to find the first 32 possibly open files on SunOS.
21028 # See also hints/sunos_4_1.sh and util.c --AD
21030 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21032 $cat >>try.c <<EOCP
21034 #$i_stdlib I_STDLIB
21036 #include <stdlib.h>
21038 #$i_unistd I_UNISTD
21040 # include <unistd.h>
21042 #$d_sysconf HAS_SYSCONF
21043 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21044 #ifdef HAS_STDIO_STREAM_ARRAY
21045 # define STDIO_STREAM_ARRAY $stdio_stream_array
21050 p = fopen("try.out", "w");
21054 # ifdef TRY_FPRINTF
21058 #ifdef TRY_FFLUSH_NULL
21061 #ifdef TRY_FFLUSH_ALL
21063 long open_max = -1;
21064 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21065 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21067 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21068 open_max = sysconf(_SC_OPEN_MAX);
21071 open_max = FOPEN_MAX;
21074 open_max = OPEN_MAX;
21083 # ifdef HAS_STDIO_STREAM_ARRAY
21084 if (open_max > 0) {
21086 for (i = 0; i < open_max; i++)
21087 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21088 STDIO_STREAM_ARRAY[i]._file < open_max &&
21089 STDIO_STREAM_ARRAY[i]._flag)
21090 fflush(&STDIO_STREAM_ARRAY[i]);
21098 : first we have to find out how _not_ to flush
21100 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21102 set try -DTRY_FPUTC
21103 if eval $compile; then
21104 $run ./try 2>/dev/null
21107 if $test ! -s try.out -a "X$code" = X42; then
21113 set try -DTRY_FPRINTF
21114 if eval $compile; then
21115 $run ./try 2>/dev/null
21118 if $test ! -s try.out -a "X$code" = X42; then
21119 output=-DTRY_FPRINTF
21125 : check for fflush NULL behavior
21126 case "$fflushNULL" in
21127 '') set try -DTRY_FFLUSH_NULL $output
21128 if eval $compile; then
21129 $run ./try 2>/dev/null
21132 if $test -s try.out -a "X$code" = X42; then
21133 fflushNULL="`$cat try.out`"
21135 if $test "X$code" != X42; then
21137 (If this test failed, don't worry, we'll try another method shortly.)
21142 $rm -f core try.core core.try.*
21143 case "$fflushNULL" in
21145 Your fflush(NULL) works okay for output streams.
21146 Let's see if it clobbers input pipes...
21148 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21149 # bug that improperly flushes the input end of pipes. So we avoid the
21150 # autoflush on fork/system/exec support for now. :-(
21151 $cat >tryp.c <<EOCP
21154 main(int argc, char **argv)
21160 while ((i = getc(stdin)) != -1
21161 && (*bp++ = i) != '\n'
21162 && bp < &buf[1024])
21165 fprintf(stdout, "%s", buf);
21173 fflushNULL="$define"
21175 if eval $compile; then
21177 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21178 if $test "X$targethost" != X; then
21181 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21183 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21185 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21187 fflush(NULL) seems to behave okay with input streams.
21189 fflushNULL="$define"
21192 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21194 fflushNULL="$undef"
21197 $rm -f core tryp.c tryp.core core.tryp.*
21200 Your fflush(NULL) isn't working (contrary to ANSI C).
21202 fflushNULL="$undef"
21205 Cannot figure out whether your fflush(NULL) works or not.
21206 I'm assuming it doesn't (contrary to ANSI C).
21208 fflushNULL="$undef"
21212 $define|true|[yY]*)
21213 fflushNULL="$define"
21216 fflushNULL="$undef"
21219 : check explicit looping only if NULL did not work, and if the pipe
21220 : bug does not show up on an explicit flush too
21221 case "$fflushNULL" in
21223 $cat >tryp.c <<EOCP
21226 main(int argc, char **argv)
21232 while ((i = getc(stdin)) != -1
21233 && (*bp++ = i) != '\n'
21234 && bp < &buf[1024])
21237 fprintf(stdout, "%s", buf);
21246 if eval $compile; then
21248 if $test "X$targethost" != X; then
21251 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21253 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21255 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21257 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21259 : now check for fflushall behaviour
21260 case "$fflushall" in
21261 '') set try -DTRY_FFLUSH_ALL $output
21262 if eval $compile; then
21264 (Now testing the other method--but note that this also may fail.)
21266 $run ./try 2>/dev/null
21269 if $test -s try.out -a "X$code" = X42; then
21270 fflushall="`$cat try.out`"
21274 case "$fflushall" in
21276 Whew. Flushing explicitly all the stdio streams works.
21278 fflushall="$define"
21281 Sigh. Flushing explicitly all the stdio streams doesn't work.
21286 Cannot figure out whether flushing stdio streams explicitly works or not.
21287 I'm assuming it doesn't.
21293 "$define"|true|[yY]*)
21294 fflushall="$define"
21302 All is futile. Even fflush(stdin) clobbers input pipes!
21309 $rm -f core tryp.c tryp.core core.tryp.*
21311 *) fflushall="$undef"
21315 case "$fflushNULL$fflushall" in
21318 OK, I give up. I cannot figure out how to flush pending stdio output.
21319 We won't be flushing handles at all before fork/exec/popen.
21325 : Store the full pathname to the ar program for use in the C program
21326 : Respect a hint or command line value for full_ar.
21331 : Store the full pathname to the sed program for use in the C program
21334 : see what type gids are declared as in the kernel
21336 echo "Looking for the type for group ids returned by getgid()."
21337 set gid_t gidtype xxx stdio.h sys/types.h
21341 xxx=`./findhdr sys/user.h`
21342 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21344 unsigned) dflt="$1 $2" ;;
21348 *) dflt="$gidtype";;
21351 gid_t) echo "gid_t found." ;;
21352 *) rp="What is the type for group ids returned by getgid()?"
21358 : Check the size of GID
21361 *_t) zzz="$gidtype" ;;
21364 echo "Checking the size of $zzz..." >&4
21366 #include <sys/types.h>
21368 #$i_stdlib I_STDLIB
21370 #include <stdlib.h>
21373 printf("%d\n", (int)sizeof($gidtype));
21378 if eval $compile_ok; then
21382 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21385 echo "Your $zzz is $gidsize bytes long."
21390 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21394 : Check if GID is signed
21397 *_t) zzz="$gidtype" ;;
21400 echo "Checking the sign of $zzz..." >&4
21402 #include <sys/types.h>
21413 if eval $compile; then
21417 echo "(I can't execute the test program--guessing unsigned.)" >&4
21421 1) echo "Your $zzz is unsigned." ;;
21422 -1) echo "Your $zzz is signed." ;;
21428 echo "(I can't compile the test program--guessing unsigned.)" >&4
21432 : Check 64bit sizes
21435 if $test X"$quadtype" != X; then
21437 echo "Checking how to print 64-bit integers..." >&4
21439 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21440 $cat >try.c <<'EOCP'
21441 #include <sys/types.h>
21444 int q = 12345678901;
21445 printf("%ld\n", q);
21449 if eval $compile; then
21453 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21454 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21455 echo "We will use %d."
21461 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21462 $cat >try.c <<'EOCP'
21463 #include <sys/types.h>
21466 long q = 12345678901;
21467 printf("%ld\n", q);
21471 if eval $compile; then
21475 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21476 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21477 echo "We will use %ld."
21483 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21484 $cat >try.c <<'EOCP'
21485 #include <sys/types.h>
21486 #include <inttypes.h>
21489 int64_t q = 12345678901;
21490 printf("%" PRId64 "\n", q);
21494 if eval $compile; then
21498 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21499 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21500 echo "We will use the C9X style."
21506 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21508 #include <sys/types.h>
21511 $quadtype q = 12345678901;
21512 printf("%Ld\n", q);
21516 if eval $compile; then
21520 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21521 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21522 echo "We will use %Ld."
21528 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21529 $cat >try.c <<'EOCP'
21530 #include <sys/types.h>
21533 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21534 printf("%lld\n", q);
21538 if eval $compile; then
21542 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21543 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21544 echo "We will use the %lld style."
21550 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21552 #include <sys/types.h>
21555 $quadtype q = 12345678901;
21556 printf("%qd\n", q);
21560 if eval $compile; then
21564 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21565 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21566 echo "We will use %qd."
21572 if $test X"$sPRId64" = X; then
21573 echo "Cannot figure out how to print 64-bit integers." >&4
21580 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21581 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21583 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21584 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21588 : Check format strings for internal types
21590 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21592 if $test X"$ivsize" = X8; then
21593 ivdformat="$sPRId64"
21594 uvuformat="$sPRIu64"
21595 uvoformat="$sPRIo64"
21596 uvxformat="$sPRIx64"
21597 uvXUformat="$sPRIXU64"
21599 if $test X"$ivsize" = X"$longsize"; then
21606 if $test X"$ivsize" = X"$intsize"; then
21614 if $test X"$ivsize" = X"$shortsize"; then
21625 if $test X"$usequadmath" = X"$define"; then
21633 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21634 nveformat="$sPRIeldbl"
21635 nvfformat="$sPRIfldbl"
21636 nvgformat="$sPRIgldbl"
21637 nvEUformat="$sPRIEUldbl"
21638 nvFUformat="$sPRIFUldbl"
21639 nvGUformat="$sPRIGUldbl"
21650 case "$ivdformat" in
21651 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21656 : Check format string for GID
21659 $echo "Checking the format string to be used for gids..." >&4
21662 -1) if $test X"$gidsize" = X"$ivsize"; then
21663 gidformat="$ivdformat"
21665 if $test X"$gidsize" = X"$longsize"; then
21668 if $test X"$gidsize" = X"$intsize"; then
21671 if $test X"$gidsize" = X"$shortsize"; then
21678 *) if $test X"$gidsize" = X"$uvsize"; then
21679 gidformat="$uvuformat"
21681 if $test X"$gidsize" = X"$longsize"; then
21684 if $test X"$gidsize" = X"$intsize"; then
21687 if $test X"$gidsize" = X"$shortsize"; then
21696 : see if getgroups exists
21697 set getgroups d_getgrps
21700 : see if setgroups exists
21701 set setgroups d_setgrps
21704 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21706 case "$d_getgrps$d_setgrps" in
21708 case "$groupstype" in
21709 '') dflt="$gidtype" ;;
21710 *) dflt="$groupstype" ;;
21713 What type of pointer is the second argument to getgroups() and setgroups()?
21714 Usually this is the same as group ids, $gidtype, but not always.
21717 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21721 *) groupstype="$gidtype";;
21724 : check whether make sets MAKE
21726 echo "Checking if your $make program sets \$(MAKE)..." >&4
21727 case "$make_set_make" in
21729 $sed 's/^X //' > testmake.mak << 'EOF'
21731 X @echo 'maketemp="$(MAKE)"'
21733 case "`$make -f testmake.mak 2>/dev/null`" in
21734 *maketemp=*) make_set_make='#' ;;
21735 *) make_set_make="MAKE=$make" ;;
21737 $rm -f testmake.mak
21740 case "$make_set_make" in
21741 '#') echo "Yup, it does.";;
21742 *) echo "Nope, it doesn't.";;
21745 : see what type is used for mode_t
21746 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21747 set mode_t modetype int stdio.h sys/types.h
21750 : see if we need va_copy
21752 case "$i_stdarg" in
21755 #include <stdarg.h>
21757 #$i_stdlib I_STDLIB
21759 #include <stdlib.h>
21761 #include <signal.h>
21764 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21766 return vfprintf(f, fmt, *valp);
21770 myvfprintf(FILE *f, const char *fmt, va_list val)
21772 return ivfprintf(f, fmt, &val);
21776 myprintf(char *fmt, ...)
21779 va_start(val, fmt);
21780 return myvfprintf(stdout, fmt, val);
21784 main(int ac, char **av)
21786 signal(SIGSEGV, exit);
21788 myprintf("%s%cs all right, then\n", "that", '\'');
21793 if eval $compile && $run ./try 2>&1 >/dev/null; then
21794 case "`$run ./try`" in
21795 "that's all right, then")
21801 yes) echo "It seems that you don't need va_copy()." >&4
21802 need_va_copy="$undef"
21804 *) echo "It seems that va_copy() or similar will be needed." >&4
21805 need_va_copy="$define"
21810 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21811 need_va_copy="$undef"
21815 : see what type is used for size_t
21816 rp="What is the type used for the length parameter for string functions?"
21817 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21820 : check for type of arguments to gethostbyaddr.
21821 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21822 case "$d_gethbyaddr" in
21826 Checking to see what type of arguments are accepted by gethostbyaddr().
21828 hdrs="$define sys/types.h
21829 $d_socket sys/socket.h
21830 $i_niin netinet/in.h
21832 $i_unistd unistd.h"
21833 : The first arg can 'char *' or 'void *'
21834 : The second arg is some of integral type
21835 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21836 for yyy in size_t long int; do
21837 case "$netdb_host_type" in
21838 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21839 if ./protochk "$try" $hdrs; then
21840 echo "Your system accepts $xxx for the first arg."
21841 echo "...and $yyy for the second arg."
21842 netdb_host_type="$xxx"
21843 netdb_hlen_type="$yyy"
21849 : In case none of those worked, prompt the user.
21850 case "$netdb_host_type" in
21851 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21854 netdb_host_type=$ans
21855 rp='What is the type for the 2nd argument to gethostbyaddr?'
21858 netdb_hlen_type=$ans
21862 *) : no gethostbyaddr, so pick harmless defaults
21863 netdb_host_type='char *'
21864 netdb_hlen_type="$sizetype"
21867 # Remove the "const" if needed. -- but then we'll have a
21869 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21872 : check for type of argument to gethostbyname.
21873 if test "X$netdb_name_type" = X ; then
21874 case "$d_gethbyname" in
21878 Checking to see what type of argument is accepted by gethostbyname().
21880 hdrs="$define sys/types.h
21881 $d_socket sys/socket.h
21882 $i_niin netinet/in.h
21884 $i_unistd unistd.h"
21885 for xxx in "const char *" "char *"; do
21886 case "$netdb_name_type" in
21887 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21888 if ./protochk "$try" $hdrs; then
21889 echo "Your system accepts $xxx."
21890 netdb_name_type="$xxx"
21895 : In case none of those worked, prompt the user.
21896 case "$netdb_name_type" in
21897 '') rp='What is the type for the 1st argument to gethostbyname?'
21900 netdb_name_type=$ans
21904 *) : no gethostbyname, so pick harmless default
21905 netdb_name_type='char *'
21910 : check for type of 1st argument to getnetbyaddr.
21911 if test "X$netdb_net_type" = X ; then
21912 case "$d_getnbyaddr" in
21916 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21918 hdrs="$define sys/types.h
21919 $d_socket sys/socket.h
21920 $i_niin netinet/in.h
21922 $i_unistd unistd.h"
21923 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21924 case "$netdb_net_type" in
21925 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21926 if ./protochk "$try" $hdrs; then
21927 echo "Your system accepts $xxx."
21928 netdb_net_type="$xxx"
21933 : In case none of those worked, prompt the user.
21934 case "$netdb_net_type" in
21935 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21938 netdb_net_type=$ans
21942 *) : no getnetbyaddr, so pick harmless default
21943 netdb_net_type='long'
21947 : locate the preferred pager for this system
21954 [a-zA-Z]:/*) dflt=$pg;;
21958 [a-zA-Z]:/*) dflt=$more;;
21962 [a-zA-Z]:/*) dflt=$less;;
21965 '') dflt=/usr/ucb/more;;
21973 rp='What pager is used on your system?'
21977 : see if ar generates random libraries by itself
21979 echo "Checking how to generate random libraries on your machine..." >&4
21980 echo 'int bar1() { return bar2(); }' > bar1.c
21981 echo 'int bar2() { return 2; }' > bar2.c
21983 #$i_stdlib I_STDLIB
21985 #include <stdlib.h>
21987 int main() { printf("%d\n", bar1()); exit(0); }
21989 $cc $ccflags -c bar1.c >/dev/null 2>&1
21990 $cc $ccflags -c bar2.c >/dev/null 2>&1
21991 $cc $ccflags -c foo.c >/dev/null 2>&1
21992 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21993 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21994 $run ./foobar >/dev/null 2>&1; then
21995 echo "$ar appears to generate random libraries itself."
21997 if [ "X$ranlib" = "X" ]; then
22000 elif $ar s bar$_a >/dev/null 2>&1 &&
22001 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22002 $run ./foobar >/dev/null 2>&1; then
22003 echo "a table of contents needs to be added with '$ar s'."
22006 elif $ar ts bar$_a >/dev/null 2>&1 &&
22007 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22008 $run ./foobar >/dev/null 2>&1; then
22009 echo "a table of contents needs to be added with '$ar ts'."
22016 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22017 $test -f $ranlib || ranlib=''
22020 if $test -n "$ranlib"; then
22021 echo "your system has '$ranlib'; we'll use that."
22024 echo "your system doesn't seem to support random libraries"
22025 echo "so we'll use lorder and tsort to order the libraries."
22032 : see if this is a values.h system
22033 set values.h i_values
22036 : Check the max offset that gmtime and localtime accept
22037 echo "Checking max offsets that gmtime () accepts"
22040 define) yyy="#include <values.h>" ;;
22044 case "$sGMTIME_min/$sGMTIME_max" in
22047 #include <sys/types.h>
22056 void gm_check (time_t t, int min_year, int max_year)
22059 if ( tmp == NULL ||
22060 /* Check tm_year overflow */
22061 tmp->tm_year < min_year || tmp->tm_year > max_year)
22072 gm_check (MAXLONG, 69, 0x7fffffff);
22074 if (tmp == NULL || tmp->tm_year < 0) {
22075 for (i = 63; i >= 0; i--) {
22076 time_t x = pt | ((time_t)1 << i);
22077 if (x < 0 || x < pt) continue;
22078 gm_check (x, 69, 0x7fffffff);
22081 printf ("sGMTIME_max=%ld\n", pt);
22090 gm_check (MINLONG, -1900, 70);
22093 for (i = 36; i >= 0; i--) {
22094 time_t x = pt - ((time_t)1 << i);
22095 if (x > 0) continue;
22096 gm_check (x, -1900, 70);
22099 printf ("sGMTIME_min=%ld\n", pt);
22103 int main (int argc, char *argv[])
22105 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22112 if eval $compile; then
22113 eval `$run ./try 2>/dev/null`
22115 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22121 echo "Checking max offsets that localtime () accepts"
22123 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22126 #include <sys/types.h>
22135 void local_check (time_t t, int min_year, int max_year)
22137 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22140 tmp = localtime (&t);
22141 if ( tmp == NULL ||
22142 /* Check tm_year overflow */
22143 tmp->tm_year < min_year || tmp->tm_year > max_year)
22147 } /* local_check */
22154 local_check (MAXLONG, 69, 0x7fffffff);
22156 if (tmp == NULL || tmp->tm_year < 0) {
22157 for (i = 63; i >= 0; i--) {
22158 time_t x = pt | ((time_t)1 << i);
22159 if (x < 0 || x < pt) continue;
22160 local_check (x, 69, 0x7fffffff);
22163 printf ("sLOCALTIME_max=%ld\n", pt);
22172 local_check (MINLONG, -1900, 70);
22175 for (i = 36; i >= 0; i--) {
22176 time_t x = pt - ((time_t)1 << i);
22177 if (x > 0) continue;
22178 local_check (x, -1900, 70);
22181 printf ("sLOCALTIME_min=%ld\n", pt);
22185 int main (int argc, char *argv[])
22193 if eval $compile; then
22194 eval `$run ./try 2>/dev/null`
22196 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22202 : check for type of arguments to select.
22203 case "$selecttype" in
22204 '') case "$d_select" in
22208 Checking to see what type of arguments are accepted by select().
22210 hdrs="$define sys/types.h
22211 $i_systime sys/time.h
22212 $i_sysselct sys/select.h
22213 $d_socket sys/socket.h"
22214 : The first arg can be int, unsigned, or size_t
22215 : The last arg may or may not be 'const'
22217 : void pointer has been seen but using that
22218 : breaks the selectminbits test
22219 for xxx in 'fd_set *' 'int *'; do
22220 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22221 for tmo in 'struct timeval *' 'const struct timeval *'; do
22223 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22224 if ./protochk "$try" $hdrs; then
22225 echo "Your system accepts $xxx."
22234 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22235 case "$d_fd_set" in
22236 $define) dflt="fd_set *" ;;
22245 *) : no select, so pick a harmless default
22252 : check for the select 'width'
22253 case "$selectminbits" in
22254 '') safebits=`expr $ptrsize \* 8`
22255 case "$d_select" in
22259 Checking to see on how many bits at a time your select() operates...
22262 #include <sys/types.h>
22264 #$i_systime I_SYS_TIME
22265 #$i_systimek I_SYS_TIME_KERNEL
22270 # ifdef I_SYS_TIME_KERNEL
22273 # include <sys/time.h>
22274 # ifdef I_SYS_TIME_KERNEL
22278 #$i_sysselct I_SYS_SELECT
22279 #ifdef I_SYS_SELECT
22280 #include <sys/select.h>
22282 #$d_socket HAS_SOCKET
22284 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22287 #$i_stdlib I_STDLIB
22289 #include <stdlib.h>
22292 #define S sizeof(*(b))
22294 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22295 #define NBITS (NBYTES * 8)
22297 char *s = (char *)malloc(NBYTES);
22306 fp = fopen("try.c", "r");
22312 b = ($selecttype)s;
22313 for (i = 0; i < NBITS; i++)
22317 select(fd + 1, b, 0, 0, &t);
22318 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22320 printf("%d\n", i + 1);
22325 if eval $compile_ok; then
22326 selectminbits=`$run ./try 2>/dev/null`
22327 case "$selectminbits" in
22329 Cannot figure out on how many bits at a time your select() operates.
22330 I'll play safe and guess it is $safebits bits.
22332 selectminbits=$safebits
22333 bits="$safebits bits"
22336 *) bits="$selectminbits bits" ;;
22338 echo "Your select() operates on $bits at a time." >&4
22340 rp='What is the minimum number of bits your select() operates on?'
22341 case "$byteorder" in
22342 12345678) dflt=64 ;;
22348 selectminbits="$val"
22352 *) : no select, so pick a harmless default
22353 selectminbits=$safebits
22359 : Trace out the files included by signal.h, then look for SIGxxx names.
22360 case "$sig_num_init" in
22362 if [ "X$fieldn" = X ]; then
22363 : Just make some guesses. We check them later.
22364 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22366 xxx=`echo '#include <signal.h>' |
22367 $cppstdin $cppminus $cppflags 2>/dev/null |
22368 $grep '^[ ]*#.*include' |
22369 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22370 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22373 for xx in $xxx /dev/null ; do
22374 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22376 case "$xxxfiles" in
22377 '') xxxfiles=`./findhdr signal.h` ;;
22380 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22381 print substr($2, 4, 20)
22383 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22384 print substr($3, 4, 20)
22386 : Append some common names just in case the awk scan failed.
22387 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22388 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22389 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22390 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22391 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22393 : generate a few handy files for later
22394 $cat > signal.c <<EOCP
22395 #include <sys/types.h>
22396 #include <signal.h>
22397 #$i_stdlib I_STDLIB
22399 #include <stdlib.h>
22404 /* Strange style to avoid deeply-nested #if/#else/#endif */
22407 # define NSIG (_NSIG)
22413 # define NSIG (SIGMAX+1)
22419 # define NSIG (SIG_MAX+1)
22425 # define NSIG (_SIG_MAX+1)
22431 # define NSIG (MAXSIG+1)
22437 # define NSIG (MAX_SIG+1)
22442 # ifdef SIGARRAYSIZE
22443 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22449 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22453 /* Default to some arbitrary number that's big enough to get most
22454 of the common signals.
22460 printf("NSIG %d\n", NSIG);
22466 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22468 printf "#ifdef SIG"; printf $1; printf "\n"
22469 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22470 printf $1; printf ");\n"
22474 printf "#endif /* JUST_NSIG */\n";
22475 printf "exit(0);\n}\n";
22478 $cat >signal.awk <<'EOP'
22479 BEGIN { ndups = 0 }
22480 $1 ~ /^NSIG$/ { nsig = $2 }
22481 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22482 if ($2 > maxsig) { maxsig = $2 }
22483 if (sig_name[$2]) {
22484 dup_name[ndups] = $1
22485 dup_num[ndups] = $2
22497 printf("NSIG %d\n", nsig);
22498 for (n = 1; n < nsig; n++) {
22500 printf("%s %d\n", sig_name[n], sig_num[n])
22503 printf("NUM%d %d\n", n, n)
22506 for (n = 0; n < ndups; n++) {
22507 printf("%s %d\n", dup_name[n], dup_num[n])
22511 $cat >signal_cmd <<EOS
22513 if $test -s signal.lst; then
22514 echo "Using your existing signal.lst file"
22519 $cat >>signal_cmd <<'EOS'
22522 if eval $compile_ok; then
22523 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22524 $uniq | $awk -f signal.awk >signal.lst
22526 echo "(I can't seem be able to compile the whole test program)" >&4
22527 echo "(I'll try it in little pieces.)" >&4
22528 set signal -DJUST_NSIG
22529 if eval $compile_ok; then
22530 $run ./signal$_exe > signal.nsg
22533 echo "I can't seem to figure out how many signals you have." >&4
22534 echo "Guessing 50." >&4
22535 echo 'NSIG 50' > signal.nsg
22537 : Now look at all the signal names, one at a time.
22538 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22539 $cat > signal.c <<EOCP
22540 #include <sys/types.h>
22541 #include <signal.h>
22544 printf("$xx %d\n", SIG${xx});
22549 if eval $compile; then
22550 echo "SIG${xx} found."
22551 $run ./signal$_exe >> signal.ls1
22553 echo "SIG${xx} NOT found."
22556 if $test -s signal.ls1; then
22557 $cat signal.nsg signal.ls1 |
22558 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22562 if $test -s signal.lst; then
22565 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22566 echo 'kill -l' >signal
22567 set X `csh -f <signal`
22571 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22573 echo $@ | $tr ' ' $trnl | \
22574 $awk '{ printf "%s %d\n", $1, ++s; }
22575 END { printf "NSIG %d\n", ++s }' >signal.lst
22577 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22579 chmod a+x signal_cmd
22580 $eunicefix signal_cmd
22584 : generate list of signal names
22585 case "$sig_num_init" in
22588 case "$sig_name_init" in
22590 *) case "$sig_num_init" in
22591 ''|*,*) doinit=yes ;;
22596 echo "Generating a list of signal names and numbers..." >&4
22598 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22599 sig_name=`$awk 'BEGIN { printf "ZERO " }
22600 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22601 sig_num=`$awk 'BEGIN { printf "0 " }
22602 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22603 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22604 !/^NSIG/ { printf "\"%s\", ", $1 }
22605 END { printf "0\n" }' signal.lst`
22606 sig_num_init=`$awk 'BEGIN { printf "0, " }
22607 !/^NSIG/ { printf "%d, ", $2}
22608 END { printf "0\n"}' signal.lst`
22611 echo "The following $sig_count signals are available:"
22613 echo $sig_name | $awk \
22614 'BEGIN { linelen = 0 }
22616 for (i = 1; i <= NF; i++) {
22617 name = "SIG" $i " "
22618 linelen = linelen + length(name)
22619 if (linelen > 70) {
22621 linelen = length(name)
22627 sig_size=`echo $sig_name | awk '{print NF}'`
22628 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22632 : Check size of size
22634 case "$sizetype" in
22635 *_t) zzz="$sizetype" ;;
22636 *) zzz="filesize" ;;
22638 echo "Checking the size of $zzz..." >&4
22640 #include <sys/types.h>
22642 #$i_stdlib I_STDLIB
22644 #include <stdlib.h>
22647 printf("%d\n", (int)sizeof($sizetype));
22652 if eval $compile_ok; then
22656 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22659 echo "Your $zzz size is $sizesize bytes."
22664 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22668 : check for socklen_t
22670 echo "Checking to see if you have socklen_t..." >&4
22672 #include <sys/types.h>
22673 #$d_socket HAS_SOCKET
22675 #include <sys/socket.h>
22677 int main() { socklen_t x = 16; }
22680 if eval $compile; then
22682 echo "You have socklen_t."
22685 echo "You do not have socklen_t."
22686 case "$sizetype" in
22687 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22694 : see if this is a socks.h system
22695 set socks.h i_socks
22698 : check for type of the size argument to socket calls
22699 case "$d_socket" in
22703 Checking to see what type is the last argument of accept().
22706 case "$d_socklen_t" in
22707 "$define") yyy="$yyy socklen_t"
22709 yyy="$yyy $sizetype int long unsigned"
22710 for xxx in $yyy; do
22711 case "$socksizetype" in
22712 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22713 case "$usesocks" in
22715 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22716 echo "Your system accepts '$xxx *' for the last argument of accept()."
22717 socksizetype="$xxx"
22720 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22721 echo "Your system accepts '$xxx *' for the last argument of accept()."
22722 socksizetype="$xxx"
22729 : In case none of those worked, prompt the user.
22730 case "$socksizetype" in
22731 '') rp='What is the type for socket address structure sizes?'
22738 *) : no sockets, so pick relatively harmless default
22743 : see what type is used for signed size_t
22744 set ssize_t ssizetype int stdio.h sys/types.h
22749 #$i_stdlib I_STDLIB
22751 #include <stdlib.h>
22753 #include <sys/types.h>
22754 #define Size_t $sizetype
22755 #define SSize_t $dflt
22758 if (sizeof(Size_t) == sizeof(SSize_t))
22760 else if (sizeof(Size_t) == sizeof(int))
22769 if eval $compile_ok && $run ./try > /dev/null; then
22770 ssizetype=`$run ./try`
22771 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22774 Help! I can't compile and run the ssize_t test program: please enlighten me!
22775 (This is probably a misconfiguration in your system or libraries, and
22776 you really ought to fix it. Still, I'll try anyway.)
22778 I need a type that is the same size as $sizetype, but is guaranteed to
22779 be signed. Common values are ssize_t, int and long.
22782 rp="What signed type is the same size as $sizetype?"
22788 : Check the size of st_ino
22790 $echo "Checking the size of st_ino..." >&4
22791 $cat > try.c <<EOCP
22792 #include <sys/stat.h>
22794 #$i_stdlib I_STDLIB
22796 #include <stdlib.h>
22800 printf("%d\n", (int)sizeof(st.st_ino));
22805 if eval $compile_ok; then
22809 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22811 *) st_ino_size=$val
22812 $echo "Your st_ino is $st_ino_size bytes long."
22817 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22821 : Check if st_ino is signed
22823 $echo "Checking the sign of st_ino..." >&4
22824 $cat > try.c <<EOCP
22825 #include <sys/stat.h>
22830 if (foo.st_ino < 0)
22837 if eval $compile; then
22841 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22843 *) st_ino_sign=$val
22844 case "$st_ino_sign" in
22845 1) $echo "Your st_ino is unsigned." ;;
22846 -1) $echo "Your st_ino is signed." ;;
22852 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22856 : see what type of char stdio uses.
22858 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22859 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22860 echo "Your stdio uses unsigned chars." >&4
22861 stdchar="unsigned char"
22863 echo "Your stdio uses signed chars." >&4
22868 : Check size of UID
22871 *_t) zzz="$uidtype" ;;
22874 echo "Checking the size of $zzz..." >&4
22876 #include <sys/types.h>
22878 #$i_stdlib I_STDLIB
22880 #include <stdlib.h>
22883 printf("%d\n", (int)sizeof($uidtype));
22888 if eval $compile_ok; then
22892 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22895 echo "Your $zzz is $uidsize bytes long."
22900 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22903 : Check if UID is signed
22906 *_t) zzz="$uidtype" ;;
22909 echo "Checking the sign of $zzz..." >&4
22911 #include <sys/types.h>
22922 if eval $compile; then
22926 echo "(I can't execute the test program--guessing unsigned.)" >&4
22930 1) echo "Your $zzz is unsigned." ;;
22931 -1) echo "Your $zzz is signed." ;;
22937 echo "(I can't compile the test program--guessing unsigned.)" >&4
22941 : Check format string for UID
22943 $echo "Checking the format string to be used for uids..." >&4
22946 -1) if $test X"$uidsize" = X"$ivsize"; then
22947 uidformat="$ivdformat"
22949 if $test X"$uidsize" = X"$longsize"; then
22952 if $test X"$uidsize" = X"$intsize"; then
22955 if $test X"$uidsize" = X"$shortsize"; then
22962 *) if $test X"$uidsize" = X"$uvsize"; then
22963 uidformat="$uvuformat"
22965 if $test X"$uidsize" = X"$longsize"; then
22968 if $test X"$uidsize" = X"$intsize"; then
22971 if $test X"$uidsize" = X"$shortsize"; then
22980 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22982 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22983 $cat >try.c <<'EOM'
22984 /* Intentionally a long probe as I'd like to sanity check that the exact
22985 approach is going to work, as thinking it will work, but only having it
22986 part working at runtime is worse than not having it. */
22988 #include <sys/types.h>
22989 #include <sys/sysctl.h>
22990 #include <sys/param.h>
22992 #include <string.h>
22993 #include <stdlib.h>
22994 #include <unistd.h>
22997 main(int argc, char **argv) {
22999 char *argv_leaf = strrchr(argv[0], '/');
23005 mib[1] = KERN_PROC;
23006 mib[2] = KERN_PROC_PATHNAME;
23010 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23014 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23019 if (size < strlen(argv_leaf) + 1) {
23020 fprintf(stderr, "size %lu is too short for a path\n",
23021 (unsigned long) size);
23025 if (size > MAXPATHLEN * MAXPATHLEN) {
23026 fprintf(stderr, "size %lu is too long for a path\n",
23027 (unsigned long) size);
23031 buffer = malloc(size);
23037 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23042 if (strlen(buffer) + 1 != size) {
23043 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23044 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23049 if (*buffer != '/') {
23050 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23054 if (strstr(buffer, "/./")) {
23055 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23059 if (strstr(buffer, "/../")) {
23060 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23064 buffer_leaf = strrchr(buffer, '/');
23065 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23066 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23078 if eval $compile; then
23079 if $run ./try; then
23080 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23083 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23087 echo "I'm unable to compile the test program." >&4
23088 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23092 set usekernprocpathname
23095 : Determine if we can use _NSGetExecutablePath to find executing program
23097 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23098 $cat >try.c <<'EOM'
23099 /* Intentionally a long probe as I'd like to sanity check that the exact
23100 approach is going to work, as thinking it will work, but only having it
23101 part working at runtime is worse than not having it. */
23102 #include <mach-o/dyld.h>
23104 #include <stdlib.h>
23105 #include <sys/param.h>
23106 #include <string.h>
23109 main(int argc, char **argv) {
23111 uint32_t size = sizeof(buf);
23115 char *argv_leaf = strrchr(argv[0], '/');
23119 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23123 _NSGetExecutablePath(buf, &size);
23124 if (size > MAXPATHLEN * MAXPATHLEN) {
23125 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23126 (unsigned int) size);
23130 buffer = malloc(size);
23136 result = _NSGetExecutablePath(buffer, &size);
23138 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23139 result, (unsigned int) size);
23143 tidied = realpath(buffer, NULL);
23145 perror("realpath");
23151 if (*tidied != '/') {
23152 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23156 if (strstr(tidied, "/./")) {
23157 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23161 if (strstr(tidied, "/../")) {
23162 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23166 tidied_leaf = strrchr(tidied, '/');
23167 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23168 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23180 if eval $compile; then
23181 if $run ./try; then
23182 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23185 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23188 echo "I'm unable to compile the test program." >&4
23189 echo "I'll assume no _NSGetExecutablePath here." >&4
23192 set usensgetexecutablepath
23195 : Check if site customization support was requested
23196 case "$usesitecustomize" in
23197 $define|true|[Yy]*)
23198 usesitecustomize="$define"
23201 usesitecustomize="$undef"
23205 : see if prototypes support variable argument declarations
23207 case "$prototype$i_stdarg" in
23209 echo "It appears we'll be able to prototype varargs functions." >&4
23213 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23220 : determine compiler compiler
23229 if $test -f "$byacc$_exe"; then
23231 comp="byacc or $comp"
23233 if $test -f "$bison$_exe"; then
23234 comp="$comp or bison -y"
23236 rp="Which compiler compiler ($comp) shall I use?"
23245 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23251 : see if this is a assert.h system
23252 set assert.h i_assert
23255 : see if this is a bfd.h system
23259 : see if this is an execinfo.h system
23260 set execinfo.h i_execinfo
23263 : see if this is a fenv.h system
23267 : see if this is a fp.h system
23271 : see if this is a fp_class.h system
23272 set fp_class.h i_fp_class
23275 : see if gdbm.h is available
23280 : see if gdbm_open exists
23281 set gdbm_open d_gdbm_open
23283 case "$d_gdbm_open" in
23286 echo "We won't be including <gdbm.h>"
23295 : see if this is a ieeefp.h system
23296 case "$i_ieeefp" in
23297 '' ) set ieeefp.h i_ieeefp
23302 : see if this is a libutil.h system
23303 set libutil.h i_libutil
23306 : see if mach cthreads are available
23307 if test "X$usethreads" = "X$define"; then
23308 set mach/cthreads.h i_machcthr
23311 i_machcthr="$undef"
23314 : see if this is a mntent.h system
23315 set mntent.h i_mntent
23318 : see if net/errno.h is available
23320 set net/errno.h val
23323 : Unfortunately, it causes problems on some systems. Arrgh.
23326 cat > try.c <<'EOM'
23329 #include <net/errno.h>
23335 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23336 echo "We'll be including <net/errno.h>." >&4
23338 echo "We won't be including <net/errno.h>." >&4
23347 : see if netinet/tcp.h is available
23348 set netinet/tcp.h i_netinettcp
23351 : see if this is a poll.h system
23355 : see if this is a prot.h system
23359 : Preprocessor symbols
23361 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23362 $cat <<'EOSH' > Cppsym.know
23363 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23364 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23365 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23366 arch_pwr ardent ARM ARM32 atarist att386 att3b
23367 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23368 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23369 byteorder byte_order
23370 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23371 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23372 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23373 ELF encore EPI EXTENSIONS
23374 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23375 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23376 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23377 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23378 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23379 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23380 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23381 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23382 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23384 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23385 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23386 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23388 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23389 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23390 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23391 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23392 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23393 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23394 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23395 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23396 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23397 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23398 ns32000 ns32016 ns32332 ns32k nsc32000
23399 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23400 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23401 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23402 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23404 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23405 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23406 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23407 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23408 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23409 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23410 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23411 SYSV4 SYSV5 sysV68 sysV88
23412 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23413 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23414 tower32_800 tower32_850 tss
23415 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23416 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23417 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23418 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23419 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23420 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23422 vax venix VMESA vms
23423 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23424 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23427 # Maybe put other stuff here too.
23428 ./tr '-' '_' <<EOSH >>Cppsym.know
23431 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23432 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23433 $cat Cppsym.know > Cppsym.c
23434 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23435 $rm -f Cppsym.a Cppsym.b Cppsym.c
23436 cat <<EOSH > Cppsym
23438 if $test \$# -gt 0; then
23439 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23440 if $test -s Cppsym.got; then
23447 $tr " " "$trnl" | ./Cppsym.try
23453 cat <<EOSH > Cppsym.try
23455 cat <<'EOCP' > try.c
23458 #define STRINGIFY(a) "a"
23460 #if cpp_stuff == 42
23461 #define StGiFy(a) #a
23462 #define STRINGIFY(a) StGiFy(a)
23464 #if $cpp_stuff != 1 && $cpp_stuff != 42
23465 # include "Bletch: How does this C preprocessor stringify macros?"
23471 cat <<'EOSH' >> Cppsym.try
23473 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23474 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23475 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23476 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23478 echo 'return 0;}' >> try.c
23480 cat <<EOSH >> Cppsym.try
23482 case "$osname-$gccversion" in
23483 irix-) ccflags="\$ccflags -woff 1178" ;;
23484 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23486 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23488 chmod +x Cppsym.try
23489 $eunicefix Cppsym.try
23490 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23491 : Add in any Linux cpp "predefined macros":
23492 case "$osname::$gccversion" in
23493 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23495 rm -f $tHdrH'.h' $tHdrH
23497 # Filter out macro arguments, such as Linux's __INT8_C(c)
23498 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23499 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23500 if [ -s $tHdrH'_cppsym.real' ]; then
23501 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23504 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23507 : now check the C compiler for additional symbols
23508 postprocess_cc_v=''
23510 aix) postprocess_cc_v="|$tr , ' '" ;;
23517 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23520 -D*) echo "\$i" | $sed 's/^-D//';;
23521 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23526 postprocess_cc_v=''
23529 ./ccsym > ccsym1.raw
23530 if $test -s ccsym1.raw; then
23531 $sort ccsym1.raw | $uniq >ccsym.raw
23533 mv ccsym1.raw ccsym.raw
23536 $awk '/\=/ { print $0; next }
23537 { print $0"=1" }' ccsym.raw >ccsym.list
23538 $comm -13 Cppsym.true ccsym.list >ccsym.own
23539 $comm -12 Cppsym.true ccsym.list >ccsym.com
23540 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23542 if $test -z ccsym.raw; then
23543 echo "Your C compiler doesn't seem to define any symbols!" >&4
23545 echo "However, your C preprocessor defines the following symbols:"
23548 cppsymbols=`$cat Cppsym.true`
23549 cppsymbols=`echo $cppsymbols`
23550 cppccsymbols="$cppsymbols"
23552 if $test -s ccsym.com; then
23553 echo "Your C compiler and pre-processor define these symbols:"
23554 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23557 cppccsymbols=`$cat ccsym.com`
23558 cppccsymbols=`echo $cppccsymbols`
23559 $test "$silent" || sleep 1
23561 if $test -s ccsym.cpp; then
23562 $test "$also" && echo " "
23563 echo "Your C pre-processor ${also}defines the following symbols:"
23564 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23566 cppsymbols=`$cat ccsym.cpp`
23567 cppsymbols=`echo $cppsymbols`
23568 $test "$silent" || sleep 1
23570 if $test -s ccsym.own; then
23571 $test "$also" && echo " "
23572 echo "Your C compiler ${also}defines the following cpp symbols:"
23573 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23574 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23575 ccsymbols=`$cat ccsym.own`
23576 ccsymbols=`echo $ccsymbols`
23577 $test "$silent" || sleep 1
23581 : add -D_FORTIFY_SOURCE if feasible and not already there
23582 case "$gccversion" in
23583 [45].*) case "$optimize$ccflags" in
23584 *-O*) case "$ccflags$cppsymbols" in
23585 *_FORTIFY_SOURCE=*) # Don't add it again.
23586 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23588 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23589 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23593 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23597 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23601 : see if this is a termio system
23605 if $test `./findhdr termios.h`; then
23606 set tcsetattr i_termios
23612 "$define") echo "You have POSIX termios.h... good!" >&4;;
23613 *) if ./Cppsym pyr; then
23614 case "`$run /bin/universe`" in
23615 ucb) if $test `./findhdr sgtty.h`; then
23617 echo "<sgtty.h> found." >&4
23619 echo "System is pyramid with BSD universe."
23620 ./warn "<sgtty.h> not found--you could have problems."
23622 *) if $test `./findhdr termio.h`; then
23624 echo "<termio.h> found." >&4
23626 echo "System is pyramid with USG universe."
23627 ./warn "<termio.h> not found--you could have problems."
23631 if $test `./findhdr termio.h`; then
23632 echo "<termio.h> found." >&4
23634 elif $test `./findhdr sgtty.h`; then
23635 echo "<sgtty.h> found." >&4
23638 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23641 if $test `./findhdr sgtty.h`; then
23642 echo "<sgtty.h> found." >&4
23644 elif $test `./findhdr termio.h`; then
23645 echo "<termio.h> found." >&4
23648 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23652 set i_termio; eval $setvar
23653 val=$val2; set i_sgtty; eval $setvar
23654 val=$val3; set i_termios; eval $setvar
23656 : see if stdbool is available
23657 : we want a real compile instead of Inhdr because some Solaris systems
23658 : have stdbool.h, but it can only be used if the compiler indicates it
23659 : is sufficiently c99-compliant.
23663 #include <stdbool.h>
23668 int main(int argc, char **argv)
23674 if eval $compile; then
23675 echo "<stdbool.h> found." >&4
23678 echo "<stdbool.h> NOT found." >&4
23685 : see if stddef is available
23686 set stddef.h i_stddef
23689 : see if stdint is available
23690 set stdint.h i_stdint
23693 : see if sys/access.h is available
23694 set sys/access.h i_sysaccess
23697 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23698 set sys/filio.h i_sysfilio
23701 if $test `./findhdr sys/ioctl.h`; then
23703 echo '<sys/ioctl.h> found.' >&4
23706 if $test $i_sysfilio = "$define"; then
23707 echo '<sys/ioctl.h> NOT found.' >&4
23709 $test $i_sgtty = "$define" && xxx="sgtty.h"
23710 $test $i_termio = "$define" && xxx="termio.h"
23711 $test $i_termios = "$define" && xxx="termios.h"
23712 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23718 : see if socket ioctl defs are in sys/sockio.h
23720 xxx=`./findhdr sys/sockio.h`
23721 if $test "$xxx"; then
23722 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23724 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23727 echo "No socket ioctls found in <sys/sockio.h>." >&4
23732 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23738 : see if this is a syslog.h system
23739 set syslog.h i_syslog
23742 : see if this is a sys/mode.h system
23743 set sys/mode.h i_sysmode
23746 : see if there is a sys/poll.h file
23747 set sys/poll.h i_syspoll
23750 : see if sys/resource.h has to be included
23751 set sys/resource.h i_sysresrc
23754 : see if sys/security.h is available
23755 set sys/security.h i_syssecrt
23758 : see if this is a sys/statvfs.h system
23759 set sys/statvfs.h i_sysstatvfs
23762 : see if this is a sys/un.h system
23763 set sys/un.h i_sysun
23766 : see if this is a sys/utsname.h system
23767 set sys/utsname.h i_sysutsname
23770 : see if this is a syswait system
23771 set sys/wait.h i_syswait
23774 : see if this is a ustat.h system
23775 set ustat.h i_ustat
23778 : see if this is an utime system
23779 set utime.h i_utime
23782 : see if this is a vfork system
23785 set vfork.h i_vfork
23795 echo "Looking for extensions..." >&4
23796 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23797 : contain old or inaccurate or duplicate values.
23798 nonxs_extensions=''
23800 : We do not use find because it might not be available.
23801 : We do not just use MANIFEST because the user may have dropped
23802 : some additional extensions into the source tree and expect them
23805 : Function to recursively find available extensions, ignoring DynaLoader
23806 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23807 : In 5.10.1 and later, extensions are stored in directories
23808 : like File-Glob instead of the older File/Glob/.
23812 DynaLoader|dynaload) ;;
23814 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23815 case "$this_ext" in
23816 Scalar/List/Utils) this_ext="List/Util" ;;
23817 PathTools) this_ext="Cwd" ;;
23819 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23820 if $contains " $this_ext " "$tdir/$$.tmp"; then
23822 echo "Duplicate directories detected for extension $xxx" >&4;
23823 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23824 case "$knowitall" in
23832 echo "Ok. Stopping Configure." >&4;
23833 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23836 echo "Ok. You will need to correct config.sh before running make." >&4;
23838 $ls -1 "$xxx" > "$tdir/$$.tmp";
23839 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23840 xs_extensions="$xs_extensions $this_ext";
23841 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23842 xs_extensions="$xs_extensions $this_ext";
23843 elif $test -d "$xxx"; then
23844 nonxs_extensions="$nonxs_extensions $this_ext";
23846 $rm -f "$tdir/$$.tmp";
23854 eval $find_extensions
23858 eval $find_extensions
23862 eval $find_extensions
23863 set X $xs_extensions
23865 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23866 set X $nonxs_extensions
23868 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23870 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23872 : Now see which are supported on this system.
23874 for xxx in $xs_extensions ; do
23878 amigaos) avail_ext="$avail_ext $xxx" ;;
23883 $define) avail_ext="$avail_ext $xxx" ;;
23886 GDBM_File|gdbm_fil)
23888 $define) avail_ext="$avail_ext $xxx" ;;
23891 I18N/Langinfo|i18n_lan)
23892 case "$i_langinfo$d_nl_langinfo" in
23893 $define$define) avail_ext="$avail_ext $xxx" ;;
23897 : XXX Do we need a useipcsysv variable here
23898 case "${d_msg}${d_sem}${d_shm}" in
23899 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23902 NDBM_File|ndbm_fil)
23905 case "$osname-$use64bitint" in
23908 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23911 *) avail_ext="$avail_ext $xxx" ;;
23916 ODBM_File|odbm_fil)
23917 case "${i_dbm}${i_rpcsvcdbm}" in
23919 case "$d_cplusplus" in
23920 define) ;; # delete as a function name will not work
23921 *) case "$osname-$use64bitint" in
23924 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23927 *) avail_ext="$avail_ext $xxx" ;;
23935 case "$useopcode" in
23936 true|define|y) avail_ext="$avail_ext $xxx" ;;
23940 case "$useposix" in
23941 true|define|y) avail_ext="$avail_ext $xxx" ;;
23945 case "$d_socket" in
23946 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23949 Sys/Syslog|sys/syslog)
23951 amigaos) ;; # not really very useful on AmigaOS
23953 : XXX syslog requires socket
23954 case "$d_socket" in
23955 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23961 case "$usethreads" in
23963 case "$use5005threads" in
23964 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23968 threads|threads/shared)
23969 # threads and threads::shared are special cases.
23970 # To stop people from asking "Perl 5.8.0 was supposed
23971 # to have this new fancy threads implementation but my
23972 # perl doesn't have it" and from people trying to
23973 # (re)install the threads module using CPAN.pm and
23974 # CPAN.pm then offering to reinstall Perl 5.8.0,
23975 # the threads.pm and threads/shared.pm will always be
23976 # there, croaking informatively ("you need to rebuild
23977 # all of Perl with threads, sorry") when threads haven't
23978 # been compiled in.
23980 avail_ext="$avail_ext $xxx"
23986 cygwin) avail_ext="$avail_ext $xxx" ;;
23989 XS/APItest|xs/apitest)
23990 # This is just for testing. Skip it unless we have dynamic loading.
23993 $define) avail_ext="$avail_ext $xxx" ;;
23996 XS/Typemap|xs/typemap)
23997 # This is just for testing. Skip it unless we have dynamic loading.
23999 $define) avail_ext="$avail_ext $xxx" ;;
24002 *) avail_ext="$avail_ext $xxx"
24011 case "$onlyextensions" in
24013 *) keepextensions=''
24014 echo "You have requested that only certain extensions be included..." >&4
24015 for i in $onlyextensions; do
24016 case " $avail_ext " in
24018 echo "Keeping extension $i."
24019 keepextensions="$keepextensions $i"
24021 *) echo "Ignoring extension $i." ;;
24024 avail_ext="$keepextensions"
24028 case "$noextensions" in
24030 *) keepextensions=''
24031 echo "You have requested that certain extensions be ignored..." >&4
24032 for i in $avail_ext; do
24033 case " $noextensions " in
24034 *" $i "*) echo "Ignoring extension $i." ;;
24035 *) echo "Keeping extension $i.";
24036 keepextensions="$keepextensions $i"
24040 avail_ext="$keepextensions"
24044 : Now see which nonxs extensions are supported on this system.
24045 : For now assume all are.
24047 for xxx in $nonxs_extensions ; do
24051 *) nonxs_ext="$nonxs_ext $xxx"
24063 A number of extensions are supplied with $package. You may choose to
24064 compile these extensions for dynamic loading (the default), compile
24065 them into the $package executable (static loading), or not include
24066 them at all. Answer "none" to include no extensions.
24067 Note that DynaLoader is always built and need not be mentioned here.
24070 case "$dynamic_ext" in
24072 : Exclude those listed in static_ext
24074 for xxx in $avail_ext; do
24075 case " $static_ext " in
24077 *) dflt="$dflt $xxx" ;;
24084 *) dflt="$dynamic_ext"
24085 # Perhaps we are reusing an old out-of-date config.sh.
24088 if test X"$dynamic_ext" != X"$avail_ext"; then
24090 NOTICE: Your previous config.sh list may be incorrect.
24091 The extensions now available to you are
24093 but the default list from your previous config.sh is
24105 rp="What extensions do you wish to load dynamically?"
24108 none) dynamic_ext=' ' ;;
24109 *) dynamic_ext="$ans" ;;
24112 case "$static_ext" in
24114 : Exclude those already listed in dynamic linking
24116 for xxx in $avail_ext; do
24117 case " $dynamic_ext " in
24119 *) dflt="$dflt $xxx" ;;
24126 *) dflt="$static_ext"
24133 rp="What extensions do you wish to load statically?"
24136 none) static_ext=' ' ;;
24137 *) static_ext="$ans" ;;
24142 A number of extensions are supplied with $package. Answer "none"
24143 to include no extensions.
24144 Note that DynaLoader is always built and need not be mentioned here.
24147 case "$static_ext" in
24148 '') dflt="$avail_ext" ;;
24149 *) dflt="$static_ext"
24150 # Perhaps we are reusing an old out-of-date config.sh.
24153 if test X"$static_ext" != X"$avail_ext"; then
24155 NOTICE: Your previous config.sh list may be incorrect.
24156 The extensions now available to you are
24158 but the default list from your previous config.sh is
24167 : Exclude those that are not xs extensions
24171 rp="What extensions do you wish to include?"
24174 none) static_ext=' ' ;;
24175 *) static_ext="$ans" ;;
24180 # Encode is a special case. If we are building Encode as a static
24181 # extension, we need to explicitly list its subextensions as well.
24182 # For other nested extensions, this is handled automatically by
24183 # the appropriate Makefile.PL.
24184 case " $static_ext " in
24185 *" Encode "*) # Add the subextensions of Encode
24187 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24188 static_ext="$static_ext Encode/$xxx"
24189 known_extensions="$known_extensions Encode/$xxx"
24195 set X $dynamic_ext $static_ext $nonxs_ext
24199 # Sanity check: We require an extension suitable for use with
24200 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24201 # should show up as failures in the test suite, but it's helpful to
24202 # catch them now.) The 'extensions' list is normally sorted
24203 # alphabetically, so we need to accept either
24204 # DB_File ... Fcntl ... IO ....
24205 # or something like
24206 # Fcntl ... NDBM_File ... IO ....
24207 case " $extensions" in
24208 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24209 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24210 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24211 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24212 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24216 : Remove libraries needed only for extensions
24217 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24218 : The exception is SunOS 4.x, which needs them.
24219 case "${osname}X${osvers}" in
24223 *) case "$usedl" in
24224 $define|true|[yY]*)
24225 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24229 *) perllibs="$libs"
24235 : Remove build directory name from cppstdin so it can be used from
24236 : either the present location or the final installed location.
24238 : Get out of the UU directory to get correct path name.
24240 case "$cppstdin" in
24242 echo "Stripping down cppstdin path name"
24248 : end of configuration questions
24250 echo "End of configuration questions."
24253 : back to where it started
24254 if test -d ../UU; then
24258 : configuration may be unconditionally patched via a 'config.arch' file
24259 if $test -f config.arch; then
24260 echo "I see a config.arch file, loading it." >&4
24264 : configuration may be patched via a 'config.over' file
24265 if $test -f config.over; then
24268 rp='I see a config.over file. Do you wish to load it?'
24271 n*) echo "OK, I'll ignore it.";;
24273 echo "Configuration override changes have been loaded."
24278 : in case they want portability, strip down executable paths
24279 case "$d_portable" in
24282 echo "Stripping down executable paths..." >&4
24283 for file in $loclist $trylist; do
24285 eval $file=`basename $temp`
24290 : create config.sh file
24292 echo "Creating config.sh..." >&4
24293 $spitshell <<EOT >config.sh
24296 # This file was produced by running the Configure script. It holds all the
24297 # definitions figured out by Configure. Should you modify one of these values,
24298 # do not forget to propagate your changes by running "Configure -der". You may
24299 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24302 # Package name : $package
24303 # Source directory : $src
24304 # Configuration time: $cf_time
24305 # Configured by : $cf_by
24306 # Target system : $myuname
24309 : Add in command line options if available
24310 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24312 $spitshell <<EOT >>config.sh
24321 Revision='$Revision'
24329 alignbytes='$alignbytes'
24330 ansi2knr='$ansi2knr'
24331 aphostname='$aphostname'
24332 api_revision='$api_revision'
24333 api_subversion='$api_subversion'
24334 api_version='$api_version'
24335 api_versionstring='$api_versionstring'
24338 archlibexp='$archlibexp'
24339 archname64='$archname64'
24340 archname='$archname'
24341 archobjs='$archobjs'
24342 asctime_r_proto='$asctime_r_proto'
24351 byteorder='$byteorder'
24353 castflags='$castflags'
24356 cccdlflags='$cccdlflags'
24357 ccdlflags='$ccdlflags'
24359 ccflags_uselargefiles='$ccflags_uselargefiles'
24361 ccsymbols='$ccsymbols'
24362 ccversion='$ccversion'
24364 cf_email='$cf_email'
24366 charbits='$charbits'
24367 charsize='$charsize'
24371 clocktype='$clocktype'
24373 compress='$compress'
24374 contains='$contains'
24378 cpp_stuff='$cpp_stuff'
24379 cppccsymbols='$cppccsymbols'
24380 cppflags='$cppflags'
24382 cppminus='$cppminus'
24384 cppstdin='$cppstdin'
24385 cppsymbols='$cppsymbols'
24386 crypt_r_proto='$crypt_r_proto'
24387 cryptlib='$cryptlib'
24389 ctermid_r_proto='$ctermid_r_proto'
24390 ctime_r_proto='$ctime_r_proto'
24391 d_Gconvert='$d_Gconvert'
24392 d_PRIEUldbl='$d_PRIEUldbl'
24393 d_PRIFUldbl='$d_PRIFUldbl'
24394 d_PRIGUldbl='$d_PRIGUldbl'
24395 d_PRIXU64='$d_PRIXU64'
24396 d_PRId64='$d_PRId64'
24397 d_PRIeldbl='$d_PRIeldbl'
24398 d_PRIfldbl='$d_PRIfldbl'
24399 d_PRIgldbl='$d_PRIgldbl'
24400 d_PRIi64='$d_PRIi64'
24401 d_PRIo64='$d_PRIo64'
24402 d_PRIu64='$d_PRIu64'
24403 d_PRIx64='$d_PRIx64'
24404 d_SCNfldbl='$d_SCNfldbl'
24405 d__fwalk='$d__fwalk'
24406 d_access='$d_access'
24407 d_accessx='$d_accessx'
24411 d_archlib='$d_archlib'
24412 d_asctime64='$d_asctime64'
24413 d_asctime_r='$d_asctime_r'
24418 d_attribute_deprecated='$d_attribute_deprecated'
24419 d_attribute_format='$d_attribute_format'
24420 d_attribute_malloc='$d_attribute_malloc'
24421 d_attribute_nonnull='$d_attribute_nonnull'
24422 d_attribute_noreturn='$d_attribute_noreturn'
24423 d_attribute_pure='$d_attribute_pure'
24424 d_attribute_unused='$d_attribute_unused'
24425 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24426 d_backtrace='$d_backtrace'
24430 d_bsdgetpgrp='$d_bsdgetpgrp'
24431 d_bsdsetpgrp='$d_bsdsetpgrp'
24432 d_builtin_choose_expr='$d_builtin_choose_expr'
24433 d_builtin_expect='$d_builtin_expect'
24435 d_c99_variadic_macros='$d_c99_variadic_macros'
24436 d_casti32='$d_casti32'
24437 d_castneg='$d_castneg'
24439 d_charvspr='$d_charvspr'
24441 d_chroot='$d_chroot'
24442 d_chsize='$d_chsize'
24444 d_clearenv='$d_clearenv'
24445 d_closedir='$d_closedir'
24446 d_cmsghdr_s='$d_cmsghdr_s'
24448 d_copysign='$d_copysign'
24449 d_copysignl='$d_copysignl'
24450 d_cplusplus='$d_cplusplus'
24452 d_crypt_r='$d_crypt_r'
24454 d_ctermid='$d_ctermid'
24455 d_ctermid_r='$d_ctermid_r'
24456 d_ctime64='$d_ctime64'
24457 d_ctime_r='$d_ctime_r'
24458 d_cuserid='$d_cuserid'
24459 d_dbl_dig='$d_dbl_dig'
24460 d_dbminitproto='$d_dbminitproto'
24461 d_difftime64='$d_difftime64'
24462 d_difftime='$d_difftime'
24463 d_dir_dd_fd='$d_dir_dd_fd'
24465 d_dirnamlen='$d_dirnamlen'
24466 d_dladdr='$d_dladdr'
24467 d_dlerror='$d_dlerror'
24468 d_dlopen='$d_dlopen'
24469 d_dlsymun='$d_dlsymun'
24470 d_dosuid='$d_dosuid'
24471 d_double_has_inf='$d_double_has_inf'
24472 d_double_has_nan='$d_double_has_nan'
24473 d_double_has_negative_zero='$d_double_has_negative_zero'
24474 d_double_has_subnormals='$d_double_has_subnormals'
24475 d_double_style_cray='$d_double_style_cray'
24476 d_double_style_ibm='$d_double_style_ibm'
24477 d_double_style_ieee='$d_double_style_ieee'
24478 d_double_style_vax='$d_double_style_vax'
24479 d_drand48_r='$d_drand48_r'
24480 d_drand48proto='$d_drand48proto'
24482 d_duplocale='$d_duplocale'
24483 d_eaccess='$d_eaccess'
24484 d_endgrent='$d_endgrent'
24485 d_endgrent_r='$d_endgrent_r'
24486 d_endhent='$d_endhent'
24487 d_endhostent_r='$d_endhostent_r'
24488 d_endnent='$d_endnent'
24489 d_endnetent_r='$d_endnetent_r'
24490 d_endpent='$d_endpent'
24491 d_endprotoent_r='$d_endprotoent_r'
24492 d_endpwent='$d_endpwent'
24493 d_endpwent_r='$d_endpwent_r'
24494 d_endsent='$d_endsent'
24495 d_endservent_r='$d_endservent_r'
24496 d_eofnblk='$d_eofnblk'
24499 d_eunice='$d_eunice'
24502 d_faststdio='$d_faststdio'
24503 d_fchdir='$d_fchdir'
24504 d_fchmod='$d_fchmod'
24505 d_fchown='$d_fchown'
24507 d_fcntl_can_lock='$d_fcntl_can_lock'
24508 d_fd_macros='$d_fd_macros'
24509 d_fd_set='$d_fd_set'
24510 d_fdclose='$d_fdclose'
24512 d_fds_bits='$d_fds_bits'
24513 d_fegetround='$d_fegetround'
24514 d_fgetpos='$d_fgetpos'
24515 d_finite='$d_finite'
24516 d_finitel='$d_finitel'
24517 d_flexfnam='$d_flexfnam'
24519 d_flockproto='$d_flockproto'
24524 d_fp_class='$d_fp_class'
24525 d_fp_classify='$d_fp_classify'
24526 d_fp_classl='$d_fp_classl'
24527 d_fpathconf='$d_fpathconf'
24528 d_fpclass='$d_fpclass'
24529 d_fpclassify='$d_fpclassify'
24530 d_fpclassl='$d_fpclassl'
24531 d_fpgetround='$d_fpgetround'
24532 d_fpos64_t='$d_fpos64_t'
24533 d_freelocale='$d_freelocale'
24534 d_frexpl='$d_frexpl'
24535 d_fs_data_s='$d_fs_data_s'
24536 d_fseeko='$d_fseeko'
24537 d_fsetpos='$d_fsetpos'
24538 d_fstatfs='$d_fstatfs'
24539 d_fstatvfs='$d_fstatvfs'
24541 d_ftello='$d_ftello'
24543 d_futimes='$d_futimes'
24544 d_gai_strerror='$d_gai_strerror'
24545 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24546 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24547 d_getaddrinfo='$d_getaddrinfo'
24548 d_getcwd='$d_getcwd'
24549 d_getespwnam='$d_getespwnam'
24550 d_getfsstat='$d_getfsstat'
24551 d_getgrent='$d_getgrent'
24552 d_getgrent_r='$d_getgrent_r'
24553 d_getgrgid_r='$d_getgrgid_r'
24554 d_getgrnam_r='$d_getgrnam_r'
24555 d_getgrps='$d_getgrps'
24556 d_gethbyaddr='$d_gethbyaddr'
24557 d_gethbyname='$d_gethbyname'
24558 d_gethent='$d_gethent'
24559 d_gethname='$d_gethname'
24560 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24561 d_gethostbyname_r='$d_gethostbyname_r'
24562 d_gethostent_r='$d_gethostent_r'
24563 d_gethostprotos='$d_gethostprotos'
24564 d_getitimer='$d_getitimer'
24565 d_getlogin='$d_getlogin'
24566 d_getlogin_r='$d_getlogin_r'
24567 d_getmnt='$d_getmnt'
24568 d_getmntent='$d_getmntent'
24569 d_getnameinfo='$d_getnameinfo'
24570 d_getnbyaddr='$d_getnbyaddr'
24571 d_getnbyname='$d_getnbyname'
24572 d_getnent='$d_getnent'
24573 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24574 d_getnetbyname_r='$d_getnetbyname_r'
24575 d_getnetent_r='$d_getnetent_r'
24576 d_getnetprotos='$d_getnetprotos'
24577 d_getpagsz='$d_getpagsz'
24578 d_getpbyname='$d_getpbyname'
24579 d_getpbynumber='$d_getpbynumber'
24580 d_getpent='$d_getpent'
24581 d_getpgid='$d_getpgid'
24582 d_getpgrp2='$d_getpgrp2'
24583 d_getpgrp='$d_getpgrp'
24584 d_getppid='$d_getppid'
24585 d_getprior='$d_getprior'
24586 d_getprotobyname_r='$d_getprotobyname_r'
24587 d_getprotobynumber_r='$d_getprotobynumber_r'
24588 d_getprotoent_r='$d_getprotoent_r'
24589 d_getprotoprotos='$d_getprotoprotos'
24590 d_getprpwnam='$d_getprpwnam'
24591 d_getpwent='$d_getpwent'
24592 d_getpwent_r='$d_getpwent_r'
24593 d_getpwnam_r='$d_getpwnam_r'
24594 d_getpwuid_r='$d_getpwuid_r'
24595 d_getsbyname='$d_getsbyname'
24596 d_getsbyport='$d_getsbyport'
24597 d_getsent='$d_getsent'
24598 d_getservbyname_r='$d_getservbyname_r'
24599 d_getservbyport_r='$d_getservbyport_r'
24600 d_getservent_r='$d_getservent_r'
24601 d_getservprotos='$d_getservprotos'
24602 d_getspnam='$d_getspnam'
24603 d_getspnam_r='$d_getspnam_r'
24604 d_gettimeod='$d_gettimeod'
24605 d_gmtime64='$d_gmtime64'
24606 d_gmtime_r='$d_gmtime_r'
24607 d_gnulibc='$d_gnulibc'
24608 d_grpasswd='$d_grpasswd'
24609 d_hasmntopt='$d_hasmntopt'
24613 d_ilogbl='$d_ilogbl'
24614 d_inc_version_list='$d_inc_version_list'
24616 d_inetaton='$d_inetaton'
24617 d_inetntop='$d_inetntop'
24618 d_inetpton='$d_inetpton'
24619 d_int64_t='$d_int64_t'
24620 d_ip_mreq='$d_ip_mreq'
24621 d_ip_mreq_source='$d_ip_mreq_source'
24622 d_ipv6_mreq='$d_ipv6_mreq'
24623 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24624 d_isascii='$d_isascii'
24625 d_isblank='$d_isblank'
24626 d_isfinite='$d_isfinite'
24627 d_isfinitel='$d_isfinitel'
24629 d_isinfl='$d_isinfl'
24630 d_isless='$d_isless'
24632 d_isnanl='$d_isnanl'
24633 d_isnormal='$d_isnormal'
24636 d_killpg='$d_killpg'
24637 d_lc_monetary_2008='$d_lc_monetary_2008'
24638 d_lchown='$d_lchown'
24639 d_ldbl_dig='$d_ldbl_dig'
24640 d_ldexpl='$d_ldexpl'
24641 d_lgamma='$d_lgamma'
24642 d_lgamma_r='$d_lgamma_r'
24643 d_libm_lib_version='$d_libm_lib_version'
24644 d_libname_unique='$d_libname_unique'
24646 d_llrint='$d_llrint'
24647 d_llrintl='$d_llrintl'
24648 d_llround='$d_llround'
24649 d_llroundl='$d_llroundl'
24650 d_localtime64='$d_localtime64'
24651 d_localtime_r='$d_localtime_r'
24652 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24653 d_locconv='$d_locconv'
24658 d_long_double_style_ieee='$d_long_double_style_ieee'
24659 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24660 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24661 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24662 d_long_double_style_vax='$d_long_double_style_vax'
24663 d_longdbl='$d_longdbl'
24664 d_longlong='$d_longlong'
24666 d_lrintl='$d_lrintl'
24667 d_lround='$d_lround'
24668 d_lroundl='$d_lroundl'
24669 d_lseekproto='$d_lseekproto'
24671 d_madvise='$d_madvise'
24672 d_malloc_good_size='$d_malloc_good_size'
24673 d_malloc_size='$d_malloc_size'
24675 d_mbstowcs='$d_mbstowcs'
24676 d_mbtowc='$d_mbtowc'
24677 d_memchr='$d_memchr'
24678 d_memcmp='$d_memcmp'
24679 d_memcpy='$d_memcpy'
24680 d_memmem='$d_memmem'
24681 d_memmove='$d_memmove'
24682 d_memset='$d_memset'
24684 d_mkdtemp='$d_mkdtemp'
24685 d_mkfifo='$d_mkfifo'
24686 d_mkstemp='$d_mkstemp'
24687 d_mkstemps='$d_mkstemps'
24688 d_mktime64='$d_mktime64'
24689 d_mktime='$d_mktime'
24692 d_modflproto='$d_modflproto'
24693 d_mprotect='$d_mprotect'
24695 d_msg_ctrunc='$d_msg_ctrunc'
24696 d_msg_dontroute='$d_msg_dontroute'
24697 d_msg_oob='$d_msg_oob'
24698 d_msg_peek='$d_msg_peek'
24699 d_msg_proxy='$d_msg_proxy'
24700 d_msgctl='$d_msgctl'
24701 d_msgget='$d_msgget'
24702 d_msghdr_s='$d_msghdr_s'
24703 d_msgrcv='$d_msgrcv'
24704 d_msgsnd='$d_msgsnd'
24706 d_munmap='$d_munmap'
24707 d_mymalloc='$d_mymalloc'
24710 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24711 d_nearbyint='$d_nearbyint'
24712 d_newlocale='$d_newlocale'
24713 d_nextafter='$d_nextafter'
24714 d_nexttoward='$d_nexttoward'
24716 d_nl_langinfo='$d_nl_langinfo'
24717 d_nv_preserves_uv='$d_nv_preserves_uv'
24718 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24719 d_off64_t='$d_off64_t'
24720 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24721 d_oldpthreads='$d_oldpthreads'
24722 d_oldsock='$d_oldsock'
24724 d_pathconf='$d_pathconf'
24726 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24727 d_phostname='$d_phostname'
24730 d_portable='$d_portable'
24732 d_prctl_set_name='$d_prctl_set_name'
24733 d_printf_format_null='$d_printf_format_null'
24734 d_procselfexe='$d_procselfexe'
24735 d_pseudofork='$d_pseudofork'
24736 d_pthread_atfork='$d_pthread_atfork'
24737 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24738 d_pthread_yield='$d_pthread_yield'
24739 d_ptrdiff_t='$d_ptrdiff_t'
24741 d_pwchange='$d_pwchange'
24742 d_pwclass='$d_pwclass'
24743 d_pwcomment='$d_pwcomment'
24744 d_pwexpire='$d_pwexpire'
24745 d_pwgecos='$d_pwgecos'
24746 d_pwpasswd='$d_pwpasswd'
24747 d_pwquota='$d_pwquota'
24750 d_querylocale='$d_querylocale'
24751 d_random_r='$d_random_r'
24752 d_re_comp='$d_re_comp'
24753 d_readdir64_r='$d_readdir64_r'
24754 d_readdir='$d_readdir'
24755 d_readdir_r='$d_readdir_r'
24756 d_readlink='$d_readlink'
24758 d_recvmsg='$d_recvmsg'
24759 d_regcmp='$d_regcmp'
24760 d_regcomp='$d_regcomp'
24761 d_remainder='$d_remainder'
24762 d_remquo='$d_remquo'
24763 d_rename='$d_rename'
24764 d_rewinddir='$d_rewinddir'
24768 d_safebcpy='$d_safebcpy'
24769 d_safemcpy='$d_safemcpy'
24770 d_sanemcmp='$d_sanemcmp'
24771 d_sbrkproto='$d_sbrkproto'
24772 d_scalbn='$d_scalbn'
24773 d_scalbnl='$d_scalbnl'
24774 d_sched_yield='$d_sched_yield'
24775 d_scm_rights='$d_scm_rights'
24776 d_seekdir='$d_seekdir'
24777 d_select='$d_select'
24779 d_semctl='$d_semctl'
24780 d_semctl_semid_ds='$d_semctl_semid_ds'
24781 d_semctl_semun='$d_semctl_semun'
24782 d_semget='$d_semget'
24784 d_sendmsg='$d_sendmsg'
24785 d_setegid='$d_setegid'
24786 d_seteuid='$d_seteuid'
24787 d_setgrent='$d_setgrent'
24788 d_setgrent_r='$d_setgrent_r'
24789 d_setgrps='$d_setgrps'
24790 d_sethent='$d_sethent'
24791 d_sethostent_r='$d_sethostent_r'
24792 d_setitimer='$d_setitimer'
24793 d_setlinebuf='$d_setlinebuf'
24794 d_setlocale='$d_setlocale'
24795 d_setlocale_r='$d_setlocale_r'
24796 d_setnent='$d_setnent'
24797 d_setnetent_r='$d_setnetent_r'
24798 d_setpent='$d_setpent'
24799 d_setpgid='$d_setpgid'
24800 d_setpgrp2='$d_setpgrp2'
24801 d_setpgrp='$d_setpgrp'
24802 d_setprior='$d_setprior'
24803 d_setproctitle='$d_setproctitle'
24804 d_setprotoent_r='$d_setprotoent_r'
24805 d_setpwent='$d_setpwent'
24806 d_setpwent_r='$d_setpwent_r'
24807 d_setregid='$d_setregid'
24808 d_setresgid='$d_setresgid'
24809 d_setresuid='$d_setresuid'
24810 d_setreuid='$d_setreuid'
24811 d_setrgid='$d_setrgid'
24812 d_setruid='$d_setruid'
24813 d_setsent='$d_setsent'
24814 d_setservent_r='$d_setservent_r'
24815 d_setsid='$d_setsid'
24816 d_setvbuf='$d_setvbuf'
24819 d_shmatprototype='$d_shmatprototype'
24820 d_shmctl='$d_shmctl'
24822 d_shmget='$d_shmget'
24823 d_sigaction='$d_sigaction'
24824 d_siginfo_si_addr='$d_siginfo_si_addr'
24825 d_siginfo_si_band='$d_siginfo_si_band'
24826 d_siginfo_si_errno='$d_siginfo_si_errno'
24827 d_siginfo_si_fd='$d_siginfo_si_fd'
24828 d_siginfo_si_pid='$d_siginfo_si_pid'
24829 d_siginfo_si_status='$d_siginfo_si_status'
24830 d_siginfo_si_uid='$d_siginfo_si_uid'
24831 d_siginfo_si_value='$d_siginfo_si_value'
24832 d_signbit='$d_signbit'
24833 d_sigprocmask='$d_sigprocmask'
24834 d_sigsetjmp='$d_sigsetjmp'
24835 d_sin6_scope_id='$d_sin6_scope_id'
24836 d_sitearch='$d_sitearch'
24837 d_snprintf='$d_snprintf'
24838 d_sockaddr_in6='$d_sockaddr_in6'
24839 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24840 d_sockatmark='$d_sockatmark'
24841 d_sockatmarkproto='$d_sockatmarkproto'
24842 d_socket='$d_socket'
24843 d_socklen_t='$d_socklen_t'
24844 d_sockpair='$d_sockpair'
24845 d_socks5_init='$d_socks5_init'
24846 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24848 d_srand48_r='$d_srand48_r'
24849 d_srandom_r='$d_srandom_r'
24850 d_sresgproto='$d_sresgproto'
24851 d_sresuproto='$d_sresuproto'
24853 d_statblks='$d_statblks'
24854 d_statfs_f_flags='$d_statfs_f_flags'
24855 d_statfs_s='$d_statfs_s'
24856 d_static_inline='$d_static_inline'
24857 d_statvfs='$d_statvfs'
24858 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24859 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24860 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24861 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24862 d_stdio_stream_array='$d_stdio_stream_array'
24863 d_stdiobase='$d_stdiobase'
24864 d_stdstdio='$d_stdstdio'
24865 d_strchr='$d_strchr'
24866 d_strcoll='$d_strcoll'
24867 d_strctcpy='$d_strctcpy'
24868 d_strerrm='$d_strerrm'
24869 d_strerror='$d_strerror'
24870 d_strerror_l='$d_strerror_l'
24871 d_strerror_r='$d_strerror_r'
24872 d_strftime='$d_strftime'
24873 d_strlcat='$d_strlcat'
24874 d_strlcpy='$d_strlcpy'
24875 d_strtod='$d_strtod'
24876 d_strtol='$d_strtol'
24877 d_strtold='$d_strtold'
24878 d_strtoll='$d_strtoll'
24879 d_strtoq='$d_strtoq'
24880 d_strtoul='$d_strtoul'
24881 d_strtoull='$d_strtoull'
24882 d_strtouq='$d_strtouq'
24883 d_strxfrm='$d_strxfrm'
24884 d_suidsafe='$d_suidsafe'
24885 d_symlink='$d_symlink'
24886 d_syscall='$d_syscall'
24887 d_syscallproto='$d_syscallproto'
24888 d_sysconf='$d_sysconf'
24889 d_sysernlst='$d_sysernlst'
24890 d_syserrlst='$d_syserrlst'
24891 d_system='$d_system'
24892 d_tcgetpgrp='$d_tcgetpgrp'
24893 d_tcsetpgrp='$d_tcsetpgrp'
24894 d_telldir='$d_telldir'
24895 d_telldirproto='$d_telldirproto'
24896 d_tgamma='$d_tgamma'
24898 d_timegm='$d_timegm'
24900 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24901 d_tm_tm_zone='$d_tm_tm_zone'
24902 d_tmpnam_r='$d_tmpnam_r'
24904 d_truncate='$d_truncate'
24905 d_truncl='$d_truncl'
24906 d_ttyname_r='$d_ttyname_r'
24907 d_tzname='$d_tzname'
24908 d_u32align='$d_u32align'
24909 d_ualarm='$d_ualarm'
24912 d_union_semun='$d_union_semun'
24913 d_unordered='$d_unordered'
24914 d_unsetenv='$d_unsetenv'
24915 d_uselocale='$d_uselocale'
24916 d_usleep='$d_usleep'
24917 d_usleepproto='$d_usleepproto'
24919 d_vendorarch='$d_vendorarch'
24920 d_vendorbin='$d_vendorbin'
24921 d_vendorlib='$d_vendorlib'
24922 d_vendorscript='$d_vendorscript'
24924 d_void_closedir='$d_void_closedir'
24925 d_voidsig='$d_voidsig'
24926 d_voidtty='$d_voidtty'
24927 d_volatile='$d_volatile'
24928 d_vprintf='$d_vprintf'
24929 d_vsnprintf='$d_vsnprintf'
24931 d_waitpid='$d_waitpid'
24932 d_wcscmp='$d_wcscmp'
24933 d_wcstombs='$d_wcstombs'
24934 d_wcsxfrm='$d_wcsxfrm'
24935 d_wctomb='$d_wctomb'
24936 d_writev='$d_writev'
24939 db_hashtype='$db_hashtype'
24940 db_prefixtype='$db_prefixtype'
24941 db_version_major='$db_version_major'
24942 db_version_minor='$db_version_minor'
24943 db_version_patch='$db_version_patch'
24944 default_inc_excludes_dot='$default_inc_excludes_dot'
24945 direntrytype='$direntrytype'
24948 doubleinfbytes='$doubleinfbytes'
24949 doublekind='$doublekind'
24950 doublemantbits='$doublemantbits'
24951 doublenanbytes='$doublenanbytes'
24952 doublesize='$doublesize'
24954 drand48_r_proto='$drand48_r_proto'
24956 dtraceobject='$dtraceobject'
24957 dynamic_ext='$dynamic_ext'
24963 endgrent_r_proto='$endgrent_r_proto'
24964 endhostent_r_proto='$endhostent_r_proto'
24965 endnetent_r_proto='$endnetent_r_proto'
24966 endprotoent_r_proto='$endprotoent_r_proto'
24967 endpwent_r_proto='$endpwent_r_proto'
24968 endservent_r_proto='$endservent_r_proto'
24969 eunicefix='$eunicefix'
24972 extensions='$extensions'
24973 extern_C='$extern_C'
24975 fflushNULL='$fflushNULL'
24976 fflushall='$fflushall'
24978 firstmakefile='$firstmakefile'
24980 fpossize='$fpossize'
24981 fpostype='$fpostype'
24982 freetype='$freetype'
24985 full_csh='$full_csh'
24986 full_sed='$full_sed'
24987 gccansipedantic='$gccansipedantic'
24988 gccosandvers='$gccosandvers'
24989 gccversion='$gccversion'
24990 getgrent_r_proto='$getgrent_r_proto'
24991 getgrgid_r_proto='$getgrgid_r_proto'
24992 getgrnam_r_proto='$getgrnam_r_proto'
24993 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24994 gethostbyname_r_proto='$gethostbyname_r_proto'
24995 gethostent_r_proto='$gethostent_r_proto'
24996 getlogin_r_proto='$getlogin_r_proto'
24997 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24998 getnetbyname_r_proto='$getnetbyname_r_proto'
24999 getnetent_r_proto='$getnetent_r_proto'
25000 getprotobyname_r_proto='$getprotobyname_r_proto'
25001 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25002 getprotoent_r_proto='$getprotoent_r_proto'
25003 getpwent_r_proto='$getpwent_r_proto'
25004 getpwnam_r_proto='$getpwnam_r_proto'
25005 getpwuid_r_proto='$getpwuid_r_proto'
25006 getservbyname_r_proto='$getservbyname_r_proto'
25007 getservbyport_r_proto='$getservbyport_r_proto'
25008 getservent_r_proto='$getservent_r_proto'
25009 getspnam_r_proto='$getspnam_r_proto'
25010 gidformat='$gidformat'
25016 gmtime_r_proto='$gmtime_r_proto'
25017 gnulibc_version='$gnulibc_version'
25019 groupcat='$groupcat'
25020 groupstype='$groupstype'
25023 h_sysfile='$h_sysfile'
25026 hostgenerate='$hostgenerate'
25027 hostosname='$hostosname'
25028 hostperl='$hostperl'
25029 html1dir='$html1dir'
25030 html1direxp='$html1direxp'
25031 html3dir='$html3dir'
25032 html3direxp='$html3direxp'
25041 i_arpainet='$i_arpainet'
25042 i_assert='$i_assert'
25044 i_bsdioctl='$i_bsdioctl'
25048 i_dirent='$i_dirent'
25050 i_execinfo='$i_execinfo'
25055 i_fp_class='$i_fp_class'
25057 i_gdbm_ndbm='$i_gdbm_ndbm'
25058 i_gdbmndbm='$i_gdbmndbm'
25060 i_ieeefp='$i_ieeefp'
25061 i_inttypes='$i_inttypes'
25062 i_langinfo='$i_langinfo'
25063 i_libutil='$i_libutil'
25064 i_limits='$i_limits'
25065 i_locale='$i_locale'
25066 i_machcthr='$i_machcthr'
25067 i_malloc='$i_malloc'
25068 i_mallocmalloc='$i_mallocmalloc'
25070 i_memory='$i_memory'
25071 i_mntent='$i_mntent'
25074 i_neterrno='$i_neterrno'
25075 i_netinettcp='$i_netinettcp'
25079 i_pthread='$i_pthread'
25081 i_quadmath='$i_quadmath'
25082 i_rpcsvcdbm='$i_rpcsvcdbm'
25084 i_shadow='$i_shadow'
25086 i_stdarg='$i_stdarg'
25087 i_stdbool='$i_stdbool'
25088 i_stddef='$i_stddef'
25089 i_stdint='$i_stdint'
25090 i_stdlib='$i_stdlib'
25091 i_string='$i_string'
25092 i_sunmath='$i_sunmath'
25093 i_sysaccess='$i_sysaccess'
25094 i_sysdir='$i_sysdir'
25095 i_sysfile='$i_sysfile'
25096 i_sysfilio='$i_sysfilio'
25098 i_sysioctl='$i_sysioctl'
25099 i_syslog='$i_syslog'
25100 i_sysmman='$i_sysmman'
25101 i_sysmode='$i_sysmode'
25102 i_sysmount='$i_sysmount'
25103 i_sysndir='$i_sysndir'
25104 i_sysparam='$i_sysparam'
25105 i_syspoll='$i_syspoll'
25106 i_sysresrc='$i_sysresrc'
25107 i_syssecrt='$i_syssecrt'
25108 i_sysselct='$i_sysselct'
25109 i_syssockio='$i_syssockio'
25110 i_sysstat='$i_sysstat'
25111 i_sysstatfs='$i_sysstatfs'
25112 i_sysstatvfs='$i_sysstatvfs'
25113 i_systime='$i_systime'
25114 i_systimek='$i_systimek'
25115 i_systimes='$i_systimes'
25116 i_systypes='$i_systypes'
25117 i_sysuio='$i_sysuio'
25119 i_sysutsname='$i_sysutsname'
25120 i_sysvfs='$i_sysvfs'
25121 i_syswait='$i_syswait'
25122 i_termio='$i_termio'
25123 i_termios='$i_termios'
25125 i_unistd='$i_unistd'
25128 i_values='$i_values'
25129 i_varargs='$i_varargs'
25130 i_varhdr='$i_varhdr'
25132 i_xlocale='$i_xlocale'
25133 ignore_versioned_solibs='$ignore_versioned_solibs'
25134 inc_version_list='$inc_version_list'
25135 inc_version_list_init='$inc_version_list_init'
25139 initialinstalllocation='$initialinstalllocation'
25140 installarchlib='$installarchlib'
25141 installbin='$installbin'
25142 installhtml1dir='$installhtml1dir'
25143 installhtml3dir='$installhtml3dir'
25144 installman1dir='$installman1dir'
25145 installman3dir='$installman3dir'
25146 installprefix='$installprefix'
25147 installprefixexp='$installprefixexp'
25148 installprivlib='$installprivlib'
25149 installscript='$installscript'
25150 installsitearch='$installsitearch'
25151 installsitebin='$installsitebin'
25152 installsitehtml1dir='$installsitehtml1dir'
25153 installsitehtml3dir='$installsitehtml3dir'
25154 installsitelib='$installsitelib'
25155 installsiteman1dir='$installsiteman1dir'
25156 installsiteman3dir='$installsiteman3dir'
25157 installsitescript='$installsitescript'
25158 installstyle='$installstyle'
25159 installusrbinperl='$installusrbinperl'
25160 installvendorarch='$installvendorarch'
25161 installvendorbin='$installvendorbin'
25162 installvendorhtml1dir='$installvendorhtml1dir'
25163 installvendorhtml3dir='$installvendorhtml3dir'
25164 installvendorlib='$installvendorlib'
25165 installvendorman1dir='$installvendorman1dir'
25166 installvendorman3dir='$installvendorman3dir'
25167 installvendorscript='$installvendorscript'
25169 issymlink='$issymlink'
25170 ivdformat='$ivdformat'
25173 known_extensions='$known_extensions'
25176 ld_can_script='$ld_can_script'
25177 lddlflags='$lddlflags'
25179 ldflags_uselargefiles='$ldflags_uselargefiles'
25180 ldlibpthname='$ldlibpthname'
25187 libsdirs='$libsdirs'
25188 libsfiles='$libsfiles'
25189 libsfound='$libsfound'
25190 libspath='$libspath'
25191 libswanted='$libswanted'
25192 libswanted_uselargefiles='$libswanted_uselargefiles'
25198 localtime_r_proto='$localtime_r_proto'
25199 locincpth='$locincpth'
25200 loclibpth='$loclibpth'
25201 longdblinfbytes='$longdblinfbytes'
25202 longdblkind='$longdblkind'
25203 longdblmantbits='$longdblmantbits'
25204 longdblnanbytes='$longdblnanbytes'
25205 longdblsize='$longdblsize'
25206 longlongsize='$longlongsize'
25207 longsize='$longsize'
25211 lseeksize='$lseeksize'
25212 lseektype='$lseektype'
25216 make_set_make='$make_set_make'
25217 mallocobj='$mallocobj'
25218 mallocsrc='$mallocsrc'
25219 malloctype='$malloctype'
25221 man1direxp='$man1direxp'
25224 man3direxp='$man3direxp'
25226 mips_type='$mips_type'
25227 mistrustnm='$mistrustnm'
25229 mmaptype='$mmaptype'
25230 modetype='$modetype'
25232 multiarch='$multiarch'
25234 myarchname='$myarchname'
25235 mydomain='$mydomain'
25236 myhostname='$myhostname'
25239 need_va_copy='$need_va_copy'
25240 netdb_hlen_type='$netdb_hlen_type'
25241 netdb_host_type='$netdb_host_type'
25242 netdb_name_type='$netdb_name_type'
25243 netdb_net_type='$netdb_net_type'
25246 nm_so_opt='$nm_so_opt'
25247 nonxs_ext='$nonxs_ext'
25249 nvEUformat='$nvEUformat'
25250 nvFUformat='$nvFUformat'
25251 nvGUformat='$nvGUformat'
25252 nv_overflows_integers_at='$nv_overflows_integers_at'
25253 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25254 nveformat='$nveformat'
25255 nvfformat='$nvfformat'
25256 nvgformat='$nvgformat'
25257 nvmantbits='$nvmantbits'
25260 o_nonblock='$o_nonblock'
25262 old_pthread_create_joinable='$old_pthread_create_joinable'
25263 optimize='$optimize'
25264 orderlib='$orderlib'
25267 otherlibdirs='$otherlibdirs'
25271 patchlevel='$patchlevel'
25272 path_sep='$path_sep'
25275 perl_patchlevel='$perl_patchlevel'
25276 perl_static_inline='$perl_static_inline'
25277 perladmin='$perladmin'
25278 perllibs='$perllibs'
25279 perlpath='$perlpath'
25281 phostname='$phostname'
25287 prefixexp='$prefixexp'
25289 privlibexp='$privlibexp'
25290 procselfexe='$procselfexe'
25291 prototype='$prototype'
25293 quadkind='$quadkind'
25294 quadtype='$quadtype'
25295 randbits='$randbits'
25296 randfunc='$randfunc'
25297 random_r_proto='$random_r_proto'
25298 randseedtype='$randseedtype'
25300 rd_nodata='$rd_nodata'
25301 readdir64_r_proto='$readdir64_r_proto'
25302 readdir_r_proto='$readdir_r_proto'
25303 revision='$revision'
25309 sGMTIME_max='$sGMTIME_max'
25310 sGMTIME_min='$sGMTIME_min'
25311 sLOCALTIME_max='$sLOCALTIME_max'
25312 sLOCALTIME_min='$sLOCALTIME_min'
25313 sPRIEUldbl='$sPRIEUldbl'
25314 sPRIFUldbl='$sPRIFUldbl'
25315 sPRIGUldbl='$sPRIGUldbl'
25316 sPRIXU64='$sPRIXU64'
25318 sPRIeldbl='$sPRIeldbl'
25319 sPRIfldbl='$sPRIfldbl'
25320 sPRIgldbl='$sPRIgldbl'
25325 sSCNfldbl='$sSCNfldbl'
25326 sched_yield='$sched_yield'
25327 scriptdir='$scriptdir'
25328 scriptdirexp='$scriptdirexp'
25330 seedfunc='$seedfunc'
25331 selectminbits='$selectminbits'
25332 selecttype='$selecttype'
25333 sendmail='$sendmail'
25334 setgrent_r_proto='$setgrent_r_proto'
25335 sethostent_r_proto='$sethostent_r_proto'
25336 setlocale_r_proto='$setlocale_r_proto'
25337 setnetent_r_proto='$setnetent_r_proto'
25338 setprotoent_r_proto='$setprotoent_r_proto'
25339 setpwent_r_proto='$setpwent_r_proto'
25340 setservent_r_proto='$setservent_r_proto'
25343 sharpbang='$sharpbang'
25344 shmattype='$shmattype'
25345 shortsize='$shortsize'
25348 sig_count='$sig_count'
25349 sig_name='$sig_name'
25350 sig_name_init='$sig_name_init'
25352 sig_num_init='$sig_num_init'
25353 sig_size='$sig_size'
25354 signal_t='$signal_t'
25355 sitearch='$sitearch'
25356 sitearchexp='$sitearchexp'
25358 sitebinexp='$sitebinexp'
25359 sitehtml1dir='$sitehtml1dir'
25360 sitehtml1direxp='$sitehtml1direxp'
25361 sitehtml3dir='$sitehtml3dir'
25362 sitehtml3direxp='$sitehtml3direxp'
25364 sitelib_stem='$sitelib_stem'
25365 sitelibexp='$sitelibexp'
25366 siteman1dir='$siteman1dir'
25367 siteman1direxp='$siteman1direxp'
25368 siteman3dir='$siteman3dir'
25369 siteman3direxp='$siteman3direxp'
25370 siteprefix='$siteprefix'
25371 siteprefixexp='$siteprefixexp'
25372 sitescript='$sitescript'
25373 sitescriptexp='$sitescriptexp'
25374 sizesize='$sizesize'
25375 sizetype='$sizetype'
25379 sockethdr='$sockethdr'
25380 socketlib='$socketlib'
25381 socksizetype='$socksizetype'
25383 spackage='$spackage'
25384 spitshell='$spitshell'
25385 srand48_r_proto='$srand48_r_proto'
25386 srandom_r_proto='$srandom_r_proto'
25388 ssizetype='$ssizetype'
25389 st_ino_sign='$st_ino_sign'
25390 st_ino_size='$st_ino_size'
25391 startperl='$startperl'
25393 static_ext='$static_ext'
25395 stdio_base='$stdio_base'
25396 stdio_bufsiz='$stdio_bufsiz'
25397 stdio_cnt='$stdio_cnt'
25398 stdio_filbuf='$stdio_filbuf'
25399 stdio_ptr='$stdio_ptr'
25400 stdio_stream_array='$stdio_stream_array'
25401 strerror_r_proto='$strerror_r_proto'
25404 subversion='$subversion'
25409 targetarch='$targetarch'
25410 targetdir='$targetdir'
25411 targetenv='$targetenv'
25412 targethost='$targethost'
25413 targetmkdir='$targetmkdir'
25414 targetport='$targetport'
25415 targetsh='$targetsh'
25419 timeincl='$timeincl'
25420 timetype='$timetype'
25421 tmpnam_r_proto='$tmpnam_r_proto'
25427 ttyname_r_proto='$ttyname_r_proto'
25436 uidformat='$uidformat'
25442 uquadtype='$uquadtype'
25443 use5005threads='$use5005threads'
25444 use64bitall='$use64bitall'
25445 use64bitint='$use64bitint'
25446 usecbacktrace='$usecbacktrace'
25447 usecrosscompile='$usecrosscompile'
25448 usedevel='$usedevel'
25450 usedtrace='$usedtrace'
25451 usefaststdio='$usefaststdio'
25452 useithreads='$useithreads'
25453 usekernprocpathname='$usekernprocpathname'
25454 uselargefiles='$uselargefiles'
25455 uselongdouble='$uselongdouble'
25456 usemallocwrap='$usemallocwrap'
25457 usemorebits='$usemorebits'
25458 usemultiplicity='$usemultiplicity'
25459 usemymalloc='$usemymalloc'
25461 usensgetexecutablepath='$usensgetexecutablepath'
25462 useopcode='$useopcode'
25463 useperlio='$useperlio'
25464 useposix='$useposix'
25465 usequadmath='$usequadmath'
25466 usereentrant='$usereentrant'
25467 userelocatableinc='$userelocatableinc'
25468 useshrplib='$useshrplib'
25469 usesitecustomize='$usesitecustomize'
25470 usesocks='$usesocks'
25471 usethreads='$usethreads'
25472 usevendorprefix='$usevendorprefix'
25473 useversionedarchname='$useversionedarchname'
25474 usevfork='$usevfork'
25477 uvXUformat='$uvXUformat'
25478 uvoformat='$uvoformat'
25481 uvuformat='$uvuformat'
25482 uvxformat='$uvxformat'
25484 vendorarch='$vendorarch'
25485 vendorarchexp='$vendorarchexp'
25486 vendorbin='$vendorbin'
25487 vendorbinexp='$vendorbinexp'
25488 vendorhtml1dir='$vendorhtml1dir'
25489 vendorhtml1direxp='$vendorhtml1direxp'
25490 vendorhtml3dir='$vendorhtml3dir'
25491 vendorhtml3direxp='$vendorhtml3direxp'
25492 vendorlib='$vendorlib'
25493 vendorlib_stem='$vendorlib_stem'
25494 vendorlibexp='$vendorlibexp'
25495 vendorman1dir='$vendorman1dir'
25496 vendorman1direxp='$vendorman1direxp'
25497 vendorman3dir='$vendorman3dir'
25498 vendorman3direxp='$vendorman3direxp'
25499 vendorprefix='$vendorprefix'
25500 vendorprefixexp='$vendorprefixexp'
25501 vendorscript='$vendorscript'
25502 vendorscriptexp='$vendorscriptexp'
25504 version_patchlevel_string='$version_patchlevel_string'
25505 versiononly='$versiononly'
25509 yaccflags='$yaccflags'
25514 : add special variables
25515 $test -f $src/patchlevel.h && \
25516 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25517 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25518 echo "PERL_CONFIG_SH=true" >>config.sh
25520 : propagate old symbols
25521 if $test -f UU/config.sh; then
25522 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25523 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25524 config.sh config.sh UU/oldconfig.sh |\
25525 $sort | $uniq -u >UU/oldsyms
25526 set X `$cat UU/oldsyms`
25532 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25534 echo ": Variables propagated from previous config.sh file." >>config.sh
25535 for sym in `$cat UU/oldsyms`; do
25536 echo " Propagating $hint variable "'$'"$sym..."
25537 eval 'tmp="$'"${sym}"'"'
25539 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25545 : preserve RCS keywords in files with variable substitution, grrr
25548 : Finish up by extracting the .SH files
25551 echo "Stopping at your request, leaving temporary files around."
25561 If you'd like to make any changes to the config.sh file before I begin
25562 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25565 rp="Press return or use a shell escape to edit config.sh:"
25570 *) : in case they cannot read
25571 sh 1>&4 -c "$ans";;
25576 : if this fails, just run all the .SH files by hand
25585 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25592 Now you need to generate make dependencies by running "$make depend".
25593 You might prefer to run it in background: "$make depend > makedepend.out &"
25594 It can take a while, so you might not want to run it right now.
25599 rp="Run $make depend now?"
25603 $make depend && echo "Now you must run '$make'."
25606 echo "You must run '$make depend' then '$make'."
25609 elif test -f [Mm]akefile; then
25611 echo "Now you must run a $make."
25613 echo "Configure done."
25616 if $test -f Policy.sh; then
25619 If you compile $package on a different machine or from a different object
25620 directory, copy the Policy.sh file from this object directory to the
25621 new one before you run Configure -- this will help you with most of
25622 the policy defaults.
25626 if $test -f UU/config.msg; then
25627 echo "Hmm. I also noted the following information while running:"
25629 $cat UU/config.msg >&4
25631 $rm -f kit*isdone ark*isdone