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/perl5-metaconfig/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=''
385 d_attribute_always_inline=''
386 d_attribute_deprecated=''
387 d_attribute_format=''
388 d_attribute_malloc=''
389 d_attribute_nonnull=''
390 d_attribute_noreturn=''
392 d_attribute_unused=''
393 d_attribute_warn_unused_result=''
394 d_printf_format_null=''
396 d_builtin_choose_expr=''
398 d_builtin_add_overflow=''
399 d_builtin_mul_overflow=''
400 d_builtin_sub_overflow=''
401 d_c99_variadic_macros=''
450 endhostent_r_proto=''
456 endprotoent_r_proto=''
462 endservent_r_proto=''
534 gethostbyaddr_r_proto=''
536 gethostbyname_r_proto=''
538 gethostent_r_proto=''
551 getnetbyaddr_r_proto=''
553 getnetbyname_r_proto=''
567 d_getprotobyname_r=''
568 getprotobyname_r_proto=''
569 d_getprotobynumber_r=''
570 getprotobynumber_r_proto=''
572 getprotoent_r_proto=''
584 getservbyname_r_proto=''
586 getservbyport_r_proto=''
588 getservent_r_proto=''
621 d_lc_monetary_2008=''
626 d_libm_lib_version=''
634 d_localtime_r_needs_tzset=''
642 d_long_double_style_ieee=''
643 d_long_double_style_ieee_doubledouble=''
644 d_long_double_style_ieee_extended=''
645 d_long_double_style_ieee_std=''
646 d_long_double_style_vax=''
659 d_malloc_good_size=''
661 d_malloc_usable_size=''
702 d_thread_safe_nl_langinfo_l=''
716 d_old_pthread_create_joinable=''
717 old_pthread_create_joinable=''
719 d_pthread_attr_setscope=''
764 sethostent_r_proto=''
769 d_setlocale_accepts_any_locale_name=''
783 setprotoent_r_proto=''
795 setservent_r_proto=''
808 d_siginfo_si_errno=''
811 d_siginfo_si_status=''
813 d_siginfo_si_value=''
825 d_ipv6_mreq_source=''
836 d_sockaddr_storage=''
855 perl_static_inline=''
860 d_stdio_ptr_lval_nochange_cnt=''
861 d_stdio_ptr_lval_sets_cnt=''
944 default_inc_excludes_dot=''
1010 d_gdbm_ndbm_h_uses_prototypes=''
1011 d_gdbmndbm_h_uses_prototypes=''
1013 d_ndbm_h_uses_prototypes=''
1084 d_inc_version_list=''
1086 inc_version_list_init=''
1094 installusrbinperl=''
1110 ignore_versioned_solibs=''
1126 d_double_has_negative_zero=''
1127 d_double_has_subnormals=''
1128 d_double_style_cray=''
1129 d_double_style_ibm=''
1130 d_double_style_ieee=''
1131 d_double_style_vax=''
1182 d_perl_otherlibdirs=''
1190 api_versionstring=''
1196 version_patchlevel_string=''
1200 d_nv_preserves_uv=''
1201 d_nv_zero_is_allbits_zero=''
1212 nv_overflows_integers_at=''
1213 nv_preserves_uv_bits=''
1285 installsitehtml1dir=''
1288 installsitehtml3dir=''
1295 installsiteman1dir=''
1298 installsiteman3dir=''
1303 installsitescript=''
1321 d_stdio_stream_array=''
1322 stdio_stream_array=''
1340 usekernprocpathname=''
1341 ccflags_uselargefiles=''
1342 ldflags_uselargefiles=''
1343 libswanted_uselargefiles=''
1352 usensgetexecutablepath=''
1365 installvendorarch=''
1372 installvendorhtml1dir=''
1374 vendorhtml1direxp=''
1375 installvendorhtml3dir=''
1377 vendorhtml3direxp=''
1383 installvendorman1dir=''
1386 installvendorman3dir=''
1393 installvendorscript=''
1404 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1407 : We must find out about Eunice early
1409 if test -f /etc/unixtovms; then
1410 eunicefix=/etc/unixtovms
1412 if test -f /etc/unixtovms.exe; then
1413 eunicefix=/etc/unixtovms.exe
1416 : Set executable suffix now -- needed before hints available
1417 if test -f "/libs/version.library"; then
1420 elif test -f "/system/gnu_library/bin/ar.pm"; then
1423 elif test -n "$DJGPP"; then
1426 elif test -f /kern/cookiejar; then
1429 elif test -d c:/. -o -n "$is_os2" ; then
1436 : Possible local include directories to search.
1437 : Set locincpth to "" in a hint file to defeat local include searches.
1438 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1439 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1441 : no include file wanted by default
1444 : Enable -DEBUGGING and -DDEBUGGING from the command line
1448 : Trailing extension. Override this in a hint file, if needed.
1449 : Extra object files, if any, needed on this platform.
1452 : change the next line if compiling for Xenix/286 on Xenix/386
1453 xlibpth='/usr/lib/386 /lib/386'
1454 : Possible local library directories to search.
1455 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1456 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1458 : general looking path for locating libraries
1459 glibpth="/lib /usr/lib $xlibpth"
1460 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1461 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1462 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1463 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1465 : Private path used by Configure to find libraries. Its value
1466 : is prepended to libpth. This variable takes care of special
1467 : machines, like the mips. Usually, it should be empty.
1470 : default library list
1472 : some systems want to use only the non-versioned libso:s
1473 ignore_versioned_solibs=''
1477 : set useposix=false in your hint file to disable the POSIX extension.
1479 : set useopcode=false in your hint file to disable the Opcode extension.
1481 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1484 ccflags_uselargefiles=''
1485 ldflags_uselargefiles=''
1486 libswanted_uselargefiles=''
1487 : set usemultiplicity on the Configure command line to enable multiplicity.
1488 : set usesocks on the Configure command line to enable socks.
1490 : set usethreads on the Configure command line to enable threads.
1491 usereentrant='undef'
1492 : List of libraries we want.
1493 : If anyone needs extra -lxxx, put those in a hint file.
1494 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1495 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1496 : We probably want to search /usr/shlib before most other libraries.
1497 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1498 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1499 glibpth="/usr/shlib $glibpth"
1500 : Do not use vfork unless overridden by a hint file.
1503 : Find the basic shell for Bourne shell scripts
1507 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1510 if test -f "$xxx"; then
1513 : Build up a list and do a single loop so we can 'break' out.
1514 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1515 for xxx in sh bash ksh pdksh ash; do
1517 try="$try ${p}/${xxx}"
1521 if test -f "$xxx"; then
1524 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1527 elif test -f "$xxx.exe"; then
1538 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1540 Usually it's in /bin/sh. How did you even get this far?
1541 Please report this issue at https://github.com/Perl/perl5/issues
1542 and we'll try to straighten this all out.
1548 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1549 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1552 : see if sh knows # comments
1553 if `$sh -c '#' >/dev/null 2>&1`; then
1557 test -f $xcat$_exe || xcat=/usr/bin/cat
1558 if test ! -f $xcat$_exe; then
1559 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1560 if test -f $p/cat$_exe; then
1565 if test ! -f $xcat$_exe; then
1566 echo "Can't find cat anywhere!"
1570 echo "#!$xcat" >sharp
1573 ./sharp > today 2>/dev/null
1574 if test -s today; then
1577 echo "#! $xcat" > sharp
1580 ./sharp > today 2>/dev/null
1581 if test -s today; then
1589 echo "Your $sh doesn't grok # comments--I will strip them later on."
1592 echo "exec grep -v '^[ ]*#'" >spitshell
1594 $eunicefix spitshell
1595 spitshell=`pwd`/spitshell
1597 echo "I presume that if # doesn't work, #! won't work either!"
1602 : figure out how to guarantee sh startup
1604 '') startsh=${sharpbang}${sh} ;;
1616 : echo "Yup, it does."
1618 echo "Hmm... '$startsh' does not guarantee sh startup..."
1619 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1623 : Save command line options in file UU/cmdline.opt for later use in
1624 : generating config.sh.
1625 cat > cmdline.opt <<EOSH
1626 : Configure command line arguments.
1635 cat >>cmdline.opt <<EOSH
1636 config_arg$argn='$arg'
1638 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1641 arg_exp=`cat cmdl.opt`
1642 args_exp="$args_exp$args_sep'$arg_exp'"
1643 argn=`expr $argn + 1`
1648 : produce awk script to parse command line options
1649 cat >options.awk <<'EOF'
1651 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1653 len = length(optstr);
1654 for (i = 1; i <= len; i++) {
1655 c = substr(optstr, i, 1);
1656 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1667 if (substr(str, 1, 1) != "-") {
1668 printf("'%s'\n", str);
1672 for (i = 2; i <= len; i++) {
1673 c = substr(str, i, 1);
1675 printf("-%s\n", substr(str, i));
1681 printf("'%s'\n", substr(str, i + 1));
1694 : process the command line options
1695 set X `for arg in "$@"; do echo "X$arg"; done |
1696 sed -e s/X// | awk -f options.awk`
1701 : set up default values
1710 rm -f optdef.sh posthint.sh
1711 cat >optdef.sh <<EOS
1717 while test $# -gt 0; do
1719 -d) shift; fastread=yes;;
1720 -e) shift; alldone=cont;;
1724 if test -r "$1"; then
1727 echo "$me: cannot read config file $1." >&2
1733 -h) shift; error=true;;
1734 -r) shift; reuseval=true;;
1735 -s) shift; silent=true; realsilent=true;;
1736 -E) shift; alldone=exit;;
1737 -K) shift; knowitall=true;;
1739 -S) shift; silent=true; extractsh=true;;
1744 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1745 echo "$me: ignoring -D $1" >&2
1748 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1749 *) echo "$1='define'" >> optdef.sh;;
1756 *=) echo "$1" >> optdef.sh;;
1758 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1759 echo "$me: ignoring -U $1" >&2
1761 *) echo "$1='undef'" >> optdef.sh;;
1772 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1776 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1777 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1783 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1784 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1785 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1786 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1787 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1788 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1794 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1796 echo "$yyy=''" >> posthint.sh ;;
1801 echo "$yyy='$zzz'" >> posthint.sh ;;
1803 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1805 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1810 echo "$yyy=$zzz" >> posthint.sh ;;
1811 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1815 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1818 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1826 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1827 [-U symbol] [-U symbol=] [-A command:symbol...]
1828 -d : use defaults for all answers.
1829 -e : go on without questioning past the production of config.sh.
1830 -f : specify an alternate default configuration file.
1831 -h : print this help message and exit (with an error status).
1832 -r : reuse C symbols value if possible (skips costly nm extraction).
1833 -s : silent mode, only echoes questions and essential information.
1834 -D : define symbol to have some value:
1835 -D symbol symbol gets the value 'define'
1836 -D symbol=value symbol gets the value 'value'
1837 common used examples (see INSTALL for more info):
1838 -Duse64bitint use 64bit integers
1839 -Duse64bitall use 64bit integers and pointers
1840 -Dusethreads use thread support
1841 -Dinc_version_list=none do not include older perl trees in @INC
1842 -DEBUGGING=none DEBUGGING options
1843 -Dcc=gcc choose your compiler
1844 -Dprefix=/opt/perl5 choose your destination
1845 -E : stop at the end of questions, after having produced config.sh.
1846 -K : do not use unless you know what you are doing.
1847 -O : ignored for backward compatibility
1848 -S : perform variable substitutions on all .SH files (can mix with -f)
1849 -U : undefine symbol:
1850 -U symbol symbol gets the value 'undef'
1851 -U symbol= symbol gets completely empty
1853 -A : manipulate symbol after the platform specific hints have been applied:
1854 -A append:symbol=value append value to symbol
1855 -A symbol=value like append:, but with a separating space
1856 -A define:symbol=value define symbol to have value
1857 -A clear:symbol define symbol to be ''
1858 -A define:symbol define symbol to be 'define'
1859 -A eval:symbol=value define symbol to be eval of value
1860 -A prepend:symbol=value prepend value to symbol
1861 -A undef:symbol define symbol to be 'undef'
1862 -A undef:symbol= define symbol to be ''
1863 e.g.: -A prepend:libswanted='cl pthread '
1864 -A ccflags=-DSOME_MACRO
1865 -V : print version number and exit (with a zero status).
1872 case "$fastread$alldone" in
1875 case "$extractsh" in
1878 if test ! -t 0; then
1879 echo "Say 'sh Configure', not 'sh <Configure'"
1889 true) exec 1>/dev/null;;
1892 : run the defines and the undefines, if any, but leave the file out there...
1894 grep '\\' optdef.sh >/dev/null 2>&1
1895 if test $? = 0; then
1896 echo "Configure does not support \\ in -D arguments"
1900 : create the posthint manipulation script and leave the file out there...
1905 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1906 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1907 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1908 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1909 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1912 : Some greps do not return status, grrr.
1913 echo "grimblepritz" >grimble
1914 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1916 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1922 : the following should work in any shell
1926 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1927 cat >contains <<'EOSS'
1928 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1933 : Find the path to the source tree
1936 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1940 *) src=`cd ../$src && pwd` ;;
1953 if test -f $rsrc/Configure && \
1954 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1956 : found it, so we are ok.
1959 for src in . .. ../.. ../../.. ../../../..; do
1960 if test -f ../$src/Configure && \
1961 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1972 Sorry, I can't seem to locate the source dir for $package. Please start
1973 Configure with an explicit path -- i.e. /some/path/Configure.
1981 echo "Sources for $package found in \"$src\"." >&4
1985 : script used to extract .SH files with variable substitutions
1986 cat >extract <<'EOS'
1988 echo "Doing variable substitutions on .SH files..."
1989 if test -f MANIFEST; then
1990 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1992 echo "(Looking for .SH files under the source directory.)"
1993 set x `(cd "$src"; find . -name "*.SH" -print)`
1997 0) set x `(cd "$src"; echo *.SH)`; shift;;
1999 if test ! -f "$src/$1"; then
2005 while test $name; do
2006 if test ! -d "$name"; then
2007 create="$name $create";
2008 name=`echo $name | sed -e "s|^[^/]*$||"`;
2009 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2014 for file in $create; do
2023 dir=`expr X$file : 'X\(.*\)/'`
2024 file=`expr X$file : 'X.*/\(.*\)'`
2025 (cd "$dir" && . ./$file)
2035 dir=`expr X$file : 'X\(.*\)/'`
2036 file=`expr X$file : 'X.*/\(.*\)'`
2037 (set x $dir; shift; eval $mkdir_p)
2038 sh <"$src/$dir/$file"
2047 if test -f "$src/config_h.SH"; then
2048 if test ! -f config.h; then
2049 : oops, they left it out of MANIFEST, probably, so do it anyway.
2050 . "$src/config_h.SH"
2055 : extract files and exit if asked to do so
2056 case "$extractsh" in
2058 case "$realsilent" in
2062 case "$config_sh" in
2063 '') config_sh='config.sh';;
2066 echo "Fetching answers from $config_sh..."
2073 echo "Extraction done."
2078 : Eunice requires " " instead of "", can you believe it
2081 echo "Beginning of configuration questions for $package."
2083 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2085 : first determine how to suppress newline on echo command
2087 echo "Checking echo to see how to suppress newlines..."
2088 (echo "hi there\c" ; echo " ") >.echotmp
2089 if $contains c .echotmp >/dev/null 2>&1 ; then
2100 echo $n "The star should be here-->$c"
2104 : Now test for existence of everything in MANIFEST
2106 if test -f "$rsrc/MANIFEST"; then
2107 echo "First let's make sure your kit is complete. Checking..." >&4
2108 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2109 (split -l 50 2>/dev/null || split -50)
2112 for filelist in x??; do
2113 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2114 >/dev/null 2>>"$tmppwd/missing")
2116 if test -s missing; then
2120 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2122 You have the option of continuing the configuration process, despite the
2123 distinct possibility that your kit is damaged, by typing 'y'es. If you
2124 do, don't blame me if something goes wrong. I advise you to type 'n'o
2125 and contact the author (https://github.com/Perl/perl5/issues).
2128 echo $n "Continue? [n] $c" >&4
2132 echo "Continuing..." >&4
2136 echo "ABORTING..." >&4
2141 echo "Looks good..."
2144 echo "There is no MANIFEST file. I hope your kit is complete !"
2148 : Find the appropriate value for a newline for tr
2149 if test -n "$DJGPP"; then
2152 if test X"$trnl" = X; then
2153 case "`echo foo | tr '\n' x 2>/dev/null`" in
2157 if test X"$trnl" = X; then
2158 case "`echo foo | tr '\012' x 2>/dev/null`" in
2159 foox) trnl='\012' ;;
2162 if test X"$trnl" = X; then
2163 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2164 fooxy) trnl='\n\r' ;;
2167 if test X"$trnl" = X; then
2170 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2176 : compute the number of columns on the terminal for proper question formatting
2181 : set up the echo used in my read
2182 myecho="case \"\$xxxm\" in
2183 '') echo $n \"\$rp $c\" >&4;;
2185 '') echo $n \"[\$xxxm] $c\";;
2187 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2189 echo $n \"[\$xxxm] $c\" >&4
2191 echo $n \"\$rp [\$xxxm] $c\" >&4
2197 : now set up to do reads with possible shell escape and default assignment
2203 case "\$fastread" in
2204 yes) case "\$dflt" in
2207 case "\$silent-\$rp" in
2212 *) case "\$silent" in
2213 true) case "\$rp" in
2218 while expr "X\$ans" : "X!" >/dev/null; do
2222 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2230 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2239 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2244 echo "(OK, I'll run with -d after this question.)" >&4
2247 echo "*** Sorry, \$1 not supported yet." >&4
2257 echo "*** Substitution done -- please confirm."
2259 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2264 echo "*** Error -- try again."
2271 case "\$ans\$xxxm\$nostick" in
2283 : create .config dir to save info across Configure sessions
2284 test -d ../.config || mkdir ../.config
2285 cat >../.config/README <<EOF
2286 This directory created by Configure to save information that should
2287 persist across sessions for $package.
2289 You may safely delete it if you wish.
2292 : See if we are using a devel version and want that
2293 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2296 usedevel="$define" ;;
2297 *) case "$xversion" in
2300 *** WHOA THERE!!! ***
2302 This is an UNSTABLE DEVELOPMENT release.
2303 The version of this $package distribution is $xversion, that is, odd,
2304 (as opposed to even) and that signifies a development release.
2305 If you want a maintenance release, you want an even-numbered version.
2307 Do ***NOT*** install this into production use.
2308 Data corruption and crashes are possible.
2310 It is most seriously suggested that you do not continue any further
2311 unless you want to help in developing and debugging Perl.
2313 If you *still* want to build perl, you can answer 'y' now,
2314 or pass -Dusedevel to Configure.
2317 rp='Do you really want to continue?'
2321 [yY]) echo >&4 "Okay, continuing."
2322 usedevel="$define" ;;
2323 *) echo >&4 "Okay, bye."
2334 case "$versiononly" in
2335 '') versiononly="$define" ;;
2337 case "$installusrbinperl" in
2338 '') installusrbinperl="$undef" ;;
2343 : general instructions
2346 user=`(logname) 2>/dev/null`
2348 '') user=`whoami 2>&1`;;
2350 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2353 rp='Would you like to see the instructions?'
2364 This installation shell script will examine your system and ask you questions
2365 to determine how the perl5 package should be installed. If you get
2366 stuck on a question, you may use a ! shell escape to start a subshell or
2367 execute a command. Many of the questions will have default answers in square
2368 brackets; typing carriage return will give you the default.
2370 On some of the questions which ask for file or directory names you are allowed
2371 to use the ~name construct to specify the login directory belonging to "name",
2372 even if you don't have a shell which knows about that. Questions where this is
2373 allowed will be marked "(~name ok)".
2377 dflt='Type carriage return to continue'
2381 The prompter used in this script allows you to use shell variables and
2382 backticks in your answers. You may use $1, $2, etc... to refer to the words
2383 in the default answer, as if the default line was a set of arguments given to a
2384 script shell. This means you may also use $* to repeat the whole default line,
2385 so you do not have to re-type everything to add something to the default.
2387 Every time there is a substitution, you will have to confirm. If there is an
2388 error (e.g. an unmatched backtick), the default answer will remain unchanged
2389 and you will be prompted again.
2391 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2392 the questions and use the computed defaults (or the previous answers if there
2393 was already a config.sh file). Type 'Configure -h' for a list of options.
2394 You may also start interactively and then answer '& -d' at any prompt to turn
2395 on the non-interactive behaviour for the remainder of the execution.
2401 Much effort has been expended to ensure that this shell script will run on any
2402 Unix system. If despite that it blows up on yours, your best bet is to edit
2403 Configure and run it again. If you can't run Configure for some reason,
2404 you'll have to generate a config.sh file by hand. Whatever problems you
2405 have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
2407 This installation script affects things in two ways:
2409 1) it may do direct variable substitutions on some of the files included
2411 2) it builds a config.h file for inclusion in C programs. You may edit
2412 any of these files as the need arises after running this script.
2414 If you make a mistake on a question, there is no easy way to back up to it
2415 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2416 files. Configure will offer to let you do this before it runs the SH files.
2419 dflt='Type carriage return to continue'
2421 case "$firsttime" in
2422 true) echo $user >>../.config/instruct;;
2426 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2427 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2428 if test "X$sysroot" = X; then
2433 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2434 # _sysroot is used in places where we need --sysroot=foo
2435 # but using the rest of the flags could cause issues.
2436 _sysroot="--sysroot=$sysroot";
2440 ccflags="$ccflags $_sysroot"
2445 ldflags="$ldflags $_sysroot"
2450 cppflags="$cppflags $_sysroot"
2452 # lddlflags updated below in lddlflags section;
2453 # same with cccdlflags
2457 # Adjust some defaults to also use $sysroot
2458 for var in xlibpth loclibpth locincpth glibpth; do
2461 for path in $xxx; do
2462 eval $var=\"\$$var $sysroot$path\"
2468 : find out where common programs are
2470 echo "Locating common programs..." >&4
2483 if test -d \$dir/\$thing; then
2489 for thisthing in \$dir/\$thing; do
2490 : just loop through to pick last item
2492 if test -f \$thisthing; then
2495 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2498 elif test -f \$dir/\$thing.exe; then
2499 if test -n "$DJGPP"; then
2500 echo \$dir/\$thing.exe
2501 elif test "$eunicefix" != ":"; then
2502 : on Eunice apparently
2555 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2556 pth="$pth $sysroot/lib $sysroot/usr/lib"
2557 for file in $loclist; do
2561 if test -f "$xxx"; then
2564 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2565 xxx=`./loc $file $file $pth`
2568 '') xxx=`./loc $file $file $pth`;;
2569 *) xxx=`./loc $xxx $xxx $pth`;;
2571 eval $file=$xxx$_exe
2575 echo $file is in $xxx.
2578 echo $file is in $xxx.
2581 echo "I don't know where '$file' is, and my life depends on it." >&4
2582 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2588 echo "Don't worry if any of the following aren't found..."
2590 for file in $trylist; do
2594 if test -f "$xxx"; then
2597 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2598 xxx=`./loc $file $file $pth`
2601 '') xxx=`./loc $file $file $pth`;;
2602 *) xxx=`./loc $xxx $xxx $pth`;;
2604 eval $file=$xxx$_exe
2608 echo $file is in $xxx.
2611 echo $file is in $xxx.
2614 echo "I don't see $file out there, $say."
2621 echo "Substituting grep for egrep."
2628 *) if $less -R </dev/null >/dev/null 2>&1; then
2629 echo "Substituting less -R for less."
2637 echo "Substituting cp for ln."
2646 echo "I can't find make or gmake, and my life depends on it." >&4
2647 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2655 *) # We can't have osname yet.
2656 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2657 # Assume that gmake, if found, is definitely GNU make
2658 # and prefer it over the system make.
2659 echo "Substituting gmake for make."
2667 echo "Hopefully test is built into your sh."
2670 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2671 echo "Using the test built into your sh."
2679 echo "Hopefully echo is built into your sh."
2684 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2685 $echo $n "hi there$c" >foo1
2686 echo $n "hi there$c" >foo2
2687 if cmp foo1 foo2 >/dev/null 2>&1; then
2688 echo "They are compatible. In fact, they may be identical."
2695 They are not compatible! You are probably running ksh on a non-USG system.
2696 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2697 have echo built in and we may have to run some Bourne shell scripts. That
2698 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2701 $echo $n "The star should be here-->$c"
2708 # This question was auctioned at YAPC::Europe-2007 in Vienna
2709 # I never promised you could answer it. I only auctioned the question.
2711 The following message is sponsored by
2713 Dresden.pm<--The stars should be here.
2715 Dear Perl user, system administrator or package
2716 maintainer, the Perl community sends greetings to
2717 you. Do you (emblematical) greet back [Y/n]? n
2721 : Check what type of C compiler we use
2725 cat <<'EOSC' >>trygcc
2730 int main(int argc, char *argv[]) {
2734 if $cc -o try $ccflags $ldflags try.c; then
2737 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2743 # Skip this test because it gives a false match on output like:
2744 # ./trygcc: line 23: cc: command not found
2745 # case "`$cc -v -c try.c 2>&1`" in
2746 # *gcc*) trygcc=no ;;
2748 if $test X"$trygcc" = Xyes; then
2749 if gcc -o try -c try.c; then
2751 echo "You seem to have a working gcc, though." >&4
2752 # Switching compilers may undo the work of hints files.
2753 # The most common problem is -D_REENTRANT for threads.
2754 # This heuristic catches that case, but gets false positives
2755 # if -Dusethreads was not actually specified. Better to
2756 # bail out here with a useful message than fail
2757 # mysteriously later. Should we perhaps just try to
2758 # re-invoke Configure -Dcc=gcc config_args ?
2759 if $test -f usethreads.cbu; then
2762 *** However, any setting of the C compiler flags (e.g. for thread support)
2763 *** will be lost. It may be necessary for you to restart Configure and
2764 *** add -Dcc=gcc to your Configure command line.
2767 rp="Would you like to go ahead and try gcc anyway?"
2770 rp="Would you like to use it?"
2773 if $test -f myread; then
2776 if $test -f UU/myread; then
2779 echo "Cannot find myread, sorry. Aborting." >&2
2784 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2797 cat <<'EOSC' >>checkcc
2802 int main(int argc, char *argv[]) {
2806 if $cc -o try $ccflags $ldflags try.c; then
2809 if $test X"$despair" = Xyes; then
2810 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2813 You need to find a working C compiler.
2814 Either (purchase and) install the C compiler supplied by your OS vendor,
2815 or for a free C compiler try http://gcc.gnu.org/
2816 I cannot continue any further, aborting.
2825 : determine whether symbolic links are supported
2828 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2829 echo "Symbolic links are supported." >&4
2832 echo "Symbolic links are NOT supported." >&4
2837 : determine whether symbolic links are supported
2841 echo "Checking how to test for symbolic links..." >&4
2843 if $test "X$issymlink" = X; then
2845 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2846 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2848 if test $? = 0; then
2851 echo "Your builtin 'test -h' may be broken." >&4
2854 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2857 if test -f "$p/$test"; then
2866 echo "Trying external '$test -h'." >&4
2867 issymlink="$test -h"
2868 if $test ! -h sym >/dev/null 2>&1; then
2869 echo "External '$test -h' is broken, too." >&4
2877 if $test "X$issymlink" = X; then
2878 if $test -L sym 2>/dev/null; then
2879 issymlink="$test -L"
2880 echo "The builtin '$test -L' worked." >&4
2883 if $test "X$issymlink" != X; then
2884 echo "You can test for symbolic links with '$issymlink'." >&4
2886 echo "I do not know how you can test for symbolic links." >&4
2890 *) echo "No symbolic links, so not testing for their testing..." >&4
2894 : Make symlinks util
2895 case "$mksymlinks" in
2898 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2901 *) case "$lns:$issymlink" in
2902 *"ln"*" -s:"*"test -"?)
2903 echo "Creating the symbolic links..." >&4
2905 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2915 print "# dir = ", dir, "file = ", file
2916 mf[dir] = mf[dir]" "source"/"dir"/"file;
2919 if (d != ".") { print("mkdir -p "d) }
2920 print("ln -sf "mf[d]" "d);
2922 }' source="$src" > UU/mksymlinks.$$
2926 if test ! -d t/base; then
2927 echo "Failed to create the subdirectories. Aborting." >&4
2931 if test ! -f t/base/lex.t; then
2932 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2935 if test ! -f win32/win32.c; then
2936 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2941 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2949 : Check for Cross-Compilation
2950 if $test "X$targethost" = "X"; then
2953 if $test "X$targetenv" = "X"; then
2956 case "$usecrosscompile" in
2958 $echo "Cross-compiling..."
2961 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2962 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2963 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2964 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2965 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2966 # leave out ld, choosing it is more complex
2967 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2968 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2969 # We are in a weird spot. Just before us, some values
2970 # were 'saved', to be restored after the hints are
2971 # run. This means that the changes we made to ar,
2972 # nm and ranlib will get reverted.
2973 # To avoid that, we hijack the saving mechanism and
2974 # have it save our new values.
2975 for file in ar nm ranlib; do
2977 eval $file=$xxx$_exe
2982 case "$targetarch" in
2983 '') echo "Targetarch not defined." >&4; croak=y ;;
2984 *) echo "Using targetarch $targetarch." >&4 ;;
2986 case "$targethost" in
2987 '') echo "Targethost not defined." >&4; croak=n ;;
2988 *) echo "Using targethost $targethost." >&4
2993 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2995 : compile a host miniperl and generate_uudmap, unless we got passed them
2996 if $test "X$hostperl" = X; then
2997 echo "Building host miniperl and generate_uudmap binaries" >&4
3005 $src/Configure -des -Dusedevel -Dmksymlinks
3007 case "$hostgenerate" in
3008 '') $make generate_uudmap
3009 hostgenerate=$src/host/generate_uudmap
3011 "$undef") hostgenerate=''
3014 hostperl=$src/host/miniperl
3017 hostosname=`$hostperl -le 'print $^O'`
3020 usecrosscompile="$undef"
3024 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3025 case "$targethost" in
3026 '') echo "Checking for cross-compile" >&4
3027 case "$usecrosscompile$multiarch" in
3028 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3029 if [ -f Makefile ]; then
3031 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3033 echo "Configure done."
3037 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3044 *) echo "Using targethost $targethost." >&4
3046 /*) run=$src/Cross/run
3047 targetmkdir=$src/Cross/mkdir
3049 from=$src/Cross/from
3051 *) pwd=`$test -f ../Configure & cd ..; pwd`
3053 targetmkdir=$pwd/Cross/mkdir
3055 from=$pwd/Cross/from
3058 case "$targetrun" in
3059 '') targetrun=ssh ;;
3064 case "$targetfrom" in
3065 '') targetfrom=scp ;;
3069 from=$from-$targetfrom
3070 case "$targetdir" in
3072 echo "Guessing targetdir $targetdir." >&4
3075 case "$targetuser" in
3077 echo "Guessing targetuser $targetuser." >&4
3080 case "$targetport" in
3082 echo "Guessing targetport $targetport." >&4
3085 case "$targetfrom" in
3089 case "$targetrun" in
3109 '') cwd=$targetdir ;;
3114 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3120 *) echo "Unknown targetrun '$targetrun'" >&4
3124 case "$targetmkdir" in
3126 cat >$targetmkdir <<EOF
3128 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3130 $chmod a+rx $targetmkdir
3132 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3144 $targetmkdir \`dirname \$f\`
3145 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3148 $targetmkdir $targetdir/\`dirname \$f\`
3149 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3162 $mkdir -p $targetdir/\`dirname \$f\`
3163 $cp \$f $targetdir/\$f || exit 1
3166 $targetmkdir $targetdir/\`dirname \$f\`
3167 $cp \$f $targetdir/\$f || exit 1
3174 *) echo "Unknown targetto '$targetto'" >&4
3178 case "$targetfrom" in
3185 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3190 cp) cat >$from <<EOF
3195 cp $targetdir/\$f . || exit 1
3200 *) echo "Unknown targetfrom '$targetfrom'" >&4
3204 if $test ! -f $run; then
3205 echo "Target 'run' script '$run' not found." >&4
3209 if $test ! -f $to; then
3210 echo "Target 'to' script '$to' not found." >&4
3214 if $test ! -f $from; then
3215 echo "Target 'from' script '$from' not found." >&4
3219 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3223 Using '$run' for remote execution,
3224 and '$from' and '$to'
3225 for remote file transfer.
3231 usecrosscompile="$undef"
3236 : see whether [:lower:] and [:upper:] are supported character classes
3238 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3240 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3244 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3245 # (0xd9 and 0xe2), therefore that is a nice testing point.
3246 if test "X$up" = X -o "X$low" = X; then
3247 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3253 if test "X$up" = X -o "X$low" = X; then
3254 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3260 if test "X$up" = X -o "X$low" = X; then
3261 case "`echo RS | od -x 2>/dev/null`" in
3263 echo "Hey, this might be EBCDIC." >&4
3264 if test "X$up" = X -o "X$low" = X; then
3265 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3266 rs) up='[A-IJ-RS-Z]'
3271 if test "X$up" = X -o "X$low" = X; then
3272 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3282 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3284 echo "Using $up and $low to convert case." >&4
3287 echo "I don't know how to translate letters from upper to lower case." >&4
3288 echo "Your tr is not acting any way I know of." >&4
3292 : set up the translation script tr, must be called with ./tr of course
3296 '[A-Z][a-z]') exec $tr '$up' '$low';;
3297 '[a-z][A-Z]') exec $tr '$low' '$up';;
3304 : Try to determine whether config.sh was made on this system
3305 case "$config_sh" in
3307 myuname=`$uname -a 2>/dev/null`
3308 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3309 # Downcase everything to avoid ambiguity.
3310 # Remove slashes and single quotes so we can use parts of this in
3311 # directory and file names.
3312 # Remove newlines so myuname is sane to use elsewhere.
3313 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3314 # because the A-Z/a-z are not consecutive.
3315 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3316 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3317 newmyuname="$myuname"
3319 case "$knowitall" in
3321 if test -f ../config.sh; then
3322 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3323 eval "`grep myuname= ../config.sh`"
3325 if test "X$myuname" = "X$newmyuname"; then
3333 : Get old answers from old config file if Configure was run on the
3334 : same system, otherwise use the hints.
3337 if test -f config.sh; then
3339 rp="I see a config.sh file. Shall I use it to set the defaults?"
3342 n*|N*) echo "OK, I'll ignore it."
3343 mv config.sh config.sh.old
3344 myuname="$newmyuname"
3346 *) echo "Fetching default answers from your old config.sh file..." >&4
3354 : Older versions did not always set $sh. Catch re-use of such
3364 if test ! -f config.sh; then
3367 First time through, eh? I have some defaults handy for some systems
3368 that need some extra help getting the Configure answers right:
3371 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3373 : Half the following guesses are probably wrong... If you have better
3374 : tests or hints, please send them to https://github.com/Perl/perl5/issues
3375 : The metaconfig authors would also appreciate a copy...
3376 $test -f /irix && osname=irix
3377 $test -f /xenix && osname=sco_xenix
3378 $test -f /dynix && osname=dynix
3379 $test -f /dnix && osname=dnix
3380 $test -f /lynx.os && osname=lynxos
3381 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3382 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3383 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3384 $test -f /bin/mips && /bin/mips && osname=mips
3385 $test -d /usr/apollo/bin && osname=apollo
3386 $test -f /etc/saf/_sactab && osname=svr4
3387 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3388 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3389 $test -f /sys/utilities/MultiView && osname=amigaos
3390 if $test -d /MachTen -o -d /MachTen_Folder; then
3392 if $test -x /sbin/version; then
3393 osvers=`/sbin/version | $awk '{print $2}' |
3394 $sed -e 's/[A-Za-z]$//'`
3395 elif $test -x /usr/etc/version; then
3396 osvers=`/usr/etc/version | $awk '{print $2}' |
3397 $sed -e 's/[A-Za-z]$//'`
3403 $test -f /sys/posix.dll &&
3404 $test -f /usr/bin/what &&
3405 set X `/usr/bin/what /sys/posix.dll` &&
3406 $test "$3" = UWIN &&
3410 if $test -f $uname; then
3418 umips) osname=umips ;;
3421 [23]100) osname=mips ;;
3423 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3424 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3427 elif $test -f /etc/kconfig; then
3429 if test "$lns" = "$ln -s"; then
3431 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3433 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3440 if test -n "$DJGPP"; then
3449 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3451 # oslevel can fail with:
3452 # oslevel: Unable to acquire lock.
3453 *not\ found) osvers="$4"."$3" ;;
3454 '<3240'|'<>3240') osvers=3.2.0 ;;
3455 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3456 '=3250'|'>3250') osvers=3.2.5 ;;
3460 bitrig) osname=bitrig
3463 bsd386) osname=bsd386
3466 cygwin*) osname=cygwin
3469 *dc.osx) osname=dcosx
3475 domainos) osname=apollo
3481 dragonfly) osname=dragonfly
3484 dynixptx*) osname=dynixptx
3485 osvers=`echo "$4"|sed 's/^v//'`
3487 freebsd) osname=freebsd
3489 genix) osname=genix ;;
3493 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3506 $test -f /system/lib/libandroid.so && osname=linux-android
3513 netbsd*) osname=netbsd
3516 news-os) osvers="$3"
3518 4*) osname=newsos4 ;;
3522 nonstop-ux) osname=nonstopux ;;
3523 openbsd) osname=openbsd
3529 POSIX-BC | posix-bc ) osname=posix-bc
3532 powerux | power_ux | powermax_os | powermaxos | \
3533 powerunix | power_unix) osname=powerux
3539 solaris) osname=solaris
3541 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3548 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3552 titanos) osname=titanos
3561 ultrix) osname=ultrix
3564 osf1|mls+) case "$5" in
3567 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3570 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3573 hp*) osname=hp_osf1 ;;
3574 mips) osname=mips_osf1 ;;
3577 # UnixWare 7.1.2 is known as Open UNIX 8
3578 openunix|unixware) osname=svr5
3586 $2) case "$osname" in
3590 : svr4.x or possibly later
3600 if test -f /stand/boot ; then
3601 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3602 if test -n "$INITPROG" -a -f "$INITPROG"; then
3603 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3604 if test -n "$isesix"; then
3612 *) if test -f /etc/systemid; then
3614 set `echo $3 | $sed 's/\./ /g'` $4
3615 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3617 elif $test -f $src/hints/sco_$1_$2.sh; then
3619 elif $test -f $src/hints/sco_$1.sh; then
3624 '') : Still unknown. Probably a generic Sys V.
3633 *) case "$osname" in
3634 '') : Still unknown. Probably a generic BSD.
3642 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3643 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3644 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3647 $rm -f UU/kernel.what
3648 elif test -d c:/. -o -n "$is_os2" ; then
3655 case "$targetarch" in
3658 case "$targetarch" in
3660 # Will load qnx.sh, which should change osname to nto
3665 # Catch arm-linux-androideabi, mipsel-linux-android,
3666 # and i686-linux-android
3667 osname=linux-android
3671 # Something like arm-linux-gnueabihf is really just
3678 # XXX perhaps we should just assume
3679 # osvers to be 2, or maybe take the value
3680 # from targetarch. Using $run before the
3681 # hints are run is somewhat icky.
3682 set X `$run $uname -a 2>/dev/null`
3685 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3690 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3697 : Now look for a hint file osname_osvers, unless one has been
3698 : specified already.
3701 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3702 : Also try without trailing minor version numbers.
3703 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3704 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3705 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3706 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3709 *) case "$osvers" in
3712 *) if $test -f $src/hints/$file.sh ; then
3714 elif $test -f $src/hints/$xfile.sh ; then
3716 elif $test -f $src/hints/$xxfile.sh ; then
3718 elif $test -f $src/hints/$xxxfile.sh ; then
3720 elif $test -f $src/hints/$xxxxfile.sh ; then
3722 elif $test -f "$src/hints/${osname}.sh" ; then
3731 if $test -f Policy.sh ; then
3734 none) dflt="Policy" ;;
3735 *) dflt="Policy $dflt" ;;
3740 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3744 if $test -f Policy.sh ; then
3747 There's also a Policy hint file available, which should make the
3748 site-specific (policy) questions easier to answer.
3755 You may give one or more space-separated answers, or "none" if appropriate.
3756 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3757 previous run of Configure, you may specify it as well as or instead of
3758 OS-specific hints. If hints are provided for your OS, you should use them:
3759 although Perl can probably be built without hints on many platforms, using
3760 hints often improve performance and may enable features that Configure can't
3761 set up on its own. If there are no hints that match your OS, specify "none";
3762 DO NOT give a wrong version or a wrong OS.
3766 rp="Which of these apply, if any?"
3769 for file in $tans; do
3770 if $test X$file = XPolicy -a -f Policy.sh; then
3772 $cat Policy.sh >> UU/config.sh
3773 elif $test -f $src/hints/$file.sh; then
3774 . $src/hints/$file.sh
3775 $cat $src/hints/$file.sh >> UU/config.sh
3776 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3779 : Give one chance to correct a possible typo.
3780 echo "$file.sh does not exist"
3782 rp="hint to use instead?"
3784 for file in $ans; do
3785 if $test -f "$src/hints/$file.sh"; then
3786 . $src/hints/$file.sh
3787 $cat $src/hints/$file.sh >> UU/config.sh
3788 elif $test X$ans = X -o X$ans = Xnone ; then
3791 echo "$file.sh does not exist -- ignored."
3798 : Remember our hint file for later.
3799 if $test -f "$src/hints/$file.sh" ; then
3809 echo "Fetching default answers from $config_sh..." >&4
3813 cp $config_sh config.sh 2>/dev/null
3825 : Restore computed paths
3826 for file in $loclist $trylist; do
3827 eval $file="\$_$file"
3832 Configure uses the operating system name and version to set some defaults.
3833 The default value is probably right if the name rings a bell. Otherwise,
3834 since spelling matters for me, either accept the default or answer "none"
3841 ''|' '|none) dflt=none ;;
3842 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3845 *) dflt="$osname" ;;
3847 rp="Operating system name?"
3851 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3857 ''|' '|none) dflt=none ;;
3858 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3859 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3861 ''|' ') dflt=none ;;
3866 *) dflt="$osvers" ;;
3868 rp="Operating system version?"
3878 : who configured the system
3879 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3882 cf_by=`(logname) 2>/dev/null`
3885 cf_by=`(whoami) 2>/dev/null`
3887 "") cf_by=unknown ;;
3892 : decide how portable to be. Allow command line overrides.
3893 case "$d_portable" in
3895 *) d_portable="$define" ;;
3898 : set up shell script to do ~ expansion
3904 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3907 if $test -f /bin/csh; then
3908 /bin/csh -f -c "glob \$1"
3913 name=\`$expr x\$1 : '..\([^/]*\)'\`
3914 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3915 if $test ! -d "\$dir"; then
3917 echo "\$me: can't locate home directory for: \$name" >&2
3922 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3938 : now set up to get a file name
3942 cat <<'EOSC' >>getfile
3958 : getfile will accept an answer from the comma-separated list
3959 : enclosed in parentheses even if it does not meet other criteria.
3960 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3961 fn=`echo $fn | sed 's/(.*)//'`
3967 loc_file=`expr $fn : '.*:\(.*\)'`
3968 fn=`expr $fn : '\(.*\):.*'`
3976 */*) fullpath=true;;
3985 *e*) exp_file=true;;
3988 *p*) nopath_ok=true;;
3993 *d*) type='Directory';;
3994 *l*) type='Locate';;
3999 Locate) what='File';;
4004 case "$d_portable" in
4012 while test "$type"; do
4017 true) rp="$rp (~name ok)";;
4020 if test -f UU/getfile.ok && \
4021 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4040 value=`UU/filexp $ans`
4043 if test "$ans" != "$value"; then
4044 echo "(That expands to $value on this system.)"
4058 /*) value="$ansexp" ;;
4059 [a-zA-Z]:/*) value="$ansexp" ;;
4064 echo "I shall only accept a full path name, as in /bin/ls." >&4
4065 echo "Use a ! shell escape if you wish to check pathnames." >&4
4068 echo "Please give a full path name, starting with slash." >&4
4071 echo "Note that using ~name is ok provided it expands well." >&4
4084 for fp in $gfpth; do
4085 if test "X$fp" = X.; then
4090 if test -f "$pf"; then
4092 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4094 echo "($value is not a plain file, but that's ok.)"
4097 if test X"$type" = X; then
4104 for fp in $gfpth; do
4105 if test "X$fp" = X.; then
4110 direxp="$fp/$ansexp"
4112 if test -d "$direxp"; then
4120 if test -d "$ansexp"; then
4121 echo "(Looking for $loc_file in directory $value.)"
4122 value="$value/$loc_file"
4123 ansexp="$ansexp/$loc_file"
4125 if test -f "$ansexp"; then
4128 case "$nopath_ok" in
4129 true) case "$value" in
4131 *) echo "Assuming $value will be in people's path."
4147 if test "$fastread" = yes; then
4152 rp="$what $value doesn't exist. Use that name anyway?"
4171 test "X$gfpthkeep" != Xy && gfpth=""
4174 : determine root of directory hierarchy where package will be installed.
4176 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4183 By default, $package will be installed in $dflt/bin, manual pages
4184 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4185 installation directories. Typically this is something like /usr/local.
4186 If you wish to have binaries under /usr/bin but other parts of the
4187 installation under /usr/local, that's ok: you will be prompted
4188 separately for each of the installation directories, the prefix being
4189 only used to set the defaults.
4193 rp='Installation prefix to use?'
4200 *) oldprefix="$prefix";;
4206 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4212 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4214 *) prefixexp="$ansexp"
4217 : allow them to override the AFS root
4220 *) afsroot=$afsroot ;;
4226 $define|true) afs=true ;;
4227 $undef|false) afs=false ;;
4228 *) if $test -d $afsroot; then
4236 echo "AFS may be running... I'll be extra cautious then..." >&4
4238 echo "AFS does not seem to be running..." >&4
4241 : determine installation prefix for where package is to be installed.
4245 Since you are running AFS, I need to distinguish the directory in which
4246 files will reside from the directory in which they are installed (and from
4247 which they are presumably copied to the former directory by occult means).
4250 case "$installprefix" in
4251 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4252 *) dflt="$installprefix";;
4257 In some special cases, particularly when building $package for distribution,
4258 it is convenient to distinguish the directory in which files should be
4259 installed from the directory ($prefix) in which they will
4260 eventually reside. For most users, these two directories are the same.
4263 case "$installprefix" in
4265 *) dflt=$installprefix;;
4269 rp='What installation prefix should I use for installing files?'
4271 installprefix="$ans"
4272 installprefixexp="$ansexp"
4274 : Perform the prefixexp/installprefixexp correction if necessary
4275 cat <<EOS >installprefix
4278 cat <<'EOSC' >>installprefix
4279 : Change installation prefix, if necessary.
4280 if $test X"$prefix" != X"$installprefix"; then
4281 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4283 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4286 chmod +x installprefix
4287 $eunicefix installprefix
4289 : Set variables such as privlib and privlibexp from the output of ./getfile
4290 : performing the prefixexp/installprefixexp correction if necessary.
4291 cat <<EOS >setprefixvar
4294 cat <<'EOSC' >>setprefixvar
4295 eval "${prefixvar}=\"\$ans\""
4296 eval "${prefixvar}exp=\"\$ansexp\""
4299 chmod +x setprefixvar
4300 $eunicefix setprefixvar
4302 : set up the script used to warn in case of inconsistency
4311 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4313 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4314 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4319 echo "*** WHOA THERE!!! ***" >&4
4320 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4323 rp=" Keep the $hint value?"
4326 y) td=$was; tu=$was;;
4330 : function used to set '$1' to '$val'
4331 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4333 $define$undef) . ./whoa; eval "$var=\$td";;
4334 $undef$define) . ./whoa; eval "$var=\$tu";;
4335 *) eval "$var=$val";;
4338 : get the patchlevel
4340 echo "Getting the current patchlevel..." >&4
4341 if $test -r $rsrc/patchlevel.h;then
4342 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4343 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4344 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4345 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4346 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4347 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4348 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4357 $echo "(You do not have patchlevel.h. Eek.)"
4359 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4360 version_patchlevel_string="version $patchlevel subversion $subversion"
4361 case "$perl_patchlevel" in
4363 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4364 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4368 $echo "(You have $package $version_patchlevel_string.)"
4372 : XXX Should be a Configure test for double-dots in filenames.
4373 version=`echo $revision $patchlevel $subversion | \
4374 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4375 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4376 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4379 version=`echo $revision $patchlevel $subversion | \
4380 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4381 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4382 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4385 : Special case the 5.005_xx maintenance series, which used 5.005
4386 : without any subversion label as a subdirectory in $sitelib
4387 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4388 api_versionstring='5.005'
4391 : Do we want threads support and if so, what type
4392 case "$usethreads" in
4393 $define|true|[yY]*) dflt='y';;
4394 *) # Catch case where user specified ithreads or 5005threads but
4395 # forgot -Dusethreads (A.D. 4/2002)
4396 case "$useithreads$use5005threads" in
4397 *$define*) dflt='y';;
4404 Perl can be built to offer a form of threading support on some systems
4405 To do so, Configure can be run with -Dusethreads.
4407 Note that Perl built with threading support runs slightly slower
4408 and uses slightly more memory than plain Perl.
4410 If this doesn't make any sense to you, just accept the default '$dflt'.
4412 rp='Build a threading Perl?'
4415 y|Y) val="$define" ;;
4421 if $test $patchlevel -lt 9; then
4422 case "$usethreads" in
4424 : Default to ithreads unless overridden on command line or with
4427 case "$use5005threads" in
4429 echo "5.005 threads are no longer supported"
4433 case "$useithreads" in
4434 $undef|false|[nN]*) dflt='n';;
4436 rp='Use the newer interpreter-based ithreads?'
4439 y|Y) val="$define" ;;
4444 : Now set use5005threads to the opposite value.
4445 case "$useithreads" in
4446 $define) val="$undef" ;;
4453 useithreads="$undef"
4454 use5005threads="$undef"
4458 case "$useithreads$use5005threads" in
4462 You cannot have both the ithreads and the 5.005 threads enabled
4463 at the same time. Disabling the 5.005 threads since they are
4464 much less stable than the ithreads.
4467 use5005threads="$undef"
4472 : perl-5.9.x and later
4474 if test X"$usethreads" = "X$define"; then
4475 case "$use5005threads" in
4479 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4486 use5005threads="$undef"
4487 useithreads="$usethreads"
4490 case "$d_oldpthreads" in
4491 '') : Configure tests would be welcome here. For now, assume undef.
4493 *) val="$d_oldpthreads" ;;
4499 : Look for a hint-file generated 'call-back-unit'. If the
4500 : user has specified that a threading perl is to be built,
4501 : we may need to set or change some other defaults.
4502 if $test -f usethreads.cbu; then
4503 echo "Your platform has some specific hints regarding threaded builds, using them..."
4506 case "$usethreads" in
4507 "$define"|true|[yY]*)
4509 (Your platform does not have any specific hints for threaded builds.
4510 Assuming POSIX threads, then.)
4516 : Check if multiplicity is required
4519 Perl can be built so that multiple Perl interpreters can coexist
4520 within the same Perl executable.
4523 case "$useithreads" in
4526 This multiple interpreter support is required for interpreter-based threads.
4530 *) case "$usemultiplicity" in
4531 $define|true|[yY]*) dflt='y';;
4535 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4536 rp='Build Perl for multiplicity?'
4539 y|Y) val="$define" ;;
4547 : Check if morebits is requested
4548 case "$usemorebits" in
4549 "$define"|true|[yY]*)
4550 use64bitint="$define"
4551 uselongdouble="$define"
4552 usemorebits="$define"
4554 *) usemorebits="$undef"
4558 : Determine the C compiler to be used
4564 rp="Use which C compiler?"
4568 : See whether they have no cc but they do have gcc
4570 if $test -f cc.cbu; then
4575 : make some quick guesses about what we are up against
4577 $echo $n "Hmm... $c"
4587 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4588 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4590 echo "Looks kind of like an OSF/1 system, but we'll see..."
4592 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4593 xxx=`./loc addbib blurfl $pth`
4594 if $test -f $xxx; then
4595 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4599 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4600 echo "Looks kind of like an extended USG system, but we'll see..."
4602 echo "Looks kind of like a USG system, but we'll see..."
4606 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4607 echo "Looks kind of like a BSD system, but we'll see..."
4611 echo "Looks kind of like a Version 7 system, but we'll see..."
4614 case "$eunicefix" in
4617 There is, however, a strange, musty smell in the air that reminds me of
4618 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4622 : it so happens the Eunice I know will not run shell scripts in Unix format
4626 echo "Congratulations. You aren't running Eunice."
4630 : Detect OS2. The p_ variable is set above in the Head.U unit.
4631 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4632 : semicolon as a patch separator
4637 I have the feeling something is not exactly right, however...don't tell me...
4638 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4639 (Or you may be running DOS with DJGPP.)
4644 if test -f /xenix; then
4645 echo "Actually, this looks more like a XENIX system..."
4650 echo "It's not Xenix..."
4655 if test -f /venix; then
4656 echo "Actually, this looks more like a VENIX system..."
4663 echo "Nor is it Venix..."
4666 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4667 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4670 : Check if we are using GNU gcc and what its version is
4672 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4676 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4678 printf("%s\n", __VERSION__);
4680 printf("%s\n", "1");
4686 if $cc -o try $ccflags $ldflags try.c; then
4687 gccversion=`$run ./try`
4688 case "$gccversion" in
4689 '') echo "You are not using GNU cc." ;;
4690 *) echo "You are using GNU cc $gccversion."
4696 echo "*** WHOA THERE!!! ***" >&4
4697 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4698 case "$knowitall" in
4700 echo " You'd better start hunting for one and let me know about it." >&4
4706 case "$gccversion" in
4707 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4709 case "$gccversion" in
4710 '') gccosandvers='' ;;
4711 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4712 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4714 case "$gccosandvers" in
4715 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4716 $osname$osvers) ;; # looking good
4717 $osname*) cat <<EOM >&4
4719 *** WHOA THERE!!! ***
4721 Your gcc has not been compiled for the exact release of
4722 your operating system ($gccosandvers versus $osname$osvers).
4724 In general it is a good idea to keep gcc synchronized with
4725 the operating system because otherwise serious problems
4726 may ensue when trying to compile software, like Perl.
4728 I'm trying to be optimistic here, though, and will continue.
4729 If later during the configuration and build icky compilation
4730 problems appear (headerfile conflicts being the most common
4731 manifestation), I suggest reinstalling the gcc to match
4732 your operating system release.
4736 *) gccosandvers='' ;; # failed to parse, better be silent
4744 # gcc 3.* complain about adding -Idirectories that they already know about,
4745 # so we will take those off from locincpth.
4746 case "$gccversion" in
4748 echo "main(){}">try.c
4749 for incdir in $locincpth; do
4750 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4751 grep '^c[cp]p*[01]: warning: changing search order '`
4752 if test "X$warn" != X; then
4753 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4759 # gcc 4.9 by default does some optimizations that break perl.
4760 # see ticket 121505.
4762 # The -fwrapv disables those optimizations (and probably others,) so
4763 # for gcc 4.9 (and later, since the optimizations probably won't go
4764 # away), add -fwrapv unless the user requests -fno-wrapv, which
4765 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4766 # which turns the overflows -fwrapv ignores into runtime errors.
4767 case "$gccversion" in
4768 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4770 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4771 *) ccflags="$ccflags -fwrapv" ;;
4775 : What should the include directory be ?
4776 : Use sysroot if set, so findhdr looks in the right place.
4778 $echo $n "Hmm... $c"
4779 dflt="$sysroot/usr/include"
4782 if $test -f /bin/mips && /bin/mips; then
4783 echo "Looks like a MIPS system..."
4784 $cat >usr.c <<'EOCP'
4785 #ifdef SYSTYPE_BSD43
4789 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4790 dflt='/bsd43/usr/include'
4794 mips_type='System V'
4796 $rm -f usr.c usr.out
4797 echo "and you're compiling with the $mips_type compiler and libraries."
4801 echo "Doesn't look like a MIPS system."
4811 case "$xxx_prompt" in
4814 rp='Where are the include files you want to use?'
4822 : see how we invoke the C preprocessor
4824 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4825 cat <<'EOT' >testcpp.c
4831 if test ! -f cppstdin; then
4832 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4833 # AIX cc -E doesn't show the absolute headerfile
4834 # locations but we'll cheat by using the -M flag.
4835 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4837 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4840 echo "Keeping your $hint cppstdin wrapper."
4843 wrapper=`pwd`/cppstdin
4847 if $test "X$cppstdin" != "X" && \
4848 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4851 echo "You used to use $cppstdin $cppminus so we'll use that again."
4853 '') echo "But let's see if we can live without a wrapper..." ;;
4855 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4856 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4858 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4861 echo "(However, $cpprun $cpplast does not work, let's see...)"
4869 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4876 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4877 $cc -E <testcpp.c >testcpp.out 2>&1; \
4878 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 echo "Yup, it does."
4880 x_cpp="$cc $cppflags -E"
4882 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4883 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4884 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 echo "Yup, it does."
4886 x_cpp="$cc $cppflags -E"
4888 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4889 $cc -P <testcpp.c >testcpp.out 2>&1; \
4890 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4891 echo "Yipee, that works!"
4892 x_cpp="$cc $cppflags -P"
4894 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4895 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4896 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4897 echo "At long last!"
4898 x_cpp="$cc $cppflags -P"
4900 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4901 $cpp <testcpp.c >testcpp.out 2>&1; \
4902 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4904 x_cpp="$cpp $cppflags"
4906 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4907 $cpp - <testcpp.c >testcpp.out 2>&1; \
4908 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4909 echo "Hooray, it works! I was beginning to wonder."
4910 x_cpp="$cpp $cppflags"
4912 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4913 $wrapper <testcpp.c >testcpp.out 2>&1; \
4914 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4920 rp="No dice. I can't find a C preprocessor. Name one:"
4924 $x_cpp <testcpp.c >testcpp.out 2>&1
4925 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4926 echo "OK, that will do." >&4
4928 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4943 echo "Perhaps can we force $cc -E using a wrapper..."
4944 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4945 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4951 echo "Nope, we'll have to live without it..."
4965 "$wrapper"|'cppstdin') ;;
4966 *) $rm -f $wrapper;;
4968 $rm -f testcpp.c testcpp.out
4970 : Adjust cppfilter for path component separator
4972 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4973 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4977 : Use gcc to determine libpth and incpth
4978 # If using gcc or clang, we can get better values for libpth, incpth
4979 # and usrinc directly from the compiler.
4980 # Note that ccname for clang is also gcc.
4983 $echo 'extern int foo;' > try.c
4984 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4986 if $test $# -gt 0; then
4988 incpth="`$echo $incpth|$sed 's/^ //'`"
4990 j="`$echo $i|$sed 's,/include$,/lib,'`"
4991 if $test -d $j; then
4995 libpth="`$echo $libpth|$sed 's/^ //'`"
4996 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4997 if $test -d $xxx; then
5000 *) libpth="$libpth $xxx";;
5007 '') for i in $incpth; do
5008 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5016 case "$usecrosscompile" in
5019 '') echo "Incpth not defined." >&4; croak=y ;;
5020 *) echo "Using incpth '$incpth'." >&4 ;;
5023 '') echo "Libpth not defined." >&4; croak=y ;;
5024 *) echo "Using libpth '$libpth'." >&4 ;;
5027 '') echo "Usrinc not defined." >&4; croak=y ;;
5028 *) echo "Using usrinc $usrinc." >&4 ;;
5032 if test "X$sysroot" = X; then
5033 echo "Cannot continue, aborting." >&4; exit 1
5035 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5044 : Default value for incpth is just usrinc
5046 '') incpth="$usrinc";;
5049 : Set private lib path
5052 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5057 '') dlist="$loclibpth $plibpth $glibpth";;
5058 *) dlist="$libpth";;
5061 : Now check and see which directories actually exist, avoiding duplicates
5064 if $test -d $xxx; then
5067 *) libpth="$libpth $xxx";;
5073 Some systems have incompatible or broken versions of libraries. Among
5074 the directories listed in the question below, please remove any you
5075 know not to be holding relevant libraries, and add any that are needed.
5076 Say "none" for none.
5080 if test "X$sysroot" != X; then
5082 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5095 rp="Directories to use for library searches?"
5102 : compute shared library extension
5105 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5115 On some systems, shared libraries may be available. Answer 'none' if
5116 you want to suppress searching of shared libraries for the remainder
5117 of this configuration.
5120 rp='What is the file extension used for shared libraries?'
5124 : Does target system insist that shared library basenames are unique
5127 Some dynamic loaders assume that the *basename* of shared library filenames
5128 are globally unique. We'll default this to undef as we assume your system
5129 is not this weird. Set to defined if you're on one of them.
5134 rp='Make shared library basenames unique?'
5137 y|Y) val="$define" ;;
5140 set d_libname_unique
5143 : Define several unixisms.
5144 : Hints files or command line option can be used to override them.
5145 : The convoluted testing is in case hints files set either the old
5148 '') case "$exe_ext" in
5150 *) _exe="$exe_ext" ;;
5155 '') case "$lib_ext" in
5162 '') case "$obj_ext" in
5169 '') case "$path_sep" in
5180 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5182 : Which makefile gets called first. This is used by make depend.
5183 case "$firstmakefile" in
5184 '') firstmakefile='makefile';;
5187 : Check is we will use socks
5189 $define|true|[yY]*) dflt='y';;
5194 Perl can be built to use the SOCKS proxy protocol library. To do so,
5195 Configure must be run with -Dusesocks. If you use SOCKS you also need
5196 to use the PerlIO abstraction layer, this will be implicitly selected.
5198 If this doesn't make any sense to you, just accept the default '$dflt'.
5200 rp='Build Perl for SOCKS?'
5203 y|Y) val="$define" ;;
5209 : Check for uselongdouble support
5211 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5214 case "$uselongdouble" in
5215 $define|true|[yY]*) dflt='y';;
5220 Perl can be built to take advantage of long doubles which
5221 (if available) may give more accuracy and range for floating point numbers.
5223 If this doesn't make any sense to you, just accept the default '$dflt'.
5225 rp='Try to use long doubles if available?'
5228 y|Y) val="$define" ;;
5234 case "$uselongdouble" in
5235 true|[yY]*) uselongdouble="$define" ;;
5238 : Look for a hint-file generated 'call-back-unit'. If the
5239 : user has specified that long doubles should be used,
5240 : we may need to set or change some other defaults.
5241 if $test -f uselongdouble.cbu; then
5242 echo "Your platform has some specific hints regarding long doubles, using them..."
5243 . ./uselongdouble.cbu
5245 case "$uselongdouble" in
5248 (Your platform does not have any specific hints for long doubles.)
5254 : Check if quadmath is requested
5255 case "$usequadmath" in
5256 "$define"|true|[yY]*) usequadmath="$define" ;;
5257 *) usequadmath="$undef" ;;
5260 : Fail if both uselongdouble and usequadmath are requested
5261 case "$usequadmath:$uselongdouble" in
5265 *** You requested the use of the quadmath library and use
5266 *** of long doubles.
5268 *** Please select one or the other.
5274 : Looking for optional libraries
5276 echo "Checking for optional libraries..." >&4
5281 case "$libswanted" in
5282 '') libswanted='c_s';;
5285 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5287 case "$usecbacktrace" in
5288 "$define") libswanted="$libswanted bfd" ;;
5290 case "$usequadmath" in
5291 "$define") libswanted="$libswanted quadmath" ;;
5297 for thisdir in $libpth $xlibpth; do
5298 test -d $thisdir && libspath="$libspath $thisdir"
5300 for thislib in $libswanted; do
5301 for thisdir in $libspath; do
5303 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5304 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5305 $test -f "$xxx" && eval $libscheck
5306 $test -f "$xxx" && libstyle=shared
5307 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5308 $test -f "$xxx" && eval $libscheck
5309 $test -f "$xxx" && libstyle=shared
5311 if test ! -f "$xxx"; then
5312 xxx=$thisdir/lib$thislib.$so
5313 $test -f "$xxx" && eval $libscheck
5314 $test -f "$xxx" && libstyle=shared
5316 if test ! -f "$xxx"; then
5317 xxx=$thisdir/lib$thislib$_a
5318 $test -f "$xxx" && eval $libscheck
5319 $test -f "$xxx" && libstyle=static
5321 if test ! -f "$xxx"; then
5322 xxx=$thisdir/$thislib$_a
5323 $test -f "$xxx" && eval $libscheck
5324 $test -f "$xxx" && libstyle=static
5326 if test ! -f "$xxx"; then
5327 xxx=$thisdir/lib${thislib}_s$_a
5328 $test -f "$xxx" && eval $libscheck
5329 $test -f "$xxx" && libstyle=static
5330 $test -f "$xxx" && thislib=${thislib}_s
5332 if test ! -f "$xxx"; then
5333 xxx=$thisdir/Slib$thislib$_a
5334 $test -f "$xxx" && eval $libscheck
5335 $test -f "$xxx" && libstyle=static
5337 if $test -f "$xxx"; then
5339 shared) echo "Found -l$thislib (shared)." ;;
5340 static) echo "Found -l$thislib." ;;
5341 *) echo "Found -l$thislib ($libstyle)." ;;
5345 *) dflt="$dflt -l$thislib"
5346 libsfound="$libsfound $xxx"
5348 libsfiles="$libsfiles $yyy"
5349 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5350 case " $libsdirs " in
5352 *) libsdirs="$libsdirs $yyy" ;;
5359 if $test ! -f "$xxx"; then
5360 echo "No -l$thislib."
5371 ' '|'') dflt='none';;
5376 In order to compile $package on your machine, a number of libraries
5377 are usually needed. Include any other special libraries here as well.
5378 Say "none" for none. The default list is almost always right.
5382 rp="What libraries to use?"
5389 : determine optimization, if desired, or use for debug flag also
5391 ' '|$undef) dflt='none';;
5393 *) dflt="$optimize";;
5397 By default, $package compiles with the -O flag to use the optimizer.
5398 Alternately, you might want to use the symbolic debugger, which uses
5399 the -g flag (on traditional Unix systems). Either flag can be
5400 specified here. To use neither flag, specify the word "none".
5403 rp="What optimizer/debugger flag should be used?"
5407 'none') optimize=" ";;
5410 : Check what DEBUGGING is required from the command line
5411 : -DEBUGGING or -DDEBUGGING or
5412 : -DEBUGGING=both = -g + -DDEBUGGING
5413 : -DEBUGGING=-g or -Doptimize=-g = -g
5414 : -DEBUGGING=none or -UDEBUGGING =
5415 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5418 *) DEBUGGING=$EBUGGING ;;
5421 case "$DEBUGGING" in
5425 *) optimize="$optimize -g" ;;
5429 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5437 case "$DEBUGGING" in
5438 both|$define) dflt='-DDEBUGGING'
5441 : argument order is deliberate, as the flag will start with - which set could
5442 : think is an option
5443 checkccflag='check=$1; flag=$2; callback=$3;
5445 echo "Checking if your compiler accepts $flag" 2>&1;
5446 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5447 echo "int main(void) { return 0; }" > gcctest.c;
5448 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5449 echo "Yes, it does." 2>&1;
5450 if $test -s gcctest.out ; then
5451 echo "But your platform does not like it:";
5456 echo "Leaving current flags $ccflags alone." 2>&1
5458 *) dflt="$dflt $flag";
5464 echo "Nope, it does not, but that is ok." 2>&1;
5468 : We will not override a previous value, but we might want to
5469 : augment a hint file
5471 default|recommended)
5472 case "$gccversion" in
5473 1.*) dflt="$dflt -fpcc-struct-return" ;;
5475 case "$optimize:$DEBUGGING" in
5476 *-g*:old) dflt="$dflt -DDEBUGGING";;
5478 case "$gccversion" in
5479 2.*) if $test -d /etc/conf/kconfig.d &&
5480 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5482 # Interactive Systems (ISC) POSIX mode.
5487 case "$gccversion" in
5490 ?*) set strict-aliasing -fno-strict-aliasing
5494 # For gcc, adding -pipe speeds up compilations for some, but apparently
5495 # some assemblers can't read from stdin. (It also slows down compilations
5496 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5497 case "$gccversion" in
5503 # on x86_64 (at least) we require an extra library (libssp) in the
5504 # link command line. This library is not named, so I infer that it is
5505 # an implementation detail that may change. Hence the safest approach
5506 # is to add the flag to the flags passed to the compiler at link time,
5507 # as that way the compiler can do the right implementation dependant
5510 amigaos) ;; # -fstack-protector builds but doesn't work
5511 *) case "$gccversion" in
5512 ?*) set stack-protector-strong -fstack-protector-strong
5515 *-fstack-protector-strong*) ;; # It got added.
5516 *) # Try the plain/older -fstack-protector.
5517 set stack-protector -fstack-protector
5528 case "$mips_type" in
5529 *BSD*|'') inclwanted="$locincpth $usrinc";;
5530 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5532 for thisincl in $inclwanted; do
5533 if $test -d $thisincl; then
5534 if $test x$thisincl != x$usrinc; then
5536 *" -I$thisincl "*);;
5537 *) dflt="$dflt -I$thisincl ";;
5543 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5545 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5553 *) dflt="$dflt -D$2";;
5557 set signal.h LANGUAGE_C; eval $inctest
5561 ccflags="$ccflags -DSOCKS"
5566 default|recommended) dflt="$ccflags $dflt" ;;
5567 *) dflt="$ccflags";;
5576 Your C compiler may want other flags. For this question you should include
5577 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5578 but you should NOT include libraries or ld flags like -lwhatever. If you
5579 want $package to honor its debug switch, you should include -DDEBUGGING here.
5580 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5582 To use no flags, specify the word "none".
5588 rp="Any additional cc flags?"
5595 : the following weeds options from ccflags that are of no interest to cpp
5597 '') cppflags="$ccflags" ;;
5598 *) set X $ccflags; shift
5599 case " $cppflags " in
5600 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5601 *) cppflags="$cppflags $ccflags" ;;
5605 case "$gccversion" in
5606 1.*) cppflags="$cppflags -D__GNUC__"
5608 case "$mips_type" in
5610 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5616 echo "Let me guess what the preprocessor flags are..." >&4
5630 *) ftry="$previous $flag";;
5632 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5633 >cpp1.out 2>/dev/null && \
5634 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5635 >cpp2.out 2>/dev/null && \
5636 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5637 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5639 cppflags="$cppflags $ftry"
5649 *-*) echo "They appear to be: $cppflags";;
5651 $rm -f cpp.c cpp?.out
5655 : flags used in final linking phase
5657 '') if ./venix; then
5663 *-posix*) dflt="$dflt -posix" ;;
5666 *) dflt="$ldflags";;
5668 # See note above about -fstack-protector
5670 *-fstack-protector-strong*)
5672 *-fstack-protector-strong*) ;; # Don't add it again
5673 *) dflt="$dflt -fstack-protector-strong" ;;
5676 *-fstack-protector*)
5678 *-fstack-protector*) ;; # Don't add it again
5679 *) dflt="$dflt -fstack-protector" ;;
5684 : Try to guess additional flags to pick up local libraries.
5685 for thislibdir in $libpth; do
5686 case " $loclibpth " in
5689 *"-L$thislibdir "*) ;;
5690 *) dflt="$dflt -L$thislibdir" ;;
5702 Your C linker may need flags. For this question you should
5703 include -L/whatever and any other flags used by the C linker, but you
5704 should NOT include libraries like -lwhatever.
5706 Make sure you include the appropriate -L/path flags if your C linker
5707 does not normally search all of the directories you specified above,
5710 To use no flags, specify the word "none".
5714 rp="Any additional ld flags (NOT including libraries)?"
5720 rmlist="$rmlist pdp11"
5724 echo "Checking your choice of C compiler and flags for coherency..." >&4
5725 $cat > try.c <<'EOF'
5727 int main() { printf("Ok\n"); return(0); }
5729 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5731 $cat >try.msg <<'EOM'
5732 I've tried to compile and run the following simple program:
5735 $cat try.c >> try.msg
5737 $cat >> try.msg <<EOM
5744 and I got the following output:
5748 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5749 if $sh -c "$run ./try " >>try.msg 2>&1; then
5753 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5756 echo "The program compiled OK, but exited with status $?." >>try.msg
5757 rp="You have a problem. Shall I abort Configure"
5761 echo "I can't compile the test program." >>try.msg
5762 rp="You have a BIG problem. Shall I abort Configure"
5768 case "$knowitall" in
5770 echo "(The supplied flags or libraries might be incorrect.)"
5778 *) echo "Ok. Stopping Configure." >&4
5783 n) echo "OK, that should do.";;
5785 $rm_try gcctest gcctest.out
5787 : define a shorthand compile call
5791 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5792 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
5796 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5797 : define a shorthand compile call for compilations that should be ok.
5801 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5803 : stub, used only to satisfy other units
5806 : check for lengths of integral types
5810 echo "Checking to see how big your integers are..." >&4
5819 printf("intsize=%d;\n", (int)sizeof(int));
5820 printf("longsize=%d;\n", (int)sizeof(long));
5821 printf("shortsize=%d;\n", (int)sizeof(short));
5826 if eval $compile_ok && $run ./try > /dev/null; then
5828 echo "Your integers are $intsize bytes long."
5829 echo "Your long integers are $longsize bytes long."
5830 echo "Your short integers are $shortsize bytes long."
5834 Help! I can't compile and run the intsize test program: please enlighten me!
5835 (This is probably a misconfiguration in your system or libraries, and
5836 you really ought to fix it. Still, I'll try anyway.)
5840 rp="What is the size of an integer (in bytes)?"
5844 rp="What is the size of a long integer (in bytes)?"
5848 rp="What is the size of a short integer (in bytes)?"
5856 : check for long long
5858 echo "Checking to see if you have long long..." >&4
5859 echo 'int main() { long long x = 7; return 0; }' > try.c
5861 if eval $compile; then
5863 echo "You have long long."
5866 echo "You do not have long long."
5872 : check for length of long long
5873 case "${d_longlong}${longlongsize}" in
5876 echo "Checking to see how big your long longs are..." >&4
5877 $cat >try.c <<'EOCP'
5881 printf("%d\n", (int)sizeof(long long));
5886 if eval $compile_ok; then
5887 longlongsize=`$run ./try`
5888 echo "Your long longs are $longlongsize bytes long."
5892 echo "(I can't seem to compile the test program. Guessing...)"
5893 rp="What is the size of a long long (in bytes)?"
5897 if $test "X$longsize" = "X$longlongsize"; then
5898 echo "(That isn't any different from an ordinary long.)"
5904 : determine filename position in cpp output
5906 echo "Computing filename position in cpp output for #include directives..." >&4
5908 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5913 vos) testaccess=-e ;;
5916 echo '#include <stdio.h>' > foo.c
5919 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5920 $grep '^[ ]*#.*stdio\.h' | \
5921 while read cline; do
5924 while $test \$# -gt 0; do
5925 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5930 pos=\`expr \$pos + 1\`
5944 *) pos="${fieldn}th";;
5946 echo "Your cpp writes the filename in the $pos field of the line."
5948 : locate header file
5953 for usrincdir in $incpth
5955 if test -f \$usrincdir/\$wanted; then
5956 echo "\$usrincdir/\$wanted"
5960 awkprg='{ print \$$fieldn }'
5961 echo "#include <\$wanted>" > foo\$\$.c
5962 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5963 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5964 while read cline; do
5965 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5967 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5968 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5973 # status = 0: grep returned 0 lines, case statement not executed
5974 # status = 1: headerfile found
5975 # status = 2: while loop executed, no headerfile found
5979 if test \$status -eq 1; then
5986 : define an alternate in-header-list? function
5987 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5988 cont=true; xxf="echo \"<\$1> found.\" >&4";
5989 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5990 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5992 case $# in 4) instead=instead;; *) instead="at last";; esac;
5993 while $test "$cont"; do
5995 var=$2; eval "was=\$$2";
5996 if $test "$xxx" && $test -r "$xxx";
5998 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
6001 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
6002 set $yyy; shift; shift; yyy=$@;
6003 case $# in 0) cont="";;
6004 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
6005 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
6006 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
6007 xxnf="echo \"there is no <\$1>, ...\" >&4";;
6011 do set $yyy; var=$2; eval "was=\$$2";
6012 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6013 set $yyy; shift; shift; yyy=$@;
6016 : see if inttypes.h is available
6017 : we want a real compile instead of Inhdr because some systems
6018 : have an inttypes.h which includes non-existent headers
6021 #include <inttypes.h>
6023 static int32_t foo32 = 0x12345678;
6027 if eval $compile; then
6028 echo "<inttypes.h> found." >&4
6031 echo "<inttypes.h> NOT found." >&4
6040 echo "Checking to see if you have int64_t..." >&4
6042 #include <sys/types.h>
6043 #$i_inttypes I_INTTYPES
6045 #include <inttypes.h>
6047 int main() { int64_t x = 7; }
6050 if eval $compile; then
6052 echo "You have int64_t."
6055 echo "You do not have int64_t."
6061 : Check if 64bit ints have a quad type
6063 echo "Checking which 64-bit integer type we could use..." >&4
6069 val='"unsigned int"'
6074 *) case "$longsize" in
6078 val='"unsigned long"'
6083 *) case "$d_longlong:$longlongsize" in
6088 val='"unsigned long long"'
6093 *) case "$d_int64_t" in
6112 '') echo "Alas, no 64-bit integer types in sight." >&4
6115 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6120 : Do we want 64bit support
6121 case "$uselonglong" in
6122 "$define"|true|[yY]*)
6125 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6127 use64bitint="$define"
6130 case "$use64bits" in
6131 "$define"|true|[yY]*)
6134 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6136 use64bitint="$define"
6139 case "$use64bitints" in
6140 "$define"|true|[yY]*)
6143 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6145 use64bitint="$define"
6148 case "$use64bitsint" in
6149 "$define"|true|[yY]*)
6152 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6154 use64bitint="$define"
6157 case "$uselonglongs" in
6158 "$define"|true|[yY]*)
6161 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6163 use64bitint="$define"
6166 case "$use64bitsall" in
6167 "$define"|true|[yY]*)
6170 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6172 use64bitall="$define"
6177 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6179 case "$use64bitall" in
6180 "$define"|true|[yY]*) use64bitint="$define" ;;
6186 You have natively 64-bit long integers.
6190 *) case "$use64bitint" in
6191 "$define"|true|[yY]*) dflt='y';;
6200 Perl can be built to take advantage of 64-bit integer types
6201 on some systems. To do so, Configure can be run with -Duse64bitint.
6202 Choosing this option will most probably introduce binary incompatibilities.
6204 If this doesn't make any sense to you, just accept the default '$dflt'.
6205 (The default has been chosen based on your configuration.)
6207 rp='Try to use 64-bit integers, if available?'
6210 [yY]*) val="$define" ;;
6218 case "$use64bitall" in
6219 "$define"|true|[yY]*) dflt='y' ;;
6220 *) case "$longsize" in
6228 You may also choose to try maximal 64-bitness. It means using as much
6229 64-bitness as possible on the platform. This in turn means even more
6230 binary incompatibilities. On the other hand, your platform may not
6231 have any more 64-bitness available than what you already have chosen.
6233 If this doesn't make any sense to you, just accept the default '$dflt'.
6234 (The default has been chosen based on your configuration.)
6236 rp='Try to use maximal 64-bit support, if available?'
6239 [yY]*) val="$define" ;;
6244 case "$use64bitall" in
6246 case "$use64bitint" in
6250 Since you have chosen a maximally 64-bit build, I'm also turning on
6251 the use of 64-bit integers.
6253 use64bitint="$define" ;;
6258 : Look for a hint-file generated 'call-back-unit'. If the
6259 : user has specified that a 64-bit perl is to be built,
6260 : we may need to set or change some other defaults.
6261 if $test -f use64bitint.cbu; then
6262 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6265 case "$use64bitint" in
6266 "$define"|true|[yY]*)
6267 : This test was common to all the OpenBSD forks, and seems harmless for
6270 echo "Checking if your C library has broken 64-bit functions..." >&4
6273 typedef $uquadtype myULL;
6280 {4294967303.15, 4294967303ULL},
6281 {4294967294.2, 4294967294ULL},
6282 {4294967295.7, 4294967295ULL},
6285 for (p = test; p->u; p++) {
6286 myULL x = (myULL)p->d;
6297 if eval $compile_ok; then
6298 libcquad=`$run ./try`
6299 echo "Your C library's 64-bit functions are $libcquad."
6301 echo "(I can't seem to compile the test program.)"
6302 echo "Assuming that your C library's 64-bit functions are ok."
6311 *** You have a C library with broken 64-bit functions.
6312 *** 64-bit support does not work reliably in this configuration.
6313 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6314 *** Cannot continue, aborting.
6321 4) case "$archname64" in
6322 '') archname64=64int ;;
6329 : Look for a hint-file generated 'call-back-unit'. If the
6330 : user has specified that a maximally 64-bit perl is to be built,
6331 : we may need to set or change some other defaults.
6332 if $test -f use64bitall.cbu; then
6333 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6336 case "$use64bitall" in
6337 "$define"|true|[yY]*)
6339 4) case "$archname64" in
6340 ''|64int) archname64=64all ;;
6347 case "$d_quad:$use64bitint" in
6351 *** You have chosen to use 64-bit integers,
6352 *** but none can be found.
6353 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6354 *** Cannot continue, aborting.
6361 : Check if we are using the GNU C library
6363 echo "Checking for GNU C Library..." >&4
6365 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6366 alone are insufficient to distinguish different versions, such as
6367 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6368 libc version 2.1.0. A. Dougherty, June 3, 2002.
6374 # ifdef __GLIBC_MINOR__
6375 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6376 # include <gnu/libc-version.h>
6377 printf("%s\n", gnu_get_libc_version());
6379 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6382 printf("%d\n", __GLIBC__);
6391 if eval $compile_ok && $run ./try > glibc.ver; then
6393 gnulibc_version=`$cat glibc.ver`
6394 echo "You are using the GNU C Library version $gnulibc_version"
6398 echo "You are not using the GNU C Library"
6404 : see if nm is to be used to determine whether a symbol is defined or not
6408 case "$d_gnulibc" in
6411 echo "nm probably won't work on the GNU C Library." >&4
6417 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6419 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6420 echo "'nm' won't be sufficient on this system." >&4
6426 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6427 if $test $dflt -gt 20; then
6437 true|$define) dflt=y;;
6444 I can use $nm to extract the symbols from your C libraries. This
6445 is a time consuming task which may generate huge output on the disk (up
6446 to 3 megabytes) but that should make the symbols extraction faster. The
6447 alternative is to skip the 'nm' extraction part and to compile a small
6448 test program instead to determine whether each symbol is present. If
6449 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6450 this may be the best solution.
6452 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6455 rp="Shall I use $nm to extract C symbols from the libraries?"
6458 [Nn]*) usenm=false;;
6467 : nm options which may be necessary
6469 '') if $test -f /mach_boot; then
6471 elif $test -d /usr/ccs/lib; then
6472 nm_opt='-p' # Solaris (and SunOS?)
6473 elif $test -f /dgux; then
6475 elif $test -f /lib64/rld; then
6476 nm_opt='-p' # 64-bit Irix
6482 : nm options which may be necessary for shared libraries but illegal
6483 : for archive libraries. Thank you, Linux.
6484 case "$nm_so_opt" in
6485 '') case "$myuname" in
6487 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6488 nm_so_opt='--dynamic'
6495 : Figure out where the libc is located
6498 : get list of predefined functions in a handy place
6503 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6509 *) for thislib in $libs; do
6512 : Handle C library specially below.
6515 thislib=`echo $thislib | $sed -e 's/^-l//'`
6516 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6518 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6520 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6522 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6524 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6526 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6528 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6533 libnames="$libnames $try"
6535 *) libnames="$libnames $thislib" ;;
6544 for xxx in $libpth; do
6545 $test -r $1 || set $xxx/libc.$so
6546 : The messy sed command sorts on library version numbers.
6548 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6549 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6551 s/[0-9][0-9]*/0000&/g
6552 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6555 $sort | $sed -e 's/^.* //'`
6558 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6559 $test -r $1 || set $sysroot/lib/libsys_s$_a
6565 if $test -r "$1"; then
6566 echo "Your (shared) C library seems to be in $1."
6568 elif $test -r /lib/libc && $test -r /lib/clib; then
6569 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6571 libc='/lib/clib /lib/libc'
6572 if $test -r /lib/syslib; then
6573 echo "(Your math library is in /lib/syslib.)"
6574 libc="$libc /lib/syslib"
6576 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6577 echo "Your C library seems to be in $libc, as you said before."
6578 elif $test -r $incpath/usr/lib/libc$_a; then
6579 libc=$incpath/usr/lib/libc$_a;
6580 echo "Your C library seems to be in $libc. That's fine."
6581 elif $test -r /lib/libc$_a; then
6583 echo "Your C library seems to be in $libc. You're normal."
6585 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6587 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6588 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6589 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6591 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6593 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6596 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6598 if $test -r "$tans"; then
6599 echo "Your C library seems to be in $tans, of all places."
6605 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6609 If the guess above is wrong (which it might be if you're using a strange
6610 compiler, or your machine supports multiple models), you can override it here.
6615 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6617 I can't seem to find your C library. I've looked in the following places:
6620 $sed 's/^/ /' libpath
6623 None of these seems to contain your C library. I need to get its name...
6628 rp='Where is your C library?'
6633 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6634 set X `cat libnames`
6637 case $# in 1) xxx=file; esac
6638 echo "Extracting names from the following $xxx for later perusal:" >&4
6640 $sed 's/^/ /' libnames >&4
6642 $echo $n "This may take a while...$c" >&4
6646 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6647 *) $nm $nm_opt $file 2>/dev/null;;
6652 $grep fprintf libc.tmp > libc.ptf
6653 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6654 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6656 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6676 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6680 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6681 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6697 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6701 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6705 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6707 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6709 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6711 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6714 $nm -p $* 2>/dev/null >libc.tmp
6715 $grep fprintf libc.tmp > libc.ptf
6716 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6717 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6723 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6725 if $ar t $libc > libc.tmp && \
6726 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6728 for thisname in $libnames $libc; do
6729 $ar t $thisname >>libc.tmp
6731 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6733 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6734 for thisname in $libnames $libc; do
6735 $ar tv $thisname >>libc.tmp
6736 emximp -o tmp.imp $thisname \
6738 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6739 < tmp.imp >>libc.tmp
6742 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6745 echo "$ar didn't seem to work right." >&4
6746 echo "Maybe this is a Cray...trying bld instead..." >&4
6748 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6751 for thisname in $libnames; do
6753 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6754 $ar t $thisname >>libc.tmp
6758 echo "That didn't work either. Giving up." >&4
6768 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6769 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6771 *) if $test -f /lib/syscalls.exp; then
6773 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6774 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6775 /lib/syscalls.exp >>libc.list
6781 $rm -f libnames libpath
6783 : Check if we are using C++
6785 echo "Checking for C++..." >&4
6786 $cat >try.c <<'EOCP'
6798 if eval $compile_ok && $run ./try; then
6800 echo "You are using a C++ compiler."
6803 echo "You are not using a C++ compiler."
6809 : is a C symbol defined?
6812 -v) tf=libc.tmp; tdc="";;
6813 -a) tf=libc.tmp; tdc="[]";;
6814 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6816 case "$d_cplusplus" in
6817 $define) extern_C="extern \"C\"" ;;
6818 *) extern_C="extern" ;;
6821 case "$reuseval-$4" in
6823 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6828 if $test "$runnm" = true; then
6829 if $contains $tlook $tf >/dev/null 2>&1; then
6831 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6832 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6833 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6834 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6838 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6839 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6845 $define) tval=true;;
6852 : define an is-in-libc? function
6853 inlibc='echo " "; td=$define; tu=$undef;
6854 sym=$1; var=$2; eval "was=\$$2";
6856 case "$reuseval$was" in
6866 echo "$sym() found." >&4;
6867 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6869 echo "$sym() NOT found." >&4;
6870 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6874 $define) echo "$sym() found." >&4;;
6875 *) echo "$sym() NOT found." >&4;;
6879 : check for length of double
6881 case "$doublesize" in
6883 echo "Checking to see how big your double precision numbers are..." >&4
6892 printf("%d\n", (int)sizeof(double));
6897 if eval $compile_ok; then
6898 doublesize=`$run ./try`
6899 echo "Your double is $doublesize bytes long."
6902 echo "(I can't seem to compile the test program. Guessing...)"
6903 rp="What is the size of a double precision number (in bytes)?"
6911 : check for long doubles
6913 echo "Checking to see if you have long double..." >&4
6914 echo 'int main() { long double x = 7.0; }' > try.c
6916 if eval $compile; then
6918 echo "You have long double."
6921 echo "You do not have long double."
6927 : see if ldexpl exists
6931 : check for length of long double
6932 case "${d_longdbl}${longdblsize}" in
6935 echo "Checking to see how big your long doubles are..." >&4
6936 $cat >try.c <<'EOCP'
6940 printf("%d\n", sizeof(long double));
6945 if eval $compile; then
6946 longdblsize=`$run ./try`
6947 echo "Your long doubles are $longdblsize bytes long."
6951 echo "(I can't seem to compile the test program. Guessing...)" >&4
6952 rp="What is the size of a long double (in bytes)?"
6956 if $test "X$doublesize" = "X$longdblsize"; then
6957 echo "That isn't any different from an ordinary double."
6958 echo "I'll keep your setting anyway, but you may see some"
6959 echo "harmless compilation warnings."
6965 $echo "Checking the kind of long doubles you have..." >&4
6966 case "$d_longdbl" in
6970 #define LONGDBLSIZE $longdblsize
6971 #define DOUBLESIZE $doublesize
6977 static const long double d = -0.1L;
6979 unsigned const char* b = (unsigned const char*)(&d);
6980 #if DOUBLESIZE == LONGDBLSIZE
6981 printf("0\n"); /* if it floats like double */
6984 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6985 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6986 /* IEEE 754 128-bit little-endian */
6990 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6991 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6996 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6997 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6998 * cannot be trusted. */
6999 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
7000 if (b[0] == 0xCD && b[9] == 0xBF) {
7001 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7002 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7003 * Also known as "extended precision". */
7007 if (b[0] == 0xBF && b[9] == 0xCD) {
7008 /* Is there ever big-endian 80-bit, really?
7010 * The Motorola 68881 had another "extended precision" format:
7011 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7012 * for total of 96 bits of bytes. The zero bits were unused.
7013 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7014 * If it ever becomes relevant, this format should be allocated
7015 * a new doublekind code since it's quite different from the Intel x87.
7021 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7022 /* software "double double", the 106 is 53+53.
7023 * but irix thinks it is 107. */
7024 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7025 /* double double 128-bit fully little-endian,
7026 * little-endian doubles in little-endian order,
7027 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7031 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7032 /* double double 128-bit fully big-endian,
7033 * big-endian doubles in big-endian order,
7034 * e.g. PPC/Power and MIPS:
7035 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7039 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7040 /* double double 128-bit mixed endian.
7041 * little-endian doubles in big-endian order,
7043 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7047 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7048 /* double double 128-bit mixed endian,
7049 * big-endian doubles in little-endian order,
7050 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7055 /* We are largely making this up because it may well be
7056 * that the VAX format H was never made available to C,
7057 * only to Fortran. */
7058 #if LONGDBLSIZE == 16 && defined(__vax__)
7059 if (b[0] == 0xFD && b[15] == 0x99) {
7060 /* VAX format H, PDP-11 mixed endian. */
7065 printf("-1\n"); /* unknown */
7070 if eval $compile; then
7071 longdblkind=`$run ./try`
7078 case "$longdblkind" in
7079 0) echo "Your long doubles are doubles." >&4 ;;
7080 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7081 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7082 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7083 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7084 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7085 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7086 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7087 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7088 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7089 *) echo "Cannot figure out your long double." >&4 ;;
7091 d_long_double_style_ieee=$undef
7092 d_long_double_style_ieee_std=$undef
7093 d_long_double_style_ieee_extended=$undef
7094 d_long_double_style_ieee_doubledouble=$undef
7095 d_long_double_style_vax=$undef
7096 case "$longdblkind" in
7097 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7099 case "$longdblkind" in
7100 1|2) d_long_double_style_ieee_std=$define ;;
7102 case "$longdblkind" in
7103 3|4) d_long_double_style_ieee_extended=$define ;;
7105 case "$longdblkind" in
7106 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7108 case "$longdblkind" in
7109 9) d_long_double_style_vax=$define ;;
7113 : determine the architecture name
7115 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7116 tarch=`arch`"-$osname"
7117 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7118 if uname -m > tmparch 2>&1 ; then
7119 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7120 -e 's/$/'"-$osname/" tmparch`
7128 case "$myarchname" in
7131 echo "(Your architecture name used to be $myarchname.)"
7135 case "$targetarch" in
7137 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7142 *) dflt="$archname";;
7144 rp='What is your architecture name'
7148 : optionally add API version to the architecture for versioned archlibs
7149 case "$useversionedarchname" in
7150 $define|true|[yY]*) dflt='y';;
7153 rp='Add the Perl API version to your archname?'
7156 y|Y) useversionedarchname="$define" ;;
7157 *) useversionedarchname="$undef" ;;
7159 case "$useversionedarchname" in
7162 *-$api_versionstring)
7163 echo "...and architecture name already has -$api_versionstring" >&4
7166 archname="$archname-$api_versionstring"
7167 echo "...setting architecture name to $archname." >&4
7173 case "$usethreads" in
7175 echo "Threads selected." >&4
7177 *-thread*) echo "...and architecture name already has -thread." >&4
7179 *) archname="$archname-thread"
7180 echo "...setting architecture name to $archname." >&4
7185 case "$usemultiplicity" in
7187 echo "Multiplicity selected." >&4
7189 *-multi*) echo "...and architecture name already has -multi." >&4
7191 *) archname="$archname-multi"
7192 echo "...setting architecture name to $archname." >&4
7197 case "$use64bitint$use64bitall" in
7199 case "$archname64" in
7201 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7204 case "$use64bitint" in
7205 "$define") echo "64 bit integers selected." >&4 ;;
7207 case "$use64bitall" in
7208 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7211 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7213 *) archname="$archname-$archname64"
7214 echo "...setting architecture name to $archname." >&4
7220 case "$uselongdouble" in
7222 echo "Long doubles selected." >&4
7223 case "$longdblsize" in
7225 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7229 *-ld*) echo "...and architecture name already has -ld." >&4
7231 *) archname="$archname-ld"
7232 echo "...setting architecture name to $archname." >&4
7239 case "$usequadmath" in
7241 echo "quadmath selected." >&4
7243 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7245 *) archname="$archname-quadmath"
7246 echo "...setting architecture name to $archname." >&4
7251 if $test -f archname.cbu; then
7252 echo "Your platform has some specific hints for architecture name, using them..."
7256 : set the prefixit variable, to compute a suitable default value
7257 prefixit='case "$3" in
7259 case "$oldprefix" in
7260 "") eval "$1=\"\$$2\"";;
7267 ""|" "|none) eval "$1=\"\$$2\"";;
7273 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7275 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7276 /*-$oldprefix/*|\~*-$oldprefix/*)
7277 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7278 *) eval "$1=\"\$$2\"";;
7282 : determine installation style
7283 : For now, try to deduce it from prefix unless it is already set.
7284 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7285 case "$installstyle" in
7286 '') case "$prefix" in
7287 *perl*) dflt='lib';;
7288 *) dflt='lib/perl5' ;;
7291 *) dflt="$installstyle" ;;
7293 : Probably not worth prompting for this since we prompt for all
7294 : the directories individually, and the prompt would be too long and
7298 : determine where public executables go
7303 rp='Pathname where the public executables will reside?'
7305 if $test "X$ansexp" != "X$binexp"; then
7309 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7310 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7311 : this via initialinstalllocation
7314 case "$userelocatableinc" in
7315 $define|true|[yY]*) dflt='y' ;;
7320 Would you like to build Perl so that the installation is relocatable, so that
7321 library paths in @INC are determined relative to the path of the perl binary?
7322 This is not advised for system Perl installs, or if you need to run setid
7323 scripts or scripts under taint mode.
7325 If this doesn't make any sense to you, just accept the default '$dflt'.
7327 rp='Use relocatable @INC?'
7330 y|Y) val="$define" ;;
7333 set userelocatableinc
7336 initialinstalllocation="$binexp"
7337 : Default prefix is now "up one level from where the binaries are"
7338 case "$userelocatableinc" in
7344 installprefixexp=".../.."
7348 : determine where private library files go
7349 : Usual default is /usr/local/lib/perl5/$version.
7350 : Also allow things like /opt/perl/lib/$version, since
7351 : /opt/perl/lib/perl5... would be redundant.
7352 : The default "style" setting is made in installstyle.U
7353 case "$installstyle" in
7354 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7355 *) set dflt privlib lib/$version ;;
7360 There are some auxiliary files for $package that need to be put into a
7361 private library directory that is accessible by everyone.
7366 rp='Pathname where the private library files will reside?'
7371 : set the prefixup variable, to restore leading tilda escape
7372 prefixup='case "$prefixexp" in
7374 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7377 : determine where public architecture dependent libraries go
7380 : privlib default is /usr/local/lib/$package/$version
7381 : archlib default is /usr/local/lib/$package/$version/$archname
7382 : privlib may have an optional trailing /share.
7383 tdflt=`echo $privlib | $sed 's,/share$,,'`
7384 tdflt=$tdflt/$archname
7393 $spackage contains architecture-dependent library files. If you are
7394 sharing libraries in a heterogeneous environment, you might store
7395 these files in a separate location. Otherwise, you can just include
7396 them with the rest of the public library files.
7401 rp='Where do you want to put the public architecture-dependent libraries?'
7405 if $test X"$archlib" = X"$privlib"; then
7411 : see if setuid scripts can be secure
7414 Some kernels have a bug that prevents setuid #! scripts from being
7415 secure. Some sites have disabled setuid #! scripts because of this.
7417 First let's decide if your kernel supports secure setuid #! scripts.
7418 (If setuid #! scripts would be secure but have been disabled anyway,
7419 don't say that they are secure if asked.)
7424 if $test -d /dev/fd; then
7425 echo "#!$ls" >reflect
7426 chmod +x,u+s reflect
7427 ./reflect >flect 2>&1
7428 if $contains "/dev/fd" flect >/dev/null; then
7429 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7433 If you are not sure if they are secure, I can check but I'll need a
7434 username and password different from the one you are using right now.
7435 If you don't have such a username or don't want me to test, simply
7439 rp='Other username to test security of setuid scripts with?'
7444 case "$d_suidsafe" in
7445 '') echo "I'll assume setuid scripts are *not* secure." >&4
7448 echo "Well, the $hint value is *not* secure." >&4
7450 *) echo "Well, the $hint value *is* secure." >&4
7455 $rm -f reflect flect
7456 echo "#!$ls" >reflect
7457 chmod +x,u+s reflect
7460 echo '"su" will (probably) prompt you for '"$ans's password."
7461 su $ans -c './reflect >flect'
7462 if $contains "/dev/fd" flect >/dev/null; then
7463 echo "Okay, it looks like setuid scripts are secure." >&4
7466 echo "I don't think setuid scripts are secure." >&4
7471 rp='Does your kernel have *secure* setuid scripts?'
7474 [yY]*) val="$define";;
7479 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7480 echo "(That's for file descriptors, not floppy disks.)"
7486 $rm -f reflect flect
7488 : now see if they want to do setuid emulation
7489 if $test $patchlevel -lt 11; then
7492 case "$d_suidsafe" in
7495 echo "No need to emulate SUID scripts since they are secure here." >&4
7499 Some systems have disabled setuid scripts, especially systems where
7500 setuid scripts cannot be secure. On systems where setuid scripts have
7501 been disabled, the setuid/setgid bits on scripts are currently
7502 useless. It is possible for $package to detect those bits and emulate
7503 setuid/setgid in a secure fashion. This emulation will only work if
7504 setuid scripts have been disabled in your kernel.
7508 "$define") dflt=y ;;
7511 rp="Do you want to do setuid/setgid emulation?"
7514 [yY]*) val="$define";;
7526 SUID emulation has been removed for 5.12
7527 Please re-run Configure without -Dd_dosuid
7536 : Find perl5.005 or later.
7537 echo "Looking for a previously installed perl5.005 or later... "
7539 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7540 : Check if this perl is recent and can load a simple module
7541 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7544 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7554 '') echo "None found. That's ok.";;
7555 *) echo "Using $perl5." ;;
7558 : Set the siteprefix variables
7561 After $package is installed, you may wish to install various
7562 add-on modules and utilities. Typically, these add-ons will
7563 be installed under $prefix with the rest
7564 of this package. However, you may wish to install such add-ons
7565 elsewhere under a different prefix.
7567 If you do not wish to put everything under a single prefix, that's
7568 ok. You will be prompted for the individual locations; this siteprefix
7569 is only used to suggest the defaults.
7571 The default should be fine for most people.
7575 rp='Installation prefix to use for add-on modules and utilities?'
7576 : XXX Here might be another good place for an installstyle setting.
7577 case "$siteprefix" in
7579 *) dflt=$siteprefix ;;
7582 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7584 case "$siteprefix" in
7588 *) oldsiteprefix="$prefix";;
7593 siteprefixexp="$ansexp"
7595 : determine where site specific libraries go.
7596 : Usual default is /usr/local/lib/perl5/site_perl/$version
7597 : The default "style" setting is made in installstyle.U
7598 : XXX No longer works with Prefixit stuff.
7599 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7601 '') case "$installstyle" in
7602 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7603 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7611 The installation process will create a directory for
7612 site-specific extensions and modules. Most users find it convenient
7613 to place all site-specific files in this directory rather than in the
7614 main distribution directory.
7618 rp='Pathname for the site-specific library files?'
7622 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7624 : Determine list of previous versions to include in @INC
7625 $cat > getverlist <<EOPL
7628 \$api_versionstring = "$api_versionstring";
7629 \$version = "$version";
7630 \$stem = "$sitelib_stem";
7631 \$archname = "$archname";
7633 $cat >> getverlist <<'EOPL'
7634 # The list found is store twice for each entry: the original name, and
7635 # the binary broken down version as pack "sss", so sorting is easy and
7636 # unambiguous. This will work for all versions that have a maximum of
7637 # three digit groups, separate by '.'s or '_'s. Names are extended with
7638 # ".0.0" to ensure at least three elements for the pack.
7639 # -- H.Merijn Brand (m)'06 23-10-2006
7641 # Can't have leading @ because metaconfig interprets it as a command!
7642 ;@inc_version_list=();
7643 # XXX Redo to do opendir/readdir?
7646 ;@candidates = map {
7647 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7648 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7654 ($pversion, $aversion, $vsn5005) = map {
7655 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7656 foreach $d (@candidates) {
7657 if ($d->[1] lt $pversion) {
7658 if ($d->[1] ge $aversion) {
7659 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7661 elsif ($d->[1] ge $vsn5005) {
7662 unshift(@inc_version_list, grep { -d } $d->[0]);
7666 # Skip newer version. I.e. don't look in
7667 # 5.7.0 if we're installing 5.6.1.
7671 if (@inc_version_list) {
7672 print join(' ', @inc_version_list);
7675 # Blank space to preserve value for next Configure run.
7680 case "$inc_version_list" in
7681 '') if test -x "$perl5$exe_ext"; then
7682 dflt=`$perl5 getverlist`
7687 $undef) dflt='none' ;;
7688 *) eval dflt=\"$inc_version_list\" ;;
7691 ''|' ') dflt=none ;;
7698 In order to ease the process of upgrading, this version of perl
7699 can be configured to use modules built and installed with earlier
7700 versions of perl that were installed under $prefix. Specify here
7701 the list of earlier versions that this version of perl should check.
7702 If Configure detected no earlier versions of perl installed under
7703 $prefix, then the list will be empty. Answer 'none' to tell perl
7704 to not search earlier versions.
7706 The default should almost always be sensible, so if you're not sure,
7707 just accept the default.
7710 rp='List of earlier versions to include in @INC?'
7713 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7714 *) inc_version_list="$ans" ;;
7716 case "$inc_version_list" in
7718 inc_version_list_init='0'
7719 d_inc_version_list="$undef"
7721 *) inc_version_list_init=`echo $inc_version_list |
7722 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7723 d_inc_version_list="$define"
7728 : see if malloc/malloc.h has to be included
7729 set malloc/malloc.h i_mallocmalloc
7732 : see if this is a malloc.h system
7733 : we want a real compile instead of Inhdr because some systems have a
7734 : malloc.h that just gives a compile error saying to use stdlib.h instead
7739 #$i_mallocmalloc I_MALLOCMALLOC
7740 #ifdef I_MALLOCMALLOC
7741 # include <malloc/malloc.h>
7744 int main () { return 0; }
7747 if eval $compile; then
7748 echo "<malloc.h> found." >&4
7751 echo "<malloc.h> NOT found." >&4
7758 : check for length of pointer
7762 echo "Checking to see how big your pointers are..." >&4
7771 printf("%d\n", (int)sizeof(void *));
7776 if eval $compile_ok; then
7777 ptrsize=`$run ./try`
7778 echo "Your pointers are $ptrsize bytes long."
7781 echo "(I can't seem to compile the test program. Guessing...)" >&4
7782 rp="What is the size of a pointer (in bytes)?"
7789 case "$use64bitall" in
7790 "$define"|true|[yY]*)
7794 *** You have chosen a maximally 64-bit build,
7795 *** but your pointers are only 4 bytes wide.
7796 *** Please rerun Configure without -Duse64bitall.
7801 *** Since you have quads, you could possibly try with -Duse64bitint.
7806 *** Cannot continue, aborting.
7816 : determine whether to use malloc wrapping
7818 case "$usemallocwrap" in
7819 [yY]*|true|$define) dflt='y' ;;
7820 [nN]*|false|$undef) dflt='n' ;;
7821 *) case "$usedevel" in
7822 [yY]*|true|$define) dflt='y' ;;
7827 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7829 usemallocwrap="$ans"
7832 usemallocwrap="$define" ;;
7834 usemallocwrap="$undef" ;;
7837 : determine which malloc to compile in
7839 case "$usemymalloc" in
7840 [yY]*|true|$define) dflt='y' ;;
7841 [nN]*|false|$undef) dflt='n' ;;
7842 *) case "$ptrsize" in
7846 if test "$useithreads" = "$define"; then dflt='n'; fi
7849 rp="Do you wish to attempt to use the malloc that comes with $package?"
7855 mallocsrc='malloc.c'
7856 mallocobj="malloc$_o"
7857 d_mymalloc="$define"
7860 : Remove malloc from list of libraries to use
7861 echo "Removing unneeded -lmalloc from library list" >&4
7862 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7865 echo "libs = $libs" >&4
7877 : compute the return types of malloc and free
7879 $cat >malloc.c <<END
7883 #include <sys/types.h>
7897 case "$malloctype" in
7899 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7906 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7910 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7917 echo "Your system uses $freetype free(), it would seem." >&4
7919 : determine where site specific architecture-dependent libraries go.
7920 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7921 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7922 : sitelib may have an optional trailing /share.
7924 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7925 dflt="$dflt/$archname"
7930 set sitearch sitearch none
7934 The installation process will also create a directory for
7935 architecture-dependent site-specific extensions and modules.
7939 rp='Pathname for the site-specific architecture-dependent library files?'
7943 if $test X"$sitearch" = X"$sitelib"; then
7946 d_sitearch="$define"
7949 : Set the vendorprefix variables
7952 The installation process will also create a directory for
7953 vendor-supplied add-ons. Vendors who supply perl with their system
7954 may find it convenient to place all vendor-supplied files in this
7955 directory rather than in the main distribution directory. This will
7956 ease upgrades between binary-compatible maintenance versions of perl.
7958 Of course you may also use these directories in whatever way you see
7959 fit. For example, you might use them to access modules shared over a
7960 company-wide network.
7962 The default answer should be fine for most people.
7963 This causes further questions about vendor add-ons to be skipped
7964 and no vendor-specific directories will be configured for perl.
7967 rp='Do you want to configure vendor-specific add-on directories?'
7968 case "$usevendorprefix" in
7969 define|true|[yY]*) dflt=y ;;
7970 *) : User may have set vendorprefix directly on Configure command line.
7971 case "$vendorprefix" in
7980 rp='Installation prefix to use for vendor-supplied add-ons?'
7981 case "$vendorprefix" in
7982 '') dflt="$prefix" ;;
7983 *) dflt=$vendorprefix ;;
7986 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7988 case "$vendorprefix" in
7992 *) oldvendorprefix="$prefix";;
7996 usevendorprefix="$define"
7998 vendorprefixexp="$ansexp"
8000 *) usevendorprefix="$undef"
8006 : Set the vendorlib variables
8007 case "$vendorprefix" in
8008 '') d_vendorlib="$undef"
8012 *) d_vendorlib="$define"
8013 : determine where vendor-supplied modules go.
8014 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8015 case "$vendorlib" in
8017 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8018 case "$installstyle" in
8019 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8020 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8023 *) dflt="$vendorlib"
8027 rp='Pathname for the vendor-supplied library files?'
8030 vendorlibexp="$ansexp"
8033 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8037 : Set the vendorarch variables
8038 case "$vendorprefix" in
8039 '') d_vendorarch="$undef"
8043 *) d_vendorarch="$define"
8044 : determine where vendor-supplied architecture-dependent libraries go.
8045 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8046 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8047 : vendorlib may have an optional trailing /share.
8048 case "$vendorarch" in
8049 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8050 dflt="$dflt/$archname"
8052 *) dflt="$vendorarch" ;;
8055 rp='Pathname for vendor-supplied architecture-dependent files?'
8058 vendorarchexp="$ansexp"
8061 prefixvar=vendorarch
8063 if $test X"$vendorarch" = X"$vendorlib"; then
8064 d_vendorarch="$undef"
8066 d_vendorarch="$define"
8069 : Final catch-all directories to search
8072 Lastly, you can have perl look in other directories for extensions and
8073 modules in addition to those already specified.
8074 These directories will be searched after
8078 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8079 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8081 case "$otherlibdirs" in
8082 ''|' ') dflt='none' ;;
8083 *) dflt="$otherlibdirs" ;;
8086 Enter a colon-separated set of extra paths to include in perl's @INC
8087 search path, or enter 'none' for no extra paths.
8091 rp='Colon-separated list of additional directories for perl to search?'
8094 ' '|''|none) otherlibdirs=' ' ;;
8095 *) otherlibdirs="$ans" ;;
8097 case "$otherlibdirs" in
8101 set d_perl_otherlibdirs
8105 dflt_dtrace='/usr/sbin/dtrace'
8106 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8110 Perl can be built to support DTrace on platforms that support it.
8111 DTrace is a diagnosis and performance analysis tool from Sun.
8113 If this doesn't make any sense to you, just accept the default.
8117 case "$usedtrace" in
8127 dflt_dtrace=$usedtrace
8134 rp='Support DTrace if available?'
8137 y|Y) val="$define" ;;
8143 test "X$usedtrace" != "X$define" && break
8146 rp='Where is the dtrace executable?'
8155 if $dtrace -h -s ../perldtrace.d \
8156 -o perldtrace.tmp >/dev/null 2>&1 \
8157 && rm -f perldtrace.tmp
8160 echo "Good: your $dtrace knows about the -h flag."
8164 *** $me: Fatal Error: $dtrace doesn't support -h flag
8166 *** Your installed dtrace doesn't support the -h switch to compile a D
8167 *** program into a C header. Can't continue.
8179 *** $me: Fatal Error: $dtrace not found.
8186 echo "*** $dtrace was not found."
8192 : See if we want extra modules installed
8199 Perl can be built with extra modules or bundles of modules which
8200 will be fetched from the CPAN and installed alongside Perl.
8202 Notice that you will need access to the CPAN; either via the Internet,
8203 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8204 be asked later to configure the CPAN.pm module which will in turn do
8205 the installation of the rest of the extra modules or bundles.)
8207 Notice also that if the modules require any external software such as
8208 libraries and headers (the libz library and the zlib.h header for the
8209 Compress::Zlib module, for example) you MUST have any such software
8210 already installed, this configuration process will NOT install such
8213 If this doesn't make any sense to you, just accept the default '$dflt'.
8215 rp='Install any extra modules (y or n)?'
8221 Please list any extra modules or bundles to be installed from CPAN,
8222 with spaces between the names. The names can be in any format the
8223 'install' command of CPAN.pm will understand. (Answer 'none',
8224 without the quotes, to install no extra modules or bundles.)
8234 $rm -f ../extras.lst
8236 *) echo "(Saving the list of extras for later...)"
8237 echo "$extras" > ../extras.lst
8245 : determine where html pages for programs go
8246 set html1dir html1dir none
8250 If you wish to install html files for programs in $spackage, indicate
8251 the appropriate directory here. To skip installing html files,
8255 ''|none|$undef|' ') dflt=none ;;
8256 *) dflt=$html1dir ;;
8259 rp="Directory for the main $spackage html pages?"
8263 : Use ' ' for none so value is preserved next time through Configure
8264 $test X"$html1dir" = "X" && html1dir=' '
8266 : determine where html pages for libraries and modules go
8267 set html3dir html3dir none
8271 If you wish to install html files for modules associated with $spackage,
8272 indicate the appropriate directory here. To skip installing html files,
8275 : There is no obvious default. If they have specified html1dir, then
8276 : try to key off that, possibly changing .../html1 into .../html3.
8278 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8279 *) dflt=$html3dir ;;
8282 rp="Directory for the $spackage module html pages?"
8286 : Use ' ' for none so value is preserved next time through Configure
8287 $test X"$html3dir" = "X" && html3dir=' '
8289 : determine whether to install perl also as /usr/bin/perl
8292 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8294 Many scripts expect perl to be installed as /usr/bin/perl.
8296 If you want to, I can install the perl you are about to compile
8297 as /usr/bin/perl (in addition to $bin/perl).
8299 if test -f /usr/bin/perl; then
8302 However, please note that because you already have a /usr/bin/perl,
8303 overwriting that with a new Perl would very probably cause problems.
8304 Therefore I'm assuming you don't want to do that (unless you insist).
8307 case "$installusrbinperl" in
8308 "$define"|[yY]*) dflt='y';;
8314 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8317 case "$installusrbinperl" in
8318 "$undef"|[nN]*) dflt='n';;
8322 rp="Do you want to install perl as /usr/bin/perl?"
8325 [yY]*) val="$define";;
8331 set installusrbinperl
8334 : see if dlopen exists
8336 xxx_ccflags="$ccflags"
8338 : with g++ one needs -shared to get is-in-libc to work for dlopen
8339 case "$gccversion" in
8342 *) case "$d_cplusplus" in
8343 "$define") ccflags="$ccflags -shared" ;;
8350 ccflags="$xxx_ccflags"
8352 : see if this is a unistd.h system
8353 set unistd.h i_unistd
8356 : determine which dynamic loading, if any, to compile in
8358 dldir="ext/DynaLoader"
8371 $define) dflt='y' ;;
8373 : Does a dl_xxx.xs file exist for this operating system
8374 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8377 rp="Do you wish to use dynamic loading?"
8384 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8385 dflt="$dldir/dl_${osname}.xs"
8386 elif $test "$d_dlopen" = "$define" ; then
8387 dflt="$dldir/dl_dlopen.xs"
8392 *) dflt="$dldir/$dlsrc"
8395 echo "The following dynamic loading files are available:"
8396 : Can not go over to $dldir because getfile has path hard-coded in.
8397 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8398 rp="Source file to use for dynamic loading"
8404 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8408 Some systems may require passing special flags to $cc -c to
8409 compile modules that will be used to create a shared library.
8410 To use no flags, say "none".
8413 case "$cccdlflags" in
8414 '') case "$gccversion" in
8415 '') case "$osname" in
8417 irix*) dflt='-KPIC' ;;
8418 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8419 sunos) dflt='-pic' ;;
8423 *) case "$osname" in
8424 darwin) dflt='none' ;;
8425 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8430 *) dflt="$cccdlflags" ;;
8437 # If -Dsysroot was specified, now's the time to add it
8439 if test "X$sysroot" != X; then
8440 case "$gccversion" in
8445 dflt="$dflt --sysroot=$sysroot" ;;
8455 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8458 none) cccdlflags=' ' ;;
8459 *) cccdlflags="$ans" ;;
8464 Some systems use ld to create libraries that can be dynamically loaded,
8465 while other systems (such as those using ELF) use $cc.
8469 : Determine if this is ELF
8471 /* Test for whether ELF binaries are produced */
8483 int i = open("a.out",O_RDONLY);
8486 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8487 exit(0); /* succeed (yes, it is ELF) */
8491 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8497 '') if $test $bin_ELF = "$define"; then
8499 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8503 echo "I'll use ld to build dynamic libraries."
8511 rp="What command should be used to create dynamic libraries?"
8517 Some systems may require passing special flags to $ld to create a
8518 library that can be dynamically loaded. If your ld flags include
8519 -L/other/path options to locate libraries outside your loader's normal
8520 search path, you may need to specify those -L options here as well. To
8521 use no flags, say "none".
8524 case "$lddlflags" in
8525 '') case "$osname" in
8526 haiku) dflt='-shared' ;;
8528 case "$gccversion" in
8529 '') dflt="$dflt +vnocompatwarnings" ;;
8532 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8533 solaris) # See [perl #66604].
8534 # On Solaris 11, gcc -m64 on amd64
8535 # appears not to understand -G. gcc versions at
8536 # least as old as 3.4.3 support -shared, so just
8537 # use that with Solaris 11 and later, but keep
8538 # the old behavior for older Solaris versions.
8539 case "$gccversion" in
8541 *) case "$osvers" in
8542 2.?|2.10) dflt='-G' ;;
8543 *) dflt='-shared' ;;
8548 sunos) dflt='-assert nodefinitions' ;;
8549 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8553 *) dflt="$lddlflags" ;;
8556 : Only do this for gcc, since, for example, qcc has no concept
8558 if $test "X$sysroot" != X; then
8559 case "$gccversion" in
8561 *) dflt="$dflt --sysroot=$sysroot" ;;
8565 : Try to guess additional flags to pick up local libraries.
8566 : Be careful not to append to a plain 'none'
8570 for thisflag in $ldflags; do
8575 *) dflt="$dflt $thisflag" ;;
8582 ''|' ') dflt='none' ;;
8586 *-fstack-protector-strong*)
8588 *-fstack-protector-strong*) ;; # Don't add it again
8589 *) dflt="$dflt -fstack-protector-strong" ;;
8592 *-fstack-protector*)
8594 *-fstack-protector*) ;; # Don't add it again
8595 *) dflt="$dflt -fstack-protector" ;;
8600 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8603 none) lddlflags=' ' ;;
8604 *) lddlflags="$ans" ;;
8609 Some systems may require passing special flags to $cc to indicate that
8610 the resulting executable will use dynamic linking. To use no flags,
8614 case "$ccdlflags" in
8615 '') case "$osname" in
8616 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8617 sunos) dflt='none' ;;
8621 *) dflt="$ccdlflags" ;;
8623 rp="Any special flags to pass to $cc to use dynamic linking?"
8626 none) ccdlflags=' ' ;;
8627 *) ccdlflags="$ans" ;;
8639 ld_can_script="$undef"
8640 case "$bin_ELF$usedl" in
8642 # Abuse try.h and a.out names for neat cleanup
8654 if $cc $cccdlflags $ccdlflags $ccflags \
8655 $ldflags $lddlflags -o a.out try.c \
8656 -Wl,--version-script=try.h >/dev/null 2>&1 \
8657 && $test -s a.out ; then
8658 echo "ld supports scripting" >&4
8659 ld_can_script="$define"
8661 echo "ld does not support scripting" >&4
8667 : Do we want a shared libperl?
8671 # No dynamic loading being used, so don't bother even to prompt.
8674 *) case "$useshrplib" in
8675 '') case "$osname" in
8676 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8678 also='Building a shared libperl is required for dynamic loading to work on your system.'
8692 The perl executable is normally obtained by linking perlmain.c with
8693 libperl${_a}, any static extensions (usually just DynaLoader), and
8694 any other libraries needed on this system (such as -lm, etc.). Since
8695 your system supports dynamic loading, it is probably possible to build
8696 a shared libperl.$so. If you will have more than one executable linked
8697 to libperl.$so, this will significantly reduce the size of each
8698 executable, but it may have a noticeable effect on performance. The
8699 default is probably sensible for your system.
8703 rp="Build a shared libperl.$so (y/n)"
8707 useshrplib='true' ;;
8708 *) useshrplib='false' ;;
8713 case "$useshrplib" in
8715 case "$userelocatableinc" in
8717 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8718 echo "See INSTALL for an explanation why that won't work." >&4
8724 # Figure out a good name for libperl.so. Since it gets stored in
8725 # a version-specific architecture-dependent library, the version
8726 # number isn't really that important, except for making cc/ld happy.
8728 # A name such as libperl.so.10.1
8729 majmin="libperl.$so.$patchlevel.$subversion"
8730 # A name such as libperl.so.100
8731 majonly=`echo $patchlevel $subversion |
8732 $awk '{printf "%d%02d", $1, $2}'`
8733 majonly=libperl.$so.$majonly
8734 # I'd prefer to keep the os-specific stuff here to a minimum, and
8735 # rely on figuring it out from the naming of libc.
8736 case "${osname}${osvers}" in
8737 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8740 cygwin*) # ld links now against the dll directly
8741 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8742 majonly=`echo $patchlevel $subversion |
8743 $awk '{printf "%03d%03d", $1, $2}'`
8744 majonly=cygperl5.$majonly.$so
8747 *) # Try to guess based on whether libc has major.minor.
8749 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8750 *libc.$so.[0-9]*) dflt=$majonly ;;
8751 *) dflt=libperl.$so ;;
8761 I need to select a good name for the shared libperl. If your system uses
8762 library names with major and minor numbers, then you might want something
8763 like $majmin. Alternatively, if your system uses a single version
8764 number for shared libraries, then you might want to use $majonly.
8765 Or, your system might be quite happy with a simple libperl.$so.
8767 Since the shared libperl will get installed into a version-specific
8768 architecture-dependent directory, the version number of the shared perl
8769 library probably isn't important, so the default should be o.k.
8772 rp='What name do you want to give to the shared libperl?'
8775 echo "Ok, I'll use $libperl"
8778 libperl="libperl${_a}"
8782 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8786 WARNING: Use of the shrpdir variable for the installation location of
8787 the shared $libperl is not supported. It was never documented and
8788 will not work in this version. Let me (https://github.com/Perl/perl5/issues)
8789 know of any problems this may cause.
8795 But your current setting of $shrpdir is
8796 the default anyway, so it's harmless.
8801 Further, your current attempted setting of $shrpdir
8802 conflicts with the value of $archlibexp/CORE
8803 that installperl will use.
8810 # How will the perl executable find the installed shared $libperl?
8811 # Add $xxx to ccdlflags.
8812 # If we can't figure out a command-line option, use $shrpenv to
8813 # set env LD_RUN_PATH. The main perl makefile uses this.
8814 shrpdir=$archlibexp/CORE
8817 if "$useshrplib"; then
8820 # We'll set it in Makefile.SH...
8825 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8826 xxx="-Wl,-R$shrpdir"
8828 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8829 xxx="-Wl,-rpath,$shrpdir"
8832 # hpux doesn't like the default, either.
8833 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8836 # cygwin needs only ldlibpth
8839 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8845 # Only add $xxx if it isn't already in ccdlflags.
8846 case " $ccdlflags " in
8848 *) ccdlflags="$ccdlflags $xxx"
8851 Adding $xxx to the flags
8852 passed to $ld so that the perl executable will find the
8853 installed shared $libperl.
8861 # Fix ccdlflags in AIX for building external extensions.
8862 # (For building Perl itself bare -bE:perl.exp is needed,
8863 # Makefile.SH takes care of this.)
8865 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8867 # Respect a hint or command-line value.
8869 '') shrpenv="$tmp_shrpenv" ;;
8871 case "$ldlibpthname" in
8872 '') ldlibpthname=LD_LIBRARY_PATH ;;
8873 none) ldlibpthname='' ;;
8876 : determine where manual pages are on this system
8880 syspath='/usr/share/man/man1 /usr/man/man1'
8881 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8882 syspath="$syspath /usr/man/u_man/man1"
8883 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8884 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8885 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8886 sysman=`./loc . /usr/man/man1 $syspath`
8889 if $test -d "$sysman"; then
8890 echo "System manual is in $sysman." >&4
8892 echo "Could not find manual pages in source form." >&4
8895 : determine where manual pages go
8896 set man1dir man1dir none
8900 $spackage has manual pages available in source form.
8904 echo "However, you don't have nroff, so they're probably useless to you."
8906 '') man1dir="none";;
8909 echo "If you don't want the manual sources installed, answer 'none'."
8914 lookpath="$prefixexp/share/man/man1"
8915 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8916 lookpath="$lookpath $prefixexp/man/p_man/man1"
8917 lookpath="$lookpath $prefixexp/man/u_man/man1"
8918 lookpath="$lookpath $prefixexp/man/man.1"
8920 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8921 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8931 rp="Where do the main $spackage manual pages (source) go?"
8933 if $test "X$man1direxp" != "X$ansexp"; then
8944 : What suffix to use on installed man pages
8951 rp="What suffix should be used for the main $spackage man pages?"
8953 '') case "$man1dir" in
8967 *) dflt="$man1ext";;
8974 : see if we can have long filenames
8976 first=123456789abcdef
8978 if (echo hi >$first) 2>/dev/null; then
8979 if $test -f 123456789abcde; then
8980 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8983 echo 'You can have filenames longer than 14 characters.'>&4
8988 You can't have filenames longer than 14 chars.
8989 You can't even think about them!
8995 $rm -rf 123456789abcde*
8997 : determine where library module manual pages go
8998 set man3dir man3dir none
9002 $spackage has manual pages for many of the library modules.
9008 However, you don't have nroff, so they're probably useless to you.
9011 '') man3dir="none";;
9015 case "$d_flexfnam" in
9018 However, your system can't handle the long file names like File::Basename.3.
9021 '') man3dir="none";;
9025 echo "If you don't want the manual sources installed, answer 'none'."
9026 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9028 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9029 if $test -d "$privlib/man/man3"; then
9032 WARNING: Previous versions of perl installed man3 pages into
9033 $privlib/man/man3. This version will suggest a
9034 new default of $dflt.
9038 rp='Do you wish to preserve the old behavior?(y/n)'
9041 y*) dflt="$privlib/man/man3" ;;
9046 *) dflt="$man3dir" ;;
9053 rp="Where do the $package library man pages (source) go?"
9063 : What suffix to use on installed man pages
9069 rp="What suffix should be used for the $package library man pages?"
9071 '') case "$man3dir" in
9085 *) dflt="$man3ext";;
9092 : see if we have to deal with yellow pages, now NIS.
9093 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9099 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9107 rp='Are you getting the hosts file via yellow pages?'
9110 y*) hostcat='ypcat hosts';;
9111 *) hostcat='cat /etc/hosts';;
9117 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9120 '') test -f /etc/group && groupcat='cat /etc/group';;
9123 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9126 : now get the host name
9128 echo "Figuring out host name..." >&4
9129 case "$myhostname" in
9131 echo 'Maybe "hostname" will work...'
9132 if tans=`sh -c hostname 2>&1` ; then
9140 if $test "$cont"; then
9142 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9143 if tans=`cat /etc/systemid 2>&1` ; then
9145 phostname='cat /etc/systemid'
9146 echo "Whadyaknow. Xenix always was a bit strange..."
9149 elif $test -r /etc/systemid; then
9150 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9153 if $test "$cont"; then
9154 echo 'No, maybe "uuname -l" will work...'
9155 if tans=`sh -c 'uuname -l' 2>&1` ; then
9157 phostname='uuname -l'
9159 echo 'Strange. Maybe "uname -n" will work...'
9160 if tans=`sh -c 'uname -n' 2>&1` ; then
9162 phostname='uname -n'
9164 echo 'Oh well, maybe I can mine it out of whoami.h...'
9165 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9166 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9167 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9169 case "$myhostname" in
9170 '') echo "Does this machine have an identity crisis or something?"
9173 echo "Well, you said $myhostname before..."
9174 phostname='echo $myhostname';;
9180 case "$myhostname" in
9181 '') myhostname=noname ;;
9183 : you do not want to know about this
9188 if $test "$myhostname" ; then
9190 rp='Your host name appears to be "'$myhostname'".'" Right?"
9198 : bad guess or no guess
9199 while $test "X$myhostname" = X ; do
9201 rp="Please type the (one word) name of your host:"
9206 : translate upper to lower if necessary
9207 case "$myhostname" in
9209 echo "(Normalizing case in your host name)"
9210 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9214 case "$myhostname" in
9216 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9217 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9218 echo "(Trimming domain name from host name--host name is now $myhostname)"
9220 *) case "$mydomain" in
9223 test "X$hostcat" = "Xypcat hosts" &&
9224 ypmatch "$myhostname" hosts 2>/dev/null |\
9225 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9228 test "X$hostcat" != "X" &&
9229 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9230 /[ ]$myhostname[ . ]/p" > hosts
9233 if $test -f hosts; then
9234 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9235 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9236 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9237 hosts | $sort | $uniq | \
9238 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9239 case `$echo X$dflt` in
9240 X*\ *) echo "(Several hosts in the database matched hostname)"
9243 X.) echo "(You do not have fully-qualified names in the hosts database)"
9247 echo "(I cannot locate a hosts database anywhere)"
9252 tans=`./loc resolv.conf X /etc /usr/etc`
9253 if $test -f "$tans"; then
9254 echo "(Attempting domain name extraction from $tans)"
9255 dflt=.`$sed -n -e 's/ / /g' \
9256 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9259 .) dflt=.`$sed -n -e 's/ / /g' \
9260 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9268 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9269 dflt=.`sh -c domainname 2>/dev/null`
9272 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9276 case "$dflt$osname" in
9277 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9278 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9282 .) echo "(Lost all hope -- silly guess then)"
9288 *) dflt="$mydomain";;
9292 rp="What is your domain name?"
9302 : translate upper to lower if necessary
9305 echo "(Normalizing case in your domain name)"
9306 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9310 : a little sanity check here
9311 case "$phostname" in
9314 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9315 $myhostname$mydomain|$myhostname) ;;
9317 case "$phostname" in
9319 echo "(That doesn't agree with your whoami.h file, by the way.)"
9322 echo "(That doesn't agree with your $phostname command, by the way.)"
9330 : determine the e-mail address of the user who is running us
9333 I need to get your e-mail address in Internet format if possible, i.e.
9334 something like user@host.domain. Please answer accurately since I have
9335 no easy means to double check it. The default value provided below
9336 is most probably close to reality but may not be valid from outside
9337 your organization...
9341 while test "$cont"; do
9342 case "$MAILDOMAIN" in
9344 if $test -s /etc/mailname; then
9345 maildomain=`$cat /etc/mailname`
9347 maildomain="$myhostname$mydomain"
9350 *) maildomain="$MAILDOMAIN";;
9353 '') dflt="$cf_by@$maildomain";;
9354 *) dflt="$cf_email";;
9356 rp='What is your e-mail address?'
9362 rp='Address does not look like an Internet one. Use it anyway?'
9376 : Ask e-mail of administrator
9379 If you or somebody else will be maintaining perl at your site, please
9380 fill in the correct e-mail address here so that they may be contacted
9381 if necessary. Currently, the "perlbug" program included with perl
9382 will send mail to this address in addition to perlbug@perl.org. You may
9383 enter "none" for no administrator.
9386 case "$perladmin" in
9387 '') dflt="$cf_email";;
9388 *) dflt="$perladmin";;
9390 rp='Perl administrator e-mail address'
9394 : determine whether to use a version number suffix for installed binaries
9397 Do you want to use a version number suffix for installed binaries? This
9398 will install 'perl$version' instead of 'perl', and likewise for other
9399 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9400 to be installed side-by-side. Unless you are a developer, you probably
9401 do *not* want to do this.
9403 case "$versiononly" in
9404 "$define"|[Yy]*|true) dflt='y' ;;
9407 rp="Do you want to use a version number suffix for installed binaries?"
9410 [yY]*) val="$define";;
9416 case "$versiononly" in
9417 "$define") inc_version_list=''
9418 inc_version_list_init=0
9422 : figure out how to guarantee perl startup
9423 : XXX Note that this currently takes advantage of the bug that binexp ignores
9424 : the Configure -Dinstallprefix setting, which in turn means that under
9425 : relocatable @INC, initialinstalllocation is what binexp started as.
9426 case "$startperl" in
9428 case "$sharpbang" in
9432 I can use the #! construct to start perl on your system. This will
9433 make startup of perl scripts faster, but may cause problems if you
9434 want to share those scripts and perl is not in a standard place
9435 ($initialinstalllocation/perl) on all your platforms. The alternative
9436 is to force a shell by starting the script with a single ':' character.
9439 case "$versiononly" in
9440 "$define") dflt="$initialinstalllocation/perl$version";;
9441 *) dflt="$initialinstalllocation/perl";;
9443 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9446 none) startperl=": # use perl";;
9447 *) startperl="#!$ans"
9448 if $test 30 -lt `echo "$ans" | wc -c`; then
9451 WARNING: Some systems limit the #! command to 32 characters.
9452 If you experience difficulty running Perl scripts with #!, try
9453 installing Perl in a directory with a shorter pathname.
9459 *) startperl=": # use perl"
9464 echo "I'll use $startperl to start perl scripts."
9466 : figure best path for perl in scripts
9469 case "$versiononly" in
9470 "$define") perlpath="$initialinstalllocation/perl$version";;
9471 *) perlpath="$initialinstalllocation/perl";;
9473 case "$startperl" in
9478 I will use the "eval 'exec'" idiom to start Perl on your system.
9479 I can use the full path of your Perl binary for this purpose, but
9480 doing so may cause problems if you want to share those scripts and
9481 Perl is not always in a standard place ($initialinstalllocation/perl).
9484 dflt="$initialinstalllocation/perl"
9485 rp="What path shall I use in \"eval 'exec'\"?"
9492 case "$startperl" in
9494 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9497 : determine where public executable scripts go
9498 set scriptdir scriptdir
9500 case "$scriptdir" in
9503 : guess some guesses
9504 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9505 $test -d /usr/share/bin && dflt=/usr/share/bin
9506 $test -d /usr/local/script && dflt=/usr/local/script
9507 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9508 $test -d $prefixexp/script && dflt=$prefixexp/script
9512 *) dflt="$scriptdir"
9517 Some installations have a separate directory just for executable scripts so
9518 that they can mount it across multiple architectures but keep the scripts in
9519 one spot. You might, for example, have a subdirectory of /usr/share for this.
9520 Or you might just lump your scripts in with all your other executables.
9524 rp='Where do you keep publicly executable scripts?'
9526 if $test "X$ansexp" != "X$scriptdirexp"; then
9532 : A little fix up for an irregularly named variable.
9533 installscript="$installscriptdir"
9535 : determine where add-on public executables go
9537 '') dflt=$siteprefix/bin ;;
9541 rp='Pathname where the add-on public executables should be installed?'
9546 : determine where add-on html pages go
9547 : There is no standard location, so try to copy the previously-selected
9548 : directory structure for the core html pages.
9549 case "$sitehtml1dir" in
9550 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9551 *) dflt=$sitehtml1dir ;;
9554 ''|' ') dflt=none ;;
9557 rp='Pathname where the site-specific html pages should be installed?'
9559 prefixvar=sitehtml1dir
9562 : determine where add-on library html pages go
9563 : There is no standard location, so try to copy the previously-selected
9564 : directory structure for the core html pages.
9565 case "$sitehtml3dir" in
9566 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9567 *) dflt=$sitehtml3dir ;;
9570 ''|' ') dflt=none ;;
9573 rp='Pathname where the site-specific library html pages should be installed?'
9575 prefixvar=sitehtml3dir
9578 : determine where add-on manual pages go
9579 case "$siteman1dir" in
9580 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9581 *) dflt=$siteman1dir ;;
9584 ''|' ') dflt=none ;;
9587 rp='Pathname where the site-specific manual pages should be installed?'
9589 prefixvar=siteman1dir
9592 : determine where add-on library man pages go
9593 case "$siteman3dir" in
9594 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9595 *) dflt=$siteman3dir ;;
9598 ''|' ') dflt=none ;;
9601 rp='Pathname where the site-specific library manual pages should be installed?'
9603 prefixvar=siteman3dir
9606 : determine where add-on public executable scripts go
9607 case "$sitescript" in
9608 '') dflt=$siteprefix/script
9609 $test -d $dflt || dflt=$sitebin ;;
9610 *) dflt="$sitescript" ;;
9613 rp='Pathname where add-on public executable scripts should be installed?'
9615 prefixvar=sitescript
9618 : see if backtrace exists
9619 set backtrace d_backtrace
9622 : Check if C backtrace is actually supported.
9623 case "$usecbacktrace" in
9624 "") usecbacktrace=$undef ;;
9626 case "$d_backtrace" in
9630 echo "This system does not support backtrace" >&4
9631 usecbacktrace=$undef
9637 : Check if faststdio is requested and available
9638 case "$usefaststdio" in
9639 $define|true|[yY]*|'')
9640 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9650 Perl can be built to use 'fast stdio', which means using the stdio
9651 library but also directly manipulating the stdio buffers to enable
9652 faster I/O. Using stdio is better for backward compatibility (especially
9653 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9654 interface has been preferred instead of stdio.
9656 If this doesn't make any sense to you, just accept the default '$dflt'.
9658 rp='Use the "fast stdio" if available?'
9661 y|Y) val="$define" ;;
9667 : define an is-a-typedef? function
9668 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9670 "") inclist="sys/types.h";;
9672 eval "varval=\$$var";
9676 for inc in $inclist; do
9677 echo "#include <$inc>" >>temp.c;
9679 echo "#ifdef $type" >> temp.c;
9680 echo "printf(\"We have $type\");" >> temp.c;
9681 echo "#endif" >> temp.c;
9682 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9683 if $contains $type temp.E >/dev/null 2>&1; then
9689 *) eval "$var=\$varval";;
9692 : define an is-a-typedef? function that prompts if the type is not available.
9693 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9695 "") inclist="sys/types.h";;
9697 eval "varval=\$$var";
9701 for inc in $inclist; do
9702 echo "#include <$inc>" >>temp.c;
9704 echo "#ifdef $type" >> temp.c;
9705 echo "printf(\"We have $type\");" >> temp.c;
9706 echo "#endif" >> temp.c;
9707 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9709 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9710 if $contains $type temp.E >/dev/null 2>&1; then
9711 echo "$type found." >&4;
9714 echo "$type NOT found." >&4;
9720 *) eval "$var=\$varval";;
9723 : see what type lseek is declared as in the kernel
9724 rp="What is the type used for lseek's offset on this system?"
9725 set off_t lseektype long stdio.h sys/types.h
9729 echo "Checking to see how big your file offsets are..." >&4
9731 #include <sys/types.h>
9735 printf("%d\n", (int)sizeof($lseektype));
9740 if eval $compile_ok; then
9741 lseeksize=`$run ./try`
9742 echo "Your file offsets are $lseeksize bytes long."
9746 echo "(I can't seem to compile the test program. Guessing...)"
9747 rp="What is the size of your file offsets (in bytes)?"
9753 : see what type file positions are declared as in the library
9754 rp="What is the type for file position used by fsetpos()?"
9755 set fpos_t fpostype long stdio.h sys/types.h
9758 : Check size for Fpos_t
9761 *_t) zzz="$fpostype" ;;
9764 echo "Checking the size of $zzz..." >&4
9766 #include <sys/types.h>
9773 printf("%d\n", (int)sizeof($fpostype));
9778 if eval $compile_ok; then
9782 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9785 echo "Your $zzz is $fpossize bytes long."
9791 echo "(I can't compile the test program. Guessing...)" >&4
9792 rp="What is the size of your file positions (in bytes)?"
9797 : Check for large file support
9798 # Backward compatibility (uselfs is deprecated).
9800 "$define"|true|[yY]*)
9803 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9805 uselargefiles="$define"
9809 case "$lseeksize:$fpossize" in
9812 You can have files larger than 2 gigabytes.
9815 *) case "$uselargefiles" in
9816 "$undef"|false|[nN]*) dflt='n' ;;
9821 Perl can be built to understand large files (files larger than 2 gigabytes)
9822 on some systems. To do so, Configure can be run with -Duselargefiles.
9824 If this doesn't make any sense to you, just accept the default '$dflt'.
9826 rp='Try to understand large files, if available?'
9829 y|Y) val="$define" ;;
9836 : Look for a hint-file generated 'call-back-unit'. If the
9837 : user has specified that a large files perl is to be built,
9838 : we may need to set or change some other defaults.
9839 if $test -f uselargefiles.cbu; then
9840 echo "Your platform has some specific hints regarding large file builds, using them..."
9841 . ./uselargefiles.cbu
9843 case "$uselargefiles" in
9845 if $test -f uselargefiles.cbu; then
9847 echo "Rechecking to see how big your file offsets are..." >&4
9849 #include <sys/types.h>
9853 printf("%d\n", (int)sizeof($lseektype));
9858 if eval $compile_ok; then
9859 lseeksize=`$run ./try`
9860 $echo "Your file offsets are now $lseeksize bytes long."
9864 echo "(I can't seem to compile the test program. Guessing...)"
9865 rp="What is the size of your file offsets (in bytes)?"
9870 *_t) zzz="$fpostype" ;;
9873 $echo $n "Rechecking the size of $zzz...$c" >&4
9875 #include <sys/types.h>
9882 printf("%d\n", (int)sizeof($fpostype));
9887 if eval $compile_ok; then
9892 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9895 echo " $fpossize bytes." >&4
9901 echo "(I can't compile the test program. Guessing...)" >&4
9902 rp="What is the size of your file positions (in bytes)?"
9911 : Check if we want perlio
9914 : Set the vendorbin variables
9915 case "$vendorprefix" in
9916 '') d_vendorbin="$undef"
9920 *) d_vendorbin="$define"
9921 : determine where vendor-supplied executables go.
9922 case "$vendorbin" in
9923 '') dflt=$vendorprefix/bin ;;
9924 *) dflt="$vendorbin" ;;
9927 rp='Pathname for the vendor-supplied executables directory?'
9930 vendorbinexp="$ansexp"
9936 : Set the vendorhtml1dir variables
9937 case "$vendorprefix" in
9938 '') vendorhtml1dir=''
9939 vendorhtml1direxp=''
9941 *) : determine where vendor-supplied html pages go.
9942 : There is no standard location, so try to copy the previously-selected
9943 : directory structure for the core html pages.
9944 : XXX Better default suggestions would be welcome.
9945 case "$vendorhtml1dir" in
9946 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9947 *) dflt=$vendorhtml1dir ;;
9950 ''|' ') dflt=none ;;
9953 rp='Pathname for the vendor-supplied html pages?'
9955 vendorhtml1dir="$ans"
9956 vendorhtml1direxp="$ansexp"
9959 : Use ' ' for none so value is preserved next time through Configure
9960 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9961 prefixvar=vendorhtml1dir
9964 : Set the vendorhtml3dir variables
9965 case "$vendorprefix" in
9966 '') vendorhtml3dir=''
9967 vendorhtml3direxp=''
9969 *) : determine where vendor-supplied module html pages go.
9970 : There is no standard location, so try to copy the previously-selected
9971 : directory structure for the core html pages.
9972 : XXX Better default suggestions would be welcome.
9973 case "$vendorhtml3dir" in
9974 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9975 *) dflt=$vendorhtml3dir ;;
9978 ''|' ') dflt=none ;;
9981 rp='Pathname for the vendor-supplied html pages?'
9983 vendorhtml3dir="$ans"
9984 vendorhtml3direxp="$ansexp"
9987 : Use ' ' for none so value is preserved next time through Configure
9988 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9989 prefixvar=vendorhtml3dir
9992 : Set the vendorman1dir variables
9993 case "$vendorprefix" in
9994 '') vendorman1dir=''
9997 *) : determine where vendor-supplied manual pages go.
9998 case "$vendorman1dir" in
9999 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10000 *) dflt=$vendorman1dir ;;
10003 ''|' ') dflt=none ;;
10006 rp='Pathname for the vendor-supplied manual section 1 pages?'
10008 vendorman1dir="$ans"
10009 vendorman1direxp="$ansexp"
10012 : Use ' ' for none so value is preserved next time through Configure
10013 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10014 prefixvar=vendorman1dir
10017 : Set the vendorman3dir variables
10018 case "$vendorprefix" in
10019 '') vendorman3dir=''
10020 vendorman3direxp=''
10022 *) : determine where vendor-supplied module manual pages go.
10023 case "$vendorman3dir" in
10024 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10025 *) dflt=$vendorman3dir ;;
10028 ''|' ') dflt=none ;;
10031 rp='Pathname for the vendor-supplied manual section 3 pages?'
10033 vendorman3dir="$ans"
10034 vendorman3direxp="$ansexp"
10037 : Use ' ' for none so value is preserved next time through Configure
10038 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10039 prefixvar=vendorman3dir
10042 : Set the vendorscript variables
10043 case "$vendorprefix" in
10044 '') d_vendorscript="$undef"
10048 *) d_vendorscript="$define"
10049 : determine where vendor-supplied scripts go.
10050 case "$vendorscript" in
10051 '') dflt=$vendorprefix/script
10052 $test -d $dflt || dflt=$vendorbin ;;
10053 *) dflt="$vendorscript" ;;
10057 The installation process will create a directory for
10058 vendor-supplied scripts.
10062 rp='Pathname for the vendor-supplied scripts directory?'
10064 vendorscript="$ans"
10065 vendorscriptexp="$ansexp"
10068 prefixvar=vendorscript
10071 : see if qgcvt exists
10075 : Check what kind of doubles your system has
10076 $echo "Checking the kind of doubles you have..." >&4
10078 #$i_stdlib I_STDLIB
10079 #define DOUBLESIZE $doublesize
10081 #include <stdlib.h>
10084 static const double d = -0.1;
10086 unsigned const char* b = (unsigned const char*)(&d);
10087 #if DOUBLESIZE == 4
10088 if (b[0] == 0xCD && b[3] == 0xBD) {
10089 /* IEEE 754 32-bit little-endian */
10093 if (b[0] == 0xBD && b[3] == 0xCD) {
10094 /* IEEE 754 32-bit big-endian */
10098 if (b[0] == 0xCC && b[3] == 0xCC) {
10099 /* VAX format F, 32-bit PDP-style mixed endian. */
10103 if (b[0] == 0xC0 && b[3] == 0x9A) {
10104 /* IBM single 32-bit */
10109 #if DOUBLESIZE == 8
10110 if (b[0] == 0x9A && b[7] == 0xBF) {
10111 /* IEEE 754 64-bit little-endian */
10115 if (b[0] == 0xBF && b[7] == 0x9A) {
10116 /* IEEE 754 64-bit big-endian */
10120 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10121 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10122 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10123 * 99 99 b9 bf 9a 99 99 99 */
10127 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10128 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10129 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10130 * 99 99 99 9a bf b9 99 99 */
10134 if (b[0] == 0xCC && b[7] == 0xCC) {
10135 /* VAX format D, 64-bit PDP-style mixed endian. */
10139 if (b[0] == 0xD9 && b[7] == 0x99) {
10140 /* VAX format G, 64-bit PDP-style mixed endian. */
10144 if (b[0] == 0xC0 && b[7] == 0x9A) {
10145 /* IBM double 64-bit */
10149 if (b[0] == 0xBF && b[7] == 0xCD) {
10150 /* CRAY single 64-bit */
10155 #if DOUBLESIZE == 16
10156 if (b[0] == 0x9A && b[15] == 0xBF) {
10157 /* IEEE 754 128-bit little-endian */
10161 if (b[0] == 0xBF && b[15] == 0x9A) {
10162 /* IEEE 754 128-bit big-endian */
10167 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10168 * Whether those environments can still build Perl is debatable. */
10169 printf("-1\n"); /* unknown */
10174 if eval $compile; then
10175 doublekind=`$run ./try`
10179 case "$doublekind" in
10180 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10181 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10182 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10183 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10184 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10185 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10186 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10187 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10188 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10189 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10190 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10191 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10192 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10193 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10194 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10196 d_double_style_ieee=$undef
10197 d_double_style_vax=$undef
10198 d_double_style_ibm=$undef
10199 d_double_style_cray=$undef
10200 case "$doublekind" in
10201 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10202 9|10|11) d_double_style_vax=$define ;;
10203 12|13) d_double_style_ibm=$define ;;
10204 14) d_double_style_cray=$define ;;
10206 case "$d_double_style_ieee" in
10208 d_double_has_inf=$define
10209 d_double_has_nan=$define
10210 d_double_has_negative_zero=$define
10211 d_double_has_subnormals=$define
10214 d_double_has_inf=$undef
10215 d_double_has_nan=$undef
10216 d_double_has_negative_zero=$undef
10217 d_double_has_subnormals=$undef
10222 : Check print/scan long double stuff
10225 if $test X"$d_longdbl" = X"$define"; then
10227 echo "Checking how to print long doubles..." >&4
10229 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10230 $cat >try.c <<'EOCP'
10231 #include <sys/types.h>
10234 double d = 123.456;
10235 printf("%.3f\n", d);
10239 if eval $compile; then
10243 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10244 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10245 echo "We will use %f."
10251 if $test X"$sPRIfldbl" = X; then
10252 $cat >try.c <<'EOCP'
10253 #include <sys/types.h>
10256 long double d = 123.456;
10257 printf("%.3Lf\n", d);
10261 if eval $compile; then
10265 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10266 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10267 echo "We will use %Lf."
10273 if $test X"$sPRIfldbl" = X; then
10274 $cat >try.c <<'EOCP'
10275 #include <sys/types.h>
10278 long double d = 123.456;
10279 printf("%.3llf\n", d);
10283 if eval $compile; then
10287 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10288 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10289 echo "We will use %llf."
10295 if $test X"$sPRIfldbl" = X; then
10296 $cat >try.c <<'EOCP'
10297 #include <sys/types.h>
10300 long double d = 123.456;
10301 printf("%.3lf\n", d);
10305 if eval $compile; then
10309 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10310 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10311 echo "We will use %lf."
10317 if $test X"$sPRIfldbl" = X; then
10318 echo "Cannot figure out how to print long doubles." >&4
10320 sSCNfldbl=$sPRIfldbl # expect consistency
10327 case "$sPRIfldbl" in
10328 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10329 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10330 d_SCNfldbl="$undef";
10332 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10333 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10334 d_SCNfldbl="$define";
10338 : Before committing on uselongdouble, see whether that looks sane.
10339 if $test "$uselongdouble" = "$define"; then
10342 echo "Checking if your long double math functions work right..." >&4
10347 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10350 case "$osname:$gccversion" in
10351 aix:) saveccflags="$ccflags"
10352 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10355 if eval $compile_ok; then
10359 3) echo "Your long double math functions are working correctly." >&4 ;;
10360 *) echo "Your long double math functions are broken, not using long doubles." >&4
10361 uselongdouble=$undef
10365 case "$osname:$gccversion" in
10366 aix:) ccflags="$saveccflags" ;; # restore
10370 : Check how to convert floats to strings.
10372 if test "X$d_Gconvert" = X; then
10375 echo "Checking for an efficient way to convert floats to strings."
10377 case "$uselongdouble" in
10378 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10380 case "$d_longdbl" in
10381 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10383 case "$d_PRIgldbl" in
10384 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10387 #ifdef TRY_gconvert
10388 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10389 const char *myname = "gconvert";
10392 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10393 const char *myname = "gcvt";
10396 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10397 const char *myname = "qgcvt";
10398 #define DOUBLETYPE long double
10401 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10402 #ifdef HAS_PRIgldbl
10403 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10405 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10408 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10410 const char *myname = "sprintf";
10414 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10415 #define DOUBLETYPE long double
10417 #define DOUBLETYPE double
10423 #$i_stdlib I_STDLIB
10425 #include <stdlib.h>
10427 #include <string.h>
10429 void checkit(const char *expect, char *got)
10431 if (strcmp(expect, got)) {
10432 printf("%s oddity: Expected %s, got %s\n",
10433 myname, expect, got);
10443 /* This must be 1st test on (which?) platform */
10444 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10445 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10446 checkit("0.1", buf);
10448 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10449 checkit("0.01", buf);
10451 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10452 checkit("0.001", buf);
10454 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10455 checkit("0.0001", buf);
10457 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10458 if (strlen(buf) > 5)
10459 checkit("9e-005", buf); /* for Microsoft ?? */
10461 checkit("9e-05", buf);
10463 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10466 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10467 checkit("1.1", buf);
10469 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10470 checkit("1.01", buf);
10472 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10473 checkit("1.001", buf);
10475 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10476 checkit("1.0001", buf);
10478 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10479 checkit("1.00001", buf);
10481 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10482 checkit("1.000001", buf);
10484 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10487 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10488 checkit("-1", buf);
10490 /* Some Linux gcvt's give 1.e+5 here. */
10491 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10492 checkit("100000", buf);
10494 /* Some Linux gcvt's give -1.e+5 here. */
10495 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10496 checkit("-100000", buf);
10498 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10499 checkit("123.456", buf);
10501 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10502 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10503 /* 34 should be enough to scare even long double
10504 * places into using the e notation. */
10505 if (strlen(buf) > 5)
10506 checkit("1e+034", buf); /* for Microsoft */
10508 checkit("1e+34", buf);
10510 /* For Perl, if you add additional tests here, also add them to
10511 * t/base/num.t for benefit of platforms not using Configure or
10512 * overriding d_Gconvert */
10517 : first add preferred functions to our list
10519 for xxx_convert in $gconvert_preference; do
10520 case $xxx_convert in
10521 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10522 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10525 : then add any others
10526 for xxx_convert in gconvert gcvt sprintf; do
10527 case "$xxx_list" in
10529 *) xxx_list="$xxx_list $xxx_convert" ;;
10533 case "$d_longdbl$uselongdouble" in
10535 : again, add preferred functions to our list first
10537 for xxx_convert in $gconvert_ld_preference; do
10538 case $xxx_convert in
10539 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10540 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10543 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10544 for xxx_convert in qgcvt sprintf $xxx_list; do
10545 case "$xxx_ld_list" in
10546 $xxx_convert*|*" $xxx_convert"*) ;;
10547 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10550 : if sprintf cannot do long doubles, move it to the end
10551 if test "$d_PRIgldbl" != "$define"; then
10552 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10554 : if no qgcvt, remove it
10555 if test "$d_qgcvt" != "$define"; then
10556 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10559 xxx_list="$xxx_ld_list"
10563 for xxx_convert in $xxx_list; do
10564 echo "Trying $xxx_convert..."
10565 $rm -f try try$_o core
10566 set try -DTRY_$xxx_convert
10567 if eval $compile; then
10568 echo "$xxx_convert() found." >&4
10569 if $run ./try; then
10570 echo "I'll use $xxx_convert to convert floats into a string." >&4
10573 echo "...But $xxx_convert didn't work as I expected."
10577 echo "$xxx_convert NOT found." >&4
10582 if test X$xxx_convert = X; then
10583 echo "*** WHOA THERE!!! ***" >&4
10584 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10585 xxx_convert=sprintf
10588 case "$xxx_convert" in
10589 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10590 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10591 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10592 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10593 "$define$define$define")
10594 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10595 "$define$define$undef")
10596 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10597 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10605 : see if _fwalk exists
10609 : see if accept4 exists
10610 set accept4 d_accept4
10613 : Initialize h_fcntl
10616 : Initialize h_sysfile
10619 : access call always available on UNIX
10620 set access d_access
10623 : locate the flags for 'access()'
10624 case "$d_access" in
10627 $cat >access.c <<EOCP
10628 #include <sys/types.h>
10633 #include <sys/file.h>
10636 #include <unistd.h>
10638 #$i_stdlib I_STDLIB
10640 #include <stdlib.h>
10646 : check sys/file.h first, no particular reason here
10647 if $test `./findhdr sys/file.h` && \
10648 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10650 echo "<sys/file.h> defines the *_OK access constants." >&4
10651 elif $test `./findhdr fcntl.h` && \
10652 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10654 echo "<fcntl.h> defines the *_OK access constants." >&4
10655 elif $test `./findhdr unistd.h` && \
10656 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10657 echo "<unistd.h> defines the *_OK access constants." >&4
10659 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10665 : see if accessx exists
10666 set accessx d_accessx
10669 : see if acosh exists
10673 : see if aintl exists
10677 : see if alarm exists
10681 : see if 64bit time functions exists
10683 set ctime64 d_ctime64
10686 set localtime64 d_localtime64
10689 set gmtime64 d_gmtime64
10692 set mktime64 d_mktime64
10695 set difftime64 d_difftime64
10698 set asctime64 d_asctime64
10701 : see if POSIX threads are available
10702 set pthread.h i_pthread
10705 : define a function to check prototypes
10706 $cat > protochk <<EOSH
10709 optimize="$optimize"
10713 usethreads=$usethreads
10714 i_pthread=$i_pthread
10715 pthread_h_first=$pthread_h_first
10718 $cat >> protochk <<'EOSH'
10723 while test $# -ge 2; do
10725 $define) echo "#include <$2>" >> try.c ;;
10726 literal) echo "$2" >> try.c ;;
10728 # Extra magic for the benefit of systems that need pthread.h
10729 # to be included early to correctly detect threadsafe functions.
10730 # Such functions must guarantee themselves, though, that the usethreads
10731 # and i_pthread have been defined, before calling protochk.
10732 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10733 echo "#include <pthread.h>" >> try.c
10738 cat >> try.c <<'EOCP'
10739 #define _(args) args
10741 echo "$foo" >> try.c
10742 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10743 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10749 $eunicefix protochk
10751 : Define hasproto macro for Configure internal use
10752 hasproto='varname=$1; func=$2; shift; shift;
10753 while $test $# -ge 2; do
10755 $define) echo "#include <$2>";;
10756 literal) echo "$2" ;;
10760 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10761 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10762 echo "$func() prototype found.";
10765 echo "$func() prototype NOT found.";
10772 : see if sys/types.h has to be included
10773 set sys/types.h i_systypes
10776 : see if sys/select.h has to be included
10777 set sys/select.h i_sysselct
10780 : Define hasfield macro for Configure internal use
10781 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10782 while $test $# -ge 2; do
10784 $define) echo "#include <$2>";;
10788 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10790 if eval $compile; then
10799 : see if we should include sys/time.h
10802 if test "X$timeincl" = X; then
10803 echo "Testing to see if we should include <sys/time.h>." >&4
10804 $echo $n "I'm now running the test program...$c"
10806 #include <sys/types.h>
10809 #ifdef SYSTIMEKERNEL
10812 #include <sys/time.h>
10815 #include <sys/select.h>
10817 #$i_stdlib I_STDLIB
10819 #include <stdlib.h>
10825 struct timeval bar;
10828 struct timezone tzp;
10830 if (foo.tm_sec == foo.tm_sec)
10833 if (bar.tv_sec == bar.tv_sec)
10840 for s_timezone in '-DS_TIMEZONE' ''; do
10842 for s_timeval in '-DS_TIMEVAL' ''; do
10843 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10844 for i_systime in '-DI_SYSTIME' ''; do
10847 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10848 if eval $compile; then
10849 set X $i_systime $i_systimek $sysselect $s_timeval
10853 $echo $n "Succeeded with $flags$c"
10864 *SYSTIMEKERNEL*) i_systimek="$define"
10865 timeincl=`./findhdr sys/time.h`
10866 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10867 *) i_systimek="$undef";;
10870 *I_SYSTIME*) i_systime="$define"
10871 timeincl=`./findhdr sys/time.h`" $timeincl"
10872 echo "We'll include <sys/time.h>." >&4;;
10873 *) i_systime="$undef";;
10877 : see if struct tm knows about tm_zone
10878 case "$i_systime$i_time" in
10881 echo "Checking to see if your struct tm has tm_zone field..." >&4
10882 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10890 case "$d_tm_tm_zone" in
10891 "$define") echo "Yes, it does." ;;
10892 *) echo "No, it doesn't." ;;
10894 : see if struct tm knows about tm_gmtoff
10895 case "$i_systime$i_time" in
10898 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10899 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10907 case "$d_tm_tm_gmtoff" in
10908 "$define") echo "Yes, it does." ;;
10909 *) echo "No, it doesn't." ;;
10912 : see if asctime_r exists
10913 set asctime_r d_asctime_r
10915 case "$d_asctime_r" in
10917 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10918 case "$d_asctime_r_proto:$usethreads" in
10919 ":define") d_asctime_r_proto=define
10920 set d_asctime_r_proto asctime_r $hdrs
10924 case "$d_asctime_r_proto" in
10926 case "$asctime_r_proto" in
10927 ''|0) try='char* asctime_r(const struct tm*, char*);'
10928 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10930 case "$asctime_r_proto" in
10931 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10932 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10934 case "$asctime_r_proto" in
10935 ''|0) try='int asctime_r(const struct tm*, char*);'
10936 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10938 case "$asctime_r_proto" in
10939 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10940 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10942 case "$asctime_r_proto" in
10943 ''|0) d_asctime_r=undef
10945 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10946 * ) case "$asctime_r_proto" in
10947 REENTRANT_PROTO*) ;;
10948 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10950 echo "Prototype: $try" ;;
10953 *) case "$usethreads" in
10954 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10961 *) asctime_r_proto=0
10965 : see if asinh exists
10969 : see if atanh exists
10973 : see if atolf exists
10977 : see if atoll exists
10981 : Look for GCC-style attribute format
10982 case "$d_attribute_format" in
10985 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10986 $cat >attrib.c <<'EOCP'
10988 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10990 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10991 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10992 echo "Your C compiler doesn't support __attribute__((format))."
10995 echo "Your C compiler supports __attribute__((format))."
10999 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11003 *) val="$d_attribute_format" ;;
11005 set d_attribute_format
11009 : Look for GCC-style attribute format with null format allowed
11010 case "$d_printf_format_null" in
11011 '') case "$d_attribute_format" in
11014 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11015 $cat >attrib.c <<EOCP
11017 #$i_stdlib I_STDLIB
11019 #include <stdlib.h>
11021 #$i_inttypes I_INTTYPES
11023 #include <inttypes.h>
11026 #define intptr_t int
11028 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11029 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11030 int main () { exit(null_printf(NULL)); }
11032 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11033 : run the executable in case it produces a run-time warning
11034 if $run ./attrib >>attrib.out 2>&1; then
11035 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11036 echo "Your C compiler doesn't allow __printf__ format to be null."
11039 echo "Your C compiler allows __printf__ format to be null."
11043 echo "Your C compiler executable failed with __printf__ format null."
11047 echo "Your C compiler fails with __printf__ format null."
11054 *) val="$d_printf_format_null" ;;
11056 set d_printf_format_null
11060 : Look for GCC-style attribute malloc
11061 case "$d_attribute_malloc" in
11064 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11065 $cat >attrib.c <<'EOCP'
11067 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11069 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11070 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11071 echo "Your C compiler doesn't support __attribute__((malloc))."
11074 echo "Your C compiler supports __attribute__((malloc))."
11078 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11082 *) val="$d_attribute_malloc" ;;
11084 set d_attribute_malloc
11088 : Look for GCC-style attribute nonnull
11089 case "$d_attribute_nonnull" in
11092 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11093 $cat >attrib.c <<'EOCP'
11095 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11097 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11098 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11099 echo "Your C compiler doesn't support __attribute__((nonnull))."
11102 echo "Your C compiler supports __attribute__((nonnull))."
11106 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11110 *) val="$d_attribute_nonnull" ;;
11112 set d_attribute_nonnull
11116 : Look for GCC-style attribute noreturn
11117 case "$d_attribute_noreturn" in
11120 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11121 $cat >attrib.c <<'EOCP'
11123 void fall_over_dead( void ) __attribute__((noreturn));
11125 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11126 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11127 echo "Your C compiler doesn't support __attribute__((noreturn))."
11130 echo "Your C compiler supports __attribute__((noreturn))."
11134 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11138 *) val="$d_attribute_noreturn" ;;
11140 set d_attribute_noreturn
11144 : Look for GCC-style attribute pure
11145 case "$d_attribute_pure" in
11148 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11149 $cat >attrib.c <<'EOCP'
11151 int square( int n ) __attribute__((pure));
11153 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11154 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11155 echo "Your C compiler doesn't support __attribute__((pure))."
11158 echo "Your C compiler supports __attribute__((pure))."
11162 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11166 *) val="$d_attribute_pure" ;;
11168 set d_attribute_pure
11172 : Look for GCC-style attribute unused
11173 case "$d_attribute_unused" in
11176 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11177 $cat >attrib.c <<'EOCP'
11179 int do_something( int dummy __attribute__((unused)), int n );
11181 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11182 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11183 echo "Your C compiler doesn't support __attribute__((unused))."
11186 echo "Your C compiler supports __attribute__((unused))."
11190 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11194 *) val="$d_attribute_unused" ;;
11196 set d_attribute_unused
11200 : Look for GCC-style attribute deprecated
11201 case "$d_attribute_deprecated" in
11204 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11205 $cat >attrib.c <<'EOCP'
11207 int I_am_deprecated(void) __attribute__((deprecated));
11209 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11210 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11211 echo "Your C compiler doesn't support __attribute__((deprecated))."
11214 echo "Your C compiler supports __attribute__((deprecated))."
11218 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11222 *) val="$d_attribute_deprecated" ;;
11224 set d_attribute_deprecated
11228 : Look for GCC-style attribute warn_unused_result
11229 case "$d_attribute_warn_unused_result" in
11232 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11233 $cat >attrib.c <<'EOCP'
11235 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11237 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11238 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11239 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11242 echo "Your C compiler supports __attribute__((warn_unused_result))."
11246 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11250 *) val="$d_attribute_warn_unused_result" ;;
11252 set d_attribute_warn_unused_result
11256 : Look for GCC-style attribute always_inline
11257 case "$d_attribute_always_inline" in
11260 echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
11261 $cat >attrib.c <<'EOCP'
11263 static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
11265 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11266 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11267 echo "Your C compiler doesn't support __attribute__((always_inline))."
11270 echo "Your C compiler supports __attribute__((always_inline))."
11274 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11278 *) val="$d_attribute_always_inline" ;;
11280 set d_attribute_always_inline
11284 : see if getpgrp exists
11285 set getpgrp d_getpgrp
11288 case "$d_getpgrp" in
11291 echo "Checking to see which flavor of getpgrp is in use..."
11294 #$i_unistd I_UNISTD
11295 #include <sys/types.h>
11297 # include <unistd.h>
11299 #$i_stdlib I_STDLIB
11301 #include <stdlib.h>
11305 if (getuid() == 0) {
11306 printf("(I see you are running Configure as super-user...)\n");
11309 #ifdef TRY_BSD_PGRP
11310 if (getpgrp(1) == 0)
11319 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11320 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11322 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11323 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11326 echo "I can't seem to compile and run the test program."
11328 xxx="a USG one, i.e. you use getpgrp()."
11330 # SVR4 systems can appear rather BSD-ish.
11331 case "$i_unistd" in
11333 xxx="a BSD one, i.e. you use getpgrp(pid)."
11337 xxx="probably a USG one, i.e. you use getpgrp()."
11342 echo "Assuming your getpgrp is $xxx" >&4
11351 : see if setpgrp exists
11352 set setpgrp d_setpgrp
11355 case "$d_setpgrp" in
11358 echo "Checking to see which flavor of setpgrp is in use..."
11361 #$i_unistd I_UNISTD
11362 #include <sys/types.h>
11364 # include <unistd.h>
11366 #$i_stdlib I_STDLIB
11368 #include <stdlib.h>
11372 if (getuid() == 0) {
11373 printf("(I see you are running Configure as super-user...)\n");
11376 #ifdef TRY_BSD_PGRP
11377 if (-1 == setpgrp(1, 1))
11380 if (setpgrp() != -1)
11386 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11387 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11389 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11390 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11393 echo "(I can't seem to compile and run the test program.)"
11395 xxx="a USG one, i.e. you use setpgrp()."
11397 # SVR4 systems can appear rather BSD-ish.
11398 case "$i_unistd" in
11400 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11404 xxx="probably a USG one, i.e. you use setpgrp()."
11409 echo "Assuming your setpgrp is $xxx" >&4
11418 : Look for GCC-style __builtin_add_overflow
11419 case "$d_builtin_add_overflow" in
11422 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11423 $cat >try.c <<'EOCP'
11425 const unsigned int uint_max = ~0u;
11426 int target_int = 0;
11427 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11430 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11433 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11440 if eval $compile && $run ./try; then
11441 echo "Your C compiler supports __builtin_add_overflow."
11444 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11448 *) val="$d_builtin_add_overflow" ;;
11451 set d_builtin_add_overflow
11455 : Look for GCC-style __builtin_sub_overflow
11456 case "$d_builtin_sub_overflow" in
11459 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11460 $cat >try.c <<'EOCP'
11462 const unsigned int uint_max = ~0u;
11463 int target_int = 0;
11464 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11467 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11470 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11477 if eval $compile && $run ./try; then
11478 echo "Your C compiler supports __builtin_sub_overflow."
11481 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11485 *) val="$d_builtin_sub_overflow" ;;
11488 set d_builtin_sub_overflow
11492 : Look for GCC-style __builtin_mul_overflow
11493 case "$d_builtin_mul_overflow" in
11496 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11497 $cat >try.c <<'EOCP'
11499 const unsigned int uint_max = ~0u;
11500 int target_int = 0;
11501 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11504 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11507 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11514 if eval $compile && $run ./try; then
11515 echo "Your C compiler supports __builtin_mul_overflow."
11518 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11522 *) val="$d_builtin_mul_overflow" ;;
11525 set d_builtin_mul_overflow
11529 : Look for GCC-style __builtin_choose_expr
11530 case "$d_builtin_choose_expr" in
11533 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11534 $cat >try.c <<'EOCP'
11535 #include <assert.h>
11536 #include <stdlib.h>
11539 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11542 assert( SYRINX(1) == 2112 );
11543 assert( SYRINX(1) != 5150 );
11544 assert( SYRINX(0) == 5150 );
11545 assert( SYRINX(0) != 2112 );
11546 puts( "All good!" );
11552 if eval $compile && $run ./try; then
11553 echo "Your C compiler supports __builtin_choose_expr."
11556 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11560 *) val="$d_builtin_choose_expr" ;;
11563 set d_builtin_choose_expr
11567 : Look for GCC-style __builtin_expect
11568 case "$d_builtin_expect" in
11571 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11572 $cat >try.c <<'EOCP'
11575 if ( __builtin_expect(n, 0) ) n = 1;
11576 /* Remember shell exit code truth is 0, C truth is non-zero */
11581 if eval $compile && $run ./try; then
11582 echo "Your C compiler supports __builtin_expect."
11585 echo "Your C compiler doesn't seem to understand __builtin_expect."
11589 *) val="$d_builtin_expect" ;;
11592 set d_builtin_expect
11596 : see if the Compiler supports C99 variadic macros
11597 echo "Checking for C99 variadic macros." >&4
11600 #include <stdarg.h>
11602 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11606 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11612 if eval $compile && $run ./try 2>&1 >/dev/null; then
11613 case "`$run ./try`" in
11615 echo "You have C99 variadic macros." >&4
11616 d_c99_variadic_macros="$define"
11619 echo "You don't have functional C99 variadic macros." >&4
11620 d_c99_variadic_macros="$undef"
11624 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11625 d_c99_variadic_macros="$undef"
11629 : see if signal is declared as pointer to function returning int or void
11631 xxx=`./findhdr signal.h`
11632 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11633 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11634 echo "You have int (*signal())() instead of void." >&4
11636 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11637 echo "You have void (*signal())()." >&4
11639 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11640 echo "You have int (*signal())() instead of void." >&4
11642 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11643 echo "You have void (*signal())()." >&4
11646 case "$d_voidsig" in
11648 echo "I can't determine whether signal handler returns void or int..." >&4
11650 rp="What type does your signal handler return?"
11653 v*) val="$define";;
11657 echo "As you already told me, signal handler returns void." >&4
11660 *) echo "As you already told me, signal handler returns int." >&4
11667 case "$d_voidsig" in
11668 "$define") signal_t="void";;
11669 *) signal_t="int";;
11673 : check for ability to cast large floats to 32-bit ints.
11675 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11676 if $test "$intsize" -ge 4; then
11683 #$i_stdlib I_STDLIB
11685 #include <stdlib.h>
11687 #include <sys/types.h>
11688 #include <signal.h>
11689 $signal_t blech(int s) { exit(3); }
11696 signal(SIGFPE, blech);
11698 /* Don't let compiler optimize the test away. Store the number
11699 in a writable string for gcc to pass to sscanf under HP-UX.
11701 sprintf(str, "2147483647");
11702 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11706 /* x86 processors will probably give 0x8000 0000, which is a
11707 sign change. We don't want that. We want to mimic SPARC
11708 behavior here, which is to preserve the sign and give
11711 if (i32 != ($xxx) f)
11717 if eval $compile_ok; then
11718 $run ./try 2>/dev/null
11721 echo "(I can't seem to compile the test program--assuming it can't)"
11726 echo "Yup, it can."
11729 echo "Nope, it can't."
11736 : check for ability to cast negative floats to unsigned
11738 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11741 #$i_stdlib I_STDLIB
11743 #include <stdlib.h>
11745 #include <sys/types.h>
11746 #include <signal.h>
11747 $signal_t blech(int s) { exit(7); }
11748 $signal_t blech_in_list(int s) { exit(4); }
11749 unsigned long dummy_long(unsigned long p) { return p; }
11750 unsigned int dummy_int(unsigned int p) { return p; }
11751 unsigned short dummy_short(unsigned short p) { return p; }
11755 unsigned long along;
11757 unsigned short ashort;
11761 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11762 a direct f = -123. assignment. gcc-2.8.0 reportedly
11763 optimized the whole file away
11765 /* Store the number in a writable string for gcc to pass to
11766 sscanf under HP-UX.
11768 sprintf(str, "-123");
11769 sscanf(str, "%lf", &f); /* f = -123.; */
11771 signal(SIGFPE, blech);
11772 along = (unsigned long)f;
11773 aint = (unsigned int)f;
11774 ashort = (unsigned short)f;
11775 if (along != (unsigned long)-123)
11777 if (aint != (unsigned int)-123)
11779 if (ashort != (unsigned short)-123)
11781 sprintf(str, "1073741824.");
11782 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11785 along = (unsigned long)f;
11786 if (along != 0x80000000)
11790 along = (unsigned long)f;
11791 if (along != 0x7fffffff)
11795 along = (unsigned long)f;
11796 if (along != 0x80000001)
11800 signal(SIGFPE, blech_in_list);
11801 sprintf(str, "123.");
11802 sscanf(str, "%lf", &f); /* f = 123.; */
11803 along = dummy_long((unsigned long)f);
11804 aint = dummy_int((unsigned int)f);
11805 ashort = dummy_short((unsigned short)f);
11806 if (along != (unsigned long)123)
11808 if (aint != (unsigned int)123)
11810 if (ashort != (unsigned short)123)
11817 if eval $compile_ok; then
11818 $run ./try 2>/dev/null
11821 echo "(I can't seem to compile the test program--assuming it can't)"
11824 case "$castflags" in
11826 echo "Yup, it can."
11829 echo "Nope, it can't."
11836 : see if cbrt exists
11840 : see if chown exists
11844 : see if chroot exists
11845 set chroot d_chroot
11848 : see if chsize exists
11849 set chsize d_chsize
11852 : see if class exists
11856 : see if clearenv exists
11857 set clearenv d_clearenv
11860 : Define hasstruct macro for Configure internal use
11861 hasstruct='varname=$1; struct=$2; shift; shift;
11862 while $test $# -ge 2; do
11864 $define) echo "#include <$2>";;
11868 echo "int main () { struct $struct foo; }" >> try.c;
11870 if eval $compile; then
11879 : see whether socket exists
11883 $echo $n "Hmm... $c" >&4
11884 if set socket val -f d_socket; eval $csym; $val; then
11885 echo "Looks like you have Berkeley networking support." >&4
11887 if set setsockopt val -f; eval $csym; $val; then
11890 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11891 d_oldsock="$define"
11894 if $contains socklib libc.list >/dev/null 2>&1; then
11895 echo "Looks like you have Berkeley networking support." >&4
11897 : we will have to assume that it supports the 4.2 BSD interface
11900 echo "You don't have Berkeley networking in libc$_a..." >&4
11901 if test "X$d_socket" = "X$define"; then
11902 echo "...but you seem to believe that you have sockets." >&4
11904 for net in net socket
11906 if test -f $sysroot/usr/lib/lib$net$_a; then
11907 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11908 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11909 if $contains socket libc.list >/dev/null 2>&1; then
11914 echo "...but the Wollongong group seems to have hacked it in." >&4
11915 sockethdr="-I$sysroot/usr/netinclude"
11918 echo "Found Berkeley sockets interface in lib$net." >&4
11919 if $contains setsockopt libc.list >/dev/null 2>&1; then
11922 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11923 d_oldsock="$define"
11929 if test "X$d_socket" != "X$define"; then
11930 echo "or anywhere else I see." >&4
11938 : see if socketpair exists
11939 set socketpair d_sockpair
11944 echo "Checking the availability sa_len in the sock struct ..." >&4
11946 #include <sys/types.h>
11947 #include <sys/socket.h>
11949 struct sockaddr sa;
11950 return (sa.sa_len);
11954 set try; if eval $compile; then
11957 set d_sockaddr_sa_len; eval $setvar
11961 echo "Checking the availability struct sockaddr_in6 ..." >&4
11963 #include <sys/types.h>
11964 #include <sys/socket.h>
11965 #include <netinet/in.h>
11967 struct sockaddr_in6 sin6;
11968 return (sin6.sin6_family);
11972 set try; if eval $compile; then
11975 set d_sockaddr_in6; eval $setvar
11979 echo "Checking the availability struct sockaddr_storage ..." >&4
11981 #include <sys/types.h>
11982 #include <sys/socket.h>
11983 #include <netinet/in.h>
11985 struct sockaddr_storage sastor;
11986 return (sastor.ss_family);
11990 set try; if eval $compile; then
11993 set d_sockaddr_storage; eval $setvar
11997 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11999 #include <sys/types.h>
12000 #include <sys/socket.h>
12001 #include <netinet/in.h>
12003 struct sockaddr_in6 sin6;
12004 return (sin6.sin6_scope_id);
12008 set try; if eval $compile; then
12011 set d_sin6_scope_id; eval $setvar
12015 echo "Checking the availability struct ip_mreq ..." >&4
12017 #include <sys/types.h>
12018 #include <sys/socket.h>
12019 #include <netinet/in.h>
12021 struct ip_mreq mreq;
12022 return (mreq.imr_multiaddr.s_addr);
12026 set try; if eval $compile; then
12029 set d_ip_mreq; eval $setvar
12033 echo "Checking the availability struct ip_mreq_source ..." >&4
12035 #include <sys/types.h>
12036 #include <sys/socket.h>
12037 #include <netinet/in.h>
12039 struct ip_mreq_source mreq;
12040 return (mreq.imr_multiaddr.s_addr);
12044 set try; if eval $compile; then
12047 set d_ip_mreq_source; eval $setvar
12051 echo "Checking the availability struct ipv6_mreq ..." >&4
12053 #include <sys/types.h>
12054 #include <sys/socket.h>
12055 #include <netinet/in.h>
12057 struct ipv6_mreq mreq;
12058 return (mreq.ipv6mr_interface);
12062 set try; if eval $compile; then
12065 set d_ipv6_mreq; eval $setvar
12069 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12071 #include <sys/types.h>
12072 #include <sys/socket.h>
12073 #include <netinet/in.h>
12075 struct ipv6_mreq_source mreq;
12076 return (mreq.imr_multiaddr.s_addr);
12080 set try; if eval $compile; then
12083 set d_ipv6_mreq_source; eval $setvar
12087 echo "Checking the availability of certain socket constants..." >&4
12088 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12089 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12091 #include <sys/types.h>
12092 #include <sys/socket.h>
12098 set try; if eval $compile; then
12101 set d_${enum}; eval $setvar
12105 : see if this is a sys/uio.h system
12106 set sys/uio.h i_sysuio
12109 : Check for cmsghdr support
12111 echo "Checking to see if your system supports struct cmsghdr..." >&4
12112 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12114 case "$d_cmsghdr_s" in
12115 "$define") echo "Yes, it does." ;;
12116 *) echo "No, it doesn't." ;;
12119 : see if copysign exists
12120 set copysign d_copysign
12123 : see if copysignl exists
12124 set copysignl d_copysignl
12127 : see if crypt exists
12132 $define) cryptlib='' ;;
12133 *) if set crypt val -f d_crypt; eval $csym; $val; then
12134 echo 'crypt() found.' >&4
12138 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12139 if $test -z "$cryptlib"; then
12140 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12144 if $test -z "$cryptlib"; then
12145 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12149 if $test -z "$cryptlib"; then
12150 cryptlib=`./loc libcrypt$_a "" $libpth`
12154 if $test -z "$cryptlib"; then
12155 echo 'crypt() NOT found.' >&4
12166 : see if this is a crypt.h system
12167 set crypt.h i_crypt
12170 : see if crypt_r exists
12171 set crypt_r d_crypt_r
12173 case "$d_crypt_r" in
12175 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12176 case "$d_crypt_r_proto:$usethreads" in
12177 ":define") d_crypt_r_proto=define
12178 set d_crypt_r_proto crypt_r $hdrs
12182 case "$d_crypt_r_proto" in
12184 case "$crypt_r_proto" in
12185 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12186 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12188 case "$crypt_r_proto" in
12189 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12190 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12192 case "$crypt_r_proto" in
12193 ''|0) d_crypt_r=undef
12195 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12196 * ) case "$crypt_r_proto" in
12197 REENTRANT_PROTO*) ;;
12198 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12200 echo "Prototype: $try" ;;
12203 *) case "$usethreads" in
12204 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12215 : get csh whereabouts
12217 'csh') val="$undef" ;;
12218 *) val="$define" ;;
12222 : Respect a hint or command line value for full_csh.
12223 case "$full_csh" in
12224 '') full_csh=$csh ;;
12227 : see if ctermid exists
12228 set ctermid d_ctermid
12231 : see if ctermid_r exists
12232 set ctermid_r d_ctermid_r
12234 case "$d_ctermid_r" in
12236 hdrs="$i_systypes sys/types.h define stdio.h "
12237 case "$d_ctermid_r_proto:$usethreads" in
12238 ":define") d_ctermid_r_proto=define
12239 set d_ctermid_r_proto ctermid_r $hdrs
12243 case "$d_ctermid_r_proto" in
12245 case "$ctermid_r_proto" in
12246 ''|0) try='char* ctermid_r(char*);'
12247 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12249 case "$ctermid_r_proto" in
12250 ''|0) d_ctermid_r=undef
12252 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12253 * ) case "$ctermid_r_proto" in
12254 REENTRANT_PROTO*) ;;
12255 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12257 echo "Prototype: $try" ;;
12260 *) case "$usethreads" in
12261 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12268 *) ctermid_r_proto=0
12272 : see if ctime_r exists
12273 set ctime_r d_ctime_r
12275 case "$d_ctime_r" in
12277 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12278 case "$d_ctime_r_proto:$usethreads" in
12279 ":define") d_ctime_r_proto=define
12280 set d_ctime_r_proto ctime_r $hdrs
12284 case "$d_ctime_r_proto" in
12286 case "$ctime_r_proto" in
12287 ''|0) try='char* ctime_r(const time_t*, char*);'
12288 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12290 case "$ctime_r_proto" in
12291 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12292 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12294 case "$ctime_r_proto" in
12295 ''|0) try='int ctime_r(const time_t*, char*);'
12296 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12298 case "$ctime_r_proto" in
12299 ''|0) try='int ctime_r(const time_t*, char*, int);'
12300 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12302 case "$ctime_r_proto" in
12303 ''|0) d_ctime_r=undef
12305 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12306 * ) case "$ctime_r_proto" in
12307 REENTRANT_PROTO*) ;;
12308 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12310 echo "Prototype: $try" ;;
12313 *) case "$usethreads" in
12314 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12325 : see if cuserid exists
12326 set cuserid d_cuserid
12329 : see if dbm.h is available
12330 : see if dbmclose exists
12331 set dbmclose d_dbmclose
12334 case "$d_dbmclose" in
12344 *) set rpcsvc/dbm.h i_rpcsvcdbm
12349 *) echo "We won't be including <dbm.h>"
12359 : see if prototype for dbminit is available
12361 set d_dbminitproto dbminit $i_dbm dbm.h
12364 : see if difftime exists
12365 set difftime d_difftime
12368 : see if this is a dirent system
12370 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12372 echo "<dirent.h> found." >&4
12375 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12376 echo "<sys/dir.h> found." >&4
12379 xinc=`./findhdr sys/ndir.h`
12381 echo "<dirent.h> NOT found." >&4
12386 : Look for type of directory structure.
12388 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12390 case "$direntrytype" in
12392 case "$i_dirent" in
12393 $define) guess1='struct dirent' ;;
12394 *) guess1='struct direct' ;;
12397 *) guess1="$direntrytype"
12402 'struct dirent') guess2='struct direct' ;;
12403 *) guess2='struct dirent' ;;
12406 if $contains "$guess1" try.c >/dev/null 2>&1; then
12407 direntrytype="$guess1"
12408 echo "Your directory entries are $direntrytype." >&4
12409 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12410 direntrytype="$guess2"
12411 echo "Your directory entries seem to be $direntrytype." >&4
12413 echo "I don't recognize your system's directory entries." >&4
12414 rp="What type is used for directory entries on this system?"
12417 direntrytype="$ans"
12421 : see if the directory entry stores field length
12423 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12424 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12425 echo "Good, your directory entry keeps length information in d_namlen." >&4
12428 echo "Your directory entry does not know about the d_namlen field." >&4
12435 : Look for DIR.dd_fd
12436 case "$i_dirent" in
12438 echo "Checking to see if DIR has a dd_fd member variable" >&4
12440 #$i_stdlib I_STDLIB
12442 #include <stdlib.h>
12444 #include <dirent.h>
12454 if eval $compile; then
12455 echo "Yes, it does."
12458 echo "No, it does not."
12463 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12471 : see if this is an sysdir system
12472 set sys/dir.h i_sysdir
12475 : see if this is an sysndir system
12476 set sys/ndir.h i_sysndir
12481 $cat >dirfd.c <<EOM
12483 #$i_stdlib I_STDLIB
12485 #include <stdlib.h>
12487 #$i_dirent I_DIRENT /**/
12488 #$i_sysdir I_SYS_DIR /**/
12489 #$i_sysndir I_SYS_NDIR /**/
12490 #$i_systypes I_SYS_TYPES /**/
12491 #if defined(I_SYS_TYPES)
12492 #include <sys/types.h>
12494 #if defined(I_DIRENT)
12495 #include <dirent.h>
12498 #include <sys/ndir.h>
12501 #include <sys/dir.h>
12506 DIR *dirp = opendir(".");
12507 if (dirfd(dirp) >= 0)
12515 if eval $compile; then
12519 $define) echo "dirfd() found." >&4 ;;
12520 *) echo "dirfd() NOT found." >&4 ;;
12526 : see if dladdr exists
12527 set dladdr d_dladdr
12530 : see if dlerror exists
12533 set dlerror d_dlerror
12537 : see if dlfcn is available
12538 set dlfcn.h i_dlfcn
12541 : Check what extension to use for shared libs
12546 On a few systems, the dynamically loaded modules that perl generates and uses
12547 will need a different extension than shared libs. The default will probably
12553 *) dflt="$dlext" ;;
12555 rp='What is the extension of dynamically loaded modules'
12564 : Check if dlsym need a leading underscore
12570 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12571 $cat >dyna.c <<'EOM'
12578 #$i_stdlib I_STDLIB
12580 #include <stdlib.h>
12584 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12586 #include <sys/types.h>
12591 extern int fred() ;
12600 int mode = RTLD_LAZY ;
12602 handle = dlopen("./dyna.$dlext", mode) ;
12603 if (handle == NULL) {
12608 symbol = dlsym(handle, "fred") ;
12609 if (symbol == NULL) {
12610 /* try putting a leading underscore */
12611 symbol = dlsym(handle, "_fred") ;
12612 if (symbol == NULL) {
12625 : Call the object file tmp-dyna.o in case dlext=o.
12626 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12627 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12628 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12629 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12632 1) echo "Test program failed using dlopen." >&4
12633 echo "Perhaps you should not use dynamic loading." >&4;;
12634 2) echo "Test program failed using dlsym." >&4
12635 echo "Perhaps you should not use dynamic loading." >&4;;
12636 3) echo "dlsym needs a leading underscore" >&4
12638 4) echo "dlsym doesn't need a leading underscore." >&4;;
12641 echo "I can't compile and run the test program." >&4
12642 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12647 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12652 : see if drand48_r exists
12653 set drand48_r d_drand48_r
12655 case "$d_drand48_r" in
12657 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12658 case "$d_drand48_r_proto:$usethreads" in
12659 ":define") d_drand48_r_proto=define
12660 set d_drand48_r_proto drand48_r $hdrs
12664 case "$d_drand48_r_proto" in
12666 case "$drand48_r_proto" in
12667 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12668 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12670 case "$drand48_r_proto" in
12671 ''|0) d_drand48_r=undef
12673 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12674 * ) case "$drand48_r_proto" in
12675 REENTRANT_PROTO*) ;;
12676 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12678 echo "Prototype: $try" ;;
12681 *) case "$usethreads" in
12682 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12689 *) drand48_r_proto=0
12693 : see if prototype for drand48 is available
12695 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12698 : see if dup2 exists
12702 : see if dup3 exists
12706 : see if this is an xlocale.h system
12707 set xlocale.h i_xlocale
12710 : see if newlocale exists
12711 set newlocale d_newlocale
12714 : see if freelocale exists
12715 set freelocale d_freelocale
12718 : see if uselocale exists
12719 set uselocale d_uselocale
12722 : see if duplocale exists
12723 set duplocale d_duplocale
12726 : see if querylocale exists
12727 set querylocale d_querylocale
12730 : see if eaccess exists
12731 set eaccess d_eaccess
12734 : see if endgrent exists
12735 set endgrent d_endgrent
12738 : see if this is an grp system
12744 xxx=`./findhdr grp.h`
12745 $cppstdin $cppflags $cppminus < $xxx >$$.h
12747 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12759 set d_grpasswd; eval $setvar
12763 : see if endgrent_r exists
12764 set endgrent_r d_endgrent_r
12766 case "$d_endgrent_r" in
12768 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12769 case "$d_endgrent_r_proto:$usethreads" in
12770 ":define") d_endgrent_r_proto=define
12771 set d_endgrent_r_proto endgrent_r $hdrs
12775 case "$d_endgrent_r_proto" in
12777 case "$endgrent_r_proto" in
12778 ''|0) try='int endgrent_r(FILE**);'
12779 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12781 case "$endgrent_r_proto" in
12782 ''|0) try='void endgrent_r(FILE**);'
12783 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12785 case "$endgrent_r_proto" in
12786 ''|0) d_endgrent_r=undef
12788 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12789 * ) case "$endgrent_r_proto" in
12790 REENTRANT_PROTO*) ;;
12791 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12793 echo "Prototype: $try" ;;
12796 *) case "$usethreads" in
12797 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12804 *) endgrent_r_proto=0
12808 : see if endhostent exists
12809 set endhostent d_endhent
12812 : see if this is a netdb.h system
12813 set netdb.h i_netdb
12816 : see if endhostent_r exists
12817 set endhostent_r d_endhostent_r
12819 case "$d_endhostent_r" in
12821 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12822 case "$d_endhostent_r_proto:$usethreads" in
12823 ":define") d_endhostent_r_proto=define
12824 set d_endhostent_r_proto endhostent_r $hdrs
12828 case "$d_endhostent_r_proto" in
12830 case "$endhostent_r_proto" in
12831 ''|0) try='int endhostent_r(struct hostent_data*);'
12832 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12834 case "$endhostent_r_proto" in
12835 ''|0) try='void endhostent_r(struct hostent_data*);'
12836 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12838 case "$endhostent_r_proto" in
12839 ''|0) d_endhostent_r=undef
12840 endhostent_r_proto=0
12841 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12842 * ) case "$endhostent_r_proto" in
12843 REENTRANT_PROTO*) ;;
12844 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12846 echo "Prototype: $try" ;;
12849 *) case "$usethreads" in
12850 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12852 d_endhostent_r=undef
12853 endhostent_r_proto=0
12857 *) endhostent_r_proto=0
12861 : see if endnetent exists
12862 set endnetent d_endnent
12865 : see if endnetent_r exists
12866 set endnetent_r d_endnetent_r
12868 case "$d_endnetent_r" in
12870 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12871 case "$d_endnetent_r_proto:$usethreads" in
12872 ":define") d_endnetent_r_proto=define
12873 set d_endnetent_r_proto endnetent_r $hdrs
12877 case "$d_endnetent_r_proto" in
12879 case "$endnetent_r_proto" in
12880 ''|0) try='int endnetent_r(struct netent_data*);'
12881 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12883 case "$endnetent_r_proto" in
12884 ''|0) try='void endnetent_r(struct netent_data*);'
12885 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12887 case "$endnetent_r_proto" in
12888 ''|0) d_endnetent_r=undef
12889 endnetent_r_proto=0
12890 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12891 * ) case "$endnetent_r_proto" in
12892 REENTRANT_PROTO*) ;;
12893 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12895 echo "Prototype: $try" ;;
12898 *) case "$usethreads" in
12899 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12901 d_endnetent_r=undef
12902 endnetent_r_proto=0
12906 *) endnetent_r_proto=0
12910 : see if endprotoent exists
12911 set endprotoent d_endpent
12914 : see if endprotoent_r exists
12915 set endprotoent_r d_endprotoent_r
12917 case "$d_endprotoent_r" in
12919 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12920 case "$d_endprotoent_r_proto:$usethreads" in
12921 ":define") d_endprotoent_r_proto=define
12922 set d_endprotoent_r_proto endprotoent_r $hdrs
12926 case "$d_endprotoent_r_proto" in
12928 case "$endprotoent_r_proto" in
12929 ''|0) try='int endprotoent_r(struct protoent_data*);'
12930 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12932 case "$endprotoent_r_proto" in
12933 ''|0) try='void endprotoent_r(struct protoent_data*);'
12934 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12936 case "$endprotoent_r_proto" in
12937 ''|0) d_endprotoent_r=undef
12938 endprotoent_r_proto=0
12939 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12940 * ) case "$endprotoent_r_proto" in
12941 REENTRANT_PROTO*) ;;
12942 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12944 echo "Prototype: $try" ;;
12947 *) case "$usethreads" in
12948 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12950 d_endprotoent_r=undef
12951 endprotoent_r_proto=0
12955 *) endprotoent_r_proto=0
12959 : see if endpwent exists
12960 set endpwent d_endpwent
12963 : see if this is a pwd.h system
12969 xxx=`./findhdr pwd.h`
12970 $cppstdin $cppflags $cppminus < $xxx >$$.h
12972 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12980 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12988 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12996 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13004 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13012 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13020 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13028 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13040 set d_pwquota; eval $setvar
13041 set d_pwage; eval $setvar
13042 set d_pwchange; eval $setvar
13043 set d_pwclass; eval $setvar
13044 set d_pwexpire; eval $setvar
13045 set d_pwcomment; eval $setvar
13046 set d_pwgecos; eval $setvar
13047 set d_pwpasswd; eval $setvar
13051 : see if endpwent_r exists
13052 set endpwent_r d_endpwent_r
13054 case "$d_endpwent_r" in
13056 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13057 case "$d_endpwent_r_proto:$usethreads" in
13058 ":define") d_endpwent_r_proto=define
13059 set d_endpwent_r_proto endpwent_r $hdrs
13063 case "$d_endpwent_r_proto" in
13065 case "$endpwent_r_proto" in
13066 ''|0) try='int endpwent_r(FILE**);'
13067 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13069 case "$endpwent_r_proto" in
13070 ''|0) try='void endpwent_r(FILE**);'
13071 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13073 case "$endpwent_r_proto" in
13074 ''|0) d_endpwent_r=undef
13076 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13077 * ) case "$endpwent_r_proto" in
13078 REENTRANT_PROTO*) ;;
13079 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13081 echo "Prototype: $try" ;;
13084 *) case "$usethreads" in
13085 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13092 *) endpwent_r_proto=0
13096 : see if endservent exists
13097 set endservent d_endsent
13100 : see if endservent_r exists
13101 set endservent_r d_endservent_r
13103 case "$d_endservent_r" in
13105 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13106 case "$d_endservent_r_proto:$usethreads" in
13107 ":define") d_endservent_r_proto=define
13108 set d_endservent_r_proto endservent_r $hdrs
13112 case "$d_endservent_r_proto" in
13114 case "$endservent_r_proto" in
13115 ''|0) try='int endservent_r(struct servent_data*);'
13116 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13118 case "$endservent_r_proto" in
13119 ''|0) try='void endservent_r(struct servent_data*);'
13120 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13122 case "$endservent_r_proto" in
13123 ''|0) d_endservent_r=undef
13124 endservent_r_proto=0
13125 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13126 * ) case "$endservent_r_proto" in
13127 REENTRANT_PROTO*) ;;
13128 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13130 echo "Prototype: $try" ;;
13133 *) case "$usethreads" in
13134 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13136 d_endservent_r=undef
13137 endservent_r_proto=0
13141 *) endservent_r_proto=0
13145 : Locate the flags for 'open()'
13148 #include <sys/types.h>
13153 #include <sys/file.h>
13155 #$i_stdlib I_STDLIB
13157 #include <stdlib.h>
13168 : check sys/file.h first to get FREAD on Sun
13169 if $test `./findhdr sys/file.h` && \
13170 set try -DI_SYS_FILE && eval $compile; then
13172 echo "<sys/file.h> defines the O_* constants..." >&4
13173 if $run ./try; then
13174 echo "and you have the 3 argument form of open()." >&4
13177 echo "but not the 3 argument form of open(). Oh, well." >&4
13180 elif $test `./findhdr fcntl.h` && \
13181 set try -DI_FCNTL && eval $compile; then
13183 echo "<fcntl.h> defines the O_* constants..." >&4
13184 if $run ./try; then
13185 echo "and you have the 3 argument form of open()." >&4
13188 echo "but not the 3 argument form of open(). Oh, well." >&4
13193 echo "I can't find the O_* constant definitions! You got problems." >&4
13199 : see if this is a sys/file.h system
13204 : do we need to include sys/file.h ?
13208 if $h_sysfile; then
13210 echo "We'll be including <sys/file.h>." >&4
13213 echo "We won't be including <sys/file.h>." >&4
13223 : see if fcntl.h is there
13228 : see if we can include fcntl.h
13234 echo "We'll be including <fcntl.h>." >&4
13237 if $h_sysfile; then
13238 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13240 echo "We won't be including <fcntl.h>." >&4
13252 : see if fork exists
13256 : see if pipe exists
13260 : check for non-blocking I/O stuff
13261 case "$h_sysfile" in
13262 true) echo "#include <sys/file.h>" > head.c;;
13265 true) echo "#include <fcntl.h>" > head.c;;
13266 *) echo "#include <sys/fcntl.h>" > head.c;;
13271 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13272 case "$o_nonblock" in
13274 $cat head.c > try.c
13275 $cat >>try.c <<EOCP
13277 #$i_stdlib I_STDLIB
13279 #include <stdlib.h>
13287 printf("O_NONBLOCK\n");
13291 printf("O_NDELAY\n");
13295 printf("FNDELAY\n");
13302 if eval $compile_ok; then
13303 o_nonblock=`$run ./try`
13304 case "$o_nonblock" in
13305 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13306 *) echo "Seems like we can use $o_nonblock.";;
13309 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13312 *) echo "Using $hint value $o_nonblock.";;
13317 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13320 case "$d_fork:$d_pipe:$d_alarm" in
13321 define:define:define)
13322 $cat head.c > try.c
13323 $cat >>try.c <<EOCP
13325 #include <sys/types.h>
13326 #include <signal.h>
13328 #$i_stdlib I_STDLIB
13330 #include <stdlib.h>
13336 #define MY_O_NONBLOCK $o_nonblock
13337 #ifndef errno /* XXX need better Configure test */
13340 #$i_unistd I_UNISTD
13342 #include <unistd.h>
13344 #include <string.h>
13345 $signal_t blech(int x) { exit(3); }
13347 $cat >> try.c <<'EOCP'
13356 ret = pipe(pd); /* Down: child -> parent */
13359 ret = pipe(pu); /* Up: parent -> child */
13363 close(pd[1]); /* Parent reads from pd[0] */
13364 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13366 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13371 signal(SIGALRM, blech);
13373 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13375 sprintf(string, "%d\n", ret);
13376 ret = write(2, string, strlen(string));
13377 if (ret != strlen(string))
13381 if (errno == EAGAIN) {
13382 printf("EAGAIN\n");
13387 if (errno == EWOULDBLOCK)
13388 printf("EWOULDBLOCK\n");
13391 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13394 sleep(2); /* Give it time to close our pipe */
13396 ret = read(pd[0], buf, 1); /* Should read EOF */
13398 sprintf(string, "%d\n", ret);
13399 ret = write(4, string, strlen(string));
13400 if (ret != strlen(string))
13405 close(pd[0]); /* We write to pd[1] */
13406 close(pu[1]); /* We read from pu[0] */
13407 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13410 close(pd[1]); /* Pipe pd is now fully closed! */
13411 exit(0); /* Bye bye, thank you for playing! */
13415 if eval $compile_ok; then
13416 echo "$startsh" >mtry
13417 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13419 $run ./mtry >/dev/null 2>&1
13421 0) eagain=`$cat try.out`;;
13422 1) echo "Could not perform non-blocking setting!";;
13423 2) echo "I did a successful read() for something that was not there!";;
13424 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13425 4) echo "Could not find F_SETFL!";;
13426 *) echo "Something terribly wrong happened during testing.";;
13428 rd_nodata=`$cat try.ret`
13429 echo "A read() system call with no data present returns $rd_nodata."
13430 case "$rd_nodata" in
13433 echo "(That's peculiar, fixing that to be -1.)"
13439 echo "Forcing errno EAGAIN on read() with no data available."
13443 echo "Your read() sets errno to $eagain when no data is available."
13446 status=`$cat try.err`
13448 0) echo "And it correctly returns 0 to signal EOF.";;
13449 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13450 *) echo "However, your read() returns '$status' on EOF??";;
13453 if test "$status" = "$rd_nodata"; then
13454 echo "WARNING: you can't distinguish between EOF and no data!"
13458 echo "I can't compile the test program--assuming errno EAGAIN will do."
13462 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13471 echo "Using $hint value $eagain."
13472 echo "Your read() returns $rd_nodata when no data is present."
13473 case "$d_eofnblk" in
13474 "$define") echo "And you can see EOF because read() returns 0.";;
13475 "$undef") echo "But you can't see EOF status from read() returned value.";;
13477 echo "(Assuming you can't see EOF status from read anyway.)"
13483 $rm_try head.c mtry
13485 : see if erf exists
13489 : see if erfc exists
13493 : see if exp2 exists
13497 : see if expm1 exists
13501 : see if _ptr and _cnt from stdio act std
13504 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13505 echo "(Looks like you have stdio.h from BSD.)"
13506 case "$stdio_ptr" in
13507 '') stdio_ptr='((fp)->_p)'
13510 *) ptr_lval=$d_stdio_ptr_lval;;
13512 case "$stdio_cnt" in
13513 '') stdio_cnt='((fp)->_r)'
13516 *) cnt_lval=$d_stdio_cnt_lval;;
13518 case "$stdio_base" in
13519 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13521 case "$stdio_bufsiz" in
13522 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13524 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13525 echo "(Looks like you have stdio.h from Linux.)"
13526 case "$stdio_ptr" in
13527 '') stdio_ptr='((fp)->_IO_read_ptr)'
13530 *) ptr_lval=$d_stdio_ptr_lval;;
13532 case "$stdio_cnt" in
13533 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13536 *) cnt_lval=$d_stdio_cnt_lval;;
13538 case "$stdio_base" in
13539 '') stdio_base='((fp)->_IO_read_base)';;
13541 case "$stdio_bufsiz" in
13542 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13545 case "$stdio_ptr" in
13546 '') stdio_ptr='((fp)->_ptr)'
13549 *) ptr_lval=$d_stdio_ptr_lval;;
13551 case "$stdio_cnt" in
13552 '') stdio_cnt='((fp)->_cnt)'
13555 *) cnt_lval=$d_stdio_cnt_lval;;
13557 case "$stdio_base" in
13558 '') stdio_base='((fp)->_base)';;
13560 case "$stdio_bufsiz" in
13561 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13565 : test whether _ptr and _cnt really work
13566 echo "Checking how std your stdio is..." >&4
13569 #$i_stdlib I_STDLIB
13571 #include <stdlib.h>
13573 #define FILE_ptr(fp) $stdio_ptr
13574 #define FILE_cnt(fp) $stdio_cnt
13576 FILE *fp = fopen("try.c", "r");
13579 18 <= FILE_cnt(fp) &&
13580 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13588 if eval $compile && $to try.c; then
13589 if $run ./try; then
13590 echo "Your stdio acts pretty std."
13593 echo "Your stdio isn't very std."
13596 echo "Your stdio doesn't appear very std."
13600 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13601 # direct buffer manipulation no longer works. The Configure tests
13602 # should be changed to correctly detect this, but until then,
13603 # the following check should at least let perl compile and run.
13604 # (This quick fix should be updated before 5.8.1.)
13605 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13606 # A. Dougherty, June 3, 2002.
13607 case "$d_gnulibc" in
13609 case "$gnulibc_version" in
13613 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13622 : Can _ptr be used as an lvalue?
13623 case "$d_stdstdio$ptr_lval" in
13624 $define$define) val=$define ;;
13627 set d_stdio_ptr_lval
13630 : Can _cnt be used as an lvalue?
13631 case "$d_stdstdio$cnt_lval" in
13632 $define$define) val=$define ;;
13635 set d_stdio_cnt_lval
13639 : test whether setting _ptr sets _cnt as a side effect
13640 d_stdio_ptr_lval_sets_cnt="$undef"
13641 d_stdio_ptr_lval_nochange_cnt="$undef"
13642 case "$d_stdio_ptr_lval$d_stdstdio" in
13644 echo "Checking to see what happens if we set the stdio ptr..." >&4
13647 /* Can we scream? */
13648 /* Eat dust sed :-) */
13649 /* In the buffer space, no one can hear you scream. */
13650 #$i_stdlib I_STDLIB
13652 #include <stdlib.h>
13654 #define FILE_ptr(fp) $stdio_ptr
13655 #define FILE_cnt(fp) $stdio_cnt
13656 #include <sys/types.h>
13658 FILE *fp = fopen("try.c", "r");
13663 puts("Fail even to read");
13666 c = getc(fp); /* Read away the first # */
13668 puts("Fail even to read");
13672 18 <= FILE_cnt(fp) &&
13673 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13675 puts("Fail even to read");
13678 ptr = (char*) FILE_ptr(fp);
13679 cnt = (size_t)FILE_cnt(fp);
13681 FILE_ptr(fp) += 42;
13683 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13684 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13687 if (FILE_cnt(fp) <= 20) {
13688 printf ("Fail (<20 chars to test)");
13691 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13692 puts("Fail compare");
13695 if (cnt == FILE_cnt(fp)) {
13696 puts("Pass_unchanged");
13699 if (FILE_cnt(fp) == (cnt - 42)) {
13700 puts("Pass_changed");
13703 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13709 if eval $compile && $to try.c; then
13710 case `$run ./try` in
13712 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13713 d_stdio_ptr_lval_sets_cnt="$define" ;;
13715 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13716 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13718 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13720 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13723 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13729 : see if _base is also standard
13731 case "$d_stdstdio" in
13735 #$i_stdlib I_STDLIB
13737 #include <stdlib.h>
13739 #define FILE_base(fp) $stdio_base
13740 #define FILE_bufsiz(fp) $stdio_bufsiz
13742 FILE *fp = fopen("try.c", "r");
13745 19 <= FILE_bufsiz(fp) &&
13746 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13753 if eval $compile && $to try.c; then
13754 if $run ./try; then
13755 echo "And its _base field acts std."
13758 echo "But its _base field isn't std."
13761 echo "However, it seems to be lacking the _base field."
13769 : see if fast_stdio exists
13771 case "$d_stdstdio:$d_stdio_ptr_lval" in
13773 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13775 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13784 : see if fchdir exists
13785 set fchdir d_fchdir
13788 : see if fchmod exists
13789 set fchmod d_fchmod
13792 : check for openat, unlinkat, renameat, linkat, fchmodat
13793 set openat d_openat
13796 set unlinkat d_unlinkat
13799 set renameat d_renameat
13802 set linkat d_linkat
13805 set fchmodat d_fchmodat
13808 : see if fchown exists
13809 set fchown d_fchown
13812 : see if this is an fcntl system
13816 : See if fcntl-based locking works.
13819 #$i_stdlib I_STDLIB
13821 #include <stdlib.h>
13823 #include <unistd.h>
13825 #include <signal.h>
13826 $signal_t blech(int x) { exit(3); }
13828 #if defined(F_SETLK) && defined(F_SETLKW)
13829 struct flock flock;
13831 fd = open("try.c", O_RDONLY);
13832 flock.l_type = F_RDLCK;
13833 flock.l_whence = SEEK_SET;
13834 flock.l_start = flock.l_len = 0;
13835 signal(SIGALRM, blech);
13837 retval = fcntl(fd, F_SETLK, &flock);
13839 (retval < 0 ? exit(2) : exit(0));
13845 echo "Checking if fcntl-based file locking works... "
13849 if eval $compile_ok; then
13850 if $run ./try; then
13851 echo "Yes, it seems to work."
13854 echo "Nope, it didn't work."
13859 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13860 *** This is (almost) impossible.
13861 *** If your NFS lock daemons are not feeling well, something like
13862 *** this may happen, please investigate. Cannot continue, aborting.
13870 echo "I'm unable to compile the test program, so I'll assume not."
13875 echo "Nope, since you don't even have fcntl()."
13878 set d_fcntl_can_lock
13882 : check for fd_set items
13885 Checking to see how well your C compiler handles fd_set and friends ...
13888 #$i_stdlib I_STDLIB
13890 #include <stdlib.h>
13892 #$i_systime I_SYS_TIME
13893 #$i_sysselct I_SYS_SELECT
13894 #$d_socket HAS_SOCKET
13895 #include <sys/types.h>
13897 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13900 #include <sys/time.h>
13902 #ifdef I_SYS_SELECT
13903 #include <sys/select.h>
13912 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13920 if eval $compile; then
13921 d_fds_bits="$define"
13923 echo "Well, your system knows about the normal fd_set typedef..." >&4
13924 if $run ./try; then
13925 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13926 d_fd_macros="$define"
13929 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13931 d_fd_macros="$undef"
13935 Hmm, your compiler has some difficulty with fd_set. Checking further...
13938 if eval $compile; then
13939 d_fds_bits="$undef"
13941 echo "Well, your system has some sort of fd_set available..." >&4
13942 if $run ./try; then
13943 echo "and you have the normal fd_set macros." >&4
13944 d_fd_macros="$define"
13947 but not the normal fd_set macros! Gross! More work for me...
13949 d_fd_macros="$undef"
13952 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13954 d_fds_bits="$undef"
13955 d_fd_macros="$undef"
13960 : see if fdclose exists
13961 set fdclose d_fdclose
13964 : see if fdim exists
13968 : see if fegetround exists
13969 set fegetround d_fegetround
13972 : see if fgetpos exists
13973 set fgetpos d_fgetpos
13976 : see if finite exists
13977 set finite d_finite
13980 : see if finitel exists
13981 set finitel d_finitel
13984 : see if flock exists
13988 : see if prototype for flock is available
13990 set d_flockproto flock $i_sysfile sys/file.h
13993 : see if fma exists
13997 : see if fmax exists
14001 : see if fmin exists
14005 : see if fp_class exists
14006 set fp_class d_fp_class
14009 : check for fpclassify
14010 echo "Checking to see if you have fpclassify..." >&4
14013 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14016 if eval $compile; then
14018 echo "You have fpclassify."
14021 echo "You do not have fpclassify."
14027 : see if fp_classify exists
14028 set fp_classify d_fp_classify
14031 : see if fp_classl exists
14032 set fp_classl d_fp_classl
14035 : see if pathconf exists
14036 set pathconf d_pathconf
14039 : see if fpathconf exists
14040 set fpathconf d_fpathconf
14043 : see if fpclass exists
14044 set fpclass d_fpclass
14047 : see if fpclassl exists
14048 set fpclassl d_fpclassl
14051 : see if fpgetround exists
14052 set fpgetround d_fpgetround
14055 : check for fpos64_t
14057 echo "Checking to see if you have fpos64_t..." >&4
14060 int main() { fpos64_t x = 7; }
14063 if eval $compile; then
14065 echo "You have fpos64_t."
14068 echo "You do not have fpos64_t."
14069 case "$fpossize" in
14070 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14077 : see if frexpl exists
14078 set frexpl d_frexpl
14081 : see if this is a sys/param system
14082 set sys/param.h i_sysparam
14085 : see if this is a sys/mount.h system
14086 set sys/mount.h i_sysmount
14089 : Check for fs_data_s
14091 echo "Checking to see if your system supports struct fs_data..." >&4
14092 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14094 case "$d_fs_data_s" in
14095 "$define") echo "Yes, it does." ;;
14096 *) echo "No, it doesn't." ;;
14099 : see if fseeko exists
14100 set fseeko d_fseeko
14102 case "$longsize" in
14103 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14106 : see if fsetpos exists
14107 set fsetpos d_fsetpos
14110 : see if fstatfs exists
14111 set fstatfs d_fstatfs
14114 : see if statvfs exists
14115 set statvfs d_statvfs
14118 : see if fstatvfs exists
14119 set fstatvfs d_fstatvfs
14122 : see if fsync exists
14126 : see if ftello exists
14127 set ftello d_ftello
14129 case "$longsize" in
14130 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14133 : check for a working futimes
14136 echo "Checking if you have a working futimes()" >&4
14139 #include <stdlib.h>
14140 #include <sys/time.h>
14143 #include <stdlib.h>
14148 fd = open ("try.c", O_RDWR);
14149 if (-1 == fd) exit (1);
14150 rv = futimes (fd, NULL);
14151 exit (rv == -1 ? errno : 0);
14155 if eval $compile; then
14159 0) echo "Yes, you have" >&4
14160 d_futimes="$define"
14162 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14166 echo "No, it does not (probably harmless)" >&4
14170 : look for gai_strerror
14172 $cat >try.c <<'EOCP'
14173 #include <sys/types.h>
14174 #include <sys/socket.h>
14178 return (gai_strerror (0) ? 0 : 1);
14183 if eval $compile; then
14186 0) echo "A working gai_strerror() found." >&4
14188 *) echo "gai_strerror() found, but it doesn't work" >&4
14192 echo "gai_strerror() NOT found." >&4
14198 : see if ndbm.h is available
14201 : Compatibility location for RedHat 7.1
14202 set gdbm/ndbm.h i_gdbmndbm
14204 : Compatibility location for Debian 4.0
14205 set gdbm-ndbm.h i_gdbm_ndbm
14209 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14210 : see if dbm_open exists
14211 set dbm_open d_dbm_open
14213 case "$d_dbm_open" in
14216 i_gdbmndbm="$undef"
14217 i_gdbm_ndbm="$undef"
14218 echo "We won't be including <ndbm.h>"
14228 ndbm_hdr_protochk='name=$1; hdr=$2;
14229 eval "ihdr=\$""i_$name";
14231 if $test "$ihdr" = "$define"; then
14232 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14233 case "$d_cplusplus" in
14234 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14235 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14238 $define) $echo "Your <$hdr> seems to have prototypes";;
14239 *) $echo "Your <$hdr> does not seem to have prototypes";;
14242 set "d_${name}_h_uses_prototypes";
14246 eval $ndbm_hdr_protochk
14247 set gdbmndbm gdbm/ndbm.h
14248 eval $ndbm_hdr_protochk
14249 set gdbm_ndbm gdbm-ndbm.h
14250 eval $ndbm_hdr_protochk
14252 : see if getaddrinfo exists
14253 set getaddrinfo d_getaddrinfo
14256 : see if getcwd exists
14257 set getcwd d_getcwd
14260 : see if getespwnam exists
14261 set getespwnam d_getespwnam
14264 : see if getfsstat exists
14265 set getfsstat d_getfsstat
14268 : see if getgrent exists
14269 set getgrent d_getgrent
14272 : see if getgrent_r exists
14273 set getgrent_r d_getgrent_r
14275 case "$d_getgrent_r" in
14277 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14278 case "$d_getgrent_r_proto:$usethreads" in
14279 ":define") d_getgrent_r_proto=define
14280 set d_getgrent_r_proto getgrent_r $hdrs
14284 case "$d_getgrent_r_proto" in
14286 case "$getgrent_r_proto" in
14287 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14288 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14290 case "$getgrent_r_proto" in
14291 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14292 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14294 case "$getgrent_r_proto" in
14295 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14296 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14298 case "$getgrent_r_proto" in
14299 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14300 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14302 case "$getgrent_r_proto" in
14303 ''|0) try='int getgrent_r(struct group*, char*, int);'
14304 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14306 case "$getgrent_r_proto" in
14307 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14308 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14310 case "$getgrent_r_proto" in
14311 ''|0) d_getgrent_r=undef
14313 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14314 * ) case "$getgrent_r_proto" in
14315 REENTRANT_PROTO*) ;;
14316 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14318 echo "Prototype: $try" ;;
14321 *) case "$usethreads" in
14322 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14329 *) getgrent_r_proto=0
14333 : see if getgrgid_r exists
14334 set getgrgid_r d_getgrgid_r
14336 case "$d_getgrgid_r" in
14338 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14339 case "$d_getgrgid_r_proto:$usethreads" in
14340 ":define") d_getgrgid_r_proto=define
14341 set d_getgrgid_r_proto getgrgid_r $hdrs
14345 case "$d_getgrgid_r_proto" in
14347 case "$getgrgid_r_proto" in
14348 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14349 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14351 case "$getgrgid_r_proto" in
14352 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14353 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14355 case "$getgrgid_r_proto" in
14356 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14357 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14359 case "$getgrgid_r_proto" in
14360 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14361 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14363 case "$getgrgid_r_proto" in
14364 ''|0) d_getgrgid_r=undef
14366 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14367 * ) case "$getgrgid_r_proto" in
14368 REENTRANT_PROTO*) ;;
14369 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14371 echo "Prototype: $try" ;;
14374 *) case "$usethreads" in
14375 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14382 *) getgrgid_r_proto=0
14386 : see if getgrnam_r exists
14387 set getgrnam_r d_getgrnam_r
14389 case "$d_getgrnam_r" in
14391 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14392 case "$d_getgrnam_r_proto:$usethreads" in
14393 ":define") d_getgrnam_r_proto=define
14394 set d_getgrnam_r_proto getgrnam_r $hdrs
14398 case "$d_getgrnam_r_proto" in
14400 case "$getgrnam_r_proto" in
14401 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14402 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14404 case "$getgrnam_r_proto" in
14405 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14406 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14408 case "$getgrnam_r_proto" in
14409 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14410 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14412 case "$getgrnam_r_proto" in
14413 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14414 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14416 case "$getgrnam_r_proto" in
14417 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14420 case "$getgrnam_r_proto" in
14421 ''|0) d_getgrnam_r=undef
14423 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14424 * ) case "$getgrnam_r_proto" in
14425 REENTRANT_PROTO*) ;;
14426 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14428 echo "Prototype: $try" ;;
14431 *) case "$usethreads" in
14432 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14439 *) getgrnam_r_proto=0
14443 : see if gethostbyaddr exists
14444 set gethostbyaddr d_gethbyaddr
14447 : see if gethostbyname exists
14448 set gethostbyname d_gethbyname
14451 : see if gethostent exists
14452 set gethostent d_gethent
14455 : see how we will look up host name
14458 if set gethostname val -f d_gethname; eval $csym; $val; then
14459 echo 'gethostname() found.' >&4
14460 d_gethname="$define"
14463 if set uname val -f d_uname; eval $csym; $val; then
14466 uname() was found, but you're running xenix, and older versions of xenix
14467 have a broken uname(). If you don't really know whether your xenix is old
14468 enough to have a broken system call, use the default answer.
14473 "$define") dflt=n;;
14475 rp='Is your uname() broken?'
14478 n*) d_uname="$define"; call=uname;;
14481 echo 'uname() found.' >&4
14488 case "$d_gethname" in
14489 '') d_gethname="$undef";;
14492 '') d_uname="$undef";;
14494 case "$d_uname$d_gethname" in
14499 Every now and then someone has a $call() that lies about the hostname
14500 but can't be fixed for political or economic reasons. If you wish, I can
14501 pretend $call() isn't there and maybe compute hostname at run-time
14502 thanks to the '$phostname' command.
14505 rp="Shall I ignore $call() from now on?"
14508 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14511 case "$phostname" in
14512 '') aphostname='';;
14513 *) case "$aphostname" in
14515 *) set X $phostname
14519 file=`./loc $file $file $pth`
14520 aphostname=`echo $file $*`
14525 case "$d_uname$d_gethname" in
14528 case "$phostname" in
14530 echo "There will be no way for $package to get your hostname." >&4;;
14532 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14536 case "$d_phostname" in
14537 '') d_phostname="$undef";;
14540 : see if gethostbyaddr_r exists
14541 set gethostbyaddr_r d_gethostbyaddr_r
14543 case "$d_gethostbyaddr_r" in
14545 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14546 case "$d_gethostbyaddr_r_proto:$usethreads" in
14547 ":define") d_gethostbyaddr_r_proto=define
14548 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14552 case "$d_gethostbyaddr_r_proto" in
14554 case "$gethostbyaddr_r_proto" in
14555 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14556 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14558 case "$gethostbyaddr_r_proto" in
14559 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14560 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14562 case "$gethostbyaddr_r_proto" in
14563 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14564 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14566 case "$gethostbyaddr_r_proto" in
14567 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14568 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14570 case "$gethostbyaddr_r_proto" in
14571 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14572 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14574 case "$gethostbyaddr_r_proto" in
14575 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14576 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14578 case "$gethostbyaddr_r_proto" in
14579 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14580 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14582 case "$gethostbyaddr_r_proto" in
14583 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14584 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14586 case "$gethostbyaddr_r_proto" in
14587 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14588 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14590 case "$gethostbyaddr_r_proto" in
14591 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14592 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14594 case "$gethostbyaddr_r_proto" in
14595 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14596 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14598 case "$gethostbyaddr_r_proto" in
14599 ''|0) d_gethostbyaddr_r=undef
14600 gethostbyaddr_r_proto=0
14601 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14602 * ) case "$gethostbyaddr_r_proto" in
14603 REENTRANT_PROTO*) ;;
14604 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14606 echo "Prototype: $try" ;;
14609 *) case "$usethreads" in
14610 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14612 d_gethostbyaddr_r=undef
14613 gethostbyaddr_r_proto=0
14617 *) gethostbyaddr_r_proto=0
14621 : see if gethostbyname_r exists
14622 set gethostbyname_r d_gethostbyname_r
14624 case "$d_gethostbyname_r" in
14626 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14627 case "$d_gethostbyname_r_proto:$usethreads" in
14628 ":define") d_gethostbyname_r_proto=define
14629 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14633 case "$d_gethostbyname_r_proto" in
14635 case "$gethostbyname_r_proto" in
14636 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14637 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14639 case "$gethostbyname_r_proto" in
14640 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14641 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14643 case "$gethostbyname_r_proto" in
14644 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14645 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14647 case "$gethostbyname_r_proto" in
14648 ''|0) d_gethostbyname_r=undef
14649 gethostbyname_r_proto=0
14650 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14651 * ) case "$gethostbyname_r_proto" in
14652 REENTRANT_PROTO*) ;;
14653 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14655 echo "Prototype: $try" ;;
14658 *) case "$usethreads" in
14659 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14661 d_gethostbyname_r=undef
14662 gethostbyname_r_proto=0
14666 *) gethostbyname_r_proto=0
14670 : see if gethostent_r exists
14671 set gethostent_r d_gethostent_r
14673 case "$d_gethostent_r" in
14675 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14676 case "$d_gethostent_r_proto:$usethreads" in
14677 ":define") d_gethostent_r_proto=define
14678 set d_gethostent_r_proto gethostent_r $hdrs
14682 case "$d_gethostent_r_proto" in
14684 case "$gethostent_r_proto" in
14685 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14686 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14688 case "$gethostent_r_proto" in
14689 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14690 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14692 case "$gethostent_r_proto" in
14693 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14694 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14696 case "$gethostent_r_proto" in
14697 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14698 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14700 case "$gethostent_r_proto" in
14701 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14702 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14704 case "$gethostent_r_proto" in
14705 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14706 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14708 case "$gethostent_r_proto" in
14709 ''|0) d_gethostent_r=undef
14710 gethostent_r_proto=0
14711 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14712 * ) case "$gethostent_r_proto" in
14713 REENTRANT_PROTO*) ;;
14714 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14716 echo "Prototype: $try" ;;
14719 *) case "$usethreads" in
14720 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14722 d_gethostent_r=undef
14723 gethostent_r_proto=0
14727 *) gethostent_r_proto=0
14731 : see if prototypes for various gethostxxx netdb.h functions are available
14733 set d_gethostprotos gethostent $i_netdb netdb.h
14736 : see if getitimer exists
14737 set getitimer d_getitimer
14740 : see if getlogin exists
14741 set getlogin d_getlogin
14744 : see if getlogin_r exists
14745 set getlogin_r d_getlogin_r
14747 case "$d_getlogin_r" in
14749 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14750 case "$d_getlogin_r_proto:$usethreads" in
14751 ":define") d_getlogin_r_proto=define
14752 set d_getlogin_r_proto getlogin_r $hdrs
14756 case "$d_getlogin_r_proto" in
14758 case "$getlogin_r_proto" in
14759 ''|0) try='int getlogin_r(char*, size_t);'
14760 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14762 case "$getlogin_r_proto" in
14763 ''|0) try='int getlogin_r(char*, int);'
14764 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14766 case "$getlogin_r_proto" in
14767 ''|0) try='char* getlogin_r(char*, size_t);'
14768 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14770 case "$getlogin_r_proto" in
14771 ''|0) try='char* getlogin_r(char*, int);'
14772 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14774 case "$getlogin_r_proto" in
14775 ''|0) d_getlogin_r=undef
14777 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14778 * ) case "$getlogin_r_proto" in
14779 REENTRANT_PROTO*) ;;
14780 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14782 echo "Prototype: $try" ;;
14785 *) case "$usethreads" in
14786 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14793 *) getlogin_r_proto=0
14797 : see if getmnt exists
14798 set getmnt d_getmnt
14801 : see if getmntent exists
14802 set getmntent d_getmntent
14805 : see if getnameinfo exists
14806 set getnameinfo d_getnameinfo
14809 : see if getnetbyaddr exists
14810 set getnetbyaddr d_getnbyaddr
14813 : see if getnetbyname exists
14814 set getnetbyname d_getnbyname
14817 : see if getnetent exists
14818 set getnetent d_getnent
14821 : see if getnetbyaddr_r exists
14822 set getnetbyaddr_r d_getnetbyaddr_r
14824 case "$d_getnetbyaddr_r" in
14826 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14827 case "$d_getnetbyaddr_r_proto:$usethreads" in
14828 ":define") d_getnetbyaddr_r_proto=define
14829 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14833 case "$d_getnetbyaddr_r_proto" in
14835 case "$getnetbyaddr_r_proto" in
14836 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14837 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14839 case "$getnetbyaddr_r_proto" in
14840 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14841 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14843 case "$getnetbyaddr_r_proto" in
14844 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14845 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14847 case "$getnetbyaddr_r_proto" in
14848 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14849 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14851 case "$getnetbyaddr_r_proto" in
14852 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14853 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14855 case "$getnetbyaddr_r_proto" in
14856 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14857 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14859 case "$getnetbyaddr_r_proto" in
14860 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14861 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14863 case "$getnetbyaddr_r_proto" in
14864 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14865 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14867 case "$getnetbyaddr_r_proto" in
14868 ''|0) d_getnetbyaddr_r=undef
14869 getnetbyaddr_r_proto=0
14870 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14871 * ) case "$getnetbyaddr_r_proto" in
14872 REENTRANT_PROTO*) ;;
14873 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14875 echo "Prototype: $try" ;;
14878 *) case "$usethreads" in
14879 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14881 d_getnetbyaddr_r=undef
14882 getnetbyaddr_r_proto=0
14886 *) getnetbyaddr_r_proto=0
14890 : see if getnetbyname_r exists
14891 set getnetbyname_r d_getnetbyname_r
14893 case "$d_getnetbyname_r" in
14895 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14896 case "$d_getnetbyname_r_proto:$usethreads" in
14897 ":define") d_getnetbyname_r_proto=define
14898 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14902 case "$d_getnetbyname_r_proto" in
14904 case "$getnetbyname_r_proto" in
14905 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14906 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14908 case "$getnetbyname_r_proto" in
14909 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14910 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14912 case "$getnetbyname_r_proto" in
14913 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14914 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14916 case "$getnetbyname_r_proto" in
14917 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14918 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14920 case "$getnetbyname_r_proto" in
14921 ''|0) d_getnetbyname_r=undef
14922 getnetbyname_r_proto=0
14923 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14924 * ) case "$getnetbyname_r_proto" in
14925 REENTRANT_PROTO*) ;;
14926 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14928 echo "Prototype: $try" ;;
14931 *) case "$usethreads" in
14932 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14934 d_getnetbyname_r=undef
14935 getnetbyname_r_proto=0
14939 *) getnetbyname_r_proto=0
14943 : see if getnetent_r exists
14944 set getnetent_r d_getnetent_r
14946 case "$d_getnetent_r" in
14948 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14949 case "$d_getnetent_r_proto:$usethreads" in
14950 ":define") d_getnetent_r_proto=define
14951 set d_getnetent_r_proto getnetent_r $hdrs
14955 case "$d_getnetent_r_proto" in
14957 case "$getnetent_r_proto" in
14958 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14959 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14961 case "$getnetent_r_proto" in
14962 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14963 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14965 case "$getnetent_r_proto" in
14966 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14967 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14969 case "$getnetent_r_proto" in
14970 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14971 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14973 case "$getnetent_r_proto" in
14974 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14975 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14977 case "$getnetent_r_proto" in
14978 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14979 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14981 case "$getnetent_r_proto" in
14982 ''|0) d_getnetent_r=undef
14983 getnetent_r_proto=0
14984 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14985 * ) case "$getnetent_r_proto" in
14986 REENTRANT_PROTO*) ;;
14987 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14989 echo "Prototype: $try" ;;
14992 *) case "$usethreads" in
14993 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14995 d_getnetent_r=undef
14996 getnetent_r_proto=0
15000 *) getnetent_r_proto=0
15004 : see if prototypes for various getnetxxx netdb.h functions are available
15006 set d_getnetprotos getnetent $i_netdb netdb.h
15009 : see if getpagesize exists
15010 set getpagesize d_getpagsz
15013 : Optional checks for getprotobyname and getprotobynumber
15015 : see if getprotobyname exists
15016 set getprotobyname d_getpbyname
15019 : see if getprotobynumber exists
15020 set getprotobynumber d_getpbynumber
15023 : see if getprotoent exists
15024 set getprotoent d_getpent
15027 : see if getpgid exists
15028 set getpgid d_getpgid
15031 : see if getpgrp2 exists
15032 set getpgrp2 d_getpgrp2
15035 : see if getppid exists
15036 set getppid d_getppid
15039 : see if getpriority exists
15040 set getpriority d_getprior
15043 : see if getprotobyname_r exists
15044 set getprotobyname_r d_getprotobyname_r
15046 case "$d_getprotobyname_r" in
15048 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15049 case "$d_getprotobyname_r_proto:$usethreads" in
15050 ":define") d_getprotobyname_r_proto=define
15051 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15055 case "$d_getprotobyname_r_proto" in
15057 case "$getprotobyname_r_proto" in
15058 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15059 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15061 case "$getprotobyname_r_proto" in
15062 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15063 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15065 case "$getprotobyname_r_proto" in
15066 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15067 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15069 case "$getprotobyname_r_proto" in
15070 ''|0) d_getprotobyname_r=undef
15071 getprotobyname_r_proto=0
15072 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15073 * ) case "$getprotobyname_r_proto" in
15074 REENTRANT_PROTO*) ;;
15075 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15077 echo "Prototype: $try" ;;
15080 *) case "$usethreads" in
15081 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15083 d_getprotobyname_r=undef
15084 getprotobyname_r_proto=0
15088 *) getprotobyname_r_proto=0
15092 : see if getprotobynumber_r exists
15093 set getprotobynumber_r d_getprotobynumber_r
15095 case "$d_getprotobynumber_r" in
15097 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15098 case "$d_getprotobynumber_r_proto:$usethreads" in
15099 ":define") d_getprotobynumber_r_proto=define
15100 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15104 case "$d_getprotobynumber_r_proto" in
15106 case "$getprotobynumber_r_proto" in
15107 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15108 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15110 case "$getprotobynumber_r_proto" in
15111 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15112 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15114 case "$getprotobynumber_r_proto" in
15115 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15116 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15118 case "$getprotobynumber_r_proto" in
15119 ''|0) d_getprotobynumber_r=undef
15120 getprotobynumber_r_proto=0
15121 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15122 * ) case "$getprotobynumber_r_proto" in
15123 REENTRANT_PROTO*) ;;
15124 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15126 echo "Prototype: $try" ;;
15129 *) case "$usethreads" in
15130 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15132 d_getprotobynumber_r=undef
15133 getprotobynumber_r_proto=0
15137 *) getprotobynumber_r_proto=0
15141 : see if getprotoent_r exists
15142 set getprotoent_r d_getprotoent_r
15144 case "$d_getprotoent_r" in
15146 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15147 case "$d_getprotoent_r_proto:$usethreads" in
15148 ":define") d_getprotoent_r_proto=define
15149 set d_getprotoent_r_proto getprotoent_r $hdrs
15153 case "$d_getprotoent_r_proto" in
15155 case "$getprotoent_r_proto" in
15156 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15157 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15159 case "$getprotoent_r_proto" in
15160 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15161 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15163 case "$getprotoent_r_proto" in
15164 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15165 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15167 case "$getprotoent_r_proto" in
15168 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15169 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15171 case "$getprotoent_r_proto" in
15172 ''|0) d_getprotoent_r=undef
15173 getprotoent_r_proto=0
15174 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15175 * ) case "$getprotoent_r_proto" in
15176 REENTRANT_PROTO*) ;;
15177 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15179 echo "Prototype: $try" ;;
15182 *) case "$usethreads" in
15183 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15185 d_getprotoent_r=undef
15186 getprotoent_r_proto=0
15190 *) getprotoent_r_proto=0
15194 : see if prototypes for various getprotoxxx netdb.h functions are available
15196 set d_getprotoprotos getprotoent $i_netdb netdb.h
15199 : see if getprpwnam exists
15200 set getprpwnam d_getprpwnam
15203 : see if getpwent exists
15204 set getpwent d_getpwent
15207 : see if getpwent_r exists
15208 set getpwent_r d_getpwent_r
15210 case "$d_getpwent_r" in
15212 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15213 case "$d_getpwent_r_proto:$usethreads" in
15214 ":define") d_getpwent_r_proto=define
15215 set d_getpwent_r_proto getpwent_r $hdrs
15219 case "$d_getpwent_r_proto" in
15221 case "$getpwent_r_proto" in
15222 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15223 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15225 case "$getpwent_r_proto" in
15226 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15227 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15229 case "$getpwent_r_proto" in
15230 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15231 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15233 case "$getpwent_r_proto" in
15234 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15235 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15237 case "$getpwent_r_proto" in
15238 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15239 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15241 case "$getpwent_r_proto" in
15242 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15243 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15245 case "$getpwent_r_proto" in
15246 ''|0) d_getpwent_r=undef
15248 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15249 * ) case "$getpwent_r_proto" in
15250 REENTRANT_PROTO*) ;;
15251 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15253 echo "Prototype: $try" ;;
15256 *) case "$usethreads" in
15257 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15264 *) getpwent_r_proto=0
15268 : see if getpwnam_r exists
15269 set getpwnam_r d_getpwnam_r
15271 case "$d_getpwnam_r" in
15273 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15274 case "$d_getpwnam_r_proto:$usethreads" in
15275 ":define") d_getpwnam_r_proto=define
15276 set d_getpwnam_r_proto getpwnam_r $hdrs
15280 case "$d_getpwnam_r_proto" in
15282 case "$getpwnam_r_proto" in
15283 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15284 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15286 case "$getpwnam_r_proto" in
15287 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15288 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15290 case "$getpwnam_r_proto" in
15291 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15292 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15294 case "$getpwnam_r_proto" in
15295 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15296 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15298 case "$getpwnam_r_proto" in
15299 ''|0) d_getpwnam_r=undef
15301 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15302 * ) case "$getpwnam_r_proto" in
15303 REENTRANT_PROTO*) ;;
15304 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15306 echo "Prototype: $try" ;;
15309 *) case "$usethreads" in
15310 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15317 *) getpwnam_r_proto=0
15321 : see if getpwuid_r exists
15322 set getpwuid_r d_getpwuid_r
15324 case "$d_getpwuid_r" in
15326 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15327 case "$d_getpwuid_r_proto:$usethreads" in
15328 ":define") d_getpwuid_r_proto=define
15329 set d_getpwuid_r_proto getpwuid_r $hdrs
15333 case "$d_getpwuid_r_proto" in
15335 case "$getpwuid_r_proto" in
15336 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15337 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15339 case "$getpwuid_r_proto" in
15340 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15341 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15343 case "$getpwuid_r_proto" in
15344 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15345 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15347 case "$getpwuid_r_proto" in
15348 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15349 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15351 case "$getpwuid_r_proto" in
15352 ''|0) d_getpwuid_r=undef
15354 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15355 * ) case "$getpwuid_r_proto" in
15356 REENTRANT_PROTO*) ;;
15357 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15359 echo "Prototype: $try" ;;
15362 *) case "$usethreads" in
15363 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15370 *) getpwuid_r_proto=0
15374 : Optional checks for getsbyname and getsbyport
15376 : see if getservbyname exists
15377 set getservbyname d_getsbyname
15380 : see if getservbyport exists
15381 set getservbyport d_getsbyport
15384 : see if getservent exists
15385 set getservent d_getsent
15388 : see if getservbyname_r exists
15389 set getservbyname_r d_getservbyname_r
15391 case "$d_getservbyname_r" in
15393 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15394 case "$d_getservbyname_r_proto:$usethreads" in
15395 ":define") d_getservbyname_r_proto=define
15396 set d_getservbyname_r_proto getservbyname_r $hdrs
15400 case "$d_getservbyname_r_proto" in
15402 case "$getservbyname_r_proto" in
15403 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15404 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15406 case "$getservbyname_r_proto" in
15407 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15408 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15410 case "$getservbyname_r_proto" in
15411 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15412 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15414 case "$getservbyname_r_proto" in
15415 ''|0) d_getservbyname_r=undef
15416 getservbyname_r_proto=0
15417 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15418 * ) case "$getservbyname_r_proto" in
15419 REENTRANT_PROTO*) ;;
15420 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15422 echo "Prototype: $try" ;;
15425 *) case "$usethreads" in
15426 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15428 d_getservbyname_r=undef
15429 getservbyname_r_proto=0
15433 *) getservbyname_r_proto=0
15437 : see if getservbyport_r exists
15438 set getservbyport_r d_getservbyport_r
15440 case "$d_getservbyport_r" in
15442 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15443 case "$d_getservbyport_r_proto:$usethreads" in
15444 ":define") d_getservbyport_r_proto=define
15445 set d_getservbyport_r_proto getservbyport_r $hdrs
15449 case "$d_getservbyport_r_proto" in
15451 case "$getservbyport_r_proto" in
15452 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15453 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15455 case "$getservbyport_r_proto" in
15456 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15457 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15459 case "$getservbyport_r_proto" in
15460 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15461 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15463 case "$getservbyport_r_proto" in
15464 ''|0) d_getservbyport_r=undef
15465 getservbyport_r_proto=0
15466 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15467 * ) case "$getservbyport_r_proto" in
15468 REENTRANT_PROTO*) ;;
15469 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15471 echo "Prototype: $try" ;;
15474 *) case "$usethreads" in
15475 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15477 d_getservbyport_r=undef
15478 getservbyport_r_proto=0
15482 *) getservbyport_r_proto=0
15486 : see if getservent_r exists
15487 set getservent_r d_getservent_r
15489 case "$d_getservent_r" in
15491 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15492 case "$d_getservent_r_proto:$usethreads" in
15493 ":define") d_getservent_r_proto=define
15494 set d_getservent_r_proto getservent_r $hdrs
15498 case "$d_getservent_r_proto" in
15500 case "$getservent_r_proto" in
15501 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15502 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15504 case "$getservent_r_proto" in
15505 ''|0) try='int getservent_r(struct servent*, char*, int);'
15506 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15508 case "$getservent_r_proto" in
15509 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15510 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15512 case "$getservent_r_proto" in
15513 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15514 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15516 case "$getservent_r_proto" in
15517 ''|0) d_getservent_r=undef
15518 getservent_r_proto=0
15519 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15520 * ) case "$getservent_r_proto" in
15521 REENTRANT_PROTO*) ;;
15522 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15524 echo "Prototype: $try" ;;
15527 *) case "$usethreads" in
15528 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15530 d_getservent_r=undef
15531 getservent_r_proto=0
15535 *) getservent_r_proto=0
15539 : see if prototypes for various getservxxx netdb.h functions are available
15541 set d_getservprotos getservent $i_netdb netdb.h
15544 : see if getspnam exists
15545 set getspnam d_getspnam
15548 : see if this is a shadow.h system
15549 set shadow.h i_shadow
15552 : see if getspnam_r exists
15553 set getspnam_r d_getspnam_r
15555 case "$d_getspnam_r" in
15557 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15558 case "$d_getspnam_r_proto:$usethreads" in
15559 ":define") d_getspnam_r_proto=define
15560 set d_getspnam_r_proto getspnam_r $hdrs
15564 case "$d_getspnam_r_proto" in
15566 case "$getspnam_r_proto" in
15567 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15568 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15570 case "$getspnam_r_proto" in
15571 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15572 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15574 case "$getspnam_r_proto" in
15575 ''|0) d_getspnam_r=undef
15577 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15578 * ) case "$getspnam_r_proto" in
15579 REENTRANT_PROTO*) ;;
15580 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15582 echo "Prototype: $try" ;;
15585 *) case "$usethreads" in
15586 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15593 *) getspnam_r_proto=0
15597 : see if gettimeofday or ftime exists
15598 set gettimeofday d_gettimeod
15600 case "$d_gettimeod" in
15606 val="$undef"; set d_ftime; eval $setvar
15609 case "$d_gettimeod$d_ftime" in
15612 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15616 : see if gmtime_r exists
15617 set gmtime_r d_gmtime_r
15619 case "$d_gmtime_r" in
15621 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15622 case "$d_gmtime_r_proto:$usethreads" in
15623 ":define") d_gmtime_r_proto=define
15624 set d_gmtime_r_proto gmtime_r $hdrs
15628 case "$d_gmtime_r_proto" in
15630 case "$gmtime_r_proto" in
15631 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15632 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15634 case "$gmtime_r_proto" in
15635 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15636 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15638 case "$gmtime_r_proto" in
15639 ''|0) d_gmtime_r=undef
15641 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15642 * ) case "$gmtime_r_proto" in
15643 REENTRANT_PROTO*) ;;
15644 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15646 echo "Prototype: $try" ;;
15649 *) case "$usethreads" in
15650 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15657 *) gmtime_r_proto=0
15661 : see if hasmntopt exists
15662 set hasmntopt d_hasmntopt
15665 : see if this is a netinet/in.h or sys/in.h system
15666 set netinet/in.h i_niin sys/in.h i_sysin
15669 : see if arpa/inet.h has to be included
15670 set arpa/inet.h i_arpainet
15673 : see if htonl --and friends-- exists
15678 : Maybe they are macros.
15681 $cat >htonl.c <<EOM
15683 #include <sys/types.h>
15684 #$i_niin I_NETINET_IN
15686 #$i_arpainet I_ARPA_INET
15687 #ifdef I_NETINET_IN
15688 #include <netinet/in.h>
15691 #include <sys/in.h>
15694 #include <arpa/inet.h>
15697 printf("Defined as a macro.");
15700 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15701 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15703 echo "But it seems to be defined as a macro." >&4
15711 : see if hypot exists
15715 : see if ilogb exists
15719 : see if ilogbl exists
15720 set ilogbl d_ilogbl
15723 : check whether inet_aton exists
15724 set inet_aton d_inetaton
15727 : see if inet_ntop exists
15728 set inet_ntop d_inetntop
15731 : see if inet_pton exists
15732 set inet_pton d_inetpton
15737 $cat >isascii.c <<EOCP
15740 #$i_stdlib I_STDLIB
15742 #include <stdlib.h>
15753 if eval $compile; then
15754 echo "isascii() found." >&4
15757 echo "isascii() NOT found." >&4
15766 $cat >isblank.c <<'EOCP'
15777 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15778 echo "isblank() found." >&4
15781 echo "isblank() NOT found." >&4
15788 : check for isfinite
15789 echo "Checking to see if you have isfinite..." >&4
15792 int main() { return isfinite(0.0); }
15795 if eval $compile; then
15797 echo "You have isfinite."
15800 echo "You do not have isfinite."
15806 : see if isfinitel exists
15807 set isfinitel d_isfinitel
15811 echo "Checking to see if you have isinf..." >&4
15814 int main() { return isinf(0.0); }
15817 if eval $compile; then
15819 echo "You have isinf."
15822 echo "You do not have isinf."
15828 : see if isinfl exists
15829 set isinfl d_isinfl
15833 echo "Checking to see if you have isless..." >&4
15836 int main() { return isless(2.0, 1.0); }
15839 if eval $compile; then
15841 echo "You have isless."
15844 echo "You do not have isless."
15851 echo "Checking to see if you have isnan..." >&4
15854 int main() { return isnan(0.0); }
15857 if eval $compile; then
15859 echo "You have isnan."
15862 echo "You do not have isnan."
15868 : see if isnanl exists
15869 set isnanl d_isnanl
15872 : check for isnormal
15873 echo "Checking to see if you have isnormal..." >&4
15876 int main() { return isnormal(0.0); }
15879 if eval $compile; then
15881 echo "You have isnormal."
15884 echo "You do not have isnormal."
15894 : see if j0l exists
15898 : see if killpg exists
15899 set killpg d_killpg
15902 : see if localeconv exists
15903 set localeconv d_locconv
15906 : see if libc has the POSIX.1-2008 currency locale rules
15907 case "$d_locconv:$d_lc_monetary_2008" in
15910 #include <locale.h>
15912 struct lconv *lc = localeconv();
15913 char int_p_cs_precedes = lc->int_p_cs_precedes;
15918 if eval $compile; then
15919 d_lc_monetary_2008="$define"
15921 d_lc_monetary_2008="$undef"
15927 : see if lchown exists
15929 $cat > try.c <<EOCP
15932 #include <stdlib.h>
15933 #$i_unistd I_UNISTD
15935 # include <unistd.h>
15937 int main(int argc, char *argv[])
15939 if (lchown("./try.c", -1, getgid()) == -1) {
15940 exit(EXIT_FAILURE);
15942 exit(EXIT_SUCCESS);
15946 if eval $compile && ./try; then
15947 $echo "lchown() found." >&4
15950 $echo "lchown() NOT found." >&4
15957 : See if number of significant digits in a double precision number is known
15959 $cat >ldbl_dig.c <<EOM
15960 #include <limits.h>
15963 printf("Contains LDBL_DIG");
15966 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15967 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15968 echo "LDBL_DIG found." >&4
15971 echo "LDBL_DIG NOT found." >&4
15978 : see if lgamma exists
15979 set lgamma d_lgamma
15982 : see if lgamma_r exists
15983 set lgamma_r d_lgamma_r
15986 : check to see if math.h defines _LIB_VERSION
15987 d_libm_lib_version="$undef"
15989 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15991 #include <unistd.h>
15993 int main (int argc, char *argv[])
15995 printf ("%d\n", _LIB_VERSION);
16000 if eval $compile; then
16002 echo "Yes, it does ($foo)" >&4
16003 d_libm_lib_version="$define"
16005 echo "No, it does not (probably harmless)" >&4
16009 : see if link exists
16013 : see if llrint exists
16014 set llrint d_llrint
16017 : see if llrintl exists
16018 set llrintl d_llrintl
16021 : see if llround exists
16022 set llround d_llround
16025 : see if llroundl exists
16026 set llroundl d_llroundl
16029 : see if localeconv_l exists
16030 set localeconv_l d_localeconv_l
16033 : see if localtime_r exists
16034 set localtime_r d_localtime_r
16036 case "$d_localtime_r" in
16038 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16039 case "$d_localtime_r_proto:$usethreads" in
16040 ":define") d_localtime_r_proto=define
16041 set d_localtime_r_proto localtime_r $hdrs
16045 case "$d_localtime_r_proto" in
16047 case "$localtime_r_proto" in
16048 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16049 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16051 case "$localtime_r_proto" in
16052 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16053 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16055 case "$localtime_r_proto" in
16056 ''|0) d_localtime_r=undef
16057 localtime_r_proto=0
16058 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16059 * ) case "$localtime_r_proto" in
16060 REENTRANT_PROTO*) ;;
16061 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16063 echo "Prototype: $try" ;;
16066 *) case "$usethreads" in
16067 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16069 d_localtime_r=undef
16070 localtime_r_proto=0
16074 *) localtime_r_proto=0
16078 : see if localtime_r calls tzset
16079 case "$localtime_r_proto" in
16082 /* Does our libc's localtime_r call tzset ?
16083 * return 0 if so, 1 otherwise.
16085 #$i_systypes I_SYS_TYPES
16086 #$i_unistd I_UNISTD
16088 #$i_stdlib I_STDLIB
16089 #$i_malloc I_MALLOC
16091 # include <sys/types.h>
16094 # include <unistd.h>
16100 #include <stdlib.h>
16102 #include <string.h>
16104 # include <malloc.h>
16108 time_t t = time(0L);
16109 char w_tz[]="TZ" "=GMT+5",
16110 e_tz[]="TZ" "=GMT-5",
16111 *tz_e = (char*)malloc(16),
16112 *tz_w = (char*)malloc(16);
16113 struct tm tm_e, tm_w;
16114 memset(&tm_e,'\0',sizeof(struct tm));
16115 memset(&tm_w,'\0',sizeof(struct tm));
16120 localtime_r(&t, &tm_e);
16123 localtime_r(&t, &tm_w);
16125 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16131 if eval $compile; then
16132 if $run ./try; then
16133 d_localtime_r_needs_tzset=undef;
16135 d_localtime_r_needs_tzset=define;
16138 d_localtime_r_needs_tzset=undef;
16142 d_localtime_r_needs_tzset=undef;
16147 : see if lockf exists
16151 : see if log1p exists
16155 : see if log2 exists
16159 : see if logb exists
16163 : see if lrint exists
16167 : see if lrintl exists
16168 set lrintl d_lrintl
16171 : see if lround exists
16172 set lround d_lround
16175 : see if lroundl exists
16176 set lroundl d_lroundl
16179 : see if prototype for lseek is available
16181 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16184 : see if lstat exists
16188 : see if madvise exists
16189 set madvise d_madvise
16192 : see if malloc_size exists
16193 set malloc_size d_malloc_size
16196 : see if malloc_size_good exists
16197 set malloc_good_size d_malloc_good_size
16200 : see if malloc_usable_size exists
16201 set malloc_usable_size d_malloc_usable_size
16204 : see if mblen exists
16208 : see if mbrlen exists
16209 set mbrlen d_mbrlen
16212 : see if mbrtowc exists
16213 set mbrtowc d_mbrtowc
16216 : see if mbstowcs exists
16217 set mbstowcs d_mbstowcs
16220 : see if mbtowc exists
16221 set mbtowc d_mbtowc
16224 : see if memmem exists
16225 : We need both a prototype in string.h and the symbol in libc.
16228 xx1="#$d_gnulibc HAS_GNULIBC"
16229 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16230 xx3='# define _GNU_SOURCE'
16232 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16234 case "$d_memmem_proto" in
16235 define) # see if memmem exists
16236 set memmem d_memmem
16245 : see if memrchr exists
16246 : We need both a prototype in string.h and the symbol in libc.
16249 xx1="#$d_gnulibc HAS_GNULIBC"
16250 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16251 xx3='# define _GNU_SOURCE'
16253 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16255 case "$d_memrchr_proto" in
16256 define) # see if memrchr exists
16257 set memrchr d_memrchr
16266 : see if mkdir exists
16270 : see if mkdtemp exists
16271 set mkdtemp d_mkdtemp
16274 : see if mkfifo exists
16275 set mkfifo d_mkfifo
16278 : see if mkostemp exists
16279 set mkostemp d_mkostemp
16282 : see if mkstemp exists
16283 set mkstemp d_mkstemp
16286 : see if mkstemps exists
16287 set mkstemps d_mkstemps
16290 : see if mktime exists
16291 set mktime d_mktime
16294 : see if sys/mman.h has to be included
16295 set sys/mman.h i_sysmman
16298 : see if mmap exists
16301 : see what shmat returns
16302 : default to something harmless
16304 case "$i_sysmman$d_mmap" in
16306 $cat >mmap.c <<'END'
16307 #include <sys/mman.h>
16310 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16315 echo "and it returns ($mmaptype)." >&4
16319 : see if sqrtl exists
16323 : see if scalbnl exists
16324 set scalbnl d_scalbnl
16327 : see if truncl exists
16328 set truncl d_truncl
16331 : see if modfl exists
16335 : see if prototype for modfl is available
16337 set d_modflproto modfl define math.h
16340 if $test "$uselongdouble" = "$define"; then
16342 if $test "$d_sqrtl" != "$define"; then
16343 message="$message sqrtl"
16345 if $test "$d_modfl" != "$define"; then
16346 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16347 echo "You have both truncl and copysignl, so I can emulate modfl."
16349 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16350 echo "You have both aintl and copysignl, so I can emulate modfl."
16352 message="$message modfl"
16356 if $test "$d_frexpl" != "$define"; then
16357 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16358 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16360 message="$message frexpl"
16363 if $test "$d_ldexpl" != "$define"; then
16364 message="$message ldexpl"
16367 if $test "$message" != ""; then
16370 *** You requested the use of long doubles but you do not seem to have
16371 *** the following mathematical functions needed for long double support:
16373 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16374 *** Cannot continue, aborting.
16382 : see if mprotect exists
16383 set mprotect d_mprotect
16386 : see if msgctl exists
16387 set msgctl d_msgctl
16390 : see if msgget exists
16391 set msgget d_msgget
16394 : see if msgsnd exists
16395 set msgsnd d_msgsnd
16398 : see if msgrcv exists
16399 set msgrcv d_msgrcv
16402 : see how much of the 'msg*(2)' library is present.
16405 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16406 *"$undef"*) h_msg=false;;
16410 case "`ipcs 2>&1`" in
16411 "SVID messages"*"not configured"*)
16412 echo "Your $osname does not have the msg*(2) configured." >&4
16415 set msgctl d_msgctl
16417 set msgget d_msgget
16419 set msgsnd d_msgsnd
16421 set msgrcv d_msgrcv
16427 : we could also check for sys/ipc.h ...
16428 if $h_msg && $test `./findhdr sys/msg.h`; then
16429 echo "You have the full msg*(2) library." >&4
16432 echo "You don't have the full msg*(2) library." >&4
16438 : Check for msghdr_s
16440 echo "Checking to see if your system supports struct msghdr..." >&4
16441 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16443 case "$d_msghdr_s" in
16444 "$define") echo "Yes, it does." ;;
16445 *) echo "No, it doesn't." ;;
16448 : see if msync exists
16452 : see if munmap exists
16453 set munmap d_munmap
16456 : see if nan exists
16460 : see if nanosleep exists
16461 set nanosleep d_nanosleep
16464 : see if nearbyint exists
16465 set nearbyint d_nearbyint
16468 : see if nextafter exists
16469 set nextafter d_nextafter
16472 : see if nexttoward exists
16473 set nexttoward d_nexttoward
16476 : see if nice exists
16480 : see if this is a langinfo.h system
16481 set langinfo.h i_langinfo
16484 : see if nl_langinfo exists
16485 set nl_langinfo d_nl_langinfo
16488 : see if this is a quadmath.h system
16489 set quadmath.h i_quadmath
16492 : Check basic sizes
16494 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16496 case "$use64bitint:$d_quad:$quadtype" in
16499 uvtype="$uquadtype"
16504 uvtype="unsigned long"
16510 case "$uselongdouble:$d_longdbl" in
16512 nvtype="long double"
16513 nvsize=$longdblsize
16520 case "$usequadmath:$i_quadmath" in
16522 nvtype="__float128"
16528 *** You requested the use of the quadmath library, but you
16529 *** do not seem to have the quadmath library installed.
16530 *** Cannot continue, aborting.
16536 define:*) $cat <<EOM >&4
16538 *** You requested the use of the quadmath library, but you
16539 *** do not seem to have the required header, <quadmath.h>.
16541 case "$gccversion" in
16544 *** Your gcc looks a bit old:
16550 *** You are not running a gcc.
16555 *** For the quadmath library you need at least gcc 4.6.
16556 *** Cannot continue, aborting.
16562 $echo "(IV will be "$ivtype", $ivsize bytes)"
16563 $echo "(UV will be "$uvtype", $uvsize bytes)"
16564 $echo "(NV will be "$nvtype", $nvsize bytes)"
16567 #$i_inttypes I_INTTYPES
16569 #include <inttypes.h>
16574 int8_t i = INT8_MAX;
16575 uint8_t u = UINT8_MAX;
16576 printf("int8_t\n");
16579 int16_t i = INT16_MAX;
16580 uint16_t u = UINT16_MAX;
16581 printf("int16_t\n");
16584 int32_t i = INT32_MAX;
16585 uint32_t u = UINT32_MAX;
16586 printf("int32_t\n");
16591 i8type="signed char"
16592 u8type="unsigned char"
16597 '') case "$shortsize" in
16599 u16type="unsigned short"
16607 '') set try -DINT16
16608 if eval $compile; then
16609 case "`$run ./try`" in
16621 '') if $test $shortsize -ge 2; then
16623 u16type="unsigned short"
16631 '') case "$longsize" in
16633 u32type="unsigned long"
16637 *) case "$intsize" in
16639 u32type="unsigned int"
16649 '') set try -DINT32
16650 if eval $compile; then
16651 case "`$run ./try`" in
16663 '') if $test $intsize -ge 4; then
16665 u32type="unsigned int"
16673 '') case "$d_quad:$quadtype" in
16675 i64type="$quadtype"
16676 u64type="$uquadtype"
16684 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16687 #$i_stdlib I_STDLIB
16689 #include <stdlib.h>
16691 #include <sys/types.h>
16692 #include <signal.h>
16694 /* volatile so that the compiler has to store it out to memory */
16695 volatile int bletched = 0;
16696 $signal_t blech(int s) { bletched = 1; }
16701 int n = 8 * $uvsize;
16704 signal(SIGFPE, blech);
16707 for (i = 0; i < n; i++) {
16708 u = u << 1 | ($uvtype)1;
16710 if (($uvtype)d != u)
16714 d = ($nvtype)(u - 1);
16715 if (($uvtype)d != (u - 1))
16722 printf("%d\n", ((i == n) ? -n : i));
16728 d_nv_preserves_uv="$undef"
16729 if eval $compile; then
16730 nv_preserves_uv_bits="`$run ./try`"
16732 case "$nv_preserves_uv_bits" in
16734 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16735 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16736 d_nv_preserves_uv="$define"
16738 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16739 d_nv_preserves_uv="$undef" ;;
16740 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16741 nv_preserves_uv_bits="0" ;;
16745 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16749 typedef $nvtype NV;
16756 while(count < 256) {
16757 /* volatile so that the compiler has to store it out to memory */
16758 volatile NV up = value + 1.0;
16759 volatile NV negated = -value;
16760 volatile NV down = negated - 1.0;
16761 volatile NV got_up = up - value;
16762 int up_good = got_up == 1.0;
16763 int got_down = down - negated;
16764 int down_good = got_down == -1.0;
16766 if (down_good != up_good) {
16768 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16769 up_good, (double) got_up, down_good, (double) got_down,
16770 count, (double) value);
16777 fputs("256.0", stdout);
16780 fputs("2.0", stdout);
16786 fputs("*", stdout);
16792 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16793 count, (double) value);
16799 nv_overflows_integers_at='0'
16800 if eval $compile; then
16806 The largest integer your NVs can preserve is equal to $xxx
16808 nv_overflows_integers_at="$xxx"
16811 Cannot determine the largest integer value your NVs can hold, unexpected output
16818 Cannot determine the largest integer value your NVs can hold
16825 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16828 #$i_stdlib I_STDLIB
16830 #include <stdlib.h>
16832 #include <string.h>
16833 #include <sys/types.h>
16834 #include <signal.h>
16836 /* volatile so that the compiler has to store it out to memory */
16837 volatile int bletched = 0;
16838 $signal_t blech(int s) { bletched = 1; }
16841 int checkit($nvtype d, const char *where) {
16843 unsigned char *p = (unsigned char *)v;
16844 unsigned char *end = p + sizeof(d);
16853 p = (unsigned char *)v;
16854 printf("No - %s: 0x", where);
16856 printf ("%02X", *p++);
16861 int main(int argc, char **argv) {
16864 fail += checkit(d, "0.0");
16866 /* The compiler shouldn't be assuming that bletched is 0 */
16869 fail += checkit(d, "bleched");
16872 signal(SIGFPE, blech);
16875 /* Paranoia - the compiler should have no way of knowing that ANSI says
16876 that argv[argc] will always be NULL. Actually, if it did assume this it
16877 would be buggy, as this is C and main() can be called from elsewhere in
16879 d = argv[argc] ? 1 : 0;
16882 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16885 fail += checkit(d, "ternary");
16887 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16890 printf("No - memset doesn't give 0.0\n");
16891 /* This might just blow up: */
16892 printf("(gives %g)\n", d);
16898 printf("No - something bleched\n");
16903 printf("No - %d fail(s)\n", fail);
16912 d_nv_zero_is_allbits_zero="$undef"
16913 if eval $compile; then
16919 0.0 is represented as all bits zero in memory
16921 d_nv_zero_is_allbits_zero="$define"
16924 0.0 is not represented as all bits zero in memory
16926 d_nv_zero_is_allbits_zero="$undef"
16931 0.0 is not represented as all bits zero in memory
16933 d_nv_zero_is_allbits_zero="$undef"
16939 : check for off64_t
16941 echo "Checking to see if you have off64_t..." >&4
16943 #include <sys/types.h>
16944 #include <unistd.h>
16945 int main() { off64_t x = 7; }
16948 if eval $compile; then
16950 echo "You have off64_t."
16953 echo "You do not have off64_t."
16954 case "$lseeksize" in
16955 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16962 : how to create joinable pthreads
16963 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16965 echo "Checking what constant to use for creating joinable pthreads..." >&4
16966 $cat >try.c <<'EOCP'
16967 #include <pthread.h>
16969 int detachstate = JOINABLE;
16972 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16973 if eval $compile; then
16974 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16975 val="$undef" # Yes, undef.
16976 set d_old_pthread_create_joinable
16979 set old_pthread_create_joinable
16982 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16983 if eval $compile; then
16984 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16986 set d_old_pthread_create_joinable
16988 val=PTHREAD_CREATE_UNDETACHED
16989 set old_pthread_create_joinable
16992 set try -DJOINABLE=__UNDETACHED
16993 if eval $compile; then
16994 echo "You seem to use __UNDETACHED." >&4
16996 set d_old_pthread_create_joinable
16999 set old_pthread_create_joinable
17002 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17004 set d_old_pthread_create_joinable
17007 set old_pthread_create_joinable
17014 d_old_pthread_create_joinable="$undef"
17015 old_pthread_create_joinable=""
17018 : see if pause exists
17022 : see if pipe2 exists
17026 : see if poll exists
17030 : see if prctl exists
17034 : see if prctl supports PR_SET_NAME
17035 d_prctl_set_name=$undef
17040 #include <unistd.h>
17042 #include <sys/prctl.h>
17044 int main (int argc, char *argv[])
17046 return (prctl (PR_SET_NAME, "Test"));
17050 if eval $compile_ok && $run ./try; then
17051 echo "Your prctl (PR_SET_NAME, ...) works"
17052 d_prctl_set_name=$define
17058 : see if readlink exists
17059 set readlink d_readlink
17062 : Check if there is a /proc symlink to the abs path of
17063 : the executing program. We will honor hints of d_procselfexe=$undef
17064 : or procselfexe being non-empty, otherwise will try to determine both
17065 : if we have readlink.
17066 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17067 : referenced, and AmigaOS does not have a proc filesystem anyway.
17070 if $test "X$d_procselfexe" = Xundef; then
17072 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17074 elif $test "X$d_readlink" = Xdefine; then
17075 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17076 : and it feels more tidy to avoid an extra level of symlink
17077 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17078 while test $# -gt 0; do
17081 if $issymlink $try; then
17082 $ls -l $try > reflect
17083 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17084 echo "You have $type-like $try."
17085 procselfexe='"'$try'"'
17087 : This will break out of the loop
17097 : backward compatibility for d_hvfork
17098 if test X$d_hvfork != X; then
17099 d_vfork="$d_hvfork"
17102 : see if there is a vfork
17107 d_pseudofork=$undef
17109 : Ok, but do we want to use it. vfork is reportedly unreliable in
17110 : perl on Solaris 2.x, and probably elsewhere.
17114 case "$usevfork" in
17120 Perl can only use a vfork() that doesn't suffer from strict
17121 restrictions on calling functions or modifying global data in
17122 the child. For example, glibc-2.1 contains such a vfork()
17123 that is unsuitable. If your system provides a proper fork()
17124 call, chances are that you do NOT want perl to use vfork().
17127 rp="Do you still want to use vfork()?"
17132 echo "Ok, we won't use vfork()."
17141 $define) usevfork='true';;
17142 *) usevfork='false';;
17145 : see whether the pthread_atfork exists
17147 #include <pthread.h>
17150 #ifdef PTHREAD_ATFORK
17151 pthread_atfork(NULL,NULL,NULL);
17156 : see if pthread_atfork exists
17157 set try -DPTHREAD_ATFORK
17158 if eval $compile; then
17163 case "$usethreads" in
17166 $define) echo 'pthread_atfork found.' >&4 ;;
17167 *) echo 'pthread_atfork NOT found.' >&4 ;;
17170 set d_pthread_atfork
17173 : see if pthread_attr_setscope exists
17174 set pthread_attr_setscope d_pthread_attr_setscope
17177 : see whether the various POSIXish _yields exist
17179 #include <pthread.h>
17185 #ifdef PTHREAD_YIELD
17188 #ifdef PTHREAD_YIELD_NULL
17189 pthread_yield(NULL);
17195 : see if sched_yield exists
17196 set try -DSCHED_YIELD
17197 if eval $compile; then
17199 sched_yield='sched_yield()'
17203 case "$usethreads" in
17206 $define) echo 'sched_yield() found.' >&4 ;;
17207 *) echo 'sched_yield() NOT found.' >&4 ;;
17213 : see if pthread_yield exists
17214 set try -DPTHREAD_YIELD
17215 if eval $compile; then
17217 case "$sched_yield" in
17218 '') sched_yield='pthread_yield()' ;;
17221 set try -DPTHREAD_YIELD_NULL
17222 if eval $compile; then
17224 case "$sched_yield" in
17225 '') sched_yield='pthread_yield(NULL)' ;;
17231 case "$usethreads" in
17234 $define) echo 'pthread_yield() found.' >&4 ;;
17235 *) echo 'pthread_yield() NOT found.' >&4 ;;
17239 set d_pthread_yield
17241 case "$sched_yield" in
17242 '') sched_yield=undef ;;
17246 : check for ptrdiff_t
17248 echo "Checking to see if you have ptrdiff_t..." >&4
17250 #include <stddef.h>
17251 int main() { ptrdiff_t x = 7; }
17254 if eval $compile; then
17256 echo "You have ptrdiff_t."
17259 echo "You do not have ptrdiff_t."
17265 : see if random_r exists
17266 set random_r d_random_r
17268 case "$d_random_r" in
17270 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17271 case "$d_random_r_proto:$usethreads" in
17272 ":define") d_random_r_proto=define
17273 set d_random_r_proto random_r $hdrs
17277 case "$d_random_r_proto" in
17279 case "$random_r_proto" in
17280 ''|0) try='int random_r(int*, struct random_data*);'
17281 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17283 case "$random_r_proto" in
17284 ''|0) try='int random_r(long*, struct random_data*);'
17285 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17287 case "$random_r_proto" in
17288 ''|0) try='int random_r(struct random_data*, int32_t*);'
17289 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17291 case "$random_r_proto" in
17292 ''|0) d_random_r=undef
17294 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17295 * ) case "$random_r_proto" in
17296 REENTRANT_PROTO*) ;;
17297 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17299 echo "Prototype: $try" ;;
17302 *) case "$usethreads" in
17303 define) echo "random_r has no prototype, not using it." >&4 ;;
17310 *) random_r_proto=0
17314 : see if readdir and friends exist
17315 set readdir d_readdir
17317 set seekdir d_seekdir
17319 set telldir d_telldir
17321 set rewinddir d_rewinddir
17324 : see if readdir64_r exists
17325 set readdir64_r d_readdir64_r
17327 case "$d_readdir64_r" in
17329 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17330 case "$d_readdir64_r_proto:$usethreads" in
17331 ":define") d_readdir64_r_proto=define
17332 set d_readdir64_r_proto readdir64_r $hdrs
17336 case "$d_readdir64_r_proto" in
17338 case "$readdir64_r_proto" in
17339 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17340 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17342 case "$readdir64_r_proto" in
17343 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17344 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17346 case "$readdir64_r_proto" in
17347 ''|0) d_readdir64_r=undef
17348 readdir64_r_proto=0
17349 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17350 * ) case "$readdir64_r_proto" in
17351 REENTRANT_PROTO*) ;;
17352 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17354 echo "Prototype: $try" ;;
17357 *) case "$usethreads" in
17358 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17360 d_readdir64_r=undef
17361 readdir64_r_proto=0
17365 *) readdir64_r_proto=0
17369 : see if readdir_r exists
17370 set readdir_r d_readdir_r
17372 case "$d_readdir_r" in
17374 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17375 case "$d_readdir_r_proto:$usethreads" in
17376 ":define") d_readdir_r_proto=define
17377 set d_readdir_r_proto readdir_r $hdrs
17381 case "$d_readdir_r_proto" in
17383 case "$readdir_r_proto" in
17384 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17385 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17387 case "$readdir_r_proto" in
17388 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17389 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17391 case "$readdir_r_proto" in
17392 ''|0) d_readdir_r=undef
17394 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17395 * ) case "$readdir_r_proto" in
17396 REENTRANT_PROTO*) ;;
17397 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17399 echo "Prototype: $try" ;;
17402 *) case "$usethreads" in
17403 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17410 *) readdir_r_proto=0
17414 : see if readv exists
17418 : see if recvmsg exists
17419 set recvmsg d_recvmsg
17422 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17424 if set regcomp val -f d_regcomp; eval $csym; $val; then
17425 echo 'regcomp() found.' >&4
17426 d_regcomp="$define"
17429 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17430 echo 'regcmp() found.' >&4
17434 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17435 echo 're_comp() found, assuming re_exec() also exists.' >&4
17436 d_re_comp="$define"
17441 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17448 : see if remainder exists
17449 set remainder d_remainder
17452 : see if remquo exists
17453 set remquo d_remquo
17456 : see if rename exists
17457 set rename d_rename
17460 : see if rint exists
17464 : see if rmdir exists
17468 : see if round exists
17472 : see if prototype for sbrk is available
17474 set d_sbrkproto sbrk $i_unistd unistd.h
17477 : see if scalbn exists
17478 set scalbn d_scalbn
17481 : see if select exists
17482 set select d_select
17485 : see if semctl exists
17486 set semctl d_semctl
17489 : see if semget exists
17490 set semget d_semget
17493 : see if semop exists
17497 : see how much of the 'sem*(2)' library is present.
17500 case "$d_semctl$d_semget$d_semop" in
17501 *"$undef"*) h_sem=false;;
17505 case "`ipcs 2>&1`" in
17506 "SVID messages"*"not configured"*)
17507 echo "Your $osname does not have the sem*(2) configured." >&4
17510 set semctl d_semctl
17512 set semget d_semget
17520 : we could also check for sys/ipc.h ...
17521 if $h_sem && $test `./findhdr sys/sem.h`; then
17522 echo "You have the full sem*(2) library." >&4
17525 echo "You don't have the full sem*(2) library." >&4
17531 : see whether sys/sem.h defines union semun
17533 $cat > try.c <<'END'
17534 #include <sys/types.h>
17535 #include <sys/ipc.h>
17536 #include <sys/sem.h>
17537 int main () { union semun semun; semun.buf = 0; }
17540 if eval $compile; then
17541 echo "You have union semun in <sys/sem.h>." >&4
17544 echo "You do not have union semun in <sys/sem.h>." >&4
17551 : see how to do semctl IPC_STAT
17555 $cat > tryh.h <<END
17558 # define S_IRUSR S_IREAD
17559 # define S_IWUSR S_IWRITE
17560 # define S_IXUSR S_IEXEC
17562 # define S_IRUSR 0400
17563 # define S_IWUSR 0200
17564 # define S_IXUSR 0100
17566 # define S_IRGRP (S_IRUSR>>3)
17567 # define S_IWGRP (S_IWUSR>>3)
17568 # define S_IXGRP (S_IXUSR>>3)
17569 # define S_IROTH (S_IRUSR>>6)
17570 # define S_IWOTH (S_IWUSR>>6)
17571 # define S_IXOTH (S_IXUSR>>6)
17574 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17575 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17576 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17579 : see whether semctl IPC_STAT can use union semun
17580 case "$d_semctl_semun" in
17584 #include <sys/types.h>
17585 #include <sys/ipc.h>
17586 #include <sys/sem.h>
17587 #include <sys/stat.h>
17594 #$d_union_semun HAS_UNION_SEMUN
17597 #ifndef HAS_UNION_SEMUN
17600 struct semid_ds *buf;
17601 unsigned short *array;
17607 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17608 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17610 struct semid_ds argbuf;
17613 st = semctl(sem, 0, IPC_STAT, arg);
17617 # endif /* IPC_STAT */
17618 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17620 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17621 # endif /* IPC_RMID */
17622 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17624 #endif /* IPC_PRIVATE && ... */
17625 printf("semget failed: errno = %d\n", errno);
17630 if eval $compile; then
17633 semun) val="$define" ;;
17641 case "$d_semctl_semun" in
17643 echo "You can use union semun for semctl IPC_STAT." >&4
17646 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17651 : see whether semctl IPC_STAT can use struct semid_ds pointer
17652 case "$d_semctl_semid_ds" in
17655 $cat > try.c <<'END'
17656 #include <sys/types.h>
17657 #include <sys/ipc.h>
17658 #include <sys/sem.h>
17659 #include <sys/stat.h>
17668 #ifndef HAS_UNION_SEMUN
17671 struct semid_ds *buf;
17672 unsigned short *array;
17676 struct semid_ds argbuf;
17679 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17680 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17684 st = semctl(sem, 0, IPC_STAT, arg);
17686 printf("semid_ds\n");
17688 # endif /* IPC_STAT */
17689 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17691 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17692 # endif /* IPC_RMID */
17693 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17695 #endif /* IPC_PRIVATE && ... */
17696 printf("semget failed: errno = %d\n", errno);
17702 if eval $compile; then
17705 semid_ds) val="$define" ;;
17709 set d_semctl_semid_ds
17713 case "$d_semctl_semid_ds" in
17715 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17717 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17723 # We do not have the full sem*(2) library, so assume we can not
17729 set d_semctl_semid_ds
17735 : see if sendmsg exists
17736 set sendmsg d_sendmsg
17739 : see if setegid exists
17740 set setegid d_setegid
17743 : see if seteuid exists
17744 set seteuid d_seteuid
17747 : see if setgrent exists
17748 set setgrent d_setgrent
17751 : see if setgrent_r exists
17752 set setgrent_r d_setgrent_r
17754 case "$d_setgrent_r" in
17756 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17757 case "$d_setgrent_r_proto:$usethreads" in
17758 ":define") d_setgrent_r_proto=define
17759 set d_setgrent_r_proto setgrent_r $hdrs
17763 case "$d_setgrent_r_proto" in
17765 case "$setgrent_r_proto" in
17766 ''|0) try='int setgrent_r(FILE**);'
17767 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17769 case "$setgrent_r_proto" in
17770 ''|0) try='void setgrent_r(FILE**);'
17771 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17773 case "$setgrent_r_proto" in
17774 ''|0) d_setgrent_r=undef
17776 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17777 * ) case "$setgrent_r_proto" in
17778 REENTRANT_PROTO*) ;;
17779 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17781 echo "Prototype: $try" ;;
17784 *) case "$usethreads" in
17785 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17792 *) setgrent_r_proto=0
17796 : see if sethostent exists
17797 set sethostent d_sethent
17800 : see if sethostent_r exists
17801 set sethostent_r d_sethostent_r
17803 case "$d_sethostent_r" in
17805 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17806 case "$d_sethostent_r_proto:$usethreads" in
17807 ":define") d_sethostent_r_proto=define
17808 set d_sethostent_r_proto sethostent_r $hdrs
17812 case "$d_sethostent_r_proto" in
17814 case "$sethostent_r_proto" in
17815 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17816 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17818 case "$sethostent_r_proto" in
17819 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17820 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17822 case "$sethostent_r_proto" in
17823 ''|0) d_sethostent_r=undef
17824 sethostent_r_proto=0
17825 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17826 * ) case "$sethostent_r_proto" in
17827 REENTRANT_PROTO*) ;;
17828 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17830 echo "Prototype: $try" ;;
17833 *) case "$usethreads" in
17834 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17836 d_sethostent_r=undef
17837 sethostent_r_proto=0
17841 *) sethostent_r_proto=0
17845 : see if setitimer exists
17846 set setitimer d_setitimer
17849 : see if setlinebuf exists
17850 set setlinebuf d_setlinebuf
17853 : see if locale.h is available
17854 set locale.h i_locale
17857 : see if this system has wctype.h
17858 set wctype.h i_wctype
17861 : see if towupper exists
17862 set towupper d_towupper
17865 : check for setlocale function and behavior
17868 Checking to see if you have setlocale() and its behavior
17871 #include <stdlib.h>
17872 #include <string.h>
17873 #$i_locale I_LOCALE
17875 # include <locale.h>
17877 #$i_wctype I_WCTYPE
17879 # include <wctype.h>
17883 const char * invalid_name = "\a"; /* This is really invalid! */
17884 int accepts_any_locale_name = 0;
17885 int has_C_UTF8 = 0;
17886 unsigned char bad_setlocale = 255;
17888 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17889 * disabled. It's hard to imagine an instance where meaningful locale
17890 * handling could be done without LC_CTYPE */
17891 const char * name = setlocale(LC_CTYPE, "C");
17893 if (name == NULL || strcmp(name, "C") != 0) {
17894 exit(bad_setlocale);
17897 name = setlocale(LC_CTYPE, invalid_name);
17898 if (name != NULL) {
17900 /* Let it pass if it accepts the name but gives back one of the C
17902 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17903 accepts_any_locale_name = 1;
17907 name = setlocale(LC_CTYPE, "C.UTF-8");
17908 if (name != NULL) {
17909 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17911 #$d_towupper HAS_TOWUPPER
17912 #ifdef HAS_TOWUPPER
17914 /* We assume that if the machine doesn't have the C99 towupper, it
17915 * doesn't have C.UTF-8, even if we successfully changed locales to
17916 * include it. This seems safer even on platforms that didn't accept
17917 * the really invalid name */
17919 if (towupper(y_with_diaeresis) == 0x178) {
17929 /* Currently unused code to determine if LC_ALL with disparate values uses
17930 * category = value pairs or positional, and to determine the separator
17931 * between the categories. We could add code so that if the separator were
17932 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17933 * every possible ASCII separator would fit in the 5 bits available in the
17934 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17935 * positional, we probably would want to know the order of the categories.
17936 * Using a file between the C program and the shell script would really be
17937 * require to do that */
17940 unsigned char min_separator = ' ' - 1;
17941 unsigned char separator = min_separator;
17942 int uses_name_value_pair_names = 0;
17944 name = setlocale(LC_ALL, "C");
17945 if (name == NULL || strcmp(name, "C") != 0) {
17946 exit(bad_setlocale);
17952 name = setlocale(LC_CTYPE, "C.UTF-8");
17953 if (name == NULL) {
17954 exit(bad_setlocale);
17956 name = setlocale(LC_ALL, NULL);
17957 if (name == NULL) {
17958 exit(bad_setlocale);
17961 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17963 uses_name_value_pair_names = 1;
17965 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17968 separator = *(pos - 1);
17972 pos = strstr(name, "C.UTF-8");
17976 else if (pos == name) {
17977 separator = name[sizeof("C.UTF-8") - 1];
17980 separator = *(pos - 1);
17988 exit( 0 /* (separator - min_separator) << 3
17989 | uses_name_value_pair_names << 2
17992 | accepts_any_locale_name);
17997 if eval $compile; then
17998 echo "Your system has setlocale()..." >&4
18001 0) echo "and it seems sane" >&4
18002 d_setlocale="$define"
18003 d_setlocale_accepts_any_locale_name="$undef"
18004 d_has_C_UTF8="false"
18006 1) echo "and it seems sane, but accepts any locale name as valid" >&4
18007 d_setlocale="$define"
18008 d_setlocale_accepts_any_locale_name="$define"
18009 d_has_C_UTF8="false"
18011 2) echo "and it seems sane" >&4
18012 d_setlocale="$define"
18013 d_setlocale_accepts_any_locale_name="$undef"
18014 d_has_C_UTF8="true"
18016 3) echo "and it seems sane, but accepts any locale name as valid" >&4
18017 d_setlocale="$define"
18018 d_setlocale_accepts_any_locale_name="$define"
18019 d_has_C_UTF8="true"
18021 *) echo "but it doesn't seem to work, so we won't use it." >&4
18022 d_setlocale="$undef"
18023 d_setlocale_accepts_any_locale_name="$undef"
18024 d_has_C_UTF8="false"
18028 echo "your system does not have setlocale()" >&4
18029 d_setlocale="$undef"
18030 d_setlocale_accepts_any_locale_name="$undef"
18031 d_has_C_UTF8="false"
18035 : see if setlocale_r exists
18036 set setlocale_r d_setlocale_r
18038 case "$d_setlocale_r" in
18040 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18041 case "$d_setlocale_r_proto:$usethreads" in
18042 ":define") d_setlocale_r_proto=define
18043 set d_setlocale_r_proto setlocale_r $hdrs
18047 case "$d_setlocale_r_proto" in
18049 case "$setlocale_r_proto" in
18050 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18051 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18053 case "$setlocale_r_proto" in
18054 ''|0) d_setlocale_r=undef
18055 setlocale_r_proto=0
18056 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18057 * ) case "$setlocale_r_proto" in
18058 REENTRANT_PROTO*) ;;
18059 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18061 echo "Prototype: $try" ;;
18064 *) case "$usethreads" in
18065 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18067 d_setlocale_r=undef
18068 setlocale_r_proto=0
18072 *) setlocale_r_proto=0
18076 : see if setnetent exists
18077 set setnetent d_setnent
18080 : see if setnetent_r exists
18081 set setnetent_r d_setnetent_r
18083 case "$d_setnetent_r" in
18085 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18086 case "$d_setnetent_r_proto:$usethreads" in
18087 ":define") d_setnetent_r_proto=define
18088 set d_setnetent_r_proto setnetent_r $hdrs
18092 case "$d_setnetent_r_proto" in
18094 case "$setnetent_r_proto" in
18095 ''|0) try='int setnetent_r(int, struct netent_data*);'
18096 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18098 case "$setnetent_r_proto" in
18099 ''|0) try='void setnetent_r(int, struct netent_data*);'
18100 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18102 case "$setnetent_r_proto" in
18103 ''|0) d_setnetent_r=undef
18104 setnetent_r_proto=0
18105 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18106 * ) case "$setnetent_r_proto" in
18107 REENTRANT_PROTO*) ;;
18108 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18110 echo "Prototype: $try" ;;
18113 *) case "$usethreads" in
18114 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18116 d_setnetent_r=undef
18117 setnetent_r_proto=0
18121 *) setnetent_r_proto=0
18125 : see if setprotoent exists
18126 set setprotoent d_setpent
18129 : see if setpgid exists
18130 set setpgid d_setpgid
18133 : see if setpgrp2 exists
18134 set setpgrp2 d_setpgrp2
18137 : see if setpriority exists
18138 set setpriority d_setprior
18141 : see if setproctitle exists
18142 set setproctitle d_setproctitle
18145 : see if setprotoent_r exists
18146 set setprotoent_r d_setprotoent_r
18148 case "$d_setprotoent_r" in
18150 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18151 case "$d_setprotoent_r_proto:$usethreads" in
18152 ":define") d_setprotoent_r_proto=define
18153 set d_setprotoent_r_proto setprotoent_r $hdrs
18157 case "$d_setprotoent_r_proto" in
18159 case "$setprotoent_r_proto" in
18160 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18161 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18163 case "$setprotoent_r_proto" in
18164 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18165 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18167 case "$setprotoent_r_proto" in
18168 ''|0) d_setprotoent_r=undef
18169 setprotoent_r_proto=0
18170 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18171 * ) case "$setprotoent_r_proto" in
18172 REENTRANT_PROTO*) ;;
18173 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18175 echo "Prototype: $try" ;;
18178 *) case "$usethreads" in
18179 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18181 d_setprotoent_r=undef
18182 setprotoent_r_proto=0
18186 *) setprotoent_r_proto=0
18190 : see if setpwent exists
18191 set setpwent d_setpwent
18194 : see if setpwent_r exists
18195 set setpwent_r d_setpwent_r
18197 case "$d_setpwent_r" in
18199 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18200 case "$d_setpwent_r_proto:$usethreads" in
18201 ":define") d_setpwent_r_proto=define
18202 set d_setpwent_r_proto setpwent_r $hdrs
18206 case "$d_setpwent_r_proto" in
18208 case "$setpwent_r_proto" in
18209 ''|0) try='int setpwent_r(FILE**);'
18210 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18212 case "$setpwent_r_proto" in
18213 ''|0) try='void setpwent_r(FILE**);'
18214 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18216 case "$setpwent_r_proto" in
18217 ''|0) d_setpwent_r=undef
18219 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18220 * ) case "$setpwent_r_proto" in
18221 REENTRANT_PROTO*) ;;
18222 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18224 echo "Prototype: $try" ;;
18227 *) case "$usethreads" in
18228 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18235 *) setpwent_r_proto=0
18239 : see if setregid exists
18240 set setregid d_setregid
18242 set setresgid d_setresgid
18245 : see if setreuid exists
18246 set setreuid d_setreuid
18248 set setresuid d_setresuid
18251 : see if setrgid exists
18252 set setrgid d_setrgid
18255 : see if setruid exists
18256 set setruid d_setruid
18259 : see if setservent exists
18260 set setservent d_setsent
18263 : see if setservent_r exists
18264 set setservent_r d_setservent_r
18266 case "$d_setservent_r" in
18268 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18269 case "$d_setservent_r_proto:$usethreads" in
18270 ":define") d_setservent_r_proto=define
18271 set d_setservent_r_proto setservent_r $hdrs
18275 case "$d_setservent_r_proto" in
18277 case "$setservent_r_proto" in
18278 ''|0) try='int setservent_r(int, struct servent_data*);'
18279 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18281 case "$setservent_r_proto" in
18282 ''|0) try='void setservent_r(int, struct servent_data*);'
18283 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18285 case "$setservent_r_proto" in
18286 ''|0) d_setservent_r=undef
18287 setservent_r_proto=0
18288 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18289 * ) case "$setservent_r_proto" in
18290 REENTRANT_PROTO*) ;;
18291 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18293 echo "Prototype: $try" ;;
18296 *) case "$usethreads" in
18297 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18299 d_setservent_r=undef
18300 setservent_r_proto=0
18304 *) setservent_r_proto=0
18308 : see if setsid exists
18309 set setsid d_setsid
18312 : see if setvbuf exists
18313 set setvbuf d_setvbuf
18316 : see if shmctl exists
18317 set shmctl d_shmctl
18320 : see if shmget exists
18321 set shmget d_shmget
18324 : see if shmat exists
18327 : see what shmat returns
18330 $cat >shmat.c <<'END'
18331 #include <sys/shm.h>
18334 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18339 echo "and it returns ($shmattype)." >&4
18340 : see if a prototype for shmat is available
18341 xxx=`./findhdr sys/shm.h`
18342 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18343 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18354 set d_shmatprototype
18357 : see if shmdt exists
18361 : see how much of the 'shm*(2)' library is present.
18364 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18365 *"$undef"*) h_shm=false;;
18369 case "`ipcs 2>&1`" in
18370 "SVID shared memory"*"not configured"*)
18371 echo "Your $osname does not have the shm*(2) configured." >&4
18374 set shmctl d_shmctl
18376 set shmget d_shmget
18386 : we could also check for sys/ipc.h ...
18387 if $h_shm && $test `./findhdr sys/shm.h`; then
18388 echo "You have the full shm*(2) library." >&4
18391 echo "You don't have the full shm*(2) library." >&4
18397 : see if we have sigaction
18399 if set sigaction val -f d_sigaction; eval $csym; $val; then
18400 echo 'sigaction() found.' >&4
18403 #include <sys/types.h>
18404 #include <signal.h>
18405 #$i_stdlib I_STDLIB
18407 #include <stdlib.h>
18411 struct sigaction act, oact;
18413 oact.sa_handler = 0;
18414 /* so that act and oact are used */
18415 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18419 if eval $compile_ok; then
18422 echo "But you don't seem to have a usable struct sigaction." >&4
18426 echo 'sigaction NOT found.' >&4
18429 set d_sigaction; eval $setvar
18432 : see what type pids are declared as in the kernel
18433 rp="What is the type of process ids on this system?"
18434 set pid_t pidtype int stdio.h sys/types.h
18437 : see what type uids are declared as in the kernel
18439 echo "Looking for the type for user ids returned by getuid()."
18440 set uid_t uidtype xxx stdio.h sys/types.h
18444 xxx=`./findhdr sys/user.h`
18445 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18447 unsigned) dflt="$1 $2" ;;
18451 *) dflt="$uidtype";;
18454 uid_t) echo "uid_t found." ;;
18455 *) rp="What is the type for user ids returned by getuid()?"
18461 : Define hasfield_t macro for Configure internal use
18462 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18463 while $test $# -ge 2; do
18465 $define) echo "#include <$2>";;
18469 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18471 if eval $compile; then
18480 : see what siginfo fields we have
18481 case "$d_sigaction" in
18483 echo "Checking if your siginfo_t has si_errno field...">&4
18484 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18487 echo "Checking if your siginfo_t has si_pid field...">&4
18488 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18491 echo "Checking if your siginfo_t has si_uid field...">&4
18492 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18495 echo "Checking if your siginfo_t has si_addr field...">&4
18496 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18499 echo "Checking if your siginfo_t has si_status field...">&4
18500 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18503 echo "Checking if your siginfo_t has si_band field...">&4
18504 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18507 echo "Checking if your siginfo_t has si_value field...">&4
18508 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18511 echo "Checking if your siginfo_t has si_fd field...">&4
18512 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18517 d_siginfo_si_errno="$undef"
18518 d_siginfo_si_pid="$undef"
18519 d_siginfo_si_uid="$undef"
18520 d_siginfo_si_addr="$undef"
18521 d_siginfo_si_status="$undef"
18522 d_siginfo_si_band="$undef"
18523 d_siginfo_si_value="$undef"
18524 d_siginfo_si_fd="$undef"
18528 : see if this is a sunmath.h system
18529 set sunmath.h i_sunmath
18532 : see if signbit exists
18533 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18535 #$i_sunmath I_SUNMATH
18537 #ifdef I_SUNMATH /* Solaris special math library */
18538 # include <sunmath.h>
18541 int main(int argc, char **argv)
18545 if ((signbit(x) == 0) && (signbit(y) != 0))
18553 if eval $compile; then
18554 if $run ./try; then
18558 $echo "Signbit seems to be available, but doesn't work as I expected."
18559 $echo "I won't use it." >&4
18570 : see if sigprocmask exists
18571 set sigprocmask d_sigprocmask
18574 : see if sigsetjmp exists
18576 case "$d_sigsetjmp" in
18579 #include <setjmp.h>
18580 #$i_stdlib I_STDLIB
18582 #include <stdlib.h>
18588 if (sigsetjmp(env,1))
18591 siglongjmp(env, 1);
18596 if eval $compile; then
18597 if $run ./try >/dev/null 2>&1; then
18598 echo "POSIX sigsetjmp found." >&4
18602 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18608 echo "sigsetjmp not found." >&4
18612 *) val="$d_sigsetjmp"
18613 case "$d_sigsetjmp" in
18614 $define) echo "POSIX sigsetjmp found." >&4;;
18615 $undef) echo "sigsetjmp not found." >&4;;
18623 : see if snprintf exists
18624 set snprintf d_snprintf
18627 : see if vsnprintf exists
18628 set vsnprintf d_vsnprintf
18631 case "$d_snprintf-$d_vsnprintf" in
18634 Checking whether your snprintf() and vsnprintf() work okay...
18636 $cat >try.c <<'EOCP'
18637 /* v?snprintf testing logic courtesy of Russ Allbery.
18638 * According to C99:
18639 * - if the buffer is too short it still must be \0-terminated
18640 * - if the buffer is too short the potentially required length
18641 * must be returned and not -1
18642 * - if the buffer is NULL the potentially required length
18643 * must be returned and not -1 or core dump
18646 #include <stdarg.h>
18650 int test (char *format, ...)
18655 va_start (args, format);
18656 count = vsnprintf (buf, sizeof buf, format, args);
18663 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18664 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18668 if eval $compile; then
18671 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18673 Your snprintf() and snprintf() don't seem to be working okay.
18675 d_snprintf="$undef"
18676 d_vsnprintf="$undef"
18680 echo "(I can't seem to compile the test program--assuming they don't)"
18681 d_snprintf="$undef"
18682 d_vsnprintf="$undef"
18688 : see if sockatmark exists
18689 set sockatmark d_sockatmark
18692 : see if prototype for sockatmark is available
18694 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18697 : see if socks5_init exists
18698 set socks5_init d_socks5_init
18701 : see if srand48_r exists
18702 set srand48_r d_srand48_r
18704 case "$d_srand48_r" in
18706 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18707 case "$d_srand48_r_proto:$usethreads" in
18708 ":define") d_srand48_r_proto=define
18709 set d_srand48_r_proto srand48_r $hdrs
18713 case "$d_srand48_r_proto" in
18715 case "$srand48_r_proto" in
18716 ''|0) try='int srand48_r(long, struct drand48_data*);'
18717 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18719 case "$srand48_r_proto" in
18720 ''|0) d_srand48_r=undef
18722 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18723 * ) case "$srand48_r_proto" in
18724 REENTRANT_PROTO*) ;;
18725 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18727 echo "Prototype: $try" ;;
18730 *) case "$usethreads" in
18731 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18738 *) srand48_r_proto=0
18742 : see if srandom_r exists
18743 set srandom_r d_srandom_r
18745 case "$d_srandom_r" in
18747 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18748 case "$d_srandom_r_proto:$usethreads" in
18749 ":define") d_srandom_r_proto=define
18750 set d_srandom_r_proto srandom_r $hdrs
18754 case "$d_srandom_r_proto" in
18756 case "$srandom_r_proto" in
18757 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18758 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18760 case "$srandom_r_proto" in
18761 ''|0) d_srandom_r=undef
18763 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18764 * ) case "$srandom_r_proto" in
18765 REENTRANT_PROTO*) ;;
18766 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18768 echo "Prototype: $try" ;;
18771 *) case "$usethreads" in
18772 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18779 *) srandom_r_proto=0
18783 : see if prototype for setresgid is available
18785 set d_sresgproto setresgid $i_unistd unistd.h
18788 : see if prototype for setresuid is available
18790 set d_sresuproto setresuid $i_unistd unistd.h
18793 : see if stat exists
18797 : see if sys/stat.h is available
18798 set sys/stat.h i_sysstat
18801 : see if stat knows about block sizes
18803 echo "Checking to see if your struct stat has st_blocks field..." >&4
18804 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18807 : see if this is a sys/vfs.h system
18808 set sys/vfs.h i_sysvfs
18811 : see if this is a sys/statfs.h system
18812 set sys/statfs.h i_sysstatfs
18815 : Check for statfs_s
18817 echo "Checking to see if your system supports struct statfs..." >&4
18818 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
18820 case "$d_statfs_s" in
18821 "$define") echo "Yes, it does." ;;
18822 *) echo "No, it doesn't." ;;
18825 : see if struct statfs knows about f_flags
18826 case "$d_statfs_s" in
18829 echo "Checking to see if your struct statfs has f_flags field..." >&4
18830 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
18834 set d_statfs_f_flags
18838 case "$d_statfs_f_flags" in
18839 "$define") echo "Yes, it does." ;;
18840 *) echo "No, it doesn't." ;;
18843 : see what flavor, if any, of static inline is supported
18845 echo "Checking to see if your system supports static inline..."
18846 $cat > try.c <<'EOCP'
18847 #include <stdlib.h>
18848 extern int f_via_a(int x);
18849 extern int f_via_b(int x);
18850 int main(int argc, char **argv)
18859 return EXIT_SUCCESS;
18862 return EXIT_FAILURE;
18866 $cat > a.c <<'EOCP'
18867 static INLINE int f(int x) {
18878 $cat > b.c <<'EOCP'
18879 extern int f(int x);
18887 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18888 case "$perl_static_inline" in
18889 '') # Check the various possibilities, and break out on success.
18890 # For gcc, prefer __inline__, which will still permit
18891 # cflags.SH to add in -ansi.
18892 case "$gccversion" in
18893 '') xxx="inline __inline__ __inline _inline";;
18894 *) xxx="__inline__ inline __inline _inline";;
18896 for inline in $xxx; do
18897 set try -DINLINE=$inline a.c
18898 if eval $compile && $run ./try; then
18899 # Now make sure there is no external linkage of static
18901 set try -DINLINE=$inline -DUSE_B a.c b.c
18902 if eval $compile && $run ./try; then
18903 $echo "Your compiler supports static $inline, " >&4
18904 $echo "but it also creates an external definition," >&4
18905 $echo "so I won't use it." >&4
18908 $echo "Your compiler supports static $inline." >&4
18910 perl_static_inline="static $inline";
18914 $echo "Your compiler does NOT support static $inline." >&4
18919 *inline*) # Some variant of inline exists.
18920 echo "Keeping your $hint value of $perl_static_inline."
18923 static) # No inline capabilities
18924 echo "Keeping your $hint value of $perl_static_inline."
18927 *) # Unrecognized previous value -- blindly trust the supplied
18928 # value and hope it makes sense. Use old value for
18929 # d_static_inline, if there is one.
18930 echo "Keeping your $hint value of $perl_static_inline."
18931 case "$d_static_inline" in
18933 *) val=$d_static_inline ;;
18937 # Fallback to plain 'static' if nothing worked.
18938 case "$perl_static_inline" in
18940 perl_static_inline="static"
18944 set d_static_inline
18946 $rm -f a.[co] b.[co]
18949 : Check stream access
18951 Checking how to access stdio streams by file descriptor number...
18953 case "$stdio_stream_array" in
18954 '') $cat >try.c <<EOCP
18957 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18961 for s in _iob __iob __sF
18963 set try -DSTDIO_STREAM_ARRAY=$s
18964 if eval $compile; then
18965 case "`$run ./try`" in
18966 yes) stdio_stream_array=$s; break ;;
18972 case "$stdio_stream_array" in
18974 I can't figure out how to access stdio streams by file descriptor number.
18976 d_stdio_stream_array="$undef"
18979 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18981 d_stdio_stream_array="$define"
18985 : see if strcoll exists
18986 set strcoll d_strcoll
18989 : see if strerror_l exists
18990 set strerror_l d_strerror_l
18993 : see if strerror_r exists
18994 set strerror_r d_strerror_r
18996 case "$d_strerror_r" in
18998 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18999 case "$d_strerror_r_proto:$usethreads" in
19000 ":define") d_strerror_r_proto=define
19001 set d_strerror_r_proto strerror_r $hdrs
19005 case "$d_strerror_r_proto" in
19007 case "$strerror_r_proto" in
19008 ''|0) try='int strerror_r(int, char*, size_t);'
19009 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19011 case "$strerror_r_proto" in
19012 ''|0) try='int strerror_r(int, char*, int);'
19013 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19015 case "$strerror_r_proto" in
19016 ''|0) try='char* strerror_r(int, char*, size_t);'
19017 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19019 case "$strerror_r_proto" in
19020 ''|0) d_strerror_r=undef
19022 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19023 * ) case "$strerror_r_proto" in
19024 REENTRANT_PROTO*) ;;
19025 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19027 echo "Prototype: $try" ;;
19030 *) case "$usethreads" in
19031 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19038 *) strerror_r_proto=0
19042 : see if strftime exists
19043 set strftime d_strftime
19046 : see if strlcat exists
19047 : We need both a prototype in string.h and the symbol in libc.
19050 xx1="#$d_gnulibc HAS_GNULIBC"
19051 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19052 xx3='# define _GNU_SOURCE'
19054 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19056 case "$d_strlcat_proto" in
19057 define) # see if strlcat exists
19058 set strlcat d_strlcat
19067 : see if strlcpy exists
19068 : We need both a prototype in string.h and the symbol in libc.
19071 xx1="#$d_gnulibc HAS_GNULIBC"
19072 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19073 xx3='# define _GNU_SOURCE'
19075 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19077 case "$d_strlcpy_proto" in
19078 define) # see if strlcpy exists
19079 set strlcpy d_strlcpy
19088 : see if strnlen exists
19089 set strnlen d_strnlen
19092 : see if strtod exists
19093 set strtod d_strtod
19096 : see if strtod_l exists
19097 set strtod_l d_strtod_l
19100 : see if strtol exists
19101 set strtol d_strtol
19104 : see if strtold exists
19105 set strtold d_strtold
19108 : see if strtold_l exists
19109 set strtold_l d_strtold_l
19112 : see if strtoll exists
19113 set strtoll d_strtoll
19116 case "$d_longlong-$d_strtoll" in
19119 Checking whether your strtoll() works okay...
19121 $cat >try.c <<'EOCP'
19124 #define strtoll __strtoll
19127 #define strtoll _strtoll
19130 #include <stdlib.h>
19131 static int bad = 0;
19132 void check(const char *s, long long ell, int een) {
19135 gll = strtoll(s, 0, 10);
19136 if (!((gll == ell) && (errno == een)))
19140 check(" 1", 1LL, 0);
19141 check(" 0", 0LL, 0);
19142 check("-1", -1LL, 0);
19143 check("-9223372036854775808", -9223372036854775808LL, 0);
19144 check("-9223372036854775808", -9223372036854775808LL, 0);
19145 check(" 9223372036854775807", 9223372036854775807LL, 0);
19146 check("-9223372036854775808", -9223372036854775808LL, 0);
19147 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19148 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19154 if eval $compile; then
19157 ok) echo "Your strtoll() seems to be working okay." ;;
19159 Your strtoll() doesn't seem to be working okay.
19165 echo "(I can't seem to compile the test program--assuming it doesn't)"
19171 : see if strtoq exists
19172 set strtoq d_strtoq
19175 : see if strtoul exists
19176 set strtoul d_strtoul
19179 case "$d_strtoul" in
19182 Checking whether your strtoul() works okay...
19184 $cat >try.c <<'EOCP'
19185 #include <stdlib.h>
19188 static int bad = 0;
19189 void check(const char *s, unsigned long eul, int een) {
19192 gul = strtoul(s, 0, 10);
19193 if (!((gul == eul) && (errno == een)))
19197 check(" 1", 1L, 0);
19198 check(" 0", 0L, 0);
19200 case "$longsize" in
19202 $cat >>try.c <<'EOCP'
19203 check("18446744073709551615", 18446744073709551615UL, 0);
19204 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19205 #if 0 /* strtoul() for /^-/ strings is undefined. */
19206 check("-1", 18446744073709551615UL, 0);
19207 check("-18446744073709551614", 2, 0);
19208 check("-18446744073709551615", 1, 0);
19209 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19210 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19215 $cat >>try.c <<'EOCP'
19216 check("4294967295", 4294967295UL, 0);
19217 check("4294967296", 4294967295UL, ERANGE);
19218 #if 0 /* strtoul() for /^-/ strings is undefined. */
19219 check("-1", 4294967295UL, 0);
19220 check("-4294967294", 2, 0);
19221 check("-4294967295", 1, 0);
19222 check("-4294967296", 4294967295UL, ERANGE);
19223 check("-4294967297", 4294967295UL, ERANGE);
19228 : Should we write these tests to be more portable by sprintf-ing
19229 : ~0 and then manipulating that char string as input for strtol?
19232 $cat >>try.c <<'EOCP'
19239 if eval $compile; then
19240 case "`$run ./try`" in
19241 ok) echo "Your strtoul() seems to be working okay." ;;
19243 Your strtoul() doesn't seem to be working okay.
19249 echo "(I can't seem to compile the test program--assuming it doesn't)"
19255 : see if strtoull exists
19256 set strtoull d_strtoull
19259 case "$d_longlong-$d_strtoull" in
19262 Checking whether your strtoull() works okay...
19264 $cat >try.c <<'EOCP'
19265 #include <stdlib.h>
19268 #define strtoull __strtoull
19271 static int bad = 0;
19272 void check(const char *s, long long eull, int een) {
19275 gull = strtoull(s, 0, 10);
19276 if (!((gull == eull) && (errno == een)))
19280 check(" 1", 1LL, 0);
19281 check(" 0", 0LL, 0);
19282 check("18446744073709551615", 18446744073709551615ULL, 0);
19283 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19284 #if 0 /* strtoull() for /^-/ strings is undefined. */
19285 check("-1", 18446744073709551615ULL, 0);
19286 check("-18446744073709551614", 2LL, 0);
19287 check("-18446744073709551615", 1LL, 0);
19288 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19289 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19296 if eval $compile; then
19297 case "`$run ./try`" in
19298 ok) echo "Your strtoull() seems to be working okay." ;;
19300 Your strtoull() doesn't seem to be working okay.
19302 d_strtoull="$undef"
19306 echo "(I can't seem to compile the test program--assuming it doesn't)"
19307 d_strtoull="$undef"
19312 : see if strtouq exists
19313 set strtouq d_strtouq
19316 case "$d_strtouq" in
19319 Checking whether your strtouq() works okay...
19321 $cat >try.c <<'EOCP'
19322 #include <stdlib.h>
19325 static int bad = 0;
19326 void check(const char *s, unsigned long long eull, int een) {
19327 unsigned long long gull;
19329 gull = strtouq(s, 0, 10);
19330 if (!((gull == eull) && (errno == een)))
19334 check(" 1", 1LL, 0);
19335 check(" 0", 0LL, 0);
19336 check("18446744073709551615", 18446744073709551615ULL, 0);
19337 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19338 #if 0 /* strtouq() for /^-/ strings is undefined. */
19339 check("-1", 18446744073709551615ULL, 0);
19340 check("-18446744073709551614", 2LL, 0);
19341 check("-18446744073709551615", 1LL, 0);
19342 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19343 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19351 if eval $compile; then
19352 case "`$run ./try`" in
19353 ok) echo "Your strtouq() seems to be working okay." ;;
19355 Your strtouq() doesn't seem to be working okay.
19361 echo "(I can't seem to compile the test program--assuming it doesn't)"
19367 : see if strxfrm exists
19368 set strxfrm d_strxfrm
19371 : see if symlink exists
19372 set symlink d_symlink
19375 : see if syscall exists
19376 set syscall d_syscall
19379 : see if prototype for syscall is available
19381 set d_syscallproto syscall $i_unistd unistd.h
19384 : see if sysconf exists
19385 set sysconf d_sysconf
19388 : see if sys_errlist[] exists
19390 if test "X$d_syserrlst" = X; then
19391 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19392 echo "You have sys_errlist[], so we could roll our own strerror."
19393 d_syserrlst="$define"
19395 echo "You don't have sys_errlist[], so strerror() is welcome."
19396 d_syserrlst="$undef"
19400 : see if system exists
19401 set system d_system
19404 : see if tcgetpgrp exists
19405 set tcgetpgrp d_tcgetpgrp
19408 : see if tcsetpgrp exists
19409 set tcsetpgrp d_tcsetpgrp
19412 : see if prototype for telldir is available
19414 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19417 : see if tgamma exists
19418 set tgamma d_tgamma
19421 : check for thread_safe_nl_langinfo_l item
19424 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19427 #$i_stdlib I_STDLIB
19429 # include <stdlib.h>
19431 #include <string.h>
19432 #$i_langinfo I_LANGINFO
19434 # include <langinfo.h>
19436 #$i_pthread I_PTHREAD
19438 # include <pthread.h>
19440 #$i_locale I_LOCALE
19442 # include <locale.h>
19446 thread_start(void * arg)
19448 nl_langinfo(RADIXCHAR);
19452 char * main_buffer;
19453 char save_main_buffer[1000];
19454 pthread_t subthread;
19455 pthread_attr_t attr;
19457 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19459 /* If too large for our generous allowance, just assume we don't have
19461 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19465 strcpy(save_main_buffer, main_buffer);
19467 if (pthread_attr_init(&attr) != 0) {
19471 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19475 if (pthread_join(subthread, NULL) != 0) {
19479 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19482 case "$usethreads" in
19485 if eval $compile; then
19486 echo "Your system has nl_langinfo_l()..." >&4
19487 if $run ./try; then
19488 echo "and it is thread-safe (just as I'd hoped)." >&4
19489 d_thread_safe_nl_langinfo_l="$define"
19490 echo "$d_thread_safe_nl_langinfo_l" >&4
19492 echo "but it isn't thread-safe, so we won't use it." >&4
19495 echo "your system does not have nl_langinfo_l()" >&4
19498 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19500 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19501 d_thread_safe_nl_langinfo_l="$undef"
19505 : see if time exists
19507 if test "X$d_time" = X -o X"$timetype" = X; then
19508 if set time val -f d_time; eval $csym; $val; then
19509 echo 'time() found.' >&4
19511 rp="What is the type returned by time() on this system?"
19512 set time_t timetype long stdio.h sys/types.h
19515 echo 'time() not found, hope that will do.' >&4
19523 : see if timegm exists
19524 set timegm d_timegm
19527 : see if this is a sys/times.h system
19528 set sys/times.h i_systimes
19531 : see if times exists
19533 if set times val -f d_times; eval $csym; $val; then
19534 echo 'times() found.' >&4
19537 case "$i_systimes" in
19538 "$define") inc='sys/times.h';;
19540 rp="What is the type returned by times() on this system?"
19541 set clock_t clocktype long stdio.h sys/types.h $inc
19544 echo 'times() NOT found, hope that will do.' >&4
19549 : see if tmpnam_r exists
19550 set tmpnam_r d_tmpnam_r
19552 case "$d_tmpnam_r" in
19554 hdrs="$i_systypes sys/types.h define stdio.h "
19555 case "$d_tmpnam_r_proto:$usethreads" in
19556 ":define") d_tmpnam_r_proto=define
19557 set d_tmpnam_r_proto tmpnam_r $hdrs
19561 case "$d_tmpnam_r_proto" in
19563 case "$tmpnam_r_proto" in
19564 ''|0) try='char* tmpnam_r(char*);'
19565 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19567 case "$tmpnam_r_proto" in
19568 ''|0) d_tmpnam_r=undef
19570 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19571 * ) case "$tmpnam_r_proto" in
19572 REENTRANT_PROTO*) ;;
19573 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19575 echo "Prototype: $try" ;;
19578 *) case "$usethreads" in
19579 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19586 *) tmpnam_r_proto=0
19590 : see if towlower exists
19591 set towlower d_towlower
19594 : see if trunc exists
19598 : see if truncate exists
19599 set truncate d_truncate
19602 : see if ttyname_r exists
19603 set ttyname_r d_ttyname_r
19605 case "$d_ttyname_r" in
19607 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19608 case "$d_ttyname_r_proto:$usethreads" in
19609 ":define") d_ttyname_r_proto=define
19610 set d_ttyname_r_proto ttyname_r $hdrs
19614 case "$d_ttyname_r_proto" in
19616 case "$ttyname_r_proto" in
19617 ''|0) try='int ttyname_r(int, char*, size_t);'
19618 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19620 case "$ttyname_r_proto" in
19621 ''|0) try='int ttyname_r(int, char*, int);'
19622 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19624 case "$ttyname_r_proto" in
19625 ''|0) try='char* ttyname_r(int, char*, int);'
19626 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19628 case "$ttyname_r_proto" in
19629 ''|0) d_ttyname_r=undef
19631 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19632 * ) case "$ttyname_r_proto" in
19633 REENTRANT_PROTO*) ;;
19634 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19636 echo "Prototype: $try" ;;
19639 *) case "$usethreads" in
19640 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19647 *) ttyname_r_proto=0
19651 : see if tzname[] exists
19653 if set tzname val -a d_tzname; eval $csym; $val; then
19655 echo 'tzname[] found.' >&4
19658 echo 'tzname[] NOT found.' >&4
19663 : Check if is a multiplatform env
19665 darwin) multiarch="$define" ;;
19667 case "$multiarch" in
19668 ''|[nN]*) multiarch="$undef" ;;
19671 : check for ordering of bytes in a UV
19673 case "$multiarch" in
19676 You seem to be doing a multiarchitecture build,
19677 skipping the byteorder check.
19683 case "$byteorder" in
19686 In the following, larger digits indicate more significance. A big-endian
19687 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19688 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19689 machines may have weird orders like 3412. A Cray will report 87654321,
19690 an Alpha will report 12345678. If the test program works the default is
19692 I'm now running the test program...
19696 #$i_stdlib I_STDLIB
19698 #include <stdlib.h>
19700 #include <sys/types.h>
19701 typedef $uvtype UV;
19711 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19713 u.l = (UV)0x04030201;
19714 for (i = 0; i < $uvsize; i++)
19715 printf("%c", u.c[i]+'0');
19722 if eval $compile && $run ./try > /dev/null; then
19725 [1-4][1-4][1-4][1-4]|12345678|87654321)
19726 echo "(The test program ran ok.)"
19727 echo "byteorder=$dflt"
19730 ????|????????) echo "(The test program ran ok.)" ;;
19731 *) echo "(The test program didn't run right for some reason.)" ;;
19736 (I can't seem to compile the test program. Guessing big-endian...)
19739 case "$xxx_prompt" in
19741 rp="What is the order of bytes in $uvtype?"
19754 : Checking 32bit alignedness
19757 Checking to see whether you can access character data unalignedly...
19759 case "$d_u32align" in
19760 '') $cat >try.c <<EOCP
19762 #$i_stdlib I_STDLIB
19764 #include <stdlib.h>
19766 #define U32 $u32type
19767 #define BYTEORDER 0x$byteorder
19769 #include <signal.h>
19771 $signal_t bletch(int s) { exit(4); }
19774 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19775 volatile U8 buf[8];
19779 if (sizeof(U32) != 4) {
19780 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19787 signal(SIGBUS, bletch);
19799 for (i = 0; i < 4; i++) {
19800 up = (U32*)(buf + i);
19801 if (! ((*up == 1 << (8*i)) || /* big-endian */
19802 (*up == 1 << (8*(3-i))) /* little-endian */
19806 printf("read failed (%x)\n", *up);
19812 for (i = 0; i < 4; i++) {
19813 up = (U32*)(buf + i);
19815 if (*up != 0xBeef) {
19816 printf("write failed (%x)\n", *up);
19830 if eval $compile_ok; then
19831 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19832 $run ./try 2>&1 >/dev/null
19835 You can access character data pretty unalignedly.
19837 d_u32align="$undef"
19840 It seems that you must access character data in an aligned manner.
19842 d_u32align="$define"
19846 rp='Can you access character data at unaligned addresses?'
19850 [yY]*) d_u32align="$undef" ;;
19851 *) d_u32align="$define" ;;
19858 : see if ualarm exists
19859 set ualarm d_ualarm
19862 : see if umask exists
19866 : see if unordered exists
19867 set unordered d_unordered
19870 : see if unsetenv exists
19871 set unsetenv d_unsetenv
19874 : see if usleep exists
19875 set usleep d_usleep
19878 : see if prototype for usleep is available
19880 set d_usleepproto usleep $i_unistd unistd.h
19883 : see if ustat exists
19887 : see if closedir exists
19888 set closedir d_closedir
19891 case "$d_closedir" in
19894 echo "Checking whether closedir() returns a status..." >&4
19896 #$i_dirent I_DIRENT /**/
19897 #$i_sysdir I_SYS_DIR /**/
19898 #$i_sysndir I_SYS_NDIR /**/
19899 #$i_systypes I_SYS_TYPES /**/
19901 #if defined(I_SYS_TYPES)
19902 #include <sys/types.h>
19904 #if defined(I_DIRENT)
19905 #include <dirent.h>
19908 #include <sys/ndir.h>
19911 #include <sys/dir.h>
19915 int main() { return closedir(opendir(".")); }
19918 if eval $compile_ok; then
19919 if $run ./try > /dev/null 2>&1 ; then
19920 echo "Yes, it does."
19923 echo "No, it doesn't."
19927 echo "(I can't seem to compile the test program--assuming it doesn't)"
19935 set d_void_closedir
19939 : see if there is a wait4
19943 : see if waitpid exists
19944 set waitpid d_waitpid
19947 : see if wcrtomb exists
19948 set wcrtomb d_wcrtomb
19953 $cat >try.c <<'EOCP'
19959 return (wcscmp (s, s) ? 1 : 0);
19964 if eval $compile; then
19967 0) echo "A working wcscmp() found." >&4
19969 *) echo "wcscmp() found, but it doesn't work" >&4
19973 echo "wcscmp() NOT found." >&4
19979 : see if wcstombs exists
19980 set wcstombs d_wcstombs
19985 $cat >try.c <<'EOCP'
19990 wchar_t dst[4], *src = L" ";
19992 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19997 if eval $compile; then
20000 0) echo "A working wcsxfrm() found." >&4
20002 *) echo "wcsxfrm() found, but it doesn't work" >&4
20006 echo "wcsxfrm() NOT found." >&4
20012 : see if wctomb exists
20013 set wctomb d_wctomb
20016 : see if writev exists
20017 set writev d_writev
20020 : check for alignment requirements
20022 case "$alignbytes" in
20023 '') echo "Checking alignment constraints..." >&4
20032 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20037 if eval $compile_ok; then
20041 echo "(I can't seem to compile the test program...)"
20043 case "$multiarch" in
20045 : The usual safe value is 8, but Darwin with -Duselongdouble
20046 : needs 16. Hence, we will take 8 as a minimum, but allow
20047 : Configure to pick a larger value if needed.
20048 if $test "$dflt" -lt 8; then
20050 echo "Setting alignment to 8 for multiarch support.">&4
20055 *) dflt="$alignbytes"
20058 rp="Doubles must be aligned on a how-many-byte boundary?"
20063 : set the base revision
20066 : length of character in bytes. Is always 1, otherwise it is not C
20067 : This used to be a test using sizeof
20070 : Check for the number of bits in a character
20071 case "$charbits" in
20072 '') echo "Checking how long a character is (in bits)..." >&4
20079 for (c = 1, n = 0; c; c <<= 1, n++) ;
20080 printf ("%d\n", n);
20085 if eval $compile_ok; then
20089 echo "(I can't seem to compile the test program. Guessing...)"
20096 rp="What is the length of a character (in bits)?"
20100 case "$charbits" in
20103 Your system has an unsigned character size of $charbits bits, which
20104 is rather unusual (normally it is 8 bits). Perl likely will not work
20105 correctly on your system, with subtle bugs in various places.
20107 rp='Do you really want to continue?'
20111 [yY]) echo >&4 "Okay, continuing." ;;
20116 : how do we concatenate cpp tokens here?
20118 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20119 $cat >cpp_stuff.c <<'EOCP'
20120 #define RCAT(a,b)a/**/b
20121 #define ACAT(a,b)a ## b
20125 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20126 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20127 echo "Oh! Smells like ANSI's been here." >&4
20128 echo "We can catify or stringify, separately or together!"
20130 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20131 echo "Ah, yes! The good old days!" >&4
20132 echo "However, in the good old days we don't know how to stringify and"
20133 echo "catify at the same time."
20137 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20138 You're going to have to edit the values of CAT[2-5] in config.h...
20140 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20144 : see if this is a db.h system
20150 : Check db version.
20152 echo "Checking Berkeley DB version ..." >&4
20154 #include <sys/types.h>
20156 #$i_stdlib I_STDLIB
20158 #include <stdlib.h>
20161 int main(int argc, char *argv[])
20163 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20164 int Major, Minor, Patch ;
20165 unsigned long Version ;
20166 (void)db_version(&Major, &Minor, &Patch) ;
20168 printf("%d %d %d %d %d %d\n",
20169 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20170 Major, Minor, Patch);
20173 printf("You have Berkeley DB Version 2 or greater.\n");
20175 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20176 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20177 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20178 Major, Minor, Patch) ;
20180 /* check that db.h & libdb are compatible */
20181 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20182 printf("db.h and libdb are incompatible.\n") ;
20186 printf("db.h and libdb are compatible.\n") ;
20188 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20189 + DB_VERSION_PATCH ;
20191 /* needs to be >= 2.3.4 */
20192 if (Version < 2003004) {
20193 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20194 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20200 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20205 printf("You have Berkeley DB Version 1.\n");
20206 exit(0); /* DB version < 2: the coast is clear. */
20208 exit(1); /* <db.h> not Berkeley DB? */
20214 if eval $compile_ok && $run ./try; then
20215 echo 'Looks OK.' >&4
20217 db_version_major=$1
20218 db_version_minor=$2
20219 db_version_patch=$3
20221 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20225 : Remove db from list of libraries to use
20226 echo "Removing unusable -ldb from library list" >&4
20227 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20230 echo "libs = $libs" >&4
20240 : Check the return type needed for hash
20242 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20244 #include <sys/types.h>
20247 #ifndef DB_VERSION_MAJOR
20248 u_int32_t hash_cb (const void* ptr, size_t size)
20255 info.hash = hash_cb;
20259 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20260 if $contains warning try.out >>/dev/null 2>&1 ; then
20263 db_hashtype='u_int32_t'
20266 : XXX Maybe we should just give up here.
20267 db_hashtype=u_int32_t
20269 echo "Help: I can't seem to compile the db test program." >&4
20270 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20273 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20275 *) db_hashtype=u_int32_t
20280 : Check the return type needed for prefix
20282 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20284 #include <sys/types.h>
20287 #ifndef DB_VERSION_MAJOR
20288 size_t prefix_cb (const DBT *key1, const DBT *key2)
20295 info.prefix = prefix_cb;
20299 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20300 if $contains warning try.out >>/dev/null 2>&1 ; then
20301 db_prefixtype='int'
20303 db_prefixtype='size_t'
20306 db_prefixtype='size_t'
20307 : XXX Maybe we should just give up here.
20309 echo "Help: I can't seem to compile the db test program." >&4
20310 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20313 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20315 *) db_prefixtype='size_t'
20319 : Include . in @INC
20322 Historically Perl has provided a final fallback of the current working
20323 directory '.' when searching for a library. This, however, can lead to
20324 problems when a Perl program which loads optional modules is called from
20325 a shared directory. This can lead to executing unexpected code.
20329 # When changing to exclude by default:
20330 case "$default_inc_excludes_dot" in
20331 $undef|false|[nN]*) dflt="n" ;;
20334 # To turn exclude off by default:
20335 #case "$default_inc_excludes_dot" in
20336 # $define|true|[yY]*) dflt="y" ;;
20340 rp='Exclude '.' from @INC by default? '
20343 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20344 *) default_inc_excludes_dot="$define" ;;
20347 : Check what kind of inf/nan your system has
20348 $echo "Checking the kind of infinities and nans you have..." >&4
20349 $echo "(The following tests may crash. That's okay.)" >&4
20351 #define DOUBLESIZE $doublesize
20352 #$d_longdbl HAS_LONG_DOUBLE
20353 #ifdef HAS_LONG_DOUBLE
20354 #define LONG_DOUBLESIZE $longdblsize
20355 #define LONG_DOUBLEKIND $longdblkind
20358 #include <string.h>
20360 /* Note that whether the sign bit is on or off
20361 * for NaN depends on the CPU/FPU, and possibly
20362 * can be affected by the build toolchain.
20364 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20365 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20366 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20367 * (respectively) as opposed to the more usual
20368 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20370 * Pre-IEEE-754 floating point format do not even have inf/nan support
20371 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20372 * to even mention, causing immediate SIGFPE or equivalent: this is
20373 * the case with VAX floating point, for example.
20375 static void bytes(void *v, unsigned int n) {
20376 unsigned char *p = (unsigned char *)v;
20378 for (i = 0; i < n; i++) {
20379 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20382 int main(int argc, char *argv[]) {
20383 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20384 * because some compilers are 'smart' and not only warn but refuse to
20385 * compile such 'illegal' values. */
20386 double dinf = exp(1e9);
20387 double dnan = sqrt(-1.0);
20388 #ifdef HAS_LONG_DOUBLE
20389 long double ldinf = (long double)exp(1e9);
20390 long double ldnan = (long double)sqrt(-1.0);
20391 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20392 /* the 80-bit long doubles might have garbage in their excess bytes */
20393 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20394 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20397 switch (argv[1][0]) {
20398 case '1': bytes(&dinf, sizeof(dinf)); break;
20399 case '2': bytes(&dnan, sizeof(dnan)); break;
20400 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20401 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20409 if eval $compile; then
20410 doubleinfbytes=`$run ./try 1`
20411 doublenanbytes=`$run ./try 2`
20412 case "$d_longdbl" in
20414 longdblinfbytes=`$run ./try 3`
20415 longdblnanbytes=`$run ./try 4`
20419 # Defaults in case the above test program failed.
20420 case "$doublekind" in
20421 1) # IEEE 754 32-bit LE
20422 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20423 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20425 2) # IEEE 754 32-bit BE
20426 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20427 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20429 3) # IEEE 754 64-bit LE
20430 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20431 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20433 4) # IEEE 754 64-bit BE
20434 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20435 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20437 5) # IEEE 754 128-bit LE
20438 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20439 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20441 6) # IEEE 754 128-bit BE
20442 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20443 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20445 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20446 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20447 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20449 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20450 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20451 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20453 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20454 doubleinfbytes=$undef
20455 doublenanbytes=$undef
20458 doubleinfbytes=$undef
20459 doublenanbytes=$undef
20462 case "$longdblkind" in
20463 1) # IEEE 754 128-bit LE
20464 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20465 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20467 2) # IEEE 754 128-bit BE
20468 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20469 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20471 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20472 case "$longdblsize" in
20473 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20474 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20475 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20478 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20479 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20482 longdblinfbytes=$undef
20483 longdblnanbytes=$undef
20487 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20488 case "$longdblsize" in
20489 12) # 32-bit system
20490 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20491 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20493 16) # 64-bit system
20494 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20495 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20498 longdblinfbytes=$undef
20499 longdblnanbytes=$undef
20503 5) # 128-bit LE-LE "double double"
20504 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20505 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20507 6) # 128-bit BE-BE "double double"
20508 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20509 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20511 7) # 128-bit LE-BE "double double"
20512 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20513 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20515 8) # 128-bit BE-LE "double double"
20516 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20517 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20519 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20520 longdblinfbytes=$undef
20521 longdblnanbytes=$undef
20524 longdblinfbytes=$undef
20525 longdblnanbytes=$undef
20529 # In case the program crashed the values are empty, turn them undef.
20530 case "$doubleinfbytes" in
20531 '') doubleinfbytes=$undef ;;
20533 case "$doublenanbytes" in
20534 '') doublenanbytes=$undef ;;
20536 case "$longdblinfbytes" in
20537 '') longdblinfbytes=$undef ;;
20539 case "$longdblnanbytes" in
20540 '') longdblnanbytes=$undef ;;
20544 : Check the length of the double mantissa
20545 $echo "Checking how many mantissa bits your doubles have..." >&4
20547 #$i_sunmath I_SUNMATH
20550 # include <sunmath.h>
20552 #ifdef DBL_MANT_DIG
20553 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20556 int main(int argc, char *argv[]) {
20558 printf("%d\n", BITS);
20564 if eval $compile; then
20565 doublemantbits=`$run ./try`
20567 doublemantbits="$undef"
20571 : Check the length of the longdouble mantissa
20572 $echo "Checking how many mantissa bits your long doubles have..." >&4
20574 #$i_sunmath I_SUNMATH
20577 # include <sunmath.h>
20579 #$d_longdbl HAS_LONG_DOUBLE
20580 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20581 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20582 /* This format has no implicit bit. Beware, however, that for
20583 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20584 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20585 * and the top bit must have been one since 387, zero is plain invalid.
20586 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20587 # define BITS LDBL_MANT_DIG
20588 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20589 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20590 * reason e.g. Irix thinks 107. But in any case, we want only
20591 * the number of real bits, the implicit bits are of no interest. */
20592 # define BITS 2 * (DBL_MANT_DIG - 1)
20594 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20598 int main(int argc, char *argv[]) {
20600 printf("%d\n", BITS);
20606 if eval $compile; then
20607 longdblmantbits=`$run ./try`
20609 longdblmantbits="$undef"
20613 : Check the length of the NV mantissa
20614 $echo "Checking how many mantissa bits your NVs have..." >&4
20615 if test "X$usequadmath" = "X$define"; then
20616 nvmantbits=112 # 128-1-15
20618 if test "X$nvsize" = "X$doublesize"; then
20619 nvmantbits="$doublemantbits"
20621 if test "X$nvsize" = "X$longdblsize"; then
20622 nvmantbits="$longdblmantbits"
20624 nvmantbits="$undef"
20629 : How can we generate normalized random numbers ?
20631 echo "Using our internal random number implementation..." >&4
20634 *-Dmy_rand=*|*-Dmy_srand=*)
20635 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20636 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20637 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20638 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20642 randfunc=Perl_drand48
20643 drand01="Perl_drand48()"
20644 seedfunc="Perl_drand48_init"
20648 : Probe whether dtrace builds an object, as newer Illumos requires an input
20649 : object file that uses at least one of the probes defined in the .d file
20650 case "$usedtrace" in
20652 case "$dtracexnolibs" in
20653 $define|true|[yY]*)
20654 dtracexnolibs=$define
20655 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20658 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20659 dtracexnolibs=$define
20660 echo "Your dtrace accepts -xnolibs"
20661 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20662 dtracexnolibs=$undef
20663 echo "Your dtrace doesn't accept -xnolibs"
20665 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20670 dtracexnolibs=$undef
20671 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20674 case $dtracexnolibs in
20675 $define) xnolibs=-xnolibs ;;
20679 case "$dtraceobject" in
20680 $define|true|[yY]*)
20681 dtraceobject=$define
20685 #include "perldtrace.h"
20687 PERL_LOADED_FILE("dummy");
20691 dtraceobject=$undef
20692 if $cc -c -o try.o $optimize $ccflags try.c \
20693 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20694 dtraceobject=$define
20695 echo "Your dtrace builds an object file"
20698 *) dtraceobject=$undef ;;
20700 $rm_try perldtrace.o perldtrace.h
20703 : Determine if this is an EBCDIC system
20705 echo "Determining whether or not we are on an EBCDIC system..." >&4
20706 $cat >try.c <<'EOM'
20709 if ('M'==0xd4) return 0;
20716 if eval $compile_ok; then
20717 if $run ./try; then
20718 echo "You seem to speak EBCDIC." >&4
20721 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20724 echo "I'm unable to compile the test program." >&4
20725 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20731 : Check how to flush
20734 Checking how to flush all pending stdio output...
20736 # I only know how to find the first 32 possibly open files on SunOS.
20737 # See also hints/sunos_4_1.sh and util.c --AD
20739 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20741 $cat >>try.c <<EOCP
20743 #$i_stdlib I_STDLIB
20745 #include <stdlib.h>
20747 #$i_unistd I_UNISTD
20749 # include <unistd.h>
20751 #$d_sysconf HAS_SYSCONF
20752 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20753 #ifdef HAS_STDIO_STREAM_ARRAY
20754 # define STDIO_STREAM_ARRAY $stdio_stream_array
20759 p = fopen("try.out", "w");
20763 # ifdef TRY_FPRINTF
20767 #ifdef TRY_FFLUSH_NULL
20770 #ifdef TRY_FFLUSH_ALL
20772 long open_max = -1;
20773 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20774 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20776 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20777 open_max = sysconf(_SC_OPEN_MAX);
20780 open_max = FOPEN_MAX;
20783 open_max = OPEN_MAX;
20792 # ifdef HAS_STDIO_STREAM_ARRAY
20793 if (open_max > 0) {
20795 for (i = 0; i < open_max; i++)
20796 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20797 STDIO_STREAM_ARRAY[i]._file < open_max &&
20798 STDIO_STREAM_ARRAY[i]._flag)
20799 fflush(&STDIO_STREAM_ARRAY[i]);
20807 : first we have to find out how _not_ to flush
20809 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20811 set try -DTRY_FPUTC
20812 if eval $compile; then
20813 $run ./try 2>/dev/null
20816 if $test ! -s try.out -a "X$code" = X42; then
20822 set try -DTRY_FPRINTF
20823 if eval $compile; then
20824 $run ./try 2>/dev/null
20827 if $test ! -s try.out -a "X$code" = X42; then
20828 output=-DTRY_FPRINTF
20834 : check for fflush NULL behavior
20835 case "$fflushNULL" in
20836 '') set try -DTRY_FFLUSH_NULL $output
20837 if eval $compile; then
20838 $run ./try 2>/dev/null
20841 if $test -s try.out -a "X$code" = X42; then
20842 fflushNULL="`$cat try.out`"
20844 if $test "X$code" != X42; then
20846 (If this test failed, don't worry, we'll try another method shortly.)
20851 $rm -f core try.core core.try.*
20852 case "$fflushNULL" in
20854 Your fflush(NULL) works okay for output streams.
20855 Let's see if it clobbers input pipes...
20857 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20858 # bug that improperly flushes the input end of pipes. So we avoid the
20859 # autoflush on fork/system/exec support for now. :-(
20860 $cat >tryp.c <<EOCP
20863 main(int argc, char **argv)
20869 while ((i = getc(stdin)) != -1
20870 && (*bp++ = i) != '\n'
20871 && bp < &buf[1024])
20874 fprintf(stdout, "%s", buf);
20882 fflushNULL="$define"
20884 if eval $compile; then
20886 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20887 if $test "X$targethost" != X; then
20890 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20892 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20894 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20896 fflush(NULL) seems to behave okay with input streams.
20898 fflushNULL="$define"
20901 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20903 fflushNULL="$undef"
20906 $rm -f core tryp.c tryp.core core.tryp.*
20909 Your fflush(NULL) isn't working (contrary to ANSI C).
20911 fflushNULL="$undef"
20914 Cannot figure out whether your fflush(NULL) works or not.
20915 I'm assuming it doesn't (contrary to ANSI C).
20917 fflushNULL="$undef"
20921 $define|true|[yY]*)
20922 fflushNULL="$define"
20925 fflushNULL="$undef"
20928 : check explicit looping only if NULL did not work, and if the pipe
20929 : bug does not show up on an explicit flush too
20930 case "$fflushNULL" in
20932 $cat >tryp.c <<EOCP
20935 main(int argc, char **argv)
20941 while ((i = getc(stdin)) != -1
20942 && (*bp++ = i) != '\n'
20943 && bp < &buf[1024])
20946 fprintf(stdout, "%s", buf);
20955 if eval $compile; then
20957 if $test "X$targethost" != X; then
20960 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20962 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20964 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20966 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20968 : now check for fflushall behaviour
20969 case "$fflushall" in
20970 '') set try -DTRY_FFLUSH_ALL $output
20971 if eval $compile; then
20973 (Now testing the other method--but note that this also may fail.)
20975 $run ./try 2>/dev/null
20978 if $test -s try.out -a "X$code" = X42; then
20979 fflushall="`$cat try.out`"
20983 case "$fflushall" in
20985 Whew. Flushing explicitly all the stdio streams works.
20987 fflushall="$define"
20990 Sigh. Flushing explicitly all the stdio streams doesn't work.
20995 Cannot figure out whether flushing stdio streams explicitly works or not.
20996 I'm assuming it doesn't.
21002 "$define"|true|[yY]*)
21003 fflushall="$define"
21011 All is futile. Even fflush(stdin) clobbers input pipes!
21018 $rm -f core tryp.c tryp.core core.tryp.*
21020 *) fflushall="$undef"
21024 case "$fflushNULL$fflushall" in
21027 OK, I give up. I cannot figure out how to flush pending stdio output.
21028 We won't be flushing handles at all before fork/exec/popen.
21034 : Store the full pathname to the ar program for use in the C program
21035 : Respect a hint or command line value for full_ar.
21040 : Store the full pathname to the sed program for use in the C program
21043 : see what type gids are declared as in the kernel
21045 echo "Looking for the type for group ids returned by getgid()."
21046 set gid_t gidtype xxx stdio.h sys/types.h
21050 xxx=`./findhdr sys/user.h`
21051 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21053 unsigned) dflt="$1 $2" ;;
21057 *) dflt="$gidtype";;
21060 gid_t) echo "gid_t found." ;;
21061 *) rp="What is the type for group ids returned by getgid()?"
21067 : Check the size of GID
21070 *_t) zzz="$gidtype" ;;
21073 echo "Checking the size of $zzz..." >&4
21075 #include <sys/types.h>
21077 #$i_stdlib I_STDLIB
21079 #include <stdlib.h>
21082 printf("%d\n", (int)sizeof($gidtype));
21087 if eval $compile_ok; then
21091 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21094 echo "Your $zzz is $gidsize bytes long."
21099 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21102 : Check if GID is signed
21105 *_t) zzz="$gidtype" ;;
21108 echo "Checking the sign of $zzz..." >&4
21110 #include <sys/types.h>
21121 if eval $compile; then
21125 echo "(I can't execute the test program--guessing unsigned.)" >&4
21129 1) echo "Your $zzz is unsigned." ;;
21130 -1) echo "Your $zzz is signed." ;;
21136 echo "(I can't compile the test program--guessing unsigned.)" >&4
21139 : Check 64bit sizes
21142 if $test X"$quadtype" != X; then
21144 echo "Checking how to print 64-bit integers..." >&4
21146 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21147 $cat >try.c <<'EOCP'
21148 #include <sys/types.h>
21151 int q = 12345678901;
21152 printf("%ld\n", q);
21156 if eval $compile; then
21160 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21161 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21162 echo "We will use %d."
21168 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21169 $cat >try.c <<'EOCP'
21170 #include <sys/types.h>
21173 long q = 12345678901;
21174 printf("%ld\n", q);
21178 if eval $compile; then
21182 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21183 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21184 echo "We will use %ld."
21190 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21191 $cat >try.c <<'EOCP'
21192 #include <sys/types.h>
21193 #include <inttypes.h>
21196 int64_t q = 12345678901;
21197 printf("%" PRId64 "\n", q);
21201 if eval $compile; then
21205 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21206 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21207 echo "We will use the C9X style."
21213 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21215 #include <sys/types.h>
21218 $quadtype q = 12345678901;
21219 printf("%Ld\n", q);
21223 if eval $compile; then
21227 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21228 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21229 echo "We will use %Ld."
21235 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21236 $cat >try.c <<'EOCP'
21237 #include <sys/types.h>
21240 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21241 printf("%lld\n", q);
21245 if eval $compile; then
21249 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21250 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21251 echo "We will use the %lld style."
21257 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21259 #include <sys/types.h>
21262 $quadtype q = 12345678901;
21263 printf("%qd\n", q);
21267 if eval $compile; then
21271 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21272 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21273 echo "We will use %qd."
21279 if $test X"$sPRId64" = X; then
21280 echo "Cannot figure out how to print 64-bit integers." >&4
21287 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21288 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21290 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21291 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21295 : Check format strings for internal types
21297 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21299 if $test X"$ivsize" = X8; then
21300 ivdformat="$sPRId64"
21301 uvuformat="$sPRIu64"
21302 uvoformat="$sPRIo64"
21303 uvxformat="$sPRIx64"
21304 uvXUformat="$sPRIXU64"
21306 if $test X"$ivsize" = X"$longsize"; then
21313 if $test X"$ivsize" = X"$intsize"; then
21321 if $test X"$ivsize" = X"$shortsize"; then
21332 if $test X"$usequadmath" = X"$define"; then
21340 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21341 nveformat="$sPRIeldbl"
21342 nvfformat="$sPRIfldbl"
21343 nvgformat="$sPRIgldbl"
21344 nvEUformat="$sPRIEUldbl"
21345 nvFUformat="$sPRIFUldbl"
21346 nvGUformat="$sPRIGUldbl"
21357 case "$ivdformat" in
21358 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21363 : Check format string for GID
21366 $echo "Checking the format string to be used for gids..." >&4
21369 -1) if $test X"$gidsize" = X"$ivsize"; then
21370 gidformat="$ivdformat"
21372 if $test X"$gidsize" = X"$longsize"; then
21375 if $test X"$gidsize" = X"$intsize"; then
21378 if $test X"$gidsize" = X"$shortsize"; then
21385 *) if $test X"$gidsize" = X"$uvsize"; then
21386 gidformat="$uvuformat"
21388 if $test X"$gidsize" = X"$longsize"; then
21391 if $test X"$gidsize" = X"$intsize"; then
21394 if $test X"$gidsize" = X"$shortsize"; then
21403 : see if getgroups exists
21404 set getgroups d_getgrps
21407 : see if setgroups exists
21408 set setgroups d_setgrps
21411 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21413 case "$d_getgrps$d_setgrps" in
21415 case "$groupstype" in
21416 '') dflt="$gidtype" ;;
21417 *) dflt="$groupstype" ;;
21420 What type of pointer is the second argument to getgroups() and setgroups()?
21421 Usually this is the same as group ids, $gidtype, but not always.
21424 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21428 *) groupstype="$gidtype";;
21431 : check whether make sets MAKE
21433 echo "Checking if your $make program sets \$(MAKE)..." >&4
21434 case "$make_set_make" in
21436 $sed 's/^X //' > testmake.mak << 'EOF'
21438 X @echo 'maketemp="$(MAKE)"'
21440 case "`$make -f testmake.mak 2>/dev/null`" in
21441 *maketemp=*) make_set_make='#' ;;
21442 *) make_set_make="MAKE=$make" ;;
21444 $rm -f testmake.mak
21447 case "$make_set_make" in
21448 '#') echo "Yup, it does.";;
21449 *) echo "Nope, it doesn't.";;
21452 : see what type is used for mode_t
21453 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21454 set mode_t modetype int stdio.h sys/types.h
21457 : see if we need va_copy
21460 #include <stdarg.h>
21462 #include <stdlib.h>
21463 #include <signal.h>
21466 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21468 return vfprintf(f, fmt, *valp);
21472 myvfprintf(FILE *f, const char *fmt, va_list val)
21474 return ivfprintf(f, fmt, &val);
21478 myprintf(char *fmt, ...)
21481 va_start(val, fmt);
21482 return myvfprintf(stdout, fmt, val);
21486 main(int ac, char **av)
21488 signal(SIGSEGV, exit);
21490 myprintf("%s%cs all right, then\n", "that", '\'');
21495 if eval $compile && $run ./try 2>&1 >/dev/null; then
21496 case "`$run ./try`" in
21497 "that's all right, then")
21503 yes) echo "It seems that you don't need va_copy()." >&4
21504 need_va_copy="$undef"
21506 *) echo "It seems that va_copy() or similar will be needed." >&4
21507 need_va_copy="$define"
21512 : see what type is used for size_t
21513 rp="What is the type used for the length parameter for string functions?"
21514 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21517 : check for type of arguments to gethostbyaddr.
21518 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21519 case "$d_gethbyaddr" in
21523 Checking to see what type of arguments are accepted by gethostbyaddr().
21525 hdrs="$define sys/types.h
21526 $d_socket sys/socket.h
21527 $i_niin netinet/in.h
21529 $i_unistd unistd.h"
21530 : The first arg can 'char *' or 'void *'
21531 : The second arg is some of integral type
21532 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21533 for yyy in size_t long int; do
21534 case "$netdb_host_type" in
21535 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21536 if ./protochk "$try" $hdrs; then
21537 echo "Your system accepts $xxx for the first arg."
21538 echo "...and $yyy for the second arg."
21539 netdb_host_type="$xxx"
21540 netdb_hlen_type="$yyy"
21546 : In case none of those worked, prompt the user.
21547 case "$netdb_host_type" in
21548 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21551 netdb_host_type=$ans
21552 rp='What is the type for the 2nd argument to gethostbyaddr?'
21555 netdb_hlen_type=$ans
21559 *) : no gethostbyaddr, so pick harmless defaults
21560 netdb_host_type='char *'
21561 netdb_hlen_type="$sizetype"
21564 # Remove the "const" if needed. -- but then we'll have a
21566 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21569 : check for type of argument to gethostbyname.
21570 if test "X$netdb_name_type" = X ; then
21571 case "$d_gethbyname" in
21575 Checking to see what type of argument is accepted by gethostbyname().
21577 hdrs="$define sys/types.h
21578 $d_socket sys/socket.h
21579 $i_niin netinet/in.h
21581 $i_unistd unistd.h"
21582 for xxx in "const char *" "char *"; do
21583 case "$netdb_name_type" in
21584 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21585 if ./protochk "$try" $hdrs; then
21586 echo "Your system accepts $xxx."
21587 netdb_name_type="$xxx"
21592 : In case none of those worked, prompt the user.
21593 case "$netdb_name_type" in
21594 '') rp='What is the type for the 1st argument to gethostbyname?'
21597 netdb_name_type=$ans
21601 *) : no gethostbyname, so pick harmless default
21602 netdb_name_type='char *'
21607 : check for type of 1st argument to getnetbyaddr.
21608 if test "X$netdb_net_type" = X ; then
21609 case "$d_getnbyaddr" in
21613 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21615 hdrs="$define sys/types.h
21616 $d_socket sys/socket.h
21617 $i_niin netinet/in.h
21619 $i_unistd unistd.h"
21620 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21621 case "$netdb_net_type" in
21622 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21623 if ./protochk "$try" $hdrs; then
21624 echo "Your system accepts $xxx."
21625 netdb_net_type="$xxx"
21630 : In case none of those worked, prompt the user.
21631 case "$netdb_net_type" in
21632 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21635 netdb_net_type=$ans
21639 *) : no getnetbyaddr, so pick harmless default
21640 netdb_net_type='long'
21644 : locate the preferred pager for this system
21651 [a-zA-Z]:/*) dflt=$pg;;
21655 [a-zA-Z]:/*) dflt=$more;;
21659 [a-zA-Z]:/*) dflt=$less;;
21662 '') dflt=/usr/ucb/more;;
21670 rp='What pager is used on your system?'
21674 : see if ar generates random libraries by itself
21676 echo "Checking how to generate random libraries on your machine..." >&4
21677 echo 'int bar1() { return bar2(); }' > bar1.c
21678 echo 'int bar2() { return 2; }' > bar2.c
21680 #$i_stdlib I_STDLIB
21682 #include <stdlib.h>
21684 int main() { printf("%d\n", bar1()); exit(0); }
21686 $cc $ccflags -c bar1.c >/dev/null 2>&1
21687 $cc $ccflags -c bar2.c >/dev/null 2>&1
21688 $cc $ccflags -c foo.c >/dev/null 2>&1
21689 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21690 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21691 $run ./foobar >/dev/null 2>&1; then
21692 echo "$ar appears to generate random libraries itself."
21694 if [ "X$ranlib" = "X" ]; then
21697 elif $ar s bar$_a >/dev/null 2>&1 &&
21698 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21699 $run ./foobar >/dev/null 2>&1; then
21700 echo "a table of contents needs to be added with '$ar s'."
21703 elif $ar ts bar$_a >/dev/null 2>&1 &&
21704 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21705 $run ./foobar >/dev/null 2>&1; then
21706 echo "a table of contents needs to be added with '$ar ts'."
21713 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21714 $test -f $ranlib || ranlib=''
21717 if $test -n "$ranlib"; then
21718 echo "your system has '$ranlib'; we'll use that."
21721 echo "your system doesn't seem to support random libraries"
21722 echo "so we'll use lorder and tsort to order the libraries."
21729 : Check the max offset that gmtime and localtime accept
21730 echo "Checking max offsets that gmtime () accepts"
21732 case "$sGMTIME_min/$sGMTIME_max" in
21735 #include <sys/types.h>
21743 void gm_check (time_t t, int min_year, int max_year)
21746 if ( tmp == NULL ||
21747 /* Check tm_year overflow */
21748 tmp->tm_year < min_year || tmp->tm_year > max_year)
21759 gm_check (MAXLONG, 69, 0x7fffffff);
21761 if (tmp == NULL || tmp->tm_year < 0) {
21762 for (i = 63; i >= 0; i--) {
21763 time_t x = pt | ((time_t)1 << i);
21764 if (x < 0 || x < pt) continue;
21765 gm_check (x, 69, 0x7fffffff);
21768 printf ("sGMTIME_max=%ld\n", pt);
21777 gm_check (MINLONG, -1900, 70);
21780 for (i = 36; i >= 0; i--) {
21781 time_t x = pt - ((time_t)1 << i);
21782 if (x > 0) continue;
21783 gm_check (x, -1900, 70);
21786 printf ("sGMTIME_min=%ld\n", pt);
21790 int main (int argc, char *argv[])
21792 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21799 if eval $compile; then
21800 eval `$run ./try 2>/dev/null`
21802 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21808 echo "Checking max offsets that localtime () accepts"
21810 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21813 #include <sys/types.h>
21821 void local_check (time_t t, int min_year, int max_year)
21823 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21826 tmp = localtime (&t);
21827 if ( tmp == NULL ||
21828 /* Check tm_year overflow */
21829 tmp->tm_year < min_year || tmp->tm_year > max_year)
21833 } /* local_check */
21840 local_check (MAXLONG, 69, 0x7fffffff);
21842 if (tmp == NULL || tmp->tm_year < 0) {
21843 for (i = 63; i >= 0; i--) {
21844 time_t x = pt | ((time_t)1 << i);
21845 if (x < 0 || x < pt) continue;
21846 local_check (x, 69, 0x7fffffff);
21849 printf ("sLOCALTIME_max=%ld\n", pt);
21858 local_check (MINLONG, -1900, 70);
21861 for (i = 36; i >= 0; i--) {
21862 time_t x = pt - ((time_t)1 << i);
21863 if (x > 0) continue;
21864 local_check (x, -1900, 70);
21867 printf ("sLOCALTIME_min=%ld\n", pt);
21871 int main (int argc, char *argv[])
21879 if eval $compile; then
21880 eval `$run ./try 2>/dev/null`
21882 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21888 : check for type of arguments to select.
21889 case "$selecttype" in
21890 '') case "$d_select" in
21894 Checking to see what type of arguments are accepted by select().
21896 hdrs="$define sys/types.h
21897 $i_systime sys/time.h
21898 $i_sysselct sys/select.h
21899 $d_socket sys/socket.h"
21900 : The first arg can be int, unsigned, or size_t
21901 : The last arg may or may not be 'const'
21903 : void pointer has been seen but using that
21904 : breaks the selectminbits test
21905 for xxx in 'fd_set *' 'int *'; do
21906 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21907 for tmo in 'struct timeval *' 'const struct timeval *'; do
21909 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21910 if ./protochk "$try" $hdrs; then
21911 echo "Your system accepts $xxx."
21920 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21921 case "$d_fd_set" in
21922 $define) dflt="fd_set *" ;;
21931 *) : no select, so pick a harmless default
21938 : check for the select 'width'
21939 case "$selectminbits" in
21940 '') safebits=`expr $ptrsize \* 8`
21941 case "$d_select" in
21945 Checking to see on how many bits at a time your select() operates...
21948 #include <sys/types.h>
21950 #$i_systime I_SYS_TIME
21951 #$i_systimek I_SYS_TIME_KERNEL
21956 # ifdef I_SYS_TIME_KERNEL
21959 # include <sys/time.h>
21960 # ifdef I_SYS_TIME_KERNEL
21964 #$i_sysselct I_SYS_SELECT
21965 #ifdef I_SYS_SELECT
21966 #include <sys/select.h>
21968 #$d_socket HAS_SOCKET
21970 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21973 #$i_stdlib I_STDLIB
21975 #include <stdlib.h>
21978 #define S sizeof(*(b))
21980 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21981 #define NBITS (NBYTES * 8)
21983 char *s = (char *)malloc(NBYTES);
21992 fp = fopen("try.c", "r");
21998 b = ($selecttype)s;
21999 for (i = 0; i < NBITS; i++)
22003 select(fd + 1, b, 0, 0, &t);
22004 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22006 printf("%d\n", i + 1);
22011 if eval $compile_ok; then
22012 selectminbits=`$run ./try 2>/dev/null`
22013 case "$selectminbits" in
22015 Cannot figure out on how many bits at a time your select() operates.
22016 I'll play safe and guess it is $safebits bits.
22018 selectminbits=$safebits
22019 bits="$safebits bits"
22022 *) bits="$selectminbits bits" ;;
22024 echo "Your select() operates on $bits at a time." >&4
22026 rp='What is the minimum number of bits your select() operates on?'
22027 case "$byteorder" in
22028 12345678) dflt=64 ;;
22034 selectminbits="$val"
22038 *) : no select, so pick a harmless default
22039 selectminbits=$safebits
22045 : Trace out the files included by signal.h, then look for SIGxxx names.
22046 case "$sig_num_init" in
22048 if [ "X$fieldn" = X ]; then
22049 : Just make some guesses. We check them later.
22050 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22052 xxx=`echo '#include <signal.h>' |
22053 $cppstdin $cppminus $cppflags 2>/dev/null |
22054 $grep '^[ ]*#.*include' |
22055 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22056 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22059 for xx in $xxx /dev/null ; do
22060 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22062 case "$xxxfiles" in
22063 '') xxxfiles=`./findhdr signal.h` ;;
22066 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22067 print substr($2, 4, 20)
22069 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22070 print substr($3, 4, 20)
22072 : Append some common names just in case the awk scan failed.
22073 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22074 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22075 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22076 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22077 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22079 : generate a few handy files for later
22080 $cat > signal.c <<EOCP
22081 #include <sys/types.h>
22082 #include <signal.h>
22083 #$i_stdlib I_STDLIB
22085 #include <stdlib.h>
22090 /* Strange style to avoid deeply-nested #if/#else/#endif */
22093 # define NSIG (_NSIG)
22099 # define NSIG (SIGMAX+1)
22105 # define NSIG (SIG_MAX+1)
22111 # define NSIG (_SIG_MAX+1)
22117 # define NSIG (MAXSIG+1)
22123 # define NSIG (MAX_SIG+1)
22128 # ifdef SIGARRAYSIZE
22129 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22135 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22139 /* Default to some arbitrary number that's big enough to get most
22140 of the common signals.
22146 printf("NSIG %d\n", NSIG);
22152 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22154 printf "#ifdef SIG"; printf $1; printf "\n"
22155 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22156 printf $1; printf ");\n"
22160 printf "#endif /* JUST_NSIG */\n";
22161 printf "exit(0);\n}\n";
22164 $cat >signal.awk <<'EOP'
22165 BEGIN { ndups = 0 }
22166 $1 ~ /^NSIG$/ { nsig = $2 }
22167 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22168 if ($2 > maxsig) { maxsig = $2 }
22169 if (sig_name[$2]) {
22170 dup_name[ndups] = $1
22171 dup_num[ndups] = $2
22183 printf("NSIG %d\n", nsig);
22184 for (n = 1; n < nsig; n++) {
22186 printf("%s %d\n", sig_name[n], sig_num[n])
22189 printf("NUM%d %d\n", n, n)
22192 for (n = 0; n < ndups; n++) {
22193 printf("%s %d\n", dup_name[n], dup_num[n])
22197 $cat >signal_cmd <<EOS
22199 if $test -s signal.lst; then
22200 echo "Using your existing signal.lst file"
22205 $cat >>signal_cmd <<'EOS'
22208 if eval $compile_ok; then
22209 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22210 $uniq | $awk -f signal.awk >signal.lst
22212 echo "(I can't seem be able to compile the whole test program)" >&4
22213 echo "(I'll try it in little pieces.)" >&4
22214 set signal -DJUST_NSIG
22215 if eval $compile_ok; then
22216 $run ./signal$_exe > signal.nsg
22219 echo "I can't seem to figure out how many signals you have." >&4
22220 echo "Guessing 50." >&4
22221 echo 'NSIG 50' > signal.nsg
22223 : Now look at all the signal names, one at a time.
22224 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22225 $cat > signal.c <<EOCP
22226 #include <sys/types.h>
22227 #include <signal.h>
22230 printf("$xx %d\n", SIG${xx});
22235 if eval $compile; then
22236 echo "SIG${xx} found."
22237 $run ./signal$_exe >> signal.ls1
22239 echo "SIG${xx} NOT found."
22242 if $test -s signal.ls1; then
22243 $cat signal.nsg signal.ls1 |
22244 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22248 if $test -s signal.lst; then
22251 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22252 echo 'kill -l' >signal
22253 set X `csh -f <signal`
22257 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22259 echo $@ | $tr ' ' $trnl | \
22260 $awk '{ printf "%s %d\n", $1, ++s; }
22261 END { printf "NSIG %d\n", ++s }' >signal.lst
22263 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22265 chmod a+x signal_cmd
22266 $eunicefix signal_cmd
22270 : generate list of signal names
22271 case "$sig_num_init" in
22274 case "$sig_name_init" in
22276 *) case "$sig_num_init" in
22277 ''|*,*) doinit=yes ;;
22282 echo "Generating a list of signal names and numbers..." >&4
22284 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22285 sig_name=`$awk 'BEGIN { printf "ZERO " }
22286 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22287 sig_num=`$awk 'BEGIN { printf "0 " }
22288 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22289 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22290 !/^NSIG/ { printf "\"%s\", ", $1 }
22291 END { printf "0\n" }' signal.lst`
22292 sig_num_init=`$awk 'BEGIN { printf "0, " }
22293 !/^NSIG/ { printf "%d, ", $2}
22294 END { printf "0\n"}' signal.lst`
22297 echo "The following $sig_count signals are available:"
22299 echo $sig_name | $awk \
22300 'BEGIN { linelen = 0 }
22302 for (i = 1; i <= NF; i++) {
22303 name = "SIG" $i " "
22304 linelen = linelen + length(name)
22305 if (linelen > 70) {
22307 linelen = length(name)
22313 sig_size=`echo $sig_name | awk '{print NF}'`
22314 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22318 : Check size of size
22320 case "$sizetype" in
22321 *_t) zzz="$sizetype" ;;
22322 *) zzz="filesize" ;;
22324 echo "Checking the size of $zzz..." >&4
22326 #include <sys/types.h>
22328 #$i_stdlib I_STDLIB
22330 #include <stdlib.h>
22333 printf("%d\n", (int)sizeof($sizetype));
22338 if eval $compile_ok; then
22342 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22345 echo "Your $zzz size is $sizesize bytes."
22350 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22353 : check for socklen_t
22355 echo "Checking to see if you have socklen_t..." >&4
22357 #include <sys/types.h>
22358 #$d_socket HAS_SOCKET
22360 #include <sys/socket.h>
22362 int main() { socklen_t x = 16; }
22365 if eval $compile; then
22367 echo "You have socklen_t."
22370 echo "You do not have socklen_t."
22371 case "$sizetype" in
22372 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22379 : see if this is a socks.h system
22380 set socks.h i_socks
22383 : check for type of the size argument to socket calls
22384 case "$d_socket" in
22388 Checking to see what type is the last argument of accept().
22391 case "$d_socklen_t" in
22392 "$define") yyy="$yyy socklen_t"
22394 yyy="$yyy $sizetype int long unsigned"
22395 for xxx in $yyy; do
22396 case "$socksizetype" in
22397 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22398 case "$usesocks" in
22400 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22401 echo "Your system accepts '$xxx *' for the last argument of accept()."
22402 socksizetype="$xxx"
22405 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22406 echo "Your system accepts '$xxx *' for the last argument of accept()."
22407 socksizetype="$xxx"
22414 : In case none of those worked, prompt the user.
22415 case "$socksizetype" in
22416 '') rp='What is the type for socket address structure sizes?'
22423 *) : no sockets, so pick relatively harmless default
22428 : see what type is used for signed size_t
22429 set ssize_t ssizetype int stdio.h sys/types.h
22434 #$i_stdlib I_STDLIB
22436 #include <stdlib.h>
22438 #include <sys/types.h>
22439 #define Size_t $sizetype
22440 #define SSize_t $dflt
22443 if (sizeof(Size_t) == sizeof(SSize_t))
22445 else if (sizeof(Size_t) == sizeof(int))
22454 if eval $compile_ok && $run ./try > /dev/null; then
22455 ssizetype=`$run ./try`
22456 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22459 Help! I can't compile and run the ssize_t test program: please enlighten me!
22460 (This is probably a misconfiguration in your system or libraries, and
22461 you really ought to fix it. Still, I'll try anyway.)
22463 I need a type that is the same size as $sizetype, but is guaranteed to
22464 be signed. Common values are ssize_t, int and long.
22467 rp="What signed type is the same size as $sizetype?"
22473 : Check the size of st_ino
22475 $echo "Checking the size of st_ino..." >&4
22476 $cat > try.c <<EOCP
22477 #include <sys/stat.h>
22479 #$i_stdlib I_STDLIB
22481 #include <stdlib.h>
22485 printf("%d\n", (int)sizeof(st.st_ino));
22490 if eval $compile_ok; then
22494 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22496 *) st_ino_size=$val
22497 $echo "Your st_ino is $st_ino_size bytes long."
22502 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22506 : Check if st_ino is signed
22508 $echo "Checking the sign of st_ino..." >&4
22509 $cat > try.c <<EOCP
22510 #include <sys/stat.h>
22515 if (foo.st_ino < 0)
22522 if eval $compile; then
22526 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22528 *) st_ino_sign=$val
22529 case "$st_ino_sign" in
22530 1) $echo "Your st_ino is unsigned." ;;
22531 -1) $echo "Your st_ino is signed." ;;
22537 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22541 : see what type of char stdio uses.
22543 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22544 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22545 echo "Your stdio uses unsigned chars." >&4
22546 stdchar="unsigned char"
22548 echo "Your stdio uses signed chars." >&4
22553 : Check size of UID
22556 *_t) zzz="$uidtype" ;;
22559 echo "Checking the size of $zzz..." >&4
22561 #include <sys/types.h>
22563 #$i_stdlib I_STDLIB
22565 #include <stdlib.h>
22568 printf("%d\n", (int)sizeof($uidtype));
22573 if eval $compile_ok; then
22577 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22580 echo "Your $zzz is $uidsize bytes long."
22585 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22588 : Check if UID is signed
22591 *_t) zzz="$uidtype" ;;
22594 echo "Checking the sign of $zzz..." >&4
22596 #include <sys/types.h>
22607 if eval $compile; then
22611 echo "(I can't execute the test program--guessing unsigned.)" >&4
22615 1) echo "Your $zzz is unsigned." ;;
22616 -1) echo "Your $zzz is signed." ;;
22622 echo "(I can't compile the test program--guessing unsigned.)" >&4
22625 : Check format string for UID
22627 $echo "Checking the format string to be used for uids..." >&4
22630 -1) if $test X"$uidsize" = X"$ivsize"; then
22631 uidformat="$ivdformat"
22633 if $test X"$uidsize" = X"$longsize"; then
22636 if $test X"$uidsize" = X"$intsize"; then
22639 if $test X"$uidsize" = X"$shortsize"; then
22646 *) if $test X"$uidsize" = X"$uvsize"; then
22647 uidformat="$uvuformat"
22649 if $test X"$uidsize" = X"$longsize"; then
22652 if $test X"$uidsize" = X"$intsize"; then
22655 if $test X"$uidsize" = X"$shortsize"; then
22664 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22666 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22667 $cat >try.c <<'EOM'
22668 /* Intentionally a long probe as I'd like to sanity check that the exact
22669 approach is going to work, as thinking it will work, but only having it
22670 part working at runtime is worse than not having it. */
22672 #include <sys/types.h>
22673 #include <sys/sysctl.h>
22674 #include <sys/param.h>
22676 #include <string.h>
22677 #include <stdlib.h>
22678 #include <unistd.h>
22681 main(int argc, char **argv) {
22683 char *argv_leaf = strrchr(argv[0], '/');
22689 mib[1] = KERN_PROC;
22690 mib[2] = KERN_PROC_PATHNAME;
22694 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22698 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22703 if (size < strlen(argv_leaf) + 1) {
22704 fprintf(stderr, "size %lu is too short for a path\n",
22705 (unsigned long) size);
22709 if (size > MAXPATHLEN * MAXPATHLEN) {
22710 fprintf(stderr, "size %lu is too long for a path\n",
22711 (unsigned long) size);
22715 buffer = (char *)malloc(size);
22721 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22726 if (strlen(buffer) + 1 != size) {
22727 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22728 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22733 if (*buffer != '/') {
22734 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22738 if (strstr(buffer, "/./")) {
22739 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22743 if (strstr(buffer, "/../")) {
22744 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22748 buffer_leaf = strrchr(buffer, '/');
22749 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22750 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22762 if eval $compile; then
22763 if $run ./try; then
22764 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22767 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22771 echo "I'm unable to compile the test program." >&4
22772 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22776 set usekernprocpathname
22779 : Determine if we can use _NSGetExecutablePath to find executing program
22781 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22782 $cat >try.c <<'EOM'
22783 /* Intentionally a long probe as I'd like to sanity check that the exact
22784 approach is going to work, as thinking it will work, but only having it
22785 part working at runtime is worse than not having it. */
22786 #include <mach-o/dyld.h>
22788 #include <stdlib.h>
22789 #include <sys/param.h>
22790 #include <string.h>
22793 main(int argc, char **argv) {
22795 uint32_t size = sizeof(buf);
22799 char *argv_leaf = strrchr(argv[0], '/');
22803 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22807 _NSGetExecutablePath(buf, &size);
22808 if (size > MAXPATHLEN * MAXPATHLEN) {
22809 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22810 (unsigned int) size);
22814 buffer = (char *)malloc(size);
22820 result = _NSGetExecutablePath(buffer, &size);
22822 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22823 result, (unsigned int) size);
22827 tidied = realpath(buffer, NULL);
22829 perror("realpath");
22835 if (*tidied != '/') {
22836 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22840 if (strstr(tidied, "/./")) {
22841 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22845 if (strstr(tidied, "/../")) {
22846 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22850 tidied_leaf = strrchr(tidied, '/');
22851 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22852 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22864 if eval $compile; then
22865 if $run ./try; then
22866 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22869 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22872 echo "I'm unable to compile the test program." >&4
22873 echo "I'll assume no _NSGetExecutablePath here." >&4
22876 set usensgetexecutablepath
22879 : Check if site customization support was requested
22880 case "$usesitecustomize" in
22881 $define|true|[Yy]*)
22882 usesitecustomize="$define"
22885 usesitecustomize="$undef"
22889 : determine compiler compiler
22898 if $test -f "$byacc$_exe"; then
22900 comp="byacc or $comp"
22902 if $test -f "$bison$_exe"; then
22903 comp="$comp or bison -y"
22905 rp="Which compiler compiler ($comp) shall I use?"
22914 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22920 : see if this is a bfd.h system
22924 : see if this is an execinfo.h system
22925 set execinfo.h i_execinfo
22928 : see if this is a fenv.h system
22932 : see if this is a fp.h system
22936 : see if this is a fp_class.h system
22937 set fp_class.h i_fp_class
22940 : see if gdbm.h is available
22945 : see if gdbm_open exists
22946 set gdbm_open d_gdbm_open
22948 case "$d_gdbm_open" in
22951 echo "We won't be including <gdbm.h>"
22960 : see if this is a ieeefp.h system
22961 case "$i_ieeefp" in
22962 '' ) set ieeefp.h i_ieeefp
22967 : see if this is a libutil.h system
22968 set libutil.h i_libutil
22971 : see if mach cthreads are available
22972 if test "X$usethreads" = "X$define"; then
22973 set mach/cthreads.h i_machcthr
22976 i_machcthr="$undef"
22979 : see if this is a mntent.h system
22980 set mntent.h i_mntent
22983 : see if net/errno.h is available
22985 set net/errno.h val
22988 : Unfortunately, it causes problems on some systems. Arrgh.
22991 cat > try.c <<'EOM'
22994 #include <net/errno.h>
23000 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23001 echo "We'll be including <net/errno.h>." >&4
23003 echo "We won't be including <net/errno.h>." >&4
23012 : see if netinet/tcp.h is available
23013 set netinet/tcp.h i_netinettcp
23016 : see if this is a poll.h system
23020 : see if this is a prot.h system
23024 : Preprocessor symbols
23026 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23027 $cat <<'EOSH' > Cppsym.know
23028 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23029 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23030 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23031 arch_pwr ardent ARM ARM32 atarist att386 att3b
23032 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23033 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23034 byteorder byte_order
23035 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23036 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23037 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23038 ELF encore EPI EXTENSIONS
23039 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23040 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23041 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23042 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23043 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23044 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23045 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23046 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23047 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23049 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23050 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23051 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23053 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23054 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23055 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23056 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23057 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23058 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23059 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23060 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23061 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23062 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23063 ns32000 ns32016 ns32332 ns32k nsc32000
23064 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23065 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23066 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23067 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23069 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23070 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23071 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23072 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23073 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23074 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23075 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23076 SYSV4 SYSV5 sysV68 sysV88
23077 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23078 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23079 tower32_800 tower32_850 tss
23080 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23081 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23082 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23083 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23084 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23085 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23087 vax venix VMESA vms
23088 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23089 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23092 # Maybe put other stuff here too.
23093 ./tr '-' '_' <<EOSH >>Cppsym.know
23096 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23097 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23098 $cat Cppsym.know > Cppsym.c
23099 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23100 $rm -f Cppsym.a Cppsym.b Cppsym.c
23101 cat <<EOSH > Cppsym
23103 if $test \$# -gt 0; then
23104 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23105 if $test -s Cppsym.got; then
23112 $tr " " "$trnl" | ./Cppsym.try
23118 cat <<EOSH > Cppsym.try
23120 cat <<'EOCP' > try.c
23123 #define STRINGIFY(a) "a"
23125 #if cpp_stuff == 42
23126 #define StGiFy(a) #a
23127 #define STRINGIFY(a) StGiFy(a)
23129 #if $cpp_stuff != 1 && $cpp_stuff != 42
23130 # include "Bletch: How does this C preprocessor stringify macros?"
23136 cat <<'EOSH' >> Cppsym.try
23138 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23139 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23140 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23141 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23143 echo 'return 0;}' >> try.c
23145 cat <<EOSH >> Cppsym.try
23147 case "$osname-$gccversion" in
23148 irix-) ccflags="\$ccflags -woff 1178" ;;
23149 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23151 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23153 chmod +x Cppsym.try
23154 $eunicefix Cppsym.try
23155 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23156 : Add in any Linux cpp "predefined macros":
23157 case "$osname::$gccversion" in
23158 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23160 rm -f $tHdrH'.h' $tHdrH
23162 # Filter out macro arguments, such as Linux's __INT8_C(c)
23163 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23164 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23165 if [ -s $tHdrH'_cppsym.real' ]; then
23166 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23169 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23172 : now check the C compiler for additional symbols
23173 postprocess_cc_v=''
23175 aix) postprocess_cc_v="|$tr , ' '" ;;
23182 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23185 -D*) echo "\$i" | $sed 's/^-D//';;
23186 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23191 postprocess_cc_v=''
23194 ./ccsym > ccsym1.raw
23195 if $test -s ccsym1.raw; then
23196 $sort ccsym1.raw | $uniq >ccsym.raw
23198 mv ccsym1.raw ccsym.raw
23201 $awk '/\=/ { print $0; next }
23202 { print $0"=1" }' ccsym.raw >ccsym.list
23203 $comm -13 Cppsym.true ccsym.list >ccsym.own
23204 $comm -12 Cppsym.true ccsym.list >ccsym.com
23205 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23207 if $test -z ccsym.raw; then
23208 echo "Your C compiler doesn't seem to define any symbols!" >&4
23210 echo "However, your C preprocessor defines the following symbols:"
23213 cppsymbols=`$cat Cppsym.true`
23214 cppsymbols=`echo $cppsymbols`
23215 cppccsymbols="$cppsymbols"
23217 if $test -s ccsym.com; then
23218 echo "Your C compiler and pre-processor define these symbols:"
23219 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23222 cppccsymbols=`$cat ccsym.com`
23223 cppccsymbols=`echo $cppccsymbols`
23224 $test "$silent" || sleep 1
23226 if $test -s ccsym.cpp; then
23227 $test "$also" && echo " "
23228 echo "Your C pre-processor ${also}defines the following symbols:"
23229 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23231 cppsymbols=`$cat ccsym.cpp`
23232 cppsymbols=`echo $cppsymbols`
23233 $test "$silent" || sleep 1
23235 if $test -s ccsym.own; then
23236 $test "$also" && echo " "
23237 echo "Your C compiler ${also}defines the following cpp symbols:"
23238 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23239 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23240 ccsymbols=`$cat ccsym.own`
23241 ccsymbols=`echo $ccsymbols`
23242 $test "$silent" || sleep 1
23246 : add -D_FORTIFY_SOURCE if feasible and not already there
23247 case "$gccversion" in
23248 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
23249 *-O*) case "$ccflags$cppsymbols" in
23250 *_FORTIFY_SOURCE=*) # Don't add it again.
23251 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23253 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23254 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23258 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23262 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23266 : script used to emit important warnings
23269 if test \$# -gt 0; then
23274 echo "*** WARNING:" >&4
23275 sed -e 's/^/*** /' <msg >&4
23277 cat msg >>config.msg
23278 echo " " >>config.msg
23284 : see if this is a termio system
23288 if $test `./findhdr termios.h`; then
23289 set tcsetattr i_termios
23295 "$define") echo "You have POSIX termios.h... good!" >&4;;
23296 *) if ./Cppsym pyr; then
23297 case "`$run /bin/universe`" in
23298 ucb) if $test `./findhdr sgtty.h`; then
23300 echo "<sgtty.h> found." >&4
23302 echo "System is pyramid with BSD universe."
23303 ./warn "<sgtty.h> not found--you could have problems."
23305 *) if $test `./findhdr termio.h`; then
23307 echo "<termio.h> found." >&4
23309 echo "System is pyramid with USG universe."
23310 ./warn "<termio.h> not found--you could have problems."
23314 if $test `./findhdr termio.h`; then
23315 echo "<termio.h> found." >&4
23317 elif $test `./findhdr sgtty.h`; then
23318 echo "<sgtty.h> found." >&4
23321 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23324 if $test `./findhdr sgtty.h`; then
23325 echo "<sgtty.h> found." >&4
23327 elif $test `./findhdr termio.h`; then
23328 echo "<termio.h> found." >&4
23331 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23335 set i_termio; eval $setvar
23336 val=$val2; set i_sgtty; eval $setvar
23337 val=$val3; set i_termios; eval $setvar
23339 : see if stdbool is available
23340 : we want a real compile instead of Inhdr because some Solaris systems
23341 : have stdbool.h, but it can only be used if the compiler indicates it
23342 : is sufficiently c99-compliant.
23346 #include <stdbool.h>
23351 int main(int argc, char **argv)
23357 if eval $compile; then
23358 echo "<stdbool.h> found." >&4
23361 echo "<stdbool.h> NOT found." >&4
23368 : see if stdint is available
23369 set stdint.h i_stdint
23372 : see if sys/access.h is available
23373 set sys/access.h i_sysaccess
23376 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23377 set sys/filio.h i_sysfilio
23380 if $test `./findhdr sys/ioctl.h`; then
23382 echo '<sys/ioctl.h> found.' >&4
23385 if $test $i_sysfilio = "$define"; then
23386 echo '<sys/ioctl.h> NOT found.' >&4
23388 $test $i_sgtty = "$define" && xxx="sgtty.h"
23389 $test $i_termio = "$define" && xxx="termio.h"
23390 $test $i_termios = "$define" && xxx="termios.h"
23391 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23397 : see if socket ioctl defs are in sys/sockio.h
23399 xxx=`./findhdr sys/sockio.h`
23400 if $test "$xxx"; then
23401 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23403 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23406 echo "No socket ioctls found in <sys/sockio.h>." >&4
23411 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23417 : see if this is a syslog.h system
23418 set syslog.h i_syslog
23421 : see if this is a sys/mode.h system
23422 set sys/mode.h i_sysmode
23425 : see if there is a sys/poll.h file
23426 set sys/poll.h i_syspoll
23429 : see if sys/resource.h has to be included
23430 set sys/resource.h i_sysresrc
23433 : see if sys/security.h is available
23434 set sys/security.h i_syssecrt
23437 : see if this is a sys/statvfs.h system
23438 set sys/statvfs.h i_sysstatvfs
23441 : see if this is a sys/un.h system
23442 set sys/un.h i_sysun
23445 : see if this is a sys/utsname.h system
23446 set sys/utsname.h i_sysutsname
23449 : see if this is a syswait system
23450 set sys/wait.h i_syswait
23453 : see if this is a ustat.h system
23454 set ustat.h i_ustat
23457 : see if this is an utime system
23458 set utime.h i_utime
23461 : see if this is a vfork system
23464 set vfork.h i_vfork
23472 : see if wchar.h is present
23473 set wchar.h i_wchar
23478 echo "Looking for extensions..." >&4
23479 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23480 : contain old or inaccurate or duplicate values.
23481 nonxs_extensions=''
23483 : We do not use find because it might not be available.
23484 : We do not just use MANIFEST because the user may have dropped
23485 : some additional extensions into the source tree and expect them
23488 : Function to recursively find available extensions, ignoring DynaLoader
23489 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23490 : In 5.10.1 and later, extensions are stored in directories
23491 : like File-Glob instead of the older File/Glob/.
23495 DynaLoader|dynaload) ;;
23497 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23498 case "$this_ext" in
23499 Scalar/List/Utils) this_ext="List/Util" ;;
23500 PathTools) this_ext="Cwd" ;;
23502 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23503 if $contains " $this_ext " "$tdir/$$.tmp"; then
23505 echo "Duplicate directories detected for extension $xxx" >&4;
23506 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23507 case "$knowitall" in
23515 echo "Ok. Stopping Configure." >&4;
23516 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23519 echo "Ok. You will need to correct config.sh before running make." >&4;
23521 $ls -1 "$xxx" > "$tdir/$$.tmp";
23522 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23523 xs_extensions="$xs_extensions $this_ext";
23524 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23525 xs_extensions="$xs_extensions $this_ext";
23526 elif $test -d "$xxx"; then
23527 nonxs_extensions="$nonxs_extensions $this_ext";
23529 $rm -f "$tdir/$$.tmp";
23537 eval $find_extensions
23541 eval $find_extensions
23545 eval $find_extensions
23546 set X $xs_extensions
23548 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23549 set X $nonxs_extensions
23551 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23553 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23555 : Now see which are supported on this system.
23557 for xxx in $xs_extensions ; do
23561 amigaos) avail_ext="$avail_ext $xxx" ;;
23566 $define) avail_ext="$avail_ext $xxx" ;;
23569 GDBM_File|gdbm_fil)
23571 $define) avail_ext="$avail_ext $xxx" ;;
23575 : XXX Do we need a useipcsysv variable here
23576 case "${d_msg}${d_sem}${d_shm}" in
23577 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23580 NDBM_File|ndbm_fil)
23583 case "$osname-$use64bitint" in
23586 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23589 *) avail_ext="$avail_ext $xxx" ;;
23594 ODBM_File|odbm_fil)
23595 case "${i_dbm}${i_rpcsvcdbm}" in
23597 case "$d_cplusplus" in
23598 define) ;; # delete as a function name will not work
23599 *) case "$osname-$use64bitint" in
23602 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23605 *) avail_ext="$avail_ext $xxx" ;;
23613 case "$useopcode" in
23614 true|define|y) avail_ext="$avail_ext $xxx" ;;
23618 case "$useposix" in
23619 true|define|y) avail_ext="$avail_ext $xxx" ;;
23623 case "$d_socket" in
23624 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23627 I18N/Langinfo|langinfo)
23628 case "$uselanginfo" in
23629 true|define|y) avail_ext="$avail_ext $xxx" ;;
23632 Sys/Syslog|sys/syslog)
23634 amigaos) ;; # not really very useful on AmigaOS
23636 : XXX syslog requires socket
23637 case "$d_socket" in
23638 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23644 case "$usethreads" in
23646 case "$use5005threads" in
23647 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23651 threads|threads/shared)
23652 # threads and threads::shared are special cases.
23653 # To stop people from asking "Perl 5.8.0 was supposed
23654 # to have this new fancy threads implementation but my
23655 # perl doesn't have it" and from people trying to
23656 # (re)install the threads module using CPAN.pm and
23657 # CPAN.pm then offering to reinstall Perl 5.8.0,
23658 # the threads.pm and threads/shared.pm will always be
23659 # there, croaking informatively ("you need to rebuild
23660 # all of Perl with threads, sorry") when threads haven't
23661 # been compiled in.
23663 avail_ext="$avail_ext $xxx"
23669 cygwin) avail_ext="$avail_ext $xxx" ;;
23672 XS/APItest|xs/apitest)
23673 # This is just for testing. Skip it unless we have dynamic loading.
23676 $define) avail_ext="$avail_ext $xxx" ;;
23679 XS/Typemap|xs/typemap)
23680 # This is just for testing. Skip it unless we have dynamic loading.
23682 $define) avail_ext="$avail_ext $xxx" ;;
23685 *) avail_ext="$avail_ext $xxx"
23694 case "$onlyextensions" in
23696 *) keepextensions=''
23697 echo "You have requested that only certain extensions be included..." >&4
23698 for i in $onlyextensions; do
23699 case " $avail_ext " in
23701 echo "Keeping extension $i."
23702 keepextensions="$keepextensions $i"
23704 *) echo "Ignoring extension $i." ;;
23707 avail_ext="$keepextensions"
23711 case "$noextensions" in
23713 *) keepextensions=''
23714 echo "You have requested that certain extensions be ignored..." >&4
23715 for i in $avail_ext; do
23716 case " $noextensions " in
23717 *" $i "*) echo "Ignoring extension $i." ;;
23718 *) echo "Keeping extension $i.";
23719 keepextensions="$keepextensions $i"
23723 avail_ext="$keepextensions"
23727 : Now see which nonxs extensions are supported on this system.
23728 : For now assume all are.
23730 for xxx in $nonxs_extensions ; do
23734 *) nonxs_ext="$nonxs_ext $xxx"
23746 A number of extensions are supplied with $package. You may choose to
23747 compile these extensions for dynamic loading (the default), compile
23748 them into the $package executable (static loading), or not include
23749 them at all. Answer "none" to include no extensions.
23750 Note that DynaLoader is always built and need not be mentioned here.
23753 case "$dynamic_ext" in
23755 : Exclude those listed in static_ext
23757 for xxx in $avail_ext; do
23758 case " $static_ext " in
23760 *) dflt="$dflt $xxx" ;;
23767 *) dflt="$dynamic_ext"
23768 # Perhaps we are reusing an old out-of-date config.sh.
23771 if test X"$dynamic_ext" != X"$avail_ext"; then
23773 NOTICE: Your previous config.sh list may be incorrect.
23774 The extensions now available to you are
23776 but the default list from your previous config.sh is
23788 rp="What extensions do you wish to load dynamically?"
23791 none) dynamic_ext=' ' ;;
23792 *) dynamic_ext="$ans" ;;
23795 case "$static_ext" in
23797 : Exclude those already listed in dynamic linking
23799 for xxx in $avail_ext; do
23800 case " $dynamic_ext " in
23802 *) dflt="$dflt $xxx" ;;
23809 *) dflt="$static_ext"
23816 rp="What extensions do you wish to load statically?"
23819 none) static_ext=' ' ;;
23820 *) static_ext="$ans" ;;
23825 A number of extensions are supplied with $package. Answer "none"
23826 to include no extensions.
23827 Note that DynaLoader is always built and need not be mentioned here.
23830 case "$static_ext" in
23831 '') dflt="$avail_ext" ;;
23832 *) dflt="$static_ext"
23833 # Perhaps we are reusing an old out-of-date config.sh.
23836 if test X"$static_ext" != X"$avail_ext"; then
23838 NOTICE: Your previous config.sh list may be incorrect.
23839 The extensions now available to you are
23841 but the default list from your previous config.sh is
23850 : Exclude those that are not xs extensions
23854 rp="What extensions do you wish to include?"
23857 none) static_ext=' ' ;;
23858 *) static_ext="$ans" ;;
23863 # Encode is a special case. If we are building Encode as a static
23864 # extension, we need to explicitly list its subextensions as well.
23865 # For other nested extensions, this is handled automatically by
23866 # the appropriate Makefile.PL.
23867 case " $static_ext " in
23868 *" Encode "*) # Add the subextensions of Encode
23870 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23871 static_ext="$static_ext Encode/$xxx"
23872 known_extensions="$known_extensions Encode/$xxx"
23878 set X $dynamic_ext $static_ext $nonxs_ext
23882 # Sanity check: We require an extension suitable for use with
23883 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23884 # should show up as failures in the test suite, but it's helpful to
23885 # catch them now.) The 'extensions' list is normally sorted
23886 # alphabetically, so we need to accept either
23887 # DB_File ... Fcntl ... IO ....
23888 # or something like
23889 # Fcntl ... NDBM_File ... IO ....
23890 case " $extensions" in
23891 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23892 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23893 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23894 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23895 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23899 : Remove libraries needed only for extensions
23900 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23901 : The exception is SunOS 4.x, which needs them.
23902 case "${osname}X${osvers}" in
23906 *) case "$usedl" in
23907 $define|true|[yY]*)
23908 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23912 *) perllibs="$libs"
23918 : Remove build directory name from cppstdin so it can be used from
23919 : either the present location or the final installed location.
23921 : Get out of the UU directory to get correct path name.
23923 case "$cppstdin" in
23925 echo "Stripping down cppstdin path name"
23931 : end of configuration questions
23933 echo "End of configuration questions."
23936 : back to where it started
23937 if test -d ../UU; then
23941 : configuration may be unconditionally patched via a 'config.arch' file
23942 if $test -f config.arch; then
23943 echo "I see a config.arch file, loading it." >&4
23947 : configuration may be patched via a 'config.over' file
23948 if $test -f config.over; then
23951 rp='I see a config.over file. Do you wish to load it?'
23954 n*) echo "OK, I'll ignore it.";;
23956 echo "Configuration override changes have been loaded."
23961 : in case they want portability, strip down executable paths
23962 case "$d_portable" in
23965 echo "Stripping down executable paths..." >&4
23966 for file in $loclist $trylist; do
23968 eval $file=`basename $temp`
23973 : create config.sh file
23975 echo "Creating config.sh..." >&4
23976 $spitshell <<EOT >config.sh
23979 # This file was produced by running the Configure script. It holds all the
23980 # definitions figured out by Configure. Should you modify one of these values,
23981 # do not forget to propagate your changes by running "Configure -der". You may
23982 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23985 # Package name : $package
23986 # Source directory : $src
23987 # Configuration time: $cf_time
23988 # Configured by : $cf_by
23989 # Target system : $myuname
23992 : Add in command line options if available
23993 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23995 $spitshell <<EOT >>config.sh
24004 Revision='$Revision'
24012 alignbytes='$alignbytes'
24013 aphostname='$aphostname'
24014 api_revision='$api_revision'
24015 api_subversion='$api_subversion'
24016 api_version='$api_version'
24017 api_versionstring='$api_versionstring'
24020 archlibexp='$archlibexp'
24021 archname64='$archname64'
24022 archname='$archname'
24023 archobjs='$archobjs'
24024 asctime_r_proto='$asctime_r_proto'
24033 byteorder='$byteorder'
24035 castflags='$castflags'
24038 cccdlflags='$cccdlflags'
24039 ccdlflags='$ccdlflags'
24041 ccflags_uselargefiles='$ccflags_uselargefiles'
24043 ccsymbols='$ccsymbols'
24044 ccversion='$ccversion'
24046 cf_email='$cf_email'
24048 charbits='$charbits'
24049 charsize='$charsize'
24053 clocktype='$clocktype'
24055 compress='$compress'
24056 contains='$contains'
24060 cpp_stuff='$cpp_stuff'
24061 cppccsymbols='$cppccsymbols'
24062 cppflags='$cppflags'
24064 cppminus='$cppminus'
24066 cppstdin='$cppstdin'
24067 cppsymbols='$cppsymbols'
24068 crypt_r_proto='$crypt_r_proto'
24069 cryptlib='$cryptlib'
24071 ctermid_r_proto='$ctermid_r_proto'
24072 ctime_r_proto='$ctime_r_proto'
24073 d_Gconvert='$d_Gconvert'
24074 d_PRIEUldbl='$d_PRIEUldbl'
24075 d_PRIFUldbl='$d_PRIFUldbl'
24076 d_PRIGUldbl='$d_PRIGUldbl'
24077 d_PRIXU64='$d_PRIXU64'
24078 d_PRId64='$d_PRId64'
24079 d_PRIeldbl='$d_PRIeldbl'
24080 d_PRIfldbl='$d_PRIfldbl'
24081 d_PRIgldbl='$d_PRIgldbl'
24082 d_PRIi64='$d_PRIi64'
24083 d_PRIo64='$d_PRIo64'
24084 d_PRIu64='$d_PRIu64'
24085 d_PRIx64='$d_PRIx64'
24086 d_SCNfldbl='$d_SCNfldbl'
24087 d__fwalk='$d__fwalk'
24088 d_accept4='$d_accept4'
24089 d_access='$d_access'
24090 d_accessx='$d_accessx'
24094 d_archlib='$d_archlib'
24095 d_asctime64='$d_asctime64'
24096 d_asctime_r='$d_asctime_r'
24101 d_attribute_always_inline='$d_attribute_always_inline'
24102 d_attribute_deprecated='$d_attribute_deprecated'
24103 d_attribute_format='$d_attribute_format'
24104 d_attribute_malloc='$d_attribute_malloc'
24105 d_attribute_nonnull='$d_attribute_nonnull'
24106 d_attribute_noreturn='$d_attribute_noreturn'
24107 d_attribute_pure='$d_attribute_pure'
24108 d_attribute_unused='$d_attribute_unused'
24109 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24110 d_backtrace='$d_backtrace'
24112 d_bsdgetpgrp='$d_bsdgetpgrp'
24113 d_bsdsetpgrp='$d_bsdsetpgrp'
24114 d_builtin_add_overflow='$d_builtin_add_overflow'
24115 d_builtin_choose_expr='$d_builtin_choose_expr'
24116 d_builtin_expect='$d_builtin_expect'
24117 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24118 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24119 d_c99_variadic_macros='$d_c99_variadic_macros'
24120 d_casti32='$d_casti32'
24121 d_castneg='$d_castneg'
24124 d_chroot='$d_chroot'
24125 d_chsize='$d_chsize'
24127 d_clearenv='$d_clearenv'
24128 d_closedir='$d_closedir'
24129 d_cmsghdr_s='$d_cmsghdr_s'
24130 d_copysign='$d_copysign'
24131 d_copysignl='$d_copysignl'
24132 d_cplusplus='$d_cplusplus'
24134 d_crypt_r='$d_crypt_r'
24136 d_ctermid='$d_ctermid'
24137 d_ctermid_r='$d_ctermid_r'
24138 d_ctime64='$d_ctime64'
24139 d_ctime_r='$d_ctime_r'
24140 d_cuserid='$d_cuserid'
24141 d_dbminitproto='$d_dbminitproto'
24142 d_difftime64='$d_difftime64'
24143 d_difftime='$d_difftime'
24144 d_dir_dd_fd='$d_dir_dd_fd'
24146 d_dirnamlen='$d_dirnamlen'
24147 d_dladdr='$d_dladdr'
24148 d_dlerror='$d_dlerror'
24149 d_dlopen='$d_dlopen'
24150 d_dlsymun='$d_dlsymun'
24151 d_dosuid='$d_dosuid'
24152 d_double_has_inf='$d_double_has_inf'
24153 d_double_has_nan='$d_double_has_nan'
24154 d_double_has_negative_zero='$d_double_has_negative_zero'
24155 d_double_has_subnormals='$d_double_has_subnormals'
24156 d_double_style_cray='$d_double_style_cray'
24157 d_double_style_ibm='$d_double_style_ibm'
24158 d_double_style_ieee='$d_double_style_ieee'
24159 d_double_style_vax='$d_double_style_vax'
24160 d_drand48_r='$d_drand48_r'
24161 d_drand48proto='$d_drand48proto'
24164 d_duplocale='$d_duplocale'
24165 d_eaccess='$d_eaccess'
24166 d_endgrent='$d_endgrent'
24167 d_endgrent_r='$d_endgrent_r'
24168 d_endhent='$d_endhent'
24169 d_endhostent_r='$d_endhostent_r'
24170 d_endnent='$d_endnent'
24171 d_endnetent_r='$d_endnetent_r'
24172 d_endpent='$d_endpent'
24173 d_endprotoent_r='$d_endprotoent_r'
24174 d_endpwent='$d_endpwent'
24175 d_endpwent_r='$d_endpwent_r'
24176 d_endsent='$d_endsent'
24177 d_endservent_r='$d_endservent_r'
24178 d_eofnblk='$d_eofnblk'
24181 d_eunice='$d_eunice'
24184 d_faststdio='$d_faststdio'
24185 d_fchdir='$d_fchdir'
24186 d_fchmod='$d_fchmod'
24187 d_fchmodat='$d_fchmodat'
24188 d_fchown='$d_fchown'
24190 d_fcntl_can_lock='$d_fcntl_can_lock'
24191 d_fd_macros='$d_fd_macros'
24192 d_fd_set='$d_fd_set'
24193 d_fdclose='$d_fdclose'
24195 d_fds_bits='$d_fds_bits'
24196 d_fegetround='$d_fegetround'
24197 d_fgetpos='$d_fgetpos'
24198 d_finite='$d_finite'
24199 d_finitel='$d_finitel'
24200 d_flexfnam='$d_flexfnam'
24202 d_flockproto='$d_flockproto'
24207 d_fp_class='$d_fp_class'
24208 d_fp_classify='$d_fp_classify'
24209 d_fp_classl='$d_fp_classl'
24210 d_fpathconf='$d_fpathconf'
24211 d_fpclass='$d_fpclass'
24212 d_fpclassify='$d_fpclassify'
24213 d_fpclassl='$d_fpclassl'
24214 d_fpgetround='$d_fpgetround'
24215 d_fpos64_t='$d_fpos64_t'
24216 d_freelocale='$d_freelocale'
24217 d_frexpl='$d_frexpl'
24218 d_fs_data_s='$d_fs_data_s'
24219 d_fseeko='$d_fseeko'
24220 d_fsetpos='$d_fsetpos'
24221 d_fstatfs='$d_fstatfs'
24222 d_fstatvfs='$d_fstatvfs'
24224 d_ftello='$d_ftello'
24226 d_futimes='$d_futimes'
24227 d_gai_strerror='$d_gai_strerror'
24228 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24229 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24230 d_getaddrinfo='$d_getaddrinfo'
24231 d_getcwd='$d_getcwd'
24232 d_getespwnam='$d_getespwnam'
24233 d_getfsstat='$d_getfsstat'
24234 d_getgrent='$d_getgrent'
24235 d_getgrent_r='$d_getgrent_r'
24236 d_getgrgid_r='$d_getgrgid_r'
24237 d_getgrnam_r='$d_getgrnam_r'
24238 d_getgrps='$d_getgrps'
24239 d_gethbyaddr='$d_gethbyaddr'
24240 d_gethbyname='$d_gethbyname'
24241 d_gethent='$d_gethent'
24242 d_gethname='$d_gethname'
24243 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24244 d_gethostbyname_r='$d_gethostbyname_r'
24245 d_gethostent_r='$d_gethostent_r'
24246 d_gethostprotos='$d_gethostprotos'
24247 d_getitimer='$d_getitimer'
24248 d_getlogin='$d_getlogin'
24249 d_getlogin_r='$d_getlogin_r'
24250 d_getmnt='$d_getmnt'
24251 d_getmntent='$d_getmntent'
24252 d_getnameinfo='$d_getnameinfo'
24253 d_getnbyaddr='$d_getnbyaddr'
24254 d_getnbyname='$d_getnbyname'
24255 d_getnent='$d_getnent'
24256 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24257 d_getnetbyname_r='$d_getnetbyname_r'
24258 d_getnetent_r='$d_getnetent_r'
24259 d_getnetprotos='$d_getnetprotos'
24260 d_getpagsz='$d_getpagsz'
24261 d_getpbyname='$d_getpbyname'
24262 d_getpbynumber='$d_getpbynumber'
24263 d_getpent='$d_getpent'
24264 d_getpgid='$d_getpgid'
24265 d_getpgrp2='$d_getpgrp2'
24266 d_getpgrp='$d_getpgrp'
24267 d_getppid='$d_getppid'
24268 d_getprior='$d_getprior'
24269 d_getprotobyname_r='$d_getprotobyname_r'
24270 d_getprotobynumber_r='$d_getprotobynumber_r'
24271 d_getprotoent_r='$d_getprotoent_r'
24272 d_getprotoprotos='$d_getprotoprotos'
24273 d_getprpwnam='$d_getprpwnam'
24274 d_getpwent='$d_getpwent'
24275 d_getpwent_r='$d_getpwent_r'
24276 d_getpwnam_r='$d_getpwnam_r'
24277 d_getpwuid_r='$d_getpwuid_r'
24278 d_getsbyname='$d_getsbyname'
24279 d_getsbyport='$d_getsbyport'
24280 d_getsent='$d_getsent'
24281 d_getservbyname_r='$d_getservbyname_r'
24282 d_getservbyport_r='$d_getservbyport_r'
24283 d_getservent_r='$d_getservent_r'
24284 d_getservprotos='$d_getservprotos'
24285 d_getspnam='$d_getspnam'
24286 d_getspnam_r='$d_getspnam_r'
24287 d_gettimeod='$d_gettimeod'
24288 d_gmtime64='$d_gmtime64'
24289 d_gmtime_r='$d_gmtime_r'
24290 d_gnulibc='$d_gnulibc'
24291 d_grpasswd='$d_grpasswd'
24292 d_has_C_UTF8='$d_has_C_UTF8'
24293 d_hasmntopt='$d_hasmntopt'
24297 d_ilogbl='$d_ilogbl'
24298 d_inc_version_list='$d_inc_version_list'
24299 d_inetaton='$d_inetaton'
24300 d_inetntop='$d_inetntop'
24301 d_inetpton='$d_inetpton'
24302 d_int64_t='$d_int64_t'
24303 d_ip_mreq='$d_ip_mreq'
24304 d_ip_mreq_source='$d_ip_mreq_source'
24305 d_ipv6_mreq='$d_ipv6_mreq'
24306 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24307 d_isascii='$d_isascii'
24308 d_isblank='$d_isblank'
24309 d_isfinite='$d_isfinite'
24310 d_isfinitel='$d_isfinitel'
24312 d_isinfl='$d_isinfl'
24313 d_isless='$d_isless'
24315 d_isnanl='$d_isnanl'
24316 d_isnormal='$d_isnormal'
24319 d_killpg='$d_killpg'
24320 d_lc_monetary_2008='$d_lc_monetary_2008'
24321 d_lchown='$d_lchown'
24322 d_ldbl_dig='$d_ldbl_dig'
24323 d_ldexpl='$d_ldexpl'
24324 d_lgamma='$d_lgamma'
24325 d_lgamma_r='$d_lgamma_r'
24326 d_libm_lib_version='$d_libm_lib_version'
24327 d_libname_unique='$d_libname_unique'
24329 d_linkat='$d_linkat'
24330 d_llrint='$d_llrint'
24331 d_llrintl='$d_llrintl'
24332 d_llround='$d_llround'
24333 d_llroundl='$d_llroundl'
24334 d_localeconv_l='$d_localeconv_l'
24335 d_localtime64='$d_localtime64'
24336 d_localtime_r='$d_localtime_r'
24337 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24338 d_locconv='$d_locconv'
24343 d_long_double_style_ieee='$d_long_double_style_ieee'
24344 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24345 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24346 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24347 d_long_double_style_vax='$d_long_double_style_vax'
24348 d_longdbl='$d_longdbl'
24349 d_longlong='$d_longlong'
24351 d_lrintl='$d_lrintl'
24352 d_lround='$d_lround'
24353 d_lroundl='$d_lroundl'
24354 d_lseekproto='$d_lseekproto'
24356 d_madvise='$d_madvise'
24357 d_malloc_good_size='$d_malloc_good_size'
24358 d_malloc_size='$d_malloc_size'
24359 d_malloc_usable_size='$d_malloc_usable_size'
24361 d_mbrlen='$d_mbrlen'
24362 d_mbrtowc='$d_mbrtowc'
24363 d_mbstowcs='$d_mbstowcs'
24364 d_mbtowc='$d_mbtowc'
24365 d_memmem='$d_memmem'
24366 d_memrchr='$d_memrchr'
24368 d_mkdtemp='$d_mkdtemp'
24369 d_mkfifo='$d_mkfifo'
24370 d_mkostemp='$d_mkostemp'
24371 d_mkstemp='$d_mkstemp'
24372 d_mkstemps='$d_mkstemps'
24373 d_mktime64='$d_mktime64'
24374 d_mktime='$d_mktime'
24377 d_modflproto='$d_modflproto'
24378 d_mprotect='$d_mprotect'
24380 d_msg_ctrunc='$d_msg_ctrunc'
24381 d_msg_dontroute='$d_msg_dontroute'
24382 d_msg_oob='$d_msg_oob'
24383 d_msg_peek='$d_msg_peek'
24384 d_msg_proxy='$d_msg_proxy'
24385 d_msgctl='$d_msgctl'
24386 d_msgget='$d_msgget'
24387 d_msghdr_s='$d_msghdr_s'
24388 d_msgrcv='$d_msgrcv'
24389 d_msgsnd='$d_msgsnd'
24391 d_munmap='$d_munmap'
24392 d_mymalloc='$d_mymalloc'
24394 d_nanosleep='$d_nanosleep'
24396 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24397 d_nearbyint='$d_nearbyint'
24398 d_newlocale='$d_newlocale'
24399 d_nextafter='$d_nextafter'
24400 d_nexttoward='$d_nexttoward'
24402 d_nl_langinfo='$d_nl_langinfo'
24403 d_nv_preserves_uv='$d_nv_preserves_uv'
24404 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24405 d_off64_t='$d_off64_t'
24406 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24407 d_oldpthreads='$d_oldpthreads'
24408 d_oldsock='$d_oldsock'
24410 d_openat='$d_openat'
24411 d_pathconf='$d_pathconf'
24413 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24414 d_phostname='$d_phostname'
24418 d_portable='$d_portable'
24420 d_prctl_set_name='$d_prctl_set_name'
24421 d_printf_format_null='$d_printf_format_null'
24422 d_procselfexe='$d_procselfexe'
24423 d_pseudofork='$d_pseudofork'
24424 d_pthread_atfork='$d_pthread_atfork'
24425 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24426 d_pthread_yield='$d_pthread_yield'
24427 d_ptrdiff_t='$d_ptrdiff_t'
24429 d_pwchange='$d_pwchange'
24430 d_pwclass='$d_pwclass'
24431 d_pwcomment='$d_pwcomment'
24432 d_pwexpire='$d_pwexpire'
24433 d_pwgecos='$d_pwgecos'
24434 d_pwpasswd='$d_pwpasswd'
24435 d_pwquota='$d_pwquota'
24438 d_querylocale='$d_querylocale'
24439 d_random_r='$d_random_r'
24440 d_re_comp='$d_re_comp'
24441 d_readdir64_r='$d_readdir64_r'
24442 d_readdir='$d_readdir'
24443 d_readdir_r='$d_readdir_r'
24444 d_readlink='$d_readlink'
24446 d_recvmsg='$d_recvmsg'
24447 d_regcmp='$d_regcmp'
24448 d_regcomp='$d_regcomp'
24449 d_remainder='$d_remainder'
24450 d_remquo='$d_remquo'
24451 d_rename='$d_rename'
24452 d_renameat='$d_renameat'
24453 d_rewinddir='$d_rewinddir'
24457 d_sbrkproto='$d_sbrkproto'
24458 d_scalbn='$d_scalbn'
24459 d_scalbnl='$d_scalbnl'
24460 d_sched_yield='$d_sched_yield'
24461 d_scm_rights='$d_scm_rights'
24462 d_seekdir='$d_seekdir'
24463 d_select='$d_select'
24465 d_semctl='$d_semctl'
24466 d_semctl_semid_ds='$d_semctl_semid_ds'
24467 d_semctl_semun='$d_semctl_semun'
24468 d_semget='$d_semget'
24470 d_sendmsg='$d_sendmsg'
24471 d_setegid='$d_setegid'
24472 d_seteuid='$d_seteuid'
24473 d_setgrent='$d_setgrent'
24474 d_setgrent_r='$d_setgrent_r'
24475 d_setgrps='$d_setgrps'
24476 d_sethent='$d_sethent'
24477 d_sethostent_r='$d_sethostent_r'
24478 d_setitimer='$d_setitimer'
24479 d_setlinebuf='$d_setlinebuf'
24480 d_setlocale='$d_setlocale'
24481 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24482 d_setlocale_r='$d_setlocale_r'
24483 d_setnent='$d_setnent'
24484 d_setnetent_r='$d_setnetent_r'
24485 d_setpent='$d_setpent'
24486 d_setpgid='$d_setpgid'
24487 d_setpgrp2='$d_setpgrp2'
24488 d_setpgrp='$d_setpgrp'
24489 d_setprior='$d_setprior'
24490 d_setproctitle='$d_setproctitle'
24491 d_setprotoent_r='$d_setprotoent_r'
24492 d_setpwent='$d_setpwent'
24493 d_setpwent_r='$d_setpwent_r'
24494 d_setregid='$d_setregid'
24495 d_setresgid='$d_setresgid'
24496 d_setresuid='$d_setresuid'
24497 d_setreuid='$d_setreuid'
24498 d_setrgid='$d_setrgid'
24499 d_setruid='$d_setruid'
24500 d_setsent='$d_setsent'
24501 d_setservent_r='$d_setservent_r'
24502 d_setsid='$d_setsid'
24503 d_setvbuf='$d_setvbuf'
24506 d_shmatprototype='$d_shmatprototype'
24507 d_shmctl='$d_shmctl'
24509 d_shmget='$d_shmget'
24510 d_sigaction='$d_sigaction'
24511 d_siginfo_si_addr='$d_siginfo_si_addr'
24512 d_siginfo_si_band='$d_siginfo_si_band'
24513 d_siginfo_si_errno='$d_siginfo_si_errno'
24514 d_siginfo_si_fd='$d_siginfo_si_fd'
24515 d_siginfo_si_pid='$d_siginfo_si_pid'
24516 d_siginfo_si_status='$d_siginfo_si_status'
24517 d_siginfo_si_uid='$d_siginfo_si_uid'
24518 d_siginfo_si_value='$d_siginfo_si_value'
24519 d_signbit='$d_signbit'
24520 d_sigprocmask='$d_sigprocmask'
24521 d_sigsetjmp='$d_sigsetjmp'
24522 d_sin6_scope_id='$d_sin6_scope_id'
24523 d_sitearch='$d_sitearch'
24524 d_snprintf='$d_snprintf'
24525 d_sockaddr_in6='$d_sockaddr_in6'
24526 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24527 d_sockaddr_storage='$d_sockaddr_storage'
24528 d_sockatmark='$d_sockatmark'
24529 d_sockatmarkproto='$d_sockatmarkproto'
24530 d_socket='$d_socket'
24531 d_socklen_t='$d_socklen_t'
24532 d_sockpair='$d_sockpair'
24533 d_socks5_init='$d_socks5_init'
24535 d_srand48_r='$d_srand48_r'
24536 d_srandom_r='$d_srandom_r'
24537 d_sresgproto='$d_sresgproto'
24538 d_sresuproto='$d_sresuproto'
24540 d_statblks='$d_statblks'
24541 d_statfs_f_flags='$d_statfs_f_flags'
24542 d_statfs_s='$d_statfs_s'
24543 d_static_inline='$d_static_inline'
24544 d_statvfs='$d_statvfs'
24545 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24546 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24547 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24548 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24549 d_stdio_stream_array='$d_stdio_stream_array'
24550 d_stdiobase='$d_stdiobase'
24551 d_stdstdio='$d_stdstdio'
24552 d_strcoll='$d_strcoll'
24553 d_strerror_l='$d_strerror_l'
24554 d_strerror_r='$d_strerror_r'
24555 d_strftime='$d_strftime'
24556 d_strlcat='$d_strlcat'
24557 d_strlcpy='$d_strlcpy'
24558 d_strnlen='$d_strnlen'
24559 d_strtod='$d_strtod'
24560 d_strtod_l='$d_strtod_l'
24561 d_strtol='$d_strtol'
24562 d_strtold='$d_strtold'
24563 d_strtold_l='$d_strtold_l'
24564 d_strtoll='$d_strtoll'
24565 d_strtoq='$d_strtoq'
24566 d_strtoul='$d_strtoul'
24567 d_strtoull='$d_strtoull'
24568 d_strtouq='$d_strtouq'
24569 d_strxfrm='$d_strxfrm'
24570 d_suidsafe='$d_suidsafe'
24571 d_symlink='$d_symlink'
24572 d_syscall='$d_syscall'
24573 d_syscallproto='$d_syscallproto'
24574 d_sysconf='$d_sysconf'
24575 d_sysernlst='$d_sysernlst'
24576 d_syserrlst='$d_syserrlst'
24577 d_system='$d_system'
24578 d_tcgetpgrp='$d_tcgetpgrp'
24579 d_tcsetpgrp='$d_tcsetpgrp'
24580 d_telldir='$d_telldir'
24581 d_telldirproto='$d_telldirproto'
24582 d_tgamma='$d_tgamma'
24583 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24585 d_timegm='$d_timegm'
24587 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24588 d_tm_tm_zone='$d_tm_tm_zone'
24589 d_tmpnam_r='$d_tmpnam_r'
24590 d_towlower='$d_towlower'
24591 d_towupper='$d_towupper'
24593 d_truncate='$d_truncate'
24594 d_truncl='$d_truncl'
24595 d_ttyname_r='$d_ttyname_r'
24596 d_tzname='$d_tzname'
24597 d_u32align='$d_u32align'
24598 d_ualarm='$d_ualarm'
24601 d_union_semun='$d_union_semun'
24602 d_unlinkat='$d_unlinkat'
24603 d_unordered='$d_unordered'
24604 d_unsetenv='$d_unsetenv'
24605 d_uselocale='$d_uselocale'
24606 d_usleep='$d_usleep'
24607 d_usleepproto='$d_usleepproto'
24609 d_vendorarch='$d_vendorarch'
24610 d_vendorbin='$d_vendorbin'
24611 d_vendorlib='$d_vendorlib'
24612 d_vendorscript='$d_vendorscript'
24614 d_void_closedir='$d_void_closedir'
24615 d_voidsig='$d_voidsig'
24616 d_voidtty='$d_voidtty'
24617 d_vsnprintf='$d_vsnprintf'
24619 d_waitpid='$d_waitpid'
24620 d_wcrtomb='$d_wcrtomb'
24621 d_wcscmp='$d_wcscmp'
24622 d_wcstombs='$d_wcstombs'
24623 d_wcsxfrm='$d_wcsxfrm'
24624 d_wctomb='$d_wctomb'
24625 d_writev='$d_writev'
24628 db_hashtype='$db_hashtype'
24629 db_prefixtype='$db_prefixtype'
24630 db_version_major='$db_version_major'
24631 db_version_minor='$db_version_minor'
24632 db_version_patch='$db_version_patch'
24633 default_inc_excludes_dot='$default_inc_excludes_dot'
24634 direntrytype='$direntrytype'
24637 doubleinfbytes='$doubleinfbytes'
24638 doublekind='$doublekind'
24639 doublemantbits='$doublemantbits'
24640 doublenanbytes='$doublenanbytes'
24641 doublesize='$doublesize'
24643 drand48_r_proto='$drand48_r_proto'
24645 dtraceobject='$dtraceobject'
24646 dtracexnolibs='$dtracexnolibs'
24647 dynamic_ext='$dynamic_ext'
24653 endgrent_r_proto='$endgrent_r_proto'
24654 endhostent_r_proto='$endhostent_r_proto'
24655 endnetent_r_proto='$endnetent_r_proto'
24656 endprotoent_r_proto='$endprotoent_r_proto'
24657 endpwent_r_proto='$endpwent_r_proto'
24658 endservent_r_proto='$endservent_r_proto'
24659 eunicefix='$eunicefix'
24662 extensions='$extensions'
24663 extern_C='$extern_C'
24665 fflushNULL='$fflushNULL'
24666 fflushall='$fflushall'
24668 firstmakefile='$firstmakefile'
24670 fpossize='$fpossize'
24671 fpostype='$fpostype'
24672 freetype='$freetype'
24675 full_csh='$full_csh'
24676 full_sed='$full_sed'
24677 gccansipedantic='$gccansipedantic'
24678 gccosandvers='$gccosandvers'
24679 gccversion='$gccversion'
24680 getgrent_r_proto='$getgrent_r_proto'
24681 getgrgid_r_proto='$getgrgid_r_proto'
24682 getgrnam_r_proto='$getgrnam_r_proto'
24683 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24684 gethostbyname_r_proto='$gethostbyname_r_proto'
24685 gethostent_r_proto='$gethostent_r_proto'
24686 getlogin_r_proto='$getlogin_r_proto'
24687 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24688 getnetbyname_r_proto='$getnetbyname_r_proto'
24689 getnetent_r_proto='$getnetent_r_proto'
24690 getprotobyname_r_proto='$getprotobyname_r_proto'
24691 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24692 getprotoent_r_proto='$getprotoent_r_proto'
24693 getpwent_r_proto='$getpwent_r_proto'
24694 getpwnam_r_proto='$getpwnam_r_proto'
24695 getpwuid_r_proto='$getpwuid_r_proto'
24696 getservbyname_r_proto='$getservbyname_r_proto'
24697 getservbyport_r_proto='$getservbyport_r_proto'
24698 getservent_r_proto='$getservent_r_proto'
24699 getspnam_r_proto='$getspnam_r_proto'
24700 gidformat='$gidformat'
24706 gmtime_r_proto='$gmtime_r_proto'
24707 gnulibc_version='$gnulibc_version'
24709 groupcat='$groupcat'
24710 groupstype='$groupstype'
24713 h_sysfile='$h_sysfile'
24716 hostgenerate='$hostgenerate'
24717 hostosname='$hostosname'
24718 hostperl='$hostperl'
24719 html1dir='$html1dir'
24720 html1direxp='$html1direxp'
24721 html3dir='$html3dir'
24722 html3direxp='$html3direxp'
24731 i_arpainet='$i_arpainet'
24733 i_bsdioctl='$i_bsdioctl'
24737 i_dirent='$i_dirent'
24739 i_execinfo='$i_execinfo'
24743 i_fp_class='$i_fp_class'
24745 i_gdbm_ndbm='$i_gdbm_ndbm'
24746 i_gdbmndbm='$i_gdbmndbm'
24748 i_ieeefp='$i_ieeefp'
24749 i_inttypes='$i_inttypes'
24750 i_langinfo='$i_langinfo'
24751 i_libutil='$i_libutil'
24752 i_locale='$i_locale'
24753 i_machcthr='$i_machcthr'
24754 i_malloc='$i_malloc'
24755 i_mallocmalloc='$i_mallocmalloc'
24756 i_mntent='$i_mntent'
24759 i_neterrno='$i_neterrno'
24760 i_netinettcp='$i_netinettcp'
24764 i_pthread='$i_pthread'
24766 i_quadmath='$i_quadmath'
24767 i_rpcsvcdbm='$i_rpcsvcdbm'
24769 i_shadow='$i_shadow'
24771 i_stdbool='$i_stdbool'
24772 i_stdint='$i_stdint'
24773 i_stdlib='$i_stdlib'
24774 i_sunmath='$i_sunmath'
24775 i_sysaccess='$i_sysaccess'
24776 i_sysdir='$i_sysdir'
24777 i_sysfile='$i_sysfile'
24778 i_sysfilio='$i_sysfilio'
24780 i_sysioctl='$i_sysioctl'
24781 i_syslog='$i_syslog'
24782 i_sysmman='$i_sysmman'
24783 i_sysmode='$i_sysmode'
24784 i_sysmount='$i_sysmount'
24785 i_sysndir='$i_sysndir'
24786 i_sysparam='$i_sysparam'
24787 i_syspoll='$i_syspoll'
24788 i_sysresrc='$i_sysresrc'
24789 i_syssecrt='$i_syssecrt'
24790 i_sysselct='$i_sysselct'
24791 i_syssockio='$i_syssockio'
24792 i_sysstat='$i_sysstat'
24793 i_sysstatfs='$i_sysstatfs'
24794 i_sysstatvfs='$i_sysstatvfs'
24795 i_systime='$i_systime'
24796 i_systimek='$i_systimek'
24797 i_systimes='$i_systimes'
24798 i_systypes='$i_systypes'
24799 i_sysuio='$i_sysuio'
24801 i_sysutsname='$i_sysutsname'
24802 i_sysvfs='$i_sysvfs'
24803 i_syswait='$i_syswait'
24804 i_termio='$i_termio'
24805 i_termios='$i_termios'
24807 i_unistd='$i_unistd'
24812 i_wctype='$i_wctype'
24813 i_xlocale='$i_xlocale'
24814 ignore_versioned_solibs='$ignore_versioned_solibs'
24815 inc_version_list='$inc_version_list'
24816 inc_version_list_init='$inc_version_list_init'
24820 initialinstalllocation='$initialinstalllocation'
24821 installarchlib='$installarchlib'
24822 installbin='$installbin'
24823 installhtml1dir='$installhtml1dir'
24824 installhtml3dir='$installhtml3dir'
24825 installman1dir='$installman1dir'
24826 installman3dir='$installman3dir'
24827 installprefix='$installprefix'
24828 installprefixexp='$installprefixexp'
24829 installprivlib='$installprivlib'
24830 installscript='$installscript'
24831 installsitearch='$installsitearch'
24832 installsitebin='$installsitebin'
24833 installsitehtml1dir='$installsitehtml1dir'
24834 installsitehtml3dir='$installsitehtml3dir'
24835 installsitelib='$installsitelib'
24836 installsiteman1dir='$installsiteman1dir'
24837 installsiteman3dir='$installsiteman3dir'
24838 installsitescript='$installsitescript'
24839 installstyle='$installstyle'
24840 installusrbinperl='$installusrbinperl'
24841 installvendorarch='$installvendorarch'
24842 installvendorbin='$installvendorbin'
24843 installvendorhtml1dir='$installvendorhtml1dir'
24844 installvendorhtml3dir='$installvendorhtml3dir'
24845 installvendorlib='$installvendorlib'
24846 installvendorman1dir='$installvendorman1dir'
24847 installvendorman3dir='$installvendorman3dir'
24848 installvendorscript='$installvendorscript'
24850 issymlink='$issymlink'
24851 ivdformat='$ivdformat'
24854 known_extensions='$known_extensions'
24857 ld_can_script='$ld_can_script'
24858 lddlflags='$lddlflags'
24860 ldflags_uselargefiles='$ldflags_uselargefiles'
24861 ldlibpthname='$ldlibpthname'
24868 libsdirs='$libsdirs'
24869 libsfiles='$libsfiles'
24870 libsfound='$libsfound'
24871 libspath='$libspath'
24872 libswanted='$libswanted'
24873 libswanted_uselargefiles='$libswanted_uselargefiles'
24879 localtime_r_proto='$localtime_r_proto'
24880 locincpth='$locincpth'
24881 loclibpth='$loclibpth'
24882 longdblinfbytes='$longdblinfbytes'
24883 longdblkind='$longdblkind'
24884 longdblmantbits='$longdblmantbits'
24885 longdblnanbytes='$longdblnanbytes'
24886 longdblsize='$longdblsize'
24887 longlongsize='$longlongsize'
24888 longsize='$longsize'
24892 lseeksize='$lseeksize'
24893 lseektype='$lseektype'
24897 make_set_make='$make_set_make'
24898 mallocobj='$mallocobj'
24899 mallocsrc='$mallocsrc'
24900 malloctype='$malloctype'
24902 man1direxp='$man1direxp'
24905 man3direxp='$man3direxp'
24907 mips_type='$mips_type'
24908 mistrustnm='$mistrustnm'
24910 mmaptype='$mmaptype'
24911 modetype='$modetype'
24913 multiarch='$multiarch'
24915 myarchname='$myarchname'
24916 mydomain='$mydomain'
24917 myhostname='$myhostname'
24920 need_va_copy='$need_va_copy'
24921 netdb_hlen_type='$netdb_hlen_type'
24922 netdb_host_type='$netdb_host_type'
24923 netdb_name_type='$netdb_name_type'
24924 netdb_net_type='$netdb_net_type'
24927 nm_so_opt='$nm_so_opt'
24928 nonxs_ext='$nonxs_ext'
24930 nvEUformat='$nvEUformat'
24931 nvFUformat='$nvFUformat'
24932 nvGUformat='$nvGUformat'
24933 nv_overflows_integers_at='$nv_overflows_integers_at'
24934 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24935 nveformat='$nveformat'
24936 nvfformat='$nvfformat'
24937 nvgformat='$nvgformat'
24938 nvmantbits='$nvmantbits'
24941 o_nonblock='$o_nonblock'
24943 old_pthread_create_joinable='$old_pthread_create_joinable'
24944 optimize='$optimize'
24945 orderlib='$orderlib'
24948 otherlibdirs='$otherlibdirs'
24952 patchlevel='$patchlevel'
24953 path_sep='$path_sep'
24956 perl_patchlevel='$perl_patchlevel'
24957 perl_static_inline='$perl_static_inline'
24958 perladmin='$perladmin'
24959 perllibs='$perllibs'
24960 perlpath='$perlpath'
24962 phostname='$phostname'
24968 prefixexp='$prefixexp'
24970 privlibexp='$privlibexp'
24971 procselfexe='$procselfexe'
24973 quadkind='$quadkind'
24974 quadtype='$quadtype'
24975 randbits='$randbits'
24976 randfunc='$randfunc'
24977 random_r_proto='$random_r_proto'
24978 randseedtype='$randseedtype'
24980 rd_nodata='$rd_nodata'
24981 readdir64_r_proto='$readdir64_r_proto'
24982 readdir_r_proto='$readdir_r_proto'
24983 revision='$revision'
24989 sGMTIME_max='$sGMTIME_max'
24990 sGMTIME_min='$sGMTIME_min'
24991 sLOCALTIME_max='$sLOCALTIME_max'
24992 sLOCALTIME_min='$sLOCALTIME_min'
24993 sPRIEUldbl='$sPRIEUldbl'
24994 sPRIFUldbl='$sPRIFUldbl'
24995 sPRIGUldbl='$sPRIGUldbl'
24996 sPRIXU64='$sPRIXU64'
24998 sPRIeldbl='$sPRIeldbl'
24999 sPRIfldbl='$sPRIfldbl'
25000 sPRIgldbl='$sPRIgldbl'
25005 sSCNfldbl='$sSCNfldbl'
25006 sched_yield='$sched_yield'
25007 scriptdir='$scriptdir'
25008 scriptdirexp='$scriptdirexp'
25010 seedfunc='$seedfunc'
25011 selectminbits='$selectminbits'
25012 selecttype='$selecttype'
25013 sendmail='$sendmail'
25014 setgrent_r_proto='$setgrent_r_proto'
25015 sethostent_r_proto='$sethostent_r_proto'
25016 setlocale_r_proto='$setlocale_r_proto'
25017 setnetent_r_proto='$setnetent_r_proto'
25018 setprotoent_r_proto='$setprotoent_r_proto'
25019 setpwent_r_proto='$setpwent_r_proto'
25020 setservent_r_proto='$setservent_r_proto'
25023 sharpbang='$sharpbang'
25024 shmattype='$shmattype'
25025 shortsize='$shortsize'
25028 sig_count='$sig_count'
25029 sig_name='$sig_name'
25030 sig_name_init='$sig_name_init'
25032 sig_num_init='$sig_num_init'
25033 sig_size='$sig_size'
25034 signal_t='$signal_t'
25035 sitearch='$sitearch'
25036 sitearchexp='$sitearchexp'
25038 sitebinexp='$sitebinexp'
25039 sitehtml1dir='$sitehtml1dir'
25040 sitehtml1direxp='$sitehtml1direxp'
25041 sitehtml3dir='$sitehtml3dir'
25042 sitehtml3direxp='$sitehtml3direxp'
25044 sitelib_stem='$sitelib_stem'
25045 sitelibexp='$sitelibexp'
25046 siteman1dir='$siteman1dir'
25047 siteman1direxp='$siteman1direxp'
25048 siteman3dir='$siteman3dir'
25049 siteman3direxp='$siteman3direxp'
25050 siteprefix='$siteprefix'
25051 siteprefixexp='$siteprefixexp'
25052 sitescript='$sitescript'
25053 sitescriptexp='$sitescriptexp'
25054 sizesize='$sizesize'
25055 sizetype='$sizetype'
25059 sockethdr='$sockethdr'
25060 socketlib='$socketlib'
25061 socksizetype='$socksizetype'
25063 spackage='$spackage'
25064 spitshell='$spitshell'
25065 srand48_r_proto='$srand48_r_proto'
25066 srandom_r_proto='$srandom_r_proto'
25068 ssizetype='$ssizetype'
25069 st_ino_sign='$st_ino_sign'
25070 st_ino_size='$st_ino_size'
25071 startperl='$startperl'
25073 static_ext='$static_ext'
25075 stdio_base='$stdio_base'
25076 stdio_bufsiz='$stdio_bufsiz'
25077 stdio_cnt='$stdio_cnt'
25078 stdio_filbuf='$stdio_filbuf'
25079 stdio_ptr='$stdio_ptr'
25080 stdio_stream_array='$stdio_stream_array'
25081 strerror_r_proto='$strerror_r_proto'
25083 subversion='$subversion'
25088 targetarch='$targetarch'
25089 targetdir='$targetdir'
25090 targetenv='$targetenv'
25091 targethost='$targethost'
25092 targetmkdir='$targetmkdir'
25093 targetport='$targetport'
25094 targetsh='$targetsh'
25098 timeincl='$timeincl'
25099 timetype='$timetype'
25100 tmpnam_r_proto='$tmpnam_r_proto'
25106 ttyname_r_proto='$ttyname_r_proto'
25115 uidformat='$uidformat'
25121 uquadtype='$uquadtype'
25122 use5005threads='$use5005threads'
25123 use64bitall='$use64bitall'
25124 use64bitint='$use64bitint'
25125 usecbacktrace='$usecbacktrace'
25126 usecrosscompile='$usecrosscompile'
25127 usedevel='$usedevel'
25129 usedtrace='$usedtrace'
25130 usefaststdio='$usefaststdio'
25131 useithreads='$useithreads'
25132 usekernprocpathname='$usekernprocpathname'
25133 uselanginfo='$uselanginfo'
25134 uselargefiles='$uselargefiles'
25135 uselongdouble='$uselongdouble'
25136 usemallocwrap='$usemallocwrap'
25137 usemorebits='$usemorebits'
25138 usemultiplicity='$usemultiplicity'
25139 usemymalloc='$usemymalloc'
25141 usensgetexecutablepath='$usensgetexecutablepath'
25142 useopcode='$useopcode'
25143 useperlio='$useperlio'
25144 useposix='$useposix'
25145 usequadmath='$usequadmath'
25146 usereentrant='$usereentrant'
25147 userelocatableinc='$userelocatableinc'
25148 useshrplib='$useshrplib'
25149 usesitecustomize='$usesitecustomize'
25150 usesocks='$usesocks'
25151 usethreads='$usethreads'
25152 usevendorprefix='$usevendorprefix'
25153 useversionedarchname='$useversionedarchname'
25154 usevfork='$usevfork'
25157 uvXUformat='$uvXUformat'
25158 uvoformat='$uvoformat'
25161 uvuformat='$uvuformat'
25162 uvxformat='$uvxformat'
25163 vendorarch='$vendorarch'
25164 vendorarchexp='$vendorarchexp'
25165 vendorbin='$vendorbin'
25166 vendorbinexp='$vendorbinexp'
25167 vendorhtml1dir='$vendorhtml1dir'
25168 vendorhtml1direxp='$vendorhtml1direxp'
25169 vendorhtml3dir='$vendorhtml3dir'
25170 vendorhtml3direxp='$vendorhtml3direxp'
25171 vendorlib='$vendorlib'
25172 vendorlib_stem='$vendorlib_stem'
25173 vendorlibexp='$vendorlibexp'
25174 vendorman1dir='$vendorman1dir'
25175 vendorman1direxp='$vendorman1direxp'
25176 vendorman3dir='$vendorman3dir'
25177 vendorman3direxp='$vendorman3direxp'
25178 vendorprefix='$vendorprefix'
25179 vendorprefixexp='$vendorprefixexp'
25180 vendorscript='$vendorscript'
25181 vendorscriptexp='$vendorscriptexp'
25183 version_patchlevel_string='$version_patchlevel_string'
25184 versiononly='$versiononly'
25188 yaccflags='$yaccflags'
25193 : add special variables
25194 $test -f $src/patchlevel.h && \
25195 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25196 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25197 echo "PERL_CONFIG_SH=true" >>config.sh
25199 : propagate old symbols
25200 if $test -f UU/config.sh; then
25201 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25202 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25203 config.sh config.sh UU/oldconfig.sh |\
25204 $sort | $uniq -u >UU/oldsyms
25205 set X `$cat UU/oldsyms`
25211 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25213 echo ": Variables propagated from previous config.sh file." >>config.sh
25214 for sym in `$cat UU/oldsyms`; do
25215 echo " Propagating $hint variable "'$'"$sym..."
25216 eval 'tmp="$'"${sym}"'"'
25218 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25224 : preserve RCS keywords in files with variable substitution, grrr
25227 : Finish up by extracting the .SH files
25230 echo "Stopping at your request, leaving temporary files around."
25240 If you'd like to make any changes to the config.sh file before I begin
25241 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25244 rp="Press return or use a shell escape to edit config.sh:"
25249 *) : in case they cannot read
25250 sh 1>&4 -c "$ans";;
25255 : if this fails, just run all the .SH files by hand
25264 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25271 Now you need to generate make dependencies by running "$make depend".
25272 You might prefer to run it in background: "$make depend > makedepend.out &"
25273 It can take a while, so you might not want to run it right now.
25278 rp="Run $make depend now?"
25282 $make depend && echo "Now you must run '$make'."
25285 echo "You must run '$make depend' then '$make'."
25288 elif test -f [Mm]akefile; then
25290 echo "Now you must run a $make."
25292 echo "Configure done."
25295 if $test -f Policy.sh; then
25298 If you compile $package on a different machine or from a different object
25299 directory, copy the Policy.sh file from this object directory to the
25300 new one before you run Configure -- this will help you with most of
25301 the policy defaults.
25305 if $test -f UU/config.msg; then
25306 echo "Hmm. I also noted the following information while running:"
25308 $cat UU/config.msg >&4
25310 $rm -f kit*isdone ark*isdone