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=''
536 gethostbyaddr_r_proto=''
538 gethostbyname_r_proto=''
540 gethostent_r_proto=''
553 getnetbyaddr_r_proto=''
555 getnetbyname_r_proto=''
569 d_getprotobyname_r=''
570 getprotobyname_r_proto=''
571 d_getprotobynumber_r=''
572 getprotobynumber_r_proto=''
574 getprotoent_r_proto=''
586 getservbyname_r_proto=''
588 getservbyport_r_proto=''
590 getservent_r_proto=''
623 d_lc_monetary_2008=''
628 d_libm_lib_version=''
635 d_localtime_r_needs_tzset=''
643 d_long_double_style_ieee=''
644 d_long_double_style_ieee_doubledouble=''
645 d_long_double_style_ieee_extended=''
646 d_long_double_style_ieee_std=''
647 d_long_double_style_vax=''
660 d_malloc_good_size=''
714 d_old_pthread_create_joinable=''
715 old_pthread_create_joinable=''
717 d_pthread_attr_setscope=''
765 sethostent_r_proto=''
782 setprotoent_r_proto=''
794 setservent_r_proto=''
807 d_siginfo_si_errno=''
810 d_siginfo_si_status=''
812 d_siginfo_si_value=''
824 d_ipv6_mreq_source=''
841 d_sprintf_returns_strlen=''
854 perl_static_inline=''
859 d_stdio_ptr_lval_nochange_cnt=''
860 d_stdio_ptr_lval_sets_cnt=''
945 default_inc_excludes_dot=''
1016 d_gdbm_ndbm_h_uses_prototypes=''
1017 d_gdbmndbm_h_uses_prototypes=''
1019 d_ndbm_h_uses_prototypes=''
1095 d_inc_version_list=''
1097 inc_version_list_init=''
1105 installusrbinperl=''
1121 ignore_versioned_solibs=''
1137 d_double_has_negative_zero=''
1138 d_double_has_subnormals=''
1139 d_double_style_cray=''
1140 d_double_style_ibm=''
1141 d_double_style_ieee=''
1142 d_double_style_vax=''
1193 d_perl_otherlibdirs=''
1201 api_versionstring=''
1207 version_patchlevel_string=''
1211 d_nv_preserves_uv=''
1212 d_nv_zero_is_allbits_zero=''
1223 nv_overflows_integers_at=''
1224 nv_preserves_uv_bits=''
1297 installsitehtml1dir=''
1300 installsitehtml3dir=''
1307 installsiteman1dir=''
1310 installsiteman3dir=''
1315 installsitescript=''
1333 d_stdio_stream_array=''
1334 stdio_stream_array=''
1352 usekernprocpathname=''
1353 ccflags_uselargefiles=''
1354 ldflags_uselargefiles=''
1355 libswanted_uselargefiles=''
1364 usensgetexecutablepath=''
1378 installvendorarch=''
1385 installvendorhtml1dir=''
1387 vendorhtml1direxp=''
1388 installvendorhtml3dir=''
1390 vendorhtml3direxp=''
1396 installvendorman1dir=''
1399 installvendorman3dir=''
1406 installvendorscript=''
1417 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1420 : We must find out about Eunice early
1422 if test -f /etc/unixtovms; then
1423 eunicefix=/etc/unixtovms
1425 if test -f /etc/unixtovms.exe; then
1426 eunicefix=/etc/unixtovms.exe
1429 : Set executable suffix now -- needed before hints available
1430 if test -f "/libs/version.library"; then
1433 elif test -f "/system/gnu_library/bin/ar.pm"; then
1436 elif test -n "$DJGPP"; then
1439 elif test -f /kern/cookiejar; then
1442 elif test -d c:/. -o -n "$is_os2" ; then
1449 : Possible local include directories to search.
1450 : Set locincpth to "" in a hint file to defeat local include searches.
1451 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1452 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1454 : no include file wanted by default
1457 : Enable -DEBUGGING and -DDEBUGGING from the command line
1461 : Trailing extension. Override this in a hint file, if needed.
1462 : Extra object files, if any, needed on this platform.
1465 : change the next line if compiling for Xenix/286 on Xenix/386
1466 xlibpth='/usr/lib/386 /lib/386'
1467 : Possible local library directories to search.
1468 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1469 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1471 : general looking path for locating libraries
1472 glibpth="/lib /usr/lib $xlibpth"
1473 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1474 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1475 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1476 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1478 : Private path used by Configure to find libraries. Its value
1479 : is prepended to libpth. This variable takes care of special
1480 : machines, like the mips. Usually, it should be empty.
1483 : default library list
1485 : some systems want to use only the non-versioned libso:s
1486 ignore_versioned_solibs=''
1490 : set useposix=false in your hint file to disable the POSIX extension.
1492 : set useopcode=false in your hint file to disable the Opcode extension.
1495 ccflags_uselargefiles=''
1496 ldflags_uselargefiles=''
1497 libswanted_uselargefiles=''
1498 : set usemultiplicity on the Configure command line to enable multiplicity.
1499 : set usesocks on the Configure command line to enable socks.
1501 : set usethreads on the Configure command line to enable threads.
1502 usereentrant='undef'
1503 : List of libraries we want.
1504 : If anyone needs extra -lxxx, put those in a hint file.
1505 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1506 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1507 : We probably want to search /usr/shlib before most other libraries.
1508 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1509 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1510 glibpth="/usr/shlib $glibpth"
1511 : Do not use vfork unless overridden by a hint file.
1514 : Find the basic shell for Bourne shell scripts
1518 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1521 if test -f "$xxx"; then
1524 : Build up a list and do a single loop so we can 'break' out.
1525 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1526 for xxx in sh bash ksh pdksh ash; do
1528 try="$try ${p}/${xxx}"
1532 if test -f "$xxx"; then
1535 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1538 elif test -f "$xxx.exe"; then
1549 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1551 Usually it's in /bin/sh. How did you even get this far?
1552 Please contact me (Perl Maintainers) at perlbug@perl.org and
1553 we'll try to straighten this all out.
1559 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1560 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1563 : see if sh knows # comments
1564 if `$sh -c '#' >/dev/null 2>&1`; then
1568 test -f $xcat$_exe || xcat=/usr/bin/cat
1569 if test ! -f $xcat$_exe; then
1570 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1571 if test -f $p/cat$_exe; then
1576 if test ! -f $xcat$_exe; then
1577 echo "Can't find cat anywhere!"
1581 echo "#!$xcat" >sharp
1584 ./sharp > today 2>/dev/null
1585 if test -s today; then
1588 echo "#! $xcat" > sharp
1591 ./sharp > today 2>/dev/null
1592 if test -s today; then
1600 echo "Your $sh doesn't grok # comments--I will strip them later on."
1603 echo "exec grep -v '^[ ]*#'" >spitshell
1605 $eunicefix spitshell
1606 spitshell=`pwd`/spitshell
1608 echo "I presume that if # doesn't work, #! won't work either!"
1613 : figure out how to guarantee sh startup
1615 '') startsh=${sharpbang}${sh} ;;
1627 : echo "Yup, it does."
1629 echo "Hmm... '$startsh' does not guarantee sh startup..."
1630 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1634 : Save command line options in file UU/cmdline.opt for later use in
1635 : generating config.sh.
1636 cat > cmdline.opt <<EOSH
1637 : Configure command line arguments.
1646 cat >>cmdline.opt <<EOSH
1647 config_arg$argn='$arg'
1649 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1652 arg_exp=`cat cmdl.opt`
1653 args_exp="$args_exp$args_sep'$arg_exp'"
1654 argn=`expr $argn + 1`
1659 : produce awk script to parse command line options
1660 cat >options.awk <<'EOF'
1662 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1664 len = length(optstr);
1665 for (i = 1; i <= len; i++) {
1666 c = substr(optstr, i, 1);
1667 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1678 if (substr(str, 1, 1) != "-") {
1679 printf("'%s'\n", str);
1683 for (i = 2; i <= len; i++) {
1684 c = substr(str, i, 1);
1686 printf("-%s\n", substr(str, i));
1692 printf("'%s'\n", substr(str, i + 1));
1705 : process the command line options
1706 set X `for arg in "$@"; do echo "X$arg"; done |
1707 sed -e s/X// | awk -f options.awk`
1712 : set up default values
1721 rm -f optdef.sh posthint.sh
1722 cat >optdef.sh <<EOS
1728 while test $# -gt 0; do
1730 -d) shift; fastread=yes;;
1731 -e) shift; alldone=cont;;
1735 if test -r "$1"; then
1738 echo "$me: cannot read config file $1." >&2
1744 -h) shift; error=true;;
1745 -r) shift; reuseval=true;;
1746 -s) shift; silent=true; realsilent=true;;
1747 -E) shift; alldone=exit;;
1748 -K) shift; knowitall=true;;
1750 -S) shift; silent=true; extractsh=true;;
1755 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1756 echo "$me: ignoring -D $1" >&2
1759 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1760 *) echo "$1='define'" >> optdef.sh;;
1767 *=) echo "$1" >> optdef.sh;;
1769 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1770 echo "$me: ignoring -U $1" >&2
1772 *) echo "$1='undef'" >> optdef.sh;;
1783 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1787 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1788 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1794 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1795 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1796 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1797 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1798 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1799 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1805 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1807 echo "$yyy=''" >> posthint.sh ;;
1812 echo "$yyy='$zzz'" >> posthint.sh ;;
1814 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1816 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1821 echo "$yyy=$zzz" >> posthint.sh ;;
1822 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1826 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1829 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1837 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1838 [-U symbol] [-U symbol=] [-A command:symbol...]
1839 -d : use defaults for all answers.
1840 -e : go on without questioning past the production of config.sh.
1841 -f : specify an alternate default configuration file.
1842 -h : print this help message and exit (with an error status).
1843 -r : reuse C symbols value if possible (skips costly nm extraction).
1844 -s : silent mode, only echoes questions and essential information.
1845 -D : define symbol to have some value:
1846 -D symbol symbol gets the value 'define'
1847 -D symbol=value symbol gets the value 'value'
1848 common used examples (see INSTALL for more info):
1849 -Duse64bitint use 64bit integers
1850 -Duse64bitall use 64bit integers and pointers
1851 -Dusethreads use thread support
1852 -Dinc_version_list=none do not include older perl trees in @INC
1853 -DEBUGGING=none DEBUGGING options
1854 -Dcc=gcc choose your compiler
1855 -Dprefix=/opt/perl5 choose your destination
1856 -E : stop at the end of questions, after having produced config.sh.
1857 -K : do not use unless you know what you are doing.
1858 -O : ignored for backward compatibility
1859 -S : perform variable substitutions on all .SH files (can mix with -f)
1860 -U : undefine symbol:
1861 -U symbol symbol gets the value 'undef'
1862 -U symbol= symbol gets completely empty
1864 -A : manipulate symbol after the platform specific hints have been applied:
1865 -A append:symbol=value append value to symbol
1866 -A symbol=value like append:, but with a separating space
1867 -A define:symbol=value define symbol to have value
1868 -A clear:symbol define symbol to be ''
1869 -A define:symbol define symbol to be 'define'
1870 -A eval:symbol=value define symbol to be eval of value
1871 -A prepend:symbol=value prepend value to symbol
1872 -A undef:symbol define symbol to be 'undef'
1873 -A undef:symbol= define symbol to be ''
1874 e.g.: -A prepend:libswanted='cl pthread '
1875 -A ccflags=-DSOME_MACRO
1876 -V : print version number and exit (with a zero status).
1883 case "$fastread$alldone" in
1886 case "$extractsh" in
1889 if test ! -t 0; then
1890 echo "Say 'sh Configure', not 'sh <Configure'"
1900 true) exec 1>/dev/null;;
1903 : run the defines and the undefines, if any, but leave the file out there...
1905 grep '\\' optdef.sh >/dev/null 2>&1
1906 if test $? = 0; then
1907 echo "Configure does not support \\ in -D arguments"
1911 : create the posthint manipulation script and leave the file out there...
1916 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1917 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1918 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1919 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1920 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1923 : Some greps do not return status, grrr.
1924 echo "grimblepritz" >grimble
1925 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1927 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1933 : the following should work in any shell
1937 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1938 cat >contains <<'EOSS'
1939 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1944 : Find the path to the source tree
1947 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1951 *) src=`cd ../$src && pwd` ;;
1964 if test -f $rsrc/Configure && \
1965 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1967 : found it, so we are ok.
1970 for src in . .. ../.. ../../.. ../../../..; do
1971 if test -f ../$src/Configure && \
1972 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1983 Sorry, I can't seem to locate the source dir for $package. Please start
1984 Configure with an explicit path -- i.e. /some/path/Configure.
1992 echo "Sources for $package found in \"$src\"." >&4
1996 : script used to extract .SH files with variable substitutions
1997 cat >extract <<'EOS'
1999 echo "Doing variable substitutions on .SH files..."
2000 if test -f MANIFEST; then
2001 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
2003 echo "(Looking for .SH files under the source directory.)"
2004 set x `(cd "$src"; find . -name "*.SH" -print)`
2008 0) set x `(cd "$src"; echo *.SH)`; shift;;
2010 if test ! -f "$src/$1"; then
2016 while test $name; do
2017 if test ! -d "$name"; then
2018 create="$name $create";
2019 name=`echo $name | sed -e "s|^[^/]*$||"`;
2020 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2025 for file in $create; do
2034 dir=`expr X$file : 'X\(.*\)/'`
2035 file=`expr X$file : 'X.*/\(.*\)'`
2036 (cd "$dir" && . ./$file)
2046 dir=`expr X$file : 'X\(.*\)/'`
2047 file=`expr X$file : 'X.*/\(.*\)'`
2048 (set x $dir; shift; eval $mkdir_p)
2049 sh <"$src/$dir/$file"
2058 if test -f "$src/config_h.SH"; then
2059 if test ! -f config.h; then
2060 : oops, they left it out of MANIFEST, probably, so do it anyway.
2061 . "$src/config_h.SH"
2066 : extract files and exit if asked to do so
2067 case "$extractsh" in
2069 case "$realsilent" in
2073 case "$config_sh" in
2074 '') config_sh='config.sh';;
2077 echo "Fetching answers from $config_sh..."
2084 echo "Extraction done."
2089 : Eunice requires " " instead of "", can you believe it
2092 echo "Beginning of configuration questions for $package."
2094 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2096 : first determine how to suppress newline on echo command
2098 echo "Checking echo to see how to suppress newlines..."
2099 (echo "hi there\c" ; echo " ") >.echotmp
2100 if $contains c .echotmp >/dev/null 2>&1 ; then
2111 echo $n "The star should be here-->$c"
2115 : Now test for existence of everything in MANIFEST
2117 if test -f "$rsrc/MANIFEST"; then
2118 echo "First let's make sure your kit is complete. Checking..." >&4
2119 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2120 (split -l 50 2>/dev/null || split -50)
2123 for filelist in x??; do
2124 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2125 >/dev/null 2>>"$tmppwd/missing")
2127 if test -s missing; then
2131 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2133 You have the option of continuing the configuration process, despite the
2134 distinct possibility that your kit is damaged, by typing 'y'es. If you
2135 do, don't blame me if something goes wrong. I advise you to type 'n'o
2136 and contact the author (perlbug@perl.org).
2139 echo $n "Continue? [n] $c" >&4
2143 echo "Continuing..." >&4
2147 echo "ABORTING..." >&4
2152 echo "Looks good..."
2155 echo "There is no MANIFEST file. I hope your kit is complete !"
2159 : Find the appropriate value for a newline for tr
2160 if test -n "$DJGPP"; then
2163 if test X"$trnl" = X; then
2164 case "`echo foo | tr '\n' x 2>/dev/null`" in
2168 if test X"$trnl" = X; then
2169 case "`echo foo | tr '\012' x 2>/dev/null`" in
2170 foox) trnl='\012' ;;
2173 if test X"$trnl" = X; then
2174 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2175 fooxy) trnl='\n\r' ;;
2178 if test X"$trnl" = X; then
2181 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2187 : compute the number of columns on the terminal for proper question formatting
2192 : set up the echo used in my read
2193 myecho="case \"\$xxxm\" in
2194 '') echo $n \"\$rp $c\" >&4;;
2196 '') echo $n \"[\$xxxm] $c\";;
2198 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2200 echo $n \"[\$xxxm] $c\" >&4
2202 echo $n \"\$rp [\$xxxm] $c\" >&4
2208 : now set up to do reads with possible shell escape and default assignment
2214 case "\$fastread" in
2215 yes) case "\$dflt" in
2218 case "\$silent-\$rp" in
2223 *) case "\$silent" in
2224 true) case "\$rp" in
2229 while expr "X\$ans" : "X!" >/dev/null; do
2233 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2241 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2250 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2255 echo "(OK, I'll run with -d after this question.)" >&4
2258 echo "*** Sorry, \$1 not supported yet." >&4
2268 echo "*** Substitution done -- please confirm."
2270 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2275 echo "*** Error -- try again."
2282 case "\$ans\$xxxm\$nostick" in
2294 : create .config dir to save info across Configure sessions
2295 test -d ../.config || mkdir ../.config
2296 cat >../.config/README <<EOF
2297 This directory created by Configure to save information that should
2298 persist across sessions for $package.
2300 You may safely delete it if you wish.
2303 : See if we are using a devel version and want that
2304 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2307 usedevel="$define" ;;
2308 *) case "$xversion" in
2311 *** WHOA THERE!!! ***
2313 This is an UNSTABLE DEVELOPMENT release.
2314 The version of this $package distribution is $xversion, that is, odd,
2315 (as opposed to even) and that signifies a development release.
2316 If you want a maintenance release, you want an even-numbered version.
2318 Do ***NOT*** install this into production use.
2319 Data corruption and crashes are possible.
2321 It is most seriously suggested that you do not continue any further
2322 unless you want to help in developing and debugging Perl.
2324 If you *still* want to build perl, you can answer 'y' now,
2325 or pass -Dusedevel to Configure.
2328 rp='Do you really want to continue?'
2332 [yY]) echo >&4 "Okay, continuing."
2333 usedevel="$define" ;;
2334 *) echo >&4 "Okay, bye."
2345 case "$versiononly" in
2346 '') versiononly="$define" ;;
2348 case "$installusrbinperl" in
2349 '') installusrbinperl="$undef" ;;
2354 : general instructions
2357 user=`(logname) 2>/dev/null`
2359 '') user=`whoami 2>&1`;;
2361 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2364 rp='Would you like to see the instructions?'
2375 This installation shell script will examine your system and ask you questions
2376 to determine how the perl5 package should be installed. If you get
2377 stuck on a question, you may use a ! shell escape to start a subshell or
2378 execute a command. Many of the questions will have default answers in square
2379 brackets; typing carriage return will give you the default.
2381 On some of the questions which ask for file or directory names you are allowed
2382 to use the ~name construct to specify the login directory belonging to "name",
2383 even if you don't have a shell which knows about that. Questions where this is
2384 allowed will be marked "(~name ok)".
2388 dflt='Type carriage return to continue'
2392 The prompter used in this script allows you to use shell variables and
2393 backticks in your answers. You may use $1, $2, etc... to refer to the words
2394 in the default answer, as if the default line was a set of arguments given to a
2395 script shell. This means you may also use $* to repeat the whole default line,
2396 so you do not have to re-type everything to add something to the default.
2398 Every time there is a substitution, you will have to confirm. If there is an
2399 error (e.g. an unmatched backtick), the default answer will remain unchanged
2400 and you will be prompted again.
2402 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2403 the questions and use the computed defaults (or the previous answers if there
2404 was already a config.sh file). Type 'Configure -h' for a list of options.
2405 You may also start interactively and then answer '& -d' at any prompt to turn
2406 on the non-interactive behaviour for the remainder of the execution.
2412 Much effort has been expended to ensure that this shell script will run on any
2413 Unix system. If despite that it blows up on yours, your best bet is to edit
2414 Configure and run it again. If you can't run Configure for some reason,
2415 you'll have to generate a config.sh file by hand. Whatever problems you
2416 have, let me (perlbug@perl.org) know how I blew it.
2418 This installation script affects things in two ways:
2420 1) it may do direct variable substitutions on some of the files included
2422 2) it builds a config.h file for inclusion in C programs. You may edit
2423 any of these files as the need arises after running this script.
2425 If you make a mistake on a question, there is no easy way to back up to it
2426 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2427 files. Configure will offer to let you do this before it runs the SH files.
2430 dflt='Type carriage return to continue'
2432 case "$firsttime" in
2433 true) echo $user >>../.config/instruct;;
2437 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2438 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2439 if test "X$sysroot" = X; then
2444 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2445 # _sysroot is used in places where we need --sysroot=foo
2446 # but using the rest of the flags could cause issues.
2447 _sysroot="--sysroot=$sysroot";
2451 ccflags="$ccflags $_sysroot"
2456 ldflags="$ldflags $_sysroot"
2461 cppflags="$cppflags $_sysroot"
2463 # lddlflags updated below in lddlflags section;
2464 # same with cccdlflags
2468 # Adjust some defaults to also use $sysroot
2469 for var in xlibpth loclibpth locincpth glibpth; do
2472 for path in $xxx; do
2473 eval $var=\"\$$var $sysroot$path\"
2479 : find out where common programs are
2481 echo "Locating common programs..." >&4
2494 if test -d \$dir/\$thing; then
2500 for thisthing in \$dir/\$thing; do
2501 : just loop through to pick last item
2503 if test -f \$thisthing; then
2506 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2509 elif test -f \$dir/\$thing.exe; then
2510 if test -n "$DJGPP"; then
2511 echo \$dir/\$thing.exe
2512 elif test "$eunicefix" != ":"; then
2513 : on Eunice apparently
2566 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2567 pth="$pth $sysroot/lib $sysroot/usr/lib"
2568 for file in $loclist; do
2572 if test -f "$xxx"; then
2575 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2576 xxx=`./loc $file $file $pth`
2579 '') xxx=`./loc $file $file $pth`;;
2580 *) xxx=`./loc $xxx $xxx $pth`;;
2582 eval $file=$xxx$_exe
2586 echo $file is in $xxx.
2589 echo $file is in $xxx.
2592 echo "I don't know where '$file' is, and my life depends on it." >&4
2593 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2599 echo "Don't worry if any of the following aren't found..."
2601 for file in $trylist; do
2605 if test -f "$xxx"; then
2608 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2609 xxx=`./loc $file $file $pth`
2612 '') xxx=`./loc $file $file $pth`;;
2613 *) xxx=`./loc $xxx $xxx $pth`;;
2615 eval $file=$xxx$_exe
2619 echo $file is in $xxx.
2622 echo $file is in $xxx.
2625 echo "I don't see $file out there, $say."
2632 echo "Substituting grep for egrep."
2639 *) if $less -R </dev/null >/dev/null 2>&1; then
2640 echo "Substituting less -R for less."
2648 echo "Substituting cp for ln."
2657 echo "I can't find make or gmake, and my life depends on it." >&4
2658 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2666 *) # We can't have osname yet.
2667 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2668 # Assume that gmake, if found, is definitely GNU make
2669 # and prefer it over the system make.
2670 echo "Substituting gmake for make."
2678 echo "Hopefully test is built into your sh."
2681 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2682 echo "Using the test built into your sh."
2690 echo "Hopefully echo is built into your sh."
2695 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2696 $echo $n "hi there$c" >foo1
2697 echo $n "hi there$c" >foo2
2698 if cmp foo1 foo2 >/dev/null 2>&1; then
2699 echo "They are compatible. In fact, they may be identical."
2706 They are not compatible! You are probably running ksh on a non-USG system.
2707 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2708 have echo built in and we may have to run some Bourne shell scripts. That
2709 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2712 $echo $n "The star should be here-->$c"
2719 # This question was auctioned at YAPC::Europe-2007 in Vienna
2720 # I never promised you could answer it. I only auctioned the question.
2722 The following message is sponsored by
2724 Dresden.pm<--The stars should be here.
2726 Dear Perl user, system administrator or package
2727 maintainer, the Perl community sends greetings to
2728 you. Do you (emblematical) greet back [Y/n]? n
2732 : Check what type of C compiler we use
2736 cat <<'EOSC' >>trygcc
2741 int main(int argc, char *argv[]) {
2745 if $cc -o try $ccflags $ldflags try.c; then
2748 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2754 # Skip this test because it gives a false match on output like:
2755 # ./trygcc: line 23: cc: command not found
2756 # case "`$cc -v -c try.c 2>&1`" in
2757 # *gcc*) trygcc=no ;;
2759 if $test X"$trygcc" = Xyes; then
2760 if gcc -o try -c try.c; then
2762 echo "You seem to have a working gcc, though." >&4
2763 # Switching compilers may undo the work of hints files.
2764 # The most common problem is -D_REENTRANT for threads.
2765 # This heuristic catches that case, but gets false positives
2766 # if -Dusethreads was not actually specified. Better to
2767 # bail out here with a useful message than fail
2768 # mysteriously later. Should we perhaps just try to
2769 # re-invoke Configure -Dcc=gcc config_args ?
2770 if $test -f usethreads.cbu; then
2773 *** However, any setting of the C compiler flags (e.g. for thread support)
2774 *** will be lost. It may be necessary for you to restart Configure and
2775 *** add -Dcc=gcc to your Configure command line.
2778 rp="Would you like to go ahead and try gcc anyway?"
2781 rp="Would you like to use it?"
2784 if $test -f myread; then
2787 if $test -f UU/myread; then
2790 echo "Cannot find myread, sorry. Aborting." >&2
2795 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2808 cat <<'EOSC' >>checkcc
2813 int main(int argc, char *argv[]) {
2817 if $cc -o try $ccflags $ldflags try.c; then
2820 if $test X"$despair" = Xyes; then
2821 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2824 You need to find a working C compiler.
2825 Either (purchase and) install the C compiler supplied by your OS vendor,
2826 or for a free C compiler try http://gcc.gnu.org/
2827 I cannot continue any further, aborting.
2836 : determine whether symbolic links are supported
2839 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2840 echo "Symbolic links are supported." >&4
2843 echo "Symbolic links are NOT supported." >&4
2848 : determine whether symbolic links are supported
2852 echo "Checking how to test for symbolic links..." >&4
2854 if $test "X$issymlink" = X; then
2856 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2857 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2859 if test $? = 0; then
2862 echo "Your builtin 'test -h' may be broken." >&4
2865 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2868 if test -f "$p/$test"; then
2877 echo "Trying external '$test -h'." >&4
2878 issymlink="$test -h"
2879 if $test ! -h sym >/dev/null 2>&1; then
2880 echo "External '$test -h' is broken, too." >&4
2888 if $test "X$issymlink" = X; then
2889 if $test -L sym 2>/dev/null; then
2890 issymlink="$test -L"
2891 echo "The builtin '$test -L' worked." >&4
2894 if $test "X$issymlink" != X; then
2895 echo "You can test for symbolic links with '$issymlink'." >&4
2897 echo "I do not know how you can test for symbolic links." >&4
2901 *) echo "No symbolic links, so not testing for their testing..." >&4
2905 : Make symlinks util
2906 case "$mksymlinks" in
2909 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2912 *) case "$lns:$issymlink" in
2913 *"ln"*" -s:"*"test -"?)
2914 echo "Creating the symbolic links..." >&4
2916 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2926 print "# dir = ", dir, "file = ", file
2927 mf[dir] = mf[dir]" "source"/"dir"/"file;
2930 if (d != ".") { print("mkdir -p "d) }
2931 print("ln -sf "mf[d]" "d);
2933 }' source="$src" > UU/mksymlinks.$$
2937 if test ! -d t/base; then
2938 echo "Failed to create the subdirectories. Aborting." >&4
2942 if test ! -f t/base/lex.t; then
2943 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2946 if test ! -f win32/win32.c; then
2947 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2952 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2960 : Check for Cross-Compilation
2961 if $test "X$targethost" = "X"; then
2964 if $test "X$targetenv" = "X"; then
2967 case "$usecrosscompile" in
2969 $echo "Cross-compiling..."
2972 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2973 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2974 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2975 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2976 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2977 # leave out ld, choosing it is more complex
2978 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2979 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2980 # We are in a weird spot. Just before us, some values
2981 # were 'saved', to be restored after the hints are
2982 # run. This means that the changes we made to ar,
2983 # nm and ranlib will get reverted.
2984 # To avoid that, we hijack the saving mechanism and
2985 # have it save our new values.
2986 for file in ar nm ranlib; do
2988 eval $file=$xxx$_exe
2993 case "$targetarch" in
2994 '') echo "Targetarch not defined." >&4; croak=y ;;
2995 *) echo "Using targetarch $targetarch." >&4 ;;
2997 case "$targethost" in
2998 '') echo "Targethost not defined." >&4; croak=n ;;
2999 *) echo "Using targethost $targethost." >&4
3004 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3006 : compile a host miniperl and generate_uudmap, unless we got passed them
3007 if $test "X$hostperl" = X; then
3008 echo "Building host miniperl and generate_uudmap binaries" >&4
3016 $src/Configure -des -Dusedevel -Dmksymlinks
3018 case "$hostgenerate" in
3019 '') $make generate_uudmap
3020 hostgenerate=$src/host/generate_uudmap
3022 "$undef") hostgenerate=''
3025 hostperl=$src/host/miniperl
3028 hostosname=`$hostperl -le 'print $^O'`
3031 usecrosscompile="$undef"
3035 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3036 case "$targethost" in
3037 '') echo "Checking for cross-compile" >&4
3038 case "$usecrosscompile$multiarch" in
3039 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3040 if [ -f Makefile ]; then
3042 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3044 echo "Configure done."
3048 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3055 *) echo "Using targethost $targethost." >&4
3057 /*) run=$src/Cross/run
3058 targetmkdir=$src/Cross/mkdir
3060 from=$src/Cross/from
3062 *) pwd=`$test -f ../Configure & cd ..; pwd`
3064 targetmkdir=$pwd/Cross/mkdir
3066 from=$pwd/Cross/from
3069 case "$targetrun" in
3070 '') targetrun=ssh ;;
3075 case "$targetfrom" in
3076 '') targetfrom=scp ;;
3080 from=$from-$targetfrom
3081 case "$targetdir" in
3083 echo "Guessing targetdir $targetdir." >&4
3086 case "$targetuser" in
3088 echo "Guessing targetuser $targetuser." >&4
3091 case "$targetport" in
3093 echo "Guessing targetport $targetport." >&4
3096 case "$targetfrom" in
3100 case "$targetrun" in
3120 '') cwd=$targetdir ;;
3125 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3131 *) echo "Unknown targetrun '$targetrun'" >&4
3135 case "$targetmkdir" in
3137 cat >$targetmkdir <<EOF
3139 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3141 $chmod a+rx $targetmkdir
3143 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3155 $targetmkdir \`dirname \$f\`
3156 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3159 $targetmkdir $targetdir/\`dirname \$f\`
3160 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3173 $mkdir -p $targetdir/\`dirname \$f\`
3174 $cp \$f $targetdir/\$f || exit 1
3177 $targetmkdir $targetdir/\`dirname \$f\`
3178 $cp \$f $targetdir/\$f || exit 1
3185 *) echo "Unknown targetto '$targetto'" >&4
3189 case "$targetfrom" in
3196 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3201 cp) cat >$from <<EOF
3206 cp $targetdir/\$f . || exit 1
3211 *) echo "Unknown targetfrom '$targetfrom'" >&4
3215 if $test ! -f $run; then
3216 echo "Target 'run' script '$run' not found." >&4
3220 if $test ! -f $to; then
3221 echo "Target 'to' script '$to' not found." >&4
3225 if $test ! -f $from; then
3226 echo "Target 'from' script '$from' not found." >&4
3230 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3234 Using '$run' for remote execution,
3235 and '$from' and '$to'
3236 for remote file transfer.
3242 usecrosscompile="$undef"
3247 : see whether [:lower:] and [:upper:] are supported character classes
3249 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3251 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3255 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3256 # (0xd9 and 0xe2), therefore that is a nice testing point.
3257 if test "X$up" = X -o "X$low" = X; then
3258 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3264 if test "X$up" = X -o "X$low" = X; then
3265 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3271 if test "X$up" = X -o "X$low" = X; then
3272 case "`echo RS | od -x 2>/dev/null`" in
3274 echo "Hey, this might be EBCDIC." >&4
3275 if test "X$up" = X -o "X$low" = X; then
3276 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3277 rs) up='[A-IJ-RS-Z]'
3282 if test "X$up" = X -o "X$low" = X; then
3283 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3293 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3295 echo "Using $up and $low to convert case." >&4
3298 echo "I don't know how to translate letters from upper to lower case." >&4
3299 echo "Your tr is not acting any way I know of." >&4
3303 : set up the translation script tr, must be called with ./tr of course
3307 '[A-Z][a-z]') exec $tr '$up' '$low';;
3308 '[a-z][A-Z]') exec $tr '$low' '$up';;
3315 : Try to determine whether config.sh was made on this system
3316 case "$config_sh" in
3318 myuname=`$uname -a 2>/dev/null`
3319 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3320 # Downcase everything to avoid ambiguity.
3321 # Remove slashes and single quotes so we can use parts of this in
3322 # directory and file names.
3323 # Remove newlines so myuname is sane to use elsewhere.
3324 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3325 # because the A-Z/a-z are not consecutive.
3326 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3327 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3328 newmyuname="$myuname"
3330 case "$knowitall" in
3332 if test -f ../config.sh; then
3333 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3334 eval "`grep myuname= ../config.sh`"
3336 if test "X$myuname" = "X$newmyuname"; then
3344 : Get old answers from old config file if Configure was run on the
3345 : same system, otherwise use the hints.
3348 if test -f config.sh; then
3350 rp="I see a config.sh file. Shall I use it to set the defaults?"
3353 n*|N*) echo "OK, I'll ignore it."
3354 mv config.sh config.sh.old
3355 myuname="$newmyuname"
3357 *) echo "Fetching default answers from your old config.sh file..." >&4
3365 : Older versions did not always set $sh. Catch re-use of such
3375 if test ! -f config.sh; then
3378 First time through, eh? I have some defaults handy for some systems
3379 that need some extra help getting the Configure answers right:
3382 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3384 : Half the following guesses are probably wrong... If you have better
3385 : tests or hints, please send them to perlbug@perl.org
3386 : The metaconfig authors would also appreciate a copy...
3387 $test -f /irix && osname=irix
3388 $test -f /xenix && osname=sco_xenix
3389 $test -f /dynix && osname=dynix
3390 $test -f /dnix && osname=dnix
3391 $test -f /lynx.os && osname=lynxos
3392 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3393 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3394 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3395 $test -f /bin/mips && /bin/mips && osname=mips
3396 $test -d /usr/apollo/bin && osname=apollo
3397 $test -f /etc/saf/_sactab && osname=svr4
3398 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3399 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3400 $test -f /sys/utilities/MultiView && osname=amigaos
3401 if $test -d /MachTen -o -d /MachTen_Folder; then
3403 if $test -x /sbin/version; then
3404 osvers=`/sbin/version | $awk '{print $2}' |
3405 $sed -e 's/[A-Za-z]$//'`
3406 elif $test -x /usr/etc/version; then
3407 osvers=`/usr/etc/version | $awk '{print $2}' |
3408 $sed -e 's/[A-Za-z]$//'`
3414 $test -f /sys/posix.dll &&
3415 $test -f /usr/bin/what &&
3416 set X `/usr/bin/what /sys/posix.dll` &&
3417 $test "$3" = UWIN &&
3421 if $test -f $uname; then
3429 umips) osname=umips ;;
3432 [23]100) osname=mips ;;
3434 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3435 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3438 elif $test -f /etc/kconfig; then
3440 if test "$lns" = "$ln -s"; then
3442 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3444 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3451 if test -n "$DJGPP"; then
3460 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3462 # oslevel can fail with:
3463 # oslevel: Unable to acquire lock.
3464 *not\ found) osvers="$4"."$3" ;;
3465 '<3240'|'<>3240') osvers=3.2.0 ;;
3466 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3467 '=3250'|'>3250') osvers=3.2.5 ;;
3471 bitrig) osname=bitrig
3474 bsd386) osname=bsd386
3477 cygwin*) osname=cygwin
3480 *dc.osx) osname=dcosx
3486 domainos) osname=apollo
3492 dragonfly) osname=dragonfly
3495 dynixptx*) osname=dynixptx
3496 osvers=`echo "$4"|sed 's/^v//'`
3498 freebsd) osname=freebsd
3500 genix) osname=genix ;;
3504 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3517 $test -f /system/lib/libandroid.so && osname=linux-android
3521 netbsd*) osname=netbsd
3524 news-os) osvers="$3"
3526 4*) osname=newsos4 ;;
3530 nonstop-ux) osname=nonstopux ;;
3531 openbsd) osname=openbsd
3537 POSIX-BC | posix-bc ) osname=posix-bc
3540 powerux | power_ux | powermax_os | powermaxos | \
3541 powerunix | power_unix) osname=powerux
3547 solaris) osname=solaris
3549 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3556 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3560 titanos) osname=titanos
3569 ultrix) osname=ultrix
3572 osf1|mls+) case "$5" in
3575 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3578 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3581 hp*) osname=hp_osf1 ;;
3582 mips) osname=mips_osf1 ;;
3585 # UnixWare 7.1.2 is known as Open UNIX 8
3586 openunix|unixware) osname=svr5
3594 $2) case "$osname" in
3598 : svr4.x or possibly later
3608 if test -f /stand/boot ; then
3609 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3610 if test -n "$INITPROG" -a -f "$INITPROG"; then
3611 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3612 if test -n "$isesix"; then
3620 *) if test -f /etc/systemid; then
3622 set `echo $3 | $sed 's/\./ /g'` $4
3623 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3625 elif $test -f $src/hints/sco_$1_$2.sh; then
3627 elif $test -f $src/hints/sco_$1.sh; then
3632 '') : Still unknown. Probably a generic Sys V.
3641 *) case "$osname" in
3642 '') : Still unknown. Probably a generic BSD.
3650 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3651 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3652 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3655 $rm -f UU/kernel.what
3656 elif test -d c:/. -o -n "$is_os2" ; then
3663 case "$targetarch" in
3666 case "$targetarch" in
3668 # Will load qnx.sh, which should change osname to nto
3673 # Catch arm-linux-androideabi, mipsel-linux-android,
3674 # and i686-linux-android
3675 osname=linux-android
3679 # Something like arm-linux-gnueabihf is really just
3686 # XXX perhaps we should just assume
3687 # osvers to be 2, or maybe take the value
3688 # from targetarch. Using $run before the
3689 # hints are run is somewhat icky.
3690 set X `$run $uname -a 2>/dev/null`
3693 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3698 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3705 : Now look for a hint file osname_osvers, unless one has been
3706 : specified already.
3709 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3710 : Also try without trailing minor version numbers.
3711 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3712 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3713 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3714 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3717 *) case "$osvers" in
3720 *) if $test -f $src/hints/$file.sh ; then
3722 elif $test -f $src/hints/$xfile.sh ; then
3724 elif $test -f $src/hints/$xxfile.sh ; then
3726 elif $test -f $src/hints/$xxxfile.sh ; then
3728 elif $test -f $src/hints/$xxxxfile.sh ; then
3730 elif $test -f "$src/hints/${osname}.sh" ; then
3739 if $test -f Policy.sh ; then
3742 none) dflt="Policy" ;;
3743 *) dflt="Policy $dflt" ;;
3748 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3752 if $test -f Policy.sh ; then
3755 There's also a Policy hint file available, which should make the
3756 site-specific (policy) questions easier to answer.
3763 You may give one or more space-separated answers, or "none" if appropriate.
3764 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3765 previous run of Configure, you may specify it as well as or instead of
3766 OS-specific hints. If hints are provided for your OS, you should use them:
3767 although Perl can probably be built without hints on many platforms, using
3768 hints often improve performance and may enable features that Configure can't
3769 set up on its own. If there are no hints that match your OS, specify "none";
3770 DO NOT give a wrong version or a wrong OS.
3774 rp="Which of these apply, if any?"
3777 for file in $tans; do
3778 if $test X$file = XPolicy -a -f Policy.sh; then
3780 $cat Policy.sh >> UU/config.sh
3781 elif $test -f $src/hints/$file.sh; then
3782 . $src/hints/$file.sh
3783 $cat $src/hints/$file.sh >> UU/config.sh
3784 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3787 : Give one chance to correct a possible typo.
3788 echo "$file.sh does not exist"
3790 rp="hint to use instead?"
3792 for file in $ans; do
3793 if $test -f "$src/hints/$file.sh"; then
3794 . $src/hints/$file.sh
3795 $cat $src/hints/$file.sh >> UU/config.sh
3796 elif $test X$ans = X -o X$ans = Xnone ; then
3799 echo "$file.sh does not exist -- ignored."
3806 : Remember our hint file for later.
3807 if $test -f "$src/hints/$file.sh" ; then
3817 echo "Fetching default answers from $config_sh..." >&4
3821 cp $config_sh config.sh 2>/dev/null
3833 : Restore computed paths
3834 for file in $loclist $trylist; do
3835 eval $file="\$_$file"
3840 Configure uses the operating system name and version to set some defaults.
3841 The default value is probably right if the name rings a bell. Otherwise,
3842 since spelling matters for me, either accept the default or answer "none"
3849 ''|' '|none) dflt=none ;;
3850 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3853 *) dflt="$osname" ;;
3855 rp="Operating system name?"
3859 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3865 ''|' '|none) dflt=none ;;
3866 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3867 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3869 ''|' ') dflt=none ;;
3874 *) dflt="$osvers" ;;
3876 rp="Operating system version?"
3886 : who configured the system
3887 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3890 cf_by=`(logname) 2>/dev/null`
3893 cf_by=`(whoami) 2>/dev/null`
3895 "") cf_by=unknown ;;
3900 : decide how portable to be. Allow command line overrides.
3901 case "$d_portable" in
3903 *) d_portable="$define" ;;
3906 : set up shell script to do ~ expansion
3912 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3915 if $test -f /bin/csh; then
3916 /bin/csh -f -c "glob \$1"
3921 name=\`$expr x\$1 : '..\([^/]*\)'\`
3922 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3923 if $test ! -d "\$dir"; then
3925 echo "\$me: can't locate home directory for: \$name" >&2
3930 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3946 : now set up to get a file name
3950 cat <<'EOSC' >>getfile
3966 : getfile will accept an answer from the comma-separated list
3967 : enclosed in parentheses even if it does not meet other criteria.
3968 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3969 fn=`echo $fn | sed 's/(.*)//'`
3975 loc_file=`expr $fn : '.*:\(.*\)'`
3976 fn=`expr $fn : '\(.*\):.*'`
3984 */*) fullpath=true;;
3993 *e*) exp_file=true;;
3996 *p*) nopath_ok=true;;
4001 *d*) type='Directory';;
4002 *l*) type='Locate';;
4007 Locate) what='File';;
4012 case "$d_portable" in
4020 while test "$type"; do
4025 true) rp="$rp (~name ok)";;
4028 if test -f UU/getfile.ok && \
4029 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4048 value=`UU/filexp $ans`
4051 if test "$ans" != "$value"; then
4052 echo "(That expands to $value on this system.)"
4066 /*) value="$ansexp" ;;
4067 [a-zA-Z]:/*) value="$ansexp" ;;
4072 echo "I shall only accept a full path name, as in /bin/ls." >&4
4073 echo "Use a ! shell escape if you wish to check pathnames." >&4
4076 echo "Please give a full path name, starting with slash." >&4
4079 echo "Note that using ~name is ok provided it expands well." >&4
4092 for fp in $gfpth; do
4093 if test "X$fp" = X.; then
4098 if test -f "$pf"; then
4100 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4102 echo "($value is not a plain file, but that's ok.)"
4105 if test X"$type" = X; then
4112 for fp in $gfpth; do
4113 if test "X$fp" = X.; then
4118 direxp="$fp/$ansexp"
4120 if test -d "$direxp"; then
4128 if test -d "$ansexp"; then
4129 echo "(Looking for $loc_file in directory $value.)"
4130 value="$value/$loc_file"
4131 ansexp="$ansexp/$loc_file"
4133 if test -f "$ansexp"; then
4136 case "$nopath_ok" in
4137 true) case "$value" in
4139 *) echo "Assuming $value will be in people's path."
4155 if test "$fastread" = yes; then
4160 rp="$what $value doesn't exist. Use that name anyway?"
4179 test "X$gfpthkeep" != Xy && gfpth=""
4182 : determine root of directory hierarchy where package will be installed.
4185 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4188 dflt=`echo "$prefix" | sed 's/.$//'`
4196 By default, $package will be installed in $dflt/bin, manual pages
4197 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4198 installation directories. Typically this is something like /usr/local.
4199 If you wish to have binaries under /usr/bin but other parts of the
4200 installation under /usr/local, that's ok: you will be prompted
4201 separately for each of the installation directories, the prefix being
4202 only used to set the defaults.
4206 rp='Installation prefix to use?'
4214 *) oldprefix="$prefix";;
4221 : allow them to override the AFS root
4224 *) afsroot=$afsroot ;;
4230 $define|true) afs=true ;;
4231 $undef|false) afs=false ;;
4232 *) if $test -d $afsroot; then
4240 echo "AFS may be running... I'll be extra cautious then..." >&4
4242 echo "AFS does not seem to be running..." >&4
4245 : determine installation prefix for where package is to be installed.
4249 Since you are running AFS, I need to distinguish the directory in which
4250 files will reside from the directory in which they are installed (and from
4251 which they are presumably copied to the former directory by occult means).
4254 case "$installprefix" in
4255 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4256 *) dflt="$installprefix";;
4261 In some special cases, particularly when building $package for distribution,
4262 it is convenient to distinguish the directory in which files should be
4263 installed from the directory ($prefix) in which they will
4264 eventually reside. For most users, these two directories are the same.
4267 case "$installprefix" in
4269 *) dflt=$installprefix;;
4273 rp='What installation prefix should I use for installing files?'
4275 installprefix="$ans"
4276 installprefixexp="$ansexp"
4278 : Perform the prefixexp/installprefixexp correction if necessary
4279 cat <<EOS >installprefix
4282 cat <<'EOSC' >>installprefix
4283 : Change installation prefix, if necessary.
4284 if $test X"$prefix" != X"$installprefix"; then
4285 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4287 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4290 chmod +x installprefix
4291 $eunicefix installprefix
4293 : Set variables such as privlib and privlibexp from the output of ./getfile
4294 : performing the prefixexp/installprefixexp correction if necessary.
4295 cat <<EOS >setprefixvar
4298 cat <<'EOSC' >>setprefixvar
4299 eval "${prefixvar}=\"\$ans\""
4300 eval "${prefixvar}exp=\"\$ansexp\""
4303 chmod +x setprefixvar
4304 $eunicefix setprefixvar
4306 : set up the script used to warn in case of inconsistency
4315 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4317 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4318 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4323 echo "*** WHOA THERE!!! ***" >&4
4324 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4327 rp=" Keep the $hint value?"
4330 y) td=$was; tu=$was;;
4334 : function used to set '$1' to '$val'
4335 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4337 $define$undef) . ./whoa; eval "$var=\$td";;
4338 $undef$define) . ./whoa; eval "$var=\$tu";;
4339 *) eval "$var=$val";;
4342 : get the patchlevel
4344 echo "Getting the current patchlevel..." >&4
4345 if $test -r $rsrc/patchlevel.h;then
4346 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4347 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4348 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4349 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4350 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4351 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4352 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4361 $echo "(You do not have patchlevel.h. Eek.)"
4363 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4364 version_patchlevel_string="version $patchlevel subversion $subversion"
4365 case "$perl_patchlevel" in
4367 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4368 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4372 $echo "(You have $package $version_patchlevel_string.)"
4376 : XXX Should be a Configure test for double-dots in filenames.
4377 version=`echo $revision $patchlevel $subversion | \
4378 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4379 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4380 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4383 version=`echo $revision $patchlevel $subversion | \
4384 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4385 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4386 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4389 : Special case the 5.005_xx maintenance series, which used 5.005
4390 : without any subversion label as a subdirectory in $sitelib
4391 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4392 api_versionstring='5.005'
4395 : Do we want threads support and if so, what type
4396 case "$usethreads" in
4397 $define|true|[yY]*) dflt='y';;
4398 *) # Catch case where user specified ithreads or 5005threads but
4399 # forgot -Dusethreads (A.D. 4/2002)
4400 case "$useithreads$use5005threads" in
4401 *$define*) dflt='y';;
4408 Perl can be built to offer a form of threading support on some systems
4409 To do so, Configure can be run with -Dusethreads.
4411 Note that Perl built with threading support runs slightly slower
4412 and uses slightly more memory than plain Perl.
4414 If this doesn't make any sense to you, just accept the default '$dflt'.
4416 rp='Build a threading Perl?'
4419 y|Y) val="$define" ;;
4425 if $test $patchlevel -lt 9; then
4426 case "$usethreads" in
4428 : Default to ithreads unless overridden on command line or with
4431 case "$use5005threads" in
4433 echo "5.005 threads are no longer supported"
4437 case "$useithreads" in
4438 $undef|false|[nN]*) dflt='n';;
4440 rp='Use the newer interpreter-based ithreads?'
4443 y|Y) val="$define" ;;
4448 : Now set use5005threads to the opposite value.
4449 case "$useithreads" in
4450 $define) val="$undef" ;;
4457 useithreads="$undef"
4458 use5005threads="$undef"
4462 case "$useithreads$use5005threads" in
4466 You cannot have both the ithreads and the 5.005 threads enabled
4467 at the same time. Disabling the 5.005 threads since they are
4468 much less stable than the ithreads.
4471 use5005threads="$undef"
4476 : perl-5.9.x and later
4478 if test X"$usethreads" = "X$define"; then
4479 case "$use5005threads" in
4483 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4490 use5005threads="$undef"
4491 useithreads="$usethreads"
4494 case "$d_oldpthreads" in
4495 '') : Configure tests would be welcome here. For now, assume undef.
4497 *) val="$d_oldpthreads" ;;
4503 : Look for a hint-file generated 'call-back-unit'. If the
4504 : user has specified that a threading perl is to be built,
4505 : we may need to set or change some other defaults.
4506 if $test -f usethreads.cbu; then
4507 echo "Your platform has some specific hints regarding threaded builds, using them..."
4510 case "$usethreads" in
4511 "$define"|true|[yY]*)
4513 (Your platform does not have any specific hints for threaded builds.
4514 Assuming POSIX threads, then.)
4520 : Check if multiplicity is required
4523 Perl can be built so that multiple Perl interpreters can coexist
4524 within the same Perl executable.
4527 case "$useithreads" in
4530 This multiple interpreter support is required for interpreter-based threads.
4534 *) case "$usemultiplicity" in
4535 $define|true|[yY]*) dflt='y';;
4539 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4540 rp='Build Perl for multiplicity?'
4543 y|Y) val="$define" ;;
4551 : Check if morebits is requested
4552 case "$usemorebits" in
4553 "$define"|true|[yY]*)
4554 use64bitint="$define"
4555 uselongdouble="$define"
4556 usemorebits="$define"
4558 *) usemorebits="$undef"
4562 : Determine the C compiler to be used
4568 rp="Use which C compiler?"
4572 : See whether they have no cc but they do have gcc
4574 if $test -f cc.cbu; then
4579 : make some quick guesses about what we are up against
4581 $echo $n "Hmm... $c"
4591 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4592 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4594 echo "Looks kind of like an OSF/1 system, but we'll see..."
4596 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4597 xxx=`./loc addbib blurfl $pth`
4598 if $test -f $xxx; then
4599 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4603 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4604 echo "Looks kind of like an extended USG system, but we'll see..."
4606 echo "Looks kind of like a USG system, but we'll see..."
4610 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4611 echo "Looks kind of like a BSD system, but we'll see..."
4615 echo "Looks kind of like a Version 7 system, but we'll see..."
4618 case "$eunicefix" in
4621 There is, however, a strange, musty smell in the air that reminds me of
4622 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4626 : it so happens the Eunice I know will not run shell scripts in Unix format
4630 echo "Congratulations. You aren't running Eunice."
4634 : Detect OS2. The p_ variable is set above in the Head.U unit.
4635 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4636 : semicolon as a patch separator
4641 I have the feeling something is not exactly right, however...don't tell me...
4642 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4643 (Or you may be running DOS with DJGPP.)
4648 if test -f /xenix; then
4649 echo "Actually, this looks more like a XENIX system..."
4654 echo "It's not Xenix..."
4659 if test -f /venix; then
4660 echo "Actually, this looks more like a VENIX system..."
4667 echo "Nor is it Venix..."
4670 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4671 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4674 : Check if we are using GNU gcc and what its version is
4676 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4680 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4682 printf("%s\n", __VERSION__);
4684 printf("%s\n", "1");
4690 if $cc -o try $ccflags $ldflags try.c; then
4691 gccversion=`$run ./try`
4692 case "$gccversion" in
4693 '') echo "You are not using GNU cc." ;;
4694 *) echo "You are using GNU cc $gccversion."
4700 echo "*** WHOA THERE!!! ***" >&4
4701 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4702 case "$knowitall" in
4704 echo " You'd better start hunting for one and let me know about it." >&4
4710 case "$gccversion" in
4711 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4713 case "$gccversion" in
4714 '') gccosandvers='' ;;
4715 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4716 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4718 case "$gccosandvers" in
4719 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4720 $osname$osvers) ;; # looking good
4721 $osname*) cat <<EOM >&4
4723 *** WHOA THERE!!! ***
4725 Your gcc has not been compiled for the exact release of
4726 your operating system ($gccosandvers versus $osname$osvers).
4728 In general it is a good idea to keep gcc synchronized with
4729 the operating system because otherwise serious problems
4730 may ensue when trying to compile software, like Perl.
4732 I'm trying to be optimistic here, though, and will continue.
4733 If later during the configuration and build icky compilation
4734 problems appear (headerfile conflicts being the most common
4735 manifestation), I suggest reinstalling the gcc to match
4736 your operating system release.
4740 *) gccosandvers='' ;; # failed to parse, better be silent
4748 # gcc 3.* complain about adding -Idirectories that they already know about,
4749 # so we will take those off from locincpth.
4750 case "$gccversion" in
4752 echo "main(){}">try.c
4753 for incdir in $locincpth; do
4754 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4755 grep '^c[cp]p*[01]: warning: changing search order '`
4756 if test "X$warn" != X; then
4757 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4763 # gcc 4.9 by default does some optimizations that break perl.
4764 # see ticket 121505.
4766 # The -fwrapv disables those optimizations (and probably others,) so
4767 # for gcc 4.9 (and later, since the optimizations probably won't go
4768 # away), add -fwrapv unless the user requests -fno-wrapv, which
4769 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4770 # which turns the overflows -fwrapv ignores into runtime errors.
4771 case "$gccversion" in
4772 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4774 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4775 *) ccflags="$ccflags -fwrapv" ;;
4779 : What should the include directory be ?
4780 : Use sysroot if set, so findhdr looks in the right place.
4782 $echo $n "Hmm... $c"
4783 dflt="$sysroot/usr/include"
4786 if $test -f /bin/mips && /bin/mips; then
4787 echo "Looks like a MIPS system..."
4788 $cat >usr.c <<'EOCP'
4789 #ifdef SYSTYPE_BSD43
4793 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4794 dflt='/bsd43/usr/include'
4798 mips_type='System V'
4800 $rm -f usr.c usr.out
4801 echo "and you're compiling with the $mips_type compiler and libraries."
4805 echo "Doesn't look like a MIPS system."
4815 case "$xxx_prompt" in
4818 rp='Where are the include files you want to use?'
4826 : see how we invoke the C preprocessor
4828 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4829 cat <<'EOT' >testcpp.c
4835 if test ! -f cppstdin; then
4836 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4837 # AIX cc -E doesn't show the absolute headerfile
4838 # locations but we'll cheat by using the -M flag.
4839 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
4841 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4844 echo "Keeping your $hint cppstdin wrapper."
4847 wrapper=`pwd`/cppstdin
4851 if $test "X$cppstdin" != "X" && \
4852 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4855 echo "You used to use $cppstdin $cppminus so we'll use that again."
4857 '') echo "But let's see if we can live without a wrapper..." ;;
4859 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4860 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4862 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4865 echo "(However, $cpprun $cpplast does not work, let's see...)"
4873 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4880 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4881 $cc -E <testcpp.c >testcpp.out 2>&1; \
4882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4883 echo "Yup, it does."
4884 x_cpp="$cc $cppflags -E"
4886 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4887 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4888 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4889 echo "Yup, it does."
4890 x_cpp="$cc $cppflags -E"
4892 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4893 $cc -P <testcpp.c >testcpp.out 2>&1; \
4894 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4895 echo "Yipee, that works!"
4896 x_cpp="$cc $cppflags -P"
4898 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4899 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4900 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 echo "At long last!"
4902 x_cpp="$cc $cppflags -P"
4904 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4905 $cpp <testcpp.c >testcpp.out 2>&1; \
4906 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4908 x_cpp="$cpp $cppflags"
4910 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4911 $cpp - <testcpp.c >testcpp.out 2>&1; \
4912 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4913 echo "Hooray, it works! I was beginning to wonder."
4914 x_cpp="$cpp $cppflags"
4916 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4917 $wrapper <testcpp.c >testcpp.out 2>&1; \
4918 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4924 rp="No dice. I can't find a C preprocessor. Name one:"
4928 $x_cpp <testcpp.c >testcpp.out 2>&1
4929 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4930 echo "OK, that will do." >&4
4932 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4947 echo "Perhaps can we force $cc -E using a wrapper..."
4948 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4949 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4955 echo "Nope, we'll have to live without it..."
4969 "$wrapper"|'cppstdin') ;;
4970 *) $rm -f $wrapper;;
4972 $rm -f testcpp.c testcpp.out
4974 : Adjust cppfilter for path component separator
4976 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4977 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4981 : Use gcc to determine libpth and incpth
4982 # If using gcc or clang, we can get better values for libpth, incpth
4983 # and usrinc directly from the compiler.
4984 # Note that ccname for clang is also gcc.
4987 $echo 'extern int foo;' > try.c
4988 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4990 if $test $# -gt 0; then
4992 incpth="`$echo $incpth|$sed 's/^ //'`"
4994 j="`$echo $i|$sed 's,/include$,/lib,'`"
4995 if $test -d $j; then
4999 libpth="`$echo $libpth|$sed 's/^ //'`"
5000 for xxx in $libpth $loclibpth $plibpth $glibpth; do
5001 if $test -d $xxx; then
5004 *) libpth="$libpth $xxx";;
5011 '') for i in $incpth; do
5012 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5020 case "$usecrosscompile" in
5023 '') echo "Incpth not defined." >&4; croak=y ;;
5024 *) echo "Using incpth '$incpth'." >&4 ;;
5027 '') echo "Libpth not defined." >&4; croak=y ;;
5028 *) echo "Using libpth '$libpth'." >&4 ;;
5031 '') echo "Usrinc not defined." >&4; croak=y ;;
5032 *) echo "Using usrinc $usrinc." >&4 ;;
5036 if test "X$sysroot" = X; then
5037 echo "Cannot continue, aborting." >&4; exit 1
5039 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5048 : Default value for incpth is just usrinc
5050 '') incpth="$usrinc";;
5053 : Set private lib path
5056 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5061 '') dlist="$loclibpth $plibpth $glibpth";;
5062 *) dlist="$libpth";;
5065 : Now check and see which directories actually exist, avoiding duplicates
5068 if $test -d $xxx; then
5071 *) libpth="$libpth $xxx";;
5077 Some systems have incompatible or broken versions of libraries. Among
5078 the directories listed in the question below, please remove any you
5079 know not to be holding relevant libraries, and add any that are needed.
5080 Say "none" for none.
5084 if test "X$sysroot" != X; then
5086 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5099 rp="Directories to use for library searches?"
5106 : compute shared library extension
5109 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5119 On some systems, shared libraries may be available. Answer 'none' if
5120 you want to suppress searching of shared libraries for the remainder
5121 of this configuration.
5124 rp='What is the file extension used for shared libraries?'
5128 : Does target system insist that shared library basenames are unique
5131 Some dynamic loaders assume that the *basename* of shared library filenames
5132 are globally unique. We'll default this to undef as we assume your system
5133 is not this weird. Set to defined if you're on one of them.
5138 rp='Make shared library basenames unique?'
5141 y|Y) val="$define" ;;
5144 set d_libname_unique
5147 : Define several unixisms.
5148 : Hints files or command line option can be used to override them.
5149 : The convoluted testing is in case hints files set either the old
5152 '') case "$exe_ext" in
5154 *) _exe="$exe_ext" ;;
5159 '') case "$lib_ext" in
5166 '') case "$obj_ext" in
5173 '') case "$path_sep" in
5184 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5186 : Which makefile gets called first. This is used by make depend.
5187 case "$firstmakefile" in
5188 '') firstmakefile='makefile';;
5191 : Check is we will use socks
5193 $define|true|[yY]*) dflt='y';;
5198 Perl can be built to use the SOCKS proxy protocol library. To do so,
5199 Configure must be run with -Dusesocks. If you use SOCKS you also need
5200 to use the PerlIO abstraction layer, this will be implicitly selected.
5202 If this doesn't make any sense to you, just accept the default '$dflt'.
5204 rp='Build Perl for SOCKS?'
5207 y|Y) val="$define" ;;
5213 : Check for uselongdouble support
5215 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5218 case "$uselongdouble" in
5219 $define|true|[yY]*) dflt='y';;
5224 Perl can be built to take advantage of long doubles which
5225 (if available) may give more accuracy and range for floating point numbers.
5227 If this doesn't make any sense to you, just accept the default '$dflt'.
5229 rp='Try to use long doubles if available?'
5232 y|Y) val="$define" ;;
5238 case "$uselongdouble" in
5239 true|[yY]*) uselongdouble="$define" ;;
5242 : Look for a hint-file generated 'call-back-unit'. If the
5243 : user has specified that long doubles should be used,
5244 : we may need to set or change some other defaults.
5245 if $test -f uselongdouble.cbu; then
5246 echo "Your platform has some specific hints regarding long doubles, using them..."
5247 . ./uselongdouble.cbu
5249 case "$uselongdouble" in
5252 (Your platform does not have any specific hints for long doubles.)
5258 : Check if quadmath is requested
5259 case "$usequadmath" in
5260 "$define"|true|[yY]*) usequadmath="$define" ;;
5261 *) usequadmath="$undef" ;;
5264 : Fail if both uselongdouble and usequadmath are requested
5265 case "$usequadmath:$uselongdouble" in
5269 *** You requested the use of the quadmath library and use
5270 *** of long doubles.
5272 *** Please select one or the other.
5278 : Looking for optional libraries
5280 echo "Checking for optional libraries..." >&4
5285 case "$libswanted" in
5286 '') libswanted='c_s';;
5289 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5291 case "$usecbacktrace" in
5292 "$define") libswanted="$libswanted bfd" ;;
5294 case "$usequadmath" in
5295 "$define") libswanted="$libswanted quadmath" ;;
5301 for thisdir in $libpth $xlibpth; do
5302 test -d $thisdir && libspath="$libspath $thisdir"
5304 for thislib in $libswanted; do
5305 for thisdir in $libspath; do
5307 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5308 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5309 $test -f "$xxx" && eval $libscheck
5310 $test -f "$xxx" && libstyle=shared
5311 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=shared
5315 if test ! -f "$xxx"; then
5316 xxx=$thisdir/lib$thislib.$so
5317 $test -f "$xxx" && eval $libscheck
5318 $test -f "$xxx" && libstyle=shared
5320 if test ! -f "$xxx"; then
5321 xxx=$thisdir/lib$thislib$_a
5322 $test -f "$xxx" && eval $libscheck
5323 $test -f "$xxx" && libstyle=static
5325 if test ! -f "$xxx"; then
5326 xxx=$thisdir/$thislib$_a
5327 $test -f "$xxx" && eval $libscheck
5328 $test -f "$xxx" && libstyle=static
5330 if test ! -f "$xxx"; then
5331 xxx=$thisdir/lib${thislib}_s$_a
5332 $test -f "$xxx" && eval $libscheck
5333 $test -f "$xxx" && libstyle=static
5334 $test -f "$xxx" && thislib=${thislib}_s
5336 if test ! -f "$xxx"; then
5337 xxx=$thisdir/Slib$thislib$_a
5338 $test -f "$xxx" && eval $libscheck
5339 $test -f "$xxx" && libstyle=static
5341 if $test -f "$xxx"; then
5343 shared) echo "Found -l$thislib (shared)." ;;
5344 static) echo "Found -l$thislib." ;;
5345 *) echo "Found -l$thislib ($libstyle)." ;;
5349 *) dflt="$dflt -l$thislib"
5350 libsfound="$libsfound $xxx"
5352 libsfiles="$libsfiles $yyy"
5353 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5354 case " $libsdirs " in
5356 *) libsdirs="$libsdirs $yyy" ;;
5363 if $test ! -f "$xxx"; then
5364 echo "No -l$thislib."
5375 ' '|'') dflt='none';;
5380 In order to compile $package on your machine, a number of libraries
5381 are usually needed. Include any other special libraries here as well.
5382 Say "none" for none. The default list is almost always right.
5386 rp="What libraries to use?"
5393 : determine optimization, if desired, or use for debug flag also
5395 ' '|$undef) dflt='none';;
5397 *) dflt="$optimize";;
5401 By default, $package compiles with the -O flag to use the optimizer.
5402 Alternately, you might want to use the symbolic debugger, which uses
5403 the -g flag (on traditional Unix systems). Either flag can be
5404 specified here. To use neither flag, specify the word "none".
5407 rp="What optimizer/debugger flag should be used?"
5411 'none') optimize=" ";;
5414 : Check what DEBUGGING is required from the command line
5415 : -DEBUGGING or -DDEBUGGING or
5416 : -DEBUGGING=both = -g + -DDEBUGGING
5417 : -DEBUGGING=-g or -Doptimize=-g = -g
5418 : -DEBUGGING=none or -UDEBUGGING =
5419 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5422 *) DEBUGGING=$EBUGGING ;;
5425 case "$DEBUGGING" in
5429 *) optimize="$optimize -g" ;;
5433 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5441 case "$DEBUGGING" in
5442 both|$define) dflt='-DDEBUGGING'
5445 : argument order is deliberate, as the flag will start with - which set could
5446 : think is an option
5447 checkccflag='check=$1; flag=$2; callback=$3;
5449 echo "Checking if your compiler accepts $flag" 2>&1;
5450 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5451 echo "int main(void) { return 0; }" > gcctest.c;
5452 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5453 echo "Yes, it does." 2>&1;
5454 if $test -s gcctest.out ; then
5455 echo "But your platform does not like it:";
5460 echo "Leaving current flags $ccflags alone." 2>&1
5462 *) dflt="$dflt $flag";
5468 echo "Nope, it does not, but that is ok." 2>&1;
5472 : We will not override a previous value, but we might want to
5473 : augment a hint file
5475 default|recommended)
5476 case "$gccversion" in
5477 1*) dflt="$dflt -fpcc-struct-return" ;;
5479 case "$optimize:$DEBUGGING" in
5480 *-g*:old) dflt="$dflt -DDEBUGGING";;
5482 case "$gccversion" in
5483 2*) if $test -d /etc/conf/kconfig.d &&
5484 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5486 # Interactive Systems (ISC) POSIX mode.
5491 case "$gccversion" in
5494 ?*) set strict-aliasing -fno-strict-aliasing
5498 # For gcc, adding -pipe speeds up compilations for some, but apparently
5499 # some assemblers can't read from stdin. (It also slows down compilations
5500 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5501 case "$gccversion" in
5507 # on x86_64 (at least) we require an extra library (libssp) in the
5508 # link command line. This library is not named, so I infer that it is
5509 # an implementation detail that may change. Hence the safest approach
5510 # is to add the flag to the flags passed to the compiler at link time,
5511 # as that way the compiler can do the right implementation dependant
5514 amigaos) ;; # -fstack-protector builds but doesn't work
5515 *) case "$gccversion" in
5516 ?*) set stack-protector-strong -fstack-protector-strong
5519 *-fstack-protector-strong*) ;; # It got added.
5520 *) # Try the plain/older -fstack-protector.
5521 set stack-protector -fstack-protector
5532 case "$mips_type" in
5533 *BSD*|'') inclwanted="$locincpth $usrinc";;
5534 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5536 for thisincl in $inclwanted; do
5537 if $test -d $thisincl; then
5538 if $test x$thisincl != x$usrinc; then
5540 *" -I$thisincl "*);;
5541 *) dflt="$dflt -I$thisincl ";;
5547 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5549 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5557 *) dflt="$dflt -D$2";;
5561 set signal.h LANGUAGE_C; eval $inctest
5565 ccflags="$ccflags -DSOCKS"
5570 default|recommended) dflt="$ccflags $dflt" ;;
5571 *) dflt="$ccflags";;
5580 Your C compiler may want other flags. For this question you should include
5581 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5582 but you should NOT include libraries or ld flags like -lwhatever. If you
5583 want $package to honor its debug switch, you should include -DDEBUGGING here.
5584 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5586 To use no flags, specify the word "none".
5592 rp="Any additional cc flags?"
5599 : the following weeds options from ccflags that are of no interest to cpp
5601 '') cppflags="$ccflags" ;;
5602 *) set X $ccflags; shift
5603 case " $cppflags " in
5604 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5605 *) cppflags="$cppflags $ccflags" ;;
5609 case "$gccversion" in
5610 1*) cppflags="$cppflags -D__GNUC__"
5612 case "$mips_type" in
5614 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5620 echo "Let me guess what the preprocessor flags are..." >&4
5634 *) ftry="$previous $flag";;
5636 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5637 >cpp1.out 2>/dev/null && \
5638 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5639 >cpp2.out 2>/dev/null && \
5640 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5641 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5643 cppflags="$cppflags $ftry"
5653 *-*) echo "They appear to be: $cppflags";;
5655 $rm -f cpp.c cpp?.out
5659 : flags used in final linking phase
5661 '') if ./venix; then
5667 *-posix*) dflt="$dflt -posix" ;;
5670 *) dflt="$ldflags";;
5672 # See note above about -fstack-protector
5674 *-fstack-protector-strong*)
5676 *-fstack-protector-strong*) ;; # Don't add it again
5677 *) dflt="$dflt -fstack-protector-strong" ;;
5680 *-fstack-protector*)
5682 *-fstack-protector*) ;; # Don't add it again
5683 *) dflt="$dflt -fstack-protector" ;;
5688 : Try to guess additional flags to pick up local libraries.
5689 for thislibdir in $libpth; do
5690 case " $loclibpth " in
5693 *"-L$thislibdir "*) ;;
5694 *) dflt="$dflt -L$thislibdir" ;;
5706 Your C linker may need flags. For this question you should
5707 include -L/whatever and any other flags used by the C linker, but you
5708 should NOT include libraries like -lwhatever.
5710 Make sure you include the appropriate -L/path flags if your C linker
5711 does not normally search all of the directories you specified above,
5714 To use no flags, specify the word "none".
5718 rp="Any additional ld flags (NOT including libraries)?"
5724 rmlist="$rmlist pdp11"
5728 echo "Checking your choice of C compiler and flags for coherency..." >&4
5729 $cat > try.c <<'EOF'
5731 int main() { printf("Ok\n"); return(0); }
5733 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5735 $cat >try.msg <<'EOM'
5736 I've tried to compile and run the following simple program:
5739 $cat try.c >> try.msg
5741 $cat >> try.msg <<EOM
5748 and I got the following output:
5752 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5753 if $sh -c "$run ./try " >>try.msg 2>&1; then
5757 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5760 echo "The program compiled OK, but exited with status $?." >>try.msg
5761 rp="You have a problem. Shall I abort Configure"
5765 echo "I can't compile the test program." >>try.msg
5766 rp="You have a BIG problem. Shall I abort Configure"
5772 case "$knowitall" in
5774 echo "(The supplied flags or libraries might be incorrect.)"
5782 *) echo "Ok. Stopping Configure." >&4
5787 n) echo "OK, that should do.";;
5789 $rm_try gcctest gcctest.out
5791 : define a shorthand compile call
5795 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5796 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5800 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5801 : define a shorthand compile call for compilations that should be ok.
5805 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5807 : determine filename position in cpp output
5809 echo "Computing filename position in cpp output for #include directives..." >&4
5811 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5816 vos) testaccess=-e ;;
5819 echo '#include <stdio.h>' > foo.c
5822 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5823 $grep '^[ ]*#.*stdio\.h' | \
5824 while read cline; do
5827 while $test \$# -gt 0; do
5828 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5833 pos=\`expr \$pos + 1\`
5847 *) pos="${fieldn}th";;
5849 echo "Your cpp writes the filename in the $pos field of the line."
5851 : locate header file
5856 for usrincdir in $incpth
5858 if test -f \$usrincdir/\$wanted; then
5859 echo "\$usrincdir/\$wanted"
5863 awkprg='{ print \$$fieldn }'
5864 echo "#include <\$wanted>" > foo\$\$.c
5865 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5866 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5867 while read cline; do
5868 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5870 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5871 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5876 # status = 0: grep returned 0 lines, case statement not executed
5877 # status = 1: headerfile found
5878 # status = 2: while loop executed, no headerfile found
5882 if test \$status -eq 1; then
5889 : define an alternate in-header-list? function
5890 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5891 cont=true; xxf="echo \"<\$1> found.\" >&4";
5892 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5893 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5895 case $# in 4) instead=instead;; *) instead="at last";; esac;
5896 while $test "$cont"; do
5898 var=$2; eval "was=\$$2";
5899 if $test "$xxx" && $test -r "$xxx";
5901 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5904 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5905 set $yyy; shift; shift; yyy=$@;
5906 case $# in 0) cont="";;
5907 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5908 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5909 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5910 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5914 do set $yyy; var=$2; eval "was=\$$2";
5915 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5916 set $yyy; shift; shift; yyy=$@;
5919 : see if stdlib is available
5920 set stdlib.h i_stdlib
5923 : check for lengths of integral types
5927 echo "Checking to see how big your integers are..." >&4
5936 printf("intsize=%d;\n", (int)sizeof(int));
5937 printf("longsize=%d;\n", (int)sizeof(long));
5938 printf("shortsize=%d;\n", (int)sizeof(short));
5943 if eval $compile_ok && $run ./try > /dev/null; then
5945 echo "Your integers are $intsize bytes long."
5946 echo "Your long integers are $longsize bytes long."
5947 echo "Your short integers are $shortsize bytes long."
5951 Help! I can't compile and run the intsize test program: please enlighten me!
5952 (This is probably a misconfiguration in your system or libraries, and
5953 you really ought to fix it. Still, I'll try anyway.)
5957 rp="What is the size of an integer (in bytes)?"
5961 rp="What is the size of a long integer (in bytes)?"
5965 rp="What is the size of a short integer (in bytes)?"
5973 : check for long long
5975 echo "Checking to see if you have long long..." >&4
5976 echo 'int main() { long long x = 7; return 0; }' > try.c
5978 if eval $compile; then
5980 echo "You have long long."
5983 echo "You do not have long long."
5989 : check for length of long long
5990 case "${d_longlong}${longlongsize}" in
5993 echo "Checking to see how big your long longs are..." >&4
5994 $cat >try.c <<'EOCP'
5998 printf("%d\n", (int)sizeof(long long));
6003 if eval $compile_ok; then
6004 longlongsize=`$run ./try`
6005 echo "Your long longs are $longlongsize bytes long."
6009 echo "(I can't seem to compile the test program. Guessing...)"
6010 rp="What is the size of a long long (in bytes)?"
6014 if $test "X$longsize" = "X$longlongsize"; then
6015 echo "(That isn't any different from an ordinary long.)"
6021 : see if inttypes.h is available
6022 : we want a real compile instead of Inhdr because some systems
6023 : have an inttypes.h which includes non-existent headers
6026 #include <inttypes.h>
6028 static int32_t foo32 = 0x12345678;
6032 if eval $compile; then
6033 echo "<inttypes.h> found." >&4
6036 echo "<inttypes.h> NOT found." >&4
6045 echo "Checking to see if you have int64_t..." >&4
6047 #include <sys/types.h>
6048 #$i_inttypes I_INTTYPES
6050 #include <inttypes.h>
6052 int main() { int64_t x = 7; }
6055 if eval $compile; then
6057 echo "You have int64_t."
6060 echo "You do not have int64_t."
6066 : Check if 64bit ints have a quad type
6068 echo "Checking which 64-bit integer type we could use..." >&4
6074 val='"unsigned int"'
6079 *) case "$longsize" in
6083 val='"unsigned long"'
6088 *) case "$d_longlong:$longlongsize" in
6093 val='"unsigned long long"'
6098 *) case "$d_int64_t" in
6117 '') echo "Alas, no 64-bit integer types in sight." >&4
6120 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6125 : Do we want 64bit support
6126 case "$uselonglong" in
6127 "$define"|true|[yY]*)
6130 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6132 use64bitint="$define"
6135 case "$use64bits" in
6136 "$define"|true|[yY]*)
6139 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6141 use64bitint="$define"
6144 case "$use64bitints" in
6145 "$define"|true|[yY]*)
6148 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6150 use64bitint="$define"
6153 case "$use64bitsint" in
6154 "$define"|true|[yY]*)
6157 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6159 use64bitint="$define"
6162 case "$uselonglongs" in
6163 "$define"|true|[yY]*)
6166 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6168 use64bitint="$define"
6171 case "$use64bitsall" in
6172 "$define"|true|[yY]*)
6175 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6177 use64bitall="$define"
6182 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6184 case "$use64bitall" in
6185 "$define"|true|[yY]*) use64bitint="$define" ;;
6191 You have natively 64-bit long integers.
6195 *) case "$use64bitint" in
6196 "$define"|true|[yY]*) dflt='y';;
6205 Perl can be built to take advantage of 64-bit integer types
6206 on some systems. To do so, Configure can be run with -Duse64bitint.
6207 Choosing this option will most probably introduce binary incompatibilities.
6209 If this doesn't make any sense to you, just accept the default '$dflt'.
6210 (The default has been chosen based on your configuration.)
6212 rp='Try to use 64-bit integers, if available?'
6215 [yY]*) val="$define" ;;
6223 case "$use64bitall" in
6224 "$define"|true|[yY]*) dflt='y' ;;
6225 *) case "$longsize" in
6233 You may also choose to try maximal 64-bitness. It means using as much
6234 64-bitness as possible on the platform. This in turn means even more
6235 binary incompatibilities. On the other hand, your platform may not
6236 have any more 64-bitness available than what you already have chosen.
6238 If this doesn't make any sense to you, just accept the default '$dflt'.
6239 (The default has been chosen based on your configuration.)
6241 rp='Try to use maximal 64-bit support, if available?'
6244 [yY]*) val="$define" ;;
6249 case "$use64bitall" in
6251 case "$use64bitint" in
6255 Since you have chosen a maximally 64-bit build, I'm also turning on
6256 the use of 64-bit integers.
6258 use64bitint="$define" ;;
6263 : Look for a hint-file generated 'call-back-unit'. If the
6264 : user has specified that a 64-bit perl is to be built,
6265 : we may need to set or change some other defaults.
6266 if $test -f use64bitint.cbu; then
6267 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6270 case "$use64bitint" in
6271 "$define"|true|[yY]*)
6272 : This test was common to all the OpenBSD forks, and seems harmless for
6275 echo "Checking if your C library has broken 64-bit functions..." >&4
6278 typedef $uquadtype myULL;
6285 {4294967303.15, 4294967303ULL},
6286 {4294967294.2, 4294967294ULL},
6287 {4294967295.7, 4294967295ULL},
6290 for (p = test; p->u; p++) {
6291 myULL x = (myULL)p->d;
6302 if eval $compile_ok; then
6303 libcquad=`$run ./try`
6304 echo "Your C library's 64-bit functions are $libcquad."
6306 echo "(I can't seem to compile the test program.)"
6307 echo "Assuming that your C library's 64-bit functions are ok."
6316 *** You have a C library with broken 64-bit functions.
6317 *** 64-bit support does not work reliably in this configuration.
6318 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6319 *** Cannot continue, aborting.
6326 4) case "$archname64" in
6327 '') archname64=64int ;;
6334 : Look for a hint-file generated 'call-back-unit'. If the
6335 : user has specified that a maximally 64-bit perl is to be built,
6336 : we may need to set or change some other defaults.
6337 if $test -f use64bitall.cbu; then
6338 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6341 case "$use64bitall" in
6342 "$define"|true|[yY]*)
6344 4) case "$archname64" in
6345 ''|64int) archname64=64all ;;
6352 case "$d_quad:$use64bitint" in
6356 *** You have chosen to use 64-bit integers,
6357 *** but none can be found.
6358 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6359 *** Cannot continue, aborting.
6366 : Check if we are using the GNU C library
6368 echo "Checking for GNU C Library..." >&4
6370 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6371 alone are insufficient to distinguish different versions, such as
6372 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6373 libc version 2.1.0. A. Dougherty, June 3, 2002.
6379 # ifdef __GLIBC_MINOR__
6380 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6381 # include <gnu/libc-version.h>
6382 printf("%s\n", gnu_get_libc_version());
6384 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6387 printf("%d\n", __GLIBC__);
6396 if eval $compile_ok && $run ./try > glibc.ver; then
6398 gnulibc_version=`$cat glibc.ver`
6399 echo "You are using the GNU C Library version $gnulibc_version"
6403 echo "You are not using the GNU C Library"
6409 : see if nm is to be used to determine whether a symbol is defined or not
6413 case "$d_gnulibc" in
6416 echo "nm probably won't work on the GNU C Library." >&4
6422 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6424 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6425 echo "'nm' won't be sufficient on this system." >&4
6431 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6432 if $test $dflt -gt 20; then
6442 true|$define) dflt=y;;
6449 I can use $nm to extract the symbols from your C libraries. This
6450 is a time consuming task which may generate huge output on the disk (up
6451 to 3 megabytes) but that should make the symbols extraction faster. The
6452 alternative is to skip the 'nm' extraction part and to compile a small
6453 test program instead to determine whether each symbol is present. If
6454 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6455 this may be the best solution.
6457 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6460 rp="Shall I use $nm to extract C symbols from the libraries?"
6463 [Nn]*) usenm=false;;
6472 : nm options which may be necessary
6474 '') if $test -f /mach_boot; then
6476 elif $test -d /usr/ccs/lib; then
6477 nm_opt='-p' # Solaris (and SunOS?)
6478 elif $test -f /dgux; then
6480 elif $test -f /lib64/rld; then
6481 nm_opt='-p' # 64-bit Irix
6487 : nm options which may be necessary for shared libraries but illegal
6488 : for archive libraries. Thank you, Linux.
6489 case "$nm_so_opt" in
6490 '') case "$myuname" in
6492 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6493 nm_so_opt='--dynamic'
6500 : Figure out where the libc is located
6503 : get list of predefined functions in a handy place
6508 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6514 *) for thislib in $libs; do
6517 : Handle C library specially below.
6520 thislib=`echo $thislib | $sed -e 's/^-l//'`
6521 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6523 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6525 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6527 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6529 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6531 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6533 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6538 libnames="$libnames $try"
6540 *) libnames="$libnames $thislib" ;;
6549 for xxx in $libpth; do
6550 $test -r $1 || set $xxx/libc.$so
6551 : The messy sed command sorts on library version numbers.
6553 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6554 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6556 s/[0-9][0-9]*/0000&/g
6557 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6560 $sort | $sed -e 's/^.* //'`
6563 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6564 $test -r $1 || set $sysroot/lib/libsys_s$_a
6570 if $test -r "$1"; then
6571 echo "Your (shared) C library seems to be in $1."
6573 elif $test -r /lib/libc && $test -r /lib/clib; then
6574 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6576 libc='/lib/clib /lib/libc'
6577 if $test -r /lib/syslib; then
6578 echo "(Your math library is in /lib/syslib.)"
6579 libc="$libc /lib/syslib"
6581 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6582 echo "Your C library seems to be in $libc, as you said before."
6583 elif $test -r $incpath/usr/lib/libc$_a; then
6584 libc=$incpath/usr/lib/libc$_a;
6585 echo "Your C library seems to be in $libc. That's fine."
6586 elif $test -r /lib/libc$_a; then
6588 echo "Your C library seems to be in $libc. You're normal."
6590 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6592 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6593 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6594 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6596 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6598 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6601 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6603 if $test -r "$tans"; then
6604 echo "Your C library seems to be in $tans, of all places."
6610 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6614 If the guess above is wrong (which it might be if you're using a strange
6615 compiler, or your machine supports multiple models), you can override it here.
6620 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6622 I can't seem to find your C library. I've looked in the following places:
6625 $sed 's/^/ /' libpath
6628 None of these seems to contain your C library. I need to get its name...
6633 rp='Where is your C library?'
6638 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6639 set X `cat libnames`
6642 case $# in 1) xxx=file; esac
6643 echo "Extracting names from the following $xxx for later perusal:" >&4
6645 $sed 's/^/ /' libnames >&4
6647 $echo $n "This may take a while...$c" >&4
6651 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6652 *) $nm $nm_opt $file 2>/dev/null;;
6657 $grep fprintf libc.tmp > libc.ptf
6658 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6659 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6661 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6686 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6698 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6702 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6706 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6710 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6712 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6714 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6716 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6719 $nm -p $* 2>/dev/null >libc.tmp
6720 $grep fprintf libc.tmp > libc.ptf
6721 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6722 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6728 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6730 if $ar t $libc > libc.tmp && \
6731 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6733 for thisname in $libnames $libc; do
6734 $ar t $thisname >>libc.tmp
6736 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6738 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6739 for thisname in $libnames $libc; do
6740 $ar tv $thisname >>libc.tmp
6741 emximp -o tmp.imp $thisname \
6743 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6744 < tmp.imp >>libc.tmp
6747 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6750 echo "$ar didn't seem to work right." >&4
6751 echo "Maybe this is a Cray...trying bld instead..." >&4
6753 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6756 for thisname in $libnames; do
6758 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6759 $ar t $thisname >>libc.tmp
6763 echo "That didn't work either. Giving up." >&4
6773 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6774 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6776 *) if $test -f /lib/syscalls.exp; then
6778 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6779 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6780 /lib/syscalls.exp >>libc.list
6786 $rm -f libnames libpath
6788 : Check if we are using C++
6790 echo "Checking for C++..." >&4
6791 $cat >try.c <<'EOCP'
6803 if eval $compile_ok && $run ./try; then
6805 echo "You are using a C++ compiler."
6808 echo "You are not using a C++ compiler."
6814 : is a C symbol defined?
6817 -v) tf=libc.tmp; tdc="";;
6818 -a) tf=libc.tmp; tdc="[]";;
6819 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6821 case "$d_cplusplus" in
6822 $define) extern_C="extern \"C\"" ;;
6823 *) extern_C="extern" ;;
6826 case "$reuseval-$4" in
6828 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6833 if $test "$runnm" = true; then
6834 if $contains $tlook $tf >/dev/null 2>&1; then
6836 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6837 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;
6838 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6839 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6843 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;
6844 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6850 $define) tval=true;;
6857 : define an is-in-libc? function
6858 inlibc='echo " "; td=$define; tu=$undef;
6859 sym=$1; var=$2; eval "was=\$$2";
6861 case "$reuseval$was" in
6871 echo "$sym() found." >&4;
6872 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6874 echo "$sym() NOT found." >&4;
6875 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6879 $define) echo "$sym() found." >&4;;
6880 *) echo "$sym() NOT found." >&4;;
6884 : check for length of double
6886 case "$doublesize" in
6888 echo "Checking to see how big your double precision numbers are..." >&4
6897 printf("%d\n", (int)sizeof(double));
6902 if eval $compile_ok; then
6903 doublesize=`$run ./try`
6904 echo "Your double is $doublesize bytes long."
6907 echo "(I can't seem to compile the test program. Guessing...)"
6908 rp="What is the size of a double precision number (in bytes)?"
6916 : see if this is a float.h system
6920 : check for long doubles
6922 echo "Checking to see if you have long double..." >&4
6923 echo 'int main() { long double x = 7.0; }' > try.c
6925 if eval $compile; then
6927 echo "You have long double."
6930 echo "You do not have long double."
6936 : see if ldexpl exists
6940 : check for length of long double
6941 case "${d_longdbl}${longdblsize}" in
6944 echo "Checking to see how big your long doubles are..." >&4
6945 $cat >try.c <<'EOCP'
6949 printf("%d\n", sizeof(long double));
6954 if eval $compile; then
6955 longdblsize=`$run ./try`
6956 echo "Your long doubles are $longdblsize bytes long."
6960 echo "(I can't seem to compile the test program. Guessing...)" >&4
6961 rp="What is the size of a long double (in bytes)?"
6965 if $test "X$doublesize" = "X$longdblsize"; then
6966 echo "That isn't any different from an ordinary double."
6967 echo "I'll keep your setting anyway, but you may see some"
6968 echo "harmless compilation warnings."
6974 $echo "Checking the kind of long doubles you have..." >&4
6975 case "$d_longdbl" in
6980 #define LONGDBLSIZE $longdblsize
6981 #define DOUBLESIZE $doublesize
6989 static const long double d = -0.1L;
6991 unsigned const char* b = (unsigned const char*)(&d);
6992 #if DOUBLESIZE == LONGDBLSIZE
6993 printf("0\n"); /* if it floats like double */
6996 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6997 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6998 /* IEEE 754 128-bit little-endian */
7002 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
7003 /* IEEE 128-bit big-endian, e.g. solaris sparc */
7008 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
7009 * while 64-bits platforms have it in 16 bytes. The trailing bytes
7010 * cannot be trusted. */
7011 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
7012 if (b[0] == 0xCD && b[9] == 0xBF) {
7013 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7014 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7015 * Also known as "extended precision". */
7019 if (b[0] == 0xBF && b[9] == 0xCD) {
7020 /* Is there ever big-endian 80-bit, really?
7022 * The Motorola 68881 had another "extended precision" format:
7023 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7024 * for total of 96 bits of bytes. The zero bits were unused.
7025 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7026 * If it ever becomes relevant, this format should be allocated
7027 * a new doublekind code since it's quite different from the Intel x87.
7033 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7034 /* software "double double", the 106 is 53+53.
7035 * but irix thinks it is 107. */
7036 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7037 /* double double 128-bit fully little-endian,
7038 * little-endian doubles in little-endian order,
7039 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7043 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7044 /* double double 128-bit fully big-endian,
7045 * big-endian doubles in big-endian order,
7046 * e.g. PPC/Power and MIPS:
7047 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7051 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7052 /* double double 128-bit mixed endian.
7053 * little-endian doubles in big-endian order,
7055 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7059 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7060 /* double double 128-bit mixed endian,
7061 * big-endian doubles in little-endian order,
7062 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7067 /* We are largely making this up because it may well be
7068 * that the VAX format H was never made available to C,
7069 * only to Fortran. */
7070 #if LONGDBLSIZE == 16 && defined(__vax__)
7071 if (b[0] == 0xFD && b[15] == 0x99) {
7072 /* VAX format H, PDP-11 mixed endian. */
7077 printf("-1\n"); /* unknown */
7082 if eval $compile; then
7083 longdblkind=`$run ./try`
7090 case "$longdblkind" in
7091 0) echo "Your long doubles are doubles." >&4 ;;
7092 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7093 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7094 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7095 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7096 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7097 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7098 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7099 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7100 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7101 *) echo "Cannot figure out your long double." >&4 ;;
7103 d_long_double_style_ieee=$undef
7104 d_long_double_style_ieee_std=$undef
7105 d_long_double_style_ieee_extended=$undef
7106 d_long_double_style_ieee_doubledouble=$undef
7107 d_long_double_style_vax=$undef
7108 case "$longdblkind" in
7109 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7111 case "$longdblkind" in
7112 1|2) d_long_double_style_ieee_std=$define ;;
7114 case "$longdblkind" in
7115 3|4) d_long_double_style_ieee_extended=$define ;;
7117 case "$longdblkind" in
7118 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7120 case "$longdblkind" in
7121 9) d_long_double_style_vax=$define ;;
7125 : determine the architecture name
7127 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7128 tarch=`arch`"-$osname"
7129 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7130 if uname -m > tmparch 2>&1 ; then
7131 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7132 -e 's/$/'"-$osname/" tmparch`
7140 case "$myarchname" in
7143 echo "(Your architecture name used to be $myarchname.)"
7147 case "$targetarch" in
7149 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7154 *) dflt="$archname";;
7156 rp='What is your architecture name'
7160 : optionally add API version to the architecture for versioned archlibs
7161 case "$useversionedarchname" in
7162 $define|true|[yY]*) dflt='y';;
7165 rp='Add the Perl API version to your archname?'
7168 y|Y) useversionedarchname="$define" ;;
7169 *) useversionedarchname="$undef" ;;
7171 case "$useversionedarchname" in
7174 *-$api_versionstring)
7175 echo "...and architecture name already has -$api_versionstring" >&4
7178 archname="$archname-$api_versionstring"
7179 echo "...setting architecture name to $archname." >&4
7185 case "$usethreads" in
7187 echo "Threads selected." >&4
7189 *-thread*) echo "...and architecture name already has -thread." >&4
7191 *) archname="$archname-thread"
7192 echo "...setting architecture name to $archname." >&4
7197 case "$usemultiplicity" in
7199 echo "Multiplicity selected." >&4
7201 *-multi*) echo "...and architecture name already has -multi." >&4
7203 *) archname="$archname-multi"
7204 echo "...setting architecture name to $archname." >&4
7209 case "$use64bitint$use64bitall" in
7211 case "$archname64" in
7213 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7216 case "$use64bitint" in
7217 "$define") echo "64 bit integers selected." >&4 ;;
7219 case "$use64bitall" in
7220 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7223 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7225 *) archname="$archname-$archname64"
7226 echo "...setting architecture name to $archname." >&4
7232 case "$uselongdouble" in
7234 echo "Long doubles selected." >&4
7235 case "$longdblsize" in
7237 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7241 *-ld*) echo "...and architecture name already has -ld." >&4
7243 *) archname="$archname-ld"
7244 echo "...setting architecture name to $archname." >&4
7251 case "$usequadmath" in
7253 echo "quadmath selected." >&4
7255 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7257 *) archname="$archname-quadmath"
7258 echo "...setting architecture name to $archname." >&4
7263 if $test -f archname.cbu; then
7264 echo "Your platform has some specific hints for architecture name, using them..."
7268 : set the prefixit variable, to compute a suitable default value
7269 prefixit='case "$3" in
7271 case "$oldprefix" in
7272 "") eval "$1=\"\$$2\"";;
7279 ""|" ") eval "$1=\"\$$2\"";;
7285 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7287 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7288 /*-$oldprefix/*|\~*-$oldprefix/*)
7289 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7290 *) eval "$1=\"\$$2\"";;
7294 : determine installation style
7295 : For now, try to deduce it from prefix unless it is already set.
7296 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7297 case "$installstyle" in
7298 '') case "$prefix" in
7299 *perl*) dflt='lib';;
7300 *) dflt='lib/perl5' ;;
7303 *) dflt="$installstyle" ;;
7305 : Probably not worth prompting for this since we prompt for all
7306 : the directories individually, and the prompt would be too long and
7310 : determine where public executables go
7315 rp='Pathname where the public executables will reside?'
7317 if $test "X$ansexp" != "X$binexp"; then
7321 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7322 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7323 : this via initialinstalllocation
7326 case "$userelocatableinc" in
7327 $define|true|[yY]*) dflt='y' ;;
7332 Would you like to build Perl so that the installation is relocatable, so that
7333 library paths in @INC are determined relative to the path of the perl binary?
7334 This is not advised for system Perl installs, or if you need to run setid
7335 scripts or scripts under taint mode.
7337 If this doesn't make any sense to you, just accept the default '$dflt'.
7339 rp='Use relocatable @INC?'
7342 y|Y) val="$define" ;;
7345 set userelocatableinc
7348 initialinstalllocation="$binexp"
7349 : Default prefix is now "up one level from where the binaries are"
7350 case "$userelocatableinc" in
7356 installprefixexp=".../.."
7360 : determine where private library files go
7361 : Usual default is /usr/local/lib/perl5/$version.
7362 : Also allow things like /opt/perl/lib/$version, since
7363 : /opt/perl/lib/perl5... would be redundant.
7364 : The default "style" setting is made in installstyle.U
7365 case "$installstyle" in
7366 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7367 *) set dflt privlib lib/$version ;;
7372 There are some auxiliary files for $package that need to be put into a
7373 private library directory that is accessible by everyone.
7378 rp='Pathname where the private library files will reside?'
7383 : set the prefixup variable, to restore leading tilda escape
7384 prefixup='case "$prefixexp" in
7386 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7389 : determine where public architecture dependent libraries go
7392 : privlib default is /usr/local/lib/$package/$version
7393 : archlib default is /usr/local/lib/$package/$version/$archname
7394 : privlib may have an optional trailing /share.
7395 tdflt=`echo $privlib | $sed 's,/share$,,'`
7396 tdflt=$tdflt/$archname
7405 $spackage contains architecture-dependent library files. If you are
7406 sharing libraries in a heterogeneous environment, you might store
7407 these files in a separate location. Otherwise, you can just include
7408 them with the rest of the public library files.
7413 rp='Where do you want to put the public architecture-dependent libraries?'
7417 if $test X"$archlib" = X"$privlib"; then
7423 : see if setuid scripts can be secure
7426 Some kernels have a bug that prevents setuid #! scripts from being
7427 secure. Some sites have disabled setuid #! scripts because of this.
7429 First let's decide if your kernel supports secure setuid #! scripts.
7430 (If setuid #! scripts would be secure but have been disabled anyway,
7431 don't say that they are secure if asked.)
7436 if $test -d /dev/fd; then
7437 echo "#!$ls" >reflect
7438 chmod +x,u+s reflect
7439 ./reflect >flect 2>&1
7440 if $contains "/dev/fd" flect >/dev/null; then
7441 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7445 If you are not sure if they are secure, I can check but I'll need a
7446 username and password different from the one you are using right now.
7447 If you don't have such a username or don't want me to test, simply
7451 rp='Other username to test security of setuid scripts with?'
7456 case "$d_suidsafe" in
7457 '') echo "I'll assume setuid scripts are *not* secure." >&4
7460 echo "Well, the $hint value is *not* secure." >&4
7462 *) echo "Well, the $hint value *is* secure." >&4
7467 $rm -f reflect flect
7468 echo "#!$ls" >reflect
7469 chmod +x,u+s reflect
7472 echo '"su" will (probably) prompt you for '"$ans's password."
7473 su $ans -c './reflect >flect'
7474 if $contains "/dev/fd" flect >/dev/null; then
7475 echo "Okay, it looks like setuid scripts are secure." >&4
7478 echo "I don't think setuid scripts are secure." >&4
7483 rp='Does your kernel have *secure* setuid scripts?'
7486 [yY]*) val="$define";;
7491 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7492 echo "(That's for file descriptors, not floppy disks.)"
7498 $rm -f reflect flect
7500 : now see if they want to do setuid emulation
7501 if $test $patchlevel -lt 11; then
7504 case "$d_suidsafe" in
7507 echo "No need to emulate SUID scripts since they are secure here." >&4
7511 Some systems have disabled setuid scripts, especially systems where
7512 setuid scripts cannot be secure. On systems where setuid scripts have
7513 been disabled, the setuid/setgid bits on scripts are currently
7514 useless. It is possible for $package to detect those bits and emulate
7515 setuid/setgid in a secure fashion. This emulation will only work if
7516 setuid scripts have been disabled in your kernel.
7520 "$define") dflt=y ;;
7523 rp="Do you want to do setuid/setgid emulation?"
7526 [yY]*) val="$define";;
7538 SUID emulation has been removed for 5.12
7539 Please re-run Configure without -Dd_dosuid
7548 : Find perl5.005 or later.
7549 echo "Looking for a previously installed perl5.005 or later... "
7551 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7552 : Check if this perl is recent and can load a simple module
7553 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7556 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7566 '') echo "None found. That's ok.";;
7567 *) echo "Using $perl5." ;;
7570 : Set the siteprefix variables
7573 After $package is installed, you may wish to install various
7574 add-on modules and utilities. Typically, these add-ons will
7575 be installed under $prefix with the rest
7576 of this package. However, you may wish to install such add-ons
7577 elsewhere under a different prefix.
7579 If you do not wish to put everything under a single prefix, that's
7580 ok. You will be prompted for the individual locations; this siteprefix
7581 is only used to suggest the defaults.
7583 The default should be fine for most people.
7587 rp='Installation prefix to use for add-on modules and utilities?'
7588 : XXX Here might be another good place for an installstyle setting.
7589 case "$siteprefix" in
7591 *) dflt=$siteprefix ;;
7594 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7596 case "$siteprefix" in
7600 *) oldsiteprefix="$prefix";;
7605 siteprefixexp="$ansexp"
7607 : determine where site specific libraries go.
7608 : Usual default is /usr/local/lib/perl5/site_perl/$version
7609 : The default "style" setting is made in installstyle.U
7610 : XXX No longer works with Prefixit stuff.
7611 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7613 '') case "$installstyle" in
7614 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7615 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7623 The installation process will create a directory for
7624 site-specific extensions and modules. Most users find it convenient
7625 to place all site-specific files in this directory rather than in the
7626 main distribution directory.
7630 rp='Pathname for the site-specific library files?'
7634 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7636 : Determine list of previous versions to include in @INC
7637 $cat > getverlist <<EOPL
7640 \$api_versionstring = "$api_versionstring";
7641 \$version = "$version";
7642 \$stem = "$sitelib_stem";
7643 \$archname = "$archname";
7645 $cat >> getverlist <<'EOPL'
7646 # The list found is store twice for each entry: the original name, and
7647 # the binary broken down version as pack "sss", so sorting is easy and
7648 # unambiguous. This will work for all versions that have a maximum of
7649 # three digit groups, separate by '.'s or '_'s. Names are extended with
7650 # ".0.0" to ensure at least three elements for the pack.
7651 # -- H.Merijn Brand (m)'06 23-10-2006
7653 # Can't have leading @ because metaconfig interprets it as a command!
7654 ;@inc_version_list=();
7655 # XXX Redo to do opendir/readdir?
7658 ;@candidates = map {
7659 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7660 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7666 ($pversion, $aversion, $vsn5005) = map {
7667 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7668 foreach $d (@candidates) {
7669 if ($d->[1] lt $pversion) {
7670 if ($d->[1] ge $aversion) {
7671 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7673 elsif ($d->[1] ge $vsn5005) {
7674 unshift(@inc_version_list, grep { -d } $d->[0]);
7678 # Skip newer version. I.e. don't look in
7679 # 5.7.0 if we're installing 5.6.1.
7683 if (@inc_version_list) {
7684 print join(' ', @inc_version_list);
7687 # Blank space to preserve value for next Configure run.
7692 case "$inc_version_list" in
7693 '') if test -x "$perl5$exe_ext"; then
7694 dflt=`$perl5 getverlist`
7699 $undef) dflt='none' ;;
7700 *) eval dflt=\"$inc_version_list\" ;;
7703 ''|' ') dflt=none ;;
7710 In order to ease the process of upgrading, this version of perl
7711 can be configured to use modules built and installed with earlier
7712 versions of perl that were installed under $prefix. Specify here
7713 the list of earlier versions that this version of perl should check.
7714 If Configure detected no earlier versions of perl installed under
7715 $prefix, then the list will be empty. Answer 'none' to tell perl
7716 to not search earlier versions.
7718 The default should almost always be sensible, so if you're not sure,
7719 just accept the default.
7722 rp='List of earlier versions to include in @INC?'
7725 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7726 *) inc_version_list="$ans" ;;
7728 case "$inc_version_list" in
7730 inc_version_list_init='0'
7731 d_inc_version_list="$undef"
7733 *) inc_version_list_init=`echo $inc_version_list |
7734 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7735 d_inc_version_list="$define"
7740 : see if malloc/malloc.h has to be included
7741 set malloc/malloc.h i_mallocmalloc
7744 : see if this is a malloc.h system
7745 : we want a real compile instead of Inhdr because some systems have a
7746 : malloc.h that just gives a compile error saying to use stdlib.h instead
7751 #$i_mallocmalloc I_MALLOCMALLOC
7752 #ifdef I_MALLOCMALLOC
7753 # include <malloc/malloc.h>
7756 int main () { return 0; }
7759 if eval $compile; then
7760 echo "<malloc.h> found." >&4
7763 echo "<malloc.h> NOT found." >&4
7770 : check for length of pointer
7774 echo "Checking to see how big your pointers are..." >&4
7783 printf("%d\n", (int)sizeof(void *));
7788 if eval $compile_ok; then
7789 ptrsize=`$run ./try`
7790 echo "Your pointers are $ptrsize bytes long."
7793 echo "(I can't seem to compile the test program. Guessing...)" >&4
7794 rp="What is the size of a pointer (in bytes)?"
7801 case "$use64bitall" in
7802 "$define"|true|[yY]*)
7806 *** You have chosen a maximally 64-bit build,
7807 *** but your pointers are only 4 bytes wide.
7808 *** Please rerun Configure without -Duse64bitall.
7813 *** Since you have quads, you could possibly try with -Duse64bitint.
7818 *** Cannot continue, aborting.
7829 : determine whether to use malloc wrapping
7831 case "$usemallocwrap" in
7832 [yY]*|true|$define) dflt='y' ;;
7833 [nN]*|false|$undef) dflt='n' ;;
7834 *) case "$usedevel" in
7835 [yY]*|true|$define) dflt='y' ;;
7840 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7842 usemallocwrap="$ans"
7845 usemallocwrap="$define" ;;
7847 usemallocwrap="$undef" ;;
7850 : determine which malloc to compile in
7852 case "$usemymalloc" in
7853 [yY]*|true|$define) dflt='y' ;;
7854 [nN]*|false|$undef) dflt='n' ;;
7855 *) case "$ptrsize" in
7859 if test "$useithreads" = "$define"; then dflt='n'; fi
7862 rp="Do you wish to attempt to use the malloc that comes with $package?"
7868 mallocsrc='malloc.c'
7869 mallocobj="malloc$_o"
7870 d_mymalloc="$define"
7873 : Remove malloc from list of libraries to use
7874 echo "Removing unneeded -lmalloc from library list" >&4
7875 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7878 echo "libs = $libs" >&4
7890 : compute the return types of malloc and free
7892 $cat >malloc.c <<END
7896 #include <sys/types.h>
7910 case "$malloctype" in
7912 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7919 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7923 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7930 echo "Your system uses $freetype free(), it would seem." >&4
7932 : determine where site specific architecture-dependent libraries go.
7933 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7934 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7935 : sitelib may have an optional trailing /share.
7937 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7938 dflt="$dflt/$archname"
7943 set sitearch sitearch none
7947 The installation process will also create a directory for
7948 architecture-dependent site-specific extensions and modules.
7952 rp='Pathname for the site-specific architecture-dependent library files?'
7956 if $test X"$sitearch" = X"$sitelib"; then
7959 d_sitearch="$define"
7962 : Set the vendorprefix variables
7965 The installation process will also create a directory for
7966 vendor-supplied add-ons. Vendors who supply perl with their system
7967 may find it convenient to place all vendor-supplied files in this
7968 directory rather than in the main distribution directory. This will
7969 ease upgrades between binary-compatible maintenance versions of perl.
7971 Of course you may also use these directories in whatever way you see
7972 fit. For example, you might use them to access modules shared over a
7973 company-wide network.
7975 The default answer should be fine for most people.
7976 This causes further questions about vendor add-ons to be skipped
7977 and no vendor-specific directories will be configured for perl.
7980 rp='Do you want to configure vendor-specific add-on directories?'
7981 case "$usevendorprefix" in
7982 define|true|[yY]*) dflt=y ;;
7983 *) : User may have set vendorprefix directly on Configure command line.
7984 case "$vendorprefix" in
7993 rp='Installation prefix to use for vendor-supplied add-ons?'
7994 case "$vendorprefix" in
7995 '') dflt="$prefix" ;;
7996 *) dflt=$vendorprefix ;;
7999 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
8001 case "$vendorprefix" in
8005 *) oldvendorprefix="$prefix";;
8009 usevendorprefix="$define"
8011 vendorprefixexp="$ansexp"
8013 *) usevendorprefix="$undef"
8019 : Set the vendorlib variables
8020 case "$vendorprefix" in
8021 '') d_vendorlib="$undef"
8025 *) d_vendorlib="$define"
8026 : determine where vendor-supplied modules go.
8027 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8028 case "$vendorlib" in
8030 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8031 case "$installstyle" in
8032 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8033 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8036 *) dflt="$vendorlib"
8040 rp='Pathname for the vendor-supplied library files?'
8043 vendorlibexp="$ansexp"
8046 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8050 : Set the vendorarch variables
8051 case "$vendorprefix" in
8052 '') d_vendorarch="$undef"
8056 *) d_vendorarch="$define"
8057 : determine where vendor-supplied architecture-dependent libraries go.
8058 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8059 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8060 : vendorlib may have an optional trailing /share.
8061 case "$vendorarch" in
8062 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8063 dflt="$dflt/$archname"
8065 *) dflt="$vendorarch" ;;
8068 rp='Pathname for vendor-supplied architecture-dependent files?'
8071 vendorarchexp="$ansexp"
8074 prefixvar=vendorarch
8076 if $test X"$vendorarch" = X"$vendorlib"; then
8077 d_vendorarch="$undef"
8079 d_vendorarch="$define"
8082 : Final catch-all directories to search
8085 Lastly, you can have perl look in other directories for extensions and
8086 modules in addition to those already specified.
8087 These directories will be searched after
8091 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8092 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8094 case "$otherlibdirs" in
8095 ''|' ') dflt='none' ;;
8096 *) dflt="$otherlibdirs" ;;
8099 Enter a colon-separated set of extra paths to include in perl's @INC
8100 search path, or enter 'none' for no extra paths.
8104 rp='Colon-separated list of additional directories for perl to search?'
8107 ' '|''|none) otherlibdirs=' ' ;;
8108 *) otherlibdirs="$ans" ;;
8110 case "$otherlibdirs" in
8114 set d_perl_otherlibdirs
8117 : Cruising for prototypes
8119 echo "Checking out function prototypes..." >&4
8120 $cat >prototype.c <<EOCP
8125 int main(int argc, char *argv[]) {
8128 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8129 echo "Your C compiler appears to support function prototypes."
8132 echo "Your C compiler doesn't seem to understand function prototypes."
8139 : Check if ansi2knr is required
8140 case "$prototype" in
8142 *) ansi2knr='ansi2knr'
8147 This version of $package can only be compiled by a compiler that
8148 understands function prototypes. Unfortunately, your C compiler
8150 doesn't seem to understand them. Sorry about that.
8152 If GNU cc is available for your system, perhaps you could try that instead.
8154 Eventually, we hope to support building Perl with pre-ANSI compilers.
8155 If you would like to help in that effort, please contact <perlbug@perl.org>.
8157 Aborting Configure now.
8164 dflt_dtrace='/usr/sbin/dtrace'
8165 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8169 Perl can be built to support DTrace on platforms that support it.
8170 DTrace is a diagnosis and performance analysis tool from Sun.
8172 If this doesn't make any sense to you, just accept the default.
8176 case "$usedtrace" in
8182 dflt_dtrace=$usedtrace
8189 rp='Support DTrace if available?'
8192 y|Y) val="$define" ;;
8198 test "X$usedtrace" != "X$define" && break
8201 rp='Where is the dtrace executable?'
8210 if $dtrace -h -s ../perldtrace.d \
8211 -o perldtrace.tmp >/dev/null 2>&1 \
8212 && rm -f perldtrace.tmp
8215 echo "Good: your $dtrace knows about the -h flag."
8219 *** $me: Fatal Error: $dtrace doesn't support -h flag
8221 *** Your installed dtrace doesn't support the -h switch to compile a D
8222 *** program into a C header. Can't continue.
8234 *** $me: Fatal Error: $dtrace not found.
8241 echo "*** $dtrace was not found."
8247 : See if we want extra modules installed
8254 Perl can be built with extra modules or bundles of modules which
8255 will be fetched from the CPAN and installed alongside Perl.
8257 Notice that you will need access to the CPAN; either via the Internet,
8258 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8259 be asked later to configure the CPAN.pm module which will in turn do
8260 the installation of the rest of the extra modules or bundles.)
8262 Notice also that if the modules require any external software such as
8263 libraries and headers (the libz library and the zlib.h header for the
8264 Compress::Zlib module, for example) you MUST have any such software
8265 already installed, this configuration process will NOT install such
8268 If this doesn't make any sense to you, just accept the default '$dflt'.
8270 rp='Install any extra modules (y or n)?'
8276 Please list any extra modules or bundles to be installed from CPAN,
8277 with spaces between the names. The names can be in any format the
8278 'install' command of CPAN.pm will understand. (Answer 'none',
8279 without the quotes, to install no extra modules or bundles.)
8289 $rm -f ../extras.lst
8291 *) echo "(Saving the list of extras for later...)"
8292 echo "$extras" > ../extras.lst
8300 : determine where html pages for programs go
8301 set html1dir html1dir none
8305 If you wish to install html files for programs in $spackage, indicate
8306 the appropriate directory here. To skip installing html files,
8310 ''|none|$undef|' ') dflt=none ;;
8311 *) dflt=$html1dir ;;
8314 rp="Directory for the main $spackage html pages?"
8318 : Use ' ' for none so value is preserved next time through Configure
8319 $test X"$html1dir" = "X" && html1dir=' '
8321 : determine where html pages for libraries and modules go
8322 set html3dir html3dir none
8326 If you wish to install html files for modules associated with $spackage,
8327 indicate the appropriate directory here. To skip installing html files,
8330 : There is no obvious default. If they have specified html1dir, then
8331 : try to key off that, possibly changing .../html1 into .../html3.
8333 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8334 *) dflt=$html3dir ;;
8337 rp="Directory for the $spackage module html pages?"
8341 : Use ' ' for none so value is preserved next time through Configure
8342 $test X"$html3dir" = "X" && html3dir=' '
8344 : determine whether to install perl also as /usr/bin/perl
8347 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8349 Many scripts expect perl to be installed as /usr/bin/perl.
8351 If you want to, I can install the perl you are about to compile
8352 as /usr/bin/perl (in addition to $bin/perl).
8354 if test -f /usr/bin/perl; then
8357 However, please note that because you already have a /usr/bin/perl,
8358 overwriting that with a new Perl would very probably cause problems.
8359 Therefore I'm assuming you don't want to do that (unless you insist).
8362 case "$installusrbinperl" in
8363 "$define"|[yY]*) dflt='y';;
8369 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8372 case "$installusrbinperl" in
8373 "$undef"|[nN]*) dflt='n';;
8377 rp="Do you want to install perl as /usr/bin/perl?"
8380 [yY]*) val="$define";;
8386 set installusrbinperl
8389 : see if dlopen exists
8391 xxx_ccflags="$ccflags"
8393 : with g++ one needs -shared to get is-in-libc to work for dlopen
8394 case "$gccversion" in
8397 *) case "$d_cplusplus" in
8398 "$define") ccflags="$ccflags -shared" ;;
8405 ccflags="$xxx_ccflags"
8407 : see if this is a unistd.h system
8408 set unistd.h i_unistd
8411 : determine which dynamic loading, if any, to compile in
8413 dldir="ext/DynaLoader"
8426 $define) dflt='y' ;;
8428 : Does a dl_xxx.xs file exist for this operating system
8429 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8432 rp="Do you wish to use dynamic loading?"
8439 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8440 dflt="$dldir/dl_${osname}.xs"
8441 elif $test "$d_dlopen" = "$define" ; then
8442 dflt="$dldir/dl_dlopen.xs"
8447 *) dflt="$dldir/$dlsrc"
8450 echo "The following dynamic loading files are available:"
8451 : Can not go over to $dldir because getfile has path hard-coded in.
8452 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8453 rp="Source file to use for dynamic loading"
8459 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8463 Some systems may require passing special flags to $cc -c to
8464 compile modules that will be used to create a shared library.
8465 To use no flags, say "none".
8468 case "$cccdlflags" in
8469 '') case "$gccversion" in
8470 '') case "$osname" in
8472 irix*) dflt='-KPIC' ;;
8473 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8474 sunos) dflt='-pic' ;;
8478 *) case "$osname" in
8479 darwin) dflt='none' ;;
8480 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8485 *) dflt="$cccdlflags" ;;
8492 # If -Dsysroot was specified, now's the time to add it
8494 if test "X$sysroot" != X; then
8495 case "$gccversion" in
8500 dflt="$dflt --sysroot=$sysroot" ;;
8510 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8513 none) cccdlflags=' ' ;;
8514 *) cccdlflags="$ans" ;;
8519 Some systems use ld to create libraries that can be dynamically loaded,
8520 while other systems (such as those using ELF) use $cc.
8524 : Determine if this is ELF
8526 /* Test for whether ELF binaries are produced */
8538 int i = open("a.out",O_RDONLY);
8541 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8542 exit(0); /* succeed (yes, it is ELF) */
8546 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8552 '') if $test $bin_ELF = "$define"; then
8554 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8558 echo "I'll use ld to build dynamic libraries."
8566 rp="What command should be used to create dynamic libraries?"
8572 Some systems may require passing special flags to $ld to create a
8573 library that can be dynamically loaded. If your ld flags include
8574 -L/other/path options to locate libraries outside your loader's normal
8575 search path, you may need to specify those -L options here as well. To
8576 use no flags, say "none".
8579 case "$lddlflags" in
8580 '') case "$osname" in
8581 haiku) dflt='-shared' ;;
8583 case "$gccversion" in
8584 '') dflt="$dflt +vnocompatwarnings" ;;
8587 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8588 solaris) # See [perl #66604].
8589 # On Solaris 11, gcc -m64 on amd64
8590 # appears not to understand -G. gcc versions at
8591 # least as old as 3.4.3 support -shared, so just
8592 # use that with Solaris 11 and later, but keep
8593 # the old behavior for older Solaris versions.
8594 case "$gccversion" in
8596 *) case "$osvers" in
8597 2.?|2.10) dflt='-G' ;;
8598 *) dflt='-shared' ;;
8603 sunos) dflt='-assert nodefinitions' ;;
8604 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8608 *) dflt="$lddlflags" ;;
8611 : Only do this for gcc, since, for example, qcc has no concept
8613 if $test "X$sysroot" != X; then
8614 case "$gccversion" in
8616 *) dflt="$dflt --sysroot $sysroot" ;;
8620 : Try to guess additional flags to pick up local libraries.
8621 : Be careful not to append to a plain 'none'
8625 for thisflag in $ldflags; do
8630 *) dflt="$dflt $thisflag" ;;
8637 ''|' ') dflt='none' ;;
8641 *-fstack-protector-strong*)
8643 *-fstack-protector-strong*) ;; # Don't add it again
8644 *) dflt="$dflt -fstack-protector-strong" ;;
8647 *-fstack-protector*)
8649 *-fstack-protector*) ;; # Don't add it again
8650 *) dflt="$dflt -fstack-protector" ;;
8655 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8658 none) lddlflags=' ' ;;
8659 *) lddlflags="$ans" ;;
8664 Some systems may require passing special flags to $cc to indicate that
8665 the resulting executable will use dynamic linking. To use no flags,
8669 case "$ccdlflags" in
8670 '') case "$osname" in
8671 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8672 sunos) dflt='none' ;;
8676 *) dflt="$ccdlflags" ;;
8678 rp="Any special flags to pass to $cc to use dynamic linking?"
8681 none) ccdlflags=' ' ;;
8682 *) ccdlflags="$ans" ;;
8694 ld_can_script="$undef"
8695 case "$bin_ELF$usedl" in
8697 # Abuse try.h and a.out names for neat cleanup
8709 if $cc $cccdlflags $ccdlflags $ccflags \
8710 $ldflags $lddlflags -o a.out try.c \
8711 -Wl,--version-script=try.h >/dev/null 2>&1 \
8712 && $test -s a.out ; then
8713 echo "ld supports scripting" >&4
8714 ld_can_script="$define"
8716 echo "ld does not support scripting" >&4
8722 : Do we want a shared libperl?
8726 # No dynamic loading being used, so don't bother even to prompt.
8729 *) case "$useshrplib" in
8730 '') case "$osname" in
8731 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8733 also='Building a shared libperl is required for dynamic loading to work on your system.'
8747 The perl executable is normally obtained by linking perlmain.c with
8748 libperl${_a}, any static extensions (usually just DynaLoader), and
8749 any other libraries needed on this system (such as -lm, etc.). Since
8750 your system supports dynamic loading, it is probably possible to build
8751 a shared libperl.$so. If you will have more than one executable linked
8752 to libperl.$so, this will significantly reduce the size of each
8753 executable, but it may have a noticeable effect on performance. The
8754 default is probably sensible for your system.
8758 rp="Build a shared libperl.$so (y/n)"
8762 useshrplib='true' ;;
8763 *) useshrplib='false' ;;
8768 case "$useshrplib" in
8770 case "$userelocatableinc" in
8772 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8773 echo "See INSTALL for an explanation why that won't work." >&4
8779 # Figure out a good name for libperl.so. Since it gets stored in
8780 # a version-specific architecture-dependent library, the version
8781 # number isn't really that important, except for making cc/ld happy.
8783 # A name such as libperl.so.10.1
8784 majmin="libperl.$so.$patchlevel.$subversion"
8785 # A name such as libperl.so.100
8786 majonly=`echo $patchlevel $subversion |
8787 $awk '{printf "%d%02d", $1, $2}'`
8788 majonly=libperl.$so.$majonly
8789 # I'd prefer to keep the os-specific stuff here to a minimum, and
8790 # rely on figuring it out from the naming of libc.
8791 case "${osname}${osvers}" in
8792 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8795 cygwin*) # ld links now against the dll directly
8796 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8797 majonly=`echo $patchlevel $subversion |
8798 $awk '{printf "%03d%03d", $1, $2}'`
8799 majonly=cygperl5.$majonly.$so
8802 *) # Try to guess based on whether libc has major.minor.
8804 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8805 *libc.$so.[0-9]*) dflt=$majonly ;;
8806 *) dflt=libperl.$so ;;
8816 I need to select a good name for the shared libperl. If your system uses
8817 library names with major and minor numbers, then you might want something
8818 like $majmin. Alternatively, if your system uses a single version
8819 number for shared libraries, then you might want to use $majonly.
8820 Or, your system might be quite happy with a simple libperl.$so.
8822 Since the shared libperl will get installed into a version-specific
8823 architecture-dependent directory, the version number of the shared perl
8824 library probably isn't important, so the default should be o.k.
8827 rp='What name do you want to give to the shared libperl?'
8830 echo "Ok, I'll use $libperl"
8833 libperl="libperl${_a}"
8837 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8841 WARNING: Use of the shrpdir variable for the installation location of
8842 the shared $libperl is not supported. It was never documented and
8843 will not work in this version. Let me (perlbug@perl.org)
8844 know of any problems this may cause.
8850 But your current setting of $shrpdir is
8851 the default anyway, so it's harmless.
8856 Further, your current attempted setting of $shrpdir
8857 conflicts with the value of $archlibexp/CORE
8858 that installperl will use.
8865 # How will the perl executable find the installed shared $libperl?
8866 # Add $xxx to ccdlflags.
8867 # If we can't figure out a command-line option, use $shrpenv to
8868 # set env LD_RUN_PATH. The main perl makefile uses this.
8869 shrpdir=$archlibexp/CORE
8872 if "$useshrplib"; then
8875 # We'll set it in Makefile.SH...
8880 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8881 xxx="-Wl,-R$shrpdir"
8883 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8884 xxx="-Wl,-rpath,$shrpdir"
8887 # hpux doesn't like the default, either.
8888 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8891 # cygwin needs only ldlibpth
8894 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8900 # Only add $xxx if it isn't already in ccdlflags.
8901 case " $ccdlflags " in
8903 *) ccdlflags="$ccdlflags $xxx"
8906 Adding $xxx to the flags
8907 passed to $ld so that the perl executable will find the
8908 installed shared $libperl.
8916 # Fix ccdlflags in AIX for building external extensions.
8917 # (For building Perl itself bare -bE:perl.exp is needed,
8918 # Makefile.SH takes care of this.)
8920 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8922 # Respect a hint or command-line value.
8924 '') shrpenv="$tmp_shrpenv" ;;
8926 case "$ldlibpthname" in
8927 '') ldlibpthname=LD_LIBRARY_PATH ;;
8928 none) ldlibpthname='' ;;
8931 : determine where manual pages are on this system
8935 syspath='/usr/share/man/man1 /usr/man/man1'
8936 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8937 syspath="$syspath /usr/man/u_man/man1"
8938 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8939 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8940 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8941 sysman=`./loc . /usr/man/man1 $syspath`
8944 if $test -d "$sysman"; then
8945 echo "System manual is in $sysman." >&4
8947 echo "Could not find manual pages in source form." >&4
8950 : determine where manual pages go
8951 set man1dir man1dir none
8955 $spackage has manual pages available in source form.
8959 echo "However, you don't have nroff, so they're probably useless to you."
8961 '') man1dir="none";;
8964 echo "If you don't want the manual sources installed, answer 'none'."
8969 lookpath="$prefixexp/share/man/man1"
8970 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8971 lookpath="$lookpath $prefixexp/man/p_man/man1"
8972 lookpath="$lookpath $prefixexp/man/u_man/man1"
8973 lookpath="$lookpath $prefixexp/man/man.1"
8975 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8976 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8986 rp="Where do the main $spackage manual pages (source) go?"
8988 if $test "X$man1direxp" != "X$ansexp"; then
8999 : What suffix to use on installed man pages
9006 rp="What suffix should be used for the main $spackage man pages?"
9008 '') case "$man1dir" in
9022 *) dflt="$man1ext";;
9029 : see if we can have long filenames
9031 first=123456789abcdef
9033 if (echo hi >$first) 2>/dev/null; then
9034 if $test -f 123456789abcde; then
9035 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
9038 echo 'You can have filenames longer than 14 characters.'>&4
9043 You can't have filenames longer than 14 chars.
9044 You can't even think about them!
9050 $rm -rf 123456789abcde*
9052 : determine where library module manual pages go
9053 set man3dir man3dir none
9057 $spackage has manual pages for many of the library modules.
9063 However, you don't have nroff, so they're probably useless to you.
9066 '') man3dir="none";;
9070 case "$d_flexfnam" in
9073 However, your system can't handle the long file names like File::Basename.3.
9076 '') man3dir="none";;
9080 echo "If you don't want the manual sources installed, answer 'none'."
9081 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9083 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9084 if $test -d "$privlib/man/man3"; then
9087 WARNING: Previous versions of perl installed man3 pages into
9088 $privlib/man/man3. This version will suggest a
9089 new default of $dflt.
9093 rp='Do you wish to preserve the old behavior?(y/n)'
9096 y*) dflt="$privlib/man/man3" ;;
9101 *) dflt="$man3dir" ;;
9108 rp="Where do the $package library man pages (source) go?"
9118 : What suffix to use on installed man pages
9124 rp="What suffix should be used for the $package library man pages?"
9126 '') case "$man3dir" in
9140 *) dflt="$man3ext";;
9147 : see if we have to deal with yellow pages, now NIS.
9148 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9154 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9162 rp='Are you getting the hosts file via yellow pages?'
9165 y*) hostcat='ypcat hosts';;
9166 *) hostcat='cat /etc/hosts';;
9172 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9175 '') test -f /etc/group && groupcat='cat /etc/group';;
9178 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9181 : now get the host name
9183 echo "Figuring out host name..." >&4
9184 case "$myhostname" in
9186 echo 'Maybe "hostname" will work...'
9187 if tans=`sh -c hostname 2>&1` ; then
9195 if $test "$cont"; then
9197 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9198 if tans=`cat /etc/systemid 2>&1` ; then
9200 phostname='cat /etc/systemid'
9201 echo "Whadyaknow. Xenix always was a bit strange..."
9204 elif $test -r /etc/systemid; then
9205 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9208 if $test "$cont"; then
9209 echo 'No, maybe "uuname -l" will work...'
9210 if tans=`sh -c 'uuname -l' 2>&1` ; then
9212 phostname='uuname -l'
9214 echo 'Strange. Maybe "uname -n" will work...'
9215 if tans=`sh -c 'uname -n' 2>&1` ; then
9217 phostname='uname -n'
9219 echo 'Oh well, maybe I can mine it out of whoami.h...'
9220 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9221 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9222 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9224 case "$myhostname" in
9225 '') echo "Does this machine have an identity crisis or something?"
9228 echo "Well, you said $myhostname before..."
9229 phostname='echo $myhostname';;
9235 case "$myhostname" in
9236 '') myhostname=noname ;;
9238 : you do not want to know about this
9243 if $test "$myhostname" ; then
9245 rp='Your host name appears to be "'$myhostname'".'" Right?"
9253 : bad guess or no guess
9254 while $test "X$myhostname" = X ; do
9256 rp="Please type the (one word) name of your host:"
9261 : translate upper to lower if necessary
9262 case "$myhostname" in
9264 echo "(Normalizing case in your host name)"
9265 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9269 case "$myhostname" in
9271 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9272 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9273 echo "(Trimming domain name from host name--host name is now $myhostname)"
9275 *) case "$mydomain" in
9278 test "X$hostcat" = "Xypcat hosts" &&
9279 ypmatch "$myhostname" hosts 2>/dev/null |\
9280 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9283 test "X$hostcat" != "X" &&
9284 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9285 /[ ]$myhostname[ . ]/p" > hosts
9288 if $test -f hosts; then
9289 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9290 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9291 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9292 hosts | $sort | $uniq | \
9293 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9294 case `$echo X$dflt` in
9295 X*\ *) echo "(Several hosts in the database matched hostname)"
9298 X.) echo "(You do not have fully-qualified names in the hosts database)"
9302 echo "(I cannot locate a hosts database anywhere)"
9307 tans=`./loc resolv.conf X /etc /usr/etc`
9308 if $test -f "$tans"; then
9309 echo "(Attempting domain name extraction from $tans)"
9310 dflt=.`$sed -n -e 's/ / /g' \
9311 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9314 .) dflt=.`$sed -n -e 's/ / /g' \
9315 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9323 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9324 dflt=.`sh -c domainname 2>/dev/null`
9327 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9331 case "$dflt$osname" in
9332 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9333 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9337 .) echo "(Lost all hope -- silly guess then)"
9343 *) dflt="$mydomain";;
9347 rp="What is your domain name?"
9357 : translate upper to lower if necessary
9360 echo "(Normalizing case in your domain name)"
9361 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9365 : a little sanity check here
9366 case "$phostname" in
9369 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9370 $myhostname$mydomain|$myhostname) ;;
9372 case "$phostname" in
9374 echo "(That doesn't agree with your whoami.h file, by the way.)"
9377 echo "(That doesn't agree with your $phostname command, by the way.)"
9385 : determine the e-mail address of the user who is running us
9388 I need to get your e-mail address in Internet format if possible, i.e.
9389 something like user@host.domain. Please answer accurately since I have
9390 no easy means to double check it. The default value provided below
9391 is most probably close to reality but may not be valid from outside
9392 your organization...
9396 while test "$cont"; do
9397 case "$MAILDOMAIN" in
9399 if $test -s /etc/mailname; then
9400 maildomain=`$cat /etc/mailname`
9402 maildomain="$myhostname$mydomain"
9405 *) maildomain="$MAILDOMAIN";;
9408 '') dflt="$cf_by@$maildomain";;
9409 *) dflt="$cf_email";;
9411 rp='What is your e-mail address?'
9417 rp='Address does not look like an Internet one. Use it anyway?'
9431 : Ask e-mail of administrator
9434 If you or somebody else will be maintaining perl at your site, please
9435 fill in the correct e-mail address here so that they may be contacted
9436 if necessary. Currently, the "perlbug" program included with perl
9437 will send mail to this address in addition to perlbug@perl.org. You may
9438 enter "none" for no administrator.
9441 case "$perladmin" in
9442 '') dflt="$cf_email";;
9443 *) dflt="$perladmin";;
9445 rp='Perl administrator e-mail address'
9449 : determine whether to use a version number suffix for installed binaries
9452 Do you want to use a version number suffix for installed binaries? This
9453 will install 'perl$version' instead of 'perl', and likewise for other
9454 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9455 to be installed side-by-side. Unless you are a developer, you probably
9456 do *not* want to do this.
9458 case "$versiononly" in
9459 "$define"|[Yy]*|true) dflt='y' ;;
9462 rp="Do you want to use a version number suffix for installed binaries?"
9465 [yY]*) val="$define";;
9471 case "$versiononly" in
9472 "$define") inc_version_list=''
9473 inc_version_list_init=0
9477 : figure out how to guarantee perl startup
9478 : XXX Note that this currently takes advantage of the bug that binexp ignores
9479 : the Configure -Dinstallprefix setting, which in turn means that under
9480 : relocatable @INC, initialinstalllocation is what binexp started as.
9481 case "$startperl" in
9483 case "$sharpbang" in
9487 I can use the #! construct to start perl on your system. This will
9488 make startup of perl scripts faster, but may cause problems if you
9489 want to share those scripts and perl is not in a standard place
9490 ($initialinstalllocation/perl) on all your platforms. The alternative
9491 is to force a shell by starting the script with a single ':' character.
9494 case "$versiononly" in
9495 "$define") dflt="$initialinstalllocation/perl$version";;
9496 *) dflt="$initialinstalllocation/perl";;
9498 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9501 none) startperl=": # use perl";;
9502 *) startperl="#!$ans"
9503 if $test 30 -lt `echo "$ans" | wc -c`; then
9506 WARNING: Some systems limit the #! command to 32 characters.
9507 If you experience difficulty running Perl scripts with #!, try
9508 installing Perl in a directory with a shorter pathname.
9514 *) startperl=": # use perl"
9519 echo "I'll use $startperl to start perl scripts."
9521 : figure best path for perl in scripts
9524 case "$versiononly" in
9525 "$define") perlpath="$initialinstalllocation/perl$version";;
9526 *) perlpath="$initialinstalllocation/perl";;
9528 case "$startperl" in
9533 I will use the "eval 'exec'" idiom to start Perl on your system.
9534 I can use the full path of your Perl binary for this purpose, but
9535 doing so may cause problems if you want to share those scripts and
9536 Perl is not always in a standard place ($initialinstalllocation/perl).
9539 dflt="$initialinstalllocation/perl"
9540 rp="What path shall I use in \"eval 'exec'\"?"
9547 case "$startperl" in
9549 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9552 : determine where public executable scripts go
9553 set scriptdir scriptdir
9555 case "$scriptdir" in
9558 : guess some guesses
9559 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9560 $test -d /usr/share/bin && dflt=/usr/share/bin
9561 $test -d /usr/local/script && dflt=/usr/local/script
9562 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9563 $test -d $prefixexp/script && dflt=$prefixexp/script
9567 *) dflt="$scriptdir"
9572 Some installations have a separate directory just for executable scripts so
9573 that they can mount it across multiple architectures but keep the scripts in
9574 one spot. You might, for example, have a subdirectory of /usr/share for this.
9575 Or you might just lump your scripts in with all your other executables.
9579 rp='Where do you keep publicly executable scripts?'
9581 if $test "X$ansexp" != "X$scriptdirexp"; then
9587 : A little fix up for an irregularly named variable.
9588 installscript="$installscriptdir"
9590 : determine where add-on public executables go
9592 '') dflt=$siteprefix/bin ;;
9596 rp='Pathname where the add-on public executables should be installed?'
9601 : determine where add-on html pages go
9602 : There is no standard location, so try to copy the previously-selected
9603 : directory structure for the core html pages.
9604 case "$sitehtml1dir" in
9605 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9606 *) dflt=$sitehtml1dir ;;
9609 ''|' ') dflt=none ;;
9612 rp='Pathname where the site-specific html pages should be installed?'
9614 prefixvar=sitehtml1dir
9617 : determine where add-on library html pages go
9618 : There is no standard location, so try to copy the previously-selected
9619 : directory structure for the core html pages.
9620 case "$sitehtml3dir" in
9621 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9622 *) dflt=$sitehtml3dir ;;
9625 ''|' ') dflt=none ;;
9628 rp='Pathname where the site-specific library html pages should be installed?'
9630 prefixvar=sitehtml3dir
9633 : determine where add-on manual pages go
9634 case "$siteman1dir" in
9635 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9636 *) dflt=$siteman1dir ;;
9639 ''|' ') dflt=none ;;
9642 rp='Pathname where the site-specific manual pages should be installed?'
9644 prefixvar=siteman1dir
9647 : determine where add-on library man pages go
9648 case "$siteman3dir" in
9649 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9650 *) dflt=$siteman3dir ;;
9653 ''|' ') dflt=none ;;
9656 rp='Pathname where the site-specific library manual pages should be installed?'
9658 prefixvar=siteman3dir
9661 : determine where add-on public executable scripts go
9662 case "$sitescript" in
9663 '') dflt=$siteprefix/script
9664 $test -d $dflt || dflt=$sitebin ;;
9665 *) dflt="$sitescript" ;;
9668 rp='Pathname where add-on public executable scripts should be installed?'
9670 prefixvar=sitescript
9673 : see if backtrace exists
9674 set backtrace d_backtrace
9677 : add flags if using c backtrace
9678 case "$usecbacktrace" in
9679 "") usecbacktrace=$undef ;;
9681 case "$d_backtrace" in
9683 case " $ccflags " in
9684 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9685 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9689 echo "This system does not support backtrace" >&4
9690 usecbacktrace=$undef
9696 : Check if faststdio is requested and available
9697 case "$usefaststdio" in
9698 $define|true|[yY]*|'')
9699 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9709 Perl can be built to use 'fast stdio', which means using the stdio
9710 library but also directly manipulating the stdio buffers to enable
9711 faster I/O. Using stdio is better for backward compatibility (especially
9712 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9713 interface has been preferred instead of stdio.
9715 If this doesn't make any sense to you, just accept the default '$dflt'.
9717 rp='Use the "fast stdio" if available?'
9720 y|Y) val="$define" ;;
9727 : define an is-a-typedef? function
9728 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9730 "") inclist="sys/types.h";;
9732 eval "varval=\$$var";
9736 for inc in $inclist; do
9737 echo "#include <$inc>" >>temp.c;
9739 echo "#ifdef $type" >> temp.c;
9740 echo "printf(\"We have $type\");" >> temp.c;
9741 echo "#endif" >> temp.c;
9742 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9743 if $contains $type temp.E >/dev/null 2>&1; then
9749 *) eval "$var=\$varval";;
9752 : define an is-a-typedef? function that prompts if the type is not available.
9753 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9755 "") inclist="sys/types.h";;
9757 eval "varval=\$$var";
9761 for inc in $inclist; do
9762 echo "#include <$inc>" >>temp.c;
9764 echo "#ifdef $type" >> temp.c;
9765 echo "printf(\"We have $type\");" >> temp.c;
9766 echo "#endif" >> temp.c;
9767 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9769 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9770 if $contains $type temp.E >/dev/null 2>&1; then
9771 echo "$type found." >&4;
9774 echo "$type NOT found." >&4;
9780 *) eval "$var=\$varval";;
9783 : see what type lseek is declared as in the kernel
9784 rp="What is the type used for lseek's offset on this system?"
9785 set off_t lseektype long stdio.h sys/types.h
9789 echo "Checking to see how big your file offsets are..." >&4
9791 #include <sys/types.h>
9795 printf("%d\n", (int)sizeof($lseektype));
9800 if eval $compile_ok; then
9801 lseeksize=`$run ./try`
9802 echo "Your file offsets are $lseeksize bytes long."
9806 echo "(I can't seem to compile the test program. Guessing...)"
9807 rp="What is the size of your file offsets (in bytes)?"
9813 : see what type file positions are declared as in the library
9814 rp="What is the type for file position used by fsetpos()?"
9815 set fpos_t fpostype long stdio.h sys/types.h
9818 : Check size for Fpos_t
9821 *_t) zzz="$fpostype" ;;
9824 echo "Checking the size of $zzz..." >&4
9826 #include <sys/types.h>
9833 printf("%d\n", (int)sizeof($fpostype));
9838 if eval $compile_ok; then
9842 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9845 echo "Your $zzz is $fpossize bytes long."
9851 echo "(I can't compile the test program. Guessing...)" >&4
9852 rp="What is the size of your file positions (in bytes)?"
9857 : Check for large file support
9858 # Backward compatibility (uselfs is deprecated).
9860 "$define"|true|[yY]*)
9863 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9865 uselargefiles="$define"
9869 case "$lseeksize:$fpossize" in
9872 You can have files larger than 2 gigabytes.
9875 *) case "$uselargefiles" in
9876 "$undef"|false|[nN]*) dflt='n' ;;
9881 Perl can be built to understand large files (files larger than 2 gigabytes)
9882 on some systems. To do so, Configure can be run with -Duselargefiles.
9884 If this doesn't make any sense to you, just accept the default '$dflt'.
9886 rp='Try to understand large files, if available?'
9889 y|Y) val="$define" ;;
9896 : Look for a hint-file generated 'call-back-unit'. If the
9897 : user has specified that a large files perl is to be built,
9898 : we may need to set or change some other defaults.
9899 if $test -f uselargefiles.cbu; then
9900 echo "Your platform has some specific hints regarding large file builds, using them..."
9901 . ./uselargefiles.cbu
9903 case "$uselargefiles" in
9905 if $test -f uselargefiles.cbu; then
9907 echo "Rechecking to see how big your file offsets are..." >&4
9909 #include <sys/types.h>
9913 printf("%d\n", (int)sizeof($lseektype));
9918 if eval $compile_ok; then
9919 lseeksize=`$run ./try`
9920 $echo "Your file offsets are now $lseeksize bytes long."
9924 echo "(I can't seem to compile the test program. Guessing...)"
9925 rp="What is the size of your file offsets (in bytes)?"
9930 *_t) zzz="$fpostype" ;;
9933 $echo $n "Rechecking the size of $zzz...$c" >&4
9935 #include <sys/types.h>
9942 printf("%d\n", (int)sizeof($fpostype));
9947 if eval $compile_ok; then
9952 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9955 echo " $fpossize bytes." >&4
9961 echo "(I can't compile the test program. Guessing...)" >&4
9962 rp="What is the size of your file positions (in bytes)?"
9971 : Check if we want perlio
9974 : Set the vendorbin variables
9975 case "$vendorprefix" in
9976 '') d_vendorbin="$undef"
9980 *) d_vendorbin="$define"
9981 : determine where vendor-supplied executables go.
9982 case "$vendorbin" in
9983 '') dflt=$vendorprefix/bin ;;
9984 *) dflt="$vendorbin" ;;
9987 rp='Pathname for the vendor-supplied executables directory?'
9990 vendorbinexp="$ansexp"
9996 : Set the vendorhtml1dir variables
9997 case "$vendorprefix" in
9998 '') vendorhtml1dir=''
9999 vendorhtml1direxp=''
10001 *) : determine where vendor-supplied html pages go.
10002 : There is no standard location, so try to copy the previously-selected
10003 : directory structure for the core html pages.
10004 : XXX Better default suggestions would be welcome.
10005 case "$vendorhtml1dir" in
10006 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10007 *) dflt=$vendorhtml1dir ;;
10010 ''|' ') dflt=none ;;
10013 rp='Pathname for the vendor-supplied html pages?'
10015 vendorhtml1dir="$ans"
10016 vendorhtml1direxp="$ansexp"
10019 : Use ' ' for none so value is preserved next time through Configure
10020 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
10021 prefixvar=vendorhtml1dir
10024 : Set the vendorhtml3dir variables
10025 case "$vendorprefix" in
10026 '') vendorhtml3dir=''
10027 vendorhtml3direxp=''
10029 *) : determine where vendor-supplied module html pages go.
10030 : There is no standard location, so try to copy the previously-selected
10031 : directory structure for the core html pages.
10032 : XXX Better default suggestions would be welcome.
10033 case "$vendorhtml3dir" in
10034 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10035 *) dflt=$vendorhtml3dir ;;
10038 ''|' ') dflt=none ;;
10041 rp='Pathname for the vendor-supplied html pages?'
10043 vendorhtml3dir="$ans"
10044 vendorhtml3direxp="$ansexp"
10047 : Use ' ' for none so value is preserved next time through Configure
10048 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10049 prefixvar=vendorhtml3dir
10052 : Set the vendorman1dir variables
10053 case "$vendorprefix" in
10054 '') vendorman1dir=''
10055 vendorman1direxp=''
10057 *) : determine where vendor-supplied manual pages go.
10058 case "$vendorman1dir" in
10059 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10060 *) dflt=$vendorman1dir ;;
10063 ''|' ') dflt=none ;;
10066 rp='Pathname for the vendor-supplied manual section 1 pages?'
10068 vendorman1dir="$ans"
10069 vendorman1direxp="$ansexp"
10072 : Use ' ' for none so value is preserved next time through Configure
10073 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10074 prefixvar=vendorman1dir
10077 : Set the vendorman3dir variables
10078 case "$vendorprefix" in
10079 '') vendorman3dir=''
10080 vendorman3direxp=''
10082 *) : determine where vendor-supplied module manual pages go.
10083 case "$vendorman3dir" in
10084 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10085 *) dflt=$vendorman3dir ;;
10088 ''|' ') dflt=none ;;
10091 rp='Pathname for the vendor-supplied manual section 3 pages?'
10093 vendorman3dir="$ans"
10094 vendorman3direxp="$ansexp"
10097 : Use ' ' for none so value is preserved next time through Configure
10098 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10099 prefixvar=vendorman3dir
10102 : Set the vendorscript variables
10103 case "$vendorprefix" in
10104 '') d_vendorscript="$undef"
10108 *) d_vendorscript="$define"
10109 : determine where vendor-supplied scripts go.
10110 case "$vendorscript" in
10111 '') dflt=$vendorprefix/script
10112 $test -d $dflt || dflt=$vendorbin ;;
10113 *) dflt="$vendorscript" ;;
10117 The installation process will create a directory for
10118 vendor-supplied scripts.
10122 rp='Pathname for the vendor-supplied scripts directory?'
10124 vendorscript="$ans"
10125 vendorscriptexp="$ansexp"
10128 prefixvar=vendorscript
10131 : script used to emit important warnings
10134 if test \$# -gt 0; then
10139 echo "*** WARNING:" >&4
10140 sed -e 's/^/*** /' <msg >&4
10142 cat msg >>config.msg
10143 echo " " >>config.msg
10149 : see which of string.h or strings.h is needed
10151 strings=`./findhdr string.h`
10152 if $test "$strings" && $test -r "$strings"; then
10153 echo "Using <string.h> instead of <strings.h>." >&4
10157 strings=`./findhdr strings.h`
10158 if $test "$strings" && $test -r "$strings"; then
10159 echo "Using <strings.h> instead of <string.h>." >&4
10161 ./warn "No string header found -- You'll surely have problems."
10166 case "$i_string" in
10167 "$undef") strings=`./findhdr strings.h`;;
10168 *) strings=`./findhdr string.h`;;
10171 : see if qgcvt exists
10175 : Check what kind of doubles your system has
10176 $echo "Checking the kind of doubles you have..." >&4
10178 #$i_stdlib I_STDLIB
10179 #define DOUBLESIZE $doublesize
10181 #include <stdlib.h>
10184 static const double d = -0.1;
10186 unsigned const char* b = (unsigned const char*)(&d);
10187 #if DOUBLESIZE == 4
10188 if (b[0] == 0xCD && b[3] == 0xBD) {
10189 /* IEEE 754 32-bit little-endian */
10193 if (b[0] == 0xBD && b[3] == 0xCD) {
10194 /* IEEE 754 32-bit big-endian */
10198 if (b[0] == 0xCC && b[3] == 0xCC) {
10199 /* VAX format F, 32-bit PDP-style mixed endian. */
10203 if (b[0] == 0xC0 && b[3] == 0x9A) {
10204 /* IBM single 32-bit */
10209 #if DOUBLESIZE == 8
10210 if (b[0] == 0x9A && b[7] == 0xBF) {
10211 /* IEEE 754 64-bit little-endian */
10215 if (b[0] == 0xBF && b[7] == 0x9A) {
10216 /* IEEE 754 64-bit big-endian */
10220 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10221 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10222 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10223 * 99 99 b9 bf 9a 99 99 99 */
10227 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10228 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10229 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10230 * 99 99 99 9a bf b9 99 99 */
10234 if (b[0] == 0xCC && b[7] == 0xCC) {
10235 /* VAX format D, 64-bit PDP-style mixed endian. */
10239 if (b[0] == 0xD9 && b[7] == 0x99) {
10240 /* VAX format G, 64-bit PDP-style mixed endian. */
10244 if (b[0] == 0xC0 && b[7] == 0x9A) {
10245 /* IBM double 64-bit */
10249 if (b[0] == 0xBF && b[7] == 0xCD) {
10250 /* CRAY single 64-bit */
10255 #if DOUBLESIZE == 16
10256 if (b[0] == 0x9A && b[15] == 0xBF) {
10257 /* IEEE 754 128-bit little-endian */
10261 if (b[0] == 0xBF && b[15] == 0x9A) {
10262 /* IEEE 754 128-bit big-endian */
10267 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10268 * Whether those environments can still build Perl is debatable. */
10269 printf("-1\n"); /* unknown */
10274 if eval $compile; then
10275 doublekind=`$run ./try`
10279 case "$doublekind" in
10280 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10281 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10282 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10283 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10284 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10285 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10286 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10287 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10288 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10289 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10290 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10291 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10292 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10293 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10294 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10296 d_double_style_ieee=$undef
10297 d_double_style_vax=$undef
10298 d_double_style_ibm=$undef
10299 d_double_style_cray=$undef
10300 case "$doublekind" in
10301 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10302 9|10|11) d_double_style_vax=$define ;;
10303 12|13) d_double_style_ibm=$define ;;
10304 14) d_double_style_cray=$define ;;
10306 case "$d_double_style_ieee" in
10308 d_double_has_inf=$define
10309 d_double_has_nan=$define
10310 d_double_has_negative_zero=$define
10311 d_double_has_subnormals=$define
10314 d_double_has_inf=$undef
10315 d_double_has_nan=$undef
10316 d_double_has_negative_zero=$undef
10317 d_double_has_subnormals=$undef
10322 : Check print/scan long double stuff
10325 if $test X"$d_longdbl" = X"$define"; then
10327 echo "Checking how to print long doubles..." >&4
10329 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10330 $cat >try.c <<'EOCP'
10331 #include <sys/types.h>
10334 double d = 123.456;
10335 printf("%.3f\n", d);
10339 if eval $compile; then
10343 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10344 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10345 echo "We will use %f."
10351 if $test X"$sPRIfldbl" = X; then
10352 $cat >try.c <<'EOCP'
10353 #include <sys/types.h>
10356 long double d = 123.456;
10357 printf("%.3Lf\n", d);
10361 if eval $compile; then
10365 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10366 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10367 echo "We will use %Lf."
10373 if $test X"$sPRIfldbl" = X; then
10374 $cat >try.c <<'EOCP'
10375 #include <sys/types.h>
10378 long double d = 123.456;
10379 printf("%.3llf\n", d);
10383 if eval $compile; then
10387 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10388 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10389 echo "We will use %llf."
10395 if $test X"$sPRIfldbl" = X; then
10396 $cat >try.c <<'EOCP'
10397 #include <sys/types.h>
10400 long double d = 123.456;
10401 printf("%.3lf\n", d);
10405 if eval $compile; then
10409 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10410 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10411 echo "We will use %lf."
10417 if $test X"$sPRIfldbl" = X; then
10418 echo "Cannot figure out how to print long doubles." >&4
10420 sSCNfldbl=$sPRIfldbl # expect consistency
10427 case "$sPRIfldbl" in
10428 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10429 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10430 d_SCNfldbl="$undef";
10432 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10433 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10434 d_SCNfldbl="$define";
10438 : Before committing on uselongdouble, see whether that looks sane.
10439 if $test "$uselongdouble" = "$define"; then
10442 echo "Checking if your long double math functions work right..." >&4
10447 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10450 case "$osname:$gccversion" in
10451 aix:) saveccflags="$ccflags"
10452 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10455 if eval $compile_ok; then
10459 3) echo "Your long double math functions are working correctly." >&4 ;;
10460 *) echo "Your long double math functions are broken, not using long doubles." >&4
10461 uselongdouble=$undef
10465 case "$osname:$gccversion" in
10466 aix:) ccflags="$saveccflags" ;; # restore
10470 : Check how to convert floats to strings.
10472 if test "X$d_Gconvert" = X; then
10475 echo "Checking for an efficient way to convert floats to strings."
10477 case "$uselongdouble" in
10478 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10480 case "$d_longdbl" in
10481 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10483 case "$d_PRIgldbl" in
10484 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10487 #ifdef TRY_gconvert
10488 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10489 char *myname = "gconvert";
10492 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10493 char *myname = "gcvt";
10496 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10497 char *myname = "qgcvt";
10498 #define DOUBLETYPE long double
10501 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10502 #ifdef HAS_PRIgldbl
10503 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10505 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10508 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10510 char *myname = "sprintf";
10514 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10515 #define DOUBLETYPE long double
10517 #define DOUBLETYPE double
10523 #$i_stdlib I_STDLIB
10525 #include <stdlib.h>
10527 #$i_string I_STRING
10529 # include <string.h>
10531 # include <strings.h>
10534 int checkit(char *expect, char *got)
10536 if (strcmp(expect, got)) {
10537 printf("%s oddity: Expected %s, got %s\n",
10538 myname, expect, got);
10548 /* This must be 1st test on (which?) platform */
10549 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10550 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10551 checkit("0.1", buf);
10553 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10554 checkit("0.01", buf);
10556 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10557 checkit("0.001", buf);
10559 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10560 checkit("0.0001", buf);
10562 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10563 if (strlen(buf) > 5)
10564 checkit("9e-005", buf); /* for Microsoft ?? */
10566 checkit("9e-05", buf);
10568 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10571 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10572 checkit("1.1", buf);
10574 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10575 checkit("1.01", buf);
10577 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10578 checkit("1.001", buf);
10580 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10581 checkit("1.0001", buf);
10583 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10584 checkit("1.00001", buf);
10586 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10587 checkit("1.000001", buf);
10589 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10592 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10593 checkit("-1", buf);
10595 /* Some Linux gcvt's give 1.e+5 here. */
10596 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10597 checkit("100000", buf);
10599 /* Some Linux gcvt's give -1.e+5 here. */
10600 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10601 checkit("-100000", buf);
10603 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10604 checkit("123.456", buf);
10606 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10607 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10608 /* 34 should be enough to scare even long double
10609 * places into using the e notation. */
10610 if (strlen(buf) > 5)
10611 checkit("1e+034", buf); /* for Microsoft */
10613 checkit("1e+34", buf);
10615 /* For Perl, if you add additional tests here, also add them to
10616 * t/base/num.t for benefit of platforms not using Configure or
10617 * overriding d_Gconvert */
10622 : first add preferred functions to our list
10624 for xxx_convert in $gconvert_preference; do
10625 case $xxx_convert in
10626 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10627 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10630 : then add any others
10631 for xxx_convert in gconvert gcvt sprintf; do
10632 case "$xxx_list" in
10634 *) xxx_list="$xxx_list $xxx_convert" ;;
10638 case "$d_longdbl$uselongdouble" in
10640 : again, add preferred functions to our list first
10642 for xxx_convert in $gconvert_ld_preference; do
10643 case $xxx_convert in
10644 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10645 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10648 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10649 for xxx_convert in qgcvt sprintf $xxx_list; do
10650 case "$xxx_ld_list" in
10651 $xxx_convert*|*" $xxx_convert"*) ;;
10652 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10655 : if sprintf cannot do long doubles, move it to the end
10656 if test "$d_PRIgldbl" != "$define"; then
10657 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10659 : if no qgcvt, remove it
10660 if test "$d_qgcvt" != "$define"; then
10661 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10664 xxx_list="$xxx_ld_list"
10668 for xxx_convert in $xxx_list; do
10669 echo "Trying $xxx_convert..."
10670 $rm -f try try$_o core
10671 set try -DTRY_$xxx_convert
10672 if eval $compile; then
10673 echo "$xxx_convert() found." >&4
10674 if $run ./try; then
10675 echo "I'll use $xxx_convert to convert floats into a string." >&4
10678 echo "...But $xxx_convert didn't work as I expected."
10682 echo "$xxx_convert NOT found." >&4
10686 if test X$xxx_convert = X; then
10687 echo "*** WHOA THERE!!! ***" >&4
10688 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10689 xxx_convert=sprintf
10692 case "$xxx_convert" in
10693 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10694 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10695 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10696 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10697 "$define$define$define")
10698 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10699 "$define$define$undef")
10700 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10701 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10709 : see if _fwalk exists
10713 : Initialize h_fcntl
10716 : Initialize h_sysfile
10719 : access call always available on UNIX
10720 set access d_access
10723 : locate the flags for 'access()'
10724 case "$d_access" in
10727 $cat >access.c <<EOCP
10728 #include <sys/types.h>
10733 #include <sys/file.h>
10736 #include <unistd.h>
10738 #$i_stdlib I_STDLIB
10740 #include <stdlib.h>
10746 : check sys/file.h first, no particular reason here
10747 if $test `./findhdr sys/file.h` && \
10748 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10750 echo "<sys/file.h> defines the *_OK access constants." >&4
10751 elif $test `./findhdr fcntl.h` && \
10752 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10754 echo "<fcntl.h> defines the *_OK access constants." >&4
10755 elif $test `./findhdr unistd.h` && \
10756 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10757 echo "<unistd.h> defines the *_OK access constants." >&4
10759 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10765 : see if accessx exists
10766 set accessx d_accessx
10769 : see if acosh exists
10773 : see if aintl exists
10777 : see if alarm exists
10781 : see if 64bit time functions exists
10783 set ctime64 d_ctime64
10786 set localtime64 d_localtime64
10789 set gmtime64 d_gmtime64
10792 set mktime64 d_mktime64
10795 set difftime64 d_difftime64
10798 set asctime64 d_asctime64
10801 : see if POSIX threads are available
10802 set pthread.h i_pthread
10805 : define a function to check prototypes
10806 $cat > protochk <<EOSH
10809 optimize="$optimize"
10811 prototype="$prototype"
10814 usethreads=$usethreads
10815 i_pthread=$i_pthread
10816 pthread_h_first=$pthread_h_first
10819 $cat >> protochk <<'EOSH'
10824 while test $# -ge 2; do
10826 $define) echo "#include <$2>" >> try.c ;;
10827 literal) echo "$2" >> try.c ;;
10829 # Extra magic for the benefit of systems that need pthread.h
10830 # to be included early to correctly detect threadsafe functions.
10831 # Such functions must guarantee themselves, though, that the usethreads
10832 # and i_pthread have been defined, before calling protochk.
10833 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10834 echo "#include <pthread.h>" >> try.c
10839 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10840 cat >> try.c <<'EOCP'
10841 #ifdef CAN_PROTOTYPE
10842 #define _(args) args
10847 echo "$foo" >> try.c
10848 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10849 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10855 $eunicefix protochk
10857 : Define hasproto macro for Configure internal use
10858 hasproto='varname=$1; func=$2; shift; shift;
10859 while $test $# -ge 2; do
10861 $define) echo "#include <$2>";;
10865 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10866 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10867 echo "$func() prototype found.";
10870 echo "$func() prototype NOT found.";
10877 : see if sys/types.h has to be included
10878 set sys/types.h i_systypes
10881 : see if sys/select.h has to be included
10882 set sys/select.h i_sysselct
10885 : Define hasfield macro for Configure internal use
10886 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10887 while $test $# -ge 2; do
10889 $define) echo "#include <$2>";;
10893 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10895 if eval $compile; then
10904 : see if we should include time.h, sys/time.h, or both
10906 if test "X$timeincl" = X; then
10907 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10908 $echo $n "I'm now running the test program...$c"
10910 #include <sys/types.h>
10915 #ifdef SYSTIMEKERNEL
10918 #include <sys/time.h>
10921 #include <sys/select.h>
10923 #$i_stdlib I_STDLIB
10925 #include <stdlib.h>
10931 struct timeval bar;
10934 struct timezone tzp;
10936 if (foo.tm_sec == foo.tm_sec)
10939 if (bar.tv_sec == bar.tv_sec)
10946 for s_timezone in '-DS_TIMEZONE' ''; do
10948 for s_timeval in '-DS_TIMEVAL' ''; do
10949 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10950 for i_time in '' '-DI_TIME'; do
10951 for i_systime in '-DI_SYSTIME' ''; do
10954 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10955 if eval $compile; then
10956 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10960 $echo $n "Succeeded with $flags$c"
10972 *SYSTIMEKERNEL*) i_systimek="$define"
10973 timeincl=`./findhdr sys/time.h`
10974 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10975 *) i_systimek="$undef";;
10978 *I_TIME*) i_time="$define"
10979 timeincl=`./findhdr time.h`" $timeincl"
10980 echo "We'll include <time.h>." >&4;;
10981 *) i_time="$undef";;
10984 *I_SYSTIME*) i_systime="$define"
10985 timeincl=`./findhdr sys/time.h`" $timeincl"
10986 echo "We'll include <sys/time.h>." >&4;;
10987 *) i_systime="$undef";;
10991 : see if struct tm knows about tm_zone
10992 case "$i_systime$i_time" in
10995 echo "Checking to see if your struct tm has tm_zone field..." >&4
10996 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
11004 case "$d_tm_tm_zone" in
11005 "$define") echo "Yes, it does." ;;
11006 *) echo "No, it doesn't." ;;
11008 : see if struct tm knows about tm_gmtoff
11009 case "$i_systime$i_time" in
11012 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
11013 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
11021 case "$d_tm_tm_gmtoff" in
11022 "$define") echo "Yes, it does." ;;
11023 *) echo "No, it doesn't." ;;
11026 : see if asctime_r exists
11027 set asctime_r d_asctime_r
11029 case "$d_asctime_r" in
11031 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11032 case "$d_asctime_r_proto:$usethreads" in
11033 ":define") d_asctime_r_proto=define
11034 set d_asctime_r_proto asctime_r $hdrs
11038 case "$d_asctime_r_proto" in
11040 case "$asctime_r_proto" in
11041 ''|0) try='char* asctime_r(const struct tm*, char*);'
11042 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
11044 case "$asctime_r_proto" in
11045 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
11046 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
11048 case "$asctime_r_proto" in
11049 ''|0) try='int asctime_r(const struct tm*, char*);'
11050 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
11052 case "$asctime_r_proto" in
11053 ''|0) try='int asctime_r(const struct tm*, char*, int);'
11054 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
11056 case "$asctime_r_proto" in
11057 ''|0) d_asctime_r=undef
11059 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
11060 * ) case "$asctime_r_proto" in
11061 REENTRANT_PROTO*) ;;
11062 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
11064 echo "Prototype: $try" ;;
11067 *) case "$usethreads" in
11068 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11075 *) asctime_r_proto=0
11079 : see if asinh exists
11083 : see if atanh exists
11087 : see if atolf exists
11091 : see if atoll exists
11095 : Look for GCC-style attribute format
11096 case "$d_attribute_format" in
11099 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11100 $cat >attrib.c <<'EOCP'
11102 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11104 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11105 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11106 echo "Your C compiler doesn't support __attribute__((format))."
11109 echo "Your C compiler supports __attribute__((format))."
11113 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11117 *) val="$d_attribute_format" ;;
11119 set d_attribute_format
11123 : Look for GCC-style attribute format with null format allowed
11124 case "$d_printf_format_null" in
11125 '') case "$d_attribute_format" in
11128 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11129 $cat >attrib.c <<EOCP
11131 #$i_stdlib I_STDLIB
11133 #include <stdlib.h>
11135 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11136 int null_printf (char* pat,...) { return (int)pat; }
11137 int main () { exit(null_printf(NULL)); }
11139 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11140 : run the executable in case it produces a run-time warning
11141 if $run ./attrib >>attrib.out 2>&1; then
11142 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11143 echo "Your C compiler doesn't allow __printf__ format to be null."
11146 echo "Your C compiler allows __printf__ format to be null."
11150 echo "Your C compiler executable failed with __printf__ format null."
11154 echo "Your C compiler fails with __printf__ format null."
11161 *) val="$d_printf_format_null" ;;
11163 set d_printf_format_null
11167 : Look for GCC-style attribute malloc
11168 case "$d_attribute_malloc" in
11171 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11172 $cat >attrib.c <<'EOCP'
11174 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11176 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11177 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11178 echo "Your C compiler doesn't support __attribute__((malloc))."
11181 echo "Your C compiler supports __attribute__((malloc))."
11185 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11189 *) val="$d_attribute_malloc" ;;
11191 set d_attribute_malloc
11195 : Look for GCC-style attribute nonnull
11196 case "$d_attribute_nonnull" in
11199 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11200 $cat >attrib.c <<'EOCP'
11202 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11204 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11205 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11206 echo "Your C compiler doesn't support __attribute__((nonnull))."
11209 echo "Your C compiler supports __attribute__((nonnull))."
11213 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11217 *) val="$d_attribute_nonnull" ;;
11219 set d_attribute_nonnull
11223 : Look for GCC-style attribute noreturn
11224 case "$d_attribute_noreturn" in
11227 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11228 $cat >attrib.c <<'EOCP'
11230 void fall_over_dead( void ) __attribute__((noreturn));
11232 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11233 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11234 echo "Your C compiler doesn't support __attribute__((noreturn))."
11237 echo "Your C compiler supports __attribute__((noreturn))."
11241 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11245 *) val="$d_attribute_noreturn" ;;
11247 set d_attribute_noreturn
11251 : Look for GCC-style attribute pure
11252 case "$d_attribute_pure" in
11255 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11256 $cat >attrib.c <<'EOCP'
11258 int square( int n ) __attribute__((pure));
11260 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11261 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11262 echo "Your C compiler doesn't support __attribute__((pure))."
11265 echo "Your C compiler supports __attribute__((pure))."
11269 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11273 *) val="$d_attribute_pure" ;;
11275 set d_attribute_pure
11279 : Look for GCC-style attribute unused
11280 case "$d_attribute_unused" in
11283 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11284 $cat >attrib.c <<'EOCP'
11286 int do_something( int dummy __attribute__((unused)), int n );
11288 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11289 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11290 echo "Your C compiler doesn't support __attribute__((unused))."
11293 echo "Your C compiler supports __attribute__((unused))."
11297 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11301 *) val="$d_attribute_unused" ;;
11303 set d_attribute_unused
11307 : Look for GCC-style attribute deprecated
11308 case "$d_attribute_deprecated" in
11311 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11312 $cat >attrib.c <<'EOCP'
11314 int I_am_deprecated(void) __attribute__((deprecated));
11316 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11317 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11318 echo "Your C compiler doesn't support __attribute__((deprecated))."
11321 echo "Your C compiler supports __attribute__((deprecated))."
11325 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11329 *) val="$d_attribute_deprecated" ;;
11331 set d_attribute_deprecated
11335 : Look for GCC-style attribute warn_unused_result
11336 case "$d_attribute_warn_unused_result" in
11339 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11340 $cat >attrib.c <<'EOCP'
11342 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11344 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11345 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11346 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11349 echo "Your C compiler supports __attribute__((warn_unused_result))."
11353 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11357 *) val="$d_attribute_warn_unused_result" ;;
11359 set d_attribute_warn_unused_result
11363 : see if bcmp exists
11367 : see if bcopy exists
11371 : see if getpgrp exists
11372 set getpgrp d_getpgrp
11375 case "$d_getpgrp" in
11378 echo "Checking to see which flavor of getpgrp is in use..."
11380 #$i_unistd I_UNISTD
11381 #include <sys/types.h>
11383 # include <unistd.h>
11385 #$i_stdlib I_STDLIB
11387 #include <stdlib.h>
11391 if (getuid() == 0) {
11392 printf("(I see you are running Configure as super-user...)\n");
11395 #ifdef TRY_BSD_PGRP
11396 if (getpgrp(1) == 0)
11405 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11406 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11408 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11409 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11412 echo "I can't seem to compile and run the test program."
11414 xxx="a USG one, i.e. you use getpgrp()."
11416 # SVR4 systems can appear rather BSD-ish.
11417 case "$i_unistd" in
11419 xxx="a BSD one, i.e. you use getpgrp(pid)."
11423 xxx="probably a USG one, i.e. you use getpgrp()."
11428 echo "Assuming your getpgrp is $xxx" >&4
11437 : see if setpgrp exists
11438 set setpgrp d_setpgrp
11441 case "$d_setpgrp" in
11444 echo "Checking to see which flavor of setpgrp is in use..."
11446 #$i_unistd I_UNISTD
11447 #include <sys/types.h>
11449 # include <unistd.h>
11451 #$i_stdlib I_STDLIB
11453 #include <stdlib.h>
11457 if (getuid() == 0) {
11458 printf("(I see you are running Configure as super-user...)\n");
11461 #ifdef TRY_BSD_PGRP
11462 if (-1 == setpgrp(1, 1))
11465 if (setpgrp() != -1)
11471 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11472 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11474 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11475 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11478 echo "(I can't seem to compile and run the test program.)"
11480 xxx="a USG one, i.e. you use setpgrp()."
11482 # SVR4 systems can appear rather BSD-ish.
11483 case "$i_unistd" in
11485 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11489 xxx="probably a USG one, i.e. you use setpgrp()."
11494 echo "Assuming your setpgrp is $xxx" >&4
11503 : Look for GCC-style __builtin_choose_expr
11504 case "$d_builtin_choose_expr" in
11507 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11508 $cat >try.c <<'EOCP'
11509 #include <assert.h>
11510 #include <stdlib.h>
11513 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11516 assert( SYRINX(1) == 2112 );
11517 assert( SYRINX(1) != 5150 );
11518 assert( SYRINX(0) == 5150 );
11519 assert( SYRINX(0) != 2112 );
11520 puts( "All good!" );
11526 if eval $compile && $run ./try; then
11527 echo "Your C compiler supports __builtin_choose_expr."
11530 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11534 *) val="$d_builtin_choose_expr" ;;
11537 set d_builtin_choose_expr
11541 : Look for GCC-style __builtin_expect
11542 case "$d_builtin_expect" in
11545 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11546 $cat >try.c <<'EOCP'
11549 if ( __builtin_expect(n, 0) ) n = 1;
11550 /* Remember shell exit code truth is 0, C truth is non-zero */
11555 if eval $compile && $run ./try; then
11556 echo "Your C compiler supports __builtin_expect."
11559 echo "Your C compiler doesn't seem to understand __builtin_expect."
11563 *) val="$d_builtin_expect" ;;
11566 set d_builtin_expect
11570 : see if bzero exists
11574 : see if stdarg is available
11576 if $test `./findhdr stdarg.h`; then
11577 echo "<stdarg.h> found." >&4
11580 echo "<stdarg.h> NOT found." >&4
11584 : see if varargs is available
11586 if $test `./findhdr varargs.h`; then
11587 echo "<varargs.h> found." >&4
11589 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11592 : set up the varargs testing programs
11593 $cat > varargs.c <<EOP
11595 #include <stdarg.h>
11598 #include <varargs.h>
11602 int f(char *p, ...)
11616 p = va_arg(ap, char *);
11622 $cat > varargs <<EOP
11624 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11633 : now check which varargs header should be included
11639 if `./varargs I_STDARG`; then
11641 elif `./varargs I_VARARGS`; then
11646 if `./varargs I_VARARGS`; then
11654 echo "*** WHOA THERE!!! ***" >&4
11655 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11656 case "$knowitall" in
11658 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11662 echo "I could not find the definition for va_dcl... You have problems..." >&4
11663 val="$undef"; set i_stdarg; eval $setvar
11664 val="$undef"; set i_varargs; eval $setvar
11669 case "$i_varhdr" in
11671 val="$define"; set i_stdarg; eval $setvar
11672 val="$undef"; set i_varargs; eval $setvar
11675 val="$undef"; set i_stdarg; eval $setvar
11676 val="$define"; set i_varargs; eval $setvar
11679 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11683 : see if the Compiler supports C99 variadic macros
11684 case "$i_stdarg$i_stdlib" in
11686 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11689 #include <stdarg.h>
11691 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11695 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11701 if eval $compile && $run ./try 2>&1 >/dev/null; then
11702 case "`$run ./try`" in
11704 echo "You have C99 variadic macros." >&4
11705 d_c99_variadic_macros="$define"
11708 echo "You don't have functional C99 variadic macros." >&4
11709 d_c99_variadic_macros="$undef"
11713 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11714 d_c99_variadic_macros="$undef"
11719 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11720 d_c99_variadic_macros="$undef"
11724 : see if signal is declared as pointer to function returning int or void
11726 xxx=`./findhdr signal.h`
11727 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11728 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11729 echo "You have int (*signal())() instead of void." >&4
11731 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11732 echo "You have void (*signal())()." >&4
11734 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11735 echo "You have int (*signal())() instead of void." >&4
11737 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11738 echo "You have void (*signal())()." >&4
11741 case "$d_voidsig" in
11743 echo "I can't determine whether signal handler returns void or int..." >&4
11745 rp="What type does your signal handler return?"
11748 v*) val="$define";;
11752 echo "As you already told me, signal handler returns void." >&4
11755 *) echo "As you already told me, signal handler returns int." >&4
11762 case "$d_voidsig" in
11763 "$define") signal_t="void";;
11764 *) signal_t="int";;
11768 : check for ability to cast large floats to 32-bit ints.
11770 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11771 if $test "$intsize" -ge 4; then
11778 #$i_stdlib I_STDLIB
11780 #include <stdlib.h>
11782 #include <sys/types.h>
11783 #include <signal.h>
11784 $signal_t blech(int s) { exit(3); }
11791 signal(SIGFPE, blech);
11793 /* Don't let compiler optimize the test away. Store the number
11794 in a writable string for gcc to pass to sscanf under HP-UX.
11796 sprintf(str, "2147483647");
11797 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11801 /* x86 processors will probably give 0x8000 0000, which is a
11802 sign change. We don't want that. We want to mimic SPARC
11803 behavior here, which is to preserve the sign and give
11806 if (i32 != ($xxx) f)
11812 if eval $compile_ok; then
11813 $run ./try 2>/dev/null
11816 echo "(I can't seem to compile the test program--assuming it can't)"
11821 echo "Yup, it can."
11824 echo "Nope, it can't."
11831 : check for ability to cast negative floats to unsigned
11833 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11836 #$i_stdlib I_STDLIB
11838 #include <stdlib.h>
11840 #include <sys/types.h>
11841 #include <signal.h>
11842 $signal_t blech(int s) { exit(7); }
11843 $signal_t blech_in_list(int s) { exit(4); }
11844 unsigned long dummy_long(unsigned long p) { return p; }
11845 unsigned int dummy_int(unsigned int p) { return p; }
11846 unsigned short dummy_short(unsigned short p) { return p; }
11850 unsigned long along;
11852 unsigned short ashort;
11856 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11857 a direct f = -123. assignment. gcc-2.8.0 reportedly
11858 optimized the whole file away
11860 /* Store the number in a writable string for gcc to pass to
11861 sscanf under HP-UX.
11863 sprintf(str, "-123");
11864 sscanf(str, "%lf", &f); /* f = -123.; */
11866 signal(SIGFPE, blech);
11867 along = (unsigned long)f;
11868 aint = (unsigned int)f;
11869 ashort = (unsigned short)f;
11870 if (along != (unsigned long)-123)
11872 if (aint != (unsigned int)-123)
11874 if (ashort != (unsigned short)-123)
11876 sprintf(str, "1073741824.");
11877 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11880 along = (unsigned long)f;
11881 if (along != 0x80000000)
11885 along = (unsigned long)f;
11886 if (along != 0x7fffffff)
11890 along = (unsigned long)f;
11891 if (along != 0x80000001)
11895 signal(SIGFPE, blech_in_list);
11896 sprintf(str, "123.");
11897 sscanf(str, "%lf", &f); /* f = 123.; */
11898 along = dummy_long((unsigned long)f);
11899 aint = dummy_int((unsigned int)f);
11900 ashort = dummy_short((unsigned short)f);
11901 if (along != (unsigned long)123)
11903 if (aint != (unsigned int)123)
11905 if (ashort != (unsigned short)123)
11912 if eval $compile_ok; then
11913 $run ./try 2>/dev/null
11916 echo "(I can't seem to compile the test program--assuming it can't)"
11919 case "$castflags" in
11921 echo "Yup, it can."
11924 echo "Nope, it can't."
11931 : see if cbrt exists
11935 : see if vprintf exists
11937 if set vprintf val -f d_vprintf; eval $csym; $val; then
11938 echo 'vprintf() found.' >&4
11941 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11942 #$i_varargs I_VARARGS
11944 #$i_stdlib I_STDLIB
11945 #$i_unistd I_UNISTD
11948 # include <stdarg.h>
11949 #else /* I_VARARGS */
11950 # include <varargs.h>
11954 # include <unistd.h>
11958 # include <stdlib.h>
11961 #include <stdio.h> /* vsprintf prototype */
11964 void xxx(int n, ...)
11969 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11971 int main() { xxx(1, "foo"); }
11973 #else /* I_VARARGS */
11981 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11983 int main() { xxx("foo"); }
11989 if eval $compile_ok; then
11990 if $run ./try; then
11991 echo "Your vsprintf() returns (int)." >&4
11994 echo "Your vsprintf() returns (char*)." >&4
11998 echo 'I am unable to compile the vsprintf() test program.' >&4
11999 # We shouldn't get here. If we do, assume the standard signature,
12000 # not the old BSD one.
12001 echo 'Guessing that vsprintf() returns (int).' >&4
12005 echo 'vprintf() NOT found.' >&4
12016 : see if chown exists
12020 : see if chroot exists
12021 set chroot d_chroot
12024 : see if chsize exists
12025 set chsize d_chsize
12028 : see if class exists
12032 : see if clearenv exists
12033 set clearenv d_clearenv
12036 : Define hasstruct macro for Configure internal use
12037 hasstruct='varname=$1; struct=$2; shift; shift;
12038 while $test $# -ge 2; do
12040 $define) echo "#include <$2>";;
12044 echo "int main () { struct $struct foo; }" >> try.c;
12046 if eval $compile; then
12055 : see whether socket exists
12059 $echo $n "Hmm... $c" >&4
12060 if set socket val -f d_socket; eval $csym; $val; then
12061 echo "Looks like you have Berkeley networking support." >&4
12063 if set setsockopt val -f; eval $csym; $val; then
12066 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
12067 d_oldsock="$define"
12070 if $contains socklib libc.list >/dev/null 2>&1; then
12071 echo "Looks like you have Berkeley networking support." >&4
12073 : we will have to assume that it supports the 4.2 BSD interface
12076 echo "You don't have Berkeley networking in libc$_a..." >&4
12077 if test "X$d_socket" = "X$define"; then
12078 echo "...but you seem to believe that you have sockets." >&4
12080 for net in net socket
12082 if test -f $sysroot/usr/lib/lib$net$_a; then
12083 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12084 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12085 if $contains socket libc.list >/dev/null 2>&1; then
12090 echo "...but the Wollongong group seems to have hacked it in." >&4
12091 sockethdr="-I$sysroot/usr/netinclude"
12094 echo "Found Berkeley sockets interface in lib$net." >&4
12095 if $contains setsockopt libc.list >/dev/null 2>&1; then
12098 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12099 d_oldsock="$define"
12105 if test "X$d_socket" != "X$define"; then
12106 echo "or anywhere else I see." >&4
12114 : see if socketpair exists
12115 set socketpair d_sockpair
12120 echo "Checking the availability sa_len in the sock struct ..." >&4
12122 #include <sys/types.h>
12123 #include <sys/socket.h>
12125 struct sockaddr sa;
12126 return (sa.sa_len);
12130 set try; if eval $compile; then
12133 set d_sockaddr_sa_len; eval $setvar
12137 echo "Checking the availability struct sockaddr_in6 ..." >&4
12139 #include <sys/types.h>
12140 #include <sys/socket.h>
12141 #include <netinet/in.h>
12143 struct sockaddr_in6 sin6;
12144 return (sin6.sin6_family);
12148 set try; if eval $compile; then
12151 set d_sockaddr_in6; eval $setvar
12155 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12157 #include <sys/types.h>
12158 #include <sys/socket.h>
12159 #include <netinet/in.h>
12161 struct sockaddr_in6 sin6;
12162 return (sin6.sin6_scope_id);
12166 set try; if eval $compile; then
12169 set d_sin6_scope_id; eval $setvar
12173 echo "Checking the availability struct ip_mreq ..." >&4
12175 #include <sys/types.h>
12176 #include <sys/socket.h>
12177 #include <netinet/in.h>
12179 struct ip_mreq mreq;
12180 return (mreq.imr_multiaddr.s_addr);
12184 set try; if eval $compile; then
12187 set d_ip_mreq; eval $setvar
12191 echo "Checking the availability struct ip_mreq_source ..." >&4
12193 #include <sys/types.h>
12194 #include <sys/socket.h>
12195 #include <netinet/in.h>
12197 struct ip_mreq_source mreq;
12198 return (mreq.imr_multiaddr.s_addr);
12202 set try; if eval $compile; then
12205 set d_ip_mreq_source; eval $setvar
12209 echo "Checking the availability struct ipv6_mreq ..." >&4
12211 #include <sys/types.h>
12212 #include <sys/socket.h>
12213 #include <netinet/in.h>
12215 struct ipv6_mreq mreq;
12216 return (mreq.ipv6mr_interface);
12220 set try; if eval $compile; then
12223 set d_ipv6_mreq; eval $setvar
12227 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12229 #include <sys/types.h>
12230 #include <sys/socket.h>
12231 #include <netinet/in.h>
12233 struct ipv6_mreq_source mreq;
12234 return (mreq.imr_multiaddr.s_addr);
12238 set try; if eval $compile; then
12241 set d_ipv6_mreq_source; eval $setvar
12245 echo "Checking the availability of certain socket constants..." >&4
12246 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12247 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12249 #include <sys/types.h>
12250 #include <sys/socket.h>
12256 set try; if eval $compile; then
12259 set d_${enum}; eval $setvar
12263 : see if this is a sys/uio.h system
12264 set sys/uio.h i_sysuio
12267 : Check for cmsghdr support
12269 echo "Checking to see if your system supports struct cmsghdr..." >&4
12270 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12272 case "$d_cmsghdr_s" in
12273 "$define") echo "Yes, it does." ;;
12274 *) echo "No, it doesn't." ;;
12278 : check for const keyword
12280 echo 'Checking to see if your C compiler knows about "const"...' >&4
12281 $cat >const.c <<'EOCP'
12282 typedef struct spug { int drokk; } spug;
12286 const spug y = { 0 };
12289 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12291 echo "Yup, it does."
12294 echo "Nope, it doesn't."
12299 : see if copysign exists
12300 set copysign d_copysign
12303 : see if copysignl exists
12304 set copysignl d_copysignl
12307 : see if crypt exists
12312 $define) cryptlib='' ;;
12313 *) if set crypt val -f d_crypt; eval $csym; $val; then
12314 echo 'crypt() found.' >&4
12318 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12319 if $test -z "$cryptlib"; then
12320 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12324 if $test -z "$cryptlib"; then
12325 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12329 if $test -z "$cryptlib"; then
12330 cryptlib=`./loc libcrypt$_a "" $libpth`
12334 if $test -z "$cryptlib"; then
12335 echo 'crypt() NOT found.' >&4
12346 : see if this is a crypt.h system
12347 set crypt.h i_crypt
12350 : see if crypt_r exists
12351 set crypt_r d_crypt_r
12353 case "$d_crypt_r" in
12355 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12356 case "$d_crypt_r_proto:$usethreads" in
12357 ":define") d_crypt_r_proto=define
12358 set d_crypt_r_proto crypt_r $hdrs
12362 case "$d_crypt_r_proto" in
12364 case "$crypt_r_proto" in
12365 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12366 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12368 case "$crypt_r_proto" in
12369 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12370 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12372 case "$crypt_r_proto" in
12373 ''|0) d_crypt_r=undef
12375 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12376 * ) case "$crypt_r_proto" in
12377 REENTRANT_PROTO*) ;;
12378 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12380 echo "Prototype: $try" ;;
12383 *) case "$usethreads" in
12384 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12395 : get csh whereabouts
12397 'csh') val="$undef" ;;
12398 *) val="$define" ;;
12402 : Respect a hint or command line value for full_csh.
12403 case "$full_csh" in
12404 '') full_csh=$csh ;;
12407 : see if ctermid exists
12408 set ctermid d_ctermid
12411 : see if ctermid_r exists
12412 set ctermid_r d_ctermid_r
12414 case "$d_ctermid_r" in
12416 hdrs="$i_systypes sys/types.h define stdio.h "
12417 case "$d_ctermid_r_proto:$usethreads" in
12418 ":define") d_ctermid_r_proto=define
12419 set d_ctermid_r_proto ctermid_r $hdrs
12423 case "$d_ctermid_r_proto" in
12425 case "$ctermid_r_proto" in
12426 ''|0) try='char* ctermid_r(char*);'
12427 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12429 case "$ctermid_r_proto" in
12430 ''|0) d_ctermid_r=undef
12432 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12433 * ) case "$ctermid_r_proto" in
12434 REENTRANT_PROTO*) ;;
12435 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12437 echo "Prototype: $try" ;;
12440 *) case "$usethreads" in
12441 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12448 *) ctermid_r_proto=0
12452 : see if ctime_r exists
12453 set ctime_r d_ctime_r
12455 case "$d_ctime_r" in
12457 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12458 case "$d_ctime_r_proto:$usethreads" in
12459 ":define") d_ctime_r_proto=define
12460 set d_ctime_r_proto ctime_r $hdrs
12464 case "$d_ctime_r_proto" in
12466 case "$ctime_r_proto" in
12467 ''|0) try='char* ctime_r(const time_t*, char*);'
12468 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12470 case "$ctime_r_proto" in
12471 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12472 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12474 case "$ctime_r_proto" in
12475 ''|0) try='int ctime_r(const time_t*, char*);'
12476 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12478 case "$ctime_r_proto" in
12479 ''|0) try='int ctime_r(const time_t*, char*, int);'
12480 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12482 case "$ctime_r_proto" in
12483 ''|0) d_ctime_r=undef
12485 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12486 * ) case "$ctime_r_proto" in
12487 REENTRANT_PROTO*) ;;
12488 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12490 echo "Prototype: $try" ;;
12493 *) case "$usethreads" in
12494 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12505 : see if cuserid exists
12506 set cuserid d_cuserid
12509 : see if this is a limits.h system
12510 set limits.h i_limits
12513 : See if number of significant digits in a double precision number is known
12515 $cat >dbl_dig.c <<EOM
12516 #$i_limits I_LIMITS
12519 #include <limits.h>
12525 printf("Contains DBL_DIG");
12528 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12529 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12530 echo "DBL_DIG found." >&4
12533 echo "DBL_DIG NOT found." >&4
12540 : see if dbm.h is available
12541 : see if dbmclose exists
12542 set dbmclose d_dbmclose
12545 case "$d_dbmclose" in
12555 *) set rpcsvc/dbm.h i_rpcsvcdbm
12560 *) echo "We won't be including <dbm.h>"
12570 : see if prototype for dbminit is available
12572 set d_dbminitproto dbminit $i_dbm dbm.h
12575 : see if difftime exists
12576 set difftime d_difftime
12579 : see if this is a dirent system
12581 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12583 echo "<dirent.h> found." >&4
12586 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12587 echo "<sys/dir.h> found." >&4
12590 xinc=`./findhdr sys/ndir.h`
12592 echo "<dirent.h> NOT found." >&4
12597 : Look for type of directory structure.
12599 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12601 case "$direntrytype" in
12603 case "$i_dirent" in
12604 $define) guess1='struct dirent' ;;
12605 *) guess1='struct direct' ;;
12608 *) guess1="$direntrytype"
12613 'struct dirent') guess2='struct direct' ;;
12614 *) guess2='struct dirent' ;;
12617 if $contains "$guess1" try.c >/dev/null 2>&1; then
12618 direntrytype="$guess1"
12619 echo "Your directory entries are $direntrytype." >&4
12620 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12621 direntrytype="$guess2"
12622 echo "Your directory entries seem to be $direntrytype." >&4
12624 echo "I don't recognize your system's directory entries." >&4
12625 rp="What type is used for directory entries on this system?"
12628 direntrytype="$ans"
12632 : see if the directory entry stores field length
12634 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12635 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12636 echo "Good, your directory entry keeps length information in d_namlen." >&4
12639 echo "Your directory entry does not know about the d_namlen field." >&4
12646 : Look for DIR.dd_fd
12647 case "$i_dirent" in
12649 echo "Checking to see if DIR has a dd_fd member variable" >&4
12651 #$i_stdlib I_STDLIB
12653 #include <stdlib.h>
12655 #include <dirent.h>
12665 if eval $compile; then
12666 echo "Yes, it does."
12669 echo "No, it does not."
12674 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12682 : see if this is an sysdir system
12683 set sys/dir.h i_sysdir
12686 : see if this is an sysndir system
12687 set sys/ndir.h i_sysndir
12692 $cat >dirfd.c <<EOM
12694 #$i_stdlib I_STDLIB
12696 #include <stdlib.h>
12698 #$i_dirent I_DIRENT /**/
12699 #$i_sysdir I_SYS_DIR /**/
12700 #$i_sysndir I_SYS_NDIR /**/
12701 #$i_systypes I_SYS_TYPES /**/
12702 #if defined(I_SYS_TYPES)
12703 #include <sys/types.h>
12705 #if defined(I_DIRENT)
12706 #include <dirent.h>
12709 #include <sys/ndir.h>
12713 #include <ndir.h> /* may be wrong in the future */
12715 #include <sys/dir.h>
12721 DIR *dirp = opendir(".");
12722 if (dirfd(dirp) >= 0)
12730 if eval $compile; then
12734 $define) echo "dirfd() found." >&4 ;;
12735 *) echo "dirfd() NOT found." >&4 ;;
12741 : see if dladdr exists
12742 set dladdr d_dladdr
12745 : see if dlerror exists
12748 set dlerror d_dlerror
12752 : see if dlfcn is available
12753 set dlfcn.h i_dlfcn
12756 : Check what extension to use for shared libs
12761 On a few systems, the dynamically loaded modules that perl generates and uses
12762 will need a different extension than shared libs. The default will probably
12768 *) dflt="$dlext" ;;
12770 rp='What is the extension of dynamically loaded modules'
12779 : Check if dlsym need a leading underscore
12785 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12786 $cat >dyna.c <<'EOM'
12793 #$i_stdlib I_STDLIB
12795 #include <stdlib.h>
12799 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12801 #include <sys/types.h>
12806 extern int fred() ;
12815 int mode = RTLD_LAZY ;
12817 handle = dlopen("./dyna.$dlext", mode) ;
12818 if (handle == NULL) {
12823 symbol = dlsym(handle, "fred") ;
12824 if (symbol == NULL) {
12825 /* try putting a leading underscore */
12826 symbol = dlsym(handle, "_fred") ;
12827 if (symbol == NULL) {
12840 : Call the object file tmp-dyna.o in case dlext=o.
12841 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12842 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12843 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12844 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12847 1) echo "Test program failed using dlopen." >&4
12848 echo "Perhaps you should not use dynamic loading." >&4;;
12849 2) echo "Test program failed using dlsym." >&4
12850 echo "Perhaps you should not use dynamic loading." >&4;;
12851 3) echo "dlsym needs a leading underscore" >&4
12853 4) echo "dlsym doesn't need a leading underscore." >&4;;
12856 echo "I can't compile and run the test program." >&4
12857 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12862 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12867 : see if drand48_r exists
12868 set drand48_r d_drand48_r
12870 case "$d_drand48_r" in
12872 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12873 case "$d_drand48_r_proto:$usethreads" in
12874 ":define") d_drand48_r_proto=define
12875 set d_drand48_r_proto drand48_r $hdrs
12879 case "$d_drand48_r_proto" in
12881 case "$drand48_r_proto" in
12882 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12883 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12885 case "$drand48_r_proto" in
12886 ''|0) d_drand48_r=undef
12888 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12889 * ) case "$drand48_r_proto" in
12890 REENTRANT_PROTO*) ;;
12891 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12893 echo "Prototype: $try" ;;
12896 *) case "$usethreads" in
12897 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12904 *) drand48_r_proto=0
12908 : see if prototype for drand48 is available
12910 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12913 : see if dup2 exists
12917 : see if eaccess exists
12918 set eaccess d_eaccess
12921 : see if endgrent exists
12922 set endgrent d_endgrent
12925 : see if this is an grp system
12931 xxx=`./findhdr grp.h`
12932 $cppstdin $cppflags $cppminus < $xxx >$$.h
12934 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12946 set d_grpasswd; eval $setvar
12950 : see if endgrent_r exists
12951 set endgrent_r d_endgrent_r
12953 case "$d_endgrent_r" in
12955 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12956 case "$d_endgrent_r_proto:$usethreads" in
12957 ":define") d_endgrent_r_proto=define
12958 set d_endgrent_r_proto endgrent_r $hdrs
12962 case "$d_endgrent_r_proto" in
12964 case "$endgrent_r_proto" in
12965 ''|0) try='int endgrent_r(FILE**);'
12966 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12968 case "$endgrent_r_proto" in
12969 ''|0) try='void endgrent_r(FILE**);'
12970 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12972 case "$endgrent_r_proto" in
12973 ''|0) d_endgrent_r=undef
12975 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12976 * ) case "$endgrent_r_proto" in
12977 REENTRANT_PROTO*) ;;
12978 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12980 echo "Prototype: $try" ;;
12983 *) case "$usethreads" in
12984 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12991 *) endgrent_r_proto=0
12995 : see if endhostent exists
12996 set endhostent d_endhent
12999 : see if this is a netdb.h system
13000 set netdb.h i_netdb
13003 : see if endhostent_r exists
13004 set endhostent_r d_endhostent_r
13006 case "$d_endhostent_r" in
13008 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13009 case "$d_endhostent_r_proto:$usethreads" in
13010 ":define") d_endhostent_r_proto=define
13011 set d_endhostent_r_proto endhostent_r $hdrs
13015 case "$d_endhostent_r_proto" in
13017 case "$endhostent_r_proto" in
13018 ''|0) try='int endhostent_r(struct hostent_data*);'
13019 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
13021 case "$endhostent_r_proto" in
13022 ''|0) try='void endhostent_r(struct hostent_data*);'
13023 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
13025 case "$endhostent_r_proto" in
13026 ''|0) d_endhostent_r=undef
13027 endhostent_r_proto=0
13028 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
13029 * ) case "$endhostent_r_proto" in
13030 REENTRANT_PROTO*) ;;
13031 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
13033 echo "Prototype: $try" ;;
13036 *) case "$usethreads" in
13037 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
13039 d_endhostent_r=undef
13040 endhostent_r_proto=0
13044 *) endhostent_r_proto=0
13048 : see if endnetent exists
13049 set endnetent d_endnent
13052 : see if endnetent_r exists
13053 set endnetent_r d_endnetent_r
13055 case "$d_endnetent_r" in
13057 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13058 case "$d_endnetent_r_proto:$usethreads" in
13059 ":define") d_endnetent_r_proto=define
13060 set d_endnetent_r_proto endnetent_r $hdrs
13064 case "$d_endnetent_r_proto" in
13066 case "$endnetent_r_proto" in
13067 ''|0) try='int endnetent_r(struct netent_data*);'
13068 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13070 case "$endnetent_r_proto" in
13071 ''|0) try='void endnetent_r(struct netent_data*);'
13072 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13074 case "$endnetent_r_proto" in
13075 ''|0) d_endnetent_r=undef
13076 endnetent_r_proto=0
13077 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13078 * ) case "$endnetent_r_proto" in
13079 REENTRANT_PROTO*) ;;
13080 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13082 echo "Prototype: $try" ;;
13085 *) case "$usethreads" in
13086 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13088 d_endnetent_r=undef
13089 endnetent_r_proto=0
13093 *) endnetent_r_proto=0
13097 : see if endprotoent exists
13098 set endprotoent d_endpent
13101 : see if endprotoent_r exists
13102 set endprotoent_r d_endprotoent_r
13104 case "$d_endprotoent_r" in
13106 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13107 case "$d_endprotoent_r_proto:$usethreads" in
13108 ":define") d_endprotoent_r_proto=define
13109 set d_endprotoent_r_proto endprotoent_r $hdrs
13113 case "$d_endprotoent_r_proto" in
13115 case "$endprotoent_r_proto" in
13116 ''|0) try='int endprotoent_r(struct protoent_data*);'
13117 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13119 case "$endprotoent_r_proto" in
13120 ''|0) try='void endprotoent_r(struct protoent_data*);'
13121 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13123 case "$endprotoent_r_proto" in
13124 ''|0) d_endprotoent_r=undef
13125 endprotoent_r_proto=0
13126 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13127 * ) case "$endprotoent_r_proto" in
13128 REENTRANT_PROTO*) ;;
13129 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13131 echo "Prototype: $try" ;;
13134 *) case "$usethreads" in
13135 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13137 d_endprotoent_r=undef
13138 endprotoent_r_proto=0
13142 *) endprotoent_r_proto=0
13146 : see if endpwent exists
13147 set endpwent d_endpwent
13150 : see if this is a pwd.h system
13156 xxx=`./findhdr pwd.h`
13157 $cppstdin $cppflags $cppminus < $xxx >$$.h
13159 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13167 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13175 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13183 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13191 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13199 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13207 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13215 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13227 set d_pwquota; eval $setvar
13228 set d_pwage; eval $setvar
13229 set d_pwchange; eval $setvar
13230 set d_pwclass; eval $setvar
13231 set d_pwexpire; eval $setvar
13232 set d_pwcomment; eval $setvar
13233 set d_pwgecos; eval $setvar
13234 set d_pwpasswd; eval $setvar
13238 : see if endpwent_r exists
13239 set endpwent_r d_endpwent_r
13241 case "$d_endpwent_r" in
13243 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13244 case "$d_endpwent_r_proto:$usethreads" in
13245 ":define") d_endpwent_r_proto=define
13246 set d_endpwent_r_proto endpwent_r $hdrs
13250 case "$d_endpwent_r_proto" in
13252 case "$endpwent_r_proto" in
13253 ''|0) try='int endpwent_r(FILE**);'
13254 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13256 case "$endpwent_r_proto" in
13257 ''|0) try='void endpwent_r(FILE**);'
13258 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13260 case "$endpwent_r_proto" in
13261 ''|0) d_endpwent_r=undef
13263 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13264 * ) case "$endpwent_r_proto" in
13265 REENTRANT_PROTO*) ;;
13266 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13268 echo "Prototype: $try" ;;
13271 *) case "$usethreads" in
13272 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13279 *) endpwent_r_proto=0
13283 : see if endservent exists
13284 set endservent d_endsent
13287 : see if endservent_r exists
13288 set endservent_r d_endservent_r
13290 case "$d_endservent_r" in
13292 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13293 case "$d_endservent_r_proto:$usethreads" in
13294 ":define") d_endservent_r_proto=define
13295 set d_endservent_r_proto endservent_r $hdrs
13299 case "$d_endservent_r_proto" in
13301 case "$endservent_r_proto" in
13302 ''|0) try='int endservent_r(struct servent_data*);'
13303 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13305 case "$endservent_r_proto" in
13306 ''|0) try='void endservent_r(struct servent_data*);'
13307 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13309 case "$endservent_r_proto" in
13310 ''|0) d_endservent_r=undef
13311 endservent_r_proto=0
13312 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13313 * ) case "$endservent_r_proto" in
13314 REENTRANT_PROTO*) ;;
13315 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13317 echo "Prototype: $try" ;;
13320 *) case "$usethreads" in
13321 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13323 d_endservent_r=undef
13324 endservent_r_proto=0
13328 *) endservent_r_proto=0
13332 : Locate the flags for 'open()'
13335 #include <sys/types.h>
13340 #include <sys/file.h>
13342 #$i_stdlib I_STDLIB
13344 #include <stdlib.h>
13355 : check sys/file.h first to get FREAD on Sun
13356 if $test `./findhdr sys/file.h` && \
13357 set try -DI_SYS_FILE && eval $compile; then
13359 echo "<sys/file.h> defines the O_* constants..." >&4
13360 if $run ./try; then
13361 echo "and you have the 3 argument form of open()." >&4
13364 echo "but not the 3 argument form of open(). Oh, well." >&4
13367 elif $test `./findhdr fcntl.h` && \
13368 set try -DI_FCNTL && eval $compile; then
13370 echo "<fcntl.h> defines the O_* constants..." >&4
13371 if $run ./try; then
13372 echo "and you have the 3 argument form of open()." >&4
13375 echo "but not the 3 argument form of open(). Oh, well." >&4
13380 echo "I can't find the O_* constant definitions! You got problems." >&4
13386 : see if this is a sys/file.h system
13391 : do we need to include sys/file.h ?
13395 if $h_sysfile; then
13397 echo "We'll be including <sys/file.h>." >&4
13400 echo "We won't be including <sys/file.h>." >&4
13410 : see if fcntl.h is there
13415 : see if we can include fcntl.h
13421 echo "We'll be including <fcntl.h>." >&4
13424 if $h_sysfile; then
13425 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13427 echo "We won't be including <fcntl.h>." >&4
13439 : see if fork exists
13443 : see if pipe exists
13447 : check for non-blocking I/O stuff
13448 case "$h_sysfile" in
13449 true) echo "#include <sys/file.h>" > head.c;;
13452 true) echo "#include <fcntl.h>" > head.c;;
13453 *) echo "#include <sys/fcntl.h>" > head.c;;
13458 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13459 case "$o_nonblock" in
13461 $cat head.c > try.c
13462 $cat >>try.c <<EOCP
13464 #$i_stdlib I_STDLIB
13466 #include <stdlib.h>
13474 printf("O_NONBLOCK\n");
13478 printf("O_NDELAY\n");
13482 printf("FNDELAY\n");
13489 if eval $compile_ok; then
13490 o_nonblock=`$run ./try`
13491 case "$o_nonblock" in
13492 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13493 *) echo "Seems like we can use $o_nonblock.";;
13496 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13499 *) echo "Using $hint value $o_nonblock.";;
13504 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13507 case "$d_fork:$d_pipe:$d_alarm" in
13508 define:define:define)
13509 $cat head.c > try.c
13510 $cat >>try.c <<EOCP
13512 #include <sys/types.h>
13513 #include <signal.h>
13515 #$i_stdlib I_STDLIB
13517 #include <stdlib.h>
13523 #define MY_O_NONBLOCK $o_nonblock
13524 #ifndef errno /* XXX need better Configure test */
13527 #$i_unistd I_UNISTD
13529 #include <unistd.h>
13531 #$i_string I_STRING
13533 #include <string.h>
13535 #include <strings.h>
13537 $signal_t blech(int x) { exit(3); }
13539 $cat >> try.c <<'EOCP'
13548 ret = pipe(pd); /* Down: child -> parent */
13551 ret = pipe(pu); /* Up: parent -> child */
13555 close(pd[1]); /* Parent reads from pd[0] */
13556 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13558 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13563 signal(SIGALRM, blech);
13565 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13567 sprintf(string, "%d\n", ret);
13568 ret = write(2, string, strlen(string));
13569 if (ret != strlen(string))
13573 if (errno == EAGAIN) {
13574 printf("EAGAIN\n");
13579 if (errno == EWOULDBLOCK)
13580 printf("EWOULDBLOCK\n");
13583 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13586 sleep(2); /* Give it time to close our pipe */
13588 ret = read(pd[0], buf, 1); /* Should read EOF */
13590 sprintf(string, "%d\n", ret);
13591 ret = write(4, string, strlen(string));
13592 if (ret != strlen(string))
13597 close(pd[0]); /* We write to pd[1] */
13598 close(pu[1]); /* We read from pu[0] */
13599 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13602 close(pd[1]); /* Pipe pd is now fully closed! */
13603 exit(0); /* Bye bye, thank you for playing! */
13607 if eval $compile_ok; then
13608 echo "$startsh" >mtry
13609 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13611 $run ./mtry >/dev/null 2>&1
13613 0) eagain=`$cat try.out`;;
13614 1) echo "Could not perform non-blocking setting!";;
13615 2) echo "I did a successful read() for something that was not there!";;
13616 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13617 4) echo "Could not find F_SETFL!";;
13618 *) echo "Something terribly wrong happened during testing.";;
13620 rd_nodata=`$cat try.ret`
13621 echo "A read() system call with no data present returns $rd_nodata."
13622 case "$rd_nodata" in
13625 echo "(That's peculiar, fixing that to be -1.)"
13631 echo "Forcing errno EAGAIN on read() with no data available."
13635 echo "Your read() sets errno to $eagain when no data is available."
13638 status=`$cat try.err`
13640 0) echo "And it correctly returns 0 to signal EOF.";;
13641 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13642 *) echo "However, your read() returns '$status' on EOF??";;
13645 if test "$status" = "$rd_nodata"; then
13646 echo "WARNING: you can't distinguish between EOF and no data!"
13650 echo "I can't compile the test program--assuming errno EAGAIN will do."
13654 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13663 echo "Using $hint value $eagain."
13664 echo "Your read() returns $rd_nodata when no data is present."
13665 case "$d_eofnblk" in
13666 "$define") echo "And you can see EOF because read() returns 0.";;
13667 "$undef") echo "But you can't see EOF status from read() returned value.";;
13669 echo "(Assuming you can't see EOF status from read anyway.)"
13675 $rm_try head.c mtry
13677 : see if erf exists
13681 : see if erfc exists
13685 : see if exp2 exists
13689 : see if expm1 exists
13693 : see if _ptr and _cnt from stdio act std
13696 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13697 echo "(Looks like you have stdio.h from BSD.)"
13698 case "$stdio_ptr" in
13699 '') stdio_ptr='((fp)->_p)'
13702 *) ptr_lval=$d_stdio_ptr_lval;;
13704 case "$stdio_cnt" in
13705 '') stdio_cnt='((fp)->_r)'
13708 *) cnt_lval=$d_stdio_cnt_lval;;
13710 case "$stdio_base" in
13711 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13713 case "$stdio_bufsiz" in
13714 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13716 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13717 echo "(Looks like you have stdio.h from Linux.)"
13718 case "$stdio_ptr" in
13719 '') stdio_ptr='((fp)->_IO_read_ptr)'
13722 *) ptr_lval=$d_stdio_ptr_lval;;
13724 case "$stdio_cnt" in
13725 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13728 *) cnt_lval=$d_stdio_cnt_lval;;
13730 case "$stdio_base" in
13731 '') stdio_base='((fp)->_IO_read_base)';;
13733 case "$stdio_bufsiz" in
13734 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13737 case "$stdio_ptr" in
13738 '') stdio_ptr='((fp)->_ptr)'
13741 *) ptr_lval=$d_stdio_ptr_lval;;
13743 case "$stdio_cnt" in
13744 '') stdio_cnt='((fp)->_cnt)'
13747 *) cnt_lval=$d_stdio_cnt_lval;;
13749 case "$stdio_base" in
13750 '') stdio_base='((fp)->_base)';;
13752 case "$stdio_bufsiz" in
13753 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13757 : test whether _ptr and _cnt really work
13758 echo "Checking how std your stdio is..." >&4
13761 #$i_stdlib I_STDLIB
13763 #include <stdlib.h>
13765 #define FILE_ptr(fp) $stdio_ptr
13766 #define FILE_cnt(fp) $stdio_cnt
13768 FILE *fp = fopen("try.c", "r");
13771 18 <= FILE_cnt(fp) &&
13772 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13780 if eval $compile && $to try.c; then
13781 if $run ./try; then
13782 echo "Your stdio acts pretty std."
13785 echo "Your stdio isn't very std."
13788 echo "Your stdio doesn't appear very std."
13792 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13793 # direct buffer manipulation no longer works. The Configure tests
13794 # should be changed to correctly detect this, but until then,
13795 # the following check should at least let perl compile and run.
13796 # (This quick fix should be updated before 5.8.1.)
13797 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13798 # A. Dougherty, June 3, 2002.
13799 case "$d_gnulibc" in
13801 case "$gnulibc_version" in
13805 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13814 : Can _ptr be used as an lvalue?
13815 case "$d_stdstdio$ptr_lval" in
13816 $define$define) val=$define ;;
13819 set d_stdio_ptr_lval
13822 : Can _cnt be used as an lvalue?
13823 case "$d_stdstdio$cnt_lval" in
13824 $define$define) val=$define ;;
13827 set d_stdio_cnt_lval
13831 : test whether setting _ptr sets _cnt as a side effect
13832 d_stdio_ptr_lval_sets_cnt="$undef"
13833 d_stdio_ptr_lval_nochange_cnt="$undef"
13834 case "$d_stdio_ptr_lval$d_stdstdio" in
13836 echo "Checking to see what happens if we set the stdio ptr..." >&4
13839 /* Can we scream? */
13840 /* Eat dust sed :-) */
13841 /* In the buffer space, no one can hear you scream. */
13842 #$i_stdlib I_STDLIB
13844 #include <stdlib.h>
13846 #define FILE_ptr(fp) $stdio_ptr
13847 #define FILE_cnt(fp) $stdio_cnt
13848 #include <sys/types.h>
13850 FILE *fp = fopen("try.c", "r");
13855 puts("Fail even to read");
13858 c = getc(fp); /* Read away the first # */
13860 puts("Fail even to read");
13864 18 <= FILE_cnt(fp) &&
13865 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13867 puts("Fail even to read");
13870 ptr = (char*) FILE_ptr(fp);
13871 cnt = (size_t)FILE_cnt(fp);
13873 FILE_ptr(fp) += 42;
13875 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13876 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13879 if (FILE_cnt(fp) <= 20) {
13880 printf ("Fail (<20 chars to test)");
13883 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13884 puts("Fail compare");
13887 if (cnt == FILE_cnt(fp)) {
13888 puts("Pass_unchanged");
13891 if (FILE_cnt(fp) == (cnt - 42)) {
13892 puts("Pass_changed");
13895 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13901 if eval $compile && $to try.c; then
13902 case `$run ./try` in
13904 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13905 d_stdio_ptr_lval_sets_cnt="$define" ;;
13907 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13908 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13910 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13912 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13915 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13921 : see if _base is also standard
13923 case "$d_stdstdio" in
13927 #$i_stdlib I_STDLIB
13929 #include <stdlib.h>
13931 #define FILE_base(fp) $stdio_base
13932 #define FILE_bufsiz(fp) $stdio_bufsiz
13934 FILE *fp = fopen("try.c", "r");
13937 19 <= FILE_bufsiz(fp) &&
13938 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13945 if eval $compile && $to try.c; then
13946 if $run ./try; then
13947 echo "And its _base field acts std."
13950 echo "But its _base field isn't std."
13953 echo "However, it seems to be lacking the _base field."
13961 : see if fast_stdio exists
13963 case "$d_stdstdio:$d_stdio_ptr_lval" in
13965 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13967 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13978 : see if fchdir exists
13979 set fchdir d_fchdir
13982 : see if fchmod exists
13983 set fchmod d_fchmod
13986 : check for openat, unlinkat, renameat, linkat, fchmodat
13987 set openat d_openat
13990 set unlinkat d_unlinkat
13993 set renameat d_renameat
13996 set linkat d_linkat
13999 set fchmodat d_fchmodat
14002 : see if fchown exists
14003 set fchown d_fchown
14006 : see if this is an fcntl system
14010 : See if fcntl-based locking works.
14013 #$i_stdlib I_STDLIB
14015 #include <stdlib.h>
14017 #include <unistd.h>
14019 #include <signal.h>
14020 $signal_t blech(int x) { exit(3); }
14022 #if defined(F_SETLK) && defined(F_SETLKW)
14023 struct flock flock;
14025 fd = open("try.c", O_RDONLY);
14026 flock.l_type = F_RDLCK;
14027 flock.l_whence = SEEK_SET;
14028 flock.l_start = flock.l_len = 0;
14029 signal(SIGALRM, blech);
14031 retval = fcntl(fd, F_SETLK, &flock);
14033 (retval < 0 ? exit(2) : exit(0));
14039 echo "Checking if fcntl-based file locking works... "
14043 if eval $compile_ok; then
14044 if $run ./try; then
14045 echo "Yes, it seems to work."
14048 echo "Nope, it didn't work."
14053 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
14054 *** This is (almost) impossible.
14055 *** If your NFS lock daemons are not feeling well, something like
14056 *** this may happen, please investigate. Cannot continue, aborting.
14064 echo "I'm unable to compile the test program, so I'll assume not."
14069 echo "Nope, since you don't even have fcntl()."
14072 set d_fcntl_can_lock
14076 : check for fd_set items
14079 Checking to see how well your C compiler handles fd_set and friends ...
14082 #$i_stdlib I_STDLIB
14084 #include <stdlib.h>
14086 #$i_systime I_SYS_TIME
14087 #$i_sysselct I_SYS_SELECT
14088 #$d_socket HAS_SOCKET
14089 #include <sys/types.h>
14091 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14094 #include <sys/time.h>
14096 #ifdef I_SYS_SELECT
14097 #include <sys/select.h>
14106 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14114 if eval $compile; then
14115 d_fds_bits="$define"
14117 echo "Well, your system knows about the normal fd_set typedef..." >&4
14118 if $run ./try; then
14119 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14120 d_fd_macros="$define"
14123 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14125 d_fd_macros="$undef"
14129 Hmm, your compiler has some difficulty with fd_set. Checking further...
14132 if eval $compile; then
14133 d_fds_bits="$undef"
14135 echo "Well, your system has some sort of fd_set available..." >&4
14136 if $run ./try; then
14137 echo "and you have the normal fd_set macros." >&4
14138 d_fd_macros="$define"
14141 but not the normal fd_set macros! Gross! More work for me...
14143 d_fd_macros="$undef"
14146 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14148 d_fds_bits="$undef"
14149 d_fd_macros="$undef"
14154 : see if fdclose exists
14155 set fdclose d_fdclose
14158 : see if fdim exists
14162 : see if fegetround exists
14163 set fegetround d_fegetround
14166 : see if fgetpos exists
14167 set fgetpos d_fgetpos
14170 : see if finite exists
14171 set finite d_finite
14174 : see if finitel exists
14175 set finitel d_finitel
14178 : see if flock exists
14182 : see if prototype for flock is available
14184 set d_flockproto flock $i_sysfile sys/file.h
14187 : see if fma exists
14191 : see if fmax exists
14195 : see if fmin exists
14199 : see if fp_class exists
14200 set fp_class d_fp_class
14203 : see if this is a math.h system
14207 : check for fpclassify
14208 echo "Checking to see if you have fpclassify..." >&4
14214 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14217 if eval $compile; then
14219 echo "You have fpclassify."
14222 echo "You do not have fpclassify."
14228 : see if fp_classify exists
14229 set fp_classify d_fp_classify
14232 : see if fp_classl exists
14233 set fp_classl d_fp_classl
14236 : see if pathconf exists
14237 set pathconf d_pathconf
14240 : see if fpathconf exists
14241 set fpathconf d_fpathconf
14244 : see if fpclass exists
14245 set fpclass d_fpclass
14248 : see if fpclassl exists
14249 set fpclassl d_fpclassl
14252 : see if fpgetround exists
14253 set fpgetround d_fpgetround
14256 : check for fpos64_t
14258 echo "Checking to see if you have fpos64_t..." >&4
14261 int main() { fpos64_t x = 7; }
14264 if eval $compile; then
14266 echo "You have fpos64_t."
14269 echo "You do not have fpos64_t."
14270 case "$fpossize" in
14271 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14278 : see if this is an xlocale.h system
14279 set xlocale.h i_xlocale
14282 : see if newlocale exists
14283 set newlocale d_newlocale
14286 : see if freelocale exists
14287 set freelocale d_freelocale
14290 : see if uselocale exists
14291 set uselocale d_uselocale
14294 : see if duplocale exists
14295 set duplocale d_duplocale
14298 : see if querylocale exists
14299 set querylocale d_querylocale
14302 : see if frexpl exists
14303 set frexpl d_frexpl
14306 : see if this is a sys/param system
14307 set sys/param.h i_sysparam
14310 : see if this is a sys/mount.h system
14311 set sys/mount.h i_sysmount
14314 : Check for fs_data_s
14316 echo "Checking to see if your system supports struct fs_data..." >&4
14317 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14319 case "$d_fs_data_s" in
14320 "$define") echo "Yes, it does." ;;
14321 *) echo "No, it doesn't." ;;
14324 : see if fseeko exists
14325 set fseeko d_fseeko
14327 case "$longsize" in
14328 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14331 : see if fsetpos exists
14332 set fsetpos d_fsetpos
14335 : see if fstatfs exists
14336 set fstatfs d_fstatfs
14339 : see if statvfs exists
14340 set statvfs d_statvfs
14343 : see if fstatvfs exists
14344 set fstatvfs d_fstatvfs
14348 : see if fsync exists
14352 : see if ftello exists
14353 set ftello d_ftello
14355 case "$longsize" in
14356 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14359 : check for a working futimes
14362 echo "Checking if you have a working futimes()" >&4
14365 #include <sys/time.h>
14372 fd = open ("try.c", O_RDWR);
14373 if (-1 == fd) exit (1);
14374 rv = futimes (fd, NULL);
14375 exit (rv == -1 ? errno : 0);
14379 if eval $compile; then
14383 0) echo "Yes, you have" >&4
14384 d_futimes="$define"
14386 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14390 echo "No, it does not (probably harmless)" >&4
14394 : look for gai_strerror
14396 $cat >try.c <<'EOCP'
14397 #include <sys/types.h>
14398 #include <sys/socket.h>
14402 return (gai_strerror (0) ? 0 : 1);
14407 if eval $compile; then
14410 0) echo "A working gai_strerror() found." >&4
14412 *) echo "gai_strerror() found, but it doesn't work" >&4
14416 echo "gai_strerror() NOT found." >&4
14422 : see if ndbm.h is available
14425 : Compatibility location for RedHat 7.1
14426 set gdbm/ndbm.h i_gdbmndbm
14428 : Compatibility location for Debian 4.0
14429 set gdbm-ndbm.h i_gdbm_ndbm
14433 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14434 : see if dbm_open exists
14435 set dbm_open d_dbm_open
14437 case "$d_dbm_open" in
14440 i_gdbmndbm="$undef"
14441 i_gdbm_ndbm="$undef"
14442 echo "We won't be including <ndbm.h>"
14452 ndbm_hdr_protochk='name=$1; hdr=$2;
14453 eval "ihdr=\$""i_$name";
14455 if $test "$ihdr" = "$define"; then
14456 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14457 case "$d_cplusplus" in
14458 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14459 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14462 $define) $echo "Your <$hdr> seems to have prototypes";;
14463 *) $echo "Your <$hdr> does not seem to have prototypes";;
14466 set "d_${name}_h_uses_prototypes";
14470 eval $ndbm_hdr_protochk
14471 set gdbmndbm gdbm/ndbm.h
14472 eval $ndbm_hdr_protochk
14473 set gdbm_ndbm gdbm-ndbm.h
14474 eval $ndbm_hdr_protochk
14476 : see if getaddrinfo exists
14477 set getaddrinfo d_getaddrinfo
14480 : see if getcwd exists
14481 set getcwd d_getcwd
14484 : see if getespwnam exists
14485 set getespwnam d_getespwnam
14488 : see if getfsstat exists
14489 set getfsstat d_getfsstat
14492 : see if getgrent exists
14493 set getgrent d_getgrent
14496 : see if getgrent_r exists
14497 set getgrent_r d_getgrent_r
14499 case "$d_getgrent_r" in
14501 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14502 case "$d_getgrent_r_proto:$usethreads" in
14503 ":define") d_getgrent_r_proto=define
14504 set d_getgrent_r_proto getgrent_r $hdrs
14508 case "$d_getgrent_r_proto" in
14510 case "$getgrent_r_proto" in
14511 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14512 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14514 case "$getgrent_r_proto" in
14515 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14516 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14518 case "$getgrent_r_proto" in
14519 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14520 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14522 case "$getgrent_r_proto" in
14523 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14524 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14526 case "$getgrent_r_proto" in
14527 ''|0) try='int getgrent_r(struct group*, char*, int);'
14528 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14530 case "$getgrent_r_proto" in
14531 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14532 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14534 case "$getgrent_r_proto" in
14535 ''|0) d_getgrent_r=undef
14537 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14538 * ) case "$getgrent_r_proto" in
14539 REENTRANT_PROTO*) ;;
14540 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14542 echo "Prototype: $try" ;;
14545 *) case "$usethreads" in
14546 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14553 *) getgrent_r_proto=0
14557 : see if getgrgid_r exists
14558 set getgrgid_r d_getgrgid_r
14560 case "$d_getgrgid_r" in
14562 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14563 case "$d_getgrgid_r_proto:$usethreads" in
14564 ":define") d_getgrgid_r_proto=define
14565 set d_getgrgid_r_proto getgrgid_r $hdrs
14569 case "$d_getgrgid_r_proto" in
14571 case "$getgrgid_r_proto" in
14572 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14573 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14575 case "$getgrgid_r_proto" in
14576 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14577 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14579 case "$getgrgid_r_proto" in
14580 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14581 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14583 case "$getgrgid_r_proto" in
14584 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14585 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14587 case "$getgrgid_r_proto" in
14588 ''|0) d_getgrgid_r=undef
14590 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14591 * ) case "$getgrgid_r_proto" in
14592 REENTRANT_PROTO*) ;;
14593 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14595 echo "Prototype: $try" ;;
14598 *) case "$usethreads" in
14599 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14606 *) getgrgid_r_proto=0
14610 : see if getgrnam_r exists
14611 set getgrnam_r d_getgrnam_r
14613 case "$d_getgrnam_r" in
14615 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14616 case "$d_getgrnam_r_proto:$usethreads" in
14617 ":define") d_getgrnam_r_proto=define
14618 set d_getgrnam_r_proto getgrnam_r $hdrs
14622 case "$d_getgrnam_r_proto" in
14624 case "$getgrnam_r_proto" in
14625 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14626 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14628 case "$getgrnam_r_proto" in
14629 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14630 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14632 case "$getgrnam_r_proto" in
14633 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14634 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14636 case "$getgrnam_r_proto" in
14637 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14638 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14640 case "$getgrnam_r_proto" in
14641 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14642 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14644 case "$getgrnam_r_proto" in
14645 ''|0) d_getgrnam_r=undef
14647 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14648 * ) case "$getgrnam_r_proto" in
14649 REENTRANT_PROTO*) ;;
14650 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14652 echo "Prototype: $try" ;;
14655 *) case "$usethreads" in
14656 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14663 *) getgrnam_r_proto=0
14667 : see if gethostbyaddr exists
14668 set gethostbyaddr d_gethbyaddr
14671 : see if gethostbyname exists
14672 set gethostbyname d_gethbyname
14675 : see if gethostent exists
14676 set gethostent d_gethent
14679 : see how we will look up host name
14682 if set gethostname val -f d_gethname; eval $csym; $val; then
14683 echo 'gethostname() found.' >&4
14684 d_gethname="$define"
14687 if set uname val -f d_uname; eval $csym; $val; then
14690 uname() was found, but you're running xenix, and older versions of xenix
14691 have a broken uname(). If you don't really know whether your xenix is old
14692 enough to have a broken system call, use the default answer.
14697 "$define") dflt=n;;
14699 rp='Is your uname() broken?'
14702 n*) d_uname="$define"; call=uname;;
14705 echo 'uname() found.' >&4
14712 case "$d_gethname" in
14713 '') d_gethname="$undef";;
14716 '') d_uname="$undef";;
14718 case "$d_uname$d_gethname" in
14723 Every now and then someone has a $call() that lies about the hostname
14724 but can't be fixed for political or economic reasons. If you wish, I can
14725 pretend $call() isn't there and maybe compute hostname at run-time
14726 thanks to the '$phostname' command.
14729 rp="Shall I ignore $call() from now on?"
14732 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14735 case "$phostname" in
14736 '') aphostname='';;
14737 *) case "$aphostname" in
14739 *) set X $phostname
14743 file=`./loc $file $file $pth`
14744 aphostname=`echo $file $*`
14749 case "$d_uname$d_gethname" in
14752 case "$phostname" in
14754 echo "There will be no way for $package to get your hostname." >&4;;
14756 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14760 case "$d_phostname" in
14761 '') d_phostname="$undef";;
14764 : see if gethostbyaddr_r exists
14765 set gethostbyaddr_r d_gethostbyaddr_r
14767 case "$d_gethostbyaddr_r" in
14769 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14770 case "$d_gethostbyaddr_r_proto:$usethreads" in
14771 ":define") d_gethostbyaddr_r_proto=define
14772 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14776 case "$d_gethostbyaddr_r_proto" in
14778 case "$gethostbyaddr_r_proto" in
14779 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14780 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14782 case "$gethostbyaddr_r_proto" in
14783 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14784 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14786 case "$gethostbyaddr_r_proto" in
14787 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14788 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14790 case "$gethostbyaddr_r_proto" in
14791 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14792 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14794 case "$gethostbyaddr_r_proto" in
14795 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14796 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14798 case "$gethostbyaddr_r_proto" in
14799 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14800 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14802 case "$gethostbyaddr_r_proto" in
14803 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14804 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14806 case "$gethostbyaddr_r_proto" in
14807 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14808 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14810 case "$gethostbyaddr_r_proto" in
14811 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14812 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14814 case "$gethostbyaddr_r_proto" in
14815 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14816 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14818 case "$gethostbyaddr_r_proto" in
14819 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14820 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14822 case "$gethostbyaddr_r_proto" in
14823 ''|0) d_gethostbyaddr_r=undef
14824 gethostbyaddr_r_proto=0
14825 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14826 * ) case "$gethostbyaddr_r_proto" in
14827 REENTRANT_PROTO*) ;;
14828 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14830 echo "Prototype: $try" ;;
14833 *) case "$usethreads" in
14834 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14836 d_gethostbyaddr_r=undef
14837 gethostbyaddr_r_proto=0
14841 *) gethostbyaddr_r_proto=0
14845 : see if gethostbyname_r exists
14846 set gethostbyname_r d_gethostbyname_r
14848 case "$d_gethostbyname_r" in
14850 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14851 case "$d_gethostbyname_r_proto:$usethreads" in
14852 ":define") d_gethostbyname_r_proto=define
14853 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14857 case "$d_gethostbyname_r_proto" in
14859 case "$gethostbyname_r_proto" in
14860 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14861 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14863 case "$gethostbyname_r_proto" in
14864 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14865 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14867 case "$gethostbyname_r_proto" in
14868 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14869 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14871 case "$gethostbyname_r_proto" in
14872 ''|0) d_gethostbyname_r=undef
14873 gethostbyname_r_proto=0
14874 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14875 * ) case "$gethostbyname_r_proto" in
14876 REENTRANT_PROTO*) ;;
14877 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14879 echo "Prototype: $try" ;;
14882 *) case "$usethreads" in
14883 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14885 d_gethostbyname_r=undef
14886 gethostbyname_r_proto=0
14890 *) gethostbyname_r_proto=0
14894 : see if gethostent_r exists
14895 set gethostent_r d_gethostent_r
14897 case "$d_gethostent_r" in
14899 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14900 case "$d_gethostent_r_proto:$usethreads" in
14901 ":define") d_gethostent_r_proto=define
14902 set d_gethostent_r_proto gethostent_r $hdrs
14906 case "$d_gethostent_r_proto" in
14908 case "$gethostent_r_proto" in
14909 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14910 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14912 case "$gethostent_r_proto" in
14913 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14914 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14916 case "$gethostent_r_proto" in
14917 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14918 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14920 case "$gethostent_r_proto" in
14921 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14922 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14924 case "$gethostent_r_proto" in
14925 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14926 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14928 case "$gethostent_r_proto" in
14929 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14930 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14932 case "$gethostent_r_proto" in
14933 ''|0) d_gethostent_r=undef
14934 gethostent_r_proto=0
14935 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14936 * ) case "$gethostent_r_proto" in
14937 REENTRANT_PROTO*) ;;
14938 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14940 echo "Prototype: $try" ;;
14943 *) case "$usethreads" in
14944 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14946 d_gethostent_r=undef
14947 gethostent_r_proto=0
14951 *) gethostent_r_proto=0
14955 : see if prototypes for various gethostxxx netdb.h functions are available
14957 set d_gethostprotos gethostent $i_netdb netdb.h
14960 : see if getitimer exists
14961 set getitimer d_getitimer
14964 : see if getlogin exists
14965 set getlogin d_getlogin
14968 : see if getlogin_r exists
14969 set getlogin_r d_getlogin_r
14971 case "$d_getlogin_r" in
14973 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14974 case "$d_getlogin_r_proto:$usethreads" in
14975 ":define") d_getlogin_r_proto=define
14976 set d_getlogin_r_proto getlogin_r $hdrs
14980 case "$d_getlogin_r_proto" in
14982 case "$getlogin_r_proto" in
14983 ''|0) try='int getlogin_r(char*, size_t);'
14984 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14986 case "$getlogin_r_proto" in
14987 ''|0) try='int getlogin_r(char*, int);'
14988 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14990 case "$getlogin_r_proto" in
14991 ''|0) try='char* getlogin_r(char*, size_t);'
14992 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14994 case "$getlogin_r_proto" in
14995 ''|0) try='char* getlogin_r(char*, int);'
14996 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14998 case "$getlogin_r_proto" in
14999 ''|0) d_getlogin_r=undef
15001 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
15002 * ) case "$getlogin_r_proto" in
15003 REENTRANT_PROTO*) ;;
15004 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
15006 echo "Prototype: $try" ;;
15009 *) case "$usethreads" in
15010 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
15017 *) getlogin_r_proto=0
15021 : see if getmnt exists
15022 set getmnt d_getmnt
15025 : see if getmntent exists
15026 set getmntent d_getmntent
15029 : see if getnameinfo exists
15030 set getnameinfo d_getnameinfo
15033 : see if getnetbyaddr exists
15034 set getnetbyaddr d_getnbyaddr
15037 : see if getnetbyname exists
15038 set getnetbyname d_getnbyname
15041 : see if getnetent exists
15042 set getnetent d_getnent
15045 : see if getnetbyaddr_r exists
15046 set getnetbyaddr_r d_getnetbyaddr_r
15048 case "$d_getnetbyaddr_r" in
15050 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15051 case "$d_getnetbyaddr_r_proto:$usethreads" in
15052 ":define") d_getnetbyaddr_r_proto=define
15053 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15057 case "$d_getnetbyaddr_r_proto" in
15059 case "$getnetbyaddr_r_proto" in
15060 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15061 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15063 case "$getnetbyaddr_r_proto" in
15064 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15065 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15067 case "$getnetbyaddr_r_proto" in
15068 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15069 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15071 case "$getnetbyaddr_r_proto" in
15072 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15073 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15075 case "$getnetbyaddr_r_proto" in
15076 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15077 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15079 case "$getnetbyaddr_r_proto" in
15080 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15081 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15083 case "$getnetbyaddr_r_proto" in
15084 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15085 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15087 case "$getnetbyaddr_r_proto" in
15088 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15089 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15091 case "$getnetbyaddr_r_proto" in
15092 ''|0) d_getnetbyaddr_r=undef
15093 getnetbyaddr_r_proto=0
15094 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15095 * ) case "$getnetbyaddr_r_proto" in
15096 REENTRANT_PROTO*) ;;
15097 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15099 echo "Prototype: $try" ;;
15102 *) case "$usethreads" in
15103 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15105 d_getnetbyaddr_r=undef
15106 getnetbyaddr_r_proto=0
15110 *) getnetbyaddr_r_proto=0
15114 : see if getnetbyname_r exists
15115 set getnetbyname_r d_getnetbyname_r
15117 case "$d_getnetbyname_r" in
15119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15120 case "$d_getnetbyname_r_proto:$usethreads" in
15121 ":define") d_getnetbyname_r_proto=define
15122 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15126 case "$d_getnetbyname_r_proto" in
15128 case "$getnetbyname_r_proto" in
15129 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15130 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15132 case "$getnetbyname_r_proto" in
15133 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15134 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15136 case "$getnetbyname_r_proto" in
15137 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15138 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15140 case "$getnetbyname_r_proto" in
15141 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15142 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15144 case "$getnetbyname_r_proto" in
15145 ''|0) d_getnetbyname_r=undef
15146 getnetbyname_r_proto=0
15147 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15148 * ) case "$getnetbyname_r_proto" in
15149 REENTRANT_PROTO*) ;;
15150 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15152 echo "Prototype: $try" ;;
15155 *) case "$usethreads" in
15156 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15158 d_getnetbyname_r=undef
15159 getnetbyname_r_proto=0
15163 *) getnetbyname_r_proto=0
15167 : see if getnetent_r exists
15168 set getnetent_r d_getnetent_r
15170 case "$d_getnetent_r" in
15172 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15173 case "$d_getnetent_r_proto:$usethreads" in
15174 ":define") d_getnetent_r_proto=define
15175 set d_getnetent_r_proto getnetent_r $hdrs
15179 case "$d_getnetent_r_proto" in
15181 case "$getnetent_r_proto" in
15182 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15183 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15185 case "$getnetent_r_proto" in
15186 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15187 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15189 case "$getnetent_r_proto" in
15190 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15191 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15193 case "$getnetent_r_proto" in
15194 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15195 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15197 case "$getnetent_r_proto" in
15198 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15199 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15201 case "$getnetent_r_proto" in
15202 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15203 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15205 case "$getnetent_r_proto" in
15206 ''|0) d_getnetent_r=undef
15207 getnetent_r_proto=0
15208 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15209 * ) case "$getnetent_r_proto" in
15210 REENTRANT_PROTO*) ;;
15211 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15213 echo "Prototype: $try" ;;
15216 *) case "$usethreads" in
15217 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15219 d_getnetent_r=undef
15220 getnetent_r_proto=0
15224 *) getnetent_r_proto=0
15228 : see if prototypes for various getnetxxx netdb.h functions are available
15230 set d_getnetprotos getnetent $i_netdb netdb.h
15233 : see if getpagesize exists
15234 set getpagesize d_getpagsz
15237 : Optional checks for getprotobyname and getprotobynumber
15239 : see if getprotobyname exists
15240 set getprotobyname d_getpbyname
15243 : see if getprotobynumber exists
15244 set getprotobynumber d_getpbynumber
15247 : see if getprotoent exists
15248 set getprotoent d_getpent
15251 : see if getpgid exists
15252 set getpgid d_getpgid
15255 : see if getpgrp2 exists
15256 set getpgrp2 d_getpgrp2
15259 : see if getppid exists
15260 set getppid d_getppid
15263 : see if getpriority exists
15264 set getpriority d_getprior
15267 : see if getprotobyname_r exists
15268 set getprotobyname_r d_getprotobyname_r
15270 case "$d_getprotobyname_r" in
15272 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15273 case "$d_getprotobyname_r_proto:$usethreads" in
15274 ":define") d_getprotobyname_r_proto=define
15275 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15279 case "$d_getprotobyname_r_proto" in
15281 case "$getprotobyname_r_proto" in
15282 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15283 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15285 case "$getprotobyname_r_proto" in
15286 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15287 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15289 case "$getprotobyname_r_proto" in
15290 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15291 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15293 case "$getprotobyname_r_proto" in
15294 ''|0) d_getprotobyname_r=undef
15295 getprotobyname_r_proto=0
15296 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15297 * ) case "$getprotobyname_r_proto" in
15298 REENTRANT_PROTO*) ;;
15299 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15301 echo "Prototype: $try" ;;
15304 *) case "$usethreads" in
15305 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15307 d_getprotobyname_r=undef
15308 getprotobyname_r_proto=0
15312 *) getprotobyname_r_proto=0
15316 : see if getprotobynumber_r exists
15317 set getprotobynumber_r d_getprotobynumber_r
15319 case "$d_getprotobynumber_r" in
15321 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15322 case "$d_getprotobynumber_r_proto:$usethreads" in
15323 ":define") d_getprotobynumber_r_proto=define
15324 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15328 case "$d_getprotobynumber_r_proto" in
15330 case "$getprotobynumber_r_proto" in
15331 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15332 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15334 case "$getprotobynumber_r_proto" in
15335 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15336 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15338 case "$getprotobynumber_r_proto" in
15339 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15340 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15342 case "$getprotobynumber_r_proto" in
15343 ''|0) d_getprotobynumber_r=undef
15344 getprotobynumber_r_proto=0
15345 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15346 * ) case "$getprotobynumber_r_proto" in
15347 REENTRANT_PROTO*) ;;
15348 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15350 echo "Prototype: $try" ;;
15353 *) case "$usethreads" in
15354 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15356 d_getprotobynumber_r=undef
15357 getprotobynumber_r_proto=0
15361 *) getprotobynumber_r_proto=0
15365 : see if getprotoent_r exists
15366 set getprotoent_r d_getprotoent_r
15368 case "$d_getprotoent_r" in
15370 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15371 case "$d_getprotoent_r_proto:$usethreads" in
15372 ":define") d_getprotoent_r_proto=define
15373 set d_getprotoent_r_proto getprotoent_r $hdrs
15377 case "$d_getprotoent_r_proto" in
15379 case "$getprotoent_r_proto" in
15380 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15381 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15383 case "$getprotoent_r_proto" in
15384 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15385 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15387 case "$getprotoent_r_proto" in
15388 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15389 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15391 case "$getprotoent_r_proto" in
15392 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15393 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15395 case "$getprotoent_r_proto" in
15396 ''|0) d_getprotoent_r=undef
15397 getprotoent_r_proto=0
15398 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15399 * ) case "$getprotoent_r_proto" in
15400 REENTRANT_PROTO*) ;;
15401 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15403 echo "Prototype: $try" ;;
15406 *) case "$usethreads" in
15407 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15409 d_getprotoent_r=undef
15410 getprotoent_r_proto=0
15414 *) getprotoent_r_proto=0
15418 : see if prototypes for various getprotoxxx netdb.h functions are available
15420 set d_getprotoprotos getprotoent $i_netdb netdb.h
15423 : see if getprpwnam exists
15424 set getprpwnam d_getprpwnam
15427 : see if getpwent exists
15428 set getpwent d_getpwent
15431 : see if getpwent_r exists
15432 set getpwent_r d_getpwent_r
15434 case "$d_getpwent_r" in
15436 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15437 case "$d_getpwent_r_proto:$usethreads" in
15438 ":define") d_getpwent_r_proto=define
15439 set d_getpwent_r_proto getpwent_r $hdrs
15443 case "$d_getpwent_r_proto" in
15445 case "$getpwent_r_proto" in
15446 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15447 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15449 case "$getpwent_r_proto" in
15450 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15451 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15453 case "$getpwent_r_proto" in
15454 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15455 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15457 case "$getpwent_r_proto" in
15458 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15459 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15461 case "$getpwent_r_proto" in
15462 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15463 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15465 case "$getpwent_r_proto" in
15466 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15467 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15469 case "$getpwent_r_proto" in
15470 ''|0) d_getpwent_r=undef
15472 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15473 * ) case "$getpwent_r_proto" in
15474 REENTRANT_PROTO*) ;;
15475 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15477 echo "Prototype: $try" ;;
15480 *) case "$usethreads" in
15481 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15488 *) getpwent_r_proto=0
15492 : see if getpwnam_r exists
15493 set getpwnam_r d_getpwnam_r
15495 case "$d_getpwnam_r" in
15497 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15498 case "$d_getpwnam_r_proto:$usethreads" in
15499 ":define") d_getpwnam_r_proto=define
15500 set d_getpwnam_r_proto getpwnam_r $hdrs
15504 case "$d_getpwnam_r_proto" in
15506 case "$getpwnam_r_proto" in
15507 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15508 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15510 case "$getpwnam_r_proto" in
15511 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15512 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15514 case "$getpwnam_r_proto" in
15515 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15516 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15518 case "$getpwnam_r_proto" in
15519 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15520 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15522 case "$getpwnam_r_proto" in
15523 ''|0) d_getpwnam_r=undef
15525 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15526 * ) case "$getpwnam_r_proto" in
15527 REENTRANT_PROTO*) ;;
15528 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15530 echo "Prototype: $try" ;;
15533 *) case "$usethreads" in
15534 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15541 *) getpwnam_r_proto=0
15545 : see if getpwuid_r exists
15546 set getpwuid_r d_getpwuid_r
15548 case "$d_getpwuid_r" in
15550 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15551 case "$d_getpwuid_r_proto:$usethreads" in
15552 ":define") d_getpwuid_r_proto=define
15553 set d_getpwuid_r_proto getpwuid_r $hdrs
15557 case "$d_getpwuid_r_proto" in
15559 case "$getpwuid_r_proto" in
15560 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15561 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15563 case "$getpwuid_r_proto" in
15564 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15565 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15567 case "$getpwuid_r_proto" in
15568 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15569 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15571 case "$getpwuid_r_proto" in
15572 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15573 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15575 case "$getpwuid_r_proto" in
15576 ''|0) d_getpwuid_r=undef
15578 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15579 * ) case "$getpwuid_r_proto" in
15580 REENTRANT_PROTO*) ;;
15581 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15583 echo "Prototype: $try" ;;
15586 *) case "$usethreads" in
15587 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15594 *) getpwuid_r_proto=0
15598 : Optional checks for getsbyname and getsbyport
15600 : see if getservbyname exists
15601 set getservbyname d_getsbyname
15604 : see if getservbyport exists
15605 set getservbyport d_getsbyport
15608 : see if getservent exists
15609 set getservent d_getsent
15612 : see if getservbyname_r exists
15613 set getservbyname_r d_getservbyname_r
15615 case "$d_getservbyname_r" in
15617 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15618 case "$d_getservbyname_r_proto:$usethreads" in
15619 ":define") d_getservbyname_r_proto=define
15620 set d_getservbyname_r_proto getservbyname_r $hdrs
15624 case "$d_getservbyname_r_proto" in
15626 case "$getservbyname_r_proto" in
15627 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15628 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15630 case "$getservbyname_r_proto" in
15631 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15632 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15634 case "$getservbyname_r_proto" in
15635 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15636 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15638 case "$getservbyname_r_proto" in
15639 ''|0) d_getservbyname_r=undef
15640 getservbyname_r_proto=0
15641 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15642 * ) case "$getservbyname_r_proto" in
15643 REENTRANT_PROTO*) ;;
15644 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15646 echo "Prototype: $try" ;;
15649 *) case "$usethreads" in
15650 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15652 d_getservbyname_r=undef
15653 getservbyname_r_proto=0
15657 *) getservbyname_r_proto=0
15661 : see if getservbyport_r exists
15662 set getservbyport_r d_getservbyport_r
15664 case "$d_getservbyport_r" in
15666 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15667 case "$d_getservbyport_r_proto:$usethreads" in
15668 ":define") d_getservbyport_r_proto=define
15669 set d_getservbyport_r_proto getservbyport_r $hdrs
15673 case "$d_getservbyport_r_proto" in
15675 case "$getservbyport_r_proto" in
15676 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15677 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15679 case "$getservbyport_r_proto" in
15680 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15681 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15683 case "$getservbyport_r_proto" in
15684 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15685 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15687 case "$getservbyport_r_proto" in
15688 ''|0) d_getservbyport_r=undef
15689 getservbyport_r_proto=0
15690 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15691 * ) case "$getservbyport_r_proto" in
15692 REENTRANT_PROTO*) ;;
15693 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15695 echo "Prototype: $try" ;;
15698 *) case "$usethreads" in
15699 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15701 d_getservbyport_r=undef
15702 getservbyport_r_proto=0
15706 *) getservbyport_r_proto=0
15710 : see if getservent_r exists
15711 set getservent_r d_getservent_r
15713 case "$d_getservent_r" in
15715 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15716 case "$d_getservent_r_proto:$usethreads" in
15717 ":define") d_getservent_r_proto=define
15718 set d_getservent_r_proto getservent_r $hdrs
15722 case "$d_getservent_r_proto" in
15724 case "$getservent_r_proto" in
15725 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15726 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15728 case "$getservent_r_proto" in
15729 ''|0) try='int getservent_r(struct servent*, char*, int);'
15730 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15732 case "$getservent_r_proto" in
15733 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15734 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15736 case "$getservent_r_proto" in
15737 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15738 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15740 case "$getservent_r_proto" in
15741 ''|0) d_getservent_r=undef
15742 getservent_r_proto=0
15743 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15744 * ) case "$getservent_r_proto" in
15745 REENTRANT_PROTO*) ;;
15746 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15748 echo "Prototype: $try" ;;
15751 *) case "$usethreads" in
15752 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15754 d_getservent_r=undef
15755 getservent_r_proto=0
15759 *) getservent_r_proto=0
15763 : see if prototypes for various getservxxx netdb.h functions are available
15765 set d_getservprotos getservent $i_netdb netdb.h
15768 : see if getspnam exists
15769 set getspnam d_getspnam
15772 : see if this is a shadow.h system
15773 set shadow.h i_shadow
15776 : see if getspnam_r exists
15777 set getspnam_r d_getspnam_r
15779 case "$d_getspnam_r" in
15781 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15782 case "$d_getspnam_r_proto:$usethreads" in
15783 ":define") d_getspnam_r_proto=define
15784 set d_getspnam_r_proto getspnam_r $hdrs
15788 case "$d_getspnam_r_proto" in
15790 case "$getspnam_r_proto" in
15791 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15792 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15794 case "$getspnam_r_proto" in
15795 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15796 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15798 case "$getspnam_r_proto" in
15799 ''|0) d_getspnam_r=undef
15801 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15802 * ) case "$getspnam_r_proto" in
15803 REENTRANT_PROTO*) ;;
15804 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15806 echo "Prototype: $try" ;;
15809 *) case "$usethreads" in
15810 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15817 *) getspnam_r_proto=0
15821 : see if gettimeofday or ftime exists
15822 set gettimeofday d_gettimeod
15824 case "$d_gettimeod" in
15830 val="$undef"; set d_ftime; eval $setvar
15833 case "$d_gettimeod$d_ftime" in
15836 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15840 : see if gmtime_r exists
15841 set gmtime_r d_gmtime_r
15843 case "$d_gmtime_r" in
15845 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15846 case "$d_gmtime_r_proto:$usethreads" in
15847 ":define") d_gmtime_r_proto=define
15848 set d_gmtime_r_proto gmtime_r $hdrs
15852 case "$d_gmtime_r_proto" in
15854 case "$gmtime_r_proto" in
15855 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15856 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15858 case "$gmtime_r_proto" in
15859 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15860 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15862 case "$gmtime_r_proto" in
15863 ''|0) d_gmtime_r=undef
15865 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15866 * ) case "$gmtime_r_proto" in
15867 REENTRANT_PROTO*) ;;
15868 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15870 echo "Prototype: $try" ;;
15873 *) case "$usethreads" in
15874 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15881 *) gmtime_r_proto=0
15885 : see if hasmntopt exists
15886 set hasmntopt d_hasmntopt
15889 : see if this is a netinet/in.h or sys/in.h system
15890 set netinet/in.h i_niin sys/in.h i_sysin
15893 : see if arpa/inet.h has to be included
15894 set arpa/inet.h i_arpainet
15897 : see if htonl --and friends-- exists
15902 : Maybe they are macros.
15905 $cat >htonl.c <<EOM
15907 #include <sys/types.h>
15908 #$i_niin I_NETINET_IN
15910 #$i_arpainet I_ARPA_INET
15911 #ifdef I_NETINET_IN
15912 #include <netinet/in.h>
15915 #include <sys/in.h>
15918 #include <arpa/inet.h>
15921 printf("Defined as a macro.");
15924 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15925 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15927 echo "But it seems to be defined as a macro." >&4
15935 : see if hypot exists
15939 : see if ilogb exists
15943 : see if ilogbl exists
15944 set ilogbl d_ilogbl
15949 if set index val -f; eval $csym; $val; then
15950 if set strchr val -f d_strchr; eval $csym; $val; then
15951 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15954 echo "strchr() found." >&4
15958 echo "index() found." >&4
15963 echo "index() found." >&4
15966 if set strchr val -f d_strchr; eval $csym; $val; then
15969 echo "strchr() found." >&4
15971 echo "No index() or strchr() found!" >&4
15976 set d_strchr; eval $setvar
15978 set d_index; eval $setvar
15980 : check whether inet_aton exists
15981 set inet_aton d_inetaton
15984 : see if inet_ntop exists
15985 set inet_ntop d_inetntop
15988 : see if inet_pton exists
15989 set inet_pton d_inetpton
15994 $cat >isascii.c <<EOCP
15997 #$i_stdlib I_STDLIB
15999 #include <stdlib.h>
16010 if eval $compile; then
16011 echo "isascii() found." >&4
16014 echo "isascii() NOT found." >&4
16023 $cat >isblank.c <<'EOCP'
16034 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
16035 echo "isblank() found." >&4
16038 echo "isblank() NOT found." >&4
16045 : check for isfinite
16046 echo "Checking to see if you have isfinite..." >&4
16052 int main() { return isfinite(0.0); }
16055 if eval $compile; then
16057 echo "You have isfinite."
16060 echo "You do not have isfinite."
16066 : see if isfinitel exists
16067 set isfinitel d_isfinitel
16071 echo "Checking to see if you have isinf..." >&4
16077 int main() { return isinf(0.0); }
16080 if eval $compile; then
16082 echo "You have isinf."
16085 echo "You do not have isinf."
16091 : see if isinfl exists
16092 set isinfl d_isinfl
16096 echo "Checking to see if you have isless..." >&4
16102 int main() { return isless(0.0); }
16105 if eval $compile; then
16107 echo "You have isless."
16110 echo "You do not have isless."
16117 echo "Checking to see if you have isnan..." >&4
16123 int main() { return isnan(0.0); }
16126 if eval $compile; then
16128 echo "You have isnan."
16131 echo "You do not have isnan."
16137 : see if isnanl exists
16138 set isnanl d_isnanl
16141 : check for isnormal
16142 echo "Checking to see if you have isnormal..." >&4
16148 int main() { return isnormal(0.0); }
16151 if eval $compile; then
16153 echo "You have isnormal."
16156 echo "You do not have isnormal."
16166 : see if j0l exists
16170 : see if killpg exists
16171 set killpg d_killpg
16174 : see if localeconv exists
16175 set localeconv d_locconv
16178 : see if libc has the POSIX.1-2008 currency locale rules
16179 case "$d_locconv:$d_lc_monetary_2008" in
16182 #include <locale.h>
16184 struct lconv *lc = localeconv();
16185 char int_p_cs_precedes = lc->int_p_cs_precedes;
16190 if eval $compile; then
16191 d_lc_monetary_2008="$define"
16193 d_lc_monetary_2008="$undef"
16199 : see if lchown exists
16201 $cat > try.c <<'EOCP'
16202 /* System header to define __stub macros and hopefully few prototypes,
16203 which can conflict with char lchown(); below. */
16204 #include <assert.h>
16205 /* Override any gcc2 internal prototype to avoid an error. */
16206 /* We use char because int might match the return type of a gcc2
16207 builtin and then its argument prototype would still apply. */
16210 /* The GNU C library defines this for functions which it implements
16211 to always fail with ENOSYS. Some functions are actually named
16212 something starting with __ and the normal name is an alias. */
16213 #if defined (__stub_lchown) || defined (__stub___lchown)
16221 if eval $compile; then
16222 $echo "lchown() found." >&4
16225 $echo "lchown() NOT found." >&4
16231 : See if number of significant digits in a double precision number is known
16233 $cat >ldbl_dig.c <<EOM
16234 #$i_limits I_LIMITS
16237 #include <limits.h>
16243 printf("Contains LDBL_DIG");
16246 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16247 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16248 echo "LDBL_DIG found." >&4
16251 echo "LDBL_DIG NOT found." >&4
16258 : see if lgamma exists
16259 set lgamma d_lgamma
16262 : see if lgamma_r exists
16263 set lgamma_r d_lgamma_r
16266 : check to see if math.h defines _LIB_VERSION
16267 d_libm_lib_version="$undef"
16271 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16273 #include <unistd.h>
16275 int main (int argc, char *argv[])
16277 printf ("%d\n", _LIB_VERSION);
16282 if eval $compile; then
16284 echo "Yes, it does ($foo)" >&4
16285 d_libm_lib_version="$define"
16287 echo "No, it does not (probably harmless)" >&4
16294 : see if link exists
16298 : see if llrint exists
16299 set llrint d_llrint
16302 : see if llrintl exists
16303 set llrintl d_llrintl
16306 : see if llround exists
16307 set llround d_llround
16310 : see if llroundl exists
16311 set llroundl d_llroundl
16314 : see if localtime_r exists
16315 set localtime_r d_localtime_r
16317 case "$d_localtime_r" in
16319 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16320 case "$d_localtime_r_proto:$usethreads" in
16321 ":define") d_localtime_r_proto=define
16322 set d_localtime_r_proto localtime_r $hdrs
16326 case "$d_localtime_r_proto" in
16328 case "$localtime_r_proto" in
16329 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16330 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16332 case "$localtime_r_proto" in
16333 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16334 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16336 case "$localtime_r_proto" in
16337 ''|0) d_localtime_r=undef
16338 localtime_r_proto=0
16339 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16340 * ) case "$localtime_r_proto" in
16341 REENTRANT_PROTO*) ;;
16342 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16344 echo "Prototype: $try" ;;
16347 *) case "$usethreads" in
16348 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16350 d_localtime_r=undef
16351 localtime_r_proto=0
16355 *) localtime_r_proto=0
16359 : see if localtime_r calls tzset
16360 case "$localtime_r_proto" in
16363 /* Does our libc's localtime_r call tzset ?
16364 * return 0 if so, 1 otherwise.
16366 #$i_systypes I_SYS_TYPES
16367 #$i_unistd I_UNISTD
16369 #$i_stdlib I_STDLIB
16370 #$i_string I_STRING
16371 #$i_malloc I_MALLOC
16373 # include <sys/types.h>
16376 # include <unistd.h>
16382 #include <stdlib.h>
16385 # include <string.h>
16387 # include <strings.h>
16390 # include <malloc.h>
16394 time_t t = time(0L);
16395 char w_tz[]="TZ" "=GMT+5",
16396 e_tz[]="TZ" "=GMT-5",
16397 *tz_e = (char*)malloc(16),
16398 *tz_w = (char*)malloc(16);
16399 struct tm tm_e, tm_w;
16400 memset(&tm_e,'\0',sizeof(struct tm));
16401 memset(&tm_w,'\0',sizeof(struct tm));
16406 localtime_r(&t, &tm_e);
16409 localtime_r(&t, &tm_w);
16411 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16417 if eval $compile; then
16418 if $run ./try; then
16419 d_localtime_r_needs_tzset=undef;
16421 d_localtime_r_needs_tzset=define;
16424 d_localtime_r_needs_tzset=undef;
16428 d_localtime_r_needs_tzset=undef;
16433 : see if lockf exists
16437 : see if log1p exists
16441 : see if log2 exists
16445 : see if logb exists
16449 : see if lrint exists
16453 : see if lrintl exists
16454 set lrintl d_lrintl
16457 : see if lround exists
16458 set lround d_lround
16461 : see if lroundl exists
16462 set lroundl d_lroundl
16465 : see if prototype for lseek is available
16467 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16470 : see if lstat exists
16474 : see if madvise exists
16475 set madvise d_madvise
16478 : see if malloc_size exists
16479 set malloc_size d_malloc_size
16482 : see if malloc_size_good exists
16483 set malloc_good_size d_malloc_good_size
16486 : see if mblen exists
16490 : see if mbstowcs exists
16491 set mbstowcs d_mbstowcs
16494 : see if mbtowc exists
16495 set mbtowc d_mbtowc
16498 : see if memchr exists
16499 set memchr d_memchr
16502 : see if memcmp exists
16503 set memcmp d_memcmp
16506 : see if memcpy exists
16507 set memcpy d_memcpy
16510 : see if memmem exists
16511 set memmem d_memmem
16514 : see if memmove exists
16515 set memmove d_memmove
16518 : see if memset exists
16519 set memset d_memset
16522 : see if mkdir exists
16526 : see if mkdtemp exists
16527 set mkdtemp d_mkdtemp
16530 : see if mkfifo exists
16531 set mkfifo d_mkfifo
16534 : see if mkstemp exists
16535 set mkstemp d_mkstemp
16538 : see if mkstemps exists
16539 set mkstemps d_mkstemps
16542 : see if mktime exists
16543 set mktime d_mktime
16546 : see if this is a sys/mman.h system
16547 set sys/mman.h i_sysmman
16550 : see if mmap exists
16553 : see what shmat returns
16554 : default to something harmless
16556 case "$i_sysmman$d_mmap" in
16558 $cat >mmap.c <<'END'
16559 #include <sys/mman.h>
16562 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16567 echo "and it returns ($mmaptype)." >&4
16573 : see if sqrtl exists
16577 : see if scalbnl exists
16578 set scalbnl d_scalbnl
16581 : see if truncl exists
16582 set truncl d_truncl
16585 : see if modfl exists
16589 : see if prototype for modfl is available
16591 set d_modflproto modfl $i_math math.h
16594 if $test "$uselongdouble" = "$define"; then
16596 if $test "$d_sqrtl" != "$define"; then
16597 message="$message sqrtl"
16599 if $test "$d_modfl" != "$define"; then
16600 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16601 echo "You have both truncl and copysignl, so I can emulate modfl."
16603 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16604 echo "You have both aintl and copysignl, so I can emulate modfl."
16606 message="$message modfl"
16610 if $test "$d_frexpl" != "$define"; then
16611 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16612 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16614 message="$message frexpl"
16617 if $test "$d_ldexpl" != "$define"; then
16618 message="$message ldexpl"
16621 if $test "$message" != ""; then
16624 *** You requested the use of long doubles but you do not seem to have
16625 *** the following mathematical functions needed for long double support:
16627 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16628 *** Cannot continue, aborting.
16636 : see if mprotect exists
16637 set mprotect d_mprotect
16640 : see if msgctl exists
16641 set msgctl d_msgctl
16644 : see if msgget exists
16645 set msgget d_msgget
16648 : see if msgsnd exists
16649 set msgsnd d_msgsnd
16652 : see if msgrcv exists
16653 set msgrcv d_msgrcv
16656 : see how much of the 'msg*(2)' library is present.
16659 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16660 *"$undef"*) h_msg=false;;
16664 case "`ipcs 2>&1`" in
16665 "SVID messages"*"not configured"*)
16666 echo "Your $osname does not have the msg*(2) configured." >&4
16669 set msgctl d_msgctl
16671 set msgget d_msgget
16673 set msgsnd d_msgsnd
16675 set msgrcv d_msgrcv
16681 : we could also check for sys/ipc.h ...
16682 if $h_msg && $test `./findhdr sys/msg.h`; then
16683 echo "You have the full msg*(2) library." >&4
16686 echo "You don't have the full msg*(2) library." >&4
16692 : Check for msghdr_s
16694 echo "Checking to see if your system supports struct msghdr..." >&4
16695 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16697 case "$d_msghdr_s" in
16698 "$define") echo "Yes, it does." ;;
16699 *) echo "No, it doesn't." ;;
16703 : see if msync exists
16707 : see if munmap exists
16708 set munmap d_munmap
16711 : see if nan exists
16715 : see if nearbyint exists
16716 set nearbyint d_nearbyint
16719 : see if nextafter exists
16720 set nextafter d_nextafter
16723 : see if nexttoward exists
16724 set nexttoward d_nexttoward
16727 : see if nice exists
16731 : see if this is a langinfo.h system
16732 set langinfo.h i_langinfo
16735 : see if nl_langinfo exists
16736 set nl_langinfo d_nl_langinfo
16739 : see if this is a quadmath.h system
16740 set quadmath.h i_quadmath
16743 : check for volatile keyword
16745 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16746 $cat >try.c <<'EOCP'
16749 typedef struct _goo_struct goo_struct;
16750 goo_struct * volatile goo = ((goo_struct *)0);
16751 struct _goo_struct {
16756 typedef unsigned short foo_t;
16757 char *volatile foo;
16759 volatile foo_t blech;
16763 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16765 echo "Yup, it does."
16768 echo "Nope, it doesn't."
16774 : Check basic sizes
16776 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16778 case "$use64bitint:$d_quad:$quadtype" in
16781 uvtype="$uquadtype"
16786 uvtype="unsigned long"
16792 case "$uselongdouble:$d_longdbl" in
16794 nvtype="long double"
16795 nvsize=$longdblsize
16802 case "$usequadmath:$i_quadmath" in
16804 nvtype="__float128"
16810 *** You requested the use of the quadmath library, but you
16811 *** do not seem to have the quadmath library installed.
16812 *** Cannot continue, aborting.
16818 define:*) $cat <<EOM >&4
16820 *** You requested the use of the quadmath library, but you
16821 *** do not seem to have the required header, <quadmath.h>.
16823 case "$gccversion" in
16826 *** Your gcc looks a bit old:
16832 *** You are not running a gcc.
16837 *** For the quadmath library you need at least gcc 4.6.
16838 *** Cannot continue, aborting.
16844 $echo "(IV will be "$ivtype", $ivsize bytes)"
16845 $echo "(UV will be "$uvtype", $uvsize bytes)"
16846 $echo "(NV will be "$nvtype", $nvsize bytes)"
16849 #$i_inttypes I_INTTYPES
16851 #include <inttypes.h>
16856 int8_t i = INT8_MAX;
16857 uint8_t u = UINT8_MAX;
16858 printf("int8_t\n");
16861 int16_t i = INT16_MAX;
16862 uint16_t u = UINT16_MAX;
16863 printf("int16_t\n");
16866 int32_t i = INT32_MAX;
16867 uint32_t u = UINT32_MAX;
16868 printf("int32_t\n");
16873 i8type="signed char"
16874 u8type="unsigned char"
16879 '') case "$shortsize" in
16881 u16type="unsigned short"
16889 '') set try -DINT16
16890 if eval $compile; then
16891 case "`$run ./try`" in
16903 '') if $test $shortsize -ge 2; then
16905 u16type="unsigned short"
16913 '') case "$longsize" in
16915 u32type="unsigned long"
16919 *) case "$intsize" in
16921 u32type="unsigned int"
16931 '') set try -DINT32
16932 if eval $compile; then
16933 case "`$run ./try`" in
16945 '') if $test $intsize -ge 4; then
16947 u32type="unsigned int"
16955 '') case "$d_quad:$quadtype" in
16957 i64type="$quadtype"
16958 u64type="$uquadtype"
16966 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16967 : volatile so that the compiler has to store it out to memory.
16968 if test X"$d_volatile" = X"$define"; then
16973 #$i_stdlib I_STDLIB
16975 #include <stdlib.h>
16977 #include <sys/types.h>
16978 #include <signal.h>
16980 $volatile int bletched = 0;
16981 $signal_t blech(int s) { bletched = 1; }
16986 int n = 8 * $uvsize;
16989 signal(SIGFPE, blech);
16992 for (i = 0; i < n; i++) {
16993 u = u << 1 | ($uvtype)1;
16995 if (($uvtype)d != u)
16999 d = ($nvtype)(u - 1);
17000 if (($uvtype)d != (u - 1))
17007 printf("%d\n", ((i == n) ? -n : i));
17013 d_nv_preserves_uv="$undef"
17014 if eval $compile; then
17015 nv_preserves_uv_bits="`$run ./try`"
17017 case "$nv_preserves_uv_bits" in
17019 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
17020 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
17021 d_nv_preserves_uv="$define"
17023 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
17024 d_nv_preserves_uv="$undef" ;;
17025 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
17026 nv_preserves_uv_bits="0" ;;
17030 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17031 : volatile so that the compiler has to store it out to memory.
17032 if test X"$d_volatile" = X"$define"; then
17038 typedef $nvtype NV;
17045 while(count < 256) {
17046 $volatile NV up = value + 1.0;
17047 $volatile NV negated = -value;
17048 $volatile NV down = negated - 1.0;
17049 $volatile NV got_up = up - value;
17050 int up_good = got_up == 1.0;
17051 int got_down = down - negated;
17052 int down_good = got_down == -1.0;
17054 if (down_good != up_good) {
17056 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17057 up_good, (double) got_up, down_good, (double) got_down,
17058 count, (double) value);
17065 fputs("256.0", stdout);
17068 fputs("2.0", stdout);
17074 fputs("*", stdout);
17080 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17081 count, (double) value);
17087 nv_overflows_integers_at='0'
17088 if eval $compile; then
17094 The largest integer your NVs can preserve is equal to $xxx
17096 nv_overflows_integers_at="$xxx"
17099 Cannot determine the largest integer value your NVs can hold, unexpected output
17106 Cannot determine the largest integer value your NVs can hold
17113 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17114 : volatile so that the compiler has to store it out to memory.
17115 if test X"$d_volatile" = X"$define"; then
17120 #$i_stdlib I_STDLIB
17122 #include <stdlib.h>
17124 #$i_string I_STRING
17126 # include <string.h>
17128 # include <strings.h>
17130 #include <sys/types.h>
17131 #include <signal.h>
17133 $volatile int bletched = 0;
17134 $signal_t blech(int s) { bletched = 1; }
17137 int checkit($nvtype d, const char *where) {
17139 unsigned char *p = (unsigned char *)v;
17140 unsigned char *end = p + sizeof(d);
17149 p = (unsigned char *)v;
17150 printf("No - %s: 0x", where);
17152 printf ("%02X", *p++);
17157 int main(int argc, char **argv) {
17160 fail += checkit(d, "0.0");
17162 /* The compiler shouldn't be assuming that bletched is 0 */
17165 fail += checkit(d, "bleched");
17168 signal(SIGFPE, blech);
17171 /* Paranoia - the compiler should have no way of knowing that ANSI says
17172 that argv[argc] will always be NULL. Actually, if it did assume this it
17173 would be buggy, as this is C and main() can be called from elsewhere in
17175 d = argv[argc] ? 1 : 0;
17178 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17181 fail += checkit(d, "ternary");
17183 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17186 printf("No - memset doesn't give 0.0\n");
17187 /* This might just blow up: */
17188 printf("(gives %g)\n", d);
17194 printf("No - something bleched\n");
17199 printf("No - %d fail(s)\n", fail);
17208 d_nv_zero_is_allbits_zero="$undef"
17209 if eval $compile; then
17215 0.0 is represented as all bits zero in memory
17217 d_nv_zero_is_allbits_zero="$define"
17220 0.0 is not represented as all bits zero in memory
17222 d_nv_zero_is_allbits_zero="$undef"
17227 0.0 is not represented as all bits zero in memory
17229 d_nv_zero_is_allbits_zero="$undef"
17235 : check for off64_t
17237 echo "Checking to see if you have off64_t..." >&4
17239 #include <sys/types.h>
17240 #include <unistd.h>
17241 int main() { off64_t x = 7; }
17244 if eval $compile; then
17246 echo "You have off64_t."
17249 echo "You do not have off64_t."
17250 case "$lseeksize" in
17251 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17258 : how to create joinable pthreads
17259 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17261 echo "Checking what constant to use for creating joinable pthreads..." >&4
17262 $cat >try.c <<'EOCP'
17263 #include <pthread.h>
17265 int detachstate = JOINABLE;
17268 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17269 if eval $compile; then
17270 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17271 val="$undef" # Yes, undef.
17272 set d_old_pthread_create_joinable
17275 set old_pthread_create_joinable
17278 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17279 if eval $compile; then
17280 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17282 set d_old_pthread_create_joinable
17284 val=PTHREAD_CREATE_UNDETACHED
17285 set old_pthread_create_joinable
17288 set try -DJOINABLE=__UNDETACHED
17289 if eval $compile; then
17290 echo "You seem to use __UNDETACHED." >&4
17292 set d_old_pthread_create_joinable
17295 set old_pthread_create_joinable
17298 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17300 set d_old_pthread_create_joinable
17303 set old_pthread_create_joinable
17310 d_old_pthread_create_joinable="$undef"
17311 old_pthread_create_joinable=""
17314 : see if pause exists
17318 : see if poll exists
17322 : see if prctl exists
17326 : see if prctl supports PR_SET_NAME
17327 d_prctl_set_name=$undef
17332 #include <unistd.h>
17334 #include <sys/prctl.h>
17336 int main (int argc, char *argv[])
17338 return (prctl (PR_SET_NAME, "Test"));
17342 if eval $compile_ok && $run ./try; then
17343 echo "Your prctl (PR_SET_NAME, ...) works"
17344 d_prctl_set_name=$define
17350 : see if readlink exists
17351 set readlink d_readlink
17354 : Check if there is a /proc symlink to the abs path of
17355 : the executing program. We will honor hints of d_procselfexe=$undef
17356 : or procselfexe being non-empty, otherwise will try to determine both
17357 : if we have readlink.
17358 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17359 : referenced, and AmigaOS does not have a proc filesystem anyway.
17362 if $test "X$d_procselfexe" = Xundef; then
17364 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17366 elif $test "X$d_readlink" = Xdefine; then
17367 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17368 : and it feels more tidy to avoid an extra level of symlink
17369 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17370 while test $# -gt 0; do
17373 if $issymlink $try; then
17374 $ls -l $try > reflect
17375 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17376 echo "You have $type-like $try."
17377 procselfexe='"'$try'"'
17379 : This will break out of the loop
17389 : backward compatibility for d_hvfork
17390 if test X$d_hvfork != X; then
17391 d_vfork="$d_hvfork"
17394 : see if there is a vfork
17399 d_pseudofork=$undef
17401 : Ok, but do we want to use it. vfork is reportedly unreliable in
17402 : perl on Solaris 2.x, and probably elsewhere.
17406 case "$usevfork" in
17412 Perl can only use a vfork() that doesn't suffer from strict
17413 restrictions on calling functions or modifying global data in
17414 the child. For example, glibc-2.1 contains such a vfork()
17415 that is unsuitable. If your system provides a proper fork()
17416 call, chances are that you do NOT want perl to use vfork().
17419 rp="Do you still want to use vfork()?"
17424 echo "Ok, we won't use vfork()."
17433 $define) usevfork='true';;
17434 *) usevfork='false';;
17437 : see whether the pthread_atfork exists
17439 #include <pthread.h>
17442 #ifdef PTHREAD_ATFORK
17443 pthread_atfork(NULL,NULL,NULL);
17448 : see if pthread_atfork exists
17449 set try -DPTHREAD_ATFORK
17450 if eval $compile; then
17455 case "$usethreads" in
17458 $define) echo 'pthread_atfork found.' >&4 ;;
17459 *) echo 'pthread_atfork NOT found.' >&4 ;;
17462 set d_pthread_atfork
17465 : see if pthread_attr_setscope exists
17466 set pthread_attr_setscope d_pthread_attr_setscope
17469 : see whether the various POSIXish _yields exist
17471 #include <pthread.h>
17477 #ifdef PTHREAD_YIELD
17480 #ifdef PTHREAD_YIELD_NULL
17481 pthread_yield(NULL);
17487 : see if sched_yield exists
17488 set try -DSCHED_YIELD
17489 if eval $compile; then
17491 sched_yield='sched_yield()'
17495 case "$usethreads" in
17498 $define) echo 'sched_yield() found.' >&4 ;;
17499 *) echo 'sched_yield() NOT found.' >&4 ;;
17505 : see if pthread_yield exists
17506 set try -DPTHREAD_YIELD
17507 if eval $compile; then
17509 case "$sched_yield" in
17510 '') sched_yield='pthread_yield()' ;;
17513 set try -DPTHREAD_YIELD_NULL
17514 if eval $compile; then
17516 case "$sched_yield" in
17517 '') sched_yield='pthread_yield(NULL)' ;;
17523 case "$usethreads" in
17526 $define) echo 'pthread_yield() found.' >&4 ;;
17527 *) echo 'pthread_yield() NOT found.' >&4 ;;
17531 set d_pthread_yield
17533 case "$sched_yield" in
17534 '') sched_yield=undef ;;
17538 : check for ptrdiff_t
17540 echo "Checking to see if you have ptrdiff_t..." >&4
17542 #include <stddef.h>
17543 int main() { ptrdiff_t x = 7; }
17546 if eval $compile; then
17548 echo "You have ptrdiff_t."
17551 echo "You do not have ptrdiff_t."
17557 : see if random_r exists
17558 set random_r d_random_r
17560 case "$d_random_r" in
17562 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17563 case "$d_random_r_proto:$usethreads" in
17564 ":define") d_random_r_proto=define
17565 set d_random_r_proto random_r $hdrs
17569 case "$d_random_r_proto" in
17571 case "$random_r_proto" in
17572 ''|0) try='int random_r(int*, struct random_data*);'
17573 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17575 case "$random_r_proto" in
17576 ''|0) try='int random_r(long*, struct random_data*);'
17577 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17579 case "$random_r_proto" in
17580 ''|0) try='int random_r(struct random_data*, int32_t*);'
17581 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17583 case "$random_r_proto" in
17584 ''|0) d_random_r=undef
17586 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17587 * ) case "$random_r_proto" in
17588 REENTRANT_PROTO*) ;;
17589 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17591 echo "Prototype: $try" ;;
17594 *) case "$usethreads" in
17595 define) echo "random_r has no prototype, not using it." >&4 ;;
17602 *) random_r_proto=0
17606 : see if readdir and friends exist
17607 set readdir d_readdir
17609 set seekdir d_seekdir
17611 set telldir d_telldir
17613 set rewinddir d_rewinddir
17616 : see if readdir64_r exists
17617 set readdir64_r d_readdir64_r
17619 case "$d_readdir64_r" in
17621 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17622 case "$d_readdir64_r_proto:$usethreads" in
17623 ":define") d_readdir64_r_proto=define
17624 set d_readdir64_r_proto readdir64_r $hdrs
17628 case "$d_readdir64_r_proto" in
17630 case "$readdir64_r_proto" in
17631 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17632 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17634 case "$readdir64_r_proto" in
17635 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17636 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17638 case "$readdir64_r_proto" in
17639 ''|0) d_readdir64_r=undef
17640 readdir64_r_proto=0
17641 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17642 * ) case "$readdir64_r_proto" in
17643 REENTRANT_PROTO*) ;;
17644 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17646 echo "Prototype: $try" ;;
17649 *) case "$usethreads" in
17650 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17652 d_readdir64_r=undef
17653 readdir64_r_proto=0
17657 *) readdir64_r_proto=0
17661 : see if readdir_r exists
17662 set readdir_r d_readdir_r
17664 case "$d_readdir_r" in
17666 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17667 case "$d_readdir_r_proto:$usethreads" in
17668 ":define") d_readdir_r_proto=define
17669 set d_readdir_r_proto readdir_r $hdrs
17673 case "$d_readdir_r_proto" in
17675 case "$readdir_r_proto" in
17676 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17677 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17679 case "$readdir_r_proto" in
17680 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17681 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17683 case "$readdir_r_proto" in
17684 ''|0) d_readdir_r=undef
17686 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17687 * ) case "$readdir_r_proto" in
17688 REENTRANT_PROTO*) ;;
17689 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17691 echo "Prototype: $try" ;;
17694 *) case "$usethreads" in
17695 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17702 *) readdir_r_proto=0
17706 : see if readv exists
17710 : see if recvmsg exists
17711 set recvmsg d_recvmsg
17714 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17716 if set regcomp val -f d_regcomp; eval $csym; $val; then
17717 echo 'regcomp() found.' >&4
17718 d_regcomp="$define"
17721 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17722 echo 'regcmp() found.' >&4
17726 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17727 echo 're_comp() found, assuming re_exec() also exists.' >&4
17728 d_re_comp="$define"
17733 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17740 : see if remainder exists
17741 set remainder d_remainder
17744 : see if remquo exists
17745 set remquo d_remquo
17748 : see if rename exists
17749 set rename d_rename
17752 : see if rint exists
17756 : see if rmdir exists
17760 : see if round exists
17764 : see if memory.h is available.
17769 : See if it conflicts with string.h
17775 $cppstdin $cppflags $cppminus < $strings > mem.h
17776 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17778 echo "We won't be including <memory.h>."
17788 : can bcopy handle overlapping blocks?
17791 case "$d_memmove" in
17792 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17793 *) case "$d_bcopy" in
17795 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17797 #$i_memory I_MEMORY
17798 #$i_stdlib I_STDLIB
17799 #$i_string I_STRING
17800 #$i_unistd I_UNISTD
17802 $cat >>try.c <<'EOCP'
17805 # include <memory.h>
17808 # include <stdlib.h>
17811 # include <string.h>
17813 # include <strings.h>
17816 # include <unistd.h> /* Needed for NetBSD */
17820 char buf[128], abc[128];
17826 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17827 try to store the string in read-only memory. */
17828 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17830 for (align = 7; align >= 0; align--) {
17831 for (len = 36; len; len--) {
17833 bcopy(abc, b, len);
17834 for (off = 1; off <= len; off++) {
17835 bcopy(b, b+off, len);
17836 bcopy(b+off, b, len);
17837 if (bcmp(b, abc, len))
17846 if eval $compile_ok; then
17847 if $run ./try 2>/dev/null; then
17848 echo "Yes, it can."
17851 echo "It can't, sorry."
17854 echo "(I can't compile the test program, so we'll assume not...)"
17864 : can memcpy handle overlapping blocks?
17867 case "$d_memmove" in
17868 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17869 *) case "$d_memcpy" in
17871 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17873 #$i_memory I_MEMORY
17874 #$i_stdlib I_STDLIB
17875 #$i_string I_STRING
17876 #$i_unistd I_UNISTD
17878 $cat >>try.c <<'EOCP'
17881 # include <memory.h>
17884 # include <stdlib.h>
17887 # include <string.h>
17889 # include <strings.h>
17892 # include <unistd.h> /* Needed for NetBSD */
17896 char buf[128], abc[128];
17902 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17903 try to store the string in read-only memory. */
17904 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17906 for (align = 7; align >= 0; align--) {
17907 for (len = 36; len; len--) {
17909 memcpy(b, abc, len);
17910 for (off = 1; off <= len; off++) {
17911 memcpy(b+off, b, len);
17912 memcpy(b, b+off, len);
17913 if (memcmp(b, abc, len))
17922 if eval $compile_ok; then
17923 if $run ./try 2>/dev/null; then
17924 echo "Yes, it can."
17927 echo "It can't, sorry."
17930 echo "(I can't compile the test program, so we'll assume not...)"
17940 : can memcmp be trusted to compare relative magnitude?
17942 case "$d_memcmp" in
17945 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17947 #$i_memory I_MEMORY
17948 #$i_stdlib I_STDLIB
17949 #$i_string I_STRING
17950 #$i_unistd I_UNISTD
17952 $cat >>try.c <<'EOCP'
17955 # include <memory.h>
17958 # include <stdlib.h>
17961 # include <string.h>
17963 # include <strings.h>
17966 # include <unistd.h> /* Needed for NetBSD */
17972 if ((a < b) && memcmp(&a, &b, 1) < 0)
17978 if eval $compile_ok; then
17979 if $run ./try 2>/dev/null; then
17980 echo "Yes, it can."
17983 echo "No, it can't (it uses signed chars)."
17986 echo "(I can't compile the test program, so we'll assume not...)"
17994 : see if prototype for sbrk is available
17996 set d_sbrkproto sbrk $i_unistd unistd.h
17999 : see if scalbn exists
18000 set scalbn d_scalbn
18003 : see if select exists
18004 set select d_select
18007 : see if semctl exists
18008 set semctl d_semctl
18011 : see if semget exists
18012 set semget d_semget
18015 : see if semop exists
18019 : see how much of the 'sem*(2)' library is present.
18022 case "$d_semctl$d_semget$d_semop" in
18023 *"$undef"*) h_sem=false;;
18027 case "`ipcs 2>&1`" in
18028 "SVID messages"*"not configured"*)
18029 echo "Your $osname does not have the sem*(2) configured." >&4
18032 set semctl d_semctl
18034 set semget d_semget
18042 : we could also check for sys/ipc.h ...
18043 if $h_sem && $test `./findhdr sys/sem.h`; then
18044 echo "You have the full sem*(2) library." >&4
18047 echo "You don't have the full sem*(2) library." >&4
18053 : see whether sys/sem.h defines union semun
18055 $cat > try.c <<'END'
18056 #include <sys/types.h>
18057 #include <sys/ipc.h>
18058 #include <sys/sem.h>
18059 int main () { union semun semun; semun.buf = 0; }
18062 if eval $compile; then
18063 echo "You have union semun in <sys/sem.h>." >&4
18066 echo "You do not have union semun in <sys/sem.h>." >&4
18073 : see how to do semctl IPC_STAT
18077 $cat > tryh.h <<END
18080 # define S_IRUSR S_IREAD
18081 # define S_IWUSR S_IWRITE
18082 # define S_IXUSR S_IEXEC
18084 # define S_IRUSR 0400
18085 # define S_IWUSR 0200
18086 # define S_IXUSR 0100
18088 # define S_IRGRP (S_IRUSR>>3)
18089 # define S_IWGRP (S_IWUSR>>3)
18090 # define S_IXGRP (S_IXUSR>>3)
18091 # define S_IROTH (S_IRUSR>>6)
18092 # define S_IWOTH (S_IWUSR>>6)
18093 # define S_IXOTH (S_IXUSR>>6)
18096 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18097 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18098 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18101 : see whether semctl IPC_STAT can use union semun
18102 case "$d_semctl_semun" in
18106 #include <sys/types.h>
18107 #include <sys/ipc.h>
18108 #include <sys/sem.h>
18109 #include <sys/stat.h>
18116 #$d_union_semun HAS_UNION_SEMUN
18119 #ifndef HAS_UNION_SEMUN
18122 struct semid_ds *buf;
18123 unsigned short *array;
18129 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18130 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18132 struct semid_ds argbuf;
18135 st = semctl(sem, 0, IPC_STAT, arg);
18139 # endif /* IPC_STAT */
18140 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18142 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18143 # endif /* IPC_RMID */
18144 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18146 #endif /* IPC_PRIVATE && ... */
18147 printf("semget failed: errno = %d\n", errno);
18152 if eval $compile; then
18155 semun) val="$define" ;;
18163 case "$d_semctl_semun" in
18165 echo "You can use union semun for semctl IPC_STAT." >&4
18168 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18173 : see whether semctl IPC_STAT can use struct semid_ds pointer
18174 case "$d_semctl_semid_ds" in
18177 $cat > try.c <<'END'
18178 #include <sys/types.h>
18179 #include <sys/ipc.h>
18180 #include <sys/sem.h>
18181 #include <sys/stat.h>
18189 struct semid_ds arg;
18192 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18193 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18196 st = semctl(sem, 0, IPC_STAT, &arg);
18198 printf("semid_ds\n");
18200 # endif /* IPC_STAT */
18201 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18203 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18204 # endif /* IPC_RMID */
18205 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18207 #endif /* IPC_PRIVATE && ... */
18208 printf("semget failed: errno = %d\n", errno);
18214 if eval $compile; then
18217 semid_ds) val="$define" ;;
18221 set d_semctl_semid_ds
18225 case "$d_semctl_semid_ds" in
18227 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18229 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18235 # We do not have the full sem*(2) library, so assume we can not
18241 set d_semctl_semid_ds
18247 : see if sendmsg exists
18248 set sendmsg d_sendmsg
18251 : see if setegid exists
18252 set setegid d_setegid
18255 : see if seteuid exists
18256 set seteuid d_seteuid
18259 : see if setgrent exists
18260 set setgrent d_setgrent
18263 : see if setgrent_r exists
18264 set setgrent_r d_setgrent_r
18266 case "$d_setgrent_r" in
18268 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18269 case "$d_setgrent_r_proto:$usethreads" in
18270 ":define") d_setgrent_r_proto=define
18271 set d_setgrent_r_proto setgrent_r $hdrs
18275 case "$d_setgrent_r_proto" in
18277 case "$setgrent_r_proto" in
18278 ''|0) try='int setgrent_r(FILE**);'
18279 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18281 case "$setgrent_r_proto" in
18282 ''|0) try='void setgrent_r(FILE**);'
18283 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18285 case "$setgrent_r_proto" in
18286 ''|0) d_setgrent_r=undef
18288 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18289 * ) case "$setgrent_r_proto" in
18290 REENTRANT_PROTO*) ;;
18291 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18293 echo "Prototype: $try" ;;
18296 *) case "$usethreads" in
18297 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18304 *) setgrent_r_proto=0
18308 : see if sethostent exists
18309 set sethostent d_sethent
18312 : see if sethostent_r exists
18313 set sethostent_r d_sethostent_r
18315 case "$d_sethostent_r" in
18317 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18318 case "$d_sethostent_r_proto:$usethreads" in
18319 ":define") d_sethostent_r_proto=define
18320 set d_sethostent_r_proto sethostent_r $hdrs
18324 case "$d_sethostent_r_proto" in
18326 case "$sethostent_r_proto" in
18327 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18328 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18330 case "$sethostent_r_proto" in
18331 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18332 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18334 case "$sethostent_r_proto" in
18335 ''|0) d_sethostent_r=undef
18336 sethostent_r_proto=0
18337 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18338 * ) case "$sethostent_r_proto" in
18339 REENTRANT_PROTO*) ;;
18340 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18342 echo "Prototype: $try" ;;
18345 *) case "$usethreads" in
18346 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18348 d_sethostent_r=undef
18349 sethostent_r_proto=0
18353 *) sethostent_r_proto=0
18357 : see if setitimer exists
18358 set setitimer d_setitimer
18361 : see if setlinebuf exists
18362 set setlinebuf d_setlinebuf
18365 : see if setlocale exists
18366 set setlocale d_setlocale
18369 : see if locale.h is available
18370 set locale.h i_locale
18373 : see if setlocale_r exists
18374 set setlocale_r d_setlocale_r
18376 case "$d_setlocale_r" in
18378 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18379 case "$d_setlocale_r_proto:$usethreads" in
18380 ":define") d_setlocale_r_proto=define
18381 set d_setlocale_r_proto setlocale_r $hdrs
18385 case "$d_setlocale_r_proto" in
18387 case "$setlocale_r_proto" in
18388 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18389 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18391 case "$setlocale_r_proto" in
18392 ''|0) d_setlocale_r=undef
18393 setlocale_r_proto=0
18394 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18395 * ) case "$setlocale_r_proto" in
18396 REENTRANT_PROTO*) ;;
18397 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18399 echo "Prototype: $try" ;;
18402 *) case "$usethreads" in
18403 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18405 d_setlocale_r=undef
18406 setlocale_r_proto=0
18410 *) setlocale_r_proto=0
18414 : see if setnetent exists
18415 set setnetent d_setnent
18418 : see if setnetent_r exists
18419 set setnetent_r d_setnetent_r
18421 case "$d_setnetent_r" in
18423 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18424 case "$d_setnetent_r_proto:$usethreads" in
18425 ":define") d_setnetent_r_proto=define
18426 set d_setnetent_r_proto setnetent_r $hdrs
18430 case "$d_setnetent_r_proto" in
18432 case "$setnetent_r_proto" in
18433 ''|0) try='int setnetent_r(int, struct netent_data*);'
18434 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18436 case "$setnetent_r_proto" in
18437 ''|0) try='void setnetent_r(int, struct netent_data*);'
18438 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18440 case "$setnetent_r_proto" in
18441 ''|0) d_setnetent_r=undef
18442 setnetent_r_proto=0
18443 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18444 * ) case "$setnetent_r_proto" in
18445 REENTRANT_PROTO*) ;;
18446 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18448 echo "Prototype: $try" ;;
18451 *) case "$usethreads" in
18452 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18454 d_setnetent_r=undef
18455 setnetent_r_proto=0
18459 *) setnetent_r_proto=0
18463 : see if setprotoent exists
18464 set setprotoent d_setpent
18467 : see if setpgid exists
18468 set setpgid d_setpgid
18471 : see if setpgrp2 exists
18472 set setpgrp2 d_setpgrp2
18475 : see if setpriority exists
18476 set setpriority d_setprior
18479 : see if setproctitle exists
18480 set setproctitle d_setproctitle
18483 : see if setprotoent_r exists
18484 set setprotoent_r d_setprotoent_r
18486 case "$d_setprotoent_r" in
18488 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18489 case "$d_setprotoent_r_proto:$usethreads" in
18490 ":define") d_setprotoent_r_proto=define
18491 set d_setprotoent_r_proto setprotoent_r $hdrs
18495 case "$d_setprotoent_r_proto" in
18497 case "$setprotoent_r_proto" in
18498 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18499 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18501 case "$setprotoent_r_proto" in
18502 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18503 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18505 case "$setprotoent_r_proto" in
18506 ''|0) d_setprotoent_r=undef
18507 setprotoent_r_proto=0
18508 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18509 * ) case "$setprotoent_r_proto" in
18510 REENTRANT_PROTO*) ;;
18511 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18513 echo "Prototype: $try" ;;
18516 *) case "$usethreads" in
18517 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18519 d_setprotoent_r=undef
18520 setprotoent_r_proto=0
18524 *) setprotoent_r_proto=0
18528 : see if setpwent exists
18529 set setpwent d_setpwent
18532 : see if setpwent_r exists
18533 set setpwent_r d_setpwent_r
18535 case "$d_setpwent_r" in
18537 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18538 case "$d_setpwent_r_proto:$usethreads" in
18539 ":define") d_setpwent_r_proto=define
18540 set d_setpwent_r_proto setpwent_r $hdrs
18544 case "$d_setpwent_r_proto" in
18546 case "$setpwent_r_proto" in
18547 ''|0) try='int setpwent_r(FILE**);'
18548 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18550 case "$setpwent_r_proto" in
18551 ''|0) try='void setpwent_r(FILE**);'
18552 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18554 case "$setpwent_r_proto" in
18555 ''|0) d_setpwent_r=undef
18557 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18558 * ) case "$setpwent_r_proto" in
18559 REENTRANT_PROTO*) ;;
18560 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18562 echo "Prototype: $try" ;;
18565 *) case "$usethreads" in
18566 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18573 *) setpwent_r_proto=0
18577 : see if setregid exists
18578 set setregid d_setregid
18580 set setresgid d_setresgid
18583 : see if setreuid exists
18584 set setreuid d_setreuid
18586 set setresuid d_setresuid
18589 : see if setrgid exists
18590 set setrgid d_setrgid
18593 : see if setruid exists
18594 set setruid d_setruid
18597 : see if setservent exists
18598 set setservent d_setsent
18601 : see if setservent_r exists
18602 set setservent_r d_setservent_r
18604 case "$d_setservent_r" in
18606 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18607 case "$d_setservent_r_proto:$usethreads" in
18608 ":define") d_setservent_r_proto=define
18609 set d_setservent_r_proto setservent_r $hdrs
18613 case "$d_setservent_r_proto" in
18615 case "$setservent_r_proto" in
18616 ''|0) try='int setservent_r(int, struct servent_data*);'
18617 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18619 case "$setservent_r_proto" in
18620 ''|0) try='void setservent_r(int, struct servent_data*);'
18621 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18623 case "$setservent_r_proto" in
18624 ''|0) d_setservent_r=undef
18625 setservent_r_proto=0
18626 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18627 * ) case "$setservent_r_proto" in
18628 REENTRANT_PROTO*) ;;
18629 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18631 echo "Prototype: $try" ;;
18634 *) case "$usethreads" in
18635 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18637 d_setservent_r=undef
18638 setservent_r_proto=0
18642 *) setservent_r_proto=0
18646 : see if setsid exists
18647 set setsid d_setsid
18650 : see if setvbuf exists
18651 set setvbuf d_setvbuf
18654 : see if shmctl exists
18655 set shmctl d_shmctl
18658 : see if shmget exists
18659 set shmget d_shmget
18662 : see if shmat exists
18665 : see what shmat returns
18668 $cat >shmat.c <<'END'
18669 #include <sys/shm.h>
18672 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18677 echo "and it returns ($shmattype)." >&4
18678 : see if a prototype for shmat is available
18679 xxx=`./findhdr sys/shm.h`
18680 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18681 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18692 set d_shmatprototype
18695 : see if shmdt exists
18699 : see how much of the 'shm*(2)' library is present.
18702 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18703 *"$undef"*) h_shm=false;;
18707 case "`ipcs 2>&1`" in
18708 "SVID shared memory"*"not configured"*)
18709 echo "Your $osname does not have the shm*(2) configured." >&4
18712 set shmctl d_shmctl
18714 set shmget d_shmget
18724 : we could also check for sys/ipc.h ...
18725 if $h_shm && $test `./findhdr sys/shm.h`; then
18726 echo "You have the full shm*(2) library." >&4
18729 echo "You don't have the full shm*(2) library." >&4
18735 : see if we have sigaction
18737 if set sigaction val -f d_sigaction; eval $csym; $val; then
18738 echo 'sigaction() found.' >&4
18741 #include <sys/types.h>
18742 #include <signal.h>
18743 #$i_stdlib I_STDLIB
18745 #include <stdlib.h>
18749 struct sigaction act, oact;
18751 oact.sa_handler = 0;
18752 /* so that act and oact are used */
18753 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18757 if eval $compile_ok; then
18760 echo "But you don't seem to have a usable struct sigaction." >&4
18764 echo 'sigaction NOT found.' >&4
18767 set d_sigaction; eval $setvar
18770 : see what type pids are declared as in the kernel
18771 rp="What is the type of process ids on this system?"
18772 set pid_t pidtype int stdio.h sys/types.h
18775 : see what type uids are declared as in the kernel
18777 echo "Looking for the type for user ids returned by getuid()."
18778 set uid_t uidtype xxx stdio.h sys/types.h
18782 xxx=`./findhdr sys/user.h`
18783 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18785 unsigned) dflt="$1 $2" ;;
18789 *) dflt="$uidtype";;
18792 uid_t) echo "uid_t found." ;;
18793 *) rp="What is the type for user ids returned by getuid()?"
18799 : Define hasfield_t macro for Configure internal use
18800 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18801 while $test $# -ge 2; do
18803 $define) echo "#include <$2>";;
18807 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18809 if eval $compile; then
18818 : see what siginfo fields we have
18819 case "$d_sigaction" in
18821 echo "Checking if your siginfo_t has si_errno field...">&4
18822 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18825 echo "Checking if your siginfo_t has si_pid field...">&4
18826 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18829 echo "Checking if your siginfo_t has si_uid field...">&4
18830 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18833 echo "Checking if your siginfo_t has si_addr field...">&4
18834 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18837 echo "Checking if your siginfo_t has si_status field...">&4
18838 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18841 echo "Checking if your siginfo_t has si_band field...">&4
18842 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18845 echo "Checking if your siginfo_t has si_value field...">&4
18846 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18849 echo "Checking if your siginfo_t has si_fd field...">&4
18850 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18855 d_siginfo_si_errno="$undef"
18856 d_siginfo_si_pid="$undef"
18857 d_siginfo_si_uid="$undef"
18858 d_siginfo_si_addr="$undef"
18859 d_siginfo_si_status="$undef"
18860 d_siginfo_si_band="$undef"
18861 d_siginfo_si_value="$undef"
18862 d_siginfo_si_fd="$undef"
18866 : see if this is a sunmath.h system
18867 set sunmath.h i_sunmath
18870 : see if signbit exists
18871 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18874 #$i_sunmath I_SUNMATH
18878 #ifdef I_SUNMATH /* Solaris special math library */
18879 # include <sunmath.h>
18882 int main(int argc, char **argv)
18886 if ((signbit(x) == 0) && (signbit(y) != 0))
18894 if eval $compile; then
18895 if $run ./try; then
18899 $echo "Signbit seems to be available, but doesn't work as I expected."
18900 $echo "I won't use it." >&4
18911 : see if sigprocmask exists
18912 set sigprocmask d_sigprocmask
18915 : see if sigsetjmp exists
18917 case "$d_sigsetjmp" in
18920 #include <setjmp.h>
18921 #$i_stdlib I_STDLIB
18923 #include <stdlib.h>
18929 if (sigsetjmp(env,1))
18932 siglongjmp(env, 1);
18937 if eval $compile; then
18938 if $run ./try >/dev/null 2>&1; then
18939 echo "POSIX sigsetjmp found." >&4
18943 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18949 echo "sigsetjmp not found." >&4
18953 *) val="$d_sigsetjmp"
18954 case "$d_sigsetjmp" in
18955 $define) echo "POSIX sigsetjmp found." >&4;;
18956 $undef) echo "sigsetjmp not found." >&4;;
18964 : see if snprintf exists
18965 set snprintf d_snprintf
18968 : see if vsnprintf exists
18969 set vsnprintf d_vsnprintf
18972 case "$d_snprintf-$d_vsnprintf" in
18975 Checking whether your snprintf() and vsnprintf() work okay...
18977 $cat >try.c <<'EOCP'
18978 /* v?snprintf testing logic courtesy of Russ Allbery.
18979 * According to C99:
18980 * - if the buffer is too short it still must be \0-terminated
18981 * - if the buffer is too short the potentially required length
18982 * must be returned and not -1
18983 * - if the buffer is NULL the potentially required length
18984 * must be returned and not -1 or core dump
18987 #include <stdarg.h>
18991 int test (char *format, ...)
18996 va_start (args, format);
18997 count = vsnprintf (buf, sizeof buf, format, args);
19004 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
19005 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
19009 if eval $compile; then
19012 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
19014 Your snprintf() and snprintf() don't seem to be working okay.
19016 d_snprintf="$undef"
19017 d_vsnprintf="$undef"
19021 echo "(I can't seem to compile the test program--assuming they don't)"
19022 d_snprintf="$undef"
19023 d_vsnprintf="$undef"
19029 : see if sockatmark exists
19030 set sockatmark d_sockatmark
19033 : see if prototype for sockatmark is available
19035 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19038 : see if socks5_init exists
19039 set socks5_init d_socks5_init
19042 : see if sprintf returns the length of the string in the buffer as per ANSI
19043 $echo "Checking whether sprintf returns the length of the string..." >&4
19046 #$i_stdlib I_STDLIB
19048 #include <stdlib.h>
19050 #$i_string I_STRING
19052 # include <string.h>
19054 # include <strings.h>
19063 int check (size_t expect, int test) {
19064 size_t got = strlen(buffer);
19068 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
19073 int main(int argc, char **argv) {
19076 check(sprintf(buffer, ""), ++test);
19077 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
19078 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
19085 if eval $compile; then
19089 sprintf returns the length of the string (as ANSI says it should)
19091 d_sprintf_returns_strlen="$define"
19094 sprintf does not return the length of the string (how old is this system?)
19096 d_sprintf_returns_strlen="$undef"
19100 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
19101 d_sprintf_returns_strlen="$undef"
19105 : see if srand48_r exists
19106 set srand48_r d_srand48_r
19108 case "$d_srand48_r" in
19110 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19111 case "$d_srand48_r_proto:$usethreads" in
19112 ":define") d_srand48_r_proto=define
19113 set d_srand48_r_proto srand48_r $hdrs
19117 case "$d_srand48_r_proto" in
19119 case "$srand48_r_proto" in
19120 ''|0) try='int srand48_r(long, struct drand48_data*);'
19121 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19123 case "$srand48_r_proto" in
19124 ''|0) d_srand48_r=undef
19126 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19127 * ) case "$srand48_r_proto" in
19128 REENTRANT_PROTO*) ;;
19129 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19131 echo "Prototype: $try" ;;
19134 *) case "$usethreads" in
19135 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19142 *) srand48_r_proto=0
19146 : see if srandom_r exists
19147 set srandom_r d_srandom_r
19149 case "$d_srandom_r" in
19151 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19152 case "$d_srandom_r_proto:$usethreads" in
19153 ":define") d_srandom_r_proto=define
19154 set d_srandom_r_proto srandom_r $hdrs
19158 case "$d_srandom_r_proto" in
19160 case "$srandom_r_proto" in
19161 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19162 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19164 case "$srandom_r_proto" in
19165 ''|0) d_srandom_r=undef
19167 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19168 * ) case "$srandom_r_proto" in
19169 REENTRANT_PROTO*) ;;
19170 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19172 echo "Prototype: $try" ;;
19175 *) case "$usethreads" in
19176 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19183 *) srandom_r_proto=0
19187 : see if prototype for setresgid is available
19189 set d_sresgproto setresgid $i_unistd unistd.h
19192 : see if prototype for setresuid is available
19194 set d_sresuproto setresuid $i_unistd unistd.h
19197 : see if stat exists
19201 : see if sys/stat.h is available
19202 set sys/stat.h i_sysstat
19205 : see if stat knows about block sizes
19207 echo "Checking to see if your struct stat has st_blocks field..." >&4
19208 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19211 : see if this is a sys/vfs.h system
19212 set sys/vfs.h i_sysvfs
19215 : see if this is a sys/statfs.h system
19216 set sys/statfs.h i_sysstatfs
19219 : Check for statfs_s
19221 echo "Checking to see if your system supports struct statfs..." >&4
19222 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
19224 case "$d_statfs_s" in
19225 "$define") echo "Yes, it does." ;;
19226 *) echo "No, it doesn't." ;;
19230 : see if struct statfs knows about f_flags
19231 case "$d_statfs_s" in
19234 echo "Checking to see if your struct statfs has f_flags field..." >&4
19235 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
19239 set d_statfs_f_flags
19243 case "$d_statfs_f_flags" in
19244 "$define") echo "Yes, it does." ;;
19245 *) echo "No, it doesn't." ;;
19248 : see what flavor, if any, of static inline is supported
19250 echo "Checking to see if your system supports static inline..."
19251 $cat > try.c <<'EOCP'
19252 #include <stdlib.h>
19253 extern int f_via_a(int x);
19254 extern int f_via_b(int x);
19255 int main(int argc, char **argv)
19264 return EXIT_SUCCESS;
19267 return EXIT_FAILURE;
19271 $cat > a.c <<'EOCP'
19272 static INLINE int f(int x) {
19283 $cat > b.c <<'EOCP'
19284 extern int f(int x);
19292 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19293 case "$perl_static_inline" in
19294 '') # Check the various possibilities, and break out on success.
19295 # For gcc, prefer __inline__, which will still permit
19296 # cflags.SH to add in -ansi.
19297 case "$gccversion" in
19298 '') xxx="inline __inline__ __inline _inline";;
19299 *) xxx="__inline__ inline __inline _inline";;
19301 for inline in $xxx; do
19302 set try -DINLINE=$inline a.c
19303 if eval $compile && $run ./try; then
19304 # Now make sure there is no external linkage of static
19306 set try -DINLINE=$inline -DUSE_B a.c b.c
19307 if eval $compile && $run ./try; then
19308 $echo "Your compiler supports static $inline, " >&4
19309 $echo "but it also creates an external definition," >&4
19310 $echo "so I won't use it." >&4
19313 $echo "Your compiler supports static $inline." >&4
19315 perl_static_inline="static $inline";
19319 $echo "Your compiler does NOT support static $inline." >&4
19324 *inline*) # Some variant of inline exists.
19325 echo "Keeping your $hint value of $perl_static_inline."
19328 static) # No inline capabilities
19329 echo "Keeping your $hint value of $perl_static_inline."
19332 *) # Unrecognized previous value -- blindly trust the supplied
19333 # value and hope it makes sense. Use old value for
19334 # d_static_inline, if there is one.
19335 echo "Keeping your $hint value of $perl_static_inline."
19336 case "$d_static_inline" in
19338 *) val=$d_static_inline ;;
19342 # Fallback to plain 'static' if nothing worked.
19343 case "$perl_static_inline" in
19345 perl_static_inline="static"
19349 set d_static_inline
19351 $rm -f a.[co] b.[co]
19354 : Check stream access
19356 Checking how to access stdio streams by file descriptor number...
19358 case "$stdio_stream_array" in
19359 '') $cat >try.c <<EOCP
19362 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19366 for s in _iob __iob __sF
19368 set try -DSTDIO_STREAM_ARRAY=$s
19369 if eval $compile; then
19370 case "`$run ./try`" in
19371 yes) stdio_stream_array=$s; break ;;
19377 case "$stdio_stream_array" in
19379 I can't figure out how to access stdio streams by file descriptor number.
19381 d_stdio_stream_array="$undef"
19384 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19386 d_stdio_stream_array="$define"
19390 : see if strcoll exists
19391 set strcoll d_strcoll
19394 : check for structure copying
19396 echo "Checking to see if your C compiler can copy structs..." >&4
19397 $cat >try.c <<'EOCP'
19407 if $cc -c try.c >/dev/null 2>&1 ; then
19409 echo "Yup, it can."
19412 echo "Nope, it can't."
19418 : see if strerror and/or sys_errlist[] exist
19420 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19421 if set strerror val -f d_strerror; eval $csym; $val; then
19422 echo 'strerror() found.' >&4
19423 d_strerror="$define"
19424 d_strerrm='strerror(e)'
19425 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19426 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19427 d_syserrlst="$define"
19429 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19430 d_syserrlst="$undef"
19432 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19433 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19434 echo 'strerror() found in string header.' >&4
19435 d_strerror="$define"
19436 d_strerrm='strerror(e)'
19437 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19438 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19439 d_syserrlst="$define"
19441 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19442 d_syserrlst="$undef"
19444 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19445 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19446 d_strerror="$undef"
19447 d_syserrlst="$define"
19448 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19450 echo 'strerror() and sys_errlist[] NOT found.' >&4
19451 d_strerror="$undef"
19452 d_syserrlst="$undef"
19453 d_strerrm='"unknown"'
19457 : see if strerror_l exists
19458 set strerror_l d_strerror_l
19461 : see if strerror_r exists
19462 set strerror_r d_strerror_r
19464 case "$d_strerror_r" in
19466 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19467 case "$d_strerror_r_proto:$usethreads" in
19468 ":define") d_strerror_r_proto=define
19469 set d_strerror_r_proto strerror_r $hdrs
19473 case "$d_strerror_r_proto" in
19475 case "$strerror_r_proto" in
19476 ''|0) try='int strerror_r(int, char*, size_t);'
19477 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19479 case "$strerror_r_proto" in
19480 ''|0) try='int strerror_r(int, char*, int);'
19481 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19483 case "$strerror_r_proto" in
19484 ''|0) try='char* strerror_r(int, char*, size_t);'
19485 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19487 case "$strerror_r_proto" in
19488 ''|0) d_strerror_r=undef
19490 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19491 * ) case "$strerror_r_proto" in
19492 REENTRANT_PROTO*) ;;
19493 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19495 echo "Prototype: $try" ;;
19498 *) case "$usethreads" in
19499 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19506 *) strerror_r_proto=0
19510 : see if strftime exists
19511 set strftime d_strftime
19514 : see if strlcat exists
19515 set strlcat d_strlcat
19518 : see if strlcpy exists
19519 set strlcpy d_strlcpy
19522 : see if strtod exists
19523 set strtod d_strtod
19526 : see if strtol exists
19527 set strtol d_strtol
19530 : see if strtold exists
19531 set strtold d_strtold
19534 : see if strtoll exists
19535 set strtoll d_strtoll
19538 case "$d_longlong-$d_strtoll" in
19541 Checking whether your strtoll() works okay...
19543 $cat >try.c <<'EOCP'
19546 #define strtoll __strtoll
19549 #define strtoll _strtoll
19552 extern long long int strtoll(char *s, char **, int);
19553 static int bad = 0;
19554 int check(char *s, long long ell, int een) {
19557 gll = strtoll(s, 0, 10);
19558 if (!((gll == ell) && (errno == een)))
19562 check(" 1", 1LL, 0);
19563 check(" 0", 0LL, 0);
19564 check("-1", -1LL, 0);
19565 check("-9223372036854775808", -9223372036854775808LL, 0);
19566 check("-9223372036854775808", -9223372036854775808LL, 0);
19567 check(" 9223372036854775807", 9223372036854775807LL, 0);
19568 check("-9223372036854775808", -9223372036854775808LL, 0);
19569 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19570 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19576 if eval $compile; then
19579 ok) echo "Your strtoll() seems to be working okay." ;;
19581 Your strtoll() doesn't seem to be working okay.
19587 echo "(I can't seem to compile the test program--assuming it doesn't)"
19593 : see if strtoq exists
19594 set strtoq d_strtoq
19597 : see if strtoul exists
19598 set strtoul d_strtoul
19601 case "$d_strtoul" in
19604 Checking whether your strtoul() works okay...
19606 $cat >try.c <<'EOCP'
19609 extern unsigned long int strtoul(char *s, char **, int);
19610 static int bad = 0;
19611 void check(char *s, unsigned long eul, int een) {
19614 gul = strtoul(s, 0, 10);
19615 if (!((gul == eul) && (errno == een)))
19619 check(" 1", 1L, 0);
19620 check(" 0", 0L, 0);
19622 case "$longsize" in
19624 $cat >>try.c <<'EOCP'
19625 check("18446744073709551615", 18446744073709551615UL, 0);
19626 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19627 #if 0 /* strtoul() for /^-/ strings is undefined. */
19628 check("-1", 18446744073709551615UL, 0);
19629 check("-18446744073709551614", 2, 0);
19630 check("-18446744073709551615", 1, 0);
19631 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19632 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19637 $cat >>try.c <<'EOCP'
19638 check("4294967295", 4294967295UL, 0);
19639 check("4294967296", 4294967295UL, ERANGE);
19640 #if 0 /* strtoul() for /^-/ strings is undefined. */
19641 check("-1", 4294967295UL, 0);
19642 check("-4294967294", 2, 0);
19643 check("-4294967295", 1, 0);
19644 check("-4294967296", 4294967295UL, ERANGE);
19645 check("-4294967297", 4294967295UL, ERANGE);
19650 : Should we write these tests to be more portable by sprintf-ing
19651 : ~0 and then manipulating that char string as input for strtol?
19654 $cat >>try.c <<'EOCP'
19661 if eval $compile; then
19662 case "`$run ./try`" in
19663 ok) echo "Your strtoul() seems to be working okay." ;;
19665 Your strtoul() doesn't seem to be working okay.
19671 echo "(I can't seem to compile the test program--assuming it doesn't)"
19677 : see if strtoull exists
19678 set strtoull d_strtoull
19681 case "$d_longlong-$d_strtoull" in
19684 Checking whether your strtoull() works okay...
19686 $cat >try.c <<'EOCP'
19689 #define strtoull __strtoull
19692 extern unsigned long long int strtoull(char *s, char **, int);
19693 static int bad = 0;
19694 int check(char *s, long long eull, int een) {
19697 gull = strtoull(s, 0, 10);
19698 if (!((gull == eull) && (errno == een)))
19702 check(" 1", 1LL, 0);
19703 check(" 0", 0LL, 0);
19704 check("18446744073709551615", 18446744073709551615ULL, 0);
19705 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19706 #if 0 /* strtoull() for /^-/ strings is undefined. */
19707 check("-1", 18446744073709551615ULL, 0);
19708 check("-18446744073709551614", 2LL, 0);
19709 check("-18446744073709551615", 1LL, 0);
19710 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19711 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19718 if eval $compile; then
19719 case "`$run ./try`" in
19720 ok) echo "Your strtoull() seems to be working okay." ;;
19722 Your strtoull() doesn't seem to be working okay.
19724 d_strtoull="$undef"
19728 echo "(I can't seem to compile the test program--assuming it doesn't)"
19729 d_strtoull="$undef"
19734 : see if strtouq exists
19735 set strtouq d_strtouq
19738 case "$d_strtouq" in
19741 Checking whether your strtouq() works okay...
19743 $cat >try.c <<'EOCP'
19746 extern unsigned long long int strtouq(char *s, char **, int);
19747 static int bad = 0;
19748 void check(char *s, unsigned long long eull, int een) {
19749 unsigned long long gull;
19751 gull = strtouq(s, 0, 10);
19752 if (!((gull == eull) && (errno == een)))
19756 check(" 1", 1LL, 0);
19757 check(" 0", 0LL, 0);
19758 check("18446744073709551615", 18446744073709551615ULL, 0);
19759 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19760 #if 0 /* strtouq() for /^-/ strings is undefined. */
19761 check("-1", 18446744073709551615ULL, 0);
19762 check("-18446744073709551614", 2LL, 0);
19763 check("-18446744073709551615", 1LL, 0);
19764 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19765 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19773 if eval $compile; then
19774 case "`$run ./try`" in
19775 ok) echo "Your strtouq() seems to be working okay." ;;
19777 Your strtouq() doesn't seem to be working okay.
19783 echo "(I can't seem to compile the test program--assuming it doesn't)"
19789 : see if strxfrm exists
19790 set strxfrm d_strxfrm
19793 : see if symlink exists
19794 set symlink d_symlink
19797 : see if syscall exists
19798 set syscall d_syscall
19801 : see if prototype for syscall is available
19803 set d_syscallproto syscall $i_unistd unistd.h
19806 : see if sysconf exists
19807 set sysconf d_sysconf
19810 : see if system exists
19811 set system d_system
19814 : see if tcgetpgrp exists
19815 set tcgetpgrp d_tcgetpgrp
19818 : see if tcsetpgrp exists
19819 set tcsetpgrp d_tcsetpgrp
19822 : see if prototype for telldir is available
19824 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19827 : see if tgamma exists
19828 set tgamma d_tgamma
19831 : see if time exists
19833 if test "X$d_time" = X -o X"$timetype" = X; then
19834 if set time val -f d_time; eval $csym; $val; then
19835 echo 'time() found.' >&4
19837 rp="What is the type returned by time() on this system?"
19838 set time_t timetype long stdio.h sys/types.h
19841 echo 'time() not found, hope that will do.' >&4
19849 : see if timegm exists
19850 set timegm d_timegm
19853 : see if this is a sys/times.h system
19854 set sys/times.h i_systimes
19857 : see if times exists
19859 if set times val -f d_times; eval $csym; $val; then
19860 echo 'times() found.' >&4
19863 case "$i_systimes" in
19864 "$define") inc='sys/times.h';;
19866 rp="What is the type returned by times() on this system?"
19867 set clock_t clocktype long stdio.h sys/types.h $inc
19870 echo 'times() NOT found, hope that will do.' >&4
19875 : see if tmpnam_r exists
19876 set tmpnam_r d_tmpnam_r
19878 case "$d_tmpnam_r" in
19880 hdrs="$i_systypes sys/types.h define stdio.h "
19881 case "$d_tmpnam_r_proto:$usethreads" in
19882 ":define") d_tmpnam_r_proto=define
19883 set d_tmpnam_r_proto tmpnam_r $hdrs
19887 case "$d_tmpnam_r_proto" in
19889 case "$tmpnam_r_proto" in
19890 ''|0) try='char* tmpnam_r(char*);'
19891 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19893 case "$tmpnam_r_proto" in
19894 ''|0) d_tmpnam_r=undef
19896 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19897 * ) case "$tmpnam_r_proto" in
19898 REENTRANT_PROTO*) ;;
19899 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19901 echo "Prototype: $try" ;;
19904 *) case "$usethreads" in
19905 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19912 *) tmpnam_r_proto=0
19916 : see if trunc exists
19920 : see if truncate exists
19921 set truncate d_truncate
19924 : see if ttyname_r exists
19925 set ttyname_r d_ttyname_r
19927 case "$d_ttyname_r" in
19929 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19930 case "$d_ttyname_r_proto:$usethreads" in
19931 ":define") d_ttyname_r_proto=define
19932 set d_ttyname_r_proto ttyname_r $hdrs
19936 case "$d_ttyname_r_proto" in
19938 case "$ttyname_r_proto" in
19939 ''|0) try='int ttyname_r(int, char*, size_t);'
19940 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19942 case "$ttyname_r_proto" in
19943 ''|0) try='int ttyname_r(int, char*, int);'
19944 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19946 case "$ttyname_r_proto" in
19947 ''|0) try='char* ttyname_r(int, char*, int);'
19948 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19950 case "$ttyname_r_proto" in
19951 ''|0) d_ttyname_r=undef
19953 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19954 * ) case "$ttyname_r_proto" in
19955 REENTRANT_PROTO*) ;;
19956 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19958 echo "Prototype: $try" ;;
19961 *) case "$usethreads" in
19962 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19969 *) ttyname_r_proto=0
19973 : see if tzname[] exists
19975 if set tzname val -a d_tzname; eval $csym; $val; then
19977 echo 'tzname[] found.' >&4
19980 echo 'tzname[] NOT found.' >&4
19985 : Check if is a multiplatform env
19987 darwin) multiarch="$define" ;;
19989 case "$multiarch" in
19990 ''|[nN]*) multiarch="$undef" ;;
19993 : check for ordering of bytes in a UV
19995 case "$multiarch" in
19998 You seem to be doing a multiarchitecture build,
19999 skipping the byteorder check.
20005 case "$byteorder" in
20008 In the following, larger digits indicate more significance. A big-endian
20009 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
20010 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
20011 machines may have weird orders like 3412. A Cray will report 87654321,
20012 an Alpha will report 12345678. If the test program works the default is
20014 I'm now running the test program...
20018 #$i_stdlib I_STDLIB
20020 #include <stdlib.h>
20022 #include <sys/types.h>
20023 typedef $uvtype UV;
20033 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20035 u.l = (UV)0x04030201;
20036 for (i = 0; i < $uvsize; i++)
20037 printf("%c", u.c[i]+'0');
20044 if eval $compile && $run ./try > /dev/null; then
20047 [1-4][1-4][1-4][1-4]|12345678|87654321)
20048 echo "(The test program ran ok.)"
20049 echo "byteorder=$dflt"
20052 ????|????????) echo "(The test program ran ok.)" ;;
20053 *) echo "(The test program didn't run right for some reason.)" ;;
20058 (I can't seem to compile the test program. Guessing big-endian...)
20061 case "$xxx_prompt" in
20063 rp="What is the order of bytes in $uvtype?"
20076 : Checking 32bit alignedness
20079 Checking to see whether you can access character data unalignedly...
20081 case "$d_u32align" in
20082 '') $cat >try.c <<EOCP
20084 #$i_stdlib I_STDLIB
20086 #include <stdlib.h>
20088 #define U32 $u32type
20089 #define BYTEORDER 0x$byteorder
20091 #include <signal.h>
20093 $signal_t bletch(int s) { exit(4); }
20096 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20097 volatile U8 buf[8];
20101 if (sizeof(U32) != 4) {
20102 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20109 signal(SIGBUS, bletch);
20121 for (i = 0; i < 4; i++) {
20122 up = (U32*)(buf + i);
20123 if (! ((*up == 1 << (8*i)) || /* big-endian */
20124 (*up == 1 << (8*(3-i))) /* little-endian */
20128 printf("read failed (%x)\n", *up);
20134 for (i = 0; i < 4; i++) {
20135 up = (U32*)(buf + i);
20137 if (*up != 0xBeef) {
20138 printf("write failed (%x)\n", *up);
20152 if eval $compile_ok; then
20153 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20154 $run ./try 2>&1 >/dev/null
20157 You can access character data pretty unalignedly.
20159 d_u32align="$undef"
20162 It seems that you must access character data in an aligned manner.
20164 d_u32align="$define"
20168 rp='Can you access character data at unaligned addresses?'
20172 [yY]*) d_u32align="$undef" ;;
20173 *) d_u32align="$define" ;;
20180 : see if ualarm exists
20181 set ualarm d_ualarm
20184 : see if umask exists
20188 : see if unordered exists
20189 set unordered d_unordered
20192 : see if unsetenv exists
20193 set unsetenv d_unsetenv
20196 : see if usleep exists
20197 set usleep d_usleep
20200 : see if prototype for usleep is available
20202 set d_usleepproto usleep $i_unistd unistd.h
20205 : see if ustat exists
20209 : see if closedir exists
20210 set closedir d_closedir
20213 case "$d_closedir" in
20216 echo "Checking whether closedir() returns a status..." >&4
20218 #$i_dirent I_DIRENT /**/
20219 #$i_sysdir I_SYS_DIR /**/
20220 #$i_sysndir I_SYS_NDIR /**/
20221 #$i_systypes I_SYS_TYPES /**/
20223 #if defined(I_SYS_TYPES)
20224 #include <sys/types.h>
20226 #if defined(I_DIRENT)
20227 #include <dirent.h>
20230 #include <sys/ndir.h>
20234 #include <ndir.h> /* may be wrong in the future */
20236 #include <sys/dir.h>
20241 int main() { return closedir(opendir(".")); }
20244 if eval $compile_ok; then
20245 if $run ./try > /dev/null 2>&1 ; then
20246 echo "Yes, it does."
20249 echo "No, it doesn't."
20253 echo "(I can't seem to compile the test program--assuming it doesn't)"
20261 set d_void_closedir
20265 : see if there is a wait4
20269 : see if waitpid exists
20270 set waitpid d_waitpid
20275 $cat >try.c <<'EOCP'
20281 return (wcscmp (s, s) ? 1 : 0);
20286 if eval $compile; then
20289 0) echo "A working wcscmp() found." >&4
20291 *) echo "wcscmp() found, but it doesn't work" >&4
20295 echo "wcscmp() NOT found." >&4
20301 : see if wcstombs exists
20302 set wcstombs d_wcstombs
20307 $cat >try.c <<'EOCP'
20312 wchar_t dst[4], *src = L" ";
20314 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20319 if eval $compile; then
20322 0) echo "A working wcsxfrm() found." >&4
20324 *) echo "wcsxfrm() found, but it doesn't work" >&4
20328 echo "wcsxfrm() NOT found." >&4
20334 : see if wctomb exists
20335 set wctomb d_wctomb
20338 : see if writev exists
20339 set writev d_writev
20342 : check for alignment requirements
20344 case "$alignbytes" in
20345 '') echo "Checking alignment constraints..." >&4
20354 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20359 if eval $compile_ok; then
20363 echo "(I can't seem to compile the test program...)"
20365 case "$multiarch" in
20367 : The usual safe value is 8, but Darwin with -Duselongdouble
20368 : needs 16. Hence, we will take 8 as a minimum, but allow
20369 : Configure to pick a larger value if needed.
20370 if $test "$dflt" -lt 8; then
20372 echo "Setting alignment to 8 for multiarch support.">&4
20377 *) dflt="$alignbytes"
20380 rp="Doubles must be aligned on a how-many-byte boundary?"
20385 : set the base revision
20388 : length of character in bytes. Is always 1, otherwise it is not C
20389 : This used to be a test using sizeof
20392 : Check for the number of bits in a character
20393 case "$charbits" in
20394 '') echo "Checking how long a character is (in bits)..." >&4
20401 for (c = 1, n = 0; c; c <<= 1, n++) ;
20402 printf ("%d\n", n);
20407 if eval $compile_ok; then
20411 echo "(I can't seem to compile the test program. Guessing...)"
20418 rp="What is the length of a character (in bits)?"
20422 case "$charbits" in
20425 Your system has an unsigned character size of $charbits bits, which
20426 is rather unusual (normally it is 8 bits). Perl likely will not work
20427 correctly on your system, with subtle bugs in various places.
20429 rp='Do you really want to continue?'
20433 [yY]) echo >&4 "Okay, continuing." ;;
20438 : how do we concatenate cpp tokens here?
20440 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20441 $cat >cpp_stuff.c <<'EOCP'
20442 #define RCAT(a,b)a/**/b
20443 #define ACAT(a,b)a ## b
20447 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20448 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20449 echo "Oh! Smells like ANSI's been here." >&4
20450 echo "We can catify or stringify, separately or together!"
20452 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20453 echo "Ah, yes! The good old days!" >&4
20454 echo "However, in the good old days we don't know how to stringify and"
20455 echo "catify at the same time."
20459 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20460 You're going to have to edit the values of CAT[2-5] in config.h...
20462 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20466 : see if this is a db.h system
20472 : Check db version.
20474 echo "Checking Berkeley DB version ..." >&4
20480 #include <sys/types.h>
20482 #$i_stdlib I_STDLIB
20484 #include <stdlib.h>
20487 int main(int argc, char *argv[])
20489 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20490 int Major, Minor, Patch ;
20491 unsigned long Version ;
20492 (void)db_version(&Major, &Minor, &Patch) ;
20494 printf("%d %d %d %d %d %d\n",
20495 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20496 Major, Minor, Patch);
20499 printf("You have Berkeley DB Version 2 or greater.\n");
20501 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20502 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20503 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20504 Major, Minor, Patch) ;
20506 /* check that db.h & libdb are compatible */
20507 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20508 printf("db.h and libdb are incompatible.\n") ;
20512 printf("db.h and libdb are compatible.\n") ;
20514 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20515 + DB_VERSION_PATCH ;
20517 /* needs to be >= 2.3.4 */
20518 if (Version < 2003004) {
20519 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20520 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20526 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20531 printf("You have Berkeley DB Version 1.\n");
20532 exit(0); /* DB version < 2: the coast is clear. */
20534 exit(1); /* <db.h> not Berkeley DB? */
20540 if eval $compile_ok && $run ./try; then
20541 echo 'Looks OK.' >&4
20543 db_version_major=$1
20544 db_version_minor=$2
20545 db_version_patch=$3
20547 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20551 : Remove db from list of libraries to use
20552 echo "Removing unusable -ldb from library list" >&4
20553 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20556 echo "libs = $libs" >&4
20566 : Check the return type needed for hash
20568 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20574 #include <sys/types.h>
20577 #ifndef DB_VERSION_MAJOR
20578 u_int32_t hash_cb (const void* ptr, size_t size)
20584 info.hash = hash_cb;
20588 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20589 if $contains warning try.out >>/dev/null 2>&1 ; then
20592 db_hashtype='u_int32_t'
20595 : XXX Maybe we should just give up here.
20596 db_hashtype=u_int32_t
20598 echo "Help: I can't seem to compile the db test program." >&4
20599 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20602 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20604 *) db_hashtype=u_int32_t
20609 : Check the return type needed for prefix
20611 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20617 #include <sys/types.h>
20620 #ifndef DB_VERSION_MAJOR
20621 size_t prefix_cb (const DBT *key1, const DBT *key2)
20627 info.prefix = prefix_cb;
20631 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20632 if $contains warning try.out >>/dev/null 2>&1 ; then
20633 db_prefixtype='int'
20635 db_prefixtype='size_t'
20638 db_prefixtype='size_t'
20639 : XXX Maybe we should just give up here.
20641 echo "Help: I can't seem to compile the db test program." >&4
20642 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20645 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20647 *) db_prefixtype='size_t'
20651 : Include . in @INC
20654 Historically Perl has provided a final fallback of the current working
20655 directory '.' when searching for a library. This, however, can lead to
20656 problems when a Perl program which loads optional modules is called from
20657 a shared directory. This can lead to executing unexpected code.
20661 # When changing to exclude by default:
20662 case "$default_inc_excludes_dot" in
20663 $undef|false|[nN]*) dflt="n" ;;
20666 # To turn exclude off by default:
20667 #case "$default_inc_excludes_dot" in
20668 # $define|true|[yY]*) dflt="y" ;;
20672 rp='Exclude '.' from @INC by default? '
20675 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20676 *) default_inc_excludes_dot="$define" ;;
20679 : Check what kind of inf/nan your system has
20680 $echo "Checking the kind of infinities and nans you have..." >&4
20681 $echo "(The following tests may crash. That's okay.)" >&4
20683 #define DOUBLESIZE $doublesize
20684 #$d_longdbl HAS_LONG_DOUBLE
20685 #ifdef HAS_LONG_DOUBLE
20686 #define LONG_DOUBLESIZE $longdblsize
20687 #define LONG_DOUBLEKIND $longdblkind
20690 #$i_string I_STRING
20695 # include <string.h>
20698 /* Note that whether the sign bit is on or off
20699 * for NaN depends on the CPU/FPU, and possibly
20700 * can be affected by the build toolchain.
20702 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20703 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20704 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20705 * (respectively) as opposed to the more usual
20706 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20708 * Pre-IEEE-754 floating point format do not even have inf/nan support
20709 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20710 * to even mention, causing immediate SIGFPE or equivalent: this is
20711 * the case with VAX floating point, for example.
20713 static void bytes(void *v, unsigned int n) {
20714 unsigned char *p = (unsigned char *)v;
20716 for (i = 0; i < n; i++) {
20717 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20720 int main(int argc, char *argv[]) {
20721 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20722 * because some compilers are 'smart' and not only warn but refuse to
20723 * compile such 'illegal' values. */
20724 double dinf = exp(1e9);
20725 double dnan = sqrt(-1.0);
20726 #ifdef HAS_LONG_DOUBLE
20727 long double ldinf = (long double)exp(1e9);
20728 long double ldnan = (long double)sqrt(-1.0);
20729 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20730 /* the 80-bit long doubles might have garbage in their excess bytes */
20731 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20732 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20735 switch (argv[1][0]) {
20736 case '1': bytes(&dinf, sizeof(dinf)); break;
20737 case '2': bytes(&dnan, sizeof(dnan)); break;
20738 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20739 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20747 if eval $compile; then
20748 doubleinfbytes=`$run ./try 1`
20749 doublenanbytes=`$run ./try 2`
20750 case "$d_longdbl" in
20752 longdblinfbytes=`$run ./try 3`
20753 longdblnanbytes=`$run ./try 4`
20757 # Defaults in case the above test program failed.
20758 case "$doublekind" in
20759 1) # IEEE 754 32-bit LE
20760 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20761 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20763 2) # IEEE 754 32-bit BE
20764 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20765 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20767 3) # IEEE 754 64-bit LE
20768 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20769 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20771 4) # IEEE 754 64-bit BE
20772 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20773 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20775 5) # IEEE 754 128-bit LE
20776 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20777 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20779 6) # IEEE 754 128-bit BE
20780 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20781 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20783 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20784 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20785 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20787 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20788 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20789 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20791 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20792 doubleinfbytes=$undef
20793 doublenanbytes=$undef
20796 doubleinfbytes=$undef
20797 doublenanbytes=$undef
20800 case "$longdblkind" in
20801 1) # IEEE 754 128-bit LE
20802 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20803 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20805 2) # IEEE 754 128-bit BE
20806 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20807 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20809 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20810 case "$longdblsize" in
20811 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20812 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20813 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20816 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20817 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20820 longdblinfbytes=$undef
20821 longdblnanbytes=$undef
20825 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20826 case "$longdblsize" in
20827 12) # 32-bit system
20828 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20829 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20831 16) # 64-bit system
20832 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20833 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20836 longdblinfbytes=$undef
20837 longdblnanbytes=$undef
20841 5) # 128-bit LE-LE "double double"
20842 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20843 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20845 6) # 128-bit BE-BE "double double"
20846 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20847 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20849 7) # 128-bit LE-BE "double double"
20850 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20851 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20853 8) # 128-bit BE-LE "double double"
20854 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20855 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20857 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20858 longdblinfbytes=$undef
20859 longdblnanbytes=$undef
20862 longdblinfbytes=$undef
20863 longdblnanbytes=$undef
20867 # In case the program crashed the values are empty, turn them undef.
20868 case "$doubleinfbytes" in
20869 '') doubleinfbytes=$undef ;;
20871 case "$doublenanbytes" in
20872 '') doublenanbytes=$undef ;;
20874 case "$longdblinfbytes" in
20875 '') longdblinfbytes=$undef ;;
20877 case "$longdblnanbytes" in
20878 '') longdblnanbytes=$undef ;;
20882 : Check the length of the double mantissa
20883 $echo "Checking how many mantissa bits your doubles have..." >&4
20886 #$i_sunmath I_SUNMATH
20888 # include <float.h>
20891 # include <sunmath.h>
20893 #ifdef DBL_MANT_DIG
20894 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20897 int main(int argc, char *argv[]) {
20899 printf("%d\n", BITS);
20905 if eval $compile; then
20906 doublemantbits=`$run ./try`
20908 doublemantbits="$undef"
20912 : Check the length of the longdouble mantissa
20913 $echo "Checking how many mantissa bits your long doubles have..." >&4
20916 #$i_sunmath I_SUNMATH
20918 # include <float.h>
20921 # include <sunmath.h>
20923 #$d_longdbl HAS_LONG_DOUBLE
20924 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20925 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20926 /* This format has no implicit bit. Beware, however, that for
20927 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20928 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20929 * and the top bit must have been one since 387, zero is plain invalid.
20930 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20931 # define BITS LDBL_MANT_DIG
20932 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20933 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20934 * reason e.g. Irix thinks 107. But in any case, we want only
20935 * the number of real bits, the implicit bits are of no interest. */
20936 # define BITS 2 * (DBL_MANT_DIG - 1)
20938 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20942 int main(int argc, char *argv[]) {
20944 printf("%d\n", BITS);
20950 if eval $compile; then
20951 longdblmantbits=`$run ./try`
20953 longdblmantbits="$undef"
20957 : Check the length of the NV mantissa
20958 $echo "Checking how many mantissa bits your NVs have..." >&4
20959 if test "X$usequadmath" = "X$define"; then
20960 nvmantbits=112 # 128-1-15
20962 if test "X$nvsize" = "X$doublesize"; then
20963 nvmantbits="$doublemantbits"
20965 if test "X$nvsize" = "X$longdblsize"; then
20966 nvmantbits="$longdblmantbits"
20968 nvmantbits="$undef"
20973 : How can we generate normalized random numbers ?
20975 echo "Using our internal random number implementation..." >&4
20978 *-Dmy_rand=*|*-Dmy_srand=*)
20979 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20980 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20981 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20982 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20986 randfunc=Perl_drand48
20987 drand01="Perl_drand48()"
20988 seedfunc="Perl_drand48_init"
20992 : Probe whether dtrace builds an object, as newer Illumos requires an input
20993 : object file that uses at least one of the probes defined in the .d file
20994 case "$usedtrace" in
20996 case "$dtracexnolibs" in
20997 $define|true|[yY]*)
20998 dtracexnolibs=$define
20999 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
21002 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21003 dtracexnolibs=$define
21004 echo "Your dtrace accepts -xnolibs"
21005 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21006 dtracexnolibs=$undef
21007 echo "Your dtrace doesn't accept -xnolibs"
21009 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
21014 dtracexnolibs=$undef
21015 $dtrace -h -s ../perldtrace.d -o perldtrace.h
21018 case $dtracexnolibs in
21019 $define) xnolibs=-xnolibs ;;
21023 case "$dtraceobject" in
21024 $define|true|[yY]*)
21025 dtraceobject=$define
21029 #include "perldtrace.h"
21031 PERL_LOADED_FILE("dummy");
21035 dtraceobject=$undef
21036 if $cc -c -o try.o $optimize $ccflags try.c \
21037 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21038 dtraceobject=$define
21039 echo "Your dtrace builds an object file"
21042 *) dtraceobject=$undef ;;
21044 $rm_try perldtrace.o perldtrace.h
21047 : Determine if this is an EBCDIC system
21049 echo "Determining whether or not we are on an EBCDIC system..." >&4
21050 $cat >try.c <<'EOM'
21053 if ('M'==0xd4) return 0;
21060 if eval $compile_ok; then
21061 if $run ./try; then
21062 echo "You seem to speak EBCDIC." >&4
21065 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21068 echo "I'm unable to compile the test program." >&4
21069 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21075 : Check how to flush
21078 Checking how to flush all pending stdio output...
21080 # I only know how to find the first 32 possibly open files on SunOS.
21081 # See also hints/sunos_4_1.sh and util.c --AD
21083 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21085 $cat >>try.c <<EOCP
21087 #$i_stdlib I_STDLIB
21089 #include <stdlib.h>
21091 #$i_unistd I_UNISTD
21093 # include <unistd.h>
21095 #$d_sysconf HAS_SYSCONF
21096 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21097 #ifdef HAS_STDIO_STREAM_ARRAY
21098 # define STDIO_STREAM_ARRAY $stdio_stream_array
21103 p = fopen("try.out", "w");
21107 # ifdef TRY_FPRINTF
21111 #ifdef TRY_FFLUSH_NULL
21114 #ifdef TRY_FFLUSH_ALL
21116 long open_max = -1;
21117 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21118 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21120 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21121 open_max = sysconf(_SC_OPEN_MAX);
21124 open_max = FOPEN_MAX;
21127 open_max = OPEN_MAX;
21136 # ifdef HAS_STDIO_STREAM_ARRAY
21137 if (open_max > 0) {
21139 for (i = 0; i < open_max; i++)
21140 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21141 STDIO_STREAM_ARRAY[i]._file < open_max &&
21142 STDIO_STREAM_ARRAY[i]._flag)
21143 fflush(&STDIO_STREAM_ARRAY[i]);
21151 : first we have to find out how _not_ to flush
21153 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21155 set try -DTRY_FPUTC
21156 if eval $compile; then
21157 $run ./try 2>/dev/null
21160 if $test ! -s try.out -a "X$code" = X42; then
21166 set try -DTRY_FPRINTF
21167 if eval $compile; then
21168 $run ./try 2>/dev/null
21171 if $test ! -s try.out -a "X$code" = X42; then
21172 output=-DTRY_FPRINTF
21178 : check for fflush NULL behavior
21179 case "$fflushNULL" in
21180 '') set try -DTRY_FFLUSH_NULL $output
21181 if eval $compile; then
21182 $run ./try 2>/dev/null
21185 if $test -s try.out -a "X$code" = X42; then
21186 fflushNULL="`$cat try.out`"
21188 if $test "X$code" != X42; then
21190 (If this test failed, don't worry, we'll try another method shortly.)
21195 $rm -f core try.core core.try.*
21196 case "$fflushNULL" in
21198 Your fflush(NULL) works okay for output streams.
21199 Let's see if it clobbers input pipes...
21201 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21202 # bug that improperly flushes the input end of pipes. So we avoid the
21203 # autoflush on fork/system/exec support for now. :-(
21204 $cat >tryp.c <<EOCP
21207 main(int argc, char **argv)
21213 while ((i = getc(stdin)) != -1
21214 && (*bp++ = i) != '\n'
21215 && bp < &buf[1024])
21218 fprintf(stdout, "%s", buf);
21226 fflushNULL="$define"
21228 if eval $compile; then
21230 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21231 if $test "X$targethost" != X; then
21234 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21236 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21238 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21240 fflush(NULL) seems to behave okay with input streams.
21242 fflushNULL="$define"
21245 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21247 fflushNULL="$undef"
21250 $rm -f core tryp.c tryp.core core.tryp.*
21253 Your fflush(NULL) isn't working (contrary to ANSI C).
21255 fflushNULL="$undef"
21258 Cannot figure out whether your fflush(NULL) works or not.
21259 I'm assuming it doesn't (contrary to ANSI C).
21261 fflushNULL="$undef"
21265 $define|true|[yY]*)
21266 fflushNULL="$define"
21269 fflushNULL="$undef"
21272 : check explicit looping only if NULL did not work, and if the pipe
21273 : bug does not show up on an explicit flush too
21274 case "$fflushNULL" in
21276 $cat >tryp.c <<EOCP
21279 main(int argc, char **argv)
21285 while ((i = getc(stdin)) != -1
21286 && (*bp++ = i) != '\n'
21287 && bp < &buf[1024])
21290 fprintf(stdout, "%s", buf);
21299 if eval $compile; then
21301 if $test "X$targethost" != X; then
21304 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21306 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21308 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21310 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21312 : now check for fflushall behaviour
21313 case "$fflushall" in
21314 '') set try -DTRY_FFLUSH_ALL $output
21315 if eval $compile; then
21317 (Now testing the other method--but note that this also may fail.)
21319 $run ./try 2>/dev/null
21322 if $test -s try.out -a "X$code" = X42; then
21323 fflushall="`$cat try.out`"
21327 case "$fflushall" in
21329 Whew. Flushing explicitly all the stdio streams works.
21331 fflushall="$define"
21334 Sigh. Flushing explicitly all the stdio streams doesn't work.
21339 Cannot figure out whether flushing stdio streams explicitly works or not.
21340 I'm assuming it doesn't.
21346 "$define"|true|[yY]*)
21347 fflushall="$define"
21355 All is futile. Even fflush(stdin) clobbers input pipes!
21362 $rm -f core tryp.c tryp.core core.tryp.*
21364 *) fflushall="$undef"
21368 case "$fflushNULL$fflushall" in
21371 OK, I give up. I cannot figure out how to flush pending stdio output.
21372 We won't be flushing handles at all before fork/exec/popen.
21378 : Store the full pathname to the ar program for use in the C program
21379 : Respect a hint or command line value for full_ar.
21384 : Store the full pathname to the sed program for use in the C program
21387 : see what type gids are declared as in the kernel
21389 echo "Looking for the type for group ids returned by getgid()."
21390 set gid_t gidtype xxx stdio.h sys/types.h
21394 xxx=`./findhdr sys/user.h`
21395 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21397 unsigned) dflt="$1 $2" ;;
21401 *) dflt="$gidtype";;
21404 gid_t) echo "gid_t found." ;;
21405 *) rp="What is the type for group ids returned by getgid()?"
21411 : Check the size of GID
21414 *_t) zzz="$gidtype" ;;
21417 echo "Checking the size of $zzz..." >&4
21419 #include <sys/types.h>
21421 #$i_stdlib I_STDLIB
21423 #include <stdlib.h>
21426 printf("%d\n", (int)sizeof($gidtype));
21431 if eval $compile_ok; then
21435 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21438 echo "Your $zzz is $gidsize bytes long."
21443 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21447 : Check if GID is signed
21450 *_t) zzz="$gidtype" ;;
21453 echo "Checking the sign of $zzz..." >&4
21455 #include <sys/types.h>
21466 if eval $compile; then
21470 echo "(I can't execute the test program--guessing unsigned.)" >&4
21474 1) echo "Your $zzz is unsigned." ;;
21475 -1) echo "Your $zzz is signed." ;;
21481 echo "(I can't compile the test program--guessing unsigned.)" >&4
21485 : Check 64bit sizes
21488 if $test X"$quadtype" != X; then
21490 echo "Checking how to print 64-bit integers..." >&4
21492 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21493 $cat >try.c <<'EOCP'
21494 #include <sys/types.h>
21497 int q = 12345678901;
21498 printf("%ld\n", q);
21502 if eval $compile; then
21506 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21507 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21508 echo "We will use %d."
21514 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21515 $cat >try.c <<'EOCP'
21516 #include <sys/types.h>
21519 long q = 12345678901;
21520 printf("%ld\n", q);
21524 if eval $compile; then
21528 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21529 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21530 echo "We will use %ld."
21536 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21537 $cat >try.c <<'EOCP'
21538 #include <sys/types.h>
21539 #include <inttypes.h>
21542 int64_t q = 12345678901;
21543 printf("%" PRId64 "\n", q);
21547 if eval $compile; then
21551 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21552 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21553 echo "We will use the C9X style."
21559 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21561 #include <sys/types.h>
21564 $quadtype q = 12345678901;
21565 printf("%Ld\n", q);
21569 if eval $compile; then
21573 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21574 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21575 echo "We will use %Ld."
21581 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21582 $cat >try.c <<'EOCP'
21583 #include <sys/types.h>
21586 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21587 printf("%lld\n", q);
21591 if eval $compile; then
21595 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21596 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21597 echo "We will use the %lld style."
21603 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21605 #include <sys/types.h>
21608 $quadtype q = 12345678901;
21609 printf("%qd\n", q);
21613 if eval $compile; then
21617 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21618 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21619 echo "We will use %qd."
21625 if $test X"$sPRId64" = X; then
21626 echo "Cannot figure out how to print 64-bit integers." >&4
21633 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21634 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21636 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21637 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21641 : Check format strings for internal types
21643 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21645 if $test X"$ivsize" = X8; then
21646 ivdformat="$sPRId64"
21647 uvuformat="$sPRIu64"
21648 uvoformat="$sPRIo64"
21649 uvxformat="$sPRIx64"
21650 uvXUformat="$sPRIXU64"
21652 if $test X"$ivsize" = X"$longsize"; then
21659 if $test X"$ivsize" = X"$intsize"; then
21667 if $test X"$ivsize" = X"$shortsize"; then
21678 if $test X"$usequadmath" = X"$define"; then
21686 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21687 nveformat="$sPRIeldbl"
21688 nvfformat="$sPRIfldbl"
21689 nvgformat="$sPRIgldbl"
21690 nvEUformat="$sPRIEUldbl"
21691 nvFUformat="$sPRIFUldbl"
21692 nvGUformat="$sPRIGUldbl"
21703 case "$ivdformat" in
21704 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21709 : Check format string for GID
21712 $echo "Checking the format string to be used for gids..." >&4
21715 -1) if $test X"$gidsize" = X"$ivsize"; then
21716 gidformat="$ivdformat"
21718 if $test X"$gidsize" = X"$longsize"; then
21721 if $test X"$gidsize" = X"$intsize"; then
21724 if $test X"$gidsize" = X"$shortsize"; then
21731 *) if $test X"$gidsize" = X"$uvsize"; then
21732 gidformat="$uvuformat"
21734 if $test X"$gidsize" = X"$longsize"; then
21737 if $test X"$gidsize" = X"$intsize"; then
21740 if $test X"$gidsize" = X"$shortsize"; then
21749 : see if getgroups exists
21750 set getgroups d_getgrps
21753 : see if setgroups exists
21754 set setgroups d_setgrps
21757 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21759 case "$d_getgrps$d_setgrps" in
21761 case "$groupstype" in
21762 '') dflt="$gidtype" ;;
21763 *) dflt="$groupstype" ;;
21766 What type of pointer is the second argument to getgroups() and setgroups()?
21767 Usually this is the same as group ids, $gidtype, but not always.
21770 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21774 *) groupstype="$gidtype";;
21777 : check whether make sets MAKE
21779 echo "Checking if your $make program sets \$(MAKE)..." >&4
21780 case "$make_set_make" in
21782 $sed 's/^X //' > testmake.mak << 'EOF'
21784 X @echo 'maketemp="$(MAKE)"'
21786 case "`$make -f testmake.mak 2>/dev/null`" in
21787 *maketemp=*) make_set_make='#' ;;
21788 *) make_set_make="MAKE=$make" ;;
21790 $rm -f testmake.mak
21793 case "$make_set_make" in
21794 '#') echo "Yup, it does.";;
21795 *) echo "Nope, it doesn't.";;
21798 : see what type is used for mode_t
21799 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21800 set mode_t modetype int stdio.h sys/types.h
21803 : see if we need va_copy
21805 case "$i_stdarg" in
21808 #include <stdarg.h>
21810 #$i_stdlib I_STDLIB
21812 #include <stdlib.h>
21814 #include <signal.h>
21817 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21819 return vfprintf(f, fmt, *valp);
21823 myvfprintf(FILE *f, const char *fmt, va_list val)
21825 return ivfprintf(f, fmt, &val);
21829 myprintf(char *fmt, ...)
21832 va_start(val, fmt);
21833 return myvfprintf(stdout, fmt, val);
21837 main(int ac, char **av)
21839 signal(SIGSEGV, exit);
21841 myprintf("%s%cs all right, then\n", "that", '\'');
21846 if eval $compile && $run ./try 2>&1 >/dev/null; then
21847 case "`$run ./try`" in
21848 "that's all right, then")
21854 yes) echo "It seems that you don't need va_copy()." >&4
21855 need_va_copy="$undef"
21857 *) echo "It seems that va_copy() or similar will be needed." >&4
21858 need_va_copy="$define"
21863 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21864 need_va_copy="$undef"
21868 : see what type is used for size_t
21869 rp="What is the type used for the length parameter for string functions?"
21870 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21873 : check for type of arguments to gethostbyaddr.
21874 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21875 case "$d_gethbyaddr" in
21879 Checking to see what type of arguments are accepted by gethostbyaddr().
21881 hdrs="$define sys/types.h
21882 $d_socket sys/socket.h
21883 $i_niin netinet/in.h
21885 $i_unistd unistd.h"
21886 : The first arg can 'char *' or 'void *'
21887 : The second arg is some of integral type
21888 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21889 for yyy in size_t long int; do
21890 case "$netdb_host_type" in
21891 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21892 if ./protochk "$try" $hdrs; then
21893 echo "Your system accepts $xxx for the first arg."
21894 echo "...and $yyy for the second arg."
21895 netdb_host_type="$xxx"
21896 netdb_hlen_type="$yyy"
21902 : In case none of those worked, prompt the user.
21903 case "$netdb_host_type" in
21904 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21907 netdb_host_type=$ans
21908 rp='What is the type for the 2nd argument to gethostbyaddr?'
21911 netdb_hlen_type=$ans
21915 *) : no gethostbyaddr, so pick harmless defaults
21916 netdb_host_type='char *'
21917 netdb_hlen_type="$sizetype"
21920 # Remove the "const" if needed. -- but then we'll have a
21922 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21925 : check for type of argument to gethostbyname.
21926 if test "X$netdb_name_type" = X ; then
21927 case "$d_gethbyname" in
21931 Checking to see what type of argument is accepted by gethostbyname().
21933 hdrs="$define sys/types.h
21934 $d_socket sys/socket.h
21935 $i_niin netinet/in.h
21937 $i_unistd unistd.h"
21938 for xxx in "const char *" "char *"; do
21939 case "$netdb_name_type" in
21940 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21941 if ./protochk "$try" $hdrs; then
21942 echo "Your system accepts $xxx."
21943 netdb_name_type="$xxx"
21948 : In case none of those worked, prompt the user.
21949 case "$netdb_name_type" in
21950 '') rp='What is the type for the 1st argument to gethostbyname?'
21953 netdb_name_type=$ans
21957 *) : no gethostbyname, so pick harmless default
21958 netdb_name_type='char *'
21963 : check for type of 1st argument to getnetbyaddr.
21964 if test "X$netdb_net_type" = X ; then
21965 case "$d_getnbyaddr" in
21969 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21971 hdrs="$define sys/types.h
21972 $d_socket sys/socket.h
21973 $i_niin netinet/in.h
21975 $i_unistd unistd.h"
21976 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21977 case "$netdb_net_type" in
21978 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21979 if ./protochk "$try" $hdrs; then
21980 echo "Your system accepts $xxx."
21981 netdb_net_type="$xxx"
21986 : In case none of those worked, prompt the user.
21987 case "$netdb_net_type" in
21988 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21991 netdb_net_type=$ans
21995 *) : no getnetbyaddr, so pick harmless default
21996 netdb_net_type='long'
22000 : locate the preferred pager for this system
22007 [a-zA-Z]:/*) dflt=$pg;;
22011 [a-zA-Z]:/*) dflt=$more;;
22015 [a-zA-Z]:/*) dflt=$less;;
22018 '') dflt=/usr/ucb/more;;
22026 rp='What pager is used on your system?'
22030 : see if ar generates random libraries by itself
22032 echo "Checking how to generate random libraries on your machine..." >&4
22033 echo 'int bar1() { return bar2(); }' > bar1.c
22034 echo 'int bar2() { return 2; }' > bar2.c
22036 #$i_stdlib I_STDLIB
22038 #include <stdlib.h>
22040 int main() { printf("%d\n", bar1()); exit(0); }
22042 $cc $ccflags -c bar1.c >/dev/null 2>&1
22043 $cc $ccflags -c bar2.c >/dev/null 2>&1
22044 $cc $ccflags -c foo.c >/dev/null 2>&1
22045 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22046 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22047 $run ./foobar >/dev/null 2>&1; then
22048 echo "$ar appears to generate random libraries itself."
22050 if [ "X$ranlib" = "X" ]; then
22053 elif $ar s bar$_a >/dev/null 2>&1 &&
22054 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22055 $run ./foobar >/dev/null 2>&1; then
22056 echo "a table of contents needs to be added with '$ar s'."
22059 elif $ar ts bar$_a >/dev/null 2>&1 &&
22060 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22061 $run ./foobar >/dev/null 2>&1; then
22062 echo "a table of contents needs to be added with '$ar ts'."
22069 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22070 $test -f $ranlib || ranlib=''
22073 if $test -n "$ranlib"; then
22074 echo "your system has '$ranlib'; we'll use that."
22077 echo "your system doesn't seem to support random libraries"
22078 echo "so we'll use lorder and tsort to order the libraries."
22085 : see if this is a values.h system
22086 set values.h i_values
22089 : Check the max offset that gmtime and localtime accept
22090 echo "Checking max offsets that gmtime () accepts"
22093 define) yyy="#include <values.h>" ;;
22097 case "$sGMTIME_min/$sGMTIME_max" in
22100 #include <sys/types.h>
22109 void gm_check (time_t t, int min_year, int max_year)
22112 if ( tmp == NULL ||
22113 /* Check tm_year overflow */
22114 tmp->tm_year < min_year || tmp->tm_year > max_year)
22125 gm_check (MAXLONG, 69, 0x7fffffff);
22127 if (tmp == NULL || tmp->tm_year < 0) {
22128 for (i = 63; i >= 0; i--) {
22129 time_t x = pt | ((time_t)1 << i);
22130 if (x < 0 || x < pt) continue;
22131 gm_check (x, 69, 0x7fffffff);
22134 printf ("sGMTIME_max=%ld\n", pt);
22143 gm_check (MINLONG, -1900, 70);
22146 for (i = 36; i >= 0; i--) {
22147 time_t x = pt - ((time_t)1 << i);
22148 if (x > 0) continue;
22149 gm_check (x, -1900, 70);
22152 printf ("sGMTIME_min=%ld\n", pt);
22156 int main (int argc, char *argv[])
22158 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22165 if eval $compile; then
22166 eval `$run ./try 2>/dev/null`
22168 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22174 echo "Checking max offsets that localtime () accepts"
22176 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22179 #include <sys/types.h>
22188 void local_check (time_t t, int min_year, int max_year)
22190 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22193 tmp = localtime (&t);
22194 if ( tmp == NULL ||
22195 /* Check tm_year overflow */
22196 tmp->tm_year < min_year || tmp->tm_year > max_year)
22200 } /* local_check */
22207 local_check (MAXLONG, 69, 0x7fffffff);
22209 if (tmp == NULL || tmp->tm_year < 0) {
22210 for (i = 63; i >= 0; i--) {
22211 time_t x = pt | ((time_t)1 << i);
22212 if (x < 0 || x < pt) continue;
22213 local_check (x, 69, 0x7fffffff);
22216 printf ("sLOCALTIME_max=%ld\n", pt);
22225 local_check (MINLONG, -1900, 70);
22228 for (i = 36; i >= 0; i--) {
22229 time_t x = pt - ((time_t)1 << i);
22230 if (x > 0) continue;
22231 local_check (x, -1900, 70);
22234 printf ("sLOCALTIME_min=%ld\n", pt);
22238 int main (int argc, char *argv[])
22246 if eval $compile; then
22247 eval `$run ./try 2>/dev/null`
22249 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22255 : check for type of arguments to select.
22256 case "$selecttype" in
22257 '') case "$d_select" in
22261 Checking to see what type of arguments are accepted by select().
22263 hdrs="$define sys/types.h
22264 $i_systime sys/time.h
22265 $i_sysselct sys/select.h
22266 $d_socket sys/socket.h"
22267 : The first arg can be int, unsigned, or size_t
22268 : The last arg may or may not be 'const'
22270 : void pointer has been seen but using that
22271 : breaks the selectminbits test
22272 for xxx in 'fd_set *' 'int *'; do
22273 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22274 for tmo in 'struct timeval *' 'const struct timeval *'; do
22276 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22277 if ./protochk "$try" $hdrs; then
22278 echo "Your system accepts $xxx."
22287 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22288 case "$d_fd_set" in
22289 $define) dflt="fd_set *" ;;
22298 *) : no select, so pick a harmless default
22305 : check for the select 'width'
22306 case "$selectminbits" in
22307 '') safebits=`expr $ptrsize \* 8`
22308 case "$d_select" in
22312 Checking to see on how many bits at a time your select() operates...
22315 #include <sys/types.h>
22317 #$i_systime I_SYS_TIME
22318 #$i_systimek I_SYS_TIME_KERNEL
22323 # ifdef I_SYS_TIME_KERNEL
22326 # include <sys/time.h>
22327 # ifdef I_SYS_TIME_KERNEL
22331 #$i_sysselct I_SYS_SELECT
22332 #ifdef I_SYS_SELECT
22333 #include <sys/select.h>
22335 #$d_socket HAS_SOCKET
22337 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22340 #$i_stdlib I_STDLIB
22342 #include <stdlib.h>
22345 #define S sizeof(*(b))
22347 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22348 #define NBITS (NBYTES * 8)
22350 char *s = (char *)malloc(NBYTES);
22359 fp = fopen("try.c", "r");
22365 b = ($selecttype)s;
22366 for (i = 0; i < NBITS; i++)
22370 select(fd + 1, b, 0, 0, &t);
22371 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22373 printf("%d\n", i + 1);
22378 if eval $compile_ok; then
22379 selectminbits=`$run ./try 2>/dev/null`
22380 case "$selectminbits" in
22382 Cannot figure out on how many bits at a time your select() operates.
22383 I'll play safe and guess it is $safebits bits.
22385 selectminbits=$safebits
22386 bits="$safebits bits"
22389 *) bits="$selectminbits bits" ;;
22391 echo "Your select() operates on $bits at a time." >&4
22393 rp='What is the minimum number of bits your select() operates on?'
22394 case "$byteorder" in
22395 12345678) dflt=64 ;;
22401 selectminbits="$val"
22405 *) : no select, so pick a harmless default
22406 selectminbits=$safebits
22412 : Trace out the files included by signal.h, then look for SIGxxx names.
22413 case "$sig_num_init" in
22415 if [ "X$fieldn" = X ]; then
22416 : Just make some guesses. We check them later.
22417 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22419 xxx=`echo '#include <signal.h>' |
22420 $cppstdin $cppminus $cppflags 2>/dev/null |
22421 $grep '^[ ]*#.*include' |
22422 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22423 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22426 for xx in $xxx /dev/null ; do
22427 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22429 case "$xxxfiles" in
22430 '') xxxfiles=`./findhdr signal.h` ;;
22433 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22434 print substr($2, 4, 20)
22436 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22437 print substr($3, 4, 20)
22439 : Append some common names just in case the awk scan failed.
22440 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22441 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22442 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22443 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22444 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22446 : generate a few handy files for later
22447 $cat > signal.c <<EOCP
22448 #include <sys/types.h>
22449 #include <signal.h>
22450 #$i_stdlib I_STDLIB
22452 #include <stdlib.h>
22457 /* Strange style to avoid deeply-nested #if/#else/#endif */
22460 # define NSIG (_NSIG)
22466 # define NSIG (SIGMAX+1)
22472 # define NSIG (SIG_MAX+1)
22478 # define NSIG (_SIG_MAX+1)
22484 # define NSIG (MAXSIG+1)
22490 # define NSIG (MAX_SIG+1)
22495 # ifdef SIGARRAYSIZE
22496 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22502 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22506 /* Default to some arbitrary number that's big enough to get most
22507 of the common signals.
22513 printf("NSIG %d\n", NSIG);
22519 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22521 printf "#ifdef SIG"; printf $1; printf "\n"
22522 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22523 printf $1; printf ");\n"
22527 printf "#endif /* JUST_NSIG */\n";
22528 printf "exit(0);\n}\n";
22531 $cat >signal.awk <<'EOP'
22532 BEGIN { ndups = 0 }
22533 $1 ~ /^NSIG$/ { nsig = $2 }
22534 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22535 if ($2 > maxsig) { maxsig = $2 }
22536 if (sig_name[$2]) {
22537 dup_name[ndups] = $1
22538 dup_num[ndups] = $2
22550 printf("NSIG %d\n", nsig);
22551 for (n = 1; n < nsig; n++) {
22553 printf("%s %d\n", sig_name[n], sig_num[n])
22556 printf("NUM%d %d\n", n, n)
22559 for (n = 0; n < ndups; n++) {
22560 printf("%s %d\n", dup_name[n], dup_num[n])
22564 $cat >signal_cmd <<EOS
22566 if $test -s signal.lst; then
22567 echo "Using your existing signal.lst file"
22572 $cat >>signal_cmd <<'EOS'
22575 if eval $compile_ok; then
22576 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22577 $uniq | $awk -f signal.awk >signal.lst
22579 echo "(I can't seem be able to compile the whole test program)" >&4
22580 echo "(I'll try it in little pieces.)" >&4
22581 set signal -DJUST_NSIG
22582 if eval $compile_ok; then
22583 $run ./signal$_exe > signal.nsg
22586 echo "I can't seem to figure out how many signals you have." >&4
22587 echo "Guessing 50." >&4
22588 echo 'NSIG 50' > signal.nsg
22590 : Now look at all the signal names, one at a time.
22591 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22592 $cat > signal.c <<EOCP
22593 #include <sys/types.h>
22594 #include <signal.h>
22597 printf("$xx %d\n", SIG${xx});
22602 if eval $compile; then
22603 echo "SIG${xx} found."
22604 $run ./signal$_exe >> signal.ls1
22606 echo "SIG${xx} NOT found."
22609 if $test -s signal.ls1; then
22610 $cat signal.nsg signal.ls1 |
22611 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22615 if $test -s signal.lst; then
22618 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22619 echo 'kill -l' >signal
22620 set X `csh -f <signal`
22624 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22626 echo $@ | $tr ' ' $trnl | \
22627 $awk '{ printf "%s %d\n", $1, ++s; }
22628 END { printf "NSIG %d\n", ++s }' >signal.lst
22630 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22632 chmod a+x signal_cmd
22633 $eunicefix signal_cmd
22637 : generate list of signal names
22638 case "$sig_num_init" in
22641 case "$sig_name_init" in
22643 *) case "$sig_num_init" in
22644 ''|*,*) doinit=yes ;;
22649 echo "Generating a list of signal names and numbers..." >&4
22651 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22652 sig_name=`$awk 'BEGIN { printf "ZERO " }
22653 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22654 sig_num=`$awk 'BEGIN { printf "0 " }
22655 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22656 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22657 !/^NSIG/ { printf "\"%s\", ", $1 }
22658 END { printf "0\n" }' signal.lst`
22659 sig_num_init=`$awk 'BEGIN { printf "0, " }
22660 !/^NSIG/ { printf "%d, ", $2}
22661 END { printf "0\n"}' signal.lst`
22664 echo "The following $sig_count signals are available:"
22666 echo $sig_name | $awk \
22667 'BEGIN { linelen = 0 }
22669 for (i = 1; i <= NF; i++) {
22670 name = "SIG" $i " "
22671 linelen = linelen + length(name)
22672 if (linelen > 70) {
22674 linelen = length(name)
22680 sig_size=`echo $sig_name | awk '{print NF}'`
22681 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22685 : Check size of size
22687 case "$sizetype" in
22688 *_t) zzz="$sizetype" ;;
22689 *) zzz="filesize" ;;
22691 echo "Checking the size of $zzz..." >&4
22693 #include <sys/types.h>
22695 #$i_stdlib I_STDLIB
22697 #include <stdlib.h>
22700 printf("%d\n", (int)sizeof($sizetype));
22705 if eval $compile_ok; then
22709 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22712 echo "Your $zzz size is $sizesize bytes."
22717 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22721 : check for socklen_t
22723 echo "Checking to see if you have socklen_t..." >&4
22725 #include <sys/types.h>
22726 #$d_socket HAS_SOCKET
22728 #include <sys/socket.h>
22730 int main() { socklen_t x = 16; }
22733 if eval $compile; then
22735 echo "You have socklen_t."
22738 echo "You do not have socklen_t."
22739 case "$sizetype" in
22740 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22747 : see if this is a socks.h system
22748 set socks.h i_socks
22751 : check for type of the size argument to socket calls
22752 case "$d_socket" in
22756 Checking to see what type is the last argument of accept().
22759 case "$d_socklen_t" in
22760 "$define") yyy="$yyy socklen_t"
22762 yyy="$yyy $sizetype int long unsigned"
22763 for xxx in $yyy; do
22764 case "$socksizetype" in
22765 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22766 case "$usesocks" in
22768 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22769 echo "Your system accepts '$xxx *' for the last argument of accept()."
22770 socksizetype="$xxx"
22773 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22774 echo "Your system accepts '$xxx *' for the last argument of accept()."
22775 socksizetype="$xxx"
22782 : In case none of those worked, prompt the user.
22783 case "$socksizetype" in
22784 '') rp='What is the type for socket address structure sizes?'
22791 *) : no sockets, so pick relatively harmless default
22796 : see what type is used for signed size_t
22797 set ssize_t ssizetype int stdio.h sys/types.h
22802 #$i_stdlib I_STDLIB
22804 #include <stdlib.h>
22806 #include <sys/types.h>
22807 #define Size_t $sizetype
22808 #define SSize_t $dflt
22811 if (sizeof(Size_t) == sizeof(SSize_t))
22813 else if (sizeof(Size_t) == sizeof(int))
22822 if eval $compile_ok && $run ./try > /dev/null; then
22823 ssizetype=`$run ./try`
22824 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22827 Help! I can't compile and run the ssize_t test program: please enlighten me!
22828 (This is probably a misconfiguration in your system or libraries, and
22829 you really ought to fix it. Still, I'll try anyway.)
22831 I need a type that is the same size as $sizetype, but is guaranteed to
22832 be signed. Common values are ssize_t, int and long.
22835 rp="What signed type is the same size as $sizetype?"
22841 : Check the size of st_ino
22843 $echo "Checking the size of st_ino..." >&4
22844 $cat > try.c <<EOCP
22845 #include <sys/stat.h>
22847 #$i_stdlib I_STDLIB
22849 #include <stdlib.h>
22853 printf("%d\n", (int)sizeof(st.st_ino));
22858 if eval $compile_ok; then
22862 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22864 *) st_ino_size=$val
22865 $echo "Your st_ino is $st_ino_size bytes long."
22870 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22874 : Check if st_ino is signed
22876 $echo "Checking the sign of st_ino..." >&4
22877 $cat > try.c <<EOCP
22878 #include <sys/stat.h>
22883 if (foo.st_ino < 0)
22890 if eval $compile; then
22894 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22896 *) st_ino_sign=$val
22897 case "$st_ino_sign" in
22898 1) $echo "Your st_ino is unsigned." ;;
22899 -1) $echo "Your st_ino is signed." ;;
22905 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22909 : see what type of char stdio uses.
22911 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22912 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22913 echo "Your stdio uses unsigned chars." >&4
22914 stdchar="unsigned char"
22916 echo "Your stdio uses signed chars." >&4
22921 : Check size of UID
22924 *_t) zzz="$uidtype" ;;
22927 echo "Checking the size of $zzz..." >&4
22929 #include <sys/types.h>
22931 #$i_stdlib I_STDLIB
22933 #include <stdlib.h>
22936 printf("%d\n", (int)sizeof($uidtype));
22941 if eval $compile_ok; then
22945 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22948 echo "Your $zzz is $uidsize bytes long."
22953 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22956 : Check if UID is signed
22959 *_t) zzz="$uidtype" ;;
22962 echo "Checking the sign of $zzz..." >&4
22964 #include <sys/types.h>
22975 if eval $compile; then
22979 echo "(I can't execute the test program--guessing unsigned.)" >&4
22983 1) echo "Your $zzz is unsigned." ;;
22984 -1) echo "Your $zzz is signed." ;;
22990 echo "(I can't compile the test program--guessing unsigned.)" >&4
22994 : Check format string for UID
22996 $echo "Checking the format string to be used for uids..." >&4
22999 -1) if $test X"$uidsize" = X"$ivsize"; then
23000 uidformat="$ivdformat"
23002 if $test X"$uidsize" = X"$longsize"; then
23005 if $test X"$uidsize" = X"$intsize"; then
23008 if $test X"$uidsize" = X"$shortsize"; then
23015 *) if $test X"$uidsize" = X"$uvsize"; then
23016 uidformat="$uvuformat"
23018 if $test X"$uidsize" = X"$longsize"; then
23021 if $test X"$uidsize" = X"$intsize"; then
23024 if $test X"$uidsize" = X"$shortsize"; then
23033 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23035 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23036 $cat >try.c <<'EOM'
23037 /* Intentionally a long probe as I'd like to sanity check that the exact
23038 approach is going to work, as thinking it will work, but only having it
23039 part working at runtime is worse than not having it. */
23041 #include <sys/types.h>
23042 #include <sys/sysctl.h>
23043 #include <sys/param.h>
23045 #include <string.h>
23046 #include <stdlib.h>
23047 #include <unistd.h>
23050 main(int argc, char **argv) {
23052 char *argv_leaf = strrchr(argv[0], '/');
23058 mib[1] = KERN_PROC;
23059 mib[2] = KERN_PROC_PATHNAME;
23063 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23067 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23072 if (size < strlen(argv_leaf) + 1) {
23073 fprintf(stderr, "size %lu is too short for a path\n",
23074 (unsigned long) size);
23078 if (size > MAXPATHLEN * MAXPATHLEN) {
23079 fprintf(stderr, "size %lu is too long for a path\n",
23080 (unsigned long) size);
23084 buffer = (char *)malloc(size);
23090 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23095 if (strlen(buffer) + 1 != size) {
23096 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23097 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23102 if (*buffer != '/') {
23103 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23107 if (strstr(buffer, "/./")) {
23108 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23112 if (strstr(buffer, "/../")) {
23113 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23117 buffer_leaf = strrchr(buffer, '/');
23118 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23119 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23131 if eval $compile; then
23132 if $run ./try; then
23133 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23136 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23140 echo "I'm unable to compile the test program." >&4
23141 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23145 set usekernprocpathname
23148 : Determine if we can use _NSGetExecutablePath to find executing program
23150 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23151 $cat >try.c <<'EOM'
23152 /* Intentionally a long probe as I'd like to sanity check that the exact
23153 approach is going to work, as thinking it will work, but only having it
23154 part working at runtime is worse than not having it. */
23155 #include <mach-o/dyld.h>
23157 #include <stdlib.h>
23158 #include <sys/param.h>
23159 #include <string.h>
23162 main(int argc, char **argv) {
23164 uint32_t size = sizeof(buf);
23168 char *argv_leaf = strrchr(argv[0], '/');
23172 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23176 _NSGetExecutablePath(buf, &size);
23177 if (size > MAXPATHLEN * MAXPATHLEN) {
23178 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23179 (unsigned int) size);
23183 buffer = (char *)malloc(size);
23189 result = _NSGetExecutablePath(buffer, &size);
23191 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23192 result, (unsigned int) size);
23196 tidied = realpath(buffer, NULL);
23198 perror("realpath");
23204 if (*tidied != '/') {
23205 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23209 if (strstr(tidied, "/./")) {
23210 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23214 if (strstr(tidied, "/../")) {
23215 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23219 tidied_leaf = strrchr(tidied, '/');
23220 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23221 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23233 if eval $compile; then
23234 if $run ./try; then
23235 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23238 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23241 echo "I'm unable to compile the test program." >&4
23242 echo "I'll assume no _NSGetExecutablePath here." >&4
23245 set usensgetexecutablepath
23248 : Check if site customization support was requested
23249 case "$usesitecustomize" in
23250 $define|true|[Yy]*)
23251 usesitecustomize="$define"
23254 usesitecustomize="$undef"
23258 : see if prototypes support variable argument declarations
23260 case "$prototype$i_stdarg" in
23262 echo "It appears we'll be able to prototype varargs functions." >&4
23266 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23273 : determine compiler compiler
23282 if $test -f "$byacc$_exe"; then
23284 comp="byacc or $comp"
23286 if $test -f "$bison$_exe"; then
23287 comp="$comp or bison -y"
23289 rp="Which compiler compiler ($comp) shall I use?"
23298 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23304 : see if this is a assert.h system
23305 set assert.h i_assert
23308 : see if this is a bfd.h system
23312 : see if this is an execinfo.h system
23313 set execinfo.h i_execinfo
23316 : see if this is a fenv.h system
23320 : see if this is a fp.h system
23324 : see if this is a fp_class.h system
23325 set fp_class.h i_fp_class
23328 : see if gdbm.h is available
23333 : see if gdbm_open exists
23334 set gdbm_open d_gdbm_open
23336 case "$d_gdbm_open" in
23339 echo "We won't be including <gdbm.h>"
23348 : see if this is a ieeefp.h system
23349 case "$i_ieeefp" in
23350 '' ) set ieeefp.h i_ieeefp
23355 : see if this is a libutil.h system
23356 set libutil.h i_libutil
23359 : see if mach cthreads are available
23360 if test "X$usethreads" = "X$define"; then
23361 set mach/cthreads.h i_machcthr
23364 i_machcthr="$undef"
23367 : see if this is a mntent.h system
23368 set mntent.h i_mntent
23371 : see if net/errno.h is available
23373 set net/errno.h val
23376 : Unfortunately, it causes problems on some systems. Arrgh.
23379 cat > try.c <<'EOM'
23382 #include <net/errno.h>
23388 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23389 echo "We'll be including <net/errno.h>." >&4
23391 echo "We won't be including <net/errno.h>." >&4
23400 : see if netinet/tcp.h is available
23401 set netinet/tcp.h i_netinettcp
23404 : see if this is a poll.h system
23408 : see if this is a prot.h system
23412 : Preprocessor symbols
23414 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23415 $cat <<'EOSH' > Cppsym.know
23416 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23417 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23418 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23419 arch_pwr ardent ARM ARM32 atarist att386 att3b
23420 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23421 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23422 byteorder byte_order
23423 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23424 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23425 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23426 ELF encore EPI EXTENSIONS
23427 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23428 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23429 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23430 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23431 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23432 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23433 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23434 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23435 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23437 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23438 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23439 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23441 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23442 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23443 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23444 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23445 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23446 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23447 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23448 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23449 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23450 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23451 ns32000 ns32016 ns32332 ns32k nsc32000
23452 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23453 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23454 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23455 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23457 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23458 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23459 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23460 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23461 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23462 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23463 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23464 SYSV4 SYSV5 sysV68 sysV88
23465 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23466 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23467 tower32_800 tower32_850 tss
23468 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23469 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23470 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23471 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23472 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23473 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23475 vax venix VMESA vms
23476 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23477 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23480 # Maybe put other stuff here too.
23481 ./tr '-' '_' <<EOSH >>Cppsym.know
23484 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23485 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23486 $cat Cppsym.know > Cppsym.c
23487 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23488 $rm -f Cppsym.a Cppsym.b Cppsym.c
23489 cat <<EOSH > Cppsym
23491 if $test \$# -gt 0; then
23492 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23493 if $test -s Cppsym.got; then
23500 $tr " " "$trnl" | ./Cppsym.try
23506 cat <<EOSH > Cppsym.try
23508 cat <<'EOCP' > try.c
23511 #define STRINGIFY(a) "a"
23513 #if cpp_stuff == 42
23514 #define StGiFy(a) #a
23515 #define STRINGIFY(a) StGiFy(a)
23517 #if $cpp_stuff != 1 && $cpp_stuff != 42
23518 # include "Bletch: How does this C preprocessor stringify macros?"
23524 cat <<'EOSH' >> Cppsym.try
23526 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23527 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23528 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23529 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23531 echo 'return 0;}' >> try.c
23533 cat <<EOSH >> Cppsym.try
23535 case "$osname-$gccversion" in
23536 irix-) ccflags="\$ccflags -woff 1178" ;;
23537 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23539 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23541 chmod +x Cppsym.try
23542 $eunicefix Cppsym.try
23543 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23544 : Add in any Linux cpp "predefined macros":
23545 case "$osname::$gccversion" in
23546 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23548 rm -f $tHdrH'.h' $tHdrH
23550 # Filter out macro arguments, such as Linux's __INT8_C(c)
23551 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23552 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23553 if [ -s $tHdrH'_cppsym.real' ]; then
23554 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23557 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23560 : now check the C compiler for additional symbols
23561 postprocess_cc_v=''
23563 aix) postprocess_cc_v="|$tr , ' '" ;;
23570 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23573 -D*) echo "\$i" | $sed 's/^-D//';;
23574 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23579 postprocess_cc_v=''
23582 ./ccsym > ccsym1.raw
23583 if $test -s ccsym1.raw; then
23584 $sort ccsym1.raw | $uniq >ccsym.raw
23586 mv ccsym1.raw ccsym.raw
23589 $awk '/\=/ { print $0; next }
23590 { print $0"=1" }' ccsym.raw >ccsym.list
23591 $comm -13 Cppsym.true ccsym.list >ccsym.own
23592 $comm -12 Cppsym.true ccsym.list >ccsym.com
23593 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23595 if $test -z ccsym.raw; then
23596 echo "Your C compiler doesn't seem to define any symbols!" >&4
23598 echo "However, your C preprocessor defines the following symbols:"
23601 cppsymbols=`$cat Cppsym.true`
23602 cppsymbols=`echo $cppsymbols`
23603 cppccsymbols="$cppsymbols"
23605 if $test -s ccsym.com; then
23606 echo "Your C compiler and pre-processor define these symbols:"
23607 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23610 cppccsymbols=`$cat ccsym.com`
23611 cppccsymbols=`echo $cppccsymbols`
23612 $test "$silent" || sleep 1
23614 if $test -s ccsym.cpp; then
23615 $test "$also" && echo " "
23616 echo "Your C pre-processor ${also}defines the following symbols:"
23617 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23619 cppsymbols=`$cat ccsym.cpp`
23620 cppsymbols=`echo $cppsymbols`
23621 $test "$silent" || sleep 1
23623 if $test -s ccsym.own; then
23624 $test "$also" && echo " "
23625 echo "Your C compiler ${also}defines the following cpp symbols:"
23626 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23627 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23628 ccsymbols=`$cat ccsym.own`
23629 ccsymbols=`echo $ccsymbols`
23630 $test "$silent" || sleep 1
23634 : add -D_FORTIFY_SOURCE if feasible and not already there
23635 case "$gccversion" in
23636 [4567].*) case "$optimize$ccflags" in
23637 *-O*) case "$ccflags$cppsymbols" in
23638 *_FORTIFY_SOURCE=*) # Don't add it again.
23639 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23641 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23642 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23646 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23650 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23654 : see if this is a termio system
23658 if $test `./findhdr termios.h`; then
23659 set tcsetattr i_termios
23665 "$define") echo "You have POSIX termios.h... good!" >&4;;
23666 *) if ./Cppsym pyr; then
23667 case "`$run /bin/universe`" in
23668 ucb) if $test `./findhdr sgtty.h`; then
23670 echo "<sgtty.h> found." >&4
23672 echo "System is pyramid with BSD universe."
23673 ./warn "<sgtty.h> not found--you could have problems."
23675 *) if $test `./findhdr termio.h`; then
23677 echo "<termio.h> found." >&4
23679 echo "System is pyramid with USG universe."
23680 ./warn "<termio.h> not found--you could have problems."
23684 if $test `./findhdr termio.h`; then
23685 echo "<termio.h> found." >&4
23687 elif $test `./findhdr sgtty.h`; then
23688 echo "<sgtty.h> found." >&4
23691 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23694 if $test `./findhdr sgtty.h`; then
23695 echo "<sgtty.h> found." >&4
23697 elif $test `./findhdr termio.h`; then
23698 echo "<termio.h> found." >&4
23701 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23705 set i_termio; eval $setvar
23706 val=$val2; set i_sgtty; eval $setvar
23707 val=$val3; set i_termios; eval $setvar
23709 : see if stdbool is available
23710 : we want a real compile instead of Inhdr because some Solaris systems
23711 : have stdbool.h, but it can only be used if the compiler indicates it
23712 : is sufficiently c99-compliant.
23716 #include <stdbool.h>
23721 int main(int argc, char **argv)
23727 if eval $compile; then
23728 echo "<stdbool.h> found." >&4
23731 echo "<stdbool.h> NOT found." >&4
23738 : see if stddef is available
23739 set stddef.h i_stddef
23742 : see if stdint is available
23743 set stdint.h i_stdint
23746 : see if sys/access.h is available
23747 set sys/access.h i_sysaccess
23750 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23751 set sys/filio.h i_sysfilio
23754 if $test `./findhdr sys/ioctl.h`; then
23756 echo '<sys/ioctl.h> found.' >&4
23759 if $test $i_sysfilio = "$define"; then
23760 echo '<sys/ioctl.h> NOT found.' >&4
23762 $test $i_sgtty = "$define" && xxx="sgtty.h"
23763 $test $i_termio = "$define" && xxx="termio.h"
23764 $test $i_termios = "$define" && xxx="termios.h"
23765 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23771 : see if socket ioctl defs are in sys/sockio.h
23773 xxx=`./findhdr sys/sockio.h`
23774 if $test "$xxx"; then
23775 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23777 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23780 echo "No socket ioctls found in <sys/sockio.h>." >&4
23785 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23791 : see if this is a syslog.h system
23792 set syslog.h i_syslog
23795 : see if this is a sys/mode.h system
23796 set sys/mode.h i_sysmode
23799 : see if there is a sys/poll.h file
23800 set sys/poll.h i_syspoll
23803 : see if sys/resource.h has to be included
23804 set sys/resource.h i_sysresrc
23807 : see if sys/security.h is available
23808 set sys/security.h i_syssecrt
23811 : see if this is a sys/statvfs.h system
23812 set sys/statvfs.h i_sysstatvfs
23815 : see if this is a sys/un.h system
23816 set sys/un.h i_sysun
23819 : see if this is a sys/utsname.h system
23820 set sys/utsname.h i_sysutsname
23823 : see if this is a syswait system
23824 set sys/wait.h i_syswait
23827 : see if this is a ustat.h system
23828 set ustat.h i_ustat
23831 : see if this is an utime system
23832 set utime.h i_utime
23835 : see if this is a vfork system
23838 set vfork.h i_vfork
23848 echo "Looking for extensions..." >&4
23849 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23850 : contain old or inaccurate or duplicate values.
23851 nonxs_extensions=''
23853 : We do not use find because it might not be available.
23854 : We do not just use MANIFEST because the user may have dropped
23855 : some additional extensions into the source tree and expect them
23858 : Function to recursively find available extensions, ignoring DynaLoader
23859 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23860 : In 5.10.1 and later, extensions are stored in directories
23861 : like File-Glob instead of the older File/Glob/.
23865 DynaLoader|dynaload) ;;
23867 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23868 case "$this_ext" in
23869 Scalar/List/Utils) this_ext="List/Util" ;;
23870 PathTools) this_ext="Cwd" ;;
23872 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23873 if $contains " $this_ext " "$tdir/$$.tmp"; then
23875 echo "Duplicate directories detected for extension $xxx" >&4;
23876 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23877 case "$knowitall" in
23885 echo "Ok. Stopping Configure." >&4;
23886 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23889 echo "Ok. You will need to correct config.sh before running make." >&4;
23891 $ls -1 "$xxx" > "$tdir/$$.tmp";
23892 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23893 xs_extensions="$xs_extensions $this_ext";
23894 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23895 xs_extensions="$xs_extensions $this_ext";
23896 elif $test -d "$xxx"; then
23897 nonxs_extensions="$nonxs_extensions $this_ext";
23899 $rm -f "$tdir/$$.tmp";
23907 eval $find_extensions
23911 eval $find_extensions
23915 eval $find_extensions
23916 set X $xs_extensions
23918 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23919 set X $nonxs_extensions
23921 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23923 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23925 : Now see which are supported on this system.
23927 for xxx in $xs_extensions ; do
23931 amigaos) avail_ext="$avail_ext $xxx" ;;
23936 $define) avail_ext="$avail_ext $xxx" ;;
23939 GDBM_File|gdbm_fil)
23941 $define) avail_ext="$avail_ext $xxx" ;;
23944 I18N/Langinfo|i18n_lan)
23945 case "$i_langinfo$d_nl_langinfo" in
23946 $define$define) avail_ext="$avail_ext $xxx" ;;
23950 : XXX Do we need a useipcsysv variable here
23951 case "${d_msg}${d_sem}${d_shm}" in
23952 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23955 NDBM_File|ndbm_fil)
23958 case "$osname-$use64bitint" in
23961 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23964 *) avail_ext="$avail_ext $xxx" ;;
23969 ODBM_File|odbm_fil)
23970 case "${i_dbm}${i_rpcsvcdbm}" in
23972 case "$d_cplusplus" in
23973 define) ;; # delete as a function name will not work
23974 *) case "$osname-$use64bitint" in
23977 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23980 *) avail_ext="$avail_ext $xxx" ;;
23988 case "$useopcode" in
23989 true|define|y) avail_ext="$avail_ext $xxx" ;;
23993 case "$useposix" in
23994 true|define|y) avail_ext="$avail_ext $xxx" ;;
23998 case "$d_socket" in
23999 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24002 Sys/Syslog|sys/syslog)
24004 amigaos) ;; # not really very useful on AmigaOS
24006 : XXX syslog requires socket
24007 case "$d_socket" in
24008 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24014 case "$usethreads" in
24016 case "$use5005threads" in
24017 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
24021 threads|threads/shared)
24022 # threads and threads::shared are special cases.
24023 # To stop people from asking "Perl 5.8.0 was supposed
24024 # to have this new fancy threads implementation but my
24025 # perl doesn't have it" and from people trying to
24026 # (re)install the threads module using CPAN.pm and
24027 # CPAN.pm then offering to reinstall Perl 5.8.0,
24028 # the threads.pm and threads/shared.pm will always be
24029 # there, croaking informatively ("you need to rebuild
24030 # all of Perl with threads, sorry") when threads haven't
24031 # been compiled in.
24033 avail_ext="$avail_ext $xxx"
24039 cygwin) avail_ext="$avail_ext $xxx" ;;
24042 XS/APItest|xs/apitest)
24043 # This is just for testing. Skip it unless we have dynamic loading.
24046 $define) avail_ext="$avail_ext $xxx" ;;
24049 XS/Typemap|xs/typemap)
24050 # This is just for testing. Skip it unless we have dynamic loading.
24052 $define) avail_ext="$avail_ext $xxx" ;;
24055 *) avail_ext="$avail_ext $xxx"
24064 case "$onlyextensions" in
24066 *) keepextensions=''
24067 echo "You have requested that only certain extensions be included..." >&4
24068 for i in $onlyextensions; do
24069 case " $avail_ext " in
24071 echo "Keeping extension $i."
24072 keepextensions="$keepextensions $i"
24074 *) echo "Ignoring extension $i." ;;
24077 avail_ext="$keepextensions"
24081 case "$noextensions" in
24083 *) keepextensions=''
24084 echo "You have requested that certain extensions be ignored..." >&4
24085 for i in $avail_ext; do
24086 case " $noextensions " in
24087 *" $i "*) echo "Ignoring extension $i." ;;
24088 *) echo "Keeping extension $i.";
24089 keepextensions="$keepextensions $i"
24093 avail_ext="$keepextensions"
24097 : Now see which nonxs extensions are supported on this system.
24098 : For now assume all are.
24100 for xxx in $nonxs_extensions ; do
24104 *) nonxs_ext="$nonxs_ext $xxx"
24116 A number of extensions are supplied with $package. You may choose to
24117 compile these extensions for dynamic loading (the default), compile
24118 them into the $package executable (static loading), or not include
24119 them at all. Answer "none" to include no extensions.
24120 Note that DynaLoader is always built and need not be mentioned here.
24123 case "$dynamic_ext" in
24125 : Exclude those listed in static_ext
24127 for xxx in $avail_ext; do
24128 case " $static_ext " in
24130 *) dflt="$dflt $xxx" ;;
24137 *) dflt="$dynamic_ext"
24138 # Perhaps we are reusing an old out-of-date config.sh.
24141 if test X"$dynamic_ext" != X"$avail_ext"; then
24143 NOTICE: Your previous config.sh list may be incorrect.
24144 The extensions now available to you are
24146 but the default list from your previous config.sh is
24158 rp="What extensions do you wish to load dynamically?"
24161 none) dynamic_ext=' ' ;;
24162 *) dynamic_ext="$ans" ;;
24165 case "$static_ext" in
24167 : Exclude those already listed in dynamic linking
24169 for xxx in $avail_ext; do
24170 case " $dynamic_ext " in
24172 *) dflt="$dflt $xxx" ;;
24179 *) dflt="$static_ext"
24186 rp="What extensions do you wish to load statically?"
24189 none) static_ext=' ' ;;
24190 *) static_ext="$ans" ;;
24195 A number of extensions are supplied with $package. Answer "none"
24196 to include no extensions.
24197 Note that DynaLoader is always built and need not be mentioned here.
24200 case "$static_ext" in
24201 '') dflt="$avail_ext" ;;
24202 *) dflt="$static_ext"
24203 # Perhaps we are reusing an old out-of-date config.sh.
24206 if test X"$static_ext" != X"$avail_ext"; then
24208 NOTICE: Your previous config.sh list may be incorrect.
24209 The extensions now available to you are
24211 but the default list from your previous config.sh is
24220 : Exclude those that are not xs extensions
24224 rp="What extensions do you wish to include?"
24227 none) static_ext=' ' ;;
24228 *) static_ext="$ans" ;;
24233 # Encode is a special case. If we are building Encode as a static
24234 # extension, we need to explicitly list its subextensions as well.
24235 # For other nested extensions, this is handled automatically by
24236 # the appropriate Makefile.PL.
24237 case " $static_ext " in
24238 *" Encode "*) # Add the subextensions of Encode
24240 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24241 static_ext="$static_ext Encode/$xxx"
24242 known_extensions="$known_extensions Encode/$xxx"
24248 set X $dynamic_ext $static_ext $nonxs_ext
24252 # Sanity check: We require an extension suitable for use with
24253 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24254 # should show up as failures in the test suite, but it's helpful to
24255 # catch them now.) The 'extensions' list is normally sorted
24256 # alphabetically, so we need to accept either
24257 # DB_File ... Fcntl ... IO ....
24258 # or something like
24259 # Fcntl ... NDBM_File ... IO ....
24260 case " $extensions" in
24261 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24262 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24263 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24264 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24265 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24269 : Remove libraries needed only for extensions
24270 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24271 : The exception is SunOS 4.x, which needs them.
24272 case "${osname}X${osvers}" in
24276 *) case "$usedl" in
24277 $define|true|[yY]*)
24278 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24282 *) perllibs="$libs"
24288 : Remove build directory name from cppstdin so it can be used from
24289 : either the present location or the final installed location.
24291 : Get out of the UU directory to get correct path name.
24293 case "$cppstdin" in
24295 echo "Stripping down cppstdin path name"
24301 : end of configuration questions
24303 echo "End of configuration questions."
24306 : back to where it started
24307 if test -d ../UU; then
24311 : configuration may be unconditionally patched via a 'config.arch' file
24312 if $test -f config.arch; then
24313 echo "I see a config.arch file, loading it." >&4
24317 : configuration may be patched via a 'config.over' file
24318 if $test -f config.over; then
24321 rp='I see a config.over file. Do you wish to load it?'
24324 n*) echo "OK, I'll ignore it.";;
24326 echo "Configuration override changes have been loaded."
24331 : in case they want portability, strip down executable paths
24332 case "$d_portable" in
24335 echo "Stripping down executable paths..." >&4
24336 for file in $loclist $trylist; do
24338 eval $file=`basename $temp`
24343 : create config.sh file
24345 echo "Creating config.sh..." >&4
24346 $spitshell <<EOT >config.sh
24349 # This file was produced by running the Configure script. It holds all the
24350 # definitions figured out by Configure. Should you modify one of these values,
24351 # do not forget to propagate your changes by running "Configure -der". You may
24352 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24355 # Package name : $package
24356 # Source directory : $src
24357 # Configuration time: $cf_time
24358 # Configured by : $cf_by
24359 # Target system : $myuname
24362 : Add in command line options if available
24363 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24365 $spitshell <<EOT >>config.sh
24374 Revision='$Revision'
24382 alignbytes='$alignbytes'
24383 ansi2knr='$ansi2knr'
24384 aphostname='$aphostname'
24385 api_revision='$api_revision'
24386 api_subversion='$api_subversion'
24387 api_version='$api_version'
24388 api_versionstring='$api_versionstring'
24391 archlibexp='$archlibexp'
24392 archname64='$archname64'
24393 archname='$archname'
24394 archobjs='$archobjs'
24395 asctime_r_proto='$asctime_r_proto'
24404 byteorder='$byteorder'
24406 castflags='$castflags'
24409 cccdlflags='$cccdlflags'
24410 ccdlflags='$ccdlflags'
24412 ccflags_uselargefiles='$ccflags_uselargefiles'
24414 ccsymbols='$ccsymbols'
24415 ccversion='$ccversion'
24417 cf_email='$cf_email'
24419 charbits='$charbits'
24420 charsize='$charsize'
24424 clocktype='$clocktype'
24426 compress='$compress'
24427 contains='$contains'
24431 cpp_stuff='$cpp_stuff'
24432 cppccsymbols='$cppccsymbols'
24433 cppflags='$cppflags'
24435 cppminus='$cppminus'
24437 cppstdin='$cppstdin'
24438 cppsymbols='$cppsymbols'
24439 crypt_r_proto='$crypt_r_proto'
24440 cryptlib='$cryptlib'
24442 ctermid_r_proto='$ctermid_r_proto'
24443 ctime_r_proto='$ctime_r_proto'
24444 d_Gconvert='$d_Gconvert'
24445 d_PRIEUldbl='$d_PRIEUldbl'
24446 d_PRIFUldbl='$d_PRIFUldbl'
24447 d_PRIGUldbl='$d_PRIGUldbl'
24448 d_PRIXU64='$d_PRIXU64'
24449 d_PRId64='$d_PRId64'
24450 d_PRIeldbl='$d_PRIeldbl'
24451 d_PRIfldbl='$d_PRIfldbl'
24452 d_PRIgldbl='$d_PRIgldbl'
24453 d_PRIi64='$d_PRIi64'
24454 d_PRIo64='$d_PRIo64'
24455 d_PRIu64='$d_PRIu64'
24456 d_PRIx64='$d_PRIx64'
24457 d_SCNfldbl='$d_SCNfldbl'
24458 d__fwalk='$d__fwalk'
24459 d_access='$d_access'
24460 d_accessx='$d_accessx'
24464 d_archlib='$d_archlib'
24465 d_asctime64='$d_asctime64'
24466 d_asctime_r='$d_asctime_r'
24471 d_attribute_deprecated='$d_attribute_deprecated'
24472 d_attribute_format='$d_attribute_format'
24473 d_attribute_malloc='$d_attribute_malloc'
24474 d_attribute_nonnull='$d_attribute_nonnull'
24475 d_attribute_noreturn='$d_attribute_noreturn'
24476 d_attribute_pure='$d_attribute_pure'
24477 d_attribute_unused='$d_attribute_unused'
24478 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24479 d_backtrace='$d_backtrace'
24483 d_bsdgetpgrp='$d_bsdgetpgrp'
24484 d_bsdsetpgrp='$d_bsdsetpgrp'
24485 d_builtin_choose_expr='$d_builtin_choose_expr'
24486 d_builtin_expect='$d_builtin_expect'
24488 d_c99_variadic_macros='$d_c99_variadic_macros'
24489 d_casti32='$d_casti32'
24490 d_castneg='$d_castneg'
24492 d_charvspr='$d_charvspr'
24494 d_chroot='$d_chroot'
24495 d_chsize='$d_chsize'
24497 d_clearenv='$d_clearenv'
24498 d_closedir='$d_closedir'
24499 d_cmsghdr_s='$d_cmsghdr_s'
24501 d_copysign='$d_copysign'
24502 d_copysignl='$d_copysignl'
24503 d_cplusplus='$d_cplusplus'
24505 d_crypt_r='$d_crypt_r'
24507 d_ctermid='$d_ctermid'
24508 d_ctermid_r='$d_ctermid_r'
24509 d_ctime64='$d_ctime64'
24510 d_ctime_r='$d_ctime_r'
24511 d_cuserid='$d_cuserid'
24512 d_dbl_dig='$d_dbl_dig'
24513 d_dbminitproto='$d_dbminitproto'
24514 d_difftime64='$d_difftime64'
24515 d_difftime='$d_difftime'
24516 d_dir_dd_fd='$d_dir_dd_fd'
24518 d_dirnamlen='$d_dirnamlen'
24519 d_dladdr='$d_dladdr'
24520 d_dlerror='$d_dlerror'
24521 d_dlopen='$d_dlopen'
24522 d_dlsymun='$d_dlsymun'
24523 d_dosuid='$d_dosuid'
24524 d_double_has_inf='$d_double_has_inf'
24525 d_double_has_nan='$d_double_has_nan'
24526 d_double_has_negative_zero='$d_double_has_negative_zero'
24527 d_double_has_subnormals='$d_double_has_subnormals'
24528 d_double_style_cray='$d_double_style_cray'
24529 d_double_style_ibm='$d_double_style_ibm'
24530 d_double_style_ieee='$d_double_style_ieee'
24531 d_double_style_vax='$d_double_style_vax'
24532 d_drand48_r='$d_drand48_r'
24533 d_drand48proto='$d_drand48proto'
24535 d_duplocale='$d_duplocale'
24536 d_eaccess='$d_eaccess'
24537 d_endgrent='$d_endgrent'
24538 d_endgrent_r='$d_endgrent_r'
24539 d_endhent='$d_endhent'
24540 d_endhostent_r='$d_endhostent_r'
24541 d_endnent='$d_endnent'
24542 d_endnetent_r='$d_endnetent_r'
24543 d_endpent='$d_endpent'
24544 d_endprotoent_r='$d_endprotoent_r'
24545 d_endpwent='$d_endpwent'
24546 d_endpwent_r='$d_endpwent_r'
24547 d_endsent='$d_endsent'
24548 d_endservent_r='$d_endservent_r'
24549 d_eofnblk='$d_eofnblk'
24552 d_eunice='$d_eunice'
24555 d_faststdio='$d_faststdio'
24556 d_fchdir='$d_fchdir'
24557 d_fchmod='$d_fchmod'
24558 d_fchmodat='$d_fchmodat'
24559 d_fchown='$d_fchown'
24561 d_fcntl_can_lock='$d_fcntl_can_lock'
24562 d_fd_macros='$d_fd_macros'
24563 d_fd_set='$d_fd_set'
24564 d_fdclose='$d_fdclose'
24566 d_fds_bits='$d_fds_bits'
24567 d_fegetround='$d_fegetround'
24568 d_fgetpos='$d_fgetpos'
24569 d_finite='$d_finite'
24570 d_finitel='$d_finitel'
24571 d_flexfnam='$d_flexfnam'
24573 d_flockproto='$d_flockproto'
24578 d_fp_class='$d_fp_class'
24579 d_fp_classify='$d_fp_classify'
24580 d_fp_classl='$d_fp_classl'
24581 d_fpathconf='$d_fpathconf'
24582 d_fpclass='$d_fpclass'
24583 d_fpclassify='$d_fpclassify'
24584 d_fpclassl='$d_fpclassl'
24585 d_fpgetround='$d_fpgetround'
24586 d_fpos64_t='$d_fpos64_t'
24587 d_freelocale='$d_freelocale'
24588 d_frexpl='$d_frexpl'
24589 d_fs_data_s='$d_fs_data_s'
24590 d_fseeko='$d_fseeko'
24591 d_fsetpos='$d_fsetpos'
24592 d_fstatfs='$d_fstatfs'
24593 d_fstatvfs='$d_fstatvfs'
24595 d_ftello='$d_ftello'
24597 d_futimes='$d_futimes'
24598 d_gai_strerror='$d_gai_strerror'
24599 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24600 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24601 d_getaddrinfo='$d_getaddrinfo'
24602 d_getcwd='$d_getcwd'
24603 d_getespwnam='$d_getespwnam'
24604 d_getfsstat='$d_getfsstat'
24605 d_getgrent='$d_getgrent'
24606 d_getgrent_r='$d_getgrent_r'
24607 d_getgrgid_r='$d_getgrgid_r'
24608 d_getgrnam_r='$d_getgrnam_r'
24609 d_getgrps='$d_getgrps'
24610 d_gethbyaddr='$d_gethbyaddr'
24611 d_gethbyname='$d_gethbyname'
24612 d_gethent='$d_gethent'
24613 d_gethname='$d_gethname'
24614 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24615 d_gethostbyname_r='$d_gethostbyname_r'
24616 d_gethostent_r='$d_gethostent_r'
24617 d_gethostprotos='$d_gethostprotos'
24618 d_getitimer='$d_getitimer'
24619 d_getlogin='$d_getlogin'
24620 d_getlogin_r='$d_getlogin_r'
24621 d_getmnt='$d_getmnt'
24622 d_getmntent='$d_getmntent'
24623 d_getnameinfo='$d_getnameinfo'
24624 d_getnbyaddr='$d_getnbyaddr'
24625 d_getnbyname='$d_getnbyname'
24626 d_getnent='$d_getnent'
24627 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24628 d_getnetbyname_r='$d_getnetbyname_r'
24629 d_getnetent_r='$d_getnetent_r'
24630 d_getnetprotos='$d_getnetprotos'
24631 d_getpagsz='$d_getpagsz'
24632 d_getpbyname='$d_getpbyname'
24633 d_getpbynumber='$d_getpbynumber'
24634 d_getpent='$d_getpent'
24635 d_getpgid='$d_getpgid'
24636 d_getpgrp2='$d_getpgrp2'
24637 d_getpgrp='$d_getpgrp'
24638 d_getppid='$d_getppid'
24639 d_getprior='$d_getprior'
24640 d_getprotobyname_r='$d_getprotobyname_r'
24641 d_getprotobynumber_r='$d_getprotobynumber_r'
24642 d_getprotoent_r='$d_getprotoent_r'
24643 d_getprotoprotos='$d_getprotoprotos'
24644 d_getprpwnam='$d_getprpwnam'
24645 d_getpwent='$d_getpwent'
24646 d_getpwent_r='$d_getpwent_r'
24647 d_getpwnam_r='$d_getpwnam_r'
24648 d_getpwuid_r='$d_getpwuid_r'
24649 d_getsbyname='$d_getsbyname'
24650 d_getsbyport='$d_getsbyport'
24651 d_getsent='$d_getsent'
24652 d_getservbyname_r='$d_getservbyname_r'
24653 d_getservbyport_r='$d_getservbyport_r'
24654 d_getservent_r='$d_getservent_r'
24655 d_getservprotos='$d_getservprotos'
24656 d_getspnam='$d_getspnam'
24657 d_getspnam_r='$d_getspnam_r'
24658 d_gettimeod='$d_gettimeod'
24659 d_gmtime64='$d_gmtime64'
24660 d_gmtime_r='$d_gmtime_r'
24661 d_gnulibc='$d_gnulibc'
24662 d_grpasswd='$d_grpasswd'
24663 d_hasmntopt='$d_hasmntopt'
24667 d_ilogbl='$d_ilogbl'
24668 d_inc_version_list='$d_inc_version_list'
24670 d_inetaton='$d_inetaton'
24671 d_inetntop='$d_inetntop'
24672 d_inetpton='$d_inetpton'
24673 d_int64_t='$d_int64_t'
24674 d_ip_mreq='$d_ip_mreq'
24675 d_ip_mreq_source='$d_ip_mreq_source'
24676 d_ipv6_mreq='$d_ipv6_mreq'
24677 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24678 d_isascii='$d_isascii'
24679 d_isblank='$d_isblank'
24680 d_isfinite='$d_isfinite'
24681 d_isfinitel='$d_isfinitel'
24683 d_isinfl='$d_isinfl'
24684 d_isless='$d_isless'
24686 d_isnanl='$d_isnanl'
24687 d_isnormal='$d_isnormal'
24690 d_killpg='$d_killpg'
24691 d_lc_monetary_2008='$d_lc_monetary_2008'
24692 d_lchown='$d_lchown'
24693 d_ldbl_dig='$d_ldbl_dig'
24694 d_ldexpl='$d_ldexpl'
24695 d_lgamma='$d_lgamma'
24696 d_lgamma_r='$d_lgamma_r'
24697 d_libm_lib_version='$d_libm_lib_version'
24698 d_libname_unique='$d_libname_unique'
24700 d_linkat='$d_linkat'
24701 d_llrint='$d_llrint'
24702 d_llrintl='$d_llrintl'
24703 d_llround='$d_llround'
24704 d_llroundl='$d_llroundl'
24705 d_localtime64='$d_localtime64'
24706 d_localtime_r='$d_localtime_r'
24707 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24708 d_locconv='$d_locconv'
24713 d_long_double_style_ieee='$d_long_double_style_ieee'
24714 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24715 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24716 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24717 d_long_double_style_vax='$d_long_double_style_vax'
24718 d_longdbl='$d_longdbl'
24719 d_longlong='$d_longlong'
24721 d_lrintl='$d_lrintl'
24722 d_lround='$d_lround'
24723 d_lroundl='$d_lroundl'
24724 d_lseekproto='$d_lseekproto'
24726 d_madvise='$d_madvise'
24727 d_malloc_good_size='$d_malloc_good_size'
24728 d_malloc_size='$d_malloc_size'
24730 d_mbstowcs='$d_mbstowcs'
24731 d_mbtowc='$d_mbtowc'
24732 d_memchr='$d_memchr'
24733 d_memcmp='$d_memcmp'
24734 d_memcpy='$d_memcpy'
24735 d_memmem='$d_memmem'
24736 d_memmove='$d_memmove'
24737 d_memset='$d_memset'
24739 d_mkdtemp='$d_mkdtemp'
24740 d_mkfifo='$d_mkfifo'
24741 d_mkstemp='$d_mkstemp'
24742 d_mkstemps='$d_mkstemps'
24743 d_mktime64='$d_mktime64'
24744 d_mktime='$d_mktime'
24747 d_modflproto='$d_modflproto'
24748 d_mprotect='$d_mprotect'
24750 d_msg_ctrunc='$d_msg_ctrunc'
24751 d_msg_dontroute='$d_msg_dontroute'
24752 d_msg_oob='$d_msg_oob'
24753 d_msg_peek='$d_msg_peek'
24754 d_msg_proxy='$d_msg_proxy'
24755 d_msgctl='$d_msgctl'
24756 d_msgget='$d_msgget'
24757 d_msghdr_s='$d_msghdr_s'
24758 d_msgrcv='$d_msgrcv'
24759 d_msgsnd='$d_msgsnd'
24761 d_munmap='$d_munmap'
24762 d_mymalloc='$d_mymalloc'
24765 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24766 d_nearbyint='$d_nearbyint'
24767 d_newlocale='$d_newlocale'
24768 d_nextafter='$d_nextafter'
24769 d_nexttoward='$d_nexttoward'
24771 d_nl_langinfo='$d_nl_langinfo'
24772 d_nv_preserves_uv='$d_nv_preserves_uv'
24773 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24774 d_off64_t='$d_off64_t'
24775 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24776 d_oldpthreads='$d_oldpthreads'
24777 d_oldsock='$d_oldsock'
24779 d_openat='$d_openat'
24780 d_pathconf='$d_pathconf'
24782 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24783 d_phostname='$d_phostname'
24786 d_portable='$d_portable'
24788 d_prctl_set_name='$d_prctl_set_name'
24789 d_printf_format_null='$d_printf_format_null'
24790 d_procselfexe='$d_procselfexe'
24791 d_pseudofork='$d_pseudofork'
24792 d_pthread_atfork='$d_pthread_atfork'
24793 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24794 d_pthread_yield='$d_pthread_yield'
24795 d_ptrdiff_t='$d_ptrdiff_t'
24797 d_pwchange='$d_pwchange'
24798 d_pwclass='$d_pwclass'
24799 d_pwcomment='$d_pwcomment'
24800 d_pwexpire='$d_pwexpire'
24801 d_pwgecos='$d_pwgecos'
24802 d_pwpasswd='$d_pwpasswd'
24803 d_pwquota='$d_pwquota'
24806 d_querylocale='$d_querylocale'
24807 d_random_r='$d_random_r'
24808 d_re_comp='$d_re_comp'
24809 d_readdir64_r='$d_readdir64_r'
24810 d_readdir='$d_readdir'
24811 d_readdir_r='$d_readdir_r'
24812 d_readlink='$d_readlink'
24814 d_recvmsg='$d_recvmsg'
24815 d_regcmp='$d_regcmp'
24816 d_regcomp='$d_regcomp'
24817 d_remainder='$d_remainder'
24818 d_remquo='$d_remquo'
24819 d_rename='$d_rename'
24820 d_renameat='$d_renameat'
24821 d_rewinddir='$d_rewinddir'
24825 d_safebcpy='$d_safebcpy'
24826 d_safemcpy='$d_safemcpy'
24827 d_sanemcmp='$d_sanemcmp'
24828 d_sbrkproto='$d_sbrkproto'
24829 d_scalbn='$d_scalbn'
24830 d_scalbnl='$d_scalbnl'
24831 d_sched_yield='$d_sched_yield'
24832 d_scm_rights='$d_scm_rights'
24833 d_seekdir='$d_seekdir'
24834 d_select='$d_select'
24836 d_semctl='$d_semctl'
24837 d_semctl_semid_ds='$d_semctl_semid_ds'
24838 d_semctl_semun='$d_semctl_semun'
24839 d_semget='$d_semget'
24841 d_sendmsg='$d_sendmsg'
24842 d_setegid='$d_setegid'
24843 d_seteuid='$d_seteuid'
24844 d_setgrent='$d_setgrent'
24845 d_setgrent_r='$d_setgrent_r'
24846 d_setgrps='$d_setgrps'
24847 d_sethent='$d_sethent'
24848 d_sethostent_r='$d_sethostent_r'
24849 d_setitimer='$d_setitimer'
24850 d_setlinebuf='$d_setlinebuf'
24851 d_setlocale='$d_setlocale'
24852 d_setlocale_r='$d_setlocale_r'
24853 d_setnent='$d_setnent'
24854 d_setnetent_r='$d_setnetent_r'
24855 d_setpent='$d_setpent'
24856 d_setpgid='$d_setpgid'
24857 d_setpgrp2='$d_setpgrp2'
24858 d_setpgrp='$d_setpgrp'
24859 d_setprior='$d_setprior'
24860 d_setproctitle='$d_setproctitle'
24861 d_setprotoent_r='$d_setprotoent_r'
24862 d_setpwent='$d_setpwent'
24863 d_setpwent_r='$d_setpwent_r'
24864 d_setregid='$d_setregid'
24865 d_setresgid='$d_setresgid'
24866 d_setresuid='$d_setresuid'
24867 d_setreuid='$d_setreuid'
24868 d_setrgid='$d_setrgid'
24869 d_setruid='$d_setruid'
24870 d_setsent='$d_setsent'
24871 d_setservent_r='$d_setservent_r'
24872 d_setsid='$d_setsid'
24873 d_setvbuf='$d_setvbuf'
24876 d_shmatprototype='$d_shmatprototype'
24877 d_shmctl='$d_shmctl'
24879 d_shmget='$d_shmget'
24880 d_sigaction='$d_sigaction'
24881 d_siginfo_si_addr='$d_siginfo_si_addr'
24882 d_siginfo_si_band='$d_siginfo_si_band'
24883 d_siginfo_si_errno='$d_siginfo_si_errno'
24884 d_siginfo_si_fd='$d_siginfo_si_fd'
24885 d_siginfo_si_pid='$d_siginfo_si_pid'
24886 d_siginfo_si_status='$d_siginfo_si_status'
24887 d_siginfo_si_uid='$d_siginfo_si_uid'
24888 d_siginfo_si_value='$d_siginfo_si_value'
24889 d_signbit='$d_signbit'
24890 d_sigprocmask='$d_sigprocmask'
24891 d_sigsetjmp='$d_sigsetjmp'
24892 d_sin6_scope_id='$d_sin6_scope_id'
24893 d_sitearch='$d_sitearch'
24894 d_snprintf='$d_snprintf'
24895 d_sockaddr_in6='$d_sockaddr_in6'
24896 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24897 d_sockatmark='$d_sockatmark'
24898 d_sockatmarkproto='$d_sockatmarkproto'
24899 d_socket='$d_socket'
24900 d_socklen_t='$d_socklen_t'
24901 d_sockpair='$d_sockpair'
24902 d_socks5_init='$d_socks5_init'
24903 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24905 d_srand48_r='$d_srand48_r'
24906 d_srandom_r='$d_srandom_r'
24907 d_sresgproto='$d_sresgproto'
24908 d_sresuproto='$d_sresuproto'
24910 d_statblks='$d_statblks'
24911 d_statfs_f_flags='$d_statfs_f_flags'
24912 d_statfs_s='$d_statfs_s'
24913 d_static_inline='$d_static_inline'
24914 d_statvfs='$d_statvfs'
24915 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24916 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24917 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24918 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24919 d_stdio_stream_array='$d_stdio_stream_array'
24920 d_stdiobase='$d_stdiobase'
24921 d_stdstdio='$d_stdstdio'
24922 d_strchr='$d_strchr'
24923 d_strcoll='$d_strcoll'
24924 d_strctcpy='$d_strctcpy'
24925 d_strerrm='$d_strerrm'
24926 d_strerror='$d_strerror'
24927 d_strerror_l='$d_strerror_l'
24928 d_strerror_r='$d_strerror_r'
24929 d_strftime='$d_strftime'
24930 d_strlcat='$d_strlcat'
24931 d_strlcpy='$d_strlcpy'
24932 d_strtod='$d_strtod'
24933 d_strtol='$d_strtol'
24934 d_strtold='$d_strtold'
24935 d_strtoll='$d_strtoll'
24936 d_strtoq='$d_strtoq'
24937 d_strtoul='$d_strtoul'
24938 d_strtoull='$d_strtoull'
24939 d_strtouq='$d_strtouq'
24940 d_strxfrm='$d_strxfrm'
24941 d_suidsafe='$d_suidsafe'
24942 d_symlink='$d_symlink'
24943 d_syscall='$d_syscall'
24944 d_syscallproto='$d_syscallproto'
24945 d_sysconf='$d_sysconf'
24946 d_sysernlst='$d_sysernlst'
24947 d_syserrlst='$d_syserrlst'
24948 d_system='$d_system'
24949 d_tcgetpgrp='$d_tcgetpgrp'
24950 d_tcsetpgrp='$d_tcsetpgrp'
24951 d_telldir='$d_telldir'
24952 d_telldirproto='$d_telldirproto'
24953 d_tgamma='$d_tgamma'
24955 d_timegm='$d_timegm'
24957 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24958 d_tm_tm_zone='$d_tm_tm_zone'
24959 d_tmpnam_r='$d_tmpnam_r'
24961 d_truncate='$d_truncate'
24962 d_truncl='$d_truncl'
24963 d_ttyname_r='$d_ttyname_r'
24964 d_tzname='$d_tzname'
24965 d_u32align='$d_u32align'
24966 d_ualarm='$d_ualarm'
24969 d_union_semun='$d_union_semun'
24970 d_unlinkat='$d_unlinkat'
24971 d_unordered='$d_unordered'
24972 d_unsetenv='$d_unsetenv'
24973 d_uselocale='$d_uselocale'
24974 d_usleep='$d_usleep'
24975 d_usleepproto='$d_usleepproto'
24977 d_vendorarch='$d_vendorarch'
24978 d_vendorbin='$d_vendorbin'
24979 d_vendorlib='$d_vendorlib'
24980 d_vendorscript='$d_vendorscript'
24982 d_void_closedir='$d_void_closedir'
24983 d_voidsig='$d_voidsig'
24984 d_voidtty='$d_voidtty'
24985 d_volatile='$d_volatile'
24986 d_vprintf='$d_vprintf'
24987 d_vsnprintf='$d_vsnprintf'
24989 d_waitpid='$d_waitpid'
24990 d_wcscmp='$d_wcscmp'
24991 d_wcstombs='$d_wcstombs'
24992 d_wcsxfrm='$d_wcsxfrm'
24993 d_wctomb='$d_wctomb'
24994 d_writev='$d_writev'
24997 db_hashtype='$db_hashtype'
24998 db_prefixtype='$db_prefixtype'
24999 db_version_major='$db_version_major'
25000 db_version_minor='$db_version_minor'
25001 db_version_patch='$db_version_patch'
25002 default_inc_excludes_dot='$default_inc_excludes_dot'
25003 direntrytype='$direntrytype'
25006 doubleinfbytes='$doubleinfbytes'
25007 doublekind='$doublekind'
25008 doublemantbits='$doublemantbits'
25009 doublenanbytes='$doublenanbytes'
25010 doublesize='$doublesize'
25012 drand48_r_proto='$drand48_r_proto'
25014 dtraceobject='$dtraceobject'
25015 dtracexnolibs='$dtracexnolibs'
25016 dynamic_ext='$dynamic_ext'
25022 endgrent_r_proto='$endgrent_r_proto'
25023 endhostent_r_proto='$endhostent_r_proto'
25024 endnetent_r_proto='$endnetent_r_proto'
25025 endprotoent_r_proto='$endprotoent_r_proto'
25026 endpwent_r_proto='$endpwent_r_proto'
25027 endservent_r_proto='$endservent_r_proto'
25028 eunicefix='$eunicefix'
25031 extensions='$extensions'
25032 extern_C='$extern_C'
25034 fflushNULL='$fflushNULL'
25035 fflushall='$fflushall'
25037 firstmakefile='$firstmakefile'
25039 fpossize='$fpossize'
25040 fpostype='$fpostype'
25041 freetype='$freetype'
25044 full_csh='$full_csh'
25045 full_sed='$full_sed'
25046 gccansipedantic='$gccansipedantic'
25047 gccosandvers='$gccosandvers'
25048 gccversion='$gccversion'
25049 getgrent_r_proto='$getgrent_r_proto'
25050 getgrgid_r_proto='$getgrgid_r_proto'
25051 getgrnam_r_proto='$getgrnam_r_proto'
25052 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25053 gethostbyname_r_proto='$gethostbyname_r_proto'
25054 gethostent_r_proto='$gethostent_r_proto'
25055 getlogin_r_proto='$getlogin_r_proto'
25056 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25057 getnetbyname_r_proto='$getnetbyname_r_proto'
25058 getnetent_r_proto='$getnetent_r_proto'
25059 getprotobyname_r_proto='$getprotobyname_r_proto'
25060 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25061 getprotoent_r_proto='$getprotoent_r_proto'
25062 getpwent_r_proto='$getpwent_r_proto'
25063 getpwnam_r_proto='$getpwnam_r_proto'
25064 getpwuid_r_proto='$getpwuid_r_proto'
25065 getservbyname_r_proto='$getservbyname_r_proto'
25066 getservbyport_r_proto='$getservbyport_r_proto'
25067 getservent_r_proto='$getservent_r_proto'
25068 getspnam_r_proto='$getspnam_r_proto'
25069 gidformat='$gidformat'
25075 gmtime_r_proto='$gmtime_r_proto'
25076 gnulibc_version='$gnulibc_version'
25078 groupcat='$groupcat'
25079 groupstype='$groupstype'
25082 h_sysfile='$h_sysfile'
25085 hostgenerate='$hostgenerate'
25086 hostosname='$hostosname'
25087 hostperl='$hostperl'
25088 html1dir='$html1dir'
25089 html1direxp='$html1direxp'
25090 html3dir='$html3dir'
25091 html3direxp='$html3direxp'
25100 i_arpainet='$i_arpainet'
25101 i_assert='$i_assert'
25103 i_bsdioctl='$i_bsdioctl'
25107 i_dirent='$i_dirent'
25109 i_execinfo='$i_execinfo'
25114 i_fp_class='$i_fp_class'
25116 i_gdbm_ndbm='$i_gdbm_ndbm'
25117 i_gdbmndbm='$i_gdbmndbm'
25119 i_ieeefp='$i_ieeefp'
25120 i_inttypes='$i_inttypes'
25121 i_langinfo='$i_langinfo'
25122 i_libutil='$i_libutil'
25123 i_limits='$i_limits'
25124 i_locale='$i_locale'
25125 i_machcthr='$i_machcthr'
25126 i_malloc='$i_malloc'
25127 i_mallocmalloc='$i_mallocmalloc'
25129 i_memory='$i_memory'
25130 i_mntent='$i_mntent'
25133 i_neterrno='$i_neterrno'
25134 i_netinettcp='$i_netinettcp'
25138 i_pthread='$i_pthread'
25140 i_quadmath='$i_quadmath'
25141 i_rpcsvcdbm='$i_rpcsvcdbm'
25143 i_shadow='$i_shadow'
25145 i_stdarg='$i_stdarg'
25146 i_stdbool='$i_stdbool'
25147 i_stddef='$i_stddef'
25148 i_stdint='$i_stdint'
25149 i_stdlib='$i_stdlib'
25150 i_string='$i_string'
25151 i_sunmath='$i_sunmath'
25152 i_sysaccess='$i_sysaccess'
25153 i_sysdir='$i_sysdir'
25154 i_sysfile='$i_sysfile'
25155 i_sysfilio='$i_sysfilio'
25157 i_sysioctl='$i_sysioctl'
25158 i_syslog='$i_syslog'
25159 i_sysmman='$i_sysmman'
25160 i_sysmode='$i_sysmode'
25161 i_sysmount='$i_sysmount'
25162 i_sysndir='$i_sysndir'
25163 i_sysparam='$i_sysparam'
25164 i_syspoll='$i_syspoll'
25165 i_sysresrc='$i_sysresrc'
25166 i_syssecrt='$i_syssecrt'
25167 i_sysselct='$i_sysselct'
25168 i_syssockio='$i_syssockio'
25169 i_sysstat='$i_sysstat'
25170 i_sysstatfs='$i_sysstatfs'
25171 i_sysstatvfs='$i_sysstatvfs'
25172 i_systime='$i_systime'
25173 i_systimek='$i_systimek'
25174 i_systimes='$i_systimes'
25175 i_systypes='$i_systypes'
25176 i_sysuio='$i_sysuio'
25178 i_sysutsname='$i_sysutsname'
25179 i_sysvfs='$i_sysvfs'
25180 i_syswait='$i_syswait'
25181 i_termio='$i_termio'
25182 i_termios='$i_termios'
25184 i_unistd='$i_unistd'
25187 i_values='$i_values'
25188 i_varargs='$i_varargs'
25189 i_varhdr='$i_varhdr'
25191 i_xlocale='$i_xlocale'
25192 ignore_versioned_solibs='$ignore_versioned_solibs'
25193 inc_version_list='$inc_version_list'
25194 inc_version_list_init='$inc_version_list_init'
25198 initialinstalllocation='$initialinstalllocation'
25199 installarchlib='$installarchlib'
25200 installbin='$installbin'
25201 installhtml1dir='$installhtml1dir'
25202 installhtml3dir='$installhtml3dir'
25203 installman1dir='$installman1dir'
25204 installman3dir='$installman3dir'
25205 installprefix='$installprefix'
25206 installprefixexp='$installprefixexp'
25207 installprivlib='$installprivlib'
25208 installscript='$installscript'
25209 installsitearch='$installsitearch'
25210 installsitebin='$installsitebin'
25211 installsitehtml1dir='$installsitehtml1dir'
25212 installsitehtml3dir='$installsitehtml3dir'
25213 installsitelib='$installsitelib'
25214 installsiteman1dir='$installsiteman1dir'
25215 installsiteman3dir='$installsiteman3dir'
25216 installsitescript='$installsitescript'
25217 installstyle='$installstyle'
25218 installusrbinperl='$installusrbinperl'
25219 installvendorarch='$installvendorarch'
25220 installvendorbin='$installvendorbin'
25221 installvendorhtml1dir='$installvendorhtml1dir'
25222 installvendorhtml3dir='$installvendorhtml3dir'
25223 installvendorlib='$installvendorlib'
25224 installvendorman1dir='$installvendorman1dir'
25225 installvendorman3dir='$installvendorman3dir'
25226 installvendorscript='$installvendorscript'
25228 issymlink='$issymlink'
25229 ivdformat='$ivdformat'
25232 known_extensions='$known_extensions'
25235 ld_can_script='$ld_can_script'
25236 lddlflags='$lddlflags'
25238 ldflags_uselargefiles='$ldflags_uselargefiles'
25239 ldlibpthname='$ldlibpthname'
25246 libsdirs='$libsdirs'
25247 libsfiles='$libsfiles'
25248 libsfound='$libsfound'
25249 libspath='$libspath'
25250 libswanted='$libswanted'
25251 libswanted_uselargefiles='$libswanted_uselargefiles'
25257 localtime_r_proto='$localtime_r_proto'
25258 locincpth='$locincpth'
25259 loclibpth='$loclibpth'
25260 longdblinfbytes='$longdblinfbytes'
25261 longdblkind='$longdblkind'
25262 longdblmantbits='$longdblmantbits'
25263 longdblnanbytes='$longdblnanbytes'
25264 longdblsize='$longdblsize'
25265 longlongsize='$longlongsize'
25266 longsize='$longsize'
25270 lseeksize='$lseeksize'
25271 lseektype='$lseektype'
25275 make_set_make='$make_set_make'
25276 mallocobj='$mallocobj'
25277 mallocsrc='$mallocsrc'
25278 malloctype='$malloctype'
25280 man1direxp='$man1direxp'
25283 man3direxp='$man3direxp'
25285 mips_type='$mips_type'
25286 mistrustnm='$mistrustnm'
25288 mmaptype='$mmaptype'
25289 modetype='$modetype'
25291 multiarch='$multiarch'
25293 myarchname='$myarchname'
25294 mydomain='$mydomain'
25295 myhostname='$myhostname'
25298 need_va_copy='$need_va_copy'
25299 netdb_hlen_type='$netdb_hlen_type'
25300 netdb_host_type='$netdb_host_type'
25301 netdb_name_type='$netdb_name_type'
25302 netdb_net_type='$netdb_net_type'
25305 nm_so_opt='$nm_so_opt'
25306 nonxs_ext='$nonxs_ext'
25308 nvEUformat='$nvEUformat'
25309 nvFUformat='$nvFUformat'
25310 nvGUformat='$nvGUformat'
25311 nv_overflows_integers_at='$nv_overflows_integers_at'
25312 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25313 nveformat='$nveformat'
25314 nvfformat='$nvfformat'
25315 nvgformat='$nvgformat'
25316 nvmantbits='$nvmantbits'
25319 o_nonblock='$o_nonblock'
25321 old_pthread_create_joinable='$old_pthread_create_joinable'
25322 optimize='$optimize'
25323 orderlib='$orderlib'
25326 otherlibdirs='$otherlibdirs'
25330 patchlevel='$patchlevel'
25331 path_sep='$path_sep'
25334 perl_patchlevel='$perl_patchlevel'
25335 perl_static_inline='$perl_static_inline'
25336 perladmin='$perladmin'
25337 perllibs='$perllibs'
25338 perlpath='$perlpath'
25340 phostname='$phostname'
25346 prefixexp='$prefixexp'
25348 privlibexp='$privlibexp'
25349 procselfexe='$procselfexe'
25350 prototype='$prototype'
25352 quadkind='$quadkind'
25353 quadtype='$quadtype'
25354 randbits='$randbits'
25355 randfunc='$randfunc'
25356 random_r_proto='$random_r_proto'
25357 randseedtype='$randseedtype'
25359 rd_nodata='$rd_nodata'
25360 readdir64_r_proto='$readdir64_r_proto'
25361 readdir_r_proto='$readdir_r_proto'
25362 revision='$revision'
25368 sGMTIME_max='$sGMTIME_max'
25369 sGMTIME_min='$sGMTIME_min'
25370 sLOCALTIME_max='$sLOCALTIME_max'
25371 sLOCALTIME_min='$sLOCALTIME_min'
25372 sPRIEUldbl='$sPRIEUldbl'
25373 sPRIFUldbl='$sPRIFUldbl'
25374 sPRIGUldbl='$sPRIGUldbl'
25375 sPRIXU64='$sPRIXU64'
25377 sPRIeldbl='$sPRIeldbl'
25378 sPRIfldbl='$sPRIfldbl'
25379 sPRIgldbl='$sPRIgldbl'
25384 sSCNfldbl='$sSCNfldbl'
25385 sched_yield='$sched_yield'
25386 scriptdir='$scriptdir'
25387 scriptdirexp='$scriptdirexp'
25389 seedfunc='$seedfunc'
25390 selectminbits='$selectminbits'
25391 selecttype='$selecttype'
25392 sendmail='$sendmail'
25393 setgrent_r_proto='$setgrent_r_proto'
25394 sethostent_r_proto='$sethostent_r_proto'
25395 setlocale_r_proto='$setlocale_r_proto'
25396 setnetent_r_proto='$setnetent_r_proto'
25397 setprotoent_r_proto='$setprotoent_r_proto'
25398 setpwent_r_proto='$setpwent_r_proto'
25399 setservent_r_proto='$setservent_r_proto'
25402 sharpbang='$sharpbang'
25403 shmattype='$shmattype'
25404 shortsize='$shortsize'
25407 sig_count='$sig_count'
25408 sig_name='$sig_name'
25409 sig_name_init='$sig_name_init'
25411 sig_num_init='$sig_num_init'
25412 sig_size='$sig_size'
25413 signal_t='$signal_t'
25414 sitearch='$sitearch'
25415 sitearchexp='$sitearchexp'
25417 sitebinexp='$sitebinexp'
25418 sitehtml1dir='$sitehtml1dir'
25419 sitehtml1direxp='$sitehtml1direxp'
25420 sitehtml3dir='$sitehtml3dir'
25421 sitehtml3direxp='$sitehtml3direxp'
25423 sitelib_stem='$sitelib_stem'
25424 sitelibexp='$sitelibexp'
25425 siteman1dir='$siteman1dir'
25426 siteman1direxp='$siteman1direxp'
25427 siteman3dir='$siteman3dir'
25428 siteman3direxp='$siteman3direxp'
25429 siteprefix='$siteprefix'
25430 siteprefixexp='$siteprefixexp'
25431 sitescript='$sitescript'
25432 sitescriptexp='$sitescriptexp'
25433 sizesize='$sizesize'
25434 sizetype='$sizetype'
25438 sockethdr='$sockethdr'
25439 socketlib='$socketlib'
25440 socksizetype='$socksizetype'
25442 spackage='$spackage'
25443 spitshell='$spitshell'
25444 srand48_r_proto='$srand48_r_proto'
25445 srandom_r_proto='$srandom_r_proto'
25447 ssizetype='$ssizetype'
25448 st_ino_sign='$st_ino_sign'
25449 st_ino_size='$st_ino_size'
25450 startperl='$startperl'
25452 static_ext='$static_ext'
25454 stdio_base='$stdio_base'
25455 stdio_bufsiz='$stdio_bufsiz'
25456 stdio_cnt='$stdio_cnt'
25457 stdio_filbuf='$stdio_filbuf'
25458 stdio_ptr='$stdio_ptr'
25459 stdio_stream_array='$stdio_stream_array'
25460 strerror_r_proto='$strerror_r_proto'
25463 subversion='$subversion'
25468 targetarch='$targetarch'
25469 targetdir='$targetdir'
25470 targetenv='$targetenv'
25471 targethost='$targethost'
25472 targetmkdir='$targetmkdir'
25473 targetport='$targetport'
25474 targetsh='$targetsh'
25478 timeincl='$timeincl'
25479 timetype='$timetype'
25480 tmpnam_r_proto='$tmpnam_r_proto'
25486 ttyname_r_proto='$ttyname_r_proto'
25495 uidformat='$uidformat'
25501 uquadtype='$uquadtype'
25502 use5005threads='$use5005threads'
25503 use64bitall='$use64bitall'
25504 use64bitint='$use64bitint'
25505 usecbacktrace='$usecbacktrace'
25506 usecrosscompile='$usecrosscompile'
25507 usedevel='$usedevel'
25509 usedtrace='$usedtrace'
25510 usefaststdio='$usefaststdio'
25511 useithreads='$useithreads'
25512 usekernprocpathname='$usekernprocpathname'
25513 uselargefiles='$uselargefiles'
25514 uselongdouble='$uselongdouble'
25515 usemallocwrap='$usemallocwrap'
25516 usemorebits='$usemorebits'
25517 usemultiplicity='$usemultiplicity'
25518 usemymalloc='$usemymalloc'
25520 usensgetexecutablepath='$usensgetexecutablepath'
25521 useopcode='$useopcode'
25522 useperlio='$useperlio'
25523 useposix='$useposix'
25524 usequadmath='$usequadmath'
25525 usereentrant='$usereentrant'
25526 userelocatableinc='$userelocatableinc'
25527 useshrplib='$useshrplib'
25528 usesitecustomize='$usesitecustomize'
25529 usesocks='$usesocks'
25530 usethreads='$usethreads'
25531 usevendorprefix='$usevendorprefix'
25532 useversionedarchname='$useversionedarchname'
25533 usevfork='$usevfork'
25536 uvXUformat='$uvXUformat'
25537 uvoformat='$uvoformat'
25540 uvuformat='$uvuformat'
25541 uvxformat='$uvxformat'
25543 vendorarch='$vendorarch'
25544 vendorarchexp='$vendorarchexp'
25545 vendorbin='$vendorbin'
25546 vendorbinexp='$vendorbinexp'
25547 vendorhtml1dir='$vendorhtml1dir'
25548 vendorhtml1direxp='$vendorhtml1direxp'
25549 vendorhtml3dir='$vendorhtml3dir'
25550 vendorhtml3direxp='$vendorhtml3direxp'
25551 vendorlib='$vendorlib'
25552 vendorlib_stem='$vendorlib_stem'
25553 vendorlibexp='$vendorlibexp'
25554 vendorman1dir='$vendorman1dir'
25555 vendorman1direxp='$vendorman1direxp'
25556 vendorman3dir='$vendorman3dir'
25557 vendorman3direxp='$vendorman3direxp'
25558 vendorprefix='$vendorprefix'
25559 vendorprefixexp='$vendorprefixexp'
25560 vendorscript='$vendorscript'
25561 vendorscriptexp='$vendorscriptexp'
25563 version_patchlevel_string='$version_patchlevel_string'
25564 versiononly='$versiononly'
25568 yaccflags='$yaccflags'
25573 : add special variables
25574 $test -f $src/patchlevel.h && \
25575 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25576 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25577 echo "PERL_CONFIG_SH=true" >>config.sh
25579 : propagate old symbols
25580 if $test -f UU/config.sh; then
25581 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25582 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25583 config.sh config.sh UU/oldconfig.sh |\
25584 $sort | $uniq -u >UU/oldsyms
25585 set X `$cat UU/oldsyms`
25591 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25593 echo ": Variables propagated from previous config.sh file." >>config.sh
25594 for sym in `$cat UU/oldsyms`; do
25595 echo " Propagating $hint variable "'$'"$sym..."
25596 eval 'tmp="$'"${sym}"'"'
25598 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25604 : preserve RCS keywords in files with variable substitution, grrr
25607 : Finish up by extracting the .SH files
25610 echo "Stopping at your request, leaving temporary files around."
25620 If you'd like to make any changes to the config.sh file before I begin
25621 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25624 rp="Press return or use a shell escape to edit config.sh:"
25629 *) : in case they cannot read
25630 sh 1>&4 -c "$ans";;
25635 : if this fails, just run all the .SH files by hand
25644 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25651 Now you need to generate make dependencies by running "$make depend".
25652 You might prefer to run it in background: "$make depend > makedepend.out &"
25653 It can take a while, so you might not want to run it right now.
25658 rp="Run $make depend now?"
25662 $make depend && echo "Now you must run '$make'."
25665 echo "You must run '$make depend' then '$make'."
25668 elif test -f [Mm]akefile; then
25670 echo "Now you must run a $make."
25672 echo "Configure done."
25675 if $test -f Policy.sh; then
25678 If you compile $package on a different machine or from a different object
25679 directory, copy the Policy.sh file from this object directory to the
25680 new one before you run Configure -- this will help you with most of
25681 the policy defaults.
25685 if $test -f UU/config.msg; then
25686 echo "Hmm. I also noted the following information while running:"
25688 $cat UU/config.msg >&4
25690 $rm -f kit*isdone ark*isdone