3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
531 gethostbyaddr_r_proto=''
533 gethostbyname_r_proto=''
535 gethostent_r_proto=''
548 getnetbyaddr_r_proto=''
550 getnetbyname_r_proto=''
564 d_getprotobyname_r=''
565 getprotobyname_r_proto=''
566 d_getprotobynumber_r=''
567 getprotobynumber_r_proto=''
569 getprotoent_r_proto=''
581 getservbyname_r_proto=''
583 getservbyport_r_proto=''
585 getservent_r_proto=''
618 d_lc_monetary_2008=''
623 d_libm_lib_version=''
630 d_localtime_r_needs_tzset=''
638 d_long_double_style_ieee=''
639 d_long_double_style_ieee_doubledouble=''
640 d_long_double_style_ieee_extended=''
641 d_long_double_style_ieee_std=''
642 d_long_double_style_vax=''
655 d_malloc_good_size=''
709 d_old_pthread_create_joinable=''
710 old_pthread_create_joinable=''
712 d_pthread_attr_setscope=''
760 sethostent_r_proto=''
777 setprotoent_r_proto=''
789 setservent_r_proto=''
802 d_siginfo_si_errno=''
805 d_siginfo_si_status=''
807 d_siginfo_si_value=''
819 d_ipv6_mreq_source=''
836 d_sprintf_returns_strlen=''
849 perl_static_inline=''
854 d_stdio_ptr_lval_nochange_cnt=''
855 d_stdio_ptr_lval_sets_cnt=''
940 default_inc_excludes_dot='undef'
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
2901 : Make symlinks util
2902 case "$mksymlinks" in
2905 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2908 *) case "$lns:$issymlink" in
2909 *"ln"*" -s:"*"test -"?)
2910 echo "Creating the symbolic links..." >&4
2912 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2922 print "# dir = ", dir, "file = ", file
2923 mf[dir] = mf[dir]" "source"/"dir"/"file;
2926 if (d != ".") { print("mkdir -p "d) }
2927 print("ln -sf "mf[d]" "d);
2929 }' source="$src" > UU/mksymlinks.$$
2933 if test ! -d t/base; then
2934 echo "Failed to create the subdirectories. Aborting." >&4
2938 if test ! -f t/base/lex.t; then
2939 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2942 if test ! -f win32/win32.c; then
2943 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2948 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2956 : Check for Cross-Compilation
2957 if $test "X$targethost" = "X"; then
2960 if $test "X$targetenv" = "X"; then
2963 case "$usecrosscompile" in
2965 $echo "Cross-compiling..."
2968 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2969 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2970 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2971 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2972 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2973 # leave out ld, choosing it is more complex
2974 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2975 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2976 # We are in a weird spot. Just before us, some values
2977 # were 'saved', to be restored after the hints are
2978 # run. This means that the changes we made to ar,
2979 # nm and ranlib will get reverted.
2980 # To avoid that, we hijack the saving mechanism and
2981 # have it save our new values.
2982 for file in ar nm ranlib; do
2984 eval $file=$xxx$_exe
2989 case "$targetarch" in
2990 '') echo "Targetarch not defined." >&4; croak=y ;;
2991 *) echo "Using targetarch $targetarch." >&4 ;;
2993 case "$targethost" in
2994 '') echo "Targethost not defined." >&4; croak=n ;;
2995 *) echo "Using targethost $targethost." >&4
3000 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3002 : compile a host miniperl and generate_uudmap, unless we got passed them
3003 if $test "X$hostperl" = X; then
3004 echo "Building host miniperl and generate_uudmap binaries" >&4
3012 $src/Configure -des -Dusedevel -Dmksymlinks
3014 case "$hostgenerate" in
3015 '') $make generate_uudmap
3016 hostgenerate=$src/host/generate_uudmap
3018 "$undef") hostgenerate=''
3021 hostperl=$src/host/miniperl
3024 hostosname=`$hostperl -le 'print $^O'`
3027 usecrosscompile="$undef"
3031 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3032 case "$targethost" in
3033 '') echo "Checking for cross-compile" >&4
3034 case "$usecrosscompile$multiarch" in
3035 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3036 if [ -f Makefile ]; then
3038 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3040 echo "Configure done."
3044 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3051 *) echo "Using targethost $targethost." >&4
3053 /*) run=$src/Cross/run
3054 targetmkdir=$src/Cross/mkdir
3056 from=$src/Cross/from
3058 *) pwd=`$test -f ../Configure & cd ..; pwd`
3060 targetmkdir=$pwd/Cross/mkdir
3062 from=$pwd/Cross/from
3065 case "$targetrun" in
3066 '') targetrun=ssh ;;
3071 case "$targetfrom" in
3072 '') targetfrom=scp ;;
3076 from=$from-$targetfrom
3077 case "$targetdir" in
3079 echo "Guessing targetdir $targetdir." >&4
3082 case "$targetuser" in
3084 echo "Guessing targetuser $targetuser." >&4
3087 case "$targetport" in
3089 echo "Guessing targetport $targetport." >&4
3092 case "$targetfrom" in
3096 case "$targetrun" in
3116 '') cwd=$targetdir ;;
3121 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3127 *) echo "Unknown targetrun '$targetrun'" >&4
3131 case "$targetmkdir" in
3133 cat >$targetmkdir <<EOF
3135 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3137 $chmod a+rx $targetmkdir
3139 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3151 $targetmkdir \`dirname \$f\`
3152 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3155 $targetmkdir $targetdir/\`dirname \$f\`
3156 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3169 $mkdir -p $targetdir/\`dirname \$f\`
3170 $cp \$f $targetdir/\$f || exit 1
3173 $targetmkdir $targetdir/\`dirname \$f\`
3174 $cp \$f $targetdir/\$f || exit 1
3181 *) echo "Unknown targetto '$targetto'" >&4
3185 case "$targetfrom" in
3192 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3197 cp) cat >$from <<EOF
3202 cp $targetdir/\$f . || exit 1
3207 *) echo "Unknown targetfrom '$targetfrom'" >&4
3211 if $test ! -f $run; then
3212 echo "Target 'run' script '$run' not found." >&4
3216 if $test ! -f $to; then
3217 echo "Target 'to' script '$to' not found." >&4
3221 if $test ! -f $from; then
3222 echo "Target 'from' script '$from' not found." >&4
3226 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3230 Using '$run' for remote execution,
3231 and '$from' and '$to'
3232 for remote file transfer.
3238 usecrosscompile="$undef"
3243 : see whether [:lower:] and [:upper:] are supported character classes
3245 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3247 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3251 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3252 # (0xd9 and 0xe2), therefore that is a nice testing point.
3253 if test "X$up" = X -o "X$low" = X; then
3254 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3260 if test "X$up" = X -o "X$low" = X; then
3261 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3267 if test "X$up" = X -o "X$low" = X; then
3268 case "`echo RS | od -x 2>/dev/null`" in
3270 echo "Hey, this might be EBCDIC." >&4
3271 if test "X$up" = X -o "X$low" = X; then
3272 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3273 rs) up='[A-IJ-RS-Z]'
3278 if test "X$up" = X -o "X$low" = X; then
3279 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3289 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3291 echo "Using $up and $low to convert case." >&4
3294 echo "I don't know how to translate letters from upper to lower case." >&4
3295 echo "Your tr is not acting any way I know of." >&4
3299 : set up the translation script tr, must be called with ./tr of course
3303 '[A-Z][a-z]') exec $tr '$up' '$low';;
3304 '[a-z][A-Z]') exec $tr '$low' '$up';;
3311 : Try to determine whether config.sh was made on this system
3312 case "$config_sh" in
3314 myuname=`$uname -a 2>/dev/null`
3315 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3316 # Downcase everything to avoid ambiguity.
3317 # Remove slashes and single quotes so we can use parts of this in
3318 # directory and file names.
3319 # Remove newlines so myuname is sane to use elsewhere.
3320 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3321 # because the A-Z/a-z are not consecutive.
3322 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3323 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3324 newmyuname="$myuname"
3326 case "$knowitall" in
3328 if test -f ../config.sh; then
3329 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3330 eval "`grep myuname= ../config.sh`"
3332 if test "X$myuname" = "X$newmyuname"; then
3340 : Get old answers from old config file if Configure was run on the
3341 : same system, otherwise use the hints.
3344 if test -f config.sh; then
3346 rp="I see a config.sh file. Shall I use it to set the defaults?"
3349 n*|N*) echo "OK, I'll ignore it."
3350 mv config.sh config.sh.old
3351 myuname="$newmyuname"
3353 *) echo "Fetching default answers from your old config.sh file..." >&4
3361 : Older versions did not always set $sh. Catch re-use of such
3371 if test ! -f config.sh; then
3374 First time through, eh? I have some defaults handy for some systems
3375 that need some extra help getting the Configure answers right:
3378 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3380 : Half the following guesses are probably wrong... If you have better
3381 : tests or hints, please send them to perlbug@perl.org
3382 : The metaconfig authors would also appreciate a copy...
3383 $test -f /irix && osname=irix
3384 $test -f /xenix && osname=sco_xenix
3385 $test -f /dynix && osname=dynix
3386 $test -f /dnix && osname=dnix
3387 $test -f /lynx.os && osname=lynxos
3388 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3389 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3390 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3391 $test -f /bin/mips && /bin/mips && osname=mips
3392 $test -d /usr/apollo/bin && osname=apollo
3393 $test -f /etc/saf/_sactab && osname=svr4
3394 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3395 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3396 $test -f /sys/utilities/MultiView && osname=amigaos
3397 if $test -d /MachTen -o -d /MachTen_Folder; then
3399 if $test -x /sbin/version; then
3400 osvers=`/sbin/version | $awk '{print $2}' |
3401 $sed -e 's/[A-Za-z]$//'`
3402 elif $test -x /usr/etc/version; then
3403 osvers=`/usr/etc/version | $awk '{print $2}' |
3404 $sed -e 's/[A-Za-z]$//'`
3410 $test -f /sys/posix.dll &&
3411 $test -f /usr/bin/what &&
3412 set X `/usr/bin/what /sys/posix.dll` &&
3413 $test "$3" = UWIN &&
3417 if $test -f $uname; then
3425 umips) osname=umips ;;
3428 [23]100) osname=mips ;;
3430 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3431 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3434 elif $test -f /etc/kconfig; then
3436 if test "$lns" = "$ln -s"; then
3438 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3440 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3447 if test -n "$DJGPP"; then
3456 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3458 # oslevel can fail with:
3459 # oslevel: Unable to acquire lock.
3460 *not\ found) osvers="$4"."$3" ;;
3461 '<3240'|'<>3240') osvers=3.2.0 ;;
3462 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3463 '=3250'|'>3250') osvers=3.2.5 ;;
3467 bitrig) osname=bitrig
3470 bsd386) osname=bsd386
3473 cygwin*) osname=cygwin
3476 *dc.osx) osname=dcosx
3482 domainos) osname=apollo
3488 dragonfly) osname=dragonfly
3491 dynixptx*) osname=dynixptx
3492 osvers=`echo "$4"|sed 's/^v//'`
3494 freebsd) osname=freebsd
3496 genix) osname=genix ;;
3500 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3513 $test -f /system/lib/libandroid.so && osname=linux-android
3517 netbsd*) osname=netbsd
3520 news-os) osvers="$3"
3522 4*) osname=newsos4 ;;
3526 nonstop-ux) osname=nonstopux ;;
3527 openbsd) osname=openbsd
3533 POSIX-BC | posix-bc ) osname=posix-bc
3536 powerux | power_ux | powermax_os | powermaxos | \
3537 powerunix | power_unix) osname=powerux
3543 solaris) osname=solaris
3545 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3552 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3556 titanos) osname=titanos
3565 ultrix) osname=ultrix
3568 osf1|mls+) case "$5" in
3571 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3574 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3577 hp*) osname=hp_osf1 ;;
3578 mips) osname=mips_osf1 ;;
3581 # UnixWare 7.1.2 is known as Open UNIX 8
3582 openunix|unixware) osname=svr5
3590 $2) case "$osname" in
3594 : svr4.x or possibly later
3604 if test -f /stand/boot ; then
3605 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3606 if test -n "$INITPROG" -a -f "$INITPROG"; then
3607 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3608 if test -n "$isesix"; then
3616 *) if test -f /etc/systemid; then
3618 set `echo $3 | $sed 's/\./ /g'` $4
3619 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3621 elif $test -f $src/hints/sco_$1_$2.sh; then
3623 elif $test -f $src/hints/sco_$1.sh; then
3628 '') : Still unknown. Probably a generic Sys V.
3637 *) case "$osname" in
3638 '') : Still unknown. Probably a generic BSD.
3646 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3647 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3648 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3651 $rm -f UU/kernel.what
3652 elif test -d c:/. -o -n "$is_os2" ; then
3659 case "$targetarch" in
3662 case "$targetarch" in
3664 # Will load qnx.sh, which should change osname to nto
3669 # Catch arm-linux-androideabi, mipsel-linux-android,
3670 # and i686-linux-android
3671 osname=linux-android
3675 # Something like arm-linux-gnueabihf is really just
3682 # XXX perhaps we should just assume
3683 # osvers to be 2, or maybe take the value
3684 # from targetarch. Using $run before the
3685 # hints are run is somewhat icky.
3686 set X `$run $uname -a 2>/dev/null`
3689 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3694 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3701 : Now look for a hint file osname_osvers, unless one has been
3702 : specified already.
3705 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3706 : Also try without trailing minor version numbers.
3707 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3708 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3709 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3710 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3713 *) case "$osvers" in
3716 *) if $test -f $src/hints/$file.sh ; then
3718 elif $test -f $src/hints/$xfile.sh ; then
3720 elif $test -f $src/hints/$xxfile.sh ; then
3722 elif $test -f $src/hints/$xxxfile.sh ; then
3724 elif $test -f $src/hints/$xxxxfile.sh ; then
3726 elif $test -f "$src/hints/${osname}.sh" ; then
3735 if $test -f Policy.sh ; then
3738 none) dflt="Policy" ;;
3739 *) dflt="Policy $dflt" ;;
3744 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3748 if $test -f Policy.sh ; then
3751 There's also a Policy hint file available, which should make the
3752 site-specific (policy) questions easier to answer.
3759 You may give one or more space-separated answers, or "none" if appropriate.
3760 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3761 previous run of Configure, you may specify it as well as or instead of
3762 OS-specific hints. If hints are provided for your OS, you should use them:
3763 although Perl can probably be built without hints on many platforms, using
3764 hints often improve performance and may enable features that Configure can't
3765 set up on its own. If there are no hints that match your OS, specify "none";
3766 DO NOT give a wrong version or a wrong OS.
3770 rp="Which of these apply, if any?"
3773 for file in $tans; do
3774 if $test X$file = XPolicy -a -f Policy.sh; then
3776 $cat Policy.sh >> UU/config.sh
3777 elif $test -f $src/hints/$file.sh; then
3778 . $src/hints/$file.sh
3779 $cat $src/hints/$file.sh >> UU/config.sh
3780 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3783 : Give one chance to correct a possible typo.
3784 echo "$file.sh does not exist"
3786 rp="hint to use instead?"
3788 for file in $ans; do
3789 if $test -f "$src/hints/$file.sh"; then
3790 . $src/hints/$file.sh
3791 $cat $src/hints/$file.sh >> UU/config.sh
3792 elif $test X$ans = X -o X$ans = Xnone ; then
3795 echo "$file.sh does not exist -- ignored."
3802 : Remember our hint file for later.
3803 if $test -f "$src/hints/$file.sh" ; then
3813 echo "Fetching default answers from $config_sh..." >&4
3817 cp $config_sh config.sh 2>/dev/null
3829 : Restore computed paths
3830 for file in $loclist $trylist; do
3831 eval $file="\$_$file"
3836 Configure uses the operating system name and version to set some defaults.
3837 The default value is probably right if the name rings a bell. Otherwise,
3838 since spelling matters for me, either accept the default or answer "none"
3845 ''|' '|none) dflt=none ;;
3846 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3849 *) dflt="$osname" ;;
3851 rp="Operating system name?"
3855 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3861 ''|' '|none) dflt=none ;;
3862 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3863 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3865 ''|' ') dflt=none ;;
3870 *) dflt="$osvers" ;;
3872 rp="Operating system version?"
3882 : who configured the system
3883 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3886 cf_by=`(logname) 2>/dev/null`
3889 cf_by=`(whoami) 2>/dev/null`
3891 "") cf_by=unknown ;;
3896 : decide how portable to be. Allow command line overrides.
3897 case "$d_portable" in
3899 *) d_portable="$define" ;;
3902 : set up shell script to do ~ expansion
3908 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3911 if $test -f /bin/csh; then
3912 /bin/csh -f -c "glob \$1"
3917 name=\`$expr x\$1 : '..\([^/]*\)'\`
3918 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3919 if $test ! -d "\$dir"; then
3921 echo "\$me: can't locate home directory for: \$name" >&2
3926 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3942 : now set up to get a file name
3946 cat <<'EOSC' >>getfile
3962 : getfile will accept an answer from the comma-separated list
3963 : enclosed in parentheses even if it does not meet other criteria.
3964 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3965 fn=`echo $fn | sed 's/(.*)//'`
3971 loc_file=`expr $fn : '.*:\(.*\)'`
3972 fn=`expr $fn : '\(.*\):.*'`
3980 */*) fullpath=true;;
3989 *e*) exp_file=true;;
3992 *p*) nopath_ok=true;;
3997 *d*) type='Directory';;
3998 *l*) type='Locate';;
4003 Locate) what='File';;
4008 case "$d_portable" in
4016 while test "$type"; do
4021 true) rp="$rp (~name ok)";;
4024 if test -f UU/getfile.ok && \
4025 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4044 value=`UU/filexp $ans`
4047 if test "$ans" != "$value"; then
4048 echo "(That expands to $value on this system.)"
4062 /*) value="$ansexp" ;;
4063 [a-zA-Z]:/*) value="$ansexp" ;;
4068 echo "I shall only accept a full path name, as in /bin/ls." >&4
4069 echo "Use a ! shell escape if you wish to check pathnames." >&4
4072 echo "Please give a full path name, starting with slash." >&4
4075 echo "Note that using ~name is ok provided it expands well." >&4
4088 for fp in $gfpth; do
4089 if test "X$fp" = X.; then
4094 if test -f "$pf"; then
4096 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4098 echo "($value is not a plain file, but that's ok.)"
4101 if test X"$type" = X; then
4108 for fp in $gfpth; do
4109 if test "X$fp" = X.; then
4114 direxp="$fp/$ansexp"
4116 if test -d "$direxp"; then
4124 if test -d "$ansexp"; then
4125 echo "(Looking for $loc_file in directory $value.)"
4126 value="$value/$loc_file"
4127 ansexp="$ansexp/$loc_file"
4129 if test -f "$ansexp"; then
4132 case "$nopath_ok" in
4133 true) case "$value" in
4135 *) echo "Assuming $value will be in people's path."
4151 if test "$fastread" = yes; then
4156 rp="$what $value doesn't exist. Use that name anyway?"
4175 test "X$gfpthkeep" != Xy && gfpth=""
4178 : determine root of directory hierarchy where package will be installed.
4181 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4184 dflt=`echo "$prefix" | sed 's/.$//'`
4192 By default, $package will be installed in $dflt/bin, manual pages
4193 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4194 installation directories. Typically this is something like /usr/local.
4195 If you wish to have binaries under /usr/bin but other parts of the
4196 installation under /usr/local, that's ok: you will be prompted
4197 separately for each of the installation directories, the prefix being
4198 only used to set the defaults.
4202 rp='Installation prefix to use?'
4210 *) oldprefix="$prefix";;
4217 : allow them to override the AFS root
4220 *) afsroot=$afsroot ;;
4226 $define|true) afs=true ;;
4227 $undef|false) afs=false ;;
4228 *) if $test -d $afsroot; then
4236 echo "AFS may be running... I'll be extra cautious then..." >&4
4238 echo "AFS does not seem to be running..." >&4
4241 : determine installation prefix for where package is to be installed.
4245 Since you are running AFS, I need to distinguish the directory in which
4246 files will reside from the directory in which they are installed (and from
4247 which they are presumably copied to the former directory by occult means).
4250 case "$installprefix" in
4251 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4252 *) dflt="$installprefix";;
4257 In some special cases, particularly when building $package for distribution,
4258 it is convenient to distinguish the directory in which files should be
4259 installed from the directory ($prefix) in which they will
4260 eventually reside. For most users, these two directories are the same.
4263 case "$installprefix" in
4265 *) dflt=$installprefix;;
4269 rp='What installation prefix should I use for installing files?'
4271 installprefix="$ans"
4272 installprefixexp="$ansexp"
4274 : Perform the prefixexp/installprefixexp correction if necessary
4275 cat <<EOS >installprefix
4278 cat <<'EOSC' >>installprefix
4279 : Change installation prefix, if necessary.
4280 if $test X"$prefix" != X"$installprefix"; then
4281 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4283 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4286 chmod +x installprefix
4287 $eunicefix installprefix
4289 : Set variables such as privlib and privlibexp from the output of ./getfile
4290 : performing the prefixexp/installprefixexp correction if necessary.
4291 cat <<EOS >setprefixvar
4294 cat <<'EOSC' >>setprefixvar
4295 eval "${prefixvar}=\"\$ans\""
4296 eval "${prefixvar}exp=\"\$ansexp\""
4299 chmod +x setprefixvar
4300 $eunicefix setprefixvar
4302 : set up the script used to warn in case of inconsistency
4311 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4313 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4314 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4319 echo "*** WHOA THERE!!! ***" >&4
4320 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4323 rp=" Keep the $hint value?"
4326 y) td=$was; tu=$was;;
4330 : function used to set '$1' to '$val'
4331 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4333 $define$undef) . ./whoa; eval "$var=\$td";;
4334 $undef$define) . ./whoa; eval "$var=\$tu";;
4335 *) eval "$var=$val";;
4338 : get the patchlevel
4340 echo "Getting the current patchlevel..." >&4
4341 if $test -r $rsrc/patchlevel.h;then
4342 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4343 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4344 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4345 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4346 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4347 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4348 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4357 $echo "(You do not have patchlevel.h. Eek.)"
4359 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4360 version_patchlevel_string="version $patchlevel subversion $subversion"
4361 case "$perl_patchlevel" in
4363 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4364 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4368 $echo "(You have $package $version_patchlevel_string.)"
4372 : XXX Should be a Configure test for double-dots in filenames.
4373 version=`echo $revision $patchlevel $subversion | \
4374 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4375 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4376 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4379 version=`echo $revision $patchlevel $subversion | \
4380 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4381 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4382 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4385 : Special case the 5.005_xx maintenance series, which used 5.005
4386 : without any subversion label as a subdirectory in $sitelib
4387 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4388 api_versionstring='5.005'
4391 : Do we want threads support and if so, what type
4392 case "$usethreads" in
4393 $define|true|[yY]*) dflt='y';;
4394 *) # Catch case where user specified ithreads or 5005threads but
4395 # forgot -Dusethreads (A.D. 4/2002)
4396 case "$useithreads$use5005threads" in
4397 *$define*) dflt='y';;
4404 Perl can be built to offer a form of threading support on some systems
4405 To do so, Configure can be run with -Dusethreads.
4407 Note that Perl built with threading support runs slightly slower
4408 and uses slightly more memory than plain Perl.
4410 If this doesn't make any sense to you, just accept the default '$dflt'.
4412 rp='Build a threading Perl?'
4415 y|Y) val="$define" ;;
4421 if $test $patchlevel -lt 9; then
4422 case "$usethreads" in
4424 : Default to ithreads unless overridden on command line or with
4427 case "$use5005threads" in
4429 echo "5.005 threads are no longer supported"
4433 case "$useithreads" in
4434 $undef|false|[nN]*) dflt='n';;
4436 rp='Use the newer interpreter-based ithreads?'
4439 y|Y) val="$define" ;;
4444 : Now set use5005threads to the opposite value.
4445 case "$useithreads" in
4446 $define) val="$undef" ;;
4453 useithreads="$undef"
4454 use5005threads="$undef"
4458 case "$useithreads$use5005threads" in
4462 You cannot have both the ithreads and the 5.005 threads enabled
4463 at the same time. Disabling the 5.005 threads since they are
4464 much less stable than the ithreads.
4467 use5005threads="$undef"
4472 : perl-5.9.x and later
4474 if test X"$usethreads" = "X$define"; then
4475 case "$use5005threads" in
4479 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4486 use5005threads="$undef"
4487 useithreads="$usethreads"
4490 case "$d_oldpthreads" in
4491 '') : Configure tests would be welcome here. For now, assume undef.
4493 *) val="$d_oldpthreads" ;;
4499 : Look for a hint-file generated 'call-back-unit'. If the
4500 : user has specified that a threading perl is to be built,
4501 : we may need to set or change some other defaults.
4502 if $test -f usethreads.cbu; then
4503 echo "Your platform has some specific hints regarding threaded builds, using them..."
4506 case "$usethreads" in
4507 "$define"|true|[yY]*)
4509 (Your platform does not have any specific hints for threaded builds.
4510 Assuming POSIX threads, then.)
4516 : Check if multiplicity is required
4519 Perl can be built so that multiple Perl interpreters can coexist
4520 within the same Perl executable.
4523 case "$useithreads" in
4526 This multiple interpreter support is required for interpreter-based threads.
4530 *) case "$usemultiplicity" in
4531 $define|true|[yY]*) dflt='y';;
4535 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4536 rp='Build Perl for multiplicity?'
4539 y|Y) val="$define" ;;
4547 : Check if morebits is requested
4548 case "$usemorebits" in
4549 "$define"|true|[yY]*)
4550 use64bitint="$define"
4551 uselongdouble="$define"
4552 usemorebits="$define"
4554 *) usemorebits="$undef"
4558 : Determine the C compiler to be used
4564 rp="Use which C compiler?"
4568 : See whether they have no cc but they do have gcc
4570 if $test -f cc.cbu; then
4575 : make some quick guesses about what we are up against
4577 $echo $n "Hmm... $c"
4587 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4588 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4590 echo "Looks kind of like an OSF/1 system, but we'll see..."
4592 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4593 xxx=`./loc addbib blurfl $pth`
4594 if $test -f $xxx; then
4595 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4599 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4600 echo "Looks kind of like an extended USG system, but we'll see..."
4602 echo "Looks kind of like a USG system, but we'll see..."
4606 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4607 echo "Looks kind of like a BSD system, but we'll see..."
4611 echo "Looks kind of like a Version 7 system, but we'll see..."
4614 case "$eunicefix" in
4617 There is, however, a strange, musty smell in the air that reminds me of
4618 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4622 : it so happens the Eunice I know will not run shell scripts in Unix format
4626 echo "Congratulations. You aren't running Eunice."
4630 : Detect OS2. The p_ variable is set above in the Head.U unit.
4631 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4632 : semicolon as a patch separator
4637 I have the feeling something is not exactly right, however...don't tell me...
4638 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4639 (Or you may be running DOS with DJGPP.)
4644 if test -f /xenix; then
4645 echo "Actually, this looks more like a XENIX system..."
4650 echo "It's not Xenix..."
4655 if test -f /venix; then
4656 echo "Actually, this looks more like a VENIX system..."
4663 echo "Nor is it Venix..."
4666 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4667 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4670 : Check if we are using GNU gcc and what its version is
4672 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4676 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4678 printf("%s\n", __VERSION__);
4680 printf("%s\n", "1");
4686 if $cc -o try $ccflags $ldflags try.c; then
4687 gccversion=`$run ./try`
4688 case "$gccversion" in
4689 '') echo "You are not using GNU cc." ;;
4690 *) echo "You are using GNU cc $gccversion."
4696 echo "*** WHOA THERE!!! ***" >&4
4697 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4698 case "$knowitall" in
4700 echo " You'd better start hunting for one and let me know about it." >&4
4706 case "$gccversion" in
4707 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4709 case "$gccversion" in
4710 '') gccosandvers='' ;;
4711 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4712 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4714 case "$gccosandvers" in
4715 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4716 $osname$osvers) ;; # looking good
4717 $osname*) cat <<EOM >&4
4719 *** WHOA THERE!!! ***
4721 Your gcc has not been compiled for the exact release of
4722 your operating system ($gccosandvers versus $osname$osvers).
4724 In general it is a good idea to keep gcc synchronized with
4725 the operating system because otherwise serious problems
4726 may ensue when trying to compile software, like Perl.
4728 I'm trying to be optimistic here, though, and will continue.
4729 If later during the configuration and build icky compilation
4730 problems appear (headerfile conflicts being the most common
4731 manifestation), I suggest reinstalling the gcc to match
4732 your operating system release.
4736 *) gccosandvers='' ;; # failed to parse, better be silent
4744 # gcc 3.* complain about adding -Idirectories that they already know about,
4745 # so we will take those off from locincpth.
4746 case "$gccversion" in
4748 echo "main(){}">try.c
4749 for incdir in $locincpth; do
4750 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4751 grep '^c[cp]p*[01]: warning: changing search order '`
4752 if test "X$warn" != X; then
4753 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4759 # gcc 4.9 by default does some optimizations that break perl.
4760 # see ticket 121505.
4762 # The -fwrapv disables those optimizations (and probably others,) so
4763 # for gcc 4.9 (and later, since the optimizations probably won't go
4764 # away), add -fwrapv unless the user requests -fno-wrapv, which
4765 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4766 # which turns the overflows -fwrapv ignores into runtime errors.
4767 case "$gccversion" in
4768 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4770 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4771 *) ccflags="$ccflags -fwrapv" ;;
4775 : What should the include directory be ?
4776 : Use sysroot if set, so findhdr looks in the right place.
4778 $echo $n "Hmm... $c"
4779 dflt="$sysroot/usr/include"
4782 if $test -f /bin/mips && /bin/mips; then
4783 echo "Looks like a MIPS system..."
4784 $cat >usr.c <<'EOCP'
4785 #ifdef SYSTYPE_BSD43
4789 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4790 dflt='/bsd43/usr/include'
4794 mips_type='System V'
4796 $rm -f usr.c usr.out
4797 echo "and you're compiling with the $mips_type compiler and libraries."
4801 echo "Doesn't look like a MIPS system."
4811 case "$xxx_prompt" in
4814 rp='Where are the include files you want to use?'
4822 : see how we invoke the C preprocessor
4824 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4825 cat <<'EOT' >testcpp.c
4831 if test ! -f cppstdin; then
4832 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4833 # AIX cc -E doesn't show the absolute headerfile
4834 # locations but we'll cheat by using the -M flag.
4835 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
4837 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4840 echo "Keeping your $hint cppstdin wrapper."
4843 wrapper=`pwd`/cppstdin
4847 if $test "X$cppstdin" != "X" && \
4848 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4851 echo "You used to use $cppstdin $cppminus so we'll use that again."
4853 '') echo "But let's see if we can live without a wrapper..." ;;
4855 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4856 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4858 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4861 echo "(However, $cpprun $cpplast does not work, let's see...)"
4869 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4876 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4877 $cc -E <testcpp.c >testcpp.out 2>&1; \
4878 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 echo "Yup, it does."
4880 x_cpp="$cc $cppflags -E"
4882 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4883 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4884 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 echo "Yup, it does."
4886 x_cpp="$cc $cppflags -E"
4888 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4889 $cc -P <testcpp.c >testcpp.out 2>&1; \
4890 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4891 echo "Yipee, that works!"
4892 x_cpp="$cc $cppflags -P"
4894 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4895 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4896 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4897 echo "At long last!"
4898 x_cpp="$cc $cppflags -P"
4900 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4901 $cpp <testcpp.c >testcpp.out 2>&1; \
4902 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4904 x_cpp="$cpp $cppflags"
4906 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4907 $cpp - <testcpp.c >testcpp.out 2>&1; \
4908 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4909 echo "Hooray, it works! I was beginning to wonder."
4910 x_cpp="$cpp $cppflags"
4912 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4913 $wrapper <testcpp.c >testcpp.out 2>&1; \
4914 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4920 rp="No dice. I can't find a C preprocessor. Name one:"
4924 $x_cpp <testcpp.c >testcpp.out 2>&1
4925 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4926 echo "OK, that will do." >&4
4928 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4943 echo "Perhaps can we force $cc -E using a wrapper..."
4944 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4945 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4951 echo "Nope, we'll have to live without it..."
4965 "$wrapper"|'cppstdin') ;;
4966 *) $rm -f $wrapper;;
4968 $rm -f testcpp.c testcpp.out
4970 : Adjust cppfilter for path component separator
4972 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4973 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4977 : Use gcc to determine libpth and incpth
4978 # If using gcc or clang, we can get better values for libpth, incpth
4979 # and usrinc directly from the compiler.
4980 # Note that ccname for clang is also gcc.
4983 $echo 'extern int foo;' > try.c
4984 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4986 if $test $# -gt 0; then
4988 incpth="`$echo $incpth|$sed 's/^ //'`"
4990 j="`$echo $i|$sed 's,/include$,/lib,'`"
4991 if $test -d $j; then
4995 libpth="`$echo $libpth|$sed 's/^ //'`"
4996 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4997 if $test -d $xxx; then
5000 *) libpth="$libpth $xxx";;
5007 '') for i in $incpth; do
5008 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5016 case "$usecrosscompile" in
5019 '') echo "Incpth not defined." >&4; croak=y ;;
5020 *) echo "Using incpth '$incpth'." >&4 ;;
5023 '') echo "Libpth not defined." >&4; croak=y ;;
5024 *) echo "Using libpth '$libpth'." >&4 ;;
5027 '') echo "Usrinc not defined." >&4; croak=y ;;
5028 *) echo "Using usrinc $usrinc." >&4 ;;
5032 if test "X$sysroot" = X; then
5033 echo "Cannot continue, aborting." >&4; exit 1
5035 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5044 : Default value for incpth is just usrinc
5046 '') incpth="$usrinc";;
5049 : Set private lib path
5052 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5057 '') dlist="$loclibpth $plibpth $glibpth";;
5058 *) dlist="$libpth";;
5061 : Now check and see which directories actually exist, avoiding duplicates
5064 if $test -d $xxx; then
5067 *) libpth="$libpth $xxx";;
5073 Some systems have incompatible or broken versions of libraries. Among
5074 the directories listed in the question below, please remove any you
5075 know not to be holding relevant libraries, and add any that are needed.
5076 Say "none" for none.
5080 if test "X$sysroot" != X; then
5082 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5095 rp="Directories to use for library searches?"
5102 : compute shared library extension
5105 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5115 On some systems, shared libraries may be available. Answer 'none' if
5116 you want to suppress searching of shared libraries for the remainder
5117 of this configuration.
5120 rp='What is the file extension used for shared libraries?'
5124 : Does target system insist that shared library basenames are unique
5127 Some dynamic loaders assume that the *basename* of shared library filenames
5128 are globally unique. We'll default this to undef as we assume your system
5129 is not this weird. Set to defined if you're on one of them.
5134 rp='Make shared library basenames unique?'
5137 y|Y) val="$define" ;;
5140 set d_libname_unique
5143 : Define several unixisms.
5144 : Hints files or command line option can be used to override them.
5145 : The convoluted testing is in case hints files set either the old
5148 '') case "$exe_ext" in
5150 *) _exe="$exe_ext" ;;
5155 '') case "$lib_ext" in
5162 '') case "$obj_ext" in
5169 '') case "$path_sep" in
5180 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5182 : Which makefile gets called first. This is used by make depend.
5183 case "$firstmakefile" in
5184 '') firstmakefile='makefile';;
5187 : Check is we will use socks
5189 $define|true|[yY]*) dflt='y';;
5194 Perl can be built to use the SOCKS proxy protocol library. To do so,
5195 Configure must be run with -Dusesocks. If you use SOCKS you also need
5196 to use the PerlIO abstraction layer, this will be implicitly selected.
5198 If this doesn't make any sense to you, just accept the default '$dflt'.
5200 rp='Build Perl for SOCKS?'
5203 y|Y) val="$define" ;;
5209 : Check for uselongdouble support
5211 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5214 case "$uselongdouble" in
5215 $define|true|[yY]*) dflt='y';;
5220 Perl can be built to take advantage of long doubles which
5221 (if available) may give more accuracy and range for floating point numbers.
5223 If this doesn't make any sense to you, just accept the default '$dflt'.
5225 rp='Try to use long doubles if available?'
5228 y|Y) val="$define" ;;
5234 case "$uselongdouble" in
5235 true|[yY]*) uselongdouble="$define" ;;
5238 : Look for a hint-file generated 'call-back-unit'. If the
5239 : user has specified that long doubles should be used,
5240 : we may need to set or change some other defaults.
5241 if $test -f uselongdouble.cbu; then
5242 echo "Your platform has some specific hints regarding long doubles, using them..."
5243 . ./uselongdouble.cbu
5245 case "$uselongdouble" in
5248 (Your platform does not have any specific hints for long doubles.)
5254 : Check if quadmath is requested
5255 case "$usequadmath" in
5256 "$define"|true|[yY]*) usequadmath="$define" ;;
5257 *) usequadmath="$undef" ;;
5260 : Fail if both uselongdouble and usequadmath are requested
5261 case "$usequadmath:$uselongdouble" in
5265 *** You requested the use of the quadmath library and use
5266 *** of long doubles.
5268 *** Please select one or the other.
5274 : Looking for optional libraries
5276 echo "Checking for optional libraries..." >&4
5281 case "$libswanted" in
5282 '') libswanted='c_s';;
5285 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5287 case "$usecbacktrace" in
5288 "$define") libswanted="$libswanted bfd" ;;
5290 case "$usequadmath" in
5291 "$define") libswanted="$libswanted quadmath" ;;
5297 for thisdir in $libpth $xlibpth; do
5298 test -d $thisdir && libspath="$libspath $thisdir"
5300 for thislib in $libswanted; do
5301 for thisdir in $libspath; do
5303 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5304 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5305 $test -f "$xxx" && eval $libscheck
5306 $test -f "$xxx" && libstyle=shared
5307 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5308 $test -f "$xxx" && eval $libscheck
5309 $test -f "$xxx" && libstyle=shared
5311 if test ! -f "$xxx"; then
5312 xxx=$thisdir/lib$thislib.$so
5313 $test -f "$xxx" && eval $libscheck
5314 $test -f "$xxx" && libstyle=shared
5316 if test ! -f "$xxx"; then
5317 xxx=$thisdir/lib$thislib$_a
5318 $test -f "$xxx" && eval $libscheck
5319 $test -f "$xxx" && libstyle=static
5321 if test ! -f "$xxx"; then
5322 xxx=$thisdir/$thislib$_a
5323 $test -f "$xxx" && eval $libscheck
5324 $test -f "$xxx" && libstyle=static
5326 if test ! -f "$xxx"; then
5327 xxx=$thisdir/lib${thislib}_s$_a
5328 $test -f "$xxx" && eval $libscheck
5329 $test -f "$xxx" && libstyle=static
5330 $test -f "$xxx" && thislib=${thislib}_s
5332 if test ! -f "$xxx"; then
5333 xxx=$thisdir/Slib$thislib$_a
5334 $test -f "$xxx" && eval $libscheck
5335 $test -f "$xxx" && libstyle=static
5337 if $test -f "$xxx"; then
5339 shared) echo "Found -l$thislib (shared)." ;;
5340 static) echo "Found -l$thislib." ;;
5341 *) echo "Found -l$thislib ($libstyle)." ;;
5345 *) dflt="$dflt -l$thislib"
5346 libsfound="$libsfound $xxx"
5348 libsfiles="$libsfiles $yyy"
5349 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5350 case " $libsdirs " in
5352 *) libsdirs="$libsdirs $yyy" ;;
5359 if $test ! -f "$xxx"; then
5360 echo "No -l$thislib."
5371 ' '|'') dflt='none';;
5376 In order to compile $package on your machine, a number of libraries
5377 are usually needed. Include any other special libraries here as well.
5378 Say "none" for none. The default list is almost always right.
5382 rp="What libraries to use?"
5389 : determine optimization, if desired, or use for debug flag also
5391 ' '|$undef) dflt='none';;
5393 *) dflt="$optimize";;
5397 By default, $package compiles with the -O flag to use the optimizer.
5398 Alternately, you might want to use the symbolic debugger, which uses
5399 the -g flag (on traditional Unix systems). Either flag can be
5400 specified here. To use neither flag, specify the word "none".
5403 rp="What optimizer/debugger flag should be used?"
5407 'none') optimize=" ";;
5410 : Check what DEBUGGING is required from the command line
5411 : -DEBUGGING or -DDEBUGGING or
5412 : -DEBUGGING=both = -g + -DDEBUGGING
5413 : -DEBUGGING=-g or -Doptimize=-g = -g
5414 : -DEBUGGING=none or -UDEBUGGING =
5415 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5418 *) DEBUGGING=$EBUGGING ;;
5421 case "$DEBUGGING" in
5425 *) optimize="$optimize -g" ;;
5429 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5437 case "$DEBUGGING" in
5438 both|$define) dflt='-DDEBUGGING'
5441 : argument order is deliberate, as the flag will start with - which set could
5442 : think is an option
5443 checkccflag='check=$1; flag=$2; callback=$3;
5445 echo "Checking if your compiler accepts $flag" 2>&1;
5446 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5447 echo "int main(void) { return 0; }" > gcctest.c;
5448 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5449 echo "Yes, it does." 2>&1;
5450 if $test -s gcctest.out ; then
5451 echo "But your platform does not like it:";
5456 echo "Leaving current flags $ccflags alone." 2>&1
5458 *) dflt="$dflt $flag";
5464 echo "Nope, it does not, but that is ok." 2>&1;
5468 : We will not override a previous value, but we might want to
5469 : augment a hint file
5471 default|recommended)
5472 case "$gccversion" in
5473 1*) dflt="$dflt -fpcc-struct-return" ;;
5475 case "$optimize:$DEBUGGING" in
5476 *-g*:old) dflt="$dflt -DDEBUGGING";;
5478 case "$gccversion" in
5479 2*) if $test -d /etc/conf/kconfig.d &&
5480 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5482 # Interactive Systems (ISC) POSIX mode.
5487 case "$gccversion" in
5490 ?*) set strict-aliasing -fno-strict-aliasing
5494 # For gcc, adding -pipe speeds up compilations for some, but apparently
5495 # some assemblers can't read from stdin. (It also slows down compilations
5496 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5497 case "$gccversion" in
5503 # on x86_64 (at least) we require an extra library (libssp) in the
5504 # link command line. This library is not named, so I infer that it is
5505 # an implementation detail that may change. Hence the safest approach
5506 # is to add the flag to the flags passed to the compiler at link time,
5507 # as that way the compiler can do the right implementation dependant
5510 amigaos) ;; # -fstack-protector builds but doesn't work
5511 *) case "$gccversion" in
5512 ?*) set stack-protector-strong -fstack-protector-strong
5515 *-fstack-protector-strong*) ;; # It got added.
5516 *) # Try the plain/older -fstack-protector.
5517 set stack-protector -fstack-protector
5528 case "$mips_type" in
5529 *BSD*|'') inclwanted="$locincpth $usrinc";;
5530 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5532 for thisincl in $inclwanted; do
5533 if $test -d $thisincl; then
5534 if $test x$thisincl != x$usrinc; then
5536 *" -I$thisincl "*);;
5537 *) dflt="$dflt -I$thisincl ";;
5543 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5545 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5553 *) dflt="$dflt -D$2";;
5557 set signal.h LANGUAGE_C; eval $inctest
5561 ccflags="$ccflags -DSOCKS"
5566 default|recommended) dflt="$ccflags $dflt" ;;
5567 *) dflt="$ccflags";;
5576 Your C compiler may want other flags. For this question you should include
5577 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5578 but you should NOT include libraries or ld flags like -lwhatever. If you
5579 want $package to honor its debug switch, you should include -DDEBUGGING here.
5580 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5582 To use no flags, specify the word "none".
5588 rp="Any additional cc flags?"
5595 : the following weeds options from ccflags that are of no interest to cpp
5597 '') cppflags="$ccflags" ;;
5598 *) set X $ccflags; shift
5599 case " $cppflags " in
5600 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5601 *) cppflags="$cppflags $ccflags" ;;
5605 case "$gccversion" in
5606 1*) cppflags="$cppflags -D__GNUC__"
5608 case "$mips_type" in
5610 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5616 echo "Let me guess what the preprocessor flags are..." >&4
5630 *) ftry="$previous $flag";;
5632 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5633 >cpp1.out 2>/dev/null && \
5634 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5635 >cpp2.out 2>/dev/null && \
5636 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5637 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5639 cppflags="$cppflags $ftry"
5649 *-*) echo "They appear to be: $cppflags";;
5651 $rm -f cpp.c cpp?.out
5655 : flags used in final linking phase
5657 '') if ./venix; then
5663 *-posix*) dflt="$dflt -posix" ;;
5666 *) dflt="$ldflags";;
5668 # See note above about -fstack-protector
5670 *-fstack-protector-strong*)
5672 *-fstack-protector-strong*) ;; # Don't add it again
5673 *) dflt="$dflt -fstack-protector-strong" ;;
5676 *-fstack-protector*)
5678 *-fstack-protector*) ;; # Don't add it again
5679 *) dflt="$dflt -fstack-protector" ;;
5684 : Try to guess additional flags to pick up local libraries.
5685 for thislibdir in $libpth; do
5686 case " $loclibpth " in
5689 *"-L$thislibdir "*) ;;
5690 *) dflt="$dflt -L$thislibdir" ;;
5702 Your C linker may need flags. For this question you should
5703 include -L/whatever and any other flags used by the C linker, but you
5704 should NOT include libraries like -lwhatever.
5706 Make sure you include the appropriate -L/path flags if your C linker
5707 does not normally search all of the directories you specified above,
5710 To use no flags, specify the word "none".
5714 rp="Any additional ld flags (NOT including libraries)?"
5720 rmlist="$rmlist pdp11"
5724 echo "Checking your choice of C compiler and flags for coherency..." >&4
5725 $cat > try.c <<'EOF'
5727 int main() { printf("Ok\n"); return(0); }
5729 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5731 $cat >try.msg <<'EOM'
5732 I've tried to compile and run the following simple program:
5735 $cat try.c >> try.msg
5737 $cat >> try.msg <<EOM
5744 and I got the following output:
5748 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5749 if $sh -c "$run ./try " >>try.msg 2>&1; then
5753 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5756 echo "The program compiled OK, but exited with status $?." >>try.msg
5757 rp="You have a problem. Shall I abort Configure"
5761 echo "I can't compile the test program." >>try.msg
5762 rp="You have a BIG problem. Shall I abort Configure"
5768 case "$knowitall" in
5770 echo "(The supplied flags or libraries might be incorrect.)"
5778 *) echo "Ok. Stopping Configure." >&4
5783 n) echo "OK, that should do.";;
5785 $rm_try gcctest gcctest.out
5787 : define a shorthand compile call
5791 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5792 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5796 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5797 : define a shorthand compile call for compilations that should be ok.
5801 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5803 : determine filename position in cpp output
5805 echo "Computing filename position in cpp output for #include directives..." >&4
5807 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5812 vos) testaccess=-e ;;
5815 echo '#include <stdio.h>' > foo.c
5818 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5819 $grep '^[ ]*#.*stdio\.h' | \
5820 while read cline; do
5823 while $test \$# -gt 0; do
5824 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5829 pos=\`expr \$pos + 1\`
5843 *) pos="${fieldn}th";;
5845 echo "Your cpp writes the filename in the $pos field of the line."
5847 : locate header file
5852 for usrincdir in $incpth
5854 if test -f \$usrincdir/\$wanted; then
5855 echo "\$usrincdir/\$wanted"
5859 awkprg='{ print \$$fieldn }'
5860 echo "#include <\$wanted>" > foo\$\$.c
5861 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5862 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5863 while read cline; do
5864 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5866 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5867 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5872 # status = 0: grep returned 0 lines, case statement not executed
5873 # status = 1: headerfile found
5874 # status = 2: while loop executed, no headerfile found
5878 if test \$status -eq 1; then
5885 : define an alternate in-header-list? function
5886 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5887 cont=true; xxf="echo \"<\$1> found.\" >&4";
5888 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5889 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5891 case $# in 4) instead=instead;; *) instead="at last";; esac;
5892 while $test "$cont"; do
5894 var=$2; eval "was=\$$2";
5895 if $test "$xxx" && $test -r "$xxx";
5897 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5900 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5901 set $yyy; shift; shift; yyy=$@;
5902 case $# in 0) cont="";;
5903 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5904 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5905 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5906 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5910 do set $yyy; var=$2; eval "was=\$$2";
5911 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5912 set $yyy; shift; shift; yyy=$@;
5915 : see if stdlib is available
5916 set stdlib.h i_stdlib
5919 : check for lengths of integral types
5923 echo "Checking to see how big your integers are..." >&4
5932 printf("intsize=%d;\n", (int)sizeof(int));
5933 printf("longsize=%d;\n", (int)sizeof(long));
5934 printf("shortsize=%d;\n", (int)sizeof(short));
5939 if eval $compile_ok && $run ./try > /dev/null; then
5941 echo "Your integers are $intsize bytes long."
5942 echo "Your long integers are $longsize bytes long."
5943 echo "Your short integers are $shortsize bytes long."
5947 Help! I can't compile and run the intsize test program: please enlighten me!
5948 (This is probably a misconfiguration in your system or libraries, and
5949 you really ought to fix it. Still, I'll try anyway.)
5953 rp="What is the size of an integer (in bytes)?"
5957 rp="What is the size of a long integer (in bytes)?"
5961 rp="What is the size of a short integer (in bytes)?"
5969 : check for long long
5971 echo "Checking to see if you have long long..." >&4
5972 echo 'int main() { long long x = 7; return 0; }' > try.c
5974 if eval $compile; then
5976 echo "You have long long."
5979 echo "You do not have long long."
5985 : check for length of long long
5986 case "${d_longlong}${longlongsize}" in
5989 echo "Checking to see how big your long longs are..." >&4
5990 $cat >try.c <<'EOCP'
5994 printf("%d\n", (int)sizeof(long long));
5999 if eval $compile_ok; then
6000 longlongsize=`$run ./try`
6001 echo "Your long longs are $longlongsize bytes long."
6005 echo "(I can't seem to compile the test program. Guessing...)"
6006 rp="What is the size of a long long (in bytes)?"
6010 if $test "X$longsize" = "X$longlongsize"; then
6011 echo "(That isn't any different from an ordinary long.)"
6017 : see if inttypes.h is available
6018 : we want a real compile instead of Inhdr because some systems
6019 : have an inttypes.h which includes non-existent headers
6022 #include <inttypes.h>
6024 static int32_t foo32 = 0x12345678;
6028 if eval $compile; then
6029 echo "<inttypes.h> found." >&4
6032 echo "<inttypes.h> NOT found." >&4
6041 echo "Checking to see if you have int64_t..." >&4
6043 #include <sys/types.h>
6044 #$i_inttypes I_INTTYPES
6046 #include <inttypes.h>
6048 int main() { int64_t x = 7; }
6051 if eval $compile; then
6053 echo "You have int64_t."
6056 echo "You do not have int64_t."
6062 : Check if 64bit ints have a quad type
6064 echo "Checking which 64-bit integer type we could use..." >&4
6070 val='"unsigned int"'
6075 *) case "$longsize" in
6079 val='"unsigned long"'
6084 *) case "$d_longlong:$longlongsize" in
6089 val='"unsigned long long"'
6094 *) case "$d_int64_t" in
6113 '') echo "Alas, no 64-bit integer types in sight." >&4
6116 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6121 : Do we want 64bit support
6122 case "$uselonglong" in
6123 "$define"|true|[yY]*)
6126 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6128 use64bitint="$define"
6131 case "$use64bits" in
6132 "$define"|true|[yY]*)
6135 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6137 use64bitint="$define"
6140 case "$use64bitints" in
6141 "$define"|true|[yY]*)
6144 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6146 use64bitint="$define"
6149 case "$use64bitsint" in
6150 "$define"|true|[yY]*)
6153 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6155 use64bitint="$define"
6158 case "$uselonglongs" in
6159 "$define"|true|[yY]*)
6162 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6164 use64bitint="$define"
6167 case "$use64bitsall" in
6168 "$define"|true|[yY]*)
6171 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6173 use64bitall="$define"
6178 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6180 case "$use64bitall" in
6181 "$define"|true|[yY]*) use64bitint="$define" ;;
6187 You have natively 64-bit long integers.
6191 *) case "$use64bitint" in
6192 "$define"|true|[yY]*) dflt='y';;
6201 Perl can be built to take advantage of 64-bit integer types
6202 on some systems. To do so, Configure can be run with -Duse64bitint.
6203 Choosing this option will most probably introduce binary incompatibilities.
6205 If this doesn't make any sense to you, just accept the default '$dflt'.
6206 (The default has been chosen based on your configuration.)
6208 rp='Try to use 64-bit integers, if available?'
6211 [yY]*) val="$define" ;;
6219 case "$use64bitall" in
6220 "$define"|true|[yY]*) dflt='y' ;;
6221 *) case "$longsize" in
6229 You may also choose to try maximal 64-bitness. It means using as much
6230 64-bitness as possible on the platform. This in turn means even more
6231 binary incompatibilities. On the other hand, your platform may not
6232 have any more 64-bitness available than what you already have chosen.
6234 If this doesn't make any sense to you, just accept the default '$dflt'.
6235 (The default has been chosen based on your configuration.)
6237 rp='Try to use maximal 64-bit support, if available?'
6240 [yY]*) val="$define" ;;
6245 case "$use64bitall" in
6247 case "$use64bitint" in
6251 Since you have chosen a maximally 64-bit build, I'm also turning on
6252 the use of 64-bit integers.
6254 use64bitint="$define" ;;
6259 : Look for a hint-file generated 'call-back-unit'. If the
6260 : user has specified that a 64-bit perl is to be built,
6261 : we may need to set or change some other defaults.
6262 if $test -f use64bitint.cbu; then
6263 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6266 case "$use64bitint" in
6267 "$define"|true|[yY]*)
6268 : This test was common to all the OpenBSD forks, and seems harmless for
6271 echo "Checking if your C library has broken 64-bit functions..." >&4
6274 typedef $uquadtype myULL;
6281 {4294967303.15, 4294967303ULL},
6282 {4294967294.2, 4294967294ULL},
6283 {4294967295.7, 4294967295ULL},
6286 for (p = test; p->u; p++) {
6287 myULL x = (myULL)p->d;
6298 if eval $compile_ok; then
6299 libcquad=`$run ./try`
6300 echo "Your C library's 64-bit functions are $libcquad."
6302 echo "(I can't seem to compile the test program.)"
6303 echo "Assuming that your C library's 64-bit functions are ok."
6312 *** You have a C library with broken 64-bit functions.
6313 *** 64-bit support does not work reliably in this configuration.
6314 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6315 *** Cannot continue, aborting.
6322 4) case "$archname64" in
6323 '') archname64=64int ;;
6330 : Look for a hint-file generated 'call-back-unit'. If the
6331 : user has specified that a maximally 64-bit perl is to be built,
6332 : we may need to set or change some other defaults.
6333 if $test -f use64bitall.cbu; then
6334 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6337 case "$use64bitall" in
6338 "$define"|true|[yY]*)
6340 4) case "$archname64" in
6341 ''|64int) archname64=64all ;;
6348 case "$d_quad:$use64bitint" in
6352 *** You have chosen to use 64-bit integers,
6353 *** but none can be found.
6354 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6355 *** Cannot continue, aborting.
6362 : Check if we are using the GNU C library
6364 echo "Checking for GNU C Library..." >&4
6366 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6367 alone are insufficient to distinguish different versions, such as
6368 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6369 libc version 2.1.0. A. Dougherty, June 3, 2002.
6375 # ifdef __GLIBC_MINOR__
6376 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6377 # include <gnu/libc-version.h>
6378 printf("%s\n", gnu_get_libc_version());
6380 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6383 printf("%d\n", __GLIBC__);
6392 if eval $compile_ok && $run ./try > glibc.ver; then
6394 gnulibc_version=`$cat glibc.ver`
6395 echo "You are using the GNU C Library version $gnulibc_version"
6399 echo "You are not using the GNU C Library"
6405 : see if nm is to be used to determine whether a symbol is defined or not
6409 case "$d_gnulibc" in
6412 echo "nm probably won't work on the GNU C Library." >&4
6418 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6420 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6421 echo "'nm' won't be sufficient on this system." >&4
6427 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6428 if $test $dflt -gt 20; then
6438 true|$define) dflt=y;;
6445 I can use $nm to extract the symbols from your C libraries. This
6446 is a time consuming task which may generate huge output on the disk (up
6447 to 3 megabytes) but that should make the symbols extraction faster. The
6448 alternative is to skip the 'nm' extraction part and to compile a small
6449 test program instead to determine whether each symbol is present. If
6450 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6451 this may be the best solution.
6453 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6456 rp="Shall I use $nm to extract C symbols from the libraries?"
6459 [Nn]*) usenm=false;;
6468 : nm options which may be necessary
6470 '') if $test -f /mach_boot; then
6472 elif $test -d /usr/ccs/lib; then
6473 nm_opt='-p' # Solaris (and SunOS?)
6474 elif $test -f /dgux; then
6476 elif $test -f /lib64/rld; then
6477 nm_opt='-p' # 64-bit Irix
6483 : nm options which may be necessary for shared libraries but illegal
6484 : for archive libraries. Thank you, Linux.
6485 case "$nm_so_opt" in
6486 '') case "$myuname" in
6488 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6489 nm_so_opt='--dynamic'
6496 : Figure out where the libc is located
6499 : get list of predefined functions in a handy place
6504 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6510 *) for thislib in $libs; do
6513 : Handle C library specially below.
6516 thislib=`echo $thislib | $sed -e 's/^-l//'`
6517 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6519 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6521 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6523 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6525 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6527 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6529 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6534 libnames="$libnames $try"
6536 *) libnames="$libnames $thislib" ;;
6545 for xxx in $libpth; do
6546 $test -r $1 || set $xxx/libc.$so
6547 : The messy sed command sorts on library version numbers.
6549 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6550 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6552 s/[0-9][0-9]*/0000&/g
6553 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6556 $sort | $sed -e 's/^.* //'`
6559 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6560 $test -r $1 || set $sysroot/lib/libsys_s$_a
6566 if $test -r "$1"; then
6567 echo "Your (shared) C library seems to be in $1."
6569 elif $test -r /lib/libc && $test -r /lib/clib; then
6570 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6572 libc='/lib/clib /lib/libc'
6573 if $test -r /lib/syslib; then
6574 echo "(Your math library is in /lib/syslib.)"
6575 libc="$libc /lib/syslib"
6577 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6578 echo "Your C library seems to be in $libc, as you said before."
6579 elif $test -r $incpath/usr/lib/libc$_a; then
6580 libc=$incpath/usr/lib/libc$_a;
6581 echo "Your C library seems to be in $libc. That's fine."
6582 elif $test -r /lib/libc$_a; then
6584 echo "Your C library seems to be in $libc. You're normal."
6586 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6588 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6589 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6590 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6592 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6594 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6597 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6599 if $test -r "$tans"; then
6600 echo "Your C library seems to be in $tans, of all places."
6606 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6610 If the guess above is wrong (which it might be if you're using a strange
6611 compiler, or your machine supports multiple models), you can override it here.
6616 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6618 I can't seem to find your C library. I've looked in the following places:
6621 $sed 's/^/ /' libpath
6624 None of these seems to contain your C library. I need to get its name...
6629 rp='Where is your C library?'
6634 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6635 set X `cat libnames`
6638 case $# in 1) xxx=file; esac
6639 echo "Extracting names from the following $xxx for later perusal:" >&4
6641 $sed 's/^/ /' libnames >&4
6643 $echo $n "This may take a while...$c" >&4
6647 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6648 *) $nm $nm_opt $file 2>/dev/null;;
6653 $grep fprintf libc.tmp > libc.ptf
6654 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6655 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6657 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6682 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6698 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6702 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6706 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6710 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6712 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6715 $nm -p $* 2>/dev/null >libc.tmp
6716 $grep fprintf libc.tmp > libc.ptf
6717 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6718 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6724 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6726 if $ar t $libc > libc.tmp && \
6727 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6729 for thisname in $libnames $libc; do
6730 $ar t $thisname >>libc.tmp
6732 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6734 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6735 for thisname in $libnames $libc; do
6736 $ar tv $thisname >>libc.tmp
6737 emximp -o tmp.imp $thisname \
6739 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6740 < tmp.imp >>libc.tmp
6743 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6746 echo "$ar didn't seem to work right." >&4
6747 echo "Maybe this is a Cray...trying bld instead..." >&4
6749 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6752 for thisname in $libnames; do
6754 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6755 $ar t $thisname >>libc.tmp
6759 echo "That didn't work either. Giving up." >&4
6769 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6770 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6772 *) if $test -f /lib/syscalls.exp; then
6774 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6775 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6776 /lib/syscalls.exp >>libc.list
6782 $rm -f libnames libpath
6784 : Check if we are using C++
6786 echo "Checking for C++..." >&4
6787 $cat >try.c <<'EOCP'
6799 if eval $compile_ok && $run ./try; then
6801 echo "You are using a C++ compiler."
6804 echo "You are not using a C++ compiler."
6810 : is a C symbol defined?
6813 -v) tf=libc.tmp; tdc="";;
6814 -a) tf=libc.tmp; tdc="[]";;
6815 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6817 case "$d_cplusplus" in
6818 $define) extern_C="extern \"C\"" ;;
6819 *) extern_C="extern" ;;
6822 case "$reuseval-$4" in
6824 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6829 if $test "$runnm" = true; then
6830 if $contains $tlook $tf >/dev/null 2>&1; then
6832 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6833 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;
6834 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6835 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6839 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;
6840 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6846 $define) tval=true;;
6853 : define an is-in-libc? function
6854 inlibc='echo " "; td=$define; tu=$undef;
6855 sym=$1; var=$2; eval "was=\$$2";
6857 case "$reuseval$was" in
6867 echo "$sym() found." >&4;
6868 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6870 echo "$sym() NOT found." >&4;
6871 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6875 $define) echo "$sym() found." >&4;;
6876 *) echo "$sym() NOT found." >&4;;
6880 : check for length of double
6882 case "$doublesize" in
6884 echo "Checking to see how big your double precision numbers are..." >&4
6893 printf("%d\n", (int)sizeof(double));
6898 if eval $compile_ok; then
6899 doublesize=`$run ./try`
6900 echo "Your double is $doublesize bytes long."
6903 echo "(I can't seem to compile the test program. Guessing...)"
6904 rp="What is the size of a double precision number (in bytes)?"
6912 : see if this is a float.h system
6916 : check for long doubles
6918 echo "Checking to see if you have long double..." >&4
6919 echo 'int main() { long double x = 7.0; }' > try.c
6921 if eval $compile; then
6923 echo "You have long double."
6926 echo "You do not have long double."
6932 : see if ldexpl exists
6936 : check for length of long double
6937 case "${d_longdbl}${longdblsize}" in
6940 echo "Checking to see how big your long doubles are..." >&4
6941 $cat >try.c <<'EOCP'
6945 printf("%d\n", sizeof(long double));
6950 if eval $compile; then
6951 longdblsize=`$run ./try`
6952 echo "Your long doubles are $longdblsize bytes long."
6956 echo "(I can't seem to compile the test program. Guessing...)" >&4
6957 rp="What is the size of a long double (in bytes)?"
6961 if $test "X$doublesize" = "X$longdblsize"; then
6962 echo "That isn't any different from an ordinary double."
6963 echo "I'll keep your setting anyway, but you may see some"
6964 echo "harmless compilation warnings."
6970 $echo "Checking the kind of long doubles you have..." >&4
6971 case "$d_longdbl" in
6976 #define LONGDBLSIZE $longdblsize
6977 #define DOUBLESIZE $doublesize
6985 static const long double d = -0.1L;
6987 unsigned const char* b = (unsigned const char*)(&d);
6988 #if DOUBLESIZE == LONGDBLSIZE
6989 printf("0\n"); /* if it floats like double */
6992 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6993 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6994 /* IEEE 754 128-bit little-endian */
6998 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6999 /* IEEE 128-bit big-endian, e.g. solaris sparc */
7004 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
7005 * while 64-bits platforms have it in 16 bytes. The trailing bytes
7006 * cannot be trusted. */
7007 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
7008 if (b[0] == 0xCD && b[9] == 0xBF) {
7009 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7010 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7011 * Also known as "extended precision". */
7015 if (b[0] == 0xBF && b[9] == 0xCD) {
7016 /* Is there ever big-endian 80-bit, really?
7018 * The Motorola 68881 had another "extended precision" format:
7019 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7020 * for total of 96 bits of bytes. The zero bits were unused.
7021 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7022 * If it ever becomes relevant, this format should be allocated
7023 * a new doublekind code since it's quite different from the Intel x87.
7029 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7030 /* software "double double", the 106 is 53+53.
7031 * but irix thinks it is 107. */
7032 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7033 /* double double 128-bit fully little-endian,
7034 * little-endian doubles in little-endian order,
7035 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7039 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7040 /* double double 128-bit fully big-endian,
7041 * big-endian doubles in big-endian order,
7042 * e.g. PPC/Power and MIPS:
7043 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7047 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7048 /* double double 128-bit mixed endian.
7049 * little-endian doubles in big-endian order,
7051 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7055 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7056 /* double double 128-bit mixed endian,
7057 * big-endian doubles in little-endian order,
7058 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7063 /* We are largely making this up because it may well be
7064 * that the VAX format H was never made available to C,
7065 * only to Fortran. */
7066 #if LONGDBLSIZE == 16 && defined(__vax__)
7067 if (b[0] == 0xFD && b[15] == 0x99) {
7068 /* VAX format H, PDP-11 mixed endian. */
7073 printf("-1\n"); /* unknown */
7078 if eval $compile; then
7079 longdblkind=`$run ./try`
7086 case "$longdblkind" in
7087 0) echo "Your long doubles are doubles." >&4 ;;
7088 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7089 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7090 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7091 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7092 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7093 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7094 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7095 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7096 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7097 *) echo "Cannot figure out your long double." >&4 ;;
7099 d_long_double_style_ieee=$undef
7100 d_long_double_style_ieee_std=$undef
7101 d_long_double_style_ieee_extended=$undef
7102 d_long_double_style_ieee_doubledouble=$undef
7103 d_long_double_style_vax=$undef
7104 case "$longdblkind" in
7105 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7107 case "$longdblkind" in
7108 1|2) d_long_double_style_ieee_std=$define ;;
7110 case "$longdblkind" in
7111 3|4) d_long_double_style_ieee_extended=$define ;;
7113 case "$longdblkind" in
7114 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7116 case "$longdblkind" in
7117 9) d_long_double_style_vax=$define ;;
7121 : determine the architecture name
7123 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7124 tarch=`arch`"-$osname"
7125 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7126 if uname -m > tmparch 2>&1 ; then
7127 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7128 -e 's/$/'"-$osname/" tmparch`
7136 case "$myarchname" in
7139 echo "(Your architecture name used to be $myarchname.)"
7143 case "$targetarch" in
7145 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7150 *) dflt="$archname";;
7152 rp='What is your architecture name'
7156 : optionally add API version to the architecture for versioned archlibs
7157 case "$useversionedarchname" in
7158 $define|true|[yY]*) dflt='y';;
7161 rp='Add the Perl API version to your archname?'
7164 y|Y) useversionedarchname="$define" ;;
7165 *) useversionedarchname="$undef" ;;
7167 case "$useversionedarchname" in
7170 *-$api_versionstring)
7171 echo "...and architecture name already has -$api_versionstring" >&4
7174 archname="$archname-$api_versionstring"
7175 echo "...setting architecture name to $archname." >&4
7181 case "$usethreads" in
7183 echo "Threads selected." >&4
7185 *-thread*) echo "...and architecture name already has -thread." >&4
7187 *) archname="$archname-thread"
7188 echo "...setting architecture name to $archname." >&4
7193 case "$usemultiplicity" in
7195 echo "Multiplicity selected." >&4
7197 *-multi*) echo "...and architecture name already has -multi." >&4
7199 *) archname="$archname-multi"
7200 echo "...setting architecture name to $archname." >&4
7205 case "$use64bitint$use64bitall" in
7207 case "$archname64" in
7209 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7212 case "$use64bitint" in
7213 "$define") echo "64 bit integers selected." >&4 ;;
7215 case "$use64bitall" in
7216 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7219 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7221 *) archname="$archname-$archname64"
7222 echo "...setting architecture name to $archname." >&4
7228 case "$uselongdouble" in
7230 echo "Long doubles selected." >&4
7231 case "$longdblsize" in
7233 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7237 *-ld*) echo "...and architecture name already has -ld." >&4
7239 *) archname="$archname-ld"
7240 echo "...setting architecture name to $archname." >&4
7247 case "$usequadmath" in
7249 echo "quadmath selected." >&4
7251 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7253 *) archname="$archname-quadmath"
7254 echo "...setting architecture name to $archname." >&4
7259 if $test -f archname.cbu; then
7260 echo "Your platform has some specific hints for architecture name, using them..."
7264 : set the prefixit variable, to compute a suitable default value
7265 prefixit='case "$3" in
7267 case "$oldprefix" in
7268 "") eval "$1=\"\$$2\"";;
7275 ""|" ") eval "$1=\"\$$2\"";;
7281 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7283 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7284 /*-$oldprefix/*|\~*-$oldprefix/*)
7285 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7286 *) eval "$1=\"\$$2\"";;
7290 : determine installation style
7291 : For now, try to deduce it from prefix unless it is already set.
7292 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7293 case "$installstyle" in
7294 '') case "$prefix" in
7295 *perl*) dflt='lib';;
7296 *) dflt='lib/perl5' ;;
7299 *) dflt="$installstyle" ;;
7301 : Probably not worth prompting for this since we prompt for all
7302 : the directories individually, and the prompt would be too long and
7306 : determine where public executables go
7311 rp='Pathname where the public executables will reside?'
7313 if $test "X$ansexp" != "X$binexp"; then
7317 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7318 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7319 : this via initialinstalllocation
7322 case "$userelocatableinc" in
7323 $define|true|[yY]*) dflt='y' ;;
7328 Would you like to build Perl so that the installation is relocatable, so that
7329 library paths in @INC are determined relative to the path of the perl binary?
7330 This is not advised for system Perl installs, or if you need to run setid
7331 scripts or scripts under taint mode.
7333 If this doesn't make any sense to you, just accept the default '$dflt'.
7335 rp='Use relocatable @INC?'
7338 y|Y) val="$define" ;;
7341 set userelocatableinc
7344 initialinstalllocation="$binexp"
7345 : Default prefix is now "up one level from where the binaries are"
7346 case "$userelocatableinc" in
7352 installprefixexp=".../.."
7356 : determine where private library files go
7357 : Usual default is /usr/local/lib/perl5/$version.
7358 : Also allow things like /opt/perl/lib/$version, since
7359 : /opt/perl/lib/perl5... would be redundant.
7360 : The default "style" setting is made in installstyle.U
7361 case "$installstyle" in
7362 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7363 *) set dflt privlib lib/$version ;;
7368 There are some auxiliary files for $package that need to be put into a
7369 private library directory that is accessible by everyone.
7374 rp='Pathname where the private library files will reside?'
7379 : set the prefixup variable, to restore leading tilda escape
7380 prefixup='case "$prefixexp" in
7382 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7385 : determine where public architecture dependent libraries go
7388 : privlib default is /usr/local/lib/$package/$version
7389 : archlib default is /usr/local/lib/$package/$version/$archname
7390 : privlib may have an optional trailing /share.
7391 tdflt=`echo $privlib | $sed 's,/share$,,'`
7392 tdflt=$tdflt/$archname
7401 $spackage contains architecture-dependent library files. If you are
7402 sharing libraries in a heterogeneous environment, you might store
7403 these files in a separate location. Otherwise, you can just include
7404 them with the rest of the public library files.
7409 rp='Where do you want to put the public architecture-dependent libraries?'
7413 if $test X"$archlib" = X"$privlib"; then
7419 : see if setuid scripts can be secure
7422 Some kernels have a bug that prevents setuid #! scripts from being
7423 secure. Some sites have disabled setuid #! scripts because of this.
7425 First let's decide if your kernel supports secure setuid #! scripts.
7426 (If setuid #! scripts would be secure but have been disabled anyway,
7427 don't say that they are secure if asked.)
7432 if $test -d /dev/fd; then
7433 echo "#!$ls" >reflect
7434 chmod +x,u+s reflect
7435 ./reflect >flect 2>&1
7436 if $contains "/dev/fd" flect >/dev/null; then
7437 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7441 If you are not sure if they are secure, I can check but I'll need a
7442 username and password different from the one you are using right now.
7443 If you don't have such a username or don't want me to test, simply
7447 rp='Other username to test security of setuid scripts with?'
7452 case "$d_suidsafe" in
7453 '') echo "I'll assume setuid scripts are *not* secure." >&4
7456 echo "Well, the $hint value is *not* secure." >&4
7458 *) echo "Well, the $hint value *is* secure." >&4
7463 $rm -f reflect flect
7464 echo "#!$ls" >reflect
7465 chmod +x,u+s reflect
7468 echo '"su" will (probably) prompt you for '"$ans's password."
7469 su $ans -c './reflect >flect'
7470 if $contains "/dev/fd" flect >/dev/null; then
7471 echo "Okay, it looks like setuid scripts are secure." >&4
7474 echo "I don't think setuid scripts are secure." >&4
7479 rp='Does your kernel have *secure* setuid scripts?'
7482 [yY]*) val="$define";;
7487 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7488 echo "(That's for file descriptors, not floppy disks.)"
7494 $rm -f reflect flect
7496 : now see if they want to do setuid emulation
7497 if $test $patchlevel -lt 11; then
7500 case "$d_suidsafe" in
7503 echo "No need to emulate SUID scripts since they are secure here." >&4
7507 Some systems have disabled setuid scripts, especially systems where
7508 setuid scripts cannot be secure. On systems where setuid scripts have
7509 been disabled, the setuid/setgid bits on scripts are currently
7510 useless. It is possible for $package to detect those bits and emulate
7511 setuid/setgid in a secure fashion. This emulation will only work if
7512 setuid scripts have been disabled in your kernel.
7516 "$define") dflt=y ;;
7519 rp="Do you want to do setuid/setgid emulation?"
7522 [yY]*) val="$define";;
7534 SUID emulation has been removed for 5.12
7535 Please re-run Configure without -Dd_dosuid
7544 : Find perl5.005 or later.
7545 echo "Looking for a previously installed perl5.005 or later... "
7547 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7548 : Check if this perl is recent and can load a simple module
7549 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7552 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7562 '') echo "None found. That's ok.";;
7563 *) echo "Using $perl5." ;;
7566 : Set the siteprefix variables
7569 After $package is installed, you may wish to install various
7570 add-on modules and utilities. Typically, these add-ons will
7571 be installed under $prefix with the rest
7572 of this package. However, you may wish to install such add-ons
7573 elsewhere under a different prefix.
7575 If you do not wish to put everything under a single prefix, that's
7576 ok. You will be prompted for the individual locations; this siteprefix
7577 is only used to suggest the defaults.
7579 The default should be fine for most people.
7583 rp='Installation prefix to use for add-on modules and utilities?'
7584 : XXX Here might be another good place for an installstyle setting.
7585 case "$siteprefix" in
7587 *) dflt=$siteprefix ;;
7590 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7592 case "$siteprefix" in
7596 *) oldsiteprefix="$prefix";;
7601 siteprefixexp="$ansexp"
7603 : determine where site specific libraries go.
7604 : Usual default is /usr/local/lib/perl5/site_perl/$version
7605 : The default "style" setting is made in installstyle.U
7606 : XXX No longer works with Prefixit stuff.
7607 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7609 '') case "$installstyle" in
7610 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7611 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7619 The installation process will create a directory for
7620 site-specific extensions and modules. Most users find it convenient
7621 to place all site-specific files in this directory rather than in the
7622 main distribution directory.
7626 rp='Pathname for the site-specific library files?'
7630 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7632 : Determine list of previous versions to include in @INC
7633 $cat > getverlist <<EOPL
7636 \$api_versionstring = "$api_versionstring";
7637 \$version = "$version";
7638 \$stem = "$sitelib_stem";
7639 \$archname = "$archname";
7641 $cat >> getverlist <<'EOPL'
7642 # The list found is store twice for each entry: the original name, and
7643 # the binary broken down version as pack "sss", so sorting is easy and
7644 # unambiguous. This will work for all versions that have a maximum of
7645 # three digit groups, separate by '.'s or '_'s. Names are extended with
7646 # ".0.0" to ensure at least three elements for the pack.
7647 # -- H.Merijn Brand (m)'06 23-10-2006
7649 # Can't have leading @ because metaconfig interprets it as a command!
7650 ;@inc_version_list=();
7651 # XXX Redo to do opendir/readdir?
7654 ;@candidates = map {
7655 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7656 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7662 ($pversion, $aversion, $vsn5005) = map {
7663 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7664 foreach $d (@candidates) {
7665 if ($d->[1] lt $pversion) {
7666 if ($d->[1] ge $aversion) {
7667 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7669 elsif ($d->[1] ge $vsn5005) {
7670 unshift(@inc_version_list, grep { -d } $d->[0]);
7674 # Skip newer version. I.e. don't look in
7675 # 5.7.0 if we're installing 5.6.1.
7679 if (@inc_version_list) {
7680 print join(' ', @inc_version_list);
7683 # Blank space to preserve value for next Configure run.
7688 case "$inc_version_list" in
7689 '') if test -x "$perl5$exe_ext"; then
7690 dflt=`$perl5 getverlist`
7695 $undef) dflt='none' ;;
7696 *) eval dflt=\"$inc_version_list\" ;;
7699 ''|' ') dflt=none ;;
7706 In order to ease the process of upgrading, this version of perl
7707 can be configured to use modules built and installed with earlier
7708 versions of perl that were installed under $prefix. Specify here
7709 the list of earlier versions that this version of perl should check.
7710 If Configure detected no earlier versions of perl installed under
7711 $prefix, then the list will be empty. Answer 'none' to tell perl
7712 to not search earlier versions.
7714 The default should almost always be sensible, so if you're not sure,
7715 just accept the default.
7718 rp='List of earlier versions to include in @INC?'
7721 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7722 *) inc_version_list="$ans" ;;
7724 case "$inc_version_list" in
7726 inc_version_list_init='0'
7727 d_inc_version_list="$undef"
7729 *) inc_version_list_init=`echo $inc_version_list |
7730 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7731 d_inc_version_list="$define"
7736 : see if malloc/malloc.h has to be included
7737 set malloc/malloc.h i_mallocmalloc
7740 : see if this is a malloc.h system
7741 : we want a real compile instead of Inhdr because some systems have a
7742 : malloc.h that just gives a compile error saying to use stdlib.h instead
7747 #$i_mallocmalloc I_MALLOCMALLOC
7748 #ifdef I_MALLOCMALLOC
7749 # include <malloc/malloc.h>
7752 int main () { return 0; }
7755 if eval $compile; then
7756 echo "<malloc.h> found." >&4
7759 echo "<malloc.h> NOT found." >&4
7766 : check for length of pointer
7770 echo "Checking to see how big your pointers are..." >&4
7779 printf("%d\n", (int)sizeof(void *));
7784 if eval $compile_ok; then
7785 ptrsize=`$run ./try`
7786 echo "Your pointers are $ptrsize bytes long."
7789 echo "(I can't seem to compile the test program. Guessing...)" >&4
7790 rp="What is the size of a pointer (in bytes)?"
7797 case "$use64bitall" in
7798 "$define"|true|[yY]*)
7802 *** You have chosen a maximally 64-bit build,
7803 *** but your pointers are only 4 bytes wide.
7804 *** Please rerun Configure without -Duse64bitall.
7809 *** Since you have quads, you could possibly try with -Duse64bitint.
7814 *** Cannot continue, aborting.
7825 : determine whether to use malloc wrapping
7827 case "$usemallocwrap" in
7828 [yY]*|true|$define) dflt='y' ;;
7829 [nN]*|false|$undef) dflt='n' ;;
7830 *) case "$usedevel" in
7831 [yY]*|true|$define) dflt='y' ;;
7836 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7838 usemallocwrap="$ans"
7841 usemallocwrap="$define" ;;
7843 usemallocwrap="$undef" ;;
7846 : determine which malloc to compile in
7848 case "$usemymalloc" in
7849 [yY]*|true|$define) dflt='y' ;;
7850 [nN]*|false|$undef) dflt='n' ;;
7851 *) case "$ptrsize" in
7855 if test "$useithreads" = "$define"; then dflt='n'; fi
7858 rp="Do you wish to attempt to use the malloc that comes with $package?"
7864 mallocsrc='malloc.c'
7865 mallocobj="malloc$_o"
7866 d_mymalloc="$define"
7869 : Remove malloc from list of libraries to use
7870 echo "Removing unneeded -lmalloc from library list" >&4
7871 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7874 echo "libs = $libs" >&4
7886 : compute the return types of malloc and free
7888 $cat >malloc.c <<END
7892 #include <sys/types.h>
7906 case "$malloctype" in
7908 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7915 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7919 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7926 echo "Your system uses $freetype free(), it would seem." >&4
7928 : determine where site specific architecture-dependent libraries go.
7929 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7930 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7931 : sitelib may have an optional trailing /share.
7933 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7934 dflt="$dflt/$archname"
7939 set sitearch sitearch none
7943 The installation process will also create a directory for
7944 architecture-dependent site-specific extensions and modules.
7948 rp='Pathname for the site-specific architecture-dependent library files?'
7952 if $test X"$sitearch" = X"$sitelib"; then
7955 d_sitearch="$define"
7958 : Set the vendorprefix variables
7961 The installation process will also create a directory for
7962 vendor-supplied add-ons. Vendors who supply perl with their system
7963 may find it convenient to place all vendor-supplied files in this
7964 directory rather than in the main distribution directory. This will
7965 ease upgrades between binary-compatible maintenance versions of perl.
7967 Of course you may also use these directories in whatever way you see
7968 fit. For example, you might use them to access modules shared over a
7969 company-wide network.
7971 The default answer should be fine for most people.
7972 This causes further questions about vendor add-ons to be skipped
7973 and no vendor-specific directories will be configured for perl.
7976 rp='Do you want to configure vendor-specific add-on directories?'
7977 case "$usevendorprefix" in
7978 define|true|[yY]*) dflt=y ;;
7979 *) : User may have set vendorprefix directly on Configure command line.
7980 case "$vendorprefix" in
7989 rp='Installation prefix to use for vendor-supplied add-ons?'
7990 case "$vendorprefix" in
7991 '') dflt="$prefix" ;;
7992 *) dflt=$vendorprefix ;;
7995 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7997 case "$vendorprefix" in
8001 *) oldvendorprefix="$prefix";;
8005 usevendorprefix="$define"
8007 vendorprefixexp="$ansexp"
8009 *) usevendorprefix="$undef"
8015 : Set the vendorlib variables
8016 case "$vendorprefix" in
8017 '') d_vendorlib="$undef"
8021 *) d_vendorlib="$define"
8022 : determine where vendor-supplied modules go.
8023 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8024 case "$vendorlib" in
8026 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8027 case "$installstyle" in
8028 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8029 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8032 *) dflt="$vendorlib"
8036 rp='Pathname for the vendor-supplied library files?'
8039 vendorlibexp="$ansexp"
8042 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8046 : Set the vendorarch variables
8047 case "$vendorprefix" in
8048 '') d_vendorarch="$undef"
8052 *) d_vendorarch="$define"
8053 : determine where vendor-supplied architecture-dependent libraries go.
8054 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8055 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8056 : vendorlib may have an optional trailing /share.
8057 case "$vendorarch" in
8058 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8059 dflt="$dflt/$archname"
8061 *) dflt="$vendorarch" ;;
8064 rp='Pathname for vendor-supplied architecture-dependent files?'
8067 vendorarchexp="$ansexp"
8070 prefixvar=vendorarch
8072 if $test X"$vendorarch" = X"$vendorlib"; then
8073 d_vendorarch="$undef"
8075 d_vendorarch="$define"
8078 : Final catch-all directories to search
8081 Lastly, you can have perl look in other directories for extensions and
8082 modules in addition to those already specified.
8083 These directories will be searched after
8087 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8088 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8090 case "$otherlibdirs" in
8091 ''|' ') dflt='none' ;;
8092 *) dflt="$otherlibdirs" ;;
8095 Enter a colon-separated set of extra paths to include in perl's @INC
8096 search path, or enter 'none' for no extra paths.
8100 rp='Colon-separated list of additional directories for perl to search?'
8103 ' '|''|none) otherlibdirs=' ' ;;
8104 *) otherlibdirs="$ans" ;;
8106 case "$otherlibdirs" in
8110 set d_perl_otherlibdirs
8113 : Cruising for prototypes
8115 echo "Checking out function prototypes..." >&4
8116 $cat >prototype.c <<EOCP
8121 int main(int argc, char *argv[]) {
8124 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8125 echo "Your C compiler appears to support function prototypes."
8128 echo "Your C compiler doesn't seem to understand function prototypes."
8135 : Check if ansi2knr is required
8136 case "$prototype" in
8138 *) ansi2knr='ansi2knr'
8143 This version of $package can only be compiled by a compiler that
8144 understands function prototypes. Unfortunately, your C compiler
8146 doesn't seem to understand them. Sorry about that.
8148 If GNU cc is available for your system, perhaps you could try that instead.
8150 Eventually, we hope to support building Perl with pre-ANSI compilers.
8151 If you would like to help in that effort, please contact <perlbug@perl.org>.
8153 Aborting Configure now.
8160 dflt_dtrace='/usr/sbin/dtrace'
8161 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8165 Perl can be built to support DTrace on platforms that support it.
8166 DTrace is a diagnosis and performance analysis tool from Sun.
8168 If this doesn't make any sense to you, just accept the default.
8172 case "$usedtrace" in
8178 dflt_dtrace=$usedtrace
8185 rp='Support DTrace if available?'
8188 y|Y) val="$define" ;;
8194 test "X$usedtrace" != "X$define" && break
8197 rp='Where is the dtrace executable?'
8206 if $dtrace -h -s ../perldtrace.d \
8207 -o perldtrace.tmp >/dev/null 2>&1 \
8208 && rm -f perldtrace.tmp
8211 echo "Good: your $dtrace knows about the -h flag."
8215 *** $me: Fatal Error: $dtrace doesn't support -h flag
8217 *** Your installed dtrace doesn't support the -h switch to compile a D
8218 *** program into a C header. Can't continue.
8230 *** $me: Fatal Error: $dtrace not found.
8237 echo "*** $dtrace was not found."
8243 : See if we want extra modules installed
8250 Perl can be built with extra modules or bundles of modules which
8251 will be fetched from the CPAN and installed alongside Perl.
8253 Notice that you will need access to the CPAN; either via the Internet,
8254 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8255 be asked later to configure the CPAN.pm module which will in turn do
8256 the installation of the rest of the extra modules or bundles.)
8258 Notice also that if the modules require any external software such as
8259 libraries and headers (the libz library and the zlib.h header for the
8260 Compress::Zlib module, for example) you MUST have any such software
8261 already installed, this configuration process will NOT install such
8264 If this doesn't make any sense to you, just accept the default '$dflt'.
8266 rp='Install any extra modules (y or n)?'
8272 Please list any extra modules or bundles to be installed from CPAN,
8273 with spaces between the names. The names can be in any format the
8274 'install' command of CPAN.pm will understand. (Answer 'none',
8275 without the quotes, to install no extra modules or bundles.)
8285 $rm -f ../extras.lst
8287 *) echo "(Saving the list of extras for later...)"
8288 echo "$extras" > ../extras.lst
8296 : determine where html pages for programs go
8297 set html1dir html1dir none
8301 If you wish to install html files for programs in $spackage, indicate
8302 the appropriate directory here. To skip installing html files,
8306 ''|none|$undef|' ') dflt=none ;;
8307 *) dflt=$html1dir ;;
8310 rp="Directory for the main $spackage html pages?"
8314 : Use ' ' for none so value is preserved next time through Configure
8315 $test X"$html1dir" = "X" && html1dir=' '
8317 : determine where html pages for libraries and modules go
8318 set html3dir html3dir none
8322 If you wish to install html files for modules associated with $spackage,
8323 indicate the appropriate directory here. To skip installing html files,
8326 : There is no obvious default. If they have specified html1dir, then
8327 : try to key off that, possibly changing .../html1 into .../html3.
8329 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8330 *) dflt=$html3dir ;;
8333 rp="Directory for the $spackage module html pages?"
8337 : Use ' ' for none so value is preserved next time through Configure
8338 $test X"$html3dir" = "X" && html3dir=' '
8340 : determine whether to install perl also as /usr/bin/perl
8343 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8345 Many scripts expect perl to be installed as /usr/bin/perl.
8347 If you want to, I can install the perl you are about to compile
8348 as /usr/bin/perl (in addition to $bin/perl).
8350 if test -f /usr/bin/perl; then
8353 However, please note that because you already have a /usr/bin/perl,
8354 overwriting that with a new Perl would very probably cause problems.
8355 Therefore I'm assuming you don't want to do that (unless you insist).
8358 case "$installusrbinperl" in
8359 "$define"|[yY]*) dflt='y';;
8365 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8368 case "$installusrbinperl" in
8369 "$undef"|[nN]*) dflt='n';;
8373 rp="Do you want to install perl as /usr/bin/perl?"
8376 [yY]*) val="$define";;
8382 set installusrbinperl
8385 : see if dlopen exists
8387 xxx_ccflags="$ccflags"
8389 : with g++ one needs -shared to get is-in-libc to work for dlopen
8390 case "$gccversion" in
8393 *) case "$d_cplusplus" in
8394 "$define") ccflags="$ccflags -shared" ;;
8401 ccflags="$xxx_ccflags"
8403 : see if this is a unistd.h system
8404 set unistd.h i_unistd
8407 : determine which dynamic loading, if any, to compile in
8409 dldir="ext/DynaLoader"
8422 $define) dflt='y' ;;
8424 : Does a dl_xxx.xs file exist for this operating system
8425 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8428 rp="Do you wish to use dynamic loading?"
8435 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8436 dflt="$dldir/dl_${osname}.xs"
8437 elif $test "$d_dlopen" = "$define" ; then
8438 dflt="$dldir/dl_dlopen.xs"
8443 *) dflt="$dldir/$dlsrc"
8446 echo "The following dynamic loading files are available:"
8447 : Can not go over to $dldir because getfile has path hard-coded in.
8448 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8449 rp="Source file to use for dynamic loading"
8455 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8459 Some systems may require passing special flags to $cc -c to
8460 compile modules that will be used to create a shared library.
8461 To use no flags, say "none".
8464 case "$cccdlflags" in
8465 '') case "$gccversion" in
8466 '') case "$osname" in
8468 irix*) dflt='-KPIC' ;;
8469 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8470 sunos) dflt='-pic' ;;
8474 *) case "$osname" in
8475 darwin) dflt='none' ;;
8476 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8481 *) dflt="$cccdlflags" ;;
8488 # If -Dsysroot was specified, now's the time to add it
8490 if test "X$sysroot" != X; then
8491 case "$gccversion" in
8496 dflt="$dflt --sysroot=$sysroot" ;;
8506 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8509 none) cccdlflags=' ' ;;
8510 *) cccdlflags="$ans" ;;
8515 Some systems use ld to create libraries that can be dynamically loaded,
8516 while other systems (such as those using ELF) use $cc.
8520 : Determine if this is ELF
8522 /* Test for whether ELF binaries are produced */
8534 int i = open("a.out",O_RDONLY);
8537 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8538 exit(0); /* succeed (yes, it is ELF) */
8542 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8548 '') if $test $bin_ELF = "$define"; then
8550 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8554 echo "I'll use ld to build dynamic libraries."
8562 rp="What command should be used to create dynamic libraries?"
8568 Some systems may require passing special flags to $ld to create a
8569 library that can be dynamically loaded. If your ld flags include
8570 -L/other/path options to locate libraries outside your loader's normal
8571 search path, you may need to specify those -L options here as well. To
8572 use no flags, say "none".
8575 case "$lddlflags" in
8576 '') case "$osname" in
8577 haiku) dflt='-shared' ;;
8579 case "$gccversion" in
8580 '') dflt="$dflt +vnocompatwarnings" ;;
8583 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8584 solaris) # See [perl #66604].
8585 # On Solaris 11, gcc -m64 on amd64
8586 # appears not to understand -G. gcc versions at
8587 # least as old as 3.4.3 support -shared, so just
8588 # use that with Solaris 11 and later, but keep
8589 # the old behavior for older Solaris versions.
8590 case "$gccversion" in
8592 *) case "$osvers" in
8593 2.?|2.10) dflt='-G' ;;
8594 *) dflt='-shared' ;;
8599 sunos) dflt='-assert nodefinitions' ;;
8600 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8604 *) dflt="$lddlflags" ;;
8607 : Only do this for gcc, since, for example, qcc has no concept
8609 if $test "X$sysroot" != X; then
8610 case "$gccversion" in
8612 *) dflt="$dflt --sysroot $sysroot" ;;
8616 : Try to guess additional flags to pick up local libraries.
8617 : Be careful not to append to a plain 'none'
8621 for thisflag in $ldflags; do
8626 *) dflt="$dflt $thisflag" ;;
8633 ''|' ') dflt='none' ;;
8637 *-fstack-protector-strong*)
8639 *-fstack-protector-strong*) ;; # Don't add it again
8640 *) dflt="$dflt -fstack-protector-strong" ;;
8643 *-fstack-protector*)
8645 *-fstack-protector*) ;; # Don't add it again
8646 *) dflt="$dflt -fstack-protector" ;;
8651 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8654 none) lddlflags=' ' ;;
8655 *) lddlflags="$ans" ;;
8660 Some systems may require passing special flags to $cc to indicate that
8661 the resulting executable will use dynamic linking. To use no flags,
8665 case "$ccdlflags" in
8666 '') case "$osname" in
8667 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8668 sunos) dflt='none' ;;
8672 *) dflt="$ccdlflags" ;;
8674 rp="Any special flags to pass to $cc to use dynamic linking?"
8677 none) ccdlflags=' ' ;;
8678 *) ccdlflags="$ans" ;;
8690 ld_can_script="$undef"
8691 case "$bin_ELF$usedl" in
8693 # Abuse try.h and a.out names for neat cleanup
8705 if $cc $cccdlflags $ccdlflags $ccflags \
8706 $ldflags $lddlflags -o a.out try.c \
8707 -Wl,--version-script=try.h >/dev/null 2>&1 \
8708 && $test -s a.out ; then
8709 echo "ld supports scripting" >&4
8710 ld_can_script="$define"
8712 echo "ld does not support scripting" >&4
8718 : Do we want a shared libperl?
8722 # No dynamic loading being used, so don't bother even to prompt.
8725 *) case "$useshrplib" in
8726 '') case "$osname" in
8727 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8729 also='Building a shared libperl is required for dynamic loading to work on your system.'
8743 The perl executable is normally obtained by linking perlmain.c with
8744 libperl${_a}, any static extensions (usually just DynaLoader), and
8745 any other libraries needed on this system (such as -lm, etc.). Since
8746 your system supports dynamic loading, it is probably possible to build
8747 a shared libperl.$so. If you will have more than one executable linked
8748 to libperl.$so, this will significantly reduce the size of each
8749 executable, but it may have a noticeable effect on performance. The
8750 default is probably sensible for your system.
8754 rp="Build a shared libperl.$so (y/n)"
8758 useshrplib='true' ;;
8759 *) useshrplib='false' ;;
8764 case "$useshrplib" in
8766 case "$userelocatableinc" in
8768 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8769 echo "See INSTALL for an explanation why that won't work." >&4
8775 # Figure out a good name for libperl.so. Since it gets stored in
8776 # a version-specific architecture-dependent library, the version
8777 # number isn't really that important, except for making cc/ld happy.
8779 # A name such as libperl.so.10.1
8780 majmin="libperl.$so.$patchlevel.$subversion"
8781 # A name such as libperl.so.100
8782 majonly=`echo $patchlevel $subversion |
8783 $awk '{printf "%d%02d", $1, $2}'`
8784 majonly=libperl.$so.$majonly
8785 # I'd prefer to keep the os-specific stuff here to a minimum, and
8786 # rely on figuring it out from the naming of libc.
8787 case "${osname}${osvers}" in
8788 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8791 cygwin*) # ld links now against the dll directly
8792 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8793 majonly=`echo $patchlevel $subversion |
8794 $awk '{printf "%03d%03d", $1, $2}'`
8795 majonly=cygperl5.$majonly.$so
8798 *) # Try to guess based on whether libc has major.minor.
8800 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8801 *libc.$so.[0-9]*) dflt=$majonly ;;
8802 *) dflt=libperl.$so ;;
8812 I need to select a good name for the shared libperl. If your system uses
8813 library names with major and minor numbers, then you might want something
8814 like $majmin. Alternatively, if your system uses a single version
8815 number for shared libraries, then you might want to use $majonly.
8816 Or, your system might be quite happy with a simple libperl.$so.
8818 Since the shared libperl will get installed into a version-specific
8819 architecture-dependent directory, the version number of the shared perl
8820 library probably isn't important, so the default should be o.k.
8823 rp='What name do you want to give to the shared libperl?'
8826 echo "Ok, I'll use $libperl"
8829 libperl="libperl${_a}"
8833 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8837 WARNING: Use of the shrpdir variable for the installation location of
8838 the shared $libperl is not supported. It was never documented and
8839 will not work in this version. Let me (perlbug@perl.org)
8840 know of any problems this may cause.
8846 But your current setting of $shrpdir is
8847 the default anyway, so it's harmless.
8852 Further, your current attempted setting of $shrpdir
8853 conflicts with the value of $archlibexp/CORE
8854 that installperl will use.
8861 # How will the perl executable find the installed shared $libperl?
8862 # Add $xxx to ccdlflags.
8863 # If we can't figure out a command-line option, use $shrpenv to
8864 # set env LD_RUN_PATH. The main perl makefile uses this.
8865 shrpdir=$archlibexp/CORE
8868 if "$useshrplib"; then
8871 # We'll set it in Makefile.SH...
8876 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8877 xxx="-Wl,-R$shrpdir"
8879 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8880 xxx="-Wl,-rpath,$shrpdir"
8883 # hpux doesn't like the default, either.
8884 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8887 # cygwin needs only ldlibpth
8890 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8896 # Only add $xxx if it isn't already in ccdlflags.
8897 case " $ccdlflags " in
8899 *) ccdlflags="$ccdlflags $xxx"
8902 Adding $xxx to the flags
8903 passed to $ld so that the perl executable will find the
8904 installed shared $libperl.
8912 # Fix ccdlflags in AIX for building external extensions.
8913 # (For building Perl itself bare -bE:perl.exp is needed,
8914 # Makefile.SH takes care of this.)
8916 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8918 # Respect a hint or command-line value.
8920 '') shrpenv="$tmp_shrpenv" ;;
8922 case "$ldlibpthname" in
8923 '') ldlibpthname=LD_LIBRARY_PATH ;;
8924 none) ldlibpthname='' ;;
8927 : determine where manual pages are on this system
8931 syspath='/usr/share/man/man1 /usr/man/man1'
8932 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8933 syspath="$syspath /usr/man/u_man/man1"
8934 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8935 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8936 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8937 sysman=`./loc . /usr/man/man1 $syspath`
8940 if $test -d "$sysman"; then
8941 echo "System manual is in $sysman." >&4
8943 echo "Could not find manual pages in source form." >&4
8946 : determine where manual pages go
8947 set man1dir man1dir none
8951 $spackage has manual pages available in source form.
8955 echo "However, you don't have nroff, so they're probably useless to you."
8957 '') man1dir="none";;
8960 echo "If you don't want the manual sources installed, answer 'none'."
8965 lookpath="$prefixexp/share/man/man1"
8966 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8967 lookpath="$lookpath $prefixexp/man/p_man/man1"
8968 lookpath="$lookpath $prefixexp/man/u_man/man1"
8969 lookpath="$lookpath $prefixexp/man/man.1"
8971 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8972 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8982 rp="Where do the main $spackage manual pages (source) go?"
8984 if $test "X$man1direxp" != "X$ansexp"; then
8995 : What suffix to use on installed man pages
9002 rp="What suffix should be used for the main $spackage man pages?"
9004 '') case "$man1dir" in
9018 *) dflt="$man1ext";;
9025 : see if we can have long filenames
9027 first=123456789abcdef
9029 if (echo hi >$first) 2>/dev/null; then
9030 if $test -f 123456789abcde; then
9031 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
9034 echo 'You can have filenames longer than 14 characters.'>&4
9039 You can't have filenames longer than 14 chars.
9040 You can't even think about them!
9046 $rm -rf 123456789abcde*
9048 : determine where library module manual pages go
9049 set man3dir man3dir none
9053 $spackage has manual pages for many of the library modules.
9059 However, you don't have nroff, so they're probably useless to you.
9062 '') man3dir="none";;
9066 case "$d_flexfnam" in
9069 However, your system can't handle the long file names like File::Basename.3.
9072 '') man3dir="none";;
9076 echo "If you don't want the manual sources installed, answer 'none'."
9077 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9079 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9080 if $test -d "$privlib/man/man3"; then
9083 WARNING: Previous versions of perl installed man3 pages into
9084 $privlib/man/man3. This version will suggest a
9085 new default of $dflt.
9089 rp='Do you wish to preserve the old behavior?(y/n)'
9092 y*) dflt="$privlib/man/man3" ;;
9097 *) dflt="$man3dir" ;;
9104 rp="Where do the $package library man pages (source) go?"
9114 : What suffix to use on installed man pages
9120 rp="What suffix should be used for the $package library man pages?"
9122 '') case "$man3dir" in
9136 *) dflt="$man3ext";;
9143 : see if we have to deal with yellow pages, now NIS.
9144 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9150 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9158 rp='Are you getting the hosts file via yellow pages?'
9161 y*) hostcat='ypcat hosts';;
9162 *) hostcat='cat /etc/hosts';;
9168 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9171 '') test -f /etc/group && groupcat='cat /etc/group';;
9174 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9177 : now get the host name
9179 echo "Figuring out host name..." >&4
9180 case "$myhostname" in
9182 echo 'Maybe "hostname" will work...'
9183 if tans=`sh -c hostname 2>&1` ; then
9191 if $test "$cont"; then
9193 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9194 if tans=`cat /etc/systemid 2>&1` ; then
9196 phostname='cat /etc/systemid'
9197 echo "Whadyaknow. Xenix always was a bit strange..."
9200 elif $test -r /etc/systemid; then
9201 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9204 if $test "$cont"; then
9205 echo 'No, maybe "uuname -l" will work...'
9206 if tans=`sh -c 'uuname -l' 2>&1` ; then
9208 phostname='uuname -l'
9210 echo 'Strange. Maybe "uname -n" will work...'
9211 if tans=`sh -c 'uname -n' 2>&1` ; then
9213 phostname='uname -n'
9215 echo 'Oh well, maybe I can mine it out of whoami.h...'
9216 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9217 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9218 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9220 case "$myhostname" in
9221 '') echo "Does this machine have an identity crisis or something?"
9224 echo "Well, you said $myhostname before..."
9225 phostname='echo $myhostname';;
9231 case "$myhostname" in
9232 '') myhostname=noname ;;
9234 : you do not want to know about this
9239 if $test "$myhostname" ; then
9241 rp='Your host name appears to be "'$myhostname'".'" Right?"
9249 : bad guess or no guess
9250 while $test "X$myhostname" = X ; do
9252 rp="Please type the (one word) name of your host:"
9257 : translate upper to lower if necessary
9258 case "$myhostname" in
9260 echo "(Normalizing case in your host name)"
9261 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9265 case "$myhostname" in
9267 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9268 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9269 echo "(Trimming domain name from host name--host name is now $myhostname)"
9271 *) case "$mydomain" in
9274 test "X$hostcat" = "Xypcat hosts" &&
9275 ypmatch "$myhostname" hosts 2>/dev/null |\
9276 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9279 test "X$hostcat" != "X" &&
9280 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9281 /[ ]$myhostname[ . ]/p" > hosts
9284 if $test -f hosts; then
9285 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9286 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9287 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9288 hosts | $sort | $uniq | \
9289 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9290 case `$echo X$dflt` in
9291 X*\ *) echo "(Several hosts in the database matched hostname)"
9294 X.) echo "(You do not have fully-qualified names in the hosts database)"
9298 echo "(I cannot locate a hosts database anywhere)"
9303 tans=`./loc resolv.conf X /etc /usr/etc`
9304 if $test -f "$tans"; then
9305 echo "(Attempting domain name extraction from $tans)"
9306 dflt=.`$sed -n -e 's/ / /g' \
9307 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9310 .) dflt=.`$sed -n -e 's/ / /g' \
9311 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9319 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9320 dflt=.`sh -c domainname 2>/dev/null`
9323 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9327 case "$dflt$osname" in
9328 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9329 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9333 .) echo "(Lost all hope -- silly guess then)"
9339 *) dflt="$mydomain";;
9343 rp="What is your domain name?"
9353 : translate upper to lower if necessary
9356 echo "(Normalizing case in your domain name)"
9357 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9361 : a little sanity check here
9362 case "$phostname" in
9365 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9366 $myhostname$mydomain|$myhostname) ;;
9368 case "$phostname" in
9370 echo "(That doesn't agree with your whoami.h file, by the way.)"
9373 echo "(That doesn't agree with your $phostname command, by the way.)"
9381 : determine the e-mail address of the user who is running us
9384 I need to get your e-mail address in Internet format if possible, i.e.
9385 something like user@host.domain. Please answer accurately since I have
9386 no easy means to double check it. The default value provided below
9387 is most probably close to reality but may not be valid from outside
9388 your organization...
9392 while test "$cont"; do
9393 case "$MAILDOMAIN" in
9395 if $test -s /etc/mailname; then
9396 maildomain=`$cat /etc/mailname`
9398 maildomain="$myhostname$mydomain"
9401 *) maildomain="$MAILDOMAIN";;
9404 '') dflt="$cf_by@$maildomain";;
9405 *) dflt="$cf_email";;
9407 rp='What is your e-mail address?'
9413 rp='Address does not look like an Internet one. Use it anyway?'
9427 : Ask e-mail of administrator
9430 If you or somebody else will be maintaining perl at your site, please
9431 fill in the correct e-mail address here so that they may be contacted
9432 if necessary. Currently, the "perlbug" program included with perl
9433 will send mail to this address in addition to perlbug@perl.org. You may
9434 enter "none" for no administrator.
9437 case "$perladmin" in
9438 '') dflt="$cf_email";;
9439 *) dflt="$perladmin";;
9441 rp='Perl administrator e-mail address'
9445 : determine whether to use a version number suffix for installed binaries
9448 Do you want to use a version number suffix for installed binaries? This
9449 will install 'perl$version' instead of 'perl', and likewise for other
9450 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9451 to be installed side-by-side. Unless you are a developer, you probably
9452 do *not* want to do this.
9454 case "$versiononly" in
9455 "$define"|[Yy]*|true) dflt='y' ;;
9458 rp="Do you want to use a version number suffix for installed binaries?"
9461 [yY]*) val="$define";;
9467 case "$versiononly" in
9468 "$define") inc_version_list=''
9469 inc_version_list_init=0
9473 : figure out how to guarantee perl startup
9474 : XXX Note that this currently takes advantage of the bug that binexp ignores
9475 : the Configure -Dinstallprefix setting, which in turn means that under
9476 : relocatable @INC, initialinstalllocation is what binexp started as.
9477 case "$startperl" in
9479 case "$sharpbang" in
9483 I can use the #! construct to start perl on your system. This will
9484 make startup of perl scripts faster, but may cause problems if you
9485 want to share those scripts and perl is not in a standard place
9486 ($initialinstalllocation/perl) on all your platforms. The alternative
9487 is to force a shell by starting the script with a single ':' character.
9490 case "$versiononly" in
9491 "$define") dflt="$initialinstalllocation/perl$version";;
9492 *) dflt="$initialinstalllocation/perl";;
9494 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9497 none) startperl=": # use perl";;
9498 *) startperl="#!$ans"
9499 if $test 30 -lt `echo "$ans" | wc -c`; then
9502 WARNING: Some systems limit the #! command to 32 characters.
9503 If you experience difficulty running Perl scripts with #!, try
9504 installing Perl in a directory with a shorter pathname.
9510 *) startperl=": # use perl"
9515 echo "I'll use $startperl to start perl scripts."
9517 : figure best path for perl in scripts
9520 case "$versiononly" in
9521 "$define") perlpath="$initialinstalllocation/perl$version";;
9522 *) perlpath="$initialinstalllocation/perl";;
9524 case "$startperl" in
9529 I will use the "eval 'exec'" idiom to start Perl on your system.
9530 I can use the full path of your Perl binary for this purpose, but
9531 doing so may cause problems if you want to share those scripts and
9532 Perl is not always in a standard place ($initialinstalllocation/perl).
9535 dflt="$initialinstalllocation/perl"
9536 rp="What path shall I use in \"eval 'exec'\"?"
9543 case "$startperl" in
9545 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9548 : determine where public executable scripts go
9549 set scriptdir scriptdir
9551 case "$scriptdir" in
9554 : guess some guesses
9555 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9556 $test -d /usr/share/bin && dflt=/usr/share/bin
9557 $test -d /usr/local/script && dflt=/usr/local/script
9558 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9559 $test -d $prefixexp/script && dflt=$prefixexp/script
9563 *) dflt="$scriptdir"
9568 Some installations have a separate directory just for executable scripts so
9569 that they can mount it across multiple architectures but keep the scripts in
9570 one spot. You might, for example, have a subdirectory of /usr/share for this.
9571 Or you might just lump your scripts in with all your other executables.
9575 rp='Where do you keep publicly executable scripts?'
9577 if $test "X$ansexp" != "X$scriptdirexp"; then
9583 : A little fix up for an irregularly named variable.
9584 installscript="$installscriptdir"
9586 : determine where add-on public executables go
9588 '') dflt=$siteprefix/bin ;;
9592 rp='Pathname where the add-on public executables should be installed?'
9597 : determine where add-on html pages go
9598 : There is no standard location, so try to copy the previously-selected
9599 : directory structure for the core html pages.
9600 case "$sitehtml1dir" in
9601 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9602 *) dflt=$sitehtml1dir ;;
9605 ''|' ') dflt=none ;;
9608 rp='Pathname where the site-specific html pages should be installed?'
9610 prefixvar=sitehtml1dir
9613 : determine where add-on library html pages go
9614 : There is no standard location, so try to copy the previously-selected
9615 : directory structure for the core html pages.
9616 case "$sitehtml3dir" in
9617 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9618 *) dflt=$sitehtml3dir ;;
9621 ''|' ') dflt=none ;;
9624 rp='Pathname where the site-specific library html pages should be installed?'
9626 prefixvar=sitehtml3dir
9629 : determine where add-on manual pages go
9630 case "$siteman1dir" in
9631 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9632 *) dflt=$siteman1dir ;;
9635 ''|' ') dflt=none ;;
9638 rp='Pathname where the site-specific manual pages should be installed?'
9640 prefixvar=siteman1dir
9643 : determine where add-on library man pages go
9644 case "$siteman3dir" in
9645 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9646 *) dflt=$siteman3dir ;;
9649 ''|' ') dflt=none ;;
9652 rp='Pathname where the site-specific library manual pages should be installed?'
9654 prefixvar=siteman3dir
9657 : determine where add-on public executable scripts go
9658 case "$sitescript" in
9659 '') dflt=$siteprefix/script
9660 $test -d $dflt || dflt=$sitebin ;;
9661 *) dflt="$sitescript" ;;
9664 rp='Pathname where add-on public executable scripts should be installed?'
9666 prefixvar=sitescript
9669 : see if backtrace exists
9670 set backtrace d_backtrace
9673 : add flags if using c backtrace
9674 case "$usecbacktrace" in
9675 "") usecbacktrace=$undef ;;
9677 case "$d_backtrace" in
9679 case " $ccflags " in
9680 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9681 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9685 echo "This system does not support backtrace" >&4
9686 usecbacktrace=$undef
9692 : Check if faststdio is requested and available
9693 case "$usefaststdio" in
9694 $define|true|[yY]*|'')
9695 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9705 Perl can be built to use 'fast stdio', which means using the stdio
9706 library but also directly manipulating the stdio buffers to enable
9707 faster I/O. Using stdio is better for backward compatibility (especially
9708 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9709 interface has been preferred instead of stdio.
9711 If this doesn't make any sense to you, just accept the default '$dflt'.
9713 rp='Use the "fast stdio" if available?'
9716 y|Y) val="$define" ;;
9723 : define an is-a-typedef? function
9724 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9726 "") inclist="sys/types.h";;
9728 eval "varval=\$$var";
9732 for inc in $inclist; do
9733 echo "#include <$inc>" >>temp.c;
9735 echo "#ifdef $type" >> temp.c;
9736 echo "printf(\"We have $type\");" >> temp.c;
9737 echo "#endif" >> temp.c;
9738 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9739 if $contains $type temp.E >/dev/null 2>&1; then
9745 *) eval "$var=\$varval";;
9748 : define an is-a-typedef? function that prompts if the type is not available.
9749 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9751 "") inclist="sys/types.h";;
9753 eval "varval=\$$var";
9757 for inc in $inclist; do
9758 echo "#include <$inc>" >>temp.c;
9760 echo "#ifdef $type" >> temp.c;
9761 echo "printf(\"We have $type\");" >> temp.c;
9762 echo "#endif" >> temp.c;
9763 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9765 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9766 if $contains $type temp.E >/dev/null 2>&1; then
9767 echo "$type found." >&4;
9770 echo "$type NOT found." >&4;
9776 *) eval "$var=\$varval";;
9779 : see what type lseek is declared as in the kernel
9780 rp="What is the type used for lseek's offset on this system?"
9781 set off_t lseektype long stdio.h sys/types.h
9785 echo "Checking to see how big your file offsets are..." >&4
9787 #include <sys/types.h>
9791 printf("%d\n", (int)sizeof($lseektype));
9796 if eval $compile_ok; then
9797 lseeksize=`$run ./try`
9798 echo "Your file offsets are $lseeksize bytes long."
9802 echo "(I can't seem to compile the test program. Guessing...)"
9803 rp="What is the size of your file offsets (in bytes)?"
9809 : see what type file positions are declared as in the library
9810 rp="What is the type for file position used by fsetpos()?"
9811 set fpos_t fpostype long stdio.h sys/types.h
9814 : Check size for Fpos_t
9817 *_t) zzz="$fpostype" ;;
9820 echo "Checking the size of $zzz..." >&4
9822 #include <sys/types.h>
9829 printf("%d\n", (int)sizeof($fpostype));
9834 if eval $compile_ok; then
9838 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9841 echo "Your $zzz is $fpossize bytes long."
9847 echo "(I can't compile the test program. Guessing...)" >&4
9848 rp="What is the size of your file positions (in bytes)?"
9853 : Check for large file support
9854 # Backward compatibility (uselfs is deprecated).
9856 "$define"|true|[yY]*)
9859 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9861 uselargefiles="$define"
9865 case "$lseeksize:$fpossize" in
9868 You can have files larger than 2 gigabytes.
9871 *) case "$uselargefiles" in
9872 "$undef"|false|[nN]*) dflt='n' ;;
9877 Perl can be built to understand large files (files larger than 2 gigabytes)
9878 on some systems. To do so, Configure can be run with -Duselargefiles.
9880 If this doesn't make any sense to you, just accept the default '$dflt'.
9882 rp='Try to understand large files, if available?'
9885 y|Y) val="$define" ;;
9892 : Look for a hint-file generated 'call-back-unit'. If the
9893 : user has specified that a large files perl is to be built,
9894 : we may need to set or change some other defaults.
9895 if $test -f uselargefiles.cbu; then
9896 echo "Your platform has some specific hints regarding large file builds, using them..."
9897 . ./uselargefiles.cbu
9899 case "$uselargefiles" in
9901 if $test -f uselargefiles.cbu; then
9903 echo "Rechecking to see how big your file offsets are..." >&4
9905 #include <sys/types.h>
9909 printf("%d\n", (int)sizeof($lseektype));
9914 if eval $compile_ok; then
9915 lseeksize=`$run ./try`
9916 $echo "Your file offsets are now $lseeksize bytes long."
9920 echo "(I can't seem to compile the test program. Guessing...)"
9921 rp="What is the size of your file offsets (in bytes)?"
9926 *_t) zzz="$fpostype" ;;
9929 $echo $n "Rechecking the size of $zzz...$c" >&4
9931 #include <sys/types.h>
9938 printf("%d\n", (int)sizeof($fpostype));
9943 if eval $compile_ok; then
9948 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9951 echo " $fpossize bytes." >&4
9957 echo "(I can't compile the test program. Guessing...)" >&4
9958 rp="What is the size of your file positions (in bytes)?"
9967 : Check if we want perlio
9970 : Set the vendorbin variables
9971 case "$vendorprefix" in
9972 '') d_vendorbin="$undef"
9976 *) d_vendorbin="$define"
9977 : determine where vendor-supplied executables go.
9978 case "$vendorbin" in
9979 '') dflt=$vendorprefix/bin ;;
9980 *) dflt="$vendorbin" ;;
9983 rp='Pathname for the vendor-supplied executables directory?'
9986 vendorbinexp="$ansexp"
9992 : Set the vendorhtml1dir variables
9993 case "$vendorprefix" in
9994 '') vendorhtml1dir=''
9995 vendorhtml1direxp=''
9997 *) : determine where vendor-supplied html pages go.
9998 : There is no standard location, so try to copy the previously-selected
9999 : directory structure for the core html pages.
10000 : XXX Better default suggestions would be welcome.
10001 case "$vendorhtml1dir" in
10002 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10003 *) dflt=$vendorhtml1dir ;;
10006 ''|' ') dflt=none ;;
10009 rp='Pathname for the vendor-supplied html pages?'
10011 vendorhtml1dir="$ans"
10012 vendorhtml1direxp="$ansexp"
10015 : Use ' ' for none so value is preserved next time through Configure
10016 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
10017 prefixvar=vendorhtml1dir
10020 : Set the vendorhtml3dir variables
10021 case "$vendorprefix" in
10022 '') vendorhtml3dir=''
10023 vendorhtml3direxp=''
10025 *) : determine where vendor-supplied module html pages go.
10026 : There is no standard location, so try to copy the previously-selected
10027 : directory structure for the core html pages.
10028 : XXX Better default suggestions would be welcome.
10029 case "$vendorhtml3dir" in
10030 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10031 *) dflt=$vendorhtml3dir ;;
10034 ''|' ') dflt=none ;;
10037 rp='Pathname for the vendor-supplied html pages?'
10039 vendorhtml3dir="$ans"
10040 vendorhtml3direxp="$ansexp"
10043 : Use ' ' for none so value is preserved next time through Configure
10044 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10045 prefixvar=vendorhtml3dir
10048 : Set the vendorman1dir variables
10049 case "$vendorprefix" in
10050 '') vendorman1dir=''
10051 vendorman1direxp=''
10053 *) : determine where vendor-supplied manual pages go.
10054 case "$vendorman1dir" in
10055 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10056 *) dflt=$vendorman1dir ;;
10059 ''|' ') dflt=none ;;
10062 rp='Pathname for the vendor-supplied manual section 1 pages?'
10064 vendorman1dir="$ans"
10065 vendorman1direxp="$ansexp"
10068 : Use ' ' for none so value is preserved next time through Configure
10069 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10070 prefixvar=vendorman1dir
10073 : Set the vendorman3dir variables
10074 case "$vendorprefix" in
10075 '') vendorman3dir=''
10076 vendorman3direxp=''
10078 *) : determine where vendor-supplied module manual pages go.
10079 case "$vendorman3dir" in
10080 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10081 *) dflt=$vendorman3dir ;;
10084 ''|' ') dflt=none ;;
10087 rp='Pathname for the vendor-supplied manual section 3 pages?'
10089 vendorman3dir="$ans"
10090 vendorman3direxp="$ansexp"
10093 : Use ' ' for none so value is preserved next time through Configure
10094 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10095 prefixvar=vendorman3dir
10098 : Set the vendorscript variables
10099 case "$vendorprefix" in
10100 '') d_vendorscript="$undef"
10104 *) d_vendorscript="$define"
10105 : determine where vendor-supplied scripts go.
10106 case "$vendorscript" in
10107 '') dflt=$vendorprefix/script
10108 $test -d $dflt || dflt=$vendorbin ;;
10109 *) dflt="$vendorscript" ;;
10113 The installation process will create a directory for
10114 vendor-supplied scripts.
10118 rp='Pathname for the vendor-supplied scripts directory?'
10120 vendorscript="$ans"
10121 vendorscriptexp="$ansexp"
10124 prefixvar=vendorscript
10127 : script used to emit important warnings
10130 if test \$# -gt 0; then
10135 echo "*** WARNING:" >&4
10136 sed -e 's/^/*** /' <msg >&4
10138 cat msg >>config.msg
10139 echo " " >>config.msg
10145 : see which of string.h or strings.h is needed
10147 strings=`./findhdr string.h`
10148 if $test "$strings" && $test -r "$strings"; then
10149 echo "Using <string.h> instead of <strings.h>." >&4
10153 strings=`./findhdr strings.h`
10154 if $test "$strings" && $test -r "$strings"; then
10155 echo "Using <strings.h> instead of <string.h>." >&4
10157 ./warn "No string header found -- You'll surely have problems."
10162 case "$i_string" in
10163 "$undef") strings=`./findhdr strings.h`;;
10164 *) strings=`./findhdr string.h`;;
10167 : see if qgcvt exists
10171 : Check what kind of doubles your system has
10172 $echo "Checking the kind of doubles you have..." >&4
10174 #$i_stdlib I_STDLIB
10175 #define DOUBLESIZE $doublesize
10177 #include <stdlib.h>
10180 static const double d = -0.1;
10182 unsigned const char* b = (unsigned const char*)(&d);
10183 #if DOUBLESIZE == 4
10184 if (b[0] == 0xCD && b[3] == 0xBD) {
10185 /* IEEE 754 32-bit little-endian */
10189 if (b[0] == 0xBD && b[3] == 0xCD) {
10190 /* IEEE 754 32-bit big-endian */
10194 if (b[0] == 0xCC && b[3] == 0xCC) {
10195 /* VAX format F, 32-bit PDP-style mixed endian. */
10199 if (b[0] == 0xC0 && b[3] == 0x9A) {
10200 /* IBM single 32-bit */
10205 #if DOUBLESIZE == 8
10206 if (b[0] == 0x9A && b[7] == 0xBF) {
10207 /* IEEE 754 64-bit little-endian */
10211 if (b[0] == 0xBF && b[7] == 0x9A) {
10212 /* IEEE 754 64-bit big-endian */
10216 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10217 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10218 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10219 * 99 99 b9 bf 9a 99 99 99 */
10223 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10224 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10225 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10226 * 99 99 99 9a bf b9 99 99 */
10230 if (b[0] == 0xCC && b[7] == 0xCC) {
10231 /* VAX format D, 64-bit PDP-style mixed endian. */
10235 if (b[0] == 0xD9 && b[7] == 0x99) {
10236 /* VAX format G, 64-bit PDP-style mixed endian. */
10240 if (b[0] == 0xC0 && b[7] == 0x9A) {
10241 /* IBM double 64-bit */
10245 if (b[0] == 0xBF && b[7] == 0xCD) {
10246 /* CRAY single 64-bit */
10251 #if DOUBLESIZE == 16
10252 if (b[0] == 0x9A && b[15] == 0xBF) {
10253 /* IEEE 754 128-bit little-endian */
10257 if (b[0] == 0xBF && b[15] == 0x9A) {
10258 /* IEEE 754 128-bit big-endian */
10263 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10264 * Whether those environments can still build Perl is debatable. */
10265 printf("-1\n"); /* unknown */
10270 if eval $compile; then
10271 doublekind=`$run ./try`
10275 case "$doublekind" in
10276 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10277 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10278 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10279 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10280 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10281 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10282 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10283 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10284 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10285 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10286 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10287 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10288 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10289 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10290 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10292 d_double_style_ieee=$undef
10293 d_double_style_vax=$undef
10294 d_double_style_ibm=$undef
10295 d_double_style_cray=$undef
10296 case "$doublekind" in
10297 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10298 9|10|11) d_double_style_vax=$define ;;
10299 12|13) d_double_style_ibm=$define ;;
10300 14) d_double_style_cray=$define ;;
10302 case "$d_double_style_ieee" in
10304 d_double_has_inf=$define
10305 d_double_has_nan=$define
10306 d_double_has_negative_zero=$define
10307 d_double_has_subnormals=$define
10310 d_double_has_inf=$undef
10311 d_double_has_nan=$undef
10312 d_double_has_negative_zero=$undef
10313 d_double_has_subnormals=$undef
10318 : Check print/scan long double stuff
10321 if $test X"$d_longdbl" = X"$define"; then
10323 echo "Checking how to print long doubles..." >&4
10325 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10326 $cat >try.c <<'EOCP'
10327 #include <sys/types.h>
10330 double d = 123.456;
10331 printf("%.3f\n", d);
10335 if eval $compile; then
10339 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10340 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10341 echo "We will use %f."
10347 if $test X"$sPRIfldbl" = X; then
10348 $cat >try.c <<'EOCP'
10349 #include <sys/types.h>
10352 long double d = 123.456;
10353 printf("%.3Lf\n", d);
10357 if eval $compile; then
10361 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10362 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10363 echo "We will use %Lf."
10369 if $test X"$sPRIfldbl" = X; then
10370 $cat >try.c <<'EOCP'
10371 #include <sys/types.h>
10374 long double d = 123.456;
10375 printf("%.3llf\n", d);
10379 if eval $compile; then
10383 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10384 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10385 echo "We will use %llf."
10391 if $test X"$sPRIfldbl" = X; then
10392 $cat >try.c <<'EOCP'
10393 #include <sys/types.h>
10396 long double d = 123.456;
10397 printf("%.3lf\n", d);
10401 if eval $compile; then
10405 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10406 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10407 echo "We will use %lf."
10413 if $test X"$sPRIfldbl" = X; then
10414 echo "Cannot figure out how to print long doubles." >&4
10416 sSCNfldbl=$sPRIfldbl # expect consistency
10423 case "$sPRIfldbl" in
10424 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10425 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10426 d_SCNfldbl="$undef";
10428 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10429 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10430 d_SCNfldbl="$define";
10434 : Before committing on uselongdouble, see whether that looks sane.
10435 if $test "$uselongdouble" = "$define"; then
10438 echo "Checking if your long double math functions work right..." >&4
10443 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10446 case "$osname:$gccversion" in
10447 aix:) saveccflags="$ccflags"
10448 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10451 if eval $compile_ok; then
10455 3) echo "Your long double math functions are working correctly." >&4 ;;
10456 *) echo "Your long double math functions are broken, not using long doubles." >&4
10457 uselongdouble=$undef
10461 case "$osname:$gccversion" in
10462 aix:) ccflags="$saveccflags" ;; # restore
10466 : Check how to convert floats to strings.
10468 if test "X$d_Gconvert" = X; then
10471 echo "Checking for an efficient way to convert floats to strings."
10473 case "$uselongdouble" in
10474 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10476 case "$d_longdbl" in
10477 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10479 case "$d_PRIgldbl" in
10480 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10483 #ifdef TRY_gconvert
10484 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10485 char *myname = "gconvert";
10488 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10489 char *myname = "gcvt";
10492 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10493 char *myname = "qgcvt";
10494 #define DOUBLETYPE long double
10497 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10498 #ifdef HAS_PRIgldbl
10499 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10501 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10504 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10506 char *myname = "sprintf";
10510 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10511 #define DOUBLETYPE long double
10513 #define DOUBLETYPE double
10519 #$i_stdlib I_STDLIB
10521 #include <stdlib.h>
10523 #$i_string I_STRING
10525 # include <string.h>
10527 # include <strings.h>
10530 int checkit(char *expect, char *got)
10532 if (strcmp(expect, got)) {
10533 printf("%s oddity: Expected %s, got %s\n",
10534 myname, expect, got);
10544 /* This must be 1st test on (which?) platform */
10545 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10546 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10547 checkit("0.1", buf);
10549 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10550 checkit("0.01", buf);
10552 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10553 checkit("0.001", buf);
10555 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10556 checkit("0.0001", buf);
10558 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10559 if (strlen(buf) > 5)
10560 checkit("9e-005", buf); /* for Microsoft ?? */
10562 checkit("9e-05", buf);
10564 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10567 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10568 checkit("1.1", buf);
10570 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10571 checkit("1.01", buf);
10573 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10574 checkit("1.001", buf);
10576 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10577 checkit("1.0001", buf);
10579 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10580 checkit("1.00001", buf);
10582 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10583 checkit("1.000001", buf);
10585 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10588 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10589 checkit("-1", buf);
10591 /* Some Linux gcvt's give 1.e+5 here. */
10592 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10593 checkit("100000", buf);
10595 /* Some Linux gcvt's give -1.e+5 here. */
10596 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10597 checkit("-100000", buf);
10599 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10600 checkit("123.456", buf);
10602 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10603 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10604 /* 34 should be enough to scare even long double
10605 * places into using the e notation. */
10606 if (strlen(buf) > 5)
10607 checkit("1e+034", buf); /* for Microsoft */
10609 checkit("1e+34", buf);
10611 /* For Perl, if you add additional tests here, also add them to
10612 * t/base/num.t for benefit of platforms not using Configure or
10613 * overriding d_Gconvert */
10618 : first add preferred functions to our list
10620 for xxx_convert in $gconvert_preference; do
10621 case $xxx_convert in
10622 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10623 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10626 : then add any others
10627 for xxx_convert in gconvert gcvt sprintf; do
10628 case "$xxx_list" in
10630 *) xxx_list="$xxx_list $xxx_convert" ;;
10634 case "$d_longdbl$uselongdouble" in
10636 : again, add preferred functions to our list first
10638 for xxx_convert in $gconvert_ld_preference; do
10639 case $xxx_convert in
10640 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10641 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10644 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10645 for xxx_convert in qgcvt sprintf $xxx_list; do
10646 case "$xxx_ld_list" in
10647 $xxx_convert*|*" $xxx_convert"*) ;;
10648 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10651 : if sprintf cannot do long doubles, move it to the end
10652 if test "$d_PRIgldbl" != "$define"; then
10653 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10655 : if no qgcvt, remove it
10656 if test "$d_qgcvt" != "$define"; then
10657 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10660 xxx_list="$xxx_ld_list"
10664 for xxx_convert in $xxx_list; do
10665 echo "Trying $xxx_convert..."
10666 $rm -f try try$_o core
10667 set try -DTRY_$xxx_convert
10668 if eval $compile; then
10669 echo "$xxx_convert() found." >&4
10670 if $run ./try; then
10671 echo "I'll use $xxx_convert to convert floats into a string." >&4
10674 echo "...But $xxx_convert didn't work as I expected."
10678 echo "$xxx_convert NOT found." >&4
10682 if test X$xxx_convert = X; then
10683 echo "*** WHOA THERE!!! ***" >&4
10684 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10685 xxx_convert=sprintf
10688 case "$xxx_convert" in
10689 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10690 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10691 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10692 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10693 "$define$define$define")
10694 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10695 "$define$define$undef")
10696 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10697 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10705 : see if _fwalk exists
10709 : Initialize h_fcntl
10712 : Initialize h_sysfile
10715 : access call always available on UNIX
10716 set access d_access
10719 : locate the flags for 'access()'
10720 case "$d_access" in
10723 $cat >access.c <<EOCP
10724 #include <sys/types.h>
10729 #include <sys/file.h>
10732 #include <unistd.h>
10734 #$i_stdlib I_STDLIB
10736 #include <stdlib.h>
10742 : check sys/file.h first, no particular reason here
10743 if $test `./findhdr sys/file.h` && \
10744 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10746 echo "<sys/file.h> defines the *_OK access constants." >&4
10747 elif $test `./findhdr fcntl.h` && \
10748 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10750 echo "<fcntl.h> defines the *_OK access constants." >&4
10751 elif $test `./findhdr unistd.h` && \
10752 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10753 echo "<unistd.h> defines the *_OK access constants." >&4
10755 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10761 : see if accessx exists
10762 set accessx d_accessx
10765 : see if acosh exists
10769 : see if aintl exists
10773 : see if alarm exists
10777 : see if 64bit time functions exists
10779 set ctime64 d_ctime64
10782 set localtime64 d_localtime64
10785 set gmtime64 d_gmtime64
10788 set mktime64 d_mktime64
10791 set difftime64 d_difftime64
10794 set asctime64 d_asctime64
10797 : see if POSIX threads are available
10798 set pthread.h i_pthread
10801 : define a function to check prototypes
10802 $cat > protochk <<EOSH
10805 optimize="$optimize"
10807 prototype="$prototype"
10810 usethreads=$usethreads
10811 i_pthread=$i_pthread
10812 pthread_h_first=$pthread_h_first
10815 $cat >> protochk <<'EOSH'
10820 while test $# -ge 2; do
10822 $define) echo "#include <$2>" >> try.c ;;
10823 literal) echo "$2" >> try.c ;;
10825 # Extra magic for the benefit of systems that need pthread.h
10826 # to be included early to correctly detect threadsafe functions.
10827 # Such functions must guarantee themselves, though, that the usethreads
10828 # and i_pthread have been defined, before calling protochk.
10829 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10830 echo "#include <pthread.h>" >> try.c
10835 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10836 cat >> try.c <<'EOCP'
10837 #ifdef CAN_PROTOTYPE
10838 #define _(args) args
10843 echo "$foo" >> try.c
10844 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10845 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10851 $eunicefix protochk
10853 : Define hasproto macro for Configure internal use
10854 hasproto='varname=$1; func=$2; shift; shift;
10855 while $test $# -ge 2; do
10857 $define) echo "#include <$2>";;
10861 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10862 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10863 echo "$func() prototype found.";
10866 echo "$func() prototype NOT found.";
10873 : see if sys/types.h has to be included
10874 set sys/types.h i_systypes
10877 : see if sys/select.h has to be included
10878 set sys/select.h i_sysselct
10881 : Define hasfield macro for Configure internal use
10882 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10883 while $test $# -ge 2; do
10885 $define) echo "#include <$2>";;
10889 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10891 if eval $compile; then
10900 : see if we should include time.h, sys/time.h, or both
10902 if test "X$timeincl" = X; then
10903 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10904 $echo $n "I'm now running the test program...$c"
10906 #include <sys/types.h>
10911 #ifdef SYSTIMEKERNEL
10914 #include <sys/time.h>
10917 #include <sys/select.h>
10919 #$i_stdlib I_STDLIB
10921 #include <stdlib.h>
10927 struct timeval bar;
10930 struct timezone tzp;
10932 if (foo.tm_sec == foo.tm_sec)
10935 if (bar.tv_sec == bar.tv_sec)
10942 for s_timezone in '-DS_TIMEZONE' ''; do
10944 for s_timeval in '-DS_TIMEVAL' ''; do
10945 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10946 for i_time in '' '-DI_TIME'; do
10947 for i_systime in '-DI_SYSTIME' ''; do
10950 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10951 if eval $compile; then
10952 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10956 $echo $n "Succeeded with $flags$c"
10968 *SYSTIMEKERNEL*) i_systimek="$define"
10969 timeincl=`./findhdr sys/time.h`
10970 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10971 *) i_systimek="$undef";;
10974 *I_TIME*) i_time="$define"
10975 timeincl=`./findhdr time.h`" $timeincl"
10976 echo "We'll include <time.h>." >&4;;
10977 *) i_time="$undef";;
10980 *I_SYSTIME*) i_systime="$define"
10981 timeincl=`./findhdr sys/time.h`" $timeincl"
10982 echo "We'll include <sys/time.h>." >&4;;
10983 *) i_systime="$undef";;
10987 : see if struct tm knows about tm_zone
10988 case "$i_systime$i_time" in
10991 echo "Checking to see if your struct tm has tm_zone field..." >&4
10992 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
11000 case "$d_tm_tm_zone" in
11001 "$define") echo "Yes, it does." ;;
11002 *) echo "No, it doesn't." ;;
11004 : see if struct tm knows about tm_gmtoff
11005 case "$i_systime$i_time" in
11008 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
11009 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
11017 case "$d_tm_tm_gmtoff" in
11018 "$define") echo "Yes, it does." ;;
11019 *) echo "No, it doesn't." ;;
11022 : see if asctime_r exists
11023 set asctime_r d_asctime_r
11025 case "$d_asctime_r" in
11027 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11028 case "$d_asctime_r_proto:$usethreads" in
11029 ":define") d_asctime_r_proto=define
11030 set d_asctime_r_proto asctime_r $hdrs
11034 case "$d_asctime_r_proto" in
11036 case "$asctime_r_proto" in
11037 ''|0) try='char* asctime_r(const struct tm*, char*);'
11038 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
11040 case "$asctime_r_proto" in
11041 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
11042 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
11044 case "$asctime_r_proto" in
11045 ''|0) try='int asctime_r(const struct tm*, char*);'
11046 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
11048 case "$asctime_r_proto" in
11049 ''|0) try='int asctime_r(const struct tm*, char*, int);'
11050 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
11052 case "$asctime_r_proto" in
11053 ''|0) d_asctime_r=undef
11055 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
11056 * ) case "$asctime_r_proto" in
11057 REENTRANT_PROTO*) ;;
11058 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
11060 echo "Prototype: $try" ;;
11063 *) case "$usethreads" in
11064 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11071 *) asctime_r_proto=0
11075 : see if asinh exists
11079 : see if atanh exists
11083 : see if atolf exists
11087 : see if atoll exists
11091 : Look for GCC-style attribute format
11092 case "$d_attribute_format" in
11095 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11096 $cat >attrib.c <<'EOCP'
11098 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11100 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11101 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11102 echo "Your C compiler doesn't support __attribute__((format))."
11105 echo "Your C compiler supports __attribute__((format))."
11109 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11113 *) val="$d_attribute_format" ;;
11115 set d_attribute_format
11119 : Look for GCC-style attribute format with null format allowed
11120 case "$d_printf_format_null" in
11121 '') case "$d_attribute_format" in
11124 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11125 $cat >attrib.c <<EOCP
11127 #$i_stdlib I_STDLIB
11129 #include <stdlib.h>
11131 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11132 int null_printf (char* pat,...) { return (int)pat; }
11133 int main () { exit(null_printf(NULL)); }
11135 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11136 : run the executable in case it produces a run-time warning
11137 if $run ./attrib >>attrib.out 2>&1; then
11138 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11139 echo "Your C compiler doesn't allow __printf__ format to be null."
11142 echo "Your C compiler allows __printf__ format to be null."
11146 echo "Your C compiler executable failed with __printf__ format null."
11150 echo "Your C compiler fails with __printf__ format null."
11157 *) val="$d_printf_format_null" ;;
11159 set d_printf_format_null
11163 : Look for GCC-style attribute malloc
11164 case "$d_attribute_malloc" in
11167 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11168 $cat >attrib.c <<'EOCP'
11170 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11172 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11173 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11174 echo "Your C compiler doesn't support __attribute__((malloc))."
11177 echo "Your C compiler supports __attribute__((malloc))."
11181 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11185 *) val="$d_attribute_malloc" ;;
11187 set d_attribute_malloc
11191 : Look for GCC-style attribute nonnull
11192 case "$d_attribute_nonnull" in
11195 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11196 $cat >attrib.c <<'EOCP'
11198 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11200 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11201 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11202 echo "Your C compiler doesn't support __attribute__((nonnull))."
11205 echo "Your C compiler supports __attribute__((nonnull))."
11209 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11213 *) val="$d_attribute_nonnull" ;;
11215 set d_attribute_nonnull
11219 : Look for GCC-style attribute noreturn
11220 case "$d_attribute_noreturn" in
11223 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11224 $cat >attrib.c <<'EOCP'
11226 void fall_over_dead( void ) __attribute__((noreturn));
11228 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11229 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11230 echo "Your C compiler doesn't support __attribute__((noreturn))."
11233 echo "Your C compiler supports __attribute__((noreturn))."
11237 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11241 *) val="$d_attribute_noreturn" ;;
11243 set d_attribute_noreturn
11247 : Look for GCC-style attribute pure
11248 case "$d_attribute_pure" in
11251 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11252 $cat >attrib.c <<'EOCP'
11254 int square( int n ) __attribute__((pure));
11256 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11257 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11258 echo "Your C compiler doesn't support __attribute__((pure))."
11261 echo "Your C compiler supports __attribute__((pure))."
11265 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11269 *) val="$d_attribute_pure" ;;
11271 set d_attribute_pure
11275 : Look for GCC-style attribute unused
11276 case "$d_attribute_unused" in
11279 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11280 $cat >attrib.c <<'EOCP'
11282 int do_something( int dummy __attribute__((unused)), int n );
11284 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11285 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11286 echo "Your C compiler doesn't support __attribute__((unused))."
11289 echo "Your C compiler supports __attribute__((unused))."
11293 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11297 *) val="$d_attribute_unused" ;;
11299 set d_attribute_unused
11303 : Look for GCC-style attribute deprecated
11304 case "$d_attribute_deprecated" in
11307 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11308 $cat >attrib.c <<'EOCP'
11310 int I_am_deprecated(void) __attribute__((deprecated));
11312 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11313 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11314 echo "Your C compiler doesn't support __attribute__((deprecated))."
11317 echo "Your C compiler supports __attribute__((deprecated))."
11321 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11325 *) val="$d_attribute_deprecated" ;;
11327 set d_attribute_deprecated
11331 : Look for GCC-style attribute warn_unused_result
11332 case "$d_attribute_warn_unused_result" in
11335 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11336 $cat >attrib.c <<'EOCP'
11338 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11340 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11341 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11342 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11345 echo "Your C compiler supports __attribute__((warn_unused_result))."
11349 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11353 *) val="$d_attribute_warn_unused_result" ;;
11355 set d_attribute_warn_unused_result
11359 : see if bcmp exists
11363 : see if bcopy exists
11367 : see if getpgrp exists
11368 set getpgrp d_getpgrp
11371 case "$d_getpgrp" in
11374 echo "Checking to see which flavor of getpgrp is in use..."
11376 #$i_unistd I_UNISTD
11377 #include <sys/types.h>
11379 # include <unistd.h>
11381 #$i_stdlib I_STDLIB
11383 #include <stdlib.h>
11387 if (getuid() == 0) {
11388 printf("(I see you are running Configure as super-user...)\n");
11391 #ifdef TRY_BSD_PGRP
11392 if (getpgrp(1) == 0)
11401 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11402 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11404 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11405 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11408 echo "I can't seem to compile and run the test program."
11410 xxx="a USG one, i.e. you use getpgrp()."
11412 # SVR4 systems can appear rather BSD-ish.
11413 case "$i_unistd" in
11415 xxx="a BSD one, i.e. you use getpgrp(pid)."
11419 xxx="probably a USG one, i.e. you use getpgrp()."
11424 echo "Assuming your getpgrp is $xxx" >&4
11433 : see if setpgrp exists
11434 set setpgrp d_setpgrp
11437 case "$d_setpgrp" in
11440 echo "Checking to see which flavor of setpgrp is in use..."
11442 #$i_unistd I_UNISTD
11443 #include <sys/types.h>
11445 # include <unistd.h>
11447 #$i_stdlib I_STDLIB
11449 #include <stdlib.h>
11453 if (getuid() == 0) {
11454 printf("(I see you are running Configure as super-user...)\n");
11457 #ifdef TRY_BSD_PGRP
11458 if (-1 == setpgrp(1, 1))
11461 if (setpgrp() != -1)
11467 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11468 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11470 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11471 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11474 echo "(I can't seem to compile and run the test program.)"
11476 xxx="a USG one, i.e. you use setpgrp()."
11478 # SVR4 systems can appear rather BSD-ish.
11479 case "$i_unistd" in
11481 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11485 xxx="probably a USG one, i.e. you use setpgrp()."
11490 echo "Assuming your setpgrp is $xxx" >&4
11499 : Look for GCC-style __builtin_choose_expr
11500 case "$d_builtin_choose_expr" in
11503 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11504 $cat >try.c <<'EOCP'
11505 #include <assert.h>
11506 #include <stdlib.h>
11509 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11512 assert( SYRINX(1) == 2112 );
11513 assert( SYRINX(1) != 5150 );
11514 assert( SYRINX(0) == 5150 );
11515 assert( SYRINX(0) != 2112 );
11516 puts( "All good!" );
11522 if eval $compile && $run ./try; then
11523 echo "Your C compiler supports __builtin_choose_expr."
11526 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11530 *) val="$d_builtin_choose_expr" ;;
11533 set d_builtin_choose_expr
11537 : Look for GCC-style __builtin_expect
11538 case "$d_builtin_expect" in
11541 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11542 $cat >try.c <<'EOCP'
11545 if ( __builtin_expect(n, 0) ) n = 1;
11546 /* Remember shell exit code truth is 0, C truth is non-zero */
11551 if eval $compile && $run ./try; then
11552 echo "Your C compiler supports __builtin_expect."
11555 echo "Your C compiler doesn't seem to understand __builtin_expect."
11559 *) val="$d_builtin_expect" ;;
11562 set d_builtin_expect
11566 : see if bzero exists
11570 : see if stdarg is available
11572 if $test `./findhdr stdarg.h`; then
11573 echo "<stdarg.h> found." >&4
11576 echo "<stdarg.h> NOT found." >&4
11580 : see if varargs is available
11582 if $test `./findhdr varargs.h`; then
11583 echo "<varargs.h> found." >&4
11585 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11588 : set up the varargs testing programs
11589 $cat > varargs.c <<EOP
11591 #include <stdarg.h>
11594 #include <varargs.h>
11598 int f(char *p, ...)
11612 p = va_arg(ap, char *);
11618 $cat > varargs <<EOP
11620 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11629 : now check which varargs header should be included
11635 if `./varargs I_STDARG`; then
11637 elif `./varargs I_VARARGS`; then
11642 if `./varargs I_VARARGS`; then
11650 echo "*** WHOA THERE!!! ***" >&4
11651 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11652 case "$knowitall" in
11654 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11658 echo "I could not find the definition for va_dcl... You have problems..." >&4
11659 val="$undef"; set i_stdarg; eval $setvar
11660 val="$undef"; set i_varargs; eval $setvar
11665 case "$i_varhdr" in
11667 val="$define"; set i_stdarg; eval $setvar
11668 val="$undef"; set i_varargs; eval $setvar
11671 val="$undef"; set i_stdarg; eval $setvar
11672 val="$define"; set i_varargs; eval $setvar
11675 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11679 : see if the Compiler supports C99 variadic macros
11680 case "$i_stdarg$i_stdlib" in
11682 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11685 #include <stdarg.h>
11687 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11691 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11697 if eval $compile && $run ./try 2>&1 >/dev/null; then
11698 case "`$run ./try`" in
11700 echo "You have C99 variadic macros." >&4
11701 d_c99_variadic_macros="$define"
11704 echo "You don't have functional C99 variadic macros." >&4
11705 d_c99_variadic_macros="$undef"
11709 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11710 d_c99_variadic_macros="$undef"
11715 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11716 d_c99_variadic_macros="$undef"
11720 : see if signal is declared as pointer to function returning int or void
11722 xxx=`./findhdr signal.h`
11723 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11724 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11725 echo "You have int (*signal())() instead of void." >&4
11727 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11728 echo "You have void (*signal())()." >&4
11730 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11731 echo "You have int (*signal())() instead of void." >&4
11733 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11734 echo "You have void (*signal())()." >&4
11737 case "$d_voidsig" in
11739 echo "I can't determine whether signal handler returns void or int..." >&4
11741 rp="What type does your signal handler return?"
11744 v*) val="$define";;
11748 echo "As you already told me, signal handler returns void." >&4
11751 *) echo "As you already told me, signal handler returns int." >&4
11758 case "$d_voidsig" in
11759 "$define") signal_t="void";;
11760 *) signal_t="int";;
11764 : check for ability to cast large floats to 32-bit ints.
11766 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11767 if $test "$intsize" -ge 4; then
11774 #$i_stdlib I_STDLIB
11776 #include <stdlib.h>
11778 #include <sys/types.h>
11779 #include <signal.h>
11780 $signal_t blech(int s) { exit(3); }
11787 signal(SIGFPE, blech);
11789 /* Don't let compiler optimize the test away. Store the number
11790 in a writable string for gcc to pass to sscanf under HP-UX.
11792 sprintf(str, "2147483647");
11793 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11797 /* x86 processors will probably give 0x8000 0000, which is a
11798 sign change. We don't want that. We want to mimic SPARC
11799 behavior here, which is to preserve the sign and give
11802 if (i32 != ($xxx) f)
11808 if eval $compile_ok; then
11809 $run ./try 2>/dev/null
11812 echo "(I can't seem to compile the test program--assuming it can't)"
11817 echo "Yup, it can."
11820 echo "Nope, it can't."
11827 : check for ability to cast negative floats to unsigned
11829 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11832 #$i_stdlib I_STDLIB
11834 #include <stdlib.h>
11836 #include <sys/types.h>
11837 #include <signal.h>
11838 $signal_t blech(int s) { exit(7); }
11839 $signal_t blech_in_list(int s) { exit(4); }
11840 unsigned long dummy_long(unsigned long p) { return p; }
11841 unsigned int dummy_int(unsigned int p) { return p; }
11842 unsigned short dummy_short(unsigned short p) { return p; }
11846 unsigned long along;
11848 unsigned short ashort;
11852 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11853 a direct f = -123. assignment. gcc-2.8.0 reportedly
11854 optimized the whole file away
11856 /* Store the number in a writable string for gcc to pass to
11857 sscanf under HP-UX.
11859 sprintf(str, "-123");
11860 sscanf(str, "%lf", &f); /* f = -123.; */
11862 signal(SIGFPE, blech);
11863 along = (unsigned long)f;
11864 aint = (unsigned int)f;
11865 ashort = (unsigned short)f;
11866 if (along != (unsigned long)-123)
11868 if (aint != (unsigned int)-123)
11870 if (ashort != (unsigned short)-123)
11872 sprintf(str, "1073741824.");
11873 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11876 along = (unsigned long)f;
11877 if (along != 0x80000000)
11881 along = (unsigned long)f;
11882 if (along != 0x7fffffff)
11886 along = (unsigned long)f;
11887 if (along != 0x80000001)
11891 signal(SIGFPE, blech_in_list);
11892 sprintf(str, "123.");
11893 sscanf(str, "%lf", &f); /* f = 123.; */
11894 along = dummy_long((unsigned long)f);
11895 aint = dummy_int((unsigned int)f);
11896 ashort = dummy_short((unsigned short)f);
11897 if (along != (unsigned long)123)
11899 if (aint != (unsigned int)123)
11901 if (ashort != (unsigned short)123)
11908 if eval $compile_ok; then
11909 $run ./try 2>/dev/null
11912 echo "(I can't seem to compile the test program--assuming it can't)"
11915 case "$castflags" in
11917 echo "Yup, it can."
11920 echo "Nope, it can't."
11927 : see if cbrt exists
11931 : see if vprintf exists
11933 if set vprintf val -f d_vprintf; eval $csym; $val; then
11934 echo 'vprintf() found.' >&4
11937 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11938 #$i_varargs I_VARARGS
11940 #$i_stdlib I_STDLIB
11941 #$i_unistd I_UNISTD
11944 # include <stdarg.h>
11945 #else /* I_VARARGS */
11946 # include <varargs.h>
11950 # include <unistd.h>
11954 # include <stdlib.h>
11957 #include <stdio.h> /* vsprintf prototype */
11960 void xxx(int n, ...)
11965 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11967 int main() { xxx(1, "foo"); }
11969 #else /* I_VARARGS */
11977 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11979 int main() { xxx("foo"); }
11985 if eval $compile_ok; then
11986 if $run ./try; then
11987 echo "Your vsprintf() returns (int)." >&4
11990 echo "Your vsprintf() returns (char*)." >&4
11994 echo 'I am unable to compile the vsprintf() test program.' >&4
11995 # We shouldn't get here. If we do, assume the standard signature,
11996 # not the old BSD one.
11997 echo 'Guessing that vsprintf() returns (int).' >&4
12001 echo 'vprintf() NOT found.' >&4
12012 : see if chown exists
12016 : see if chroot exists
12017 set chroot d_chroot
12020 : see if chsize exists
12021 set chsize d_chsize
12024 : see if class exists
12028 : see if clearenv exists
12029 set clearenv d_clearenv
12032 : Define hasstruct macro for Configure internal use
12033 hasstruct='varname=$1; struct=$2; shift; shift;
12034 while $test $# -ge 2; do
12036 $define) echo "#include <$2>";;
12040 echo "int main () { struct $struct foo; }" >> try.c;
12042 if eval $compile; then
12051 : see whether socket exists
12055 $echo $n "Hmm... $c" >&4
12056 if set socket val -f d_socket; eval $csym; $val; then
12057 echo "Looks like you have Berkeley networking support." >&4
12059 if set setsockopt val -f; eval $csym; $val; then
12062 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
12063 d_oldsock="$define"
12066 if $contains socklib libc.list >/dev/null 2>&1; then
12067 echo "Looks like you have Berkeley networking support." >&4
12069 : we will have to assume that it supports the 4.2 BSD interface
12072 echo "You don't have Berkeley networking in libc$_a..." >&4
12073 if test "X$d_socket" = "X$define"; then
12074 echo "...but you seem to believe that you have sockets." >&4
12076 for net in net socket
12078 if test -f $sysroot/usr/lib/lib$net$_a; then
12079 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12080 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12081 if $contains socket libc.list >/dev/null 2>&1; then
12086 echo "...but the Wollongong group seems to have hacked it in." >&4
12087 sockethdr="-I$sysroot/usr/netinclude"
12090 echo "Found Berkeley sockets interface in lib$net." >&4
12091 if $contains setsockopt libc.list >/dev/null 2>&1; then
12094 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12095 d_oldsock="$define"
12101 if test "X$d_socket" != "X$define"; then
12102 echo "or anywhere else I see." >&4
12110 : see if socketpair exists
12111 set socketpair d_sockpair
12116 echo "Checking the availability sa_len in the sock struct ..." >&4
12118 #include <sys/types.h>
12119 #include <sys/socket.h>
12121 struct sockaddr sa;
12122 return (sa.sa_len);
12126 set try; if eval $compile; then
12129 set d_sockaddr_sa_len; eval $setvar
12133 echo "Checking the availability struct sockaddr_in6 ..." >&4
12135 #include <sys/types.h>
12136 #include <sys/socket.h>
12137 #include <netinet/in.h>
12139 struct sockaddr_in6 sin6;
12140 return (sin6.sin6_family);
12144 set try; if eval $compile; then
12147 set d_sockaddr_in6; eval $setvar
12151 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12153 #include <sys/types.h>
12154 #include <sys/socket.h>
12155 #include <netinet/in.h>
12157 struct sockaddr_in6 sin6;
12158 return (sin6.sin6_scope_id);
12162 set try; if eval $compile; then
12165 set d_sin6_scope_id; eval $setvar
12169 echo "Checking the availability struct ip_mreq ..." >&4
12171 #include <sys/types.h>
12172 #include <sys/socket.h>
12173 #include <netinet/in.h>
12175 struct ip_mreq mreq;
12176 return (mreq.imr_multiaddr.s_addr);
12180 set try; if eval $compile; then
12183 set d_ip_mreq; eval $setvar
12187 echo "Checking the availability struct ip_mreq_source ..." >&4
12189 #include <sys/types.h>
12190 #include <sys/socket.h>
12191 #include <netinet/in.h>
12193 struct ip_mreq_source mreq;
12194 return (mreq.imr_multiaddr.s_addr);
12198 set try; if eval $compile; then
12201 set d_ip_mreq_source; eval $setvar
12205 echo "Checking the availability struct ipv6_mreq ..." >&4
12207 #include <sys/types.h>
12208 #include <sys/socket.h>
12209 #include <netinet/in.h>
12211 struct ipv6_mreq mreq;
12212 return (mreq.ipv6mr_interface);
12216 set try; if eval $compile; then
12219 set d_ipv6_mreq; eval $setvar
12223 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12225 #include <sys/types.h>
12226 #include <sys/socket.h>
12227 #include <netinet/in.h>
12229 struct ipv6_mreq_source mreq;
12230 return (mreq.imr_multiaddr.s_addr);
12234 set try; if eval $compile; then
12237 set d_ipv6_mreq_source; eval $setvar
12241 echo "Checking the availability of certain socket constants..." >&4
12242 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12243 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12245 #include <sys/types.h>
12246 #include <sys/socket.h>
12252 set try; if eval $compile; then
12255 set d_${enum}; eval $setvar
12259 : see if this is a sys/uio.h system
12260 set sys/uio.h i_sysuio
12263 : Check for cmsghdr support
12265 echo "Checking to see if your system supports struct cmsghdr..." >&4
12266 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12268 case "$d_cmsghdr_s" in
12269 "$define") echo "Yes, it does." ;;
12270 *) echo "No, it doesn't." ;;
12274 : check for const keyword
12276 echo 'Checking to see if your C compiler knows about "const"...' >&4
12277 $cat >const.c <<'EOCP'
12278 typedef struct spug { int drokk; } spug;
12282 const spug y = { 0 };
12285 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12287 echo "Yup, it does."
12290 echo "Nope, it doesn't."
12295 : see if copysign exists
12296 set copysign d_copysign
12299 : see if copysignl exists
12300 set copysignl d_copysignl
12303 : see if crypt exists
12308 $define) cryptlib='' ;;
12309 *) if set crypt val -f d_crypt; eval $csym; $val; then
12310 echo 'crypt() found.' >&4
12314 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12315 if $test -z "$cryptlib"; then
12316 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12320 if $test -z "$cryptlib"; then
12321 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12325 if $test -z "$cryptlib"; then
12326 cryptlib=`./loc libcrypt$_a "" $libpth`
12330 if $test -z "$cryptlib"; then
12331 echo 'crypt() NOT found.' >&4
12342 : see if this is a crypt.h system
12343 set crypt.h i_crypt
12346 : see if crypt_r exists
12347 set crypt_r d_crypt_r
12349 case "$d_crypt_r" in
12351 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12352 case "$d_crypt_r_proto:$usethreads" in
12353 ":define") d_crypt_r_proto=define
12354 set d_crypt_r_proto crypt_r $hdrs
12358 case "$d_crypt_r_proto" in
12360 case "$crypt_r_proto" in
12361 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12362 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12364 case "$crypt_r_proto" in
12365 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12366 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12368 case "$crypt_r_proto" in
12369 ''|0) d_crypt_r=undef
12371 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12372 * ) case "$crypt_r_proto" in
12373 REENTRANT_PROTO*) ;;
12374 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12376 echo "Prototype: $try" ;;
12379 *) case "$usethreads" in
12380 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12391 : get csh whereabouts
12393 'csh') val="$undef" ;;
12394 *) val="$define" ;;
12398 : Respect a hint or command line value for full_csh.
12399 case "$full_csh" in
12400 '') full_csh=$csh ;;
12403 : see if ctermid exists
12404 set ctermid d_ctermid
12407 : see if ctermid_r exists
12408 set ctermid_r d_ctermid_r
12410 case "$d_ctermid_r" in
12412 hdrs="$i_systypes sys/types.h define stdio.h "
12413 case "$d_ctermid_r_proto:$usethreads" in
12414 ":define") d_ctermid_r_proto=define
12415 set d_ctermid_r_proto ctermid_r $hdrs
12419 case "$d_ctermid_r_proto" in
12421 case "$ctermid_r_proto" in
12422 ''|0) try='char* ctermid_r(char*);'
12423 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12425 case "$ctermid_r_proto" in
12426 ''|0) d_ctermid_r=undef
12428 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12429 * ) case "$ctermid_r_proto" in
12430 REENTRANT_PROTO*) ;;
12431 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12433 echo "Prototype: $try" ;;
12436 *) case "$usethreads" in
12437 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12444 *) ctermid_r_proto=0
12448 : see if ctime_r exists
12449 set ctime_r d_ctime_r
12451 case "$d_ctime_r" in
12453 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12454 case "$d_ctime_r_proto:$usethreads" in
12455 ":define") d_ctime_r_proto=define
12456 set d_ctime_r_proto ctime_r $hdrs
12460 case "$d_ctime_r_proto" in
12462 case "$ctime_r_proto" in
12463 ''|0) try='char* ctime_r(const time_t*, char*);'
12464 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12466 case "$ctime_r_proto" in
12467 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12468 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12470 case "$ctime_r_proto" in
12471 ''|0) try='int ctime_r(const time_t*, char*);'
12472 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12474 case "$ctime_r_proto" in
12475 ''|0) try='int ctime_r(const time_t*, char*, int);'
12476 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12478 case "$ctime_r_proto" in
12479 ''|0) d_ctime_r=undef
12481 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12482 * ) case "$ctime_r_proto" in
12483 REENTRANT_PROTO*) ;;
12484 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12486 echo "Prototype: $try" ;;
12489 *) case "$usethreads" in
12490 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12501 : see if cuserid exists
12502 set cuserid d_cuserid
12505 : see if this is a limits.h system
12506 set limits.h i_limits
12509 : See if number of significant digits in a double precision number is known
12511 $cat >dbl_dig.c <<EOM
12512 #$i_limits I_LIMITS
12515 #include <limits.h>
12521 printf("Contains DBL_DIG");
12524 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12525 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12526 echo "DBL_DIG found." >&4
12529 echo "DBL_DIG NOT found." >&4
12536 : see if dbm.h is available
12537 : see if dbmclose exists
12538 set dbmclose d_dbmclose
12541 case "$d_dbmclose" in
12551 *) set rpcsvc/dbm.h i_rpcsvcdbm
12556 *) echo "We won't be including <dbm.h>"
12566 : see if prototype for dbminit is available
12568 set d_dbminitproto dbminit $i_dbm dbm.h
12571 : see if difftime exists
12572 set difftime d_difftime
12575 : see if this is a dirent system
12577 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12579 echo "<dirent.h> found." >&4
12582 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12583 echo "<sys/dir.h> found." >&4
12586 xinc=`./findhdr sys/ndir.h`
12588 echo "<dirent.h> NOT found." >&4
12593 : Look for type of directory structure.
12595 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12597 case "$direntrytype" in
12599 case "$i_dirent" in
12600 $define) guess1='struct dirent' ;;
12601 *) guess1='struct direct' ;;
12604 *) guess1="$direntrytype"
12609 'struct dirent') guess2='struct direct' ;;
12610 *) guess2='struct dirent' ;;
12613 if $contains "$guess1" try.c >/dev/null 2>&1; then
12614 direntrytype="$guess1"
12615 echo "Your directory entries are $direntrytype." >&4
12616 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12617 direntrytype="$guess2"
12618 echo "Your directory entries seem to be $direntrytype." >&4
12620 echo "I don't recognize your system's directory entries." >&4
12621 rp="What type is used for directory entries on this system?"
12624 direntrytype="$ans"
12628 : see if the directory entry stores field length
12630 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12631 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12632 echo "Good, your directory entry keeps length information in d_namlen." >&4
12635 echo "Your directory entry does not know about the d_namlen field." >&4
12642 : Look for DIR.dd_fd
12643 case "$i_dirent" in
12645 echo "Checking to see if DIR has a dd_fd member variable" >&4
12647 #$i_stdlib I_STDLIB
12649 #include <stdlib.h>
12651 #include <dirent.h>
12661 if eval $compile; then
12662 echo "Yes, it does."
12665 echo "No, it does not."
12670 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12678 : see if this is an sysdir system
12679 set sys/dir.h i_sysdir
12682 : see if this is an sysndir system
12683 set sys/ndir.h i_sysndir
12688 $cat >dirfd.c <<EOM
12690 #$i_stdlib I_STDLIB
12692 #include <stdlib.h>
12694 #$i_dirent I_DIRENT /**/
12695 #$i_sysdir I_SYS_DIR /**/
12696 #$i_sysndir I_SYS_NDIR /**/
12697 #$i_systypes I_SYS_TYPES /**/
12698 #if defined(I_SYS_TYPES)
12699 #include <sys/types.h>
12701 #if defined(I_DIRENT)
12702 #include <dirent.h>
12705 #include <sys/ndir.h>
12709 #include <ndir.h> /* may be wrong in the future */
12711 #include <sys/dir.h>
12717 DIR *dirp = opendir(".");
12718 if (dirfd(dirp) >= 0)
12726 if eval $compile; then
12730 $define) echo "dirfd() found." >&4 ;;
12731 *) echo "dirfd() NOT found." >&4 ;;
12737 : see if dladdr exists
12738 set dladdr d_dladdr
12741 : see if dlerror exists
12744 set dlerror d_dlerror
12748 : see if dlfcn is available
12749 set dlfcn.h i_dlfcn
12752 : Check what extension to use for shared libs
12757 On a few systems, the dynamically loaded modules that perl generates and uses
12758 will need a different extension than shared libs. The default will probably
12764 *) dflt="$dlext" ;;
12766 rp='What is the extension of dynamically loaded modules'
12775 : Check if dlsym need a leading underscore
12781 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12782 $cat >dyna.c <<'EOM'
12789 #$i_stdlib I_STDLIB
12791 #include <stdlib.h>
12795 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12797 #include <sys/types.h>
12802 extern int fred() ;
12811 int mode = RTLD_LAZY ;
12813 handle = dlopen("./dyna.$dlext", mode) ;
12814 if (handle == NULL) {
12819 symbol = dlsym(handle, "fred") ;
12820 if (symbol == NULL) {
12821 /* try putting a leading underscore */
12822 symbol = dlsym(handle, "_fred") ;
12823 if (symbol == NULL) {
12836 : Call the object file tmp-dyna.o in case dlext=o.
12837 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12838 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12839 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12840 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12843 1) echo "Test program failed using dlopen." >&4
12844 echo "Perhaps you should not use dynamic loading." >&4;;
12845 2) echo "Test program failed using dlsym." >&4
12846 echo "Perhaps you should not use dynamic loading." >&4;;
12847 3) echo "dlsym needs a leading underscore" >&4
12849 4) echo "dlsym doesn't need a leading underscore." >&4;;
12852 echo "I can't compile and run the test program." >&4
12853 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12858 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12863 : see if drand48_r exists
12864 set drand48_r d_drand48_r
12866 case "$d_drand48_r" in
12868 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12869 case "$d_drand48_r_proto:$usethreads" in
12870 ":define") d_drand48_r_proto=define
12871 set d_drand48_r_proto drand48_r $hdrs
12875 case "$d_drand48_r_proto" in
12877 case "$drand48_r_proto" in
12878 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12879 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12881 case "$drand48_r_proto" in
12882 ''|0) d_drand48_r=undef
12884 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12885 * ) case "$drand48_r_proto" in
12886 REENTRANT_PROTO*) ;;
12887 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12889 echo "Prototype: $try" ;;
12892 *) case "$usethreads" in
12893 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12900 *) drand48_r_proto=0
12904 : see if prototype for drand48 is available
12906 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12909 : see if dup2 exists
12913 : see if eaccess exists
12914 set eaccess d_eaccess
12917 : see if endgrent exists
12918 set endgrent d_endgrent
12921 : see if this is an grp system
12927 xxx=`./findhdr grp.h`
12928 $cppstdin $cppflags $cppminus < $xxx >$$.h
12930 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12942 set d_grpasswd; eval $setvar
12946 : see if endgrent_r exists
12947 set endgrent_r d_endgrent_r
12949 case "$d_endgrent_r" in
12951 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12952 case "$d_endgrent_r_proto:$usethreads" in
12953 ":define") d_endgrent_r_proto=define
12954 set d_endgrent_r_proto endgrent_r $hdrs
12958 case "$d_endgrent_r_proto" in
12960 case "$endgrent_r_proto" in
12961 ''|0) try='int endgrent_r(FILE**);'
12962 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12964 case "$endgrent_r_proto" in
12965 ''|0) try='void endgrent_r(FILE**);'
12966 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12968 case "$endgrent_r_proto" in
12969 ''|0) d_endgrent_r=undef
12971 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12972 * ) case "$endgrent_r_proto" in
12973 REENTRANT_PROTO*) ;;
12974 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12976 echo "Prototype: $try" ;;
12979 *) case "$usethreads" in
12980 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12987 *) endgrent_r_proto=0
12991 : see if endhostent exists
12992 set endhostent d_endhent
12995 : see if this is a netdb.h system
12996 set netdb.h i_netdb
12999 : see if endhostent_r exists
13000 set endhostent_r d_endhostent_r
13002 case "$d_endhostent_r" in
13004 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13005 case "$d_endhostent_r_proto:$usethreads" in
13006 ":define") d_endhostent_r_proto=define
13007 set d_endhostent_r_proto endhostent_r $hdrs
13011 case "$d_endhostent_r_proto" in
13013 case "$endhostent_r_proto" in
13014 ''|0) try='int endhostent_r(struct hostent_data*);'
13015 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
13017 case "$endhostent_r_proto" in
13018 ''|0) try='void endhostent_r(struct hostent_data*);'
13019 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
13021 case "$endhostent_r_proto" in
13022 ''|0) d_endhostent_r=undef
13023 endhostent_r_proto=0
13024 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
13025 * ) case "$endhostent_r_proto" in
13026 REENTRANT_PROTO*) ;;
13027 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
13029 echo "Prototype: $try" ;;
13032 *) case "$usethreads" in
13033 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
13035 d_endhostent_r=undef
13036 endhostent_r_proto=0
13040 *) endhostent_r_proto=0
13044 : see if endnetent exists
13045 set endnetent d_endnent
13048 : see if endnetent_r exists
13049 set endnetent_r d_endnetent_r
13051 case "$d_endnetent_r" in
13053 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13054 case "$d_endnetent_r_proto:$usethreads" in
13055 ":define") d_endnetent_r_proto=define
13056 set d_endnetent_r_proto endnetent_r $hdrs
13060 case "$d_endnetent_r_proto" in
13062 case "$endnetent_r_proto" in
13063 ''|0) try='int endnetent_r(struct netent_data*);'
13064 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13066 case "$endnetent_r_proto" in
13067 ''|0) try='void endnetent_r(struct netent_data*);'
13068 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13070 case "$endnetent_r_proto" in
13071 ''|0) d_endnetent_r=undef
13072 endnetent_r_proto=0
13073 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13074 * ) case "$endnetent_r_proto" in
13075 REENTRANT_PROTO*) ;;
13076 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13078 echo "Prototype: $try" ;;
13081 *) case "$usethreads" in
13082 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13084 d_endnetent_r=undef
13085 endnetent_r_proto=0
13089 *) endnetent_r_proto=0
13093 : see if endprotoent exists
13094 set endprotoent d_endpent
13097 : see if endprotoent_r exists
13098 set endprotoent_r d_endprotoent_r
13100 case "$d_endprotoent_r" in
13102 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13103 case "$d_endprotoent_r_proto:$usethreads" in
13104 ":define") d_endprotoent_r_proto=define
13105 set d_endprotoent_r_proto endprotoent_r $hdrs
13109 case "$d_endprotoent_r_proto" in
13111 case "$endprotoent_r_proto" in
13112 ''|0) try='int endprotoent_r(struct protoent_data*);'
13113 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13115 case "$endprotoent_r_proto" in
13116 ''|0) try='void endprotoent_r(struct protoent_data*);'
13117 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13119 case "$endprotoent_r_proto" in
13120 ''|0) d_endprotoent_r=undef
13121 endprotoent_r_proto=0
13122 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13123 * ) case "$endprotoent_r_proto" in
13124 REENTRANT_PROTO*) ;;
13125 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13127 echo "Prototype: $try" ;;
13130 *) case "$usethreads" in
13131 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13133 d_endprotoent_r=undef
13134 endprotoent_r_proto=0
13138 *) endprotoent_r_proto=0
13142 : see if endpwent exists
13143 set endpwent d_endpwent
13146 : see if this is a pwd.h system
13152 xxx=`./findhdr pwd.h`
13153 $cppstdin $cppflags $cppminus < $xxx >$$.h
13155 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13163 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13171 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13179 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13187 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13195 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13203 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13211 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13223 set d_pwquota; eval $setvar
13224 set d_pwage; eval $setvar
13225 set d_pwchange; eval $setvar
13226 set d_pwclass; eval $setvar
13227 set d_pwexpire; eval $setvar
13228 set d_pwcomment; eval $setvar
13229 set d_pwgecos; eval $setvar
13230 set d_pwpasswd; eval $setvar
13234 : see if endpwent_r exists
13235 set endpwent_r d_endpwent_r
13237 case "$d_endpwent_r" in
13239 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13240 case "$d_endpwent_r_proto:$usethreads" in
13241 ":define") d_endpwent_r_proto=define
13242 set d_endpwent_r_proto endpwent_r $hdrs
13246 case "$d_endpwent_r_proto" in
13248 case "$endpwent_r_proto" in
13249 ''|0) try='int endpwent_r(FILE**);'
13250 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13252 case "$endpwent_r_proto" in
13253 ''|0) try='void endpwent_r(FILE**);'
13254 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13256 case "$endpwent_r_proto" in
13257 ''|0) d_endpwent_r=undef
13259 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13260 * ) case "$endpwent_r_proto" in
13261 REENTRANT_PROTO*) ;;
13262 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13264 echo "Prototype: $try" ;;
13267 *) case "$usethreads" in
13268 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13275 *) endpwent_r_proto=0
13279 : see if endservent exists
13280 set endservent d_endsent
13283 : see if endservent_r exists
13284 set endservent_r d_endservent_r
13286 case "$d_endservent_r" in
13288 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13289 case "$d_endservent_r_proto:$usethreads" in
13290 ":define") d_endservent_r_proto=define
13291 set d_endservent_r_proto endservent_r $hdrs
13295 case "$d_endservent_r_proto" in
13297 case "$endservent_r_proto" in
13298 ''|0) try='int endservent_r(struct servent_data*);'
13299 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13301 case "$endservent_r_proto" in
13302 ''|0) try='void endservent_r(struct servent_data*);'
13303 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13305 case "$endservent_r_proto" in
13306 ''|0) d_endservent_r=undef
13307 endservent_r_proto=0
13308 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13309 * ) case "$endservent_r_proto" in
13310 REENTRANT_PROTO*) ;;
13311 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13313 echo "Prototype: $try" ;;
13316 *) case "$usethreads" in
13317 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13319 d_endservent_r=undef
13320 endservent_r_proto=0
13324 *) endservent_r_proto=0
13328 : Locate the flags for 'open()'
13331 #include <sys/types.h>
13336 #include <sys/file.h>
13338 #$i_stdlib I_STDLIB
13340 #include <stdlib.h>
13351 : check sys/file.h first to get FREAD on Sun
13352 if $test `./findhdr sys/file.h` && \
13353 set try -DI_SYS_FILE && eval $compile; then
13355 echo "<sys/file.h> defines the O_* constants..." >&4
13356 if $run ./try; then
13357 echo "and you have the 3 argument form of open()." >&4
13360 echo "but not the 3 argument form of open(). Oh, well." >&4
13363 elif $test `./findhdr fcntl.h` && \
13364 set try -DI_FCNTL && eval $compile; then
13366 echo "<fcntl.h> defines the O_* constants..." >&4
13367 if $run ./try; then
13368 echo "and you have the 3 argument form of open()." >&4
13371 echo "but not the 3 argument form of open(). Oh, well." >&4
13376 echo "I can't find the O_* constant definitions! You got problems." >&4
13382 : see if this is a sys/file.h system
13387 : do we need to include sys/file.h ?
13391 if $h_sysfile; then
13393 echo "We'll be including <sys/file.h>." >&4
13396 echo "We won't be including <sys/file.h>." >&4
13406 : see if fcntl.h is there
13411 : see if we can include fcntl.h
13417 echo "We'll be including <fcntl.h>." >&4
13420 if $h_sysfile; then
13421 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13423 echo "We won't be including <fcntl.h>." >&4
13435 : see if fork exists
13439 : see if pipe exists
13443 : check for non-blocking I/O stuff
13444 case "$h_sysfile" in
13445 true) echo "#include <sys/file.h>" > head.c;;
13448 true) echo "#include <fcntl.h>" > head.c;;
13449 *) echo "#include <sys/fcntl.h>" > head.c;;
13454 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13455 case "$o_nonblock" in
13457 $cat head.c > try.c
13458 $cat >>try.c <<EOCP
13460 #$i_stdlib I_STDLIB
13462 #include <stdlib.h>
13470 printf("O_NONBLOCK\n");
13474 printf("O_NDELAY\n");
13478 printf("FNDELAY\n");
13485 if eval $compile_ok; then
13486 o_nonblock=`$run ./try`
13487 case "$o_nonblock" in
13488 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13489 *) echo "Seems like we can use $o_nonblock.";;
13492 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13495 *) echo "Using $hint value $o_nonblock.";;
13500 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13503 case "$d_fork:$d_pipe:$d_alarm" in
13504 define:define:define)
13505 $cat head.c > try.c
13506 $cat >>try.c <<EOCP
13508 #include <sys/types.h>
13509 #include <signal.h>
13511 #$i_stdlib I_STDLIB
13513 #include <stdlib.h>
13519 #define MY_O_NONBLOCK $o_nonblock
13520 #ifndef errno /* XXX need better Configure test */
13523 #$i_unistd I_UNISTD
13525 #include <unistd.h>
13527 #$i_string I_STRING
13529 #include <string.h>
13531 #include <strings.h>
13533 $signal_t blech(int x) { exit(3); }
13535 $cat >> try.c <<'EOCP'
13544 ret = pipe(pd); /* Down: child -> parent */
13547 ret = pipe(pu); /* Up: parent -> child */
13551 close(pd[1]); /* Parent reads from pd[0] */
13552 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13554 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13559 signal(SIGALRM, blech);
13561 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13563 sprintf(string, "%d\n", ret);
13564 ret = write(2, string, strlen(string));
13565 if (ret != strlen(string))
13569 if (errno == EAGAIN) {
13570 printf("EAGAIN\n");
13575 if (errno == EWOULDBLOCK)
13576 printf("EWOULDBLOCK\n");
13579 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13582 sleep(2); /* Give it time to close our pipe */
13584 ret = read(pd[0], buf, 1); /* Should read EOF */
13586 sprintf(string, "%d\n", ret);
13587 ret = write(4, string, strlen(string));
13588 if (ret != strlen(string))
13593 close(pd[0]); /* We write to pd[1] */
13594 close(pu[1]); /* We read from pu[0] */
13595 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13598 close(pd[1]); /* Pipe pd is now fully closed! */
13599 exit(0); /* Bye bye, thank you for playing! */
13603 if eval $compile_ok; then
13604 echo "$startsh" >mtry
13605 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13607 $run ./mtry >/dev/null 2>&1
13609 0) eagain=`$cat try.out`;;
13610 1) echo "Could not perform non-blocking setting!";;
13611 2) echo "I did a successful read() for something that was not there!";;
13612 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13613 4) echo "Could not find F_SETFL!";;
13614 *) echo "Something terribly wrong happened during testing.";;
13616 rd_nodata=`$cat try.ret`
13617 echo "A read() system call with no data present returns $rd_nodata."
13618 case "$rd_nodata" in
13621 echo "(That's peculiar, fixing that to be -1.)"
13627 echo "Forcing errno EAGAIN on read() with no data available."
13631 echo "Your read() sets errno to $eagain when no data is available."
13634 status=`$cat try.err`
13636 0) echo "And it correctly returns 0 to signal EOF.";;
13637 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13638 *) echo "However, your read() returns '$status' on EOF??";;
13641 if test "$status" = "$rd_nodata"; then
13642 echo "WARNING: you can't distinguish between EOF and no data!"
13646 echo "I can't compile the test program--assuming errno EAGAIN will do."
13650 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13659 echo "Using $hint value $eagain."
13660 echo "Your read() returns $rd_nodata when no data is present."
13661 case "$d_eofnblk" in
13662 "$define") echo "And you can see EOF because read() returns 0.";;
13663 "$undef") echo "But you can't see EOF status from read() returned value.";;
13665 echo "(Assuming you can't see EOF status from read anyway.)"
13671 $rm_try head.c mtry
13673 : see if erf exists
13677 : see if erfc exists
13681 : see if exp2 exists
13685 : see if expm1 exists
13689 : see if _ptr and _cnt from stdio act std
13692 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13693 echo "(Looks like you have stdio.h from BSD.)"
13694 case "$stdio_ptr" in
13695 '') stdio_ptr='((fp)->_p)'
13698 *) ptr_lval=$d_stdio_ptr_lval;;
13700 case "$stdio_cnt" in
13701 '') stdio_cnt='((fp)->_r)'
13704 *) cnt_lval=$d_stdio_cnt_lval;;
13706 case "$stdio_base" in
13707 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13709 case "$stdio_bufsiz" in
13710 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13712 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13713 echo "(Looks like you have stdio.h from Linux.)"
13714 case "$stdio_ptr" in
13715 '') stdio_ptr='((fp)->_IO_read_ptr)'
13718 *) ptr_lval=$d_stdio_ptr_lval;;
13720 case "$stdio_cnt" in
13721 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13724 *) cnt_lval=$d_stdio_cnt_lval;;
13726 case "$stdio_base" in
13727 '') stdio_base='((fp)->_IO_read_base)';;
13729 case "$stdio_bufsiz" in
13730 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13733 case "$stdio_ptr" in
13734 '') stdio_ptr='((fp)->_ptr)'
13737 *) ptr_lval=$d_stdio_ptr_lval;;
13739 case "$stdio_cnt" in
13740 '') stdio_cnt='((fp)->_cnt)'
13743 *) cnt_lval=$d_stdio_cnt_lval;;
13745 case "$stdio_base" in
13746 '') stdio_base='((fp)->_base)';;
13748 case "$stdio_bufsiz" in
13749 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13753 : test whether _ptr and _cnt really work
13754 echo "Checking how std your stdio is..." >&4
13757 #$i_stdlib I_STDLIB
13759 #include <stdlib.h>
13761 #define FILE_ptr(fp) $stdio_ptr
13762 #define FILE_cnt(fp) $stdio_cnt
13764 FILE *fp = fopen("try.c", "r");
13767 18 <= FILE_cnt(fp) &&
13768 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13776 if eval $compile && $to try.c; then
13777 if $run ./try; then
13778 echo "Your stdio acts pretty std."
13781 echo "Your stdio isn't very std."
13784 echo "Your stdio doesn't appear very std."
13788 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13789 # direct buffer manipulation no longer works. The Configure tests
13790 # should be changed to correctly detect this, but until then,
13791 # the following check should at least let perl compile and run.
13792 # (This quick fix should be updated before 5.8.1.)
13793 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13794 # A. Dougherty, June 3, 2002.
13795 case "$d_gnulibc" in
13797 case "$gnulibc_version" in
13801 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13810 : Can _ptr be used as an lvalue?
13811 case "$d_stdstdio$ptr_lval" in
13812 $define$define) val=$define ;;
13815 set d_stdio_ptr_lval
13818 : Can _cnt be used as an lvalue?
13819 case "$d_stdstdio$cnt_lval" in
13820 $define$define) val=$define ;;
13823 set d_stdio_cnt_lval
13827 : test whether setting _ptr sets _cnt as a side effect
13828 d_stdio_ptr_lval_sets_cnt="$undef"
13829 d_stdio_ptr_lval_nochange_cnt="$undef"
13830 case "$d_stdio_ptr_lval$d_stdstdio" in
13832 echo "Checking to see what happens if we set the stdio ptr..." >&4
13835 /* Can we scream? */
13836 /* Eat dust sed :-) */
13837 /* In the buffer space, no one can hear you scream. */
13838 #$i_stdlib I_STDLIB
13840 #include <stdlib.h>
13842 #define FILE_ptr(fp) $stdio_ptr
13843 #define FILE_cnt(fp) $stdio_cnt
13844 #include <sys/types.h>
13846 FILE *fp = fopen("try.c", "r");
13851 puts("Fail even to read");
13854 c = getc(fp); /* Read away the first # */
13856 puts("Fail even to read");
13860 18 <= FILE_cnt(fp) &&
13861 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13863 puts("Fail even to read");
13866 ptr = (char*) FILE_ptr(fp);
13867 cnt = (size_t)FILE_cnt(fp);
13869 FILE_ptr(fp) += 42;
13871 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13872 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13875 if (FILE_cnt(fp) <= 20) {
13876 printf ("Fail (<20 chars to test)");
13879 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13880 puts("Fail compare");
13883 if (cnt == FILE_cnt(fp)) {
13884 puts("Pass_unchanged");
13887 if (FILE_cnt(fp) == (cnt - 42)) {
13888 puts("Pass_changed");
13891 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13897 if eval $compile && $to try.c; then
13898 case `$run ./try` in
13900 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13901 d_stdio_ptr_lval_sets_cnt="$define" ;;
13903 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13904 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13906 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13908 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13911 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13917 : see if _base is also standard
13919 case "$d_stdstdio" in
13923 #$i_stdlib I_STDLIB
13925 #include <stdlib.h>
13927 #define FILE_base(fp) $stdio_base
13928 #define FILE_bufsiz(fp) $stdio_bufsiz
13930 FILE *fp = fopen("try.c", "r");
13933 19 <= FILE_bufsiz(fp) &&
13934 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13941 if eval $compile && $to try.c; then
13942 if $run ./try; then
13943 echo "And its _base field acts std."
13946 echo "But its _base field isn't std."
13949 echo "However, it seems to be lacking the _base field."
13957 : see if fast_stdio exists
13959 case "$d_stdstdio:$d_stdio_ptr_lval" in
13961 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13963 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13974 : see if fchdir exists
13975 set fchdir d_fchdir
13978 : see if fchmod exists
13979 set fchmod d_fchmod
13982 : see if fchown exists
13983 set fchown d_fchown
13986 : see if this is an fcntl system
13990 : See if fcntl-based locking works.
13993 #$i_stdlib I_STDLIB
13995 #include <stdlib.h>
13997 #include <unistd.h>
13999 #include <signal.h>
14000 $signal_t blech(int x) { exit(3); }
14002 #if defined(F_SETLK) && defined(F_SETLKW)
14003 struct flock flock;
14005 fd = open("try.c", O_RDONLY);
14006 flock.l_type = F_RDLCK;
14007 flock.l_whence = SEEK_SET;
14008 flock.l_start = flock.l_len = 0;
14009 signal(SIGALRM, blech);
14011 retval = fcntl(fd, F_SETLK, &flock);
14013 (retval < 0 ? exit(2) : exit(0));
14019 echo "Checking if fcntl-based file locking works... "
14023 if eval $compile_ok; then
14024 if $run ./try; then
14025 echo "Yes, it seems to work."
14028 echo "Nope, it didn't work."
14033 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
14034 *** This is (almost) impossible.
14035 *** If your NFS lock daemons are not feeling well, something like
14036 *** this may happen, please investigate. Cannot continue, aborting.
14044 echo "I'm unable to compile the test program, so I'll assume not."
14049 echo "Nope, since you don't even have fcntl()."
14052 set d_fcntl_can_lock
14056 : check for fd_set items
14059 Checking to see how well your C compiler handles fd_set and friends ...
14062 #$i_stdlib I_STDLIB
14064 #include <stdlib.h>
14066 #$i_systime I_SYS_TIME
14067 #$i_sysselct I_SYS_SELECT
14068 #$d_socket HAS_SOCKET
14069 #include <sys/types.h>
14071 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14074 #include <sys/time.h>
14076 #ifdef I_SYS_SELECT
14077 #include <sys/select.h>
14086 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14094 if eval $compile; then
14095 d_fds_bits="$define"
14097 echo "Well, your system knows about the normal fd_set typedef..." >&4
14098 if $run ./try; then
14099 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14100 d_fd_macros="$define"
14103 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14105 d_fd_macros="$undef"
14109 Hmm, your compiler has some difficulty with fd_set. Checking further...
14112 if eval $compile; then
14113 d_fds_bits="$undef"
14115 echo "Well, your system has some sort of fd_set available..." >&4
14116 if $run ./try; then
14117 echo "and you have the normal fd_set macros." >&4
14118 d_fd_macros="$define"
14121 but not the normal fd_set macros! Gross! More work for me...
14123 d_fd_macros="$undef"
14126 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14128 d_fds_bits="$undef"
14129 d_fd_macros="$undef"
14134 : see if fdclose exists
14135 set fdclose d_fdclose
14138 : see if fdim exists
14142 : see if fegetround exists
14143 set fegetround d_fegetround
14146 : see if fgetpos exists
14147 set fgetpos d_fgetpos
14150 : see if finite exists
14151 set finite d_finite
14154 : see if finitel exists
14155 set finitel d_finitel
14158 : see if flock exists
14162 : see if prototype for flock is available
14164 set d_flockproto flock $i_sysfile sys/file.h
14167 : see if fma exists
14171 : see if fmax exists
14175 : see if fmin exists
14179 : see if fp_class exists
14180 set fp_class d_fp_class
14183 : see if this is a math.h system
14187 : check for fpclassify
14188 echo "Checking to see if you have fpclassify..." >&4
14194 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14197 if eval $compile; then
14199 echo "You have fpclassify."
14202 echo "You do not have fpclassify."
14208 : see if fp_classify exists
14209 set fp_classify d_fp_classify
14212 : see if fp_classl exists
14213 set fp_classl d_fp_classl
14216 : see if pathconf exists
14217 set pathconf d_pathconf
14220 : see if fpathconf exists
14221 set fpathconf d_fpathconf
14224 : see if fpclass exists
14225 set fpclass d_fpclass
14228 : see if fpclassl exists
14229 set fpclassl d_fpclassl
14232 : see if fpgetround exists
14233 set fpgetround d_fpgetround
14236 : check for fpos64_t
14238 echo "Checking to see if you have fpos64_t..." >&4
14241 int main() { fpos64_t x = 7; }
14244 if eval $compile; then
14246 echo "You have fpos64_t."
14249 echo "You do not have fpos64_t."
14250 case "$fpossize" in
14251 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14258 : see if this is an xlocale.h system
14259 set xlocale.h i_xlocale
14262 : see if newlocale exists
14263 set newlocale d_newlocale
14266 : see if freelocale exists
14267 set freelocale d_freelocale
14270 : see if uselocale exists
14271 set uselocale d_uselocale
14274 : see if duplocale exists
14275 set duplocale d_duplocale
14278 : see if querylocale exists
14279 set querylocale d_querylocale
14282 : see if frexpl exists
14283 set frexpl d_frexpl
14286 : see if this is a sys/param system
14287 set sys/param.h i_sysparam
14290 : see if this is a sys/mount.h system
14291 set sys/mount.h i_sysmount
14294 : Check for fs_data_s
14296 echo "Checking to see if your system supports struct fs_data..." >&4
14297 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14299 case "$d_fs_data_s" in
14300 "$define") echo "Yes, it does." ;;
14301 *) echo "No, it doesn't." ;;
14304 : see if fseeko exists
14305 set fseeko d_fseeko
14307 case "$longsize" in
14308 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14311 : see if fsetpos exists
14312 set fsetpos d_fsetpos
14315 : see if fstatfs exists
14316 set fstatfs d_fstatfs
14319 : see if statvfs exists
14320 set statvfs d_statvfs
14323 : see if fstatvfs exists
14324 set fstatvfs d_fstatvfs
14328 : see if fsync exists
14332 : see if ftello exists
14333 set ftello d_ftello
14335 case "$longsize" in
14336 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14339 : check for a working futimes
14342 echo "Checking if you have a working futimes()" >&4
14345 #include <sys/time.h>
14352 fd = open ("try.c", O_RDWR);
14353 if (-1 == fd) exit (1);
14354 rv = futimes (fd, NULL);
14355 exit (rv == -1 ? errno : 0);
14359 if eval $compile; then
14363 0) echo "Yes, you have" >&4
14364 d_futimes="$define"
14366 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14370 echo "No, it does not (probably harmless)" >&4
14374 : look for gai_strerror
14376 $cat >try.c <<'EOCP'
14377 #include <sys/types.h>
14378 #include <sys/socket.h>
14382 return (gai_strerror (0) ? 0 : 1);
14387 if eval $compile; then
14390 0) echo "A working gai_strerror() found." >&4
14392 *) echo "gai_strerror() found, but it doesn't work" >&4
14396 echo "gai_strerror() NOT found." >&4
14402 : see if ndbm.h is available
14405 : Compatibility location for RedHat 7.1
14406 set gdbm/ndbm.h i_gdbmndbm
14408 : Compatibility location for Debian 4.0
14409 set gdbm-ndbm.h i_gdbm_ndbm
14413 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14414 : see if dbm_open exists
14415 set dbm_open d_dbm_open
14417 case "$d_dbm_open" in
14420 i_gdbmndbm="$undef"
14421 i_gdbm_ndbm="$undef"
14422 echo "We won't be including <ndbm.h>"
14432 ndbm_hdr_protochk='name=$1; hdr=$2;
14433 eval "ihdr=\$""i_$name";
14435 if $test "$ihdr" = "$define"; then
14436 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14437 case "$d_cplusplus" in
14438 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14439 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14442 $define) $echo "Your <$hdr> seems to have prototypes";;
14443 *) $echo "Your <$hdr> does not seem to have prototypes";;
14446 set "d_${name}_h_uses_prototypes";
14450 eval $ndbm_hdr_protochk
14451 set gdbmndbm gdbm/ndbm.h
14452 eval $ndbm_hdr_protochk
14453 set gdbm_ndbm gdbm-ndbm.h
14454 eval $ndbm_hdr_protochk
14456 : see if getaddrinfo exists
14457 set getaddrinfo d_getaddrinfo
14460 : see if getcwd exists
14461 set getcwd d_getcwd
14464 : see if getespwnam exists
14465 set getespwnam d_getespwnam
14468 : see if getfsstat exists
14469 set getfsstat d_getfsstat
14472 : see if getgrent exists
14473 set getgrent d_getgrent
14476 : see if getgrent_r exists
14477 set getgrent_r d_getgrent_r
14479 case "$d_getgrent_r" in
14481 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14482 case "$d_getgrent_r_proto:$usethreads" in
14483 ":define") d_getgrent_r_proto=define
14484 set d_getgrent_r_proto getgrent_r $hdrs
14488 case "$d_getgrent_r_proto" in
14490 case "$getgrent_r_proto" in
14491 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14492 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14494 case "$getgrent_r_proto" in
14495 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14496 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14498 case "$getgrent_r_proto" in
14499 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14500 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14502 case "$getgrent_r_proto" in
14503 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14504 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14506 case "$getgrent_r_proto" in
14507 ''|0) try='int getgrent_r(struct group*, char*, int);'
14508 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14510 case "$getgrent_r_proto" in
14511 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14512 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14514 case "$getgrent_r_proto" in
14515 ''|0) d_getgrent_r=undef
14517 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14518 * ) case "$getgrent_r_proto" in
14519 REENTRANT_PROTO*) ;;
14520 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14522 echo "Prototype: $try" ;;
14525 *) case "$usethreads" in
14526 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14533 *) getgrent_r_proto=0
14537 : see if getgrgid_r exists
14538 set getgrgid_r d_getgrgid_r
14540 case "$d_getgrgid_r" in
14542 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14543 case "$d_getgrgid_r_proto:$usethreads" in
14544 ":define") d_getgrgid_r_proto=define
14545 set d_getgrgid_r_proto getgrgid_r $hdrs
14549 case "$d_getgrgid_r_proto" in
14551 case "$getgrgid_r_proto" in
14552 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14553 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14555 case "$getgrgid_r_proto" in
14556 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14557 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14559 case "$getgrgid_r_proto" in
14560 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14561 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14563 case "$getgrgid_r_proto" in
14564 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14565 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14567 case "$getgrgid_r_proto" in
14568 ''|0) d_getgrgid_r=undef
14570 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14571 * ) case "$getgrgid_r_proto" in
14572 REENTRANT_PROTO*) ;;
14573 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14575 echo "Prototype: $try" ;;
14578 *) case "$usethreads" in
14579 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14586 *) getgrgid_r_proto=0
14590 : see if getgrnam_r exists
14591 set getgrnam_r d_getgrnam_r
14593 case "$d_getgrnam_r" in
14595 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14596 case "$d_getgrnam_r_proto:$usethreads" in
14597 ":define") d_getgrnam_r_proto=define
14598 set d_getgrnam_r_proto getgrnam_r $hdrs
14602 case "$d_getgrnam_r_proto" in
14604 case "$getgrnam_r_proto" in
14605 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14606 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14608 case "$getgrnam_r_proto" in
14609 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14610 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14612 case "$getgrnam_r_proto" in
14613 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14614 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14616 case "$getgrnam_r_proto" in
14617 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14618 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14620 case "$getgrnam_r_proto" in
14621 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14622 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14624 case "$getgrnam_r_proto" in
14625 ''|0) d_getgrnam_r=undef
14627 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14628 * ) case "$getgrnam_r_proto" in
14629 REENTRANT_PROTO*) ;;
14630 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14632 echo "Prototype: $try" ;;
14635 *) case "$usethreads" in
14636 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14643 *) getgrnam_r_proto=0
14647 : see if gethostbyaddr exists
14648 set gethostbyaddr d_gethbyaddr
14651 : see if gethostbyname exists
14652 set gethostbyname d_gethbyname
14655 : see if gethostent exists
14656 set gethostent d_gethent
14659 : see how we will look up host name
14662 if set gethostname val -f d_gethname; eval $csym; $val; then
14663 echo 'gethostname() found.' >&4
14664 d_gethname="$define"
14667 if set uname val -f d_uname; eval $csym; $val; then
14670 uname() was found, but you're running xenix, and older versions of xenix
14671 have a broken uname(). If you don't really know whether your xenix is old
14672 enough to have a broken system call, use the default answer.
14677 "$define") dflt=n;;
14679 rp='Is your uname() broken?'
14682 n*) d_uname="$define"; call=uname;;
14685 echo 'uname() found.' >&4
14692 case "$d_gethname" in
14693 '') d_gethname="$undef";;
14696 '') d_uname="$undef";;
14698 case "$d_uname$d_gethname" in
14703 Every now and then someone has a $call() that lies about the hostname
14704 but can't be fixed for political or economic reasons. If you wish, I can
14705 pretend $call() isn't there and maybe compute hostname at run-time
14706 thanks to the '$phostname' command.
14709 rp="Shall I ignore $call() from now on?"
14712 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14715 case "$phostname" in
14716 '') aphostname='';;
14717 *) case "$aphostname" in
14719 *) set X $phostname
14723 file=`./loc $file $file $pth`
14724 aphostname=`echo $file $*`
14729 case "$d_uname$d_gethname" in
14732 case "$phostname" in
14734 echo "There will be no way for $package to get your hostname." >&4;;
14736 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14740 case "$d_phostname" in
14741 '') d_phostname="$undef";;
14744 : see if gethostbyaddr_r exists
14745 set gethostbyaddr_r d_gethostbyaddr_r
14747 case "$d_gethostbyaddr_r" in
14749 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14750 case "$d_gethostbyaddr_r_proto:$usethreads" in
14751 ":define") d_gethostbyaddr_r_proto=define
14752 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14756 case "$d_gethostbyaddr_r_proto" in
14758 case "$gethostbyaddr_r_proto" in
14759 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14760 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14762 case "$gethostbyaddr_r_proto" in
14763 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14764 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14766 case "$gethostbyaddr_r_proto" in
14767 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14768 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14770 case "$gethostbyaddr_r_proto" in
14771 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14772 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14774 case "$gethostbyaddr_r_proto" in
14775 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14776 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14778 case "$gethostbyaddr_r_proto" in
14779 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14780 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14782 case "$gethostbyaddr_r_proto" in
14783 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14784 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14786 case "$gethostbyaddr_r_proto" in
14787 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14788 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14790 case "$gethostbyaddr_r_proto" in
14791 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14792 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14794 case "$gethostbyaddr_r_proto" in
14795 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14796 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14798 case "$gethostbyaddr_r_proto" in
14799 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14800 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14802 case "$gethostbyaddr_r_proto" in
14803 ''|0) d_gethostbyaddr_r=undef
14804 gethostbyaddr_r_proto=0
14805 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14806 * ) case "$gethostbyaddr_r_proto" in
14807 REENTRANT_PROTO*) ;;
14808 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14810 echo "Prototype: $try" ;;
14813 *) case "$usethreads" in
14814 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14816 d_gethostbyaddr_r=undef
14817 gethostbyaddr_r_proto=0
14821 *) gethostbyaddr_r_proto=0
14825 : see if gethostbyname_r exists
14826 set gethostbyname_r d_gethostbyname_r
14828 case "$d_gethostbyname_r" in
14830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14831 case "$d_gethostbyname_r_proto:$usethreads" in
14832 ":define") d_gethostbyname_r_proto=define
14833 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14837 case "$d_gethostbyname_r_proto" in
14839 case "$gethostbyname_r_proto" in
14840 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14841 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14843 case "$gethostbyname_r_proto" in
14844 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14845 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14847 case "$gethostbyname_r_proto" in
14848 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14849 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14851 case "$gethostbyname_r_proto" in
14852 ''|0) d_gethostbyname_r=undef
14853 gethostbyname_r_proto=0
14854 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14855 * ) case "$gethostbyname_r_proto" in
14856 REENTRANT_PROTO*) ;;
14857 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14859 echo "Prototype: $try" ;;
14862 *) case "$usethreads" in
14863 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14865 d_gethostbyname_r=undef
14866 gethostbyname_r_proto=0
14870 *) gethostbyname_r_proto=0
14874 : see if gethostent_r exists
14875 set gethostent_r d_gethostent_r
14877 case "$d_gethostent_r" in
14879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14880 case "$d_gethostent_r_proto:$usethreads" in
14881 ":define") d_gethostent_r_proto=define
14882 set d_gethostent_r_proto gethostent_r $hdrs
14886 case "$d_gethostent_r_proto" in
14888 case "$gethostent_r_proto" in
14889 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14890 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14892 case "$gethostent_r_proto" in
14893 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14894 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14896 case "$gethostent_r_proto" in
14897 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14898 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14900 case "$gethostent_r_proto" in
14901 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14902 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14904 case "$gethostent_r_proto" in
14905 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14906 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14908 case "$gethostent_r_proto" in
14909 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14910 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14912 case "$gethostent_r_proto" in
14913 ''|0) d_gethostent_r=undef
14914 gethostent_r_proto=0
14915 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14916 * ) case "$gethostent_r_proto" in
14917 REENTRANT_PROTO*) ;;
14918 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14920 echo "Prototype: $try" ;;
14923 *) case "$usethreads" in
14924 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14926 d_gethostent_r=undef
14927 gethostent_r_proto=0
14931 *) gethostent_r_proto=0
14935 : see if prototypes for various gethostxxx netdb.h functions are available
14937 set d_gethostprotos gethostent $i_netdb netdb.h
14940 : see if getitimer exists
14941 set getitimer d_getitimer
14944 : see if getlogin exists
14945 set getlogin d_getlogin
14948 : see if getlogin_r exists
14949 set getlogin_r d_getlogin_r
14951 case "$d_getlogin_r" in
14953 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14954 case "$d_getlogin_r_proto:$usethreads" in
14955 ":define") d_getlogin_r_proto=define
14956 set d_getlogin_r_proto getlogin_r $hdrs
14960 case "$d_getlogin_r_proto" in
14962 case "$getlogin_r_proto" in
14963 ''|0) try='int getlogin_r(char*, size_t);'
14964 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14966 case "$getlogin_r_proto" in
14967 ''|0) try='int getlogin_r(char*, int);'
14968 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14970 case "$getlogin_r_proto" in
14971 ''|0) try='char* getlogin_r(char*, size_t);'
14972 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14974 case "$getlogin_r_proto" in
14975 ''|0) try='char* getlogin_r(char*, int);'
14976 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14978 case "$getlogin_r_proto" in
14979 ''|0) d_getlogin_r=undef
14981 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14982 * ) case "$getlogin_r_proto" in
14983 REENTRANT_PROTO*) ;;
14984 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14986 echo "Prototype: $try" ;;
14989 *) case "$usethreads" in
14990 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14997 *) getlogin_r_proto=0
15001 : see if getmnt exists
15002 set getmnt d_getmnt
15005 : see if getmntent exists
15006 set getmntent d_getmntent
15009 : see if getnameinfo exists
15010 set getnameinfo d_getnameinfo
15013 : see if getnetbyaddr exists
15014 set getnetbyaddr d_getnbyaddr
15017 : see if getnetbyname exists
15018 set getnetbyname d_getnbyname
15021 : see if getnetent exists
15022 set getnetent d_getnent
15025 : see if getnetbyaddr_r exists
15026 set getnetbyaddr_r d_getnetbyaddr_r
15028 case "$d_getnetbyaddr_r" in
15030 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15031 case "$d_getnetbyaddr_r_proto:$usethreads" in
15032 ":define") d_getnetbyaddr_r_proto=define
15033 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15037 case "$d_getnetbyaddr_r_proto" in
15039 case "$getnetbyaddr_r_proto" in
15040 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15041 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15043 case "$getnetbyaddr_r_proto" in
15044 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15045 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15047 case "$getnetbyaddr_r_proto" in
15048 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15049 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15051 case "$getnetbyaddr_r_proto" in
15052 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15053 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15055 case "$getnetbyaddr_r_proto" in
15056 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15057 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15059 case "$getnetbyaddr_r_proto" in
15060 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15061 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15063 case "$getnetbyaddr_r_proto" in
15064 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15065 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15067 case "$getnetbyaddr_r_proto" in
15068 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15069 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15071 case "$getnetbyaddr_r_proto" in
15072 ''|0) d_getnetbyaddr_r=undef
15073 getnetbyaddr_r_proto=0
15074 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15075 * ) case "$getnetbyaddr_r_proto" in
15076 REENTRANT_PROTO*) ;;
15077 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15079 echo "Prototype: $try" ;;
15082 *) case "$usethreads" in
15083 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15085 d_getnetbyaddr_r=undef
15086 getnetbyaddr_r_proto=0
15090 *) getnetbyaddr_r_proto=0
15094 : see if getnetbyname_r exists
15095 set getnetbyname_r d_getnetbyname_r
15097 case "$d_getnetbyname_r" in
15099 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15100 case "$d_getnetbyname_r_proto:$usethreads" in
15101 ":define") d_getnetbyname_r_proto=define
15102 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15106 case "$d_getnetbyname_r_proto" in
15108 case "$getnetbyname_r_proto" in
15109 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15110 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15112 case "$getnetbyname_r_proto" in
15113 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15114 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15116 case "$getnetbyname_r_proto" in
15117 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15118 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15120 case "$getnetbyname_r_proto" in
15121 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15122 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15124 case "$getnetbyname_r_proto" in
15125 ''|0) d_getnetbyname_r=undef
15126 getnetbyname_r_proto=0
15127 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15128 * ) case "$getnetbyname_r_proto" in
15129 REENTRANT_PROTO*) ;;
15130 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15132 echo "Prototype: $try" ;;
15135 *) case "$usethreads" in
15136 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15138 d_getnetbyname_r=undef
15139 getnetbyname_r_proto=0
15143 *) getnetbyname_r_proto=0
15147 : see if getnetent_r exists
15148 set getnetent_r d_getnetent_r
15150 case "$d_getnetent_r" in
15152 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15153 case "$d_getnetent_r_proto:$usethreads" in
15154 ":define") d_getnetent_r_proto=define
15155 set d_getnetent_r_proto getnetent_r $hdrs
15159 case "$d_getnetent_r_proto" in
15161 case "$getnetent_r_proto" in
15162 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15163 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15165 case "$getnetent_r_proto" in
15166 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15167 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15169 case "$getnetent_r_proto" in
15170 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15171 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15173 case "$getnetent_r_proto" in
15174 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15175 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15177 case "$getnetent_r_proto" in
15178 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15179 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15181 case "$getnetent_r_proto" in
15182 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15183 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15185 case "$getnetent_r_proto" in
15186 ''|0) d_getnetent_r=undef
15187 getnetent_r_proto=0
15188 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15189 * ) case "$getnetent_r_proto" in
15190 REENTRANT_PROTO*) ;;
15191 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15193 echo "Prototype: $try" ;;
15196 *) case "$usethreads" in
15197 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15199 d_getnetent_r=undef
15200 getnetent_r_proto=0
15204 *) getnetent_r_proto=0
15208 : see if prototypes for various getnetxxx netdb.h functions are available
15210 set d_getnetprotos getnetent $i_netdb netdb.h
15213 : see if getpagesize exists
15214 set getpagesize d_getpagsz
15217 : Optional checks for getprotobyname and getprotobynumber
15219 : see if getprotobyname exists
15220 set getprotobyname d_getpbyname
15223 : see if getprotobynumber exists
15224 set getprotobynumber d_getpbynumber
15227 : see if getprotoent exists
15228 set getprotoent d_getpent
15231 : see if getpgid exists
15232 set getpgid d_getpgid
15235 : see if getpgrp2 exists
15236 set getpgrp2 d_getpgrp2
15239 : see if getppid exists
15240 set getppid d_getppid
15243 : see if getpriority exists
15244 set getpriority d_getprior
15247 : see if getprotobyname_r exists
15248 set getprotobyname_r d_getprotobyname_r
15250 case "$d_getprotobyname_r" in
15252 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15253 case "$d_getprotobyname_r_proto:$usethreads" in
15254 ":define") d_getprotobyname_r_proto=define
15255 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15259 case "$d_getprotobyname_r_proto" in
15261 case "$getprotobyname_r_proto" in
15262 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15263 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15265 case "$getprotobyname_r_proto" in
15266 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15267 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15269 case "$getprotobyname_r_proto" in
15270 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15271 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15273 case "$getprotobyname_r_proto" in
15274 ''|0) d_getprotobyname_r=undef
15275 getprotobyname_r_proto=0
15276 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15277 * ) case "$getprotobyname_r_proto" in
15278 REENTRANT_PROTO*) ;;
15279 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15281 echo "Prototype: $try" ;;
15284 *) case "$usethreads" in
15285 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15287 d_getprotobyname_r=undef
15288 getprotobyname_r_proto=0
15292 *) getprotobyname_r_proto=0
15296 : see if getprotobynumber_r exists
15297 set getprotobynumber_r d_getprotobynumber_r
15299 case "$d_getprotobynumber_r" in
15301 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15302 case "$d_getprotobynumber_r_proto:$usethreads" in
15303 ":define") d_getprotobynumber_r_proto=define
15304 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15308 case "$d_getprotobynumber_r_proto" in
15310 case "$getprotobynumber_r_proto" in
15311 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15312 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15314 case "$getprotobynumber_r_proto" in
15315 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15316 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15318 case "$getprotobynumber_r_proto" in
15319 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15320 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15322 case "$getprotobynumber_r_proto" in
15323 ''|0) d_getprotobynumber_r=undef
15324 getprotobynumber_r_proto=0
15325 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15326 * ) case "$getprotobynumber_r_proto" in
15327 REENTRANT_PROTO*) ;;
15328 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15330 echo "Prototype: $try" ;;
15333 *) case "$usethreads" in
15334 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15336 d_getprotobynumber_r=undef
15337 getprotobynumber_r_proto=0
15341 *) getprotobynumber_r_proto=0
15345 : see if getprotoent_r exists
15346 set getprotoent_r d_getprotoent_r
15348 case "$d_getprotoent_r" in
15350 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15351 case "$d_getprotoent_r_proto:$usethreads" in
15352 ":define") d_getprotoent_r_proto=define
15353 set d_getprotoent_r_proto getprotoent_r $hdrs
15357 case "$d_getprotoent_r_proto" in
15359 case "$getprotoent_r_proto" in
15360 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15361 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15363 case "$getprotoent_r_proto" in
15364 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15365 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15367 case "$getprotoent_r_proto" in
15368 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15369 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15371 case "$getprotoent_r_proto" in
15372 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15373 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15375 case "$getprotoent_r_proto" in
15376 ''|0) d_getprotoent_r=undef
15377 getprotoent_r_proto=0
15378 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15379 * ) case "$getprotoent_r_proto" in
15380 REENTRANT_PROTO*) ;;
15381 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15383 echo "Prototype: $try" ;;
15386 *) case "$usethreads" in
15387 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15389 d_getprotoent_r=undef
15390 getprotoent_r_proto=0
15394 *) getprotoent_r_proto=0
15398 : see if prototypes for various getprotoxxx netdb.h functions are available
15400 set d_getprotoprotos getprotoent $i_netdb netdb.h
15403 : see if getprpwnam exists
15404 set getprpwnam d_getprpwnam
15407 : see if getpwent exists
15408 set getpwent d_getpwent
15411 : see if getpwent_r exists
15412 set getpwent_r d_getpwent_r
15414 case "$d_getpwent_r" in
15416 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15417 case "$d_getpwent_r_proto:$usethreads" in
15418 ":define") d_getpwent_r_proto=define
15419 set d_getpwent_r_proto getpwent_r $hdrs
15423 case "$d_getpwent_r_proto" in
15425 case "$getpwent_r_proto" in
15426 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15427 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15429 case "$getpwent_r_proto" in
15430 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15431 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15433 case "$getpwent_r_proto" in
15434 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15435 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15437 case "$getpwent_r_proto" in
15438 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15439 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15441 case "$getpwent_r_proto" in
15442 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15443 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15445 case "$getpwent_r_proto" in
15446 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15447 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15449 case "$getpwent_r_proto" in
15450 ''|0) d_getpwent_r=undef
15452 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15453 * ) case "$getpwent_r_proto" in
15454 REENTRANT_PROTO*) ;;
15455 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15457 echo "Prototype: $try" ;;
15460 *) case "$usethreads" in
15461 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15468 *) getpwent_r_proto=0
15472 : see if getpwnam_r exists
15473 set getpwnam_r d_getpwnam_r
15475 case "$d_getpwnam_r" in
15477 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15478 case "$d_getpwnam_r_proto:$usethreads" in
15479 ":define") d_getpwnam_r_proto=define
15480 set d_getpwnam_r_proto getpwnam_r $hdrs
15484 case "$d_getpwnam_r_proto" in
15486 case "$getpwnam_r_proto" in
15487 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15488 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15490 case "$getpwnam_r_proto" in
15491 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15492 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15494 case "$getpwnam_r_proto" in
15495 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15496 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15498 case "$getpwnam_r_proto" in
15499 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15500 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15502 case "$getpwnam_r_proto" in
15503 ''|0) d_getpwnam_r=undef
15505 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15506 * ) case "$getpwnam_r_proto" in
15507 REENTRANT_PROTO*) ;;
15508 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15510 echo "Prototype: $try" ;;
15513 *) case "$usethreads" in
15514 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15521 *) getpwnam_r_proto=0
15525 : see if getpwuid_r exists
15526 set getpwuid_r d_getpwuid_r
15528 case "$d_getpwuid_r" in
15530 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15531 case "$d_getpwuid_r_proto:$usethreads" in
15532 ":define") d_getpwuid_r_proto=define
15533 set d_getpwuid_r_proto getpwuid_r $hdrs
15537 case "$d_getpwuid_r_proto" in
15539 case "$getpwuid_r_proto" in
15540 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15541 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15543 case "$getpwuid_r_proto" in
15544 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15545 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15547 case "$getpwuid_r_proto" in
15548 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15549 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15551 case "$getpwuid_r_proto" in
15552 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15553 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15555 case "$getpwuid_r_proto" in
15556 ''|0) d_getpwuid_r=undef
15558 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15559 * ) case "$getpwuid_r_proto" in
15560 REENTRANT_PROTO*) ;;
15561 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15563 echo "Prototype: $try" ;;
15566 *) case "$usethreads" in
15567 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15574 *) getpwuid_r_proto=0
15578 : Optional checks for getsbyname and getsbyport
15580 : see if getservbyname exists
15581 set getservbyname d_getsbyname
15584 : see if getservbyport exists
15585 set getservbyport d_getsbyport
15588 : see if getservent exists
15589 set getservent d_getsent
15592 : see if getservbyname_r exists
15593 set getservbyname_r d_getservbyname_r
15595 case "$d_getservbyname_r" in
15597 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15598 case "$d_getservbyname_r_proto:$usethreads" in
15599 ":define") d_getservbyname_r_proto=define
15600 set d_getservbyname_r_proto getservbyname_r $hdrs
15604 case "$d_getservbyname_r_proto" in
15606 case "$getservbyname_r_proto" in
15607 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15608 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15610 case "$getservbyname_r_proto" in
15611 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15612 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15614 case "$getservbyname_r_proto" in
15615 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15616 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15618 case "$getservbyname_r_proto" in
15619 ''|0) d_getservbyname_r=undef
15620 getservbyname_r_proto=0
15621 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15622 * ) case "$getservbyname_r_proto" in
15623 REENTRANT_PROTO*) ;;
15624 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15626 echo "Prototype: $try" ;;
15629 *) case "$usethreads" in
15630 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15632 d_getservbyname_r=undef
15633 getservbyname_r_proto=0
15637 *) getservbyname_r_proto=0
15641 : see if getservbyport_r exists
15642 set getservbyport_r d_getservbyport_r
15644 case "$d_getservbyport_r" in
15646 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15647 case "$d_getservbyport_r_proto:$usethreads" in
15648 ":define") d_getservbyport_r_proto=define
15649 set d_getservbyport_r_proto getservbyport_r $hdrs
15653 case "$d_getservbyport_r_proto" in
15655 case "$getservbyport_r_proto" in
15656 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15657 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15659 case "$getservbyport_r_proto" in
15660 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15661 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15663 case "$getservbyport_r_proto" in
15664 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15665 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15667 case "$getservbyport_r_proto" in
15668 ''|0) d_getservbyport_r=undef
15669 getservbyport_r_proto=0
15670 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15671 * ) case "$getservbyport_r_proto" in
15672 REENTRANT_PROTO*) ;;
15673 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15675 echo "Prototype: $try" ;;
15678 *) case "$usethreads" in
15679 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15681 d_getservbyport_r=undef
15682 getservbyport_r_proto=0
15686 *) getservbyport_r_proto=0
15690 : see if getservent_r exists
15691 set getservent_r d_getservent_r
15693 case "$d_getservent_r" in
15695 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15696 case "$d_getservent_r_proto:$usethreads" in
15697 ":define") d_getservent_r_proto=define
15698 set d_getservent_r_proto getservent_r $hdrs
15702 case "$d_getservent_r_proto" in
15704 case "$getservent_r_proto" in
15705 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15706 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15708 case "$getservent_r_proto" in
15709 ''|0) try='int getservent_r(struct servent*, char*, int);'
15710 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15712 case "$getservent_r_proto" in
15713 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15714 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15716 case "$getservent_r_proto" in
15717 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15718 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15720 case "$getservent_r_proto" in
15721 ''|0) d_getservent_r=undef
15722 getservent_r_proto=0
15723 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15724 * ) case "$getservent_r_proto" in
15725 REENTRANT_PROTO*) ;;
15726 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15728 echo "Prototype: $try" ;;
15731 *) case "$usethreads" in
15732 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15734 d_getservent_r=undef
15735 getservent_r_proto=0
15739 *) getservent_r_proto=0
15743 : see if prototypes for various getservxxx netdb.h functions are available
15745 set d_getservprotos getservent $i_netdb netdb.h
15748 : see if getspnam exists
15749 set getspnam d_getspnam
15752 : see if this is a shadow.h system
15753 set shadow.h i_shadow
15756 : see if getspnam_r exists
15757 set getspnam_r d_getspnam_r
15759 case "$d_getspnam_r" in
15761 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15762 case "$d_getspnam_r_proto:$usethreads" in
15763 ":define") d_getspnam_r_proto=define
15764 set d_getspnam_r_proto getspnam_r $hdrs
15768 case "$d_getspnam_r_proto" in
15770 case "$getspnam_r_proto" in
15771 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15772 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15774 case "$getspnam_r_proto" in
15775 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15776 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15778 case "$getspnam_r_proto" in
15779 ''|0) d_getspnam_r=undef
15781 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15782 * ) case "$getspnam_r_proto" in
15783 REENTRANT_PROTO*) ;;
15784 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15786 echo "Prototype: $try" ;;
15789 *) case "$usethreads" in
15790 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15797 *) getspnam_r_proto=0
15801 : see if gettimeofday or ftime exists
15802 set gettimeofday d_gettimeod
15804 case "$d_gettimeod" in
15810 val="$undef"; set d_ftime; eval $setvar
15813 case "$d_gettimeod$d_ftime" in
15816 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15820 : see if gmtime_r exists
15821 set gmtime_r d_gmtime_r
15823 case "$d_gmtime_r" in
15825 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15826 case "$d_gmtime_r_proto:$usethreads" in
15827 ":define") d_gmtime_r_proto=define
15828 set d_gmtime_r_proto gmtime_r $hdrs
15832 case "$d_gmtime_r_proto" in
15834 case "$gmtime_r_proto" in
15835 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15836 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15838 case "$gmtime_r_proto" in
15839 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15840 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15842 case "$gmtime_r_proto" in
15843 ''|0) d_gmtime_r=undef
15845 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15846 * ) case "$gmtime_r_proto" in
15847 REENTRANT_PROTO*) ;;
15848 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15850 echo "Prototype: $try" ;;
15853 *) case "$usethreads" in
15854 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15861 *) gmtime_r_proto=0
15865 : see if hasmntopt exists
15866 set hasmntopt d_hasmntopt
15869 : see if this is a netinet/in.h or sys/in.h system
15870 set netinet/in.h i_niin sys/in.h i_sysin
15873 : see if arpa/inet.h has to be included
15874 set arpa/inet.h i_arpainet
15877 : see if htonl --and friends-- exists
15882 : Maybe they are macros.
15885 $cat >htonl.c <<EOM
15887 #include <sys/types.h>
15888 #$i_niin I_NETINET_IN
15890 #$i_arpainet I_ARPA_INET
15891 #ifdef I_NETINET_IN
15892 #include <netinet/in.h>
15895 #include <sys/in.h>
15898 #include <arpa/inet.h>
15901 printf("Defined as a macro.");
15904 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15905 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15907 echo "But it seems to be defined as a macro." >&4
15915 : see if hypot exists
15919 : see if ilogb exists
15923 : see if ilogbl exists
15924 set ilogbl d_ilogbl
15929 if set index val -f; eval $csym; $val; then
15930 if set strchr val -f d_strchr; eval $csym; $val; then
15931 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15934 echo "strchr() found." >&4
15938 echo "index() found." >&4
15943 echo "index() found." >&4
15946 if set strchr val -f d_strchr; eval $csym; $val; then
15949 echo "strchr() found." >&4
15951 echo "No index() or strchr() found!" >&4
15956 set d_strchr; eval $setvar
15958 set d_index; eval $setvar
15960 : check whether inet_aton exists
15961 set inet_aton d_inetaton
15964 : see if inet_ntop exists
15965 set inet_ntop d_inetntop
15968 : see if inet_pton exists
15969 set inet_pton d_inetpton
15974 $cat >isascii.c <<EOCP
15977 #$i_stdlib I_STDLIB
15979 #include <stdlib.h>
15990 if eval $compile; then
15991 echo "isascii() found." >&4
15994 echo "isascii() NOT found." >&4
16003 $cat >isblank.c <<'EOCP'
16014 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
16015 echo "isblank() found." >&4
16018 echo "isblank() NOT found." >&4
16025 : check for isfinite
16026 echo "Checking to see if you have isfinite..." >&4
16032 int main() { return isfinite(0.0); }
16035 if eval $compile; then
16037 echo "You have isfinite."
16040 echo "You do not have isfinite."
16046 : see if isfinitel exists
16047 set isfinitel d_isfinitel
16051 echo "Checking to see if you have isinf..." >&4
16057 int main() { return isinf(0.0); }
16060 if eval $compile; then
16062 echo "You have isinf."
16065 echo "You do not have isinf."
16071 : see if isinfl exists
16072 set isinfl d_isinfl
16076 echo "Checking to see if you have isless..." >&4
16082 int main() { return isless(0.0); }
16085 if eval $compile; then
16087 echo "You have isless."
16090 echo "You do not have isless."
16097 echo "Checking to see if you have isnan..." >&4
16103 int main() { return isnan(0.0); }
16106 if eval $compile; then
16108 echo "You have isnan."
16111 echo "You do not have isnan."
16117 : see if isnanl exists
16118 set isnanl d_isnanl
16121 : check for isnormal
16122 echo "Checking to see if you have isnormal..." >&4
16128 int main() { return isnormal(0.0); }
16131 if eval $compile; then
16133 echo "You have isnormal."
16136 echo "You do not have isnormal."
16146 : see if j0l exists
16150 : see if killpg exists
16151 set killpg d_killpg
16154 : see if localeconv exists
16155 set localeconv d_locconv
16158 : see if libc has the POSIX.1-2008 currency locale rules
16159 case "$d_locconv:$d_lc_monetary_2008" in
16162 #include <locale.h>
16164 struct lconv *lc = localeconv();
16165 char int_p_cs_precedes = lc->int_p_cs_precedes;
16170 if eval $compile; then
16171 d_lc_monetary_2008="$define"
16173 d_lc_monetary_2008="$undef"
16179 : see if lchown exists
16181 $cat > try.c <<'EOCP'
16182 /* System header to define __stub macros and hopefully few prototypes,
16183 which can conflict with char lchown(); below. */
16184 #include <assert.h>
16185 /* Override any gcc2 internal prototype to avoid an error. */
16186 /* We use char because int might match the return type of a gcc2
16187 builtin and then its argument prototype would still apply. */
16190 /* The GNU C library defines this for functions which it implements
16191 to always fail with ENOSYS. Some functions are actually named
16192 something starting with __ and the normal name is an alias. */
16193 #if defined (__stub_lchown) || defined (__stub___lchown)
16201 if eval $compile; then
16202 $echo "lchown() found." >&4
16205 $echo "lchown() NOT found." >&4
16211 : See if number of significant digits in a double precision number is known
16213 $cat >ldbl_dig.c <<EOM
16214 #$i_limits I_LIMITS
16217 #include <limits.h>
16223 printf("Contains LDBL_DIG");
16226 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16227 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16228 echo "LDBL_DIG found." >&4
16231 echo "LDBL_DIG NOT found." >&4
16238 : see if lgamma exists
16239 set lgamma d_lgamma
16242 : see if lgamma_r exists
16243 set lgamma_r d_lgamma_r
16246 : check to see if math.h defines _LIB_VERSION
16247 d_libm_lib_version="$undef"
16251 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16253 #include <unistd.h>
16255 int main (int argc, char *argv[])
16257 printf ("%d\n", _LIB_VERSION);
16262 if eval $compile; then
16264 echo "Yes, it does ($foo)" >&4
16265 d_libm_lib_version="$define"
16267 echo "No, it does not (probably harmless)" >&4
16274 : see if link exists
16278 : see if llrint exists
16279 set llrint d_llrint
16282 : see if llrintl exists
16283 set llrintl d_llrintl
16286 : see if llround exists
16287 set llround d_llround
16290 : see if llroundl exists
16291 set llroundl d_llroundl
16294 : see if localtime_r exists
16295 set localtime_r d_localtime_r
16297 case "$d_localtime_r" in
16299 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16300 case "$d_localtime_r_proto:$usethreads" in
16301 ":define") d_localtime_r_proto=define
16302 set d_localtime_r_proto localtime_r $hdrs
16306 case "$d_localtime_r_proto" in
16308 case "$localtime_r_proto" in
16309 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16310 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16312 case "$localtime_r_proto" in
16313 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16314 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16316 case "$localtime_r_proto" in
16317 ''|0) d_localtime_r=undef
16318 localtime_r_proto=0
16319 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16320 * ) case "$localtime_r_proto" in
16321 REENTRANT_PROTO*) ;;
16322 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16324 echo "Prototype: $try" ;;
16327 *) case "$usethreads" in
16328 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16330 d_localtime_r=undef
16331 localtime_r_proto=0
16335 *) localtime_r_proto=0
16339 : see if localtime_r calls tzset
16340 case "$localtime_r_proto" in
16343 /* Does our libc's localtime_r call tzset ?
16344 * return 0 if so, 1 otherwise.
16346 #$i_systypes I_SYS_TYPES
16347 #$i_unistd I_UNISTD
16349 #$i_stdlib I_STDLIB
16350 #$i_string I_STRING
16351 #$i_malloc I_MALLOC
16353 # include <sys/types.h>
16356 # include <unistd.h>
16362 #include <stdlib.h>
16365 # include <string.h>
16367 # include <strings.h>
16370 # include <malloc.h>
16374 time_t t = time(0L);
16375 char w_tz[]="TZ" "=GMT+5",
16376 e_tz[]="TZ" "=GMT-5",
16377 *tz_e = (char*)malloc(16),
16378 *tz_w = (char*)malloc(16);
16379 struct tm tm_e, tm_w;
16380 memset(&tm_e,'\0',sizeof(struct tm));
16381 memset(&tm_w,'\0',sizeof(struct tm));
16386 localtime_r(&t, &tm_e);
16389 localtime_r(&t, &tm_w);
16391 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16397 if eval $compile; then
16398 if $run ./try; then
16399 d_localtime_r_needs_tzset=undef;
16401 d_localtime_r_needs_tzset=define;
16404 d_localtime_r_needs_tzset=undef;
16408 d_localtime_r_needs_tzset=undef;
16413 : see if lockf exists
16417 : see if log1p exists
16421 : see if log2 exists
16425 : see if logb exists
16429 : see if lrint exists
16433 : see if lrintl exists
16434 set lrintl d_lrintl
16437 : see if lround exists
16438 set lround d_lround
16441 : see if lroundl exists
16442 set lroundl d_lroundl
16445 : see if prototype for lseek is available
16447 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16450 : see if lstat exists
16454 : see if madvise exists
16455 set madvise d_madvise
16458 : see if malloc_size exists
16459 set malloc_size d_malloc_size
16462 : see if malloc_size_good exists
16463 set malloc_good_size d_malloc_good_size
16466 : see if mblen exists
16470 : see if mbstowcs exists
16471 set mbstowcs d_mbstowcs
16474 : see if mbtowc exists
16475 set mbtowc d_mbtowc
16478 : see if memchr exists
16479 set memchr d_memchr
16482 : see if memcmp exists
16483 set memcmp d_memcmp
16486 : see if memcpy exists
16487 set memcpy d_memcpy
16490 : see if memmem exists
16491 set memmem d_memmem
16494 : see if memmove exists
16495 set memmove d_memmove
16498 : see if memset exists
16499 set memset d_memset
16502 : see if mkdir exists
16506 : see if mkdtemp exists
16507 set mkdtemp d_mkdtemp
16510 : see if mkfifo exists
16511 set mkfifo d_mkfifo
16514 : see if mkstemp exists
16515 set mkstemp d_mkstemp
16518 : see if mkstemps exists
16519 set mkstemps d_mkstemps
16522 : see if mktime exists
16523 set mktime d_mktime
16526 : see if this is a sys/mman.h system
16527 set sys/mman.h i_sysmman
16530 : see if mmap exists
16533 : see what shmat returns
16534 : default to something harmless
16536 case "$i_sysmman$d_mmap" in
16538 $cat >mmap.c <<'END'
16539 #include <sys/mman.h>
16542 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16547 echo "and it returns ($mmaptype)." >&4
16553 : see if sqrtl exists
16557 : see if scalbnl exists
16558 set scalbnl d_scalbnl
16561 : see if truncl exists
16562 set truncl d_truncl
16565 : see if modfl exists
16569 : see if prototype for modfl is available
16571 set d_modflproto modfl $i_math math.h
16574 if $test "$uselongdouble" = "$define"; then
16576 if $test "$d_sqrtl" != "$define"; then
16577 message="$message sqrtl"
16579 if $test "$d_modfl" != "$define"; then
16580 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16581 echo "You have both truncl and copysignl, so I can emulate modfl."
16583 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16584 echo "You have both aintl and copysignl, so I can emulate modfl."
16586 message="$message modfl"
16590 if $test "$d_frexpl" != "$define"; then
16591 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16592 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16594 message="$message frexpl"
16597 if $test "$d_ldexpl" != "$define"; then
16598 message="$message ldexpl"
16601 if $test "$message" != ""; then
16604 *** You requested the use of long doubles but you do not seem to have
16605 *** the following mathematical functions needed for long double support:
16607 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16608 *** Cannot continue, aborting.
16616 : see if mprotect exists
16617 set mprotect d_mprotect
16620 : see if msgctl exists
16621 set msgctl d_msgctl
16624 : see if msgget exists
16625 set msgget d_msgget
16628 : see if msgsnd exists
16629 set msgsnd d_msgsnd
16632 : see if msgrcv exists
16633 set msgrcv d_msgrcv
16636 : see how much of the 'msg*(2)' library is present.
16639 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16640 *"$undef"*) h_msg=false;;
16644 case "`ipcs 2>&1`" in
16645 "SVID messages"*"not configured"*)
16646 echo "Your $osname does not have the msg*(2) configured." >&4
16649 set msgctl d_msgctl
16651 set msgget d_msgget
16653 set msgsnd d_msgsnd
16655 set msgrcv d_msgrcv
16661 : we could also check for sys/ipc.h ...
16662 if $h_msg && $test `./findhdr sys/msg.h`; then
16663 echo "You have the full msg*(2) library." >&4
16666 echo "You don't have the full msg*(2) library." >&4
16672 : Check for msghdr_s
16674 echo "Checking to see if your system supports struct msghdr..." >&4
16675 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16677 case "$d_msghdr_s" in
16678 "$define") echo "Yes, it does." ;;
16679 *) echo "No, it doesn't." ;;
16683 : see if msync exists
16687 : see if munmap exists
16688 set munmap d_munmap
16691 : see if nan exists
16695 : see if nearbyint exists
16696 set nearbyint d_nearbyint
16699 : see if nextafter exists
16700 set nextafter d_nextafter
16703 : see if nexttoward exists
16704 set nexttoward d_nexttoward
16707 : see if nice exists
16711 : see if this is a langinfo.h system
16712 set langinfo.h i_langinfo
16715 : see if nl_langinfo exists
16716 set nl_langinfo d_nl_langinfo
16719 : see if this is a quadmath.h system
16720 set quadmath.h i_quadmath
16723 : check for volatile keyword
16725 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16726 $cat >try.c <<'EOCP'
16729 typedef struct _goo_struct goo_struct;
16730 goo_struct * volatile goo = ((goo_struct *)0);
16731 struct _goo_struct {
16736 typedef unsigned short foo_t;
16737 char *volatile foo;
16739 volatile foo_t blech;
16743 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16745 echo "Yup, it does."
16748 echo "Nope, it doesn't."
16754 : Check basic sizes
16756 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16758 case "$use64bitint:$d_quad:$quadtype" in
16761 uvtype="$uquadtype"
16766 uvtype="unsigned long"
16772 case "$uselongdouble:$d_longdbl" in
16774 nvtype="long double"
16775 nvsize=$longdblsize
16782 case "$usequadmath:$i_quadmath" in
16784 nvtype="__float128"
16790 *** You requested the use of the quadmath library, but you
16791 *** do not seem to have the quadmath library installed.
16792 *** Cannot continue, aborting.
16798 define:*) $cat <<EOM >&4
16800 *** You requested the use of the quadmath library, but you
16801 *** do not seem to have the required header, <quadmath.h>.
16803 case "$gccversion" in
16806 *** Your gcc looks a bit old:
16812 *** You are not running a gcc.
16817 *** For the quadmath library you need at least gcc 4.6.
16818 *** Cannot continue, aborting.
16824 $echo "(IV will be "$ivtype", $ivsize bytes)"
16825 $echo "(UV will be "$uvtype", $uvsize bytes)"
16826 $echo "(NV will be "$nvtype", $nvsize bytes)"
16829 #$i_inttypes I_INTTYPES
16831 #include <inttypes.h>
16836 int8_t i = INT8_MAX;
16837 uint8_t u = UINT8_MAX;
16838 printf("int8_t\n");
16841 int16_t i = INT16_MAX;
16842 uint16_t u = UINT16_MAX;
16843 printf("int16_t\n");
16846 int32_t i = INT32_MAX;
16847 uint32_t u = UINT32_MAX;
16848 printf("int32_t\n");
16853 i8type="signed char"
16854 u8type="unsigned char"
16859 '') case "$shortsize" in
16861 u16type="unsigned short"
16869 '') set try -DINT16
16870 if eval $compile; then
16871 case "`$run ./try`" in
16883 '') if $test $shortsize -ge 2; then
16885 u16type="unsigned short"
16893 '') case "$longsize" in
16895 u32type="unsigned long"
16899 *) case "$intsize" in
16901 u32type="unsigned int"
16911 '') set try -DINT32
16912 if eval $compile; then
16913 case "`$run ./try`" in
16925 '') if $test $intsize -ge 4; then
16927 u32type="unsigned int"
16935 '') case "$d_quad:$quadtype" in
16937 i64type="$quadtype"
16938 u64type="$uquadtype"
16946 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16947 : volatile so that the compiler has to store it out to memory.
16948 if test X"$d_volatile" = X"$define"; then
16953 #$i_stdlib I_STDLIB
16955 #include <stdlib.h>
16957 #include <sys/types.h>
16958 #include <signal.h>
16960 $volatile int bletched = 0;
16961 $signal_t blech(int s) { bletched = 1; }
16966 int n = 8 * $uvsize;
16969 signal(SIGFPE, blech);
16972 for (i = 0; i < n; i++) {
16973 u = u << 1 | ($uvtype)1;
16975 if (($uvtype)d != u)
16979 d = ($nvtype)(u - 1);
16980 if (($uvtype)d != (u - 1))
16987 printf("%d\n", ((i == n) ? -n : i));
16993 d_nv_preserves_uv="$undef"
16994 if eval $compile; then
16995 nv_preserves_uv_bits="`$run ./try`"
16997 case "$nv_preserves_uv_bits" in
16999 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
17000 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
17001 d_nv_preserves_uv="$define"
17003 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
17004 d_nv_preserves_uv="$undef" ;;
17005 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
17006 nv_preserves_uv_bits="0" ;;
17010 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17011 : volatile so that the compiler has to store it out to memory.
17012 if test X"$d_volatile" = X"$define"; then
17018 typedef $nvtype NV;
17025 while(count < 256) {
17026 $volatile NV up = value + 1.0;
17027 $volatile NV negated = -value;
17028 $volatile NV down = negated - 1.0;
17029 $volatile NV got_up = up - value;
17030 int up_good = got_up == 1.0;
17031 int got_down = down - negated;
17032 int down_good = got_down == -1.0;
17034 if (down_good != up_good) {
17036 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17037 up_good, (double) got_up, down_good, (double) got_down,
17038 count, (double) value);
17045 fputs("256.0", stdout);
17048 fputs("2.0", stdout);
17054 fputs("*", stdout);
17060 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17061 count, (double) value);
17067 nv_overflows_integers_at='0'
17068 if eval $compile; then
17074 The largest integer your NVs can preserve is equal to $xxx
17076 nv_overflows_integers_at="$xxx"
17079 Cannot determine the largest integer value your NVs can hold, unexpected output
17086 Cannot determine the largest integer value your NVs can hold
17093 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17094 : volatile so that the compiler has to store it out to memory.
17095 if test X"$d_volatile" = X"$define"; then
17100 #$i_stdlib I_STDLIB
17102 #include <stdlib.h>
17104 #$i_string I_STRING
17106 # include <string.h>
17108 # include <strings.h>
17110 #include <sys/types.h>
17111 #include <signal.h>
17113 $volatile int bletched = 0;
17114 $signal_t blech(int s) { bletched = 1; }
17117 int checkit($nvtype d, char *where) {
17118 unsigned char *p = (char *)&d;
17119 unsigned char *end = p + sizeof(d);
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" ;;
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
20673 /* Note that whether the sign bit is on or off
20674 * for NaN depends on the CPU/FPU, and possibly
20675 * can be affected by the build toolchain.
20677 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20678 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20679 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20680 * (respectively) as opposed to the more usual
20681 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20683 * Pre-IEEE-754 floating point format do not even have inf/nan support
20684 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20685 * to even mention, causing immediate SIGFPE or equivalent: this is
20686 * the case with VAX floating point, for example.
20688 static void bytes(unsigned char *p, unsigned int n) {
20690 for (i = 0; i < n; i++) {
20691 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20694 int main(int argc, char *argv[]) {
20695 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20696 * because some compilers are 'smart' and not only warn but refuse to
20697 * compile such 'illegal' values. */
20698 double dinf = exp(1e9);
20699 double dnan = sqrt(-1.0);
20700 #ifdef HAS_LONG_DOUBLE
20701 long double ldinf = (long double)exp(1e9);
20702 long double ldnan = (long double)sqrt(-1.0);
20703 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20704 /* the 80-bit long doubles might have garbage in their excess bytes */
20705 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20706 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20709 switch (argv[1][0]) {
20710 case '1': bytes(&dinf, sizeof(dinf)); break;
20711 case '2': bytes(&dnan, sizeof(dnan)); break;
20712 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20713 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20721 if eval $compile; then
20722 doubleinfbytes=`$run ./try 1`
20723 doublenanbytes=`$run ./try 2`
20724 case "$d_longdbl" in
20726 longdblinfbytes=`$run ./try 3`
20727 longdblnanbytes=`$run ./try 4`
20731 # Defaults in case the above test program failed.
20732 case "$doublekind" in
20733 1) # IEEE 754 32-bit LE
20734 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20735 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20737 2) # IEEE 754 32-bit BE
20738 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20739 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20741 3) # IEEE 754 64-bit LE
20742 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20743 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20745 4) # IEEE 754 64-bit BE
20746 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20747 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20749 5) # IEEE 754 128-bit LE
20750 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20751 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20753 6) # IEEE 754 128-bit BE
20754 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20755 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20757 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20758 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20759 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20761 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20762 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20763 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20765 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20766 doubleinfbytes=$undef
20767 doublenanbytes=$undef
20770 doubleinfbytes=$undef
20771 doublenanbytes=$undef
20774 case "$longdblkind" in
20775 1) # IEEE 754 128-bit LE
20776 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20777 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20779 2) # IEEE 754 128-bit BE
20780 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20781 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20783 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20784 case "$longdblsize" in
20785 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20786 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20787 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20790 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20791 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20794 longdblinfbytes=$undef
20795 longdblnanbytes=$undef
20799 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20800 case "$longdblsize" in
20801 12) # 32-bit system
20802 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20803 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20805 16) # 64-bit system
20806 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20807 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20810 longdblinfbytes=$undef
20811 longdblnanbytes=$undef
20815 5) # 128-bit LE-LE "double double"
20816 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20817 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20819 6) # 128-bit BE-BE "double double"
20820 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20821 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20823 7) # 128-bit LE-BE "double double"
20824 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20825 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20827 8) # 128-bit BE-LE "double double"
20828 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20829 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20831 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20832 longdblinfbytes=$undef
20833 longdblnanbytes=$undef
20836 longdblinfbytes=$undef
20837 longdblnanbytes=$undef
20841 # In case the program crashed the values are empty, turn them undef.
20842 case "$doubleinfbytes" in
20843 '') doubleinfbytes=$undef ;;
20845 case "$doublenanbytes" in
20846 '') doublenanbytes=$undef ;;
20848 case "$longdblinfbytes" in
20849 '') longdblinfbytes=$undef ;;
20851 case "$longdblnanbytes" in
20852 '') longdblnanbytes=$undef ;;
20856 : Check the length of the double mantissa
20857 $echo "Checking how many mantissa bits your doubles have..." >&4
20860 #$i_sunmath I_SUNMATH
20862 # include <float.h>
20865 # include <sunmath.h>
20867 #ifdef DBL_MANT_DIG
20868 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20871 int main(int argc, char *argv[]) {
20873 printf("%d\n", BITS);
20879 if eval $compile; then
20880 doublemantbits=`$run ./try`
20882 doublemantbits="$undef"
20886 : Check the length of the longdouble mantissa
20887 $echo "Checking how many mantissa bits your long doubles have..." >&4
20890 #$i_sunmath I_SUNMATH
20892 # include <float.h>
20895 # include <sunmath.h>
20897 #$d_longdbl HAS_LONG_DOUBLE
20898 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20899 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20900 /* This format has no implicit bit. Beware, however, that for
20901 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20902 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20903 * and the top bit must have been one since 387, zero is plain invalid.
20904 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20905 # define BITS LDBL_MANT_DIG
20906 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20907 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20908 * reason e.g. Irix thinks 107. But in any case, we want only
20909 * the number of real bits, the implicit bits are of no interest. */
20910 # define BITS 2 * (DBL_MANT_DIG - 1)
20912 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20916 int main(int argc, char *argv[]) {
20918 printf("%d\n", BITS);
20924 if eval $compile; then
20925 longdblmantbits=`$run ./try`
20927 longdblmantbits="$undef"
20931 : Check the length of the NV mantissa
20932 $echo "Checking how many mantissa bits your NVs have..." >&4
20933 if test "X$usequadmath" = "X$define"; then
20934 nvmantbits=112 # 128-1-15
20936 if test "X$nvsize" = "X$doublesize"; then
20937 nvmantbits="$doublemantbits"
20939 if test "X$nvsize" = "X$longdblsize"; then
20940 nvmantbits="$longdblmantbits"
20942 nvmantbits="$undef"
20947 : How can we generate normalized random numbers ?
20949 echo "Using our internal random number implementation..." >&4
20952 *-Dmy_rand=*|*-Dmy_srand=*)
20953 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20954 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20955 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20956 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20960 randfunc=Perl_drand48
20961 drand01="Perl_drand48()"
20962 seedfunc="Perl_drand48_init"
20966 : Probe whether dtrace builds an object, as newer Illumos requires an input
20967 : object file that uses at least one of the probes defined in the .d file
20968 case "$usedtrace" in
20970 case "$dtracexnolibs" in
20971 $define|true|[yY]*)
20972 dtracexnolibs=$define
20973 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20976 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20977 dtracexnolibs=$define
20978 echo "Your dtrace accepts -xnolibs"
20979 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20980 dtracexnolibs=$undef
20981 echo "Your dtrace doesn't accept -xnolibs"
20983 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20988 dtracexnolibs=$undef
20989 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20992 case $dtracexnolibs in
20993 $define) xnolibs=-xnolibs ;;
20997 case "$dtraceobject" in
20998 $define|true|[yY]*)
20999 dtraceobject=$define
21003 #include "perldtrace.h"
21005 PERL_LOADED_FILE("dummy");
21009 dtraceobject=$undef
21010 if $cc -c -o try.o $optimize $ccflags try.c \
21011 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21012 dtraceobject=$define
21013 echo "Your dtrace builds an object file"
21016 *) dtraceobject=$undef ;;
21018 $rm -f try.c try.o perldtrace.o perldtrace.h
21021 : Determine if this is an EBCDIC system
21023 echo "Determining whether or not we are on an EBCDIC system..." >&4
21024 $cat >try.c <<'EOM'
21027 if ('M'==0xd4) return 0;
21034 if eval $compile_ok; then
21035 if $run ./try; then
21036 echo "You seem to speak EBCDIC." >&4
21039 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21042 echo "I'm unable to compile the test program." >&4
21043 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21049 : Check how to flush
21052 Checking how to flush all pending stdio output...
21054 # I only know how to find the first 32 possibly open files on SunOS.
21055 # See also hints/sunos_4_1.sh and util.c --AD
21057 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21059 $cat >>try.c <<EOCP
21061 #$i_stdlib I_STDLIB
21063 #include <stdlib.h>
21065 #$i_unistd I_UNISTD
21067 # include <unistd.h>
21069 #$d_sysconf HAS_SYSCONF
21070 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21071 #ifdef HAS_STDIO_STREAM_ARRAY
21072 # define STDIO_STREAM_ARRAY $stdio_stream_array
21077 p = fopen("try.out", "w");
21081 # ifdef TRY_FPRINTF
21085 #ifdef TRY_FFLUSH_NULL
21088 #ifdef TRY_FFLUSH_ALL
21090 long open_max = -1;
21091 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21092 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21094 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21095 open_max = sysconf(_SC_OPEN_MAX);
21098 open_max = FOPEN_MAX;
21101 open_max = OPEN_MAX;
21110 # ifdef HAS_STDIO_STREAM_ARRAY
21111 if (open_max > 0) {
21113 for (i = 0; i < open_max; i++)
21114 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21115 STDIO_STREAM_ARRAY[i]._file < open_max &&
21116 STDIO_STREAM_ARRAY[i]._flag)
21117 fflush(&STDIO_STREAM_ARRAY[i]);
21125 : first we have to find out how _not_ to flush
21127 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21129 set try -DTRY_FPUTC
21130 if eval $compile; then
21131 $run ./try 2>/dev/null
21134 if $test ! -s try.out -a "X$code" = X42; then
21140 set try -DTRY_FPRINTF
21141 if eval $compile; then
21142 $run ./try 2>/dev/null
21145 if $test ! -s try.out -a "X$code" = X42; then
21146 output=-DTRY_FPRINTF
21152 : check for fflush NULL behavior
21153 case "$fflushNULL" in
21154 '') set try -DTRY_FFLUSH_NULL $output
21155 if eval $compile; then
21156 $run ./try 2>/dev/null
21159 if $test -s try.out -a "X$code" = X42; then
21160 fflushNULL="`$cat try.out`"
21162 if $test "X$code" != X42; then
21164 (If this test failed, don't worry, we'll try another method shortly.)
21169 $rm -f core try.core core.try.*
21170 case "$fflushNULL" in
21172 Your fflush(NULL) works okay for output streams.
21173 Let's see if it clobbers input pipes...
21175 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21176 # bug that improperly flushes the input end of pipes. So we avoid the
21177 # autoflush on fork/system/exec support for now. :-(
21178 $cat >tryp.c <<EOCP
21181 main(int argc, char **argv)
21187 while ((i = getc(stdin)) != -1
21188 && (*bp++ = i) != '\n'
21189 && bp < &buf[1024])
21192 fprintf(stdout, "%s", buf);
21200 fflushNULL="$define"
21202 if eval $compile; then
21204 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21205 if $test "X$targethost" != X; then
21208 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21210 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21212 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21214 fflush(NULL) seems to behave okay with input streams.
21216 fflushNULL="$define"
21219 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21221 fflushNULL="$undef"
21224 $rm -f core tryp.c tryp.core core.tryp.*
21227 Your fflush(NULL) isn't working (contrary to ANSI C).
21229 fflushNULL="$undef"
21232 Cannot figure out whether your fflush(NULL) works or not.
21233 I'm assuming it doesn't (contrary to ANSI C).
21235 fflushNULL="$undef"
21239 $define|true|[yY]*)
21240 fflushNULL="$define"
21243 fflushNULL="$undef"
21246 : check explicit looping only if NULL did not work, and if the pipe
21247 : bug does not show up on an explicit flush too
21248 case "$fflushNULL" in
21250 $cat >tryp.c <<EOCP
21253 main(int argc, char **argv)
21259 while ((i = getc(stdin)) != -1
21260 && (*bp++ = i) != '\n'
21261 && bp < &buf[1024])
21264 fprintf(stdout, "%s", buf);
21273 if eval $compile; then
21275 if $test "X$targethost" != X; then
21278 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21280 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21282 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21284 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21286 : now check for fflushall behaviour
21287 case "$fflushall" in
21288 '') set try -DTRY_FFLUSH_ALL $output
21289 if eval $compile; then
21291 (Now testing the other method--but note that this also may fail.)
21293 $run ./try 2>/dev/null
21296 if $test -s try.out -a "X$code" = X42; then
21297 fflushall="`$cat try.out`"
21301 case "$fflushall" in
21303 Whew. Flushing explicitly all the stdio streams works.
21305 fflushall="$define"
21308 Sigh. Flushing explicitly all the stdio streams doesn't work.
21313 Cannot figure out whether flushing stdio streams explicitly works or not.
21314 I'm assuming it doesn't.
21320 "$define"|true|[yY]*)
21321 fflushall="$define"
21329 All is futile. Even fflush(stdin) clobbers input pipes!
21336 $rm -f core tryp.c tryp.core core.tryp.*
21338 *) fflushall="$undef"
21342 case "$fflushNULL$fflushall" in
21345 OK, I give up. I cannot figure out how to flush pending stdio output.
21346 We won't be flushing handles at all before fork/exec/popen.
21352 : Store the full pathname to the ar program for use in the C program
21353 : Respect a hint or command line value for full_ar.
21358 : Store the full pathname to the sed program for use in the C program
21361 : see what type gids are declared as in the kernel
21363 echo "Looking for the type for group ids returned by getgid()."
21364 set gid_t gidtype xxx stdio.h sys/types.h
21368 xxx=`./findhdr sys/user.h`
21369 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21371 unsigned) dflt="$1 $2" ;;
21375 *) dflt="$gidtype";;
21378 gid_t) echo "gid_t found." ;;
21379 *) rp="What is the type for group ids returned by getgid()?"
21385 : Check the size of GID
21388 *_t) zzz="$gidtype" ;;
21391 echo "Checking the size of $zzz..." >&4
21393 #include <sys/types.h>
21395 #$i_stdlib I_STDLIB
21397 #include <stdlib.h>
21400 printf("%d\n", (int)sizeof($gidtype));
21405 if eval $compile_ok; then
21409 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21412 echo "Your $zzz is $gidsize bytes long."
21417 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21421 : Check if GID is signed
21424 *_t) zzz="$gidtype" ;;
21427 echo "Checking the sign of $zzz..." >&4
21429 #include <sys/types.h>
21440 if eval $compile; then
21444 echo "(I can't execute the test program--guessing unsigned.)" >&4
21448 1) echo "Your $zzz is unsigned." ;;
21449 -1) echo "Your $zzz is signed." ;;
21455 echo "(I can't compile the test program--guessing unsigned.)" >&4
21459 : Check 64bit sizes
21462 if $test X"$quadtype" != X; then
21464 echo "Checking how to print 64-bit integers..." >&4
21466 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21467 $cat >try.c <<'EOCP'
21468 #include <sys/types.h>
21471 int q = 12345678901;
21472 printf("%ld\n", q);
21476 if eval $compile; then
21480 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21481 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21482 echo "We will use %d."
21488 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21489 $cat >try.c <<'EOCP'
21490 #include <sys/types.h>
21493 long q = 12345678901;
21494 printf("%ld\n", q);
21498 if eval $compile; then
21502 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21503 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21504 echo "We will use %ld."
21510 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21511 $cat >try.c <<'EOCP'
21512 #include <sys/types.h>
21513 #include <inttypes.h>
21516 int64_t q = 12345678901;
21517 printf("%" PRId64 "\n", q);
21521 if eval $compile; then
21525 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21526 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21527 echo "We will use the C9X style."
21533 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21535 #include <sys/types.h>
21538 $quadtype q = 12345678901;
21539 printf("%Ld\n", q);
21543 if eval $compile; then
21547 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21548 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21549 echo "We will use %Ld."
21555 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21556 $cat >try.c <<'EOCP'
21557 #include <sys/types.h>
21560 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21561 printf("%lld\n", q);
21565 if eval $compile; then
21569 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21570 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21571 echo "We will use the %lld style."
21577 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21579 #include <sys/types.h>
21582 $quadtype q = 12345678901;
21583 printf("%qd\n", q);
21587 if eval $compile; then
21591 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21592 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21593 echo "We will use %qd."
21599 if $test X"$sPRId64" = X; then
21600 echo "Cannot figure out how to print 64-bit integers." >&4
21607 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21608 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21610 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21611 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21615 : Check format strings for internal types
21617 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21619 if $test X"$ivsize" = X8; then
21620 ivdformat="$sPRId64"
21621 uvuformat="$sPRIu64"
21622 uvoformat="$sPRIo64"
21623 uvxformat="$sPRIx64"
21624 uvXUformat="$sPRIXU64"
21626 if $test X"$ivsize" = X"$longsize"; then
21633 if $test X"$ivsize" = X"$intsize"; then
21641 if $test X"$ivsize" = X"$shortsize"; then
21652 if $test X"$usequadmath" = X"$define"; then
21660 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21661 nveformat="$sPRIeldbl"
21662 nvfformat="$sPRIfldbl"
21663 nvgformat="$sPRIgldbl"
21664 nvEUformat="$sPRIEUldbl"
21665 nvFUformat="$sPRIFUldbl"
21666 nvGUformat="$sPRIGUldbl"
21677 case "$ivdformat" in
21678 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21683 : Check format string for GID
21686 $echo "Checking the format string to be used for gids..." >&4
21689 -1) if $test X"$gidsize" = X"$ivsize"; then
21690 gidformat="$ivdformat"
21692 if $test X"$gidsize" = X"$longsize"; then
21695 if $test X"$gidsize" = X"$intsize"; then
21698 if $test X"$gidsize" = X"$shortsize"; then
21705 *) if $test X"$gidsize" = X"$uvsize"; then
21706 gidformat="$uvuformat"
21708 if $test X"$gidsize" = X"$longsize"; then
21711 if $test X"$gidsize" = X"$intsize"; then
21714 if $test X"$gidsize" = X"$shortsize"; then
21723 : see if getgroups exists
21724 set getgroups d_getgrps
21727 : see if setgroups exists
21728 set setgroups d_setgrps
21731 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21733 case "$d_getgrps$d_setgrps" in
21735 case "$groupstype" in
21736 '') dflt="$gidtype" ;;
21737 *) dflt="$groupstype" ;;
21740 What type of pointer is the second argument to getgroups() and setgroups()?
21741 Usually this is the same as group ids, $gidtype, but not always.
21744 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21748 *) groupstype="$gidtype";;
21751 : check whether make sets MAKE
21753 echo "Checking if your $make program sets \$(MAKE)..." >&4
21754 case "$make_set_make" in
21756 $sed 's/^X //' > testmake.mak << 'EOF'
21758 X @echo 'maketemp="$(MAKE)"'
21760 case "`$make -f testmake.mak 2>/dev/null`" in
21761 *maketemp=*) make_set_make='#' ;;
21762 *) make_set_make="MAKE=$make" ;;
21764 $rm -f testmake.mak
21767 case "$make_set_make" in
21768 '#') echo "Yup, it does.";;
21769 *) echo "Nope, it doesn't.";;
21772 : see what type is used for mode_t
21773 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21774 set mode_t modetype int stdio.h sys/types.h
21777 : see if we need va_copy
21779 case "$i_stdarg" in
21782 #include <stdarg.h>
21784 #$i_stdlib I_STDLIB
21786 #include <stdlib.h>
21788 #include <signal.h>
21791 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21793 return vfprintf(f, fmt, *valp);
21797 myvfprintf(FILE *f, const char *fmt, va_list val)
21799 return ivfprintf(f, fmt, &val);
21803 myprintf(char *fmt, ...)
21806 va_start(val, fmt);
21807 return myvfprintf(stdout, fmt, val);
21811 main(int ac, char **av)
21813 signal(SIGSEGV, exit);
21815 myprintf("%s%cs all right, then\n", "that", '\'');
21820 if eval $compile && $run ./try 2>&1 >/dev/null; then
21821 case "`$run ./try`" in
21822 "that's all right, then")
21828 yes) echo "It seems that you don't need va_copy()." >&4
21829 need_va_copy="$undef"
21831 *) echo "It seems that va_copy() or similar will be needed." >&4
21832 need_va_copy="$define"
21837 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21838 need_va_copy="$undef"
21842 : see what type is used for size_t
21843 rp="What is the type used for the length parameter for string functions?"
21844 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21847 : check for type of arguments to gethostbyaddr.
21848 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21849 case "$d_gethbyaddr" in
21853 Checking to see what type of arguments are accepted by gethostbyaddr().
21855 hdrs="$define sys/types.h
21856 $d_socket sys/socket.h
21857 $i_niin netinet/in.h
21859 $i_unistd unistd.h"
21860 : The first arg can 'char *' or 'void *'
21861 : The second arg is some of integral type
21862 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21863 for yyy in size_t long int; do
21864 case "$netdb_host_type" in
21865 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21866 if ./protochk "$try" $hdrs; then
21867 echo "Your system accepts $xxx for the first arg."
21868 echo "...and $yyy for the second arg."
21869 netdb_host_type="$xxx"
21870 netdb_hlen_type="$yyy"
21876 : In case none of those worked, prompt the user.
21877 case "$netdb_host_type" in
21878 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21881 netdb_host_type=$ans
21882 rp='What is the type for the 2nd argument to gethostbyaddr?'
21885 netdb_hlen_type=$ans
21889 *) : no gethostbyaddr, so pick harmless defaults
21890 netdb_host_type='char *'
21891 netdb_hlen_type="$sizetype"
21894 # Remove the "const" if needed. -- but then we'll have a
21896 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21899 : check for type of argument to gethostbyname.
21900 if test "X$netdb_name_type" = X ; then
21901 case "$d_gethbyname" in
21905 Checking to see what type of argument is accepted by gethostbyname().
21907 hdrs="$define sys/types.h
21908 $d_socket sys/socket.h
21909 $i_niin netinet/in.h
21911 $i_unistd unistd.h"
21912 for xxx in "const char *" "char *"; do
21913 case "$netdb_name_type" in
21914 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21915 if ./protochk "$try" $hdrs; then
21916 echo "Your system accepts $xxx."
21917 netdb_name_type="$xxx"
21922 : In case none of those worked, prompt the user.
21923 case "$netdb_name_type" in
21924 '') rp='What is the type for the 1st argument to gethostbyname?'
21927 netdb_name_type=$ans
21931 *) : no gethostbyname, so pick harmless default
21932 netdb_name_type='char *'
21937 : check for type of 1st argument to getnetbyaddr.
21938 if test "X$netdb_net_type" = X ; then
21939 case "$d_getnbyaddr" in
21943 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21945 hdrs="$define sys/types.h
21946 $d_socket sys/socket.h
21947 $i_niin netinet/in.h
21949 $i_unistd unistd.h"
21950 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21951 case "$netdb_net_type" in
21952 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21953 if ./protochk "$try" $hdrs; then
21954 echo "Your system accepts $xxx."
21955 netdb_net_type="$xxx"
21960 : In case none of those worked, prompt the user.
21961 case "$netdb_net_type" in
21962 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21965 netdb_net_type=$ans
21969 *) : no getnetbyaddr, so pick harmless default
21970 netdb_net_type='long'
21974 : locate the preferred pager for this system
21981 [a-zA-Z]:/*) dflt=$pg;;
21985 [a-zA-Z]:/*) dflt=$more;;
21989 [a-zA-Z]:/*) dflt=$less;;
21992 '') dflt=/usr/ucb/more;;
22000 rp='What pager is used on your system?'
22004 : see if ar generates random libraries by itself
22006 echo "Checking how to generate random libraries on your machine..." >&4
22007 echo 'int bar1() { return bar2(); }' > bar1.c
22008 echo 'int bar2() { return 2; }' > bar2.c
22010 #$i_stdlib I_STDLIB
22012 #include <stdlib.h>
22014 int main() { printf("%d\n", bar1()); exit(0); }
22016 $cc $ccflags -c bar1.c >/dev/null 2>&1
22017 $cc $ccflags -c bar2.c >/dev/null 2>&1
22018 $cc $ccflags -c foo.c >/dev/null 2>&1
22019 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22020 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22021 $run ./foobar >/dev/null 2>&1; then
22022 echo "$ar appears to generate random libraries itself."
22024 if [ "X$ranlib" = "X" ]; then
22027 elif $ar s bar$_a >/dev/null 2>&1 &&
22028 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22029 $run ./foobar >/dev/null 2>&1; then
22030 echo "a table of contents needs to be added with '$ar s'."
22033 elif $ar ts bar$_a >/dev/null 2>&1 &&
22034 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22035 $run ./foobar >/dev/null 2>&1; then
22036 echo "a table of contents needs to be added with '$ar ts'."
22043 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22044 $test -f $ranlib || ranlib=''
22047 if $test -n "$ranlib"; then
22048 echo "your system has '$ranlib'; we'll use that."
22051 echo "your system doesn't seem to support random libraries"
22052 echo "so we'll use lorder and tsort to order the libraries."
22059 : see if this is a values.h system
22060 set values.h i_values
22063 : Check the max offset that gmtime and localtime accept
22064 echo "Checking max offsets that gmtime () accepts"
22067 define) yyy="#include <values.h>" ;;
22071 case "$sGMTIME_min/$sGMTIME_max" in
22074 #include <sys/types.h>
22083 void gm_check (time_t t, int min_year, int max_year)
22086 if ( tmp == NULL ||
22087 /* Check tm_year overflow */
22088 tmp->tm_year < min_year || tmp->tm_year > max_year)
22099 gm_check (MAXLONG, 69, 0x7fffffff);
22101 if (tmp == NULL || tmp->tm_year < 0) {
22102 for (i = 63; i >= 0; i--) {
22103 time_t x = pt | ((time_t)1 << i);
22104 if (x < 0 || x < pt) continue;
22105 gm_check (x, 69, 0x7fffffff);
22108 printf ("sGMTIME_max=%ld\n", pt);
22117 gm_check (MINLONG, -1900, 70);
22120 for (i = 36; i >= 0; i--) {
22121 time_t x = pt - ((time_t)1 << i);
22122 if (x > 0) continue;
22123 gm_check (x, -1900, 70);
22126 printf ("sGMTIME_min=%ld\n", pt);
22130 int main (int argc, char *argv[])
22132 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22139 if eval $compile; then
22140 eval `$run ./try 2>/dev/null`
22142 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22148 echo "Checking max offsets that localtime () accepts"
22150 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22153 #include <sys/types.h>
22162 void local_check (time_t t, int min_year, int max_year)
22164 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22167 tmp = localtime (&t);
22168 if ( tmp == NULL ||
22169 /* Check tm_year overflow */
22170 tmp->tm_year < min_year || tmp->tm_year > max_year)
22174 } /* local_check */
22181 local_check (MAXLONG, 69, 0x7fffffff);
22183 if (tmp == NULL || tmp->tm_year < 0) {
22184 for (i = 63; i >= 0; i--) {
22185 time_t x = pt | ((time_t)1 << i);
22186 if (x < 0 || x < pt) continue;
22187 local_check (x, 69, 0x7fffffff);
22190 printf ("sLOCALTIME_max=%ld\n", pt);
22199 local_check (MINLONG, -1900, 70);
22202 for (i = 36; i >= 0; i--) {
22203 time_t x = pt - ((time_t)1 << i);
22204 if (x > 0) continue;
22205 local_check (x, -1900, 70);
22208 printf ("sLOCALTIME_min=%ld\n", pt);
22212 int main (int argc, char *argv[])
22220 if eval $compile; then
22221 eval `$run ./try 2>/dev/null`
22223 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22229 : check for type of arguments to select.
22230 case "$selecttype" in
22231 '') case "$d_select" in
22235 Checking to see what type of arguments are accepted by select().
22237 hdrs="$define sys/types.h
22238 $i_systime sys/time.h
22239 $i_sysselct sys/select.h
22240 $d_socket sys/socket.h"
22241 : The first arg can be int, unsigned, or size_t
22242 : The last arg may or may not be 'const'
22244 : void pointer has been seen but using that
22245 : breaks the selectminbits test
22246 for xxx in 'fd_set *' 'int *'; do
22247 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22248 for tmo in 'struct timeval *' 'const struct timeval *'; do
22250 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22251 if ./protochk "$try" $hdrs; then
22252 echo "Your system accepts $xxx."
22261 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22262 case "$d_fd_set" in
22263 $define) dflt="fd_set *" ;;
22272 *) : no select, so pick a harmless default
22279 : check for the select 'width'
22280 case "$selectminbits" in
22281 '') safebits=`expr $ptrsize \* 8`
22282 case "$d_select" in
22286 Checking to see on how many bits at a time your select() operates...
22289 #include <sys/types.h>
22291 #$i_systime I_SYS_TIME
22292 #$i_systimek I_SYS_TIME_KERNEL
22297 # ifdef I_SYS_TIME_KERNEL
22300 # include <sys/time.h>
22301 # ifdef I_SYS_TIME_KERNEL
22305 #$i_sysselct I_SYS_SELECT
22306 #ifdef I_SYS_SELECT
22307 #include <sys/select.h>
22309 #$d_socket HAS_SOCKET
22311 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22314 #$i_stdlib I_STDLIB
22316 #include <stdlib.h>
22319 #define S sizeof(*(b))
22321 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22322 #define NBITS (NBYTES * 8)
22324 char *s = (char *)malloc(NBYTES);
22333 fp = fopen("try.c", "r");
22339 b = ($selecttype)s;
22340 for (i = 0; i < NBITS; i++)
22344 select(fd + 1, b, 0, 0, &t);
22345 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22347 printf("%d\n", i + 1);
22352 if eval $compile_ok; then
22353 selectminbits=`$run ./try 2>/dev/null`
22354 case "$selectminbits" in
22356 Cannot figure out on how many bits at a time your select() operates.
22357 I'll play safe and guess it is $safebits bits.
22359 selectminbits=$safebits
22360 bits="$safebits bits"
22363 *) bits="$selectminbits bits" ;;
22365 echo "Your select() operates on $bits at a time." >&4
22367 rp='What is the minimum number of bits your select() operates on?'
22368 case "$byteorder" in
22369 12345678) dflt=64 ;;
22375 selectminbits="$val"
22379 *) : no select, so pick a harmless default
22380 selectminbits=$safebits
22386 : Trace out the files included by signal.h, then look for SIGxxx names.
22387 case "$sig_num_init" in
22389 if [ "X$fieldn" = X ]; then
22390 : Just make some guesses. We check them later.
22391 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22393 xxx=`echo '#include <signal.h>' |
22394 $cppstdin $cppminus $cppflags 2>/dev/null |
22395 $grep '^[ ]*#.*include' |
22396 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22397 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22400 for xx in $xxx /dev/null ; do
22401 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22403 case "$xxxfiles" in
22404 '') xxxfiles=`./findhdr signal.h` ;;
22407 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22408 print substr($2, 4, 20)
22410 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22411 print substr($3, 4, 20)
22413 : Append some common names just in case the awk scan failed.
22414 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22415 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22416 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22417 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22418 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22420 : generate a few handy files for later
22421 $cat > signal.c <<EOCP
22422 #include <sys/types.h>
22423 #include <signal.h>
22424 #$i_stdlib I_STDLIB
22426 #include <stdlib.h>
22431 /* Strange style to avoid deeply-nested #if/#else/#endif */
22434 # define NSIG (_NSIG)
22440 # define NSIG (SIGMAX+1)
22446 # define NSIG (SIG_MAX+1)
22452 # define NSIG (_SIG_MAX+1)
22458 # define NSIG (MAXSIG+1)
22464 # define NSIG (MAX_SIG+1)
22469 # ifdef SIGARRAYSIZE
22470 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22476 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22480 /* Default to some arbitrary number that's big enough to get most
22481 of the common signals.
22487 printf("NSIG %d\n", NSIG);
22493 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22495 printf "#ifdef SIG"; printf $1; printf "\n"
22496 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22497 printf $1; printf ");\n"
22501 printf "#endif /* JUST_NSIG */\n";
22502 printf "exit(0);\n}\n";
22505 $cat >signal.awk <<'EOP'
22506 BEGIN { ndups = 0 }
22507 $1 ~ /^NSIG$/ { nsig = $2 }
22508 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22509 if ($2 > maxsig) { maxsig = $2 }
22510 if (sig_name[$2]) {
22511 dup_name[ndups] = $1
22512 dup_num[ndups] = $2
22524 printf("NSIG %d\n", nsig);
22525 for (n = 1; n < nsig; n++) {
22527 printf("%s %d\n", sig_name[n], sig_num[n])
22530 printf("NUM%d %d\n", n, n)
22533 for (n = 0; n < ndups; n++) {
22534 printf("%s %d\n", dup_name[n], dup_num[n])
22538 $cat >signal_cmd <<EOS
22540 if $test -s signal.lst; then
22541 echo "Using your existing signal.lst file"
22546 $cat >>signal_cmd <<'EOS'
22549 if eval $compile_ok; then
22550 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22551 $uniq | $awk -f signal.awk >signal.lst
22553 echo "(I can't seem be able to compile the whole test program)" >&4
22554 echo "(I'll try it in little pieces.)" >&4
22555 set signal -DJUST_NSIG
22556 if eval $compile_ok; then
22557 $run ./signal$_exe > signal.nsg
22560 echo "I can't seem to figure out how many signals you have." >&4
22561 echo "Guessing 50." >&4
22562 echo 'NSIG 50' > signal.nsg
22564 : Now look at all the signal names, one at a time.
22565 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22566 $cat > signal.c <<EOCP
22567 #include <sys/types.h>
22568 #include <signal.h>
22571 printf("$xx %d\n", SIG${xx});
22576 if eval $compile; then
22577 echo "SIG${xx} found."
22578 $run ./signal$_exe >> signal.ls1
22580 echo "SIG${xx} NOT found."
22583 if $test -s signal.ls1; then
22584 $cat signal.nsg signal.ls1 |
22585 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22589 if $test -s signal.lst; then
22592 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22593 echo 'kill -l' >signal
22594 set X `csh -f <signal`
22598 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22600 echo $@ | $tr ' ' $trnl | \
22601 $awk '{ printf "%s %d\n", $1, ++s; }
22602 END { printf "NSIG %d\n", ++s }' >signal.lst
22604 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22606 chmod a+x signal_cmd
22607 $eunicefix signal_cmd
22611 : generate list of signal names
22612 case "$sig_num_init" in
22615 case "$sig_name_init" in
22617 *) case "$sig_num_init" in
22618 ''|*,*) doinit=yes ;;
22623 echo "Generating a list of signal names and numbers..." >&4
22625 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22626 sig_name=`$awk 'BEGIN { printf "ZERO " }
22627 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22628 sig_num=`$awk 'BEGIN { printf "0 " }
22629 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22630 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22631 !/^NSIG/ { printf "\"%s\", ", $1 }
22632 END { printf "0\n" }' signal.lst`
22633 sig_num_init=`$awk 'BEGIN { printf "0, " }
22634 !/^NSIG/ { printf "%d, ", $2}
22635 END { printf "0\n"}' signal.lst`
22638 echo "The following $sig_count signals are available:"
22640 echo $sig_name | $awk \
22641 'BEGIN { linelen = 0 }
22643 for (i = 1; i <= NF; i++) {
22644 name = "SIG" $i " "
22645 linelen = linelen + length(name)
22646 if (linelen > 70) {
22648 linelen = length(name)
22654 sig_size=`echo $sig_name | awk '{print NF}'`
22655 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22659 : Check size of size
22661 case "$sizetype" in
22662 *_t) zzz="$sizetype" ;;
22663 *) zzz="filesize" ;;
22665 echo "Checking the size of $zzz..." >&4
22667 #include <sys/types.h>
22669 #$i_stdlib I_STDLIB
22671 #include <stdlib.h>
22674 printf("%d\n", (int)sizeof($sizetype));
22679 if eval $compile_ok; then
22683 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22686 echo "Your $zzz size is $sizesize bytes."
22691 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22695 : check for socklen_t
22697 echo "Checking to see if you have socklen_t..." >&4
22699 #include <sys/types.h>
22700 #$d_socket HAS_SOCKET
22702 #include <sys/socket.h>
22704 int main() { socklen_t x = 16; }
22707 if eval $compile; then
22709 echo "You have socklen_t."
22712 echo "You do not have socklen_t."
22713 case "$sizetype" in
22714 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22721 : see if this is a socks.h system
22722 set socks.h i_socks
22725 : check for type of the size argument to socket calls
22726 case "$d_socket" in
22730 Checking to see what type is the last argument of accept().
22733 case "$d_socklen_t" in
22734 "$define") yyy="$yyy socklen_t"
22736 yyy="$yyy $sizetype int long unsigned"
22737 for xxx in $yyy; do
22738 case "$socksizetype" in
22739 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22740 case "$usesocks" in
22742 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22743 echo "Your system accepts '$xxx *' for the last argument of accept()."
22744 socksizetype="$xxx"
22747 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22748 echo "Your system accepts '$xxx *' for the last argument of accept()."
22749 socksizetype="$xxx"
22756 : In case none of those worked, prompt the user.
22757 case "$socksizetype" in
22758 '') rp='What is the type for socket address structure sizes?'
22765 *) : no sockets, so pick relatively harmless default
22770 : see what type is used for signed size_t
22771 set ssize_t ssizetype int stdio.h sys/types.h
22776 #$i_stdlib I_STDLIB
22778 #include <stdlib.h>
22780 #include <sys/types.h>
22781 #define Size_t $sizetype
22782 #define SSize_t $dflt
22785 if (sizeof(Size_t) == sizeof(SSize_t))
22787 else if (sizeof(Size_t) == sizeof(int))
22796 if eval $compile_ok && $run ./try > /dev/null; then
22797 ssizetype=`$run ./try`
22798 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22801 Help! I can't compile and run the ssize_t test program: please enlighten me!
22802 (This is probably a misconfiguration in your system or libraries, and
22803 you really ought to fix it. Still, I'll try anyway.)
22805 I need a type that is the same size as $sizetype, but is guaranteed to
22806 be signed. Common values are ssize_t, int and long.
22809 rp="What signed type is the same size as $sizetype?"
22815 : Check the size of st_ino
22817 $echo "Checking the size of st_ino..." >&4
22818 $cat > try.c <<EOCP
22819 #include <sys/stat.h>
22821 #$i_stdlib I_STDLIB
22823 #include <stdlib.h>
22827 printf("%d\n", (int)sizeof(st.st_ino));
22832 if eval $compile_ok; then
22836 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22838 *) st_ino_size=$val
22839 $echo "Your st_ino is $st_ino_size bytes long."
22844 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22848 : Check if st_ino is signed
22850 $echo "Checking the sign of st_ino..." >&4
22851 $cat > try.c <<EOCP
22852 #include <sys/stat.h>
22857 if (foo.st_ino < 0)
22864 if eval $compile; then
22868 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22870 *) st_ino_sign=$val
22871 case "$st_ino_sign" in
22872 1) $echo "Your st_ino is unsigned." ;;
22873 -1) $echo "Your st_ino is signed." ;;
22879 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22883 : see what type of char stdio uses.
22885 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22886 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22887 echo "Your stdio uses unsigned chars." >&4
22888 stdchar="unsigned char"
22890 echo "Your stdio uses signed chars." >&4
22895 : Check size of UID
22898 *_t) zzz="$uidtype" ;;
22901 echo "Checking the size of $zzz..." >&4
22903 #include <sys/types.h>
22905 #$i_stdlib I_STDLIB
22907 #include <stdlib.h>
22910 printf("%d\n", (int)sizeof($uidtype));
22915 if eval $compile_ok; then
22919 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22922 echo "Your $zzz is $uidsize bytes long."
22927 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22930 : Check if UID is signed
22933 *_t) zzz="$uidtype" ;;
22936 echo "Checking the sign of $zzz..." >&4
22938 #include <sys/types.h>
22949 if eval $compile; then
22953 echo "(I can't execute the test program--guessing unsigned.)" >&4
22957 1) echo "Your $zzz is unsigned." ;;
22958 -1) echo "Your $zzz is signed." ;;
22964 echo "(I can't compile the test program--guessing unsigned.)" >&4
22968 : Check format string for UID
22970 $echo "Checking the format string to be used for uids..." >&4
22973 -1) if $test X"$uidsize" = X"$ivsize"; then
22974 uidformat="$ivdformat"
22976 if $test X"$uidsize" = X"$longsize"; then
22979 if $test X"$uidsize" = X"$intsize"; then
22982 if $test X"$uidsize" = X"$shortsize"; then
22989 *) if $test X"$uidsize" = X"$uvsize"; then
22990 uidformat="$uvuformat"
22992 if $test X"$uidsize" = X"$longsize"; then
22995 if $test X"$uidsize" = X"$intsize"; then
22998 if $test X"$uidsize" = X"$shortsize"; then
23007 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23009 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23010 $cat >try.c <<'EOM'
23011 /* Intentionally a long probe as I'd like to sanity check that the exact
23012 approach is going to work, as thinking it will work, but only having it
23013 part working at runtime is worse than not having it. */
23015 #include <sys/types.h>
23016 #include <sys/sysctl.h>
23017 #include <sys/param.h>
23019 #include <string.h>
23020 #include <stdlib.h>
23021 #include <unistd.h>
23024 main(int argc, char **argv) {
23026 char *argv_leaf = strrchr(argv[0], '/');
23032 mib[1] = KERN_PROC;
23033 mib[2] = KERN_PROC_PATHNAME;
23037 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23041 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23046 if (size < strlen(argv_leaf) + 1) {
23047 fprintf(stderr, "size %lu is too short for a path\n",
23048 (unsigned long) size);
23052 if (size > MAXPATHLEN * MAXPATHLEN) {
23053 fprintf(stderr, "size %lu is too long for a path\n",
23054 (unsigned long) size);
23058 buffer = malloc(size);
23064 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23069 if (strlen(buffer) + 1 != size) {
23070 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23071 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23076 if (*buffer != '/') {
23077 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23081 if (strstr(buffer, "/./")) {
23082 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23086 if (strstr(buffer, "/../")) {
23087 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23091 buffer_leaf = strrchr(buffer, '/');
23092 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23093 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23105 if eval $compile; then
23106 if $run ./try; then
23107 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23110 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23114 echo "I'm unable to compile the test program." >&4
23115 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23119 set usekernprocpathname
23122 : Determine if we can use _NSGetExecutablePath to find executing program
23124 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23125 $cat >try.c <<'EOM'
23126 /* Intentionally a long probe as I'd like to sanity check that the exact
23127 approach is going to work, as thinking it will work, but only having it
23128 part working at runtime is worse than not having it. */
23129 #include <mach-o/dyld.h>
23131 #include <stdlib.h>
23132 #include <sys/param.h>
23133 #include <string.h>
23136 main(int argc, char **argv) {
23138 uint32_t size = sizeof(buf);
23142 char *argv_leaf = strrchr(argv[0], '/');
23146 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23150 _NSGetExecutablePath(buf, &size);
23151 if (size > MAXPATHLEN * MAXPATHLEN) {
23152 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23153 (unsigned int) size);
23157 buffer = malloc(size);
23163 result = _NSGetExecutablePath(buffer, &size);
23165 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23166 result, (unsigned int) size);
23170 tidied = realpath(buffer, NULL);
23172 perror("realpath");
23178 if (*tidied != '/') {
23179 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23183 if (strstr(tidied, "/./")) {
23184 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23188 if (strstr(tidied, "/../")) {
23189 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23193 tidied_leaf = strrchr(tidied, '/');
23194 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23195 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23207 if eval $compile; then
23208 if $run ./try; then
23209 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23212 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23215 echo "I'm unable to compile the test program." >&4
23216 echo "I'll assume no _NSGetExecutablePath here." >&4
23219 set usensgetexecutablepath
23222 : Check if site customization support was requested
23223 case "$usesitecustomize" in
23224 $define|true|[Yy]*)
23225 usesitecustomize="$define"
23228 usesitecustomize="$undef"
23232 : see if prototypes support variable argument declarations
23234 case "$prototype$i_stdarg" in
23236 echo "It appears we'll be able to prototype varargs functions." >&4
23240 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23247 : determine compiler compiler
23256 if $test -f "$byacc$_exe"; then
23258 comp="byacc or $comp"
23260 if $test -f "$bison$_exe"; then
23261 comp="$comp or bison -y"
23263 rp="Which compiler compiler ($comp) shall I use?"
23272 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23278 : see if this is a assert.h system
23279 set assert.h i_assert
23282 : see if this is a bfd.h system
23286 : see if this is an execinfo.h system
23287 set execinfo.h i_execinfo
23290 : see if this is a fenv.h system
23294 : see if this is a fp.h system
23298 : see if this is a fp_class.h system
23299 set fp_class.h i_fp_class
23302 : see if gdbm.h is available
23307 : see if gdbm_open exists
23308 set gdbm_open d_gdbm_open
23310 case "$d_gdbm_open" in
23313 echo "We won't be including <gdbm.h>"
23322 : see if this is a ieeefp.h system
23323 case "$i_ieeefp" in
23324 '' ) set ieeefp.h i_ieeefp
23329 : see if this is a libutil.h system
23330 set libutil.h i_libutil
23333 : see if mach cthreads are available
23334 if test "X$usethreads" = "X$define"; then
23335 set mach/cthreads.h i_machcthr
23338 i_machcthr="$undef"
23341 : see if this is a mntent.h system
23342 set mntent.h i_mntent
23345 : see if net/errno.h is available
23347 set net/errno.h val
23350 : Unfortunately, it causes problems on some systems. Arrgh.
23353 cat > try.c <<'EOM'
23356 #include <net/errno.h>
23362 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23363 echo "We'll be including <net/errno.h>." >&4
23365 echo "We won't be including <net/errno.h>." >&4
23374 : see if netinet/tcp.h is available
23375 set netinet/tcp.h i_netinettcp
23378 : see if this is a poll.h system
23382 : see if this is a prot.h system
23386 : Preprocessor symbols
23388 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23389 $cat <<'EOSH' > Cppsym.know
23390 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23391 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23392 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23393 arch_pwr ardent ARM ARM32 atarist att386 att3b
23394 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23395 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23396 byteorder byte_order
23397 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23398 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23399 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23400 ELF encore EPI EXTENSIONS
23401 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23402 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23403 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23404 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23405 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23406 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23407 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23408 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23409 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23411 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23412 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23413 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23415 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23416 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23417 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23418 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23419 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23420 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23421 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23422 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23423 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23424 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23425 ns32000 ns32016 ns32332 ns32k nsc32000
23426 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23427 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23428 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23429 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23431 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23432 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23433 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23434 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23435 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23436 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23437 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23438 SYSV4 SYSV5 sysV68 sysV88
23439 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23440 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23441 tower32_800 tower32_850 tss
23442 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23443 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23444 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23445 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23446 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23447 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23449 vax venix VMESA vms
23450 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23451 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23454 # Maybe put other stuff here too.
23455 ./tr '-' '_' <<EOSH >>Cppsym.know
23458 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23459 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23460 $cat Cppsym.know > Cppsym.c
23461 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23462 $rm -f Cppsym.a Cppsym.b Cppsym.c
23463 cat <<EOSH > Cppsym
23465 if $test \$# -gt 0; then
23466 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23467 if $test -s Cppsym.got; then
23474 $tr " " "$trnl" | ./Cppsym.try
23480 cat <<EOSH > Cppsym.try
23482 cat <<'EOCP' > try.c
23485 #define STRINGIFY(a) "a"
23487 #if cpp_stuff == 42
23488 #define StGiFy(a) #a
23489 #define STRINGIFY(a) StGiFy(a)
23491 #if $cpp_stuff != 1 && $cpp_stuff != 42
23492 # include "Bletch: How does this C preprocessor stringify macros?"
23498 cat <<'EOSH' >> Cppsym.try
23500 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23501 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23502 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23503 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23505 echo 'return 0;}' >> try.c
23507 cat <<EOSH >> Cppsym.try
23509 case "$osname-$gccversion" in
23510 irix-) ccflags="\$ccflags -woff 1178" ;;
23511 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23513 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23515 chmod +x Cppsym.try
23516 $eunicefix Cppsym.try
23517 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23518 : Add in any Linux cpp "predefined macros":
23519 case "$osname::$gccversion" in
23520 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23522 rm -f $tHdrH'.h' $tHdrH
23524 # Filter out macro arguments, such as Linux's __INT8_C(c)
23525 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23526 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23527 if [ -s $tHdrH'_cppsym.real' ]; then
23528 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23531 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23534 : now check the C compiler for additional symbols
23535 postprocess_cc_v=''
23537 aix) postprocess_cc_v="|$tr , ' '" ;;
23544 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23547 -D*) echo "\$i" | $sed 's/^-D//';;
23548 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23553 postprocess_cc_v=''
23556 ./ccsym > ccsym1.raw
23557 if $test -s ccsym1.raw; then
23558 $sort ccsym1.raw | $uniq >ccsym.raw
23560 mv ccsym1.raw ccsym.raw
23563 $awk '/\=/ { print $0; next }
23564 { print $0"=1" }' ccsym.raw >ccsym.list
23565 $comm -13 Cppsym.true ccsym.list >ccsym.own
23566 $comm -12 Cppsym.true ccsym.list >ccsym.com
23567 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23569 if $test -z ccsym.raw; then
23570 echo "Your C compiler doesn't seem to define any symbols!" >&4
23572 echo "However, your C preprocessor defines the following symbols:"
23575 cppsymbols=`$cat Cppsym.true`
23576 cppsymbols=`echo $cppsymbols`
23577 cppccsymbols="$cppsymbols"
23579 if $test -s ccsym.com; then
23580 echo "Your C compiler and pre-processor define these symbols:"
23581 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23584 cppccsymbols=`$cat ccsym.com`
23585 cppccsymbols=`echo $cppccsymbols`
23586 $test "$silent" || sleep 1
23588 if $test -s ccsym.cpp; then
23589 $test "$also" && echo " "
23590 echo "Your C pre-processor ${also}defines the following symbols:"
23591 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23593 cppsymbols=`$cat ccsym.cpp`
23594 cppsymbols=`echo $cppsymbols`
23595 $test "$silent" || sleep 1
23597 if $test -s ccsym.own; then
23598 $test "$also" && echo " "
23599 echo "Your C compiler ${also}defines the following cpp symbols:"
23600 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23601 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23602 ccsymbols=`$cat ccsym.own`
23603 ccsymbols=`echo $ccsymbols`
23604 $test "$silent" || sleep 1
23608 : add -D_FORTIFY_SOURCE if feasible and not already there
23609 case "$gccversion" in
23610 [45].*) case "$optimize$ccflags" in
23611 *-O*) case "$ccflags$cppsymbols" in
23612 *_FORTIFY_SOURCE=*) # Don't add it again.
23613 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23615 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23616 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23620 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23624 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23628 : see if this is a termio system
23632 if $test `./findhdr termios.h`; then
23633 set tcsetattr i_termios
23639 "$define") echo "You have POSIX termios.h... good!" >&4;;
23640 *) if ./Cppsym pyr; then
23641 case "`$run /bin/universe`" in
23642 ucb) if $test `./findhdr sgtty.h`; then
23644 echo "<sgtty.h> found." >&4
23646 echo "System is pyramid with BSD universe."
23647 ./warn "<sgtty.h> not found--you could have problems."
23649 *) if $test `./findhdr termio.h`; then
23651 echo "<termio.h> found." >&4
23653 echo "System is pyramid with USG universe."
23654 ./warn "<termio.h> not found--you could have problems."
23658 if $test `./findhdr termio.h`; then
23659 echo "<termio.h> found." >&4
23661 elif $test `./findhdr sgtty.h`; then
23662 echo "<sgtty.h> found." >&4
23665 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23668 if $test `./findhdr sgtty.h`; then
23669 echo "<sgtty.h> found." >&4
23671 elif $test `./findhdr termio.h`; then
23672 echo "<termio.h> found." >&4
23675 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23679 set i_termio; eval $setvar
23680 val=$val2; set i_sgtty; eval $setvar
23681 val=$val3; set i_termios; eval $setvar
23683 : see if stdbool is available
23684 : we want a real compile instead of Inhdr because some Solaris systems
23685 : have stdbool.h, but it can only be used if the compiler indicates it
23686 : is sufficiently c99-compliant.
23690 #include <stdbool.h>
23695 int main(int argc, char **argv)
23701 if eval $compile; then
23702 echo "<stdbool.h> found." >&4
23705 echo "<stdbool.h> NOT found." >&4
23712 : see if stddef is available
23713 set stddef.h i_stddef
23716 : see if stdint is available
23717 set stdint.h i_stdint
23720 : see if sys/access.h is available
23721 set sys/access.h i_sysaccess
23724 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23725 set sys/filio.h i_sysfilio
23728 if $test `./findhdr sys/ioctl.h`; then
23730 echo '<sys/ioctl.h> found.' >&4
23733 if $test $i_sysfilio = "$define"; then
23734 echo '<sys/ioctl.h> NOT found.' >&4
23736 $test $i_sgtty = "$define" && xxx="sgtty.h"
23737 $test $i_termio = "$define" && xxx="termio.h"
23738 $test $i_termios = "$define" && xxx="termios.h"
23739 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23745 : see if socket ioctl defs are in sys/sockio.h
23747 xxx=`./findhdr sys/sockio.h`
23748 if $test "$xxx"; then
23749 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23751 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23754 echo "No socket ioctls found in <sys/sockio.h>." >&4
23759 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23765 : see if this is a syslog.h system
23766 set syslog.h i_syslog
23769 : see if this is a sys/mode.h system
23770 set sys/mode.h i_sysmode
23773 : see if there is a sys/poll.h file
23774 set sys/poll.h i_syspoll
23777 : see if sys/resource.h has to be included
23778 set sys/resource.h i_sysresrc
23781 : see if sys/security.h is available
23782 set sys/security.h i_syssecrt
23785 : see if this is a sys/statvfs.h system
23786 set sys/statvfs.h i_sysstatvfs
23789 : see if this is a sys/un.h system
23790 set sys/un.h i_sysun
23793 : see if this is a sys/utsname.h system
23794 set sys/utsname.h i_sysutsname
23797 : see if this is a syswait system
23798 set sys/wait.h i_syswait
23801 : see if this is a ustat.h system
23802 set ustat.h i_ustat
23805 : see if this is an utime system
23806 set utime.h i_utime
23809 : see if this is a vfork system
23812 set vfork.h i_vfork
23822 echo "Looking for extensions..." >&4
23823 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23824 : contain old or inaccurate or duplicate values.
23825 nonxs_extensions=''
23827 : We do not use find because it might not be available.
23828 : We do not just use MANIFEST because the user may have dropped
23829 : some additional extensions into the source tree and expect them
23832 : Function to recursively find available extensions, ignoring DynaLoader
23833 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23834 : In 5.10.1 and later, extensions are stored in directories
23835 : like File-Glob instead of the older File/Glob/.
23839 DynaLoader|dynaload) ;;
23841 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23842 case "$this_ext" in
23843 Scalar/List/Utils) this_ext="List/Util" ;;
23844 PathTools) this_ext="Cwd" ;;
23846 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23847 if $contains " $this_ext " "$tdir/$$.tmp"; then
23849 echo "Duplicate directories detected for extension $xxx" >&4;
23850 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23851 case "$knowitall" in
23859 echo "Ok. Stopping Configure." >&4;
23860 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23863 echo "Ok. You will need to correct config.sh before running make." >&4;
23865 $ls -1 "$xxx" > "$tdir/$$.tmp";
23866 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23867 xs_extensions="$xs_extensions $this_ext";
23868 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23869 xs_extensions="$xs_extensions $this_ext";
23870 elif $test -d "$xxx"; then
23871 nonxs_extensions="$nonxs_extensions $this_ext";
23873 $rm -f "$tdir/$$.tmp";
23881 eval $find_extensions
23885 eval $find_extensions
23889 eval $find_extensions
23890 set X $xs_extensions
23892 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23893 set X $nonxs_extensions
23895 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23897 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23899 : Now see which are supported on this system.
23901 for xxx in $xs_extensions ; do
23905 amigaos) avail_ext="$avail_ext $xxx" ;;
23910 $define) avail_ext="$avail_ext $xxx" ;;
23913 GDBM_File|gdbm_fil)
23915 $define) avail_ext="$avail_ext $xxx" ;;
23918 I18N/Langinfo|i18n_lan)
23919 case "$i_langinfo$d_nl_langinfo" in
23920 $define$define) avail_ext="$avail_ext $xxx" ;;
23924 : XXX Do we need a useipcsysv variable here
23925 case "${d_msg}${d_sem}${d_shm}" in
23926 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23929 NDBM_File|ndbm_fil)
23932 case "$osname-$use64bitint" in
23935 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23938 *) avail_ext="$avail_ext $xxx" ;;
23943 ODBM_File|odbm_fil)
23944 case "${i_dbm}${i_rpcsvcdbm}" in
23946 case "$d_cplusplus" in
23947 define) ;; # delete as a function name will not work
23948 *) case "$osname-$use64bitint" in
23951 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23954 *) avail_ext="$avail_ext $xxx" ;;
23962 case "$useopcode" in
23963 true|define|y) avail_ext="$avail_ext $xxx" ;;
23967 case "$useposix" in
23968 true|define|y) avail_ext="$avail_ext $xxx" ;;
23972 case "$d_socket" in
23973 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23976 Sys/Syslog|sys/syslog)
23978 amigaos) ;; # not really very useful on AmigaOS
23980 : XXX syslog requires socket
23981 case "$d_socket" in
23982 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23988 case "$usethreads" in
23990 case "$use5005threads" in
23991 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23995 threads|threads/shared)
23996 # threads and threads::shared are special cases.
23997 # To stop people from asking "Perl 5.8.0 was supposed
23998 # to have this new fancy threads implementation but my
23999 # perl doesn't have it" and from people trying to
24000 # (re)install the threads module using CPAN.pm and
24001 # CPAN.pm then offering to reinstall Perl 5.8.0,
24002 # the threads.pm and threads/shared.pm will always be
24003 # there, croaking informatively ("you need to rebuild
24004 # all of Perl with threads, sorry") when threads haven't
24005 # been compiled in.
24007 avail_ext="$avail_ext $xxx"
24013 cygwin) avail_ext="$avail_ext $xxx" ;;
24016 XS/APItest|xs/apitest)
24017 # This is just for testing. Skip it unless we have dynamic loading.
24020 $define) avail_ext="$avail_ext $xxx" ;;
24023 XS/Typemap|xs/typemap)
24024 # This is just for testing. Skip it unless we have dynamic loading.
24026 $define) avail_ext="$avail_ext $xxx" ;;
24029 *) avail_ext="$avail_ext $xxx"
24038 case "$onlyextensions" in
24040 *) keepextensions=''
24041 echo "You have requested that only certain extensions be included..." >&4
24042 for i in $onlyextensions; do
24043 case " $avail_ext " in
24045 echo "Keeping extension $i."
24046 keepextensions="$keepextensions $i"
24048 *) echo "Ignoring extension $i." ;;
24051 avail_ext="$keepextensions"
24055 case "$noextensions" in
24057 *) keepextensions=''
24058 echo "You have requested that certain extensions be ignored..." >&4
24059 for i in $avail_ext; do
24060 case " $noextensions " in
24061 *" $i "*) echo "Ignoring extension $i." ;;
24062 *) echo "Keeping extension $i.";
24063 keepextensions="$keepextensions $i"
24067 avail_ext="$keepextensions"
24071 : Now see which nonxs extensions are supported on this system.
24072 : For now assume all are.
24074 for xxx in $nonxs_extensions ; do
24078 *) nonxs_ext="$nonxs_ext $xxx"
24090 A number of extensions are supplied with $package. You may choose to
24091 compile these extensions for dynamic loading (the default), compile
24092 them into the $package executable (static loading), or not include
24093 them at all. Answer "none" to include no extensions.
24094 Note that DynaLoader is always built and need not be mentioned here.
24097 case "$dynamic_ext" in
24099 : Exclude those listed in static_ext
24101 for xxx in $avail_ext; do
24102 case " $static_ext " in
24104 *) dflt="$dflt $xxx" ;;
24111 *) dflt="$dynamic_ext"
24112 # Perhaps we are reusing an old out-of-date config.sh.
24115 if test X"$dynamic_ext" != X"$avail_ext"; then
24117 NOTICE: Your previous config.sh list may be incorrect.
24118 The extensions now available to you are
24120 but the default list from your previous config.sh is
24132 rp="What extensions do you wish to load dynamically?"
24135 none) dynamic_ext=' ' ;;
24136 *) dynamic_ext="$ans" ;;
24139 case "$static_ext" in
24141 : Exclude those already listed in dynamic linking
24143 for xxx in $avail_ext; do
24144 case " $dynamic_ext " in
24146 *) dflt="$dflt $xxx" ;;
24153 *) dflt="$static_ext"
24160 rp="What extensions do you wish to load statically?"
24163 none) static_ext=' ' ;;
24164 *) static_ext="$ans" ;;
24169 A number of extensions are supplied with $package. Answer "none"
24170 to include no extensions.
24171 Note that DynaLoader is always built and need not be mentioned here.
24174 case "$static_ext" in
24175 '') dflt="$avail_ext" ;;
24176 *) dflt="$static_ext"
24177 # Perhaps we are reusing an old out-of-date config.sh.
24180 if test X"$static_ext" != X"$avail_ext"; then
24182 NOTICE: Your previous config.sh list may be incorrect.
24183 The extensions now available to you are
24185 but the default list from your previous config.sh is
24194 : Exclude those that are not xs extensions
24198 rp="What extensions do you wish to include?"
24201 none) static_ext=' ' ;;
24202 *) static_ext="$ans" ;;
24207 # Encode is a special case. If we are building Encode as a static
24208 # extension, we need to explicitly list its subextensions as well.
24209 # For other nested extensions, this is handled automatically by
24210 # the appropriate Makefile.PL.
24211 case " $static_ext " in
24212 *" Encode "*) # Add the subextensions of Encode
24214 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24215 static_ext="$static_ext Encode/$xxx"
24216 known_extensions="$known_extensions Encode/$xxx"
24222 set X $dynamic_ext $static_ext $nonxs_ext
24226 # Sanity check: We require an extension suitable for use with
24227 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24228 # should show up as failures in the test suite, but it's helpful to
24229 # catch them now.) The 'extensions' list is normally sorted
24230 # alphabetically, so we need to accept either
24231 # DB_File ... Fcntl ... IO ....
24232 # or something like
24233 # Fcntl ... NDBM_File ... IO ....
24234 case " $extensions" in
24235 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24236 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24237 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24238 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24239 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24243 : Remove libraries needed only for extensions
24244 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24245 : The exception is SunOS 4.x, which needs them.
24246 case "${osname}X${osvers}" in
24250 *) case "$usedl" in
24251 $define|true|[yY]*)
24252 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24256 *) perllibs="$libs"
24262 : Remove build directory name from cppstdin so it can be used from
24263 : either the present location or the final installed location.
24265 : Get out of the UU directory to get correct path name.
24267 case "$cppstdin" in
24269 echo "Stripping down cppstdin path name"
24275 : end of configuration questions
24277 echo "End of configuration questions."
24280 : back to where it started
24281 if test -d ../UU; then
24285 : configuration may be unconditionally patched via a 'config.arch' file
24286 if $test -f config.arch; then
24287 echo "I see a config.arch file, loading it." >&4
24291 : configuration may be patched via a 'config.over' file
24292 if $test -f config.over; then
24295 rp='I see a config.over file. Do you wish to load it?'
24298 n*) echo "OK, I'll ignore it.";;
24300 echo "Configuration override changes have been loaded."
24305 : in case they want portability, strip down executable paths
24306 case "$d_portable" in
24309 echo "Stripping down executable paths..." >&4
24310 for file in $loclist $trylist; do
24312 eval $file=`basename $temp`
24317 : create config.sh file
24319 echo "Creating config.sh..." >&4
24320 $spitshell <<EOT >config.sh
24323 # This file was produced by running the Configure script. It holds all the
24324 # definitions figured out by Configure. Should you modify one of these values,
24325 # do not forget to propagate your changes by running "Configure -der". You may
24326 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24329 # Package name : $package
24330 # Source directory : $src
24331 # Configuration time: $cf_time
24332 # Configured by : $cf_by
24333 # Target system : $myuname
24336 : Add in command line options if available
24337 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24339 $spitshell <<EOT >>config.sh
24348 Revision='$Revision'
24356 alignbytes='$alignbytes'
24357 ansi2knr='$ansi2knr'
24358 aphostname='$aphostname'
24359 api_revision='$api_revision'
24360 api_subversion='$api_subversion'
24361 api_version='$api_version'
24362 api_versionstring='$api_versionstring'
24365 archlibexp='$archlibexp'
24366 archname64='$archname64'
24367 archname='$archname'
24368 archobjs='$archobjs'
24369 asctime_r_proto='$asctime_r_proto'
24378 byteorder='$byteorder'
24380 castflags='$castflags'
24383 cccdlflags='$cccdlflags'
24384 ccdlflags='$ccdlflags'
24386 ccflags_uselargefiles='$ccflags_uselargefiles'
24388 ccsymbols='$ccsymbols'
24389 ccversion='$ccversion'
24391 cf_email='$cf_email'
24393 charbits='$charbits'
24394 charsize='$charsize'
24398 clocktype='$clocktype'
24400 compress='$compress'
24401 contains='$contains'
24405 cpp_stuff='$cpp_stuff'
24406 cppccsymbols='$cppccsymbols'
24407 cppflags='$cppflags'
24409 cppminus='$cppminus'
24411 cppstdin='$cppstdin'
24412 cppsymbols='$cppsymbols'
24413 crypt_r_proto='$crypt_r_proto'
24414 cryptlib='$cryptlib'
24416 ctermid_r_proto='$ctermid_r_proto'
24417 ctime_r_proto='$ctime_r_proto'
24418 d_Gconvert='$d_Gconvert'
24419 d_PRIEUldbl='$d_PRIEUldbl'
24420 d_PRIFUldbl='$d_PRIFUldbl'
24421 d_PRIGUldbl='$d_PRIGUldbl'
24422 d_PRIXU64='$d_PRIXU64'
24423 d_PRId64='$d_PRId64'
24424 d_PRIeldbl='$d_PRIeldbl'
24425 d_PRIfldbl='$d_PRIfldbl'
24426 d_PRIgldbl='$d_PRIgldbl'
24427 d_PRIi64='$d_PRIi64'
24428 d_PRIo64='$d_PRIo64'
24429 d_PRIu64='$d_PRIu64'
24430 d_PRIx64='$d_PRIx64'
24431 d_SCNfldbl='$d_SCNfldbl'
24432 d__fwalk='$d__fwalk'
24433 d_access='$d_access'
24434 d_accessx='$d_accessx'
24438 d_archlib='$d_archlib'
24439 d_asctime64='$d_asctime64'
24440 d_asctime_r='$d_asctime_r'
24445 d_attribute_deprecated='$d_attribute_deprecated'
24446 d_attribute_format='$d_attribute_format'
24447 d_attribute_malloc='$d_attribute_malloc'
24448 d_attribute_nonnull='$d_attribute_nonnull'
24449 d_attribute_noreturn='$d_attribute_noreturn'
24450 d_attribute_pure='$d_attribute_pure'
24451 d_attribute_unused='$d_attribute_unused'
24452 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24453 d_backtrace='$d_backtrace'
24457 d_bsdgetpgrp='$d_bsdgetpgrp'
24458 d_bsdsetpgrp='$d_bsdsetpgrp'
24459 d_builtin_choose_expr='$d_builtin_choose_expr'
24460 d_builtin_expect='$d_builtin_expect'
24462 d_c99_variadic_macros='$d_c99_variadic_macros'
24463 d_casti32='$d_casti32'
24464 d_castneg='$d_castneg'
24466 d_charvspr='$d_charvspr'
24468 d_chroot='$d_chroot'
24469 d_chsize='$d_chsize'
24471 d_clearenv='$d_clearenv'
24472 d_closedir='$d_closedir'
24473 d_cmsghdr_s='$d_cmsghdr_s'
24475 d_copysign='$d_copysign'
24476 d_copysignl='$d_copysignl'
24477 d_cplusplus='$d_cplusplus'
24479 d_crypt_r='$d_crypt_r'
24481 d_ctermid='$d_ctermid'
24482 d_ctermid_r='$d_ctermid_r'
24483 d_ctime64='$d_ctime64'
24484 d_ctime_r='$d_ctime_r'
24485 d_cuserid='$d_cuserid'
24486 d_dbl_dig='$d_dbl_dig'
24487 d_dbminitproto='$d_dbminitproto'
24488 d_difftime64='$d_difftime64'
24489 d_difftime='$d_difftime'
24490 d_dir_dd_fd='$d_dir_dd_fd'
24492 d_dirnamlen='$d_dirnamlen'
24493 d_dladdr='$d_dladdr'
24494 d_dlerror='$d_dlerror'
24495 d_dlopen='$d_dlopen'
24496 d_dlsymun='$d_dlsymun'
24497 d_dosuid='$d_dosuid'
24498 d_double_has_inf='$d_double_has_inf'
24499 d_double_has_nan='$d_double_has_nan'
24500 d_double_has_negative_zero='$d_double_has_negative_zero'
24501 d_double_has_subnormals='$d_double_has_subnormals'
24502 d_double_style_cray='$d_double_style_cray'
24503 d_double_style_ibm='$d_double_style_ibm'
24504 d_double_style_ieee='$d_double_style_ieee'
24505 d_double_style_vax='$d_double_style_vax'
24506 d_drand48_r='$d_drand48_r'
24507 d_drand48proto='$d_drand48proto'
24509 d_duplocale='$d_duplocale'
24510 d_eaccess='$d_eaccess'
24511 d_endgrent='$d_endgrent'
24512 d_endgrent_r='$d_endgrent_r'
24513 d_endhent='$d_endhent'
24514 d_endhostent_r='$d_endhostent_r'
24515 d_endnent='$d_endnent'
24516 d_endnetent_r='$d_endnetent_r'
24517 d_endpent='$d_endpent'
24518 d_endprotoent_r='$d_endprotoent_r'
24519 d_endpwent='$d_endpwent'
24520 d_endpwent_r='$d_endpwent_r'
24521 d_endsent='$d_endsent'
24522 d_endservent_r='$d_endservent_r'
24523 d_eofnblk='$d_eofnblk'
24526 d_eunice='$d_eunice'
24529 d_faststdio='$d_faststdio'
24530 d_fchdir='$d_fchdir'
24531 d_fchmod='$d_fchmod'
24532 d_fchown='$d_fchown'
24534 d_fcntl_can_lock='$d_fcntl_can_lock'
24535 d_fd_macros='$d_fd_macros'
24536 d_fd_set='$d_fd_set'
24537 d_fdclose='$d_fdclose'
24539 d_fds_bits='$d_fds_bits'
24540 d_fegetround='$d_fegetround'
24541 d_fgetpos='$d_fgetpos'
24542 d_finite='$d_finite'
24543 d_finitel='$d_finitel'
24544 d_flexfnam='$d_flexfnam'
24546 d_flockproto='$d_flockproto'
24551 d_fp_class='$d_fp_class'
24552 d_fp_classify='$d_fp_classify'
24553 d_fp_classl='$d_fp_classl'
24554 d_fpathconf='$d_fpathconf'
24555 d_fpclass='$d_fpclass'
24556 d_fpclassify='$d_fpclassify'
24557 d_fpclassl='$d_fpclassl'
24558 d_fpgetround='$d_fpgetround'
24559 d_fpos64_t='$d_fpos64_t'
24560 d_freelocale='$d_freelocale'
24561 d_frexpl='$d_frexpl'
24562 d_fs_data_s='$d_fs_data_s'
24563 d_fseeko='$d_fseeko'
24564 d_fsetpos='$d_fsetpos'
24565 d_fstatfs='$d_fstatfs'
24566 d_fstatvfs='$d_fstatvfs'
24568 d_ftello='$d_ftello'
24570 d_futimes='$d_futimes'
24571 d_gai_strerror='$d_gai_strerror'
24572 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24573 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24574 d_getaddrinfo='$d_getaddrinfo'
24575 d_getcwd='$d_getcwd'
24576 d_getespwnam='$d_getespwnam'
24577 d_getfsstat='$d_getfsstat'
24578 d_getgrent='$d_getgrent'
24579 d_getgrent_r='$d_getgrent_r'
24580 d_getgrgid_r='$d_getgrgid_r'
24581 d_getgrnam_r='$d_getgrnam_r'
24582 d_getgrps='$d_getgrps'
24583 d_gethbyaddr='$d_gethbyaddr'
24584 d_gethbyname='$d_gethbyname'
24585 d_gethent='$d_gethent'
24586 d_gethname='$d_gethname'
24587 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24588 d_gethostbyname_r='$d_gethostbyname_r'
24589 d_gethostent_r='$d_gethostent_r'
24590 d_gethostprotos='$d_gethostprotos'
24591 d_getitimer='$d_getitimer'
24592 d_getlogin='$d_getlogin'
24593 d_getlogin_r='$d_getlogin_r'
24594 d_getmnt='$d_getmnt'
24595 d_getmntent='$d_getmntent'
24596 d_getnameinfo='$d_getnameinfo'
24597 d_getnbyaddr='$d_getnbyaddr'
24598 d_getnbyname='$d_getnbyname'
24599 d_getnent='$d_getnent'
24600 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24601 d_getnetbyname_r='$d_getnetbyname_r'
24602 d_getnetent_r='$d_getnetent_r'
24603 d_getnetprotos='$d_getnetprotos'
24604 d_getpagsz='$d_getpagsz'
24605 d_getpbyname='$d_getpbyname'
24606 d_getpbynumber='$d_getpbynumber'
24607 d_getpent='$d_getpent'
24608 d_getpgid='$d_getpgid'
24609 d_getpgrp2='$d_getpgrp2'
24610 d_getpgrp='$d_getpgrp'
24611 d_getppid='$d_getppid'
24612 d_getprior='$d_getprior'
24613 d_getprotobyname_r='$d_getprotobyname_r'
24614 d_getprotobynumber_r='$d_getprotobynumber_r'
24615 d_getprotoent_r='$d_getprotoent_r'
24616 d_getprotoprotos='$d_getprotoprotos'
24617 d_getprpwnam='$d_getprpwnam'
24618 d_getpwent='$d_getpwent'
24619 d_getpwent_r='$d_getpwent_r'
24620 d_getpwnam_r='$d_getpwnam_r'
24621 d_getpwuid_r='$d_getpwuid_r'
24622 d_getsbyname='$d_getsbyname'
24623 d_getsbyport='$d_getsbyport'
24624 d_getsent='$d_getsent'
24625 d_getservbyname_r='$d_getservbyname_r'
24626 d_getservbyport_r='$d_getservbyport_r'
24627 d_getservent_r='$d_getservent_r'
24628 d_getservprotos='$d_getservprotos'
24629 d_getspnam='$d_getspnam'
24630 d_getspnam_r='$d_getspnam_r'
24631 d_gettimeod='$d_gettimeod'
24632 d_gmtime64='$d_gmtime64'
24633 d_gmtime_r='$d_gmtime_r'
24634 d_gnulibc='$d_gnulibc'
24635 d_grpasswd='$d_grpasswd'
24636 d_hasmntopt='$d_hasmntopt'
24640 d_ilogbl='$d_ilogbl'
24641 d_inc_version_list='$d_inc_version_list'
24643 d_inetaton='$d_inetaton'
24644 d_inetntop='$d_inetntop'
24645 d_inetpton='$d_inetpton'
24646 d_int64_t='$d_int64_t'
24647 d_ip_mreq='$d_ip_mreq'
24648 d_ip_mreq_source='$d_ip_mreq_source'
24649 d_ipv6_mreq='$d_ipv6_mreq'
24650 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24651 d_isascii='$d_isascii'
24652 d_isblank='$d_isblank'
24653 d_isfinite='$d_isfinite'
24654 d_isfinitel='$d_isfinitel'
24656 d_isinfl='$d_isinfl'
24657 d_isless='$d_isless'
24659 d_isnanl='$d_isnanl'
24660 d_isnormal='$d_isnormal'
24663 d_killpg='$d_killpg'
24664 d_lc_monetary_2008='$d_lc_monetary_2008'
24665 d_lchown='$d_lchown'
24666 d_ldbl_dig='$d_ldbl_dig'
24667 d_ldexpl='$d_ldexpl'
24668 d_lgamma='$d_lgamma'
24669 d_lgamma_r='$d_lgamma_r'
24670 d_libm_lib_version='$d_libm_lib_version'
24671 d_libname_unique='$d_libname_unique'
24673 d_llrint='$d_llrint'
24674 d_llrintl='$d_llrintl'
24675 d_llround='$d_llround'
24676 d_llroundl='$d_llroundl'
24677 d_localtime64='$d_localtime64'
24678 d_localtime_r='$d_localtime_r'
24679 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24680 d_locconv='$d_locconv'
24685 d_long_double_style_ieee='$d_long_double_style_ieee'
24686 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24687 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24688 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24689 d_long_double_style_vax='$d_long_double_style_vax'
24690 d_longdbl='$d_longdbl'
24691 d_longlong='$d_longlong'
24693 d_lrintl='$d_lrintl'
24694 d_lround='$d_lround'
24695 d_lroundl='$d_lroundl'
24696 d_lseekproto='$d_lseekproto'
24698 d_madvise='$d_madvise'
24699 d_malloc_good_size='$d_malloc_good_size'
24700 d_malloc_size='$d_malloc_size'
24702 d_mbstowcs='$d_mbstowcs'
24703 d_mbtowc='$d_mbtowc'
24704 d_memchr='$d_memchr'
24705 d_memcmp='$d_memcmp'
24706 d_memcpy='$d_memcpy'
24707 d_memmem='$d_memmem'
24708 d_memmove='$d_memmove'
24709 d_memset='$d_memset'
24711 d_mkdtemp='$d_mkdtemp'
24712 d_mkfifo='$d_mkfifo'
24713 d_mkstemp='$d_mkstemp'
24714 d_mkstemps='$d_mkstemps'
24715 d_mktime64='$d_mktime64'
24716 d_mktime='$d_mktime'
24719 d_modflproto='$d_modflproto'
24720 d_mprotect='$d_mprotect'
24722 d_msg_ctrunc='$d_msg_ctrunc'
24723 d_msg_dontroute='$d_msg_dontroute'
24724 d_msg_oob='$d_msg_oob'
24725 d_msg_peek='$d_msg_peek'
24726 d_msg_proxy='$d_msg_proxy'
24727 d_msgctl='$d_msgctl'
24728 d_msgget='$d_msgget'
24729 d_msghdr_s='$d_msghdr_s'
24730 d_msgrcv='$d_msgrcv'
24731 d_msgsnd='$d_msgsnd'
24733 d_munmap='$d_munmap'
24734 d_mymalloc='$d_mymalloc'
24737 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24738 d_nearbyint='$d_nearbyint'
24739 d_newlocale='$d_newlocale'
24740 d_nextafter='$d_nextafter'
24741 d_nexttoward='$d_nexttoward'
24743 d_nl_langinfo='$d_nl_langinfo'
24744 d_nv_preserves_uv='$d_nv_preserves_uv'
24745 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24746 d_off64_t='$d_off64_t'
24747 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24748 d_oldpthreads='$d_oldpthreads'
24749 d_oldsock='$d_oldsock'
24751 d_pathconf='$d_pathconf'
24753 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24754 d_phostname='$d_phostname'
24757 d_portable='$d_portable'
24759 d_prctl_set_name='$d_prctl_set_name'
24760 d_printf_format_null='$d_printf_format_null'
24761 d_procselfexe='$d_procselfexe'
24762 d_pseudofork='$d_pseudofork'
24763 d_pthread_atfork='$d_pthread_atfork'
24764 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24765 d_pthread_yield='$d_pthread_yield'
24766 d_ptrdiff_t='$d_ptrdiff_t'
24768 d_pwchange='$d_pwchange'
24769 d_pwclass='$d_pwclass'
24770 d_pwcomment='$d_pwcomment'
24771 d_pwexpire='$d_pwexpire'
24772 d_pwgecos='$d_pwgecos'
24773 d_pwpasswd='$d_pwpasswd'
24774 d_pwquota='$d_pwquota'
24777 d_querylocale='$d_querylocale'
24778 d_random_r='$d_random_r'
24779 d_re_comp='$d_re_comp'
24780 d_readdir64_r='$d_readdir64_r'
24781 d_readdir='$d_readdir'
24782 d_readdir_r='$d_readdir_r'
24783 d_readlink='$d_readlink'
24785 d_recvmsg='$d_recvmsg'
24786 d_regcmp='$d_regcmp'
24787 d_regcomp='$d_regcomp'
24788 d_remainder='$d_remainder'
24789 d_remquo='$d_remquo'
24790 d_rename='$d_rename'
24791 d_rewinddir='$d_rewinddir'
24795 d_safebcpy='$d_safebcpy'
24796 d_safemcpy='$d_safemcpy'
24797 d_sanemcmp='$d_sanemcmp'
24798 d_sbrkproto='$d_sbrkproto'
24799 d_scalbn='$d_scalbn'
24800 d_scalbnl='$d_scalbnl'
24801 d_sched_yield='$d_sched_yield'
24802 d_scm_rights='$d_scm_rights'
24803 d_seekdir='$d_seekdir'
24804 d_select='$d_select'
24806 d_semctl='$d_semctl'
24807 d_semctl_semid_ds='$d_semctl_semid_ds'
24808 d_semctl_semun='$d_semctl_semun'
24809 d_semget='$d_semget'
24811 d_sendmsg='$d_sendmsg'
24812 d_setegid='$d_setegid'
24813 d_seteuid='$d_seteuid'
24814 d_setgrent='$d_setgrent'
24815 d_setgrent_r='$d_setgrent_r'
24816 d_setgrps='$d_setgrps'
24817 d_sethent='$d_sethent'
24818 d_sethostent_r='$d_sethostent_r'
24819 d_setitimer='$d_setitimer'
24820 d_setlinebuf='$d_setlinebuf'
24821 d_setlocale='$d_setlocale'
24822 d_setlocale_r='$d_setlocale_r'
24823 d_setnent='$d_setnent'
24824 d_setnetent_r='$d_setnetent_r'
24825 d_setpent='$d_setpent'
24826 d_setpgid='$d_setpgid'
24827 d_setpgrp2='$d_setpgrp2'
24828 d_setpgrp='$d_setpgrp'
24829 d_setprior='$d_setprior'
24830 d_setproctitle='$d_setproctitle'
24831 d_setprotoent_r='$d_setprotoent_r'
24832 d_setpwent='$d_setpwent'
24833 d_setpwent_r='$d_setpwent_r'
24834 d_setregid='$d_setregid'
24835 d_setresgid='$d_setresgid'
24836 d_setresuid='$d_setresuid'
24837 d_setreuid='$d_setreuid'
24838 d_setrgid='$d_setrgid'
24839 d_setruid='$d_setruid'
24840 d_setsent='$d_setsent'
24841 d_setservent_r='$d_setservent_r'
24842 d_setsid='$d_setsid'
24843 d_setvbuf='$d_setvbuf'
24846 d_shmatprototype='$d_shmatprototype'
24847 d_shmctl='$d_shmctl'
24849 d_shmget='$d_shmget'
24850 d_sigaction='$d_sigaction'
24851 d_siginfo_si_addr='$d_siginfo_si_addr'
24852 d_siginfo_si_band='$d_siginfo_si_band'
24853 d_siginfo_si_errno='$d_siginfo_si_errno'
24854 d_siginfo_si_fd='$d_siginfo_si_fd'
24855 d_siginfo_si_pid='$d_siginfo_si_pid'
24856 d_siginfo_si_status='$d_siginfo_si_status'
24857 d_siginfo_si_uid='$d_siginfo_si_uid'
24858 d_siginfo_si_value='$d_siginfo_si_value'
24859 d_signbit='$d_signbit'
24860 d_sigprocmask='$d_sigprocmask'
24861 d_sigsetjmp='$d_sigsetjmp'
24862 d_sin6_scope_id='$d_sin6_scope_id'
24863 d_sitearch='$d_sitearch'
24864 d_snprintf='$d_snprintf'
24865 d_sockaddr_in6='$d_sockaddr_in6'
24866 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24867 d_sockatmark='$d_sockatmark'
24868 d_sockatmarkproto='$d_sockatmarkproto'
24869 d_socket='$d_socket'
24870 d_socklen_t='$d_socklen_t'
24871 d_sockpair='$d_sockpair'
24872 d_socks5_init='$d_socks5_init'
24873 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24875 d_srand48_r='$d_srand48_r'
24876 d_srandom_r='$d_srandom_r'
24877 d_sresgproto='$d_sresgproto'
24878 d_sresuproto='$d_sresuproto'
24880 d_statblks='$d_statblks'
24881 d_statfs_f_flags='$d_statfs_f_flags'
24882 d_statfs_s='$d_statfs_s'
24883 d_static_inline='$d_static_inline'
24884 d_statvfs='$d_statvfs'
24885 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24886 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24887 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24888 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24889 d_stdio_stream_array='$d_stdio_stream_array'
24890 d_stdiobase='$d_stdiobase'
24891 d_stdstdio='$d_stdstdio'
24892 d_strchr='$d_strchr'
24893 d_strcoll='$d_strcoll'
24894 d_strctcpy='$d_strctcpy'
24895 d_strerrm='$d_strerrm'
24896 d_strerror='$d_strerror'
24897 d_strerror_l='$d_strerror_l'
24898 d_strerror_r='$d_strerror_r'
24899 d_strftime='$d_strftime'
24900 d_strlcat='$d_strlcat'
24901 d_strlcpy='$d_strlcpy'
24902 d_strtod='$d_strtod'
24903 d_strtol='$d_strtol'
24904 d_strtold='$d_strtold'
24905 d_strtoll='$d_strtoll'
24906 d_strtoq='$d_strtoq'
24907 d_strtoul='$d_strtoul'
24908 d_strtoull='$d_strtoull'
24909 d_strtouq='$d_strtouq'
24910 d_strxfrm='$d_strxfrm'
24911 d_suidsafe='$d_suidsafe'
24912 d_symlink='$d_symlink'
24913 d_syscall='$d_syscall'
24914 d_syscallproto='$d_syscallproto'
24915 d_sysconf='$d_sysconf'
24916 d_sysernlst='$d_sysernlst'
24917 d_syserrlst='$d_syserrlst'
24918 d_system='$d_system'
24919 d_tcgetpgrp='$d_tcgetpgrp'
24920 d_tcsetpgrp='$d_tcsetpgrp'
24921 d_telldir='$d_telldir'
24922 d_telldirproto='$d_telldirproto'
24923 d_tgamma='$d_tgamma'
24925 d_timegm='$d_timegm'
24927 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24928 d_tm_tm_zone='$d_tm_tm_zone'
24929 d_tmpnam_r='$d_tmpnam_r'
24931 d_truncate='$d_truncate'
24932 d_truncl='$d_truncl'
24933 d_ttyname_r='$d_ttyname_r'
24934 d_tzname='$d_tzname'
24935 d_u32align='$d_u32align'
24936 d_ualarm='$d_ualarm'
24939 d_union_semun='$d_union_semun'
24940 d_unordered='$d_unordered'
24941 d_unsetenv='$d_unsetenv'
24942 d_uselocale='$d_uselocale'
24943 d_usleep='$d_usleep'
24944 d_usleepproto='$d_usleepproto'
24946 d_vendorarch='$d_vendorarch'
24947 d_vendorbin='$d_vendorbin'
24948 d_vendorlib='$d_vendorlib'
24949 d_vendorscript='$d_vendorscript'
24951 d_void_closedir='$d_void_closedir'
24952 d_voidsig='$d_voidsig'
24953 d_voidtty='$d_voidtty'
24954 d_volatile='$d_volatile'
24955 d_vprintf='$d_vprintf'
24956 d_vsnprintf='$d_vsnprintf'
24958 d_waitpid='$d_waitpid'
24959 d_wcscmp='$d_wcscmp'
24960 d_wcstombs='$d_wcstombs'
24961 d_wcsxfrm='$d_wcsxfrm'
24962 d_wctomb='$d_wctomb'
24963 d_writev='$d_writev'
24966 db_hashtype='$db_hashtype'
24967 db_prefixtype='$db_prefixtype'
24968 db_version_major='$db_version_major'
24969 db_version_minor='$db_version_minor'
24970 db_version_patch='$db_version_patch'
24971 default_inc_excludes_dot='$default_inc_excludes_dot'
24972 direntrytype='$direntrytype'
24975 doubleinfbytes='$doubleinfbytes'
24976 doublekind='$doublekind'
24977 doublemantbits='$doublemantbits'
24978 doublenanbytes='$doublenanbytes'
24979 doublesize='$doublesize'
24981 drand48_r_proto='$drand48_r_proto'
24983 dtraceobject='$dtraceobject'
24984 dtracexnolibs='$dtracexnolibs'
24985 dynamic_ext='$dynamic_ext'
24991 endgrent_r_proto='$endgrent_r_proto'
24992 endhostent_r_proto='$endhostent_r_proto'
24993 endnetent_r_proto='$endnetent_r_proto'
24994 endprotoent_r_proto='$endprotoent_r_proto'
24995 endpwent_r_proto='$endpwent_r_proto'
24996 endservent_r_proto='$endservent_r_proto'
24997 eunicefix='$eunicefix'
25000 extensions='$extensions'
25001 extern_C='$extern_C'
25003 fflushNULL='$fflushNULL'
25004 fflushall='$fflushall'
25006 firstmakefile='$firstmakefile'
25008 fpossize='$fpossize'
25009 fpostype='$fpostype'
25010 freetype='$freetype'
25013 full_csh='$full_csh'
25014 full_sed='$full_sed'
25015 gccansipedantic='$gccansipedantic'
25016 gccosandvers='$gccosandvers'
25017 gccversion='$gccversion'
25018 getgrent_r_proto='$getgrent_r_proto'
25019 getgrgid_r_proto='$getgrgid_r_proto'
25020 getgrnam_r_proto='$getgrnam_r_proto'
25021 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25022 gethostbyname_r_proto='$gethostbyname_r_proto'
25023 gethostent_r_proto='$gethostent_r_proto'
25024 getlogin_r_proto='$getlogin_r_proto'
25025 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25026 getnetbyname_r_proto='$getnetbyname_r_proto'
25027 getnetent_r_proto='$getnetent_r_proto'
25028 getprotobyname_r_proto='$getprotobyname_r_proto'
25029 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25030 getprotoent_r_proto='$getprotoent_r_proto'
25031 getpwent_r_proto='$getpwent_r_proto'
25032 getpwnam_r_proto='$getpwnam_r_proto'
25033 getpwuid_r_proto='$getpwuid_r_proto'
25034 getservbyname_r_proto='$getservbyname_r_proto'
25035 getservbyport_r_proto='$getservbyport_r_proto'
25036 getservent_r_proto='$getservent_r_proto'
25037 getspnam_r_proto='$getspnam_r_proto'
25038 gidformat='$gidformat'
25044 gmtime_r_proto='$gmtime_r_proto'
25045 gnulibc_version='$gnulibc_version'
25047 groupcat='$groupcat'
25048 groupstype='$groupstype'
25051 h_sysfile='$h_sysfile'
25054 hostgenerate='$hostgenerate'
25055 hostosname='$hostosname'
25056 hostperl='$hostperl'
25057 html1dir='$html1dir'
25058 html1direxp='$html1direxp'
25059 html3dir='$html3dir'
25060 html3direxp='$html3direxp'
25069 i_arpainet='$i_arpainet'
25070 i_assert='$i_assert'
25072 i_bsdioctl='$i_bsdioctl'
25076 i_dirent='$i_dirent'
25078 i_execinfo='$i_execinfo'
25083 i_fp_class='$i_fp_class'
25085 i_gdbm_ndbm='$i_gdbm_ndbm'
25086 i_gdbmndbm='$i_gdbmndbm'
25088 i_ieeefp='$i_ieeefp'
25089 i_inttypes='$i_inttypes'
25090 i_langinfo='$i_langinfo'
25091 i_libutil='$i_libutil'
25092 i_limits='$i_limits'
25093 i_locale='$i_locale'
25094 i_machcthr='$i_machcthr'
25095 i_malloc='$i_malloc'
25096 i_mallocmalloc='$i_mallocmalloc'
25098 i_memory='$i_memory'
25099 i_mntent='$i_mntent'
25102 i_neterrno='$i_neterrno'
25103 i_netinettcp='$i_netinettcp'
25107 i_pthread='$i_pthread'
25109 i_quadmath='$i_quadmath'
25110 i_rpcsvcdbm='$i_rpcsvcdbm'
25112 i_shadow='$i_shadow'
25114 i_stdarg='$i_stdarg'
25115 i_stdbool='$i_stdbool'
25116 i_stddef='$i_stddef'
25117 i_stdint='$i_stdint'
25118 i_stdlib='$i_stdlib'
25119 i_string='$i_string'
25120 i_sunmath='$i_sunmath'
25121 i_sysaccess='$i_sysaccess'
25122 i_sysdir='$i_sysdir'
25123 i_sysfile='$i_sysfile'
25124 i_sysfilio='$i_sysfilio'
25126 i_sysioctl='$i_sysioctl'
25127 i_syslog='$i_syslog'
25128 i_sysmman='$i_sysmman'
25129 i_sysmode='$i_sysmode'
25130 i_sysmount='$i_sysmount'
25131 i_sysndir='$i_sysndir'
25132 i_sysparam='$i_sysparam'
25133 i_syspoll='$i_syspoll'
25134 i_sysresrc='$i_sysresrc'
25135 i_syssecrt='$i_syssecrt'
25136 i_sysselct='$i_sysselct'
25137 i_syssockio='$i_syssockio'
25138 i_sysstat='$i_sysstat'
25139 i_sysstatfs='$i_sysstatfs'
25140 i_sysstatvfs='$i_sysstatvfs'
25141 i_systime='$i_systime'
25142 i_systimek='$i_systimek'
25143 i_systimes='$i_systimes'
25144 i_systypes='$i_systypes'
25145 i_sysuio='$i_sysuio'
25147 i_sysutsname='$i_sysutsname'
25148 i_sysvfs='$i_sysvfs'
25149 i_syswait='$i_syswait'
25150 i_termio='$i_termio'
25151 i_termios='$i_termios'
25153 i_unistd='$i_unistd'
25156 i_values='$i_values'
25157 i_varargs='$i_varargs'
25158 i_varhdr='$i_varhdr'
25160 i_xlocale='$i_xlocale'
25161 ignore_versioned_solibs='$ignore_versioned_solibs'
25162 inc_version_list='$inc_version_list'
25163 inc_version_list_init='$inc_version_list_init'
25167 initialinstalllocation='$initialinstalllocation'
25168 installarchlib='$installarchlib'
25169 installbin='$installbin'
25170 installhtml1dir='$installhtml1dir'
25171 installhtml3dir='$installhtml3dir'
25172 installman1dir='$installman1dir'
25173 installman3dir='$installman3dir'
25174 installprefix='$installprefix'
25175 installprefixexp='$installprefixexp'
25176 installprivlib='$installprivlib'
25177 installscript='$installscript'
25178 installsitearch='$installsitearch'
25179 installsitebin='$installsitebin'
25180 installsitehtml1dir='$installsitehtml1dir'
25181 installsitehtml3dir='$installsitehtml3dir'
25182 installsitelib='$installsitelib'
25183 installsiteman1dir='$installsiteman1dir'
25184 installsiteman3dir='$installsiteman3dir'
25185 installsitescript='$installsitescript'
25186 installstyle='$installstyle'
25187 installusrbinperl='$installusrbinperl'
25188 installvendorarch='$installvendorarch'
25189 installvendorbin='$installvendorbin'
25190 installvendorhtml1dir='$installvendorhtml1dir'
25191 installvendorhtml3dir='$installvendorhtml3dir'
25192 installvendorlib='$installvendorlib'
25193 installvendorman1dir='$installvendorman1dir'
25194 installvendorman3dir='$installvendorman3dir'
25195 installvendorscript='$installvendorscript'
25197 issymlink='$issymlink'
25198 ivdformat='$ivdformat'
25201 known_extensions='$known_extensions'
25204 ld_can_script='$ld_can_script'
25205 lddlflags='$lddlflags'
25207 ldflags_uselargefiles='$ldflags_uselargefiles'
25208 ldlibpthname='$ldlibpthname'
25215 libsdirs='$libsdirs'
25216 libsfiles='$libsfiles'
25217 libsfound='$libsfound'
25218 libspath='$libspath'
25219 libswanted='$libswanted'
25220 libswanted_uselargefiles='$libswanted_uselargefiles'
25226 localtime_r_proto='$localtime_r_proto'
25227 locincpth='$locincpth'
25228 loclibpth='$loclibpth'
25229 longdblinfbytes='$longdblinfbytes'
25230 longdblkind='$longdblkind'
25231 longdblmantbits='$longdblmantbits'
25232 longdblnanbytes='$longdblnanbytes'
25233 longdblsize='$longdblsize'
25234 longlongsize='$longlongsize'
25235 longsize='$longsize'
25239 lseeksize='$lseeksize'
25240 lseektype='$lseektype'
25244 make_set_make='$make_set_make'
25245 mallocobj='$mallocobj'
25246 mallocsrc='$mallocsrc'
25247 malloctype='$malloctype'
25249 man1direxp='$man1direxp'
25252 man3direxp='$man3direxp'
25254 mips_type='$mips_type'
25255 mistrustnm='$mistrustnm'
25257 mmaptype='$mmaptype'
25258 modetype='$modetype'
25260 multiarch='$multiarch'
25262 myarchname='$myarchname'
25263 mydomain='$mydomain'
25264 myhostname='$myhostname'
25267 need_va_copy='$need_va_copy'
25268 netdb_hlen_type='$netdb_hlen_type'
25269 netdb_host_type='$netdb_host_type'
25270 netdb_name_type='$netdb_name_type'
25271 netdb_net_type='$netdb_net_type'
25274 nm_so_opt='$nm_so_opt'
25275 nonxs_ext='$nonxs_ext'
25277 nvEUformat='$nvEUformat'
25278 nvFUformat='$nvFUformat'
25279 nvGUformat='$nvGUformat'
25280 nv_overflows_integers_at='$nv_overflows_integers_at'
25281 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25282 nveformat='$nveformat'
25283 nvfformat='$nvfformat'
25284 nvgformat='$nvgformat'
25285 nvmantbits='$nvmantbits'
25288 o_nonblock='$o_nonblock'
25290 old_pthread_create_joinable='$old_pthread_create_joinable'
25291 optimize='$optimize'
25292 orderlib='$orderlib'
25295 otherlibdirs='$otherlibdirs'
25299 patchlevel='$patchlevel'
25300 path_sep='$path_sep'
25303 perl_patchlevel='$perl_patchlevel'
25304 perl_static_inline='$perl_static_inline'
25305 perladmin='$perladmin'
25306 perllibs='$perllibs'
25307 perlpath='$perlpath'
25309 phostname='$phostname'
25315 prefixexp='$prefixexp'
25317 privlibexp='$privlibexp'
25318 procselfexe='$procselfexe'
25319 prototype='$prototype'
25321 quadkind='$quadkind'
25322 quadtype='$quadtype'
25323 randbits='$randbits'
25324 randfunc='$randfunc'
25325 random_r_proto='$random_r_proto'
25326 randseedtype='$randseedtype'
25328 rd_nodata='$rd_nodata'
25329 readdir64_r_proto='$readdir64_r_proto'
25330 readdir_r_proto='$readdir_r_proto'
25331 revision='$revision'
25337 sGMTIME_max='$sGMTIME_max'
25338 sGMTIME_min='$sGMTIME_min'
25339 sLOCALTIME_max='$sLOCALTIME_max'
25340 sLOCALTIME_min='$sLOCALTIME_min'
25341 sPRIEUldbl='$sPRIEUldbl'
25342 sPRIFUldbl='$sPRIFUldbl'
25343 sPRIGUldbl='$sPRIGUldbl'
25344 sPRIXU64='$sPRIXU64'
25346 sPRIeldbl='$sPRIeldbl'
25347 sPRIfldbl='$sPRIfldbl'
25348 sPRIgldbl='$sPRIgldbl'
25353 sSCNfldbl='$sSCNfldbl'
25354 sched_yield='$sched_yield'
25355 scriptdir='$scriptdir'
25356 scriptdirexp='$scriptdirexp'
25358 seedfunc='$seedfunc'
25359 selectminbits='$selectminbits'
25360 selecttype='$selecttype'
25361 sendmail='$sendmail'
25362 setgrent_r_proto='$setgrent_r_proto'
25363 sethostent_r_proto='$sethostent_r_proto'
25364 setlocale_r_proto='$setlocale_r_proto'
25365 setnetent_r_proto='$setnetent_r_proto'
25366 setprotoent_r_proto='$setprotoent_r_proto'
25367 setpwent_r_proto='$setpwent_r_proto'
25368 setservent_r_proto='$setservent_r_proto'
25371 sharpbang='$sharpbang'
25372 shmattype='$shmattype'
25373 shortsize='$shortsize'
25376 sig_count='$sig_count'
25377 sig_name='$sig_name'
25378 sig_name_init='$sig_name_init'
25380 sig_num_init='$sig_num_init'
25381 sig_size='$sig_size'
25382 signal_t='$signal_t'
25383 sitearch='$sitearch'
25384 sitearchexp='$sitearchexp'
25386 sitebinexp='$sitebinexp'
25387 sitehtml1dir='$sitehtml1dir'
25388 sitehtml1direxp='$sitehtml1direxp'
25389 sitehtml3dir='$sitehtml3dir'
25390 sitehtml3direxp='$sitehtml3direxp'
25392 sitelib_stem='$sitelib_stem'
25393 sitelibexp='$sitelibexp'
25394 siteman1dir='$siteman1dir'
25395 siteman1direxp='$siteman1direxp'
25396 siteman3dir='$siteman3dir'
25397 siteman3direxp='$siteman3direxp'
25398 siteprefix='$siteprefix'
25399 siteprefixexp='$siteprefixexp'
25400 sitescript='$sitescript'
25401 sitescriptexp='$sitescriptexp'
25402 sizesize='$sizesize'
25403 sizetype='$sizetype'
25407 sockethdr='$sockethdr'
25408 socketlib='$socketlib'
25409 socksizetype='$socksizetype'
25411 spackage='$spackage'
25412 spitshell='$spitshell'
25413 srand48_r_proto='$srand48_r_proto'
25414 srandom_r_proto='$srandom_r_proto'
25416 ssizetype='$ssizetype'
25417 st_ino_sign='$st_ino_sign'
25418 st_ino_size='$st_ino_size'
25419 startperl='$startperl'
25421 static_ext='$static_ext'
25423 stdio_base='$stdio_base'
25424 stdio_bufsiz='$stdio_bufsiz'
25425 stdio_cnt='$stdio_cnt'
25426 stdio_filbuf='$stdio_filbuf'
25427 stdio_ptr='$stdio_ptr'
25428 stdio_stream_array='$stdio_stream_array'
25429 strerror_r_proto='$strerror_r_proto'
25432 subversion='$subversion'
25437 targetarch='$targetarch'
25438 targetdir='$targetdir'
25439 targetenv='$targetenv'
25440 targethost='$targethost'
25441 targetmkdir='$targetmkdir'
25442 targetport='$targetport'
25443 targetsh='$targetsh'
25447 timeincl='$timeincl'
25448 timetype='$timetype'
25449 tmpnam_r_proto='$tmpnam_r_proto'
25455 ttyname_r_proto='$ttyname_r_proto'
25464 uidformat='$uidformat'
25470 uquadtype='$uquadtype'
25471 use5005threads='$use5005threads'
25472 use64bitall='$use64bitall'
25473 use64bitint='$use64bitint'
25474 usecbacktrace='$usecbacktrace'
25475 usecrosscompile='$usecrosscompile'
25476 usedevel='$usedevel'
25478 usedtrace='$usedtrace'
25479 usefaststdio='$usefaststdio'
25480 useithreads='$useithreads'
25481 usekernprocpathname='$usekernprocpathname'
25482 uselargefiles='$uselargefiles'
25483 uselongdouble='$uselongdouble'
25484 usemallocwrap='$usemallocwrap'
25485 usemorebits='$usemorebits'
25486 usemultiplicity='$usemultiplicity'
25487 usemymalloc='$usemymalloc'
25489 usensgetexecutablepath='$usensgetexecutablepath'
25490 useopcode='$useopcode'
25491 useperlio='$useperlio'
25492 useposix='$useposix'
25493 usequadmath='$usequadmath'
25494 usereentrant='$usereentrant'
25495 userelocatableinc='$userelocatableinc'
25496 useshrplib='$useshrplib'
25497 usesitecustomize='$usesitecustomize'
25498 usesocks='$usesocks'
25499 usethreads='$usethreads'
25500 usevendorprefix='$usevendorprefix'
25501 useversionedarchname='$useversionedarchname'
25502 usevfork='$usevfork'
25505 uvXUformat='$uvXUformat'
25506 uvoformat='$uvoformat'
25509 uvuformat='$uvuformat'
25510 uvxformat='$uvxformat'
25512 vendorarch='$vendorarch'
25513 vendorarchexp='$vendorarchexp'
25514 vendorbin='$vendorbin'
25515 vendorbinexp='$vendorbinexp'
25516 vendorhtml1dir='$vendorhtml1dir'
25517 vendorhtml1direxp='$vendorhtml1direxp'
25518 vendorhtml3dir='$vendorhtml3dir'
25519 vendorhtml3direxp='$vendorhtml3direxp'
25520 vendorlib='$vendorlib'
25521 vendorlib_stem='$vendorlib_stem'
25522 vendorlibexp='$vendorlibexp'
25523 vendorman1dir='$vendorman1dir'
25524 vendorman1direxp='$vendorman1direxp'
25525 vendorman3dir='$vendorman3dir'
25526 vendorman3direxp='$vendorman3direxp'
25527 vendorprefix='$vendorprefix'
25528 vendorprefixexp='$vendorprefixexp'
25529 vendorscript='$vendorscript'
25530 vendorscriptexp='$vendorscriptexp'
25532 version_patchlevel_string='$version_patchlevel_string'
25533 versiononly='$versiononly'
25537 yaccflags='$yaccflags'
25542 : add special variables
25543 $test -f $src/patchlevel.h && \
25544 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25545 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25546 echo "PERL_CONFIG_SH=true" >>config.sh
25548 : propagate old symbols
25549 if $test -f UU/config.sh; then
25550 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25551 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25552 config.sh config.sh UU/oldconfig.sh |\
25553 $sort | $uniq -u >UU/oldsyms
25554 set X `$cat UU/oldsyms`
25560 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25562 echo ": Variables propagated from previous config.sh file." >>config.sh
25563 for sym in `$cat UU/oldsyms`; do
25564 echo " Propagating $hint variable "'$'"$sym..."
25565 eval 'tmp="$'"${sym}"'"'
25567 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25573 : preserve RCS keywords in files with variable substitution, grrr
25576 : Finish up by extracting the .SH files
25579 echo "Stopping at your request, leaving temporary files around."
25589 If you'd like to make any changes to the config.sh file before I begin
25590 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25593 rp="Press return or use a shell escape to edit config.sh:"
25598 *) : in case they cannot read
25599 sh 1>&4 -c "$ans";;
25604 : if this fails, just run all the .SH files by hand
25613 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25620 Now you need to generate make dependencies by running "$make depend".
25621 You might prefer to run it in background: "$make depend > makedepend.out &"
25622 It can take a while, so you might not want to run it right now.
25627 rp="Run $make depend now?"
25631 $make depend && echo "Now you must run '$make'."
25634 echo "You must run '$make depend' then '$make'."
25637 elif test -f [Mm]akefile; then
25639 echo "Now you must run a $make."
25641 echo "Configure done."
25644 if $test -f Policy.sh; then
25647 If you compile $package on a different machine or from a different object
25648 directory, copy the Policy.sh file from this object directory to the
25649 new one before you run Configure -- this will help you with most of
25650 the policy defaults.
25654 if $test -f UU/config.msg; then
25655 echo "Hmm. I also noted the following information while running:"
25657 $cat UU/config.msg >&4
25659 $rm -f kit*isdone ark*isdone