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=''
1011 d_gdbm_ndbm_h_uses_prototypes=''
1012 d_gdbmndbm_h_uses_prototypes=''
1014 d_ndbm_h_uses_prototypes=''
1090 d_inc_version_list=''
1092 inc_version_list_init=''
1100 installusrbinperl=''
1116 ignore_versioned_solibs=''
1132 d_double_has_negative_zero=''
1133 d_double_has_subnormals=''
1134 d_double_style_cray=''
1135 d_double_style_ibm=''
1136 d_double_style_ieee=''
1137 d_double_style_vax=''
1188 d_perl_otherlibdirs=''
1196 api_versionstring=''
1202 version_patchlevel_string=''
1206 d_nv_preserves_uv=''
1207 d_nv_zero_is_allbits_zero=''
1218 nv_overflows_integers_at=''
1219 nv_preserves_uv_bits=''
1292 installsitehtml1dir=''
1295 installsitehtml3dir=''
1302 installsiteman1dir=''
1305 installsiteman3dir=''
1310 installsitescript=''
1328 d_stdio_stream_array=''
1329 stdio_stream_array=''
1347 usekernprocpathname=''
1348 ccflags_uselargefiles=''
1349 ldflags_uselargefiles=''
1350 libswanted_uselargefiles=''
1359 usensgetexecutablepath=''
1373 installvendorarch=''
1380 installvendorhtml1dir=''
1382 vendorhtml1direxp=''
1383 installvendorhtml3dir=''
1385 vendorhtml3direxp=''
1391 installvendorman1dir=''
1394 installvendorman3dir=''
1401 installvendorscript=''
1412 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1415 : We must find out about Eunice early
1417 if test -f /etc/unixtovms; then
1418 eunicefix=/etc/unixtovms
1420 if test -f /etc/unixtovms.exe; then
1421 eunicefix=/etc/unixtovms.exe
1424 : Set executable suffix now -- needed before hints available
1425 if test -f "/libs/version.library"; then
1428 elif test -f "/system/gnu_library/bin/ar.pm"; then
1431 elif test -n "$DJGPP"; then
1434 elif test -f /kern/cookiejar; then
1437 elif test -d c:/. -o -n "$is_os2" ; then
1444 : Possible local include directories to search.
1445 : Set locincpth to "" in a hint file to defeat local include searches.
1446 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1447 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1449 : no include file wanted by default
1452 : Enable -DEBUGGING and -DDEBUGGING from the command line
1456 : Trailing extension. Override this in a hint file, if needed.
1457 : Extra object files, if any, needed on this platform.
1460 : change the next line if compiling for Xenix/286 on Xenix/386
1461 xlibpth='/usr/lib/386 /lib/386'
1462 : Possible local library directories to search.
1463 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1464 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1466 : general looking path for locating libraries
1467 glibpth="/lib /usr/lib $xlibpth"
1468 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1469 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1470 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1471 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1473 : Private path used by Configure to find libraries. Its value
1474 : is prepended to libpth. This variable takes care of special
1475 : machines, like the mips. Usually, it should be empty.
1478 : default library list
1480 : some systems want to use only the non-versioned libso:s
1481 ignore_versioned_solibs=''
1485 : set useposix=false in your hint file to disable the POSIX extension.
1487 : set useopcode=false in your hint file to disable the Opcode extension.
1490 ccflags_uselargefiles=''
1491 ldflags_uselargefiles=''
1492 libswanted_uselargefiles=''
1493 : set usemultiplicity on the Configure command line to enable multiplicity.
1494 : set usesocks on the Configure command line to enable socks.
1496 : set usethreads on the Configure command line to enable threads.
1497 usereentrant='undef'
1498 : List of libraries we want.
1499 : If anyone needs extra -lxxx, put those in a hint file.
1500 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1501 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1502 : We probably want to search /usr/shlib before most other libraries.
1503 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1504 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1505 glibpth="/usr/shlib $glibpth"
1506 : Do not use vfork unless overridden by a hint file.
1509 : Find the basic shell for Bourne shell scripts
1513 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1516 if test -f "$xxx"; then
1519 : Build up a list and do a single loop so we can 'break' out.
1520 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1521 for xxx in sh bash ksh pdksh ash; do
1523 try="$try ${p}/${xxx}"
1527 if test -f "$xxx"; then
1530 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1533 elif test -f "$xxx.exe"; then
1544 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1546 Usually it's in /bin/sh. How did you even get this far?
1547 Please contact me (Perl Maintainers) at perlbug@perl.org and
1548 we'll try to straighten this all out.
1554 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1555 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1558 : see if sh knows # comments
1559 if `$sh -c '#' >/dev/null 2>&1`; then
1563 test -f $xcat$_exe || xcat=/usr/bin/cat
1564 if test ! -f $xcat$_exe; then
1565 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1566 if test -f $p/cat$_exe; then
1571 if test ! -f $xcat$_exe; then
1572 echo "Can't find cat anywhere!"
1576 echo "#!$xcat" >sharp
1579 ./sharp > today 2>/dev/null
1580 if test -s today; then
1583 echo "#! $xcat" > sharp
1586 ./sharp > today 2>/dev/null
1587 if test -s today; then
1595 echo "Your $sh doesn't grok # comments--I will strip them later on."
1598 echo "exec grep -v '^[ ]*#'" >spitshell
1600 $eunicefix spitshell
1601 spitshell=`pwd`/spitshell
1603 echo "I presume that if # doesn't work, #! won't work either!"
1608 : figure out how to guarantee sh startup
1610 '') startsh=${sharpbang}${sh} ;;
1622 : echo "Yup, it does."
1624 echo "Hmm... '$startsh' does not guarantee sh startup..."
1625 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1629 : Save command line options in file UU/cmdline.opt for later use in
1630 : generating config.sh.
1631 cat > cmdline.opt <<EOSH
1632 : Configure command line arguments.
1641 cat >>cmdline.opt <<EOSH
1642 config_arg$argn='$arg'
1644 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1647 arg_exp=`cat cmdl.opt`
1648 args_exp="$args_exp$args_sep'$arg_exp'"
1649 argn=`expr $argn + 1`
1654 : produce awk script to parse command line options
1655 cat >options.awk <<'EOF'
1657 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1659 len = length(optstr);
1660 for (i = 1; i <= len; i++) {
1661 c = substr(optstr, i, 1);
1662 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1673 if (substr(str, 1, 1) != "-") {
1674 printf("'%s'\n", str);
1678 for (i = 2; i <= len; i++) {
1679 c = substr(str, i, 1);
1681 printf("-%s\n", substr(str, i));
1687 printf("'%s'\n", substr(str, i + 1));
1700 : process the command line options
1701 set X `for arg in "$@"; do echo "X$arg"; done |
1702 sed -e s/X// | awk -f options.awk`
1707 : set up default values
1716 rm -f optdef.sh posthint.sh
1717 cat >optdef.sh <<EOS
1723 while test $# -gt 0; do
1725 -d) shift; fastread=yes;;
1726 -e) shift; alldone=cont;;
1730 if test -r "$1"; then
1733 echo "$me: cannot read config file $1." >&2
1739 -h) shift; error=true;;
1740 -r) shift; reuseval=true;;
1741 -s) shift; silent=true; realsilent=true;;
1742 -E) shift; alldone=exit;;
1743 -K) shift; knowitall=true;;
1745 -S) shift; silent=true; extractsh=true;;
1750 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1751 echo "$me: ignoring -D $1" >&2
1754 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1755 *) echo "$1='define'" >> optdef.sh;;
1762 *=) echo "$1" >> optdef.sh;;
1764 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1765 echo "$me: ignoring -U $1" >&2
1767 *) echo "$1='undef'" >> optdef.sh;;
1778 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1782 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1783 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1789 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1790 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1791 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1792 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1793 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1794 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1800 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1802 echo "$yyy=''" >> posthint.sh ;;
1807 echo "$yyy='$zzz'" >> posthint.sh ;;
1809 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1811 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1816 echo "$yyy=$zzz" >> posthint.sh ;;
1817 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1821 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1824 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1832 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1833 [-U symbol] [-U symbol=] [-A command:symbol...]
1834 -d : use defaults for all answers.
1835 -e : go on without questioning past the production of config.sh.
1836 -f : specify an alternate default configuration file.
1837 -h : print this help message and exit (with an error status).
1838 -r : reuse C symbols value if possible (skips costly nm extraction).
1839 -s : silent mode, only echoes questions and essential information.
1840 -D : define symbol to have some value:
1841 -D symbol symbol gets the value 'define'
1842 -D symbol=value symbol gets the value 'value'
1843 common used examples (see INSTALL for more info):
1844 -Duse64bitint use 64bit integers
1845 -Duse64bitall use 64bit integers and pointers
1846 -Dusethreads use thread support
1847 -Dinc_version_list=none do not include older perl trees in @INC
1848 -DEBUGGING=none DEBUGGING options
1849 -Dcc=gcc choose your compiler
1850 -Dprefix=/opt/perl5 choose your destination
1851 -E : stop at the end of questions, after having produced config.sh.
1852 -K : do not use unless you know what you are doing.
1853 -O : ignored for backward compatibility
1854 -S : perform variable substitutions on all .SH files (can mix with -f)
1855 -U : undefine symbol:
1856 -U symbol symbol gets the value 'undef'
1857 -U symbol= symbol gets completely empty
1859 -A : manipulate symbol after the platform specific hints have been applied:
1860 -A append:symbol=value append value to symbol
1861 -A symbol=value like append:, but with a separating space
1862 -A define:symbol=value define symbol to have value
1863 -A clear:symbol define symbol to be ''
1864 -A define:symbol define symbol to be 'define'
1865 -A eval:symbol=value define symbol to be eval of value
1866 -A prepend:symbol=value prepend value to symbol
1867 -A undef:symbol define symbol to be 'undef'
1868 -A undef:symbol= define symbol to be ''
1869 e.g.: -A prepend:libswanted='cl pthread '
1870 -A ccflags=-DSOME_MACRO
1871 -V : print version number and exit (with a zero status).
1878 case "$fastread$alldone" in
1881 case "$extractsh" in
1884 if test ! -t 0; then
1885 echo "Say 'sh Configure', not 'sh <Configure'"
1895 true) exec 1>/dev/null;;
1898 : run the defines and the undefines, if any, but leave the file out there...
1900 grep '\\' optdef.sh >/dev/null 2>&1
1901 if test $? = 0; then
1902 echo "Configure does not support \\ in -D arguments"
1906 : create the posthint manipulation script and leave the file out there...
1911 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1912 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1913 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1914 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1915 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1918 : Some greps do not return status, grrr.
1919 echo "grimblepritz" >grimble
1920 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1922 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1928 : the following should work in any shell
1932 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1933 cat >contains <<'EOSS'
1934 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1939 : Find the path to the source tree
1942 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1946 *) src=`cd ../$src && pwd` ;;
1959 if test -f $rsrc/Configure && \
1960 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1962 : found it, so we are ok.
1965 for src in . .. ../.. ../../.. ../../../..; do
1966 if test -f ../$src/Configure && \
1967 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1978 Sorry, I can't seem to locate the source dir for $package. Please start
1979 Configure with an explicit path -- i.e. /some/path/Configure.
1987 echo "Sources for $package found in \"$src\"." >&4
1991 : script used to extract .SH files with variable substitutions
1992 cat >extract <<'EOS'
1994 echo "Doing variable substitutions on .SH files..."
1995 if test -f MANIFEST; then
1996 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1998 echo "(Looking for .SH files under the source directory.)"
1999 set x `(cd "$src"; find . -name "*.SH" -print)`
2003 0) set x `(cd "$src"; echo *.SH)`; shift;;
2005 if test ! -f "$src/$1"; then
2011 while test $name; do
2012 if test ! -d "$name"; then
2013 create="$name $create";
2014 name=`echo $name | sed -e "s|^[^/]*$||"`;
2015 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2020 for file in $create; do
2029 dir=`expr X$file : 'X\(.*\)/'`
2030 file=`expr X$file : 'X.*/\(.*\)'`
2031 (cd "$dir" && . ./$file)
2041 dir=`expr X$file : 'X\(.*\)/'`
2042 file=`expr X$file : 'X.*/\(.*\)'`
2043 (set x $dir; shift; eval $mkdir_p)
2044 sh <"$src/$dir/$file"
2053 if test -f "$src/config_h.SH"; then
2054 if test ! -f config.h; then
2055 : oops, they left it out of MANIFEST, probably, so do it anyway.
2056 . "$src/config_h.SH"
2061 : extract files and exit if asked to do so
2062 case "$extractsh" in
2064 case "$realsilent" in
2068 case "$config_sh" in
2069 '') config_sh='config.sh';;
2072 echo "Fetching answers from $config_sh..."
2079 echo "Extraction done."
2084 : Eunice requires " " instead of "", can you believe it
2087 echo "Beginning of configuration questions for $package."
2089 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2091 : first determine how to suppress newline on echo command
2093 echo "Checking echo to see how to suppress newlines..."
2094 (echo "hi there\c" ; echo " ") >.echotmp
2095 if $contains c .echotmp >/dev/null 2>&1 ; then
2106 echo $n "The star should be here-->$c"
2110 : Now test for existence of everything in MANIFEST
2112 if test -f "$rsrc/MANIFEST"; then
2113 echo "First let's make sure your kit is complete. Checking..." >&4
2114 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2115 (split -l 50 2>/dev/null || split -50)
2118 for filelist in x??; do
2119 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2120 >/dev/null 2>>"$tmppwd/missing")
2122 if test -s missing; then
2126 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2128 You have the option of continuing the configuration process, despite the
2129 distinct possibility that your kit is damaged, by typing 'y'es. If you
2130 do, don't blame me if something goes wrong. I advise you to type 'n'o
2131 and contact the author (perlbug@perl.org).
2134 echo $n "Continue? [n] $c" >&4
2138 echo "Continuing..." >&4
2142 echo "ABORTING..." >&4
2147 echo "Looks good..."
2150 echo "There is no MANIFEST file. I hope your kit is complete !"
2154 : Find the appropriate value for a newline for tr
2155 if test -n "$DJGPP"; then
2158 if test X"$trnl" = X; then
2159 case "`echo foo | tr '\n' x 2>/dev/null`" in
2163 if test X"$trnl" = X; then
2164 case "`echo foo | tr '\012' x 2>/dev/null`" in
2165 foox) trnl='\012' ;;
2168 if test X"$trnl" = X; then
2169 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2170 fooxy) trnl='\n\r' ;;
2173 if test X"$trnl" = X; then
2176 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2182 : compute the number of columns on the terminal for proper question formatting
2187 : set up the echo used in my read
2188 myecho="case \"\$xxxm\" in
2189 '') echo $n \"\$rp $c\" >&4;;
2191 '') echo $n \"[\$xxxm] $c\";;
2193 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2195 echo $n \"[\$xxxm] $c\" >&4
2197 echo $n \"\$rp [\$xxxm] $c\" >&4
2203 : now set up to do reads with possible shell escape and default assignment
2209 case "\$fastread" in
2210 yes) case "\$dflt" in
2213 case "\$silent-\$rp" in
2218 *) case "\$silent" in
2219 true) case "\$rp" in
2224 while expr "X\$ans" : "X!" >/dev/null; do
2228 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2236 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2245 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2250 echo "(OK, I'll run with -d after this question.)" >&4
2253 echo "*** Sorry, \$1 not supported yet." >&4
2263 echo "*** Substitution done -- please confirm."
2265 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2270 echo "*** Error -- try again."
2277 case "\$ans\$xxxm\$nostick" in
2289 : create .config dir to save info across Configure sessions
2290 test -d ../.config || mkdir ../.config
2291 cat >../.config/README <<EOF
2292 This directory created by Configure to save information that should
2293 persist across sessions for $package.
2295 You may safely delete it if you wish.
2298 : See if we are using a devel version and want that
2299 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2302 usedevel="$define" ;;
2303 *) case "$xversion" in
2306 *** WHOA THERE!!! ***
2308 This is an UNSTABLE DEVELOPMENT release.
2309 The version of this $package distribution is $xversion, that is, odd,
2310 (as opposed to even) and that signifies a development release.
2311 If you want a maintenance release, you want an even-numbered version.
2313 Do ***NOT*** install this into production use.
2314 Data corruption and crashes are possible.
2316 It is most seriously suggested that you do not continue any further
2317 unless you want to help in developing and debugging Perl.
2319 If you *still* want to build perl, you can answer 'y' now,
2320 or pass -Dusedevel to Configure.
2323 rp='Do you really want to continue?'
2327 [yY]) echo >&4 "Okay, continuing."
2328 usedevel="$define" ;;
2329 *) echo >&4 "Okay, bye."
2340 case "$versiononly" in
2341 '') versiononly="$define" ;;
2343 case "$installusrbinperl" in
2344 '') installusrbinperl="$undef" ;;
2349 : general instructions
2352 user=`(logname) 2>/dev/null`
2354 '') user=`whoami 2>&1`;;
2356 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2359 rp='Would you like to see the instructions?'
2370 This installation shell script will examine your system and ask you questions
2371 to determine how the perl5 package should be installed. If you get
2372 stuck on a question, you may use a ! shell escape to start a subshell or
2373 execute a command. Many of the questions will have default answers in square
2374 brackets; typing carriage return will give you the default.
2376 On some of the questions which ask for file or directory names you are allowed
2377 to use the ~name construct to specify the login directory belonging to "name",
2378 even if you don't have a shell which knows about that. Questions where this is
2379 allowed will be marked "(~name ok)".
2383 dflt='Type carriage return to continue'
2387 The prompter used in this script allows you to use shell variables and
2388 backticks in your answers. You may use $1, $2, etc... to refer to the words
2389 in the default answer, as if the default line was a set of arguments given to a
2390 script shell. This means you may also use $* to repeat the whole default line,
2391 so you do not have to re-type everything to add something to the default.
2393 Every time there is a substitution, you will have to confirm. If there is an
2394 error (e.g. an unmatched backtick), the default answer will remain unchanged
2395 and you will be prompted again.
2397 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2398 the questions and use the computed defaults (or the previous answers if there
2399 was already a config.sh file). Type 'Configure -h' for a list of options.
2400 You may also start interactively and then answer '& -d' at any prompt to turn
2401 on the non-interactive behaviour for the remainder of the execution.
2407 Much effort has been expended to ensure that this shell script will run on any
2408 Unix system. If despite that it blows up on yours, your best bet is to edit
2409 Configure and run it again. If you can't run Configure for some reason,
2410 you'll have to generate a config.sh file by hand. Whatever problems you
2411 have, let me (perlbug@perl.org) know how I blew it.
2413 This installation script affects things in two ways:
2415 1) it may do direct variable substitutions on some of the files included
2417 2) it builds a config.h file for inclusion in C programs. You may edit
2418 any of these files as the need arises after running this script.
2420 If you make a mistake on a question, there is no easy way to back up to it
2421 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2422 files. Configure will offer to let you do this before it runs the SH files.
2425 dflt='Type carriage return to continue'
2427 case "$firsttime" in
2428 true) echo $user >>../.config/instruct;;
2432 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2433 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2434 if test "X$sysroot" = X; then
2439 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2440 # _sysroot is used in places where we need --sysroot=foo
2441 # but using the rest of the flags could cause issues.
2442 _sysroot="--sysroot=$sysroot";
2446 ccflags="$ccflags $_sysroot"
2451 ldflags="$ldflags $_sysroot"
2456 cppflags="$cppflags $_sysroot"
2458 # lddlflags updated below in lddlflags section;
2459 # same with cccdlflags
2463 # Adjust some defaults to also use $sysroot
2464 for var in xlibpth loclibpth locincpth glibpth; do
2467 for path in $xxx; do
2468 eval $var=\"\$$var $sysroot$path\"
2474 : find out where common programs are
2476 echo "Locating common programs..." >&4
2489 if test -d \$dir/\$thing; then
2495 for thisthing in \$dir/\$thing; do
2496 : just loop through to pick last item
2498 if test -f \$thisthing; then
2501 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2504 elif test -f \$dir/\$thing.exe; then
2505 if test -n "$DJGPP"; then
2506 echo \$dir/\$thing.exe
2507 elif test "$eunicefix" != ":"; then
2508 : on Eunice apparently
2561 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2562 pth="$pth $sysroot/lib $sysroot/usr/lib"
2563 for file in $loclist; do
2567 if test -f "$xxx"; then
2570 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2571 xxx=`./loc $file $file $pth`
2574 '') xxx=`./loc $file $file $pth`;;
2575 *) xxx=`./loc $xxx $xxx $pth`;;
2577 eval $file=$xxx$_exe
2581 echo $file is in $xxx.
2584 echo $file is in $xxx.
2587 echo "I don't know where '$file' is, and my life depends on it." >&4
2588 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2594 echo "Don't worry if any of the following aren't found..."
2596 for file in $trylist; do
2600 if test -f "$xxx"; then
2603 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2604 xxx=`./loc $file $file $pth`
2607 '') xxx=`./loc $file $file $pth`;;
2608 *) xxx=`./loc $xxx $xxx $pth`;;
2610 eval $file=$xxx$_exe
2614 echo $file is in $xxx.
2617 echo $file is in $xxx.
2620 echo "I don't see $file out there, $say."
2627 echo "Substituting grep for egrep."
2634 *) if $less -R </dev/null >/dev/null 2>&1; then
2635 echo "Substituting less -R for less."
2643 echo "Substituting cp for ln."
2652 echo "I can't find make or gmake, and my life depends on it." >&4
2653 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2661 *) # We can't have osname yet.
2662 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2663 # Assume that gmake, if found, is definitely GNU make
2664 # and prefer it over the system make.
2665 echo "Substituting gmake for make."
2673 echo "Hopefully test is built into your sh."
2676 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2677 echo "Using the test built into your sh."
2685 echo "Hopefully echo is built into your sh."
2690 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2691 $echo $n "hi there$c" >foo1
2692 echo $n "hi there$c" >foo2
2693 if cmp foo1 foo2 >/dev/null 2>&1; then
2694 echo "They are compatible. In fact, they may be identical."
2701 They are not compatible! You are probably running ksh on a non-USG system.
2702 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2703 have echo built in and we may have to run some Bourne shell scripts. That
2704 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2707 $echo $n "The star should be here-->$c"
2714 # This question was auctioned at YAPC::Europe-2007 in Vienna
2715 # I never promised you could answer it. I only auctioned the question.
2717 The following message is sponsored by
2719 Dresden.pm<--The stars should be here.
2721 Dear Perl user, system administrator or package
2722 maintainer, the Perl community sends greetings to
2723 you. Do you (emblematical) greet back [Y/n]? n
2727 : Check what type of C compiler we use
2731 cat <<'EOSC' >>trygcc
2736 int main(int argc, char *argv[]) {
2740 if $cc -o try $ccflags $ldflags try.c; then
2743 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2749 # Skip this test because it gives a false match on output like:
2750 # ./trygcc: line 23: cc: command not found
2751 # case "`$cc -v -c try.c 2>&1`" in
2752 # *gcc*) trygcc=no ;;
2754 if $test X"$trygcc" = Xyes; then
2755 if gcc -o try -c try.c; then
2757 echo "You seem to have a working gcc, though." >&4
2758 # Switching compilers may undo the work of hints files.
2759 # The most common problem is -D_REENTRANT for threads.
2760 # This heuristic catches that case, but gets false positives
2761 # if -Dusethreads was not actually specified. Better to
2762 # bail out here with a useful message than fail
2763 # mysteriously later. Should we perhaps just try to
2764 # re-invoke Configure -Dcc=gcc config_args ?
2765 if $test -f usethreads.cbu; then
2768 *** However, any setting of the C compiler flags (e.g. for thread support)
2769 *** will be lost. It may be necessary for you to restart Configure and
2770 *** add -Dcc=gcc to your Configure command line.
2773 rp="Would you like to go ahead and try gcc anyway?"
2776 rp="Would you like to use it?"
2779 if $test -f myread; then
2782 if $test -f UU/myread; then
2785 echo "Cannot find myread, sorry. Aborting." >&2
2790 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2803 cat <<'EOSC' >>checkcc
2808 int main(int argc, char *argv[]) {
2812 if $cc -o try $ccflags $ldflags try.c; then
2815 if $test X"$despair" = Xyes; then
2816 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2819 You need to find a working C compiler.
2820 Either (purchase and) install the C compiler supplied by your OS vendor,
2821 or for a free C compiler try http://gcc.gnu.org/
2822 I cannot continue any further, aborting.
2831 : determine whether symbolic links are supported
2834 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2835 echo "Symbolic links are supported." >&4
2838 echo "Symbolic links are NOT supported." >&4
2843 : determine whether symbolic links are supported
2847 echo "Checking how to test for symbolic links..." >&4
2849 if $test "X$issymlink" = X; then
2851 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2852 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2854 if test $? = 0; then
2857 echo "Your builtin 'test -h' may be broken." >&4
2860 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2863 if test -f "$p/$test"; then
2872 echo "Trying external '$test -h'." >&4
2873 issymlink="$test -h"
2874 if $test ! -h sym >/dev/null 2>&1; then
2875 echo "External '$test -h' is broken, too." >&4
2883 if $test "X$issymlink" = X; then
2884 if $test -L sym 2>/dev/null; then
2885 issymlink="$test -L"
2886 echo "The builtin '$test -L' worked." >&4
2889 if $test "X$issymlink" != X; then
2890 echo "You can test for symbolic links with '$issymlink'." >&4
2892 echo "I do not know how you can test for symbolic links." >&4
2896 *) 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, const char *where) {
17118 unsigned char *p = (unsigned char *)v;
17119 unsigned char *end = p + sizeof(d);
17128 p = (unsigned char *)v;
17129 printf("No - %s: 0x", where);
17131 printf ("%02X", *p++);
17136 int main(int argc, char **argv) {
17139 fail += checkit(d, "0.0");
17141 /* The compiler shouldn't be assuming that bletched is 0 */
17144 fail += checkit(d, "bleched");
17147 signal(SIGFPE, blech);
17150 /* Paranoia - the compiler should have no way of knowing that ANSI says
17151 that argv[argc] will always be NULL. Actually, if it did assume this it
17152 would be buggy, as this is C and main() can be called from elsewhere in
17154 d = argv[argc] ? 1 : 0;
17157 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17160 fail += checkit(d, "ternary");
17162 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17165 printf("No - memset doesn't give 0.0\n");
17166 /* This might just blow up: */
17167 printf("(gives %g)\n", d);
17173 printf("No - something bleched\n");
17178 printf("No - %d fail(s)\n", fail);
17187 d_nv_zero_is_allbits_zero="$undef"
17188 if eval $compile; then
17194 0.0 is represented as all bits zero in memory
17196 d_nv_zero_is_allbits_zero="$define"
17199 0.0 is not represented as all bits zero in memory
17201 d_nv_zero_is_allbits_zero="$undef"
17206 0.0 is not represented as all bits zero in memory
17208 d_nv_zero_is_allbits_zero="$undef"
17214 : check for off64_t
17216 echo "Checking to see if you have off64_t..." >&4
17218 #include <sys/types.h>
17219 #include <unistd.h>
17220 int main() { off64_t x = 7; }
17223 if eval $compile; then
17225 echo "You have off64_t."
17228 echo "You do not have off64_t."
17229 case "$lseeksize" in
17230 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17237 : how to create joinable pthreads
17238 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17240 echo "Checking what constant to use for creating joinable pthreads..." >&4
17241 $cat >try.c <<'EOCP'
17242 #include <pthread.h>
17244 int detachstate = JOINABLE;
17247 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17248 if eval $compile; then
17249 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17250 val="$undef" # Yes, undef.
17251 set d_old_pthread_create_joinable
17254 set old_pthread_create_joinable
17257 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17258 if eval $compile; then
17259 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17261 set d_old_pthread_create_joinable
17263 val=PTHREAD_CREATE_UNDETACHED
17264 set old_pthread_create_joinable
17267 set try -DJOINABLE=__UNDETACHED
17268 if eval $compile; then
17269 echo "You seem to use __UNDETACHED." >&4
17271 set d_old_pthread_create_joinable
17274 set old_pthread_create_joinable
17277 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17279 set d_old_pthread_create_joinable
17282 set old_pthread_create_joinable
17289 d_old_pthread_create_joinable="$undef"
17290 old_pthread_create_joinable=""
17293 : see if pause exists
17297 : see if poll exists
17301 : see if prctl exists
17305 : see if prctl supports PR_SET_NAME
17306 d_prctl_set_name=$undef
17311 #include <unistd.h>
17313 #include <sys/prctl.h>
17315 int main (int argc, char *argv[])
17317 return (prctl (PR_SET_NAME, "Test"));
17321 if eval $compile_ok && $run ./try; then
17322 echo "Your prctl (PR_SET_NAME, ...) works"
17323 d_prctl_set_name=$define
17329 : see if readlink exists
17330 set readlink d_readlink
17333 : Check if there is a /proc symlink to the abs path of
17334 : the executing program. We will honor hints of d_procselfexe=$undef
17335 : or procselfexe being non-empty, otherwise will try to determine both
17336 : if we have readlink.
17337 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17338 : referenced, and AmigaOS does not have a proc filesystem anyway.
17341 if $test "X$d_procselfexe" = Xundef; then
17343 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17345 elif $test "X$d_readlink" = Xdefine; then
17346 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17347 : and it feels more tidy to avoid an extra level of symlink
17348 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17349 while test $# -gt 0; do
17352 if $issymlink $try; then
17353 $ls -l $try > reflect
17354 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17355 echo "You have $type-like $try."
17356 procselfexe='"'$try'"'
17358 : This will break out of the loop
17368 : backward compatibility for d_hvfork
17369 if test X$d_hvfork != X; then
17370 d_vfork="$d_hvfork"
17373 : see if there is a vfork
17378 d_pseudofork=$undef
17380 : Ok, but do we want to use it. vfork is reportedly unreliable in
17381 : perl on Solaris 2.x, and probably elsewhere.
17385 case "$usevfork" in
17391 Perl can only use a vfork() that doesn't suffer from strict
17392 restrictions on calling functions or modifying global data in
17393 the child. For example, glibc-2.1 contains such a vfork()
17394 that is unsuitable. If your system provides a proper fork()
17395 call, chances are that you do NOT want perl to use vfork().
17398 rp="Do you still want to use vfork()?"
17403 echo "Ok, we won't use vfork()."
17412 $define) usevfork='true';;
17413 *) usevfork='false';;
17416 : see whether the pthread_atfork exists
17418 #include <pthread.h>
17421 #ifdef PTHREAD_ATFORK
17422 pthread_atfork(NULL,NULL,NULL);
17427 : see if pthread_atfork exists
17428 set try -DPTHREAD_ATFORK
17429 if eval $compile; then
17434 case "$usethreads" in
17437 $define) echo 'pthread_atfork found.' >&4 ;;
17438 *) echo 'pthread_atfork NOT found.' >&4 ;;
17441 set d_pthread_atfork
17444 : see if pthread_attr_setscope exists
17445 set pthread_attr_setscope d_pthread_attr_setscope
17448 : see whether the various POSIXish _yields exist
17450 #include <pthread.h>
17456 #ifdef PTHREAD_YIELD
17459 #ifdef PTHREAD_YIELD_NULL
17460 pthread_yield(NULL);
17466 : see if sched_yield exists
17467 set try -DSCHED_YIELD
17468 if eval $compile; then
17470 sched_yield='sched_yield()'
17474 case "$usethreads" in
17477 $define) echo 'sched_yield() found.' >&4 ;;
17478 *) echo 'sched_yield() NOT found.' >&4 ;;
17484 : see if pthread_yield exists
17485 set try -DPTHREAD_YIELD
17486 if eval $compile; then
17488 case "$sched_yield" in
17489 '') sched_yield='pthread_yield()' ;;
17492 set try -DPTHREAD_YIELD_NULL
17493 if eval $compile; then
17495 case "$sched_yield" in
17496 '') sched_yield='pthread_yield(NULL)' ;;
17502 case "$usethreads" in
17505 $define) echo 'pthread_yield() found.' >&4 ;;
17506 *) echo 'pthread_yield() NOT found.' >&4 ;;
17510 set d_pthread_yield
17512 case "$sched_yield" in
17513 '') sched_yield=undef ;;
17517 : check for ptrdiff_t
17519 echo "Checking to see if you have ptrdiff_t..." >&4
17521 #include <stddef.h>
17522 int main() { ptrdiff_t x = 7; }
17525 if eval $compile; then
17527 echo "You have ptrdiff_t."
17530 echo "You do not have ptrdiff_t."
17536 : see if random_r exists
17537 set random_r d_random_r
17539 case "$d_random_r" in
17541 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17542 case "$d_random_r_proto:$usethreads" in
17543 ":define") d_random_r_proto=define
17544 set d_random_r_proto random_r $hdrs
17548 case "$d_random_r_proto" in
17550 case "$random_r_proto" in
17551 ''|0) try='int random_r(int*, struct random_data*);'
17552 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17554 case "$random_r_proto" in
17555 ''|0) try='int random_r(long*, struct random_data*);'
17556 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17558 case "$random_r_proto" in
17559 ''|0) try='int random_r(struct random_data*, int32_t*);'
17560 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17562 case "$random_r_proto" in
17563 ''|0) d_random_r=undef
17565 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17566 * ) case "$random_r_proto" in
17567 REENTRANT_PROTO*) ;;
17568 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17570 echo "Prototype: $try" ;;
17573 *) case "$usethreads" in
17574 define) echo "random_r has no prototype, not using it." >&4 ;;
17581 *) random_r_proto=0
17585 : see if readdir and friends exist
17586 set readdir d_readdir
17588 set seekdir d_seekdir
17590 set telldir d_telldir
17592 set rewinddir d_rewinddir
17595 : see if readdir64_r exists
17596 set readdir64_r d_readdir64_r
17598 case "$d_readdir64_r" in
17600 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17601 case "$d_readdir64_r_proto:$usethreads" in
17602 ":define") d_readdir64_r_proto=define
17603 set d_readdir64_r_proto readdir64_r $hdrs
17607 case "$d_readdir64_r_proto" in
17609 case "$readdir64_r_proto" in
17610 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17611 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17613 case "$readdir64_r_proto" in
17614 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17615 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17617 case "$readdir64_r_proto" in
17618 ''|0) d_readdir64_r=undef
17619 readdir64_r_proto=0
17620 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17621 * ) case "$readdir64_r_proto" in
17622 REENTRANT_PROTO*) ;;
17623 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17625 echo "Prototype: $try" ;;
17628 *) case "$usethreads" in
17629 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17631 d_readdir64_r=undef
17632 readdir64_r_proto=0
17636 *) readdir64_r_proto=0
17640 : see if readdir_r exists
17641 set readdir_r d_readdir_r
17643 case "$d_readdir_r" in
17645 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17646 case "$d_readdir_r_proto:$usethreads" in
17647 ":define") d_readdir_r_proto=define
17648 set d_readdir_r_proto readdir_r $hdrs
17652 case "$d_readdir_r_proto" in
17654 case "$readdir_r_proto" in
17655 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17656 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17658 case "$readdir_r_proto" in
17659 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17660 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17662 case "$readdir_r_proto" in
17663 ''|0) d_readdir_r=undef
17665 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17666 * ) case "$readdir_r_proto" in
17667 REENTRANT_PROTO*) ;;
17668 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17670 echo "Prototype: $try" ;;
17673 *) case "$usethreads" in
17674 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17681 *) readdir_r_proto=0
17685 : see if readv exists
17689 : see if recvmsg exists
17690 set recvmsg d_recvmsg
17693 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17695 if set regcomp val -f d_regcomp; eval $csym; $val; then
17696 echo 'regcomp() found.' >&4
17697 d_regcomp="$define"
17700 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17701 echo 'regcmp() found.' >&4
17705 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17706 echo 're_comp() found, assuming re_exec() also exists.' >&4
17707 d_re_comp="$define"
17712 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17719 : see if remainder exists
17720 set remainder d_remainder
17723 : see if remquo exists
17724 set remquo d_remquo
17727 : see if rename exists
17728 set rename d_rename
17731 : see if rint exists
17735 : see if rmdir exists
17739 : see if round exists
17743 : see if memory.h is available.
17748 : See if it conflicts with string.h
17754 $cppstdin $cppflags $cppminus < $strings > mem.h
17755 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17757 echo "We won't be including <memory.h>."
17767 : can bcopy handle overlapping blocks?
17770 case "$d_memmove" in
17771 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17772 *) case "$d_bcopy" in
17774 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17776 #$i_memory I_MEMORY
17777 #$i_stdlib I_STDLIB
17778 #$i_string I_STRING
17779 #$i_unistd I_UNISTD
17781 $cat >>try.c <<'EOCP'
17784 # include <memory.h>
17787 # include <stdlib.h>
17790 # include <string.h>
17792 # include <strings.h>
17795 # include <unistd.h> /* Needed for NetBSD */
17799 char buf[128], abc[128];
17805 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17806 try to store the string in read-only memory. */
17807 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17809 for (align = 7; align >= 0; align--) {
17810 for (len = 36; len; len--) {
17812 bcopy(abc, b, len);
17813 for (off = 1; off <= len; off++) {
17814 bcopy(b, b+off, len);
17815 bcopy(b+off, b, len);
17816 if (bcmp(b, abc, len))
17825 if eval $compile_ok; then
17826 if $run ./try 2>/dev/null; then
17827 echo "Yes, it can."
17830 echo "It can't, sorry."
17833 echo "(I can't compile the test program, so we'll assume not...)"
17843 : can memcpy handle overlapping blocks?
17846 case "$d_memmove" in
17847 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17848 *) case "$d_memcpy" in
17850 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17852 #$i_memory I_MEMORY
17853 #$i_stdlib I_STDLIB
17854 #$i_string I_STRING
17855 #$i_unistd I_UNISTD
17857 $cat >>try.c <<'EOCP'
17860 # include <memory.h>
17863 # include <stdlib.h>
17866 # include <string.h>
17868 # include <strings.h>
17871 # include <unistd.h> /* Needed for NetBSD */
17875 char buf[128], abc[128];
17881 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17882 try to store the string in read-only memory. */
17883 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17885 for (align = 7; align >= 0; align--) {
17886 for (len = 36; len; len--) {
17888 memcpy(b, abc, len);
17889 for (off = 1; off <= len; off++) {
17890 memcpy(b+off, b, len);
17891 memcpy(b, b+off, len);
17892 if (memcmp(b, abc, len))
17901 if eval $compile_ok; then
17902 if $run ./try 2>/dev/null; then
17903 echo "Yes, it can."
17906 echo "It can't, sorry."
17909 echo "(I can't compile the test program, so we'll assume not...)"
17919 : can memcmp be trusted to compare relative magnitude?
17921 case "$d_memcmp" in
17924 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17926 #$i_memory I_MEMORY
17927 #$i_stdlib I_STDLIB
17928 #$i_string I_STRING
17929 #$i_unistd I_UNISTD
17931 $cat >>try.c <<'EOCP'
17934 # include <memory.h>
17937 # include <stdlib.h>
17940 # include <string.h>
17942 # include <strings.h>
17945 # include <unistd.h> /* Needed for NetBSD */
17951 if ((a < b) && memcmp(&a, &b, 1) < 0)
17957 if eval $compile_ok; then
17958 if $run ./try 2>/dev/null; then
17959 echo "Yes, it can."
17962 echo "No, it can't (it uses signed chars)."
17965 echo "(I can't compile the test program, so we'll assume not...)"
17973 : see if prototype for sbrk is available
17975 set d_sbrkproto sbrk $i_unistd unistd.h
17978 : see if scalbn exists
17979 set scalbn d_scalbn
17982 : see if select exists
17983 set select d_select
17986 : see if semctl exists
17987 set semctl d_semctl
17990 : see if semget exists
17991 set semget d_semget
17994 : see if semop exists
17998 : see how much of the 'sem*(2)' library is present.
18001 case "$d_semctl$d_semget$d_semop" in
18002 *"$undef"*) h_sem=false;;
18006 case "`ipcs 2>&1`" in
18007 "SVID messages"*"not configured"*)
18008 echo "Your $osname does not have the sem*(2) configured." >&4
18011 set semctl d_semctl
18013 set semget d_semget
18021 : we could also check for sys/ipc.h ...
18022 if $h_sem && $test `./findhdr sys/sem.h`; then
18023 echo "You have the full sem*(2) library." >&4
18026 echo "You don't have the full sem*(2) library." >&4
18032 : see whether sys/sem.h defines union semun
18034 $cat > try.c <<'END'
18035 #include <sys/types.h>
18036 #include <sys/ipc.h>
18037 #include <sys/sem.h>
18038 int main () { union semun semun; semun.buf = 0; }
18041 if eval $compile; then
18042 echo "You have union semun in <sys/sem.h>." >&4
18045 echo "You do not have union semun in <sys/sem.h>." >&4
18052 : see how to do semctl IPC_STAT
18056 $cat > tryh.h <<END
18059 # define S_IRUSR S_IREAD
18060 # define S_IWUSR S_IWRITE
18061 # define S_IXUSR S_IEXEC
18063 # define S_IRUSR 0400
18064 # define S_IWUSR 0200
18065 # define S_IXUSR 0100
18067 # define S_IRGRP (S_IRUSR>>3)
18068 # define S_IWGRP (S_IWUSR>>3)
18069 # define S_IXGRP (S_IXUSR>>3)
18070 # define S_IROTH (S_IRUSR>>6)
18071 # define S_IWOTH (S_IWUSR>>6)
18072 # define S_IXOTH (S_IXUSR>>6)
18075 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18076 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18077 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18080 : see whether semctl IPC_STAT can use union semun
18081 case "$d_semctl_semun" in
18085 #include <sys/types.h>
18086 #include <sys/ipc.h>
18087 #include <sys/sem.h>
18088 #include <sys/stat.h>
18095 #$d_union_semun HAS_UNION_SEMUN
18098 #ifndef HAS_UNION_SEMUN
18101 struct semid_ds *buf;
18102 unsigned short *array;
18108 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18109 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18111 struct semid_ds argbuf;
18114 st = semctl(sem, 0, IPC_STAT, arg);
18118 # endif /* IPC_STAT */
18119 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18121 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18122 # endif /* IPC_RMID */
18123 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18125 #endif /* IPC_PRIVATE && ... */
18126 printf("semget failed: errno = %d\n", errno);
18131 if eval $compile; then
18134 semun) val="$define" ;;
18142 case "$d_semctl_semun" in
18144 echo "You can use union semun for semctl IPC_STAT." >&4
18147 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18152 : see whether semctl IPC_STAT can use struct semid_ds pointer
18153 case "$d_semctl_semid_ds" in
18156 $cat > try.c <<'END'
18157 #include <sys/types.h>
18158 #include <sys/ipc.h>
18159 #include <sys/sem.h>
18160 #include <sys/stat.h>
18168 struct semid_ds arg;
18171 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18172 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18175 st = semctl(sem, 0, IPC_STAT, &arg);
18177 printf("semid_ds\n");
18179 # endif /* IPC_STAT */
18180 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18182 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18183 # endif /* IPC_RMID */
18184 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18186 #endif /* IPC_PRIVATE && ... */
18187 printf("semget failed: errno = %d\n", errno);
18193 if eval $compile; then
18196 semid_ds) val="$define" ;;
18200 set d_semctl_semid_ds
18204 case "$d_semctl_semid_ds" in
18206 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18208 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18214 # We do not have the full sem*(2) library, so assume we can not
18220 set d_semctl_semid_ds
18226 : see if sendmsg exists
18227 set sendmsg d_sendmsg
18230 : see if setegid exists
18231 set setegid d_setegid
18234 : see if seteuid exists
18235 set seteuid d_seteuid
18238 : see if setgrent exists
18239 set setgrent d_setgrent
18242 : see if setgrent_r exists
18243 set setgrent_r d_setgrent_r
18245 case "$d_setgrent_r" in
18247 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18248 case "$d_setgrent_r_proto:$usethreads" in
18249 ":define") d_setgrent_r_proto=define
18250 set d_setgrent_r_proto setgrent_r $hdrs
18254 case "$d_setgrent_r_proto" in
18256 case "$setgrent_r_proto" in
18257 ''|0) try='int setgrent_r(FILE**);'
18258 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18260 case "$setgrent_r_proto" in
18261 ''|0) try='void setgrent_r(FILE**);'
18262 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18264 case "$setgrent_r_proto" in
18265 ''|0) d_setgrent_r=undef
18267 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18268 * ) case "$setgrent_r_proto" in
18269 REENTRANT_PROTO*) ;;
18270 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18272 echo "Prototype: $try" ;;
18275 *) case "$usethreads" in
18276 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18283 *) setgrent_r_proto=0
18287 : see if sethostent exists
18288 set sethostent d_sethent
18291 : see if sethostent_r exists
18292 set sethostent_r d_sethostent_r
18294 case "$d_sethostent_r" in
18296 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18297 case "$d_sethostent_r_proto:$usethreads" in
18298 ":define") d_sethostent_r_proto=define
18299 set d_sethostent_r_proto sethostent_r $hdrs
18303 case "$d_sethostent_r_proto" in
18305 case "$sethostent_r_proto" in
18306 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18307 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18309 case "$sethostent_r_proto" in
18310 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18311 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18313 case "$sethostent_r_proto" in
18314 ''|0) d_sethostent_r=undef
18315 sethostent_r_proto=0
18316 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18317 * ) case "$sethostent_r_proto" in
18318 REENTRANT_PROTO*) ;;
18319 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18321 echo "Prototype: $try" ;;
18324 *) case "$usethreads" in
18325 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18327 d_sethostent_r=undef
18328 sethostent_r_proto=0
18332 *) sethostent_r_proto=0
18336 : see if setitimer exists
18337 set setitimer d_setitimer
18340 : see if setlinebuf exists
18341 set setlinebuf d_setlinebuf
18344 : see if setlocale exists
18345 set setlocale d_setlocale
18348 : see if locale.h is available
18349 set locale.h i_locale
18352 : see if setlocale_r exists
18353 set setlocale_r d_setlocale_r
18355 case "$d_setlocale_r" in
18357 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18358 case "$d_setlocale_r_proto:$usethreads" in
18359 ":define") d_setlocale_r_proto=define
18360 set d_setlocale_r_proto setlocale_r $hdrs
18364 case "$d_setlocale_r_proto" in
18366 case "$setlocale_r_proto" in
18367 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18368 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18370 case "$setlocale_r_proto" in
18371 ''|0) d_setlocale_r=undef
18372 setlocale_r_proto=0
18373 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18374 * ) case "$setlocale_r_proto" in
18375 REENTRANT_PROTO*) ;;
18376 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18378 echo "Prototype: $try" ;;
18381 *) case "$usethreads" in
18382 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18384 d_setlocale_r=undef
18385 setlocale_r_proto=0
18389 *) setlocale_r_proto=0
18393 : see if setnetent exists
18394 set setnetent d_setnent
18397 : see if setnetent_r exists
18398 set setnetent_r d_setnetent_r
18400 case "$d_setnetent_r" in
18402 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18403 case "$d_setnetent_r_proto:$usethreads" in
18404 ":define") d_setnetent_r_proto=define
18405 set d_setnetent_r_proto setnetent_r $hdrs
18409 case "$d_setnetent_r_proto" in
18411 case "$setnetent_r_proto" in
18412 ''|0) try='int setnetent_r(int, struct netent_data*);'
18413 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18415 case "$setnetent_r_proto" in
18416 ''|0) try='void setnetent_r(int, struct netent_data*);'
18417 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18419 case "$setnetent_r_proto" in
18420 ''|0) d_setnetent_r=undef
18421 setnetent_r_proto=0
18422 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18423 * ) case "$setnetent_r_proto" in
18424 REENTRANT_PROTO*) ;;
18425 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18427 echo "Prototype: $try" ;;
18430 *) case "$usethreads" in
18431 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18433 d_setnetent_r=undef
18434 setnetent_r_proto=0
18438 *) setnetent_r_proto=0
18442 : see if setprotoent exists
18443 set setprotoent d_setpent
18446 : see if setpgid exists
18447 set setpgid d_setpgid
18450 : see if setpgrp2 exists
18451 set setpgrp2 d_setpgrp2
18454 : see if setpriority exists
18455 set setpriority d_setprior
18458 : see if setproctitle exists
18459 set setproctitle d_setproctitle
18462 : see if setprotoent_r exists
18463 set setprotoent_r d_setprotoent_r
18465 case "$d_setprotoent_r" in
18467 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18468 case "$d_setprotoent_r_proto:$usethreads" in
18469 ":define") d_setprotoent_r_proto=define
18470 set d_setprotoent_r_proto setprotoent_r $hdrs
18474 case "$d_setprotoent_r_proto" in
18476 case "$setprotoent_r_proto" in
18477 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18478 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18480 case "$setprotoent_r_proto" in
18481 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18482 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18484 case "$setprotoent_r_proto" in
18485 ''|0) d_setprotoent_r=undef
18486 setprotoent_r_proto=0
18487 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18488 * ) case "$setprotoent_r_proto" in
18489 REENTRANT_PROTO*) ;;
18490 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18492 echo "Prototype: $try" ;;
18495 *) case "$usethreads" in
18496 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18498 d_setprotoent_r=undef
18499 setprotoent_r_proto=0
18503 *) setprotoent_r_proto=0
18507 : see if setpwent exists
18508 set setpwent d_setpwent
18511 : see if setpwent_r exists
18512 set setpwent_r d_setpwent_r
18514 case "$d_setpwent_r" in
18516 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18517 case "$d_setpwent_r_proto:$usethreads" in
18518 ":define") d_setpwent_r_proto=define
18519 set d_setpwent_r_proto setpwent_r $hdrs
18523 case "$d_setpwent_r_proto" in
18525 case "$setpwent_r_proto" in
18526 ''|0) try='int setpwent_r(FILE**);'
18527 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18529 case "$setpwent_r_proto" in
18530 ''|0) try='void setpwent_r(FILE**);'
18531 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18533 case "$setpwent_r_proto" in
18534 ''|0) d_setpwent_r=undef
18536 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18537 * ) case "$setpwent_r_proto" in
18538 REENTRANT_PROTO*) ;;
18539 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18541 echo "Prototype: $try" ;;
18544 *) case "$usethreads" in
18545 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18552 *) setpwent_r_proto=0
18556 : see if setregid exists
18557 set setregid d_setregid
18559 set setresgid d_setresgid
18562 : see if setreuid exists
18563 set setreuid d_setreuid
18565 set setresuid d_setresuid
18568 : see if setrgid exists
18569 set setrgid d_setrgid
18572 : see if setruid exists
18573 set setruid d_setruid
18576 : see if setservent exists
18577 set setservent d_setsent
18580 : see if setservent_r exists
18581 set setservent_r d_setservent_r
18583 case "$d_setservent_r" in
18585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18586 case "$d_setservent_r_proto:$usethreads" in
18587 ":define") d_setservent_r_proto=define
18588 set d_setservent_r_proto setservent_r $hdrs
18592 case "$d_setservent_r_proto" in
18594 case "$setservent_r_proto" in
18595 ''|0) try='int setservent_r(int, struct servent_data*);'
18596 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18598 case "$setservent_r_proto" in
18599 ''|0) try='void setservent_r(int, struct servent_data*);'
18600 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18602 case "$setservent_r_proto" in
18603 ''|0) d_setservent_r=undef
18604 setservent_r_proto=0
18605 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18606 * ) case "$setservent_r_proto" in
18607 REENTRANT_PROTO*) ;;
18608 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18610 echo "Prototype: $try" ;;
18613 *) case "$usethreads" in
18614 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18616 d_setservent_r=undef
18617 setservent_r_proto=0
18621 *) setservent_r_proto=0
18625 : see if setsid exists
18626 set setsid d_setsid
18629 : see if setvbuf exists
18630 set setvbuf d_setvbuf
18633 : see if shmctl exists
18634 set shmctl d_shmctl
18637 : see if shmget exists
18638 set shmget d_shmget
18641 : see if shmat exists
18644 : see what shmat returns
18647 $cat >shmat.c <<'END'
18648 #include <sys/shm.h>
18651 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18656 echo "and it returns ($shmattype)." >&4
18657 : see if a prototype for shmat is available
18658 xxx=`./findhdr sys/shm.h`
18659 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18660 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18671 set d_shmatprototype
18674 : see if shmdt exists
18678 : see how much of the 'shm*(2)' library is present.
18681 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18682 *"$undef"*) h_shm=false;;
18686 case "`ipcs 2>&1`" in
18687 "SVID shared memory"*"not configured"*)
18688 echo "Your $osname does not have the shm*(2) configured." >&4
18691 set shmctl d_shmctl
18693 set shmget d_shmget
18703 : we could also check for sys/ipc.h ...
18704 if $h_shm && $test `./findhdr sys/shm.h`; then
18705 echo "You have the full shm*(2) library." >&4
18708 echo "You don't have the full shm*(2) library." >&4
18714 : see if we have sigaction
18716 if set sigaction val -f d_sigaction; eval $csym; $val; then
18717 echo 'sigaction() found.' >&4
18720 #include <sys/types.h>
18721 #include <signal.h>
18722 #$i_stdlib I_STDLIB
18724 #include <stdlib.h>
18728 struct sigaction act, oact;
18730 oact.sa_handler = 0;
18731 /* so that act and oact are used */
18732 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18736 if eval $compile_ok; then
18739 echo "But you don't seem to have a usable struct sigaction." >&4
18743 echo 'sigaction NOT found.' >&4
18746 set d_sigaction; eval $setvar
18749 : see what type pids are declared as in the kernel
18750 rp="What is the type of process ids on this system?"
18751 set pid_t pidtype int stdio.h sys/types.h
18754 : see what type uids are declared as in the kernel
18756 echo "Looking for the type for user ids returned by getuid()."
18757 set uid_t uidtype xxx stdio.h sys/types.h
18761 xxx=`./findhdr sys/user.h`
18762 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18764 unsigned) dflt="$1 $2" ;;
18768 *) dflt="$uidtype";;
18771 uid_t) echo "uid_t found." ;;
18772 *) rp="What is the type for user ids returned by getuid()?"
18778 : Define hasfield_t macro for Configure internal use
18779 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18780 while $test $# -ge 2; do
18782 $define) echo "#include <$2>";;
18786 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18788 if eval $compile; then
18797 : see what siginfo fields we have
18798 case "$d_sigaction" in
18800 echo "Checking if your siginfo_t has si_errno field...">&4
18801 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18804 echo "Checking if your siginfo_t has si_pid field...">&4
18805 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18808 echo "Checking if your siginfo_t has si_uid field...">&4
18809 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18812 echo "Checking if your siginfo_t has si_addr field...">&4
18813 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18816 echo "Checking if your siginfo_t has si_status field...">&4
18817 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18820 echo "Checking if your siginfo_t has si_band field...">&4
18821 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18824 echo "Checking if your siginfo_t has si_value field...">&4
18825 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18828 echo "Checking if your siginfo_t has si_fd field...">&4
18829 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18834 d_siginfo_si_errno="$undef"
18835 d_siginfo_si_pid="$undef"
18836 d_siginfo_si_uid="$undef"
18837 d_siginfo_si_addr="$undef"
18838 d_siginfo_si_status="$undef"
18839 d_siginfo_si_band="$undef"
18840 d_siginfo_si_value="$undef"
18841 d_siginfo_si_fd="$undef"
18845 : see if this is a sunmath.h system
18846 set sunmath.h i_sunmath
18849 : see if signbit exists
18850 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18853 #$i_sunmath I_SUNMATH
18857 #ifdef I_SUNMATH /* Solaris special math library */
18858 # include <sunmath.h>
18861 int main(int argc, char **argv)
18865 if ((signbit(x) == 0) && (signbit(y) != 0))
18873 if eval $compile; then
18874 if $run ./try; then
18878 $echo "Signbit seems to be available, but doesn't work as I expected."
18879 $echo "I won't use it." >&4
18890 : see if sigprocmask exists
18891 set sigprocmask d_sigprocmask
18894 : see if sigsetjmp exists
18896 case "$d_sigsetjmp" in
18899 #include <setjmp.h>
18900 #$i_stdlib I_STDLIB
18902 #include <stdlib.h>
18908 if (sigsetjmp(env,1))
18911 siglongjmp(env, 1);
18916 if eval $compile; then
18917 if $run ./try >/dev/null 2>&1; then
18918 echo "POSIX sigsetjmp found." >&4
18922 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18928 echo "sigsetjmp not found." >&4
18932 *) val="$d_sigsetjmp"
18933 case "$d_sigsetjmp" in
18934 $define) echo "POSIX sigsetjmp found." >&4;;
18935 $undef) echo "sigsetjmp not found." >&4;;
18943 : see if snprintf exists
18944 set snprintf d_snprintf
18947 : see if vsnprintf exists
18948 set vsnprintf d_vsnprintf
18951 case "$d_snprintf-$d_vsnprintf" in
18954 Checking whether your snprintf() and vsnprintf() work okay...
18956 $cat >try.c <<'EOCP'
18957 /* v?snprintf testing logic courtesy of Russ Allbery.
18958 * According to C99:
18959 * - if the buffer is too short it still must be \0-terminated
18960 * - if the buffer is too short the potentially required length
18961 * must be returned and not -1
18962 * - if the buffer is NULL the potentially required length
18963 * must be returned and not -1 or core dump
18966 #include <stdarg.h>
18970 int test (char *format, ...)
18975 va_start (args, format);
18976 count = vsnprintf (buf, sizeof buf, format, args);
18983 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18984 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18988 if eval $compile; then
18991 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18993 Your snprintf() and snprintf() don't seem to be working okay.
18995 d_snprintf="$undef"
18996 d_vsnprintf="$undef"
19000 echo "(I can't seem to compile the test program--assuming they don't)"
19001 d_snprintf="$undef"
19002 d_vsnprintf="$undef"
19008 : see if sockatmark exists
19009 set sockatmark d_sockatmark
19012 : see if prototype for sockatmark is available
19014 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19017 : see if socks5_init exists
19018 set socks5_init d_socks5_init
19021 : see if sprintf returns the length of the string in the buffer as per ANSI
19022 $echo "Checking whether sprintf returns the length of the string..." >&4
19025 #$i_stdlib I_STDLIB
19027 #include <stdlib.h>
19029 #$i_string I_STRING
19031 # include <string.h>
19033 # include <strings.h>
19042 int check (size_t expect, int test) {
19043 size_t got = strlen(buffer);
19047 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
19052 int main(int argc, char **argv) {
19055 check(sprintf(buffer, ""), ++test);
19056 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
19057 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
19064 if eval $compile; then
19068 sprintf returns the length of the string (as ANSI says it should)
19070 d_sprintf_returns_strlen="$define"
19073 sprintf does not return the length of the string (how old is this system?)
19075 d_sprintf_returns_strlen="$undef"
19079 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
19080 d_sprintf_returns_strlen="$undef"
19084 : see if srand48_r exists
19085 set srand48_r d_srand48_r
19087 case "$d_srand48_r" in
19089 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19090 case "$d_srand48_r_proto:$usethreads" in
19091 ":define") d_srand48_r_proto=define
19092 set d_srand48_r_proto srand48_r $hdrs
19096 case "$d_srand48_r_proto" in
19098 case "$srand48_r_proto" in
19099 ''|0) try='int srand48_r(long, struct drand48_data*);'
19100 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19102 case "$srand48_r_proto" in
19103 ''|0) d_srand48_r=undef
19105 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19106 * ) case "$srand48_r_proto" in
19107 REENTRANT_PROTO*) ;;
19108 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19110 echo "Prototype: $try" ;;
19113 *) case "$usethreads" in
19114 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19121 *) srand48_r_proto=0
19125 : see if srandom_r exists
19126 set srandom_r d_srandom_r
19128 case "$d_srandom_r" in
19130 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19131 case "$d_srandom_r_proto:$usethreads" in
19132 ":define") d_srandom_r_proto=define
19133 set d_srandom_r_proto srandom_r $hdrs
19137 case "$d_srandom_r_proto" in
19139 case "$srandom_r_proto" in
19140 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19141 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19143 case "$srandom_r_proto" in
19144 ''|0) d_srandom_r=undef
19146 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19147 * ) case "$srandom_r_proto" in
19148 REENTRANT_PROTO*) ;;
19149 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19151 echo "Prototype: $try" ;;
19154 *) case "$usethreads" in
19155 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19162 *) srandom_r_proto=0
19166 : see if prototype for setresgid is available
19168 set d_sresgproto setresgid $i_unistd unistd.h
19171 : see if prototype for setresuid is available
19173 set d_sresuproto setresuid $i_unistd unistd.h
19176 : see if stat exists
19180 : see if sys/stat.h is available
19181 set sys/stat.h i_sysstat
19184 : see if stat knows about block sizes
19186 echo "Checking to see if your struct stat has st_blocks field..." >&4
19187 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19190 : see if this is a sys/vfs.h system
19191 set sys/vfs.h i_sysvfs
19194 : see if this is a sys/statfs.h system
19195 set sys/statfs.h i_sysstatfs
19198 : Check for statfs_s
19200 echo "Checking to see if your system supports struct statfs..." >&4
19201 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
19203 case "$d_statfs_s" in
19204 "$define") echo "Yes, it does." ;;
19205 *) echo "No, it doesn't." ;;
19209 : see if struct statfs knows about f_flags
19210 case "$d_statfs_s" in
19213 echo "Checking to see if your struct statfs has f_flags field..." >&4
19214 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
19218 set d_statfs_f_flags
19222 case "$d_statfs_f_flags" in
19223 "$define") echo "Yes, it does." ;;
19224 *) echo "No, it doesn't." ;;
19227 : see what flavor, if any, of static inline is supported
19229 echo "Checking to see if your system supports static inline..."
19230 $cat > try.c <<'EOCP'
19231 #include <stdlib.h>
19232 extern int f_via_a(int x);
19233 extern int f_via_b(int x);
19234 int main(int argc, char **argv)
19243 return EXIT_SUCCESS;
19246 return EXIT_FAILURE;
19250 $cat > a.c <<'EOCP'
19251 static INLINE int f(int x) {
19262 $cat > b.c <<'EOCP'
19263 extern int f(int x);
19271 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19272 case "$perl_static_inline" in
19273 '') # Check the various possibilities, and break out on success.
19274 # For gcc, prefer __inline__, which will still permit
19275 # cflags.SH to add in -ansi.
19276 case "$gccversion" in
19277 '') xxx="inline __inline__ __inline _inline";;
19278 *) xxx="__inline__ inline __inline _inline";;
19280 for inline in $xxx; do
19281 set try -DINLINE=$inline a.c
19282 if eval $compile && $run ./try; then
19283 # Now make sure there is no external linkage of static
19285 set try -DINLINE=$inline -DUSE_B a.c b.c
19286 if eval $compile && $run ./try; then
19287 $echo "Your compiler supports static $inline, " >&4
19288 $echo "but it also creates an external definition," >&4
19289 $echo "so I won't use it." >&4
19292 $echo "Your compiler supports static $inline." >&4
19294 perl_static_inline="static $inline";
19298 $echo "Your compiler does NOT support static $inline." >&4
19303 *inline*) # Some variant of inline exists.
19304 echo "Keeping your $hint value of $perl_static_inline."
19307 static) # No inline capabilities
19308 echo "Keeping your $hint value of $perl_static_inline."
19311 *) # Unrecognized previous value -- blindly trust the supplied
19312 # value and hope it makes sense. Use old value for
19313 # d_static_inline, if there is one.
19314 echo "Keeping your $hint value of $perl_static_inline."
19315 case "$d_static_inline" in
19317 *) val=$d_static_inline ;;
19321 # Fallback to plain 'static' if nothing worked.
19322 case "$perl_static_inline" in
19324 perl_static_inline="static"
19328 set d_static_inline
19330 $rm -f a.[co] b.[co]
19333 : Check stream access
19335 Checking how to access stdio streams by file descriptor number...
19337 case "$stdio_stream_array" in
19338 '') $cat >try.c <<EOCP
19341 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19345 for s in _iob __iob __sF
19347 set try -DSTDIO_STREAM_ARRAY=$s
19348 if eval $compile; then
19349 case "`$run ./try`" in
19350 yes) stdio_stream_array=$s; break ;;
19356 case "$stdio_stream_array" in
19358 I can't figure out how to access stdio streams by file descriptor number.
19360 d_stdio_stream_array="$undef"
19363 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19365 d_stdio_stream_array="$define"
19369 : see if strcoll exists
19370 set strcoll d_strcoll
19373 : check for structure copying
19375 echo "Checking to see if your C compiler can copy structs..." >&4
19376 $cat >try.c <<'EOCP'
19386 if $cc -c try.c >/dev/null 2>&1 ; then
19388 echo "Yup, it can."
19391 echo "Nope, it can't."
19397 : see if strerror and/or sys_errlist[] exist
19399 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19400 if set strerror val -f d_strerror; eval $csym; $val; then
19401 echo 'strerror() found.' >&4
19402 d_strerror="$define"
19403 d_strerrm='strerror(e)'
19404 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19405 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19406 d_syserrlst="$define"
19408 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19409 d_syserrlst="$undef"
19411 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19412 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19413 echo 'strerror() found in string header.' >&4
19414 d_strerror="$define"
19415 d_strerrm='strerror(e)'
19416 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19417 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19418 d_syserrlst="$define"
19420 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19421 d_syserrlst="$undef"
19423 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19424 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19425 d_strerror="$undef"
19426 d_syserrlst="$define"
19427 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19429 echo 'strerror() and sys_errlist[] NOT found.' >&4
19430 d_strerror="$undef"
19431 d_syserrlst="$undef"
19432 d_strerrm='"unknown"'
19436 : see if strerror_l exists
19437 set strerror_l d_strerror_l
19440 : see if strerror_r exists
19441 set strerror_r d_strerror_r
19443 case "$d_strerror_r" in
19445 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19446 case "$d_strerror_r_proto:$usethreads" in
19447 ":define") d_strerror_r_proto=define
19448 set d_strerror_r_proto strerror_r $hdrs
19452 case "$d_strerror_r_proto" in
19454 case "$strerror_r_proto" in
19455 ''|0) try='int strerror_r(int, char*, size_t);'
19456 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19458 case "$strerror_r_proto" in
19459 ''|0) try='int strerror_r(int, char*, int);'
19460 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19462 case "$strerror_r_proto" in
19463 ''|0) try='char* strerror_r(int, char*, size_t);'
19464 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19466 case "$strerror_r_proto" in
19467 ''|0) d_strerror_r=undef
19469 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19470 * ) case "$strerror_r_proto" in
19471 REENTRANT_PROTO*) ;;
19472 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19474 echo "Prototype: $try" ;;
19477 *) case "$usethreads" in
19478 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19485 *) strerror_r_proto=0
19489 : see if strftime exists
19490 set strftime d_strftime
19493 : see if strlcat exists
19494 set strlcat d_strlcat
19497 : see if strlcpy exists
19498 set strlcpy d_strlcpy
19501 : see if strtod exists
19502 set strtod d_strtod
19505 : see if strtol exists
19506 set strtol d_strtol
19509 : see if strtold exists
19510 set strtold d_strtold
19513 : see if strtoll exists
19514 set strtoll d_strtoll
19517 case "$d_longlong-$d_strtoll" in
19520 Checking whether your strtoll() works okay...
19522 $cat >try.c <<'EOCP'
19525 #define strtoll __strtoll
19528 #define strtoll _strtoll
19531 extern long long int strtoll(char *s, char **, int);
19532 static int bad = 0;
19533 int check(char *s, long long ell, int een) {
19536 gll = strtoll(s, 0, 10);
19537 if (!((gll == ell) && (errno == een)))
19541 check(" 1", 1LL, 0);
19542 check(" 0", 0LL, 0);
19543 check("-1", -1LL, 0);
19544 check("-9223372036854775808", -9223372036854775808LL, 0);
19545 check("-9223372036854775808", -9223372036854775808LL, 0);
19546 check(" 9223372036854775807", 9223372036854775807LL, 0);
19547 check("-9223372036854775808", -9223372036854775808LL, 0);
19548 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19549 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19555 if eval $compile; then
19558 ok) echo "Your strtoll() seems to be working okay." ;;
19560 Your strtoll() doesn't seem to be working okay.
19566 echo "(I can't seem to compile the test program--assuming it doesn't)"
19572 : see if strtoq exists
19573 set strtoq d_strtoq
19576 : see if strtoul exists
19577 set strtoul d_strtoul
19580 case "$d_strtoul" in
19583 Checking whether your strtoul() works okay...
19585 $cat >try.c <<'EOCP'
19588 extern unsigned long int strtoul(char *s, char **, int);
19589 static int bad = 0;
19590 void check(char *s, unsigned long eul, int een) {
19593 gul = strtoul(s, 0, 10);
19594 if (!((gul == eul) && (errno == een)))
19598 check(" 1", 1L, 0);
19599 check(" 0", 0L, 0);
19601 case "$longsize" in
19603 $cat >>try.c <<'EOCP'
19604 check("18446744073709551615", 18446744073709551615UL, 0);
19605 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19606 #if 0 /* strtoul() for /^-/ strings is undefined. */
19607 check("-1", 18446744073709551615UL, 0);
19608 check("-18446744073709551614", 2, 0);
19609 check("-18446744073709551615", 1, 0);
19610 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19611 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19616 $cat >>try.c <<'EOCP'
19617 check("4294967295", 4294967295UL, 0);
19618 check("4294967296", 4294967295UL, ERANGE);
19619 #if 0 /* strtoul() for /^-/ strings is undefined. */
19620 check("-1", 4294967295UL, 0);
19621 check("-4294967294", 2, 0);
19622 check("-4294967295", 1, 0);
19623 check("-4294967296", 4294967295UL, ERANGE);
19624 check("-4294967297", 4294967295UL, ERANGE);
19629 : Should we write these tests to be more portable by sprintf-ing
19630 : ~0 and then manipulating that char string as input for strtol?
19633 $cat >>try.c <<'EOCP'
19640 if eval $compile; then
19641 case "`$run ./try`" in
19642 ok) echo "Your strtoul() seems to be working okay." ;;
19644 Your strtoul() doesn't seem to be working okay.
19650 echo "(I can't seem to compile the test program--assuming it doesn't)"
19656 : see if strtoull exists
19657 set strtoull d_strtoull
19660 case "$d_longlong-$d_strtoull" in
19663 Checking whether your strtoull() works okay...
19665 $cat >try.c <<'EOCP'
19668 #define strtoull __strtoull
19671 extern unsigned long long int strtoull(char *s, char **, int);
19672 static int bad = 0;
19673 int check(char *s, long long eull, int een) {
19676 gull = strtoull(s, 0, 10);
19677 if (!((gull == eull) && (errno == een)))
19681 check(" 1", 1LL, 0);
19682 check(" 0", 0LL, 0);
19683 check("18446744073709551615", 18446744073709551615ULL, 0);
19684 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19685 #if 0 /* strtoull() for /^-/ strings is undefined. */
19686 check("-1", 18446744073709551615ULL, 0);
19687 check("-18446744073709551614", 2LL, 0);
19688 check("-18446744073709551615", 1LL, 0);
19689 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19690 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19697 if eval $compile; then
19698 case "`$run ./try`" in
19699 ok) echo "Your strtoull() seems to be working okay." ;;
19701 Your strtoull() doesn't seem to be working okay.
19703 d_strtoull="$undef"
19707 echo "(I can't seem to compile the test program--assuming it doesn't)"
19708 d_strtoull="$undef"
19713 : see if strtouq exists
19714 set strtouq d_strtouq
19717 case "$d_strtouq" in
19720 Checking whether your strtouq() works okay...
19722 $cat >try.c <<'EOCP'
19725 extern unsigned long long int strtouq(char *s, char **, int);
19726 static int bad = 0;
19727 void check(char *s, unsigned long long eull, int een) {
19728 unsigned long long gull;
19730 gull = strtouq(s, 0, 10);
19731 if (!((gull == eull) && (errno == een)))
19735 check(" 1", 1LL, 0);
19736 check(" 0", 0LL, 0);
19737 check("18446744073709551615", 18446744073709551615ULL, 0);
19738 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19739 #if 0 /* strtouq() for /^-/ strings is undefined. */
19740 check("-1", 18446744073709551615ULL, 0);
19741 check("-18446744073709551614", 2LL, 0);
19742 check("-18446744073709551615", 1LL, 0);
19743 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19744 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19752 if eval $compile; then
19753 case "`$run ./try`" in
19754 ok) echo "Your strtouq() seems to be working okay." ;;
19756 Your strtouq() doesn't seem to be working okay.
19762 echo "(I can't seem to compile the test program--assuming it doesn't)"
19768 : see if strxfrm exists
19769 set strxfrm d_strxfrm
19772 : see if symlink exists
19773 set symlink d_symlink
19776 : see if syscall exists
19777 set syscall d_syscall
19780 : see if prototype for syscall is available
19782 set d_syscallproto syscall $i_unistd unistd.h
19785 : see if sysconf exists
19786 set sysconf d_sysconf
19789 : see if system exists
19790 set system d_system
19793 : see if tcgetpgrp exists
19794 set tcgetpgrp d_tcgetpgrp
19797 : see if tcsetpgrp exists
19798 set tcsetpgrp d_tcsetpgrp
19801 : see if prototype for telldir is available
19803 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19806 : see if tgamma exists
19807 set tgamma d_tgamma
19810 : see if time exists
19812 if test "X$d_time" = X -o X"$timetype" = X; then
19813 if set time val -f d_time; eval $csym; $val; then
19814 echo 'time() found.' >&4
19816 rp="What is the type returned by time() on this system?"
19817 set time_t timetype long stdio.h sys/types.h
19820 echo 'time() not found, hope that will do.' >&4
19828 : see if timegm exists
19829 set timegm d_timegm
19832 : see if this is a sys/times.h system
19833 set sys/times.h i_systimes
19836 : see if times exists
19838 if set times val -f d_times; eval $csym; $val; then
19839 echo 'times() found.' >&4
19842 case "$i_systimes" in
19843 "$define") inc='sys/times.h';;
19845 rp="What is the type returned by times() on this system?"
19846 set clock_t clocktype long stdio.h sys/types.h $inc
19849 echo 'times() NOT found, hope that will do.' >&4
19854 : see if tmpnam_r exists
19855 set tmpnam_r d_tmpnam_r
19857 case "$d_tmpnam_r" in
19859 hdrs="$i_systypes sys/types.h define stdio.h "
19860 case "$d_tmpnam_r_proto:$usethreads" in
19861 ":define") d_tmpnam_r_proto=define
19862 set d_tmpnam_r_proto tmpnam_r $hdrs
19866 case "$d_tmpnam_r_proto" in
19868 case "$tmpnam_r_proto" in
19869 ''|0) try='char* tmpnam_r(char*);'
19870 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19872 case "$tmpnam_r_proto" in
19873 ''|0) d_tmpnam_r=undef
19875 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19876 * ) case "$tmpnam_r_proto" in
19877 REENTRANT_PROTO*) ;;
19878 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19880 echo "Prototype: $try" ;;
19883 *) case "$usethreads" in
19884 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19891 *) tmpnam_r_proto=0
19895 : see if trunc exists
19899 : see if truncate exists
19900 set truncate d_truncate
19903 : see if ttyname_r exists
19904 set ttyname_r d_ttyname_r
19906 case "$d_ttyname_r" in
19908 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19909 case "$d_ttyname_r_proto:$usethreads" in
19910 ":define") d_ttyname_r_proto=define
19911 set d_ttyname_r_proto ttyname_r $hdrs
19915 case "$d_ttyname_r_proto" in
19917 case "$ttyname_r_proto" in
19918 ''|0) try='int ttyname_r(int, char*, size_t);'
19919 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19921 case "$ttyname_r_proto" in
19922 ''|0) try='int ttyname_r(int, char*, int);'
19923 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19925 case "$ttyname_r_proto" in
19926 ''|0) try='char* ttyname_r(int, char*, int);'
19927 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19929 case "$ttyname_r_proto" in
19930 ''|0) d_ttyname_r=undef
19932 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19933 * ) case "$ttyname_r_proto" in
19934 REENTRANT_PROTO*) ;;
19935 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19937 echo "Prototype: $try" ;;
19940 *) case "$usethreads" in
19941 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19948 *) ttyname_r_proto=0
19952 : see if tzname[] exists
19954 if set tzname val -a d_tzname; eval $csym; $val; then
19956 echo 'tzname[] found.' >&4
19959 echo 'tzname[] NOT found.' >&4
19964 : Check if is a multiplatform env
19966 darwin) multiarch="$define" ;;
19968 case "$multiarch" in
19969 ''|[nN]*) multiarch="$undef" ;;
19972 : check for ordering of bytes in a UV
19974 case "$multiarch" in
19977 You seem to be doing a multiarchitecture build,
19978 skipping the byteorder check.
19984 case "$byteorder" in
19987 In the following, larger digits indicate more significance. A big-endian
19988 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19989 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19990 machines may have weird orders like 3412. A Cray will report 87654321,
19991 an Alpha will report 12345678. If the test program works the default is
19993 I'm now running the test program...
19997 #$i_stdlib I_STDLIB
19999 #include <stdlib.h>
20001 #include <sys/types.h>
20002 typedef $uvtype UV;
20012 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20014 u.l = (UV)0x04030201;
20015 for (i = 0; i < $uvsize; i++)
20016 printf("%c", u.c[i]+'0');
20023 if eval $compile && $run ./try > /dev/null; then
20026 [1-4][1-4][1-4][1-4]|12345678|87654321)
20027 echo "(The test program ran ok.)"
20028 echo "byteorder=$dflt"
20031 ????|????????) echo "(The test program ran ok.)" ;;
20032 *) echo "(The test program didn't run right for some reason.)" ;;
20037 (I can't seem to compile the test program. Guessing big-endian...)
20040 case "$xxx_prompt" in
20042 rp="What is the order of bytes in $uvtype?"
20055 : Checking 32bit alignedness
20058 Checking to see whether you can access character data unalignedly...
20060 case "$d_u32align" in
20061 '') $cat >try.c <<EOCP
20063 #$i_stdlib I_STDLIB
20065 #include <stdlib.h>
20067 #define U32 $u32type
20068 #define BYTEORDER 0x$byteorder
20070 #include <signal.h>
20072 $signal_t bletch(int s) { exit(4); }
20075 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20076 volatile U8 buf[8];
20080 if (sizeof(U32) != 4) {
20081 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20088 signal(SIGBUS, bletch);
20100 for (i = 0; i < 4; i++) {
20101 up = (U32*)(buf + i);
20102 if (! ((*up == 1 << (8*i)) || /* big-endian */
20103 (*up == 1 << (8*(3-i))) /* little-endian */
20107 printf("read failed (%x)\n", *up);
20113 for (i = 0; i < 4; i++) {
20114 up = (U32*)(buf + i);
20116 if (*up != 0xBeef) {
20117 printf("write failed (%x)\n", *up);
20131 if eval $compile_ok; then
20132 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20133 $run ./try 2>&1 >/dev/null
20136 You can access character data pretty unalignedly.
20138 d_u32align="$undef"
20141 It seems that you must access character data in an aligned manner.
20143 d_u32align="$define"
20147 rp='Can you access character data at unaligned addresses?'
20151 [yY]*) d_u32align="$undef" ;;
20152 *) d_u32align="$define" ;;
20159 : see if ualarm exists
20160 set ualarm d_ualarm
20163 : see if umask exists
20167 : see if unordered exists
20168 set unordered d_unordered
20171 : see if unsetenv exists
20172 set unsetenv d_unsetenv
20175 : see if usleep exists
20176 set usleep d_usleep
20179 : see if prototype for usleep is available
20181 set d_usleepproto usleep $i_unistd unistd.h
20184 : see if ustat exists
20188 : see if closedir exists
20189 set closedir d_closedir
20192 case "$d_closedir" in
20195 echo "Checking whether closedir() returns a status..." >&4
20197 #$i_dirent I_DIRENT /**/
20198 #$i_sysdir I_SYS_DIR /**/
20199 #$i_sysndir I_SYS_NDIR /**/
20200 #$i_systypes I_SYS_TYPES /**/
20202 #if defined(I_SYS_TYPES)
20203 #include <sys/types.h>
20205 #if defined(I_DIRENT)
20206 #include <dirent.h>
20209 #include <sys/ndir.h>
20213 #include <ndir.h> /* may be wrong in the future */
20215 #include <sys/dir.h>
20220 int main() { return closedir(opendir(".")); }
20223 if eval $compile_ok; then
20224 if $run ./try > /dev/null 2>&1 ; then
20225 echo "Yes, it does."
20228 echo "No, it doesn't."
20232 echo "(I can't seem to compile the test program--assuming it doesn't)"
20240 set d_void_closedir
20244 : see if there is a wait4
20248 : see if waitpid exists
20249 set waitpid d_waitpid
20254 $cat >try.c <<'EOCP'
20260 return (wcscmp (s, s) ? 1 : 0);
20265 if eval $compile; then
20268 0) echo "A working wcscmp() found." >&4
20270 *) echo "wcscmp() found, but it doesn't work" >&4
20274 echo "wcscmp() NOT found." >&4
20280 : see if wcstombs exists
20281 set wcstombs d_wcstombs
20286 $cat >try.c <<'EOCP'
20291 wchar_t dst[4], *src = L" ";
20293 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20298 if eval $compile; then
20301 0) echo "A working wcsxfrm() found." >&4
20303 *) echo "wcsxfrm() found, but it doesn't work" >&4
20307 echo "wcsxfrm() NOT found." >&4
20313 : see if wctomb exists
20314 set wctomb d_wctomb
20317 : see if writev exists
20318 set writev d_writev
20321 : check for alignment requirements
20323 case "$alignbytes" in
20324 '') echo "Checking alignment constraints..." >&4
20333 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20338 if eval $compile_ok; then
20342 echo "(I can't seem to compile the test program...)"
20344 case "$multiarch" in
20346 : The usual safe value is 8, but Darwin with -Duselongdouble
20347 : needs 16. Hence, we will take 8 as a minimum, but allow
20348 : Configure to pick a larger value if needed.
20349 if $test "$dflt" -lt 8; then
20351 echo "Setting alignment to 8 for multiarch support.">&4
20356 *) dflt="$alignbytes"
20359 rp="Doubles must be aligned on a how-many-byte boundary?"
20364 : set the base revision
20367 : length of character in bytes. Is always 1, otherwise it is not C
20368 : This used to be a test using sizeof
20371 : Check for the number of bits in a character
20372 case "$charbits" in
20373 '') echo "Checking how long a character is (in bits)..." >&4
20380 for (c = 1, n = 0; c; c <<= 1, n++) ;
20381 printf ("%d\n", n);
20386 if eval $compile_ok; then
20390 echo "(I can't seem to compile the test program. Guessing...)"
20397 rp="What is the length of a character (in bits)?"
20401 case "$charbits" in
20404 Your system has an unsigned character size of $charbits bits, which
20405 is rather unusual (normally it is 8 bits). Perl likely will not work
20406 correctly on your system, with subtle bugs in various places.
20408 rp='Do you really want to continue?'
20412 [yY]) echo >&4 "Okay, continuing." ;;
20417 : how do we concatenate cpp tokens here?
20419 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20420 $cat >cpp_stuff.c <<'EOCP'
20421 #define RCAT(a,b)a/**/b
20422 #define ACAT(a,b)a ## b
20426 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20427 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20428 echo "Oh! Smells like ANSI's been here." >&4
20429 echo "We can catify or stringify, separately or together!"
20431 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20432 echo "Ah, yes! The good old days!" >&4
20433 echo "However, in the good old days we don't know how to stringify and"
20434 echo "catify at the same time."
20438 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20439 You're going to have to edit the values of CAT[2-5] in config.h...
20441 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20445 : see if this is a db.h system
20451 : Check db version.
20453 echo "Checking Berkeley DB version ..." >&4
20459 #include <sys/types.h>
20461 #$i_stdlib I_STDLIB
20463 #include <stdlib.h>
20466 int main(int argc, char *argv[])
20468 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20469 int Major, Minor, Patch ;
20470 unsigned long Version ;
20471 (void)db_version(&Major, &Minor, &Patch) ;
20473 printf("%d %d %d %d %d %d\n",
20474 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20475 Major, Minor, Patch);
20478 printf("You have Berkeley DB Version 2 or greater.\n");
20480 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20481 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20482 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20483 Major, Minor, Patch) ;
20485 /* check that db.h & libdb are compatible */
20486 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20487 printf("db.h and libdb are incompatible.\n") ;
20491 printf("db.h and libdb are compatible.\n") ;
20493 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20494 + DB_VERSION_PATCH ;
20496 /* needs to be >= 2.3.4 */
20497 if (Version < 2003004) {
20498 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20499 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20505 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20510 printf("You have Berkeley DB Version 1.\n");
20511 exit(0); /* DB version < 2: the coast is clear. */
20513 exit(1); /* <db.h> not Berkeley DB? */
20519 if eval $compile_ok && $run ./try; then
20520 echo 'Looks OK.' >&4
20522 db_version_major=$1
20523 db_version_minor=$2
20524 db_version_patch=$3
20526 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20530 : Remove db from list of libraries to use
20531 echo "Removing unusable -ldb from library list" >&4
20532 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20535 echo "libs = $libs" >&4
20545 : Check the return type needed for hash
20547 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20553 #include <sys/types.h>
20556 #ifndef DB_VERSION_MAJOR
20557 u_int32_t hash_cb (const void* ptr, size_t size)
20563 info.hash = hash_cb;
20567 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20568 if $contains warning try.out >>/dev/null 2>&1 ; then
20571 db_hashtype='u_int32_t'
20574 : XXX Maybe we should just give up here.
20575 db_hashtype=u_int32_t
20577 echo "Help: I can't seem to compile the db test program." >&4
20578 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20581 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20583 *) db_hashtype=u_int32_t
20588 : Check the return type needed for prefix
20590 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20596 #include <sys/types.h>
20599 #ifndef DB_VERSION_MAJOR
20600 size_t prefix_cb (const DBT *key1, const DBT *key2)
20606 info.prefix = prefix_cb;
20610 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20611 if $contains warning try.out >>/dev/null 2>&1 ; then
20612 db_prefixtype='int'
20614 db_prefixtype='size_t'
20617 db_prefixtype='size_t'
20618 : XXX Maybe we should just give up here.
20620 echo "Help: I can't seem to compile the db test program." >&4
20621 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20624 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20626 *) db_prefixtype='size_t'
20630 : Include . in @INC
20633 Historically Perl has provided a final fallback of the current working
20634 directory '.' when searching for a library. This, however, can lead to
20635 problems when a Perl program which loads optional modules is called from
20636 a shared directory. This can lead to executing unexpected code.
20640 # When changing to exclude by default:
20641 case "$default_inc_excludes_dot" in
20642 $undef|false|[nN]*) dflt="n" ;;
20645 # To turn exclude off by default:
20646 #case "$default_inc_excludes_dot" in
20647 # $define|true|[yY]*) dflt="y" ;;
20651 rp='Exclude '.' from @INC by default? '
20654 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20655 *) default_inc_excludes_dot="$define" ;;
20658 : Check what kind of inf/nan your system has
20659 $echo "Checking the kind of infinities and nans you have..." >&4
20660 $echo "(The following tests may crash. That's okay.)" >&4
20662 #define DOUBLESIZE $doublesize
20663 #$d_longdbl HAS_LONG_DOUBLE
20664 #ifdef HAS_LONG_DOUBLE
20665 #define LONG_DOUBLESIZE $longdblsize
20666 #define LONG_DOUBLEKIND $longdblkind
20669 #$i_string I_STRING
20674 # include <string.h>
20677 /* Note that whether the sign bit is on or off
20678 * for NaN depends on the CPU/FPU, and possibly
20679 * can be affected by the build toolchain.
20681 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20682 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20683 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20684 * (respectively) as opposed to the more usual
20685 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20687 * Pre-IEEE-754 floating point format do not even have inf/nan support
20688 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20689 * to even mention, causing immediate SIGFPE or equivalent: this is
20690 * the case with VAX floating point, for example.
20692 static void bytes(void *v, unsigned int n) {
20693 unsigned char *p = (unsigned char *)v;
20695 for (i = 0; i < n; i++) {
20696 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20699 int main(int argc, char *argv[]) {
20700 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20701 * because some compilers are 'smart' and not only warn but refuse to
20702 * compile such 'illegal' values. */
20703 double dinf = exp(1e9);
20704 double dnan = sqrt(-1.0);
20705 #ifdef HAS_LONG_DOUBLE
20706 long double ldinf = (long double)exp(1e9);
20707 long double ldnan = (long double)sqrt(-1.0);
20708 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20709 /* the 80-bit long doubles might have garbage in their excess bytes */
20710 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20711 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20714 switch (argv[1][0]) {
20715 case '1': bytes(&dinf, sizeof(dinf)); break;
20716 case '2': bytes(&dnan, sizeof(dnan)); break;
20717 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20718 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20726 if eval $compile; then
20727 doubleinfbytes=`$run ./try 1`
20728 doublenanbytes=`$run ./try 2`
20729 case "$d_longdbl" in
20731 longdblinfbytes=`$run ./try 3`
20732 longdblnanbytes=`$run ./try 4`
20736 # Defaults in case the above test program failed.
20737 case "$doublekind" in
20738 1) # IEEE 754 32-bit LE
20739 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20740 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20742 2) # IEEE 754 32-bit BE
20743 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20744 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20746 3) # IEEE 754 64-bit LE
20747 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20748 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20750 4) # IEEE 754 64-bit BE
20751 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20752 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20754 5) # IEEE 754 128-bit LE
20755 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20756 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20758 6) # IEEE 754 128-bit BE
20759 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20760 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20762 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20763 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20764 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20766 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20767 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20768 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20770 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20771 doubleinfbytes=$undef
20772 doublenanbytes=$undef
20775 doubleinfbytes=$undef
20776 doublenanbytes=$undef
20779 case "$longdblkind" in
20780 1) # IEEE 754 128-bit LE
20781 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20782 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20784 2) # IEEE 754 128-bit BE
20785 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20786 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20788 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20789 case "$longdblsize" in
20790 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20791 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20792 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20795 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20796 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20799 longdblinfbytes=$undef
20800 longdblnanbytes=$undef
20804 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20805 case "$longdblsize" in
20806 12) # 32-bit system
20807 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20808 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20810 16) # 64-bit system
20811 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20812 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20815 longdblinfbytes=$undef
20816 longdblnanbytes=$undef
20820 5) # 128-bit LE-LE "double double"
20821 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20822 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20824 6) # 128-bit BE-BE "double double"
20825 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20826 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20828 7) # 128-bit LE-BE "double double"
20829 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20830 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20832 8) # 128-bit BE-LE "double double"
20833 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20834 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20836 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20837 longdblinfbytes=$undef
20838 longdblnanbytes=$undef
20841 longdblinfbytes=$undef
20842 longdblnanbytes=$undef
20846 # In case the program crashed the values are empty, turn them undef.
20847 case "$doubleinfbytes" in
20848 '') doubleinfbytes=$undef ;;
20850 case "$doublenanbytes" in
20851 '') doublenanbytes=$undef ;;
20853 case "$longdblinfbytes" in
20854 '') longdblinfbytes=$undef ;;
20856 case "$longdblnanbytes" in
20857 '') longdblnanbytes=$undef ;;
20861 : Check the length of the double mantissa
20862 $echo "Checking how many mantissa bits your doubles have..." >&4
20865 #$i_sunmath I_SUNMATH
20867 # include <float.h>
20870 # include <sunmath.h>
20872 #ifdef DBL_MANT_DIG
20873 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20876 int main(int argc, char *argv[]) {
20878 printf("%d\n", BITS);
20884 if eval $compile; then
20885 doublemantbits=`$run ./try`
20887 doublemantbits="$undef"
20891 : Check the length of the longdouble mantissa
20892 $echo "Checking how many mantissa bits your long doubles have..." >&4
20895 #$i_sunmath I_SUNMATH
20897 # include <float.h>
20900 # include <sunmath.h>
20902 #$d_longdbl HAS_LONG_DOUBLE
20903 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20904 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20905 /* This format has no implicit bit. Beware, however, that for
20906 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20907 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20908 * and the top bit must have been one since 387, zero is plain invalid.
20909 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20910 # define BITS LDBL_MANT_DIG
20911 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20912 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20913 * reason e.g. Irix thinks 107. But in any case, we want only
20914 * the number of real bits, the implicit bits are of no interest. */
20915 # define BITS 2 * (DBL_MANT_DIG - 1)
20917 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20921 int main(int argc, char *argv[]) {
20923 printf("%d\n", BITS);
20929 if eval $compile; then
20930 longdblmantbits=`$run ./try`
20932 longdblmantbits="$undef"
20936 : Check the length of the NV mantissa
20937 $echo "Checking how many mantissa bits your NVs have..." >&4
20938 if test "X$usequadmath" = "X$define"; then
20939 nvmantbits=112 # 128-1-15
20941 if test "X$nvsize" = "X$doublesize"; then
20942 nvmantbits="$doublemantbits"
20944 if test "X$nvsize" = "X$longdblsize"; then
20945 nvmantbits="$longdblmantbits"
20947 nvmantbits="$undef"
20952 : How can we generate normalized random numbers ?
20954 echo "Using our internal random number implementation..." >&4
20957 *-Dmy_rand=*|*-Dmy_srand=*)
20958 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20959 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20960 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20961 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20965 randfunc=Perl_drand48
20966 drand01="Perl_drand48()"
20967 seedfunc="Perl_drand48_init"
20971 : Probe whether dtrace builds an object, as newer Illumos requires an input
20972 : object file that uses at least one of the probes defined in the .d file
20973 case "$usedtrace" in
20975 case "$dtracexnolibs" in
20976 $define|true|[yY]*)
20977 dtracexnolibs=$define
20978 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20981 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20982 dtracexnolibs=$define
20983 echo "Your dtrace accepts -xnolibs"
20984 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20985 dtracexnolibs=$undef
20986 echo "Your dtrace doesn't accept -xnolibs"
20988 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20993 dtracexnolibs=$undef
20994 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20997 case $dtracexnolibs in
20998 $define) xnolibs=-xnolibs ;;
21002 case "$dtraceobject" in
21003 $define|true|[yY]*)
21004 dtraceobject=$define
21008 #include "perldtrace.h"
21010 PERL_LOADED_FILE("dummy");
21014 dtraceobject=$undef
21015 if $cc -c -o try.o $optimize $ccflags try.c \
21016 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21017 dtraceobject=$define
21018 echo "Your dtrace builds an object file"
21021 *) dtraceobject=$undef ;;
21023 $rm_try perldtrace.o perldtrace.h
21026 : Determine if this is an EBCDIC system
21028 echo "Determining whether or not we are on an EBCDIC system..." >&4
21029 $cat >try.c <<'EOM'
21032 if ('M'==0xd4) return 0;
21039 if eval $compile_ok; then
21040 if $run ./try; then
21041 echo "You seem to speak EBCDIC." >&4
21044 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21047 echo "I'm unable to compile the test program." >&4
21048 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21054 : Check how to flush
21057 Checking how to flush all pending stdio output...
21059 # I only know how to find the first 32 possibly open files on SunOS.
21060 # See also hints/sunos_4_1.sh and util.c --AD
21062 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21064 $cat >>try.c <<EOCP
21066 #$i_stdlib I_STDLIB
21068 #include <stdlib.h>
21070 #$i_unistd I_UNISTD
21072 # include <unistd.h>
21074 #$d_sysconf HAS_SYSCONF
21075 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21076 #ifdef HAS_STDIO_STREAM_ARRAY
21077 # define STDIO_STREAM_ARRAY $stdio_stream_array
21082 p = fopen("try.out", "w");
21086 # ifdef TRY_FPRINTF
21090 #ifdef TRY_FFLUSH_NULL
21093 #ifdef TRY_FFLUSH_ALL
21095 long open_max = -1;
21096 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21097 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21099 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21100 open_max = sysconf(_SC_OPEN_MAX);
21103 open_max = FOPEN_MAX;
21106 open_max = OPEN_MAX;
21115 # ifdef HAS_STDIO_STREAM_ARRAY
21116 if (open_max > 0) {
21118 for (i = 0; i < open_max; i++)
21119 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21120 STDIO_STREAM_ARRAY[i]._file < open_max &&
21121 STDIO_STREAM_ARRAY[i]._flag)
21122 fflush(&STDIO_STREAM_ARRAY[i]);
21130 : first we have to find out how _not_ to flush
21132 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21134 set try -DTRY_FPUTC
21135 if eval $compile; then
21136 $run ./try 2>/dev/null
21139 if $test ! -s try.out -a "X$code" = X42; then
21145 set try -DTRY_FPRINTF
21146 if eval $compile; then
21147 $run ./try 2>/dev/null
21150 if $test ! -s try.out -a "X$code" = X42; then
21151 output=-DTRY_FPRINTF
21157 : check for fflush NULL behavior
21158 case "$fflushNULL" in
21159 '') set try -DTRY_FFLUSH_NULL $output
21160 if eval $compile; then
21161 $run ./try 2>/dev/null
21164 if $test -s try.out -a "X$code" = X42; then
21165 fflushNULL="`$cat try.out`"
21167 if $test "X$code" != X42; then
21169 (If this test failed, don't worry, we'll try another method shortly.)
21174 $rm -f core try.core core.try.*
21175 case "$fflushNULL" in
21177 Your fflush(NULL) works okay for output streams.
21178 Let's see if it clobbers input pipes...
21180 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21181 # bug that improperly flushes the input end of pipes. So we avoid the
21182 # autoflush on fork/system/exec support for now. :-(
21183 $cat >tryp.c <<EOCP
21186 main(int argc, char **argv)
21192 while ((i = getc(stdin)) != -1
21193 && (*bp++ = i) != '\n'
21194 && bp < &buf[1024])
21197 fprintf(stdout, "%s", buf);
21205 fflushNULL="$define"
21207 if eval $compile; then
21209 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21210 if $test "X$targethost" != X; then
21213 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21215 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21217 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21219 fflush(NULL) seems to behave okay with input streams.
21221 fflushNULL="$define"
21224 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21226 fflushNULL="$undef"
21229 $rm -f core tryp.c tryp.core core.tryp.*
21232 Your fflush(NULL) isn't working (contrary to ANSI C).
21234 fflushNULL="$undef"
21237 Cannot figure out whether your fflush(NULL) works or not.
21238 I'm assuming it doesn't (contrary to ANSI C).
21240 fflushNULL="$undef"
21244 $define|true|[yY]*)
21245 fflushNULL="$define"
21248 fflushNULL="$undef"
21251 : check explicit looping only if NULL did not work, and if the pipe
21252 : bug does not show up on an explicit flush too
21253 case "$fflushNULL" in
21255 $cat >tryp.c <<EOCP
21258 main(int argc, char **argv)
21264 while ((i = getc(stdin)) != -1
21265 && (*bp++ = i) != '\n'
21266 && bp < &buf[1024])
21269 fprintf(stdout, "%s", buf);
21278 if eval $compile; then
21280 if $test "X$targethost" != X; then
21283 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21285 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21287 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21289 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21291 : now check for fflushall behaviour
21292 case "$fflushall" in
21293 '') set try -DTRY_FFLUSH_ALL $output
21294 if eval $compile; then
21296 (Now testing the other method--but note that this also may fail.)
21298 $run ./try 2>/dev/null
21301 if $test -s try.out -a "X$code" = X42; then
21302 fflushall="`$cat try.out`"
21306 case "$fflushall" in
21308 Whew. Flushing explicitly all the stdio streams works.
21310 fflushall="$define"
21313 Sigh. Flushing explicitly all the stdio streams doesn't work.
21318 Cannot figure out whether flushing stdio streams explicitly works or not.
21319 I'm assuming it doesn't.
21325 "$define"|true|[yY]*)
21326 fflushall="$define"
21334 All is futile. Even fflush(stdin) clobbers input pipes!
21341 $rm -f core tryp.c tryp.core core.tryp.*
21343 *) fflushall="$undef"
21347 case "$fflushNULL$fflushall" in
21350 OK, I give up. I cannot figure out how to flush pending stdio output.
21351 We won't be flushing handles at all before fork/exec/popen.
21357 : Store the full pathname to the ar program for use in the C program
21358 : Respect a hint or command line value for full_ar.
21363 : Store the full pathname to the sed program for use in the C program
21366 : see what type gids are declared as in the kernel
21368 echo "Looking for the type for group ids returned by getgid()."
21369 set gid_t gidtype xxx stdio.h sys/types.h
21373 xxx=`./findhdr sys/user.h`
21374 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21376 unsigned) dflt="$1 $2" ;;
21380 *) dflt="$gidtype";;
21383 gid_t) echo "gid_t found." ;;
21384 *) rp="What is the type for group ids returned by getgid()?"
21390 : Check the size of GID
21393 *_t) zzz="$gidtype" ;;
21396 echo "Checking the size of $zzz..." >&4
21398 #include <sys/types.h>
21400 #$i_stdlib I_STDLIB
21402 #include <stdlib.h>
21405 printf("%d\n", (int)sizeof($gidtype));
21410 if eval $compile_ok; then
21414 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21417 echo "Your $zzz is $gidsize bytes long."
21422 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21426 : Check if GID is signed
21429 *_t) zzz="$gidtype" ;;
21432 echo "Checking the sign of $zzz..." >&4
21434 #include <sys/types.h>
21445 if eval $compile; then
21449 echo "(I can't execute the test program--guessing unsigned.)" >&4
21453 1) echo "Your $zzz is unsigned." ;;
21454 -1) echo "Your $zzz is signed." ;;
21460 echo "(I can't compile the test program--guessing unsigned.)" >&4
21464 : Check 64bit sizes
21467 if $test X"$quadtype" != X; then
21469 echo "Checking how to print 64-bit integers..." >&4
21471 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21472 $cat >try.c <<'EOCP'
21473 #include <sys/types.h>
21476 int q = 12345678901;
21477 printf("%ld\n", q);
21481 if eval $compile; then
21485 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21486 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21487 echo "We will use %d."
21493 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21494 $cat >try.c <<'EOCP'
21495 #include <sys/types.h>
21498 long q = 12345678901;
21499 printf("%ld\n", q);
21503 if eval $compile; then
21507 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21508 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21509 echo "We will use %ld."
21515 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21516 $cat >try.c <<'EOCP'
21517 #include <sys/types.h>
21518 #include <inttypes.h>
21521 int64_t q = 12345678901;
21522 printf("%" PRId64 "\n", q);
21526 if eval $compile; then
21530 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21531 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21532 echo "We will use the C9X style."
21538 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21540 #include <sys/types.h>
21543 $quadtype q = 12345678901;
21544 printf("%Ld\n", q);
21548 if eval $compile; then
21552 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21553 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21554 echo "We will use %Ld."
21560 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21561 $cat >try.c <<'EOCP'
21562 #include <sys/types.h>
21565 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21566 printf("%lld\n", q);
21570 if eval $compile; then
21574 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21575 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21576 echo "We will use the %lld style."
21582 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21584 #include <sys/types.h>
21587 $quadtype q = 12345678901;
21588 printf("%qd\n", q);
21592 if eval $compile; then
21596 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21597 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21598 echo "We will use %qd."
21604 if $test X"$sPRId64" = X; then
21605 echo "Cannot figure out how to print 64-bit integers." >&4
21612 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21613 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21615 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21616 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21620 : Check format strings for internal types
21622 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21624 if $test X"$ivsize" = X8; then
21625 ivdformat="$sPRId64"
21626 uvuformat="$sPRIu64"
21627 uvoformat="$sPRIo64"
21628 uvxformat="$sPRIx64"
21629 uvXUformat="$sPRIXU64"
21631 if $test X"$ivsize" = X"$longsize"; then
21638 if $test X"$ivsize" = X"$intsize"; then
21646 if $test X"$ivsize" = X"$shortsize"; then
21657 if $test X"$usequadmath" = X"$define"; then
21665 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21666 nveformat="$sPRIeldbl"
21667 nvfformat="$sPRIfldbl"
21668 nvgformat="$sPRIgldbl"
21669 nvEUformat="$sPRIEUldbl"
21670 nvFUformat="$sPRIFUldbl"
21671 nvGUformat="$sPRIGUldbl"
21682 case "$ivdformat" in
21683 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21688 : Check format string for GID
21691 $echo "Checking the format string to be used for gids..." >&4
21694 -1) if $test X"$gidsize" = X"$ivsize"; then
21695 gidformat="$ivdformat"
21697 if $test X"$gidsize" = X"$longsize"; then
21700 if $test X"$gidsize" = X"$intsize"; then
21703 if $test X"$gidsize" = X"$shortsize"; then
21710 *) if $test X"$gidsize" = X"$uvsize"; then
21711 gidformat="$uvuformat"
21713 if $test X"$gidsize" = X"$longsize"; then
21716 if $test X"$gidsize" = X"$intsize"; then
21719 if $test X"$gidsize" = X"$shortsize"; then
21728 : see if getgroups exists
21729 set getgroups d_getgrps
21732 : see if setgroups exists
21733 set setgroups d_setgrps
21736 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21738 case "$d_getgrps$d_setgrps" in
21740 case "$groupstype" in
21741 '') dflt="$gidtype" ;;
21742 *) dflt="$groupstype" ;;
21745 What type of pointer is the second argument to getgroups() and setgroups()?
21746 Usually this is the same as group ids, $gidtype, but not always.
21749 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21753 *) groupstype="$gidtype";;
21756 : check whether make sets MAKE
21758 echo "Checking if your $make program sets \$(MAKE)..." >&4
21759 case "$make_set_make" in
21761 $sed 's/^X //' > testmake.mak << 'EOF'
21763 X @echo 'maketemp="$(MAKE)"'
21765 case "`$make -f testmake.mak 2>/dev/null`" in
21766 *maketemp=*) make_set_make='#' ;;
21767 *) make_set_make="MAKE=$make" ;;
21769 $rm -f testmake.mak
21772 case "$make_set_make" in
21773 '#') echo "Yup, it does.";;
21774 *) echo "Nope, it doesn't.";;
21777 : see what type is used for mode_t
21778 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21779 set mode_t modetype int stdio.h sys/types.h
21782 : see if we need va_copy
21784 case "$i_stdarg" in
21787 #include <stdarg.h>
21789 #$i_stdlib I_STDLIB
21791 #include <stdlib.h>
21793 #include <signal.h>
21796 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21798 return vfprintf(f, fmt, *valp);
21802 myvfprintf(FILE *f, const char *fmt, va_list val)
21804 return ivfprintf(f, fmt, &val);
21808 myprintf(char *fmt, ...)
21811 va_start(val, fmt);
21812 return myvfprintf(stdout, fmt, val);
21816 main(int ac, char **av)
21818 signal(SIGSEGV, exit);
21820 myprintf("%s%cs all right, then\n", "that", '\'');
21825 if eval $compile && $run ./try 2>&1 >/dev/null; then
21826 case "`$run ./try`" in
21827 "that's all right, then")
21833 yes) echo "It seems that you don't need va_copy()." >&4
21834 need_va_copy="$undef"
21836 *) echo "It seems that va_copy() or similar will be needed." >&4
21837 need_va_copy="$define"
21842 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21843 need_va_copy="$undef"
21847 : see what type is used for size_t
21848 rp="What is the type used for the length parameter for string functions?"
21849 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21852 : check for type of arguments to gethostbyaddr.
21853 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21854 case "$d_gethbyaddr" in
21858 Checking to see what type of arguments are accepted by gethostbyaddr().
21860 hdrs="$define sys/types.h
21861 $d_socket sys/socket.h
21862 $i_niin netinet/in.h
21864 $i_unistd unistd.h"
21865 : The first arg can 'char *' or 'void *'
21866 : The second arg is some of integral type
21867 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21868 for yyy in size_t long int; do
21869 case "$netdb_host_type" in
21870 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21871 if ./protochk "$try" $hdrs; then
21872 echo "Your system accepts $xxx for the first arg."
21873 echo "...and $yyy for the second arg."
21874 netdb_host_type="$xxx"
21875 netdb_hlen_type="$yyy"
21881 : In case none of those worked, prompt the user.
21882 case "$netdb_host_type" in
21883 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21886 netdb_host_type=$ans
21887 rp='What is the type for the 2nd argument to gethostbyaddr?'
21890 netdb_hlen_type=$ans
21894 *) : no gethostbyaddr, so pick harmless defaults
21895 netdb_host_type='char *'
21896 netdb_hlen_type="$sizetype"
21899 # Remove the "const" if needed. -- but then we'll have a
21901 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21904 : check for type of argument to gethostbyname.
21905 if test "X$netdb_name_type" = X ; then
21906 case "$d_gethbyname" in
21910 Checking to see what type of argument is accepted by gethostbyname().
21912 hdrs="$define sys/types.h
21913 $d_socket sys/socket.h
21914 $i_niin netinet/in.h
21916 $i_unistd unistd.h"
21917 for xxx in "const char *" "char *"; do
21918 case "$netdb_name_type" in
21919 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21920 if ./protochk "$try" $hdrs; then
21921 echo "Your system accepts $xxx."
21922 netdb_name_type="$xxx"
21927 : In case none of those worked, prompt the user.
21928 case "$netdb_name_type" in
21929 '') rp='What is the type for the 1st argument to gethostbyname?'
21932 netdb_name_type=$ans
21936 *) : no gethostbyname, so pick harmless default
21937 netdb_name_type='char *'
21942 : check for type of 1st argument to getnetbyaddr.
21943 if test "X$netdb_net_type" = X ; then
21944 case "$d_getnbyaddr" in
21948 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21950 hdrs="$define sys/types.h
21951 $d_socket sys/socket.h
21952 $i_niin netinet/in.h
21954 $i_unistd unistd.h"
21955 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21956 case "$netdb_net_type" in
21957 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21958 if ./protochk "$try" $hdrs; then
21959 echo "Your system accepts $xxx."
21960 netdb_net_type="$xxx"
21965 : In case none of those worked, prompt the user.
21966 case "$netdb_net_type" in
21967 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21970 netdb_net_type=$ans
21974 *) : no getnetbyaddr, so pick harmless default
21975 netdb_net_type='long'
21979 : locate the preferred pager for this system
21986 [a-zA-Z]:/*) dflt=$pg;;
21990 [a-zA-Z]:/*) dflt=$more;;
21994 [a-zA-Z]:/*) dflt=$less;;
21997 '') dflt=/usr/ucb/more;;
22005 rp='What pager is used on your system?'
22009 : see if ar generates random libraries by itself
22011 echo "Checking how to generate random libraries on your machine..." >&4
22012 echo 'int bar1() { return bar2(); }' > bar1.c
22013 echo 'int bar2() { return 2; }' > bar2.c
22015 #$i_stdlib I_STDLIB
22017 #include <stdlib.h>
22019 int main() { printf("%d\n", bar1()); exit(0); }
22021 $cc $ccflags -c bar1.c >/dev/null 2>&1
22022 $cc $ccflags -c bar2.c >/dev/null 2>&1
22023 $cc $ccflags -c foo.c >/dev/null 2>&1
22024 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22025 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22026 $run ./foobar >/dev/null 2>&1; then
22027 echo "$ar appears to generate random libraries itself."
22029 if [ "X$ranlib" = "X" ]; then
22032 elif $ar s bar$_a >/dev/null 2>&1 &&
22033 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22034 $run ./foobar >/dev/null 2>&1; then
22035 echo "a table of contents needs to be added with '$ar s'."
22038 elif $ar ts bar$_a >/dev/null 2>&1 &&
22039 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22040 $run ./foobar >/dev/null 2>&1; then
22041 echo "a table of contents needs to be added with '$ar ts'."
22048 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22049 $test -f $ranlib || ranlib=''
22052 if $test -n "$ranlib"; then
22053 echo "your system has '$ranlib'; we'll use that."
22056 echo "your system doesn't seem to support random libraries"
22057 echo "so we'll use lorder and tsort to order the libraries."
22064 : see if this is a values.h system
22065 set values.h i_values
22068 : Check the max offset that gmtime and localtime accept
22069 echo "Checking max offsets that gmtime () accepts"
22072 define) yyy="#include <values.h>" ;;
22076 case "$sGMTIME_min/$sGMTIME_max" in
22079 #include <sys/types.h>
22088 void gm_check (time_t t, int min_year, int max_year)
22091 if ( tmp == NULL ||
22092 /* Check tm_year overflow */
22093 tmp->tm_year < min_year || tmp->tm_year > max_year)
22104 gm_check (MAXLONG, 69, 0x7fffffff);
22106 if (tmp == NULL || tmp->tm_year < 0) {
22107 for (i = 63; i >= 0; i--) {
22108 time_t x = pt | ((time_t)1 << i);
22109 if (x < 0 || x < pt) continue;
22110 gm_check (x, 69, 0x7fffffff);
22113 printf ("sGMTIME_max=%ld\n", pt);
22122 gm_check (MINLONG, -1900, 70);
22125 for (i = 36; i >= 0; i--) {
22126 time_t x = pt - ((time_t)1 << i);
22127 if (x > 0) continue;
22128 gm_check (x, -1900, 70);
22131 printf ("sGMTIME_min=%ld\n", pt);
22135 int main (int argc, char *argv[])
22137 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22144 if eval $compile; then
22145 eval `$run ./try 2>/dev/null`
22147 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22153 echo "Checking max offsets that localtime () accepts"
22155 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22158 #include <sys/types.h>
22167 void local_check (time_t t, int min_year, int max_year)
22169 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22172 tmp = localtime (&t);
22173 if ( tmp == NULL ||
22174 /* Check tm_year overflow */
22175 tmp->tm_year < min_year || tmp->tm_year > max_year)
22179 } /* local_check */
22186 local_check (MAXLONG, 69, 0x7fffffff);
22188 if (tmp == NULL || tmp->tm_year < 0) {
22189 for (i = 63; i >= 0; i--) {
22190 time_t x = pt | ((time_t)1 << i);
22191 if (x < 0 || x < pt) continue;
22192 local_check (x, 69, 0x7fffffff);
22195 printf ("sLOCALTIME_max=%ld\n", pt);
22204 local_check (MINLONG, -1900, 70);
22207 for (i = 36; i >= 0; i--) {
22208 time_t x = pt - ((time_t)1 << i);
22209 if (x > 0) continue;
22210 local_check (x, -1900, 70);
22213 printf ("sLOCALTIME_min=%ld\n", pt);
22217 int main (int argc, char *argv[])
22225 if eval $compile; then
22226 eval `$run ./try 2>/dev/null`
22228 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22234 : check for type of arguments to select.
22235 case "$selecttype" in
22236 '') case "$d_select" in
22240 Checking to see what type of arguments are accepted by select().
22242 hdrs="$define sys/types.h
22243 $i_systime sys/time.h
22244 $i_sysselct sys/select.h
22245 $d_socket sys/socket.h"
22246 : The first arg can be int, unsigned, or size_t
22247 : The last arg may or may not be 'const'
22249 : void pointer has been seen but using that
22250 : breaks the selectminbits test
22251 for xxx in 'fd_set *' 'int *'; do
22252 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22253 for tmo in 'struct timeval *' 'const struct timeval *'; do
22255 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22256 if ./protochk "$try" $hdrs; then
22257 echo "Your system accepts $xxx."
22266 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22267 case "$d_fd_set" in
22268 $define) dflt="fd_set *" ;;
22277 *) : no select, so pick a harmless default
22284 : check for the select 'width'
22285 case "$selectminbits" in
22286 '') safebits=`expr $ptrsize \* 8`
22287 case "$d_select" in
22291 Checking to see on how many bits at a time your select() operates...
22294 #include <sys/types.h>
22296 #$i_systime I_SYS_TIME
22297 #$i_systimek I_SYS_TIME_KERNEL
22302 # ifdef I_SYS_TIME_KERNEL
22305 # include <sys/time.h>
22306 # ifdef I_SYS_TIME_KERNEL
22310 #$i_sysselct I_SYS_SELECT
22311 #ifdef I_SYS_SELECT
22312 #include <sys/select.h>
22314 #$d_socket HAS_SOCKET
22316 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22319 #$i_stdlib I_STDLIB
22321 #include <stdlib.h>
22324 #define S sizeof(*(b))
22326 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22327 #define NBITS (NBYTES * 8)
22329 char *s = (char *)malloc(NBYTES);
22338 fp = fopen("try.c", "r");
22344 b = ($selecttype)s;
22345 for (i = 0; i < NBITS; i++)
22349 select(fd + 1, b, 0, 0, &t);
22350 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22352 printf("%d\n", i + 1);
22357 if eval $compile_ok; then
22358 selectminbits=`$run ./try 2>/dev/null`
22359 case "$selectminbits" in
22361 Cannot figure out on how many bits at a time your select() operates.
22362 I'll play safe and guess it is $safebits bits.
22364 selectminbits=$safebits
22365 bits="$safebits bits"
22368 *) bits="$selectminbits bits" ;;
22370 echo "Your select() operates on $bits at a time." >&4
22372 rp='What is the minimum number of bits your select() operates on?'
22373 case "$byteorder" in
22374 12345678) dflt=64 ;;
22380 selectminbits="$val"
22384 *) : no select, so pick a harmless default
22385 selectminbits=$safebits
22391 : Trace out the files included by signal.h, then look for SIGxxx names.
22392 case "$sig_num_init" in
22394 if [ "X$fieldn" = X ]; then
22395 : Just make some guesses. We check them later.
22396 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22398 xxx=`echo '#include <signal.h>' |
22399 $cppstdin $cppminus $cppflags 2>/dev/null |
22400 $grep '^[ ]*#.*include' |
22401 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22402 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22405 for xx in $xxx /dev/null ; do
22406 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22408 case "$xxxfiles" in
22409 '') xxxfiles=`./findhdr signal.h` ;;
22412 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22413 print substr($2, 4, 20)
22415 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22416 print substr($3, 4, 20)
22418 : Append some common names just in case the awk scan failed.
22419 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22420 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22421 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22422 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22423 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22425 : generate a few handy files for later
22426 $cat > signal.c <<EOCP
22427 #include <sys/types.h>
22428 #include <signal.h>
22429 #$i_stdlib I_STDLIB
22431 #include <stdlib.h>
22436 /* Strange style to avoid deeply-nested #if/#else/#endif */
22439 # define NSIG (_NSIG)
22445 # define NSIG (SIGMAX+1)
22451 # define NSIG (SIG_MAX+1)
22457 # define NSIG (_SIG_MAX+1)
22463 # define NSIG (MAXSIG+1)
22469 # define NSIG (MAX_SIG+1)
22474 # ifdef SIGARRAYSIZE
22475 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22481 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22485 /* Default to some arbitrary number that's big enough to get most
22486 of the common signals.
22492 printf("NSIG %d\n", NSIG);
22498 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22500 printf "#ifdef SIG"; printf $1; printf "\n"
22501 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22502 printf $1; printf ");\n"
22506 printf "#endif /* JUST_NSIG */\n";
22507 printf "exit(0);\n}\n";
22510 $cat >signal.awk <<'EOP'
22511 BEGIN { ndups = 0 }
22512 $1 ~ /^NSIG$/ { nsig = $2 }
22513 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22514 if ($2 > maxsig) { maxsig = $2 }
22515 if (sig_name[$2]) {
22516 dup_name[ndups] = $1
22517 dup_num[ndups] = $2
22529 printf("NSIG %d\n", nsig);
22530 for (n = 1; n < nsig; n++) {
22532 printf("%s %d\n", sig_name[n], sig_num[n])
22535 printf("NUM%d %d\n", n, n)
22538 for (n = 0; n < ndups; n++) {
22539 printf("%s %d\n", dup_name[n], dup_num[n])
22543 $cat >signal_cmd <<EOS
22545 if $test -s signal.lst; then
22546 echo "Using your existing signal.lst file"
22551 $cat >>signal_cmd <<'EOS'
22554 if eval $compile_ok; then
22555 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22556 $uniq | $awk -f signal.awk >signal.lst
22558 echo "(I can't seem be able to compile the whole test program)" >&4
22559 echo "(I'll try it in little pieces.)" >&4
22560 set signal -DJUST_NSIG
22561 if eval $compile_ok; then
22562 $run ./signal$_exe > signal.nsg
22565 echo "I can't seem to figure out how many signals you have." >&4
22566 echo "Guessing 50." >&4
22567 echo 'NSIG 50' > signal.nsg
22569 : Now look at all the signal names, one at a time.
22570 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22571 $cat > signal.c <<EOCP
22572 #include <sys/types.h>
22573 #include <signal.h>
22576 printf("$xx %d\n", SIG${xx});
22581 if eval $compile; then
22582 echo "SIG${xx} found."
22583 $run ./signal$_exe >> signal.ls1
22585 echo "SIG${xx} NOT found."
22588 if $test -s signal.ls1; then
22589 $cat signal.nsg signal.ls1 |
22590 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22594 if $test -s signal.lst; then
22597 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22598 echo 'kill -l' >signal
22599 set X `csh -f <signal`
22603 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22605 echo $@ | $tr ' ' $trnl | \
22606 $awk '{ printf "%s %d\n", $1, ++s; }
22607 END { printf "NSIG %d\n", ++s }' >signal.lst
22609 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22611 chmod a+x signal_cmd
22612 $eunicefix signal_cmd
22616 : generate list of signal names
22617 case "$sig_num_init" in
22620 case "$sig_name_init" in
22622 *) case "$sig_num_init" in
22623 ''|*,*) doinit=yes ;;
22628 echo "Generating a list of signal names and numbers..." >&4
22630 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22631 sig_name=`$awk 'BEGIN { printf "ZERO " }
22632 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22633 sig_num=`$awk 'BEGIN { printf "0 " }
22634 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22635 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22636 !/^NSIG/ { printf "\"%s\", ", $1 }
22637 END { printf "0\n" }' signal.lst`
22638 sig_num_init=`$awk 'BEGIN { printf "0, " }
22639 !/^NSIG/ { printf "%d, ", $2}
22640 END { printf "0\n"}' signal.lst`
22643 echo "The following $sig_count signals are available:"
22645 echo $sig_name | $awk \
22646 'BEGIN { linelen = 0 }
22648 for (i = 1; i <= NF; i++) {
22649 name = "SIG" $i " "
22650 linelen = linelen + length(name)
22651 if (linelen > 70) {
22653 linelen = length(name)
22659 sig_size=`echo $sig_name | awk '{print NF}'`
22660 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22664 : Check size of size
22666 case "$sizetype" in
22667 *_t) zzz="$sizetype" ;;
22668 *) zzz="filesize" ;;
22670 echo "Checking the size of $zzz..." >&4
22672 #include <sys/types.h>
22674 #$i_stdlib I_STDLIB
22676 #include <stdlib.h>
22679 printf("%d\n", (int)sizeof($sizetype));
22684 if eval $compile_ok; then
22688 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22691 echo "Your $zzz size is $sizesize bytes."
22696 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22700 : check for socklen_t
22702 echo "Checking to see if you have socklen_t..." >&4
22704 #include <sys/types.h>
22705 #$d_socket HAS_SOCKET
22707 #include <sys/socket.h>
22709 int main() { socklen_t x = 16; }
22712 if eval $compile; then
22714 echo "You have socklen_t."
22717 echo "You do not have socklen_t."
22718 case "$sizetype" in
22719 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22726 : see if this is a socks.h system
22727 set socks.h i_socks
22730 : check for type of the size argument to socket calls
22731 case "$d_socket" in
22735 Checking to see what type is the last argument of accept().
22738 case "$d_socklen_t" in
22739 "$define") yyy="$yyy socklen_t"
22741 yyy="$yyy $sizetype int long unsigned"
22742 for xxx in $yyy; do
22743 case "$socksizetype" in
22744 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22745 case "$usesocks" in
22747 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22748 echo "Your system accepts '$xxx *' for the last argument of accept()."
22749 socksizetype="$xxx"
22752 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22753 echo "Your system accepts '$xxx *' for the last argument of accept()."
22754 socksizetype="$xxx"
22761 : In case none of those worked, prompt the user.
22762 case "$socksizetype" in
22763 '') rp='What is the type for socket address structure sizes?'
22770 *) : no sockets, so pick relatively harmless default
22775 : see what type is used for signed size_t
22776 set ssize_t ssizetype int stdio.h sys/types.h
22781 #$i_stdlib I_STDLIB
22783 #include <stdlib.h>
22785 #include <sys/types.h>
22786 #define Size_t $sizetype
22787 #define SSize_t $dflt
22790 if (sizeof(Size_t) == sizeof(SSize_t))
22792 else if (sizeof(Size_t) == sizeof(int))
22801 if eval $compile_ok && $run ./try > /dev/null; then
22802 ssizetype=`$run ./try`
22803 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22806 Help! I can't compile and run the ssize_t test program: please enlighten me!
22807 (This is probably a misconfiguration in your system or libraries, and
22808 you really ought to fix it. Still, I'll try anyway.)
22810 I need a type that is the same size as $sizetype, but is guaranteed to
22811 be signed. Common values are ssize_t, int and long.
22814 rp="What signed type is the same size as $sizetype?"
22820 : Check the size of st_ino
22822 $echo "Checking the size of st_ino..." >&4
22823 $cat > try.c <<EOCP
22824 #include <sys/stat.h>
22826 #$i_stdlib I_STDLIB
22828 #include <stdlib.h>
22832 printf("%d\n", (int)sizeof(st.st_ino));
22837 if eval $compile_ok; then
22841 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22843 *) st_ino_size=$val
22844 $echo "Your st_ino is $st_ino_size bytes long."
22849 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22853 : Check if st_ino is signed
22855 $echo "Checking the sign of st_ino..." >&4
22856 $cat > try.c <<EOCP
22857 #include <sys/stat.h>
22862 if (foo.st_ino < 0)
22869 if eval $compile; then
22873 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22875 *) st_ino_sign=$val
22876 case "$st_ino_sign" in
22877 1) $echo "Your st_ino is unsigned." ;;
22878 -1) $echo "Your st_ino is signed." ;;
22884 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22888 : see what type of char stdio uses.
22890 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22891 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22892 echo "Your stdio uses unsigned chars." >&4
22893 stdchar="unsigned char"
22895 echo "Your stdio uses signed chars." >&4
22900 : Check size of UID
22903 *_t) zzz="$uidtype" ;;
22906 echo "Checking the size of $zzz..." >&4
22908 #include <sys/types.h>
22910 #$i_stdlib I_STDLIB
22912 #include <stdlib.h>
22915 printf("%d\n", (int)sizeof($uidtype));
22920 if eval $compile_ok; then
22924 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22927 echo "Your $zzz is $uidsize bytes long."
22932 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22935 : Check if UID is signed
22938 *_t) zzz="$uidtype" ;;
22941 echo "Checking the sign of $zzz..." >&4
22943 #include <sys/types.h>
22954 if eval $compile; then
22958 echo "(I can't execute the test program--guessing unsigned.)" >&4
22962 1) echo "Your $zzz is unsigned." ;;
22963 -1) echo "Your $zzz is signed." ;;
22969 echo "(I can't compile the test program--guessing unsigned.)" >&4
22973 : Check format string for UID
22975 $echo "Checking the format string to be used for uids..." >&4
22978 -1) if $test X"$uidsize" = X"$ivsize"; then
22979 uidformat="$ivdformat"
22981 if $test X"$uidsize" = X"$longsize"; then
22984 if $test X"$uidsize" = X"$intsize"; then
22987 if $test X"$uidsize" = X"$shortsize"; then
22994 *) if $test X"$uidsize" = X"$uvsize"; then
22995 uidformat="$uvuformat"
22997 if $test X"$uidsize" = X"$longsize"; then
23000 if $test X"$uidsize" = X"$intsize"; then
23003 if $test X"$uidsize" = X"$shortsize"; then
23012 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23014 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23015 $cat >try.c <<'EOM'
23016 /* Intentionally a long probe as I'd like to sanity check that the exact
23017 approach is going to work, as thinking it will work, but only having it
23018 part working at runtime is worse than not having it. */
23020 #include <sys/types.h>
23021 #include <sys/sysctl.h>
23022 #include <sys/param.h>
23024 #include <string.h>
23025 #include <stdlib.h>
23026 #include <unistd.h>
23029 main(int argc, char **argv) {
23031 char *argv_leaf = strrchr(argv[0], '/');
23037 mib[1] = KERN_PROC;
23038 mib[2] = KERN_PROC_PATHNAME;
23042 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23046 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23051 if (size < strlen(argv_leaf) + 1) {
23052 fprintf(stderr, "size %lu is too short for a path\n",
23053 (unsigned long) size);
23057 if (size > MAXPATHLEN * MAXPATHLEN) {
23058 fprintf(stderr, "size %lu is too long for a path\n",
23059 (unsigned long) size);
23063 buffer = (char *)malloc(size);
23069 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23074 if (strlen(buffer) + 1 != size) {
23075 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23076 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23081 if (*buffer != '/') {
23082 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23086 if (strstr(buffer, "/./")) {
23087 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23091 if (strstr(buffer, "/../")) {
23092 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23096 buffer_leaf = strrchr(buffer, '/');
23097 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23098 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23110 if eval $compile; then
23111 if $run ./try; then
23112 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23115 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23119 echo "I'm unable to compile the test program." >&4
23120 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23124 set usekernprocpathname
23127 : Determine if we can use _NSGetExecutablePath to find executing program
23129 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23130 $cat >try.c <<'EOM'
23131 /* Intentionally a long probe as I'd like to sanity check that the exact
23132 approach is going to work, as thinking it will work, but only having it
23133 part working at runtime is worse than not having it. */
23134 #include <mach-o/dyld.h>
23136 #include <stdlib.h>
23137 #include <sys/param.h>
23138 #include <string.h>
23141 main(int argc, char **argv) {
23143 uint32_t size = sizeof(buf);
23147 char *argv_leaf = strrchr(argv[0], '/');
23151 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23155 _NSGetExecutablePath(buf, &size);
23156 if (size > MAXPATHLEN * MAXPATHLEN) {
23157 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23158 (unsigned int) size);
23162 buffer = (char *)malloc(size);
23168 result = _NSGetExecutablePath(buffer, &size);
23170 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23171 result, (unsigned int) size);
23175 tidied = realpath(buffer, NULL);
23177 perror("realpath");
23183 if (*tidied != '/') {
23184 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23188 if (strstr(tidied, "/./")) {
23189 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23193 if (strstr(tidied, "/../")) {
23194 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23198 tidied_leaf = strrchr(tidied, '/');
23199 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23200 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23212 if eval $compile; then
23213 if $run ./try; then
23214 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23217 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23220 echo "I'm unable to compile the test program." >&4
23221 echo "I'll assume no _NSGetExecutablePath here." >&4
23224 set usensgetexecutablepath
23227 : Check if site customization support was requested
23228 case "$usesitecustomize" in
23229 $define|true|[Yy]*)
23230 usesitecustomize="$define"
23233 usesitecustomize="$undef"
23237 : see if prototypes support variable argument declarations
23239 case "$prototype$i_stdarg" in
23241 echo "It appears we'll be able to prototype varargs functions." >&4
23245 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23252 : determine compiler compiler
23261 if $test -f "$byacc$_exe"; then
23263 comp="byacc or $comp"
23265 if $test -f "$bison$_exe"; then
23266 comp="$comp or bison -y"
23268 rp="Which compiler compiler ($comp) shall I use?"
23277 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23283 : see if this is a assert.h system
23284 set assert.h i_assert
23287 : see if this is a bfd.h system
23291 : see if this is an execinfo.h system
23292 set execinfo.h i_execinfo
23295 : see if this is a fenv.h system
23299 : see if this is a fp.h system
23303 : see if this is a fp_class.h system
23304 set fp_class.h i_fp_class
23307 : see if gdbm.h is available
23312 : see if gdbm_open exists
23313 set gdbm_open d_gdbm_open
23315 case "$d_gdbm_open" in
23318 echo "We won't be including <gdbm.h>"
23327 : see if this is a ieeefp.h system
23328 case "$i_ieeefp" in
23329 '' ) set ieeefp.h i_ieeefp
23334 : see if this is a libutil.h system
23335 set libutil.h i_libutil
23338 : see if mach cthreads are available
23339 if test "X$usethreads" = "X$define"; then
23340 set mach/cthreads.h i_machcthr
23343 i_machcthr="$undef"
23346 : see if this is a mntent.h system
23347 set mntent.h i_mntent
23350 : see if net/errno.h is available
23352 set net/errno.h val
23355 : Unfortunately, it causes problems on some systems. Arrgh.
23358 cat > try.c <<'EOM'
23361 #include <net/errno.h>
23367 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23368 echo "We'll be including <net/errno.h>." >&4
23370 echo "We won't be including <net/errno.h>." >&4
23379 : see if netinet/tcp.h is available
23380 set netinet/tcp.h i_netinettcp
23383 : see if this is a poll.h system
23387 : see if this is a prot.h system
23391 : Preprocessor symbols
23393 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23394 $cat <<'EOSH' > Cppsym.know
23395 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23396 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23397 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23398 arch_pwr ardent ARM ARM32 atarist att386 att3b
23399 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23400 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23401 byteorder byte_order
23402 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23403 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23404 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23405 ELF encore EPI EXTENSIONS
23406 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23407 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23408 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23409 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23410 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23411 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23412 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23413 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23414 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23416 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23417 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23418 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23420 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23421 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23422 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23423 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23424 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23425 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23426 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23427 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23428 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23429 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23430 ns32000 ns32016 ns32332 ns32k nsc32000
23431 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23432 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23433 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23434 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23436 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23437 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23438 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23439 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23440 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23441 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23442 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23443 SYSV4 SYSV5 sysV68 sysV88
23444 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23445 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23446 tower32_800 tower32_850 tss
23447 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23448 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23449 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23450 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23451 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23452 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23454 vax venix VMESA vms
23455 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23456 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23459 # Maybe put other stuff here too.
23460 ./tr '-' '_' <<EOSH >>Cppsym.know
23463 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23464 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23465 $cat Cppsym.know > Cppsym.c
23466 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23467 $rm -f Cppsym.a Cppsym.b Cppsym.c
23468 cat <<EOSH > Cppsym
23470 if $test \$# -gt 0; then
23471 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23472 if $test -s Cppsym.got; then
23479 $tr " " "$trnl" | ./Cppsym.try
23485 cat <<EOSH > Cppsym.try
23487 cat <<'EOCP' > try.c
23490 #define STRINGIFY(a) "a"
23492 #if cpp_stuff == 42
23493 #define StGiFy(a) #a
23494 #define STRINGIFY(a) StGiFy(a)
23496 #if $cpp_stuff != 1 && $cpp_stuff != 42
23497 # include "Bletch: How does this C preprocessor stringify macros?"
23503 cat <<'EOSH' >> Cppsym.try
23505 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23506 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23507 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23508 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23510 echo 'return 0;}' >> try.c
23512 cat <<EOSH >> Cppsym.try
23514 case "$osname-$gccversion" in
23515 irix-) ccflags="\$ccflags -woff 1178" ;;
23516 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23518 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23520 chmod +x Cppsym.try
23521 $eunicefix Cppsym.try
23522 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23523 : Add in any Linux cpp "predefined macros":
23524 case "$osname::$gccversion" in
23525 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23527 rm -f $tHdrH'.h' $tHdrH
23529 # Filter out macro arguments, such as Linux's __INT8_C(c)
23530 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23531 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23532 if [ -s $tHdrH'_cppsym.real' ]; then
23533 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23536 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23539 : now check the C compiler for additional symbols
23540 postprocess_cc_v=''
23542 aix) postprocess_cc_v="|$tr , ' '" ;;
23549 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23552 -D*) echo "\$i" | $sed 's/^-D//';;
23553 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23558 postprocess_cc_v=''
23561 ./ccsym > ccsym1.raw
23562 if $test -s ccsym1.raw; then
23563 $sort ccsym1.raw | $uniq >ccsym.raw
23565 mv ccsym1.raw ccsym.raw
23568 $awk '/\=/ { print $0; next }
23569 { print $0"=1" }' ccsym.raw >ccsym.list
23570 $comm -13 Cppsym.true ccsym.list >ccsym.own
23571 $comm -12 Cppsym.true ccsym.list >ccsym.com
23572 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23574 if $test -z ccsym.raw; then
23575 echo "Your C compiler doesn't seem to define any symbols!" >&4
23577 echo "However, your C preprocessor defines the following symbols:"
23580 cppsymbols=`$cat Cppsym.true`
23581 cppsymbols=`echo $cppsymbols`
23582 cppccsymbols="$cppsymbols"
23584 if $test -s ccsym.com; then
23585 echo "Your C compiler and pre-processor define these symbols:"
23586 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23589 cppccsymbols=`$cat ccsym.com`
23590 cppccsymbols=`echo $cppccsymbols`
23591 $test "$silent" || sleep 1
23593 if $test -s ccsym.cpp; then
23594 $test "$also" && echo " "
23595 echo "Your C pre-processor ${also}defines the following symbols:"
23596 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23598 cppsymbols=`$cat ccsym.cpp`
23599 cppsymbols=`echo $cppsymbols`
23600 $test "$silent" || sleep 1
23602 if $test -s ccsym.own; then
23603 $test "$also" && echo " "
23604 echo "Your C compiler ${also}defines the following cpp symbols:"
23605 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23606 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23607 ccsymbols=`$cat ccsym.own`
23608 ccsymbols=`echo $ccsymbols`
23609 $test "$silent" || sleep 1
23613 : add -D_FORTIFY_SOURCE if feasible and not already there
23614 case "$gccversion" in
23615 [45].*) case "$optimize$ccflags" in
23616 *-O*) case "$ccflags$cppsymbols" in
23617 *_FORTIFY_SOURCE=*) # Don't add it again.
23618 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23620 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23621 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23625 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23629 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23633 : see if this is a termio system
23637 if $test `./findhdr termios.h`; then
23638 set tcsetattr i_termios
23644 "$define") echo "You have POSIX termios.h... good!" >&4;;
23645 *) if ./Cppsym pyr; then
23646 case "`$run /bin/universe`" in
23647 ucb) if $test `./findhdr sgtty.h`; then
23649 echo "<sgtty.h> found." >&4
23651 echo "System is pyramid with BSD universe."
23652 ./warn "<sgtty.h> not found--you could have problems."
23654 *) if $test `./findhdr termio.h`; then
23656 echo "<termio.h> found." >&4
23658 echo "System is pyramid with USG universe."
23659 ./warn "<termio.h> not found--you could have problems."
23663 if $test `./findhdr termio.h`; then
23664 echo "<termio.h> found." >&4
23666 elif $test `./findhdr sgtty.h`; then
23667 echo "<sgtty.h> found." >&4
23670 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23673 if $test `./findhdr sgtty.h`; then
23674 echo "<sgtty.h> found." >&4
23676 elif $test `./findhdr termio.h`; then
23677 echo "<termio.h> found." >&4
23680 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23684 set i_termio; eval $setvar
23685 val=$val2; set i_sgtty; eval $setvar
23686 val=$val3; set i_termios; eval $setvar
23688 : see if stdbool is available
23689 : we want a real compile instead of Inhdr because some Solaris systems
23690 : have stdbool.h, but it can only be used if the compiler indicates it
23691 : is sufficiently c99-compliant.
23695 #include <stdbool.h>
23700 int main(int argc, char **argv)
23706 if eval $compile; then
23707 echo "<stdbool.h> found." >&4
23710 echo "<stdbool.h> NOT found." >&4
23717 : see if stddef is available
23718 set stddef.h i_stddef
23721 : see if stdint is available
23722 set stdint.h i_stdint
23725 : see if sys/access.h is available
23726 set sys/access.h i_sysaccess
23729 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23730 set sys/filio.h i_sysfilio
23733 if $test `./findhdr sys/ioctl.h`; then
23735 echo '<sys/ioctl.h> found.' >&4
23738 if $test $i_sysfilio = "$define"; then
23739 echo '<sys/ioctl.h> NOT found.' >&4
23741 $test $i_sgtty = "$define" && xxx="sgtty.h"
23742 $test $i_termio = "$define" && xxx="termio.h"
23743 $test $i_termios = "$define" && xxx="termios.h"
23744 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23750 : see if socket ioctl defs are in sys/sockio.h
23752 xxx=`./findhdr sys/sockio.h`
23753 if $test "$xxx"; then
23754 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23756 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23759 echo "No socket ioctls found in <sys/sockio.h>." >&4
23764 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23770 : see if this is a syslog.h system
23771 set syslog.h i_syslog
23774 : see if this is a sys/mode.h system
23775 set sys/mode.h i_sysmode
23778 : see if there is a sys/poll.h file
23779 set sys/poll.h i_syspoll
23782 : see if sys/resource.h has to be included
23783 set sys/resource.h i_sysresrc
23786 : see if sys/security.h is available
23787 set sys/security.h i_syssecrt
23790 : see if this is a sys/statvfs.h system
23791 set sys/statvfs.h i_sysstatvfs
23794 : see if this is a sys/un.h system
23795 set sys/un.h i_sysun
23798 : see if this is a sys/utsname.h system
23799 set sys/utsname.h i_sysutsname
23802 : see if this is a syswait system
23803 set sys/wait.h i_syswait
23806 : see if this is a ustat.h system
23807 set ustat.h i_ustat
23810 : see if this is an utime system
23811 set utime.h i_utime
23814 : see if this is a vfork system
23817 set vfork.h i_vfork
23827 echo "Looking for extensions..." >&4
23828 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23829 : contain old or inaccurate or duplicate values.
23830 nonxs_extensions=''
23832 : We do not use find because it might not be available.
23833 : We do not just use MANIFEST because the user may have dropped
23834 : some additional extensions into the source tree and expect them
23837 : Function to recursively find available extensions, ignoring DynaLoader
23838 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23839 : In 5.10.1 and later, extensions are stored in directories
23840 : like File-Glob instead of the older File/Glob/.
23844 DynaLoader|dynaload) ;;
23846 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23847 case "$this_ext" in
23848 Scalar/List/Utils) this_ext="List/Util" ;;
23849 PathTools) this_ext="Cwd" ;;
23851 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23852 if $contains " $this_ext " "$tdir/$$.tmp"; then
23854 echo "Duplicate directories detected for extension $xxx" >&4;
23855 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23856 case "$knowitall" in
23864 echo "Ok. Stopping Configure." >&4;
23865 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23868 echo "Ok. You will need to correct config.sh before running make." >&4;
23870 $ls -1 "$xxx" > "$tdir/$$.tmp";
23871 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23872 xs_extensions="$xs_extensions $this_ext";
23873 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23874 xs_extensions="$xs_extensions $this_ext";
23875 elif $test -d "$xxx"; then
23876 nonxs_extensions="$nonxs_extensions $this_ext";
23878 $rm -f "$tdir/$$.tmp";
23886 eval $find_extensions
23890 eval $find_extensions
23894 eval $find_extensions
23895 set X $xs_extensions
23897 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23898 set X $nonxs_extensions
23900 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23902 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23904 : Now see which are supported on this system.
23906 for xxx in $xs_extensions ; do
23910 amigaos) avail_ext="$avail_ext $xxx" ;;
23915 $define) avail_ext="$avail_ext $xxx" ;;
23918 GDBM_File|gdbm_fil)
23920 $define) avail_ext="$avail_ext $xxx" ;;
23923 I18N/Langinfo|i18n_lan)
23924 case "$i_langinfo$d_nl_langinfo" in
23925 $define$define) avail_ext="$avail_ext $xxx" ;;
23929 : XXX Do we need a useipcsysv variable here
23930 case "${d_msg}${d_sem}${d_shm}" in
23931 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23934 NDBM_File|ndbm_fil)
23937 case "$osname-$use64bitint" in
23940 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23943 *) avail_ext="$avail_ext $xxx" ;;
23948 ODBM_File|odbm_fil)
23949 case "${i_dbm}${i_rpcsvcdbm}" in
23951 case "$d_cplusplus" in
23952 define) ;; # delete as a function name will not work
23953 *) case "$osname-$use64bitint" in
23956 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23959 *) avail_ext="$avail_ext $xxx" ;;
23967 case "$useopcode" in
23968 true|define|y) avail_ext="$avail_ext $xxx" ;;
23972 case "$useposix" in
23973 true|define|y) avail_ext="$avail_ext $xxx" ;;
23977 case "$d_socket" in
23978 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23981 Sys/Syslog|sys/syslog)
23983 amigaos) ;; # not really very useful on AmigaOS
23985 : XXX syslog requires socket
23986 case "$d_socket" in
23987 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23993 case "$usethreads" in
23995 case "$use5005threads" in
23996 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
24000 threads|threads/shared)
24001 # threads and threads::shared are special cases.
24002 # To stop people from asking "Perl 5.8.0 was supposed
24003 # to have this new fancy threads implementation but my
24004 # perl doesn't have it" and from people trying to
24005 # (re)install the threads module using CPAN.pm and
24006 # CPAN.pm then offering to reinstall Perl 5.8.0,
24007 # the threads.pm and threads/shared.pm will always be
24008 # there, croaking informatively ("you need to rebuild
24009 # all of Perl with threads, sorry") when threads haven't
24010 # been compiled in.
24012 avail_ext="$avail_ext $xxx"
24018 cygwin) avail_ext="$avail_ext $xxx" ;;
24021 XS/APItest|xs/apitest)
24022 # This is just for testing. Skip it unless we have dynamic loading.
24025 $define) avail_ext="$avail_ext $xxx" ;;
24028 XS/Typemap|xs/typemap)
24029 # This is just for testing. Skip it unless we have dynamic loading.
24031 $define) avail_ext="$avail_ext $xxx" ;;
24034 *) avail_ext="$avail_ext $xxx"
24043 case "$onlyextensions" in
24045 *) keepextensions=''
24046 echo "You have requested that only certain extensions be included..." >&4
24047 for i in $onlyextensions; do
24048 case " $avail_ext " in
24050 echo "Keeping extension $i."
24051 keepextensions="$keepextensions $i"
24053 *) echo "Ignoring extension $i." ;;
24056 avail_ext="$keepextensions"
24060 case "$noextensions" in
24062 *) keepextensions=''
24063 echo "You have requested that certain extensions be ignored..." >&4
24064 for i in $avail_ext; do
24065 case " $noextensions " in
24066 *" $i "*) echo "Ignoring extension $i." ;;
24067 *) echo "Keeping extension $i.";
24068 keepextensions="$keepextensions $i"
24072 avail_ext="$keepextensions"
24076 : Now see which nonxs extensions are supported on this system.
24077 : For now assume all are.
24079 for xxx in $nonxs_extensions ; do
24083 *) nonxs_ext="$nonxs_ext $xxx"
24095 A number of extensions are supplied with $package. You may choose to
24096 compile these extensions for dynamic loading (the default), compile
24097 them into the $package executable (static loading), or not include
24098 them at all. Answer "none" to include no extensions.
24099 Note that DynaLoader is always built and need not be mentioned here.
24102 case "$dynamic_ext" in
24104 : Exclude those listed in static_ext
24106 for xxx in $avail_ext; do
24107 case " $static_ext " in
24109 *) dflt="$dflt $xxx" ;;
24116 *) dflt="$dynamic_ext"
24117 # Perhaps we are reusing an old out-of-date config.sh.
24120 if test X"$dynamic_ext" != X"$avail_ext"; then
24122 NOTICE: Your previous config.sh list may be incorrect.
24123 The extensions now available to you are
24125 but the default list from your previous config.sh is
24137 rp="What extensions do you wish to load dynamically?"
24140 none) dynamic_ext=' ' ;;
24141 *) dynamic_ext="$ans" ;;
24144 case "$static_ext" in
24146 : Exclude those already listed in dynamic linking
24148 for xxx in $avail_ext; do
24149 case " $dynamic_ext " in
24151 *) dflt="$dflt $xxx" ;;
24158 *) dflt="$static_ext"
24165 rp="What extensions do you wish to load statically?"
24168 none) static_ext=' ' ;;
24169 *) static_ext="$ans" ;;
24174 A number of extensions are supplied with $package. Answer "none"
24175 to include no extensions.
24176 Note that DynaLoader is always built and need not be mentioned here.
24179 case "$static_ext" in
24180 '') dflt="$avail_ext" ;;
24181 *) dflt="$static_ext"
24182 # Perhaps we are reusing an old out-of-date config.sh.
24185 if test X"$static_ext" != X"$avail_ext"; then
24187 NOTICE: Your previous config.sh list may be incorrect.
24188 The extensions now available to you are
24190 but the default list from your previous config.sh is
24199 : Exclude those that are not xs extensions
24203 rp="What extensions do you wish to include?"
24206 none) static_ext=' ' ;;
24207 *) static_ext="$ans" ;;
24212 # Encode is a special case. If we are building Encode as a static
24213 # extension, we need to explicitly list its subextensions as well.
24214 # For other nested extensions, this is handled automatically by
24215 # the appropriate Makefile.PL.
24216 case " $static_ext " in
24217 *" Encode "*) # Add the subextensions of Encode
24219 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24220 static_ext="$static_ext Encode/$xxx"
24221 known_extensions="$known_extensions Encode/$xxx"
24227 set X $dynamic_ext $static_ext $nonxs_ext
24231 # Sanity check: We require an extension suitable for use with
24232 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24233 # should show up as failures in the test suite, but it's helpful to
24234 # catch them now.) The 'extensions' list is normally sorted
24235 # alphabetically, so we need to accept either
24236 # DB_File ... Fcntl ... IO ....
24237 # or something like
24238 # Fcntl ... NDBM_File ... IO ....
24239 case " $extensions" in
24240 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24241 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24242 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24243 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24244 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24248 : Remove libraries needed only for extensions
24249 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24250 : The exception is SunOS 4.x, which needs them.
24251 case "${osname}X${osvers}" in
24255 *) case "$usedl" in
24256 $define|true|[yY]*)
24257 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24261 *) perllibs="$libs"
24267 : Remove build directory name from cppstdin so it can be used from
24268 : either the present location or the final installed location.
24270 : Get out of the UU directory to get correct path name.
24272 case "$cppstdin" in
24274 echo "Stripping down cppstdin path name"
24280 : end of configuration questions
24282 echo "End of configuration questions."
24285 : back to where it started
24286 if test -d ../UU; then
24290 : configuration may be unconditionally patched via a 'config.arch' file
24291 if $test -f config.arch; then
24292 echo "I see a config.arch file, loading it." >&4
24296 : configuration may be patched via a 'config.over' file
24297 if $test -f config.over; then
24300 rp='I see a config.over file. Do you wish to load it?'
24303 n*) echo "OK, I'll ignore it.";;
24305 echo "Configuration override changes have been loaded."
24310 : in case they want portability, strip down executable paths
24311 case "$d_portable" in
24314 echo "Stripping down executable paths..." >&4
24315 for file in $loclist $trylist; do
24317 eval $file=`basename $temp`
24322 : create config.sh file
24324 echo "Creating config.sh..." >&4
24325 $spitshell <<EOT >config.sh
24328 # This file was produced by running the Configure script. It holds all the
24329 # definitions figured out by Configure. Should you modify one of these values,
24330 # do not forget to propagate your changes by running "Configure -der". You may
24331 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24334 # Package name : $package
24335 # Source directory : $src
24336 # Configuration time: $cf_time
24337 # Configured by : $cf_by
24338 # Target system : $myuname
24341 : Add in command line options if available
24342 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24344 $spitshell <<EOT >>config.sh
24353 Revision='$Revision'
24361 alignbytes='$alignbytes'
24362 ansi2knr='$ansi2knr'
24363 aphostname='$aphostname'
24364 api_revision='$api_revision'
24365 api_subversion='$api_subversion'
24366 api_version='$api_version'
24367 api_versionstring='$api_versionstring'
24370 archlibexp='$archlibexp'
24371 archname64='$archname64'
24372 archname='$archname'
24373 archobjs='$archobjs'
24374 asctime_r_proto='$asctime_r_proto'
24383 byteorder='$byteorder'
24385 castflags='$castflags'
24388 cccdlflags='$cccdlflags'
24389 ccdlflags='$ccdlflags'
24391 ccflags_uselargefiles='$ccflags_uselargefiles'
24393 ccsymbols='$ccsymbols'
24394 ccversion='$ccversion'
24396 cf_email='$cf_email'
24398 charbits='$charbits'
24399 charsize='$charsize'
24403 clocktype='$clocktype'
24405 compress='$compress'
24406 contains='$contains'
24410 cpp_stuff='$cpp_stuff'
24411 cppccsymbols='$cppccsymbols'
24412 cppflags='$cppflags'
24414 cppminus='$cppminus'
24416 cppstdin='$cppstdin'
24417 cppsymbols='$cppsymbols'
24418 crypt_r_proto='$crypt_r_proto'
24419 cryptlib='$cryptlib'
24421 ctermid_r_proto='$ctermid_r_proto'
24422 ctime_r_proto='$ctime_r_proto'
24423 d_Gconvert='$d_Gconvert'
24424 d_PRIEUldbl='$d_PRIEUldbl'
24425 d_PRIFUldbl='$d_PRIFUldbl'
24426 d_PRIGUldbl='$d_PRIGUldbl'
24427 d_PRIXU64='$d_PRIXU64'
24428 d_PRId64='$d_PRId64'
24429 d_PRIeldbl='$d_PRIeldbl'
24430 d_PRIfldbl='$d_PRIfldbl'
24431 d_PRIgldbl='$d_PRIgldbl'
24432 d_PRIi64='$d_PRIi64'
24433 d_PRIo64='$d_PRIo64'
24434 d_PRIu64='$d_PRIu64'
24435 d_PRIx64='$d_PRIx64'
24436 d_SCNfldbl='$d_SCNfldbl'
24437 d__fwalk='$d__fwalk'
24438 d_access='$d_access'
24439 d_accessx='$d_accessx'
24443 d_archlib='$d_archlib'
24444 d_asctime64='$d_asctime64'
24445 d_asctime_r='$d_asctime_r'
24450 d_attribute_deprecated='$d_attribute_deprecated'
24451 d_attribute_format='$d_attribute_format'
24452 d_attribute_malloc='$d_attribute_malloc'
24453 d_attribute_nonnull='$d_attribute_nonnull'
24454 d_attribute_noreturn='$d_attribute_noreturn'
24455 d_attribute_pure='$d_attribute_pure'
24456 d_attribute_unused='$d_attribute_unused'
24457 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24458 d_backtrace='$d_backtrace'
24462 d_bsdgetpgrp='$d_bsdgetpgrp'
24463 d_bsdsetpgrp='$d_bsdsetpgrp'
24464 d_builtin_choose_expr='$d_builtin_choose_expr'
24465 d_builtin_expect='$d_builtin_expect'
24467 d_c99_variadic_macros='$d_c99_variadic_macros'
24468 d_casti32='$d_casti32'
24469 d_castneg='$d_castneg'
24471 d_charvspr='$d_charvspr'
24473 d_chroot='$d_chroot'
24474 d_chsize='$d_chsize'
24476 d_clearenv='$d_clearenv'
24477 d_closedir='$d_closedir'
24478 d_cmsghdr_s='$d_cmsghdr_s'
24480 d_copysign='$d_copysign'
24481 d_copysignl='$d_copysignl'
24482 d_cplusplus='$d_cplusplus'
24484 d_crypt_r='$d_crypt_r'
24486 d_ctermid='$d_ctermid'
24487 d_ctermid_r='$d_ctermid_r'
24488 d_ctime64='$d_ctime64'
24489 d_ctime_r='$d_ctime_r'
24490 d_cuserid='$d_cuserid'
24491 d_dbl_dig='$d_dbl_dig'
24492 d_dbminitproto='$d_dbminitproto'
24493 d_difftime64='$d_difftime64'
24494 d_difftime='$d_difftime'
24495 d_dir_dd_fd='$d_dir_dd_fd'
24497 d_dirnamlen='$d_dirnamlen'
24498 d_dladdr='$d_dladdr'
24499 d_dlerror='$d_dlerror'
24500 d_dlopen='$d_dlopen'
24501 d_dlsymun='$d_dlsymun'
24502 d_dosuid='$d_dosuid'
24503 d_double_has_inf='$d_double_has_inf'
24504 d_double_has_nan='$d_double_has_nan'
24505 d_double_has_negative_zero='$d_double_has_negative_zero'
24506 d_double_has_subnormals='$d_double_has_subnormals'
24507 d_double_style_cray='$d_double_style_cray'
24508 d_double_style_ibm='$d_double_style_ibm'
24509 d_double_style_ieee='$d_double_style_ieee'
24510 d_double_style_vax='$d_double_style_vax'
24511 d_drand48_r='$d_drand48_r'
24512 d_drand48proto='$d_drand48proto'
24514 d_duplocale='$d_duplocale'
24515 d_eaccess='$d_eaccess'
24516 d_endgrent='$d_endgrent'
24517 d_endgrent_r='$d_endgrent_r'
24518 d_endhent='$d_endhent'
24519 d_endhostent_r='$d_endhostent_r'
24520 d_endnent='$d_endnent'
24521 d_endnetent_r='$d_endnetent_r'
24522 d_endpent='$d_endpent'
24523 d_endprotoent_r='$d_endprotoent_r'
24524 d_endpwent='$d_endpwent'
24525 d_endpwent_r='$d_endpwent_r'
24526 d_endsent='$d_endsent'
24527 d_endservent_r='$d_endservent_r'
24528 d_eofnblk='$d_eofnblk'
24531 d_eunice='$d_eunice'
24534 d_faststdio='$d_faststdio'
24535 d_fchdir='$d_fchdir'
24536 d_fchmod='$d_fchmod'
24537 d_fchown='$d_fchown'
24539 d_fcntl_can_lock='$d_fcntl_can_lock'
24540 d_fd_macros='$d_fd_macros'
24541 d_fd_set='$d_fd_set'
24542 d_fdclose='$d_fdclose'
24544 d_fds_bits='$d_fds_bits'
24545 d_fegetround='$d_fegetround'
24546 d_fgetpos='$d_fgetpos'
24547 d_finite='$d_finite'
24548 d_finitel='$d_finitel'
24549 d_flexfnam='$d_flexfnam'
24551 d_flockproto='$d_flockproto'
24556 d_fp_class='$d_fp_class'
24557 d_fp_classify='$d_fp_classify'
24558 d_fp_classl='$d_fp_classl'
24559 d_fpathconf='$d_fpathconf'
24560 d_fpclass='$d_fpclass'
24561 d_fpclassify='$d_fpclassify'
24562 d_fpclassl='$d_fpclassl'
24563 d_fpgetround='$d_fpgetround'
24564 d_fpos64_t='$d_fpos64_t'
24565 d_freelocale='$d_freelocale'
24566 d_frexpl='$d_frexpl'
24567 d_fs_data_s='$d_fs_data_s'
24568 d_fseeko='$d_fseeko'
24569 d_fsetpos='$d_fsetpos'
24570 d_fstatfs='$d_fstatfs'
24571 d_fstatvfs='$d_fstatvfs'
24573 d_ftello='$d_ftello'
24575 d_futimes='$d_futimes'
24576 d_gai_strerror='$d_gai_strerror'
24577 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24578 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24579 d_getaddrinfo='$d_getaddrinfo'
24580 d_getcwd='$d_getcwd'
24581 d_getespwnam='$d_getespwnam'
24582 d_getfsstat='$d_getfsstat'
24583 d_getgrent='$d_getgrent'
24584 d_getgrent_r='$d_getgrent_r'
24585 d_getgrgid_r='$d_getgrgid_r'
24586 d_getgrnam_r='$d_getgrnam_r'
24587 d_getgrps='$d_getgrps'
24588 d_gethbyaddr='$d_gethbyaddr'
24589 d_gethbyname='$d_gethbyname'
24590 d_gethent='$d_gethent'
24591 d_gethname='$d_gethname'
24592 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24593 d_gethostbyname_r='$d_gethostbyname_r'
24594 d_gethostent_r='$d_gethostent_r'
24595 d_gethostprotos='$d_gethostprotos'
24596 d_getitimer='$d_getitimer'
24597 d_getlogin='$d_getlogin'
24598 d_getlogin_r='$d_getlogin_r'
24599 d_getmnt='$d_getmnt'
24600 d_getmntent='$d_getmntent'
24601 d_getnameinfo='$d_getnameinfo'
24602 d_getnbyaddr='$d_getnbyaddr'
24603 d_getnbyname='$d_getnbyname'
24604 d_getnent='$d_getnent'
24605 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24606 d_getnetbyname_r='$d_getnetbyname_r'
24607 d_getnetent_r='$d_getnetent_r'
24608 d_getnetprotos='$d_getnetprotos'
24609 d_getpagsz='$d_getpagsz'
24610 d_getpbyname='$d_getpbyname'
24611 d_getpbynumber='$d_getpbynumber'
24612 d_getpent='$d_getpent'
24613 d_getpgid='$d_getpgid'
24614 d_getpgrp2='$d_getpgrp2'
24615 d_getpgrp='$d_getpgrp'
24616 d_getppid='$d_getppid'
24617 d_getprior='$d_getprior'
24618 d_getprotobyname_r='$d_getprotobyname_r'
24619 d_getprotobynumber_r='$d_getprotobynumber_r'
24620 d_getprotoent_r='$d_getprotoent_r'
24621 d_getprotoprotos='$d_getprotoprotos'
24622 d_getprpwnam='$d_getprpwnam'
24623 d_getpwent='$d_getpwent'
24624 d_getpwent_r='$d_getpwent_r'
24625 d_getpwnam_r='$d_getpwnam_r'
24626 d_getpwuid_r='$d_getpwuid_r'
24627 d_getsbyname='$d_getsbyname'
24628 d_getsbyport='$d_getsbyport'
24629 d_getsent='$d_getsent'
24630 d_getservbyname_r='$d_getservbyname_r'
24631 d_getservbyport_r='$d_getservbyport_r'
24632 d_getservent_r='$d_getservent_r'
24633 d_getservprotos='$d_getservprotos'
24634 d_getspnam='$d_getspnam'
24635 d_getspnam_r='$d_getspnam_r'
24636 d_gettimeod='$d_gettimeod'
24637 d_gmtime64='$d_gmtime64'
24638 d_gmtime_r='$d_gmtime_r'
24639 d_gnulibc='$d_gnulibc'
24640 d_grpasswd='$d_grpasswd'
24641 d_hasmntopt='$d_hasmntopt'
24645 d_ilogbl='$d_ilogbl'
24646 d_inc_version_list='$d_inc_version_list'
24648 d_inetaton='$d_inetaton'
24649 d_inetntop='$d_inetntop'
24650 d_inetpton='$d_inetpton'
24651 d_int64_t='$d_int64_t'
24652 d_ip_mreq='$d_ip_mreq'
24653 d_ip_mreq_source='$d_ip_mreq_source'
24654 d_ipv6_mreq='$d_ipv6_mreq'
24655 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24656 d_isascii='$d_isascii'
24657 d_isblank='$d_isblank'
24658 d_isfinite='$d_isfinite'
24659 d_isfinitel='$d_isfinitel'
24661 d_isinfl='$d_isinfl'
24662 d_isless='$d_isless'
24664 d_isnanl='$d_isnanl'
24665 d_isnormal='$d_isnormal'
24668 d_killpg='$d_killpg'
24669 d_lc_monetary_2008='$d_lc_monetary_2008'
24670 d_lchown='$d_lchown'
24671 d_ldbl_dig='$d_ldbl_dig'
24672 d_ldexpl='$d_ldexpl'
24673 d_lgamma='$d_lgamma'
24674 d_lgamma_r='$d_lgamma_r'
24675 d_libm_lib_version='$d_libm_lib_version'
24676 d_libname_unique='$d_libname_unique'
24678 d_llrint='$d_llrint'
24679 d_llrintl='$d_llrintl'
24680 d_llround='$d_llround'
24681 d_llroundl='$d_llroundl'
24682 d_localtime64='$d_localtime64'
24683 d_localtime_r='$d_localtime_r'
24684 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24685 d_locconv='$d_locconv'
24690 d_long_double_style_ieee='$d_long_double_style_ieee'
24691 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24692 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24693 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24694 d_long_double_style_vax='$d_long_double_style_vax'
24695 d_longdbl='$d_longdbl'
24696 d_longlong='$d_longlong'
24698 d_lrintl='$d_lrintl'
24699 d_lround='$d_lround'
24700 d_lroundl='$d_lroundl'
24701 d_lseekproto='$d_lseekproto'
24703 d_madvise='$d_madvise'
24704 d_malloc_good_size='$d_malloc_good_size'
24705 d_malloc_size='$d_malloc_size'
24707 d_mbstowcs='$d_mbstowcs'
24708 d_mbtowc='$d_mbtowc'
24709 d_memchr='$d_memchr'
24710 d_memcmp='$d_memcmp'
24711 d_memcpy='$d_memcpy'
24712 d_memmem='$d_memmem'
24713 d_memmove='$d_memmove'
24714 d_memset='$d_memset'
24716 d_mkdtemp='$d_mkdtemp'
24717 d_mkfifo='$d_mkfifo'
24718 d_mkstemp='$d_mkstemp'
24719 d_mkstemps='$d_mkstemps'
24720 d_mktime64='$d_mktime64'
24721 d_mktime='$d_mktime'
24724 d_modflproto='$d_modflproto'
24725 d_mprotect='$d_mprotect'
24727 d_msg_ctrunc='$d_msg_ctrunc'
24728 d_msg_dontroute='$d_msg_dontroute'
24729 d_msg_oob='$d_msg_oob'
24730 d_msg_peek='$d_msg_peek'
24731 d_msg_proxy='$d_msg_proxy'
24732 d_msgctl='$d_msgctl'
24733 d_msgget='$d_msgget'
24734 d_msghdr_s='$d_msghdr_s'
24735 d_msgrcv='$d_msgrcv'
24736 d_msgsnd='$d_msgsnd'
24738 d_munmap='$d_munmap'
24739 d_mymalloc='$d_mymalloc'
24742 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24743 d_nearbyint='$d_nearbyint'
24744 d_newlocale='$d_newlocale'
24745 d_nextafter='$d_nextafter'
24746 d_nexttoward='$d_nexttoward'
24748 d_nl_langinfo='$d_nl_langinfo'
24749 d_nv_preserves_uv='$d_nv_preserves_uv'
24750 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24751 d_off64_t='$d_off64_t'
24752 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24753 d_oldpthreads='$d_oldpthreads'
24754 d_oldsock='$d_oldsock'
24756 d_pathconf='$d_pathconf'
24758 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24759 d_phostname='$d_phostname'
24762 d_portable='$d_portable'
24764 d_prctl_set_name='$d_prctl_set_name'
24765 d_printf_format_null='$d_printf_format_null'
24766 d_procselfexe='$d_procselfexe'
24767 d_pseudofork='$d_pseudofork'
24768 d_pthread_atfork='$d_pthread_atfork'
24769 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24770 d_pthread_yield='$d_pthread_yield'
24771 d_ptrdiff_t='$d_ptrdiff_t'
24773 d_pwchange='$d_pwchange'
24774 d_pwclass='$d_pwclass'
24775 d_pwcomment='$d_pwcomment'
24776 d_pwexpire='$d_pwexpire'
24777 d_pwgecos='$d_pwgecos'
24778 d_pwpasswd='$d_pwpasswd'
24779 d_pwquota='$d_pwquota'
24782 d_querylocale='$d_querylocale'
24783 d_random_r='$d_random_r'
24784 d_re_comp='$d_re_comp'
24785 d_readdir64_r='$d_readdir64_r'
24786 d_readdir='$d_readdir'
24787 d_readdir_r='$d_readdir_r'
24788 d_readlink='$d_readlink'
24790 d_recvmsg='$d_recvmsg'
24791 d_regcmp='$d_regcmp'
24792 d_regcomp='$d_regcomp'
24793 d_remainder='$d_remainder'
24794 d_remquo='$d_remquo'
24795 d_rename='$d_rename'
24796 d_rewinddir='$d_rewinddir'
24800 d_safebcpy='$d_safebcpy'
24801 d_safemcpy='$d_safemcpy'
24802 d_sanemcmp='$d_sanemcmp'
24803 d_sbrkproto='$d_sbrkproto'
24804 d_scalbn='$d_scalbn'
24805 d_scalbnl='$d_scalbnl'
24806 d_sched_yield='$d_sched_yield'
24807 d_scm_rights='$d_scm_rights'
24808 d_seekdir='$d_seekdir'
24809 d_select='$d_select'
24811 d_semctl='$d_semctl'
24812 d_semctl_semid_ds='$d_semctl_semid_ds'
24813 d_semctl_semun='$d_semctl_semun'
24814 d_semget='$d_semget'
24816 d_sendmsg='$d_sendmsg'
24817 d_setegid='$d_setegid'
24818 d_seteuid='$d_seteuid'
24819 d_setgrent='$d_setgrent'
24820 d_setgrent_r='$d_setgrent_r'
24821 d_setgrps='$d_setgrps'
24822 d_sethent='$d_sethent'
24823 d_sethostent_r='$d_sethostent_r'
24824 d_setitimer='$d_setitimer'
24825 d_setlinebuf='$d_setlinebuf'
24826 d_setlocale='$d_setlocale'
24827 d_setlocale_r='$d_setlocale_r'
24828 d_setnent='$d_setnent'
24829 d_setnetent_r='$d_setnetent_r'
24830 d_setpent='$d_setpent'
24831 d_setpgid='$d_setpgid'
24832 d_setpgrp2='$d_setpgrp2'
24833 d_setpgrp='$d_setpgrp'
24834 d_setprior='$d_setprior'
24835 d_setproctitle='$d_setproctitle'
24836 d_setprotoent_r='$d_setprotoent_r'
24837 d_setpwent='$d_setpwent'
24838 d_setpwent_r='$d_setpwent_r'
24839 d_setregid='$d_setregid'
24840 d_setresgid='$d_setresgid'
24841 d_setresuid='$d_setresuid'
24842 d_setreuid='$d_setreuid'
24843 d_setrgid='$d_setrgid'
24844 d_setruid='$d_setruid'
24845 d_setsent='$d_setsent'
24846 d_setservent_r='$d_setservent_r'
24847 d_setsid='$d_setsid'
24848 d_setvbuf='$d_setvbuf'
24851 d_shmatprototype='$d_shmatprototype'
24852 d_shmctl='$d_shmctl'
24854 d_shmget='$d_shmget'
24855 d_sigaction='$d_sigaction'
24856 d_siginfo_si_addr='$d_siginfo_si_addr'
24857 d_siginfo_si_band='$d_siginfo_si_band'
24858 d_siginfo_si_errno='$d_siginfo_si_errno'
24859 d_siginfo_si_fd='$d_siginfo_si_fd'
24860 d_siginfo_si_pid='$d_siginfo_si_pid'
24861 d_siginfo_si_status='$d_siginfo_si_status'
24862 d_siginfo_si_uid='$d_siginfo_si_uid'
24863 d_siginfo_si_value='$d_siginfo_si_value'
24864 d_signbit='$d_signbit'
24865 d_sigprocmask='$d_sigprocmask'
24866 d_sigsetjmp='$d_sigsetjmp'
24867 d_sin6_scope_id='$d_sin6_scope_id'
24868 d_sitearch='$d_sitearch'
24869 d_snprintf='$d_snprintf'
24870 d_sockaddr_in6='$d_sockaddr_in6'
24871 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24872 d_sockatmark='$d_sockatmark'
24873 d_sockatmarkproto='$d_sockatmarkproto'
24874 d_socket='$d_socket'
24875 d_socklen_t='$d_socklen_t'
24876 d_sockpair='$d_sockpair'
24877 d_socks5_init='$d_socks5_init'
24878 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24880 d_srand48_r='$d_srand48_r'
24881 d_srandom_r='$d_srandom_r'
24882 d_sresgproto='$d_sresgproto'
24883 d_sresuproto='$d_sresuproto'
24885 d_statblks='$d_statblks'
24886 d_statfs_f_flags='$d_statfs_f_flags'
24887 d_statfs_s='$d_statfs_s'
24888 d_static_inline='$d_static_inline'
24889 d_statvfs='$d_statvfs'
24890 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24891 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24892 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24893 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24894 d_stdio_stream_array='$d_stdio_stream_array'
24895 d_stdiobase='$d_stdiobase'
24896 d_stdstdio='$d_stdstdio'
24897 d_strchr='$d_strchr'
24898 d_strcoll='$d_strcoll'
24899 d_strctcpy='$d_strctcpy'
24900 d_strerrm='$d_strerrm'
24901 d_strerror='$d_strerror'
24902 d_strerror_l='$d_strerror_l'
24903 d_strerror_r='$d_strerror_r'
24904 d_strftime='$d_strftime'
24905 d_strlcat='$d_strlcat'
24906 d_strlcpy='$d_strlcpy'
24907 d_strtod='$d_strtod'
24908 d_strtol='$d_strtol'
24909 d_strtold='$d_strtold'
24910 d_strtoll='$d_strtoll'
24911 d_strtoq='$d_strtoq'
24912 d_strtoul='$d_strtoul'
24913 d_strtoull='$d_strtoull'
24914 d_strtouq='$d_strtouq'
24915 d_strxfrm='$d_strxfrm'
24916 d_suidsafe='$d_suidsafe'
24917 d_symlink='$d_symlink'
24918 d_syscall='$d_syscall'
24919 d_syscallproto='$d_syscallproto'
24920 d_sysconf='$d_sysconf'
24921 d_sysernlst='$d_sysernlst'
24922 d_syserrlst='$d_syserrlst'
24923 d_system='$d_system'
24924 d_tcgetpgrp='$d_tcgetpgrp'
24925 d_tcsetpgrp='$d_tcsetpgrp'
24926 d_telldir='$d_telldir'
24927 d_telldirproto='$d_telldirproto'
24928 d_tgamma='$d_tgamma'
24930 d_timegm='$d_timegm'
24932 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24933 d_tm_tm_zone='$d_tm_tm_zone'
24934 d_tmpnam_r='$d_tmpnam_r'
24936 d_truncate='$d_truncate'
24937 d_truncl='$d_truncl'
24938 d_ttyname_r='$d_ttyname_r'
24939 d_tzname='$d_tzname'
24940 d_u32align='$d_u32align'
24941 d_ualarm='$d_ualarm'
24944 d_union_semun='$d_union_semun'
24945 d_unordered='$d_unordered'
24946 d_unsetenv='$d_unsetenv'
24947 d_uselocale='$d_uselocale'
24948 d_usleep='$d_usleep'
24949 d_usleepproto='$d_usleepproto'
24951 d_vendorarch='$d_vendorarch'
24952 d_vendorbin='$d_vendorbin'
24953 d_vendorlib='$d_vendorlib'
24954 d_vendorscript='$d_vendorscript'
24956 d_void_closedir='$d_void_closedir'
24957 d_voidsig='$d_voidsig'
24958 d_voidtty='$d_voidtty'
24959 d_volatile='$d_volatile'
24960 d_vprintf='$d_vprintf'
24961 d_vsnprintf='$d_vsnprintf'
24963 d_waitpid='$d_waitpid'
24964 d_wcscmp='$d_wcscmp'
24965 d_wcstombs='$d_wcstombs'
24966 d_wcsxfrm='$d_wcsxfrm'
24967 d_wctomb='$d_wctomb'
24968 d_writev='$d_writev'
24971 db_hashtype='$db_hashtype'
24972 db_prefixtype='$db_prefixtype'
24973 db_version_major='$db_version_major'
24974 db_version_minor='$db_version_minor'
24975 db_version_patch='$db_version_patch'
24976 default_inc_excludes_dot='$default_inc_excludes_dot'
24977 direntrytype='$direntrytype'
24980 doubleinfbytes='$doubleinfbytes'
24981 doublekind='$doublekind'
24982 doublemantbits='$doublemantbits'
24983 doublenanbytes='$doublenanbytes'
24984 doublesize='$doublesize'
24986 drand48_r_proto='$drand48_r_proto'
24988 dtraceobject='$dtraceobject'
24989 dtracexnolibs='$dtracexnolibs'
24990 dynamic_ext='$dynamic_ext'
24996 endgrent_r_proto='$endgrent_r_proto'
24997 endhostent_r_proto='$endhostent_r_proto'
24998 endnetent_r_proto='$endnetent_r_proto'
24999 endprotoent_r_proto='$endprotoent_r_proto'
25000 endpwent_r_proto='$endpwent_r_proto'
25001 endservent_r_proto='$endservent_r_proto'
25002 eunicefix='$eunicefix'
25005 extensions='$extensions'
25006 extern_C='$extern_C'
25008 fflushNULL='$fflushNULL'
25009 fflushall='$fflushall'
25011 firstmakefile='$firstmakefile'
25013 fpossize='$fpossize'
25014 fpostype='$fpostype'
25015 freetype='$freetype'
25018 full_csh='$full_csh'
25019 full_sed='$full_sed'
25020 gccansipedantic='$gccansipedantic'
25021 gccosandvers='$gccosandvers'
25022 gccversion='$gccversion'
25023 getgrent_r_proto='$getgrent_r_proto'
25024 getgrgid_r_proto='$getgrgid_r_proto'
25025 getgrnam_r_proto='$getgrnam_r_proto'
25026 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25027 gethostbyname_r_proto='$gethostbyname_r_proto'
25028 gethostent_r_proto='$gethostent_r_proto'
25029 getlogin_r_proto='$getlogin_r_proto'
25030 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25031 getnetbyname_r_proto='$getnetbyname_r_proto'
25032 getnetent_r_proto='$getnetent_r_proto'
25033 getprotobyname_r_proto='$getprotobyname_r_proto'
25034 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25035 getprotoent_r_proto='$getprotoent_r_proto'
25036 getpwent_r_proto='$getpwent_r_proto'
25037 getpwnam_r_proto='$getpwnam_r_proto'
25038 getpwuid_r_proto='$getpwuid_r_proto'
25039 getservbyname_r_proto='$getservbyname_r_proto'
25040 getservbyport_r_proto='$getservbyport_r_proto'
25041 getservent_r_proto='$getservent_r_proto'
25042 getspnam_r_proto='$getspnam_r_proto'
25043 gidformat='$gidformat'
25049 gmtime_r_proto='$gmtime_r_proto'
25050 gnulibc_version='$gnulibc_version'
25052 groupcat='$groupcat'
25053 groupstype='$groupstype'
25056 h_sysfile='$h_sysfile'
25059 hostgenerate='$hostgenerate'
25060 hostosname='$hostosname'
25061 hostperl='$hostperl'
25062 html1dir='$html1dir'
25063 html1direxp='$html1direxp'
25064 html3dir='$html3dir'
25065 html3direxp='$html3direxp'
25074 i_arpainet='$i_arpainet'
25075 i_assert='$i_assert'
25077 i_bsdioctl='$i_bsdioctl'
25081 i_dirent='$i_dirent'
25083 i_execinfo='$i_execinfo'
25088 i_fp_class='$i_fp_class'
25090 i_gdbm_ndbm='$i_gdbm_ndbm'
25091 i_gdbmndbm='$i_gdbmndbm'
25093 i_ieeefp='$i_ieeefp'
25094 i_inttypes='$i_inttypes'
25095 i_langinfo='$i_langinfo'
25096 i_libutil='$i_libutil'
25097 i_limits='$i_limits'
25098 i_locale='$i_locale'
25099 i_machcthr='$i_machcthr'
25100 i_malloc='$i_malloc'
25101 i_mallocmalloc='$i_mallocmalloc'
25103 i_memory='$i_memory'
25104 i_mntent='$i_mntent'
25107 i_neterrno='$i_neterrno'
25108 i_netinettcp='$i_netinettcp'
25112 i_pthread='$i_pthread'
25114 i_quadmath='$i_quadmath'
25115 i_rpcsvcdbm='$i_rpcsvcdbm'
25117 i_shadow='$i_shadow'
25119 i_stdarg='$i_stdarg'
25120 i_stdbool='$i_stdbool'
25121 i_stddef='$i_stddef'
25122 i_stdint='$i_stdint'
25123 i_stdlib='$i_stdlib'
25124 i_string='$i_string'
25125 i_sunmath='$i_sunmath'
25126 i_sysaccess='$i_sysaccess'
25127 i_sysdir='$i_sysdir'
25128 i_sysfile='$i_sysfile'
25129 i_sysfilio='$i_sysfilio'
25131 i_sysioctl='$i_sysioctl'
25132 i_syslog='$i_syslog'
25133 i_sysmman='$i_sysmman'
25134 i_sysmode='$i_sysmode'
25135 i_sysmount='$i_sysmount'
25136 i_sysndir='$i_sysndir'
25137 i_sysparam='$i_sysparam'
25138 i_syspoll='$i_syspoll'
25139 i_sysresrc='$i_sysresrc'
25140 i_syssecrt='$i_syssecrt'
25141 i_sysselct='$i_sysselct'
25142 i_syssockio='$i_syssockio'
25143 i_sysstat='$i_sysstat'
25144 i_sysstatfs='$i_sysstatfs'
25145 i_sysstatvfs='$i_sysstatvfs'
25146 i_systime='$i_systime'
25147 i_systimek='$i_systimek'
25148 i_systimes='$i_systimes'
25149 i_systypes='$i_systypes'
25150 i_sysuio='$i_sysuio'
25152 i_sysutsname='$i_sysutsname'
25153 i_sysvfs='$i_sysvfs'
25154 i_syswait='$i_syswait'
25155 i_termio='$i_termio'
25156 i_termios='$i_termios'
25158 i_unistd='$i_unistd'
25161 i_values='$i_values'
25162 i_varargs='$i_varargs'
25163 i_varhdr='$i_varhdr'
25165 i_xlocale='$i_xlocale'
25166 ignore_versioned_solibs='$ignore_versioned_solibs'
25167 inc_version_list='$inc_version_list'
25168 inc_version_list_init='$inc_version_list_init'
25172 initialinstalllocation='$initialinstalllocation'
25173 installarchlib='$installarchlib'
25174 installbin='$installbin'
25175 installhtml1dir='$installhtml1dir'
25176 installhtml3dir='$installhtml3dir'
25177 installman1dir='$installman1dir'
25178 installman3dir='$installman3dir'
25179 installprefix='$installprefix'
25180 installprefixexp='$installprefixexp'
25181 installprivlib='$installprivlib'
25182 installscript='$installscript'
25183 installsitearch='$installsitearch'
25184 installsitebin='$installsitebin'
25185 installsitehtml1dir='$installsitehtml1dir'
25186 installsitehtml3dir='$installsitehtml3dir'
25187 installsitelib='$installsitelib'
25188 installsiteman1dir='$installsiteman1dir'
25189 installsiteman3dir='$installsiteman3dir'
25190 installsitescript='$installsitescript'
25191 installstyle='$installstyle'
25192 installusrbinperl='$installusrbinperl'
25193 installvendorarch='$installvendorarch'
25194 installvendorbin='$installvendorbin'
25195 installvendorhtml1dir='$installvendorhtml1dir'
25196 installvendorhtml3dir='$installvendorhtml3dir'
25197 installvendorlib='$installvendorlib'
25198 installvendorman1dir='$installvendorman1dir'
25199 installvendorman3dir='$installvendorman3dir'
25200 installvendorscript='$installvendorscript'
25202 issymlink='$issymlink'
25203 ivdformat='$ivdformat'
25206 known_extensions='$known_extensions'
25209 ld_can_script='$ld_can_script'
25210 lddlflags='$lddlflags'
25212 ldflags_uselargefiles='$ldflags_uselargefiles'
25213 ldlibpthname='$ldlibpthname'
25220 libsdirs='$libsdirs'
25221 libsfiles='$libsfiles'
25222 libsfound='$libsfound'
25223 libspath='$libspath'
25224 libswanted='$libswanted'
25225 libswanted_uselargefiles='$libswanted_uselargefiles'
25231 localtime_r_proto='$localtime_r_proto'
25232 locincpth='$locincpth'
25233 loclibpth='$loclibpth'
25234 longdblinfbytes='$longdblinfbytes'
25235 longdblkind='$longdblkind'
25236 longdblmantbits='$longdblmantbits'
25237 longdblnanbytes='$longdblnanbytes'
25238 longdblsize='$longdblsize'
25239 longlongsize='$longlongsize'
25240 longsize='$longsize'
25244 lseeksize='$lseeksize'
25245 lseektype='$lseektype'
25249 make_set_make='$make_set_make'
25250 mallocobj='$mallocobj'
25251 mallocsrc='$mallocsrc'
25252 malloctype='$malloctype'
25254 man1direxp='$man1direxp'
25257 man3direxp='$man3direxp'
25259 mips_type='$mips_type'
25260 mistrustnm='$mistrustnm'
25262 mmaptype='$mmaptype'
25263 modetype='$modetype'
25265 multiarch='$multiarch'
25267 myarchname='$myarchname'
25268 mydomain='$mydomain'
25269 myhostname='$myhostname'
25272 need_va_copy='$need_va_copy'
25273 netdb_hlen_type='$netdb_hlen_type'
25274 netdb_host_type='$netdb_host_type'
25275 netdb_name_type='$netdb_name_type'
25276 netdb_net_type='$netdb_net_type'
25279 nm_so_opt='$nm_so_opt'
25280 nonxs_ext='$nonxs_ext'
25282 nvEUformat='$nvEUformat'
25283 nvFUformat='$nvFUformat'
25284 nvGUformat='$nvGUformat'
25285 nv_overflows_integers_at='$nv_overflows_integers_at'
25286 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25287 nveformat='$nveformat'
25288 nvfformat='$nvfformat'
25289 nvgformat='$nvgformat'
25290 nvmantbits='$nvmantbits'
25293 o_nonblock='$o_nonblock'
25295 old_pthread_create_joinable='$old_pthread_create_joinable'
25296 optimize='$optimize'
25297 orderlib='$orderlib'
25300 otherlibdirs='$otherlibdirs'
25304 patchlevel='$patchlevel'
25305 path_sep='$path_sep'
25308 perl_patchlevel='$perl_patchlevel'
25309 perl_static_inline='$perl_static_inline'
25310 perladmin='$perladmin'
25311 perllibs='$perllibs'
25312 perlpath='$perlpath'
25314 phostname='$phostname'
25320 prefixexp='$prefixexp'
25322 privlibexp='$privlibexp'
25323 procselfexe='$procselfexe'
25324 prototype='$prototype'
25326 quadkind='$quadkind'
25327 quadtype='$quadtype'
25328 randbits='$randbits'
25329 randfunc='$randfunc'
25330 random_r_proto='$random_r_proto'
25331 randseedtype='$randseedtype'
25333 rd_nodata='$rd_nodata'
25334 readdir64_r_proto='$readdir64_r_proto'
25335 readdir_r_proto='$readdir_r_proto'
25336 revision='$revision'
25342 sGMTIME_max='$sGMTIME_max'
25343 sGMTIME_min='$sGMTIME_min'
25344 sLOCALTIME_max='$sLOCALTIME_max'
25345 sLOCALTIME_min='$sLOCALTIME_min'
25346 sPRIEUldbl='$sPRIEUldbl'
25347 sPRIFUldbl='$sPRIFUldbl'
25348 sPRIGUldbl='$sPRIGUldbl'
25349 sPRIXU64='$sPRIXU64'
25351 sPRIeldbl='$sPRIeldbl'
25352 sPRIfldbl='$sPRIfldbl'
25353 sPRIgldbl='$sPRIgldbl'
25358 sSCNfldbl='$sSCNfldbl'
25359 sched_yield='$sched_yield'
25360 scriptdir='$scriptdir'
25361 scriptdirexp='$scriptdirexp'
25363 seedfunc='$seedfunc'
25364 selectminbits='$selectminbits'
25365 selecttype='$selecttype'
25366 sendmail='$sendmail'
25367 setgrent_r_proto='$setgrent_r_proto'
25368 sethostent_r_proto='$sethostent_r_proto'
25369 setlocale_r_proto='$setlocale_r_proto'
25370 setnetent_r_proto='$setnetent_r_proto'
25371 setprotoent_r_proto='$setprotoent_r_proto'
25372 setpwent_r_proto='$setpwent_r_proto'
25373 setservent_r_proto='$setservent_r_proto'
25376 sharpbang='$sharpbang'
25377 shmattype='$shmattype'
25378 shortsize='$shortsize'
25381 sig_count='$sig_count'
25382 sig_name='$sig_name'
25383 sig_name_init='$sig_name_init'
25385 sig_num_init='$sig_num_init'
25386 sig_size='$sig_size'
25387 signal_t='$signal_t'
25388 sitearch='$sitearch'
25389 sitearchexp='$sitearchexp'
25391 sitebinexp='$sitebinexp'
25392 sitehtml1dir='$sitehtml1dir'
25393 sitehtml1direxp='$sitehtml1direxp'
25394 sitehtml3dir='$sitehtml3dir'
25395 sitehtml3direxp='$sitehtml3direxp'
25397 sitelib_stem='$sitelib_stem'
25398 sitelibexp='$sitelibexp'
25399 siteman1dir='$siteman1dir'
25400 siteman1direxp='$siteman1direxp'
25401 siteman3dir='$siteman3dir'
25402 siteman3direxp='$siteman3direxp'
25403 siteprefix='$siteprefix'
25404 siteprefixexp='$siteprefixexp'
25405 sitescript='$sitescript'
25406 sitescriptexp='$sitescriptexp'
25407 sizesize='$sizesize'
25408 sizetype='$sizetype'
25412 sockethdr='$sockethdr'
25413 socketlib='$socketlib'
25414 socksizetype='$socksizetype'
25416 spackage='$spackage'
25417 spitshell='$spitshell'
25418 srand48_r_proto='$srand48_r_proto'
25419 srandom_r_proto='$srandom_r_proto'
25421 ssizetype='$ssizetype'
25422 st_ino_sign='$st_ino_sign'
25423 st_ino_size='$st_ino_size'
25424 startperl='$startperl'
25426 static_ext='$static_ext'
25428 stdio_base='$stdio_base'
25429 stdio_bufsiz='$stdio_bufsiz'
25430 stdio_cnt='$stdio_cnt'
25431 stdio_filbuf='$stdio_filbuf'
25432 stdio_ptr='$stdio_ptr'
25433 stdio_stream_array='$stdio_stream_array'
25434 strerror_r_proto='$strerror_r_proto'
25437 subversion='$subversion'
25442 targetarch='$targetarch'
25443 targetdir='$targetdir'
25444 targetenv='$targetenv'
25445 targethost='$targethost'
25446 targetmkdir='$targetmkdir'
25447 targetport='$targetport'
25448 targetsh='$targetsh'
25452 timeincl='$timeincl'
25453 timetype='$timetype'
25454 tmpnam_r_proto='$tmpnam_r_proto'
25460 ttyname_r_proto='$ttyname_r_proto'
25469 uidformat='$uidformat'
25475 uquadtype='$uquadtype'
25476 use5005threads='$use5005threads'
25477 use64bitall='$use64bitall'
25478 use64bitint='$use64bitint'
25479 usecbacktrace='$usecbacktrace'
25480 usecrosscompile='$usecrosscompile'
25481 usedevel='$usedevel'
25483 usedtrace='$usedtrace'
25484 usefaststdio='$usefaststdio'
25485 useithreads='$useithreads'
25486 usekernprocpathname='$usekernprocpathname'
25487 uselargefiles='$uselargefiles'
25488 uselongdouble='$uselongdouble'
25489 usemallocwrap='$usemallocwrap'
25490 usemorebits='$usemorebits'
25491 usemultiplicity='$usemultiplicity'
25492 usemymalloc='$usemymalloc'
25494 usensgetexecutablepath='$usensgetexecutablepath'
25495 useopcode='$useopcode'
25496 useperlio='$useperlio'
25497 useposix='$useposix'
25498 usequadmath='$usequadmath'
25499 usereentrant='$usereentrant'
25500 userelocatableinc='$userelocatableinc'
25501 useshrplib='$useshrplib'
25502 usesitecustomize='$usesitecustomize'
25503 usesocks='$usesocks'
25504 usethreads='$usethreads'
25505 usevendorprefix='$usevendorprefix'
25506 useversionedarchname='$useversionedarchname'
25507 usevfork='$usevfork'
25510 uvXUformat='$uvXUformat'
25511 uvoformat='$uvoformat'
25514 uvuformat='$uvuformat'
25515 uvxformat='$uvxformat'
25517 vendorarch='$vendorarch'
25518 vendorarchexp='$vendorarchexp'
25519 vendorbin='$vendorbin'
25520 vendorbinexp='$vendorbinexp'
25521 vendorhtml1dir='$vendorhtml1dir'
25522 vendorhtml1direxp='$vendorhtml1direxp'
25523 vendorhtml3dir='$vendorhtml3dir'
25524 vendorhtml3direxp='$vendorhtml3direxp'
25525 vendorlib='$vendorlib'
25526 vendorlib_stem='$vendorlib_stem'
25527 vendorlibexp='$vendorlibexp'
25528 vendorman1dir='$vendorman1dir'
25529 vendorman1direxp='$vendorman1direxp'
25530 vendorman3dir='$vendorman3dir'
25531 vendorman3direxp='$vendorman3direxp'
25532 vendorprefix='$vendorprefix'
25533 vendorprefixexp='$vendorprefixexp'
25534 vendorscript='$vendorscript'
25535 vendorscriptexp='$vendorscriptexp'
25537 version_patchlevel_string='$version_patchlevel_string'
25538 versiononly='$versiononly'
25542 yaccflags='$yaccflags'
25547 : add special variables
25548 $test -f $src/patchlevel.h && \
25549 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25550 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25551 echo "PERL_CONFIG_SH=true" >>config.sh
25553 : propagate old symbols
25554 if $test -f UU/config.sh; then
25555 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25556 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25557 config.sh config.sh UU/oldconfig.sh |\
25558 $sort | $uniq -u >UU/oldsyms
25559 set X `$cat UU/oldsyms`
25565 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25567 echo ": Variables propagated from previous config.sh file." >>config.sh
25568 for sym in `$cat UU/oldsyms`; do
25569 echo " Propagating $hint variable "'$'"$sym..."
25570 eval 'tmp="$'"${sym}"'"'
25572 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25578 : preserve RCS keywords in files with variable substitution, grrr
25581 : Finish up by extracting the .SH files
25584 echo "Stopping at your request, leaving temporary files around."
25594 If you'd like to make any changes to the config.sh file before I begin
25595 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25598 rp="Press return or use a shell escape to edit config.sh:"
25603 *) : in case they cannot read
25604 sh 1>&4 -c "$ans";;
25609 : if this fails, just run all the .SH files by hand
25618 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25625 Now you need to generate make dependencies by running "$make depend".
25626 You might prefer to run it in background: "$make depend > makedepend.out &"
25627 It can take a while, so you might not want to run it right now.
25632 rp="Run $make depend now?"
25636 $make depend && echo "Now you must run '$make'."
25639 echo "You must run '$make depend' then '$make'."
25642 elif test -f [Mm]akefile; then
25644 echo "Now you must run a $make."
25646 echo "Configure done."
25649 if $test -f Policy.sh; then
25652 If you compile $package on a different machine or from a different object
25653 directory, copy the Policy.sh file from this object directory to the
25654 new one before you run Configure -- this will help you with most of
25655 the policy defaults.
25659 if $test -f UU/config.msg; then
25660 echo "Hmm. I also noted the following information while running:"
25662 $cat UU/config.msg >&4
25664 $rm -f kit*isdone ark*isdone