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 should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/Perl/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # with additional metaconfig patches from https://github.com/Perl/metaconfig
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
386 d_attribute_always_inline=''
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_visibility=''
395 d_attribute_warn_unused_result=''
396 d_printf_format_null=''
398 d_non_int_bitfields=''
399 d_builtin_choose_expr=''
401 d_builtin_add_overflow=''
402 d_builtin_mul_overflow=''
403 d_builtin_sub_overflow=''
404 d_c99_variadic_macros=''
453 endhostent_r_proto=''
459 endprotoent_r_proto=''
465 endservent_r_proto=''
521 d_getenv_preserves_other_thread=''
540 gethostbyaddr_r_proto=''
542 gethostbyname_r_proto=''
544 gethostent_r_proto=''
557 getnetbyaddr_r_proto=''
559 getnetbyname_r_proto=''
573 d_getprotobyname_r=''
574 getprotobyname_r_proto=''
575 d_getprotobynumber_r=''
576 getprotobynumber_r_proto=''
578 getprotoent_r_proto=''
590 getservbyname_r_proto=''
592 getservbyport_r_proto=''
594 getservent_r_proto=''
627 d_lc_monetary_2008=''
632 d_libm_lib_version=''
640 d_localtime_r_needs_tzset=''
648 d_long_double_style_ieee=''
649 d_long_double_style_ieee_doubledouble=''
650 d_long_double_style_ieee_extended=''
651 d_long_double_style_ieee_std=''
652 d_long_double_style_vax=''
665 d_malloc_good_size=''
667 d_malloc_usable_size=''
710 d_thread_safe_nl_langinfo_l=''
724 d_old_pthread_create_joinable=''
725 old_pthread_create_joinable=''
727 d_pthread_attr_setscope=''
773 sethostent_r_proto=''
778 d_setlocale_accepts_any_locale_name=''
792 setprotoent_r_proto=''
804 setservent_r_proto=''
817 d_siginfo_si_errno=''
820 d_siginfo_si_status=''
822 d_siginfo_si_value=''
834 d_ipv6_mreq_source=''
845 d_sockaddr_storage=''
864 perl_static_inline=''
869 d_stdio_ptr_lval_nochange_cnt=''
870 d_stdio_ptr_lval_sets_cnt=''
956 default_inc_excludes_dot=''
1022 d_gdbm_ndbm_h_uses_prototypes=''
1023 d_gdbmndbm_h_uses_prototypes=''
1025 d_ndbm_h_uses_prototypes=''
1096 d_inc_version_list=''
1098 inc_version_list_init=''
1106 installusrbinperl=''
1122 ignore_versioned_solibs=''
1138 d_double_has_negative_zero=''
1139 d_double_has_subnormals=''
1140 d_double_style_cray=''
1141 d_double_style_ibm=''
1142 d_double_style_ieee=''
1143 d_double_style_vax=''
1194 d_perl_otherlibdirs=''
1202 api_versionstring=''
1208 version_patchlevel_string=''
1212 d_nv_preserves_uv=''
1213 d_nv_zero_is_allbits_zero=''
1224 nv_overflows_integers_at=''
1225 nv_preserves_uv_bits=''
1297 installsitehtml1dir=''
1300 installsitehtml3dir=''
1307 installsiteman1dir=''
1310 installsiteman3dir=''
1315 installsitescript=''
1335 d_stdio_stream_array=''
1336 stdio_stream_array=''
1355 usekernprocpathname=''
1356 ccflags_uselargefiles=''
1357 ldflags_uselargefiles=''
1358 libswanted_uselargefiles=''
1367 usensgetexecutablepath=''
1379 installvendorarch=''
1386 installvendorhtml1dir=''
1388 vendorhtml1direxp=''
1389 installvendorhtml3dir=''
1391 vendorhtml3direxp=''
1397 installvendorman1dir=''
1400 installvendorman3dir=''
1407 installvendorscript=''
1418 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1421 : We must find out about Eunice early
1423 if test -f /etc/unixtovms; then
1424 eunicefix=/etc/unixtovms
1426 if test -f /etc/unixtovms.exe; then
1427 eunicefix=/etc/unixtovms.exe
1430 : Set executable suffix now -- needed before hints available
1431 if test -f "/libs/version.library"; then
1434 elif test -f "/system/gnu_library/bin/ar.pm"; then
1437 elif test -n "$DJGPP"; then
1440 elif test -f /kern/cookiejar; then
1443 elif test -d c:/. -o -n "$is_os2" ; then
1450 : Possible local include directories to search.
1451 : Set locincpth to "" in a hint file to defeat local include searches.
1452 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1453 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1455 : no include file wanted by default
1458 : Enable -DEBUGGING and -DDEBUGGING from the command line
1462 : Trailing extension. Override this in a hint file, if needed.
1463 : Extra object files, if any, needed on this platform.
1466 : change the next line if compiling for Xenix/286 on Xenix/386
1467 xlibpth='/usr/lib/386 /lib/386'
1468 : Possible local library directories to search.
1469 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1470 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1472 : general looking path for locating libraries
1473 glibpth="/lib /usr/lib $xlibpth"
1474 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1475 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1476 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1477 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1479 : Private path used by Configure to find libraries. Its value
1480 : is prepended to libpth. This variable takes care of special
1481 : machines, like the mips. Usually, it should be empty.
1484 : default library list
1486 : some systems want to use only the non-versioned libso:s
1487 ignore_versioned_solibs=''
1491 : set useposix=false in your hint file to disable the POSIX extension.
1493 : set useopcode=false in your hint file to disable the Opcode extension.
1495 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1498 ccflags_uselargefiles=''
1499 ldflags_uselargefiles=''
1500 libswanted_uselargefiles=''
1501 : set usemultiplicity on the Configure command line to enable multiplicity.
1502 : set usesocks on the Configure command line to enable socks.
1504 : set usethreads on the Configure command line to enable threads.
1505 usereentrant='undef'
1506 : List of libraries we want.
1507 : If anyone needs extra -lxxx, put those in a hint file.
1508 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1509 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1510 : We probably want to search /usr/shlib before most other libraries.
1511 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1512 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1513 glibpth="/usr/shlib $glibpth"
1514 : Do not use vfork unless overridden by a hint file.
1517 : Find the basic shell for Bourne shell scripts
1521 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1524 if test -f "$xxx"; then
1527 : Build up a list and do a single loop so we can 'break' out.
1528 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1529 for xxx in sh bash ksh pdksh ash; do
1531 try="$try ${p}/${xxx}"
1535 if test -f "$xxx"; then
1538 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1541 elif test -f "$xxx.exe"; then
1552 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1554 Usually it's in /bin/sh. How did you even get this far?
1555 Please report this issue at https://github.com/Perl/perl5/issues
1556 and we'll try to straighten this all out.
1562 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1563 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1566 : see if sh knows # comments
1567 if `$sh -c '#' >/dev/null 2>&1`; then
1571 test -f $xcat$_exe || xcat=/usr/bin/cat
1572 if test ! -f $xcat$_exe; then
1573 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1574 if test -f $p/cat$_exe; then
1579 if test ! -f $xcat$_exe; then
1580 echo "Can't find cat anywhere!"
1584 echo "#!$xcat" >sharp
1587 ./sharp > today 2>/dev/null
1588 if test -s today; then
1591 echo "#! $xcat" > sharp
1594 ./sharp > today 2>/dev/null
1595 if test -s today; then
1603 echo "Your $sh doesn't grok # comments--I will strip them later on."
1606 echo "exec grep -v '^[ ]*#'" >spitshell
1608 $eunicefix spitshell
1609 spitshell=`pwd`/spitshell
1611 echo "I presume that if # doesn't work, #! won't work either!"
1616 : figure out how to guarantee sh startup
1618 '') startsh=${sharpbang}${sh} ;;
1630 : echo "Yup, it does."
1632 echo "Hmm... '$startsh' does not guarantee sh startup..."
1633 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1637 : Save command line options in file UU/cmdline.opt for later use in
1638 : generating config.sh.
1639 cat > cmdline.opt <<EOSH
1640 : Configure command line arguments.
1649 cat >>cmdline.opt <<EOSH
1650 config_arg$argn='$arg'
1652 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1655 arg_exp=`cat cmdl.opt`
1656 args_exp="$args_exp$args_sep'$arg_exp'"
1657 argn=`expr $argn + 1`
1662 : produce awk script to parse command line options
1663 cat >options.awk <<'EOF'
1665 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1667 len = length(optstr);
1668 for (i = 1; i <= len; i++) {
1669 c = substr(optstr, i, 1);
1670 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1681 if (substr(str, 1, 1) != "-") {
1682 printf("'%s'\n", str);
1686 for (i = 2; i <= len; i++) {
1687 c = substr(str, i, 1);
1689 printf("-%s\n", substr(str, i));
1695 printf("'%s'\n", substr(str, i + 1));
1708 : process the command line options
1709 set X `for arg in "$@"; do echo "X$arg"; done |
1710 sed -e s/X// | awk -f options.awk`
1715 : set up default values
1724 rm -f optdef.sh posthint.sh
1725 cat >optdef.sh <<EOS
1731 while test $# -gt 0; do
1733 -d) shift; fastread=yes;;
1734 -e) shift; alldone=cont;;
1738 if test -r "$1"; then
1741 echo "$me: cannot read config file $1." >&2
1747 -h) shift; error=true;;
1748 -r) shift; reuseval=true;;
1749 -s) shift; silent=true; realsilent=true;;
1750 -E) shift; alldone=exit;;
1751 -K) shift; knowitall=true;;
1753 -S) shift; silent=true; extractsh=true;;
1758 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1759 echo "$me: ignoring -D $1" >&2
1762 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1763 *) echo "$1='define'" >> optdef.sh;;
1770 *=) echo "$1" >> optdef.sh;;
1772 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1773 echo "$me: ignoring -U $1" >&2
1775 *) echo "$1='undef'" >> optdef.sh;;
1786 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1790 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1791 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1797 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1798 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1799 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1800 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1801 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1802 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1808 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1810 echo "$yyy=''" >> posthint.sh ;;
1815 echo "$yyy='$zzz'" >> posthint.sh ;;
1817 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1819 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1824 echo "$yyy=$zzz" >> posthint.sh ;;
1825 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1829 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1832 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1840 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1841 [-U symbol] [-U symbol=] [-A command:symbol...]
1842 -d : use defaults for all answers.
1843 -e : go on without questioning past the production of config.sh.
1844 -f : specify an alternate default configuration file.
1845 -h : print this help message and exit (with an error status).
1846 -r : reuse C symbols value if possible (skips costly nm extraction).
1847 -s : silent mode, only echoes questions and essential information.
1848 -D : define symbol to have some value:
1849 -D symbol symbol gets the value 'define'
1850 -D symbol='some value' symbol is set to 'some value'
1851 common used examples (see INSTALL for more info):
1852 -Duse64bitint use 64bit integers
1853 -Duse64bitall use 64bit integers and pointers
1854 -Dusethreads use thread support
1855 -Dinc_version_list=none do not include older perl trees in @INC
1856 -DEBUGGING=none DEBUGGING options
1857 -Dcc=gcc choose your compiler
1858 -Dprefix=/opt/perl5 choose your destination
1859 -E : stop at the end of questions, after having produced config.sh.
1860 -K : do not use unless you know what you are doing.
1861 -O : ignored for backward compatibility
1862 -S : perform variable substitutions on all .SH files (can mix with -f)
1863 -U : undefine symbol:
1864 -U symbol symbol gets the value 'undef'
1865 -U symbol= symbol gets completely empty
1867 -A : manipulate symbol after the platform specific hints have been applied:
1868 -A append:symbol=value append value to symbol
1869 -A symbol=value like append:, but with a separating space
1870 -A define:symbol=value define symbol to have value
1871 -A clear:symbol define symbol to be ''
1872 -A define:symbol define symbol to be 'define'
1873 -A eval:symbol=value define symbol to be eval of value
1874 -A prepend:symbol=value prepend value to symbol
1875 -A undef:symbol define symbol to be 'undef'
1876 -A undef:symbol= define symbol to be ''
1877 e.g.: -A prepend:libswanted='cl pthread '
1878 -A ccflags=-DSOME_MACRO
1879 -V : print version number and exit (with a zero status).
1886 case "$fastread$alldone" in
1889 case "$extractsh" in
1892 if test ! -t 0; then
1893 echo "Say 'sh Configure', not 'sh <Configure'"
1903 true) exec 1>/dev/null;;
1906 : run the defines and the undefines, if any, but leave the file out there...
1908 grep '\\' optdef.sh >/dev/null 2>&1
1909 if test $? = 0; then
1910 echo "Configure does not support \\ in -D arguments"
1914 : create the posthint manipulation script and leave the file out there...
1919 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1920 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1921 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1922 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1923 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1926 : Some greps do not return status, grrr.
1927 echo "grimblepritz" >grimble
1928 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1930 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1936 : the following should work in any shell
1940 echo "AGH! Grep doesn't return a status. Attempting remedial action." >&4
1941 cat >contains <<'EOSS'
1942 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1948 : Find the path to the source tree
1951 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1955 *) src=`cd ../$src && pwd` ;;
1968 if test -f $rsrc/Configure && \
1969 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1971 : found it, so we are ok.
1974 for src in . .. ../.. ../../.. ../../../..; do
1975 if test -f ../$src/Configure && \
1976 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1987 Sorry, I can't seem to locate the source dir for $package. Please start
1988 Configure with an explicit path -- i.e. /some/path/Configure.
1996 echo "Sources for $package found in \"$src\"." >&4
2000 : script used to extract .SH files with variable substitutions
2001 cat >extract <<'EOS'
2003 echo "Doing variable substitutions on .SH files..."
2004 if test -f MANIFEST; then
2005 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
2007 echo "(Looking for .SH files under the source directory.)"
2008 set x `(cd "$src"; find . -name "*.SH" -print)`
2012 0) set x `(cd "$src"; echo *.SH)`; shift;;
2014 if test ! -f "$src/$1"; then
2020 while test $name; do
2021 if test ! -d "$name"; then
2022 create="$name $create";
2023 name=`echo $name | sed -e "s|^[^/]*$||"`;
2024 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2029 for file in $create; do
2038 dir=`expr X$file : 'X\(.*\)/'`
2039 file=`expr X$file : 'X.*/\(.*\)'`
2040 (cd "$dir" && . ./$file)
2050 dir=`expr X$file : 'X\(.*\)/'`
2051 file=`expr X$file : 'X.*/\(.*\)'`
2052 (set x $dir; shift; eval $mkdir_p)
2053 sh <"$src/$dir/$file"
2062 if test -f "$src/config_h.SH"; then
2063 if test ! -f config.h; then
2064 : oops, they left it out of MANIFEST, probably, so do it anyway.
2065 . "$src/config_h.SH"
2070 : extract files and exit if asked to do so
2071 case "$extractsh" in
2073 case "$realsilent" in
2077 case "$config_sh" in
2078 '') config_sh='config.sh';;
2081 echo "Fetching answers from $config_sh..."
2088 echo "Extraction done."
2093 : Eunice requires " " instead of "", can you believe it
2096 echo "Beginning of configuration questions for $package."
2098 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2100 : first determine how to suppress newline on echo command
2102 echo "Checking echo to see how to suppress newlines..."
2103 (echo "hi there\c" ; echo " ") >.echotmp
2104 if $contains c .echotmp >/dev/null 2>&1 ; then
2115 echo $n "The star should be here-->$c"
2119 : Now test for existence of everything in MANIFEST
2121 if test -f "$rsrc/MANIFEST"; then
2122 echo "First let's make sure your kit is complete. Checking..." >&4
2123 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2124 (split -l 50 2>/dev/null || split -50)
2127 for filelist in x??; do
2128 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2129 >/dev/null 2>>"$tmppwd/missing")
2131 if test -s missing; then
2135 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2137 You have the option of continuing the configuration process, despite the
2138 distinct possibility that your kit is damaged, by typing 'y'es. If you
2139 do, don't blame me if something goes wrong. I advise you to type 'n'o
2140 and contact the author (https://github.com/Perl/perl5/issues).
2143 echo $n "Continue? [n] $c" >&4
2147 echo "Continuing..." >&4
2151 echo "ABORTING..." >&4
2156 echo "Looks good..."
2159 echo "There is no MANIFEST file. I hope your kit is complete !"
2163 : Find the appropriate value for a newline for tr
2164 if test -n "$DJGPP"; then
2167 if test X"$trnl" = X; then
2168 case "`echo foo | tr '\n' x 2>/dev/null`" in
2172 if test X"$trnl" = X; then
2173 case "`echo foo | tr '\012' x 2>/dev/null`" in
2174 foox) trnl='\012' ;;
2177 if test X"$trnl" = X; then
2178 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2179 fooxy) trnl='\n\r' ;;
2182 if test X"$trnl" = X; then
2185 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2191 : compute the number of columns on the terminal for proper question formatting
2196 : set up the echo used in my read
2197 myecho="case \"\$xxxm\" in
2198 '') echo $n \"\$rp $c\" >&4;;
2200 '') echo $n \"[\$xxxm] $c\";;
2202 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2204 echo $n \"[\$xxxm] $c\" >&4
2206 echo $n \"\$rp [\$xxxm] $c\" >&4
2212 : now set up to do reads with possible shell escape and default assignment
2219 case "\$fastread" in
2220 yes) case "\$dflt" in
2223 case "\$silent-\$rp" in
2228 *) case "\$silent" in
2229 true) case "\$rp" in
2234 while expr "X\$ans" : "X!" >/dev/null; do
2238 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2246 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2255 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2260 echo "(OK, I'll run with -d after this question.)" >&4
2263 echo "*** Sorry, \$1 not supported yet." >&4
2273 echo "*** Substitution done -- please confirm."
2275 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2280 echo "*** Error -- try again."
2287 case "\$ans\$xxxm\$nostick" in
2293 counter=\`echo \$counter | awk '{ print --\$0 }'\`
2294 if [ \$counter = 0 ]; then
2296 echo >&4 Too many attempts asking the same question. Giving up.
2305 : create .config dir to save info across Configure sessions
2306 test -d ../.config || mkdir ../.config
2307 cat >../.config/README <<EOF
2308 This directory created by Configure to save information that should
2309 persist across sessions for $package.
2311 You may safely delete it if you wish.
2314 : See if we are using a devel version and want that
2315 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2318 usedevel="$define" ;;
2319 *) case "$xversion" in
2322 *** WHOA THERE!!! ***
2324 This is an UNSTABLE DEVELOPMENT release.
2325 The version of this $package distribution is $xversion, that is, odd,
2326 (as opposed to even) and that signifies a development release.
2327 If you want a maintenance release, you want an even-numbered version.
2329 Do ***NOT*** install this into production use.
2330 Data corruption and crashes are possible.
2332 It is most seriously suggested that you do not continue any further
2333 unless you want to help in developing and debugging Perl.
2335 If you *still* want to build perl, you can answer 'y' now,
2336 or pass -Dusedevel to Configure.
2339 rp='Do you really want to continue?'
2343 [yY]) echo >&4 "Okay, continuing."
2344 usedevel="$define" ;;
2345 *) echo >&4 "Okay, bye."
2356 case "$versiononly" in
2357 '') versiononly="$define" ;;
2359 case "$installusrbinperl" in
2360 '') installusrbinperl="$undef" ;;
2365 : general instructions
2368 user=`(logname) 2>/dev/null`
2370 '') user=`whoami 2>&1`;;
2372 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2375 rp='Would you like to see the instructions?'
2386 This installation shell script will examine your system and ask you questions
2387 to determine how the perl5 package should be installed. If you get
2388 stuck on a question, you may use a ! shell escape to start a subshell or
2389 execute a command. Many of the questions will have default answers in square
2390 brackets; typing carriage return will give you the default.
2392 On some of the questions which ask for file or directory names you are allowed
2393 to use the ~name construct to specify the login directory belonging to "name",
2394 even if you don't have a shell which knows about that. Questions where this is
2395 allowed will be marked "(~name ok)".
2399 dflt='Type carriage return to continue'
2403 The prompter used in this script allows you to use shell variables and
2404 backticks in your answers. You may use $1, $2, etc... to refer to the words
2405 in the default answer, as if the default line was a set of arguments given to a
2406 script shell. This means you may also use $* to repeat the whole default line,
2407 so you do not have to re-type everything to add something to the default.
2409 Every time there is a substitution, you will have to confirm. If there is an
2410 error (e.g. an unmatched backtick), the default answer will remain unchanged
2411 and you will be prompted again.
2413 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2414 the questions and use the computed defaults (or the previous answers if there
2415 was already a config.sh file). Type 'Configure -h' for a list of options.
2416 You may also start interactively and then answer '& -d' at any prompt to turn
2417 on the non-interactive behaviour for the remainder of the execution.
2423 Much effort has been expended to ensure that this shell script will run on any
2424 Unix system. If despite that it blows up on yours, your best bet is to edit
2425 Configure and run it again. If you can't run Configure for some reason,
2426 you'll have to generate a config.sh file by hand. Whatever problems you
2427 have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
2429 This installation script affects things in two ways:
2431 1) it may do direct variable substitutions on some of the files included
2433 2) it builds a config.h file for inclusion in C programs. You may edit
2434 any of these files as the need arises after running this script.
2436 If you make a mistake on a question, there is no easy way to back up to it
2437 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2438 files. Configure will offer to let you do this before it runs the SH files.
2441 dflt='Type carriage return to continue'
2443 case "$firsttime" in
2444 true) echo $user >>../.config/instruct;;
2448 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2449 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2450 if test "X$sysroot" = X; then
2455 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2456 # _sysroot is used in places where we need --sysroot=foo
2457 # but using the rest of the flags could cause issues.
2458 _sysroot="--sysroot=$sysroot";
2462 ccflags="$ccflags $_sysroot"
2467 ldflags="$ldflags $_sysroot"
2472 cppflags="$cppflags $_sysroot"
2474 # lddlflags updated below in lddlflags section;
2475 # same with cccdlflags
2479 # Adjust some defaults to also use $sysroot
2480 for var in xlibpth loclibpth locincpth glibpth; do
2483 for path in $xxx; do
2484 eval $var=\"\$$var $sysroot$path\"
2490 : find out where common programs are
2492 echo "Locating common programs..." >&4
2505 if test -d \$dir/\$thing; then
2511 for thisthing in \$dir/\$thing; do
2512 : just loop through to pick last item
2514 if test -f \$thisthing; then
2517 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2520 elif test -f \$dir/\$thing.exe; then
2521 if test -n "$DJGPP"; then
2522 echo \$dir/\$thing.exe
2523 elif test "$eunicefix" != ":"; then
2524 : on Eunice apparently
2577 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2578 pth="$pth $sysroot/lib $sysroot/usr/lib"
2579 for file in $loclist; do
2583 if test -f "$xxx"; then
2586 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2587 xxx=`./loc $file $file $pth`
2590 '') xxx=`./loc $file $file $pth`;;
2591 *) xxx=`./loc $xxx $xxx $pth`;;
2593 eval $file=$xxx$_exe
2597 echo $file is in $xxx.
2600 echo $file is in $xxx.
2603 echo "I don't know where '$file' is, and my life depends on it." >&4
2604 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2610 echo "Don't worry if any of the following aren't found..."
2612 for file in $trylist; do
2616 if test -f "$xxx"; then
2619 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2620 xxx=`./loc $file $file $pth`
2623 '') xxx=`./loc $file $file $pth`;;
2624 *) xxx=`./loc $xxx $xxx $pth`;;
2626 eval $file=$xxx$_exe
2630 echo $file is in $xxx.
2633 echo $file is in $xxx.
2636 echo "I don't see $file out there, $say."
2643 echo "Substituting grep for egrep."
2650 *) if $less -R </dev/null >/dev/null 2>&1; then
2651 echo "Substituting less -R for less."
2659 echo "Substituting cp for ln."
2668 echo "I can't find make or gmake, and my life depends on it." >&4
2669 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2677 *) # We can't have osname yet.
2678 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2679 # Assume that gmake, if found, is definitely GNU make
2680 # and prefer it over the system make.
2681 echo "Substituting gmake for make."
2689 echo "Hopefully test is built into your sh."
2692 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2693 echo "Using the test built into your sh."
2701 echo "Hopefully echo is built into your sh."
2706 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2707 $echo $n "hi there$c" >foo1
2708 echo $n "hi there$c" >foo2
2709 if cmp foo1 foo2 >/dev/null 2>&1; then
2710 echo "They are compatible. In fact, they may be identical."
2717 They are not compatible! You are probably running ksh on a non-USG system.
2718 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2719 have echo built in and we may have to run some Bourne shell scripts. That
2720 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2723 $echo $n "The star should be here-->$c"
2730 # This question was auctioned at YAPC::Europe-2007 in Vienna
2731 # I never promised you could answer it. I only auctioned the question.
2733 The following message is sponsored by
2735 Dresden.pm<--The stars should be here.
2737 Dear Perl user, system administrator or package
2738 maintainer, the Perl community sends greetings to
2739 you. Do you (emblematical) greet back [Y/n]? n
2743 : Check what type of C compiler we use
2747 cat <<'EOSC' >>trygcc
2752 int main(int argc, char *argv[]) {
2756 if $cc -o try $ccflags $ldflags try.c; then
2759 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2765 # Skip this test because it gives a false match on output like:
2766 # ./trygcc: line 23: cc: command not found
2767 # case "`$cc -v -c try.c 2>&1`" in
2768 # *gcc*) trygcc=no ;;
2770 if $test X"$trygcc" = Xyes; then
2771 if gcc -o try -c try.c; then
2773 echo "You seem to have a working gcc, though." >&4
2774 # Switching compilers may undo the work of hints files.
2775 # The most common problem is -D_REENTRANT for threads.
2776 # This heuristic catches that case, but gets false positives
2777 # if -Dusethreads was not actually specified. Better to
2778 # bail out here with a useful message than fail
2779 # mysteriously later. Should we perhaps just try to
2780 # re-invoke Configure -Dcc=gcc config_args ?
2781 if $test -f usethreads.cbu; then
2784 *** However, any setting of the C compiler flags (e.g. for thread support)
2785 *** will be lost. It may be necessary for you to restart Configure and
2786 *** add -Dcc=gcc to your Configure command line.
2789 rp="Would you like to go ahead and try gcc anyway?"
2792 rp="Would you like to use it?"
2795 if $test -f myread; then
2798 if $test -f UU/myread; then
2801 echo "Cannot find myread, sorry. Aborting." >&4
2806 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2819 cat <<'EOSC' >>checkcc
2824 int main(int argc, char *argv[]) {
2828 if $cc -o try $ccflags $ldflags try.c; then
2831 if $test X"$despair" = Xyes; then
2832 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2835 You need to find a working C compiler.
2836 Either (purchase and) install the C compiler supplied by your OS vendor,
2837 or for a free C compiler try http://gcc.gnu.org/
2838 I cannot continue any further, aborting.
2847 : determine whether symbolic links are supported
2850 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2851 echo "Symbolic links are supported." >&4
2854 echo "Symbolic links are NOT supported." >&4
2859 : determine whether symbolic links are supported
2863 echo "Checking how to test for symbolic links..." >&4
2865 if $test "X$issymlink" = X; then
2867 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2868 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2870 if test $? = 0; then
2873 echo "Your builtin 'test -h' may be broken." >&4
2876 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2879 if test -f "$p/$test"; then
2888 echo "Trying external '$test -h'." >&4
2889 issymlink="$test -h"
2890 if $test ! -h sym >/dev/null 2>&1; then
2891 echo "External '$test -h' is broken, too." >&4
2899 if $test "X$issymlink" = X; then
2900 if $test -L sym 2>/dev/null; then
2901 issymlink="$test -L"
2902 echo "The builtin '$test -L' worked." >&4
2905 if $test "X$issymlink" != X; then
2906 echo "You can test for symbolic links with '$issymlink'." >&4
2908 echo "I do not know how you can test for symbolic links." >&4
2912 *) echo "No symbolic links, so not testing for their testing..." >&4
2916 : Make symlinks util
2917 case "$mksymlinks" in
2920 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2923 *) case "$lns:$issymlink" in
2924 *"ln"*" -s:"*"test -"?)
2925 echo "Creating the symbolic links..." >&4
2927 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2937 print "# dir = ", dir, "file = ", file
2938 mf[dir] = mf[dir]" "source"/"dir"/"file;
2941 if (d != ".") { print("mkdir -p "d) }
2942 print("ln -sf "mf[d]" "d);
2944 }' source="$src" > UU/mksymlinks.$$
2948 if test ! -d t/base; then
2949 echo "Failed to create the subdirectories. Aborting." >&4
2953 if test ! -f t/base/lex.t; then
2954 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2957 if test ! -f win32/win32.c; then
2958 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2963 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2971 : Check for Cross-Compilation
2972 if $test "X$targethost" = "X"; then
2975 if $test "X$targetenv" = "X"; then
2978 case "$usecrosscompile" in
2980 $echo "Cross-compiling..."
2983 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2984 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2985 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2986 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2987 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2988 # leave out ld, choosing it is more complex
2989 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2990 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2991 # We are in a weird spot. Just before us, some values
2992 # were 'saved', to be restored after the hints are
2993 # run. This means that the changes we made to ar,
2994 # nm and ranlib will get reverted.
2995 # To avoid that, we hijack the saving mechanism and
2996 # have it save our new values.
2997 for file in ar nm ranlib; do
2999 eval $file=$xxx$_exe
3004 case "$targetarch" in
3005 '') echo "Targetarch not defined." >&4; croak=y ;;
3006 *) echo "Using targetarch $targetarch." >&4 ;;
3008 case "$targethost" in
3009 '') echo "Targethost not defined." >&4; croak=n ;;
3010 *) echo "Using targethost $targethost." >&4
3015 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
3017 : compile a host miniperl and generate_uudmap, unless we got passed them
3018 if $test "X$hostperl" = X; then
3019 echo "Building host miniperl and generate_uudmap binaries" >&4
3027 $src/Configure -des -Dusedevel -Dmksymlinks
3029 case "$hostgenerate" in
3030 '') $make generate_uudmap
3031 hostgenerate=$src/host/generate_uudmap
3033 "$undef") hostgenerate=''
3036 hostperl=$src/host/miniperl
3039 hostosname=`$hostperl -le 'print $^O'`
3042 usecrosscompile="$undef"
3046 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3047 case "$targethost" in
3048 '') echo "Checking for cross-compile" >&4
3049 case "$usecrosscompile$multiarch" in
3050 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3051 if [ -f Makefile ]; then
3053 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3055 echo "Configure done."
3059 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3066 *) echo "Using targethost $targethost." >&4
3068 /*) run=$src/Cross/run
3069 targetmkdir=$src/Cross/mkdir
3071 from=$src/Cross/from
3073 *) pwd=`$test -f ../Configure & cd ..; pwd`
3075 targetmkdir=$pwd/Cross/mkdir
3077 from=$pwd/Cross/from
3080 case "$targetrun" in
3081 '') targetrun=ssh ;;
3086 case "$targetfrom" in
3087 '') targetfrom=scp ;;
3091 from=$from-$targetfrom
3092 case "$targetdir" in
3094 echo "Guessing targetdir $targetdir." >&4
3097 case "$targetuser" in
3099 echo "Guessing targetuser $targetuser." >&4
3102 case "$targetport" in
3104 echo "Guessing targetport $targetport." >&4
3107 case "$targetfrom" in
3111 case "$targetrun" in
3131 '') cwd=$targetdir ;;
3136 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3142 *) echo "Unknown targetrun '$targetrun'" >&4
3146 case "$targetmkdir" in
3148 cat >$targetmkdir <<EOF
3150 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3152 $chmod a+rx $targetmkdir
3154 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3166 $targetmkdir \`dirname \$f\`
3167 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3170 $targetmkdir $targetdir/\`dirname \$f\`
3171 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3184 $mkdir -p $targetdir/\`dirname \$f\`
3185 $cp \$f $targetdir/\$f || exit 1
3188 $targetmkdir $targetdir/\`dirname \$f\`
3189 $cp \$f $targetdir/\$f || exit 1
3196 *) echo "Unknown targetto '$targetto'" >&4
3200 case "$targetfrom" in
3207 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3212 cp) cat >$from <<EOF
3217 cp $targetdir/\$f . || exit 1
3222 *) echo "Unknown targetfrom '$targetfrom'" >&4
3226 if $test ! -f $run; then
3227 echo "Target 'run' script '$run' not found." >&4
3231 if $test ! -f $to; then
3232 echo "Target 'to' script '$to' not found." >&4
3236 if $test ! -f $from; then
3237 echo "Target 'from' script '$from' not found." >&4
3241 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3245 Using '$run' for remote execution,
3246 and '$from' and '$to'
3247 for remote file transfer.
3253 usecrosscompile="$undef"
3258 : see whether [:lower:] and [:upper:] are supported character classes
3260 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3262 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3266 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3267 # (0xd9 and 0xe2), therefore that is a nice testing point.
3268 if test "X$up" = X -o "X$low" = X; then
3269 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3275 if test "X$up" = X -o "X$low" = X; then
3276 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3282 if test "X$up" = X -o "X$low" = X; then
3283 case "`echo RS | od -x 2>/dev/null`" in
3285 echo "Hey, this might be EBCDIC." >&4
3286 if test "X$up" = X -o "X$low" = X; then
3287 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3288 rs) up='[A-IJ-RS-Z]'
3293 if test "X$up" = X -o "X$low" = X; then
3294 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3304 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3306 echo "Using $up and $low to convert case." >&4
3309 echo "I don't know how to translate letters from upper to lower case." >&4
3310 echo "Your tr is not acting any way I know of." >&4
3314 : set up the translation script tr, must be called with ./tr of course
3318 '[A-Z][a-z]') exec $tr '$up' '$low';;
3319 '[a-z][A-Z]') exec $tr '$low' '$up';;
3326 : Try to determine whether config.sh was made on this system
3327 case "$config_sh" in
3329 myuname=`$uname -a 2>/dev/null`
3330 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3331 # Downcase everything to avoid ambiguity.
3332 # Remove slashes and single quotes so we can use parts of this in
3333 # directory and file names.
3334 # Remove newlines so myuname is sane to use elsewhere.
3335 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3336 # because the A-Z/a-z are not consecutive.
3337 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3338 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3339 newmyuname="$myuname"
3341 case "$knowitall" in
3343 if test -f ../config.sh; then
3344 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3345 eval "`grep myuname= ../config.sh`"
3347 if test "X$myuname" = "X$newmyuname"; then
3355 : Get old answers from old config file if Configure was run on the
3356 : same system, otherwise use the hints.
3359 if test -f config.sh; then
3361 rp="I see a config.sh file. Shall I use it to set the defaults?"
3364 n*|N*) echo "OK, I'll ignore it."
3365 mv config.sh config.sh.old
3366 myuname="$newmyuname"
3368 *) echo "Fetching default answers from your old config.sh file..." >&4
3376 : Older versions did not always set $sh. Catch re-use of such
3386 if test ! -f config.sh; then
3389 First time through, eh? I have some defaults handy for some systems
3390 that need some extra help getting the Configure answers right:
3393 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3395 : Half the following guesses are probably wrong... If you have better
3396 : tests or hints, please send them to https://github.com/Perl/perl5/issues
3397 : The metaconfig authors would also appreciate a copy...
3398 $test -f /irix && osname=irix
3399 $test -f /xenix && osname=sco_xenix
3400 $test -f /dynix && osname=dynix
3401 $test -f /dnix && osname=dnix
3402 $test -f /lynx.os && osname=lynxos
3403 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3404 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3405 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3406 $test -f /bin/mips && /bin/mips && osname=mips
3407 $test -d /usr/apollo/bin && osname=apollo
3408 $test -f /etc/saf/_sactab && osname=svr4
3409 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3410 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3411 $test -f /sys/utilities/MultiView && osname=amigaos
3412 if $test -d /MachTen -o -d /MachTen_Folder; then
3414 if $test -x /sbin/version; then
3415 osvers=`/sbin/version | $awk '{print $2}' |
3416 $sed -e 's/[A-Za-z]$//'`
3417 elif $test -x /usr/etc/version; then
3418 osvers=`/usr/etc/version | $awk '{print $2}' |
3419 $sed -e 's/[A-Za-z]$//'`
3425 $test -f /sys/posix.dll &&
3426 $test -f /usr/bin/what &&
3427 set X `/usr/bin/what /sys/posix.dll` &&
3428 $test "$3" = UWIN &&
3432 if $test -f $uname; then
3440 umips) osname=umips ;;
3443 [23]100) osname=mips ;;
3445 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3446 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3449 elif $test -f /etc/kconfig; then
3451 if test "$lns" = "$ln -s"; then
3453 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3455 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3462 if test -n "$DJGPP"; then
3471 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3473 # oslevel can fail with:
3474 # oslevel: Unable to acquire lock.
3475 *not\ found) osvers="$4"."$3" ;;
3476 '<3240'|'<>3240') osvers=3.2.0 ;;
3477 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3478 '=3250'|'>3250') osvers=3.2.5 ;;
3482 bitrig) osname=bitrig
3485 bsd386) osname=bsd386
3488 cygwin*) osname=cygwin
3491 *dc.osx) osname=dcosx
3497 domainos) osname=apollo
3503 dragonfly) osname=dragonfly
3505 [0-9]*) osvers="$3" ;;
3509 dynixptx*) osname=dynixptx
3510 osvers=`echo "$4"|sed 's/^v//'`
3512 freebsd) osname=freebsd
3514 genix) osname=genix ;;
3518 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3531 $test -f /system/lib/libandroid.so && osname=linux-android
3538 netbsd*) osname=netbsd
3541 news-os) osvers="$3"
3543 4*) osname=newsos4 ;;
3547 nonstop-ux) osname=nonstopux ;;
3548 openbsd) osname=openbsd
3554 POSIX-BC | posix-bc ) osname=posix-bc
3557 powerux | power_ux | powermax_os | powermaxos | \
3558 powerunix | power_unix) osname=powerux
3564 solaris) osname=solaris
3566 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3573 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3577 titanos) osname=titanos
3586 ultrix) osname=ultrix
3589 osf1|mls+) case "$5" in
3592 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3595 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3598 hp*) osname=hp_osf1 ;;
3599 mips) osname=mips_osf1 ;;
3602 # UnixWare 7.1.2 is known as Open UNIX 8
3603 openunix|unixware) osname=svr5
3611 $2) case "$osname" in
3615 : svr4.x or possibly later
3625 if test -f /stand/boot ; then
3626 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3627 if test -n "$INITPROG" -a -f "$INITPROG"; then
3628 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3629 if test -n "$isesix"; then
3637 *) if test -f /etc/systemid; then
3639 set `echo $3 | $sed 's/\./ /g'` $4
3640 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3642 elif $test -f $src/hints/sco_$1_$2.sh; then
3644 elif $test -f $src/hints/sco_$1.sh; then
3649 '') : Still unknown. Probably a generic Sys V.
3658 *) case "$osname" in
3659 '') : Still unknown. Probably a generic BSD.
3667 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3668 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3669 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3672 $rm -f UU/kernel.what
3673 elif test -d c:/. -o -n "$is_os2" ; then
3680 case "$targetarch" in
3683 case "$targetarch" in
3685 # Will load qnx.sh, which should change osname to nto
3690 # Catch arm-linux-androideabi, mipsel-linux-android,
3691 # and i686-linux-android
3692 osname=linux-android
3696 # Something like arm-linux-gnueabihf is really just
3703 # XXX perhaps we should just assume
3704 # osvers to be 2, or maybe take the value
3705 # from targetarch. Using $run before the
3706 # hints are run is somewhat icky.
3707 set X `$run $uname -a 2>/dev/null`
3710 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3715 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3722 : Now look for a hint file osname_osvers, unless one has been
3723 : specified already.
3726 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3727 : Also try without trailing minor version numbers.
3728 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3729 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3730 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3731 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3734 *) case "$osvers" in
3737 *) if $test -f $src/hints/$file.sh ; then
3739 elif $test -f $src/hints/$xfile.sh ; then
3741 elif $test -f $src/hints/$xxfile.sh ; then
3743 elif $test -f $src/hints/$xxxfile.sh ; then
3745 elif $test -f $src/hints/$xxxxfile.sh ; then
3747 elif $test -f "$src/hints/${osname}.sh" ; then
3756 if $test -f Policy.sh ; then
3759 none) dflt="Policy" ;;
3760 *) dflt="Policy $dflt" ;;
3765 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3769 if $test -f Policy.sh ; then
3772 There's also a Policy hint file available, which should make the
3773 site-specific (policy) questions easier to answer.
3780 You may give one or more space-separated answers, or "none" if appropriate.
3781 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3782 previous run of Configure, you may specify it as well as or instead of
3783 OS-specific hints. If hints are provided for your OS, you should use them:
3784 although Perl can probably be built without hints on many platforms, using
3785 hints often improve performance and may enable features that Configure can't
3786 set up on its own. If there are no hints that match your OS, specify "none";
3787 DO NOT give a wrong version or a wrong OS.
3791 rp="Which of these apply, if any?"
3794 for file in $tans; do
3795 if $test X$file = XPolicy -a -f Policy.sh; then
3797 $cat Policy.sh >> UU/config.sh
3798 elif $test -f $src/hints/$file.sh; then
3799 . $src/hints/$file.sh
3800 $cat $src/hints/$file.sh >> UU/config.sh
3801 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3804 : Give one chance to correct a possible typo.
3805 echo "$file.sh does not exist"
3807 rp="hint to use instead?"
3809 for file in $ans; do
3810 if $test -f "$src/hints/$file.sh"; then
3811 . $src/hints/$file.sh
3812 $cat $src/hints/$file.sh >> UU/config.sh
3813 elif $test X$ans = X -o X$ans = Xnone ; then
3816 echo "$file.sh does not exist -- ignored."
3823 : Remember our hint file for later.
3824 if $test -f "$src/hints/$file.sh" ; then
3834 echo "Fetching default answers from $config_sh..." >&4
3838 cp $config_sh config.sh 2>/dev/null
3850 : Restore computed paths
3851 for file in $loclist $trylist; do
3852 eval $file="\$_$file"
3857 Configure uses the operating system name and version to set some defaults.
3858 The default value is probably right if the name rings a bell. Otherwise,
3859 since spelling matters for me, either accept the default or answer "none"
3866 ''|' '|none) dflt=none ;;
3867 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3870 *) dflt="$osname" ;;
3872 rp="Operating system name?"
3876 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3882 ''|' '|none) dflt=none ;;
3883 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3884 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3886 ''|' ') dflt=none ;;
3891 *) dflt="$osvers" ;;
3893 rp="Operating system version?"
3903 : who configured the system
3904 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3907 cf_by=`(logname) 2>/dev/null`
3910 cf_by=`(whoami) 2>/dev/null`
3912 "") cf_by=unknown ;;
3917 : decide how portable to be. Allow command line overrides.
3918 case "$d_portable" in
3920 *) d_portable="$define" ;;
3923 : set up shell script to do ~ expansion
3929 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3932 if $test -f /bin/csh; then
3933 /bin/csh -f -c "glob \$1"
3938 name=\`$expr x\$1 : '..\([^/]*\)'\`
3939 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3940 if $test ! -d "\$dir"; then
3942 echo "\$me: can't locate home directory for: \$name" >&2
3947 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3963 : now set up to get a file name
3967 cat <<'EOSC' >>getfile
3983 : getfile will accept an answer from the comma-separated list
3984 : enclosed in parentheses even if it does not meet other criteria.
3985 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3986 fn=`echo $fn | sed 's/(.*)//'`
3992 loc_file=`expr $fn : '.*:\(.*\)'`
3993 fn=`expr $fn : '\(.*\):.*'`
4001 */*) fullpath=true;;
4010 *e*) exp_file=true;;
4013 *p*) nopath_ok=true;;
4018 *d*) type='Directory';;
4019 *l*) type='Locate';;
4024 Locate) what='File';;
4029 case "$d_portable" in
4037 while test "$type"; do
4042 true) rp="$rp (~name ok)";;
4045 if test -f UU/getfile.ok && \
4046 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4065 value=`UU/filexp $ans`
4068 if test "$ans" != "$value"; then
4069 echo "(That expands to $value on this system.)"
4083 /*) value="$ansexp" ;;
4084 [a-zA-Z]:/*) value="$ansexp" ;;
4089 echo "I shall only accept a full path name, as in /bin/ls." >&4
4090 echo "Use a ! shell escape if you wish to check pathnames." >&4
4093 echo "Please give a full path name, starting with slash." >&4
4096 echo "Note that using ~name is ok provided it expands well." >&4
4109 for fp in $gfpth; do
4110 if test "X$fp" = X.; then
4115 if test -f "$pf"; then
4117 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4119 echo "($value is not a plain file, but that's ok.)"
4122 if test X"$type" = X; then
4129 for fp in $gfpth; do
4130 if test "X$fp" = X.; then
4135 direxp="$fp/$ansexp"
4137 if test -d "$direxp"; then
4145 if test -d "$ansexp"; then
4146 echo "(Looking for $loc_file in directory $value.)"
4147 value="$value/$loc_file"
4148 ansexp="$ansexp/$loc_file"
4150 if test -f "$ansexp"; then
4153 case "$nopath_ok" in
4154 true) case "$value" in
4156 *) echo "Assuming $value will be in people's path."
4172 if test "$fastread" = yes; then
4177 rp="$what $value doesn't exist. Use that name anyway?"
4196 test "X$gfpthkeep" != Xy && gfpth=""
4199 : determine root of directory hierarchy where package will be installed.
4201 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4208 By default, $package will be installed in $dflt/bin, manual pages
4209 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4210 installation directories. Typically this is something like /usr/local.
4211 If you wish to have binaries under /usr/bin but other parts of the
4212 installation under /usr/local, that's ok: you will be prompted
4213 separately for each of the installation directories, the prefix being
4214 only used to set the defaults.
4218 rp='Installation prefix to use?'
4225 *) oldprefix="$prefix";;
4231 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4237 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4239 *) prefixexp="$ansexp"
4242 : allow them to override the AFS root
4245 *) afsroot=$afsroot ;;
4251 $define|true) afs=true ;;
4252 $undef|false) afs=false ;;
4253 *) if $test -d $afsroot; then
4261 echo "AFS may be running... I'll be extra cautious then..." >&4
4263 echo "AFS does not seem to be running..." >&4
4266 : determine installation prefix for where package is to be installed.
4270 Since you are running AFS, I need to distinguish the directory in which
4271 files will reside from the directory in which they are installed (and from
4272 which they are presumably copied to the former directory by occult means).
4275 case "$installprefix" in
4276 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4277 *) dflt="$installprefix";;
4282 In some special cases, particularly when building $package for distribution,
4283 it is convenient to distinguish the directory in which files should be
4284 installed from the directory ($prefix) in which they will
4285 eventually reside. For most users, these two directories are the same.
4288 case "$installprefix" in
4290 *) dflt=$installprefix;;
4294 rp='What installation prefix should I use for installing files?'
4296 installprefix="$ans"
4297 installprefixexp="$ansexp"
4299 : Perform the prefixexp/installprefixexp correction if necessary
4300 cat <<EOS >installprefix
4303 cat <<'EOSC' >>installprefix
4304 : Change installation prefix, if necessary.
4305 if $test X"$prefix" != X"$installprefix"; then
4306 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4308 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4311 chmod +x installprefix
4312 $eunicefix installprefix
4314 : Set variables such as privlib and privlibexp from the output of ./getfile
4315 : performing the prefixexp/installprefixexp correction if necessary.
4316 cat <<EOS >setprefixvar
4319 cat <<'EOSC' >>setprefixvar
4320 eval "${prefixvar}=\"\$ans\""
4321 eval "${prefixvar}exp=\"\$ansexp\""
4324 chmod +x setprefixvar
4325 $eunicefix setprefixvar
4327 : set up the script used to warn in case of inconsistency
4336 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4338 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4339 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4344 echo "*** WHOA THERE!!! ***" >&4
4345 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4348 rp=" Keep the $hint value?"
4351 y) td=$was; tu=$was;;
4355 : function used to set '$1' to '$val'
4356 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4358 $define$undef) . ./whoa; eval "$var=\$td";;
4359 $undef$define) . ./whoa; eval "$var=\$tu";;
4360 *) eval "$var=$val";;
4363 : Do we want threads support and if so, what type
4364 case "$usethreads" in
4365 $define|true|[yY]*) dflt='y';;
4366 *) # Catch case where user specified ithreads but
4367 # forgot -Dusethreads (A.D. 4/2002)
4368 case "$useithreads" in
4369 *$define*) dflt='y';;
4376 Perl can be built to offer a form of threading support on some systems
4377 To do so, Configure can be run with -Dusethreads.
4379 Note that Perl built with threading support runs slightly slower
4380 and uses slightly more memory than plain Perl.
4382 If this doesn't make any sense to you, just accept the default '$dflt'.
4384 rp='Build a threading Perl?'
4387 y|Y) val="$define" ;;
4393 useithreads="$usethreads"
4395 case "$d_oldpthreads" in
4396 '') : Configure tests would be welcome here. For now, assume undef.
4398 *) val="$d_oldpthreads" ;;
4404 : Look for a hint-file generated 'call-back-unit'. If the
4405 : user has specified that a threading perl is to be built,
4406 : we may need to set or change some other defaults.
4407 if $test -f usethreads.cbu; then
4408 echo "Your platform has some specific hints regarding threaded builds, using them..."
4411 case "$usethreads" in
4412 "$define"|true|[yY]*)
4414 (Your platform does not have any specific hints for threaded builds.
4415 Assuming POSIX threads, then.)
4421 : Check if multiplicity is required
4424 Perl can be built so that multiple Perl interpreters can coexist
4425 within the same Perl executable.
4428 case "$useithreads" in
4431 This multiple interpreter support is required for interpreter-based threads.
4435 *) case "$usemultiplicity" in
4436 $define|true|[yY]*) dflt='y';;
4440 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4441 rp='Build Perl for multiplicity?'
4444 y|Y) val="$define" ;;
4452 : Check if morebits is requested
4453 case "$usemorebits" in
4454 "$define"|true|[yY]*)
4455 use64bitint="$define"
4456 uselongdouble="$define"
4457 usemorebits="$define"
4459 *) usemorebits="$undef"
4463 : Determine the C compiler to be used
4469 rp="Use which C compiler?"
4473 : See whether they have no cc but they do have gcc
4475 if $test -f cc.cbu; then
4480 : make some quick guesses about what we are up against
4482 $echo $n "Hmm... $c"
4492 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4493 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4495 echo "Looks kind of like an OSF/1 system, but we'll see..."
4497 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4498 xxx=`./loc addbib blurfl $pth`
4499 if $test -f $xxx; then
4500 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4504 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4505 echo "Looks kind of like an extended USG system, but we'll see..."
4507 echo "Looks kind of like a USG system, but we'll see..."
4511 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4512 echo "Looks kind of like a BSD system, but we'll see..."
4516 echo "Looks kind of like a Version 7 system, but we'll see..."
4519 case "$eunicefix" in
4522 There is, however, a strange, musty smell in the air that reminds me of
4523 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4527 : it so happens the Eunice I know will not run shell scripts in Unix format
4531 echo "Congratulations. You aren't running Eunice."
4535 : Detect OS2. The p_ variable is set above in the Head.U unit.
4536 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4537 : semicolon as a patch separator
4542 I have the feeling something is not exactly right, however...don't tell me...
4543 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4544 (Or you may be running DOS with DJGPP.)
4549 if test -f /xenix; then
4550 echo "Actually, this looks more like a XENIX system..."
4555 echo "It's not Xenix..."
4560 if test -f /venix; then
4561 echo "Actually, this looks more like a VENIX system..."
4568 echo "Nor is it Venix..."
4571 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4572 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4575 : Check if we are using GNU gcc and what its version is
4577 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4581 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4583 printf("%s\n", __VERSION__);
4585 printf("%s\n", "1");
4591 if $cc -o try $ccflags $ldflags try.c; then
4592 gccversion=`$run ./try`
4593 case "$gccversion" in
4594 '') echo "You are not using GNU cc." ;;
4595 *) echo "You are using GNU cc $gccversion."
4601 echo "*** WHOA THERE!!! ***" >&4
4602 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4603 case "$knowitall" in
4605 echo " You'd better start hunting for one and let me know about it." >&4
4611 case "$gccversion" in
4612 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4614 case "$gccversion" in
4615 '') gccosandvers='' ;;
4616 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4617 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4619 case "$gccosandvers" in
4620 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4621 $osname$osvers) ;; # looking good
4622 $osname*) cat <<EOM >&4
4624 *** WHOA THERE!!! ***
4626 Your gcc has not been compiled for the exact release of
4627 your operating system ($gccosandvers versus $osname$osvers).
4629 In general it is a good idea to keep gcc synchronized with
4630 the operating system because otherwise serious problems
4631 may ensue when trying to compile software, like Perl.
4633 I'm trying to be optimistic here, though, and will continue.
4634 If later during the configuration and build icky compilation
4635 problems appear (headerfile conflicts being the most common
4636 manifestation), I suggest reinstalling the gcc to match
4637 your operating system release.
4641 *) gccosandvers='' ;; # failed to parse, better be silent
4649 # gcc 3.* complain about adding -Idirectories that they already know about,
4650 # so we will take those off from locincpth.
4651 case "$gccversion" in
4653 echo "main(){}">try.c
4654 for incdir in $locincpth; do
4655 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4656 grep '^c[cp]p*[01]: warning: changing search order '`
4657 if test "X$warn" != X; then
4658 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4664 # gcc 4.9 by default does some optimizations that break perl.
4665 # see ticket 121505.
4667 # The -fwrapv disables those optimizations (and probably others,) so
4668 # for gcc 4.9 (and later, since the optimizations probably won't go
4669 # away), add -fwrapv unless the user requests -fno-wrapv, which
4670 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4671 # which turns the overflows -fwrapv ignores into runtime errors.
4672 case "$gccversion" in
4673 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4675 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4676 *) ccflags="$ccflags -fwrapv" ;;
4680 # Really old versions of gcc default to C89 and will error for this code.
4681 # See if the compiler (gcc or otherwise) needs a flag to compile C99 code
4682 # Initialisations in for loops seem to be the particular problem
4683 # (Does this syntax conflict with something else that was valid C89?)
4684 # We also add a declaration after a statement to detect whether the compiler
4685 # (or the user supplied -Accflags) consider such declarations to be errors.
4686 # This causes 'Configure with -Accflags="-Werror=declaration-after-statement"'
4687 # to fail hard and early.
4689 # Annoyingly -std=c99 will cause gcc to tell glibc not to define prototypes for
4690 # syscall, drand48 etc when including <unistd.h>, which messes up our build.
4691 # I guess we *could* loop round trying -std=c99 first with checks both for the
4692 # prototype found and the code compiling (because -std=gnu99 might do other
4693 # things we don't want, particularly on non-GCC compilers) but
4694 # 1) We would need to check for the prototype first (without any flags)
4695 # 2) We would still end up with most Linux systems either being -std=gnu99
4696 # or "" (no flag), and so both common options would not rigorously check our
4697 # portability to other platforms.
4698 # So it doesn't seem worth the complexity and chance of different failure.
4699 $cat >try.c <<'EOCP'
4700 int main(int argc, char **argv) {
4702 /* This is deliberately a declaration after a statement. */
4703 unsigned long long count = 0;
4704 for (char **p = argv; *p; ++p) {
4707 return count == 1 ? 0 : argc;
4711 for flag in '' '-std=gnu99' '-std=c99'; do
4712 if $cc -o try $flag $ccflags $ldflags try.c 2>/dev/null && ./try; then
4718 '') echo "Your C compiler doesn't need any special flags to compile C99 code"
4720 no) echo >&4 "Your C compiler doesn't seem to be able to compile C99 code"
4721 rp='Do you really want to continue?'
4725 [yY]) echo >&4 "Okay, continuing." ;;
4729 *) echo "Your C compiler needs $c99_for to compile C99 code"
4730 ccflags="$c99_for $ccflags"
4735 : What should the include directory be ?
4736 : Use sysroot if set, so findhdr looks in the right place.
4738 $echo $n "Hmm... $c"
4739 dflt="$sysroot/usr/include"
4742 if $test -f /bin/mips && /bin/mips; then
4743 echo "Looks like a MIPS system..."
4744 $cat >usr.c <<'EOCP'
4745 #ifdef SYSTYPE_BSD43
4749 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4750 dflt='/bsd43/usr/include'
4754 mips_type='System V'
4756 $rm -f usr.c usr.out
4757 echo "and you're compiling with the $mips_type compiler and libraries."
4761 echo "Doesn't look like a MIPS system."
4771 case "$xxx_prompt" in
4774 rp='Where are the include files you want to use?'
4782 : see how we invoke the C preprocessor
4784 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4785 cat <<'EOT' >testcpp.c
4791 if test ! -f cppstdin; then
4792 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4793 # AIX cc -E doesn't show the absolute headerfile
4794 # locations but we'll cheat by using the -M flag.
4795 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
4797 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4800 echo "Keeping your $hint cppstdin wrapper."
4803 wrapper=`pwd`/cppstdin
4807 if $test "X$cppstdin" != "X" && \
4808 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4809 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4811 echo "You used to use $cppstdin $cppminus so we'll use that again."
4813 '') echo "But let's see if we can live without a wrapper..." ;;
4815 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4816 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4818 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4821 echo "(However, $cpprun $cpplast does not work, let's see...)"
4829 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4836 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4837 $cc -E <testcpp.c >testcpp.out 2>&1; \
4838 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4839 echo "Yup, it does."
4840 x_cpp="$cc $cppflags -E"
4842 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4843 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4844 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4845 echo "Yup, it does."
4846 x_cpp="$cc $cppflags -E"
4848 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4849 $cc -P <testcpp.c >testcpp.out 2>&1; \
4850 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4851 echo "Yipee, that works!"
4852 x_cpp="$cc $cppflags -P"
4854 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4855 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4856 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4857 echo "At long last!"
4858 x_cpp="$cc $cppflags -P"
4860 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4861 $cpp <testcpp.c >testcpp.out 2>&1; \
4862 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4864 x_cpp="$cpp $cppflags"
4866 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4867 $cpp - <testcpp.c >testcpp.out 2>&1; \
4868 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 echo "Hooray, it works! I was beginning to wonder."
4870 x_cpp="$cpp $cppflags"
4872 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4873 $wrapper <testcpp.c >testcpp.out 2>&1; \
4874 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4880 rp="No dice. I can't find a C preprocessor. Name one:"
4884 $x_cpp <testcpp.c >testcpp.out 2>&1
4885 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4886 echo "OK, that will do." >&4
4888 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4903 echo "Perhaps can we force $cc -E using a wrapper..."
4904 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4905 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4911 echo "Nope, we'll have to live without it..."
4925 "$wrapper"|'cppstdin') ;;
4926 *) $rm -f $wrapper;;
4928 $rm -f testcpp.c testcpp.out
4930 : Adjust cppfilter for path component separator
4932 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4933 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4937 : Use gcc to determine libpth and incpth
4938 # If using gcc or clang, we can get better values for libpth, incpth
4939 # and usrinc directly from the compiler.
4940 # Note that ccname for clang is also gcc.
4943 realpath=`which realpath 2>/dev/null | sed 's/no realpath in.*//'`
4944 $echo 'extern int foo;' > try.c
4945 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4948 if $test $# -gt 0; then
4951 */realpath) i=`$realpath $i` ;;
4954 j="`$echo $i | $sed 's,/include[^/]*,/lib,'`"
4955 if $test -d $j; then
4956 inclibpth="$inclibpth $j"
4959 incpth="`$echo $incpth | $sed 's/^ //'`"
4960 for xxx in $inclibpth $loclibpth $plibpth $glibpth; do
4961 if $test -d $xxx; then
4963 */realpath) xxx=`$realpath $xxx` ;;
4967 *) libpth="$libpth $xxx";;
4971 libpth="`$echo $libpth | $sed 's/^ //'`"
4975 '') for i in $incpth; do
4976 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4984 case "$usecrosscompile" in
4987 '') echo "Incpth not defined." >&4; croak=y ;;
4988 *) echo "Using incpth '$incpth'." >&4 ;;
4991 '') echo "Libpth not defined." >&4; croak=y ;;
4992 *) echo "Using libpth '$libpth'." >&4 ;;
4995 '') echo "Usrinc not defined." >&4; croak=y ;;
4996 *) echo "Using usrinc $usrinc." >&4 ;;
5000 if test "X$sysroot" = X; then
5001 echo "Cannot continue, aborting." >&4; exit 1
5003 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5012 : Default value for incpth is just usrinc
5014 '') incpth="$usrinc";;
5017 : Set private lib path
5020 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5025 '') dlist="$loclibpth $plibpth $glibpth";;
5026 *) dlist="$libpth";;
5029 : Now check and see which directories actually exist, avoiding duplicates
5032 if $test -d $xxx; then
5035 *) libpth="$libpth $xxx";;
5041 Some systems have incompatible or broken versions of libraries. Among
5042 the directories listed in the question below, please remove any you
5043 know not to be holding relevant libraries, and add any that are needed.
5044 Say "none" for none.
5048 if test "X$sysroot" != X; then
5050 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5063 rp="Directories to use for library searches?"
5070 : compute shared library extension
5073 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5083 On some systems, shared libraries may be available. Answer 'none' if
5084 you want to suppress searching of shared libraries for the remainder
5085 of this configuration.
5088 rp='What is the file extension used for shared libraries?'
5092 : Does target system insist that shared library basenames are unique
5095 Some dynamic loaders assume that the *basename* of shared library filenames
5096 are globally unique. We'll default this to undef as we assume your system
5097 is not this weird. Set to defined if you're on one of them.
5102 rp='Make shared library basenames unique?'
5105 y|Y) val="$define" ;;
5108 set d_libname_unique
5111 : Define several unixisms.
5112 : Hints files or command line option can be used to override them.
5113 : The convoluted testing is in case hints files set either the old
5116 '') case "$exe_ext" in
5118 *) _exe="$exe_ext" ;;
5123 '') case "$lib_ext" in
5130 '') case "$obj_ext" in
5137 '') case "$path_sep" in
5148 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5150 : Which makefile gets called first. This is used by make depend.
5151 case "$firstmakefile" in
5152 '') firstmakefile='makefile';;
5155 : Check is we will use socks
5157 $define|true|[yY]*) dflt='y';;
5162 Perl can be built to use the SOCKS proxy protocol library. To do so,
5163 Configure must be run with -Dusesocks. If you use SOCKS you also need
5164 to use the PerlIO abstraction layer, this will be implicitly selected.
5166 If this doesn't make any sense to you, just accept the default '$dflt'.
5168 rp='Build Perl for SOCKS?'
5171 y|Y) val="$define" ;;
5177 : Check for uselongdouble support
5179 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5182 case "$uselongdouble" in
5183 $define|true|[yY]*) dflt='y';;
5188 Perl can be built to take advantage of long doubles which
5189 (if available) may give more accuracy and range for floating point numbers.
5191 If this doesn't make any sense to you, just accept the default '$dflt'.
5193 rp='Try to use long doubles if available?'
5196 y|Y) val="$define" ;;
5202 case "$uselongdouble" in
5203 true|[yY]*) uselongdouble="$define" ;;
5206 : Look for a hint-file generated 'call-back-unit'. If the
5207 : user has specified that long doubles should be used,
5208 : we may need to set or change some other defaults.
5209 if $test -f uselongdouble.cbu; then
5210 echo "Your platform has some specific hints regarding long doubles, using them..."
5211 . ./uselongdouble.cbu
5213 case "$uselongdouble" in
5216 (Your platform does not have any specific hints for long doubles.)
5222 : Check if quadmath is requested
5223 case "$usequadmath" in
5224 "$define"|true|[yY]*) usequadmath="$define" ;;
5225 *) usequadmath="$undef" ;;
5228 : Fail if both uselongdouble and usequadmath are requested
5229 case "$usequadmath:$uselongdouble" in
5233 *** You requested the use of the quadmath library and use
5234 *** of long doubles.
5236 *** Please select one or the other.
5242 : Looking for optional libraries
5244 echo "Checking for optional libraries..." >&4
5249 case "$libswanted" in
5250 '') libswanted='c_s';;
5253 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5255 case "$usecbacktrace" in
5256 "$define") libswanted="$libswanted bfd" ;;
5258 case "$usequadmath" in
5259 "$define") libswanted="$libswanted quadmath" ;;
5265 for thisdir in $libpth $xlibpth; do
5266 test -d $thisdir && libspath="$libspath $thisdir"
5268 for thislib in $libswanted; do
5269 for thisdir in $libspath; do
5271 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5272 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5273 $test -f "$xxx" && eval $libscheck
5274 $test -f "$xxx" && libstyle=shared
5275 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5276 $test -f "$xxx" && eval $libscheck
5277 $test -f "$xxx" && libstyle=shared
5279 if test ! -f "$xxx"; then
5280 xxx=$thisdir/lib$thislib.$so$_a
5281 $test -f "$xxx" && eval $libscheck
5282 $test -f "$xxx" && libstyle="import"
5284 if test ! -f "$xxx"; then
5285 xxx=$thisdir/$thislib.$so$_a
5286 $test -f "$xxx" && eval $libscheck
5287 $test -f "$xxx" && libstyle="import"
5289 if test ! -f "$xxx"; then
5290 xxx=$thisdir/lib$thislib.$so
5291 $test -f "$xxx" && eval $libscheck
5292 $test -f "$xxx" && libstyle=shared
5294 if test ! -f "$xxx"; then
5295 xxx=$thisdir/lib$thislib$_a
5296 $test -f "$xxx" && eval $libscheck
5297 $test -f "$xxx" && libstyle=static
5299 if test ! -f "$xxx"; then
5300 xxx=$thisdir/$thislib$_a
5301 $test -f "$xxx" && eval $libscheck
5302 $test -f "$xxx" && libstyle=static
5304 if test ! -f "$xxx"; then
5305 xxx=$thisdir/lib${thislib}_s$_a
5306 $test -f "$xxx" && eval $libscheck
5307 $test -f "$xxx" && libstyle=static
5308 $test -f "$xxx" && thislib=${thislib}_s
5310 if test ! -f "$xxx"; then
5311 xxx=$thisdir/Slib$thislib$_a
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=static
5315 if $test -f "$xxx"; then
5317 shared) echo "Found -l$thislib (shared)." ;;
5318 static) echo "Found -l$thislib." ;;
5319 *) echo "Found -l$thislib ($libstyle)." ;;
5323 *) dflt="$dflt -l$thislib"
5324 libsfound="$libsfound $xxx"
5326 libsfiles="$libsfiles $yyy"
5327 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5328 case " $libsdirs " in
5330 *) libsdirs="$libsdirs $yyy" ;;
5337 if $test ! -f "$xxx"; then
5338 echo "No -l$thislib."
5349 ' '|'') dflt='none';;
5354 In order to compile $package on your machine, a number of libraries
5355 are usually needed. Include any other special libraries here as well.
5356 Say "none" for none. The default list is almost always right.
5360 rp="What libraries to use?"
5367 : determine optimization, if desired, or use for debug flag also
5369 ' '|$undef) dflt='none';;
5371 *) dflt="$optimize";;
5375 By default, $package compiles with the -O flag to use the optimizer.
5376 Alternately, you might want to use the symbolic debugger, which uses
5377 the -g flag (on traditional Unix systems). Either flag can be
5378 specified here. To use neither flag, specify the word "none".
5381 rp="What optimizer/debugger flag should be used?"
5385 'none') optimize=" ";;
5388 : Check what DEBUGGING is required from the command line
5389 : -DEBUGGING or -DDEBUGGING or
5390 : -DEBUGGING=both = -g + -DDEBUGGING
5391 : -DEBUGGING=-g or -Doptimize=-g = -g
5392 : -DEBUGGING=none or -UDEBUGGING =
5393 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5396 *) DEBUGGING=$EBUGGING ;;
5399 case "$DEBUGGING" in
5403 *) optimize="$optimize -g" ;;
5407 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5415 case "$DEBUGGING" in
5416 both|$define) dflt='-DDEBUGGING'
5419 : argument order is deliberate, as the flag will start with - which set could
5420 : think is an option
5421 checkccflag='check=$1; flag=$2; callback=$3;
5423 echo "Checking if your compiler accepts $flag" >&4;
5424 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5425 echo "int main(void) { return 0; }" > gcctest.c;
5426 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5427 echo "Yes, it does." >&4;
5428 if $test -s gcctest.out ; then
5429 echo "But your platform does not like it:";
5434 echo "Leaving current flags $ccflags alone." >&4
5436 *) dflt="$dflt $flag";
5442 echo "Nope, it does not, but that is ok." >&4;
5446 : We will not override a previous value, but we might want to
5447 : augment a hint file
5449 default|recommended)
5450 case "$gccversion" in
5451 1.*) dflt="$dflt -fpcc-struct-return" ;;
5453 case "$optimize:$DEBUGGING" in
5454 *-g*:old) dflt="$dflt -DDEBUGGING";;
5456 case "$gccversion" in
5457 2.*) if $test -d /etc/conf/kconfig.d &&
5458 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5460 # Interactive Systems (ISC) POSIX mode.
5465 case "$gccversion" in
5468 ?*) set strict-aliasing -fno-strict-aliasing
5472 # For gcc, adding -pipe speeds up compilations for some, but apparently
5473 # some assemblers can't read from stdin. (It also slows down compilations
5474 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5475 case "$gccversion" in
5481 # on x86_64 (at least) we require an extra library (libssp) in the
5482 # link command line. This library is not named, so I infer that it is
5483 # an implementation detail that may change. Hence the safest approach
5484 # is to add the flag to the flags passed to the compiler at link time,
5485 # as that way the compiler can do the right implementation dependant
5488 *-fno-stack-protector*)
5489 echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
5491 *) case "$gccversion" in
5492 ?*) set stack-protector-strong -fstack-protector-strong
5495 *-fstack-protector-strong*) ;; # It got added.
5496 *) # Try the plain/older -fstack-protector.
5497 set stack-protector -fstack-protector
5507 case "$mips_type" in
5508 *BSD*|'') inclwanted="$locincpth $usrinc";;
5509 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5511 for thisincl in $inclwanted; do
5512 if $test -d $thisincl; then
5513 if $test x$thisincl != x$usrinc; then
5515 *" -I$thisincl "*);;
5516 *) dflt="$dflt -I$thisincl ";;
5522 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5524 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5532 *) dflt="$dflt -D$2";;
5536 set signal.h LANGUAGE_C; eval $inctest
5540 ccflags="$ccflags -DSOCKS"
5545 default|recommended) dflt="$ccflags $dflt" ;;
5546 *) dflt="$ccflags";;
5555 Your C compiler may want other flags. For this question you should include
5556 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5557 but you should NOT include libraries or ld flags like -lwhatever. If you
5558 want $package to honor its debug switch, you should include -DDEBUGGING here.
5559 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5561 To use no flags, specify the word "none".
5567 rp="Any additional cc flags?"
5574 : the following weeds options from ccflags that are of no interest to cpp
5576 '') cppflags="$ccflags" ;;
5577 *) set X $ccflags; shift
5578 case " $cppflags " in
5579 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5580 *) cppflags="$cppflags $ccflags" ;;
5584 case "$gccversion" in
5585 1.*) cppflags="$cppflags -D__GNUC__"
5587 case "$mips_type" in
5589 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5595 echo "Let me guess what the preprocessor flags are..." >&4
5609 *) ftry="$previous $flag";;
5611 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5612 >cpp1.out 2>/dev/null && \
5613 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5614 >cpp2.out 2>/dev/null && \
5615 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5616 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5618 cppflags="$cppflags $ftry"
5628 *-*) echo "They appear to be: $cppflags";;
5630 $rm -f cpp.c cpp?.out
5634 : flags used in final linking phase
5636 '') if ./venix; then
5642 *-posix*) dflt="$dflt -posix" ;;
5645 *) dflt="$ldflags";;
5647 # See note above about -fstack-protector
5649 *-fstack-protector-strong*)
5651 *-fstack-protector-strong*) ;; # Don't add it again
5652 *) dflt="$dflt -fstack-protector-strong" ;;
5655 *-fstack-protector*)
5657 *-fstack-protector*) ;; # Don't add it again
5658 *) dflt="$dflt -fstack-protector" ;;
5663 : Try to guess additional flags to pick up local libraries.
5664 for thislibdir in $libpth; do
5665 case " $loclibpth " in
5668 *"-L$thislibdir "*) ;;
5669 *) dflt="$dflt -L$thislibdir" ;;
5681 Your C linker may need flags. For this question you should
5682 include -L/whatever and any other flags used by the C linker, but you
5683 should NOT include libraries like -lwhatever.
5685 Make sure you include the appropriate -L/path flags if your C linker
5686 does not normally search all of the directories you specified above,
5689 To use no flags, specify the word "none".
5693 rp="Any additional ld flags (NOT including libraries)?"
5699 rmlist="$rmlist pdp11"
5703 echo "Checking your choice of C compiler and flags for coherency..." >&4
5704 $cat > try.c <<'EOF'
5706 int main() { printf("Ok\n"); return(0); }
5708 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5710 $cat >try.msg <<'EOM'
5711 I've tried to compile and run the following simple program:
5714 $cat try.c >> try.msg
5716 $cat >> try.msg <<EOM
5723 and I got the following output:
5727 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5728 if $sh -c "$run ./try " >>try.msg 2>&1; then
5732 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5735 echo "The program compiled OK, but exited with status $?." >>try.msg
5736 rp="You have a problem. Shall I abort Configure"
5740 echo "I can't compile the test program." >>try.msg
5741 rp="You have a BIG problem. Shall I abort Configure"
5747 case "$knowitall" in
5749 echo "(The supplied flags or libraries might be incorrect.)"
5757 *) echo "Ok. Stopping Configure." >&4
5762 n) echo "OK, that should do.";;
5764 $rm_try gcctest gcctest.out
5766 : define a shorthand compile call
5770 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5771 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
5775 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5776 : define a shorthand compile call for compilations that should be ok.
5780 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5782 : stub, used only to satisfy other units
5785 : check for lengths of integral types
5789 echo "Checking to see how big your integers are..." >&4
5798 printf("intsize=%d;\n", (int)sizeof(int));
5799 printf("longsize=%d;\n", (int)sizeof(long));
5800 printf("shortsize=%d;\n", (int)sizeof(short));
5805 if eval $compile_ok && $run ./try > /dev/null; then
5807 echo "Your integers are $intsize bytes long."
5808 echo "Your long integers are $longsize bytes long."
5809 echo "Your short integers are $shortsize bytes long."
5813 Help! I can't compile and run the intsize test program: please enlighten me!
5814 (This is probably a misconfiguration in your system or libraries, and
5815 you really ought to fix it. Still, I'll try anyway.)
5819 rp="What is the size of an integer (in bytes)?"
5823 rp="What is the size of a long integer (in bytes)?"
5827 rp="What is the size of a short integer (in bytes)?"
5835 : check for long long
5837 echo "Checking to see if you have long long..." >&4
5838 echo 'int main() { long long x = 7; return 0; }' > try.c
5840 if eval $compile; then
5842 echo "You have long long."
5845 echo "You do not have long long."
5851 : check for length of long long
5852 case "${d_longlong}${longlongsize}" in
5855 echo "Checking to see how big your long longs are..." >&4
5856 $cat >try.c <<'EOCP'
5860 printf("%d\n", (int)sizeof(long long));
5865 if eval $compile_ok; then
5866 longlongsize=`$run ./try`
5867 echo "Your long longs are $longlongsize bytes long."
5871 echo "(I can't seem to compile the test program. Guessing...)"
5872 rp="What is the size of a long long (in bytes)?"
5876 if $test "X$longsize" = "X$longlongsize"; then
5877 echo "(That isn't any different from an ordinary long.)"
5883 : determine filename position in cpp output
5885 echo "Computing filename position in cpp output for #include directives..." >&4
5887 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5892 vos) testaccess=-e ;;
5895 echo '#include <stdio.h>' > foo.c
5898 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5899 $grep '^[ ]*#.*stdio\.h' | \
5900 while read cline; do
5903 while $test \$# -gt 0; do
5904 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5909 pos=\`expr \$pos + 1\`
5923 *) pos="${fieldn}th";;
5925 echo "Your cpp writes the filename in the $pos field of the line."
5927 : locate header file
5932 for usrincdir in $incpth
5934 if test -f \$usrincdir/\$wanted; then
5935 echo "\$usrincdir/\$wanted"
5939 awkprg='{ print \$$fieldn }'
5940 echo "#include <\$wanted>" > foo\$\$.c
5941 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5942 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5943 while read cline; do
5944 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5946 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5947 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5952 # status = 0: grep returned 0 lines, case statement not executed
5953 # status = 1: headerfile found
5954 # status = 2: while loop executed, no headerfile found
5958 if test \$status -eq 1; then
5965 : define an alternate in-header-list? function
5966 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5967 cont=true; xxf="echo \"<\$1> found.\" >&4";
5968 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5969 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5971 case $# in 4) instead=instead;; *) instead="at last";; esac;
5972 while $test "$cont"; do
5974 var=$2; eval "was=\$$2";
5975 if $test "$xxx" && $test -r "$xxx";
5977 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5980 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5981 set $yyy; shift; shift; yyy=$@;
5982 case $# in 0) cont="";;
5983 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5984 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5985 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5986 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5990 do set $yyy; var=$2; eval "was=\$$2";
5991 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5992 set $yyy; shift; shift; yyy=$@;
5995 : see if inttypes.h is available
5996 : we want a real compile instead of Inhdr because some systems
5997 : have an inttypes.h which includes non-existent headers
6000 #include <inttypes.h>
6002 static int32_t foo32 = 0x12345678;
6006 if eval $compile; then
6007 echo "<inttypes.h> found." >&4
6010 echo "<inttypes.h> NOT found." >&4
6019 echo "Checking to see if you have int64_t..." >&4
6021 #include <sys/types.h>
6022 #$i_inttypes I_INTTYPES
6024 #include <inttypes.h>
6026 int main() { int64_t x = 7; }
6029 if eval $compile; then
6031 echo "You have int64_t."
6034 echo "You do not have int64_t."
6040 : Check if 64bit ints have a quad type
6042 echo "Checking which 64-bit integer type we could use..." >&4
6048 val='"unsigned int"'
6053 *) case "$longsize" in
6057 val='"unsigned long"'
6062 *) case "$d_longlong:$longlongsize" in
6067 val='"unsigned long long"'
6072 *) case "$d_int64_t" in
6091 '') echo "Alas, no 64-bit integer types in sight." >&4
6094 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6099 : Do we want 64bit support
6100 case "$uselonglong" in
6101 "$define"|true|[yY]*)
6104 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6106 use64bitint="$define"
6109 case "$use64bits" in
6110 "$define"|true|[yY]*)
6113 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6115 use64bitint="$define"
6118 case "$use64bitints" in
6119 "$define"|true|[yY]*)
6122 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6124 use64bitint="$define"
6127 case "$use64bitsint" in
6128 "$define"|true|[yY]*)
6131 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6133 use64bitint="$define"
6136 case "$uselonglongs" in
6137 "$define"|true|[yY]*)
6140 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6142 use64bitint="$define"
6145 case "$use64bitsall" in
6146 "$define"|true|[yY]*)
6149 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6151 use64bitall="$define"
6156 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6158 case "$use64bitall" in
6159 "$define"|true|[yY]*) use64bitint="$define" ;;
6165 You have natively 64-bit long integers.
6169 *) case "$use64bitint" in
6170 "$define"|true|[yY]*) dflt='y';;
6179 Perl can be built to take advantage of 64-bit integer types
6180 on some systems. To do so, Configure can be run with -Duse64bitint.
6181 Choosing this option will most probably introduce binary incompatibilities.
6183 If this doesn't make any sense to you, just accept the default '$dflt'.
6184 (The default has been chosen based on your configuration.)
6186 rp='Try to use 64-bit integers, if available?'
6189 [yY]*) val="$define" ;;
6197 case "$use64bitall" in
6198 "$define"|true|[yY]*) dflt='y' ;;
6199 *) case "$longsize" in
6207 You may also choose to try maximal 64-bitness. It means using as much
6208 64-bitness as possible on the platform. This in turn means even more
6209 binary incompatibilities. On the other hand, your platform may not
6210 have any more 64-bitness available than what you already have chosen.
6212 If this doesn't make any sense to you, just accept the default '$dflt'.
6213 (The default has been chosen based on your configuration.)
6215 rp='Try to use maximal 64-bit support, if available?'
6218 [yY]*) val="$define" ;;
6223 case "$use64bitall" in
6225 case "$use64bitint" in
6229 Since you have chosen a maximally 64-bit build, I'm also turning on
6230 the use of 64-bit integers.
6232 use64bitint="$define" ;;
6237 : Look for a hint-file generated 'call-back-unit'. If the
6238 : user has specified that a 64-bit perl is to be built,
6239 : we may need to set or change some other defaults.
6240 if $test -f use64bitint.cbu; then
6241 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6244 case "$use64bitint" in
6245 "$define"|true|[yY]*)
6246 : This test was common to all the OpenBSD forks, and seems harmless for
6249 echo "Checking if your C library has broken 64-bit functions..." >&4
6252 typedef $uquadtype myULL;
6259 {4294967303.15, 4294967303ULL},
6260 {4294967294.2, 4294967294ULL},
6261 {4294967295.7, 4294967295ULL},
6264 for (p = test; p->u; p++) {
6265 myULL x = (myULL)p->d;
6276 if eval $compile_ok; then
6277 libcquad=`$run ./try`
6278 echo "Your C library's 64-bit functions are $libcquad."
6280 echo "(I can't seem to compile the test program.)"
6281 echo "Assuming that your C library's 64-bit functions are ok."
6290 *** You have a C library with broken 64-bit functions.
6291 *** 64-bit support does not work reliably in this configuration.
6292 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6293 *** Cannot continue, aborting.
6300 4) case "$archname64" in
6301 '') archname64=64int ;;
6308 : Look for a hint-file generated 'call-back-unit'. If the
6309 : user has specified that a maximally 64-bit perl is to be built,
6310 : we may need to set or change some other defaults.
6311 if $test -f use64bitall.cbu; then
6312 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6315 case "$use64bitall" in
6316 "$define"|true|[yY]*)
6318 4) case "$archname64" in
6319 ''|64int) archname64=64all ;;
6326 case "$d_quad:$use64bitint" in
6330 *** You have chosen to use 64-bit integers,
6331 *** but none can be found.
6332 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6333 *** Cannot continue, aborting.
6340 : Check if we are using the GNU C library
6342 echo "Checking for GNU C Library..." >&4
6344 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6345 alone are insufficient to distinguish different versions, such as
6346 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6347 libc version 2.1.0. A. Dougherty, June 3, 2002.
6353 # ifdef __GLIBC_MINOR__
6354 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6355 # include <gnu/libc-version.h>
6356 printf("%s\n", gnu_get_libc_version());
6358 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6361 printf("%d\n", __GLIBC__);
6370 if eval $compile_ok && $run ./try > glibc.ver; then
6372 gnulibc_version=`$cat glibc.ver`
6373 echo "You are using the GNU C Library version $gnulibc_version"
6377 echo "You are not using the GNU C Library"
6383 : see if nm is to be used to determine whether a symbol is defined or not
6387 case "$d_gnulibc" in
6390 echo "nm probably won't work on the GNU C Library." >&4
6396 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6398 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6399 echo "'nm' won't be sufficient on this system." >&4
6405 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6406 if $test $dflt -gt 20; then
6416 true|$define) dflt=y;;
6423 I can use $nm to extract the symbols from your C libraries. This
6424 is a time consuming task which may generate huge output on the disk (up
6425 to 3 megabytes) but that should make the symbols extraction faster. The
6426 alternative is to skip the 'nm' extraction part and to compile a small
6427 test program instead to determine whether each symbol is present. If
6428 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6429 this may be the best solution.
6431 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6434 rp="Shall I use $nm to extract C symbols from the libraries?"
6437 [Nn]*) usenm=false;;
6446 : nm options which may be necessary
6448 '') if $test -f /mach_boot; then
6450 elif $test -d /usr/ccs/lib; then
6451 nm_opt='-p' # Solaris (and SunOS?)
6452 elif $test -f /dgux; then
6454 elif $test -f /lib64/rld; then
6455 nm_opt='-p' # 64-bit Irix
6461 : nm options which may be necessary for shared libraries but illegal
6462 : for archive libraries. Thank you, Linux.
6463 case "$nm_so_opt" in
6464 '') case "$myuname" in
6466 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6467 nm_so_opt='--dynamic'
6474 : Figure out where the libc is located
6477 : get list of predefined functions in a handy place
6482 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6488 *) for thislib in $libs; do
6491 : Handle C library specially below.
6494 thislib=`echo $thislib | $sed -e 's/^-l//'`
6495 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6497 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6499 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6501 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6503 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6505 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6507 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6512 libnames="$libnames $try"
6514 *) libnames="$libnames $thislib" ;;
6523 for xxx in $libpth; do
6524 $test -r $1 || set $xxx/libc.$so
6525 : The messy sed command sorts on library version numbers.
6527 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6528 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6530 s/[0-9][0-9]*/0000&/g
6531 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6534 $sort | $sed -e 's/^.* //'`
6537 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6538 $test -r $1 || set $sysroot/lib/libsys_s$_a
6544 if $test -r "$1"; then
6545 echo "Your (shared) C library seems to be in $1."
6547 elif $test -r /lib/libc && $test -r /lib/clib; then
6548 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6550 libc='/lib/clib /lib/libc'
6551 if $test -r /lib/syslib; then
6552 echo "(Your math library is in /lib/syslib.)"
6553 libc="$libc /lib/syslib"
6555 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6556 echo "Your C library seems to be in $libc, as you said before."
6557 elif $test -r $incpath/usr/lib/libc$_a; then
6558 libc=$incpath/usr/lib/libc$_a;
6559 echo "Your C library seems to be in $libc. That's fine."
6560 elif $test -r /lib/libc$_a; then
6562 echo "Your C library seems to be in $libc. You're normal."
6564 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6566 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6567 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6568 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6570 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6572 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6575 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6577 if $test -r "$tans"; then
6578 echo "Your C library seems to be in $tans, of all places."
6584 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6588 If the guess above is wrong (which it might be if you're using a strange
6589 compiler, or your machine supports multiple models), you can override it here.
6594 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6596 I can't seem to find your C library. I've looked in the following places:
6599 $sed 's/^/ /' libpath
6602 None of these seems to contain your C library. I need to get its name...
6607 rp='Where is your C library?'
6612 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6613 set X `cat libnames`
6616 case $# in 1) xxx=file; esac
6617 echo "Extracting names from the following $xxx for later perusal:" >&4
6619 $sed 's/^/ /' libnames >&4
6621 $echo $n "This may take a while...$c" >&4
6625 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6626 *) $nm $nm_opt $file 2>/dev/null;;
6631 $grep fprintf libc.tmp > libc.ptf
6632 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6633 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6635 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6639 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6643 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6647 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6651 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6655 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6659 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6660 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6676 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6680 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6684 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6688 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 $nm -p $* 2>/dev/null >libc.tmp
6694 $grep fprintf libc.tmp > libc.ptf
6695 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6696 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6702 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6704 if $ar t $libc > libc.tmp && \
6705 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6707 for thisname in $libnames $libc; do
6708 $ar t $thisname >>libc.tmp
6710 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6712 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6713 for thisname in $libnames $libc; do
6714 $ar tv $thisname >>libc.tmp
6715 emximp -o tmp.imp $thisname \
6717 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6718 < tmp.imp >>libc.tmp
6721 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6724 echo "$ar didn't seem to work right." >&4
6725 echo "Maybe this is a Cray...trying bld instead..." >&4
6727 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6730 for thisname in $libnames; do
6732 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6733 $ar t $thisname >>libc.tmp
6737 echo "That didn't work either. Giving up." >&4
6747 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6748 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6750 *) if $test -f /lib/syscalls.exp; then
6752 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6753 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6754 /lib/syscalls.exp >>libc.list
6760 $rm -f libnames libpath
6762 : Check if we are using C++
6764 echo "Checking for C++..." >&4
6765 $cat >try.c <<'EOCP'
6777 if eval $compile_ok && $run ./try; then
6779 echo "You are using a C++ compiler."
6782 echo "You are not using a C++ compiler."
6788 : is a C symbol defined?
6791 -v) tf=libc.tmp; tdc="";;
6792 -a) tf=libc.tmp; tdc="[]";;
6793 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6795 case "$d_cplusplus" in
6796 $define) extern_C="extern \"C\"" ;;
6797 *) extern_C="extern" ;;
6800 case "$reuseval-$4" in
6802 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6807 if $test "$runnm" = true; then
6808 if $contains $tlook $tf >/dev/null 2>&1; then
6810 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6811 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;
6812 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6813 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6817 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;
6818 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6824 $define) tval=true;;
6831 : define an is-in-libc? function
6832 inlibc='echo " "; td=$define; tu=$undef;
6833 sym=$1; var=$2; eval "was=\$$2";
6835 case "$reuseval$was" in
6845 echo "$sym() found." >&4;
6846 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6848 echo "$sym() NOT found." >&4;
6849 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6853 $define) echo "$sym() found." >&4;;
6854 *) echo "$sym() NOT found." >&4;;
6858 : check for length of double
6860 case "$doublesize" in
6862 echo "Checking to see how big your double precision numbers are..." >&4
6871 printf("%d\n", (int)sizeof(double));
6876 if eval $compile_ok; then
6877 doublesize=`$run ./try`
6878 echo "Your double is $doublesize bytes long."
6881 echo "(I can't seem to compile the test program. Guessing...)"
6882 rp="What is the size of a double precision number (in bytes)?"
6890 : check for long doubles
6892 echo "Checking to see if you have long double..." >&4
6893 echo 'int main() { long double x = 7.0; }' > try.c
6895 if eval $compile; then
6897 echo "You have long double." >&4
6900 echo "You do not have long double." >&4
6906 : see if ldexpl exists
6910 : check for length of long double
6911 case "${d_longdbl}${longdblsize}" in
6914 echo "Checking to see how big your long doubles are..." >&4
6915 $cat >try.c <<'EOCP'
6919 printf("%d\n", sizeof(long double));
6924 if eval $compile; then
6925 longdblsize=`$run ./try`
6926 echo "Your long doubles are $longdblsize bytes long." >&4
6930 echo "(I can't seem to compile the test program. Guessing...)" >&4
6931 rp="What is the size of a long double (in bytes)?"
6935 if $test "X$doublesize" = "X$longdblsize"; then
6936 echo "That isn't any different from an ordinary double." >&4
6937 echo "I'll keep your setting anyway, but you may see some" >&4
6938 echo "harmless compilation warnings." >&4
6944 $echo "Checking the kind of long doubles you have..." >&4
6945 case "$d_longdbl" in
6949 #define LONGDBLSIZE $longdblsize
6950 #define DOUBLESIZE $doublesize
6956 static const long double d = -0.1L;
6958 unsigned const char* b = (unsigned const char*)(&d);
6959 #if DOUBLESIZE == LONGDBLSIZE
6960 printf("0\n"); /* if it floats like double */
6963 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6964 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6965 /* IEEE 754 128-bit little-endian */
6969 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6970 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6975 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6976 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6977 * cannot be trusted. */
6978 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6979 if (b[0] == 0xCD && b[9] == 0xBF) {
6980 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6981 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6982 * Also known as "extended precision". */
6986 if (b[0] == 0xBF && b[9] == 0xCD) {
6987 /* Is there ever big-endian 80-bit, really?
6989 * The Motorola 68881 had another "extended precision" format:
6990 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6991 * for total of 96 bits of bytes. The zero bits were unused.
6992 * See "M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL" for more details.
6993 * If it ever becomes relevant, this format should be allocated a
6994 * new doublekind code since it is quite different from the Intel x87.
7000 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7001 /* software "double double", the 106 is 53+53.
7002 * but irix thinks it is 107. */
7003 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7004 /* double double 128-bit fully little-endian,
7005 * little-endian doubles in little-endian order,
7006 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7010 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7011 /* double double 128-bit fully big-endian,
7012 * big-endian doubles in big-endian order,
7013 * e.g. PPC/Power and MIPS:
7014 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7018 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7019 /* double double 128-bit mixed endian.
7020 * little-endian doubles in big-endian order,
7022 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7026 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7027 /* double double 128-bit mixed endian,
7028 * big-endian doubles in little-endian order,
7029 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7034 /* We are largely making this up because it may well be
7035 * that the VAX format H was never made available to C,
7036 * only to Fortran. */
7037 #if LONGDBLSIZE == 16 && defined(__vax__)
7038 if (b[0] == 0xFD && b[15] == 0x99) {
7039 /* VAX format H, PDP-11 mixed endian. */
7044 printf("-1\n"); /* unknown */
7049 if eval $compile; then
7050 longdblkind=`$run ./try`
7057 case "$longdblkind" in
7058 0) echo "Your long doubles are doubles." >&4 ;;
7059 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7060 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7061 3) echo "You have x86 80-bit little endian long doubles." >&4 ;;
7062 4) echo "You have x86 80-bit big endian long doubles." >&4 ;;
7063 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >&4 ;;
7064 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >&4 ;;
7065 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >&4 ;;
7066 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >&4 ;;
7067 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >&4 ;;
7068 *) echo "Cannot figure out your long double." >&4 ;;
7070 d_long_double_style_ieee=$undef
7071 d_long_double_style_ieee_std=$undef
7072 d_long_double_style_ieee_extended=$undef
7073 d_long_double_style_ieee_doubledouble=$undef
7074 d_long_double_style_vax=$undef
7075 case "$longdblkind" in
7076 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7078 case "$longdblkind" in
7079 1|2) d_long_double_style_ieee_std=$define ;;
7081 case "$longdblkind" in
7082 3|4) d_long_double_style_ieee_extended=$define ;;
7084 case "$longdblkind" in
7085 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7087 case "$longdblkind" in
7088 9) d_long_double_style_vax=$define ;;
7092 : get the patchlevel
7094 echo "Getting the current patchlevel..." >&4
7095 if $test -r $rsrc/patchlevel.h;then
7096 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
7097 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
7098 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7099 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
7100 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
7101 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
7102 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
7111 $echo "(You do not have patchlevel.h. Eek.)"
7113 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
7114 version_patchlevel_string="version $patchlevel subversion $subversion"
7115 case "$perl_patchlevel" in
7117 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
7118 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
7122 $echo "(You have $package $version_patchlevel_string.)"
7126 : XXX Should be a Configure test for double-dots in filenames.
7127 version=`echo $revision $patchlevel $subversion | \
7128 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7129 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7130 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
7133 version=`echo $revision $patchlevel $subversion | \
7134 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7135 api_versionstring=`echo $api_revision $api_version $api_subversion | \
7136 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
7139 : Special case the 5.005_xx maintenance series, which used 5.005
7140 : without any subversion label as a subdirectory in $sitelib
7141 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
7142 api_versionstring='5.005'
7145 : determine the architecture name
7147 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7148 tarch=`arch`"-$osname"
7149 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7150 if uname -m > tmparch 2>&1 ; then
7151 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7152 -e 's/$/'"-$osname/" tmparch`
7160 case "$myarchname" in
7163 echo "(Your architecture name used to be $myarchname.)"
7167 case "$targetarch" in
7169 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7174 *) dflt="$archname";;
7176 rp='What is your architecture name'
7180 : optionally add API version to the architecture for versioned archlibs
7181 case "$useversionedarchname" in
7182 $define|true|[yY]*) dflt='y';;
7185 rp='Add the Perl API version to your archname?'
7188 y|Y) useversionedarchname="$define" ;;
7189 *) useversionedarchname="$undef" ;;
7191 case "$useversionedarchname" in
7194 *-$api_versionstring)
7195 echo "...and architecture name already has -$api_versionstring" >&4
7198 archname="$archname-$api_versionstring"
7199 echo "...setting architecture name to $archname." >&4
7205 case "$usethreads" in
7207 echo "Threads selected." >&4
7209 *-thread*) echo "...and architecture name already has -thread." >&4
7211 *) archname="$archname-thread"
7212 echo "...setting architecture name to $archname." >&4
7217 case "$usemultiplicity" in
7219 echo "Multiplicity selected." >&4
7221 *-multi*) echo "...and architecture name already has -multi." >&4
7223 *) archname="$archname-multi"
7224 echo "...setting architecture name to $archname." >&4
7229 case "$use64bitint$use64bitall" in
7231 case "$archname64" in
7233 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7236 case "$use64bitint" in
7237 "$define") echo "64 bit integers selected." >&4 ;;
7239 case "$use64bitall" in
7240 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7243 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7245 *) archname="$archname-$archname64"
7246 echo "...setting architecture name to $archname." >&4
7252 case "$uselongdouble" in
7254 echo "Long doubles selected." >&4
7255 case "$longdblsize" in
7257 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7261 *-ld*) echo "...and architecture name already has -ld." >&4
7263 *) archname="$archname-ld"
7264 echo "...setting architecture name to $archname." >&4
7271 case "$usequadmath" in
7273 echo "quadmath selected." >&4
7275 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7277 *) archname="$archname-quadmath"
7278 echo "...setting architecture name to $archname." >&4
7283 if $test -f archname.cbu; then
7284 echo "Your platform has some specific hints for architecture name, using them..."
7288 : set the prefixit variable, to compute a suitable default value
7289 prefixit='case "$3" in
7291 case "$oldprefix" in
7292 "") eval "$1=\"\$$2\"";;
7299 ""|" "|none) eval "$1=\"\$$2\"";;
7305 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7307 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7308 /*-$oldprefix/*|\~*-$oldprefix/*)
7309 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7310 *) eval "$1=\"\$$2\"";;
7314 : determine installation style
7315 : For now, try to deduce it from prefix unless it is already set.
7316 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7317 case "$installstyle" in
7318 '') case "$prefix" in
7319 *perl*) dflt='lib';;
7320 *) dflt='lib/perl5' ;;
7323 *) dflt="$installstyle" ;;
7325 : Probably not worth prompting for this since we prompt for all
7326 : the directories individually, and the prompt would be too long and
7330 : determine where public executables go
7335 rp='Pathname where the public executables will reside?'
7337 if $test "X$ansexp" != "X$binexp"; then
7341 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7342 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7343 : this via initialinstalllocation
7346 case "$userelocatableinc" in
7347 $define|true|[yY]*) dflt='y' ;;
7352 Would you like to build Perl so that the installation is relocatable, so that
7353 library paths in @INC are determined relative to the path of the perl binary?
7354 This is not advised for system Perl installs, or if you need to run setid
7355 scripts or scripts under taint mode.
7357 If this doesn't make any sense to you, just accept the default '$dflt'.
7359 rp='Use relocatable @INC?'
7362 y|Y) val="$define" ;;
7365 set userelocatableinc
7368 initialinstalllocation="$binexp"
7369 : Default prefix is now "up one level from where the binaries are"
7370 case "$userelocatableinc" in
7376 installprefixexp=".../.."
7380 : determine where private library files go
7381 : Usual default is /usr/local/lib/perl5/$version.
7382 : Also allow things like /opt/perl/lib/$version, since
7383 : /opt/perl/lib/perl5... would be redundant.
7384 : The default "style" setting is made in installstyle.U
7385 case "$installstyle" in
7386 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7387 *) set dflt privlib lib/$version ;;
7392 There are some auxiliary files for $package that need to be put into a
7393 private library directory that is accessible by everyone.
7398 rp='Pathname where the private library files will reside?'
7403 : set the prefixup variable, to restore leading tilda escape
7404 prefixup='case "$prefixexp" in
7406 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7409 : determine where public architecture dependent libraries go
7412 : privlib default is /usr/local/lib/$package/$version
7413 : archlib default is /usr/local/lib/$package/$version/$archname
7414 : privlib may have an optional trailing /share.
7415 tdflt=`echo $privlib | $sed 's,/share$,,'`
7416 tdflt=$tdflt/$archname
7425 $spackage contains architecture-dependent library files. If you are
7426 sharing libraries in a heterogeneous environment, you might store
7427 these files in a separate location. Otherwise, you can just include
7428 them with the rest of the public library files.
7433 rp='Where do you want to put the public architecture-dependent libraries?'
7437 if $test X"$archlib" = X"$privlib"; then
7443 : see if setuid scripts can be secure
7446 Some kernels have a bug that prevents setuid #! scripts from being
7447 secure. Some sites have disabled setuid #! scripts because of this.
7449 First let's decide if your kernel supports secure setuid #! scripts.
7450 (If setuid #! scripts would be secure but have been disabled anyway,
7451 don't say that they are secure if asked.)
7456 if $test -d /dev/fd; then
7457 echo "#!$ls" >reflect
7458 chmod +x,u+s reflect
7459 ./reflect >flect 2>&1
7460 if $contains "/dev/fd" flect >/dev/null; then
7461 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7465 If you are not sure if they are secure, I can check but I'll need a
7466 username and password different from the one you are using right now.
7467 If you don't have such a username or don't want me to test, simply
7471 rp='Other username to test security of setuid scripts with?'
7476 case "$d_suidsafe" in
7477 '') echo "I'll assume setuid scripts are *not* secure." >&4
7480 echo "Well, the $hint value is *not* secure." >&4
7482 *) echo "Well, the $hint value *is* secure." >&4
7487 $rm -f reflect flect
7488 echo "#!$ls" >reflect
7489 chmod +x,u+s reflect
7492 echo '"su" will (probably) prompt you for '"$ans's password."
7493 su $ans -c './reflect >flect'
7494 if $contains "/dev/fd" flect >/dev/null; then
7495 echo "Okay, it looks like setuid scripts are secure." >&4
7498 echo "I don't think setuid scripts are secure." >&4
7503 rp='Does your kernel have *secure* setuid scripts?'
7506 [yY]*) val="$define";;
7511 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7512 echo "(That's for file descriptors, not floppy disks.)"
7518 $rm -f reflect flect
7520 : now see if they want to do setuid emulation
7521 if $test $patchlevel -lt 11; then
7524 case "$d_suidsafe" in
7527 echo "No need to emulate SUID scripts since they are secure here." >&4
7531 Some systems have disabled setuid scripts, especially systems where
7532 setuid scripts cannot be secure. On systems where setuid scripts have
7533 been disabled, the setuid/setgid bits on scripts are currently
7534 useless. It is possible for $package to detect those bits and emulate
7535 setuid/setgid in a secure fashion. This emulation will only work if
7536 setuid scripts have been disabled in your kernel.
7540 "$define") dflt=y ;;
7543 rp="Do you want to do setuid/setgid emulation?"
7546 [yY]*) val="$define";;
7558 SUID emulation has been removed for 5.12
7559 Please re-run Configure without -Dd_dosuid
7568 : Find perl5.005 or later.
7569 echo "Looking for a previously installed perl5.005 or later... "
7571 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7572 : Check if this perl is recent and can load a simple module
7573 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7576 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7586 '') echo "None found. That's ok.";;
7587 *) echo "Using $perl5." ;;
7590 : Set the siteprefix variables
7593 After $package is installed, you may wish to install various
7594 add-on modules and utilities. Typically, these add-ons will
7595 be installed under $prefix with the rest
7596 of this package. However, you may wish to install such add-ons
7597 elsewhere under a different prefix.
7599 If you do not wish to put everything under a single prefix, that's
7600 ok. You will be prompted for the individual locations; this siteprefix
7601 is only used to suggest the defaults.
7603 The default should be fine for most people.
7607 rp='Installation prefix to use for add-on modules and utilities?'
7608 : XXX Here might be another good place for an installstyle setting.
7609 case "$siteprefix" in
7611 *) dflt=$siteprefix ;;
7614 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7616 case "$siteprefix" in
7620 *) oldsiteprefix="$prefix";;
7625 siteprefixexp="$ansexp"
7627 : determine where site specific libraries go.
7628 : Usual default is /usr/local/lib/perl5/site_perl/$version
7629 : The default "style" setting is made in installstyle.U
7630 : XXX No longer works with Prefixit stuff.
7631 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7633 '') case "$installstyle" in
7634 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7635 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7643 The installation process will create a directory for
7644 site-specific extensions and modules. Most users find it convenient
7645 to place all site-specific files in this directory rather than in the
7646 main distribution directory.
7650 rp='Pathname for the site-specific library files?'
7654 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7656 : Determine list of previous versions to include in @INC
7657 $cat > getverlist <<EOPL
7662 my \$api_versionstring = "$api_versionstring";
7663 my \$version = "$version";
7664 my \$stem = "$sitelib_stem";
7665 my \$archname = "$archname";
7667 $cat >> getverlist <<'EOPL'
7668 # The list found is stored twice for each entry: the original name, and
7669 # the binary broken down version into pack "s>s>s>", so sorting is easy
7670 # and unambiguous. This will work for all versions that have a maximum
7671 # of three digit per group separate by '.'s or '_'s. Names are extended
7672 # with ".0.0" to ensure at least three elements for the pack.
7673 # -- H.Merijn Brand (m)'06 23-10-2006
7675 my @inc_version_list;
7677 # XXX Redo to do opendir/readdir?
7680 ;@candidates = map {
7681 [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
7682 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7688 my ($pversion, $aversion, $vsn5005) = map {
7689 pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7690 foreach my $d (@candidates) {
7691 if ($d->[1] lt $pversion) {
7692 if ($d->[1] ge $aversion) {
7693 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7695 elsif ($d->[1] ge $vsn5005) {
7696 unshift(@inc_version_list, grep { -d } $d->[0]);
7700 # Skip newer version. I.e. don't look in
7701 # 5.7.0 if we're installing 5.6.1.
7705 if (@inc_version_list) {
7706 print join(' ', @inc_version_list);
7709 # Blank space to preserve value for next Configure run.
7714 case "$inc_version_list" in
7715 '') if test -x "$perl5$exe_ext"; then
7716 dflt=`$perl5 getverlist`
7721 $undef) dflt='none' ;;
7722 *) eval dflt=\"$inc_version_list\" ;;
7725 ''|' ') dflt=none ;;
7732 In order to ease the process of upgrading, this version of perl
7733 can be configured to use modules built and installed with earlier
7734 versions of perl that were installed under $prefix. Specify here
7735 the list of earlier versions that this version of perl should check.
7736 If Configure detected no earlier versions of perl installed under
7737 $prefix, then the list will be empty. Answer 'none' to tell perl
7738 to not search earlier versions.
7740 The default should almost always be sensible, so if you're not sure,
7741 just accept the default.
7744 rp='List of earlier versions to include in @INC?'
7747 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7748 *) inc_version_list="$ans" ;;
7750 case "$inc_version_list" in
7752 inc_version_list_init='0'
7753 d_inc_version_list="$undef"
7755 *) inc_version_list_init=`echo $inc_version_list |
7756 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7757 d_inc_version_list="$define"
7762 : see if malloc/malloc.h has to be included
7763 set malloc/malloc.h i_mallocmalloc
7766 : see if this is a malloc.h system
7767 : we want a real compile instead of Inhdr because some systems have a
7768 : malloc.h that just gives a compile error saying to use stdlib.h instead
7773 #$i_mallocmalloc I_MALLOCMALLOC
7774 #ifdef I_MALLOCMALLOC
7775 # include <malloc/malloc.h>
7778 int main () { return 0; }
7781 if eval $compile; then
7782 echo "<malloc.h> found." >&4
7785 echo "<malloc.h> NOT found." >&4
7792 : check for length of pointer
7796 echo "Checking to see how big your pointers are..." >&4
7805 printf("%d\n", (int)sizeof(void *));
7810 if eval $compile_ok; then
7811 ptrsize=`$run ./try`
7812 echo "Your pointers are $ptrsize bytes long."
7815 echo "(I can't seem to compile the test program. Guessing...)" >&4
7816 rp="What is the size of a pointer (in bytes)?"
7823 case "$use64bitall" in
7824 "$define"|true|[yY]*)
7828 *** You have chosen a maximally 64-bit build,
7829 *** but your pointers are only 4 bytes wide.
7830 *** Please rerun Configure without -Duse64bitall.
7835 *** Since you have quads, you could possibly try with -Duse64bitint.
7840 *** Cannot continue, aborting.
7850 : determine whether to use malloc wrapping
7852 case "$usemallocwrap" in
7853 [yY]*|true|$define) dflt='y' ;;
7854 [nN]*|false|$undef) dflt='n' ;;
7855 *) case "$usedevel" in
7856 [yY]*|true|$define) dflt='y' ;;
7861 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7863 usemallocwrap="$ans"
7866 usemallocwrap="$define" ;;
7868 usemallocwrap="$undef" ;;
7871 : determine which malloc to compile in
7873 case "$usemymalloc" in
7874 [yY]*|true|$define) dflt='y' ;;
7875 [nN]*|false|$undef) dflt='n' ;;
7876 *) case "$ptrsize" in
7880 if test "$useithreads" = "$define"; then dflt='n'; fi
7883 rp="Do you wish to attempt to use the malloc that comes with $package?"
7889 mallocsrc='malloc.c'
7890 mallocobj="malloc$_o"
7891 d_mymalloc="$define"
7894 : Remove malloc from list of libraries to use
7895 echo "Removing unneeded -lmalloc from library list" >&4
7896 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7899 echo "libs = $libs" >&4
7911 : compute the return types of malloc and free
7913 $cat >malloc.c <<END
7917 #include <sys/types.h>
7931 case "$malloctype" in
7933 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7940 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7944 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7951 echo "Your system uses $freetype free(), it would seem." >&4
7953 : determine where site specific architecture-dependent libraries go.
7954 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7955 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7956 : sitelib may have an optional trailing /share.
7958 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7959 dflt="$dflt/$archname"
7964 set sitearch sitearch none
7968 The installation process will also create a directory for
7969 architecture-dependent site-specific extensions and modules.
7973 rp='Pathname for the site-specific architecture-dependent library files?'
7977 if $test X"$sitearch" = X"$sitelib"; then
7980 d_sitearch="$define"
7983 : Set the vendorprefix variables
7986 The installation process will also create a directory for
7987 vendor-supplied add-ons. Vendors who supply perl with their system
7988 may find it convenient to place all vendor-supplied files in this
7989 directory rather than in the main distribution directory. This will
7990 ease upgrades between binary-compatible maintenance versions of perl.
7992 Of course you may also use these directories in whatever way you see
7993 fit. For example, you might use them to access modules shared over a
7994 company-wide network.
7996 The default answer should be fine for most people.
7997 This causes further questions about vendor add-ons to be skipped
7998 and no vendor-specific directories will be configured for perl.
8001 rp='Do you want to configure vendor-specific add-on directories?'
8002 case "$usevendorprefix" in
8003 define|true|[yY]*) dflt=y ;;
8004 *) : User may have set vendorprefix directly on Configure command line.
8005 case "$vendorprefix" in
8014 rp='Installation prefix to use for vendor-supplied add-ons?'
8015 case "$vendorprefix" in
8016 '') dflt="$prefix" ;;
8017 *) dflt=$vendorprefix ;;
8020 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
8022 case "$vendorprefix" in
8026 *) oldvendorprefix="$prefix";;
8030 usevendorprefix="$define"
8032 vendorprefixexp="$ansexp"
8034 *) usevendorprefix="$undef"
8040 : Set the vendorlib variables
8041 case "$vendorprefix" in
8042 '') d_vendorlib="$undef"
8046 *) d_vendorlib="$define"
8047 : determine where vendor-supplied modules go.
8048 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8049 case "$vendorlib" in
8051 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8052 case "$installstyle" in
8053 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8054 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8057 *) dflt="$vendorlib"
8061 rp='Pathname for the vendor-supplied library files?'
8064 vendorlibexp="$ansexp"
8067 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8071 : Set the vendorarch variables
8072 case "$vendorprefix" in
8073 '') d_vendorarch="$undef"
8077 *) d_vendorarch="$define"
8078 : determine where vendor-supplied architecture-dependent libraries go.
8079 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8080 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8081 : vendorlib may have an optional trailing /share.
8082 case "$vendorarch" in
8083 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8084 dflt="$dflt/$archname"
8086 *) dflt="$vendorarch" ;;
8089 rp='Pathname for vendor-supplied architecture-dependent files?'
8092 vendorarchexp="$ansexp"
8095 prefixvar=vendorarch
8097 if $test X"$vendorarch" = X"$vendorlib"; then
8098 d_vendorarch="$undef"
8100 d_vendorarch="$define"
8103 : Final catch-all directories to search
8106 Lastly, you can have perl look in other directories for extensions and
8107 modules in addition to those already specified.
8108 These directories will be searched after
8112 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8113 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8115 case "$otherlibdirs" in
8116 ''|' ') dflt='none' ;;
8117 *) dflt="$otherlibdirs" ;;
8120 Enter a colon-separated set of extra paths to include in perl's @INC
8121 search path, or enter 'none' for no extra paths.
8125 rp='Colon-separated list of additional directories for perl to search?'
8128 ' '|''|none) otherlibdirs=' ' ;;
8129 *) otherlibdirs="$ans" ;;
8131 case "$otherlibdirs" in
8135 set d_perl_otherlibdirs
8139 dflt_dtrace='/usr/sbin/dtrace'
8140 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8144 Perl can be built to support DTrace on platforms that support it.
8145 DTrace is a diagnosis and performance analysis tool from Sun.
8147 If this doesn't make any sense to you, just accept the default.
8151 case "$usedtrace" in
8161 dflt_dtrace=$usedtrace
8168 rp='Support DTrace if available?'
8171 y|Y) val="$define" ;;
8177 test "X$usedtrace" != "X$define" && break
8180 rp='Where is the dtrace executable?'
8189 if $dtrace -h -s ../perldtrace.d \
8190 -o perldtrace.tmp >/dev/null 2>&1 \
8191 && rm -f perldtrace.tmp
8194 echo "Good: your $dtrace knows about the -h flag."
8198 *** $me: Fatal Error: $dtrace doesn't support -h flag
8200 *** Your installed dtrace doesn't support the -h switch to compile a D
8201 *** program into a C header. Can't continue.
8213 *** $me: Fatal Error: $dtrace not found.
8220 echo "*** $dtrace was not found."
8226 : See if we want extra modules installed
8233 Perl can be built with extra modules or bundles of modules which
8234 will be fetched from the CPAN and installed alongside Perl.
8236 Notice that you will need access to the CPAN; either via the Internet,
8237 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8238 be asked later to configure the CPAN.pm module which will in turn do
8239 the installation of the rest of the extra modules or bundles.)
8241 Notice also that if the modules require any external software such as
8242 libraries and headers (the libz library and the zlib.h header for the
8243 Compress::Zlib module, for example) you MUST have any such software
8244 already installed, this configuration process will NOT install such
8247 If this doesn't make any sense to you, just accept the default '$dflt'.
8249 rp='Install any extra modules (y or n)?'
8255 Please list any extra modules or bundles to be installed from CPAN,
8256 with spaces between the names. The names can be in any format the
8257 'install' command of CPAN.pm will understand. (Answer 'none',
8258 without the quotes, to install no extra modules or bundles.)
8268 $rm -f ../extras.lst
8270 *) echo "(Saving the list of extras for later...)"
8271 echo "$extras" > ../extras.lst
8279 : determine where html pages for programs go
8280 set html1dir html1dir none
8284 If you wish to install html files for programs in $spackage, indicate
8285 the appropriate directory here. To skip installing html files,
8289 ''|none|$undef|' ') dflt=none ;;
8290 *) dflt=$html1dir ;;
8293 rp="Directory for the main $spackage html pages?"
8297 : Use ' ' for none so value is preserved next time through Configure
8298 $test X"$html1dir" = "X" && html1dir=' '
8300 : determine where html pages for libraries and modules go
8301 set html3dir html3dir none
8305 If you wish to install html files for modules associated with $spackage,
8306 indicate the appropriate directory here. To skip installing html files,
8309 : There is no obvious default. If they have specified html1dir, then
8310 : try to key off that, possibly changing .../html1 into .../html3.
8312 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8313 *) dflt=$html3dir ;;
8316 rp="Directory for the $spackage module html pages?"
8320 : Use ' ' for none so value is preserved next time through Configure
8321 $test X"$html3dir" = "X" && html3dir=' '
8323 : determine whether to install perl also as /usr/bin/perl
8326 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8328 Many scripts expect perl to be installed as /usr/bin/perl.
8330 If you want to, I can install the perl you are about to compile
8331 as /usr/bin/perl (in addition to $bin/perl).
8333 if test -f /usr/bin/perl; then
8336 However, please note that because you already have a /usr/bin/perl,
8337 overwriting that with a new Perl would very probably cause problems.
8338 Therefore I'm assuming you don't want to do that (unless you insist).
8341 case "$installusrbinperl" in
8342 "$define"|[yY]*) dflt='y';;
8348 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8351 case "$installusrbinperl" in
8352 "$undef"|[nN]*) dflt='n';;
8356 rp="Do you want to install perl as /usr/bin/perl?"
8359 [yY]*) val="$define";;
8365 set installusrbinperl
8368 : see if dlopen exists
8370 xxx_ccflags="$ccflags"
8372 : with g++ one needs -shared to get is-in-libc to work for dlopen
8373 case "$gccversion" in
8376 *) case "$d_cplusplus" in
8377 "$define") ccflags="$ccflags -shared" ;;
8384 ccflags="$xxx_ccflags"
8386 : see if this is a unistd.h system
8387 set unistd.h i_unistd
8390 : determine which dynamic loading, if any, to compile in
8392 dldir="ext/DynaLoader"
8405 $define) dflt='y' ;;
8407 : Does a dl_xxx.xs file exist for this operating system
8408 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8411 rp="Do you wish to use dynamic loading?"
8418 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8419 dflt="$dldir/dl_${osname}.xs"
8420 elif $test "$d_dlopen" = "$define" ; then
8421 dflt="$dldir/dl_dlopen.xs"
8426 *) dflt="$dldir/$dlsrc"
8429 echo "The following dynamic loading files are available:"
8430 : Can not go over to $dldir because getfile has path hard-coded in.
8431 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8432 rp="Source file to use for dynamic loading"
8438 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8442 Some systems may require passing special flags to $cc -c to
8443 compile modules that will be used to create a shared library.
8444 To use no flags, say "none".
8447 case "$cccdlflags" in
8448 '') case "$gccversion" in
8449 '') case "$osname" in
8451 irix*) dflt='-KPIC' ;;
8452 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8453 sunos) dflt='-pic' ;;
8457 *) case "$osname" in
8458 darwin) dflt='none' ;;
8459 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8464 *) dflt="$cccdlflags" ;;
8471 # If -Dsysroot was specified, now's the time to add it
8473 if test "X$sysroot" != X; then
8474 case "$gccversion" in
8479 dflt="$dflt --sysroot=$sysroot" ;;
8489 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8492 none) cccdlflags=' ' ;;
8493 *) cccdlflags="$ans" ;;
8498 Some systems use ld to create libraries that can be dynamically loaded,
8499 while other systems (such as those using ELF) use $cc.
8503 : Determine if this is ELF
8505 /* Test for whether ELF binaries are produced */
8517 int i = open("a.out",O_RDONLY);
8520 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8521 exit(0); /* succeed (yes, it is ELF) */
8525 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8531 '') if $test $bin_ELF = "$define"; then
8533 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8537 echo "I'll use ld to build dynamic libraries."
8545 rp="What command should be used to create dynamic libraries?"
8551 Some systems may require passing special flags to $ld to create a
8552 library that can be dynamically loaded. If your ld flags include
8553 -L/other/path options to locate libraries outside your loader's normal
8554 search path, you may need to specify those -L options here as well. To
8555 use no flags, say "none".
8558 case "$lddlflags" in
8559 '') case "$osname" in
8560 haiku) dflt='-shared' ;;
8562 case "$gccversion" in
8563 '') dflt="$dflt +vnocompatwarnings" ;;
8566 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8567 solaris) # See [perl #66604].
8568 # On Solaris 11, gcc -m64 on amd64
8569 # appears not to understand -G. gcc versions at
8570 # least as old as 3.4.3 support -shared, so just
8571 # use that with Solaris 11 and later, but keep
8572 # the old behavior for older Solaris versions.
8573 case "$gccversion" in
8575 *) case "$osvers" in
8576 2.?|2.10) dflt='-G' ;;
8577 *) dflt='-shared' ;;
8582 sunos) dflt='-assert nodefinitions' ;;
8583 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8587 *) dflt="$lddlflags" ;;
8590 : Only do this for gcc, since, for example, qcc has no concept
8592 if $test "X$sysroot" != X; then
8593 case "$gccversion" in
8595 *) dflt="$dflt --sysroot=$sysroot" ;;
8599 : Try to guess additional flags to pick up local libraries.
8600 : Be careful not to append to a plain 'none'
8604 for thisflag in $ldflags; do
8609 *) dflt="$dflt $thisflag" ;;
8616 ''|' ') dflt='none' ;;
8620 *-fstack-protector-strong*)
8622 *-fstack-protector-strong*) ;; # Don't add it again
8623 *) dflt="$dflt -fstack-protector-strong" ;;
8626 *-fstack-protector*)
8628 *-fstack-protector*) ;; # Don't add it again
8629 *) dflt="$dflt -fstack-protector" ;;
8634 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8637 none) lddlflags=' ' ;;
8638 *) lddlflags="$ans" ;;
8643 Some systems may require passing special flags to $cc to indicate that
8644 the resulting executable will use dynamic linking. To use no flags,
8648 case "$ccdlflags" in
8649 '') case "$osname" in
8650 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8651 sunos) dflt='none' ;;
8655 *) dflt="$ccdlflags" ;;
8657 rp="Any special flags to pass to $cc to use dynamic linking?"
8660 none) ccdlflags=' ' ;;
8661 *) ccdlflags="$ans" ;;
8673 ld_can_script="$undef"
8674 case "$bin_ELF$usedl" in
8676 # Abuse try.h and a.out names for neat cleanup
8688 if $cc $cccdlflags $ccdlflags $ccflags \
8689 $ldflags $lddlflags -o a.out try.c \
8690 -Wl,--version-script=try.h >/dev/null 2>&1 \
8691 && $test -s a.out ; then
8692 echo "ld supports scripting" >&4
8693 ld_can_script="$define"
8695 echo "ld does not support scripting" >&4
8701 : Do we want a shared libperl?
8705 # No dynamic loading being used, so don't bother even to prompt.
8708 *) case "$useshrplib" in
8709 '') case "$osname" in
8710 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8712 also='Building a shared libperl is required for dynamic loading to work on your system.'
8726 The perl executable is normally obtained by linking perlmain.c with
8727 libperl${_a}, any static extensions (usually just DynaLoader), and
8728 any other libraries needed on this system (such as -lm, etc.). Since
8729 your system supports dynamic loading, it is probably possible to build
8730 a shared libperl.$so. If you will have more than one executable linked
8731 to libperl.$so, this will significantly reduce the size of each
8732 executable, but it may have a noticeable effect on performance. The
8733 default is probably sensible for your system.
8737 rp="Build a shared libperl.$so (y/n)"
8741 useshrplib='true' ;;
8742 *) useshrplib='false' ;;
8747 case "$useshrplib" in
8749 case "$userelocatableinc" in
8751 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8752 echo "See INSTALL for an explanation why that won't work." >&4
8758 # Figure out a good name for libperl.so. Since it gets stored in
8759 # a version-specific architecture-dependent library, the version
8760 # number isn't really that important, except for making cc/ld happy.
8762 # A name such as libperl.so.10.1
8763 majmin="libperl.$so.$patchlevel.$subversion"
8764 # A name such as libperl.so.100
8765 majonly=`echo $patchlevel $subversion |
8766 $awk '{printf "%d%02d", $1, $2}'`
8767 majonly=libperl.$so.$majonly
8768 # I'd prefer to keep the os-specific stuff here to a minimum, and
8769 # rely on figuring it out from the naming of libc.
8770 case "${osname}${osvers}" in
8771 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8774 cygwin*) # ld links now against the dll directly
8775 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8776 majonly=`echo $patchlevel $subversion |
8777 $awk '{printf "%03d%03d", $1, $2}'`
8778 majonly=cygperl5.$majonly.$so
8781 *) # Try to guess based on whether libc has major.minor.
8783 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8784 *libc.$so.[0-9]*) dflt=$majonly ;;
8785 *) dflt=libperl.$so ;;
8795 I need to select a good name for the shared libperl. If your system uses
8796 library names with major and minor numbers, then you might want something
8797 like $majmin. Alternatively, if your system uses a single version
8798 number for shared libraries, then you might want to use $majonly.
8799 Or, your system might be quite happy with a simple libperl.$so.
8801 Since the shared libperl will get installed into a version-specific
8802 architecture-dependent directory, the version number of the shared perl
8803 library probably isn't important, so the default should be o.k.
8806 rp='What name do you want to give to the shared libperl?'
8809 echo "Ok, I'll use $libperl"
8812 libperl="libperl${_a}"
8816 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8820 WARNING: Use of the shrpdir variable for the installation location of
8821 the shared $libperl is not supported. It was never documented and
8822 will not work in this version. Let me (https://github.com/Perl/perl5/issues)
8823 know of any problems this may cause.
8829 But your current setting of $shrpdir is
8830 the default anyway, so it's harmless.
8835 Further, your current attempted setting of $shrpdir
8836 conflicts with the value of $archlibexp/CORE
8837 that installperl will use.
8844 # How will the perl executable find the installed shared $libperl?
8845 # Add $xxx to ccdlflags.
8846 # If we can't figure out a command-line option, use $shrpenv to
8847 # set env LD_RUN_PATH. The main perl makefile uses this.
8848 shrpdir=$archlibexp/CORE
8851 if "$useshrplib"; then
8854 # We'll set it in Makefile.SH...
8859 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8860 xxx="-Wl,-R$shrpdir"
8862 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8863 xxx="-Wl,-rpath,$shrpdir"
8866 # hpux doesn't like the default, either.
8867 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8870 # cygwin needs only ldlibpth
8873 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8879 # Only add $xxx if it isn't already in ccdlflags.
8880 case " $ccdlflags " in
8882 *) ccdlflags="$ccdlflags $xxx"
8885 Adding $xxx to the flags
8886 passed to $ld so that the perl executable will find the
8887 installed shared $libperl.
8895 # Fix ccdlflags in AIX for building external extensions.
8896 # (For building Perl itself bare -bE:perl.exp is needed,
8897 # Makefile.SH takes care of this.)
8899 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8901 # Respect a hint or command-line value.
8903 '') shrpenv="$tmp_shrpenv" ;;
8905 case "$ldlibpthname" in
8906 '') ldlibpthname=LD_LIBRARY_PATH ;;
8907 none) ldlibpthname='' ;;
8910 : determine where manual pages are on this system
8914 syspath='/usr/share/man/man1 /usr/man/man1'
8915 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8916 syspath="$syspath /usr/man/u_man/man1"
8917 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8918 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8919 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8920 sysman=`./loc . /usr/man/man1 $syspath`
8923 if $test -d "$sysman"; then
8924 echo "System manual is in $sysman." >&4
8926 echo "Could not find manual pages in source form." >&4
8929 : determine where manual pages go
8930 set man1dir man1dir none
8934 $spackage has manual pages available in source form.
8938 echo "However, you don't have nroff, so they're probably useless to you."
8940 '') man1dir="none";;
8943 echo "If you don't want the manual sources installed, answer 'none'."
8948 lookpath="$prefixexp/share/man/man1"
8949 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8950 lookpath="$lookpath $prefixexp/man/p_man/man1"
8951 lookpath="$lookpath $prefixexp/man/u_man/man1"
8952 lookpath="$lookpath $prefixexp/man/man.1"
8954 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8955 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8965 rp="Where do the main $spackage manual pages (source) go?"
8967 if $test "X$man1direxp" != "X$ansexp"; then
8978 : What suffix to use on installed man pages
8985 rp="What suffix should be used for the main $spackage man pages?"
8987 '') case "$man1dir" in
9001 *) dflt="$man1ext";;
9008 : see if we can have long filenames
9010 first=123456789abcdef
9012 if (echo hi >$first) 2>/dev/null; then
9013 if $test -f 123456789abcde; then
9014 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
9017 echo 'You can have filenames longer than 14 characters.'>&4
9022 You can't have filenames longer than 14 chars.
9023 You can't even think about them!
9029 $rm -rf 123456789abcde*
9031 : determine where library module manual pages go
9032 set man3dir man3dir none
9036 $spackage has manual pages for many of the library modules.
9042 However, you don't have nroff, so they're probably useless to you.
9045 '') man3dir="none";;
9049 case "$d_flexfnam" in
9052 However, your system can't handle the long file names like File::Basename.3.
9055 '') man3dir="none";;
9059 echo "If you don't want the manual sources installed, answer 'none'."
9060 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9062 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9063 if $test -d "$privlib/man/man3"; then
9066 WARNING: Previous versions of perl installed man3 pages into
9067 $privlib/man/man3. This version will suggest a
9068 new default of $dflt.
9072 rp='Do you wish to preserve the old behavior?(y/n)'
9075 y*) dflt="$privlib/man/man3" ;;
9080 *) dflt="$man3dir" ;;
9087 rp="Where do the $package library man pages (source) go?"
9097 : What suffix to use on installed man pages
9103 rp="What suffix should be used for the $package library man pages?"
9105 '') case "$man3dir" in
9119 *) dflt="$man3ext";;
9126 : see if we have to deal with yellow pages, now NIS.
9127 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9133 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9141 rp='Are you getting the hosts file via yellow pages?'
9144 y*) hostcat='ypcat hosts';;
9145 *) hostcat='cat /etc/hosts';;
9151 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9154 '') test -f /etc/group && groupcat='cat /etc/group';;
9157 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9160 : now get the host name
9162 echo "Figuring out host name..." >&4
9163 case "$myhostname" in
9165 echo 'Maybe "hostname" will work...'
9166 if tans=`sh -c hostname 2>&1` ; then
9174 if $test "$cont"; then
9176 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9177 if tans=`cat /etc/systemid 2>&1` ; then
9179 phostname='cat /etc/systemid'
9180 echo "Whadyaknow. Xenix always was a bit strange..."
9183 elif $test -r /etc/systemid; then
9184 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9187 if $test "$cont"; then
9188 echo 'No, maybe "uuname -l" will work...'
9189 if tans=`sh -c 'uuname -l' 2>&1` ; then
9191 phostname='uuname -l'
9193 echo 'Strange. Maybe "uname -n" will work...'
9194 if tans=`sh -c 'uname -n' 2>&1` ; then
9196 phostname='uname -n'
9198 echo 'Oh well, maybe I can mine it out of whoami.h...'
9199 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9200 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9201 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9203 case "$myhostname" in
9204 '') echo "Does this machine have an identity crisis or something?"
9207 echo "Well, you said $myhostname before..."
9208 phostname='echo $myhostname';;
9214 case "$myhostname" in
9215 '') myhostname=noname ;;
9217 : you do not want to know about this
9222 if $test "$myhostname" ; then
9224 rp='Your host name appears to be "'$myhostname'".'" Right?"
9232 : bad guess or no guess
9233 while $test "X$myhostname" = X ; do
9235 rp="Please type the (one word) name of your host:"
9240 : translate upper to lower if necessary
9241 case "$myhostname" in
9243 echo "(Normalizing case in your host name)"
9244 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9248 case "$myhostname" in
9250 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9251 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9252 echo "(Trimming domain name from host name--host name is now $myhostname)"
9254 *) case "$mydomain" in
9257 test "X$hostcat" = "Xypcat hosts" &&
9258 ypmatch "$myhostname" hosts 2>/dev/null |\
9259 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9262 test "X$hostcat" != "X" &&
9263 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9264 /[ ]$myhostname[ . ]/p" > hosts
9267 if $test -f hosts; then
9268 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9269 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9270 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9271 hosts | $sort | $uniq | \
9272 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9273 case `$echo X$dflt` in
9274 X*\ *) echo "(Several hosts in the database matched hostname)"
9277 X.) echo "(You do not have fully-qualified names in the hosts database)"
9281 echo "(I cannot locate a hosts database anywhere)"
9286 tans=`./loc resolv.conf X /etc /usr/etc`
9287 if $test -f "$tans"; then
9288 echo "(Attempting domain name extraction from $tans)"
9289 dflt=.`$sed -n -e 's/ / /g' \
9290 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9293 .) dflt=.`$sed -n -e 's/ / /g' \
9294 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9302 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9303 dflt=.`sh -c domainname 2>/dev/null`
9306 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9310 case "$dflt$osname" in
9311 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9312 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9316 .) echo "(Lost all hope -- silly guess then)"
9322 *) dflt="$mydomain";;
9326 rp="What is your domain name?"
9336 : translate upper to lower if necessary
9339 echo "(Normalizing case in your domain name)"
9340 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9344 : a little sanity check here
9345 case "$phostname" in
9348 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9349 $myhostname$mydomain|$myhostname) ;;
9351 case "$phostname" in
9353 echo "(That doesn't agree with your whoami.h file, by the way.)"
9356 echo "(That doesn't agree with your $phostname command, by the way.)"
9364 : determine the e-mail address of the user who is running us
9367 I need to get your e-mail address in Internet format if possible, i.e.
9368 something like user@host.domain. Please answer accurately since I have
9369 no easy means to double check it. The default value provided below
9370 is most probably close to reality but may not be valid from outside
9371 your organization...
9375 while test "$cont"; do
9376 case "$MAILDOMAIN" in
9378 if $test -s /etc/mailname; then
9379 maildomain=`$cat /etc/mailname`
9381 maildomain="$myhostname$mydomain"
9384 *) maildomain="$MAILDOMAIN";;
9387 '') dflt="$cf_by@$maildomain";;
9388 *) dflt="$cf_email";;
9390 rp='What is your e-mail address?'
9396 rp='Address does not look like an Internet one. Use it anyway?'
9410 : Ask e-mail of administrator
9413 If you or somebody else will be maintaining perl at your site, please
9414 fill in the correct e-mail address here so that they may be contacted
9415 if necessary. You may enter "none" for no administrator.
9418 case "$perladmin" in
9419 '') dflt="$cf_email";;
9420 *) dflt="$perladmin";;
9422 rp='Perl administrator e-mail address'
9426 : determine whether to use a version number suffix for installed binaries
9429 Do you want to use a version number suffix for installed binaries? This
9430 will install 'perl$version' instead of 'perl', and likewise for other
9431 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9432 to be installed side-by-side. Unless you are a developer, you probably
9433 do *not* want to do this.
9435 case "$versiononly" in
9436 "$define"|[Yy]*|true) dflt='y' ;;
9439 rp="Do you want to use a version number suffix for installed binaries?"
9442 [yY]*) val="$define";;
9448 case "$versiononly" in
9449 "$define") inc_version_list=''
9450 inc_version_list_init=0
9454 : figure out how to guarantee perl startup
9455 : XXX Note that this currently takes advantage of the bug that binexp ignores
9456 : the Configure -Dinstallprefix setting, which in turn means that under
9457 : relocatable @INC, initialinstalllocation is what binexp started as.
9458 case "$startperl" in
9460 case "$sharpbang" in
9464 I can use the #! construct to start perl on your system. This will
9465 make startup of perl scripts faster, but may cause problems if you
9466 want to share those scripts and perl is not in a standard place
9467 ($initialinstalllocation/perl) on all your platforms. The alternative
9468 is to force a shell by starting the script with a single ':' character.
9471 case "$versiononly" in
9472 "$define") dflt="$initialinstalllocation/perl$version";;
9473 *) dflt="$initialinstalllocation/perl";;
9475 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9478 none) startperl=": # use perl";;
9479 *) startperl="#!$ans"
9480 if $test 30 -lt `echo "$ans" | wc -c`; then
9483 WARNING: Some systems limit the #! command to 32 characters.
9484 If you experience difficulty running Perl scripts with #!, try
9485 installing Perl in a directory with a shorter pathname.
9491 *) startperl=": # use perl"
9496 echo "I'll use $startperl to start perl scripts."
9498 : figure best path for perl in scripts
9501 case "$versiononly" in
9502 "$define") perlpath="$initialinstalllocation/perl$version";;
9503 *) perlpath="$initialinstalllocation/perl";;
9505 case "$startperl" in
9510 I will use the "eval 'exec'" idiom to start Perl on your system.
9511 I can use the full path of your Perl binary for this purpose, but
9512 doing so may cause problems if you want to share those scripts and
9513 Perl is not always in a standard place ($initialinstalllocation/perl).
9516 dflt="$initialinstalllocation/perl"
9517 rp="What path shall I use in \"eval 'exec'\"?"
9524 case "$startperl" in
9526 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9529 : determine where public executable scripts go
9530 set scriptdir scriptdir
9532 case "$scriptdir" in
9535 : guess some guesses
9536 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9537 $test -d /usr/share/bin && dflt=/usr/share/bin
9538 $test -d /usr/local/script && dflt=/usr/local/script
9539 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9540 $test -d $prefixexp/script && dflt=$prefixexp/script
9544 *) dflt="$scriptdir"
9549 Some installations have a separate directory just for executable scripts so
9550 that they can mount it across multiple architectures but keep the scripts in
9551 one spot. You might, for example, have a subdirectory of /usr/share for this.
9552 Or you might just lump your scripts in with all your other executables.
9556 rp='Where do you keep publicly executable scripts?'
9558 if $test "X$ansexp" != "X$scriptdirexp"; then
9564 : A little fix up for an irregularly named variable.
9565 installscript="$installscriptdir"
9567 : determine where add-on public executables go
9569 '') dflt=$siteprefix/bin ;;
9573 rp='Pathname where the add-on public executables should be installed?'
9578 : determine where add-on html pages go
9579 : There is no standard location, so try to copy the previously-selected
9580 : directory structure for the core html pages.
9581 case "$sitehtml1dir" in
9582 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9583 *) dflt=$sitehtml1dir ;;
9586 ''|' ') dflt=none ;;
9589 rp='Pathname where the site-specific html pages should be installed?'
9591 prefixvar=sitehtml1dir
9594 : determine where add-on library html pages go
9595 : There is no standard location, so try to copy the previously-selected
9596 : directory structure for the core html pages.
9597 case "$sitehtml3dir" in
9598 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9599 *) dflt=$sitehtml3dir ;;
9602 ''|' ') dflt=none ;;
9605 rp='Pathname where the site-specific library html pages should be installed?'
9607 prefixvar=sitehtml3dir
9610 : determine where add-on manual pages go
9611 case "$siteman1dir" in
9612 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9613 *) dflt=$siteman1dir ;;
9616 ''|' ') dflt=none ;;
9619 rp='Pathname where the site-specific manual pages should be installed?'
9621 prefixvar=siteman1dir
9624 : determine where add-on library man pages go
9625 case "$siteman3dir" in
9626 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9627 *) dflt=$siteman3dir ;;
9630 ''|' ') dflt=none ;;
9633 rp='Pathname where the site-specific library manual pages should be installed?'
9635 prefixvar=siteman3dir
9638 : determine where add-on public executable scripts go
9639 case "$sitescript" in
9640 '') dflt=$siteprefix/script
9641 $test -d $dflt || dflt=$sitebin ;;
9642 *) dflt="$sitescript" ;;
9645 rp='Pathname where add-on public executable scripts should be installed?'
9647 prefixvar=sitescript
9650 : see if backtrace exists
9651 set backtrace d_backtrace
9654 : Check if C backtrace is actually supported.
9655 case "$usecbacktrace" in
9656 "") usecbacktrace=$undef ;;
9658 case "$d_backtrace" in
9662 echo "This system does not support backtrace" >&4
9663 usecbacktrace=$undef
9669 : Check if faststdio is requested and available
9670 case "$usefaststdio" in
9671 $define|true|[yY]*|'')
9672 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9682 Perl can be built to use 'fast stdio', which means using the stdio
9683 library but also directly manipulating the stdio buffers to enable
9684 faster I/O. Using stdio is better for backward compatibility (especially
9685 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9686 interface has been preferred instead of stdio.
9688 If this doesn't make any sense to you, just accept the default '$dflt'.
9690 rp='Use the "fast stdio" if available?'
9693 y|Y) val="$define" ;;
9699 : define an is-a-typedef? function
9700 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9702 "") inclist="sys/types.h";;
9704 eval "varval=\$$var";
9708 for inc in $inclist; do
9709 echo "#include <$inc>" >>temp.c;
9711 echo "#ifdef $type" >> temp.c;
9712 echo "printf(\"We have $type\");" >> temp.c;
9713 echo "#endif" >> temp.c;
9714 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9715 if $contains $type temp.E >/dev/null 2>&1; then
9721 *) eval "$var=\$varval";;
9724 : define an is-a-typedef? function that prompts if the type is not available.
9725 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9727 "") inclist="sys/types.h";;
9729 eval "varval=\$$var";
9733 for inc in $inclist; do
9734 echo "#include <$inc>" >>temp.c;
9736 echo "#ifdef $type" >> temp.c;
9737 echo "printf(\"We have $type\");" >> temp.c;
9738 echo "#endif" >> temp.c;
9739 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9741 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9742 if $contains $type temp.E >/dev/null 2>&1; then
9743 echo "$type found." >&4;
9746 echo "$type NOT found." >&4;
9752 *) eval "$var=\$varval";;
9755 : see what type lseek is declared as in the kernel
9756 rp="What is the type used for lseek's offset on this system?"
9757 set off_t lseektype long stdio.h sys/types.h
9761 echo "Checking to see how big your file offsets are..." >&4
9763 #include <sys/types.h>
9767 printf("%d\n", (int)sizeof($lseektype));
9772 if eval $compile_ok; then
9773 lseeksize=`$run ./try`
9774 echo "Your file offsets are $lseeksize bytes long."
9778 echo "(I can't seem to compile the test program. Guessing...)"
9779 rp="What is the size of your file offsets (in bytes)?"
9785 : see what type file positions are declared as in the library
9786 rp="What is the type for file position used by fsetpos()?"
9787 set fpos_t fpostype long stdio.h sys/types.h
9790 : Check size for Fpos_t
9793 *_t) zzz="$fpostype" ;;
9796 echo "Checking the size of $zzz..." >&4
9798 #include <sys/types.h>
9805 printf("%d\n", (int)sizeof($fpostype));
9810 if eval $compile_ok; then
9814 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9817 echo "Your $zzz is $fpossize bytes long."
9823 echo "(I can't compile the test program. Guessing...)" >&4
9824 rp="What is the size of your file positions (in bytes)?"
9829 : Check for large file support
9830 # Backward compatibility (uselfs is deprecated).
9832 "$define"|true|[yY]*)
9835 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9837 uselargefiles="$define"
9841 case "$lseeksize:$fpossize" in
9844 You can have files larger than 2 gigabytes.
9847 *) case "$uselargefiles" in
9848 "$undef"|false|[nN]*) dflt='n' ;;
9853 Perl can be built to understand large files (files larger than 2 gigabytes)
9854 on some systems. To do so, Configure can be run with -Duselargefiles.
9856 If this doesn't make any sense to you, just accept the default '$dflt'.
9858 rp='Try to understand large files, if available?'
9861 y|Y) val="$define" ;;
9868 : Look for a hint-file generated 'call-back-unit'. If the
9869 : user has specified that a large files perl is to be built,
9870 : we may need to set or change some other defaults.
9871 if $test -f uselargefiles.cbu; then
9872 echo "Your platform has some specific hints regarding large file builds, using them..."
9873 . ./uselargefiles.cbu
9875 case "$uselargefiles" in
9877 if $test -f uselargefiles.cbu; then
9879 echo "Rechecking to see how big your file offsets are..." >&4
9881 #include <sys/types.h>
9885 printf("%d\n", (int)sizeof($lseektype));
9890 if eval $compile_ok; then
9891 lseeksize=`$run ./try`
9892 $echo "Your file offsets are now $lseeksize bytes long."
9896 echo "(I can't seem to compile the test program. Guessing...)"
9897 rp="What is the size of your file offsets (in bytes)?"
9902 *_t) zzz="$fpostype" ;;
9905 $echo $n "Rechecking the size of $zzz...$c" >&4
9907 #include <sys/types.h>
9914 printf("%d\n", (int)sizeof($fpostype));
9919 if eval $compile_ok; then
9924 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9927 echo " $fpossize bytes." >&4
9933 echo "(I can't compile the test program. Guessing...)" >&4
9934 rp="What is the size of your file positions (in bytes)?"
9943 : Check if we want perlio
9946 : Set the vendorbin variables
9947 case "$vendorprefix" in
9948 '') d_vendorbin="$undef"
9952 *) d_vendorbin="$define"
9953 : determine where vendor-supplied executables go.
9954 case "$vendorbin" in
9955 '') dflt=$vendorprefix/bin ;;
9956 *) dflt="$vendorbin" ;;
9959 rp='Pathname for the vendor-supplied executables directory?'
9962 vendorbinexp="$ansexp"
9968 : Set the vendorhtml1dir variables
9969 case "$vendorprefix" in
9970 '') vendorhtml1dir=''
9971 vendorhtml1direxp=''
9973 *) : determine where vendor-supplied html pages go.
9974 : There is no standard location, so try to copy the previously-selected
9975 : directory structure for the core html pages.
9976 : XXX Better default suggestions would be welcome.
9977 case "$vendorhtml1dir" in
9978 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9979 *) dflt=$vendorhtml1dir ;;
9982 ''|' ') dflt=none ;;
9985 rp='Pathname for the vendor-supplied html pages?'
9987 vendorhtml1dir="$ans"
9988 vendorhtml1direxp="$ansexp"
9991 : Use ' ' for none so value is preserved next time through Configure
9992 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9993 prefixvar=vendorhtml1dir
9996 : Set the vendorhtml3dir variables
9997 case "$vendorprefix" in
9998 '') vendorhtml3dir=''
9999 vendorhtml3direxp=''
10001 *) : determine where vendor-supplied module 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 "$vendorhtml3dir" in
10006 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10007 *) dflt=$vendorhtml3dir ;;
10010 ''|' ') dflt=none ;;
10013 rp='Pathname for the vendor-supplied html pages?'
10015 vendorhtml3dir="$ans"
10016 vendorhtml3direxp="$ansexp"
10019 : Use ' ' for none so value is preserved next time through Configure
10020 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10021 prefixvar=vendorhtml3dir
10024 : Set the vendorman1dir variables
10025 case "$vendorprefix" in
10026 '') vendorman1dir=''
10027 vendorman1direxp=''
10029 *) : determine where vendor-supplied manual pages go.
10030 case "$vendorman1dir" in
10031 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10032 *) dflt=$vendorman1dir ;;
10035 ''|' ') dflt=none ;;
10038 rp='Pathname for the vendor-supplied manual section 1 pages?'
10040 vendorman1dir="$ans"
10041 vendorman1direxp="$ansexp"
10044 : Use ' ' for none so value is preserved next time through Configure
10045 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10046 prefixvar=vendorman1dir
10049 : Set the vendorman3dir variables
10050 case "$vendorprefix" in
10051 '') vendorman3dir=''
10052 vendorman3direxp=''
10054 *) : determine where vendor-supplied module manual pages go.
10055 case "$vendorman3dir" in
10056 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10057 *) dflt=$vendorman3dir ;;
10060 ''|' ') dflt=none ;;
10063 rp='Pathname for the vendor-supplied manual section 3 pages?'
10065 vendorman3dir="$ans"
10066 vendorman3direxp="$ansexp"
10069 : Use ' ' for none so value is preserved next time through Configure
10070 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10071 prefixvar=vendorman3dir
10074 : Set the vendorscript variables
10075 case "$vendorprefix" in
10076 '') d_vendorscript="$undef"
10080 *) d_vendorscript="$define"
10081 : determine where vendor-supplied scripts go.
10082 case "$vendorscript" in
10083 '') dflt=$vendorprefix/script
10084 $test -d $dflt || dflt=$vendorbin ;;
10085 *) dflt="$vendorscript" ;;
10089 The installation process will create a directory for
10090 vendor-supplied scripts.
10094 rp='Pathname for the vendor-supplied scripts directory?'
10096 vendorscript="$ans"
10097 vendorscriptexp="$ansexp"
10100 prefixvar=vendorscript
10103 : see if qgcvt exists
10107 : Check what kind of doubles your system has
10108 $echo "Checking the kind of doubles you have..." >&4
10110 #$i_stdlib I_STDLIB
10111 #define DOUBLESIZE $doublesize
10113 #include <stdlib.h>
10116 static const double d = -0.1;
10118 unsigned const char* b = (unsigned const char*)(&d);
10119 #if DOUBLESIZE == 4
10120 if (b[0] == 0xCD && b[3] == 0xBD) {
10121 /* IEEE 754 32-bit little-endian */
10125 if (b[0] == 0xBD && b[3] == 0xCD) {
10126 /* IEEE 754 32-bit big-endian */
10130 if (b[0] == 0xCC && b[3] == 0xCC) {
10131 /* VAX format F, 32-bit PDP-style mixed endian. */
10135 if (b[0] == 0xC0 && b[3] == 0x9A) {
10136 /* IBM single 32-bit */
10141 #if DOUBLESIZE == 8
10142 if (b[0] == 0x9A && b[7] == 0xBF) {
10143 /* IEEE 754 64-bit little-endian */
10147 if (b[0] == 0xBF && b[7] == 0x9A) {
10148 /* IEEE 754 64-bit big-endian */
10152 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10153 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10154 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10155 * 99 99 b9 bf 9a 99 99 99 */
10159 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10160 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10161 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10162 * 99 99 99 9a bf b9 99 99 */
10166 if (b[0] == 0xCC && b[7] == 0xCC) {
10167 /* VAX format D, 64-bit PDP-style mixed endian. */
10171 if (b[0] == 0xD9 && b[7] == 0x99) {
10172 /* VAX format G, 64-bit PDP-style mixed endian. */
10176 if (b[0] == 0xC0 && b[7] == 0x9A) {
10177 /* IBM double 64-bit */
10181 if (b[0] == 0xBF && b[7] == 0xCD) {
10182 /* CRAY single 64-bit */
10187 #if DOUBLESIZE == 16
10188 if (b[0] == 0x9A && b[15] == 0xBF) {
10189 /* IEEE 754 128-bit little-endian */
10193 if (b[0] == 0xBF && b[15] == 0x9A) {
10194 /* IEEE 754 128-bit big-endian */
10199 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10200 * Whether those environments can still build Perl is debatable. */
10201 printf("-1\n"); /* unknown */
10206 if eval $compile; then
10207 doublekind=`$run ./try`
10211 case "$doublekind" in
10212 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10213 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10214 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10215 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10216 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10217 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10218 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10219 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10220 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10221 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10222 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10223 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10224 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10225 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10226 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10228 d_double_style_ieee=$undef
10229 d_double_style_vax=$undef
10230 d_double_style_ibm=$undef
10231 d_double_style_cray=$undef
10232 case "$doublekind" in
10233 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10234 9|10|11) d_double_style_vax=$define ;;
10235 12|13) d_double_style_ibm=$define ;;
10236 14) d_double_style_cray=$define ;;
10238 case "$d_double_style_ieee" in
10240 d_double_has_inf=$define
10241 d_double_has_nan=$define
10242 d_double_has_negative_zero=$define
10243 d_double_has_subnormals=$define
10246 d_double_has_inf=$undef
10247 d_double_has_nan=$undef
10248 d_double_has_negative_zero=$undef
10249 d_double_has_subnormals=$undef
10254 : Check print/scan long double stuff
10257 if $test X"$d_longdbl" = X"$define"; then
10259 echo "Checking how to print long doubles..." >&4
10261 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10262 $cat >try.c <<'EOCP'
10263 #include <sys/types.h>
10266 double d = 123.456;
10267 printf("%.3f\n", d);
10271 if eval $compile; then
10275 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10276 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10277 echo "We will use %f."
10283 if $test X"$sPRIfldbl" = X; then
10284 $cat >try.c <<'EOCP'
10285 #include <sys/types.h>
10288 long double d = 123.456;
10289 printf("%.3Lf\n", d);
10293 if eval $compile; then
10297 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10298 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10299 echo "We will use %Lf."
10305 if $test X"$sPRIfldbl" = X; then
10306 $cat >try.c <<'EOCP'
10307 #include <sys/types.h>
10310 long double d = 123.456;
10311 printf("%.3llf\n", d);
10315 if eval $compile; then
10319 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10320 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10321 echo "We will use %llf."
10327 if $test X"$sPRIfldbl" = X; then
10328 $cat >try.c <<'EOCP'
10329 #include <sys/types.h>
10332 long double d = 123.456;
10333 printf("%.3lf\n", d);
10337 if eval $compile; then
10341 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10342 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10343 echo "We will use %lf."
10349 if $test X"$sPRIfldbl" = X; then
10350 echo "Cannot figure out how to print long doubles." >&4
10352 sSCNfldbl=$sPRIfldbl # expect consistency
10359 case "$sPRIfldbl" in
10360 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10361 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10362 d_SCNfldbl="$undef";
10364 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10365 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10366 d_SCNfldbl="$define";
10370 : Before committing on uselongdouble, see whether that looks sane.
10371 if $test "$uselongdouble" = "$define"; then
10374 echo "Checking if your long double math functions work right..." >&4
10379 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10382 case "$osname:$gccversion" in
10383 aix:) saveccflags="$ccflags"
10384 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10387 if eval $compile_ok; then
10391 3) echo "Your long double math functions are working correctly." >&4 ;;
10392 *) echo "Your long double math functions are broken, not using long doubles." >&4
10393 uselongdouble=$undef
10397 case "$osname:$gccversion" in
10398 aix:) ccflags="$saveccflags" ;; # restore
10402 : Check how to convert floats to strings.
10404 if test "X$d_Gconvert" = X; then
10407 echo "Checking for an efficient way to convert floats to strings."
10409 case "$uselongdouble" in
10410 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10412 case "$d_longdbl" in
10413 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10415 case "$d_PRIgldbl" in
10416 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10419 #ifdef TRY_gconvert
10420 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10421 const char *myname = "gconvert";
10424 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10425 const char *myname = "gcvt";
10428 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10429 const char *myname = "qgcvt";
10430 #define DOUBLETYPE long double
10433 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10434 #ifdef HAS_PRIgldbl
10435 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10437 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10440 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10442 const char *myname = "sprintf";
10446 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10447 #define DOUBLETYPE long double
10449 #define DOUBLETYPE double
10455 #$i_stdlib I_STDLIB
10457 #include <stdlib.h>
10459 #include <string.h>
10461 void checkit(const char *expect, char *got)
10463 if (strcmp(expect, got)) {
10464 printf("%s oddity: Expected %s, got %s\n",
10465 myname, expect, got);
10470 void lencheck(int expect, int got)
10472 if (expect != got) {
10473 printf("%s length mismatch: Expected %d, got %d\n",
10474 myname, expect, got);
10484 /* This must be 1st test on (which?) platform */
10485 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10486 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10487 checkit("0.1", buf);
10489 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10490 checkit("0.01", buf);
10492 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10493 checkit("0.001", buf);
10495 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10496 checkit("0.0001", buf);
10498 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10499 if (strlen(buf) > 5)
10500 checkit("9e-005", buf); /* for Microsoft ?? */
10502 checkit("9e-05", buf);
10504 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10507 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10508 checkit("1.1", buf);
10510 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10511 checkit("1.01", buf);
10513 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10514 checkit("1.001", buf);
10516 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10517 checkit("1.0001", buf);
10519 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10520 checkit("1.00001", buf);
10522 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10523 checkit("1.000001", buf);
10525 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10528 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10529 checkit("-1", buf);
10531 /* Some Linux gcvt's give 1.e+5 here. */
10532 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10533 checkit("100000", buf);
10535 /* Some Linux gcvt's give -1.e+5 here. */
10536 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10537 checkit("-100000", buf);
10539 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10540 checkit("123.456", buf);
10542 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10543 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10544 /* 34 should be enough to scare even long double
10545 * places into using the e notation. */
10546 if (strlen(buf) > 5)
10547 checkit("1e+034", buf); /* for Microsoft */
10549 checkit("1e+34", buf);
10551 /* Test for an Ubuntu/Debian bug in gcvt and qgcvt. See: *
10552 * https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1899553 */
10554 Gconvert((DOUBLETYPE)0.4, 53, 0, buf);
10555 lencheck(55, (int)strlen(buf));
10557 /* For Perl, if you add additional tests here, also add them to
10558 * t/base/num.t for benefit of platforms not using Configure or
10559 * overriding d_Gconvert */
10564 : first add preferred functions to our list
10566 for xxx_convert in $gconvert_preference; do
10567 case $xxx_convert in
10568 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10569 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10572 : then add any others
10573 for xxx_convert in gconvert gcvt sprintf; do
10574 case "$xxx_list" in
10576 *) xxx_list="$xxx_list $xxx_convert" ;;
10580 case "$d_longdbl$uselongdouble" in
10582 : again, add preferred functions to our list first
10584 for xxx_convert in $gconvert_ld_preference; do
10585 case $xxx_convert in
10586 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10587 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10590 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10591 for xxx_convert in qgcvt sprintf $xxx_list; do
10592 case "$xxx_ld_list" in
10593 $xxx_convert*|*" $xxx_convert"*) ;;
10594 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10597 : if sprintf cannot do long doubles, move it to the end
10598 if test "$d_PRIgldbl" != "$define"; then
10599 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10601 : if no qgcvt, remove it
10602 if test "$d_qgcvt" != "$define"; then
10603 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10606 xxx_list="$xxx_ld_list"
10610 for xxx_convert in $xxx_list; do
10611 echo "Trying $xxx_convert..."
10612 $rm -f try try$_o core
10613 set try -DTRY_$xxx_convert
10614 if eval $compile; then
10615 echo "$xxx_convert() found." >&4
10616 if $run ./try; then
10617 echo "I'll use $xxx_convert to convert floats into a string." >&4
10620 echo "...But $xxx_convert didn't work as I expected."
10624 echo "$xxx_convert NOT found." >&4
10629 if test X$xxx_convert = X; then
10630 echo "*** WHOA THERE!!! ***" >&4
10631 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10632 xxx_convert=sprintf
10635 case "$xxx_convert" in
10636 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10637 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10638 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10639 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10640 "$define$define$define")
10641 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10642 "$define$define$undef")
10643 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10644 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10652 : see if _fwalk exists
10656 : see if accept4 exists
10657 set accept4 d_accept4
10660 : Initialize h_fcntl
10663 : Initialize h_sysfile
10666 : access call always available on UNIX
10667 set access d_access
10670 : locate the flags for 'access()'
10671 case "$d_access" in
10674 $cat >access.c <<EOCP
10675 #include <sys/types.h>
10680 #include <sys/file.h>
10683 #include <unistd.h>
10685 #$i_stdlib I_STDLIB
10687 #include <stdlib.h>
10693 : check sys/file.h first, no particular reason here
10694 if $test `./findhdr sys/file.h` && \
10695 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10697 echo "<sys/file.h> defines the *_OK access constants." >&4
10698 elif $test `./findhdr fcntl.h` && \
10699 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10701 echo "<fcntl.h> defines the *_OK access constants." >&4
10702 elif $test `./findhdr unistd.h` && \
10703 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10704 echo "<unistd.h> defines the *_OK access constants." >&4
10706 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10712 : see if accessx exists
10713 set accessx d_accessx
10716 : see if acosh exists
10720 : see if aintl exists
10724 : see if alarm exists
10728 : see if 64bit time functions exists
10730 set ctime64 d_ctime64
10733 set localtime64 d_localtime64
10736 set gmtime64 d_gmtime64
10739 set mktime64 d_mktime64
10742 set difftime64 d_difftime64
10745 set asctime64 d_asctime64
10748 : see if POSIX threads are available
10749 set pthread.h i_pthread
10752 : define a function to check prototypes
10753 $cat > protochk <<EOSH
10756 optimize="$optimize"
10760 usethreads=$usethreads
10761 i_pthread=$i_pthread
10762 pthread_h_first=$pthread_h_first
10765 $cat >> protochk <<'EOSH'
10770 while test $# -ge 2; do
10772 $define) echo "#include <$2>" >> try.c ;;
10773 literal) echo "$2" >> try.c ;;
10775 # Extra magic for the benefit of systems that need pthread.h
10776 # to be included early to correctly detect threadsafe functions.
10777 # Such functions must guarantee themselves, though, that the usethreads
10778 # and i_pthread have been defined, before calling protochk.
10779 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10780 echo "#include <pthread.h>" >> try.c
10785 cat >> try.c <<'EOCP'
10786 #define _(args) args
10788 echo "$foo" >> try.c
10789 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10790 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10796 $eunicefix protochk
10798 : Define hasproto macro for Configure internal use
10799 hasproto='varname=$1; func=$2; shift; shift;
10800 while $test $# -ge 2; do
10802 $define) echo "#include <$2>";;
10803 literal) echo "$2" ;;
10807 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10808 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10809 echo "$func() prototype found.";
10812 echo "$func() prototype NOT found.";
10819 : see if sys/types.h has to be included
10820 set sys/types.h i_systypes
10823 : see if sys/select.h has to be included
10824 set sys/select.h i_sysselct
10827 : Define hasfield macro for Configure internal use
10828 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10829 while $test $# -ge 2; do
10831 $define) echo "#include <$2>";;
10835 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10837 if eval $compile; then
10846 : see if we should include sys/time.h
10849 if test "X$timeincl" = X; then
10850 echo "Testing to see if we should include <sys/time.h>." >&4
10851 $echo $n "I'm now running the test program...$c"
10853 #include <sys/types.h>
10856 #ifdef SYSTIMEKERNEL
10859 #include <sys/time.h>
10862 #include <sys/select.h>
10864 #$i_stdlib I_STDLIB
10866 #include <stdlib.h>
10872 struct timeval bar;
10875 struct timezone tzp;
10877 if (foo.tm_sec == foo.tm_sec)
10880 if (bar.tv_sec == bar.tv_sec)
10887 for s_timezone in '-DS_TIMEZONE' ''; do
10889 for s_timeval in '-DS_TIMEVAL' ''; do
10890 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10891 for i_systime in '-DI_SYSTIME' ''; do
10894 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10895 if eval $compile; then
10896 set X $i_systime $i_systimek $sysselect $s_timeval
10900 $echo $n "Succeeded with $flags$c"
10911 *SYSTIMEKERNEL*) i_systimek="$define"
10912 timeincl=`./findhdr sys/time.h`
10913 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10914 *) i_systimek="$undef";;
10917 *I_SYSTIME*) i_systime="$define"
10918 timeincl=`./findhdr sys/time.h`" $timeincl"
10919 echo "We'll include <sys/time.h>." >&4;;
10920 *) i_systime="$undef";;
10924 : see if struct tm knows about tm_zone
10925 case "$i_systime$i_time" in
10928 echo "Checking to see if your struct tm has tm_zone field..." >&4
10929 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10937 case "$d_tm_tm_zone" in
10938 "$define") echo "Yes, it does." ;;
10939 *) echo "No, it doesn't." ;;
10941 : see if struct tm knows about tm_gmtoff
10942 case "$i_systime$i_time" in
10945 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10946 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10954 case "$d_tm_tm_gmtoff" in
10955 "$define") echo "Yes, it does." ;;
10956 *) echo "No, it doesn't." ;;
10959 : see if asctime_r exists
10960 set asctime_r d_asctime_r
10962 case "$d_asctime_r" in
10964 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10965 case "$d_asctime_r_proto:$usethreads" in
10966 ":define") d_asctime_r_proto=define
10967 set d_asctime_r_proto asctime_r $hdrs
10971 case "$d_asctime_r_proto" in
10973 case "$asctime_r_proto" in
10974 ''|0) try='char* asctime_r(const struct tm*, char*);'
10975 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10977 case "$asctime_r_proto" in
10978 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10979 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10981 case "$asctime_r_proto" in
10982 ''|0) try='int asctime_r(const struct tm*, char*);'
10983 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10985 case "$asctime_r_proto" in
10986 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10987 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10989 case "$asctime_r_proto" in
10990 ''|0) d_asctime_r=undef
10992 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10993 * ) case "$asctime_r_proto" in
10994 REENTRANT_PROTO*) ;;
10995 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10997 echo "Prototype: $try" ;;
11000 *) case "$usethreads" in
11001 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11008 *) asctime_r_proto=0
11012 : see if asinh exists
11016 : see if atanh exists
11020 : see if atolf exists
11024 : see if atoll exists
11028 : See if a file contains compiler warnings
11029 : See if a file contains compiler warnings
11032 cat >compiler_warning <<EOSS
11033 # Sample for aix ('.5' indicates the column number in the line):
11034 # "op.h", line 203.5: 1506-159 (E) Bit field type specified for op_type
11035 # Since the word 'warning' isn't present, use a fairly rigorous match of what
11036 # warning messages look like
11037 # " o p . h ", line 203 . 5 : 1506 - 159 ( E )
11038 $grep -E "^\\"[A-Za-z][A-Za-z0-9_]*\.[ch]\\", line [1-9][0-9]*[.][1-9][0-9]*: [1-9][0-9]*-[1-9][0-9]* \([EW][)] " "\$1"
11040 compiler_warning=./compiler_warning
11041 chmod +x $compiler_warning
11043 # Maybe a colon after the 'warning' would be appropriate
11044 *) compiler_warning="$contains -i warning"
11048 : Look for GCC-style attribute format
11049 case "$d_attribute_format" in
11052 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11053 $cat >attrib.c <<'EOCP'
11055 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11057 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11058 if $compiler_warning attrib.out >/dev/null 2>&1; then
11059 echo "Your C compiler doesn't support __attribute__((format))."
11062 echo "Your C compiler supports __attribute__((format))."
11066 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11070 *) val="$d_attribute_format" ;;
11072 set d_attribute_format
11076 : Look for GCC-style attribute format with null format allowed
11077 case "$d_printf_format_null" in
11078 '') case "$d_attribute_format" in
11081 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11082 $cat >attrib.c <<EOCP
11084 #$i_stdlib I_STDLIB
11086 #include <stdlib.h>
11088 #$i_inttypes I_INTTYPES
11090 #include <inttypes.h>
11093 #define intptr_t int
11095 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11096 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11097 int main () { exit(null_printf(NULL)); }
11099 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11100 : run the executable in case it produces a run-time warning
11101 if $run ./attrib >>attrib.out 2>&1; then
11102 if $compiler_warning attrib.out >/dev/null 2>&1; then
11103 echo "Your C compiler doesn't allow __printf__ format to be null."
11106 echo "Your C compiler allows __printf__ format to be null."
11110 echo "Your C compiler executable failed with __printf__ format null."
11114 echo "Your C compiler fails with __printf__ format null."
11121 *) val="$d_printf_format_null" ;;
11123 set d_printf_format_null
11127 : Look for GCC-style attribute malloc
11128 case "$d_attribute_malloc" in
11131 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11132 $cat >attrib.c <<'EOCP'
11134 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11136 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11137 if $compiler_warning attrib.out >/dev/null 2>&1; then
11138 echo "Your C compiler doesn't support __attribute__((malloc))."
11141 echo "Your C compiler supports __attribute__((malloc))."
11145 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11149 *) val="$d_attribute_malloc" ;;
11151 set d_attribute_malloc
11155 : Look for GCC-style attribute nonnull
11156 case "$d_attribute_nonnull" in
11159 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11160 $cat >attrib.c <<'EOCP'
11162 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11164 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11165 if $compiler_warning attrib.out >/dev/null 2>&1; then
11166 echo "Your C compiler doesn't support __attribute__((nonnull))."
11169 echo "Your C compiler supports __attribute__((nonnull))."
11173 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11177 *) val="$d_attribute_nonnull" ;;
11179 set d_attribute_nonnull
11183 : Look for GCC-style attribute noreturn
11184 case "$d_attribute_noreturn" in
11187 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11188 $cat >attrib.c <<'EOCP'
11190 void fall_over_dead( void ) __attribute__((noreturn));
11192 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11193 if $compiler_warning attrib.out >/dev/null 2>&1; then
11194 echo "Your C compiler doesn't support __attribute__((noreturn))."
11197 echo "Your C compiler supports __attribute__((noreturn))."
11201 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11205 *) val="$d_attribute_noreturn" ;;
11207 set d_attribute_noreturn
11211 : Look for GCC-style attribute pure
11212 case "$d_attribute_pure" in
11215 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11216 $cat >attrib.c <<'EOCP'
11218 int square( int n ) __attribute__((pure));
11220 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11221 if $compiler_warning attrib.out >/dev/null 2>&1; then
11222 echo "Your C compiler doesn't support __attribute__((pure))."
11225 echo "Your C compiler supports __attribute__((pure))."
11229 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11233 *) val="$d_attribute_pure" ;;
11235 set d_attribute_pure
11239 : Look for GCC-style attribute unused
11240 case "$d_attribute_unused" in
11243 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11244 $cat >attrib.c <<'EOCP'
11246 int do_something( int dummy __attribute__((unused)), int n );
11248 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11249 if $compiler_warning attrib.out >/dev/null 2>&1; then
11250 echo "Your C compiler doesn't support __attribute__((unused))."
11253 echo "Your C compiler supports __attribute__((unused))."
11257 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11261 *) val="$d_attribute_unused" ;;
11263 set d_attribute_unused
11267 : Look for GCC-style attribute deprecated
11268 case "$d_attribute_deprecated" in
11271 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11272 $cat >attrib.c <<'EOCP'
11274 int I_am_deprecated(void) __attribute__((deprecated));
11276 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11277 if $compiler_warning attrib.out >/dev/null 2>&1; then
11278 echo "Your C compiler doesn't support __attribute__((deprecated))."
11281 echo "Your C compiler supports __attribute__((deprecated))."
11285 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11289 *) val="$d_attribute_deprecated" ;;
11291 set d_attribute_deprecated
11295 : Look for GCC-style attribute warn_unused_result
11296 case "$d_attribute_warn_unused_result" in
11299 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11300 $cat >attrib.c <<'EOCP'
11302 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11304 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11305 if $compiler_warning attrib.out >/dev/null 2>&1; then
11306 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11309 echo "Your C compiler supports __attribute__((warn_unused_result))."
11313 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11317 *) val="$d_attribute_warn_unused_result" ;;
11319 set d_attribute_warn_unused_result
11323 : Look for GCC-style attribute always_inline
11324 case "$d_attribute_always_inline" in
11327 echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
11328 $cat >attrib.c <<'EOCP'
11330 static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
11332 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11333 if $compiler_warning attrib.out >/dev/null 2>&1; then
11334 echo "Your C compiler doesn't support __attribute__((always_inline))."
11337 echo "Your C compiler supports __attribute__((always_inline))."
11341 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11345 *) val="$d_attribute_always_inline" ;;
11347 set d_attribute_always_inline
11351 : Look for GCC-style attribute visibility
11352 case "$d_attribute_visibility" in
11355 echo "Checking whether your compiler can handle __attribute__((visibility)) ..." >&4
11356 $cat >attrib.c <<'EOCP'
11358 __attribute__((visibility("hidden"))) int I_will_be_hidden(void);
11360 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11361 if $compiler_warning attrib.out >/dev/null 2>&1; then
11362 echo "Your C compiler doesn't support __attribute__((visibility))."
11365 echo "Your C compiler supports __attribute__((visibility))."
11369 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11373 *) val="$d_attribute_visibility" ;;
11375 set d_attribute_visibility
11379 : see if getpgrp exists
11380 set getpgrp d_getpgrp
11383 case "$d_getpgrp" in
11386 echo "Checking to see which flavor of getpgrp is in use..."
11389 #$i_unistd I_UNISTD
11390 #include <sys/types.h>
11392 # include <unistd.h>
11394 #$i_stdlib I_STDLIB
11396 #include <stdlib.h>
11400 if (getuid() == 0) {
11401 printf("(I see you are running Configure as super-user...)\n");
11404 #ifdef TRY_BSD_PGRP
11405 if (getpgrp(1) == 0)
11414 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11415 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11417 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11418 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11421 echo "I can't seem to compile and run the test program."
11423 xxx="a USG one, i.e. you use getpgrp()."
11425 # SVR4 systems can appear rather BSD-ish.
11426 case "$i_unistd" in
11428 xxx="a BSD one, i.e. you use getpgrp(pid)."
11432 xxx="probably a USG one, i.e. you use getpgrp()."
11437 echo "Assuming your getpgrp is $xxx" >&4
11446 : see if setpgrp exists
11447 set setpgrp d_setpgrp
11450 case "$d_setpgrp" in
11453 echo "Checking to see which flavor of setpgrp is in use..."
11456 #$i_unistd I_UNISTD
11457 #include <sys/types.h>
11459 # include <unistd.h>
11461 #$i_stdlib I_STDLIB
11463 #include <stdlib.h>
11467 if (getuid() == 0) {
11468 printf("(I see you are running Configure as super-user...)\n");
11471 #ifdef TRY_BSD_PGRP
11472 if (-1 == setpgrp(1, 1))
11475 if (setpgrp() != -1)
11481 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11482 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11484 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11485 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11488 echo "(I can't seem to compile and run the test program.)"
11490 xxx="a USG one, i.e. you use setpgrp()."
11492 # SVR4 systems can appear rather BSD-ish.
11493 case "$i_unistd" in
11495 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11499 xxx="probably a USG one, i.e. you use setpgrp()."
11504 echo "Assuming your setpgrp is $xxx" >&4
11513 : Look for GCC-style __builtin_add_overflow
11514 case "$d_builtin_add_overflow" in
11517 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11518 $cat >try.c <<'EOCP'
11520 const unsigned int uint_max = ~0u;
11521 int target_int = 0;
11522 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11525 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11528 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11535 if eval $compile && $run ./try; then
11536 echo "Your C compiler supports __builtin_add_overflow."
11539 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11543 *) val="$d_builtin_add_overflow" ;;
11546 set d_builtin_add_overflow
11550 : Look for GCC-style __builtin_sub_overflow
11551 case "$d_builtin_sub_overflow" in
11554 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11555 $cat >try.c <<'EOCP'
11557 const unsigned int uint_max = ~0u;
11558 int target_int = 0;
11559 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11562 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11565 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11572 if eval $compile && $run ./try; then
11573 echo "Your C compiler supports __builtin_sub_overflow."
11576 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11580 *) val="$d_builtin_sub_overflow" ;;
11583 set d_builtin_sub_overflow
11587 : Look for GCC-style __builtin_mul_overflow
11588 case "$d_builtin_mul_overflow" in
11591 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11592 $cat >try.c <<'EOCP'
11594 const unsigned int uint_max = ~0u;
11595 int target_int = 0;
11596 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11599 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11602 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11609 if eval $compile && $run ./try; then
11610 echo "Your C compiler supports __builtin_mul_overflow."
11613 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11617 *) val="$d_builtin_mul_overflow" ;;
11620 set d_builtin_mul_overflow
11624 : Look for GCC-style __builtin_choose_expr
11625 case "$d_builtin_choose_expr" in
11628 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11629 $cat >try.c <<'EOCP'
11630 #include <assert.h>
11631 #include <stdlib.h>
11634 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11637 assert( SYRINX(1) == 2112 );
11638 assert( SYRINX(1) != 5150 );
11639 assert( SYRINX(0) == 5150 );
11640 assert( SYRINX(0) != 2112 );
11641 puts( "All good!" );
11647 if eval $compile && $run ./try; then
11648 echo "Your C compiler supports __builtin_choose_expr."
11651 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11655 *) val="$d_builtin_choose_expr" ;;
11658 set d_builtin_choose_expr
11662 : Look for GCC-style __builtin_expect
11663 case "$d_builtin_expect" in
11666 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11667 $cat >try.c <<'EOCP'
11670 if ( __builtin_expect(n, 0) ) n = 1;
11671 /* Remember shell exit code truth is 0, C truth is non-zero */
11676 if eval $compile && $run ./try; then
11677 echo "Your C compiler supports __builtin_expect."
11680 echo "Your C compiler doesn't seem to understand __builtin_expect."
11684 *) val="$d_builtin_expect" ;;
11687 set d_builtin_expect
11691 : see if the Compiler supports C99 variadic macros
11692 echo "Checking for C99 variadic macros." >&4
11695 #include <stdarg.h>
11697 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11701 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11707 if eval $compile && $run ./try 2>&1 >/dev/null; then
11708 case "`$run ./try`" in
11710 echo "You have C99 variadic macros." >&4
11711 d_c99_variadic_macros="$define"
11714 echo "You don't have functional C99 variadic macros." >&4
11715 d_c99_variadic_macros="$undef"
11719 echo "I couldn't compile and run the test program, so I assume that you don't have functional 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 chown exists
11939 : see if chroot exists
11940 set chroot d_chroot
11943 : see if chsize exists
11944 set chsize d_chsize
11947 : see if class exists
11951 : see if clearenv exists
11952 set clearenv d_clearenv
11955 : Define hasstruct macro for Configure internal use
11956 hasstruct='varname=$1; struct=$2; shift; shift;
11957 while $test $# -ge 2; do
11959 $define) echo "#include <$2>";;
11963 echo "int main () { struct $struct foo; }" >> try.c;
11965 if eval $compile; then
11974 : see whether socket exists
11978 $echo $n "Hmm... $c" >&4
11979 if set socket val -f d_socket; eval $csym; $val; then
11980 echo "Looks like you have Berkeley networking support." >&4
11982 if set setsockopt val -f; eval $csym; $val; then
11985 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11986 d_oldsock="$define"
11989 if $contains socklib libc.list >/dev/null 2>&1; then
11990 echo "Looks like you have Berkeley networking support." >&4
11992 : we will have to assume that it supports the 4.2 BSD interface
11995 echo "You don't have Berkeley networking in libc$_a..." >&4
11996 if test "X$d_socket" = "X$define"; then
11997 echo "...but you seem to believe that you have sockets." >&4
11999 for net in net socket
12001 if test -f $sysroot/usr/lib/lib$net$_a; then
12002 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12003 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12004 if $contains socket libc.list >/dev/null 2>&1; then
12009 echo "...but the Wollongong group seems to have hacked it in." >&4
12010 sockethdr="-I$sysroot/usr/netinclude"
12013 echo "Found Berkeley sockets interface in lib$net." >&4
12014 if $contains setsockopt libc.list >/dev/null 2>&1; then
12017 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12018 d_oldsock="$define"
12024 if test "X$d_socket" != "X$define"; then
12025 echo "or anywhere else I see." >&4
12033 : see if socketpair exists
12034 set socketpair d_sockpair
12038 echo "Checking the availability sa_len in the sock struct ..." >&4
12040 #include <sys/types.h>
12041 #include <sys/socket.h>
12043 struct sockaddr sa;
12044 return (sa.sa_len);
12048 set try; if eval $compile; then
12051 set d_sockaddr_sa_len; eval $setvar
12054 echo "Checking the availability struct sockaddr_in6 ..." >&4
12056 #include <sys/types.h>
12057 #include <sys/socket.h>
12058 #include <netinet/in.h>
12060 struct sockaddr_in6 sin6;
12061 return (sin6.sin6_family);
12065 set try; if eval $compile; then
12068 set d_sockaddr_in6; eval $setvar
12071 echo "Checking the availability struct sockaddr_storage ..." >&4
12073 #include <sys/types.h>
12074 #include <sys/socket.h>
12075 #include <netinet/in.h>
12077 struct sockaddr_storage sastor;
12078 return (sastor.ss_family);
12082 set try; if eval $compile; then
12085 set d_sockaddr_storage; eval $setvar
12088 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12090 #include <sys/types.h>
12091 #include <sys/socket.h>
12092 #include <netinet/in.h>
12094 struct sockaddr_in6 sin6;
12095 return (sin6.sin6_scope_id);
12099 set try; if eval $compile; then
12102 set d_sin6_scope_id; eval $setvar
12105 echo "Checking the availability struct ip_mreq ..." >&4
12107 #include <sys/types.h>
12108 #include <sys/socket.h>
12109 #include <netinet/in.h>
12111 struct ip_mreq mreq;
12112 return (mreq.imr_multiaddr.s_addr);
12116 set try; if eval $compile; then
12119 set d_ip_mreq; eval $setvar
12122 echo "Checking the availability struct ip_mreq_source ..." >&4
12124 #include <sys/types.h>
12125 #include <sys/socket.h>
12126 #include <netinet/in.h>
12128 struct ip_mreq_source mreq;
12129 return (mreq.imr_multiaddr.s_addr);
12133 set try; if eval $compile; then
12136 set d_ip_mreq_source; eval $setvar
12139 echo "Checking the availability struct ipv6_mreq ..." >&4
12141 #include <sys/types.h>
12142 #include <sys/socket.h>
12143 #include <netinet/in.h>
12145 struct ipv6_mreq mreq;
12146 return (mreq.ipv6mr_interface);
12150 set try; if eval $compile; then
12153 set d_ipv6_mreq; eval $setvar
12156 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12158 #include <sys/types.h>
12159 #include <sys/socket.h>
12160 #include <netinet/in.h>
12162 struct ipv6_mreq_source mreq;
12163 return (mreq.imr_multiaddr.s_addr);
12167 set try; if eval $compile; then
12170 set d_ipv6_mreq_source; eval $setvar
12173 echo "Checking the availability of certain socket constants..." >&4
12174 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12175 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12177 #include <sys/types.h>
12178 #include <sys/socket.h>
12184 set try; if eval $compile; then
12187 set d_${enum}; eval $setvar
12191 : see if this is a sys/uio.h system
12192 set sys/uio.h i_sysuio
12195 : Check for cmsghdr support
12197 echo "Checking to see if your system supports struct cmsghdr..." >&4
12198 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12200 case "$d_cmsghdr_s" in
12201 "$define") echo "Yes, it does." ;;
12202 *) echo "No, it doesn't." ;;
12205 : see if copysign exists
12206 set copysign d_copysign
12209 : see if copysignl exists
12210 set copysignl d_copysignl
12213 : see if crypt exists
12218 $define) cryptlib='' ;;
12219 *) if set crypt val -f d_crypt; eval $csym; $val; then
12220 echo 'crypt() found.' >&4
12224 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12225 if $test -z "$cryptlib"; then
12226 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12230 if $test -z "$cryptlib"; then
12231 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12235 if $test -z "$cryptlib"; then
12236 cryptlib=`./loc libcrypt$_a "" $libpth`
12240 if $test -z "$cryptlib"; then
12241 echo 'crypt() NOT found.' >&4
12252 : see if this is a crypt.h system
12253 set crypt.h i_crypt
12256 : see if crypt_r exists
12257 set crypt_r d_crypt_r
12259 case "$d_crypt_r" in
12261 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12262 case "$d_crypt_r_proto:$usethreads" in
12263 ":define") d_crypt_r_proto=define
12264 set d_crypt_r_proto crypt_r $hdrs
12268 case "$d_crypt_r_proto" in
12270 case "$crypt_r_proto" in
12271 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12272 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12274 case "$crypt_r_proto" in
12275 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12276 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12278 case "$crypt_r_proto" in
12279 ''|0) d_crypt_r=undef
12281 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12282 * ) case "$crypt_r_proto" in
12283 REENTRANT_PROTO*) ;;
12284 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12286 echo "Prototype: $try" ;;
12289 *) case "$usethreads" in
12290 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12301 : get csh whereabouts
12303 'csh') val="$undef" ;;
12304 *) val="$define" ;;
12308 : Respect a hint or command line value for full_csh.
12309 case "$full_csh" in
12310 '') full_csh=$csh ;;
12313 : see if ctermid exists
12314 set ctermid d_ctermid
12317 : see if ctermid_r exists
12318 set ctermid_r d_ctermid_r
12320 case "$d_ctermid_r" in
12322 hdrs="$i_systypes sys/types.h define stdio.h "
12323 case "$d_ctermid_r_proto:$usethreads" in
12324 ":define") d_ctermid_r_proto=define
12325 set d_ctermid_r_proto ctermid_r $hdrs
12329 case "$d_ctermid_r_proto" in
12331 case "$ctermid_r_proto" in
12332 ''|0) try='char* ctermid_r(char*);'
12333 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12335 case "$ctermid_r_proto" in
12336 ''|0) d_ctermid_r=undef
12338 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12339 * ) case "$ctermid_r_proto" in
12340 REENTRANT_PROTO*) ;;
12341 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12343 echo "Prototype: $try" ;;
12346 *) case "$usethreads" in
12347 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12354 *) ctermid_r_proto=0
12358 : see if ctime_r exists
12359 set ctime_r d_ctime_r
12361 case "$d_ctime_r" in
12363 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12364 case "$d_ctime_r_proto:$usethreads" in
12365 ":define") d_ctime_r_proto=define
12366 set d_ctime_r_proto ctime_r $hdrs
12370 case "$d_ctime_r_proto" in
12372 case "$ctime_r_proto" in
12373 ''|0) try='char* ctime_r(const time_t*, char*);'
12374 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12376 case "$ctime_r_proto" in
12377 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12378 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12380 case "$ctime_r_proto" in
12381 ''|0) try='int ctime_r(const time_t*, char*);'
12382 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12384 case "$ctime_r_proto" in
12385 ''|0) try='int ctime_r(const time_t*, char*, int);'
12386 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12388 case "$ctime_r_proto" in
12389 ''|0) d_ctime_r=undef
12391 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12392 * ) case "$ctime_r_proto" in
12393 REENTRANT_PROTO*) ;;
12394 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12396 echo "Prototype: $try" ;;
12399 *) case "$usethreads" in
12400 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12411 : see if cuserid exists
12412 set cuserid d_cuserid
12415 : see if dbm.h is available
12416 : see if dbmclose exists
12417 set dbmclose d_dbmclose
12420 case "$d_dbmclose" in
12430 *) set rpcsvc/dbm.h i_rpcsvcdbm
12435 *) echo "We won't be including <dbm.h>"
12445 : see if prototype for dbminit is available
12447 set d_dbminitproto dbminit $i_dbm dbm.h
12450 : see if difftime exists
12451 set difftime d_difftime
12454 : see if this is a dirent system
12456 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12458 echo "<dirent.h> found." >&4
12461 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12462 echo "<sys/dir.h> found." >&4
12465 xinc=`./findhdr sys/ndir.h`
12467 echo "<dirent.h> NOT found." >&4
12472 : Look for type of directory structure.
12474 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12476 case "$direntrytype" in
12478 case "$i_dirent" in
12479 $define) guess1='struct dirent' ;;
12480 *) guess1='struct direct' ;;
12483 *) guess1="$direntrytype"
12488 'struct dirent') guess2='struct direct' ;;
12489 *) guess2='struct dirent' ;;
12492 if $contains "$guess1" try.c >/dev/null 2>&1; then
12493 direntrytype="$guess1"
12494 echo "Your directory entries are $direntrytype." >&4
12495 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12496 direntrytype="$guess2"
12497 echo "Your directory entries seem to be $direntrytype." >&4
12499 echo "I don't recognize your system's directory entries." >&4
12500 rp="What type is used for directory entries on this system?"
12503 direntrytype="$ans"
12507 : see if the directory entry stores field length
12509 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12510 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12511 echo "Good, your directory entry keeps length information in d_namlen." >&4
12514 echo "Your directory entry does not know about the d_namlen field." >&4
12521 : Look for DIR.dd_fd
12522 case "$i_dirent" in
12524 echo "Checking to see if DIR has a dd_fd member variable" >&4
12526 #$i_stdlib I_STDLIB
12528 #include <stdlib.h>
12530 #include <dirent.h>
12540 if eval $compile; then
12541 echo "Yes, it does."
12544 echo "No, it does not."
12549 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12557 : see if this is an sysdir system
12558 set sys/dir.h i_sysdir
12561 : see if this is an sysndir system
12562 set sys/ndir.h i_sysndir
12567 $cat >dirfd.c <<EOM
12569 #$i_stdlib I_STDLIB
12571 #include <stdlib.h>
12573 #$i_dirent I_DIRENT /**/
12574 #$i_sysdir I_SYS_DIR /**/
12575 #$i_sysndir I_SYS_NDIR /**/
12576 #$i_systypes I_SYS_TYPES /**/
12577 #if defined(I_SYS_TYPES)
12578 #include <sys/types.h>
12580 #if defined(I_DIRENT)
12581 #include <dirent.h>
12584 #include <sys/ndir.h>
12587 #include <sys/dir.h>
12592 DIR *dirp = opendir(".");
12593 if (dirfd(dirp) >= 0)
12601 if eval $compile; then
12605 $define) echo "dirfd() found." >&4 ;;
12606 *) echo "dirfd() NOT found." >&4 ;;
12612 : see if dladdr exists
12613 set dladdr d_dladdr
12616 : see if dlerror exists
12619 set dlerror d_dlerror
12623 : see if dlfcn is available
12624 set dlfcn.h i_dlfcn
12627 : Check what extension to use for shared libs
12632 On a few systems, the dynamically loaded modules that perl generates and uses
12633 will need a different extension than shared libs. The default will probably
12639 *) dflt="$dlext" ;;
12641 rp='What is the extension of dynamically loaded modules'
12650 : Check if dlsym need a leading underscore
12656 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12657 $cat >dyna.c <<'EOM'
12664 #$i_stdlib I_STDLIB
12666 #include <stdlib.h>
12670 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12672 #include <sys/types.h>
12677 extern int fred() ;
12686 int mode = RTLD_LAZY ;
12688 handle = dlopen("./dyna.$dlext", mode) ;
12689 if (handle == NULL) {
12694 symbol = dlsym(handle, "fred") ;
12695 if (symbol == NULL) {
12696 /* try putting a leading underscore */
12697 symbol = dlsym(handle, "_fred") ;
12698 if (symbol == NULL) {
12711 : Call the object file tmp-dyna.o in case dlext=o.
12712 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12713 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12714 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12715 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12718 1) echo "Test program failed using dlopen." >&4
12719 echo "Perhaps you should not use dynamic loading." >&4;;
12720 2) echo "Test program failed using dlsym." >&4
12721 echo "Perhaps you should not use dynamic loading." >&4;;
12722 3) echo "dlsym needs a leading underscore" >&4
12724 4) echo "dlsym doesn't need a leading underscore." >&4;;
12727 echo "I can't compile and run the test program." >&4
12728 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12733 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12738 : see if drand48_r exists
12739 set drand48_r d_drand48_r
12741 case "$d_drand48_r" in
12743 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12744 case "$d_drand48_r_proto:$usethreads" in
12745 ":define") d_drand48_r_proto=define
12746 set d_drand48_r_proto drand48_r $hdrs
12750 case "$d_drand48_r_proto" in
12752 case "$drand48_r_proto" in
12753 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12754 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12756 case "$drand48_r_proto" in
12757 ''|0) d_drand48_r=undef
12759 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12760 * ) case "$drand48_r_proto" in
12761 REENTRANT_PROTO*) ;;
12762 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12764 echo "Prototype: $try" ;;
12767 *) case "$usethreads" in
12768 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12775 *) drand48_r_proto=0
12779 : see if prototype for drand48 is available
12781 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12784 : see if dup2 exists
12788 : see if dup3 exists
12792 : see if localeconv_l exists
12793 set localeconv_l d_localeconv_l
12796 : see if this is an xlocale.h system
12797 set xlocale.h i_xlocale
12800 : see if newlocale exists
12801 set newlocale d_newlocale
12804 : see if freelocale exists
12805 set freelocale d_freelocale
12808 : see if uselocale exists
12809 set uselocale d_uselocale
12812 : see if duplocale exists
12813 set duplocale d_duplocale
12816 : see if querylocale exists
12817 set querylocale d_querylocale
12820 : if we have xlocale.h, check whether it is needed
12821 case "$i_xlocale$d_newlocale$xlocale_needed" in
12823 echo "Checking if xlocale.h is needed..." >&4
12825 #include <locale.h>
12828 #include <xlocale.h>
12830 #$d_localeconv_l HAVE_LOCALECONV_L
12832 #ifdef HAVE_LOCALECONV_L
12833 struct lconv *(*lcptr)(locale_t) = localeconv_l;
12837 locale_t lc = newlocale(LC_ALL_MASK, "C", (locale_t)0);
12839 #ifdef HAVE_LOCALECONV_L
12840 /* FreeBSD hides only localeconv_l() in xlocale.h */
12841 struct lconv *lcbuf = localeconv_l(lc);
12842 printf("decimal: %s\n", lcbuf->decimal_point);
12850 if eval $compile && $run ./try > /dev/null 2>&1 ; then
12851 echo "xlocale.h isn't needed" >&4
12852 xlocale_needed=$undef
12854 set try -DTRY_XLOCALE
12855 if eval $compile && $run ./try > /dev/null 2>&1 ; then
12856 xlocale_needed=$define
12857 echo "xlocale.h is needed" >&4
12859 echo "I can't build my test either way" >&4
12860 xlocale_needed=$undef
12865 *) xlocale_needed=$undef ;;
12868 : see if eaccess exists
12869 set eaccess d_eaccess
12872 : see if endgrent exists
12873 set endgrent d_endgrent
12876 : see if this is an grp system
12882 xxx=`./findhdr grp.h`
12883 $cppstdin $cppflags $cppminus < $xxx >$$.h
12885 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12897 set d_grpasswd; eval $setvar
12901 : see if endgrent_r exists
12902 set endgrent_r d_endgrent_r
12904 case "$d_endgrent_r" in
12906 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12907 case "$d_endgrent_r_proto:$usethreads" in
12908 ":define") d_endgrent_r_proto=define
12909 set d_endgrent_r_proto endgrent_r $hdrs
12913 case "$d_endgrent_r_proto" in
12915 case "$endgrent_r_proto" in
12916 ''|0) try='int endgrent_r(FILE**);'
12917 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12919 case "$endgrent_r_proto" in
12920 ''|0) try='void endgrent_r(FILE**);'
12921 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12923 case "$endgrent_r_proto" in
12924 ''|0) d_endgrent_r=undef
12926 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12927 * ) case "$endgrent_r_proto" in
12928 REENTRANT_PROTO*) ;;
12929 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12931 echo "Prototype: $try" ;;
12934 *) case "$usethreads" in
12935 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12942 *) endgrent_r_proto=0
12946 : see if endhostent exists
12947 set endhostent d_endhent
12950 : see if this is a netdb.h system
12951 set netdb.h i_netdb
12954 : see if endhostent_r exists
12955 set endhostent_r d_endhostent_r
12957 case "$d_endhostent_r" in
12959 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12960 case "$d_endhostent_r_proto:$usethreads" in
12961 ":define") d_endhostent_r_proto=define
12962 set d_endhostent_r_proto endhostent_r $hdrs
12966 case "$d_endhostent_r_proto" in
12968 case "$endhostent_r_proto" in
12969 ''|0) try='int endhostent_r(struct hostent_data*);'
12970 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12972 case "$endhostent_r_proto" in
12973 ''|0) try='void endhostent_r(struct hostent_data*);'
12974 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12976 case "$endhostent_r_proto" in
12977 ''|0) d_endhostent_r=undef
12978 endhostent_r_proto=0
12979 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12980 * ) case "$endhostent_r_proto" in
12981 REENTRANT_PROTO*) ;;
12982 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12984 echo "Prototype: $try" ;;
12987 *) case "$usethreads" in
12988 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12990 d_endhostent_r=undef
12991 endhostent_r_proto=0
12995 *) endhostent_r_proto=0
12999 : see if endnetent exists
13000 set endnetent d_endnent
13003 : see if endnetent_r exists
13004 set endnetent_r d_endnetent_r
13006 case "$d_endnetent_r" in
13008 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13009 case "$d_endnetent_r_proto:$usethreads" in
13010 ":define") d_endnetent_r_proto=define
13011 set d_endnetent_r_proto endnetent_r $hdrs
13015 case "$d_endnetent_r_proto" in
13017 case "$endnetent_r_proto" in
13018 ''|0) try='int endnetent_r(struct netent_data*);'
13019 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13021 case "$endnetent_r_proto" in
13022 ''|0) try='void endnetent_r(struct netent_data*);'
13023 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13025 case "$endnetent_r_proto" in
13026 ''|0) d_endnetent_r=undef
13027 endnetent_r_proto=0
13028 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13029 * ) case "$endnetent_r_proto" in
13030 REENTRANT_PROTO*) ;;
13031 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13033 echo "Prototype: $try" ;;
13036 *) case "$usethreads" in
13037 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13039 d_endnetent_r=undef
13040 endnetent_r_proto=0
13044 *) endnetent_r_proto=0
13048 : see if endprotoent exists
13049 set endprotoent d_endpent
13052 : see if endprotoent_r exists
13053 set endprotoent_r d_endprotoent_r
13055 case "$d_endprotoent_r" in
13057 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13058 case "$d_endprotoent_r_proto:$usethreads" in
13059 ":define") d_endprotoent_r_proto=define
13060 set d_endprotoent_r_proto endprotoent_r $hdrs
13064 case "$d_endprotoent_r_proto" in
13066 case "$endprotoent_r_proto" in
13067 ''|0) try='int endprotoent_r(struct protoent_data*);'
13068 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13070 case "$endprotoent_r_proto" in
13071 ''|0) try='void endprotoent_r(struct protoent_data*);'
13072 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13074 case "$endprotoent_r_proto" in
13075 ''|0) d_endprotoent_r=undef
13076 endprotoent_r_proto=0
13077 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13078 * ) case "$endprotoent_r_proto" in
13079 REENTRANT_PROTO*) ;;
13080 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13082 echo "Prototype: $try" ;;
13085 *) case "$usethreads" in
13086 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13088 d_endprotoent_r=undef
13089 endprotoent_r_proto=0
13093 *) endprotoent_r_proto=0
13097 : see if endpwent exists
13098 set endpwent d_endpwent
13101 : see if this is a pwd.h system
13107 xxx=`./findhdr pwd.h`
13108 $cppstdin $cppflags $cppminus < $xxx >$$.h
13110 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13118 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13126 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13134 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13142 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13150 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13158 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13166 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13178 set d_pwquota; eval $setvar
13179 set d_pwage; eval $setvar
13180 set d_pwchange; eval $setvar
13181 set d_pwclass; eval $setvar
13182 set d_pwexpire; eval $setvar
13183 set d_pwcomment; eval $setvar
13184 set d_pwgecos; eval $setvar
13185 set d_pwpasswd; eval $setvar
13189 : see if endpwent_r exists
13190 set endpwent_r d_endpwent_r
13192 case "$d_endpwent_r" in
13194 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13195 case "$d_endpwent_r_proto:$usethreads" in
13196 ":define") d_endpwent_r_proto=define
13197 set d_endpwent_r_proto endpwent_r $hdrs
13201 case "$d_endpwent_r_proto" in
13203 case "$endpwent_r_proto" in
13204 ''|0) try='int endpwent_r(FILE**);'
13205 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13207 case "$endpwent_r_proto" in
13208 ''|0) try='void endpwent_r(FILE**);'
13209 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13211 case "$endpwent_r_proto" in
13212 ''|0) d_endpwent_r=undef
13214 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13215 * ) case "$endpwent_r_proto" in
13216 REENTRANT_PROTO*) ;;
13217 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13219 echo "Prototype: $try" ;;
13222 *) case "$usethreads" in
13223 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13230 *) endpwent_r_proto=0
13234 : see if endservent exists
13235 set endservent d_endsent
13238 : see if endservent_r exists
13239 set endservent_r d_endservent_r
13241 case "$d_endservent_r" in
13243 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13244 case "$d_endservent_r_proto:$usethreads" in
13245 ":define") d_endservent_r_proto=define
13246 set d_endservent_r_proto endservent_r $hdrs
13250 case "$d_endservent_r_proto" in
13252 case "$endservent_r_proto" in
13253 ''|0) try='int endservent_r(struct servent_data*);'
13254 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13256 case "$endservent_r_proto" in
13257 ''|0) try='void endservent_r(struct servent_data*);'
13258 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13260 case "$endservent_r_proto" in
13261 ''|0) d_endservent_r=undef
13262 endservent_r_proto=0
13263 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13264 * ) case "$endservent_r_proto" in
13265 REENTRANT_PROTO*) ;;
13266 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13268 echo "Prototype: $try" ;;
13271 *) case "$usethreads" in
13272 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13274 d_endservent_r=undef
13275 endservent_r_proto=0
13279 *) endservent_r_proto=0
13283 : Locate the flags for 'open()'
13286 #include <sys/types.h>
13291 #include <sys/file.h>
13293 #$i_stdlib I_STDLIB
13295 #include <stdlib.h>
13306 : check sys/file.h first to get FREAD on Sun
13307 if $test `./findhdr sys/file.h` && \
13308 set try -DI_SYS_FILE && eval $compile; then
13310 echo "<sys/file.h> defines the O_* constants..." >&4
13311 if $run ./try; then
13312 echo "and you have the 3 argument form of open()." >&4
13315 echo "but not the 3 argument form of open(). Oh, well." >&4
13318 elif $test `./findhdr fcntl.h` && \
13319 set try -DI_FCNTL && eval $compile; then
13321 echo "<fcntl.h> defines the O_* constants..." >&4
13322 if $run ./try; then
13323 echo "and you have the 3 argument form of open()." >&4
13326 echo "but not the 3 argument form of open(). Oh, well." >&4
13331 echo "I can't find the O_* constant definitions! You got problems." >&4
13337 : see if this is a sys/file.h system
13342 : do we need to include sys/file.h ?
13346 if $h_sysfile; then
13348 echo "We'll be including <sys/file.h>." >&4
13351 echo "We won't be including <sys/file.h>." >&4
13361 : see if fcntl.h is there
13366 : see if we can include fcntl.h
13372 echo "We'll be including <fcntl.h>." >&4
13375 if $h_sysfile; then
13376 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13378 echo "We won't be including <fcntl.h>." >&4
13390 : see if fork exists
13394 : see if pipe exists
13398 : check for non-blocking I/O stuff
13399 case "$h_sysfile" in
13400 true) echo "#include <sys/file.h>" > head.c;;
13403 true) echo "#include <fcntl.h>" > head.c;;
13404 *) echo "#include <sys/fcntl.h>" > head.c;;
13409 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13410 case "$o_nonblock" in
13412 $cat head.c > try.c
13413 $cat >>try.c <<EOCP
13415 #$i_stdlib I_STDLIB
13417 #include <stdlib.h>
13425 printf("O_NONBLOCK\n");
13429 printf("O_NDELAY\n");
13433 printf("FNDELAY\n");
13440 if eval $compile_ok; then
13441 o_nonblock=`$run ./try`
13442 case "$o_nonblock" in
13443 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13444 *) echo "Seems like we can use $o_nonblock.";;
13447 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13450 *) echo "Using $hint value $o_nonblock.";;
13455 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13458 case "$d_fork:$d_pipe:$d_alarm" in
13459 define:define:define)
13460 $cat head.c > try.c
13461 $cat >>try.c <<EOCP
13463 #include <sys/types.h>
13464 #include <signal.h>
13466 #$i_stdlib I_STDLIB
13468 #include <stdlib.h>
13474 #define MY_O_NONBLOCK $o_nonblock
13475 #ifndef errno /* XXX need better Configure test */
13478 #$i_unistd I_UNISTD
13480 #include <unistd.h>
13482 #include <string.h>
13483 $signal_t blech(int x) { exit(3); }
13485 $cat >> try.c <<'EOCP'
13494 ret = pipe(pd); /* Down: child -> parent */
13497 ret = pipe(pu); /* Up: parent -> child */
13501 close(pd[1]); /* Parent reads from pd[0] */
13502 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13504 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13509 signal(SIGALRM, blech);
13511 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13513 sprintf(string, "%d\n", ret);
13514 ret = write(2, string, strlen(string));
13515 if (ret != strlen(string))
13519 if (errno == EAGAIN) {
13520 printf("EAGAIN\n");
13525 if (errno == EWOULDBLOCK)
13526 printf("EWOULDBLOCK\n");
13529 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13532 sleep(2); /* Give it time to close our pipe */
13534 ret = read(pd[0], buf, 1); /* Should read EOF */
13536 sprintf(string, "%d\n", ret);
13537 ret = write(4, string, strlen(string));
13538 if (ret != strlen(string))
13543 close(pd[0]); /* We write to pd[1] */
13544 close(pu[1]); /* We read from pu[0] */
13545 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13548 close(pd[1]); /* Pipe pd is now fully closed! */
13549 exit(0); /* Bye bye, thank you for playing! */
13553 if eval $compile_ok; then
13554 echo "$startsh" >mtry
13555 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13557 $run ./mtry >/dev/null 2>&1
13559 0) eagain=`$cat try.out`;;
13560 1) echo "Could not perform non-blocking setting!";;
13561 2) echo "I did a successful read() for something that was not there!";;
13562 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13563 4) echo "Could not find F_SETFL!";;
13564 *) echo "Something terribly wrong happened during testing.";;
13566 rd_nodata=`$cat try.ret`
13567 echo "A read() system call with no data present returns $rd_nodata."
13568 case "$rd_nodata" in
13571 echo "(That's peculiar, fixing that to be -1.)"
13577 echo "Forcing errno EAGAIN on read() with no data available."
13581 echo "Your read() sets errno to $eagain when no data is available."
13584 status=`$cat try.err`
13586 0) echo "And it correctly returns 0 to signal EOF.";;
13587 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13588 *) echo "However, your read() returns '$status' on EOF??";;
13591 if test "$status" = "$rd_nodata"; then
13592 echo "WARNING: you can't distinguish between EOF and no data!"
13596 echo "I can't compile the test program--assuming errno EAGAIN will do."
13600 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13609 echo "Using $hint value $eagain."
13610 echo "Your read() returns $rd_nodata when no data is present."
13611 case "$d_eofnblk" in
13612 "$define") echo "And you can see EOF because read() returns 0.";;
13613 "$undef") echo "But you can't see EOF status from read() returned value.";;
13615 echo "(Assuming you can't see EOF status from read anyway.)"
13621 $rm_try head.c mtry
13623 : see if erf exists
13627 : see if erfc exists
13631 : see if exp2 exists
13635 : see if expm1 exists
13639 : see if _ptr and _cnt from stdio act std
13642 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13643 echo "(Looks like you have stdio.h from BSD.)"
13644 case "$stdio_ptr" in
13645 '') stdio_ptr='((fp)->_p)'
13648 *) ptr_lval=$d_stdio_ptr_lval;;
13650 case "$stdio_cnt" in
13651 '') stdio_cnt='((fp)->_r)'
13654 *) cnt_lval=$d_stdio_cnt_lval;;
13656 case "$stdio_base" in
13657 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13659 case "$stdio_bufsiz" in
13660 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13662 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13663 echo "(Looks like you have stdio.h from Linux.)"
13664 case "$stdio_ptr" in
13665 '') stdio_ptr='((fp)->_IO_read_ptr)'
13668 *) ptr_lval=$d_stdio_ptr_lval;;
13670 case "$stdio_cnt" in
13671 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13674 *) cnt_lval=$d_stdio_cnt_lval;;
13676 case "$stdio_base" in
13677 '') stdio_base='((fp)->_IO_read_base)';;
13679 case "$stdio_bufsiz" in
13680 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13683 case "$stdio_ptr" in
13684 '') stdio_ptr='((fp)->_ptr)'
13687 *) ptr_lval=$d_stdio_ptr_lval;;
13689 case "$stdio_cnt" in
13690 '') stdio_cnt='((fp)->_cnt)'
13693 *) cnt_lval=$d_stdio_cnt_lval;;
13695 case "$stdio_base" in
13696 '') stdio_base='((fp)->_base)';;
13698 case "$stdio_bufsiz" in
13699 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13703 : test whether _ptr and _cnt really work
13704 echo "Checking how std your stdio is..." >&4
13707 #$i_stdlib I_STDLIB
13709 #include <stdlib.h>
13711 #define FILE_ptr(fp) $stdio_ptr
13712 #define FILE_cnt(fp) $stdio_cnt
13714 FILE *fp = fopen("try.c", "r");
13717 18 <= FILE_cnt(fp) &&
13718 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13726 if eval $compile && $to try.c; then
13727 if $run ./try; then
13728 echo "Your stdio acts pretty std."
13731 echo "Your stdio isn't very std."
13734 echo "Your stdio doesn't appear very std."
13738 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13739 # direct buffer manipulation no longer works. The Configure tests
13740 # should be changed to correctly detect this, but until then,
13741 # the following check should at least let perl compile and run.
13742 # (This quick fix should be updated before 5.8.1.)
13743 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13744 # A. Dougherty, June 3, 2002.
13745 case "$d_gnulibc" in
13747 case "$gnulibc_version" in
13751 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13760 : Can _ptr be used as an lvalue?
13761 case "$d_stdstdio$ptr_lval" in
13762 $define$define) val=$define ;;
13765 set d_stdio_ptr_lval
13768 : Can _cnt be used as an lvalue?
13769 case "$d_stdstdio$cnt_lval" in
13770 $define$define) val=$define ;;
13773 set d_stdio_cnt_lval
13777 : test whether setting _ptr sets _cnt as a side effect
13778 d_stdio_ptr_lval_sets_cnt="$undef"
13779 d_stdio_ptr_lval_nochange_cnt="$undef"
13780 case "$d_stdio_ptr_lval$d_stdstdio" in
13782 echo "Checking to see what happens if we set the stdio ptr..." >&4
13785 /* Can we scream? */
13786 /* Eat dust sed :-) */
13787 /* In the buffer space, no one can hear you scream. */
13788 #$i_stdlib I_STDLIB
13790 #include <stdlib.h>
13792 #define FILE_ptr(fp) $stdio_ptr
13793 #define FILE_cnt(fp) $stdio_cnt
13794 #include <sys/types.h>
13796 FILE *fp = fopen("try.c", "r");
13801 puts("Fail even to read");
13804 c = getc(fp); /* Read away the first # */
13806 puts("Fail even to read");
13810 18 <= FILE_cnt(fp) &&
13811 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13813 puts("Fail even to read");
13816 ptr = (char*) FILE_ptr(fp);
13817 cnt = (size_t)FILE_cnt(fp);
13819 FILE_ptr(fp) += 42;
13821 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13822 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13825 if (FILE_cnt(fp) <= 20) {
13826 printf ("Fail (<20 chars to test)");
13829 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13830 puts("Fail compare");
13833 if (cnt == FILE_cnt(fp)) {
13834 puts("Pass_unchanged");
13837 if (FILE_cnt(fp) == (cnt - 42)) {
13838 puts("Pass_changed");
13841 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13847 if eval $compile && $to try.c; then
13848 case `$run ./try` in
13850 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13851 d_stdio_ptr_lval_sets_cnt="$define" ;;
13853 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13854 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13856 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13858 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13861 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13867 : see if _base is also standard
13869 case "$d_stdstdio" in
13873 #$i_stdlib I_STDLIB
13875 #include <stdlib.h>
13877 #define FILE_base(fp) $stdio_base
13878 #define FILE_bufsiz(fp) $stdio_bufsiz
13880 FILE *fp = fopen("try.c", "r");
13883 19 <= FILE_bufsiz(fp) &&
13884 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13891 if eval $compile && $to try.c; then
13892 if $run ./try; then
13893 echo "And its _base field acts std."
13896 echo "But its _base field isn't std."
13899 echo "However, it seems to be lacking the _base field."
13907 : see if fast_stdio exists
13909 case "$d_stdstdio:$d_stdio_ptr_lval" in
13911 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13913 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >&4
13922 : see if fchdir exists
13923 set fchdir d_fchdir
13926 : see if fchmod exists
13927 set fchmod d_fchmod
13930 : check for openat, unlinkat, renameat, linkat, fchmodat
13931 set openat d_openat
13934 set unlinkat d_unlinkat
13937 set renameat d_renameat
13940 set linkat d_linkat
13943 set fchmodat d_fchmodat
13946 : see if fchown exists
13947 set fchown d_fchown
13950 : see if this is an fcntl system
13954 : See if fcntl-based locking works.
13957 #$i_stdlib I_STDLIB
13959 #include <stdlib.h>
13961 #include <unistd.h>
13963 #include <signal.h>
13964 $signal_t blech(int x) { exit(3); }
13966 #if defined(F_SETLK) && defined(F_SETLKW)
13967 struct flock flock;
13969 fd = open("try.c", O_RDONLY);
13970 flock.l_type = F_RDLCK;
13971 flock.l_whence = SEEK_SET;
13972 flock.l_start = flock.l_len = 0;
13973 signal(SIGALRM, blech);
13975 retval = fcntl(fd, F_SETLK, &flock);
13977 (retval < 0 ? exit(2) : exit(0));
13983 echo "Checking if fcntl-based file locking works... "
13987 if eval $compile_ok; then
13988 if $run ./try; then
13989 echo "Yes, it seems to work."
13992 echo "Nope, it didn't work."
13997 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13998 *** This is (almost) impossible.
13999 *** If your NFS lock daemons are not feeling well, something like
14000 *** this may happen, please investigate. Cannot continue, aborting.
14008 echo "I'm unable to compile the test program, so I'll assume not."
14013 echo "Nope, since you don't even have fcntl()."
14016 set d_fcntl_can_lock
14020 : check for fd_set items
14023 Checking to see how well your C compiler handles fd_set and friends ...
14026 #$i_stdlib I_STDLIB
14028 #include <stdlib.h>
14030 #$i_systime I_SYS_TIME
14031 #$i_sysselct I_SYS_SELECT
14032 #$d_socket HAS_SOCKET
14033 #include <sys/types.h>
14035 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14038 #include <sys/time.h>
14040 #ifdef I_SYS_SELECT
14041 #include <sys/select.h>
14050 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14058 if eval $compile; then
14059 d_fds_bits="$define"
14061 echo "Well, your system knows about the normal fd_set typedef..." >&4
14062 if $run ./try; then
14063 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14064 d_fd_macros="$define"
14067 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14069 d_fd_macros="$undef"
14073 Hmm, your compiler has some difficulty with fd_set. Checking further...
14076 if eval $compile; then
14077 d_fds_bits="$undef"
14079 echo "Well, your system has some sort of fd_set available..." >&4
14080 if $run ./try; then
14081 echo "and you have the normal fd_set macros." >&4
14082 d_fd_macros="$define"
14085 but not the normal fd_set macros! Gross! More work for me...
14087 d_fd_macros="$undef"
14090 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14092 d_fds_bits="$undef"
14093 d_fd_macros="$undef"
14098 : see if fdclose exists
14099 set fdclose d_fdclose
14102 : see if fdim exists
14106 : see if fegetround exists
14107 set fegetround d_fegetround
14110 : see if ffs exists
14113 : see if ffsl exists
14117 : see if fgetpos exists
14118 set fgetpos d_fgetpos
14121 : see if finite exists
14122 set finite d_finite
14125 : see if finitel exists
14126 set finitel d_finitel
14129 : see if flock exists
14133 : see if prototype for flock is available
14135 set d_flockproto flock $i_sysfile sys/file.h
14138 : see if fma exists
14142 : see if fmax exists
14146 : see if fmin exists
14150 : see if fp_class exists
14151 set fp_class d_fp_class
14154 : check for fpclassify
14155 echo "Checking to see if you have fpclassify..." >&4
14158 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14161 if eval $compile; then
14163 echo "You have fpclassify."
14166 echo "You do not have fpclassify."
14172 : see if fp_classify exists
14173 set fp_classify d_fp_classify
14176 : see if fp_classl exists
14177 set fp_classl d_fp_classl
14180 : see if pathconf exists
14181 set pathconf d_pathconf
14184 : see if fpathconf exists
14185 set fpathconf d_fpathconf
14188 : see if fpclass exists
14189 set fpclass d_fpclass
14192 : see if fpclassl exists
14193 set fpclassl d_fpclassl
14196 : see if fpgetround exists
14197 set fpgetround d_fpgetround
14200 : check for fpos64_t
14202 echo "Checking to see if you have fpos64_t..." >&4
14205 int main() { fpos64_t x = 7; }
14208 if eval $compile; then
14210 echo "You have fpos64_t."
14213 echo "You do not have fpos64_t."
14214 case "$fpossize" in
14215 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14222 : see if frexpl exists
14223 set frexpl d_frexpl
14226 : see if this is a sys/param system
14227 set sys/param.h i_sysparam
14230 : see if this is a sys/mount.h system
14231 set sys/mount.h i_sysmount
14234 : Check for fs_data_s
14236 echo "Checking to see if your system supports struct fs_data..." >&4
14237 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14239 case "$d_fs_data_s" in
14240 "$define") echo "Yes, it does." ;;
14241 *) echo "No, it doesn't." ;;
14244 : see if fseeko exists
14245 set fseeko d_fseeko
14247 case "$longsize" in
14248 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14251 : see if fsetpos exists
14252 set fsetpos d_fsetpos
14255 : see if fstatfs exists
14256 set fstatfs d_fstatfs
14259 : see if statvfs exists
14260 set statvfs d_statvfs
14263 : see if fstatvfs exists
14264 set fstatvfs d_fstatvfs
14267 : see if fsync exists
14271 : see if ftello exists
14272 set ftello d_ftello
14274 case "$longsize" in
14275 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14278 : check for a working futimes
14281 echo "Checking if you have a working futimes()" >&4
14284 #include <stdlib.h>
14285 #include <sys/time.h>
14288 #include <stdlib.h>
14293 fd = open ("try.c", O_RDWR);
14294 if (-1 == fd) exit (1);
14295 rv = futimes (fd, NULL);
14296 exit (rv == -1 ? errno : 0);
14300 if eval $compile; then
14304 0) echo "Yes, you have" >&4
14305 d_futimes="$define"
14307 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14311 echo "No, it does not (probably harmless)" >&4
14315 : look for gai_strerror
14317 $cat >try.c <<'EOCP'
14318 #include <sys/types.h>
14319 #include <sys/socket.h>
14323 return (gai_strerror (0) ? 0 : 1);
14328 if eval $compile; then
14331 0) echo "A working gai_strerror() found." >&4
14333 *) echo "gai_strerror() found, but it doesn't work" >&4
14337 echo "gai_strerror() NOT found." >&4
14343 : see if ndbm.h is available
14346 : Compatibility location for RedHat 7.1
14347 set gdbm/ndbm.h i_gdbmndbm
14349 : Compatibility location for Debian 4.0
14350 set gdbm-ndbm.h i_gdbm_ndbm
14354 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14355 : see if dbm_open exists
14356 set dbm_open d_dbm_open
14358 case "$d_dbm_open" in
14361 i_gdbmndbm="$undef"
14362 i_gdbm_ndbm="$undef"
14363 echo "We won't be including <ndbm.h>"
14373 ndbm_hdr_protochk='name=$1; hdr=$2;
14374 eval "ihdr=\$""i_$name";
14376 if $test "$ihdr" = "$define"; then
14377 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14378 case "$d_cplusplus" in
14379 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14380 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14383 $define) $echo "Your <$hdr> seems to have prototypes";;
14384 *) $echo "Your <$hdr> does not seem to have prototypes";;
14387 set "d_${name}_h_uses_prototypes";
14391 eval $ndbm_hdr_protochk
14392 set gdbmndbm gdbm/ndbm.h
14393 eval $ndbm_hdr_protochk
14394 set gdbm_ndbm gdbm-ndbm.h
14395 eval $ndbm_hdr_protochk
14397 : see if getaddrinfo exists
14398 set getaddrinfo d_getaddrinfo
14401 : see if getcwd exists
14402 set getcwd d_getcwd
14405 : check for getenv behavior
14406 case "$d_getenv_preserves_other_thread" in
14408 $echo "Checking to see if getenv() preserves a different thread's results" >&4
14410 #$i_stdlib I_STDLIB
14412 # include <stdlib.h>
14415 #include <string.h>
14416 #$i_pthread I_PTHREAD
14418 # include <pthread.h>
14422 thread_start(void * arg)
14424 return (void *) getenv("HOME");
14428 char * main_buffer;
14429 char save_main_buffer[1000];
14430 pthread_t subthread;
14431 pthread_attr_t attr;
14433 main_buffer = getenv("PATH");
14435 /* If too large for our generous allowance, return we couldn't figure it
14437 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
14441 strcpy(save_main_buffer, main_buffer);
14443 if (pthread_attr_init(&attr) != 0) {
14447 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
14451 if (pthread_join(subthread, NULL) != 0) {
14455 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
14460 if eval $compile_ok; then
14464 0) echo "getenv() didn't destroy another thread's buffer" >&4
14467 1) echo "getenv() does destroy another thread's buffer" >&4
14470 *) echo "Couldn't determine if getenv() destroys another thread's return value (code=$rc); assuming it does" >&4
14475 echo "(I can't seem to compile the test program.)" >&4
14476 echo "Assuming that your C library's getenv destroys another thread's return value." >&4
14479 set d_getenv_preserves_other_thread
14485 : see if getespwnam exists
14486 set getespwnam d_getespwnam
14489 : see if getfsstat exists
14490 set getfsstat d_getfsstat
14493 : see if getgrent exists
14494 set getgrent d_getgrent
14497 : see if getgrent_r exists
14498 set getgrent_r d_getgrent_r
14500 case "$d_getgrent_r" in
14502 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14503 case "$d_getgrent_r_proto:$usethreads" in
14504 ":define") d_getgrent_r_proto=define
14505 set d_getgrent_r_proto getgrent_r $hdrs
14509 case "$d_getgrent_r_proto" in
14511 case "$getgrent_r_proto" in
14512 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14513 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14515 case "$getgrent_r_proto" in
14516 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14517 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14519 case "$getgrent_r_proto" in
14520 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14521 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14523 case "$getgrent_r_proto" in
14524 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14525 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14527 case "$getgrent_r_proto" in
14528 ''|0) try='int getgrent_r(struct group*, char*, int);'
14529 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14531 case "$getgrent_r_proto" in
14532 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14533 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14535 case "$getgrent_r_proto" in
14536 ''|0) d_getgrent_r=undef
14538 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14539 * ) case "$getgrent_r_proto" in
14540 REENTRANT_PROTO*) ;;
14541 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14543 echo "Prototype: $try" ;;
14546 *) case "$usethreads" in
14547 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14554 *) getgrent_r_proto=0
14558 : see if getgrgid_r exists
14559 set getgrgid_r d_getgrgid_r
14561 case "$d_getgrgid_r" in
14563 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14564 case "$d_getgrgid_r_proto:$usethreads" in
14565 ":define") d_getgrgid_r_proto=define
14566 set d_getgrgid_r_proto getgrgid_r $hdrs
14570 case "$d_getgrgid_r_proto" in
14572 case "$getgrgid_r_proto" in
14573 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14574 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14576 case "$getgrgid_r_proto" in
14577 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14578 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14580 case "$getgrgid_r_proto" in
14581 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14582 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14584 case "$getgrgid_r_proto" in
14585 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14586 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14588 case "$getgrgid_r_proto" in
14589 ''|0) d_getgrgid_r=undef
14591 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14592 * ) case "$getgrgid_r_proto" in
14593 REENTRANT_PROTO*) ;;
14594 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14596 echo "Prototype: $try" ;;
14599 *) case "$usethreads" in
14600 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14607 *) getgrgid_r_proto=0
14611 : see if getgrnam_r exists
14612 set getgrnam_r d_getgrnam_r
14614 case "$d_getgrnam_r" in
14616 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14617 case "$d_getgrnam_r_proto:$usethreads" in
14618 ":define") d_getgrnam_r_proto=define
14619 set d_getgrnam_r_proto getgrnam_r $hdrs
14623 case "$d_getgrnam_r_proto" in
14625 case "$getgrnam_r_proto" in
14626 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14627 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14629 case "$getgrnam_r_proto" in
14630 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14631 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14633 case "$getgrnam_r_proto" in
14634 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14635 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14637 case "$getgrnam_r_proto" in
14638 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14639 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14641 case "$getgrnam_r_proto" in
14642 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14643 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14645 case "$getgrnam_r_proto" in
14646 ''|0) d_getgrnam_r=undef
14648 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14649 * ) case "$getgrnam_r_proto" in
14650 REENTRANT_PROTO*) ;;
14651 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14653 echo "Prototype: $try" ;;
14656 *) case "$usethreads" in
14657 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14664 *) getgrnam_r_proto=0
14668 : see if gethostbyaddr exists
14669 set gethostbyaddr d_gethbyaddr
14672 : see if gethostbyname exists
14673 set gethostbyname d_gethbyname
14676 : see if gethostent exists
14677 set gethostent d_gethent
14680 : see how we will look up host name
14683 if set gethostname val -f d_gethname; eval $csym; $val; then
14684 echo 'gethostname() found.' >&4
14685 d_gethname="$define"
14688 if set uname val -f d_uname; eval $csym; $val; then
14691 uname() was found, but you're running xenix, and older versions of xenix
14692 have a broken uname(). If you don't really know whether your xenix is old
14693 enough to have a broken system call, use the default answer.
14698 "$define") dflt=n;;
14700 rp='Is your uname() broken?'
14703 n*) d_uname="$define"; call=uname;;
14706 echo 'uname() found.' >&4
14713 case "$d_gethname" in
14714 '') d_gethname="$undef";;
14717 '') d_uname="$undef";;
14719 case "$d_uname$d_gethname" in
14724 Every now and then someone has a $call() that lies about the hostname
14725 but can't be fixed for political or economic reasons. If you wish, I can
14726 pretend $call() isn't there and maybe compute hostname at run-time
14727 thanks to the '$phostname' command.
14730 rp="Shall I ignore $call() from now on?"
14733 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14736 case "$phostname" in
14737 '') aphostname='';;
14738 *) case "$aphostname" in
14740 *) set X $phostname
14744 file=`./loc $file $file $pth`
14745 aphostname=`echo $file $*`
14750 case "$d_uname$d_gethname" in
14753 case "$phostname" in
14755 echo "There will be no way for $package to get your hostname." >&4;;
14757 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14761 case "$d_phostname" in
14762 '') d_phostname="$undef";;
14765 : see if gethostbyaddr_r exists
14766 set gethostbyaddr_r d_gethostbyaddr_r
14768 case "$d_gethostbyaddr_r" in
14770 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14771 case "$d_gethostbyaddr_r_proto:$usethreads" in
14772 ":define") d_gethostbyaddr_r_proto=define
14773 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14777 case "$d_gethostbyaddr_r_proto" in
14779 case "$gethostbyaddr_r_proto" in
14780 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14781 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14783 case "$gethostbyaddr_r_proto" in
14784 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14785 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14787 case "$gethostbyaddr_r_proto" in
14788 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14789 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14791 case "$gethostbyaddr_r_proto" in
14792 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14793 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14795 case "$gethostbyaddr_r_proto" in
14796 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14797 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14799 case "$gethostbyaddr_r_proto" in
14800 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14801 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14803 case "$gethostbyaddr_r_proto" in
14804 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14805 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14807 case "$gethostbyaddr_r_proto" in
14808 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14809 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14811 case "$gethostbyaddr_r_proto" in
14812 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14813 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14815 case "$gethostbyaddr_r_proto" in
14816 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14817 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14819 case "$gethostbyaddr_r_proto" in
14820 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14821 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14823 case "$gethostbyaddr_r_proto" in
14824 ''|0) d_gethostbyaddr_r=undef
14825 gethostbyaddr_r_proto=0
14826 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14827 * ) case "$gethostbyaddr_r_proto" in
14828 REENTRANT_PROTO*) ;;
14829 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14831 echo "Prototype: $try" ;;
14834 *) case "$usethreads" in
14835 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14837 d_gethostbyaddr_r=undef
14838 gethostbyaddr_r_proto=0
14842 *) gethostbyaddr_r_proto=0
14846 : see if gethostbyname_r exists
14847 set gethostbyname_r d_gethostbyname_r
14849 case "$d_gethostbyname_r" in
14851 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14852 case "$d_gethostbyname_r_proto:$usethreads" in
14853 ":define") d_gethostbyname_r_proto=define
14854 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14858 case "$d_gethostbyname_r_proto" in
14860 case "$gethostbyname_r_proto" in
14861 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14862 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14864 case "$gethostbyname_r_proto" in
14865 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14866 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14868 case "$gethostbyname_r_proto" in
14869 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14870 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14872 case "$gethostbyname_r_proto" in
14873 ''|0) d_gethostbyname_r=undef
14874 gethostbyname_r_proto=0
14875 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14876 * ) case "$gethostbyname_r_proto" in
14877 REENTRANT_PROTO*) ;;
14878 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14880 echo "Prototype: $try" ;;
14883 *) case "$usethreads" in
14884 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14886 d_gethostbyname_r=undef
14887 gethostbyname_r_proto=0
14891 *) gethostbyname_r_proto=0
14895 : see if gethostent_r exists
14896 set gethostent_r d_gethostent_r
14898 case "$d_gethostent_r" in
14900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14901 case "$d_gethostent_r_proto:$usethreads" in
14902 ":define") d_gethostent_r_proto=define
14903 set d_gethostent_r_proto gethostent_r $hdrs
14907 case "$d_gethostent_r_proto" in
14909 case "$gethostent_r_proto" in
14910 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14911 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14913 case "$gethostent_r_proto" in
14914 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14915 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14917 case "$gethostent_r_proto" in
14918 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14919 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14921 case "$gethostent_r_proto" in
14922 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14923 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14925 case "$gethostent_r_proto" in
14926 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14927 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14929 case "$gethostent_r_proto" in
14930 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14931 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14933 case "$gethostent_r_proto" in
14934 ''|0) d_gethostent_r=undef
14935 gethostent_r_proto=0
14936 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14937 * ) case "$gethostent_r_proto" in
14938 REENTRANT_PROTO*) ;;
14939 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14941 echo "Prototype: $try" ;;
14944 *) case "$usethreads" in
14945 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14947 d_gethostent_r=undef
14948 gethostent_r_proto=0
14952 *) gethostent_r_proto=0
14956 : see if prototypes for various gethostxxx netdb.h functions are available
14958 set d_gethostprotos gethostent $i_netdb netdb.h
14961 : see if getitimer exists
14962 set getitimer d_getitimer
14965 : see if getlogin exists
14966 set getlogin d_getlogin
14969 : see if getlogin_r exists
14970 set getlogin_r d_getlogin_r
14972 case "$d_getlogin_r" in
14974 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14975 case "$d_getlogin_r_proto:$usethreads" in
14976 ":define") d_getlogin_r_proto=define
14977 set d_getlogin_r_proto getlogin_r $hdrs
14981 case "$d_getlogin_r_proto" in
14983 case "$getlogin_r_proto" in
14984 ''|0) try='int getlogin_r(char*, size_t);'
14985 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14987 case "$getlogin_r_proto" in
14988 ''|0) try='int getlogin_r(char*, int);'
14989 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14991 case "$getlogin_r_proto" in
14992 ''|0) try='char* getlogin_r(char*, size_t);'
14993 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14995 case "$getlogin_r_proto" in
14996 ''|0) try='char* getlogin_r(char*, int);'
14997 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14999 case "$getlogin_r_proto" in
15000 ''|0) d_getlogin_r=undef
15002 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
15003 * ) case "$getlogin_r_proto" in
15004 REENTRANT_PROTO*) ;;
15005 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
15007 echo "Prototype: $try" ;;
15010 *) case "$usethreads" in
15011 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
15018 *) getlogin_r_proto=0
15022 : see if getmnt exists
15023 set getmnt d_getmnt
15026 : see if getmntent exists
15027 set getmntent d_getmntent
15030 : see if getnameinfo exists
15031 set getnameinfo d_getnameinfo
15034 : see if getnetbyaddr exists
15035 set getnetbyaddr d_getnbyaddr
15038 : see if getnetbyname exists
15039 set getnetbyname d_getnbyname
15042 : see if getnetent exists
15043 set getnetent d_getnent
15046 : see if getnetbyaddr_r exists
15047 set getnetbyaddr_r d_getnetbyaddr_r
15049 case "$d_getnetbyaddr_r" in
15051 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15052 case "$d_getnetbyaddr_r_proto:$usethreads" in
15053 ":define") d_getnetbyaddr_r_proto=define
15054 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
15058 case "$d_getnetbyaddr_r_proto" in
15060 case "$getnetbyaddr_r_proto" in
15061 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
15062 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
15064 case "$getnetbyaddr_r_proto" in
15065 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
15066 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
15068 case "$getnetbyaddr_r_proto" in
15069 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
15070 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
15072 case "$getnetbyaddr_r_proto" in
15073 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
15074 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
15076 case "$getnetbyaddr_r_proto" in
15077 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
15078 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15080 case "$getnetbyaddr_r_proto" in
15081 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15082 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15084 case "$getnetbyaddr_r_proto" in
15085 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15086 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15088 case "$getnetbyaddr_r_proto" in
15089 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15090 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15092 case "$getnetbyaddr_r_proto" in
15093 ''|0) d_getnetbyaddr_r=undef
15094 getnetbyaddr_r_proto=0
15095 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15096 * ) case "$getnetbyaddr_r_proto" in
15097 REENTRANT_PROTO*) ;;
15098 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15100 echo "Prototype: $try" ;;
15103 *) case "$usethreads" in
15104 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15106 d_getnetbyaddr_r=undef
15107 getnetbyaddr_r_proto=0
15111 *) getnetbyaddr_r_proto=0
15115 : see if getnetbyname_r exists
15116 set getnetbyname_r d_getnetbyname_r
15118 case "$d_getnetbyname_r" in
15120 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15121 case "$d_getnetbyname_r_proto:$usethreads" in
15122 ":define") d_getnetbyname_r_proto=define
15123 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15127 case "$d_getnetbyname_r_proto" in
15129 case "$getnetbyname_r_proto" in
15130 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15131 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15133 case "$getnetbyname_r_proto" in
15134 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15135 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15137 case "$getnetbyname_r_proto" in
15138 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15139 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15141 case "$getnetbyname_r_proto" in
15142 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15143 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15145 case "$getnetbyname_r_proto" in
15146 ''|0) d_getnetbyname_r=undef
15147 getnetbyname_r_proto=0
15148 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15149 * ) case "$getnetbyname_r_proto" in
15150 REENTRANT_PROTO*) ;;
15151 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15153 echo "Prototype: $try" ;;
15156 *) case "$usethreads" in
15157 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15159 d_getnetbyname_r=undef
15160 getnetbyname_r_proto=0
15164 *) getnetbyname_r_proto=0
15168 : see if getnetent_r exists
15169 set getnetent_r d_getnetent_r
15171 case "$d_getnetent_r" in
15173 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15174 case "$d_getnetent_r_proto:$usethreads" in
15175 ":define") d_getnetent_r_proto=define
15176 set d_getnetent_r_proto getnetent_r $hdrs
15180 case "$d_getnetent_r_proto" in
15182 case "$getnetent_r_proto" in
15183 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15184 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15186 case "$getnetent_r_proto" in
15187 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15188 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15190 case "$getnetent_r_proto" in
15191 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15192 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15194 case "$getnetent_r_proto" in
15195 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15196 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15198 case "$getnetent_r_proto" in
15199 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15200 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15202 case "$getnetent_r_proto" in
15203 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15204 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15206 case "$getnetent_r_proto" in
15207 ''|0) d_getnetent_r=undef
15208 getnetent_r_proto=0
15209 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15210 * ) case "$getnetent_r_proto" in
15211 REENTRANT_PROTO*) ;;
15212 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15214 echo "Prototype: $try" ;;
15217 *) case "$usethreads" in
15218 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15220 d_getnetent_r=undef
15221 getnetent_r_proto=0
15225 *) getnetent_r_proto=0
15229 : see if prototypes for various getnetxxx netdb.h functions are available
15231 set d_getnetprotos getnetent $i_netdb netdb.h
15234 : see if getpagesize exists
15235 set getpagesize d_getpagsz
15238 : Optional checks for getprotobyname and getprotobynumber
15240 : see if getprotobyname exists
15241 set getprotobyname d_getpbyname
15244 : see if getprotobynumber exists
15245 set getprotobynumber d_getpbynumber
15248 : see if getprotoent exists
15249 set getprotoent d_getpent
15252 : see if getpgid exists
15253 set getpgid d_getpgid
15256 : see if getpgrp2 exists
15257 set getpgrp2 d_getpgrp2
15260 : see if getppid exists
15261 set getppid d_getppid
15264 : see if getpriority exists
15265 set getpriority d_getprior
15268 : see if getprotobyname_r exists
15269 set getprotobyname_r d_getprotobyname_r
15271 case "$d_getprotobyname_r" in
15273 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15274 case "$d_getprotobyname_r_proto:$usethreads" in
15275 ":define") d_getprotobyname_r_proto=define
15276 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15280 case "$d_getprotobyname_r_proto" in
15282 case "$getprotobyname_r_proto" in
15283 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15284 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15286 case "$getprotobyname_r_proto" in
15287 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15288 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15290 case "$getprotobyname_r_proto" in
15291 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15292 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15294 case "$getprotobyname_r_proto" in
15295 ''|0) d_getprotobyname_r=undef
15296 getprotobyname_r_proto=0
15297 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15298 * ) case "$getprotobyname_r_proto" in
15299 REENTRANT_PROTO*) ;;
15300 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15302 echo "Prototype: $try" ;;
15305 *) case "$usethreads" in
15306 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15308 d_getprotobyname_r=undef
15309 getprotobyname_r_proto=0
15313 *) getprotobyname_r_proto=0
15317 : see if getprotobynumber_r exists
15318 set getprotobynumber_r d_getprotobynumber_r
15320 case "$d_getprotobynumber_r" in
15322 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15323 case "$d_getprotobynumber_r_proto:$usethreads" in
15324 ":define") d_getprotobynumber_r_proto=define
15325 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15329 case "$d_getprotobynumber_r_proto" in
15331 case "$getprotobynumber_r_proto" in
15332 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15333 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15335 case "$getprotobynumber_r_proto" in
15336 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15337 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15339 case "$getprotobynumber_r_proto" in
15340 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15341 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15343 case "$getprotobynumber_r_proto" in
15344 ''|0) d_getprotobynumber_r=undef
15345 getprotobynumber_r_proto=0
15346 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15347 * ) case "$getprotobynumber_r_proto" in
15348 REENTRANT_PROTO*) ;;
15349 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15351 echo "Prototype: $try" ;;
15354 *) case "$usethreads" in
15355 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15357 d_getprotobynumber_r=undef
15358 getprotobynumber_r_proto=0
15362 *) getprotobynumber_r_proto=0
15366 : see if getprotoent_r exists
15367 set getprotoent_r d_getprotoent_r
15369 case "$d_getprotoent_r" in
15371 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15372 case "$d_getprotoent_r_proto:$usethreads" in
15373 ":define") d_getprotoent_r_proto=define
15374 set d_getprotoent_r_proto getprotoent_r $hdrs
15378 case "$d_getprotoent_r_proto" in
15380 case "$getprotoent_r_proto" in
15381 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15382 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15384 case "$getprotoent_r_proto" in
15385 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15386 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15388 case "$getprotoent_r_proto" in
15389 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15390 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15392 case "$getprotoent_r_proto" in
15393 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15394 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15396 case "$getprotoent_r_proto" in
15397 ''|0) d_getprotoent_r=undef
15398 getprotoent_r_proto=0
15399 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15400 * ) case "$getprotoent_r_proto" in
15401 REENTRANT_PROTO*) ;;
15402 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15404 echo "Prototype: $try" ;;
15407 *) case "$usethreads" in
15408 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15410 d_getprotoent_r=undef
15411 getprotoent_r_proto=0
15415 *) getprotoent_r_proto=0
15419 : see if prototypes for various getprotoxxx netdb.h functions are available
15421 set d_getprotoprotos getprotoent $i_netdb netdb.h
15424 : see if getprpwnam exists
15425 set getprpwnam d_getprpwnam
15428 : see if getpwent exists
15429 set getpwent d_getpwent
15432 : see if getpwent_r exists
15433 set getpwent_r d_getpwent_r
15435 case "$d_getpwent_r" in
15437 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15438 case "$d_getpwent_r_proto:$usethreads" in
15439 ":define") d_getpwent_r_proto=define
15440 set d_getpwent_r_proto getpwent_r $hdrs
15444 case "$d_getpwent_r_proto" in
15446 case "$getpwent_r_proto" in
15447 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15448 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15450 case "$getpwent_r_proto" in
15451 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15452 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15454 case "$getpwent_r_proto" in
15455 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15456 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15458 case "$getpwent_r_proto" in
15459 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15460 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15462 case "$getpwent_r_proto" in
15463 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15464 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15466 case "$getpwent_r_proto" in
15467 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15468 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15470 case "$getpwent_r_proto" in
15471 ''|0) d_getpwent_r=undef
15473 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15474 * ) case "$getpwent_r_proto" in
15475 REENTRANT_PROTO*) ;;
15476 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15478 echo "Prototype: $try" ;;
15481 *) case "$usethreads" in
15482 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15489 *) getpwent_r_proto=0
15493 : see if getpwnam_r exists
15494 set getpwnam_r d_getpwnam_r
15496 case "$d_getpwnam_r" in
15498 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15499 case "$d_getpwnam_r_proto:$usethreads" in
15500 ":define") d_getpwnam_r_proto=define
15501 set d_getpwnam_r_proto getpwnam_r $hdrs
15505 case "$d_getpwnam_r_proto" in
15507 case "$getpwnam_r_proto" in
15508 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15509 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15511 case "$getpwnam_r_proto" in
15512 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15513 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15515 case "$getpwnam_r_proto" in
15516 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15517 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15519 case "$getpwnam_r_proto" in
15520 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15521 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15523 case "$getpwnam_r_proto" in
15524 ''|0) d_getpwnam_r=undef
15526 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15527 * ) case "$getpwnam_r_proto" in
15528 REENTRANT_PROTO*) ;;
15529 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15531 echo "Prototype: $try" ;;
15534 *) case "$usethreads" in
15535 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15542 *) getpwnam_r_proto=0
15546 : see if getpwuid_r exists
15547 set getpwuid_r d_getpwuid_r
15549 case "$d_getpwuid_r" in
15551 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15552 case "$d_getpwuid_r_proto:$usethreads" in
15553 ":define") d_getpwuid_r_proto=define
15554 set d_getpwuid_r_proto getpwuid_r $hdrs
15558 case "$d_getpwuid_r_proto" in
15560 case "$getpwuid_r_proto" in
15561 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15562 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15564 case "$getpwuid_r_proto" in
15565 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15566 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15568 case "$getpwuid_r_proto" in
15569 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15570 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15572 case "$getpwuid_r_proto" in
15573 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15574 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15576 case "$getpwuid_r_proto" in
15577 ''|0) d_getpwuid_r=undef
15579 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15580 * ) case "$getpwuid_r_proto" in
15581 REENTRANT_PROTO*) ;;
15582 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15584 echo "Prototype: $try" ;;
15587 *) case "$usethreads" in
15588 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15595 *) getpwuid_r_proto=0
15599 : Optional checks for getsbyname and getsbyport
15601 : see if getservbyname exists
15602 set getservbyname d_getsbyname
15605 : see if getservbyport exists
15606 set getservbyport d_getsbyport
15609 : see if getservent exists
15610 set getservent d_getsent
15613 : see if getservbyname_r exists
15614 set getservbyname_r d_getservbyname_r
15616 case "$d_getservbyname_r" in
15618 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15619 case "$d_getservbyname_r_proto:$usethreads" in
15620 ":define") d_getservbyname_r_proto=define
15621 set d_getservbyname_r_proto getservbyname_r $hdrs
15625 case "$d_getservbyname_r_proto" in
15627 case "$getservbyname_r_proto" in
15628 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15629 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15631 case "$getservbyname_r_proto" in
15632 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15633 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15635 case "$getservbyname_r_proto" in
15636 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15637 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15639 case "$getservbyname_r_proto" in
15640 ''|0) d_getservbyname_r=undef
15641 getservbyname_r_proto=0
15642 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15643 * ) case "$getservbyname_r_proto" in
15644 REENTRANT_PROTO*) ;;
15645 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15647 echo "Prototype: $try" ;;
15650 *) case "$usethreads" in
15651 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15653 d_getservbyname_r=undef
15654 getservbyname_r_proto=0
15658 *) getservbyname_r_proto=0
15662 : see if getservbyport_r exists
15663 set getservbyport_r d_getservbyport_r
15665 case "$d_getservbyport_r" in
15667 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15668 case "$d_getservbyport_r_proto:$usethreads" in
15669 ":define") d_getservbyport_r_proto=define
15670 set d_getservbyport_r_proto getservbyport_r $hdrs
15674 case "$d_getservbyport_r_proto" in
15676 case "$getservbyport_r_proto" in
15677 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15678 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15680 case "$getservbyport_r_proto" in
15681 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15682 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15684 case "$getservbyport_r_proto" in
15685 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15686 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15688 case "$getservbyport_r_proto" in
15689 ''|0) d_getservbyport_r=undef
15690 getservbyport_r_proto=0
15691 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15692 * ) case "$getservbyport_r_proto" in
15693 REENTRANT_PROTO*) ;;
15694 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15696 echo "Prototype: $try" ;;
15699 *) case "$usethreads" in
15700 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15702 d_getservbyport_r=undef
15703 getservbyport_r_proto=0
15707 *) getservbyport_r_proto=0
15711 : see if getservent_r exists
15712 set getservent_r d_getservent_r
15714 case "$d_getservent_r" in
15716 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15717 case "$d_getservent_r_proto:$usethreads" in
15718 ":define") d_getservent_r_proto=define
15719 set d_getservent_r_proto getservent_r $hdrs
15723 case "$d_getservent_r_proto" in
15725 case "$getservent_r_proto" in
15726 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15727 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15729 case "$getservent_r_proto" in
15730 ''|0) try='int getservent_r(struct servent*, char*, int);'
15731 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15733 case "$getservent_r_proto" in
15734 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15735 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15737 case "$getservent_r_proto" in
15738 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15739 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15741 case "$getservent_r_proto" in
15742 ''|0) d_getservent_r=undef
15743 getservent_r_proto=0
15744 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15745 * ) case "$getservent_r_proto" in
15746 REENTRANT_PROTO*) ;;
15747 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15749 echo "Prototype: $try" ;;
15752 *) case "$usethreads" in
15753 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15755 d_getservent_r=undef
15756 getservent_r_proto=0
15760 *) getservent_r_proto=0
15764 : see if prototypes for various getservxxx netdb.h functions are available
15766 set d_getservprotos getservent $i_netdb netdb.h
15769 : see if getspnam exists
15770 set getspnam d_getspnam
15773 : see if this is a shadow.h system
15774 set shadow.h i_shadow
15777 : see if getspnam_r exists
15778 set getspnam_r d_getspnam_r
15780 case "$d_getspnam_r" in
15782 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15783 case "$d_getspnam_r_proto:$usethreads" in
15784 ":define") d_getspnam_r_proto=define
15785 set d_getspnam_r_proto getspnam_r $hdrs
15789 case "$d_getspnam_r_proto" in
15791 case "$getspnam_r_proto" in
15792 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15793 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15795 case "$getspnam_r_proto" in
15796 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15797 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15799 case "$getspnam_r_proto" in
15800 ''|0) d_getspnam_r=undef
15802 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15803 * ) case "$getspnam_r_proto" in
15804 REENTRANT_PROTO*) ;;
15805 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15807 echo "Prototype: $try" ;;
15810 *) case "$usethreads" in
15811 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15818 *) getspnam_r_proto=0
15822 : see if gettimeofday or ftime exists
15823 set gettimeofday d_gettimeod
15825 case "$d_gettimeod" in
15831 val="$undef"; set d_ftime; eval $setvar
15834 case "$d_gettimeod$d_ftime" in
15837 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15841 : see if gmtime_r exists
15842 set gmtime_r d_gmtime_r
15844 case "$d_gmtime_r" in
15846 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15847 case "$d_gmtime_r_proto:$usethreads" in
15848 ":define") d_gmtime_r_proto=define
15849 set d_gmtime_r_proto gmtime_r $hdrs
15853 case "$d_gmtime_r_proto" in
15855 case "$gmtime_r_proto" in
15856 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15857 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15859 case "$gmtime_r_proto" in
15860 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15861 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15863 case "$gmtime_r_proto" in
15864 ''|0) d_gmtime_r=undef
15866 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15867 * ) case "$gmtime_r_proto" in
15868 REENTRANT_PROTO*) ;;
15869 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15871 echo "Prototype: $try" ;;
15874 *) case "$usethreads" in
15875 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15882 *) gmtime_r_proto=0
15886 : see if hasmntopt exists
15887 set hasmntopt d_hasmntopt
15890 : see if this is a netinet/in.h or sys/in.h system
15891 set netinet/in.h i_niin sys/in.h i_sysin
15894 : see if arpa/inet.h has to be included
15895 set arpa/inet.h i_arpainet
15898 : see if htonl --and friends-- exists
15903 : Maybe they are macros.
15906 $cat >htonl.c <<EOM
15908 #include <sys/types.h>
15909 #$i_niin I_NETINET_IN
15911 #$i_arpainet I_ARPA_INET
15912 #ifdef I_NETINET_IN
15913 #include <netinet/in.h>
15916 #include <sys/in.h>
15919 #include <arpa/inet.h>
15922 printf("Defined as a macro.");
15925 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15926 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15928 echo "But it seems to be defined as a macro." >&4
15936 : see if hypot exists
15940 : see if ilogb exists
15944 : see if ilogbl exists
15945 set ilogbl d_ilogbl
15948 : check whether inet_aton exists
15949 set inet_aton d_inetaton
15952 : see if inet_ntop exists
15953 set inet_ntop d_inetntop
15956 : see if inet_pton exists
15957 set inet_pton d_inetpton
15962 $cat >isascii.c <<EOCP
15965 #$i_stdlib I_STDLIB
15967 #include <stdlib.h>
15978 if eval $compile; then
15979 echo "isascii() found." >&4
15982 echo "isascii() NOT found." >&4
15991 $cat >isblank.c <<'EOCP'
16002 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
16003 echo "isblank() found." >&4
16006 echo "isblank() NOT found." >&4
16013 : check for isfinite
16014 echo "Checking to see if you have isfinite..." >&4
16017 int main() { return isfinite(0.0); }
16020 if eval $compile; then
16022 echo "You have isfinite."
16025 echo "You do not have isfinite."
16031 : see if isfinitel exists
16032 set isfinitel d_isfinitel
16036 echo "Checking to see if you have isinf..." >&4
16039 int main() { return isinf(0.0); }
16042 if eval $compile; then
16044 echo "You have isinf."
16047 echo "You do not have isinf."
16053 : see if isinfl exists
16054 set isinfl d_isinfl
16058 echo "Checking to see if you have isless..." >&4
16061 int main() { return isless(2.0, 1.0); }
16064 if eval $compile; then
16066 echo "You have isless."
16069 echo "You do not have isless."
16076 echo "Checking to see if you have isnan..." >&4
16079 int main() { return isnan(0.0); }
16082 if eval $compile; then
16084 echo "You have isnan."
16087 echo "You do not have isnan."
16093 : see if isnanl exists
16094 set isnanl d_isnanl
16097 : check for isnormal
16098 echo "Checking to see if you have isnormal..." >&4
16101 int main() { return isnormal(0.0); }
16104 if eval $compile; then
16106 echo "You have isnormal."
16109 echo "You do not have isnormal."
16119 : see if j0l exists
16123 : see if killpg exists
16124 set killpg d_killpg
16127 : see if localeconv exists
16128 set localeconv d_locconv
16131 : see if libc has the POSIX.1-2008 currency locale rules
16132 case "$d_locconv:$d_lc_monetary_2008" in
16135 #include <locale.h>
16137 struct lconv *lc = localeconv();
16138 char int_p_cs_precedes = lc->int_p_cs_precedes;
16143 if eval $compile; then
16144 d_lc_monetary_2008="$define"
16146 d_lc_monetary_2008="$undef"
16152 : see if lchown exists
16154 $cat > try.c <<EOCP
16157 #include <stdlib.h>
16158 #$i_unistd I_UNISTD
16160 # include <unistd.h>
16162 int main(int argc, char *argv[])
16164 if (lchown("./try.c", -1, getgid()) == -1) {
16165 exit(EXIT_FAILURE);
16167 exit(EXIT_SUCCESS);
16171 if eval $compile && ./try; then
16172 $echo "lchown() found." >&4
16175 $echo "lchown() NOT found." >&4
16182 : See if number of significant digits in a double precision number is known
16184 $cat >ldbl_dig.c <<EOM
16185 #include <limits.h>
16188 printf("Contains LDBL_DIG");
16191 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16192 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16193 echo "LDBL_DIG found." >&4
16196 echo "LDBL_DIG NOT found." >&4
16203 : see if lgamma exists
16204 set lgamma d_lgamma
16207 : see if lgamma_r exists
16208 set lgamma_r d_lgamma_r
16211 : check to see if math.h defines _LIB_VERSION
16212 d_libm_lib_version="$undef"
16214 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16216 #include <unistd.h>
16218 int main (int argc, char *argv[])
16220 printf ("%d\n", _LIB_VERSION);
16225 if eval $compile; then
16227 echo "Yes, it does ($foo)" >&4
16228 d_libm_lib_version="$define"
16230 echo "No, it does not (probably harmless)" >&4
16234 : see if link exists
16238 : see if llrint exists
16239 set llrint d_llrint
16242 : see if llrintl exists
16243 set llrintl d_llrintl
16246 : see if llround exists
16247 set llround d_llround
16250 : see if llroundl exists
16251 set llroundl d_llroundl
16254 : see if localtime_r exists
16255 set localtime_r d_localtime_r
16257 case "$d_localtime_r" in
16259 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16260 case "$d_localtime_r_proto:$usethreads" in
16261 ":define") d_localtime_r_proto=define
16262 set d_localtime_r_proto localtime_r $hdrs
16266 case "$d_localtime_r_proto" in
16268 case "$localtime_r_proto" in
16269 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16270 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16272 case "$localtime_r_proto" in
16273 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16274 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16276 case "$localtime_r_proto" in
16277 ''|0) d_localtime_r=undef
16278 localtime_r_proto=0
16279 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16280 * ) case "$localtime_r_proto" in
16281 REENTRANT_PROTO*) ;;
16282 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16284 echo "Prototype: $try" ;;
16287 *) case "$usethreads" in
16288 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16290 d_localtime_r=undef
16291 localtime_r_proto=0
16295 *) localtime_r_proto=0
16299 : see if localtime_r calls tzset
16300 case "$localtime_r_proto" in
16303 /* Does our libc's localtime_r call tzset ?
16304 * return 0 if so, 1 otherwise.
16306 #$i_systypes I_SYS_TYPES
16307 #$i_unistd I_UNISTD
16309 #$i_stdlib I_STDLIB
16310 #$i_malloc I_MALLOC
16312 # include <sys/types.h>
16315 # include <unistd.h>
16321 #include <stdlib.h>
16323 #include <string.h>
16325 # include <malloc.h>
16330 time_t t = time(0L);
16331 char w_tz[]="TZ" "=GMT+5",
16332 e_tz[]="TZ" "=GMT-5",
16333 *tz_e = (char*)malloc(16),
16334 *tz_w = (char*)malloc(16);
16335 struct tm tm_e, tm_w;
16336 memset(&tm_e,'\0',sizeof(struct tm));
16337 memset(&tm_w,'\0',sizeof(struct tm));
16342 localtime_r(&t, &tm_e);
16345 localtime_r(&t, &tm_w);
16347 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16350 free(tz_e);free(tz_w);
16355 if eval $compile; then
16356 if $run ./try; then
16357 d_localtime_r_needs_tzset=undef;
16359 d_localtime_r_needs_tzset=define;
16362 d_localtime_r_needs_tzset=undef;
16366 d_localtime_r_needs_tzset=undef;
16371 : see if lockf exists
16375 : see if log1p exists
16379 : see if log2 exists
16383 : see if logb exists
16387 : see if lrint exists
16391 : see if lrintl exists
16392 set lrintl d_lrintl
16395 : see if lround exists
16396 set lround d_lround
16399 : see if lroundl exists
16400 set lroundl d_lroundl
16403 : see if prototype for lseek is available
16405 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16408 : see if lstat exists
16412 : see if madvise exists
16413 set madvise d_madvise
16416 : see if malloc_size exists
16417 set malloc_size d_malloc_size
16420 : see if malloc_size_good exists
16421 set malloc_good_size d_malloc_good_size
16424 : see if malloc_usable_size exists
16425 set malloc_usable_size d_malloc_usable_size
16428 : see if mblen exists
16432 : see if mbrlen exists
16433 set mbrlen d_mbrlen
16436 : see if mbrtowc exists
16437 set mbrtowc d_mbrtowc
16440 : see if mbstowcs exists
16441 set mbstowcs d_mbstowcs
16444 : see if mbtowc exists
16445 set mbtowc d_mbtowc
16448 : see if memmem exists
16449 : We need both a prototype in string.h and the symbol in libc.
16452 xx1="#$d_gnulibc HAS_GNULIBC"
16453 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16454 xx3='# define _GNU_SOURCE'
16456 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16458 case "$d_memmem_proto" in
16459 define) # see if memmem exists
16460 set memmem d_memmem
16469 : see if memrchr exists
16470 : We need both a prototype in string.h and the symbol in libc.
16473 xx1="#$d_gnulibc HAS_GNULIBC"
16474 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16475 xx3='# define _GNU_SOURCE'
16477 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16479 case "$d_memrchr_proto" in
16480 define) # see if memrchr exists
16481 set memrchr d_memrchr
16490 : see if mkdir exists
16494 : see if mkdtemp exists
16495 set mkdtemp d_mkdtemp
16498 : see if mkfifo exists
16499 set mkfifo d_mkfifo
16502 : see if mkostemp exists
16503 set mkostemp d_mkostemp
16506 : see if mkstemp exists
16507 set mkstemp d_mkstemp
16510 : see if mkstemps exists
16511 set mkstemps d_mkstemps
16514 : see if mktime exists
16515 set mktime d_mktime
16518 : see if sys/mman.h has to be included
16519 set sys/mman.h i_sysmman
16522 : see if mmap exists
16525 : see what shmat returns
16526 : default to something harmless
16528 case "$i_sysmman$d_mmap" in
16530 $cat >mmap.c <<'END'
16531 #include <sys/mman.h>
16534 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16539 echo "and it returns ($mmaptype)." >&4
16543 : see if sqrtl exists
16547 : see if scalbnl exists
16548 set scalbnl d_scalbnl
16551 : see if truncl exists
16552 set truncl d_truncl
16555 : see if modfl exists
16559 : see if prototype for modfl is available
16561 set d_modflproto modfl define math.h
16564 if $test "$uselongdouble" = "$define"; then
16566 if $test "$d_sqrtl" != "$define"; then
16567 message="$message sqrtl"
16569 if $test "$d_modfl" != "$define"; then
16570 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16571 echo "You have both truncl and copysignl, so I can emulate modfl."
16573 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16574 echo "You have both aintl and copysignl, so I can emulate modfl."
16576 message="$message modfl"
16580 if $test "$d_frexpl" != "$define"; then
16581 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16582 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16584 message="$message frexpl"
16587 if $test "$d_ldexpl" != "$define"; then
16588 message="$message ldexpl"
16591 if $test "$message" != ""; then
16594 *** You requested the use of long doubles but you do not seem to have
16595 *** the following mathematical functions needed for long double support:
16597 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16598 *** Cannot continue, aborting.
16606 : see if mprotect exists
16607 set mprotect d_mprotect
16610 : see if msgctl exists
16611 set msgctl d_msgctl
16614 : see if msgget exists
16615 set msgget d_msgget
16618 : see if msgsnd exists
16619 set msgsnd d_msgsnd
16622 : see if msgrcv exists
16623 set msgrcv d_msgrcv
16626 : see how much of the 'msg*(2)' library is present.
16629 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16630 *"$undef"*) h_msg=false;;
16634 case "`ipcs 2>&1`" in
16635 "SVID messages"*"not configured"*)
16636 echo "Your $osname does not have the msg*(2) configured." >&4
16639 set msgctl d_msgctl
16641 set msgget d_msgget
16643 set msgsnd d_msgsnd
16645 set msgrcv d_msgrcv
16651 : we could also check for sys/ipc.h ...
16652 if $h_msg && $test `./findhdr sys/msg.h`; then
16653 echo "You have the full msg*(2) library." >&4
16656 echo "You don't have the full msg*(2) library." >&4
16662 : Check for msghdr_s
16664 echo "Checking to see if your system supports struct msghdr..." >&4
16665 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16667 case "$d_msghdr_s" in
16668 "$define") echo "Yes, it does." ;;
16669 *) echo "No, it doesn't." ;;
16672 : see if msync exists
16676 : see if munmap exists
16677 set munmap d_munmap
16680 : see if nan exists
16684 : see if nanosleep exists
16685 set nanosleep d_nanosleep
16688 : see if nearbyint exists
16689 set nearbyint d_nearbyint
16692 : see if nextafter exists
16693 set nextafter d_nextafter
16696 : see if nexttoward exists
16697 set nexttoward d_nexttoward
16700 : see if nice exists
16704 : see if this is a langinfo.h system
16705 set langinfo.h i_langinfo
16708 : see if nl_langinfo exists
16709 set nl_langinfo d_nl_langinfo
16712 : see if locale.h is available
16713 set locale.h i_locale
16716 : check for nl_langinfo_l item
16719 Checking to see if you have nl_langinfo_l(), and that it is thread-safe
16722 #$i_stdlib I_STDLIB
16724 # include <stdlib.h>
16726 #include <string.h>
16727 #$i_langinfo I_LANGINFO
16729 # include <langinfo.h>
16731 #$i_pthread I_PTHREAD
16733 # include <pthread.h>
16735 #$i_locale I_LOCALE
16737 # include <locale.h>
16741 thread_start(void * arg)
16743 nl_langinfo(RADIXCHAR);
16747 char * main_buffer;
16748 char save_main_buffer[1000];
16749 pthread_t subthread;
16750 pthread_attr_t attr;
16752 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
16754 /* If too large for our generous allowance, just assume we don't have
16756 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
16760 strcpy(save_main_buffer, main_buffer);
16762 if (pthread_attr_init(&attr) != 0) {
16766 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
16770 if (pthread_join(subthread, NULL) != 0) {
16774 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
16777 case "$usethreads" in
16780 if eval $compile; then
16781 echo "Your system has nl_langinfo_l()..." >&4
16782 d_nl_langinfo_l="$define"
16783 echo "$d_nl_langinfo_l" >&4
16784 if $run ./try; then
16785 echo "and it is thread-safe (just as I'd hoped)." >&4
16786 d_thread_safe_nl_langinfo_l="$define"
16787 echo "$d_thread_safe_nl_langinfo_l" >&4
16789 echo "but it isn't thread-safe." >&4
16792 echo "your system does not have nl_langinfo_l()" >&4
16795 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
16797 if test X"$d_nl_langinfo_l" = X; then
16798 d_nl_langinfo_l="$undef"
16800 if test X"$d_thread_safe_nl_langinfo_l" = X; then
16801 d_thread_safe_nl_langinfo_l="$undef"
16805 : Look for non 'int'-sized bitfields
16806 case "$d_non_int_bitfields" in
16809 echo "Checking whether your compiler can handle struct bitfields that aren't 'int' or 'unsigned int' ..." >&4
16810 $cat >try.c <<'EOCP'
16813 unsigned char byte:1;
16814 unsigned short halfword:1;
16817 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16818 if $compiler_warning try.out >/dev/null 2>&1; then
16819 echo "Your C compiler doesn't support struct bitfields that aren't 'int' or 'unsigned int'." >&4
16822 echo "Your C compiler supports struct bitfields besides 'int' and 'unsigned int'." >&4
16826 echo "Your C compiler doesn't seem to understand struct bitfields that aren't 'int' or 'unsigned int' at all." >&4
16830 *) val="$d_non_int_bitfields" ;;
16832 set d_non_int_bitfields
16836 : see if this is a quadmath.h system
16837 set quadmath.h i_quadmath
16840 : Check basic sizes
16842 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16844 case "$use64bitint:$d_quad:$quadtype" in
16847 uvtype="$uquadtype"
16852 uvtype="unsigned long"
16858 case "$uselongdouble:$d_longdbl" in
16860 nvtype="long double"
16861 nvsize=$longdblsize
16868 case "$usequadmath:$i_quadmath" in
16870 nvtype="__float128"
16876 *** You requested the use of the quadmath library, but you
16877 *** do not seem to have the quadmath library installed.
16878 *** Cannot continue, aborting.
16884 define:*) $cat <<EOM >&4
16886 *** You requested the use of the quadmath library, but you
16887 *** do not seem to have the required header, <quadmath.h>.
16889 case "$gccversion" in
16892 *** Your gcc looks a bit old:
16898 *** You are not running a gcc.
16903 *** For the quadmath library you need at least gcc 4.6.
16904 *** Cannot continue, aborting.
16910 $echo "(IV will be "$ivtype", $ivsize bytes)"
16911 $echo "(UV will be "$uvtype", $uvsize bytes)"
16912 $echo "(NV will be "$nvtype", $nvsize bytes)"
16915 #$i_inttypes I_INTTYPES
16917 #include <inttypes.h>
16922 int8_t i = INT8_MAX;
16923 uint8_t u = UINT8_MAX;
16924 printf("int8_t\n");
16927 int16_t i = INT16_MAX;
16928 uint16_t u = UINT16_MAX;
16929 printf("int16_t\n");
16932 int32_t i = INT32_MAX;
16933 uint32_t u = UINT32_MAX;
16934 printf("int32_t\n");
16939 i8type="signed char"
16940 u8type="unsigned char"
16945 '') case "$shortsize" in
16947 u16type="unsigned short"
16955 '') set try -DINT16
16956 if eval $compile; then
16957 case "`$run ./try`" in
16969 '') if $test $shortsize -ge 2; then
16971 u16type="unsigned short"
16979 '') case "$longsize" in
16981 u32type="unsigned long"
16985 *) case "$intsize" in
16987 u32type="unsigned int"
16997 '') set try -DINT32
16998 if eval $compile; then
16999 case "`$run ./try`" in
17011 '') if $test $intsize -ge 4; then
17013 u32type="unsigned int"
17021 '') case "$d_quad:$quadtype" in
17023 i64type="$quadtype"
17024 u64type="$uquadtype"
17032 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
17035 #$i_stdlib I_STDLIB
17037 #include <stdlib.h>
17039 #$i_inttypes I_INTTYPES
17041 #include <inttypes.h>
17043 #include <sys/types.h>
17044 #include <signal.h>
17046 /* volatile so that the compiler has to store it out to memory */
17047 volatile int bletched = 0;
17048 $signal_t blech(int s) { bletched = 1; }
17053 int n = 8 * $uvsize;
17056 signal(SIGFPE, blech);
17059 for (i = 0; i < n; i++) {
17060 u = u << 1 | ($uvtype)1;
17062 if (($uvtype)d != u)
17066 d = ($nvtype)(u - 1);
17067 if (($uvtype)d != (u - 1))
17074 printf("%d\n", ((i == n) ? -n : i));
17080 d_nv_preserves_uv="$undef"
17081 if eval $compile; then
17082 nv_preserves_uv_bits="`$run ./try`"
17084 case "$nv_preserves_uv_bits" in
17086 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
17087 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." >&4
17088 d_nv_preserves_uv="$define"
17090 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." >&4
17091 d_nv_preserves_uv="$undef" ;;
17092 *) $echo "Can't figure out how many bits your NVs preserve." >&4
17093 nv_preserves_uv_bits="0" ;;
17097 $echo "Checking to find the largest integer value your NVs can hold..." >&4
17101 typedef $nvtype NV;
17108 while(count < 256) {
17109 /* volatile so that the compiler has to store it out to memory */
17110 volatile NV up = value + 1.0;
17111 volatile NV negated = -value;
17112 volatile NV down = negated - 1.0;
17113 volatile NV got_up = up - value;
17114 int up_good = got_up == 1.0;
17115 int got_down = down - negated;
17116 int down_good = got_down == -1.0;
17118 if (down_good != up_good) {
17120 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
17121 up_good, (double) got_up, down_good, (double) got_down,
17122 count, (double) value);
17129 fputs("256.0", stdout);
17132 fputs("2.0", stdout);
17138 fputs("*", stdout);
17144 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17145 count, (double) value);
17151 nv_overflows_integers_at='0'
17152 if eval $compile; then
17158 The largest integer your NVs can preserve is equal to $xxx
17160 nv_overflows_integers_at="$xxx"
17163 Cannot determine the largest integer value your NVs can hold, unexpected output
17170 Cannot determine the largest integer value your NVs can hold
17177 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17180 #$i_stdlib I_STDLIB
17182 #include <stdlib.h>
17184 #include <string.h>
17185 #include <sys/types.h>
17186 #include <signal.h>
17188 /* volatile so that the compiler has to store it out to memory */
17189 volatile int bletched = 0;
17190 $signal_t blech(int s) { bletched = 1; }
17193 int checkit($nvtype d, const char *where) {
17195 unsigned char *p = (unsigned char *)v;
17196 unsigned char *end = p + sizeof(d);
17205 p = (unsigned char *)v;
17206 printf("No - %s: 0x", where);
17208 printf ("%02X", *p++);
17213 int main(int argc, char **argv) {
17216 fail += checkit(d, "0.0");
17218 /* The compiler shouldn't be assuming that bletched is 0 */
17221 fail += checkit(d, "bleched");
17224 signal(SIGFPE, blech);
17227 /* Paranoia - the compiler should have no way of knowing that ANSI says
17228 that argv[argc] will always be NULL. Actually, if it did assume this it
17229 would be buggy, as this is C and main() can be called from elsewhere in
17231 d = argv[argc] ? 1 : 0;
17234 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17237 fail += checkit(d, "ternary");
17239 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17242 printf("No - memset doesn't give 0.0\n");
17243 /* This might just blow up: */
17244 printf("(gives %g)\n", d);
17250 printf("No - something bleched\n");
17255 printf("No - %d fail(s)\n", fail);
17264 d_nv_zero_is_allbits_zero="$undef"
17265 if eval $compile; then
17271 0.0 is represented as all bits zero in memory
17273 d_nv_zero_is_allbits_zero="$define"
17276 0.0 is not represented as all bits zero in memory
17278 d_nv_zero_is_allbits_zero="$undef"
17283 0.0 is not represented as all bits zero in memory
17285 d_nv_zero_is_allbits_zero="$undef"
17291 : check for off64_t
17293 echo "Checking to see if you have off64_t..." >&4
17295 #include <sys/types.h>
17296 #include <unistd.h>
17297 int main() { off64_t x = 7; }
17300 if eval $compile; then
17302 echo "You have off64_t."
17305 echo "You do not have off64_t."
17306 case "$lseeksize" in
17307 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17314 : how to create joinable pthreads
17315 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17317 echo "Checking what constant to use for creating joinable pthreads..." >&4
17318 $cat >try.c <<'EOCP'
17319 #include <pthread.h>
17321 int detachstate = JOINABLE;
17324 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17325 if eval $compile; then
17326 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17327 val="$undef" # Yes, undef.
17328 set d_old_pthread_create_joinable
17331 set old_pthread_create_joinable
17334 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17335 if eval $compile; then
17336 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17338 set d_old_pthread_create_joinable
17340 val=PTHREAD_CREATE_UNDETACHED
17341 set old_pthread_create_joinable
17344 set try -DJOINABLE=__UNDETACHED
17345 if eval $compile; then
17346 echo "You seem to use __UNDETACHED." >&4
17348 set d_old_pthread_create_joinable
17351 set old_pthread_create_joinable
17354 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17356 set d_old_pthread_create_joinable
17359 set old_pthread_create_joinable
17366 d_old_pthread_create_joinable="$undef"
17367 old_pthread_create_joinable=""
17370 : see if pause exists
17374 : see if pipe2 exists
17378 : see if poll exists
17382 : see if prctl exists
17386 : see if prctl supports PR_SET_NAME
17387 d_prctl_set_name=$undef
17392 #include <unistd.h>
17394 #include <sys/prctl.h>
17396 int main (int argc, char *argv[])
17398 return (prctl (PR_SET_NAME, "Test"));
17402 if eval $compile_ok && $run ./try; then
17403 echo "Your prctl (PR_SET_NAME, ...) works"
17404 d_prctl_set_name=$define
17410 : see if readlink exists
17411 set readlink d_readlink
17414 : Check if there is a /proc symlink to the abs path of
17415 : the executing program. We will honor hints of d_procselfexe=$undef
17416 : or procselfexe being non-empty, otherwise will try to determine both
17417 : if we have readlink.
17418 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17419 : referenced, and AmigaOS does not have a proc filesystem anyway.
17422 if $test "X$d_procselfexe" = Xundef; then
17424 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17426 elif $test "X$d_readlink" = Xdefine; then
17427 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17428 : and it feels more tidy to avoid an extra level of symlink
17429 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17430 while test $# -gt 0; do
17433 if $issymlink $try; then
17434 $ls -l $try > reflect
17435 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17436 echo "You have $type-like $try."
17437 procselfexe='"'$try'"'
17439 : This will break out of the loop
17449 : backward compatibility for d_hvfork
17450 if test X$d_hvfork != X; then
17451 d_vfork="$d_hvfork"
17454 : see if there is a vfork
17459 d_pseudofork=$undef
17461 : Ok, but do we want to use it. vfork is reportedly unreliable in
17462 : perl on Solaris 2.x, and probably elsewhere.
17466 case "$usevfork" in
17472 Perl can only use a vfork() that doesn't suffer from strict
17473 restrictions on calling functions or modifying global data in
17474 the child. For example, glibc-2.1 contains such a vfork()
17475 that is unsuitable. If your system provides a proper fork()
17476 call, chances are that you do NOT want perl to use vfork().
17479 rp="Do you still want to use vfork()?"
17484 echo "Ok, we won't use vfork()."
17493 $define) usevfork='true';;
17494 *) usevfork='false';;
17497 : see whether the pthread_atfork exists
17499 #include <pthread.h>
17502 #ifdef PTHREAD_ATFORK
17503 pthread_atfork(NULL,NULL,NULL);
17508 : see if pthread_atfork exists
17509 set try -DPTHREAD_ATFORK
17510 if eval $compile; then
17515 case "$usethreads" in
17518 $define) echo 'pthread_atfork found.' >&4 ;;
17519 *) echo 'pthread_atfork NOT found.' >&4 ;;
17522 set d_pthread_atfork
17525 : see if pthread_attr_setscope exists
17526 set pthread_attr_setscope d_pthread_attr_setscope
17529 : see whether the various POSIXish _yields exist
17531 #include <pthread.h>
17537 #ifdef PTHREAD_YIELD
17540 #ifdef PTHREAD_YIELD_NULL
17541 pthread_yield(NULL);
17547 : see if sched_yield exists
17548 set try -DSCHED_YIELD
17549 if eval $compile; then
17551 sched_yield='sched_yield()'
17555 case "$usethreads" in
17558 $define) echo 'sched_yield() found.' >&4 ;;
17559 *) echo 'sched_yield() NOT found.' >&4 ;;
17565 : see if pthread_yield exists
17566 set try -DPTHREAD_YIELD
17567 if eval $compile; then
17569 case "$sched_yield" in
17570 '') sched_yield='pthread_yield()' ;;
17573 set try -DPTHREAD_YIELD_NULL
17574 if eval $compile; then
17576 case "$sched_yield" in
17577 '') sched_yield='pthread_yield(NULL)' ;;
17583 case "$usethreads" in
17586 $define) echo 'pthread_yield() found.' >&4 ;;
17587 *) echo 'pthread_yield() NOT found.' >&4 ;;
17591 set d_pthread_yield
17593 case "$sched_yield" in
17594 '') sched_yield=undef ;;
17598 : check for ptrdiff_t
17600 echo "Checking to see if you have ptrdiff_t..." >&4
17602 #include <stddef.h>
17603 int main() { ptrdiff_t x = 7; }
17606 if eval $compile; then
17608 echo "You have ptrdiff_t."
17611 echo "You do not have ptrdiff_t."
17617 : see if random_r exists
17618 set random_r d_random_r
17620 case "$d_random_r" in
17622 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17623 case "$d_random_r_proto:$usethreads" in
17624 ":define") d_random_r_proto=define
17625 set d_random_r_proto random_r $hdrs
17629 case "$d_random_r_proto" in
17631 case "$random_r_proto" in
17632 ''|0) try='int random_r(int*, struct random_data*);'
17633 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17635 case "$random_r_proto" in
17636 ''|0) try='int random_r(long*, struct random_data*);'
17637 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17639 case "$random_r_proto" in
17640 ''|0) try='int random_r(struct random_data*, int32_t*);'
17641 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17643 case "$random_r_proto" in
17644 ''|0) d_random_r=undef
17646 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17647 * ) case "$random_r_proto" in
17648 REENTRANT_PROTO*) ;;
17649 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17651 echo "Prototype: $try" ;;
17654 *) case "$usethreads" in
17655 define) echo "random_r has no prototype, not using it." >&4 ;;
17662 *) random_r_proto=0
17666 : see if readdir and friends exist
17667 set readdir d_readdir
17669 set seekdir d_seekdir
17671 set telldir d_telldir
17673 set rewinddir d_rewinddir
17676 : see if readdir64_r exists
17677 set readdir64_r d_readdir64_r
17679 case "$d_readdir64_r" in
17681 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17682 case "$d_readdir64_r_proto:$usethreads" in
17683 ":define") d_readdir64_r_proto=define
17684 set d_readdir64_r_proto readdir64_r $hdrs
17688 case "$d_readdir64_r_proto" in
17690 case "$readdir64_r_proto" in
17691 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17692 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17694 case "$readdir64_r_proto" in
17695 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17696 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17698 case "$readdir64_r_proto" in
17699 ''|0) d_readdir64_r=undef
17700 readdir64_r_proto=0
17701 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17702 * ) case "$readdir64_r_proto" in
17703 REENTRANT_PROTO*) ;;
17704 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17706 echo "Prototype: $try" ;;
17709 *) case "$usethreads" in
17710 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17712 d_readdir64_r=undef
17713 readdir64_r_proto=0
17717 *) readdir64_r_proto=0
17721 : see if readdir_r exists
17722 set readdir_r d_readdir_r
17724 case "$d_readdir_r" in
17726 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17727 case "$d_readdir_r_proto:$usethreads" in
17728 ":define") d_readdir_r_proto=define
17729 set d_readdir_r_proto readdir_r $hdrs
17733 case "$d_readdir_r_proto" in
17735 case "$readdir_r_proto" in
17736 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17737 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17739 case "$readdir_r_proto" in
17740 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17741 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17743 case "$readdir_r_proto" in
17744 ''|0) d_readdir_r=undef
17746 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17747 * ) case "$readdir_r_proto" in
17748 REENTRANT_PROTO*) ;;
17749 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17751 echo "Prototype: $try" ;;
17754 *) case "$usethreads" in
17755 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17762 *) readdir_r_proto=0
17766 : see if readv exists
17770 : see if recvmsg exists
17771 set recvmsg d_recvmsg
17774 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17776 if set regcomp val -f d_regcomp; eval $csym; $val; then
17777 echo 'regcomp() found.' >&4
17778 d_regcomp="$define"
17781 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17782 echo 'regcmp() found.' >&4
17786 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17787 echo 're_comp() found, assuming re_exec() also exists.' >&4
17788 d_re_comp="$define"
17793 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17800 : see if remainder exists
17801 set remainder d_remainder
17804 : see if remquo exists
17805 set remquo d_remquo
17808 : see if rename exists
17809 set rename d_rename
17812 : see if rint exists
17816 : see if rmdir exists
17820 : see if round exists
17824 : see if prototype for sbrk is available
17826 set d_sbrkproto sbrk $i_unistd unistd.h
17829 : see if scalbn exists
17830 set scalbn d_scalbn
17833 : see if select exists
17834 set select d_select
17837 : see if semctl exists
17838 set semctl d_semctl
17841 : see if semget exists
17842 set semget d_semget
17845 : see if semop exists
17849 : see how much of the 'sem*(2)' library is present.
17852 case "$d_semctl$d_semget$d_semop" in
17853 *"$undef"*) h_sem=false;;
17857 case "`ipcs 2>&1`" in
17858 "SVID messages"*"not configured"*)
17859 echo "Your $osname does not have the sem*(2) configured." >&4
17862 set semctl d_semctl
17864 set semget d_semget
17872 : we could also check for sys/ipc.h ...
17873 if $h_sem && $test `./findhdr sys/sem.h`; then
17874 echo "You have the full sem*(2) library." >&4
17877 echo "You don't have the full sem*(2) library." >&4
17883 : see whether sys/sem.h defines union semun
17885 $cat > try.c <<'END'
17886 #include <sys/types.h>
17887 #include <sys/ipc.h>
17888 #include <sys/sem.h>
17889 int main () { union semun semun; semun.buf = 0; }
17892 if eval $compile; then
17893 echo "You have union semun in <sys/sem.h>." >&4
17896 echo "You do not have union semun in <sys/sem.h>." >&4
17903 : see how to do semctl IPC_STAT
17907 $cat > tryh.h <<END
17910 # define S_IRUSR S_IREAD
17911 # define S_IWUSR S_IWRITE
17912 # define S_IXUSR S_IEXEC
17914 # define S_IRUSR 0400
17915 # define S_IWUSR 0200
17916 # define S_IXUSR 0100
17918 # define S_IRGRP (S_IRUSR>>3)
17919 # define S_IWGRP (S_IWUSR>>3)
17920 # define S_IXGRP (S_IXUSR>>3)
17921 # define S_IROTH (S_IRUSR>>6)
17922 # define S_IWOTH (S_IWUSR>>6)
17923 # define S_IXOTH (S_IXUSR>>6)
17926 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17927 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17928 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17931 : see whether semctl IPC_STAT can use union semun
17932 case "$d_semctl_semun" in
17936 #include <sys/types.h>
17937 #include <sys/ipc.h>
17938 #include <sys/sem.h>
17939 #include <sys/stat.h>
17946 #$d_union_semun HAS_UNION_SEMUN
17949 #ifndef HAS_UNION_SEMUN
17952 struct semid_ds *buf;
17953 unsigned short *array;
17959 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17960 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17962 struct semid_ds argbuf;
17965 st = semctl(sem, 0, IPC_STAT, arg);
17969 # endif /* IPC_STAT */
17970 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17972 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17973 # endif /* IPC_RMID */
17974 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17976 #endif /* IPC_PRIVATE && ... */
17977 printf("semget failed: errno = %d\n", errno);
17982 if eval $compile; then
17985 semun) val="$define" ;;
17993 case "$d_semctl_semun" in
17995 echo "You can use union semun for semctl IPC_STAT." >&4
17998 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18003 : see whether semctl IPC_STAT can use struct semid_ds pointer
18004 case "$d_semctl_semid_ds" in
18007 $cat > try.c <<'END'
18008 #include <sys/types.h>
18009 #include <sys/ipc.h>
18010 #include <sys/sem.h>
18011 #include <sys/stat.h>
18020 #ifndef HAS_UNION_SEMUN
18023 struct semid_ds *buf;
18024 unsigned short *array;
18028 struct semid_ds argbuf;
18031 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18032 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18036 st = semctl(sem, 0, IPC_STAT, arg);
18038 printf("semid_ds\n");
18040 # endif /* IPC_STAT */
18041 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18043 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18044 # endif /* IPC_RMID */
18045 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18047 #endif /* IPC_PRIVATE && ... */
18048 printf("semget failed: errno = %d\n", errno);
18054 if eval $compile; then
18057 semid_ds) val="$define" ;;
18061 set d_semctl_semid_ds
18065 case "$d_semctl_semid_ds" in
18067 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18069 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18075 # We do not have the full sem*(2) library, so assume we can not
18081 set d_semctl_semid_ds
18087 : see if sendmsg exists
18088 set sendmsg d_sendmsg
18091 : see if setegid exists
18092 set setegid d_setegid
18095 : see if setenv exists
18096 set setenv d_setenv
18099 : see if seteuid exists
18100 set seteuid d_seteuid
18103 : see if setgrent exists
18104 set setgrent d_setgrent
18107 : see if setgrent_r exists
18108 set setgrent_r d_setgrent_r
18110 case "$d_setgrent_r" in
18112 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18113 case "$d_setgrent_r_proto:$usethreads" in
18114 ":define") d_setgrent_r_proto=define
18115 set d_setgrent_r_proto setgrent_r $hdrs
18119 case "$d_setgrent_r_proto" in
18121 case "$setgrent_r_proto" in
18122 ''|0) try='int setgrent_r(FILE**);'
18123 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18125 case "$setgrent_r_proto" in
18126 ''|0) try='void setgrent_r(FILE**);'
18127 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18129 case "$setgrent_r_proto" in
18130 ''|0) d_setgrent_r=undef
18132 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18133 * ) case "$setgrent_r_proto" in
18134 REENTRANT_PROTO*) ;;
18135 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18137 echo "Prototype: $try" ;;
18140 *) case "$usethreads" in
18141 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18148 *) setgrent_r_proto=0
18152 : see if sethostent exists
18153 set sethostent d_sethent
18156 : see if sethostent_r exists
18157 set sethostent_r d_sethostent_r
18159 case "$d_sethostent_r" in
18161 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18162 case "$d_sethostent_r_proto:$usethreads" in
18163 ":define") d_sethostent_r_proto=define
18164 set d_sethostent_r_proto sethostent_r $hdrs
18168 case "$d_sethostent_r_proto" in
18170 case "$sethostent_r_proto" in
18171 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18172 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18174 case "$sethostent_r_proto" in
18175 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18176 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18178 case "$sethostent_r_proto" in
18179 ''|0) d_sethostent_r=undef
18180 sethostent_r_proto=0
18181 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18182 * ) case "$sethostent_r_proto" in
18183 REENTRANT_PROTO*) ;;
18184 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18186 echo "Prototype: $try" ;;
18189 *) case "$usethreads" in
18190 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18192 d_sethostent_r=undef
18193 sethostent_r_proto=0
18197 *) sethostent_r_proto=0
18201 : see if setitimer exists
18202 set setitimer d_setitimer
18205 : see if setlinebuf exists
18206 set setlinebuf d_setlinebuf
18209 : see if this system has wctype.h
18210 set wctype.h i_wctype
18213 : see if towupper exists
18214 set towupper d_towupper
18217 : check for setlocale function and behavior
18218 case "$d_setlocale" in
18222 Checking to see if you have setlocale() and its behavior
18225 #include <stdlib.h>
18226 #include <string.h>
18227 #$i_locale I_LOCALE
18229 # include <locale.h>
18231 #$i_wctype I_WCTYPE
18233 # include <wctype.h>
18237 const char * invalid_name = "\a"; /* This is really invalid! */
18238 int accepts_any_locale_name = 0;
18239 int has_C_UTF8 = 0;
18240 unsigned char bad_setlocale = 255;
18242 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
18243 * disabled. It's hard to imagine an instance where meaningful locale
18244 * handling could be done without LC_CTYPE */
18245 const char * name = setlocale(LC_CTYPE, "C");
18247 if (name == NULL || strcmp(name, "C") != 0) {
18248 exit(bad_setlocale);
18251 name = setlocale(LC_CTYPE, invalid_name);
18252 if (name != NULL) {
18254 /* Let it pass if it accepts the name but gives back one of the C
18256 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
18257 accepts_any_locale_name = 1;
18261 name = setlocale(LC_CTYPE, "C.UTF-8");
18262 if (name != NULL) {
18263 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
18265 #$d_towupper HAS_TOWUPPER
18266 #ifdef HAS_TOWUPPER
18268 /* We assume that if the machine doesn't have the C99 towupper, it
18269 * doesn't have C.UTF-8, even if we successfully changed locales to
18270 * include it. This seems safer even on platforms that didn't accept
18271 * the really invalid name */
18273 if (towupper(y_with_diaeresis) == 0x178) {
18283 /* Currently unused code to determine if LC_ALL with disparate values uses
18284 * category = value pairs or positional, and to determine the separator
18285 * between the categories. We could add code so that if the separator were
18286 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
18287 * every possible ASCII separator would fit in the 5 bits available in the
18288 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
18289 * positional, we probably would want to know the order of the categories.
18290 * Using a file between the C program and the shell script would really be
18291 * require to do that */
18294 unsigned char min_separator = ' ' - 1;
18295 unsigned char separator = min_separator;
18296 int uses_name_value_pair_names = 0;
18298 name = setlocale(LC_ALL, "C");
18299 if (name == NULL || strcmp(name, "C") != 0) {
18300 exit(bad_setlocale);
18306 name = setlocale(LC_CTYPE, "C.UTF-8");
18307 if (name == NULL) {
18308 exit(bad_setlocale);
18310 name = setlocale(LC_ALL, NULL);
18311 if (name == NULL) {
18312 exit(bad_setlocale);
18315 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
18317 uses_name_value_pair_names = 1;
18319 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
18322 separator = *(pos - 1);
18326 pos = strstr(name, "C.UTF-8");
18330 else if (pos == name) {
18331 separator = name[sizeof("C.UTF-8") - 1];
18334 separator = *(pos - 1);
18342 exit( 0 /* (separator - min_separator) << 3
18343 | uses_name_value_pair_names << 2
18346 | accepts_any_locale_name);
18353 case $d_setlocale in
18354 $undef) d_setlocale_accepts_any_locale_name="$undef"
18355 d_has_C_UTF8="false"
18358 if eval $compile; then
18359 echo "Your system has setlocale()..." >&4
18362 0) echo "and it seems sane; you don't have a C.UTF-8 locale" >&4
18363 d_setlocale="$define"
18364 d_setlocale_accepts_any_locale_name="$undef"
18365 d_has_C_UTF8="false"
18367 1) echo "and it seems sane, but accepts any locale name as valid" >&4
18368 d_setlocale="$define"
18369 d_setlocale_accepts_any_locale_name="$define"
18370 d_has_C_UTF8="false"
18372 2) echo "and it seems sane; you have a C.UTF-8 locale" >&4
18373 d_setlocale="$define"
18374 d_setlocale_accepts_any_locale_name="$undef"
18375 d_has_C_UTF8="true"
18377 3) echo "and it seems sane, but accepts any locale name as valid" >&4
18378 d_setlocale="$define"
18379 d_setlocale_accepts_any_locale_name="$define"
18380 d_has_C_UTF8="true"
18382 *) echo "but it doesn't seem to work, so we won't use it." >&4
18383 d_setlocale="$undef"
18384 d_setlocale_accepts_any_locale_name="$undef"
18385 d_has_C_UTF8="false"
18389 echo "your system does not have setlocale()" >&4
18390 d_setlocale="$undef"
18391 d_setlocale_accepts_any_locale_name="$undef"
18392 d_has_C_UTF8="false"
18397 *) val="$d_setlocale"
18400 case "$d_setlocale" in
18401 $undef) echo "There may be other ways to set the locale on your system, so we need to ask:" >&4
18404 rp="Does your system have the C.UTF-8 locale?"
18408 [Yy]*) d_has_C_UTF8="true"
18409 c_utf8_locale=" or C.UTF-8"
18411 *) d_has_C_UTF8="false"
18415 case "$d_setlocale" in
18417 rp="When you set your locale to something besides C$c_utf8_locale, does it do so, or just pretend to?" >&4
18422 d_setlocale_accepts_any_locale_name="$undef"
18424 *) d_setlocale_accepts_any_locale_name="$define"
18428 *) d_setlocale_accepts_any_locale_name="$undef"
18433 : see if setlocale_r exists
18434 set setlocale_r d_setlocale_r
18436 case "$d_setlocale_r" in
18438 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18439 case "$d_setlocale_r_proto:$usethreads" in
18440 ":define") d_setlocale_r_proto=define
18441 set d_setlocale_r_proto setlocale_r $hdrs
18445 case "$d_setlocale_r_proto" in
18447 case "$setlocale_r_proto" in
18448 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18449 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18451 case "$setlocale_r_proto" in
18452 ''|0) d_setlocale_r=undef
18453 setlocale_r_proto=0
18454 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18455 * ) case "$setlocale_r_proto" in
18456 REENTRANT_PROTO*) ;;
18457 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18459 echo "Prototype: $try" ;;
18462 *) case "$usethreads" in
18463 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18465 d_setlocale_r=undef
18466 setlocale_r_proto=0
18470 *) setlocale_r_proto=0
18474 : see if setnetent exists
18475 set setnetent d_setnent
18478 : see if setnetent_r exists
18479 set setnetent_r d_setnetent_r
18481 case "$d_setnetent_r" in
18483 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18484 case "$d_setnetent_r_proto:$usethreads" in
18485 ":define") d_setnetent_r_proto=define
18486 set d_setnetent_r_proto setnetent_r $hdrs
18490 case "$d_setnetent_r_proto" in
18492 case "$setnetent_r_proto" in
18493 ''|0) try='int setnetent_r(int, struct netent_data*);'
18494 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18496 case "$setnetent_r_proto" in
18497 ''|0) try='void setnetent_r(int, struct netent_data*);'
18498 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18500 case "$setnetent_r_proto" in
18501 ''|0) d_setnetent_r=undef
18502 setnetent_r_proto=0
18503 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18504 * ) case "$setnetent_r_proto" in
18505 REENTRANT_PROTO*) ;;
18506 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18508 echo "Prototype: $try" ;;
18511 *) case "$usethreads" in
18512 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18514 d_setnetent_r=undef
18515 setnetent_r_proto=0
18519 *) setnetent_r_proto=0
18523 : see if setprotoent exists
18524 set setprotoent d_setpent
18527 : see if setpgid exists
18528 set setpgid d_setpgid
18531 : see if setpgrp2 exists
18532 set setpgrp2 d_setpgrp2
18535 : see if setpriority exists
18536 set setpriority d_setprior
18539 : see if setproctitle exists
18540 set setproctitle d_setproctitle
18543 : see if setprotoent_r exists
18544 set setprotoent_r d_setprotoent_r
18546 case "$d_setprotoent_r" in
18548 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18549 case "$d_setprotoent_r_proto:$usethreads" in
18550 ":define") d_setprotoent_r_proto=define
18551 set d_setprotoent_r_proto setprotoent_r $hdrs
18555 case "$d_setprotoent_r_proto" in
18557 case "$setprotoent_r_proto" in
18558 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18559 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18561 case "$setprotoent_r_proto" in
18562 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18563 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18565 case "$setprotoent_r_proto" in
18566 ''|0) d_setprotoent_r=undef
18567 setprotoent_r_proto=0
18568 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18569 * ) case "$setprotoent_r_proto" in
18570 REENTRANT_PROTO*) ;;
18571 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18573 echo "Prototype: $try" ;;
18576 *) case "$usethreads" in
18577 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18579 d_setprotoent_r=undef
18580 setprotoent_r_proto=0
18584 *) setprotoent_r_proto=0
18588 : see if setpwent exists
18589 set setpwent d_setpwent
18592 : see if setpwent_r exists
18593 set setpwent_r d_setpwent_r
18595 case "$d_setpwent_r" in
18597 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18598 case "$d_setpwent_r_proto:$usethreads" in
18599 ":define") d_setpwent_r_proto=define
18600 set d_setpwent_r_proto setpwent_r $hdrs
18604 case "$d_setpwent_r_proto" in
18606 case "$setpwent_r_proto" in
18607 ''|0) try='int setpwent_r(FILE**);'
18608 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18610 case "$setpwent_r_proto" in
18611 ''|0) try='void setpwent_r(FILE**);'
18612 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18614 case "$setpwent_r_proto" in
18615 ''|0) d_setpwent_r=undef
18617 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18618 * ) case "$setpwent_r_proto" in
18619 REENTRANT_PROTO*) ;;
18620 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18622 echo "Prototype: $try" ;;
18625 *) case "$usethreads" in
18626 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18633 *) setpwent_r_proto=0
18637 : see if setregid exists
18638 set setregid d_setregid
18640 set setresgid d_setresgid
18643 : see if setreuid exists
18644 set setreuid d_setreuid
18646 set setresuid d_setresuid
18649 : see if setrgid exists
18650 set setrgid d_setrgid
18653 : see if setruid exists
18654 set setruid d_setruid
18657 : see if setservent exists
18658 set setservent d_setsent
18661 : see if setservent_r exists
18662 set setservent_r d_setservent_r
18664 case "$d_setservent_r" in
18666 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18667 case "$d_setservent_r_proto:$usethreads" in
18668 ":define") d_setservent_r_proto=define
18669 set d_setservent_r_proto setservent_r $hdrs
18673 case "$d_setservent_r_proto" in
18675 case "$setservent_r_proto" in
18676 ''|0) try='int setservent_r(int, struct servent_data*);'
18677 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18679 case "$setservent_r_proto" in
18680 ''|0) try='void setservent_r(int, struct servent_data*);'
18681 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18683 case "$setservent_r_proto" in
18684 ''|0) d_setservent_r=undef
18685 setservent_r_proto=0
18686 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18687 * ) case "$setservent_r_proto" in
18688 REENTRANT_PROTO*) ;;
18689 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18691 echo "Prototype: $try" ;;
18694 *) case "$usethreads" in
18695 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18697 d_setservent_r=undef
18698 setservent_r_proto=0
18702 *) setservent_r_proto=0
18706 : see if setsid exists
18707 set setsid d_setsid
18710 : see if setvbuf exists
18711 set setvbuf d_setvbuf
18714 : see if shmctl exists
18715 set shmctl d_shmctl
18718 : see if shmget exists
18719 set shmget d_shmget
18722 : see if shmat exists
18725 : see what shmat returns
18728 $cat >shmat.c <<'END'
18729 #include <sys/shm.h>
18732 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18737 echo "and it returns ($shmattype)." >&4
18738 : see if a prototype for shmat is available
18739 xxx=`./findhdr sys/shm.h`
18740 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18741 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18752 set d_shmatprototype
18755 : see if shmdt exists
18759 : see how much of the 'shm*(2)' library is present.
18762 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18763 *"$undef"*) h_shm=false;;
18767 case "`ipcs 2>&1`" in
18768 "SVID shared memory"*"not configured"*)
18769 echo "Your $osname does not have the shm*(2) configured." >&4
18772 set shmctl d_shmctl
18774 set shmget d_shmget
18784 : we could also check for sys/ipc.h ...
18785 if $h_shm && $test `./findhdr sys/shm.h`; then
18786 echo "You have the full shm*(2) library." >&4
18789 echo "You don't have the full shm*(2) library." >&4
18795 : see if we have sigaction
18797 if set sigaction val -f d_sigaction; eval $csym; $val; then
18798 echo 'sigaction() found.' >&4
18801 #include <sys/types.h>
18802 #include <signal.h>
18803 #$i_stdlib I_STDLIB
18805 #include <stdlib.h>
18809 struct sigaction act, oact;
18811 oact.sa_handler = 0;
18812 /* so that act and oact are used */
18813 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18817 if eval $compile_ok; then
18820 echo "But you don't seem to have a usable struct sigaction." >&4
18824 echo 'sigaction NOT found.' >&4
18827 set d_sigaction; eval $setvar
18830 : see what type pids are declared as in the kernel
18831 rp="What is the type of process ids on this system?"
18832 set pid_t pidtype int stdio.h sys/types.h
18835 : see what type uids are declared as in the kernel
18837 echo "Looking for the type for user ids returned by getuid()."
18838 set uid_t uidtype xxx stdio.h sys/types.h
18842 xxx=`./findhdr sys/user.h`
18843 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18845 unsigned) dflt="$1 $2" ;;
18849 *) dflt="$uidtype";;
18852 uid_t) echo "uid_t found." ;;
18853 *) rp="What is the type for user ids returned by getuid()?"
18859 : Define hasfield_t macro for Configure internal use
18860 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18861 while $test $# -ge 2; do
18863 $define) echo "#include <$2>";;
18867 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18869 if eval $compile; then
18878 : see what siginfo fields we have
18879 case "$d_sigaction" in
18881 echo "Checking if your siginfo_t has si_errno field...">&4
18882 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18885 echo "Checking if your siginfo_t has si_pid field...">&4
18886 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18889 echo "Checking if your siginfo_t has si_uid field...">&4
18890 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18893 echo "Checking if your siginfo_t has si_addr field...">&4
18894 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18897 echo "Checking if your siginfo_t has si_status field...">&4
18898 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18901 echo "Checking if your siginfo_t has si_band field...">&4
18902 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18905 echo "Checking if your siginfo_t has si_value field...">&4
18906 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18909 echo "Checking if your siginfo_t has si_fd field...">&4
18910 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18915 d_siginfo_si_errno="$undef"
18916 d_siginfo_si_pid="$undef"
18917 d_siginfo_si_uid="$undef"
18918 d_siginfo_si_addr="$undef"
18919 d_siginfo_si_status="$undef"
18920 d_siginfo_si_band="$undef"
18921 d_siginfo_si_value="$undef"
18922 d_siginfo_si_fd="$undef"
18926 : see if this is a sunmath.h system
18927 set sunmath.h i_sunmath
18930 : see if signbit exists
18931 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18933 #$i_sunmath I_SUNMATH
18935 #ifdef I_SUNMATH /* Solaris special math library */
18936 # include <sunmath.h>
18939 int main(int argc, char **argv)
18943 if ((signbit(x) == 0) && (signbit(y) != 0))
18951 if eval $compile; then
18952 if $run ./try; then
18956 $echo "Signbit seems to be available, but doesn't work as I expected."
18957 $echo "I won't use it." >&4
18968 : see if sigprocmask exists
18969 set sigprocmask d_sigprocmask
18972 : see if sigsetjmp exists
18974 case "$d_sigsetjmp" in
18977 #include <setjmp.h>
18978 #$i_stdlib I_STDLIB
18980 #include <stdlib.h>
18986 if (sigsetjmp(env,1))
18989 siglongjmp(env, 1);
18994 if eval $compile; then
18995 if $run ./try >/dev/null 2>&1; then
18996 echo "POSIX sigsetjmp found." >&4
19000 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
19006 echo "sigsetjmp not found." >&4
19010 *) val="$d_sigsetjmp"
19011 case "$d_sigsetjmp" in
19012 $define) echo "POSIX sigsetjmp found." >&4;;
19013 $undef) echo "sigsetjmp not found." >&4;;
19021 : see if snprintf exists
19022 set snprintf d_snprintf
19025 : see if vsnprintf exists
19026 set vsnprintf d_vsnprintf
19029 case "$d_snprintf-$d_vsnprintf" in
19032 Checking whether your snprintf() and vsnprintf() work okay...
19034 $cat >try.c <<'EOCP'
19035 /* v?snprintf testing logic courtesy of Russ Allbery.
19036 * According to C99:
19037 * - if the buffer is too short it still must be \0-terminated
19038 * - if the buffer is too short the potentially required length
19039 * must be returned and not -1
19040 * - if the buffer is NULL the potentially required length
19041 * must be returned and not -1 or core dump
19044 #include <stdarg.h>
19048 int test (char *format, ...)
19053 va_start (args, format);
19054 count = vsnprintf (buf, sizeof buf, format, args);
19061 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
19062 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
19066 if eval $compile; then
19069 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
19071 Your snprintf() and snprintf() don't seem to be working okay.
19073 d_snprintf="$undef"
19074 d_vsnprintf="$undef"
19078 echo "(I can't seem to compile the test program--assuming they don't)"
19079 d_snprintf="$undef"
19080 d_vsnprintf="$undef"
19086 : see if sockatmark exists
19087 set sockatmark d_sockatmark
19090 : see if prototype for sockatmark is available
19092 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
19095 : see if socks5_init exists
19096 set socks5_init d_socks5_init
19099 : see if srand48_r exists
19100 set srand48_r d_srand48_r
19102 case "$d_srand48_r" in
19104 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19105 case "$d_srand48_r_proto:$usethreads" in
19106 ":define") d_srand48_r_proto=define
19107 set d_srand48_r_proto srand48_r $hdrs
19111 case "$d_srand48_r_proto" in
19113 case "$srand48_r_proto" in
19114 ''|0) try='int srand48_r(long, struct drand48_data*);'
19115 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19117 case "$srand48_r_proto" in
19118 ''|0) d_srand48_r=undef
19120 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19121 * ) case "$srand48_r_proto" in
19122 REENTRANT_PROTO*) ;;
19123 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19125 echo "Prototype: $try" ;;
19128 *) case "$usethreads" in
19129 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19136 *) srand48_r_proto=0
19140 : see if srandom_r exists
19141 set srandom_r d_srandom_r
19143 case "$d_srandom_r" in
19145 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19146 case "$d_srandom_r_proto:$usethreads" in
19147 ":define") d_srandom_r_proto=define
19148 set d_srandom_r_proto srandom_r $hdrs
19152 case "$d_srandom_r_proto" in
19154 case "$srandom_r_proto" in
19155 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19156 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19158 case "$srandom_r_proto" in
19159 ''|0) d_srandom_r=undef
19161 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19162 * ) case "$srandom_r_proto" in
19163 REENTRANT_PROTO*) ;;
19164 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19166 echo "Prototype: $try" ;;
19169 *) case "$usethreads" in
19170 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19177 *) srandom_r_proto=0
19181 : see if prototype for setresgid is available
19183 set d_sresgproto setresgid $i_unistd unistd.h
19186 : see if prototype for setresuid is available
19188 set d_sresuproto setresuid $i_unistd unistd.h
19191 : see if stat exists
19195 : see if sys/stat.h is available
19196 set sys/stat.h i_sysstat
19199 : see if stat knows about block sizes
19201 echo "Checking to see if your struct stat has st_blocks field..." >&4
19202 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19205 : see if this is a sys/vfs.h system
19206 set sys/vfs.h i_sysvfs
19209 : see if this is a sys/statfs.h system
19210 set sys/statfs.h i_sysstatfs
19213 : Check for statfs_s
19215 echo "Checking to see if your system supports struct statfs..." >&4
19216 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
19218 case "$d_statfs_s" in
19219 "$define") echo "Yes, it does." ;;
19220 *) echo "No, it doesn't." ;;
19223 : see if struct statfs knows about f_flags
19224 case "$d_statfs_s" in
19227 echo "Checking to see if your struct statfs has f_flags field..." >&4
19228 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
19232 set d_statfs_f_flags
19236 case "$d_statfs_f_flags" in
19237 "$define") echo "Yes, it does." ;;
19238 *) echo "No, it doesn't." ;;
19241 : see what flavor, if any, of static inline is supported
19243 echo "Checking to see if your system supports static inline..."
19244 $cat > try.c <<'EOCP'
19245 #include <stdlib.h>
19246 extern int f_via_a(int x);
19247 extern int f_via_b(int x);
19248 int main(int argc, char **argv)
19257 return EXIT_SUCCESS;
19260 return EXIT_FAILURE;
19264 $cat > a.c <<'EOCP'
19265 static INLINE int f(int x) {
19276 $cat > b.c <<'EOCP'
19277 extern int f(int x);
19285 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19286 case "$perl_static_inline" in
19287 '') # Check the various possibilities, and break out on success.
19288 # For gcc, prefer __inline__, which will still permit
19289 # cflags.SH to add in -ansi.
19290 case "$gccversion" in
19291 '') xxx="inline __inline__ __inline _inline";;
19292 *) xxx="__inline__ inline __inline _inline";;
19294 for inline in $xxx; do
19295 set try -DINLINE=$inline a.c
19296 if eval $compile && $run ./try; then
19297 # Now make sure there is no external linkage of static
19299 set try -DINLINE=$inline -DUSE_B a.c b.c
19300 if eval $compile && $run ./try; then
19301 $echo "Your compiler supports static $inline, " >&4
19302 $echo "but it also creates an external definition," >&4
19303 $echo "so I won't use it." >&4
19306 $echo "Your compiler supports static $inline." >&4
19308 perl_static_inline="static $inline";
19312 $echo "Your compiler does NOT support static $inline." >&4
19317 *inline*) # Some variant of inline exists.
19318 echo "Keeping your $hint value of $perl_static_inline."
19321 static) # No inline capabilities
19322 echo "Keeping your $hint value of $perl_static_inline."
19325 *) # Unrecognized previous value -- blindly trust the supplied
19326 # value and hope it makes sense. Use old value for
19327 # d_static_inline, if there is one.
19328 echo "Keeping your $hint value of $perl_static_inline."
19329 case "$d_static_inline" in
19331 *) val=$d_static_inline ;;
19335 # Fallback to plain 'static' if nothing worked.
19336 case "$perl_static_inline" in
19338 perl_static_inline="static"
19342 set d_static_inline
19344 $rm -f a.[co] b.[co]
19347 : Check stream access
19349 Checking how to access stdio streams by file descriptor number...
19351 case "$stdio_stream_array" in
19352 '') $cat >try.c <<EOCP
19355 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19359 for s in _iob __iob __sF
19361 set try -DSTDIO_STREAM_ARRAY=$s
19362 if eval $compile; then
19363 case "`$run ./try`" in
19364 yes) stdio_stream_array=$s; break ;;
19370 case "$stdio_stream_array" in
19372 I can't figure out how to access stdio streams by file descriptor number.
19374 d_stdio_stream_array="$undef"
19377 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19379 d_stdio_stream_array="$define"
19383 : see if strcoll exists
19384 set strcoll d_strcoll
19387 : see if strerror_l exists
19388 set strerror_l d_strerror_l
19391 : see if strerror_r exists
19392 set strerror_r d_strerror_r
19394 case "$d_strerror_r" in
19396 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
19397 case "$d_strerror_r_proto:$usethreads" in
19398 ":define") d_strerror_r_proto=define
19399 set d_strerror_r_proto strerror_r $hdrs
19403 case "$d_strerror_r_proto" in
19405 case "$strerror_r_proto" in
19406 ''|0) try='int strerror_r(int, char*, size_t);'
19407 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19409 case "$strerror_r_proto" in
19410 ''|0) try='int strerror_r(int, char*, int);'
19411 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19413 case "$strerror_r_proto" in
19414 ''|0) try='char* strerror_r(int, char*, size_t);'
19415 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19417 case "$strerror_r_proto" in
19418 ''|0) d_strerror_r=undef
19420 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19421 * ) case "$strerror_r_proto" in
19422 REENTRANT_PROTO*) ;;
19423 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19425 echo "Prototype: $try" ;;
19428 *) case "$usethreads" in
19429 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19436 *) strerror_r_proto=0
19440 : see if strftime exists
19441 set strftime d_strftime
19444 : see if strlcat exists
19445 : We need both a prototype in string.h and the symbol in libc.
19448 xx1="#$d_gnulibc HAS_GNULIBC"
19449 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19450 xx3='# define _GNU_SOURCE'
19452 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19454 case "$d_strlcat_proto" in
19455 define) # see if strlcat exists
19456 set strlcat d_strlcat
19465 : see if strlcpy exists
19466 : We need both a prototype in string.h and the symbol in libc.
19469 xx1="#$d_gnulibc HAS_GNULIBC"
19470 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19471 xx3='# define _GNU_SOURCE'
19473 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19475 case "$d_strlcpy_proto" in
19476 define) # see if strlcpy exists
19477 set strlcpy d_strlcpy
19486 : see if strnlen exists
19487 set strnlen d_strnlen
19490 : see if strtod exists
19491 set strtod d_strtod
19494 : see if strtod_l exists
19495 set strtod_l d_strtod_l
19498 : see if strtol exists
19499 set strtol d_strtol
19502 : see if strtold exists
19503 set strtold d_strtold
19506 : see if strtold_l exists
19507 set strtold_l d_strtold_l
19510 : see if strtoll exists
19511 set strtoll d_strtoll
19514 case "$d_longlong-$d_strtoll" in
19517 Checking whether your strtoll() works okay...
19519 $cat >try.c <<'EOCP'
19522 #define strtoll __strtoll
19525 #define strtoll _strtoll
19528 #include <stdlib.h>
19529 static int bad = 0;
19530 void check(const char *s, long long ell, int een) {
19533 gll = strtoll(s, 0, 10);
19534 if (!((gll == ell) && (errno == een)))
19538 check(" 1", 1LL, 0);
19539 check(" 0", 0LL, 0);
19540 check("-1", -1LL, 0);
19541 check("-9223372036854775808", -9223372036854775808LL, 0);
19542 check("-9223372036854775808", -9223372036854775808LL, 0);
19543 check(" 9223372036854775807", 9223372036854775807LL, 0);
19544 check("-9223372036854775808", -9223372036854775808LL, 0);
19545 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19546 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19552 if eval $compile; then
19555 ok) echo "Your strtoll() seems to be working okay." ;;
19557 Your strtoll() doesn't seem to be working okay.
19563 echo "(I can't seem to compile the test program--assuming it doesn't)"
19569 : see if strtoq exists
19570 set strtoq d_strtoq
19573 : see if strtoul exists
19574 set strtoul d_strtoul
19577 case "$d_strtoul" in
19580 Checking whether your strtoul() works okay...
19582 $cat >try.c <<'EOCP'
19583 #include <stdlib.h>
19586 static int bad = 0;
19587 void check(const char *s, unsigned long eul, int een) {
19590 gul = strtoul(s, 0, 10);
19591 if (!((gul == eul) && (errno == een)))
19595 check(" 1", 1L, 0);
19596 check(" 0", 0L, 0);
19598 case "$longsize" in
19600 $cat >>try.c <<'EOCP'
19601 check("18446744073709551615", 18446744073709551615UL, 0);
19602 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19603 #if 0 /* strtoul() for /^-/ strings is undefined. */
19604 check("-1", 18446744073709551615UL, 0);
19605 check("-18446744073709551614", 2, 0);
19606 check("-18446744073709551615", 1, 0);
19607 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19608 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19613 $cat >>try.c <<'EOCP'
19614 check("4294967295", 4294967295UL, 0);
19615 check("4294967296", 4294967295UL, ERANGE);
19616 #if 0 /* strtoul() for /^-/ strings is undefined. */
19617 check("-1", 4294967295UL, 0);
19618 check("-4294967294", 2, 0);
19619 check("-4294967295", 1, 0);
19620 check("-4294967296", 4294967295UL, ERANGE);
19621 check("-4294967297", 4294967295UL, ERANGE);
19626 : Should we write these tests to be more portable by sprintf-ing
19627 : ~0 and then manipulating that char string as input for strtol?
19630 $cat >>try.c <<'EOCP'
19637 if eval $compile; then
19638 case "`$run ./try`" in
19639 ok) echo "Your strtoul() seems to be working okay." ;;
19641 Your strtoul() doesn't seem to be working okay.
19647 echo "(I can't seem to compile the test program--assuming it doesn't)"
19653 : see if strtoull exists
19654 set strtoull d_strtoull
19657 case "$d_longlong-$d_strtoull" in
19660 Checking whether your strtoull() works okay...
19662 $cat >try.c <<'EOCP'
19663 #include <stdlib.h>
19666 #define strtoull __strtoull
19669 static int bad = 0;
19670 void check(const char *s, long long eull, int een) {
19673 gull = strtoull(s, 0, 10);
19674 if (!((gull == eull) && (errno == een)))
19678 check(" 1", 1LL, 0);
19679 check(" 0", 0LL, 0);
19680 check("18446744073709551615", 18446744073709551615ULL, 0);
19681 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19682 #if 0 /* strtoull() for /^-/ strings is undefined. */
19683 check("-1", 18446744073709551615ULL, 0);
19684 check("-18446744073709551614", 2LL, 0);
19685 check("-18446744073709551615", 1LL, 0);
19686 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19687 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19694 if eval $compile; then
19695 case "`$run ./try`" in
19696 ok) echo "Your strtoull() seems to be working okay." ;;
19698 Your strtoull() doesn't seem to be working okay.
19700 d_strtoull="$undef"
19704 echo "(I can't seem to compile the test program--assuming it doesn't)"
19705 d_strtoull="$undef"
19710 : see if strtouq exists
19711 set strtouq d_strtouq
19714 case "$d_strtouq" in
19717 Checking whether your strtouq() works okay...
19719 $cat >try.c <<'EOCP'
19720 #include <stdlib.h>
19723 static int bad = 0;
19724 void check(const char *s, unsigned long long eull, int een) {
19725 unsigned long long gull;
19727 gull = strtouq(s, 0, 10);
19728 if (!((gull == eull) && (errno == een)))
19732 check(" 1", 1LL, 0);
19733 check(" 0", 0LL, 0);
19734 check("18446744073709551615", 18446744073709551615ULL, 0);
19735 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19736 #if 0 /* strtouq() for /^-/ strings is undefined. */
19737 check("-1", 18446744073709551615ULL, 0);
19738 check("-18446744073709551614", 2LL, 0);
19739 check("-18446744073709551615", 1LL, 0);
19740 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19741 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19749 if eval $compile; then
19750 case "`$run ./try`" in
19751 ok) echo "Your strtouq() seems to be working okay." ;;
19753 Your strtouq() doesn't seem to be working okay.
19759 echo "(I can't seem to compile the test program--assuming it doesn't)"
19765 : see if strxfrm exists
19766 set strxfrm d_strxfrm
19769 : see if strxfrm_l exists
19770 set strxfrm_l d_strxfrm_l
19773 : see if symlink exists
19774 set symlink d_symlink
19777 : see if syscall exists
19778 set syscall d_syscall
19781 : see if prototype for syscall is available
19783 set d_syscallproto syscall $i_unistd unistd.h
19786 : see if sysconf exists
19787 set sysconf d_sysconf
19790 : see if sys_errlist[] exists
19792 if test "X$d_syserrlst" = X; then
19793 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19794 echo "You have sys_errlist[], so we could roll our own strerror."
19795 d_syserrlst="$define"
19797 echo "You don't have sys_errlist[], so strerror() is welcome."
19798 d_syserrlst="$undef"
19802 : see if system exists
19803 set system d_system
19806 : see if tcgetpgrp exists
19807 set tcgetpgrp d_tcgetpgrp
19810 : see if tcsetpgrp exists
19811 set tcsetpgrp d_tcsetpgrp
19814 : see if prototype for telldir is available
19816 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19819 : see if tgamma exists
19820 set tgamma d_tgamma
19823 : see what flavor, if any, of thread local storage is supported
19825 echo "Checking to see if your system supports C11 thread local storage..."
19826 $cat > try.c <<'EOCP'
19828 #include <stdlib.h>
19829 #include <pthread.h>
19831 static int plus_one = 1;
19832 static int minus_one = -1;
19834 PROBE_MACRO int *minion;
19836 int callback (const void *a, const void *b) {
19837 int val_a = *minion * *(const int *)a;
19838 int val_b = *minion * *(const int *)b;
19839 return val_a < val_b ? -1 : val_a > val_b;
19844 void *thread_function(void *arg) {
19845 /* thread local variables should start zeroed in each thread. */
19846 if (minion != NULL) {
19847 fprintf(stderr, "__thread variable started with %p, should be NULL\n",
19851 minion = &minus_one;
19855 for (i = 0; i < SIZE; ++i) {
19856 /* "Hash randomisation" - this array isn't in sorted order: */
19857 array[i ^ 5] = i * i;
19860 qsort(array, SIZE, sizeof(int), callback);
19863 for (i = 0; i < SIZE; ++i) {
19864 int want = (SIZE - 1 - i) * (SIZE - 1 - i);
19865 int have = array[i];
19866 if (want != have) {
19868 fprintf(stderr, "array[%u] - want %i, have %i\n", i, want, have);
19877 int main(int argc, char **argv) {
19878 if (minion != NULL) {
19879 fprintf(stderr, "__thread variable started with %p, should be NULL\n",
19884 minion = &plus_one;
19887 int result = pthread_create(&tid, NULL, thread_function, NULL);
19889 fprintf(stderr, "pthread_create failed (%d)\n", result);
19893 result = pthread_join(tid, NULL);
19895 fprintf(stderr, "pthread_join failed (%d)\n", result);
19899 if (minion == NULL) {
19900 fprintf(stderr, "__thread variable should not be NULL\n");
19903 if (!(minion == &plus_one && *minion == 1)) {
19904 fprintf(stderr, "__thread variable should be %d @ %p, not %d @ %p\n",
19905 1, &plus_one, *minion, minion);
19913 # Respect a hint (or previous) value for perl_thread_local, if there is one.
19914 case "$perl_thread_local" in
19915 '') # Check the various possibilities, and break out on success.
19916 for thread_local in _Thread_local __thread; do
19917 set try -DPROBE_MACRO=$thread_local
19918 if eval $compile && $run ./try; then
19919 $echo "Your compiler supports $thread_local." >&4
19921 perl_thread_local="$thread_local";
19924 $echo "Your compiler does NOT support $thread_local." >&4
19928 *thread*|*Thread*) # Some variant of thread local exists.
19929 echo "Keeping your $hint value of $perl_thread_local."
19932 *) # Unrecognized previous value -- blindly trust the supplied
19933 # value and hope it makes sense. Use old value for
19934 # d_thread_local, if there is one.
19935 echo "Keeping your $hint value of $perl_thread_local."
19936 case "$d_thread_local" in
19938 *) val=$d_thread_local ;;
19946 : see if time exists
19948 if test "X$d_time" = X -o X"$timetype" = X; then
19949 if set time val -f d_time; eval $csym; $val; then
19950 echo 'time() found.' >&4
19952 rp="What is the type returned by time() on this system?"
19953 set time_t timetype long stdio.h sys/types.h
19956 echo 'time() not found, hope that will do.' >&4
19964 : see if timegm exists
19965 set timegm d_timegm
19968 : see if this is a sys/times.h system
19969 set sys/times.h i_systimes
19972 : see if times exists
19974 if set times val -f d_times; eval $csym; $val; then
19975 echo 'times() found.' >&4
19978 case "$i_systimes" in
19979 "$define") inc='sys/times.h';;
19981 rp="What is the type returned by times() on this system?"
19982 set clock_t clocktype long stdio.h sys/types.h $inc
19985 echo 'times() NOT found, hope that will do.' >&4
19990 : see if tmpnam_r exists
19991 set tmpnam_r d_tmpnam_r
19993 case "$d_tmpnam_r" in
19995 hdrs="$i_systypes sys/types.h define stdio.h "
19996 case "$d_tmpnam_r_proto:$usethreads" in
19997 ":define") d_tmpnam_r_proto=define
19998 set d_tmpnam_r_proto tmpnam_r $hdrs
20002 case "$d_tmpnam_r_proto" in
20004 case "$tmpnam_r_proto" in
20005 ''|0) try='char* tmpnam_r(char*);'
20006 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
20008 case "$tmpnam_r_proto" in
20009 ''|0) d_tmpnam_r=undef
20011 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
20012 * ) case "$tmpnam_r_proto" in
20013 REENTRANT_PROTO*) ;;
20014 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
20016 echo "Prototype: $try" ;;
20019 *) case "$usethreads" in
20020 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
20027 *) tmpnam_r_proto=0
20031 : see if towlower exists
20032 set towlower d_towlower
20035 : see if trunc exists
20039 : see if truncate exists
20040 set truncate d_truncate
20043 : see if ttyname_r exists
20044 set ttyname_r d_ttyname_r
20046 case "$d_ttyname_r" in
20048 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
20049 case "$d_ttyname_r_proto:$usethreads" in
20050 ":define") d_ttyname_r_proto=define
20051 set d_ttyname_r_proto ttyname_r $hdrs
20055 case "$d_ttyname_r_proto" in
20057 case "$ttyname_r_proto" in
20058 ''|0) try='int ttyname_r(int, char*, size_t);'
20059 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
20061 case "$ttyname_r_proto" in
20062 ''|0) try='int ttyname_r(int, char*, int);'
20063 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
20065 case "$ttyname_r_proto" in
20066 ''|0) try='char* ttyname_r(int, char*, int);'
20067 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
20069 case "$ttyname_r_proto" in
20070 ''|0) d_ttyname_r=undef
20072 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
20073 * ) case "$ttyname_r_proto" in
20074 REENTRANT_PROTO*) ;;
20075 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
20077 echo "Prototype: $try" ;;
20080 *) case "$usethreads" in
20081 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
20088 *) ttyname_r_proto=0
20092 : see if tzname[] exists
20094 if set tzname val -a d_tzname; eval $csym; $val; then
20096 echo 'tzname[] found.' >&4
20099 echo 'tzname[] NOT found.' >&4
20104 : Check if is a multiplatform env
20106 darwin) multiarch="$define" ;;
20108 case "$multiarch" in
20109 ''|[nN]*) multiarch="$undef" ;;
20112 : check for ordering of bytes in a UV
20114 case "$multiarch" in
20117 You seem to be doing a multiarchitecture build,
20118 skipping the byteorder check.
20124 case "$byteorder" in
20127 In the following, larger digits indicate more significance. A big-endian
20128 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
20129 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
20130 machines may have weird orders like 3412. A Cray will report 87654321,
20131 an Alpha will report 12345678. If the test program works the default is
20133 I'm now running the test program...
20137 #$i_stdlib I_STDLIB
20139 #include <stdlib.h>
20141 #$i_inttypes I_INTTYPES
20143 #include <inttypes.h>
20145 #include <sys/types.h>
20146 typedef $uvtype UV;
20156 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
20158 u.l = (UV)0x04030201;
20159 for (i = 0; i < $uvsize; i++)
20160 printf("%c", u.c[i]+'0');
20167 if eval $compile && $run ./try > /dev/null; then
20170 [1-4][1-4][1-4][1-4]|12345678|87654321)
20171 echo "(The test program ran ok.)"
20172 echo "byteorder=$dflt"
20175 ????|????????) echo "(The test program ran ok.)" ;;
20176 *) echo "(The test program didn't run right for some reason.)" ;;
20181 (I can't seem to compile the test program. Guessing big-endian...)
20184 case "$xxx_prompt" in
20186 rp="What is the order of bytes in $uvtype?"
20199 : Checking 32bit alignedness
20202 Checking to see whether you can access character data unalignedly...
20204 case "$d_u32align" in
20205 '') $cat >try.c <<EOCP
20207 #$i_stdlib I_STDLIB
20209 #include <stdlib.h>
20211 #define U32 $u32type
20212 #define BYTEORDER 0x$byteorder
20214 #include <signal.h>
20216 $signal_t bletch(int s) { exit(4); }
20219 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20220 volatile U8 buf[8];
20224 if (sizeof(U32) != 4) {
20225 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20232 signal(SIGBUS, bletch);
20244 for (i = 0; i < 4; i++) {
20245 up = (U32*)(buf + i);
20246 if (! ((*up == 1 << (8*i)) || /* big-endian */
20247 (*up == 1 << (8*(3-i))) /* little-endian */
20251 printf("read failed (%x)\n", *up);
20257 for (i = 0; i < 4; i++) {
20258 up = (U32*)(buf + i);
20260 if (*up != 0xBeef) {
20261 printf("write failed (%x)\n", *up);
20275 if eval $compile_ok; then
20276 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20277 $run ./try 2>&1 >/dev/null
20280 You can access character data pretty unalignedly.
20282 d_u32align="$undef"
20285 It seems that you must access character data in an aligned manner.
20287 d_u32align="$define"
20291 rp='Can you access character data at unaligned addresses?'
20295 [yY]*) d_u32align="$undef" ;;
20296 *) d_u32align="$define" ;;
20303 : see if ualarm exists
20304 set ualarm d_ualarm
20307 : see if umask exists
20311 : see if unordered exists
20312 set unordered d_unordered
20315 : see if unsetenv exists
20316 set unsetenv d_unsetenv
20319 : see if usleep exists
20320 set usleep d_usleep
20323 : see if prototype for usleep is available
20325 set d_usleepproto usleep $i_unistd unistd.h
20328 : see if ustat exists
20332 : see if closedir exists
20333 set closedir d_closedir
20336 case "$d_closedir" in
20339 echo "Checking whether closedir() returns a status..." >&4
20341 #$i_dirent I_DIRENT /**/
20342 #$i_sysdir I_SYS_DIR /**/
20343 #$i_sysndir I_SYS_NDIR /**/
20344 #$i_systypes I_SYS_TYPES /**/
20346 #if defined(I_SYS_TYPES)
20347 #include <sys/types.h>
20349 #if defined(I_DIRENT)
20350 #include <dirent.h>
20353 #include <sys/ndir.h>
20356 #include <sys/dir.h>
20360 int main() { return closedir(opendir(".")); }
20363 if eval $compile_ok; then
20364 if $run ./try > /dev/null 2>&1 ; then
20365 echo "Yes, it does."
20368 echo "No, it doesn't."
20372 echo "(I can't seem to compile the test program--assuming it doesn't)"
20380 set d_void_closedir
20384 : see if there is a wait4
20388 : see if waitpid exists
20389 set waitpid d_waitpid
20392 : see if wcrtomb exists
20393 set wcrtomb d_wcrtomb
20398 $cat >try.c <<'EOCP'
20404 return (wcscmp (s, s) ? 1 : 0);
20409 if eval $compile; then
20412 0) echo "A working wcscmp() found." >&4
20414 *) echo "wcscmp() found, but it doesn't work" >&4
20418 echo "wcscmp() NOT found." >&4
20424 : see if wcstombs exists
20425 set wcstombs d_wcstombs
20430 $cat >try.c <<'EOCP'
20435 wchar_t dst[4], *src = L" ";
20437 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20442 if eval $compile; then
20445 0) echo "A working wcsxfrm() found." >&4
20447 *) echo "wcsxfrm() found, but it doesn't work" >&4
20451 echo "wcsxfrm() NOT found." >&4
20457 : see if wctomb exists
20458 set wctomb d_wctomb
20461 : see if writev exists
20462 set writev d_writev
20465 : check for alignment requirements
20467 case "$alignbytes" in
20468 '') echo "Checking alignment constraints..." >&4
20477 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20482 if eval $compile_ok; then
20486 echo "(I can't seem to compile the test program...)"
20488 case "$multiarch" in
20490 : The usual safe value is 8, but Darwin with -Duselongdouble
20491 : needs 16. Hence, we will take 8 as a minimum, but allow
20492 : Configure to pick a larger value if needed.
20493 if $test "$dflt" -lt 8; then
20495 echo "Setting alignment to 8 for multiarch support.">&4
20500 *) dflt="$alignbytes"
20503 rp="Doubles must be aligned on a how-many-byte boundary?"
20508 : set the base revision
20511 : length of character in bytes. Is always 1, otherwise it is not C
20512 : This used to be a test using sizeof
20515 : Check for the number of bits in a character
20516 case "$charbits" in
20517 '') echo "Checking how long a character is (in bits)..." >&4
20524 for (c = 1, n = 0; c; c <<= 1, n++) ;
20525 printf ("%d\n", n);
20530 if eval $compile_ok; then
20534 echo "(I can't seem to compile the test program. Guessing...)"
20541 rp="What is the length of a character (in bits)?"
20545 case "$charbits" in
20548 Your system has an unsigned character size of $charbits bits, which
20549 is rather unusual (normally it is 8 bits). Perl likely will not work
20550 correctly on your system, with subtle bugs in various places.
20552 rp='Do you really want to continue?'
20556 [yY]) echo >&4 "Okay, continuing." ;;
20561 : how do we concatenate cpp tokens here?
20563 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20564 $cat >cpp_stuff.c <<'EOCP'
20565 #define RCAT(a,b)a/**/b
20566 #define ACAT(a,b)a ## b
20570 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20571 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20572 echo "Oh! Smells like ANSI's been here." >&4
20573 echo "We can catify or stringify, separately or together!"
20575 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20576 echo "Ah, yes! The good old days!" >&4
20577 echo "However, in the good old days we don't know how to stringify and"
20578 echo "catify at the same time."
20582 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20583 You're going to have to edit the values of CAT[2-5] in config.h...
20585 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20589 : see if this is a db.h system
20595 : Check db version.
20597 echo "Checking Berkeley DB version ..." >&4
20599 #include <sys/types.h>
20601 #$i_stdlib I_STDLIB
20603 #include <stdlib.h>
20606 int main(int argc, char *argv[])
20608 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20609 int Major, Minor, Patch ;
20610 unsigned long Version ;
20611 (void)db_version(&Major, &Minor, &Patch) ;
20613 printf("%d %d %d %d %d %d\n",
20614 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20615 Major, Minor, Patch);
20618 printf("You have Berkeley DB Version 2 or greater.\n");
20620 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20621 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20622 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20623 Major, Minor, Patch) ;
20625 /* check that db.h & libdb are compatible */
20626 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20627 printf("db.h and libdb are incompatible.\n") ;
20631 printf("db.h and libdb are compatible.\n") ;
20633 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20634 + DB_VERSION_PATCH ;
20636 /* needs to be >= 2.3.4 */
20637 if (Version < 2003004) {
20638 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20639 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20645 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20650 printf("You have Berkeley DB Version 1.\n");
20651 exit(0); /* DB version < 2: the coast is clear. */
20653 exit(1); /* <db.h> not Berkeley DB? */
20659 if eval $compile_ok && $run ./try; then
20660 echo 'Looks OK.' >&4
20662 db_version_major=$1
20663 db_version_minor=$2
20664 db_version_patch=$3
20666 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20670 : Remove db from list of libraries to use
20671 echo "Removing unusable -ldb from library list" >&4
20672 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20675 echo "libs = $libs" >&4
20685 : Check the return type needed for hash
20687 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20689 #include <sys/types.h>
20692 #ifndef DB_VERSION_MAJOR
20693 u_int32_t hash_cb (const void* ptr, size_t size)
20700 info.hash = hash_cb;
20704 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20705 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20708 db_hashtype='u_int32_t'
20711 : XXX Maybe we should just give up here.
20712 db_hashtype=u_int32_t
20714 echo "Help: I can't seem to compile the db test program." >&4
20715 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20718 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20720 *) db_hashtype=u_int32_t
20725 : Check the return type needed for prefix
20727 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20729 #include <sys/types.h>
20732 #ifndef DB_VERSION_MAJOR
20733 size_t prefix_cb (const DBT *key1, const DBT *key2)
20740 info.prefix = prefix_cb;
20744 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20745 if $compiler_warning try.out >>/dev/null 2>&1 ; then
20746 db_prefixtype='int'
20748 db_prefixtype='size_t'
20751 db_prefixtype='size_t'
20752 : XXX Maybe we should just give up here.
20754 echo "Help: I can't seem to compile the db test program." >&4
20755 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20758 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20760 *) db_prefixtype='size_t'
20764 : Include . in @INC
20767 Historically Perl has provided a final fallback of the current working
20768 directory '.' when searching for a library. This, however, can lead to
20769 problems when a Perl program which loads optional modules is called from
20770 a shared directory. This can lead to executing unexpected code.
20774 # When changing to exclude by default:
20775 case "$default_inc_excludes_dot" in
20776 $undef|false|[nN]*) dflt="n" ;;
20779 # To turn exclude off by default:
20780 #case "$default_inc_excludes_dot" in
20781 # $define|true|[yY]*) dflt="y" ;;
20785 rp='Exclude '.' from @INC by default? '
20788 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20789 *) default_inc_excludes_dot="$define" ;;
20792 : Check what kind of inf/nan your system has
20793 $echo "Checking the kind of infinities and nans you have..." >&4
20794 $echo "(The following tests may crash. That's okay.)" >&4
20796 #define DOUBLESIZE $doublesize
20797 #$d_longdbl HAS_LONG_DOUBLE
20798 #ifdef HAS_LONG_DOUBLE
20799 #define LONG_DOUBLESIZE $longdblsize
20800 #define LONG_DOUBLEKIND $longdblkind
20803 #include <string.h>
20805 /* Note that whether the sign bit is on or off
20806 * for NaN depends on the CPU/FPU, and possibly
20807 * can be affected by the build toolchain.
20809 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20810 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20811 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20812 * (respectively) as opposed to the more usual
20813 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20815 * Pre-IEEE-754 floating point format do not even have inf/nan support
20816 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20817 * to even mention, causing immediate SIGFPE or equivalent: this is
20818 * the case with VAX floating point, for example.
20820 static void bytes(void *v, unsigned int n) {
20821 unsigned char *p = (unsigned char *)v;
20823 for (i = 0; i < n; i++) {
20824 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20827 int main(int argc, char *argv[]) {
20828 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20829 * because some compilers are 'smart' and not only warn but refuse to
20830 * compile such 'illegal' values. */
20831 double dinf = exp(1e9);
20832 double dnan = sqrt(-1.0);
20833 #ifdef HAS_LONG_DOUBLE
20834 long double ldinf = (long double)exp(1e9);
20835 long double ldnan = (long double)sqrt(-1.0);
20836 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20837 /* the 80-bit long doubles might have garbage in their excess bytes */
20838 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20839 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20843 switch (argv[1][0]) {
20844 case '1': bytes(&dinf, sizeof(dinf)); break;
20845 case '2': bytes(&dnan, sizeof(dnan)); break;
20846 #ifdef HAS_LONG_DOUBLE
20847 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20848 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20856 if eval $compile; then
20857 doubleinfbytes=`$run ./try 1`
20858 doublenanbytes=`$run ./try 2`
20859 case "$d_longdbl" in
20861 longdblinfbytes=`$run ./try 3`
20862 longdblnanbytes=`$run ./try 4`
20866 # Defaults in case the above test program failed.
20867 case "$doublekind" in
20868 1) # IEEE 754 32-bit LE
20869 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20870 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20872 2) # IEEE 754 32-bit BE
20873 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20874 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20876 3) # IEEE 754 64-bit LE
20877 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20878 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20880 4) # IEEE 754 64-bit BE
20881 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20882 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20884 5) # IEEE 754 128-bit LE
20885 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20886 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20888 6) # IEEE 754 128-bit BE
20889 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20890 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20892 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20893 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20894 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20896 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20897 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20898 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20900 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20901 doubleinfbytes=$undef
20902 doublenanbytes=$undef
20905 doubleinfbytes=$undef
20906 doublenanbytes=$undef
20909 case "$longdblkind" in
20910 1) # IEEE 754 128-bit LE
20911 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20912 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20914 2) # IEEE 754 128-bit BE
20915 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20916 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20918 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20919 case "$longdblsize" in
20920 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20921 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20922 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20925 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20926 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20929 longdblinfbytes=$undef
20930 longdblnanbytes=$undef
20934 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20935 case "$longdblsize" in
20936 12) # 32-bit system
20937 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20938 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20940 16) # 64-bit system
20941 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20942 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20945 longdblinfbytes=$undef
20946 longdblnanbytes=$undef
20950 5) # 128-bit LE-LE "double double"
20951 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20952 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20954 6) # 128-bit BE-BE "double double"
20955 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20956 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20958 7) # 128-bit LE-BE "double double"
20959 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20960 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20962 8) # 128-bit BE-LE "double double"
20963 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20964 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20966 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20967 longdblinfbytes=$undef
20968 longdblnanbytes=$undef
20971 longdblinfbytes=$undef
20972 longdblnanbytes=$undef
20976 # In case the program crashed the values are empty, turn them undef.
20977 case "$doubleinfbytes" in
20978 '') doubleinfbytes=$undef ;;
20980 case "$doublenanbytes" in
20981 '') doublenanbytes=$undef ;;
20983 case "$longdblinfbytes" in
20984 '') longdblinfbytes=$undef ;;
20986 case "$longdblnanbytes" in
20987 '') longdblnanbytes=$undef ;;
20991 : Check the length of the double mantissa
20992 $echo "Checking how many mantissa bits your doubles have..." >&4
20994 #$i_sunmath I_SUNMATH
20997 # include <sunmath.h>
20999 #ifdef DBL_MANT_DIG
21000 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
21003 int main(int argc, char *argv[]) {
21005 printf("%d\n", BITS);
21011 if eval $compile; then
21012 doublemantbits=`$run ./try`
21014 doublemantbits="$undef"
21018 : Check the length of the longdouble mantissa
21019 $echo "Checking how many mantissa bits your long doubles have..." >&4
21021 #$i_sunmath I_SUNMATH
21024 # include <sunmath.h>
21026 #$d_longdbl HAS_LONG_DOUBLE
21027 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
21028 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
21029 /* This format has no implicit bit. Beware, however, that for
21030 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
21031 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
21032 * and the top bit must have been one since 387, zero is plain invalid.
21033 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
21034 # define BITS LDBL_MANT_DIG
21035 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
21036 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
21037 * reason e.g. Irix thinks 107. But in any case, we want only
21038 * the number of real bits, the implicit bits are of no interest. */
21039 # define BITS 2 * (DBL_MANT_DIG - 1)
21041 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
21045 int main(int argc, char *argv[]) {
21047 printf("%d\n", BITS);
21053 if eval $compile; then
21054 longdblmantbits=`$run ./try`
21056 longdblmantbits="$undef"
21060 : Check the length of the NV mantissa
21061 $echo "Checking how many mantissa bits your NVs have..." >&4
21062 if test "X$usequadmath" = "X$define"; then
21063 nvmantbits=112 # 128-1-15
21065 if test "X$nvsize" = "X$doublesize"; then
21066 nvmantbits="$doublemantbits"
21068 if test "X$nvsize" = "X$longdblsize"; then
21069 nvmantbits="$longdblmantbits"
21071 nvmantbits="$undef"
21076 : How can we generate normalized random numbers ?
21078 echo "Using our internal random number implementation..." >&4
21081 *-Dmy_rand=*|*-Dmy_srand=*)
21082 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
21083 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
21084 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
21085 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
21089 randfunc=Perl_drand48
21090 drand01="Perl_drand48()"
21091 seedfunc="Perl_drand48_init"
21095 : Probe whether dtrace builds an object, as newer Illumos requires an input
21096 : object file that uses at least one of the probes defined in the .d file
21097 case "$usedtrace" in
21099 case "$dtracexnolibs" in
21100 $define|true|[yY]*)
21101 dtracexnolibs=$define
21102 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
21105 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21106 dtracexnolibs=$define
21107 echo "Your dtrace accepts -xnolibs"
21108 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
21109 dtracexnolibs=$undef
21110 echo "Your dtrace doesn't accept -xnolibs"
21112 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
21117 dtracexnolibs=$undef
21118 $dtrace -h -s ../perldtrace.d -o perldtrace.h
21121 case $dtracexnolibs in
21122 $define) xnolibs=-xnolibs ;;
21126 case "$dtraceobject" in
21127 $define|true|[yY]*)
21128 dtraceobject=$define
21132 #include "perldtrace.h"
21134 PERL_LOADED_FILE("dummy");
21138 dtraceobject=$undef
21139 if $cc -c -o try.o $optimize $ccflags try.c \
21140 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
21141 dtraceobject=$define
21142 echo "Your dtrace builds an object file"
21145 *) dtraceobject=$undef ;;
21147 $rm_try perldtrace.o perldtrace.h
21150 : Determine if this is an EBCDIC system
21152 echo "Determining whether or not we are on an EBCDIC system..." >&4
21153 $cat >try.c <<'EOM'
21156 if ('M'==0xd4) return 0;
21163 if eval $compile_ok; then
21164 if $run ./try; then
21165 echo "You seem to speak EBCDIC." >&4
21168 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
21171 echo "I'm unable to compile the test program." >&4
21172 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
21178 : Check how to flush
21181 Checking how to flush all pending stdio output...
21183 # I only know how to find the first 32 possibly open files on SunOS.
21184 # See also hints/sunos_4_1.sh and util.c --AD
21186 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
21188 $cat >>try.c <<EOCP
21190 #$i_stdlib I_STDLIB
21192 #include <stdlib.h>
21194 #$i_unistd I_UNISTD
21196 # include <unistd.h>
21198 #$d_sysconf HAS_SYSCONF
21199 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
21200 #ifdef HAS_STDIO_STREAM_ARRAY
21201 # define STDIO_STREAM_ARRAY $stdio_stream_array
21206 p = fopen("try.out", "w");
21210 # ifdef TRY_FPRINTF
21214 #ifdef TRY_FFLUSH_NULL
21217 #ifdef TRY_FFLUSH_ALL
21219 long open_max = -1;
21220 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
21221 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
21223 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
21224 open_max = sysconf(_SC_OPEN_MAX);
21227 open_max = FOPEN_MAX;
21230 open_max = OPEN_MAX;
21239 # ifdef HAS_STDIO_STREAM_ARRAY
21240 if (open_max > 0) {
21242 for (i = 0; i < open_max; i++)
21243 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
21244 STDIO_STREAM_ARRAY[i]._file < open_max &&
21245 STDIO_STREAM_ARRAY[i]._flag)
21246 fflush(&STDIO_STREAM_ARRAY[i]);
21254 : first we have to find out how _not_ to flush
21256 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
21258 set try -DTRY_FPUTC
21259 if eval $compile; then
21260 $run ./try 2>/dev/null
21263 if $test ! -s try.out -a "X$code" = X42; then
21269 set try -DTRY_FPRINTF
21270 if eval $compile; then
21271 $run ./try 2>/dev/null
21274 if $test ! -s try.out -a "X$code" = X42; then
21275 output=-DTRY_FPRINTF
21281 : check for fflush NULL behavior
21282 case "$fflushNULL" in
21283 '') set try -DTRY_FFLUSH_NULL $output
21284 if eval $compile; then
21285 $run ./try 2>/dev/null
21288 if $test -s try.out -a "X$code" = X42; then
21289 fflushNULL="`$cat try.out`"
21291 if $test "X$code" != X42; then
21293 (If this test failed, don't worry, we'll try another method shortly.)
21298 $rm -f core try.core core.try.*
21299 case "$fflushNULL" in
21301 Your fflush(NULL) works okay for output streams.
21302 Let's see if it clobbers input pipes...
21304 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21305 # bug that improperly flushes the input end of pipes. So we avoid the
21306 # autoflush on fork/system/exec support for now. :-(
21307 $cat >tryp.c <<EOCP
21310 main(int argc, char **argv)
21316 while ((i = getc(stdin)) != -1
21317 && (*bp++ = i) != '\n'
21318 && bp < &buf[1024])
21321 fprintf(stdout, "%s", buf);
21329 fflushNULL="$define"
21331 if eval $compile; then
21333 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21334 if $test "X$targethost" != X; then
21337 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21339 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21341 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21343 fflush(NULL) seems to behave okay with input streams.
21345 fflushNULL="$define"
21348 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21350 fflushNULL="$undef"
21353 $rm -f core tryp.c tryp.core core.tryp.*
21356 Your fflush(NULL) isn't working (contrary to ANSI C).
21358 fflushNULL="$undef"
21361 Cannot figure out whether your fflush(NULL) works or not.
21362 I'm assuming it doesn't (contrary to ANSI C).
21364 fflushNULL="$undef"
21368 $define|true|[yY]*)
21369 fflushNULL="$define"
21372 fflushNULL="$undef"
21375 : check explicit looping only if NULL did not work, and if the pipe
21376 : bug does not show up on an explicit flush too
21377 case "$fflushNULL" in
21379 $cat >tryp.c <<EOCP
21382 main(int argc, char **argv)
21388 while ((i = getc(stdin)) != -1
21389 && (*bp++ = i) != '\n'
21390 && bp < &buf[1024])
21393 fprintf(stdout, "%s", buf);
21402 if eval $compile; then
21404 if $test "X$targethost" != X; then
21407 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21409 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21411 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21413 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21415 : now check for fflushall behaviour
21416 case "$fflushall" in
21417 '') set try -DTRY_FFLUSH_ALL $output
21418 if eval $compile; then
21420 (Now testing the other method--but note that this also may fail.)
21422 $run ./try 2>/dev/null
21425 if $test -s try.out -a "X$code" = X42; then
21426 fflushall="`$cat try.out`"
21430 case "$fflushall" in
21432 Whew. Flushing explicitly all the stdio streams works.
21434 fflushall="$define"
21437 Sigh. Flushing explicitly all the stdio streams doesn't work.
21442 Cannot figure out whether flushing stdio streams explicitly works or not.
21443 I'm assuming it doesn't.
21449 "$define"|true|[yY]*)
21450 fflushall="$define"
21458 All is futile. Even fflush(stdin) clobbers input pipes!
21465 $rm -f core tryp.c tryp.core core.tryp.*
21467 *) fflushall="$undef"
21471 case "$fflushNULL$fflushall" in
21474 OK, I give up. I cannot figure out how to flush pending stdio output.
21475 We won't be flushing handles at all before fork/exec/popen.
21481 : Store the full pathname to the ar program for use in the C program
21482 : Respect a hint or command line value for full_ar.
21487 : Store the full pathname to the sed program for use in the C program
21490 : see what type gids are declared as in the kernel
21492 echo "Looking for the type for group ids returned by getgid()."
21493 set gid_t gidtype xxx stdio.h sys/types.h
21497 xxx=`./findhdr sys/user.h`
21498 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21500 unsigned) dflt="$1 $2" ;;
21504 *) dflt="$gidtype";;
21507 gid_t) echo "gid_t found." ;;
21508 *) rp="What is the type for group ids returned by getgid()?"
21514 : Check the size of GID
21517 *_t) zzz="$gidtype" ;;
21520 echo "Checking the size of $zzz..." >&4
21522 #include <sys/types.h>
21524 #$i_stdlib I_STDLIB
21526 #include <stdlib.h>
21529 printf("%d\n", (int)sizeof($gidtype));
21534 if eval $compile_ok; then
21538 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21541 echo "Your $zzz is $gidsize bytes long."
21546 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21549 : Check if GID is signed
21552 *_t) zzz="$gidtype" ;;
21555 echo "Checking the sign of $zzz..." >&4
21557 #include <sys/types.h>
21568 if eval $compile; then
21572 echo "(I can't execute the test program--guessing unsigned.)" >&4
21576 1) echo "Your $zzz is unsigned." ;;
21577 -1) echo "Your $zzz is signed." ;;
21583 echo "(I can't compile the test program--guessing unsigned.)" >&4
21586 : Check 64bit sizes
21589 if $test X"$quadtype" != X; then
21591 echo "Checking how to print 64-bit integers..." >&4
21593 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21594 $cat >try.c <<'EOCP'
21595 #include <sys/types.h>
21598 int q = 12345678901;
21599 printf("%ld\n", q);
21603 if eval $compile; then
21607 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21608 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21609 echo "We will use %d."
21615 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21616 $cat >try.c <<'EOCP'
21617 #include <sys/types.h>
21620 long q = 12345678901;
21621 printf("%ld\n", q);
21625 if eval $compile; then
21629 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21630 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21631 echo "We will use %ld."
21637 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21638 $cat >try.c <<'EOCP'
21639 #include <sys/types.h>
21640 #include <inttypes.h>
21643 int64_t q = 12345678901;
21644 printf("%" PRId64 "\n", q);
21648 if eval $compile; then
21652 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21653 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIX64;
21654 echo "We will use the C9X style."
21660 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21662 #include <sys/types.h>
21665 $quadtype q = 12345678901;
21666 printf("%Ld\n", q);
21670 if eval $compile; then
21674 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21675 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21676 echo "We will use %Ld."
21682 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21683 $cat >try.c <<'EOCP'
21684 #include <sys/types.h>
21687 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21688 printf("%lld\n", q);
21692 if eval $compile; then
21696 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21697 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21698 echo "We will use the %lld style."
21704 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21706 #include <sys/types.h>
21709 $quadtype q = 12345678901;
21710 printf("%qd\n", q);
21714 if eval $compile; then
21718 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21719 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21720 echo "We will use %qd."
21726 if $test X"$sPRId64" = X; then
21727 echo "Cannot figure out how to print 64-bit integers." >&4
21734 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21735 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21737 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21738 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21742 : Check format strings for internal types
21744 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21746 if $test X"$ivsize" = X8; then
21747 ivdformat="$sPRId64"
21748 uvuformat="$sPRIu64"
21749 uvoformat="$sPRIo64"
21750 uvxformat="$sPRIx64"
21751 uvXUformat="$sPRIXU64"
21753 if $test X"$ivsize" = X"$longsize"; then
21760 if $test X"$ivsize" = X"$intsize"; then
21768 if $test X"$ivsize" = X"$shortsize"; then
21779 if $test X"$usequadmath" = X"$define"; then
21787 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21788 nveformat="$sPRIeldbl"
21789 nvfformat="$sPRIfldbl"
21790 nvgformat="$sPRIgldbl"
21791 nvEUformat="$sPRIEUldbl"
21792 nvFUformat="$sPRIFUldbl"
21793 nvGUformat="$sPRIGUldbl"
21804 case "$ivdformat" in
21805 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21810 : Check format string for GID
21813 $echo "Checking the format string to be used for gids..." >&4
21816 -1) if $test X"$gidsize" = X"$ivsize"; then
21817 gidformat="$ivdformat"
21819 if $test X"$gidsize" = X"$longsize"; then
21822 if $test X"$gidsize" = X"$intsize"; then
21825 if $test X"$gidsize" = X"$shortsize"; then
21832 *) if $test X"$gidsize" = X"$uvsize"; then
21833 gidformat="$uvuformat"
21835 if $test X"$gidsize" = X"$longsize"; then
21838 if $test X"$gidsize" = X"$intsize"; then
21841 if $test X"$gidsize" = X"$shortsize"; then
21850 : see if getgroups exists
21851 set getgroups d_getgrps
21854 : see if setgroups exists
21855 set setgroups d_setgrps
21858 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21860 case "$d_getgrps$d_setgrps" in
21862 case "$groupstype" in
21863 '') dflt="$gidtype" ;;
21864 *) dflt="$groupstype" ;;
21867 What type of pointer is the second argument to getgroups() and setgroups()?
21868 Usually this is the same as group ids, $gidtype, but not always.
21871 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21875 *) groupstype="$gidtype";;
21878 : check whether make sets MAKE
21880 echo "Checking if your $make program sets \$(MAKE)..." >&4
21881 case "$make_set_make" in
21883 $sed 's/^X //' > testmake.mak << 'EOF'
21885 X @echo 'maketemp="$(MAKE)"'
21887 case "`$make -f testmake.mak 2>/dev/null`" in
21888 *maketemp=*) make_set_make='#' ;;
21889 *) make_set_make="MAKE=$make" ;;
21891 $rm -f testmake.mak
21894 case "$make_set_make" in
21895 '#') echo "Yup, it does.";;
21896 *) echo "Nope, it doesn't.";;
21899 : see what type is used for mode_t
21900 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21901 set mode_t modetype int stdio.h sys/types.h
21904 : see if we need va_copy
21907 #include <stdarg.h>
21909 #include <stdlib.h>
21910 #include <signal.h>
21913 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21915 return vfprintf(f, fmt, *valp);
21919 myvfprintf(FILE *f, const char *fmt, va_list val)
21921 return ivfprintf(f, fmt, &val);
21925 myprintf(char *fmt, ...)
21928 va_start(val, fmt);
21929 return myvfprintf(stdout, fmt, val);
21933 main(int ac, char **av)
21935 signal(SIGSEGV, exit);
21937 signal(SIGBUS, exit);
21940 myprintf("%s%cs all right, then\n", "that", '\'');
21945 if eval $compile && $run ./try 2>&1 >/dev/null; then
21946 case "`$run ./try`" in
21947 "that's all right, then")
21953 yes) echo "It seems that you don't need va_copy()." >&4
21954 need_va_copy="$undef"
21956 *) echo "It seems that va_copy() or similar will be needed." >&4
21957 need_va_copy="$define"
21962 : see what type is used for size_t
21963 rp="What is the type used for the length parameter for string functions?"
21964 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21967 : check for type of arguments to gethostbyaddr.
21968 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21969 case "$d_gethbyaddr" in
21973 Checking to see what type of arguments are accepted by gethostbyaddr().
21975 hdrs="$define sys/types.h
21976 $d_socket sys/socket.h
21977 $i_niin netinet/in.h
21979 $i_unistd unistd.h"
21980 : The first arg can 'char *' or 'void *'
21981 : The second arg is some of integral type
21982 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21983 for yyy in size_t long int; do
21984 case "$netdb_host_type" in
21985 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21986 if ./protochk "$try" $hdrs; then
21987 echo "Your system accepts $xxx for the first arg."
21988 echo "...and $yyy for the second arg."
21989 netdb_host_type="$xxx"
21990 netdb_hlen_type="$yyy"
21996 : In case none of those worked, prompt the user.
21997 case "$netdb_host_type" in
21998 '') rp='What is the type for the 1st argument to gethostbyaddr?'
22001 netdb_host_type=$ans
22002 rp='What is the type for the 2nd argument to gethostbyaddr?'
22005 netdb_hlen_type=$ans
22009 *) : no gethostbyaddr, so pick harmless defaults
22010 netdb_host_type='char *'
22011 netdb_hlen_type="$sizetype"
22014 # Remove the "const" if needed. -- but then we'll have a
22016 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
22019 : check for type of argument to gethostbyname.
22020 if test "X$netdb_name_type" = X ; then
22021 case "$d_gethbyname" in
22025 Checking to see what type of argument is accepted by gethostbyname().
22027 hdrs="$define sys/types.h
22028 $d_socket sys/socket.h
22029 $i_niin netinet/in.h
22031 $i_unistd unistd.h"
22032 for xxx in "const char *" "char *"; do
22033 case "$netdb_name_type" in
22034 '') try="$extern_C struct hostent *gethostbyname($xxx);"
22035 if ./protochk "$try" $hdrs; then
22036 echo "Your system accepts $xxx."
22037 netdb_name_type="$xxx"
22042 : In case none of those worked, prompt the user.
22043 case "$netdb_name_type" in
22044 '') rp='What is the type for the 1st argument to gethostbyname?'
22047 netdb_name_type=$ans
22051 *) : no gethostbyname, so pick harmless default
22052 netdb_name_type='char *'
22057 : check for type of 1st argument to getnetbyaddr.
22058 if test "X$netdb_net_type" = X ; then
22059 case "$d_getnbyaddr" in
22063 Checking to see what type of 1st argument is accepted by getnetbyaddr().
22065 hdrs="$define sys/types.h
22066 $d_socket sys/socket.h
22067 $i_niin netinet/in.h
22069 $i_unistd unistd.h"
22070 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
22071 case "$netdb_net_type" in
22072 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
22073 if ./protochk "$try" $hdrs; then
22074 echo "Your system accepts $xxx."
22075 netdb_net_type="$xxx"
22080 : In case none of those worked, prompt the user.
22081 case "$netdb_net_type" in
22082 '') rp='What is the type for the 1st argument to getnetbyaddr?'
22085 netdb_net_type=$ans
22089 *) : no getnetbyaddr, so pick harmless default
22090 netdb_net_type='long'
22094 : locate the preferred pager for this system
22101 [a-zA-Z]:/*) dflt=$pg;;
22105 [a-zA-Z]:/*) dflt=$more;;
22109 [a-zA-Z]:/*) dflt=$less;;
22112 '') dflt=/usr/ucb/more;;
22120 rp='What pager is used on your system?'
22124 : see if ar generates random libraries by itself
22126 echo "Checking how to generate random libraries on your machine..." >&4
22127 echo 'int bar1() { return bar2(); }' > bar1.c
22128 echo 'int bar2() { return 2; }' > bar2.c
22130 #$i_stdlib I_STDLIB
22132 #include <stdlib.h>
22134 int main() { printf("%d\n", bar1()); exit(0); }
22136 $cc $ccflags -c bar1.c >/dev/null 2>&1
22137 $cc $ccflags -c bar2.c >/dev/null 2>&1
22138 $cc $ccflags -c foo.c >/dev/null 2>&1
22139 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
22140 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22141 $run ./foobar >/dev/null 2>&1; then
22142 echo "$ar appears to generate random libraries itself."
22144 if [ "X$ranlib" = "X" ]; then
22147 elif $ar s bar$_a >/dev/null 2>&1 &&
22148 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22149 $run ./foobar >/dev/null 2>&1; then
22150 echo "a table of contents needs to be added with '$ar s'."
22153 elif $ar ts bar$_a >/dev/null 2>&1 &&
22154 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
22155 $run ./foobar >/dev/null 2>&1; then
22156 echo "a table of contents needs to be added with '$ar ts'."
22163 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
22164 $test -f $ranlib || ranlib=''
22167 if $test -n "$ranlib"; then
22168 echo "your system has '$ranlib'; we'll use that."
22171 echo "your system doesn't seem to support random libraries"
22172 echo "so we'll use lorder and tsort to order the libraries."
22179 : Check the max offset that gmtime and localtime accept
22180 echo "Checking max offsets that gmtime () accepts"
22182 case "$sGMTIME_min/$sGMTIME_max" in
22185 #include <sys/types.h>
22193 void gm_check (time_t t, int min_year, int max_year)
22196 if ( tmp == NULL ||
22197 /* Check tm_year overflow */
22198 tmp->tm_year < min_year || tmp->tm_year > max_year)
22209 gm_check (MAXLONG, 69, 0x7fffffff);
22211 if (tmp == NULL || tmp->tm_year < 0) {
22212 for (i = 63; i >= 0; i--) {
22213 time_t x = pt | ((time_t)1 << i);
22214 if (x < 0 || x < pt) continue;
22215 gm_check (x, 69, 0x7fffffff);
22218 printf ("sGMTIME_max=%ld\n", pt);
22227 gm_check (MINLONG, -1900, 70);
22230 for (i = 36; i >= 0; i--) {
22231 time_t x = pt - ((time_t)1 << i);
22232 if (x > 0) continue;
22233 gm_check (x, -1900, 70);
22236 printf ("sGMTIME_min=%ld\n", pt);
22240 int main (int argc, char *argv[])
22242 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22249 if eval $compile; then
22250 eval `$run ./try 2>/dev/null`
22252 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22258 echo "Checking max offsets that localtime () accepts"
22260 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22263 #include <sys/types.h>
22271 void local_check (time_t t, int min_year, int max_year)
22273 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22276 tmp = localtime (&t);
22277 if ( tmp == NULL ||
22278 /* Check tm_year overflow */
22279 tmp->tm_year < min_year || tmp->tm_year > max_year)
22283 } /* local_check */
22290 local_check (MAXLONG, 69, 0x7fffffff);
22292 if (tmp == NULL || tmp->tm_year < 0) {
22293 for (i = 63; i >= 0; i--) {
22294 time_t x = pt | ((time_t)1 << i);
22295 if (x < 0 || x < pt) continue;
22296 local_check (x, 69, 0x7fffffff);
22299 printf ("sLOCALTIME_max=%ld\n", pt);
22308 local_check (MINLONG, -1900, 70);
22311 for (i = 36; i >= 0; i--) {
22312 time_t x = pt - ((time_t)1 << i);
22313 if (x > 0) continue;
22314 local_check (x, -1900, 70);
22317 printf ("sLOCALTIME_min=%ld\n", pt);
22321 int main (int argc, char *argv[])
22329 if eval $compile; then
22330 eval `$run ./try 2>/dev/null`
22332 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22338 : check for type of arguments to select.
22339 case "$selecttype" in
22340 '') case "$d_select" in
22344 Checking to see what type of arguments are accepted by select().
22346 hdrs="$define sys/types.h
22347 $i_systime sys/time.h
22348 $i_sysselct sys/select.h
22349 $d_socket sys/socket.h"
22350 : The first arg can be int, unsigned, or size_t
22351 : The last arg may or may not be 'const'
22353 : void pointer has been seen but using that
22354 : breaks the selectminbits test
22355 for xxx in 'fd_set *' 'int *'; do
22356 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22357 for tmo in 'struct timeval *' 'const struct timeval *'; do
22359 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22360 if ./protochk "$try" $hdrs; then
22361 echo "Your system accepts $xxx."
22370 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22371 case "$d_fd_set" in
22372 $define) dflt="fd_set *" ;;
22381 *) : no select, so pick a harmless default
22388 : check for the select 'width'
22389 case "$selectminbits" in
22390 '') safebits=`expr $ptrsize \* 8`
22391 case "$d_select" in
22395 Checking to see on how many bits at a time your select() operates...
22398 #include <sys/types.h>
22400 #$i_systime I_SYS_TIME
22401 #$i_systimek I_SYS_TIME_KERNEL
22406 # ifdef I_SYS_TIME_KERNEL
22409 # include <sys/time.h>
22410 # ifdef I_SYS_TIME_KERNEL
22414 #$i_sysselct I_SYS_SELECT
22415 #ifdef I_SYS_SELECT
22416 #include <sys/select.h>
22418 #$d_socket HAS_SOCKET
22420 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22423 #$i_stdlib I_STDLIB
22425 #include <stdlib.h>
22428 #define S sizeof(*(b))
22430 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22431 #define NBITS (NBYTES * 8)
22433 char *s = (char *)malloc(NBYTES);
22442 fp = fopen("try.c", "r");
22448 b = ($selecttype)s;
22449 for (i = 0; i < NBITS; i++)
22453 select(fd + 1, b, 0, 0, &t);
22454 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22456 printf("%d\n", i + 1);
22461 if eval $compile_ok; then
22462 selectminbits=`$run ./try 2>/dev/null`
22463 case "$selectminbits" in
22465 Cannot figure out on how many bits at a time your select() operates.
22466 I'll play safe and guess it is $safebits bits.
22468 selectminbits=$safebits
22469 bits="$safebits bits"
22472 *) bits="$selectminbits bits" ;;
22474 echo "Your select() operates on $bits at a time." >&4
22476 rp='What is the minimum number of bits your select() operates on?'
22477 case "$byteorder" in
22478 12345678) dflt=64 ;;
22484 selectminbits="$val"
22488 *) : no select, so pick a harmless default
22489 selectminbits=$safebits
22495 : Trace out the files included by signal.h, then look for SIGxxx names.
22496 case "$sig_num_init" in
22498 if [ "X$fieldn" = X ]; then
22499 : Just make some guesses. We check them later.
22500 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22502 xxx=`echo '#include <signal.h>' |
22503 $cppstdin $cppminus $cppflags 2>/dev/null |
22504 $grep '^[ ]*#.*include' |
22505 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22506 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22509 for xx in $xxx /dev/null ; do
22510 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22512 case "$xxxfiles" in
22513 '') xxxfiles=`./findhdr signal.h` ;;
22516 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22517 print substr($2, 4, 20)
22519 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22520 print substr($3, 4, 20)
22522 : Append some common names just in case the awk scan failed.
22523 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22524 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22525 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22526 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22527 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22529 : generate a few handy files for later
22530 $cat > signal.c <<EOCP
22531 #include <sys/types.h>
22532 #include <signal.h>
22533 #$i_stdlib I_STDLIB
22535 #include <stdlib.h>
22540 /* Strange style to avoid deeply-nested #if/#else/#endif */
22543 # define NSIG (_NSIG)
22549 # define NSIG (SIGMAX+1)
22555 # define NSIG (SIG_MAX+1)
22561 # define NSIG (_SIG_MAX+1)
22567 # define NSIG (MAXSIG+1)
22573 # define NSIG (MAX_SIG+1)
22578 # ifdef SIGARRAYSIZE
22579 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22585 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22589 /* Default to some arbitrary number that's big enough to get most
22590 of the common signals.
22596 printf("NSIG %d\n", NSIG);
22602 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22604 printf "#ifdef SIG"; printf $1; printf "\n"
22605 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22606 printf $1; printf ");\n"
22610 printf "#endif /* JUST_NSIG */\n";
22611 printf "exit(0);\n}\n";
22614 $cat >signal.awk <<'EOP'
22615 BEGIN { ndups = 0 }
22616 $1 ~ /^NSIG$/ { nsig = $2 }
22617 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22618 if ($2 > maxsig) { maxsig = $2 }
22619 if (sig_name[$2]) {
22620 dup_name[ndups] = $1
22621 dup_num[ndups] = $2
22633 printf("NSIG %d\n", nsig);
22634 for (n = 1; n < nsig; n++) {
22636 printf("%s %d\n", sig_name[n], sig_num[n])
22639 printf("NUM%d %d\n", n, n)
22642 for (n = 0; n < ndups; n++) {
22643 printf("%s %d\n", dup_name[n], dup_num[n])
22647 $cat >signal_cmd <<EOS
22649 if $test -s signal.lst; then
22650 echo "Using your existing signal.lst file"
22655 $cat >>signal_cmd <<'EOS'
22658 if eval $compile_ok; then
22659 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22660 $uniq | $awk -f signal.awk >signal.lst
22662 echo "(I can't seem be able to compile the whole test program)" >&4
22663 echo "(I'll try it in little pieces.)" >&4
22664 set signal -DJUST_NSIG
22665 if eval $compile_ok; then
22666 $run ./signal$_exe > signal.nsg
22669 echo "I can't seem to figure out how many signals you have." >&4
22670 echo "Guessing 50." >&4
22671 echo 'NSIG 50' > signal.nsg
22673 : Now look at all the signal names, one at a time.
22674 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22675 $cat > signal.c <<EOCP
22676 #include <sys/types.h>
22677 #include <signal.h>
22680 printf("$xx %d\n", SIG${xx});
22685 if eval $compile; then
22686 echo "SIG${xx} found."
22687 $run ./signal$_exe >> signal.ls1
22689 echo "SIG${xx} NOT found."
22692 if $test -s signal.ls1; then
22693 $cat signal.nsg signal.ls1 |
22694 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22698 if $test -s signal.lst; then
22701 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22702 echo 'kill -l' >signal
22703 set X `csh -f <signal`
22707 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22709 echo $@ | $tr ' ' $trnl | \
22710 $awk '{ printf "%s %d\n", $1, ++s; }
22711 END { printf "NSIG %d\n", ++s }' >signal.lst
22713 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22715 chmod a+x signal_cmd
22716 $eunicefix signal_cmd
22720 : generate list of signal names
22721 case "$sig_num_init" in
22724 case "$sig_name_init" in
22726 *) case "$sig_num_init" in
22727 ''|*,*) doinit=yes ;;
22732 echo "Generating a list of signal names and numbers..." >&4
22734 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22735 sig_name=`$awk 'BEGIN { printf "ZERO " }
22736 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22737 sig_num=`$awk 'BEGIN { printf "0 " }
22738 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22739 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22740 !/^NSIG/ { printf "\"%s\", ", $1 }
22741 END { printf "0\n" }' signal.lst`
22742 sig_num_init=`$awk 'BEGIN { printf "0, " }
22743 !/^NSIG/ { printf "%d, ", $2}
22744 END { printf "0\n"}' signal.lst`
22747 echo "The following $sig_count signals are available:"
22749 echo $sig_name | $awk \
22750 'BEGIN { linelen = 0 }
22752 for (i = 1; i <= NF; i++) {
22753 name = "SIG" $i " "
22754 linelen = linelen + length(name)
22755 if (linelen > 70) {
22757 linelen = length(name)
22763 sig_size=`echo $sig_name | awk '{print NF}'`
22764 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22768 : Check size of size
22770 case "$sizetype" in
22771 *_t) zzz="$sizetype" ;;
22772 *) zzz="filesize" ;;
22774 echo "Checking the size of $zzz..." >&4
22776 #include <sys/types.h>
22778 #$i_stdlib I_STDLIB
22780 #include <stdlib.h>
22783 printf("%d\n", (int)sizeof($sizetype));
22788 if eval $compile_ok; then
22792 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22795 echo "Your $zzz size is $sizesize bytes."
22800 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22803 : check for socklen_t
22805 echo "Checking to see if you have socklen_t..." >&4
22807 #include <sys/types.h>
22808 #$d_socket HAS_SOCKET
22810 #include <sys/socket.h>
22812 int main() { socklen_t x = 16; }
22815 if eval $compile; then
22817 echo "You have socklen_t."
22820 echo "You do not have socklen_t."
22821 case "$sizetype" in
22822 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22829 : see if this is a socks.h system
22830 set socks.h i_socks
22833 : check for type of the size argument to socket calls
22834 case "$d_socket" in
22838 Checking to see what type is the last argument of accept().
22841 case "$d_socklen_t" in
22842 "$define") yyy="$yyy socklen_t"
22844 yyy="$yyy $sizetype int long unsigned"
22845 for xxx in $yyy; do
22846 case "$socksizetype" in
22847 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22848 case "$usesocks" in
22850 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22851 echo "Your system accepts '$xxx *' for the last argument of accept()."
22852 socksizetype="$xxx"
22855 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22856 echo "Your system accepts '$xxx *' for the last argument of accept()."
22857 socksizetype="$xxx"
22864 : In case none of those worked, prompt the user.
22865 case "$socksizetype" in
22866 '') rp='What is the type for socket address structure sizes?'
22873 *) : no sockets, so pick relatively harmless default
22878 : see what type is used for signed size_t
22879 set ssize_t ssizetype int stdio.h sys/types.h
22884 #$i_stdlib I_STDLIB
22886 #include <stdlib.h>
22888 #include <sys/types.h>
22889 #define Size_t $sizetype
22890 #define SSize_t $dflt
22893 if (sizeof(Size_t) == sizeof(SSize_t))
22895 else if (sizeof(Size_t) == sizeof(int))
22904 if eval $compile_ok && $run ./try > /dev/null; then
22905 ssizetype=`$run ./try`
22906 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22909 Help! I can't compile and run the ssize_t test program: please enlighten me!
22910 (This is probably a misconfiguration in your system or libraries, and
22911 you really ought to fix it. Still, I'll try anyway.)
22913 I need a type that is the same size as $sizetype, but is guaranteed to
22914 be signed. Common values are ssize_t, int and long.
22917 rp="What signed type is the same size as $sizetype?"
22923 : Check the size of st_dev
22925 $echo "Checking the size of st_dev..." >&4
22926 $cat > try.c <<EOCP
22927 #include <sys/stat.h>
22929 #$i_stdlib I_STDLIB
22931 #include <stdlib.h>
22935 printf("%d\n", (int)sizeof(st.st_dev));
22940 if eval $compile_ok; then
22944 $echo "(I can't execute the test program--guessing $st_dev_size.)" >&4
22946 *) st_dev_size=$val
22947 $echo "Your st_dev is $st_dev_size bytes long."
22952 $echo "(I can't compile the test program--guessing $st_dev_size.)" >&4
22956 : Check if st_dev is signed
22958 $echo "Checking the sign of st_dev..." >&4
22959 $cat > try.c <<EOCP
22960 #include <sys/stat.h>
22965 if (foo.st_dev < 0)
22972 if eval $compile; then
22976 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22978 *) st_dev_sign=$val
22979 case "$st_dev_sign" in
22980 1) $echo "Your st_dev is unsigned." ;;
22981 -1) $echo "Your st_dev is signed." ;;
22987 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22991 : Check the size of st_ino
22993 $echo "Checking the size of st_ino..." >&4
22994 $cat > try.c <<EOCP
22995 #include <sys/stat.h>
22997 #$i_stdlib I_STDLIB
22999 #include <stdlib.h>
23003 printf("%d\n", (int)sizeof(st.st_ino));
23008 if eval $compile_ok; then
23012 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
23014 *) st_ino_size=$val
23015 $echo "Your st_ino is $st_ino_size bytes long."
23020 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
23024 : Check if st_ino is signed
23026 $echo "Checking the sign of st_ino..." >&4
23027 $cat > try.c <<EOCP
23028 #include <sys/stat.h>
23033 if (foo.st_ino < 0)
23040 if eval $compile; then
23044 $echo "(I can't execute the test program--guessing unsigned.)" >&4
23046 *) st_ino_sign=$val
23047 case "$st_ino_sign" in
23048 1) $echo "Your st_ino is unsigned." ;;
23049 -1) $echo "Your st_ino is signed." ;;
23055 $echo "(I can't compile the test program--guessing unsigned.)" >&4
23059 : see what type of char stdio uses.
23061 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
23062 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
23063 echo "Your stdio uses unsigned chars." >&4
23064 stdchar="unsigned char"
23066 echo "Your stdio uses signed chars." >&4
23071 : Check size of UID
23074 *_t) zzz="$uidtype" ;;
23077 echo "Checking the size of $zzz..." >&4
23079 #include <sys/types.h>
23081 #$i_stdlib I_STDLIB
23083 #include <stdlib.h>
23086 printf("%d\n", (int)sizeof($uidtype));
23091 if eval $compile_ok; then
23095 echo "(I can't execute the test program--guessing $uidsize.)" >&4
23098 echo "Your $zzz is $uidsize bytes long."
23103 echo "(I can't compile the test program--guessing $uidsize.)" >&4
23106 : Check if UID is signed
23109 *_t) zzz="$uidtype" ;;
23112 echo "Checking the sign of $zzz..." >&4
23114 #include <sys/types.h>
23125 if eval $compile; then
23129 echo "(I can't execute the test program--guessing unsigned.)" >&4
23133 1) echo "Your $zzz is unsigned." ;;
23134 -1) echo "Your $zzz is signed." ;;
23140 echo "(I can't compile the test program--guessing unsigned.)" >&4
23143 : Check format string for UID
23145 $echo "Checking the format string to be used for uids..." >&4
23148 -1) if $test X"$uidsize" = X"$ivsize"; then
23149 uidformat="$ivdformat"
23151 if $test X"$uidsize" = X"$longsize"; then
23154 if $test X"$uidsize" = X"$intsize"; then
23157 if $test X"$uidsize" = X"$shortsize"; then
23164 *) if $test X"$uidsize" = X"$uvsize"; then
23165 uidformat="$uvuformat"
23167 if $test X"$uidsize" = X"$longsize"; then
23170 if $test X"$uidsize" = X"$intsize"; then
23173 if $test X"$uidsize" = X"$shortsize"; then
23182 : Ask about strict by default.
23183 case "$usedefaultstrict" in
23184 $define|true|[Yy]*)
23194 EXPERIMENTAL: Perl can now be built with strict on by default when not
23195 invoked with -e or -E. This is a diagnostic tool for development.
23197 Unless you are familiar with this feature, you should probably answer 'no'.
23201 rp='Would you like to build perl with strict enabled by default?'
23204 y|Y) val="$define" ;;
23207 set usedefaultstrict
23210 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
23212 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
23213 $cat >try.c <<'EOM'
23214 /* Intentionally a long probe as I'd like to sanity check that the exact
23215 approach is going to work, as thinking it will work, but only having it
23216 part working at runtime is worse than not having it. */
23218 #include <sys/types.h>
23219 #include <sys/sysctl.h>
23220 #include <sys/param.h>
23222 #include <string.h>
23223 #include <stdlib.h>
23224 #include <unistd.h>
23227 main(int argc, char **argv) {
23229 char *argv_leaf = strrchr(argv[0], '/');
23235 mib[1] = KERN_PROC;
23236 mib[2] = KERN_PROC_PATHNAME;
23240 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23244 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
23249 if (size < strlen(argv_leaf) + 1) {
23250 fprintf(stderr, "size %lu is too short for a path\n",
23251 (unsigned long) size);
23255 if (size > MAXPATHLEN * MAXPATHLEN) {
23256 fprintf(stderr, "size %lu is too long for a path\n",
23257 (unsigned long) size);
23261 buffer = (char *)malloc(size);
23267 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
23272 if (strlen(buffer) + 1 != size) {
23273 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
23274 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
23279 if (*buffer != '/') {
23280 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
23284 if (strstr(buffer, "/./")) {
23285 fprintf(stderr, "Contains /./: '%s'\n", buffer);
23289 if (strstr(buffer, "/../")) {
23290 fprintf(stderr, "Contains /../: '%s'\n", buffer);
23294 buffer_leaf = strrchr(buffer, '/');
23295 if (strcmp(buffer_leaf, argv_leaf) != 0) {
23296 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
23308 if eval $compile; then
23309 if $run ./try; then
23310 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
23313 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
23317 echo "I'm unable to compile the test program." >&4
23318 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
23322 set usekernprocpathname
23325 : Determine if we can use _NSGetExecutablePath to find executing program
23327 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
23328 $cat >try.c <<'EOM'
23329 /* Intentionally a long probe as I'd like to sanity check that the exact
23330 approach is going to work, as thinking it will work, but only having it
23331 part working at runtime is worse than not having it. */
23332 #include <mach-o/dyld.h>
23334 #include <stdlib.h>
23335 #include <sys/param.h>
23336 #include <string.h>
23339 main(int argc, char **argv) {
23341 uint32_t size = sizeof(buf);
23345 char *argv_leaf = strrchr(argv[0], '/');
23349 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23353 _NSGetExecutablePath(buf, &size);
23354 if (size > MAXPATHLEN * MAXPATHLEN) {
23355 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23356 (unsigned int) size);
23360 buffer = (char *)malloc(size);
23366 result = _NSGetExecutablePath(buffer, &size);
23368 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23369 result, (unsigned int) size);
23373 tidied = realpath(buffer, NULL);
23375 perror("realpath");
23381 if (*tidied != '/') {
23382 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23386 if (strstr(tidied, "/./")) {
23387 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23391 if (strstr(tidied, "/../")) {
23392 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23396 tidied_leaf = strrchr(tidied, '/');
23397 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23398 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23410 if eval $compile; then
23411 if $run ./try; then
23412 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23415 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23418 echo "I'm unable to compile the test program." >&4
23419 echo "I'll assume no _NSGetExecutablePath here." >&4
23422 set usensgetexecutablepath
23425 : Check if site customization support was requested
23426 case "$usesitecustomize" in
23427 $define|true|[Yy]*)
23428 usesitecustomize="$define"
23431 usesitecustomize="$undef"
23435 : determine compiler compiler
23444 if $test -f "$byacc$_exe"; then
23446 comp="byacc or $comp"
23448 if $test -f "$bison$_exe"; then
23449 comp="$comp or bison -y"
23451 rp="Which compiler compiler ($comp) shall I use?"
23460 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23466 : see if this is a bfd.h system
23470 : see if this is an execinfo.h system
23471 set execinfo.h i_execinfo
23474 : see if this is a fenv.h system
23478 : see if this is a fp.h system
23482 : see if this is a fp_class.h system
23483 set fp_class.h i_fp_class
23486 : see if gdbm.h is available
23491 : see if gdbm_open exists
23492 set gdbm_open d_gdbm_open
23494 case "$d_gdbm_open" in
23497 echo "We won't be including <gdbm.h>"
23506 : see if this is a ieeefp.h system
23507 case "$i_ieeefp" in
23508 '' ) set ieeefp.h i_ieeefp
23513 : see if this is a libutil.h system
23514 set libutil.h i_libutil
23517 : see if mach cthreads are available
23518 if test "X$usethreads" = "X$define"; then
23519 set mach/cthreads.h i_machcthr
23522 i_machcthr="$undef"
23525 : see if this is a mntent.h system
23526 set mntent.h i_mntent
23529 : see if net/errno.h is available
23531 set net/errno.h val
23534 : Unfortunately, it causes problems on some systems. Arrgh.
23537 cat > try.c <<'EOM'
23540 #include <net/errno.h>
23546 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23547 echo "We'll be including <net/errno.h>." >&4
23549 echo "We won't be including <net/errno.h>." >&4
23558 : see if netinet/tcp.h is available
23559 set netinet/tcp.h i_netinettcp
23562 : see if this is a poll.h system
23566 : see if this is a prot.h system
23570 : Preprocessor symbols
23572 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23573 $cat <<'EOSH' > Cppsym.know
23574 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23575 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23576 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23577 arch_pwr ardent ARM ARM32 atarist att386 att3b
23578 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23579 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23580 byteorder byte_order
23581 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23582 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23583 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23584 ELF encore EPI EXTENSIONS
23585 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23586 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23587 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23588 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23589 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23590 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23591 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23592 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23593 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23595 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23596 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23597 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23599 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23600 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23601 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23602 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23603 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23604 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23605 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23606 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23607 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23608 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23609 ns32000 ns32016 ns32332 ns32k nsc32000
23610 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23611 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23612 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23613 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23615 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23616 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23617 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23618 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23619 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23620 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23621 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23622 SYSV4 SYSV5 sysV68 sysV88
23623 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23624 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23625 tower32_800 tower32_850 tss
23626 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23627 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23628 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23629 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23630 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23631 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23633 vax venix VMESA vms
23634 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23635 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23638 # Maybe put other stuff here too.
23639 ./tr '-' '_' <<EOSH >>Cppsym.know
23642 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23643 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23644 $cat Cppsym.know > Cppsym.c
23645 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23646 $rm -f Cppsym.a Cppsym.b Cppsym.c
23647 cat <<EOSH > Cppsym
23649 if $test \$# -gt 0; then
23650 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23651 if $test -s Cppsym.got; then
23658 $tr " " "$trnl" | ./Cppsym.try
23664 cat <<EOSH > Cppsym.try
23666 cat <<'EOCP' > try.c
23669 #define STRINGIFY(a) "a"
23671 #if cpp_stuff == 42
23672 #define StGiFy(a) #a
23673 #define STRINGIFY(a) StGiFy(a)
23675 #if $cpp_stuff != 1 && $cpp_stuff != 42
23676 # include "Bletch: How does this C preprocessor stringify macros?"
23682 cat <<'EOSH' >> Cppsym.try
23684 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23685 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23686 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23687 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23689 echo 'return 0;}' >> try.c
23691 cat <<EOSH >> Cppsym.try
23693 case "$osname-$gccversion" in
23694 irix-) ccflags="\$ccflags -woff 1178" ;;
23695 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23697 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23699 chmod +x Cppsym.try
23700 $eunicefix Cppsym.try
23701 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23702 : Add in any Linux cpp "predefined macros":
23703 case "$osname::$gccversion" in
23704 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23706 rm -f $tHdrH'.h' $tHdrH
23708 # Filter out macro arguments, such as Linux's __INT8_C(c)
23709 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23710 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23711 if [ -s $tHdrH'_cppsym.real' ]; then
23712 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23715 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23718 : now check the C compiler for additional symbols
23719 postprocess_cc_v=''
23721 aix) postprocess_cc_v="|$tr , ' '" ;;
23728 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23731 -D*) echo "\$i" | $sed 's/^-D//';;
23732 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23737 postprocess_cc_v=''
23740 ./ccsym > ccsym1.raw
23741 if $test -s ccsym1.raw; then
23742 $sort ccsym1.raw | $uniq >ccsym.raw
23744 mv ccsym1.raw ccsym.raw
23747 $awk '/\=/ { print $0; next }
23748 { print $0"=1" }' ccsym.raw >ccsym.list
23749 $comm -13 Cppsym.true ccsym.list >ccsym.own
23750 $comm -12 Cppsym.true ccsym.list >ccsym.com
23751 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23753 if $test -z ccsym.raw; then
23754 echo "Your C compiler doesn't seem to define any symbols!" >&4
23756 echo "However, your C preprocessor defines the following symbols:"
23759 cppsymbols=`$cat Cppsym.true`
23760 cppsymbols=`echo $cppsymbols`
23761 cppccsymbols="$cppsymbols"
23763 if $test -s ccsym.com; then
23764 echo "Your C compiler and pre-processor define these symbols:"
23765 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23768 cppccsymbols=`$cat ccsym.com`
23769 cppccsymbols=`echo $cppccsymbols`
23770 $test "$silent" || sleep 1
23772 if $test -s ccsym.cpp; then
23773 $test "$also" && echo " "
23774 echo "Your C pre-processor ${also}defines the following symbols:"
23775 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23777 cppsymbols=`$cat ccsym.cpp`
23778 cppsymbols=`echo $cppsymbols`
23779 $test "$silent" || sleep 1
23781 if $test -s ccsym.own; then
23782 $test "$also" && echo " "
23783 echo "Your C compiler ${also}defines the following cpp symbols:"
23784 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23785 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23786 ccsymbols=`$cat ccsym.own`
23787 ccsymbols=`echo $ccsymbols`
23788 $test "$silent" || sleep 1
23792 : add -D_FORTIFY_SOURCE if feasible and not already there
23793 case "$gccversion" in
23794 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
23795 *-O*) case "$ccflags$cppsymbols" in
23796 *_FORTIFY_SOURCE=*) # Don't add it again.
23797 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23799 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23800 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23804 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23808 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23812 : script used to emit important warnings
23815 if test \$# -gt 0; then
23820 echo "*** WARNING:" >&4
23821 sed -e 's/^/*** /' <msg >&4
23823 cat msg >>config.msg
23824 echo " " >>config.msg
23830 : see if this is a termio system
23834 if $test `./findhdr termios.h`; then
23835 set tcsetattr i_termios
23841 "$define") echo "You have POSIX termios.h... good!" >&4;;
23842 *) if ./Cppsym pyr; then
23843 case "`$run /bin/universe`" in
23844 ucb) if $test `./findhdr sgtty.h`; then
23846 echo "<sgtty.h> found." >&4
23848 echo "System is pyramid with BSD universe."
23849 ./warn "<sgtty.h> not found--you could have problems."
23851 *) if $test `./findhdr termio.h`; then
23853 echo "<termio.h> found." >&4
23855 echo "System is pyramid with USG universe."
23856 ./warn "<termio.h> not found--you could have problems."
23860 if $test `./findhdr termio.h`; then
23861 echo "<termio.h> found." >&4
23863 elif $test `./findhdr sgtty.h`; then
23864 echo "<sgtty.h> found." >&4
23867 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23870 if $test `./findhdr sgtty.h`; then
23871 echo "<sgtty.h> found." >&4
23873 elif $test `./findhdr termio.h`; then
23874 echo "<termio.h> found." >&4
23877 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23881 set i_termio; eval $setvar
23882 val=$val2; set i_sgtty; eval $setvar
23883 val=$val3; set i_termios; eval $setvar
23885 : see if stdbool is available
23886 : we want a real compile instead of Inhdr because some Solaris systems
23887 : have stdbool.h, but it can only be used if the compiler indicates it
23888 : is sufficiently c99-compliant.
23892 #include <stdbool.h>
23897 int main(int argc, char **argv)
23903 if eval $compile; then
23904 echo "<stdbool.h> found." >&4
23907 echo "<stdbool.h> NOT found." >&4
23914 : see if stdint is available
23915 set stdint.h i_stdint
23918 : see if sys/access.h is available
23919 set sys/access.h i_sysaccess
23922 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23923 set sys/filio.h i_sysfilio
23926 if $test `./findhdr sys/ioctl.h`; then
23928 echo '<sys/ioctl.h> found.' >&4
23931 if $test $i_sysfilio = "$define"; then
23932 echo '<sys/ioctl.h> NOT found.' >&4
23934 $test $i_sgtty = "$define" && xxx="sgtty.h"
23935 $test $i_termio = "$define" && xxx="termio.h"
23936 $test $i_termios = "$define" && xxx="termios.h"
23937 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23943 : see if socket ioctl defs are in sys/sockio.h
23945 xxx=`./findhdr sys/sockio.h`
23946 if $test "$xxx"; then
23947 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23949 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23952 echo "No socket ioctls found in <sys/sockio.h>." >&4
23957 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23963 : see if this is a syslog.h system
23964 set syslog.h i_syslog
23967 : see if this is a sys/mode.h system
23968 set sys/mode.h i_sysmode
23971 : see if there is a sys/poll.h file
23972 set sys/poll.h i_syspoll
23975 : see if sys/resource.h has to be included
23976 set sys/resource.h i_sysresrc
23979 : see if sys/security.h is available
23980 set sys/security.h i_syssecrt
23983 : see if this is a sys/statvfs.h system
23984 set sys/statvfs.h i_sysstatvfs
23987 : see if this is a sys/un.h system
23988 set sys/un.h i_sysun
23991 : see if this is a sys/utsname.h system
23992 set sys/utsname.h i_sysutsname
23995 : see if this is a syswait system
23996 set sys/wait.h i_syswait
23999 : see if this is a ustat.h system
24000 set ustat.h i_ustat
24003 : see if this is an utime system
24004 set utime.h i_utime
24007 : see if this is a vfork system
24010 set vfork.h i_vfork
24018 : see if wchar.h is present
24019 set wchar.h i_wchar
24024 echo "Looking for extensions..." >&4
24025 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
24026 : contain old or inaccurate or duplicate values.
24027 nonxs_extensions=''
24029 : We do not use find because it might not be available.
24030 : We do not just use MANIFEST because the user may have dropped
24031 : some additional extensions into the source tree and expect them
24034 : Function to recursively find available extensions, ignoring DynaLoader
24035 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
24036 : In 5.10.1 and later, extensions are stored in directories
24037 : like File-Glob instead of the older File/Glob/.
24041 DynaLoader|dynaload) ;;
24043 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
24044 case "$this_ext" in
24045 Scalar/List/Utils) this_ext="List/Util" ;;
24046 PathTools) this_ext="Cwd" ;;
24048 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
24049 if $contains " $this_ext " "$tdir/$$.tmp"; then
24051 echo "Duplicate directories detected for extension $xxx" >&4;
24052 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
24053 case "$knowitall" in
24061 echo "Ok. Stopping Configure." >&4;
24062 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
24065 echo "Ok. You will need to correct config.sh before running make." >&4;
24067 $ls -1 "$xxx" > "$tdir/$$.tmp";
24068 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
24069 xs_extensions="$xs_extensions $this_ext";
24070 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
24071 xs_extensions="$xs_extensions $this_ext";
24072 elif $test -d "$xxx"; then
24073 nonxs_extensions="$nonxs_extensions $this_ext";
24075 $rm -f "$tdir/$$.tmp";
24083 eval $find_extensions
24087 eval $find_extensions
24091 eval $find_extensions
24092 set X $xs_extensions
24094 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
24095 set X $nonxs_extensions
24097 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
24099 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
24101 : Now see which are supported on this system.
24103 for xxx in $xs_extensions ; do
24107 amigaos) avail_ext="$avail_ext $xxx" ;;
24112 $define) avail_ext="$avail_ext $xxx" ;;
24115 GDBM_File|gdbm_fil)
24117 $define) avail_ext="$avail_ext $xxx" ;;
24121 : XXX Do we need a useipcsysv variable here
24122 case "${d_msg}${d_sem}${d_shm}" in
24123 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
24126 NDBM_File|ndbm_fil)
24129 case "$osname-$use64bitint" in
24132 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
24135 *) avail_ext="$avail_ext $xxx" ;;
24140 ODBM_File|odbm_fil)
24141 case "${i_dbm}${i_rpcsvcdbm}" in
24143 case "$d_cplusplus" in
24144 define) ;; # delete as a function name will not work
24145 *) case "$osname-$use64bitint" in
24148 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
24151 *) avail_ext="$avail_ext $xxx" ;;
24159 case "$useopcode" in
24160 true|define|y) avail_ext="$avail_ext $xxx" ;;
24164 case "$useposix" in
24165 true|define|y) avail_ext="$avail_ext $xxx" ;;
24169 case "$d_socket" in
24170 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24173 I18N/Langinfo|langinfo)
24174 case "$uselanginfo" in
24175 true|define|y) avail_ext="$avail_ext $xxx" ;;
24178 Sys/Syslog|sys/syslog)
24180 amigaos) ;; # not really very useful on AmigaOS
24182 : XXX syslog requires socket
24183 case "$d_socket" in
24184 true|$define|y) avail_ext="$avail_ext $xxx" ;;
24189 threads|threads/shared)
24190 # threads and threads::shared are special cases.
24191 # To stop people from asking "Perl 5.8.0 was supposed
24192 # to have this new fancy threads implementation but my
24193 # perl doesn't have it" and from people trying to
24194 # (re)install the threads module using CPAN.pm and
24195 # CPAN.pm then offering to reinstall Perl 5.8.0,
24196 # the threads.pm and threads/shared.pm will always be
24197 # there, croaking informatively ("you need to rebuild
24198 # all of Perl with threads, sorry") when threads haven't
24199 # been compiled in.
24201 avail_ext="$avail_ext $xxx"
24207 cygwin) avail_ext="$avail_ext $xxx" ;;
24210 XS/APItest|xs/apitest)
24211 # This is just for testing. Skip it unless we have dynamic loading.
24214 $define) avail_ext="$avail_ext $xxx" ;;
24217 XS/Typemap|xs/typemap)
24218 # This is just for testing. Skip it unless we have dynamic loading.
24220 $define) avail_ext="$avail_ext $xxx" ;;
24223 *) avail_ext="$avail_ext $xxx"
24232 case "$onlyextensions" in
24234 *) keepextensions=''
24235 echo "You have requested that only certain extensions be included..." >&4
24236 for i in $onlyextensions; do
24237 case " $avail_ext " in
24239 echo "Keeping extension $i."
24240 keepextensions="$keepextensions $i"
24242 *) echo "Ignoring extension $i." ;;
24245 avail_ext="$keepextensions"
24249 case "$noextensions" in
24251 *) keepextensions=''
24252 echo "You have requested that certain extensions be ignored..." >&4
24253 for i in $avail_ext; do
24254 case " $noextensions " in
24255 *" $i "*) echo "Ignoring extension $i." ;;
24256 *) echo "Keeping extension $i.";
24257 keepextensions="$keepextensions $i"
24261 avail_ext="$keepextensions"
24265 : Now see which nonxs extensions are supported on this system.
24266 : For now assume all are.
24268 for xxx in $nonxs_extensions ; do
24272 *) nonxs_ext="$nonxs_ext $xxx"
24284 A number of extensions are supplied with $package. You may choose to
24285 compile these extensions for dynamic loading (the default), compile
24286 them into the $package executable (static loading), or not include
24287 them at all. Answer "none" to include no extensions.
24288 Note that DynaLoader is always built and need not be mentioned here.
24291 case "$dynamic_ext" in
24293 : Exclude those listed in static_ext
24295 for xxx in $avail_ext; do
24296 case " $static_ext " in
24298 *) dflt="$dflt $xxx" ;;
24305 *) dflt="$dynamic_ext"
24306 # Perhaps we are reusing an old out-of-date config.sh.
24309 if test X"$dynamic_ext" != X"$avail_ext"; then
24311 NOTICE: Your previous config.sh list may be incorrect.
24312 The extensions now available to you are
24314 but the default list from your previous config.sh is
24326 rp="What extensions do you wish to load dynamically?"
24329 none) dynamic_ext=' ' ;;
24330 *) dynamic_ext="$ans" ;;
24333 case "$static_ext" in
24335 : Exclude those already listed in dynamic linking
24337 for xxx in $avail_ext; do
24338 case " $dynamic_ext " in
24340 *) dflt="$dflt $xxx" ;;
24347 *) dflt="$static_ext"
24354 rp="What extensions do you wish to load statically?"
24357 none) static_ext=' ' ;;
24358 *) static_ext="$ans" ;;
24363 A number of extensions are supplied with $package. Answer "none"
24364 to include no extensions.
24365 Note that DynaLoader is always built and need not be mentioned here.
24368 case "$static_ext" in
24369 '') dflt="$avail_ext" ;;
24370 *) dflt="$static_ext"
24371 # Perhaps we are reusing an old out-of-date config.sh.
24374 if test X"$static_ext" != X"$avail_ext"; then
24376 NOTICE: Your previous config.sh list may be incorrect.
24377 The extensions now available to you are
24379 but the default list from your previous config.sh is
24388 : Exclude those that are not xs extensions
24392 rp="What extensions do you wish to include?"
24395 none) static_ext=' ' ;;
24396 *) static_ext="$ans" ;;
24401 # Encode is a special case. If we are building Encode as a static
24402 # extension, we need to explicitly list its subextensions as well.
24403 # For other nested extensions, this is handled automatically by
24404 # the appropriate Makefile.PL.
24405 case " $static_ext " in
24406 *" Encode "*) # Add the subextensions of Encode
24408 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24409 static_ext="$static_ext Encode/$xxx"
24410 known_extensions="$known_extensions Encode/$xxx"
24416 set X $dynamic_ext $static_ext $nonxs_ext
24420 # Sanity check: We require an extension suitable for use with
24421 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24422 # should show up as failures in the test suite, but it's helpful to
24423 # catch them now.) The 'extensions' list is normally sorted
24424 # alphabetically, so we need to accept either
24425 # DB_File ... Fcntl ... IO ....
24426 # or something like
24427 # Fcntl ... NDBM_File ... IO ....
24428 case " $extensions" in
24429 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24430 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24431 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24432 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24433 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24437 : Remove libraries needed only for extensions
24438 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24439 : The exception is SunOS 4.x, which needs them.
24440 case "${osname}X${osvers}" in
24444 *) case "$usedl" in
24445 $define|true|[yY]*)
24446 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24450 *) perllibs="$libs"
24456 : Remove build directory name from cppstdin so it can be used from
24457 : either the present location or the final installed location.
24459 : Get out of the UU directory to get correct path name.
24461 case "$cppstdin" in
24463 echo "Stripping down cppstdin path name"
24469 : end of configuration questions
24471 echo "End of configuration questions."
24474 : back to where it started
24475 if test -d ../UU; then
24479 : configuration may be unconditionally patched via a 'config.arch' file
24480 if $test -f config.arch; then
24481 echo "I see a config.arch file, loading it." >&4
24485 : configuration may be patched via a 'config.over' file
24486 if $test -f config.over; then
24489 rp='I see a config.over file. Do you wish to load it?'
24492 n*) echo "OK, I'll ignore it.";;
24494 echo "Configuration override changes have been loaded."
24499 : in case they want portability, strip down executable paths
24500 case "$d_portable" in
24503 echo "Stripping down executable paths..." >&4
24504 for file in $loclist $trylist; do
24506 eval $file=`basename $temp`
24511 : create config.sh file
24513 echo "Creating config.sh..." >&4
24514 $spitshell <<EOT >config.sh
24517 # This file was produced by running the Configure script. It holds all the
24518 # definitions figured out by Configure. Should you modify one of these values,
24519 # do not forget to propagate your changes by running "Configure -der". You may
24520 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24523 # Package name : $package
24524 # Source directory : $src
24525 # Configuration time: $cf_time
24526 # Configured by : $cf_by
24527 # Target system : $myuname
24530 : Add in command line options if available
24531 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24533 $spitshell <<EOT >>config.sh
24542 Revision='$Revision'
24550 alignbytes='$alignbytes'
24551 aphostname='$aphostname'
24552 api_revision='$api_revision'
24553 api_subversion='$api_subversion'
24554 api_version='$api_version'
24555 api_versionstring='$api_versionstring'
24558 archlibexp='$archlibexp'
24559 archname64='$archname64'
24560 archname='$archname'
24561 archobjs='$archobjs'
24562 asctime_r_proto='$asctime_r_proto'
24571 byteorder='$byteorder'
24573 castflags='$castflags'
24576 cccdlflags='$cccdlflags'
24577 ccdlflags='$ccdlflags'
24579 ccflags_uselargefiles='$ccflags_uselargefiles'
24581 ccsymbols='$ccsymbols'
24582 ccversion='$ccversion'
24584 cf_email='$cf_email'
24586 charbits='$charbits'
24587 charsize='$charsize'
24591 clocktype='$clocktype'
24593 compiler_warning='$compiler_warning'
24594 compress='$compress'
24595 contains='$contains'
24599 cpp_stuff='$cpp_stuff'
24600 cppccsymbols='$cppccsymbols'
24601 cppflags='$cppflags'
24603 cppminus='$cppminus'
24605 cppstdin='$cppstdin'
24606 cppsymbols='$cppsymbols'
24607 crypt_r_proto='$crypt_r_proto'
24608 cryptlib='$cryptlib'
24610 ctermid_r_proto='$ctermid_r_proto'
24611 ctime_r_proto='$ctime_r_proto'
24612 d_Gconvert='$d_Gconvert'
24613 d_PRIEUldbl='$d_PRIEUldbl'
24614 d_PRIFUldbl='$d_PRIFUldbl'
24615 d_PRIGUldbl='$d_PRIGUldbl'
24616 d_PRIXU64='$d_PRIXU64'
24617 d_PRId64='$d_PRId64'
24618 d_PRIeldbl='$d_PRIeldbl'
24619 d_PRIfldbl='$d_PRIfldbl'
24620 d_PRIgldbl='$d_PRIgldbl'
24621 d_PRIi64='$d_PRIi64'
24622 d_PRIo64='$d_PRIo64'
24623 d_PRIu64='$d_PRIu64'
24624 d_PRIx64='$d_PRIx64'
24625 d_SCNfldbl='$d_SCNfldbl'
24626 d__fwalk='$d__fwalk'
24627 d_accept4='$d_accept4'
24628 d_access='$d_access'
24629 d_accessx='$d_accessx'
24633 d_archlib='$d_archlib'
24634 d_asctime64='$d_asctime64'
24635 d_asctime_r='$d_asctime_r'
24640 d_attribute_always_inline='$d_attribute_always_inline'
24641 d_attribute_deprecated='$d_attribute_deprecated'
24642 d_attribute_format='$d_attribute_format'
24643 d_attribute_malloc='$d_attribute_malloc'
24644 d_attribute_nonnull='$d_attribute_nonnull'
24645 d_attribute_noreturn='$d_attribute_noreturn'
24646 d_attribute_pure='$d_attribute_pure'
24647 d_attribute_unused='$d_attribute_unused'
24648 d_attribute_visibility='$d_attribute_visibility'
24649 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24650 d_backtrace='$d_backtrace'
24652 d_bsdgetpgrp='$d_bsdgetpgrp'
24653 d_bsdsetpgrp='$d_bsdsetpgrp'
24654 d_builtin_add_overflow='$d_builtin_add_overflow'
24655 d_builtin_choose_expr='$d_builtin_choose_expr'
24656 d_builtin_expect='$d_builtin_expect'
24657 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24658 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24659 d_c99_variadic_macros='$d_c99_variadic_macros'
24660 d_casti32='$d_casti32'
24661 d_castneg='$d_castneg'
24664 d_chroot='$d_chroot'
24665 d_chsize='$d_chsize'
24667 d_clearenv='$d_clearenv'
24668 d_closedir='$d_closedir'
24669 d_cmsghdr_s='$d_cmsghdr_s'
24670 d_copysign='$d_copysign'
24671 d_copysignl='$d_copysignl'
24672 d_cplusplus='$d_cplusplus'
24674 d_crypt_r='$d_crypt_r'
24676 d_ctermid='$d_ctermid'
24677 d_ctermid_r='$d_ctermid_r'
24678 d_ctime64='$d_ctime64'
24679 d_ctime_r='$d_ctime_r'
24680 d_cuserid='$d_cuserid'
24681 d_dbminitproto='$d_dbminitproto'
24682 d_difftime64='$d_difftime64'
24683 d_difftime='$d_difftime'
24684 d_dir_dd_fd='$d_dir_dd_fd'
24686 d_dirnamlen='$d_dirnamlen'
24687 d_dladdr='$d_dladdr'
24688 d_dlerror='$d_dlerror'
24689 d_dlopen='$d_dlopen'
24690 d_dlsymun='$d_dlsymun'
24691 d_dosuid='$d_dosuid'
24692 d_double_has_inf='$d_double_has_inf'
24693 d_double_has_nan='$d_double_has_nan'
24694 d_double_has_negative_zero='$d_double_has_negative_zero'
24695 d_double_has_subnormals='$d_double_has_subnormals'
24696 d_double_style_cray='$d_double_style_cray'
24697 d_double_style_ibm='$d_double_style_ibm'
24698 d_double_style_ieee='$d_double_style_ieee'
24699 d_double_style_vax='$d_double_style_vax'
24700 d_drand48_r='$d_drand48_r'
24701 d_drand48proto='$d_drand48proto'
24704 d_duplocale='$d_duplocale'
24705 d_eaccess='$d_eaccess'
24706 d_endgrent='$d_endgrent'
24707 d_endgrent_r='$d_endgrent_r'
24708 d_endhent='$d_endhent'
24709 d_endhostent_r='$d_endhostent_r'
24710 d_endnent='$d_endnent'
24711 d_endnetent_r='$d_endnetent_r'
24712 d_endpent='$d_endpent'
24713 d_endprotoent_r='$d_endprotoent_r'
24714 d_endpwent='$d_endpwent'
24715 d_endpwent_r='$d_endpwent_r'
24716 d_endsent='$d_endsent'
24717 d_endservent_r='$d_endservent_r'
24718 d_eofnblk='$d_eofnblk'
24721 d_eunice='$d_eunice'
24724 d_faststdio='$d_faststdio'
24725 d_fchdir='$d_fchdir'
24726 d_fchmod='$d_fchmod'
24727 d_fchmodat='$d_fchmodat'
24728 d_fchown='$d_fchown'
24730 d_fcntl_can_lock='$d_fcntl_can_lock'
24731 d_fd_macros='$d_fd_macros'
24732 d_fd_set='$d_fd_set'
24733 d_fdclose='$d_fdclose'
24735 d_fds_bits='$d_fds_bits'
24736 d_fegetround='$d_fegetround'
24739 d_fgetpos='$d_fgetpos'
24740 d_finite='$d_finite'
24741 d_finitel='$d_finitel'
24742 d_flexfnam='$d_flexfnam'
24744 d_flockproto='$d_flockproto'
24749 d_fp_class='$d_fp_class'
24750 d_fp_classify='$d_fp_classify'
24751 d_fp_classl='$d_fp_classl'
24752 d_fpathconf='$d_fpathconf'
24753 d_fpclass='$d_fpclass'
24754 d_fpclassify='$d_fpclassify'
24755 d_fpclassl='$d_fpclassl'
24756 d_fpgetround='$d_fpgetround'
24757 d_fpos64_t='$d_fpos64_t'
24758 d_freelocale='$d_freelocale'
24759 d_frexpl='$d_frexpl'
24760 d_fs_data_s='$d_fs_data_s'
24761 d_fseeko='$d_fseeko'
24762 d_fsetpos='$d_fsetpos'
24763 d_fstatfs='$d_fstatfs'
24764 d_fstatvfs='$d_fstatvfs'
24766 d_ftello='$d_ftello'
24768 d_futimes='$d_futimes'
24769 d_gai_strerror='$d_gai_strerror'
24770 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24771 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24772 d_getaddrinfo='$d_getaddrinfo'
24773 d_getcwd='$d_getcwd'
24774 d_getenv_preserves_other_thread='$d_getenv_preserves_other_thread'
24775 d_getespwnam='$d_getespwnam'
24776 d_getfsstat='$d_getfsstat'
24777 d_getgrent='$d_getgrent'
24778 d_getgrent_r='$d_getgrent_r'
24779 d_getgrgid_r='$d_getgrgid_r'
24780 d_getgrnam_r='$d_getgrnam_r'
24781 d_getgrps='$d_getgrps'
24782 d_gethbyaddr='$d_gethbyaddr'
24783 d_gethbyname='$d_gethbyname'
24784 d_gethent='$d_gethent'
24785 d_gethname='$d_gethname'
24786 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24787 d_gethostbyname_r='$d_gethostbyname_r'
24788 d_gethostent_r='$d_gethostent_r'
24789 d_gethostprotos='$d_gethostprotos'
24790 d_getitimer='$d_getitimer'
24791 d_getlogin='$d_getlogin'
24792 d_getlogin_r='$d_getlogin_r'
24793 d_getmnt='$d_getmnt'
24794 d_getmntent='$d_getmntent'
24795 d_getnameinfo='$d_getnameinfo'
24796 d_getnbyaddr='$d_getnbyaddr'
24797 d_getnbyname='$d_getnbyname'
24798 d_getnent='$d_getnent'
24799 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24800 d_getnetbyname_r='$d_getnetbyname_r'
24801 d_getnetent_r='$d_getnetent_r'
24802 d_getnetprotos='$d_getnetprotos'
24803 d_getpagsz='$d_getpagsz'
24804 d_getpbyname='$d_getpbyname'
24805 d_getpbynumber='$d_getpbynumber'
24806 d_getpent='$d_getpent'
24807 d_getpgid='$d_getpgid'
24808 d_getpgrp2='$d_getpgrp2'
24809 d_getpgrp='$d_getpgrp'
24810 d_getppid='$d_getppid'
24811 d_getprior='$d_getprior'
24812 d_getprotobyname_r='$d_getprotobyname_r'
24813 d_getprotobynumber_r='$d_getprotobynumber_r'
24814 d_getprotoent_r='$d_getprotoent_r'
24815 d_getprotoprotos='$d_getprotoprotos'
24816 d_getprpwnam='$d_getprpwnam'
24817 d_getpwent='$d_getpwent'
24818 d_getpwent_r='$d_getpwent_r'
24819 d_getpwnam_r='$d_getpwnam_r'
24820 d_getpwuid_r='$d_getpwuid_r'
24821 d_getsbyname='$d_getsbyname'
24822 d_getsbyport='$d_getsbyport'
24823 d_getsent='$d_getsent'
24824 d_getservbyname_r='$d_getservbyname_r'
24825 d_getservbyport_r='$d_getservbyport_r'
24826 d_getservent_r='$d_getservent_r'
24827 d_getservprotos='$d_getservprotos'
24828 d_getspnam='$d_getspnam'
24829 d_getspnam_r='$d_getspnam_r'
24830 d_gettimeod='$d_gettimeod'
24831 d_gmtime64='$d_gmtime64'
24832 d_gmtime_r='$d_gmtime_r'
24833 d_gnulibc='$d_gnulibc'
24834 d_grpasswd='$d_grpasswd'
24835 d_has_C_UTF8='$d_has_C_UTF8'
24836 d_hasmntopt='$d_hasmntopt'
24840 d_ilogbl='$d_ilogbl'
24841 d_inc_version_list='$d_inc_version_list'
24842 d_inetaton='$d_inetaton'
24843 d_inetntop='$d_inetntop'
24844 d_inetpton='$d_inetpton'
24845 d_int64_t='$d_int64_t'
24846 d_ip_mreq='$d_ip_mreq'
24847 d_ip_mreq_source='$d_ip_mreq_source'
24848 d_ipv6_mreq='$d_ipv6_mreq'
24849 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24850 d_isascii='$d_isascii'
24851 d_isblank='$d_isblank'
24852 d_isfinite='$d_isfinite'
24853 d_isfinitel='$d_isfinitel'
24855 d_isinfl='$d_isinfl'
24856 d_isless='$d_isless'
24858 d_isnanl='$d_isnanl'
24859 d_isnormal='$d_isnormal'
24862 d_killpg='$d_killpg'
24863 d_lc_monetary_2008='$d_lc_monetary_2008'
24864 d_lchown='$d_lchown'
24865 d_ldbl_dig='$d_ldbl_dig'
24866 d_ldexpl='$d_ldexpl'
24867 d_lgamma='$d_lgamma'
24868 d_lgamma_r='$d_lgamma_r'
24869 d_libm_lib_version='$d_libm_lib_version'
24870 d_libname_unique='$d_libname_unique'
24872 d_linkat='$d_linkat'
24873 d_llrint='$d_llrint'
24874 d_llrintl='$d_llrintl'
24875 d_llround='$d_llround'
24876 d_llroundl='$d_llroundl'
24877 d_localeconv_l='$d_localeconv_l'
24878 d_localtime64='$d_localtime64'
24879 d_localtime_r='$d_localtime_r'
24880 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24881 d_locconv='$d_locconv'
24886 d_long_double_style_ieee='$d_long_double_style_ieee'
24887 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24888 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24889 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24890 d_long_double_style_vax='$d_long_double_style_vax'
24891 d_longdbl='$d_longdbl'
24892 d_longlong='$d_longlong'
24894 d_lrintl='$d_lrintl'
24895 d_lround='$d_lround'
24896 d_lroundl='$d_lroundl'
24897 d_lseekproto='$d_lseekproto'
24899 d_madvise='$d_madvise'
24900 d_malloc_good_size='$d_malloc_good_size'
24901 d_malloc_size='$d_malloc_size'
24902 d_malloc_usable_size='$d_malloc_usable_size'
24904 d_mbrlen='$d_mbrlen'
24905 d_mbrtowc='$d_mbrtowc'
24906 d_mbstowcs='$d_mbstowcs'
24907 d_mbtowc='$d_mbtowc'
24908 d_memmem='$d_memmem'
24909 d_memrchr='$d_memrchr'
24911 d_mkdtemp='$d_mkdtemp'
24912 d_mkfifo='$d_mkfifo'
24913 d_mkostemp='$d_mkostemp'
24914 d_mkstemp='$d_mkstemp'
24915 d_mkstemps='$d_mkstemps'
24916 d_mktime64='$d_mktime64'
24917 d_mktime='$d_mktime'
24920 d_modflproto='$d_modflproto'
24921 d_mprotect='$d_mprotect'
24923 d_msg_ctrunc='$d_msg_ctrunc'
24924 d_msg_dontroute='$d_msg_dontroute'
24925 d_msg_oob='$d_msg_oob'
24926 d_msg_peek='$d_msg_peek'
24927 d_msg_proxy='$d_msg_proxy'
24928 d_msgctl='$d_msgctl'
24929 d_msgget='$d_msgget'
24930 d_msghdr_s='$d_msghdr_s'
24931 d_msgrcv='$d_msgrcv'
24932 d_msgsnd='$d_msgsnd'
24934 d_munmap='$d_munmap'
24935 d_mymalloc='$d_mymalloc'
24937 d_nanosleep='$d_nanosleep'
24939 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24940 d_nearbyint='$d_nearbyint'
24941 d_newlocale='$d_newlocale'
24942 d_nextafter='$d_nextafter'
24943 d_nexttoward='$d_nexttoward'
24945 d_nl_langinfo='$d_nl_langinfo'
24946 d_nl_langinfo_l='$d_nl_langinfo_l'
24947 d_non_int_bitfields='$d_non_int_bitfields'
24948 d_nv_preserves_uv='$d_nv_preserves_uv'
24949 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24950 d_off64_t='$d_off64_t'
24951 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24952 d_oldpthreads='$d_oldpthreads'
24953 d_oldsock='$d_oldsock'
24955 d_openat='$d_openat'
24956 d_pathconf='$d_pathconf'
24958 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24959 d_phostname='$d_phostname'
24963 d_portable='$d_portable'
24965 d_prctl_set_name='$d_prctl_set_name'
24966 d_printf_format_null='$d_printf_format_null'
24967 d_procselfexe='$d_procselfexe'
24968 d_pseudofork='$d_pseudofork'
24969 d_pthread_atfork='$d_pthread_atfork'
24970 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24971 d_pthread_yield='$d_pthread_yield'
24972 d_ptrdiff_t='$d_ptrdiff_t'
24974 d_pwchange='$d_pwchange'
24975 d_pwclass='$d_pwclass'
24976 d_pwcomment='$d_pwcomment'
24977 d_pwexpire='$d_pwexpire'
24978 d_pwgecos='$d_pwgecos'
24979 d_pwpasswd='$d_pwpasswd'
24980 d_pwquota='$d_pwquota'
24983 d_querylocale='$d_querylocale'
24984 d_random_r='$d_random_r'
24985 d_re_comp='$d_re_comp'
24986 d_readdir64_r='$d_readdir64_r'
24987 d_readdir='$d_readdir'
24988 d_readdir_r='$d_readdir_r'
24989 d_readlink='$d_readlink'
24991 d_recvmsg='$d_recvmsg'
24992 d_regcmp='$d_regcmp'
24993 d_regcomp='$d_regcomp'
24994 d_remainder='$d_remainder'
24995 d_remquo='$d_remquo'
24996 d_rename='$d_rename'
24997 d_renameat='$d_renameat'
24998 d_rewinddir='$d_rewinddir'
25002 d_sbrkproto='$d_sbrkproto'
25003 d_scalbn='$d_scalbn'
25004 d_scalbnl='$d_scalbnl'
25005 d_sched_yield='$d_sched_yield'
25006 d_scm_rights='$d_scm_rights'
25007 d_seekdir='$d_seekdir'
25008 d_select='$d_select'
25010 d_semctl='$d_semctl'
25011 d_semctl_semid_ds='$d_semctl_semid_ds'
25012 d_semctl_semun='$d_semctl_semun'
25013 d_semget='$d_semget'
25015 d_sendmsg='$d_sendmsg'
25016 d_setegid='$d_setegid'
25017 d_setenv='$d_setenv'
25018 d_seteuid='$d_seteuid'
25019 d_setgrent='$d_setgrent'
25020 d_setgrent_r='$d_setgrent_r'
25021 d_setgrps='$d_setgrps'
25022 d_sethent='$d_sethent'
25023 d_sethostent_r='$d_sethostent_r'
25024 d_setitimer='$d_setitimer'
25025 d_setlinebuf='$d_setlinebuf'
25026 d_setlocale='$d_setlocale'
25027 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
25028 d_setlocale_r='$d_setlocale_r'
25029 d_setnent='$d_setnent'
25030 d_setnetent_r='$d_setnetent_r'
25031 d_setpent='$d_setpent'
25032 d_setpgid='$d_setpgid'
25033 d_setpgrp2='$d_setpgrp2'
25034 d_setpgrp='$d_setpgrp'
25035 d_setprior='$d_setprior'
25036 d_setproctitle='$d_setproctitle'
25037 d_setprotoent_r='$d_setprotoent_r'
25038 d_setpwent='$d_setpwent'
25039 d_setpwent_r='$d_setpwent_r'
25040 d_setregid='$d_setregid'
25041 d_setresgid='$d_setresgid'
25042 d_setresuid='$d_setresuid'
25043 d_setreuid='$d_setreuid'
25044 d_setrgid='$d_setrgid'
25045 d_setruid='$d_setruid'
25046 d_setsent='$d_setsent'
25047 d_setservent_r='$d_setservent_r'
25048 d_setsid='$d_setsid'
25049 d_setvbuf='$d_setvbuf'
25052 d_shmatprototype='$d_shmatprototype'
25053 d_shmctl='$d_shmctl'
25055 d_shmget='$d_shmget'
25056 d_sigaction='$d_sigaction'
25057 d_siginfo_si_addr='$d_siginfo_si_addr'
25058 d_siginfo_si_band='$d_siginfo_si_band'
25059 d_siginfo_si_errno='$d_siginfo_si_errno'
25060 d_siginfo_si_fd='$d_siginfo_si_fd'
25061 d_siginfo_si_pid='$d_siginfo_si_pid'
25062 d_siginfo_si_status='$d_siginfo_si_status'
25063 d_siginfo_si_uid='$d_siginfo_si_uid'
25064 d_siginfo_si_value='$d_siginfo_si_value'
25065 d_signbit='$d_signbit'
25066 d_sigprocmask='$d_sigprocmask'
25067 d_sigsetjmp='$d_sigsetjmp'
25068 d_sin6_scope_id='$d_sin6_scope_id'
25069 d_sitearch='$d_sitearch'
25070 d_snprintf='$d_snprintf'
25071 d_sockaddr_in6='$d_sockaddr_in6'
25072 d_sockaddr_sa_len='$d_sockaddr_sa_len'
25073 d_sockaddr_storage='$d_sockaddr_storage'
25074 d_sockatmark='$d_sockatmark'
25075 d_sockatmarkproto='$d_sockatmarkproto'
25076 d_socket='$d_socket'
25077 d_socklen_t='$d_socklen_t'
25078 d_sockpair='$d_sockpair'
25079 d_socks5_init='$d_socks5_init'
25081 d_srand48_r='$d_srand48_r'
25082 d_srandom_r='$d_srandom_r'
25083 d_sresgproto='$d_sresgproto'
25084 d_sresuproto='$d_sresuproto'
25086 d_statblks='$d_statblks'
25087 d_statfs_f_flags='$d_statfs_f_flags'
25088 d_statfs_s='$d_statfs_s'
25089 d_static_inline='$d_static_inline'
25090 d_statvfs='$d_statvfs'
25091 d_stdio_cnt_lval='$d_stdio_cnt_lval'
25092 d_stdio_ptr_lval='$d_stdio_ptr_lval'
25093 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
25094 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
25095 d_stdio_stream_array='$d_stdio_stream_array'
25096 d_stdiobase='$d_stdiobase'
25097 d_stdstdio='$d_stdstdio'
25098 d_strcoll='$d_strcoll'
25099 d_strerror_l='$d_strerror_l'
25100 d_strerror_r='$d_strerror_r'
25101 d_strftime='$d_strftime'
25102 d_strlcat='$d_strlcat'
25103 d_strlcpy='$d_strlcpy'
25104 d_strnlen='$d_strnlen'
25105 d_strtod='$d_strtod'
25106 d_strtod_l='$d_strtod_l'
25107 d_strtol='$d_strtol'
25108 d_strtold='$d_strtold'
25109 d_strtold_l='$d_strtold_l'
25110 d_strtoll='$d_strtoll'
25111 d_strtoq='$d_strtoq'
25112 d_strtoul='$d_strtoul'
25113 d_strtoull='$d_strtoull'
25114 d_strtouq='$d_strtouq'
25115 d_strxfrm='$d_strxfrm'
25116 d_strxfrm_l='$d_strxfrm_l'
25117 d_suidsafe='$d_suidsafe'
25118 d_symlink='$d_symlink'
25119 d_syscall='$d_syscall'
25120 d_syscallproto='$d_syscallproto'
25121 d_sysconf='$d_sysconf'
25122 d_sysernlst='$d_sysernlst'
25123 d_syserrlst='$d_syserrlst'
25124 d_system='$d_system'
25125 d_tcgetpgrp='$d_tcgetpgrp'
25126 d_tcsetpgrp='$d_tcsetpgrp'
25127 d_telldir='$d_telldir'
25128 d_telldirproto='$d_telldirproto'
25129 d_tgamma='$d_tgamma'
25130 d_thread_local='$d_thread_local'
25131 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
25133 d_timegm='$d_timegm'
25135 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
25136 d_tm_tm_zone='$d_tm_tm_zone'
25137 d_tmpnam_r='$d_tmpnam_r'
25138 d_towlower='$d_towlower'
25139 d_towupper='$d_towupper'
25141 d_truncate='$d_truncate'
25142 d_truncl='$d_truncl'
25143 d_ttyname_r='$d_ttyname_r'
25144 d_tzname='$d_tzname'
25145 d_u32align='$d_u32align'
25146 d_ualarm='$d_ualarm'
25149 d_union_semun='$d_union_semun'
25150 d_unlinkat='$d_unlinkat'
25151 d_unordered='$d_unordered'
25152 d_unsetenv='$d_unsetenv'
25153 d_uselocale='$d_uselocale'
25154 d_usleep='$d_usleep'
25155 d_usleepproto='$d_usleepproto'
25157 d_vendorarch='$d_vendorarch'
25158 d_vendorbin='$d_vendorbin'
25159 d_vendorlib='$d_vendorlib'
25160 d_vendorscript='$d_vendorscript'
25162 d_void_closedir='$d_void_closedir'
25163 d_voidsig='$d_voidsig'
25164 d_voidtty='$d_voidtty'
25165 d_vsnprintf='$d_vsnprintf'
25167 d_waitpid='$d_waitpid'
25168 d_wcrtomb='$d_wcrtomb'
25169 d_wcscmp='$d_wcscmp'
25170 d_wcstombs='$d_wcstombs'
25171 d_wcsxfrm='$d_wcsxfrm'
25172 d_wctomb='$d_wctomb'
25173 d_writev='$d_writev'
25176 db_hashtype='$db_hashtype'
25177 db_prefixtype='$db_prefixtype'
25178 db_version_major='$db_version_major'
25179 db_version_minor='$db_version_minor'
25180 db_version_patch='$db_version_patch'
25181 default_inc_excludes_dot='$default_inc_excludes_dot'
25182 direntrytype='$direntrytype'
25185 doubleinfbytes='$doubleinfbytes'
25186 doublekind='$doublekind'
25187 doublemantbits='$doublemantbits'
25188 doublenanbytes='$doublenanbytes'
25189 doublesize='$doublesize'
25191 drand48_r_proto='$drand48_r_proto'
25193 dtraceobject='$dtraceobject'
25194 dtracexnolibs='$dtracexnolibs'
25195 dynamic_ext='$dynamic_ext'
25201 endgrent_r_proto='$endgrent_r_proto'
25202 endhostent_r_proto='$endhostent_r_proto'
25203 endnetent_r_proto='$endnetent_r_proto'
25204 endprotoent_r_proto='$endprotoent_r_proto'
25205 endpwent_r_proto='$endpwent_r_proto'
25206 endservent_r_proto='$endservent_r_proto'
25207 eunicefix='$eunicefix'
25210 extensions='$extensions'
25211 extern_C='$extern_C'
25213 fflushNULL='$fflushNULL'
25214 fflushall='$fflushall'
25216 firstmakefile='$firstmakefile'
25218 fpossize='$fpossize'
25219 fpostype='$fpostype'
25220 freetype='$freetype'
25223 full_csh='$full_csh'
25224 full_sed='$full_sed'
25225 gccansipedantic='$gccansipedantic'
25226 gccosandvers='$gccosandvers'
25227 gccversion='$gccversion'
25228 getgrent_r_proto='$getgrent_r_proto'
25229 getgrgid_r_proto='$getgrgid_r_proto'
25230 getgrnam_r_proto='$getgrnam_r_proto'
25231 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
25232 gethostbyname_r_proto='$gethostbyname_r_proto'
25233 gethostent_r_proto='$gethostent_r_proto'
25234 getlogin_r_proto='$getlogin_r_proto'
25235 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
25236 getnetbyname_r_proto='$getnetbyname_r_proto'
25237 getnetent_r_proto='$getnetent_r_proto'
25238 getprotobyname_r_proto='$getprotobyname_r_proto'
25239 getprotobynumber_r_proto='$getprotobynumber_r_proto'
25240 getprotoent_r_proto='$getprotoent_r_proto'
25241 getpwent_r_proto='$getpwent_r_proto'
25242 getpwnam_r_proto='$getpwnam_r_proto'
25243 getpwuid_r_proto='$getpwuid_r_proto'
25244 getservbyname_r_proto='$getservbyname_r_proto'
25245 getservbyport_r_proto='$getservbyport_r_proto'
25246 getservent_r_proto='$getservent_r_proto'
25247 getspnam_r_proto='$getspnam_r_proto'
25248 gidformat='$gidformat'
25254 gmtime_r_proto='$gmtime_r_proto'
25255 gnulibc_version='$gnulibc_version'
25257 groupcat='$groupcat'
25258 groupstype='$groupstype'
25261 h_sysfile='$h_sysfile'
25264 hostgenerate='$hostgenerate'
25265 hostosname='$hostosname'
25266 hostperl='$hostperl'
25267 html1dir='$html1dir'
25268 html1direxp='$html1direxp'
25269 html3dir='$html3dir'
25270 html3direxp='$html3direxp'
25279 i_arpainet='$i_arpainet'
25281 i_bsdioctl='$i_bsdioctl'
25285 i_dirent='$i_dirent'
25287 i_execinfo='$i_execinfo'
25291 i_fp_class='$i_fp_class'
25293 i_gdbm_ndbm='$i_gdbm_ndbm'
25294 i_gdbmndbm='$i_gdbmndbm'
25296 i_ieeefp='$i_ieeefp'
25297 i_inttypes='$i_inttypes'
25298 i_langinfo='$i_langinfo'
25299 i_libutil='$i_libutil'
25300 i_locale='$i_locale'
25301 i_machcthr='$i_machcthr'
25302 i_malloc='$i_malloc'
25303 i_mallocmalloc='$i_mallocmalloc'
25304 i_mntent='$i_mntent'
25307 i_neterrno='$i_neterrno'
25308 i_netinettcp='$i_netinettcp'
25312 i_pthread='$i_pthread'
25314 i_quadmath='$i_quadmath'
25315 i_rpcsvcdbm='$i_rpcsvcdbm'
25317 i_shadow='$i_shadow'
25319 i_stdbool='$i_stdbool'
25320 i_stdint='$i_stdint'
25321 i_stdlib='$i_stdlib'
25322 i_sunmath='$i_sunmath'
25323 i_sysaccess='$i_sysaccess'
25324 i_sysdir='$i_sysdir'
25325 i_sysfile='$i_sysfile'
25326 i_sysfilio='$i_sysfilio'
25328 i_sysioctl='$i_sysioctl'
25329 i_syslog='$i_syslog'
25330 i_sysmman='$i_sysmman'
25331 i_sysmode='$i_sysmode'
25332 i_sysmount='$i_sysmount'
25333 i_sysndir='$i_sysndir'
25334 i_sysparam='$i_sysparam'
25335 i_syspoll='$i_syspoll'
25336 i_sysresrc='$i_sysresrc'
25337 i_syssecrt='$i_syssecrt'
25338 i_sysselct='$i_sysselct'
25339 i_syssockio='$i_syssockio'
25340 i_sysstat='$i_sysstat'
25341 i_sysstatfs='$i_sysstatfs'
25342 i_sysstatvfs='$i_sysstatvfs'
25343 i_systime='$i_systime'
25344 i_systimek='$i_systimek'
25345 i_systimes='$i_systimes'
25346 i_systypes='$i_systypes'
25347 i_sysuio='$i_sysuio'
25349 i_sysutsname='$i_sysutsname'
25350 i_sysvfs='$i_sysvfs'
25351 i_syswait='$i_syswait'
25352 i_termio='$i_termio'
25353 i_termios='$i_termios'
25355 i_unistd='$i_unistd'
25360 i_wctype='$i_wctype'
25361 i_xlocale='$i_xlocale'
25362 ignore_versioned_solibs='$ignore_versioned_solibs'
25363 inc_version_list='$inc_version_list'
25364 inc_version_list_init='$inc_version_list_init'
25368 initialinstalllocation='$initialinstalllocation'
25369 installarchlib='$installarchlib'
25370 installbin='$installbin'
25371 installhtml1dir='$installhtml1dir'
25372 installhtml3dir='$installhtml3dir'
25373 installman1dir='$installman1dir'
25374 installman3dir='$installman3dir'
25375 installprefix='$installprefix'
25376 installprefixexp='$installprefixexp'
25377 installprivlib='$installprivlib'
25378 installscript='$installscript'
25379 installsitearch='$installsitearch'
25380 installsitebin='$installsitebin'
25381 installsitehtml1dir='$installsitehtml1dir'
25382 installsitehtml3dir='$installsitehtml3dir'
25383 installsitelib='$installsitelib'
25384 installsiteman1dir='$installsiteman1dir'
25385 installsiteman3dir='$installsiteman3dir'
25386 installsitescript='$installsitescript'
25387 installstyle='$installstyle'
25388 installusrbinperl='$installusrbinperl'
25389 installvendorarch='$installvendorarch'
25390 installvendorbin='$installvendorbin'
25391 installvendorhtml1dir='$installvendorhtml1dir'
25392 installvendorhtml3dir='$installvendorhtml3dir'
25393 installvendorlib='$installvendorlib'
25394 installvendorman1dir='$installvendorman1dir'
25395 installvendorman3dir='$installvendorman3dir'
25396 installvendorscript='$installvendorscript'
25398 issymlink='$issymlink'
25399 ivdformat='$ivdformat'
25402 known_extensions='$known_extensions'
25405 ld_can_script='$ld_can_script'
25406 lddlflags='$lddlflags'
25408 ldflags_uselargefiles='$ldflags_uselargefiles'
25409 ldlibpthname='$ldlibpthname'
25416 libsdirs='$libsdirs'
25417 libsfiles='$libsfiles'
25418 libsfound='$libsfound'
25419 libspath='$libspath'
25420 libswanted='$libswanted'
25421 libswanted_uselargefiles='$libswanted_uselargefiles'
25427 localtime_r_proto='$localtime_r_proto'
25428 locincpth='$locincpth'
25429 loclibpth='$loclibpth'
25430 longdblinfbytes='$longdblinfbytes'
25431 longdblkind='$longdblkind'
25432 longdblmantbits='$longdblmantbits'
25433 longdblnanbytes='$longdblnanbytes'
25434 longdblsize='$longdblsize'
25435 longlongsize='$longlongsize'
25436 longsize='$longsize'
25440 lseeksize='$lseeksize'
25441 lseektype='$lseektype'
25445 make_set_make='$make_set_make'
25446 mallocobj='$mallocobj'
25447 mallocsrc='$mallocsrc'
25448 malloctype='$malloctype'
25450 man1direxp='$man1direxp'
25453 man3direxp='$man3direxp'
25455 mips_type='$mips_type'
25456 mistrustnm='$mistrustnm'
25458 mmaptype='$mmaptype'
25459 modetype='$modetype'
25461 multiarch='$multiarch'
25463 myarchname='$myarchname'
25464 mydomain='$mydomain'
25465 myhostname='$myhostname'
25468 need_va_copy='$need_va_copy'
25469 netdb_hlen_type='$netdb_hlen_type'
25470 netdb_host_type='$netdb_host_type'
25471 netdb_name_type='$netdb_name_type'
25472 netdb_net_type='$netdb_net_type'
25475 nm_so_opt='$nm_so_opt'
25476 nonxs_ext='$nonxs_ext'
25478 nvEUformat='$nvEUformat'
25479 nvFUformat='$nvFUformat'
25480 nvGUformat='$nvGUformat'
25481 nv_overflows_integers_at='$nv_overflows_integers_at'
25482 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25483 nveformat='$nveformat'
25484 nvfformat='$nvfformat'
25485 nvgformat='$nvgformat'
25486 nvmantbits='$nvmantbits'
25489 o_nonblock='$o_nonblock'
25491 old_pthread_create_joinable='$old_pthread_create_joinable'
25492 optimize='$optimize'
25493 orderlib='$orderlib'
25496 otherlibdirs='$otherlibdirs'
25500 patchlevel='$patchlevel'
25501 path_sep='$path_sep'
25504 perl_patchlevel='$perl_patchlevel'
25505 perl_static_inline='$perl_static_inline'
25506 perl_thread_local='$perl_thread_local'
25507 perladmin='$perladmin'
25508 perllibs='$perllibs'
25509 perlpath='$perlpath'
25511 phostname='$phostname'
25517 prefixexp='$prefixexp'
25519 privlibexp='$privlibexp'
25520 procselfexe='$procselfexe'
25522 quadkind='$quadkind'
25523 quadtype='$quadtype'
25524 randbits='$randbits'
25525 randfunc='$randfunc'
25526 random_r_proto='$random_r_proto'
25527 randseedtype='$randseedtype'
25529 rd_nodata='$rd_nodata'
25530 readdir64_r_proto='$readdir64_r_proto'
25531 readdir_r_proto='$readdir_r_proto'
25532 revision='$revision'
25538 sGMTIME_max='$sGMTIME_max'
25539 sGMTIME_min='$sGMTIME_min'
25540 sLOCALTIME_max='$sLOCALTIME_max'
25541 sLOCALTIME_min='$sLOCALTIME_min'
25542 sPRIEUldbl='$sPRIEUldbl'
25543 sPRIFUldbl='$sPRIFUldbl'
25544 sPRIGUldbl='$sPRIGUldbl'
25545 sPRIXU64='$sPRIXU64'
25547 sPRIeldbl='$sPRIeldbl'
25548 sPRIfldbl='$sPRIfldbl'
25549 sPRIgldbl='$sPRIgldbl'
25554 sSCNfldbl='$sSCNfldbl'
25555 sched_yield='$sched_yield'
25556 scriptdir='$scriptdir'
25557 scriptdirexp='$scriptdirexp'
25559 seedfunc='$seedfunc'
25560 selectminbits='$selectminbits'
25561 selecttype='$selecttype'
25562 sendmail='$sendmail'
25563 setgrent_r_proto='$setgrent_r_proto'
25564 sethostent_r_proto='$sethostent_r_proto'
25565 setlocale_r_proto='$setlocale_r_proto'
25566 setnetent_r_proto='$setnetent_r_proto'
25567 setprotoent_r_proto='$setprotoent_r_proto'
25568 setpwent_r_proto='$setpwent_r_proto'
25569 setservent_r_proto='$setservent_r_proto'
25572 sharpbang='$sharpbang'
25573 shmattype='$shmattype'
25574 shortsize='$shortsize'
25577 sig_count='$sig_count'
25578 sig_name='$sig_name'
25579 sig_name_init='$sig_name_init'
25581 sig_num_init='$sig_num_init'
25582 sig_size='$sig_size'
25583 signal_t='$signal_t'
25584 sitearch='$sitearch'
25585 sitearchexp='$sitearchexp'
25587 sitebinexp='$sitebinexp'
25588 sitehtml1dir='$sitehtml1dir'
25589 sitehtml1direxp='$sitehtml1direxp'
25590 sitehtml3dir='$sitehtml3dir'
25591 sitehtml3direxp='$sitehtml3direxp'
25593 sitelib_stem='$sitelib_stem'
25594 sitelibexp='$sitelibexp'
25595 siteman1dir='$siteman1dir'
25596 siteman1direxp='$siteman1direxp'
25597 siteman3dir='$siteman3dir'
25598 siteman3direxp='$siteman3direxp'
25599 siteprefix='$siteprefix'
25600 siteprefixexp='$siteprefixexp'
25601 sitescript='$sitescript'
25602 sitescriptexp='$sitescriptexp'
25603 sizesize='$sizesize'
25604 sizetype='$sizetype'
25608 sockethdr='$sockethdr'
25609 socketlib='$socketlib'
25610 socksizetype='$socksizetype'
25612 spackage='$spackage'
25613 spitshell='$spitshell'
25614 srand48_r_proto='$srand48_r_proto'
25615 srandom_r_proto='$srandom_r_proto'
25617 ssizetype='$ssizetype'
25618 st_dev_sign='$st_dev_sign'
25619 st_dev_size='$st_dev_size'
25620 st_ino_sign='$st_ino_sign'
25621 st_ino_size='$st_ino_size'
25622 startperl='$startperl'
25624 static_ext='$static_ext'
25626 stdio_base='$stdio_base'
25627 stdio_bufsiz='$stdio_bufsiz'
25628 stdio_cnt='$stdio_cnt'
25629 stdio_filbuf='$stdio_filbuf'
25630 stdio_ptr='$stdio_ptr'
25631 stdio_stream_array='$stdio_stream_array'
25632 strerror_r_proto='$strerror_r_proto'
25634 subversion='$subversion'
25639 targetarch='$targetarch'
25640 targetdir='$targetdir'
25641 targetenv='$targetenv'
25642 targethost='$targethost'
25643 targetmkdir='$targetmkdir'
25644 targetport='$targetport'
25645 targetsh='$targetsh'
25649 timeincl='$timeincl'
25650 timetype='$timetype'
25651 tmpnam_r_proto='$tmpnam_r_proto'
25657 ttyname_r_proto='$ttyname_r_proto'
25666 uidformat='$uidformat'
25672 uquadtype='$uquadtype'
25673 use64bitall='$use64bitall'
25674 use64bitint='$use64bitint'
25675 usecbacktrace='$usecbacktrace'
25676 usecrosscompile='$usecrosscompile'
25677 usedefaultstrict='$usedefaultstrict'
25678 usedevel='$usedevel'
25680 usedtrace='$usedtrace'
25681 usefaststdio='$usefaststdio'
25682 useithreads='$useithreads'
25683 usekernprocpathname='$usekernprocpathname'
25684 uselanginfo='$uselanginfo'
25685 uselargefiles='$uselargefiles'
25686 uselongdouble='$uselongdouble'
25687 usemallocwrap='$usemallocwrap'
25688 usemorebits='$usemorebits'
25689 usemultiplicity='$usemultiplicity'
25690 usemymalloc='$usemymalloc'
25692 usensgetexecutablepath='$usensgetexecutablepath'
25693 useopcode='$useopcode'
25694 useperlio='$useperlio'
25695 useposix='$useposix'
25696 usequadmath='$usequadmath'
25697 usereentrant='$usereentrant'
25698 userelocatableinc='$userelocatableinc'
25699 useshrplib='$useshrplib'
25700 usesitecustomize='$usesitecustomize'
25701 usesocks='$usesocks'
25702 usethreads='$usethreads'
25703 usevendorprefix='$usevendorprefix'
25704 useversionedarchname='$useversionedarchname'
25705 usevfork='$usevfork'
25708 uvXUformat='$uvXUformat'
25709 uvoformat='$uvoformat'
25712 uvuformat='$uvuformat'
25713 uvxformat='$uvxformat'
25714 vendorarch='$vendorarch'
25715 vendorarchexp='$vendorarchexp'
25716 vendorbin='$vendorbin'
25717 vendorbinexp='$vendorbinexp'
25718 vendorhtml1dir='$vendorhtml1dir'
25719 vendorhtml1direxp='$vendorhtml1direxp'
25720 vendorhtml3dir='$vendorhtml3dir'
25721 vendorhtml3direxp='$vendorhtml3direxp'
25722 vendorlib='$vendorlib'
25723 vendorlib_stem='$vendorlib_stem'
25724 vendorlibexp='$vendorlibexp'
25725 vendorman1dir='$vendorman1dir'
25726 vendorman1direxp='$vendorman1direxp'
25727 vendorman3dir='$vendorman3dir'
25728 vendorman3direxp='$vendorman3direxp'
25729 vendorprefix='$vendorprefix'
25730 vendorprefixexp='$vendorprefixexp'
25731 vendorscript='$vendorscript'
25732 vendorscriptexp='$vendorscriptexp'
25734 version_patchlevel_string='$version_patchlevel_string'
25735 versiononly='$versiononly'
25738 xlocale_needed='$xlocale_needed'
25740 yaccflags='$yaccflags'
25745 : add special variables
25746 $test -f $src/patchlevel.h && \
25747 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25748 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25749 echo "PERL_CONFIG_SH=true" >>config.sh
25751 : propagate old symbols
25752 if $test -f UU/config.sh; then
25753 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25754 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25755 config.sh config.sh UU/oldconfig.sh |\
25756 $sort | $uniq -u >UU/oldsyms
25757 set X `$cat UU/oldsyms`
25763 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25765 echo ": Variables propagated from previous config.sh file." >>config.sh
25766 for sym in `$cat UU/oldsyms`; do
25767 echo " Propagating $hint variable "'$'"$sym..."
25768 eval 'tmp="$'"${sym}"'"'
25770 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25776 : preserve RCS keywords in files with variable substitution, grrr
25779 : Finish up by extracting the .SH files
25782 echo "Stopping at your request, leaving temporary files around."
25792 If you'd like to make any changes to the config.sh file before I begin
25793 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25796 rp="Press return or use a shell escape to edit config.sh:"
25801 *) : in case they cannot read
25802 sh 1>&4 -c "$ans";;
25807 : if this fails, just run all the .SH files by hand
25816 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25823 Now you need to generate make dependencies by running "$make depend".
25824 You might prefer to run it in background: "$make depend > makedepend.out &"
25825 It can take a while, so you might not want to run it right now.
25830 rp="Run $make depend now?"
25834 $make depend && echo "Now you must run '$make'."
25837 echo "You must run '$make depend' then '$make'."
25840 elif test -f [Mm]akefile; then
25842 echo "Now you must run a $make."
25844 echo "Configure done."
25847 if $test -f Policy.sh; then
25850 If you compile $package on a different machine or from a different object
25851 directory, copy the Policy.sh file from this object directory to the
25852 new one before you run Configure -- this will help you with most of
25853 the policy defaults.
25857 if $test -f UU/config.msg; then
25858 echo "Hmm. I also noted the following information while running:"
25860 $cat UU/config.msg >&4
25862 $rm -f kit*isdone ark*isdone