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
11943 echo "Checking the availability sa_len in the sock struct ..." >&4
11945 #include <sys/types.h>
11946 #include <sys/socket.h>
11948 struct sockaddr sa;
11949 return (sa.sa_len);
11953 set try; if eval $compile; then
11956 set d_sockaddr_sa_len; eval $setvar
11959 echo "Checking the availability struct sockaddr_in6 ..." >&4
11961 #include <sys/types.h>
11962 #include <sys/socket.h>
11963 #include <netinet/in.h>
11965 struct sockaddr_in6 sin6;
11966 return (sin6.sin6_family);
11970 set try; if eval $compile; then
11973 set d_sockaddr_in6; eval $setvar
11976 echo "Checking the availability struct sockaddr_storage ..." >&4
11978 #include <sys/types.h>
11979 #include <sys/socket.h>
11980 #include <netinet/in.h>
11982 struct sockaddr_storage sastor;
11983 return (sastor.ss_family);
11987 set try; if eval $compile; then
11990 set d_sockaddr_storage; eval $setvar
11993 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11995 #include <sys/types.h>
11996 #include <sys/socket.h>
11997 #include <netinet/in.h>
11999 struct sockaddr_in6 sin6;
12000 return (sin6.sin6_scope_id);
12004 set try; if eval $compile; then
12007 set d_sin6_scope_id; eval $setvar
12010 echo "Checking the availability struct ip_mreq ..." >&4
12012 #include <sys/types.h>
12013 #include <sys/socket.h>
12014 #include <netinet/in.h>
12016 struct ip_mreq mreq;
12017 return (mreq.imr_multiaddr.s_addr);
12021 set try; if eval $compile; then
12024 set d_ip_mreq; eval $setvar
12027 echo "Checking the availability struct ip_mreq_source ..." >&4
12029 #include <sys/types.h>
12030 #include <sys/socket.h>
12031 #include <netinet/in.h>
12033 struct ip_mreq_source mreq;
12034 return (mreq.imr_multiaddr.s_addr);
12038 set try; if eval $compile; then
12041 set d_ip_mreq_source; eval $setvar
12044 echo "Checking the availability struct ipv6_mreq ..." >&4
12046 #include <sys/types.h>
12047 #include <sys/socket.h>
12048 #include <netinet/in.h>
12050 struct ipv6_mreq mreq;
12051 return (mreq.ipv6mr_interface);
12055 set try; if eval $compile; then
12058 set d_ipv6_mreq; eval $setvar
12061 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12063 #include <sys/types.h>
12064 #include <sys/socket.h>
12065 #include <netinet/in.h>
12067 struct ipv6_mreq_source mreq;
12068 return (mreq.imr_multiaddr.s_addr);
12072 set try; if eval $compile; then
12075 set d_ipv6_mreq_source; eval $setvar
12078 echo "Checking the availability of certain socket constants..." >&4
12079 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12080 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12082 #include <sys/types.h>
12083 #include <sys/socket.h>
12089 set try; if eval $compile; then
12092 set d_${enum}; eval $setvar
12096 : see if this is a sys/uio.h system
12097 set sys/uio.h i_sysuio
12100 : Check for cmsghdr support
12102 echo "Checking to see if your system supports struct cmsghdr..." >&4
12103 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12105 case "$d_cmsghdr_s" in
12106 "$define") echo "Yes, it does." ;;
12107 *) echo "No, it doesn't." ;;
12110 : see if copysign exists
12111 set copysign d_copysign
12114 : see if copysignl exists
12115 set copysignl d_copysignl
12118 : see if crypt exists
12123 $define) cryptlib='' ;;
12124 *) if set crypt val -f d_crypt; eval $csym; $val; then
12125 echo 'crypt() found.' >&4
12129 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12130 if $test -z "$cryptlib"; then
12131 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12135 if $test -z "$cryptlib"; then
12136 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12140 if $test -z "$cryptlib"; then
12141 cryptlib=`./loc libcrypt$_a "" $libpth`
12145 if $test -z "$cryptlib"; then
12146 echo 'crypt() NOT found.' >&4
12157 : see if this is a crypt.h system
12158 set crypt.h i_crypt
12161 : see if crypt_r exists
12162 set crypt_r d_crypt_r
12164 case "$d_crypt_r" in
12166 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12167 case "$d_crypt_r_proto:$usethreads" in
12168 ":define") d_crypt_r_proto=define
12169 set d_crypt_r_proto crypt_r $hdrs
12173 case "$d_crypt_r_proto" in
12175 case "$crypt_r_proto" in
12176 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12177 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12179 case "$crypt_r_proto" in
12180 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12181 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12183 case "$crypt_r_proto" in
12184 ''|0) d_crypt_r=undef
12186 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12187 * ) case "$crypt_r_proto" in
12188 REENTRANT_PROTO*) ;;
12189 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12191 echo "Prototype: $try" ;;
12194 *) case "$usethreads" in
12195 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12206 : get csh whereabouts
12208 'csh') val="$undef" ;;
12209 *) val="$define" ;;
12213 : Respect a hint or command line value for full_csh.
12214 case "$full_csh" in
12215 '') full_csh=$csh ;;
12218 : see if ctermid exists
12219 set ctermid d_ctermid
12222 : see if ctermid_r exists
12223 set ctermid_r d_ctermid_r
12225 case "$d_ctermid_r" in
12227 hdrs="$i_systypes sys/types.h define stdio.h "
12228 case "$d_ctermid_r_proto:$usethreads" in
12229 ":define") d_ctermid_r_proto=define
12230 set d_ctermid_r_proto ctermid_r $hdrs
12234 case "$d_ctermid_r_proto" in
12236 case "$ctermid_r_proto" in
12237 ''|0) try='char* ctermid_r(char*);'
12238 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12240 case "$ctermid_r_proto" in
12241 ''|0) d_ctermid_r=undef
12243 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12244 * ) case "$ctermid_r_proto" in
12245 REENTRANT_PROTO*) ;;
12246 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12248 echo "Prototype: $try" ;;
12251 *) case "$usethreads" in
12252 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12259 *) ctermid_r_proto=0
12263 : see if ctime_r exists
12264 set ctime_r d_ctime_r
12266 case "$d_ctime_r" in
12268 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12269 case "$d_ctime_r_proto:$usethreads" in
12270 ":define") d_ctime_r_proto=define
12271 set d_ctime_r_proto ctime_r $hdrs
12275 case "$d_ctime_r_proto" in
12277 case "$ctime_r_proto" in
12278 ''|0) try='char* ctime_r(const time_t*, char*);'
12279 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12281 case "$ctime_r_proto" in
12282 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12283 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12285 case "$ctime_r_proto" in
12286 ''|0) try='int ctime_r(const time_t*, char*);'
12287 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12289 case "$ctime_r_proto" in
12290 ''|0) try='int ctime_r(const time_t*, char*, int);'
12291 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12293 case "$ctime_r_proto" in
12294 ''|0) d_ctime_r=undef
12296 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12297 * ) case "$ctime_r_proto" in
12298 REENTRANT_PROTO*) ;;
12299 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12301 echo "Prototype: $try" ;;
12304 *) case "$usethreads" in
12305 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12316 : see if cuserid exists
12317 set cuserid d_cuserid
12320 : see if dbm.h is available
12321 : see if dbmclose exists
12322 set dbmclose d_dbmclose
12325 case "$d_dbmclose" in
12335 *) set rpcsvc/dbm.h i_rpcsvcdbm
12340 *) echo "We won't be including <dbm.h>"
12350 : see if prototype for dbminit is available
12352 set d_dbminitproto dbminit $i_dbm dbm.h
12355 : see if difftime exists
12356 set difftime d_difftime
12359 : see if this is a dirent system
12361 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12363 echo "<dirent.h> found." >&4
12366 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12367 echo "<sys/dir.h> found." >&4
12370 xinc=`./findhdr sys/ndir.h`
12372 echo "<dirent.h> NOT found." >&4
12377 : Look for type of directory structure.
12379 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12381 case "$direntrytype" in
12383 case "$i_dirent" in
12384 $define) guess1='struct dirent' ;;
12385 *) guess1='struct direct' ;;
12388 *) guess1="$direntrytype"
12393 'struct dirent') guess2='struct direct' ;;
12394 *) guess2='struct dirent' ;;
12397 if $contains "$guess1" try.c >/dev/null 2>&1; then
12398 direntrytype="$guess1"
12399 echo "Your directory entries are $direntrytype." >&4
12400 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12401 direntrytype="$guess2"
12402 echo "Your directory entries seem to be $direntrytype." >&4
12404 echo "I don't recognize your system's directory entries." >&4
12405 rp="What type is used for directory entries on this system?"
12408 direntrytype="$ans"
12412 : see if the directory entry stores field length
12414 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12415 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12416 echo "Good, your directory entry keeps length information in d_namlen." >&4
12419 echo "Your directory entry does not know about the d_namlen field." >&4
12426 : Look for DIR.dd_fd
12427 case "$i_dirent" in
12429 echo "Checking to see if DIR has a dd_fd member variable" >&4
12431 #$i_stdlib I_STDLIB
12433 #include <stdlib.h>
12435 #include <dirent.h>
12445 if eval $compile; then
12446 echo "Yes, it does."
12449 echo "No, it does not."
12454 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12462 : see if this is an sysdir system
12463 set sys/dir.h i_sysdir
12466 : see if this is an sysndir system
12467 set sys/ndir.h i_sysndir
12472 $cat >dirfd.c <<EOM
12474 #$i_stdlib I_STDLIB
12476 #include <stdlib.h>
12478 #$i_dirent I_DIRENT /**/
12479 #$i_sysdir I_SYS_DIR /**/
12480 #$i_sysndir I_SYS_NDIR /**/
12481 #$i_systypes I_SYS_TYPES /**/
12482 #if defined(I_SYS_TYPES)
12483 #include <sys/types.h>
12485 #if defined(I_DIRENT)
12486 #include <dirent.h>
12489 #include <sys/ndir.h>
12492 #include <sys/dir.h>
12497 DIR *dirp = opendir(".");
12498 if (dirfd(dirp) >= 0)
12506 if eval $compile; then
12510 $define) echo "dirfd() found." >&4 ;;
12511 *) echo "dirfd() NOT found." >&4 ;;
12517 : see if dladdr exists
12518 set dladdr d_dladdr
12521 : see if dlerror exists
12524 set dlerror d_dlerror
12528 : see if dlfcn is available
12529 set dlfcn.h i_dlfcn
12532 : Check what extension to use for shared libs
12537 On a few systems, the dynamically loaded modules that perl generates and uses
12538 will need a different extension than shared libs. The default will probably
12544 *) dflt="$dlext" ;;
12546 rp='What is the extension of dynamically loaded modules'
12555 : Check if dlsym need a leading underscore
12561 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12562 $cat >dyna.c <<'EOM'
12569 #$i_stdlib I_STDLIB
12571 #include <stdlib.h>
12575 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12577 #include <sys/types.h>
12582 extern int fred() ;
12591 int mode = RTLD_LAZY ;
12593 handle = dlopen("./dyna.$dlext", mode) ;
12594 if (handle == NULL) {
12599 symbol = dlsym(handle, "fred") ;
12600 if (symbol == NULL) {
12601 /* try putting a leading underscore */
12602 symbol = dlsym(handle, "_fred") ;
12603 if (symbol == NULL) {
12616 : Call the object file tmp-dyna.o in case dlext=o.
12617 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12618 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12619 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12620 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12623 1) echo "Test program failed using dlopen." >&4
12624 echo "Perhaps you should not use dynamic loading." >&4;;
12625 2) echo "Test program failed using dlsym." >&4
12626 echo "Perhaps you should not use dynamic loading." >&4;;
12627 3) echo "dlsym needs a leading underscore" >&4
12629 4) echo "dlsym doesn't need a leading underscore." >&4;;
12632 echo "I can't compile and run the test program." >&4
12633 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12638 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12643 : see if drand48_r exists
12644 set drand48_r d_drand48_r
12646 case "$d_drand48_r" in
12648 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12649 case "$d_drand48_r_proto:$usethreads" in
12650 ":define") d_drand48_r_proto=define
12651 set d_drand48_r_proto drand48_r $hdrs
12655 case "$d_drand48_r_proto" in
12657 case "$drand48_r_proto" in
12658 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12659 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12661 case "$drand48_r_proto" in
12662 ''|0) d_drand48_r=undef
12664 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12665 * ) case "$drand48_r_proto" in
12666 REENTRANT_PROTO*) ;;
12667 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12669 echo "Prototype: $try" ;;
12672 *) case "$usethreads" in
12673 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12680 *) drand48_r_proto=0
12684 : see if prototype for drand48 is available
12686 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12689 : see if dup2 exists
12693 : see if dup3 exists
12697 : see if this is an xlocale.h system
12698 set xlocale.h i_xlocale
12701 : see if newlocale exists
12702 set newlocale d_newlocale
12705 : see if freelocale exists
12706 set freelocale d_freelocale
12709 : see if uselocale exists
12710 set uselocale d_uselocale
12713 : see if duplocale exists
12714 set duplocale d_duplocale
12717 : see if querylocale exists
12718 set querylocale d_querylocale
12721 : see if eaccess exists
12722 set eaccess d_eaccess
12725 : see if endgrent exists
12726 set endgrent d_endgrent
12729 : see if this is an grp system
12735 xxx=`./findhdr grp.h`
12736 $cppstdin $cppflags $cppminus < $xxx >$$.h
12738 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12750 set d_grpasswd; eval $setvar
12754 : see if endgrent_r exists
12755 set endgrent_r d_endgrent_r
12757 case "$d_endgrent_r" in
12759 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12760 case "$d_endgrent_r_proto:$usethreads" in
12761 ":define") d_endgrent_r_proto=define
12762 set d_endgrent_r_proto endgrent_r $hdrs
12766 case "$d_endgrent_r_proto" in
12768 case "$endgrent_r_proto" in
12769 ''|0) try='int endgrent_r(FILE**);'
12770 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12772 case "$endgrent_r_proto" in
12773 ''|0) try='void endgrent_r(FILE**);'
12774 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12776 case "$endgrent_r_proto" in
12777 ''|0) d_endgrent_r=undef
12779 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12780 * ) case "$endgrent_r_proto" in
12781 REENTRANT_PROTO*) ;;
12782 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12784 echo "Prototype: $try" ;;
12787 *) case "$usethreads" in
12788 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12795 *) endgrent_r_proto=0
12799 : see if endhostent exists
12800 set endhostent d_endhent
12803 : see if this is a netdb.h system
12804 set netdb.h i_netdb
12807 : see if endhostent_r exists
12808 set endhostent_r d_endhostent_r
12810 case "$d_endhostent_r" in
12812 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12813 case "$d_endhostent_r_proto:$usethreads" in
12814 ":define") d_endhostent_r_proto=define
12815 set d_endhostent_r_proto endhostent_r $hdrs
12819 case "$d_endhostent_r_proto" in
12821 case "$endhostent_r_proto" in
12822 ''|0) try='int endhostent_r(struct hostent_data*);'
12823 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12825 case "$endhostent_r_proto" in
12826 ''|0) try='void endhostent_r(struct hostent_data*);'
12827 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12829 case "$endhostent_r_proto" in
12830 ''|0) d_endhostent_r=undef
12831 endhostent_r_proto=0
12832 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12833 * ) case "$endhostent_r_proto" in
12834 REENTRANT_PROTO*) ;;
12835 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12837 echo "Prototype: $try" ;;
12840 *) case "$usethreads" in
12841 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12843 d_endhostent_r=undef
12844 endhostent_r_proto=0
12848 *) endhostent_r_proto=0
12852 : see if endnetent exists
12853 set endnetent d_endnent
12856 : see if endnetent_r exists
12857 set endnetent_r d_endnetent_r
12859 case "$d_endnetent_r" in
12861 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12862 case "$d_endnetent_r_proto:$usethreads" in
12863 ":define") d_endnetent_r_proto=define
12864 set d_endnetent_r_proto endnetent_r $hdrs
12868 case "$d_endnetent_r_proto" in
12870 case "$endnetent_r_proto" in
12871 ''|0) try='int endnetent_r(struct netent_data*);'
12872 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12874 case "$endnetent_r_proto" in
12875 ''|0) try='void endnetent_r(struct netent_data*);'
12876 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12878 case "$endnetent_r_proto" in
12879 ''|0) d_endnetent_r=undef
12880 endnetent_r_proto=0
12881 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12882 * ) case "$endnetent_r_proto" in
12883 REENTRANT_PROTO*) ;;
12884 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12886 echo "Prototype: $try" ;;
12889 *) case "$usethreads" in
12890 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12892 d_endnetent_r=undef
12893 endnetent_r_proto=0
12897 *) endnetent_r_proto=0
12901 : see if endprotoent exists
12902 set endprotoent d_endpent
12905 : see if endprotoent_r exists
12906 set endprotoent_r d_endprotoent_r
12908 case "$d_endprotoent_r" in
12910 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12911 case "$d_endprotoent_r_proto:$usethreads" in
12912 ":define") d_endprotoent_r_proto=define
12913 set d_endprotoent_r_proto endprotoent_r $hdrs
12917 case "$d_endprotoent_r_proto" in
12919 case "$endprotoent_r_proto" in
12920 ''|0) try='int endprotoent_r(struct protoent_data*);'
12921 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12923 case "$endprotoent_r_proto" in
12924 ''|0) try='void endprotoent_r(struct protoent_data*);'
12925 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12927 case "$endprotoent_r_proto" in
12928 ''|0) d_endprotoent_r=undef
12929 endprotoent_r_proto=0
12930 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12931 * ) case "$endprotoent_r_proto" in
12932 REENTRANT_PROTO*) ;;
12933 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12935 echo "Prototype: $try" ;;
12938 *) case "$usethreads" in
12939 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12941 d_endprotoent_r=undef
12942 endprotoent_r_proto=0
12946 *) endprotoent_r_proto=0
12950 : see if endpwent exists
12951 set endpwent d_endpwent
12954 : see if this is a pwd.h system
12960 xxx=`./findhdr pwd.h`
12961 $cppstdin $cppflags $cppminus < $xxx >$$.h
12963 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12971 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12979 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12987 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12995 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13003 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13011 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13019 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13031 set d_pwquota; eval $setvar
13032 set d_pwage; eval $setvar
13033 set d_pwchange; eval $setvar
13034 set d_pwclass; eval $setvar
13035 set d_pwexpire; eval $setvar
13036 set d_pwcomment; eval $setvar
13037 set d_pwgecos; eval $setvar
13038 set d_pwpasswd; eval $setvar
13042 : see if endpwent_r exists
13043 set endpwent_r d_endpwent_r
13045 case "$d_endpwent_r" in
13047 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13048 case "$d_endpwent_r_proto:$usethreads" in
13049 ":define") d_endpwent_r_proto=define
13050 set d_endpwent_r_proto endpwent_r $hdrs
13054 case "$d_endpwent_r_proto" in
13056 case "$endpwent_r_proto" in
13057 ''|0) try='int endpwent_r(FILE**);'
13058 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13060 case "$endpwent_r_proto" in
13061 ''|0) try='void endpwent_r(FILE**);'
13062 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13064 case "$endpwent_r_proto" in
13065 ''|0) d_endpwent_r=undef
13067 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13068 * ) case "$endpwent_r_proto" in
13069 REENTRANT_PROTO*) ;;
13070 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13072 echo "Prototype: $try" ;;
13075 *) case "$usethreads" in
13076 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13083 *) endpwent_r_proto=0
13087 : see if endservent exists
13088 set endservent d_endsent
13091 : see if endservent_r exists
13092 set endservent_r d_endservent_r
13094 case "$d_endservent_r" in
13096 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13097 case "$d_endservent_r_proto:$usethreads" in
13098 ":define") d_endservent_r_proto=define
13099 set d_endservent_r_proto endservent_r $hdrs
13103 case "$d_endservent_r_proto" in
13105 case "$endservent_r_proto" in
13106 ''|0) try='int endservent_r(struct servent_data*);'
13107 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13109 case "$endservent_r_proto" in
13110 ''|0) try='void endservent_r(struct servent_data*);'
13111 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13113 case "$endservent_r_proto" in
13114 ''|0) d_endservent_r=undef
13115 endservent_r_proto=0
13116 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13117 * ) case "$endservent_r_proto" in
13118 REENTRANT_PROTO*) ;;
13119 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13121 echo "Prototype: $try" ;;
13124 *) case "$usethreads" in
13125 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13127 d_endservent_r=undef
13128 endservent_r_proto=0
13132 *) endservent_r_proto=0
13136 : Locate the flags for 'open()'
13139 #include <sys/types.h>
13144 #include <sys/file.h>
13146 #$i_stdlib I_STDLIB
13148 #include <stdlib.h>
13159 : check sys/file.h first to get FREAD on Sun
13160 if $test `./findhdr sys/file.h` && \
13161 set try -DI_SYS_FILE && eval $compile; then
13163 echo "<sys/file.h> defines the O_* constants..." >&4
13164 if $run ./try; then
13165 echo "and you have the 3 argument form of open()." >&4
13168 echo "but not the 3 argument form of open(). Oh, well." >&4
13171 elif $test `./findhdr fcntl.h` && \
13172 set try -DI_FCNTL && eval $compile; then
13174 echo "<fcntl.h> defines the O_* constants..." >&4
13175 if $run ./try; then
13176 echo "and you have the 3 argument form of open()." >&4
13179 echo "but not the 3 argument form of open(). Oh, well." >&4
13184 echo "I can't find the O_* constant definitions! You got problems." >&4
13190 : see if this is a sys/file.h system
13195 : do we need to include sys/file.h ?
13199 if $h_sysfile; then
13201 echo "We'll be including <sys/file.h>." >&4
13204 echo "We won't be including <sys/file.h>." >&4
13214 : see if fcntl.h is there
13219 : see if we can include fcntl.h
13225 echo "We'll be including <fcntl.h>." >&4
13228 if $h_sysfile; then
13229 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13231 echo "We won't be including <fcntl.h>." >&4
13243 : see if fork exists
13247 : see if pipe exists
13251 : check for non-blocking I/O stuff
13252 case "$h_sysfile" in
13253 true) echo "#include <sys/file.h>" > head.c;;
13256 true) echo "#include <fcntl.h>" > head.c;;
13257 *) echo "#include <sys/fcntl.h>" > head.c;;
13262 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13263 case "$o_nonblock" in
13265 $cat head.c > try.c
13266 $cat >>try.c <<EOCP
13268 #$i_stdlib I_STDLIB
13270 #include <stdlib.h>
13278 printf("O_NONBLOCK\n");
13282 printf("O_NDELAY\n");
13286 printf("FNDELAY\n");
13293 if eval $compile_ok; then
13294 o_nonblock=`$run ./try`
13295 case "$o_nonblock" in
13296 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13297 *) echo "Seems like we can use $o_nonblock.";;
13300 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13303 *) echo "Using $hint value $o_nonblock.";;
13308 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13311 case "$d_fork:$d_pipe:$d_alarm" in
13312 define:define:define)
13313 $cat head.c > try.c
13314 $cat >>try.c <<EOCP
13316 #include <sys/types.h>
13317 #include <signal.h>
13319 #$i_stdlib I_STDLIB
13321 #include <stdlib.h>
13327 #define MY_O_NONBLOCK $o_nonblock
13328 #ifndef errno /* XXX need better Configure test */
13331 #$i_unistd I_UNISTD
13333 #include <unistd.h>
13335 #include <string.h>
13336 $signal_t blech(int x) { exit(3); }
13338 $cat >> try.c <<'EOCP'
13347 ret = pipe(pd); /* Down: child -> parent */
13350 ret = pipe(pu); /* Up: parent -> child */
13354 close(pd[1]); /* Parent reads from pd[0] */
13355 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13357 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13362 signal(SIGALRM, blech);
13364 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13366 sprintf(string, "%d\n", ret);
13367 ret = write(2, string, strlen(string));
13368 if (ret != strlen(string))
13372 if (errno == EAGAIN) {
13373 printf("EAGAIN\n");
13378 if (errno == EWOULDBLOCK)
13379 printf("EWOULDBLOCK\n");
13382 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13385 sleep(2); /* Give it time to close our pipe */
13387 ret = read(pd[0], buf, 1); /* Should read EOF */
13389 sprintf(string, "%d\n", ret);
13390 ret = write(4, string, strlen(string));
13391 if (ret != strlen(string))
13396 close(pd[0]); /* We write to pd[1] */
13397 close(pu[1]); /* We read from pu[0] */
13398 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13401 close(pd[1]); /* Pipe pd is now fully closed! */
13402 exit(0); /* Bye bye, thank you for playing! */
13406 if eval $compile_ok; then
13407 echo "$startsh" >mtry
13408 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13410 $run ./mtry >/dev/null 2>&1
13412 0) eagain=`$cat try.out`;;
13413 1) echo "Could not perform non-blocking setting!";;
13414 2) echo "I did a successful read() for something that was not there!";;
13415 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13416 4) echo "Could not find F_SETFL!";;
13417 *) echo "Something terribly wrong happened during testing.";;
13419 rd_nodata=`$cat try.ret`
13420 echo "A read() system call with no data present returns $rd_nodata."
13421 case "$rd_nodata" in
13424 echo "(That's peculiar, fixing that to be -1.)"
13430 echo "Forcing errno EAGAIN on read() with no data available."
13434 echo "Your read() sets errno to $eagain when no data is available."
13437 status=`$cat try.err`
13439 0) echo "And it correctly returns 0 to signal EOF.";;
13440 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13441 *) echo "However, your read() returns '$status' on EOF??";;
13444 if test "$status" = "$rd_nodata"; then
13445 echo "WARNING: you can't distinguish between EOF and no data!"
13449 echo "I can't compile the test program--assuming errno EAGAIN will do."
13453 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13462 echo "Using $hint value $eagain."
13463 echo "Your read() returns $rd_nodata when no data is present."
13464 case "$d_eofnblk" in
13465 "$define") echo "And you can see EOF because read() returns 0.";;
13466 "$undef") echo "But you can't see EOF status from read() returned value.";;
13468 echo "(Assuming you can't see EOF status from read anyway.)"
13474 $rm_try head.c mtry
13476 : see if erf exists
13480 : see if erfc exists
13484 : see if exp2 exists
13488 : see if expm1 exists
13492 : see if _ptr and _cnt from stdio act std
13495 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13496 echo "(Looks like you have stdio.h from BSD.)"
13497 case "$stdio_ptr" in
13498 '') stdio_ptr='((fp)->_p)'
13501 *) ptr_lval=$d_stdio_ptr_lval;;
13503 case "$stdio_cnt" in
13504 '') stdio_cnt='((fp)->_r)'
13507 *) cnt_lval=$d_stdio_cnt_lval;;
13509 case "$stdio_base" in
13510 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13512 case "$stdio_bufsiz" in
13513 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13515 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13516 echo "(Looks like you have stdio.h from Linux.)"
13517 case "$stdio_ptr" in
13518 '') stdio_ptr='((fp)->_IO_read_ptr)'
13521 *) ptr_lval=$d_stdio_ptr_lval;;
13523 case "$stdio_cnt" in
13524 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13527 *) cnt_lval=$d_stdio_cnt_lval;;
13529 case "$stdio_base" in
13530 '') stdio_base='((fp)->_IO_read_base)';;
13532 case "$stdio_bufsiz" in
13533 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13536 case "$stdio_ptr" in
13537 '') stdio_ptr='((fp)->_ptr)'
13540 *) ptr_lval=$d_stdio_ptr_lval;;
13542 case "$stdio_cnt" in
13543 '') stdio_cnt='((fp)->_cnt)'
13546 *) cnt_lval=$d_stdio_cnt_lval;;
13548 case "$stdio_base" in
13549 '') stdio_base='((fp)->_base)';;
13551 case "$stdio_bufsiz" in
13552 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13556 : test whether _ptr and _cnt really work
13557 echo "Checking how std your stdio is..." >&4
13560 #$i_stdlib I_STDLIB
13562 #include <stdlib.h>
13564 #define FILE_ptr(fp) $stdio_ptr
13565 #define FILE_cnt(fp) $stdio_cnt
13567 FILE *fp = fopen("try.c", "r");
13570 18 <= FILE_cnt(fp) &&
13571 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13579 if eval $compile && $to try.c; then
13580 if $run ./try; then
13581 echo "Your stdio acts pretty std."
13584 echo "Your stdio isn't very std."
13587 echo "Your stdio doesn't appear very std."
13591 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13592 # direct buffer manipulation no longer works. The Configure tests
13593 # should be changed to correctly detect this, but until then,
13594 # the following check should at least let perl compile and run.
13595 # (This quick fix should be updated before 5.8.1.)
13596 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13597 # A. Dougherty, June 3, 2002.
13598 case "$d_gnulibc" in
13600 case "$gnulibc_version" in
13604 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13613 : Can _ptr be used as an lvalue?
13614 case "$d_stdstdio$ptr_lval" in
13615 $define$define) val=$define ;;
13618 set d_stdio_ptr_lval
13621 : Can _cnt be used as an lvalue?
13622 case "$d_stdstdio$cnt_lval" in
13623 $define$define) val=$define ;;
13626 set d_stdio_cnt_lval
13630 : test whether setting _ptr sets _cnt as a side effect
13631 d_stdio_ptr_lval_sets_cnt="$undef"
13632 d_stdio_ptr_lval_nochange_cnt="$undef"
13633 case "$d_stdio_ptr_lval$d_stdstdio" in
13635 echo "Checking to see what happens if we set the stdio ptr..." >&4
13638 /* Can we scream? */
13639 /* Eat dust sed :-) */
13640 /* In the buffer space, no one can hear you scream. */
13641 #$i_stdlib I_STDLIB
13643 #include <stdlib.h>
13645 #define FILE_ptr(fp) $stdio_ptr
13646 #define FILE_cnt(fp) $stdio_cnt
13647 #include <sys/types.h>
13649 FILE *fp = fopen("try.c", "r");
13654 puts("Fail even to read");
13657 c = getc(fp); /* Read away the first # */
13659 puts("Fail even to read");
13663 18 <= FILE_cnt(fp) &&
13664 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13666 puts("Fail even to read");
13669 ptr = (char*) FILE_ptr(fp);
13670 cnt = (size_t)FILE_cnt(fp);
13672 FILE_ptr(fp) += 42;
13674 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13675 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13678 if (FILE_cnt(fp) <= 20) {
13679 printf ("Fail (<20 chars to test)");
13682 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13683 puts("Fail compare");
13686 if (cnt == FILE_cnt(fp)) {
13687 puts("Pass_unchanged");
13690 if (FILE_cnt(fp) == (cnt - 42)) {
13691 puts("Pass_changed");
13694 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13700 if eval $compile && $to try.c; then
13701 case `$run ./try` in
13703 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13704 d_stdio_ptr_lval_sets_cnt="$define" ;;
13706 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13707 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13709 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13711 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13714 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13720 : see if _base is also standard
13722 case "$d_stdstdio" in
13726 #$i_stdlib I_STDLIB
13728 #include <stdlib.h>
13730 #define FILE_base(fp) $stdio_base
13731 #define FILE_bufsiz(fp) $stdio_bufsiz
13733 FILE *fp = fopen("try.c", "r");
13736 19 <= FILE_bufsiz(fp) &&
13737 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13744 if eval $compile && $to try.c; then
13745 if $run ./try; then
13746 echo "And its _base field acts std."
13749 echo "But its _base field isn't std."
13752 echo "However, it seems to be lacking the _base field."
13760 : see if fast_stdio exists
13762 case "$d_stdstdio:$d_stdio_ptr_lval" in
13764 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13766 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13775 : see if fchdir exists
13776 set fchdir d_fchdir
13779 : see if fchmod exists
13780 set fchmod d_fchmod
13783 : check for openat, unlinkat, renameat, linkat, fchmodat
13784 set openat d_openat
13787 set unlinkat d_unlinkat
13790 set renameat d_renameat
13793 set linkat d_linkat
13796 set fchmodat d_fchmodat
13799 : see if fchown exists
13800 set fchown d_fchown
13803 : see if this is an fcntl system
13807 : See if fcntl-based locking works.
13810 #$i_stdlib I_STDLIB
13812 #include <stdlib.h>
13814 #include <unistd.h>
13816 #include <signal.h>
13817 $signal_t blech(int x) { exit(3); }
13819 #if defined(F_SETLK) && defined(F_SETLKW)
13820 struct flock flock;
13822 fd = open("try.c", O_RDONLY);
13823 flock.l_type = F_RDLCK;
13824 flock.l_whence = SEEK_SET;
13825 flock.l_start = flock.l_len = 0;
13826 signal(SIGALRM, blech);
13828 retval = fcntl(fd, F_SETLK, &flock);
13830 (retval < 0 ? exit(2) : exit(0));
13836 echo "Checking if fcntl-based file locking works... "
13840 if eval $compile_ok; then
13841 if $run ./try; then
13842 echo "Yes, it seems to work."
13845 echo "Nope, it didn't work."
13850 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13851 *** This is (almost) impossible.
13852 *** If your NFS lock daemons are not feeling well, something like
13853 *** this may happen, please investigate. Cannot continue, aborting.
13861 echo "I'm unable to compile the test program, so I'll assume not."
13866 echo "Nope, since you don't even have fcntl()."
13869 set d_fcntl_can_lock
13873 : check for fd_set items
13876 Checking to see how well your C compiler handles fd_set and friends ...
13879 #$i_stdlib I_STDLIB
13881 #include <stdlib.h>
13883 #$i_systime I_SYS_TIME
13884 #$i_sysselct I_SYS_SELECT
13885 #$d_socket HAS_SOCKET
13886 #include <sys/types.h>
13888 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13891 #include <sys/time.h>
13893 #ifdef I_SYS_SELECT
13894 #include <sys/select.h>
13903 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13911 if eval $compile; then
13912 d_fds_bits="$define"
13914 echo "Well, your system knows about the normal fd_set typedef..." >&4
13915 if $run ./try; then
13916 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13917 d_fd_macros="$define"
13920 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13922 d_fd_macros="$undef"
13926 Hmm, your compiler has some difficulty with fd_set. Checking further...
13929 if eval $compile; then
13930 d_fds_bits="$undef"
13932 echo "Well, your system has some sort of fd_set available..." >&4
13933 if $run ./try; then
13934 echo "and you have the normal fd_set macros." >&4
13935 d_fd_macros="$define"
13938 but not the normal fd_set macros! Gross! More work for me...
13940 d_fd_macros="$undef"
13943 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13945 d_fds_bits="$undef"
13946 d_fd_macros="$undef"
13951 : see if fdclose exists
13952 set fdclose d_fdclose
13955 : see if fdim exists
13959 : see if fegetround exists
13960 set fegetround d_fegetround
13963 : see if fgetpos exists
13964 set fgetpos d_fgetpos
13967 : see if finite exists
13968 set finite d_finite
13971 : see if finitel exists
13972 set finitel d_finitel
13975 : see if flock exists
13979 : see if prototype for flock is available
13981 set d_flockproto flock $i_sysfile sys/file.h
13984 : see if fma exists
13988 : see if fmax exists
13992 : see if fmin exists
13996 : see if fp_class exists
13997 set fp_class d_fp_class
14000 : check for fpclassify
14001 echo "Checking to see if you have fpclassify..." >&4
14004 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14007 if eval $compile; then
14009 echo "You have fpclassify."
14012 echo "You do not have fpclassify."
14018 : see if fp_classify exists
14019 set fp_classify d_fp_classify
14022 : see if fp_classl exists
14023 set fp_classl d_fp_classl
14026 : see if pathconf exists
14027 set pathconf d_pathconf
14030 : see if fpathconf exists
14031 set fpathconf d_fpathconf
14034 : see if fpclass exists
14035 set fpclass d_fpclass
14038 : see if fpclassl exists
14039 set fpclassl d_fpclassl
14042 : see if fpgetround exists
14043 set fpgetround d_fpgetround
14046 : check for fpos64_t
14048 echo "Checking to see if you have fpos64_t..." >&4
14051 int main() { fpos64_t x = 7; }
14054 if eval $compile; then
14056 echo "You have fpos64_t."
14059 echo "You do not have fpos64_t."
14060 case "$fpossize" in
14061 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14068 : see if frexpl exists
14069 set frexpl d_frexpl
14072 : see if this is a sys/param system
14073 set sys/param.h i_sysparam
14076 : see if this is a sys/mount.h system
14077 set sys/mount.h i_sysmount
14080 : Check for fs_data_s
14082 echo "Checking to see if your system supports struct fs_data..." >&4
14083 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14085 case "$d_fs_data_s" in
14086 "$define") echo "Yes, it does." ;;
14087 *) echo "No, it doesn't." ;;
14090 : see if fseeko exists
14091 set fseeko d_fseeko
14093 case "$longsize" in
14094 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14097 : see if fsetpos exists
14098 set fsetpos d_fsetpos
14101 : see if fstatfs exists
14102 set fstatfs d_fstatfs
14105 : see if statvfs exists
14106 set statvfs d_statvfs
14109 : see if fstatvfs exists
14110 set fstatvfs d_fstatvfs
14113 : see if fsync exists
14117 : see if ftello exists
14118 set ftello d_ftello
14120 case "$longsize" in
14121 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14124 : check for a working futimes
14127 echo "Checking if you have a working futimes()" >&4
14130 #include <stdlib.h>
14131 #include <sys/time.h>
14134 #include <stdlib.h>
14139 fd = open ("try.c", O_RDWR);
14140 if (-1 == fd) exit (1);
14141 rv = futimes (fd, NULL);
14142 exit (rv == -1 ? errno : 0);
14146 if eval $compile; then
14150 0) echo "Yes, you have" >&4
14151 d_futimes="$define"
14153 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14157 echo "No, it does not (probably harmless)" >&4
14161 : look for gai_strerror
14163 $cat >try.c <<'EOCP'
14164 #include <sys/types.h>
14165 #include <sys/socket.h>
14169 return (gai_strerror (0) ? 0 : 1);
14174 if eval $compile; then
14177 0) echo "A working gai_strerror() found." >&4
14179 *) echo "gai_strerror() found, but it doesn't work" >&4
14183 echo "gai_strerror() NOT found." >&4
14189 : see if ndbm.h is available
14192 : Compatibility location for RedHat 7.1
14193 set gdbm/ndbm.h i_gdbmndbm
14195 : Compatibility location for Debian 4.0
14196 set gdbm-ndbm.h i_gdbm_ndbm
14200 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14201 : see if dbm_open exists
14202 set dbm_open d_dbm_open
14204 case "$d_dbm_open" in
14207 i_gdbmndbm="$undef"
14208 i_gdbm_ndbm="$undef"
14209 echo "We won't be including <ndbm.h>"
14219 ndbm_hdr_protochk='name=$1; hdr=$2;
14220 eval "ihdr=\$""i_$name";
14222 if $test "$ihdr" = "$define"; then
14223 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14224 case "$d_cplusplus" in
14225 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14226 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14229 $define) $echo "Your <$hdr> seems to have prototypes";;
14230 *) $echo "Your <$hdr> does not seem to have prototypes";;
14233 set "d_${name}_h_uses_prototypes";
14237 eval $ndbm_hdr_protochk
14238 set gdbmndbm gdbm/ndbm.h
14239 eval $ndbm_hdr_protochk
14240 set gdbm_ndbm gdbm-ndbm.h
14241 eval $ndbm_hdr_protochk
14243 : see if getaddrinfo exists
14244 set getaddrinfo d_getaddrinfo
14247 : see if getcwd exists
14248 set getcwd d_getcwd
14251 : see if getespwnam exists
14252 set getespwnam d_getespwnam
14255 : see if getfsstat exists
14256 set getfsstat d_getfsstat
14259 : see if getgrent exists
14260 set getgrent d_getgrent
14263 : see if getgrent_r exists
14264 set getgrent_r d_getgrent_r
14266 case "$d_getgrent_r" in
14268 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14269 case "$d_getgrent_r_proto:$usethreads" in
14270 ":define") d_getgrent_r_proto=define
14271 set d_getgrent_r_proto getgrent_r $hdrs
14275 case "$d_getgrent_r_proto" in
14277 case "$getgrent_r_proto" in
14278 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14279 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14281 case "$getgrent_r_proto" in
14282 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14283 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14285 case "$getgrent_r_proto" in
14286 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14287 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14289 case "$getgrent_r_proto" in
14290 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14291 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14293 case "$getgrent_r_proto" in
14294 ''|0) try='int getgrent_r(struct group*, char*, int);'
14295 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14297 case "$getgrent_r_proto" in
14298 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14299 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14301 case "$getgrent_r_proto" in
14302 ''|0) d_getgrent_r=undef
14304 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14305 * ) case "$getgrent_r_proto" in
14306 REENTRANT_PROTO*) ;;
14307 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14309 echo "Prototype: $try" ;;
14312 *) case "$usethreads" in
14313 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14320 *) getgrent_r_proto=0
14324 : see if getgrgid_r exists
14325 set getgrgid_r d_getgrgid_r
14327 case "$d_getgrgid_r" in
14329 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14330 case "$d_getgrgid_r_proto:$usethreads" in
14331 ":define") d_getgrgid_r_proto=define
14332 set d_getgrgid_r_proto getgrgid_r $hdrs
14336 case "$d_getgrgid_r_proto" in
14338 case "$getgrgid_r_proto" in
14339 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14340 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14342 case "$getgrgid_r_proto" in
14343 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14344 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14346 case "$getgrgid_r_proto" in
14347 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14348 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14350 case "$getgrgid_r_proto" in
14351 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14352 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14354 case "$getgrgid_r_proto" in
14355 ''|0) d_getgrgid_r=undef
14357 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14358 * ) case "$getgrgid_r_proto" in
14359 REENTRANT_PROTO*) ;;
14360 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14362 echo "Prototype: $try" ;;
14365 *) case "$usethreads" in
14366 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14373 *) getgrgid_r_proto=0
14377 : see if getgrnam_r exists
14378 set getgrnam_r d_getgrnam_r
14380 case "$d_getgrnam_r" in
14382 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14383 case "$d_getgrnam_r_proto:$usethreads" in
14384 ":define") d_getgrnam_r_proto=define
14385 set d_getgrnam_r_proto getgrnam_r $hdrs
14389 case "$d_getgrnam_r_proto" in
14391 case "$getgrnam_r_proto" in
14392 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14393 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14395 case "$getgrnam_r_proto" in
14396 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14397 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14399 case "$getgrnam_r_proto" in
14400 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14401 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14403 case "$getgrnam_r_proto" in
14404 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14405 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14407 case "$getgrnam_r_proto" in
14408 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14409 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14411 case "$getgrnam_r_proto" in
14412 ''|0) d_getgrnam_r=undef
14414 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14415 * ) case "$getgrnam_r_proto" in
14416 REENTRANT_PROTO*) ;;
14417 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14419 echo "Prototype: $try" ;;
14422 *) case "$usethreads" in
14423 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14430 *) getgrnam_r_proto=0
14434 : see if gethostbyaddr exists
14435 set gethostbyaddr d_gethbyaddr
14438 : see if gethostbyname exists
14439 set gethostbyname d_gethbyname
14442 : see if gethostent exists
14443 set gethostent d_gethent
14446 : see how we will look up host name
14449 if set gethostname val -f d_gethname; eval $csym; $val; then
14450 echo 'gethostname() found.' >&4
14451 d_gethname="$define"
14454 if set uname val -f d_uname; eval $csym; $val; then
14457 uname() was found, but you're running xenix, and older versions of xenix
14458 have a broken uname(). If you don't really know whether your xenix is old
14459 enough to have a broken system call, use the default answer.
14464 "$define") dflt=n;;
14466 rp='Is your uname() broken?'
14469 n*) d_uname="$define"; call=uname;;
14472 echo 'uname() found.' >&4
14479 case "$d_gethname" in
14480 '') d_gethname="$undef";;
14483 '') d_uname="$undef";;
14485 case "$d_uname$d_gethname" in
14490 Every now and then someone has a $call() that lies about the hostname
14491 but can't be fixed for political or economic reasons. If you wish, I can
14492 pretend $call() isn't there and maybe compute hostname at run-time
14493 thanks to the '$phostname' command.
14496 rp="Shall I ignore $call() from now on?"
14499 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14502 case "$phostname" in
14503 '') aphostname='';;
14504 *) case "$aphostname" in
14506 *) set X $phostname
14510 file=`./loc $file $file $pth`
14511 aphostname=`echo $file $*`
14516 case "$d_uname$d_gethname" in
14519 case "$phostname" in
14521 echo "There will be no way for $package to get your hostname." >&4;;
14523 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14527 case "$d_phostname" in
14528 '') d_phostname="$undef";;
14531 : see if gethostbyaddr_r exists
14532 set gethostbyaddr_r d_gethostbyaddr_r
14534 case "$d_gethostbyaddr_r" in
14536 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14537 case "$d_gethostbyaddr_r_proto:$usethreads" in
14538 ":define") d_gethostbyaddr_r_proto=define
14539 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14543 case "$d_gethostbyaddr_r_proto" in
14545 case "$gethostbyaddr_r_proto" in
14546 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14547 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14549 case "$gethostbyaddr_r_proto" in
14550 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14551 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14553 case "$gethostbyaddr_r_proto" in
14554 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14555 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14557 case "$gethostbyaddr_r_proto" in
14558 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14559 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14561 case "$gethostbyaddr_r_proto" in
14562 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14563 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14565 case "$gethostbyaddr_r_proto" in
14566 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14567 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14569 case "$gethostbyaddr_r_proto" in
14570 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14571 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14573 case "$gethostbyaddr_r_proto" in
14574 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14575 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14577 case "$gethostbyaddr_r_proto" in
14578 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14579 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14581 case "$gethostbyaddr_r_proto" in
14582 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14583 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14585 case "$gethostbyaddr_r_proto" in
14586 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14587 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14589 case "$gethostbyaddr_r_proto" in
14590 ''|0) d_gethostbyaddr_r=undef
14591 gethostbyaddr_r_proto=0
14592 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14593 * ) case "$gethostbyaddr_r_proto" in
14594 REENTRANT_PROTO*) ;;
14595 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14597 echo "Prototype: $try" ;;
14600 *) case "$usethreads" in
14601 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14603 d_gethostbyaddr_r=undef
14604 gethostbyaddr_r_proto=0
14608 *) gethostbyaddr_r_proto=0
14612 : see if gethostbyname_r exists
14613 set gethostbyname_r d_gethostbyname_r
14615 case "$d_gethostbyname_r" in
14617 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14618 case "$d_gethostbyname_r_proto:$usethreads" in
14619 ":define") d_gethostbyname_r_proto=define
14620 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14624 case "$d_gethostbyname_r_proto" in
14626 case "$gethostbyname_r_proto" in
14627 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14628 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14630 case "$gethostbyname_r_proto" in
14631 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14632 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14634 case "$gethostbyname_r_proto" in
14635 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14636 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14638 case "$gethostbyname_r_proto" in
14639 ''|0) d_gethostbyname_r=undef
14640 gethostbyname_r_proto=0
14641 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14642 * ) case "$gethostbyname_r_proto" in
14643 REENTRANT_PROTO*) ;;
14644 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14646 echo "Prototype: $try" ;;
14649 *) case "$usethreads" in
14650 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14652 d_gethostbyname_r=undef
14653 gethostbyname_r_proto=0
14657 *) gethostbyname_r_proto=0
14661 : see if gethostent_r exists
14662 set gethostent_r d_gethostent_r
14664 case "$d_gethostent_r" in
14666 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14667 case "$d_gethostent_r_proto:$usethreads" in
14668 ":define") d_gethostent_r_proto=define
14669 set d_gethostent_r_proto gethostent_r $hdrs
14673 case "$d_gethostent_r_proto" in
14675 case "$gethostent_r_proto" in
14676 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14677 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14679 case "$gethostent_r_proto" in
14680 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14681 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14683 case "$gethostent_r_proto" in
14684 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14685 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14687 case "$gethostent_r_proto" in
14688 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14689 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14691 case "$gethostent_r_proto" in
14692 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14693 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14695 case "$gethostent_r_proto" in
14696 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14697 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14699 case "$gethostent_r_proto" in
14700 ''|0) d_gethostent_r=undef
14701 gethostent_r_proto=0
14702 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14703 * ) case "$gethostent_r_proto" in
14704 REENTRANT_PROTO*) ;;
14705 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14707 echo "Prototype: $try" ;;
14710 *) case "$usethreads" in
14711 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14713 d_gethostent_r=undef
14714 gethostent_r_proto=0
14718 *) gethostent_r_proto=0
14722 : see if prototypes for various gethostxxx netdb.h functions are available
14724 set d_gethostprotos gethostent $i_netdb netdb.h
14727 : see if getitimer exists
14728 set getitimer d_getitimer
14731 : see if getlogin exists
14732 set getlogin d_getlogin
14735 : see if getlogin_r exists
14736 set getlogin_r d_getlogin_r
14738 case "$d_getlogin_r" in
14740 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14741 case "$d_getlogin_r_proto:$usethreads" in
14742 ":define") d_getlogin_r_proto=define
14743 set d_getlogin_r_proto getlogin_r $hdrs
14747 case "$d_getlogin_r_proto" in
14749 case "$getlogin_r_proto" in
14750 ''|0) try='int getlogin_r(char*, size_t);'
14751 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14753 case "$getlogin_r_proto" in
14754 ''|0) try='int getlogin_r(char*, int);'
14755 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14757 case "$getlogin_r_proto" in
14758 ''|0) try='char* getlogin_r(char*, size_t);'
14759 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14761 case "$getlogin_r_proto" in
14762 ''|0) try='char* getlogin_r(char*, int);'
14763 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14765 case "$getlogin_r_proto" in
14766 ''|0) d_getlogin_r=undef
14768 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14769 * ) case "$getlogin_r_proto" in
14770 REENTRANT_PROTO*) ;;
14771 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14773 echo "Prototype: $try" ;;
14776 *) case "$usethreads" in
14777 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14784 *) getlogin_r_proto=0
14788 : see if getmnt exists
14789 set getmnt d_getmnt
14792 : see if getmntent exists
14793 set getmntent d_getmntent
14796 : see if getnameinfo exists
14797 set getnameinfo d_getnameinfo
14800 : see if getnetbyaddr exists
14801 set getnetbyaddr d_getnbyaddr
14804 : see if getnetbyname exists
14805 set getnetbyname d_getnbyname
14808 : see if getnetent exists
14809 set getnetent d_getnent
14812 : see if getnetbyaddr_r exists
14813 set getnetbyaddr_r d_getnetbyaddr_r
14815 case "$d_getnetbyaddr_r" in
14817 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14818 case "$d_getnetbyaddr_r_proto:$usethreads" in
14819 ":define") d_getnetbyaddr_r_proto=define
14820 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14824 case "$d_getnetbyaddr_r_proto" in
14826 case "$getnetbyaddr_r_proto" in
14827 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14828 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14830 case "$getnetbyaddr_r_proto" in
14831 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14832 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14834 case "$getnetbyaddr_r_proto" in
14835 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14836 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14838 case "$getnetbyaddr_r_proto" in
14839 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14840 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14842 case "$getnetbyaddr_r_proto" in
14843 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14844 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14846 case "$getnetbyaddr_r_proto" in
14847 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14848 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14850 case "$getnetbyaddr_r_proto" in
14851 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14852 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14854 case "$getnetbyaddr_r_proto" in
14855 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14856 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14858 case "$getnetbyaddr_r_proto" in
14859 ''|0) d_getnetbyaddr_r=undef
14860 getnetbyaddr_r_proto=0
14861 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14862 * ) case "$getnetbyaddr_r_proto" in
14863 REENTRANT_PROTO*) ;;
14864 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14866 echo "Prototype: $try" ;;
14869 *) case "$usethreads" in
14870 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14872 d_getnetbyaddr_r=undef
14873 getnetbyaddr_r_proto=0
14877 *) getnetbyaddr_r_proto=0
14881 : see if getnetbyname_r exists
14882 set getnetbyname_r d_getnetbyname_r
14884 case "$d_getnetbyname_r" in
14886 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14887 case "$d_getnetbyname_r_proto:$usethreads" in
14888 ":define") d_getnetbyname_r_proto=define
14889 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14893 case "$d_getnetbyname_r_proto" in
14895 case "$getnetbyname_r_proto" in
14896 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14897 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14899 case "$getnetbyname_r_proto" in
14900 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14901 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14903 case "$getnetbyname_r_proto" in
14904 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14905 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14907 case "$getnetbyname_r_proto" in
14908 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14909 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14911 case "$getnetbyname_r_proto" in
14912 ''|0) d_getnetbyname_r=undef
14913 getnetbyname_r_proto=0
14914 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14915 * ) case "$getnetbyname_r_proto" in
14916 REENTRANT_PROTO*) ;;
14917 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14919 echo "Prototype: $try" ;;
14922 *) case "$usethreads" in
14923 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14925 d_getnetbyname_r=undef
14926 getnetbyname_r_proto=0
14930 *) getnetbyname_r_proto=0
14934 : see if getnetent_r exists
14935 set getnetent_r d_getnetent_r
14937 case "$d_getnetent_r" in
14939 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14940 case "$d_getnetent_r_proto:$usethreads" in
14941 ":define") d_getnetent_r_proto=define
14942 set d_getnetent_r_proto getnetent_r $hdrs
14946 case "$d_getnetent_r_proto" in
14948 case "$getnetent_r_proto" in
14949 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14950 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14952 case "$getnetent_r_proto" in
14953 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14954 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14956 case "$getnetent_r_proto" in
14957 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14958 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14960 case "$getnetent_r_proto" in
14961 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14962 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14964 case "$getnetent_r_proto" in
14965 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14966 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14968 case "$getnetent_r_proto" in
14969 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14970 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14972 case "$getnetent_r_proto" in
14973 ''|0) d_getnetent_r=undef
14974 getnetent_r_proto=0
14975 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14976 * ) case "$getnetent_r_proto" in
14977 REENTRANT_PROTO*) ;;
14978 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14980 echo "Prototype: $try" ;;
14983 *) case "$usethreads" in
14984 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14986 d_getnetent_r=undef
14987 getnetent_r_proto=0
14991 *) getnetent_r_proto=0
14995 : see if prototypes for various getnetxxx netdb.h functions are available
14997 set d_getnetprotos getnetent $i_netdb netdb.h
15000 : see if getpagesize exists
15001 set getpagesize d_getpagsz
15004 : Optional checks for getprotobyname and getprotobynumber
15006 : see if getprotobyname exists
15007 set getprotobyname d_getpbyname
15010 : see if getprotobynumber exists
15011 set getprotobynumber d_getpbynumber
15014 : see if getprotoent exists
15015 set getprotoent d_getpent
15018 : see if getpgid exists
15019 set getpgid d_getpgid
15022 : see if getpgrp2 exists
15023 set getpgrp2 d_getpgrp2
15026 : see if getppid exists
15027 set getppid d_getppid
15030 : see if getpriority exists
15031 set getpriority d_getprior
15034 : see if getprotobyname_r exists
15035 set getprotobyname_r d_getprotobyname_r
15037 case "$d_getprotobyname_r" in
15039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15040 case "$d_getprotobyname_r_proto:$usethreads" in
15041 ":define") d_getprotobyname_r_proto=define
15042 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15046 case "$d_getprotobyname_r_proto" in
15048 case "$getprotobyname_r_proto" in
15049 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15050 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15052 case "$getprotobyname_r_proto" in
15053 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15054 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15056 case "$getprotobyname_r_proto" in
15057 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15058 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15060 case "$getprotobyname_r_proto" in
15061 ''|0) d_getprotobyname_r=undef
15062 getprotobyname_r_proto=0
15063 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15064 * ) case "$getprotobyname_r_proto" in
15065 REENTRANT_PROTO*) ;;
15066 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15068 echo "Prototype: $try" ;;
15071 *) case "$usethreads" in
15072 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15074 d_getprotobyname_r=undef
15075 getprotobyname_r_proto=0
15079 *) getprotobyname_r_proto=0
15083 : see if getprotobynumber_r exists
15084 set getprotobynumber_r d_getprotobynumber_r
15086 case "$d_getprotobynumber_r" in
15088 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15089 case "$d_getprotobynumber_r_proto:$usethreads" in
15090 ":define") d_getprotobynumber_r_proto=define
15091 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15095 case "$d_getprotobynumber_r_proto" in
15097 case "$getprotobynumber_r_proto" in
15098 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15099 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15101 case "$getprotobynumber_r_proto" in
15102 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15103 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15105 case "$getprotobynumber_r_proto" in
15106 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15107 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15109 case "$getprotobynumber_r_proto" in
15110 ''|0) d_getprotobynumber_r=undef
15111 getprotobynumber_r_proto=0
15112 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15113 * ) case "$getprotobynumber_r_proto" in
15114 REENTRANT_PROTO*) ;;
15115 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15117 echo "Prototype: $try" ;;
15120 *) case "$usethreads" in
15121 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15123 d_getprotobynumber_r=undef
15124 getprotobynumber_r_proto=0
15128 *) getprotobynumber_r_proto=0
15132 : see if getprotoent_r exists
15133 set getprotoent_r d_getprotoent_r
15135 case "$d_getprotoent_r" in
15137 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15138 case "$d_getprotoent_r_proto:$usethreads" in
15139 ":define") d_getprotoent_r_proto=define
15140 set d_getprotoent_r_proto getprotoent_r $hdrs
15144 case "$d_getprotoent_r_proto" in
15146 case "$getprotoent_r_proto" in
15147 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15148 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15150 case "$getprotoent_r_proto" in
15151 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15152 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15154 case "$getprotoent_r_proto" in
15155 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15156 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15158 case "$getprotoent_r_proto" in
15159 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15160 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15162 case "$getprotoent_r_proto" in
15163 ''|0) d_getprotoent_r=undef
15164 getprotoent_r_proto=0
15165 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15166 * ) case "$getprotoent_r_proto" in
15167 REENTRANT_PROTO*) ;;
15168 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15170 echo "Prototype: $try" ;;
15173 *) case "$usethreads" in
15174 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15176 d_getprotoent_r=undef
15177 getprotoent_r_proto=0
15181 *) getprotoent_r_proto=0
15185 : see if prototypes for various getprotoxxx netdb.h functions are available
15187 set d_getprotoprotos getprotoent $i_netdb netdb.h
15190 : see if getprpwnam exists
15191 set getprpwnam d_getprpwnam
15194 : see if getpwent exists
15195 set getpwent d_getpwent
15198 : see if getpwent_r exists
15199 set getpwent_r d_getpwent_r
15201 case "$d_getpwent_r" in
15203 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15204 case "$d_getpwent_r_proto:$usethreads" in
15205 ":define") d_getpwent_r_proto=define
15206 set d_getpwent_r_proto getpwent_r $hdrs
15210 case "$d_getpwent_r_proto" in
15212 case "$getpwent_r_proto" in
15213 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15214 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15216 case "$getpwent_r_proto" in
15217 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15218 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15220 case "$getpwent_r_proto" in
15221 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15222 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15224 case "$getpwent_r_proto" in
15225 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15226 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15228 case "$getpwent_r_proto" in
15229 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15230 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15232 case "$getpwent_r_proto" in
15233 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15234 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15236 case "$getpwent_r_proto" in
15237 ''|0) d_getpwent_r=undef
15239 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15240 * ) case "$getpwent_r_proto" in
15241 REENTRANT_PROTO*) ;;
15242 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15244 echo "Prototype: $try" ;;
15247 *) case "$usethreads" in
15248 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15255 *) getpwent_r_proto=0
15259 : see if getpwnam_r exists
15260 set getpwnam_r d_getpwnam_r
15262 case "$d_getpwnam_r" in
15264 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15265 case "$d_getpwnam_r_proto:$usethreads" in
15266 ":define") d_getpwnam_r_proto=define
15267 set d_getpwnam_r_proto getpwnam_r $hdrs
15271 case "$d_getpwnam_r_proto" in
15273 case "$getpwnam_r_proto" in
15274 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15275 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15277 case "$getpwnam_r_proto" in
15278 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15279 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15281 case "$getpwnam_r_proto" in
15282 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15283 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15285 case "$getpwnam_r_proto" in
15286 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15287 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15289 case "$getpwnam_r_proto" in
15290 ''|0) d_getpwnam_r=undef
15292 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15293 * ) case "$getpwnam_r_proto" in
15294 REENTRANT_PROTO*) ;;
15295 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15297 echo "Prototype: $try" ;;
15300 *) case "$usethreads" in
15301 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15308 *) getpwnam_r_proto=0
15312 : see if getpwuid_r exists
15313 set getpwuid_r d_getpwuid_r
15315 case "$d_getpwuid_r" in
15317 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15318 case "$d_getpwuid_r_proto:$usethreads" in
15319 ":define") d_getpwuid_r_proto=define
15320 set d_getpwuid_r_proto getpwuid_r $hdrs
15324 case "$d_getpwuid_r_proto" in
15326 case "$getpwuid_r_proto" in
15327 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15328 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15330 case "$getpwuid_r_proto" in
15331 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15332 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15334 case "$getpwuid_r_proto" in
15335 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15336 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15338 case "$getpwuid_r_proto" in
15339 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15340 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15342 case "$getpwuid_r_proto" in
15343 ''|0) d_getpwuid_r=undef
15345 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15346 * ) case "$getpwuid_r_proto" in
15347 REENTRANT_PROTO*) ;;
15348 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15350 echo "Prototype: $try" ;;
15353 *) case "$usethreads" in
15354 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15361 *) getpwuid_r_proto=0
15365 : Optional checks for getsbyname and getsbyport
15367 : see if getservbyname exists
15368 set getservbyname d_getsbyname
15371 : see if getservbyport exists
15372 set getservbyport d_getsbyport
15375 : see if getservent exists
15376 set getservent d_getsent
15379 : see if getservbyname_r exists
15380 set getservbyname_r d_getservbyname_r
15382 case "$d_getservbyname_r" in
15384 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15385 case "$d_getservbyname_r_proto:$usethreads" in
15386 ":define") d_getservbyname_r_proto=define
15387 set d_getservbyname_r_proto getservbyname_r $hdrs
15391 case "$d_getservbyname_r_proto" in
15393 case "$getservbyname_r_proto" in
15394 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15395 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15397 case "$getservbyname_r_proto" in
15398 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15399 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15401 case "$getservbyname_r_proto" in
15402 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15403 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15405 case "$getservbyname_r_proto" in
15406 ''|0) d_getservbyname_r=undef
15407 getservbyname_r_proto=0
15408 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15409 * ) case "$getservbyname_r_proto" in
15410 REENTRANT_PROTO*) ;;
15411 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15413 echo "Prototype: $try" ;;
15416 *) case "$usethreads" in
15417 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15419 d_getservbyname_r=undef
15420 getservbyname_r_proto=0
15424 *) getservbyname_r_proto=0
15428 : see if getservbyport_r exists
15429 set getservbyport_r d_getservbyport_r
15431 case "$d_getservbyport_r" in
15433 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15434 case "$d_getservbyport_r_proto:$usethreads" in
15435 ":define") d_getservbyport_r_proto=define
15436 set d_getservbyport_r_proto getservbyport_r $hdrs
15440 case "$d_getservbyport_r_proto" in
15442 case "$getservbyport_r_proto" in
15443 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15444 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15446 case "$getservbyport_r_proto" in
15447 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15448 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15450 case "$getservbyport_r_proto" in
15451 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15452 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15454 case "$getservbyport_r_proto" in
15455 ''|0) d_getservbyport_r=undef
15456 getservbyport_r_proto=0
15457 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15458 * ) case "$getservbyport_r_proto" in
15459 REENTRANT_PROTO*) ;;
15460 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15462 echo "Prototype: $try" ;;
15465 *) case "$usethreads" in
15466 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15468 d_getservbyport_r=undef
15469 getservbyport_r_proto=0
15473 *) getservbyport_r_proto=0
15477 : see if getservent_r exists
15478 set getservent_r d_getservent_r
15480 case "$d_getservent_r" in
15482 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15483 case "$d_getservent_r_proto:$usethreads" in
15484 ":define") d_getservent_r_proto=define
15485 set d_getservent_r_proto getservent_r $hdrs
15489 case "$d_getservent_r_proto" in
15491 case "$getservent_r_proto" in
15492 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15493 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15495 case "$getservent_r_proto" in
15496 ''|0) try='int getservent_r(struct servent*, char*, int);'
15497 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15499 case "$getservent_r_proto" in
15500 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15501 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15503 case "$getservent_r_proto" in
15504 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15505 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15507 case "$getservent_r_proto" in
15508 ''|0) d_getservent_r=undef
15509 getservent_r_proto=0
15510 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15511 * ) case "$getservent_r_proto" in
15512 REENTRANT_PROTO*) ;;
15513 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15515 echo "Prototype: $try" ;;
15518 *) case "$usethreads" in
15519 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15521 d_getservent_r=undef
15522 getservent_r_proto=0
15526 *) getservent_r_proto=0
15530 : see if prototypes for various getservxxx netdb.h functions are available
15532 set d_getservprotos getservent $i_netdb netdb.h
15535 : see if getspnam exists
15536 set getspnam d_getspnam
15539 : see if this is a shadow.h system
15540 set shadow.h i_shadow
15543 : see if getspnam_r exists
15544 set getspnam_r d_getspnam_r
15546 case "$d_getspnam_r" in
15548 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15549 case "$d_getspnam_r_proto:$usethreads" in
15550 ":define") d_getspnam_r_proto=define
15551 set d_getspnam_r_proto getspnam_r $hdrs
15555 case "$d_getspnam_r_proto" in
15557 case "$getspnam_r_proto" in
15558 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15559 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15561 case "$getspnam_r_proto" in
15562 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15563 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15565 case "$getspnam_r_proto" in
15566 ''|0) d_getspnam_r=undef
15568 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15569 * ) case "$getspnam_r_proto" in
15570 REENTRANT_PROTO*) ;;
15571 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15573 echo "Prototype: $try" ;;
15576 *) case "$usethreads" in
15577 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15584 *) getspnam_r_proto=0
15588 : see if gettimeofday or ftime exists
15589 set gettimeofday d_gettimeod
15591 case "$d_gettimeod" in
15597 val="$undef"; set d_ftime; eval $setvar
15600 case "$d_gettimeod$d_ftime" in
15603 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15607 : see if gmtime_r exists
15608 set gmtime_r d_gmtime_r
15610 case "$d_gmtime_r" in
15612 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15613 case "$d_gmtime_r_proto:$usethreads" in
15614 ":define") d_gmtime_r_proto=define
15615 set d_gmtime_r_proto gmtime_r $hdrs
15619 case "$d_gmtime_r_proto" in
15621 case "$gmtime_r_proto" in
15622 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15623 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15625 case "$gmtime_r_proto" in
15626 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15627 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15629 case "$gmtime_r_proto" in
15630 ''|0) d_gmtime_r=undef
15632 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15633 * ) case "$gmtime_r_proto" in
15634 REENTRANT_PROTO*) ;;
15635 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15637 echo "Prototype: $try" ;;
15640 *) case "$usethreads" in
15641 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15648 *) gmtime_r_proto=0
15652 : see if hasmntopt exists
15653 set hasmntopt d_hasmntopt
15656 : see if this is a netinet/in.h or sys/in.h system
15657 set netinet/in.h i_niin sys/in.h i_sysin
15660 : see if arpa/inet.h has to be included
15661 set arpa/inet.h i_arpainet
15664 : see if htonl --and friends-- exists
15669 : Maybe they are macros.
15672 $cat >htonl.c <<EOM
15674 #include <sys/types.h>
15675 #$i_niin I_NETINET_IN
15677 #$i_arpainet I_ARPA_INET
15678 #ifdef I_NETINET_IN
15679 #include <netinet/in.h>
15682 #include <sys/in.h>
15685 #include <arpa/inet.h>
15688 printf("Defined as a macro.");
15691 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15692 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15694 echo "But it seems to be defined as a macro." >&4
15702 : see if hypot exists
15706 : see if ilogb exists
15710 : see if ilogbl exists
15711 set ilogbl d_ilogbl
15714 : check whether inet_aton exists
15715 set inet_aton d_inetaton
15718 : see if inet_ntop exists
15719 set inet_ntop d_inetntop
15722 : see if inet_pton exists
15723 set inet_pton d_inetpton
15728 $cat >isascii.c <<EOCP
15731 #$i_stdlib I_STDLIB
15733 #include <stdlib.h>
15744 if eval $compile; then
15745 echo "isascii() found." >&4
15748 echo "isascii() NOT found." >&4
15757 $cat >isblank.c <<'EOCP'
15768 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15769 echo "isblank() found." >&4
15772 echo "isblank() NOT found." >&4
15779 : check for isfinite
15780 echo "Checking to see if you have isfinite..." >&4
15783 int main() { return isfinite(0.0); }
15786 if eval $compile; then
15788 echo "You have isfinite."
15791 echo "You do not have isfinite."
15797 : see if isfinitel exists
15798 set isfinitel d_isfinitel
15802 echo "Checking to see if you have isinf..." >&4
15805 int main() { return isinf(0.0); }
15808 if eval $compile; then
15810 echo "You have isinf."
15813 echo "You do not have isinf."
15819 : see if isinfl exists
15820 set isinfl d_isinfl
15824 echo "Checking to see if you have isless..." >&4
15827 int main() { return isless(2.0, 1.0); }
15830 if eval $compile; then
15832 echo "You have isless."
15835 echo "You do not have isless."
15842 echo "Checking to see if you have isnan..." >&4
15845 int main() { return isnan(0.0); }
15848 if eval $compile; then
15850 echo "You have isnan."
15853 echo "You do not have isnan."
15859 : see if isnanl exists
15860 set isnanl d_isnanl
15863 : check for isnormal
15864 echo "Checking to see if you have isnormal..." >&4
15867 int main() { return isnormal(0.0); }
15870 if eval $compile; then
15872 echo "You have isnormal."
15875 echo "You do not have isnormal."
15885 : see if j0l exists
15889 : see if killpg exists
15890 set killpg d_killpg
15893 : see if localeconv exists
15894 set localeconv d_locconv
15897 : see if libc has the POSIX.1-2008 currency locale rules
15898 case "$d_locconv:$d_lc_monetary_2008" in
15901 #include <locale.h>
15903 struct lconv *lc = localeconv();
15904 char int_p_cs_precedes = lc->int_p_cs_precedes;
15909 if eval $compile; then
15910 d_lc_monetary_2008="$define"
15912 d_lc_monetary_2008="$undef"
15918 : see if lchown exists
15920 $cat > try.c <<EOCP
15923 #include <stdlib.h>
15924 #$i_unistd I_UNISTD
15926 # include <unistd.h>
15928 int main(int argc, char *argv[])
15930 if (lchown("./try.c", -1, getgid()) == -1) {
15931 exit(EXIT_FAILURE);
15933 exit(EXIT_SUCCESS);
15937 if eval $compile && ./try; then
15938 $echo "lchown() found." >&4
15941 $echo "lchown() NOT found." >&4
15948 : See if number of significant digits in a double precision number is known
15950 $cat >ldbl_dig.c <<EOM
15951 #include <limits.h>
15954 printf("Contains LDBL_DIG");
15957 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15958 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15959 echo "LDBL_DIG found." >&4
15962 echo "LDBL_DIG NOT found." >&4
15969 : see if lgamma exists
15970 set lgamma d_lgamma
15973 : see if lgamma_r exists
15974 set lgamma_r d_lgamma_r
15977 : check to see if math.h defines _LIB_VERSION
15978 d_libm_lib_version="$undef"
15980 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15982 #include <unistd.h>
15984 int main (int argc, char *argv[])
15986 printf ("%d\n", _LIB_VERSION);
15991 if eval $compile; then
15993 echo "Yes, it does ($foo)" >&4
15994 d_libm_lib_version="$define"
15996 echo "No, it does not (probably harmless)" >&4
16000 : see if link exists
16004 : see if llrint exists
16005 set llrint d_llrint
16008 : see if llrintl exists
16009 set llrintl d_llrintl
16012 : see if llround exists
16013 set llround d_llround
16016 : see if llroundl exists
16017 set llroundl d_llroundl
16020 : see if localeconv_l exists
16021 set localeconv_l d_localeconv_l
16024 : see if localtime_r exists
16025 set localtime_r d_localtime_r
16027 case "$d_localtime_r" in
16029 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16030 case "$d_localtime_r_proto:$usethreads" in
16031 ":define") d_localtime_r_proto=define
16032 set d_localtime_r_proto localtime_r $hdrs
16036 case "$d_localtime_r_proto" in
16038 case "$localtime_r_proto" in
16039 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16040 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16042 case "$localtime_r_proto" in
16043 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16044 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16046 case "$localtime_r_proto" in
16047 ''|0) d_localtime_r=undef
16048 localtime_r_proto=0
16049 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16050 * ) case "$localtime_r_proto" in
16051 REENTRANT_PROTO*) ;;
16052 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16054 echo "Prototype: $try" ;;
16057 *) case "$usethreads" in
16058 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16060 d_localtime_r=undef
16061 localtime_r_proto=0
16065 *) localtime_r_proto=0
16069 : see if localtime_r calls tzset
16070 case "$localtime_r_proto" in
16073 /* Does our libc's localtime_r call tzset ?
16074 * return 0 if so, 1 otherwise.
16076 #$i_systypes I_SYS_TYPES
16077 #$i_unistd I_UNISTD
16079 #$i_stdlib I_STDLIB
16080 #$i_malloc I_MALLOC
16082 # include <sys/types.h>
16085 # include <unistd.h>
16091 #include <stdlib.h>
16093 #include <string.h>
16095 # include <malloc.h>
16099 time_t t = time(0L);
16100 char w_tz[]="TZ" "=GMT+5",
16101 e_tz[]="TZ" "=GMT-5",
16102 *tz_e = (char*)malloc(16),
16103 *tz_w = (char*)malloc(16);
16104 struct tm tm_e, tm_w;
16105 memset(&tm_e,'\0',sizeof(struct tm));
16106 memset(&tm_w,'\0',sizeof(struct tm));
16111 localtime_r(&t, &tm_e);
16114 localtime_r(&t, &tm_w);
16116 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16122 if eval $compile; then
16123 if $run ./try; then
16124 d_localtime_r_needs_tzset=undef;
16126 d_localtime_r_needs_tzset=define;
16129 d_localtime_r_needs_tzset=undef;
16133 d_localtime_r_needs_tzset=undef;
16138 : see if lockf exists
16142 : see if log1p exists
16146 : see if log2 exists
16150 : see if logb exists
16154 : see if lrint exists
16158 : see if lrintl exists
16159 set lrintl d_lrintl
16162 : see if lround exists
16163 set lround d_lround
16166 : see if lroundl exists
16167 set lroundl d_lroundl
16170 : see if prototype for lseek is available
16172 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16175 : see if lstat exists
16179 : see if madvise exists
16180 set madvise d_madvise
16183 : see if malloc_size exists
16184 set malloc_size d_malloc_size
16187 : see if malloc_size_good exists
16188 set malloc_good_size d_malloc_good_size
16191 : see if malloc_usable_size exists
16192 set malloc_usable_size d_malloc_usable_size
16195 : see if mblen exists
16199 : see if mbrlen exists
16200 set mbrlen d_mbrlen
16203 : see if mbrtowc exists
16204 set mbrtowc d_mbrtowc
16207 : see if mbstowcs exists
16208 set mbstowcs d_mbstowcs
16211 : see if mbtowc exists
16212 set mbtowc d_mbtowc
16215 : see if memmem exists
16216 : We need both a prototype in string.h and the symbol in libc.
16219 xx1="#$d_gnulibc HAS_GNULIBC"
16220 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16221 xx3='# define _GNU_SOURCE'
16223 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16225 case "$d_memmem_proto" in
16226 define) # see if memmem exists
16227 set memmem d_memmem
16236 : see if memrchr exists
16237 : We need both a prototype in string.h and the symbol in libc.
16240 xx1="#$d_gnulibc HAS_GNULIBC"
16241 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16242 xx3='# define _GNU_SOURCE'
16244 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16246 case "$d_memrchr_proto" in
16247 define) # see if memrchr exists
16248 set memrchr d_memrchr
16257 : see if mkdir exists
16261 : see if mkdtemp exists
16262 set mkdtemp d_mkdtemp
16265 : see if mkfifo exists
16266 set mkfifo d_mkfifo
16269 : see if mkostemp exists
16270 set mkostemp d_mkostemp
16273 : see if mkstemp exists
16274 set mkstemp d_mkstemp
16277 : see if mkstemps exists
16278 set mkstemps d_mkstemps
16281 : see if mktime exists
16282 set mktime d_mktime
16285 : see if sys/mman.h has to be included
16286 set sys/mman.h i_sysmman
16289 : see if mmap exists
16292 : see what shmat returns
16293 : default to something harmless
16295 case "$i_sysmman$d_mmap" in
16297 $cat >mmap.c <<'END'
16298 #include <sys/mman.h>
16301 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16306 echo "and it returns ($mmaptype)." >&4
16310 : see if sqrtl exists
16314 : see if scalbnl exists
16315 set scalbnl d_scalbnl
16318 : see if truncl exists
16319 set truncl d_truncl
16322 : see if modfl exists
16326 : see if prototype for modfl is available
16328 set d_modflproto modfl define math.h
16331 if $test "$uselongdouble" = "$define"; then
16333 if $test "$d_sqrtl" != "$define"; then
16334 message="$message sqrtl"
16336 if $test "$d_modfl" != "$define"; then
16337 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16338 echo "You have both truncl and copysignl, so I can emulate modfl."
16340 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16341 echo "You have both aintl and copysignl, so I can emulate modfl."
16343 message="$message modfl"
16347 if $test "$d_frexpl" != "$define"; then
16348 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16349 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16351 message="$message frexpl"
16354 if $test "$d_ldexpl" != "$define"; then
16355 message="$message ldexpl"
16358 if $test "$message" != ""; then
16361 *** You requested the use of long doubles but you do not seem to have
16362 *** the following mathematical functions needed for long double support:
16364 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16365 *** Cannot continue, aborting.
16373 : see if mprotect exists
16374 set mprotect d_mprotect
16377 : see if msgctl exists
16378 set msgctl d_msgctl
16381 : see if msgget exists
16382 set msgget d_msgget
16385 : see if msgsnd exists
16386 set msgsnd d_msgsnd
16389 : see if msgrcv exists
16390 set msgrcv d_msgrcv
16393 : see how much of the 'msg*(2)' library is present.
16396 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16397 *"$undef"*) h_msg=false;;
16401 case "`ipcs 2>&1`" in
16402 "SVID messages"*"not configured"*)
16403 echo "Your $osname does not have the msg*(2) configured." >&4
16406 set msgctl d_msgctl
16408 set msgget d_msgget
16410 set msgsnd d_msgsnd
16412 set msgrcv d_msgrcv
16418 : we could also check for sys/ipc.h ...
16419 if $h_msg && $test `./findhdr sys/msg.h`; then
16420 echo "You have the full msg*(2) library." >&4
16423 echo "You don't have the full msg*(2) library." >&4
16429 : Check for msghdr_s
16431 echo "Checking to see if your system supports struct msghdr..." >&4
16432 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16434 case "$d_msghdr_s" in
16435 "$define") echo "Yes, it does." ;;
16436 *) echo "No, it doesn't." ;;
16439 : see if msync exists
16443 : see if munmap exists
16444 set munmap d_munmap
16447 : see if nan exists
16451 : see if nanosleep exists
16452 set nanosleep d_nanosleep
16455 : see if nearbyint exists
16456 set nearbyint d_nearbyint
16459 : see if nextafter exists
16460 set nextafter d_nextafter
16463 : see if nexttoward exists
16464 set nexttoward d_nexttoward
16467 : see if nice exists
16471 : see if this is a langinfo.h system
16472 set langinfo.h i_langinfo
16475 : see if nl_langinfo exists
16476 set nl_langinfo d_nl_langinfo
16479 : see if this is a quadmath.h system
16480 set quadmath.h i_quadmath
16483 : Check basic sizes
16485 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16487 case "$use64bitint:$d_quad:$quadtype" in
16490 uvtype="$uquadtype"
16495 uvtype="unsigned long"
16501 case "$uselongdouble:$d_longdbl" in
16503 nvtype="long double"
16504 nvsize=$longdblsize
16511 case "$usequadmath:$i_quadmath" in
16513 nvtype="__float128"
16519 *** You requested the use of the quadmath library, but you
16520 *** do not seem to have the quadmath library installed.
16521 *** Cannot continue, aborting.
16527 define:*) $cat <<EOM >&4
16529 *** You requested the use of the quadmath library, but you
16530 *** do not seem to have the required header, <quadmath.h>.
16532 case "$gccversion" in
16535 *** Your gcc looks a bit old:
16541 *** You are not running a gcc.
16546 *** For the quadmath library you need at least gcc 4.6.
16547 *** Cannot continue, aborting.
16553 $echo "(IV will be "$ivtype", $ivsize bytes)"
16554 $echo "(UV will be "$uvtype", $uvsize bytes)"
16555 $echo "(NV will be "$nvtype", $nvsize bytes)"
16558 #$i_inttypes I_INTTYPES
16560 #include <inttypes.h>
16565 int8_t i = INT8_MAX;
16566 uint8_t u = UINT8_MAX;
16567 printf("int8_t\n");
16570 int16_t i = INT16_MAX;
16571 uint16_t u = UINT16_MAX;
16572 printf("int16_t\n");
16575 int32_t i = INT32_MAX;
16576 uint32_t u = UINT32_MAX;
16577 printf("int32_t\n");
16582 i8type="signed char"
16583 u8type="unsigned char"
16588 '') case "$shortsize" in
16590 u16type="unsigned short"
16598 '') set try -DINT16
16599 if eval $compile; then
16600 case "`$run ./try`" in
16612 '') if $test $shortsize -ge 2; then
16614 u16type="unsigned short"
16622 '') case "$longsize" in
16624 u32type="unsigned long"
16628 *) case "$intsize" in
16630 u32type="unsigned int"
16640 '') set try -DINT32
16641 if eval $compile; then
16642 case "`$run ./try`" in
16654 '') if $test $intsize -ge 4; then
16656 u32type="unsigned int"
16664 '') case "$d_quad:$quadtype" in
16666 i64type="$quadtype"
16667 u64type="$uquadtype"
16675 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16678 #$i_stdlib I_STDLIB
16680 #include <stdlib.h>
16682 #include <sys/types.h>
16683 #include <signal.h>
16685 /* volatile so that the compiler has to store it out to memory */
16686 volatile int bletched = 0;
16687 $signal_t blech(int s) { bletched = 1; }
16692 int n = 8 * $uvsize;
16695 signal(SIGFPE, blech);
16698 for (i = 0; i < n; i++) {
16699 u = u << 1 | ($uvtype)1;
16701 if (($uvtype)d != u)
16705 d = ($nvtype)(u - 1);
16706 if (($uvtype)d != (u - 1))
16713 printf("%d\n", ((i == n) ? -n : i));
16719 d_nv_preserves_uv="$undef"
16720 if eval $compile; then
16721 nv_preserves_uv_bits="`$run ./try`"
16723 case "$nv_preserves_uv_bits" in
16725 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16726 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16727 d_nv_preserves_uv="$define"
16729 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16730 d_nv_preserves_uv="$undef" ;;
16731 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16732 nv_preserves_uv_bits="0" ;;
16736 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16740 typedef $nvtype NV;
16747 while(count < 256) {
16748 /* volatile so that the compiler has to store it out to memory */
16749 volatile NV up = value + 1.0;
16750 volatile NV negated = -value;
16751 volatile NV down = negated - 1.0;
16752 volatile NV got_up = up - value;
16753 int up_good = got_up == 1.0;
16754 int got_down = down - negated;
16755 int down_good = got_down == -1.0;
16757 if (down_good != up_good) {
16759 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16760 up_good, (double) got_up, down_good, (double) got_down,
16761 count, (double) value);
16768 fputs("256.0", stdout);
16771 fputs("2.0", stdout);
16777 fputs("*", stdout);
16783 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16784 count, (double) value);
16790 nv_overflows_integers_at='0'
16791 if eval $compile; then
16797 The largest integer your NVs can preserve is equal to $xxx
16799 nv_overflows_integers_at="$xxx"
16802 Cannot determine the largest integer value your NVs can hold, unexpected output
16809 Cannot determine the largest integer value your NVs can hold
16816 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16819 #$i_stdlib I_STDLIB
16821 #include <stdlib.h>
16823 #include <string.h>
16824 #include <sys/types.h>
16825 #include <signal.h>
16827 /* volatile so that the compiler has to store it out to memory */
16828 volatile int bletched = 0;
16829 $signal_t blech(int s) { bletched = 1; }
16832 int checkit($nvtype d, const char *where) {
16834 unsigned char *p = (unsigned char *)v;
16835 unsigned char *end = p + sizeof(d);
16844 p = (unsigned char *)v;
16845 printf("No - %s: 0x", where);
16847 printf ("%02X", *p++);
16852 int main(int argc, char **argv) {
16855 fail += checkit(d, "0.0");
16857 /* The compiler shouldn't be assuming that bletched is 0 */
16860 fail += checkit(d, "bleched");
16863 signal(SIGFPE, blech);
16866 /* Paranoia - the compiler should have no way of knowing that ANSI says
16867 that argv[argc] will always be NULL. Actually, if it did assume this it
16868 would be buggy, as this is C and main() can be called from elsewhere in
16870 d = argv[argc] ? 1 : 0;
16873 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16876 fail += checkit(d, "ternary");
16878 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16881 printf("No - memset doesn't give 0.0\n");
16882 /* This might just blow up: */
16883 printf("(gives %g)\n", d);
16889 printf("No - something bleched\n");
16894 printf("No - %d fail(s)\n", fail);
16903 d_nv_zero_is_allbits_zero="$undef"
16904 if eval $compile; then
16910 0.0 is represented as all bits zero in memory
16912 d_nv_zero_is_allbits_zero="$define"
16915 0.0 is not represented as all bits zero in memory
16917 d_nv_zero_is_allbits_zero="$undef"
16922 0.0 is not represented as all bits zero in memory
16924 d_nv_zero_is_allbits_zero="$undef"
16930 : check for off64_t
16932 echo "Checking to see if you have off64_t..." >&4
16934 #include <sys/types.h>
16935 #include <unistd.h>
16936 int main() { off64_t x = 7; }
16939 if eval $compile; then
16941 echo "You have off64_t."
16944 echo "You do not have off64_t."
16945 case "$lseeksize" in
16946 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16953 : how to create joinable pthreads
16954 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16956 echo "Checking what constant to use for creating joinable pthreads..." >&4
16957 $cat >try.c <<'EOCP'
16958 #include <pthread.h>
16960 int detachstate = JOINABLE;
16963 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16964 if eval $compile; then
16965 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16966 val="$undef" # Yes, undef.
16967 set d_old_pthread_create_joinable
16970 set old_pthread_create_joinable
16973 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16974 if eval $compile; then
16975 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16977 set d_old_pthread_create_joinable
16979 val=PTHREAD_CREATE_UNDETACHED
16980 set old_pthread_create_joinable
16983 set try -DJOINABLE=__UNDETACHED
16984 if eval $compile; then
16985 echo "You seem to use __UNDETACHED." >&4
16987 set d_old_pthread_create_joinable
16990 set old_pthread_create_joinable
16993 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16995 set d_old_pthread_create_joinable
16998 set old_pthread_create_joinable
17005 d_old_pthread_create_joinable="$undef"
17006 old_pthread_create_joinable=""
17009 : see if pause exists
17013 : see if pipe2 exists
17017 : see if poll exists
17021 : see if prctl exists
17025 : see if prctl supports PR_SET_NAME
17026 d_prctl_set_name=$undef
17031 #include <unistd.h>
17033 #include <sys/prctl.h>
17035 int main (int argc, char *argv[])
17037 return (prctl (PR_SET_NAME, "Test"));
17041 if eval $compile_ok && $run ./try; then
17042 echo "Your prctl (PR_SET_NAME, ...) works"
17043 d_prctl_set_name=$define
17049 : see if readlink exists
17050 set readlink d_readlink
17053 : Check if there is a /proc symlink to the abs path of
17054 : the executing program. We will honor hints of d_procselfexe=$undef
17055 : or procselfexe being non-empty, otherwise will try to determine both
17056 : if we have readlink.
17057 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17058 : referenced, and AmigaOS does not have a proc filesystem anyway.
17061 if $test "X$d_procselfexe" = Xundef; then
17063 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17065 elif $test "X$d_readlink" = Xdefine; then
17066 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17067 : and it feels more tidy to avoid an extra level of symlink
17068 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17069 while test $# -gt 0; do
17072 if $issymlink $try; then
17073 $ls -l $try > reflect
17074 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17075 echo "You have $type-like $try."
17076 procselfexe='"'$try'"'
17078 : This will break out of the loop
17088 : backward compatibility for d_hvfork
17089 if test X$d_hvfork != X; then
17090 d_vfork="$d_hvfork"
17093 : see if there is a vfork
17098 d_pseudofork=$undef
17100 : Ok, but do we want to use it. vfork is reportedly unreliable in
17101 : perl on Solaris 2.x, and probably elsewhere.
17105 case "$usevfork" in
17111 Perl can only use a vfork() that doesn't suffer from strict
17112 restrictions on calling functions or modifying global data in
17113 the child. For example, glibc-2.1 contains such a vfork()
17114 that is unsuitable. If your system provides a proper fork()
17115 call, chances are that you do NOT want perl to use vfork().
17118 rp="Do you still want to use vfork()?"
17123 echo "Ok, we won't use vfork()."
17132 $define) usevfork='true';;
17133 *) usevfork='false';;
17136 : see whether the pthread_atfork exists
17138 #include <pthread.h>
17141 #ifdef PTHREAD_ATFORK
17142 pthread_atfork(NULL,NULL,NULL);
17147 : see if pthread_atfork exists
17148 set try -DPTHREAD_ATFORK
17149 if eval $compile; then
17154 case "$usethreads" in
17157 $define) echo 'pthread_atfork found.' >&4 ;;
17158 *) echo 'pthread_atfork NOT found.' >&4 ;;
17161 set d_pthread_atfork
17164 : see if pthread_attr_setscope exists
17165 set pthread_attr_setscope d_pthread_attr_setscope
17168 : see whether the various POSIXish _yields exist
17170 #include <pthread.h>
17176 #ifdef PTHREAD_YIELD
17179 #ifdef PTHREAD_YIELD_NULL
17180 pthread_yield(NULL);
17186 : see if sched_yield exists
17187 set try -DSCHED_YIELD
17188 if eval $compile; then
17190 sched_yield='sched_yield()'
17194 case "$usethreads" in
17197 $define) echo 'sched_yield() found.' >&4 ;;
17198 *) echo 'sched_yield() NOT found.' >&4 ;;
17204 : see if pthread_yield exists
17205 set try -DPTHREAD_YIELD
17206 if eval $compile; then
17208 case "$sched_yield" in
17209 '') sched_yield='pthread_yield()' ;;
17212 set try -DPTHREAD_YIELD_NULL
17213 if eval $compile; then
17215 case "$sched_yield" in
17216 '') sched_yield='pthread_yield(NULL)' ;;
17222 case "$usethreads" in
17225 $define) echo 'pthread_yield() found.' >&4 ;;
17226 *) echo 'pthread_yield() NOT found.' >&4 ;;
17230 set d_pthread_yield
17232 case "$sched_yield" in
17233 '') sched_yield=undef ;;
17237 : check for ptrdiff_t
17239 echo "Checking to see if you have ptrdiff_t..." >&4
17241 #include <stddef.h>
17242 int main() { ptrdiff_t x = 7; }
17245 if eval $compile; then
17247 echo "You have ptrdiff_t."
17250 echo "You do not have ptrdiff_t."
17256 : see if random_r exists
17257 set random_r d_random_r
17259 case "$d_random_r" in
17261 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17262 case "$d_random_r_proto:$usethreads" in
17263 ":define") d_random_r_proto=define
17264 set d_random_r_proto random_r $hdrs
17268 case "$d_random_r_proto" in
17270 case "$random_r_proto" in
17271 ''|0) try='int random_r(int*, struct random_data*);'
17272 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17274 case "$random_r_proto" in
17275 ''|0) try='int random_r(long*, struct random_data*);'
17276 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17278 case "$random_r_proto" in
17279 ''|0) try='int random_r(struct random_data*, int32_t*);'
17280 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17282 case "$random_r_proto" in
17283 ''|0) d_random_r=undef
17285 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17286 * ) case "$random_r_proto" in
17287 REENTRANT_PROTO*) ;;
17288 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17290 echo "Prototype: $try" ;;
17293 *) case "$usethreads" in
17294 define) echo "random_r has no prototype, not using it." >&4 ;;
17301 *) random_r_proto=0
17305 : see if readdir and friends exist
17306 set readdir d_readdir
17308 set seekdir d_seekdir
17310 set telldir d_telldir
17312 set rewinddir d_rewinddir
17315 : see if readdir64_r exists
17316 set readdir64_r d_readdir64_r
17318 case "$d_readdir64_r" in
17320 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17321 case "$d_readdir64_r_proto:$usethreads" in
17322 ":define") d_readdir64_r_proto=define
17323 set d_readdir64_r_proto readdir64_r $hdrs
17327 case "$d_readdir64_r_proto" in
17329 case "$readdir64_r_proto" in
17330 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17331 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17333 case "$readdir64_r_proto" in
17334 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17335 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17337 case "$readdir64_r_proto" in
17338 ''|0) d_readdir64_r=undef
17339 readdir64_r_proto=0
17340 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17341 * ) case "$readdir64_r_proto" in
17342 REENTRANT_PROTO*) ;;
17343 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17345 echo "Prototype: $try" ;;
17348 *) case "$usethreads" in
17349 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17351 d_readdir64_r=undef
17352 readdir64_r_proto=0
17356 *) readdir64_r_proto=0
17360 : see if readdir_r exists
17361 set readdir_r d_readdir_r
17363 case "$d_readdir_r" in
17365 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17366 case "$d_readdir_r_proto:$usethreads" in
17367 ":define") d_readdir_r_proto=define
17368 set d_readdir_r_proto readdir_r $hdrs
17372 case "$d_readdir_r_proto" in
17374 case "$readdir_r_proto" in
17375 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17376 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17378 case "$readdir_r_proto" in
17379 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17380 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17382 case "$readdir_r_proto" in
17383 ''|0) d_readdir_r=undef
17385 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17386 * ) case "$readdir_r_proto" in
17387 REENTRANT_PROTO*) ;;
17388 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17390 echo "Prototype: $try" ;;
17393 *) case "$usethreads" in
17394 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17401 *) readdir_r_proto=0
17405 : see if readv exists
17409 : see if recvmsg exists
17410 set recvmsg d_recvmsg
17413 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17415 if set regcomp val -f d_regcomp; eval $csym; $val; then
17416 echo 'regcomp() found.' >&4
17417 d_regcomp="$define"
17420 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17421 echo 'regcmp() found.' >&4
17425 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17426 echo 're_comp() found, assuming re_exec() also exists.' >&4
17427 d_re_comp="$define"
17432 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17439 : see if remainder exists
17440 set remainder d_remainder
17443 : see if remquo exists
17444 set remquo d_remquo
17447 : see if rename exists
17448 set rename d_rename
17451 : see if rint exists
17455 : see if rmdir exists
17459 : see if round exists
17463 : see if prototype for sbrk is available
17465 set d_sbrkproto sbrk $i_unistd unistd.h
17468 : see if scalbn exists
17469 set scalbn d_scalbn
17472 : see if select exists
17473 set select d_select
17476 : see if semctl exists
17477 set semctl d_semctl
17480 : see if semget exists
17481 set semget d_semget
17484 : see if semop exists
17488 : see how much of the 'sem*(2)' library is present.
17491 case "$d_semctl$d_semget$d_semop" in
17492 *"$undef"*) h_sem=false;;
17496 case "`ipcs 2>&1`" in
17497 "SVID messages"*"not configured"*)
17498 echo "Your $osname does not have the sem*(2) configured." >&4
17501 set semctl d_semctl
17503 set semget d_semget
17511 : we could also check for sys/ipc.h ...
17512 if $h_sem && $test `./findhdr sys/sem.h`; then
17513 echo "You have the full sem*(2) library." >&4
17516 echo "You don't have the full sem*(2) library." >&4
17522 : see whether sys/sem.h defines union semun
17524 $cat > try.c <<'END'
17525 #include <sys/types.h>
17526 #include <sys/ipc.h>
17527 #include <sys/sem.h>
17528 int main () { union semun semun; semun.buf = 0; }
17531 if eval $compile; then
17532 echo "You have union semun in <sys/sem.h>." >&4
17535 echo "You do not have union semun in <sys/sem.h>." >&4
17542 : see how to do semctl IPC_STAT
17546 $cat > tryh.h <<END
17549 # define S_IRUSR S_IREAD
17550 # define S_IWUSR S_IWRITE
17551 # define S_IXUSR S_IEXEC
17553 # define S_IRUSR 0400
17554 # define S_IWUSR 0200
17555 # define S_IXUSR 0100
17557 # define S_IRGRP (S_IRUSR>>3)
17558 # define S_IWGRP (S_IWUSR>>3)
17559 # define S_IXGRP (S_IXUSR>>3)
17560 # define S_IROTH (S_IRUSR>>6)
17561 # define S_IWOTH (S_IWUSR>>6)
17562 # define S_IXOTH (S_IXUSR>>6)
17565 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17566 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17567 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17570 : see whether semctl IPC_STAT can use union semun
17571 case "$d_semctl_semun" in
17575 #include <sys/types.h>
17576 #include <sys/ipc.h>
17577 #include <sys/sem.h>
17578 #include <sys/stat.h>
17585 #$d_union_semun HAS_UNION_SEMUN
17588 #ifndef HAS_UNION_SEMUN
17591 struct semid_ds *buf;
17592 unsigned short *array;
17598 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17599 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17601 struct semid_ds argbuf;
17604 st = semctl(sem, 0, IPC_STAT, arg);
17608 # endif /* IPC_STAT */
17609 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17611 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17612 # endif /* IPC_RMID */
17613 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17615 #endif /* IPC_PRIVATE && ... */
17616 printf("semget failed: errno = %d\n", errno);
17621 if eval $compile; then
17624 semun) val="$define" ;;
17632 case "$d_semctl_semun" in
17634 echo "You can use union semun for semctl IPC_STAT." >&4
17637 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17642 : see whether semctl IPC_STAT can use struct semid_ds pointer
17643 case "$d_semctl_semid_ds" in
17646 $cat > try.c <<'END'
17647 #include <sys/types.h>
17648 #include <sys/ipc.h>
17649 #include <sys/sem.h>
17650 #include <sys/stat.h>
17659 #ifndef HAS_UNION_SEMUN
17662 struct semid_ds *buf;
17663 unsigned short *array;
17667 struct semid_ds argbuf;
17670 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17671 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17675 st = semctl(sem, 0, IPC_STAT, arg);
17677 printf("semid_ds\n");
17679 # endif /* IPC_STAT */
17680 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17682 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17683 # endif /* IPC_RMID */
17684 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17686 #endif /* IPC_PRIVATE && ... */
17687 printf("semget failed: errno = %d\n", errno);
17693 if eval $compile; then
17696 semid_ds) val="$define" ;;
17700 set d_semctl_semid_ds
17704 case "$d_semctl_semid_ds" in
17706 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17708 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17714 # We do not have the full sem*(2) library, so assume we can not
17720 set d_semctl_semid_ds
17726 : see if sendmsg exists
17727 set sendmsg d_sendmsg
17730 : see if setegid exists
17731 set setegid d_setegid
17734 : see if seteuid exists
17735 set seteuid d_seteuid
17738 : see if setgrent exists
17739 set setgrent d_setgrent
17742 : see if setgrent_r exists
17743 set setgrent_r d_setgrent_r
17745 case "$d_setgrent_r" in
17747 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17748 case "$d_setgrent_r_proto:$usethreads" in
17749 ":define") d_setgrent_r_proto=define
17750 set d_setgrent_r_proto setgrent_r $hdrs
17754 case "$d_setgrent_r_proto" in
17756 case "$setgrent_r_proto" in
17757 ''|0) try='int setgrent_r(FILE**);'
17758 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17760 case "$setgrent_r_proto" in
17761 ''|0) try='void setgrent_r(FILE**);'
17762 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17764 case "$setgrent_r_proto" in
17765 ''|0) d_setgrent_r=undef
17767 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17768 * ) case "$setgrent_r_proto" in
17769 REENTRANT_PROTO*) ;;
17770 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17772 echo "Prototype: $try" ;;
17775 *) case "$usethreads" in
17776 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17783 *) setgrent_r_proto=0
17787 : see if sethostent exists
17788 set sethostent d_sethent
17791 : see if sethostent_r exists
17792 set sethostent_r d_sethostent_r
17794 case "$d_sethostent_r" in
17796 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17797 case "$d_sethostent_r_proto:$usethreads" in
17798 ":define") d_sethostent_r_proto=define
17799 set d_sethostent_r_proto sethostent_r $hdrs
17803 case "$d_sethostent_r_proto" in
17805 case "$sethostent_r_proto" in
17806 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17807 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17809 case "$sethostent_r_proto" in
17810 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17811 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17813 case "$sethostent_r_proto" in
17814 ''|0) d_sethostent_r=undef
17815 sethostent_r_proto=0
17816 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17817 * ) case "$sethostent_r_proto" in
17818 REENTRANT_PROTO*) ;;
17819 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17821 echo "Prototype: $try" ;;
17824 *) case "$usethreads" in
17825 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17827 d_sethostent_r=undef
17828 sethostent_r_proto=0
17832 *) sethostent_r_proto=0
17836 : see if setitimer exists
17837 set setitimer d_setitimer
17840 : see if setlinebuf exists
17841 set setlinebuf d_setlinebuf
17844 : see if locale.h is available
17845 set locale.h i_locale
17848 : see if this system has wctype.h
17849 set wctype.h i_wctype
17852 : see if towupper exists
17853 set towupper d_towupper
17856 : check for setlocale function and behavior
17859 Checking to see if you have setlocale() and its behavior
17862 #include <stdlib.h>
17863 #include <string.h>
17864 #$i_locale I_LOCALE
17866 # include <locale.h>
17868 #$i_wctype I_WCTYPE
17870 # include <wctype.h>
17874 const char * invalid_name = "\a"; /* This is really invalid! */
17875 int accepts_any_locale_name = 0;
17876 int has_C_UTF8 = 0;
17877 unsigned char bad_setlocale = 255;
17879 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17880 * disabled. It's hard to imagine an instance where meaningful locale
17881 * handling could be done without LC_CTYPE */
17882 const char * name = setlocale(LC_CTYPE, "C");
17884 if (name == NULL || strcmp(name, "C") != 0) {
17885 exit(bad_setlocale);
17888 name = setlocale(LC_CTYPE, invalid_name);
17889 if (name != NULL) {
17891 /* Let it pass if it accepts the name but gives back one of the C
17893 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17894 accepts_any_locale_name = 1;
17898 name = setlocale(LC_CTYPE, "C.UTF-8");
17899 if (name != NULL) {
17900 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17902 #$d_towupper HAS_TOWUPPER
17903 #ifdef HAS_TOWUPPER
17905 /* We assume that if the machine doesn't have the C99 towupper, it
17906 * doesn't have C.UTF-8, even if we successfully changed locales to
17907 * include it. This seems safer even on platforms that didn't accept
17908 * the really invalid name */
17910 if (towupper(y_with_diaeresis) == 0x178) {
17920 /* Currently unused code to determine if LC_ALL with disparate values uses
17921 * category = value pairs or positional, and to determine the separator
17922 * between the categories. We could add code so that if the separator were
17923 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17924 * every possible ASCII separator would fit in the 5 bits available in the
17925 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17926 * positional, we probably would want to know the order of the categories.
17927 * Using a file between the C program and the shell script would really be
17928 * require to do that */
17931 unsigned char min_separator = ' ' - 1;
17932 unsigned char separator = min_separator;
17933 int uses_name_value_pair_names = 0;
17935 name = setlocale(LC_ALL, "C");
17936 if (name == NULL || strcmp(name, "C") != 0) {
17937 exit(bad_setlocale);
17943 name = setlocale(LC_CTYPE, "C.UTF-8");
17944 if (name == NULL) {
17945 exit(bad_setlocale);
17947 name = setlocale(LC_ALL, NULL);
17948 if (name == NULL) {
17949 exit(bad_setlocale);
17952 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17954 uses_name_value_pair_names = 1;
17956 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17959 separator = *(pos - 1);
17963 pos = strstr(name, "C.UTF-8");
17967 else if (pos == name) {
17968 separator = name[sizeof("C.UTF-8") - 1];
17971 separator = *(pos - 1);
17979 exit( 0 /* (separator - min_separator) << 3
17980 | uses_name_value_pair_names << 2
17983 | accepts_any_locale_name);
17988 if eval $compile; then
17989 echo "Your system has setlocale()..." >&4
17992 0) echo "and it seems sane" >&4
17993 d_setlocale="$define"
17994 d_setlocale_accepts_any_locale_name="$undef"
17995 d_has_C_UTF8="false"
17997 1) echo "and it seems sane, but accepts any locale name as valid" >&4
17998 d_setlocale="$define"
17999 d_setlocale_accepts_any_locale_name="$define"
18000 d_has_C_UTF8="false"
18002 2) echo "and it seems sane" >&4
18003 d_setlocale="$define"
18004 d_setlocale_accepts_any_locale_name="$undef"
18005 d_has_C_UTF8="true"
18007 3) echo "and it seems sane, but accepts any locale name as valid" >&4
18008 d_setlocale="$define"
18009 d_setlocale_accepts_any_locale_name="$define"
18010 d_has_C_UTF8="true"
18012 *) echo "but it doesn't seem to work, so we won't use it." >&4
18013 d_setlocale="$undef"
18014 d_setlocale_accepts_any_locale_name="$undef"
18015 d_has_C_UTF8="false"
18019 echo "your system does not have setlocale()" >&4
18020 d_setlocale="$undef"
18021 d_setlocale_accepts_any_locale_name="$undef"
18022 d_has_C_UTF8="false"
18026 : see if setlocale_r exists
18027 set setlocale_r d_setlocale_r
18029 case "$d_setlocale_r" in
18031 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18032 case "$d_setlocale_r_proto:$usethreads" in
18033 ":define") d_setlocale_r_proto=define
18034 set d_setlocale_r_proto setlocale_r $hdrs
18038 case "$d_setlocale_r_proto" in
18040 case "$setlocale_r_proto" in
18041 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18042 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18044 case "$setlocale_r_proto" in
18045 ''|0) d_setlocale_r=undef
18046 setlocale_r_proto=0
18047 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18048 * ) case "$setlocale_r_proto" in
18049 REENTRANT_PROTO*) ;;
18050 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18052 echo "Prototype: $try" ;;
18055 *) case "$usethreads" in
18056 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18058 d_setlocale_r=undef
18059 setlocale_r_proto=0
18063 *) setlocale_r_proto=0
18067 : see if setnetent exists
18068 set setnetent d_setnent
18071 : see if setnetent_r exists
18072 set setnetent_r d_setnetent_r
18074 case "$d_setnetent_r" in
18076 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18077 case "$d_setnetent_r_proto:$usethreads" in
18078 ":define") d_setnetent_r_proto=define
18079 set d_setnetent_r_proto setnetent_r $hdrs
18083 case "$d_setnetent_r_proto" in
18085 case "$setnetent_r_proto" in
18086 ''|0) try='int setnetent_r(int, struct netent_data*);'
18087 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18089 case "$setnetent_r_proto" in
18090 ''|0) try='void setnetent_r(int, struct netent_data*);'
18091 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18093 case "$setnetent_r_proto" in
18094 ''|0) d_setnetent_r=undef
18095 setnetent_r_proto=0
18096 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18097 * ) case "$setnetent_r_proto" in
18098 REENTRANT_PROTO*) ;;
18099 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18101 echo "Prototype: $try" ;;
18104 *) case "$usethreads" in
18105 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18107 d_setnetent_r=undef
18108 setnetent_r_proto=0
18112 *) setnetent_r_proto=0
18116 : see if setprotoent exists
18117 set setprotoent d_setpent
18120 : see if setpgid exists
18121 set setpgid d_setpgid
18124 : see if setpgrp2 exists
18125 set setpgrp2 d_setpgrp2
18128 : see if setpriority exists
18129 set setpriority d_setprior
18132 : see if setproctitle exists
18133 set setproctitle d_setproctitle
18136 : see if setprotoent_r exists
18137 set setprotoent_r d_setprotoent_r
18139 case "$d_setprotoent_r" in
18141 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18142 case "$d_setprotoent_r_proto:$usethreads" in
18143 ":define") d_setprotoent_r_proto=define
18144 set d_setprotoent_r_proto setprotoent_r $hdrs
18148 case "$d_setprotoent_r_proto" in
18150 case "$setprotoent_r_proto" in
18151 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18152 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18154 case "$setprotoent_r_proto" in
18155 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18156 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18158 case "$setprotoent_r_proto" in
18159 ''|0) d_setprotoent_r=undef
18160 setprotoent_r_proto=0
18161 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18162 * ) case "$setprotoent_r_proto" in
18163 REENTRANT_PROTO*) ;;
18164 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18166 echo "Prototype: $try" ;;
18169 *) case "$usethreads" in
18170 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18172 d_setprotoent_r=undef
18173 setprotoent_r_proto=0
18177 *) setprotoent_r_proto=0
18181 : see if setpwent exists
18182 set setpwent d_setpwent
18185 : see if setpwent_r exists
18186 set setpwent_r d_setpwent_r
18188 case "$d_setpwent_r" in
18190 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18191 case "$d_setpwent_r_proto:$usethreads" in
18192 ":define") d_setpwent_r_proto=define
18193 set d_setpwent_r_proto setpwent_r $hdrs
18197 case "$d_setpwent_r_proto" in
18199 case "$setpwent_r_proto" in
18200 ''|0) try='int setpwent_r(FILE**);'
18201 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18203 case "$setpwent_r_proto" in
18204 ''|0) try='void setpwent_r(FILE**);'
18205 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18207 case "$setpwent_r_proto" in
18208 ''|0) d_setpwent_r=undef
18210 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18211 * ) case "$setpwent_r_proto" in
18212 REENTRANT_PROTO*) ;;
18213 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18215 echo "Prototype: $try" ;;
18218 *) case "$usethreads" in
18219 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18226 *) setpwent_r_proto=0
18230 : see if setregid exists
18231 set setregid d_setregid
18233 set setresgid d_setresgid
18236 : see if setreuid exists
18237 set setreuid d_setreuid
18239 set setresuid d_setresuid
18242 : see if setrgid exists
18243 set setrgid d_setrgid
18246 : see if setruid exists
18247 set setruid d_setruid
18250 : see if setservent exists
18251 set setservent d_setsent
18254 : see if setservent_r exists
18255 set setservent_r d_setservent_r
18257 case "$d_setservent_r" in
18259 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18260 case "$d_setservent_r_proto:$usethreads" in
18261 ":define") d_setservent_r_proto=define
18262 set d_setservent_r_proto setservent_r $hdrs
18266 case "$d_setservent_r_proto" in
18268 case "$setservent_r_proto" in
18269 ''|0) try='int setservent_r(int, struct servent_data*);'
18270 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18272 case "$setservent_r_proto" in
18273 ''|0) try='void setservent_r(int, struct servent_data*);'
18274 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18276 case "$setservent_r_proto" in
18277 ''|0) d_setservent_r=undef
18278 setservent_r_proto=0
18279 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18280 * ) case "$setservent_r_proto" in
18281 REENTRANT_PROTO*) ;;
18282 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18284 echo "Prototype: $try" ;;
18287 *) case "$usethreads" in
18288 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18290 d_setservent_r=undef
18291 setservent_r_proto=0
18295 *) setservent_r_proto=0
18299 : see if setsid exists
18300 set setsid d_setsid
18303 : see if setvbuf exists
18304 set setvbuf d_setvbuf
18307 : see if shmctl exists
18308 set shmctl d_shmctl
18311 : see if shmget exists
18312 set shmget d_shmget
18315 : see if shmat exists
18318 : see what shmat returns
18321 $cat >shmat.c <<'END'
18322 #include <sys/shm.h>
18325 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18330 echo "and it returns ($shmattype)." >&4
18331 : see if a prototype for shmat is available
18332 xxx=`./findhdr sys/shm.h`
18333 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18334 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18345 set d_shmatprototype
18348 : see if shmdt exists
18352 : see how much of the 'shm*(2)' library is present.
18355 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18356 *"$undef"*) h_shm=false;;
18360 case "`ipcs 2>&1`" in
18361 "SVID shared memory"*"not configured"*)
18362 echo "Your $osname does not have the shm*(2) configured." >&4
18365 set shmctl d_shmctl
18367 set shmget d_shmget
18377 : we could also check for sys/ipc.h ...
18378 if $h_shm && $test `./findhdr sys/shm.h`; then
18379 echo "You have the full shm*(2) library." >&4
18382 echo "You don't have the full shm*(2) library." >&4
18388 : see if we have sigaction
18390 if set sigaction val -f d_sigaction; eval $csym; $val; then
18391 echo 'sigaction() found.' >&4
18394 #include <sys/types.h>
18395 #include <signal.h>
18396 #$i_stdlib I_STDLIB
18398 #include <stdlib.h>
18402 struct sigaction act, oact;
18404 oact.sa_handler = 0;
18405 /* so that act and oact are used */
18406 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18410 if eval $compile_ok; then
18413 echo "But you don't seem to have a usable struct sigaction." >&4
18417 echo 'sigaction NOT found.' >&4
18420 set d_sigaction; eval $setvar
18423 : see what type pids are declared as in the kernel
18424 rp="What is the type of process ids on this system?"
18425 set pid_t pidtype int stdio.h sys/types.h
18428 : see what type uids are declared as in the kernel
18430 echo "Looking for the type for user ids returned by getuid()."
18431 set uid_t uidtype xxx stdio.h sys/types.h
18435 xxx=`./findhdr sys/user.h`
18436 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18438 unsigned) dflt="$1 $2" ;;
18442 *) dflt="$uidtype";;
18445 uid_t) echo "uid_t found." ;;
18446 *) rp="What is the type for user ids returned by getuid()?"
18452 : Define hasfield_t macro for Configure internal use
18453 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18454 while $test $# -ge 2; do
18456 $define) echo "#include <$2>";;
18460 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18462 if eval $compile; then
18471 : see what siginfo fields we have
18472 case "$d_sigaction" in
18474 echo "Checking if your siginfo_t has si_errno field...">&4
18475 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18478 echo "Checking if your siginfo_t has si_pid field...">&4
18479 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18482 echo "Checking if your siginfo_t has si_uid field...">&4
18483 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18486 echo "Checking if your siginfo_t has si_addr field...">&4
18487 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18490 echo "Checking if your siginfo_t has si_status field...">&4
18491 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18494 echo "Checking if your siginfo_t has si_band field...">&4
18495 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18498 echo "Checking if your siginfo_t has si_value field...">&4
18499 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18502 echo "Checking if your siginfo_t has si_fd field...">&4
18503 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18508 d_siginfo_si_errno="$undef"
18509 d_siginfo_si_pid="$undef"
18510 d_siginfo_si_uid="$undef"
18511 d_siginfo_si_addr="$undef"
18512 d_siginfo_si_status="$undef"
18513 d_siginfo_si_band="$undef"
18514 d_siginfo_si_value="$undef"
18515 d_siginfo_si_fd="$undef"
18519 : see if this is a sunmath.h system
18520 set sunmath.h i_sunmath
18523 : see if signbit exists
18524 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18526 #$i_sunmath I_SUNMATH
18528 #ifdef I_SUNMATH /* Solaris special math library */
18529 # include <sunmath.h>
18532 int main(int argc, char **argv)
18536 if ((signbit(x) == 0) && (signbit(y) != 0))
18544 if eval $compile; then
18545 if $run ./try; then
18549 $echo "Signbit seems to be available, but doesn't work as I expected."
18550 $echo "I won't use it." >&4
18561 : see if sigprocmask exists
18562 set sigprocmask d_sigprocmask
18565 : see if sigsetjmp exists
18567 case "$d_sigsetjmp" in
18570 #include <setjmp.h>
18571 #$i_stdlib I_STDLIB
18573 #include <stdlib.h>
18579 if (sigsetjmp(env,1))
18582 siglongjmp(env, 1);
18587 if eval $compile; then
18588 if $run ./try >/dev/null 2>&1; then
18589 echo "POSIX sigsetjmp found." >&4
18593 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18599 echo "sigsetjmp not found." >&4
18603 *) val="$d_sigsetjmp"
18604 case "$d_sigsetjmp" in
18605 $define) echo "POSIX sigsetjmp found." >&4;;
18606 $undef) echo "sigsetjmp not found." >&4;;
18614 : see if snprintf exists
18615 set snprintf d_snprintf
18618 : see if vsnprintf exists
18619 set vsnprintf d_vsnprintf
18622 case "$d_snprintf-$d_vsnprintf" in
18625 Checking whether your snprintf() and vsnprintf() work okay...
18627 $cat >try.c <<'EOCP'
18628 /* v?snprintf testing logic courtesy of Russ Allbery.
18629 * According to C99:
18630 * - if the buffer is too short it still must be \0-terminated
18631 * - if the buffer is too short the potentially required length
18632 * must be returned and not -1
18633 * - if the buffer is NULL the potentially required length
18634 * must be returned and not -1 or core dump
18637 #include <stdarg.h>
18641 int test (char *format, ...)
18646 va_start (args, format);
18647 count = vsnprintf (buf, sizeof buf, format, args);
18654 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18655 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18659 if eval $compile; then
18662 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18664 Your snprintf() and snprintf() don't seem to be working okay.
18666 d_snprintf="$undef"
18667 d_vsnprintf="$undef"
18671 echo "(I can't seem to compile the test program--assuming they don't)"
18672 d_snprintf="$undef"
18673 d_vsnprintf="$undef"
18679 : see if sockatmark exists
18680 set sockatmark d_sockatmark
18683 : see if prototype for sockatmark is available
18685 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18688 : see if socks5_init exists
18689 set socks5_init d_socks5_init
18692 : see if srand48_r exists
18693 set srand48_r d_srand48_r
18695 case "$d_srand48_r" in
18697 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18698 case "$d_srand48_r_proto:$usethreads" in
18699 ":define") d_srand48_r_proto=define
18700 set d_srand48_r_proto srand48_r $hdrs
18704 case "$d_srand48_r_proto" in
18706 case "$srand48_r_proto" in
18707 ''|0) try='int srand48_r(long, struct drand48_data*);'
18708 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18710 case "$srand48_r_proto" in
18711 ''|0) d_srand48_r=undef
18713 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18714 * ) case "$srand48_r_proto" in
18715 REENTRANT_PROTO*) ;;
18716 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18718 echo "Prototype: $try" ;;
18721 *) case "$usethreads" in
18722 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18729 *) srand48_r_proto=0
18733 : see if srandom_r exists
18734 set srandom_r d_srandom_r
18736 case "$d_srandom_r" in
18738 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18739 case "$d_srandom_r_proto:$usethreads" in
18740 ":define") d_srandom_r_proto=define
18741 set d_srandom_r_proto srandom_r $hdrs
18745 case "$d_srandom_r_proto" in
18747 case "$srandom_r_proto" in
18748 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18749 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18751 case "$srandom_r_proto" in
18752 ''|0) d_srandom_r=undef
18754 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18755 * ) case "$srandom_r_proto" in
18756 REENTRANT_PROTO*) ;;
18757 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18759 echo "Prototype: $try" ;;
18762 *) case "$usethreads" in
18763 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18770 *) srandom_r_proto=0
18774 : see if prototype for setresgid is available
18776 set d_sresgproto setresgid $i_unistd unistd.h
18779 : see if prototype for setresuid is available
18781 set d_sresuproto setresuid $i_unistd unistd.h
18784 : see if stat exists
18788 : see if sys/stat.h is available
18789 set sys/stat.h i_sysstat
18792 : see if stat knows about block sizes
18794 echo "Checking to see if your struct stat has st_blocks field..." >&4
18795 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18798 : see if this is a sys/vfs.h system
18799 set sys/vfs.h i_sysvfs
18802 : see if this is a sys/statfs.h system
18803 set sys/statfs.h i_sysstatfs
18806 : Check for statfs_s
18808 echo "Checking to see if your system supports struct statfs..." >&4
18809 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
18811 case "$d_statfs_s" in
18812 "$define") echo "Yes, it does." ;;
18813 *) echo "No, it doesn't." ;;
18816 : see if struct statfs knows about f_flags
18817 case "$d_statfs_s" in
18820 echo "Checking to see if your struct statfs has f_flags field..." >&4
18821 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
18825 set d_statfs_f_flags
18829 case "$d_statfs_f_flags" in
18830 "$define") echo "Yes, it does." ;;
18831 *) echo "No, it doesn't." ;;
18834 : see what flavor, if any, of static inline is supported
18836 echo "Checking to see if your system supports static inline..."
18837 $cat > try.c <<'EOCP'
18838 #include <stdlib.h>
18839 extern int f_via_a(int x);
18840 extern int f_via_b(int x);
18841 int main(int argc, char **argv)
18850 return EXIT_SUCCESS;
18853 return EXIT_FAILURE;
18857 $cat > a.c <<'EOCP'
18858 static INLINE int f(int x) {
18869 $cat > b.c <<'EOCP'
18870 extern int f(int x);
18878 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18879 case "$perl_static_inline" in
18880 '') # Check the various possibilities, and break out on success.
18881 # For gcc, prefer __inline__, which will still permit
18882 # cflags.SH to add in -ansi.
18883 case "$gccversion" in
18884 '') xxx="inline __inline__ __inline _inline";;
18885 *) xxx="__inline__ inline __inline _inline";;
18887 for inline in $xxx; do
18888 set try -DINLINE=$inline a.c
18889 if eval $compile && $run ./try; then
18890 # Now make sure there is no external linkage of static
18892 set try -DINLINE=$inline -DUSE_B a.c b.c
18893 if eval $compile && $run ./try; then
18894 $echo "Your compiler supports static $inline, " >&4
18895 $echo "but it also creates an external definition," >&4
18896 $echo "so I won't use it." >&4
18899 $echo "Your compiler supports static $inline." >&4
18901 perl_static_inline="static $inline";
18905 $echo "Your compiler does NOT support static $inline." >&4
18910 *inline*) # Some variant of inline exists.
18911 echo "Keeping your $hint value of $perl_static_inline."
18914 static) # No inline capabilities
18915 echo "Keeping your $hint value of $perl_static_inline."
18918 *) # Unrecognized previous value -- blindly trust the supplied
18919 # value and hope it makes sense. Use old value for
18920 # d_static_inline, if there is one.
18921 echo "Keeping your $hint value of $perl_static_inline."
18922 case "$d_static_inline" in
18924 *) val=$d_static_inline ;;
18928 # Fallback to plain 'static' if nothing worked.
18929 case "$perl_static_inline" in
18931 perl_static_inline="static"
18935 set d_static_inline
18937 $rm -f a.[co] b.[co]
18940 : Check stream access
18942 Checking how to access stdio streams by file descriptor number...
18944 case "$stdio_stream_array" in
18945 '') $cat >try.c <<EOCP
18948 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18952 for s in _iob __iob __sF
18954 set try -DSTDIO_STREAM_ARRAY=$s
18955 if eval $compile; then
18956 case "`$run ./try`" in
18957 yes) stdio_stream_array=$s; break ;;
18963 case "$stdio_stream_array" in
18965 I can't figure out how to access stdio streams by file descriptor number.
18967 d_stdio_stream_array="$undef"
18970 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18972 d_stdio_stream_array="$define"
18976 : see if strcoll exists
18977 set strcoll d_strcoll
18980 : see if strerror_l exists
18981 set strerror_l d_strerror_l
18984 : see if strerror_r exists
18985 set strerror_r d_strerror_r
18987 case "$d_strerror_r" in
18989 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18990 case "$d_strerror_r_proto:$usethreads" in
18991 ":define") d_strerror_r_proto=define
18992 set d_strerror_r_proto strerror_r $hdrs
18996 case "$d_strerror_r_proto" in
18998 case "$strerror_r_proto" in
18999 ''|0) try='int strerror_r(int, char*, size_t);'
19000 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19002 case "$strerror_r_proto" in
19003 ''|0) try='int strerror_r(int, char*, int);'
19004 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19006 case "$strerror_r_proto" in
19007 ''|0) try='char* strerror_r(int, char*, size_t);'
19008 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19010 case "$strerror_r_proto" in
19011 ''|0) d_strerror_r=undef
19013 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19014 * ) case "$strerror_r_proto" in
19015 REENTRANT_PROTO*) ;;
19016 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19018 echo "Prototype: $try" ;;
19021 *) case "$usethreads" in
19022 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19029 *) strerror_r_proto=0
19033 : see if strftime exists
19034 set strftime d_strftime
19037 : see if strlcat exists
19038 : We need both a prototype in string.h and the symbol in libc.
19041 xx1="#$d_gnulibc HAS_GNULIBC"
19042 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19043 xx3='# define _GNU_SOURCE'
19045 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19047 case "$d_strlcat_proto" in
19048 define) # see if strlcat exists
19049 set strlcat d_strlcat
19058 : see if strlcpy exists
19059 : We need both a prototype in string.h and the symbol in libc.
19062 xx1="#$d_gnulibc HAS_GNULIBC"
19063 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19064 xx3='# define _GNU_SOURCE'
19066 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19068 case "$d_strlcpy_proto" in
19069 define) # see if strlcpy exists
19070 set strlcpy d_strlcpy
19079 : see if strnlen exists
19080 set strnlen d_strnlen
19083 : see if strtod exists
19084 set strtod d_strtod
19087 : see if strtod_l exists
19088 set strtod_l d_strtod_l
19091 : see if strtol exists
19092 set strtol d_strtol
19095 : see if strtold exists
19096 set strtold d_strtold
19099 : see if strtold_l exists
19100 set strtold_l d_strtold_l
19103 : see if strtoll exists
19104 set strtoll d_strtoll
19107 case "$d_longlong-$d_strtoll" in
19110 Checking whether your strtoll() works okay...
19112 $cat >try.c <<'EOCP'
19115 #define strtoll __strtoll
19118 #define strtoll _strtoll
19121 #include <stdlib.h>
19122 static int bad = 0;
19123 void check(const char *s, long long ell, int een) {
19126 gll = strtoll(s, 0, 10);
19127 if (!((gll == ell) && (errno == een)))
19131 check(" 1", 1LL, 0);
19132 check(" 0", 0LL, 0);
19133 check("-1", -1LL, 0);
19134 check("-9223372036854775808", -9223372036854775808LL, 0);
19135 check("-9223372036854775808", -9223372036854775808LL, 0);
19136 check(" 9223372036854775807", 9223372036854775807LL, 0);
19137 check("-9223372036854775808", -9223372036854775808LL, 0);
19138 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19139 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19145 if eval $compile; then
19148 ok) echo "Your strtoll() seems to be working okay." ;;
19150 Your strtoll() doesn't seem to be working okay.
19156 echo "(I can't seem to compile the test program--assuming it doesn't)"
19162 : see if strtoq exists
19163 set strtoq d_strtoq
19166 : see if strtoul exists
19167 set strtoul d_strtoul
19170 case "$d_strtoul" in
19173 Checking whether your strtoul() works okay...
19175 $cat >try.c <<'EOCP'
19176 #include <stdlib.h>
19179 static int bad = 0;
19180 void check(const char *s, unsigned long eul, int een) {
19183 gul = strtoul(s, 0, 10);
19184 if (!((gul == eul) && (errno == een)))
19188 check(" 1", 1L, 0);
19189 check(" 0", 0L, 0);
19191 case "$longsize" in
19193 $cat >>try.c <<'EOCP'
19194 check("18446744073709551615", 18446744073709551615UL, 0);
19195 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19196 #if 0 /* strtoul() for /^-/ strings is undefined. */
19197 check("-1", 18446744073709551615UL, 0);
19198 check("-18446744073709551614", 2, 0);
19199 check("-18446744073709551615", 1, 0);
19200 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19201 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19206 $cat >>try.c <<'EOCP'
19207 check("4294967295", 4294967295UL, 0);
19208 check("4294967296", 4294967295UL, ERANGE);
19209 #if 0 /* strtoul() for /^-/ strings is undefined. */
19210 check("-1", 4294967295UL, 0);
19211 check("-4294967294", 2, 0);
19212 check("-4294967295", 1, 0);
19213 check("-4294967296", 4294967295UL, ERANGE);
19214 check("-4294967297", 4294967295UL, ERANGE);
19219 : Should we write these tests to be more portable by sprintf-ing
19220 : ~0 and then manipulating that char string as input for strtol?
19223 $cat >>try.c <<'EOCP'
19230 if eval $compile; then
19231 case "`$run ./try`" in
19232 ok) echo "Your strtoul() seems to be working okay." ;;
19234 Your strtoul() doesn't seem to be working okay.
19240 echo "(I can't seem to compile the test program--assuming it doesn't)"
19246 : see if strtoull exists
19247 set strtoull d_strtoull
19250 case "$d_longlong-$d_strtoull" in
19253 Checking whether your strtoull() works okay...
19255 $cat >try.c <<'EOCP'
19256 #include <stdlib.h>
19259 #define strtoull __strtoull
19262 static int bad = 0;
19263 void check(const char *s, long long eull, int een) {
19266 gull = strtoull(s, 0, 10);
19267 if (!((gull == eull) && (errno == een)))
19271 check(" 1", 1LL, 0);
19272 check(" 0", 0LL, 0);
19273 check("18446744073709551615", 18446744073709551615ULL, 0);
19274 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19275 #if 0 /* strtoull() for /^-/ strings is undefined. */
19276 check("-1", 18446744073709551615ULL, 0);
19277 check("-18446744073709551614", 2LL, 0);
19278 check("-18446744073709551615", 1LL, 0);
19279 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19280 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19287 if eval $compile; then
19288 case "`$run ./try`" in
19289 ok) echo "Your strtoull() seems to be working okay." ;;
19291 Your strtoull() doesn't seem to be working okay.
19293 d_strtoull="$undef"
19297 echo "(I can't seem to compile the test program--assuming it doesn't)"
19298 d_strtoull="$undef"
19303 : see if strtouq exists
19304 set strtouq d_strtouq
19307 case "$d_strtouq" in
19310 Checking whether your strtouq() works okay...
19312 $cat >try.c <<'EOCP'
19313 #include <stdlib.h>
19316 static int bad = 0;
19317 void check(const char *s, unsigned long long eull, int een) {
19318 unsigned long long gull;
19320 gull = strtouq(s, 0, 10);
19321 if (!((gull == eull) && (errno == een)))
19325 check(" 1", 1LL, 0);
19326 check(" 0", 0LL, 0);
19327 check("18446744073709551615", 18446744073709551615ULL, 0);
19328 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19329 #if 0 /* strtouq() for /^-/ strings is undefined. */
19330 check("-1", 18446744073709551615ULL, 0);
19331 check("-18446744073709551614", 2LL, 0);
19332 check("-18446744073709551615", 1LL, 0);
19333 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19334 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19342 if eval $compile; then
19343 case "`$run ./try`" in
19344 ok) echo "Your strtouq() seems to be working okay." ;;
19346 Your strtouq() doesn't seem to be working okay.
19352 echo "(I can't seem to compile the test program--assuming it doesn't)"
19358 : see if strxfrm exists
19359 set strxfrm d_strxfrm
19362 : see if symlink exists
19363 set symlink d_symlink
19366 : see if syscall exists
19367 set syscall d_syscall
19370 : see if prototype for syscall is available
19372 set d_syscallproto syscall $i_unistd unistd.h
19375 : see if sysconf exists
19376 set sysconf d_sysconf
19379 : see if sys_errlist[] exists
19381 if test "X$d_syserrlst" = X; then
19382 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19383 echo "You have sys_errlist[], so we could roll our own strerror."
19384 d_syserrlst="$define"
19386 echo "You don't have sys_errlist[], so strerror() is welcome."
19387 d_syserrlst="$undef"
19391 : see if system exists
19392 set system d_system
19395 : see if tcgetpgrp exists
19396 set tcgetpgrp d_tcgetpgrp
19399 : see if tcsetpgrp exists
19400 set tcsetpgrp d_tcsetpgrp
19403 : see if prototype for telldir is available
19405 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19408 : see if tgamma exists
19409 set tgamma d_tgamma
19412 : check for thread_safe_nl_langinfo_l item
19415 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19418 #$i_stdlib I_STDLIB
19420 # include <stdlib.h>
19422 #include <string.h>
19423 #$i_langinfo I_LANGINFO
19425 # include <langinfo.h>
19427 #$i_pthread I_PTHREAD
19429 # include <pthread.h>
19431 #$i_locale I_LOCALE
19433 # include <locale.h>
19437 thread_start(void * arg)
19439 nl_langinfo(RADIXCHAR);
19443 char * main_buffer;
19444 char save_main_buffer[1000];
19445 pthread_t subthread;
19446 pthread_attr_t attr;
19448 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19450 /* If too large for our generous allowance, just assume we don't have
19452 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19456 strcpy(save_main_buffer, main_buffer);
19458 if (pthread_attr_init(&attr) != 0) {
19462 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19466 if (pthread_join(subthread, NULL) != 0) {
19470 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19473 case "$usethreads" in
19476 if eval $compile; then
19477 echo "Your system has nl_langinfo_l()..." >&4
19478 if $run ./try; then
19479 echo "and it is thread-safe (just as I'd hoped)." >&4
19480 d_thread_safe_nl_langinfo_l="$define"
19481 echo "$d_thread_safe_nl_langinfo_l" >&4
19483 echo "but it isn't thread-safe, so we won't use it." >&4
19486 echo "your system does not have nl_langinfo_l()" >&4
19489 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19491 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19492 d_thread_safe_nl_langinfo_l="$undef"
19496 : see if time exists
19498 if test "X$d_time" = X -o X"$timetype" = X; then
19499 if set time val -f d_time; eval $csym; $val; then
19500 echo 'time() found.' >&4
19502 rp="What is the type returned by time() on this system?"
19503 set time_t timetype long stdio.h sys/types.h
19506 echo 'time() not found, hope that will do.' >&4
19514 : see if timegm exists
19515 set timegm d_timegm
19518 : see if this is a sys/times.h system
19519 set sys/times.h i_systimes
19522 : see if times exists
19524 if set times val -f d_times; eval $csym; $val; then
19525 echo 'times() found.' >&4
19528 case "$i_systimes" in
19529 "$define") inc='sys/times.h';;
19531 rp="What is the type returned by times() on this system?"
19532 set clock_t clocktype long stdio.h sys/types.h $inc
19535 echo 'times() NOT found, hope that will do.' >&4
19540 : see if tmpnam_r exists
19541 set tmpnam_r d_tmpnam_r
19543 case "$d_tmpnam_r" in
19545 hdrs="$i_systypes sys/types.h define stdio.h "
19546 case "$d_tmpnam_r_proto:$usethreads" in
19547 ":define") d_tmpnam_r_proto=define
19548 set d_tmpnam_r_proto tmpnam_r $hdrs
19552 case "$d_tmpnam_r_proto" in
19554 case "$tmpnam_r_proto" in
19555 ''|0) try='char* tmpnam_r(char*);'
19556 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19558 case "$tmpnam_r_proto" in
19559 ''|0) d_tmpnam_r=undef
19561 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19562 * ) case "$tmpnam_r_proto" in
19563 REENTRANT_PROTO*) ;;
19564 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19566 echo "Prototype: $try" ;;
19569 *) case "$usethreads" in
19570 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19577 *) tmpnam_r_proto=0
19581 : see if towlower exists
19582 set towlower d_towlower
19585 : see if trunc exists
19589 : see if truncate exists
19590 set truncate d_truncate
19593 : see if ttyname_r exists
19594 set ttyname_r d_ttyname_r
19596 case "$d_ttyname_r" in
19598 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19599 case "$d_ttyname_r_proto:$usethreads" in
19600 ":define") d_ttyname_r_proto=define
19601 set d_ttyname_r_proto ttyname_r $hdrs
19605 case "$d_ttyname_r_proto" in
19607 case "$ttyname_r_proto" in
19608 ''|0) try='int ttyname_r(int, char*, size_t);'
19609 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19611 case "$ttyname_r_proto" in
19612 ''|0) try='int ttyname_r(int, char*, int);'
19613 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19615 case "$ttyname_r_proto" in
19616 ''|0) try='char* ttyname_r(int, char*, int);'
19617 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19619 case "$ttyname_r_proto" in
19620 ''|0) d_ttyname_r=undef
19622 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19623 * ) case "$ttyname_r_proto" in
19624 REENTRANT_PROTO*) ;;
19625 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19627 echo "Prototype: $try" ;;
19630 *) case "$usethreads" in
19631 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19638 *) ttyname_r_proto=0
19642 : see if tzname[] exists
19644 if set tzname val -a d_tzname; eval $csym; $val; then
19646 echo 'tzname[] found.' >&4
19649 echo 'tzname[] NOT found.' >&4
19654 : Check if is a multiplatform env
19656 darwin) multiarch="$define" ;;
19658 case "$multiarch" in
19659 ''|[nN]*) multiarch="$undef" ;;
19662 : check for ordering of bytes in a UV
19664 case "$multiarch" in
19667 You seem to be doing a multiarchitecture build,
19668 skipping the byteorder check.
19674 case "$byteorder" in
19677 In the following, larger digits indicate more significance. A big-endian
19678 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19679 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19680 machines may have weird orders like 3412. A Cray will report 87654321,
19681 an Alpha will report 12345678. If the test program works the default is
19683 I'm now running the test program...
19687 #$i_stdlib I_STDLIB
19689 #include <stdlib.h>
19691 #include <sys/types.h>
19692 typedef $uvtype UV;
19702 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19704 u.l = (UV)0x04030201;
19705 for (i = 0; i < $uvsize; i++)
19706 printf("%c", u.c[i]+'0');
19713 if eval $compile && $run ./try > /dev/null; then
19716 [1-4][1-4][1-4][1-4]|12345678|87654321)
19717 echo "(The test program ran ok.)"
19718 echo "byteorder=$dflt"
19721 ????|????????) echo "(The test program ran ok.)" ;;
19722 *) echo "(The test program didn't run right for some reason.)" ;;
19727 (I can't seem to compile the test program. Guessing big-endian...)
19730 case "$xxx_prompt" in
19732 rp="What is the order of bytes in $uvtype?"
19745 : Checking 32bit alignedness
19748 Checking to see whether you can access character data unalignedly...
19750 case "$d_u32align" in
19751 '') $cat >try.c <<EOCP
19753 #$i_stdlib I_STDLIB
19755 #include <stdlib.h>
19757 #define U32 $u32type
19758 #define BYTEORDER 0x$byteorder
19760 #include <signal.h>
19762 $signal_t bletch(int s) { exit(4); }
19765 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19766 volatile U8 buf[8];
19770 if (sizeof(U32) != 4) {
19771 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19778 signal(SIGBUS, bletch);
19790 for (i = 0; i < 4; i++) {
19791 up = (U32*)(buf + i);
19792 if (! ((*up == 1 << (8*i)) || /* big-endian */
19793 (*up == 1 << (8*(3-i))) /* little-endian */
19797 printf("read failed (%x)\n", *up);
19803 for (i = 0; i < 4; i++) {
19804 up = (U32*)(buf + i);
19806 if (*up != 0xBeef) {
19807 printf("write failed (%x)\n", *up);
19821 if eval $compile_ok; then
19822 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19823 $run ./try 2>&1 >/dev/null
19826 You can access character data pretty unalignedly.
19828 d_u32align="$undef"
19831 It seems that you must access character data in an aligned manner.
19833 d_u32align="$define"
19837 rp='Can you access character data at unaligned addresses?'
19841 [yY]*) d_u32align="$undef" ;;
19842 *) d_u32align="$define" ;;
19849 : see if ualarm exists
19850 set ualarm d_ualarm
19853 : see if umask exists
19857 : see if unordered exists
19858 set unordered d_unordered
19861 : see if unsetenv exists
19862 set unsetenv d_unsetenv
19865 : see if usleep exists
19866 set usleep d_usleep
19869 : see if prototype for usleep is available
19871 set d_usleepproto usleep $i_unistd unistd.h
19874 : see if ustat exists
19878 : see if closedir exists
19879 set closedir d_closedir
19882 case "$d_closedir" in
19885 echo "Checking whether closedir() returns a status..." >&4
19887 #$i_dirent I_DIRENT /**/
19888 #$i_sysdir I_SYS_DIR /**/
19889 #$i_sysndir I_SYS_NDIR /**/
19890 #$i_systypes I_SYS_TYPES /**/
19892 #if defined(I_SYS_TYPES)
19893 #include <sys/types.h>
19895 #if defined(I_DIRENT)
19896 #include <dirent.h>
19899 #include <sys/ndir.h>
19902 #include <sys/dir.h>
19906 int main() { return closedir(opendir(".")); }
19909 if eval $compile_ok; then
19910 if $run ./try > /dev/null 2>&1 ; then
19911 echo "Yes, it does."
19914 echo "No, it doesn't."
19918 echo "(I can't seem to compile the test program--assuming it doesn't)"
19926 set d_void_closedir
19930 : see if there is a wait4
19934 : see if waitpid exists
19935 set waitpid d_waitpid
19938 : see if wcrtomb exists
19939 set wcrtomb d_wcrtomb
19944 $cat >try.c <<'EOCP'
19950 return (wcscmp (s, s) ? 1 : 0);
19955 if eval $compile; then
19958 0) echo "A working wcscmp() found." >&4
19960 *) echo "wcscmp() found, but it doesn't work" >&4
19964 echo "wcscmp() NOT found." >&4
19970 : see if wcstombs exists
19971 set wcstombs d_wcstombs
19976 $cat >try.c <<'EOCP'
19981 wchar_t dst[4], *src = L" ";
19983 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19988 if eval $compile; then
19991 0) echo "A working wcsxfrm() found." >&4
19993 *) echo "wcsxfrm() found, but it doesn't work" >&4
19997 echo "wcsxfrm() NOT found." >&4
20003 : see if wctomb exists
20004 set wctomb d_wctomb
20007 : see if writev exists
20008 set writev d_writev
20011 : check for alignment requirements
20013 case "$alignbytes" in
20014 '') echo "Checking alignment constraints..." >&4
20023 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20028 if eval $compile_ok; then
20032 echo "(I can't seem to compile the test program...)"
20034 case "$multiarch" in
20036 : The usual safe value is 8, but Darwin with -Duselongdouble
20037 : needs 16. Hence, we will take 8 as a minimum, but allow
20038 : Configure to pick a larger value if needed.
20039 if $test "$dflt" -lt 8; then
20041 echo "Setting alignment to 8 for multiarch support.">&4
20046 *) dflt="$alignbytes"
20049 rp="Doubles must be aligned on a how-many-byte boundary?"
20054 : set the base revision
20057 : length of character in bytes. Is always 1, otherwise it is not C
20058 : This used to be a test using sizeof
20061 : Check for the number of bits in a character
20062 case "$charbits" in
20063 '') echo "Checking how long a character is (in bits)..." >&4
20070 for (c = 1, n = 0; c; c <<= 1, n++) ;
20071 printf ("%d\n", n);
20076 if eval $compile_ok; then
20080 echo "(I can't seem to compile the test program. Guessing...)"
20087 rp="What is the length of a character (in bits)?"
20091 case "$charbits" in
20094 Your system has an unsigned character size of $charbits bits, which
20095 is rather unusual (normally it is 8 bits). Perl likely will not work
20096 correctly on your system, with subtle bugs in various places.
20098 rp='Do you really want to continue?'
20102 [yY]) echo >&4 "Okay, continuing." ;;
20107 : how do we concatenate cpp tokens here?
20109 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20110 $cat >cpp_stuff.c <<'EOCP'
20111 #define RCAT(a,b)a/**/b
20112 #define ACAT(a,b)a ## b
20116 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20117 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20118 echo "Oh! Smells like ANSI's been here." >&4
20119 echo "We can catify or stringify, separately or together!"
20121 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20122 echo "Ah, yes! The good old days!" >&4
20123 echo "However, in the good old days we don't know how to stringify and"
20124 echo "catify at the same time."
20128 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20129 You're going to have to edit the values of CAT[2-5] in config.h...
20131 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20135 : see if this is a db.h system
20141 : Check db version.
20143 echo "Checking Berkeley DB version ..." >&4
20145 #include <sys/types.h>
20147 #$i_stdlib I_STDLIB
20149 #include <stdlib.h>
20152 int main(int argc, char *argv[])
20154 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20155 int Major, Minor, Patch ;
20156 unsigned long Version ;
20157 (void)db_version(&Major, &Minor, &Patch) ;
20159 printf("%d %d %d %d %d %d\n",
20160 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20161 Major, Minor, Patch);
20164 printf("You have Berkeley DB Version 2 or greater.\n");
20166 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20167 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20168 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20169 Major, Minor, Patch) ;
20171 /* check that db.h & libdb are compatible */
20172 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20173 printf("db.h and libdb are incompatible.\n") ;
20177 printf("db.h and libdb are compatible.\n") ;
20179 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20180 + DB_VERSION_PATCH ;
20182 /* needs to be >= 2.3.4 */
20183 if (Version < 2003004) {
20184 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20185 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20191 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20196 printf("You have Berkeley DB Version 1.\n");
20197 exit(0); /* DB version < 2: the coast is clear. */
20199 exit(1); /* <db.h> not Berkeley DB? */
20205 if eval $compile_ok && $run ./try; then
20206 echo 'Looks OK.' >&4
20208 db_version_major=$1
20209 db_version_minor=$2
20210 db_version_patch=$3
20212 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20216 : Remove db from list of libraries to use
20217 echo "Removing unusable -ldb from library list" >&4
20218 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20221 echo "libs = $libs" >&4
20231 : Check the return type needed for hash
20233 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20235 #include <sys/types.h>
20238 #ifndef DB_VERSION_MAJOR
20239 u_int32_t hash_cb (const void* ptr, size_t size)
20246 info.hash = hash_cb;
20250 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20251 if $contains warning try.out >>/dev/null 2>&1 ; then
20254 db_hashtype='u_int32_t'
20257 : XXX Maybe we should just give up here.
20258 db_hashtype=u_int32_t
20260 echo "Help: I can't seem to compile the db test program." >&4
20261 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20264 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20266 *) db_hashtype=u_int32_t
20271 : Check the return type needed for prefix
20273 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20275 #include <sys/types.h>
20278 #ifndef DB_VERSION_MAJOR
20279 size_t prefix_cb (const DBT *key1, const DBT *key2)
20286 info.prefix = prefix_cb;
20290 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20291 if $contains warning try.out >>/dev/null 2>&1 ; then
20292 db_prefixtype='int'
20294 db_prefixtype='size_t'
20297 db_prefixtype='size_t'
20298 : XXX Maybe we should just give up here.
20300 echo "Help: I can't seem to compile the db test program." >&4
20301 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20304 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20306 *) db_prefixtype='size_t'
20310 : Include . in @INC
20313 Historically Perl has provided a final fallback of the current working
20314 directory '.' when searching for a library. This, however, can lead to
20315 problems when a Perl program which loads optional modules is called from
20316 a shared directory. This can lead to executing unexpected code.
20320 # When changing to exclude by default:
20321 case "$default_inc_excludes_dot" in
20322 $undef|false|[nN]*) dflt="n" ;;
20325 # To turn exclude off by default:
20326 #case "$default_inc_excludes_dot" in
20327 # $define|true|[yY]*) dflt="y" ;;
20331 rp='Exclude '.' from @INC by default? '
20334 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20335 *) default_inc_excludes_dot="$define" ;;
20338 : Check what kind of inf/nan your system has
20339 $echo "Checking the kind of infinities and nans you have..." >&4
20340 $echo "(The following tests may crash. That's okay.)" >&4
20342 #define DOUBLESIZE $doublesize
20343 #$d_longdbl HAS_LONG_DOUBLE
20344 #ifdef HAS_LONG_DOUBLE
20345 #define LONG_DOUBLESIZE $longdblsize
20346 #define LONG_DOUBLEKIND $longdblkind
20349 #include <string.h>
20351 /* Note that whether the sign bit is on or off
20352 * for NaN depends on the CPU/FPU, and possibly
20353 * can be affected by the build toolchain.
20355 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20356 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20357 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20358 * (respectively) as opposed to the more usual
20359 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20361 * Pre-IEEE-754 floating point format do not even have inf/nan support
20362 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20363 * to even mention, causing immediate SIGFPE or equivalent: this is
20364 * the case with VAX floating point, for example.
20366 static void bytes(void *v, unsigned int n) {
20367 unsigned char *p = (unsigned char *)v;
20369 for (i = 0; i < n; i++) {
20370 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20373 int main(int argc, char *argv[]) {
20374 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20375 * because some compilers are 'smart' and not only warn but refuse to
20376 * compile such 'illegal' values. */
20377 double dinf = exp(1e9);
20378 double dnan = sqrt(-1.0);
20379 #ifdef HAS_LONG_DOUBLE
20380 long double ldinf = (long double)exp(1e9);
20381 long double ldnan = (long double)sqrt(-1.0);
20382 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20383 /* the 80-bit long doubles might have garbage in their excess bytes */
20384 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20385 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20388 switch (argv[1][0]) {
20389 case '1': bytes(&dinf, sizeof(dinf)); break;
20390 case '2': bytes(&dnan, sizeof(dnan)); break;
20391 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20392 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20400 if eval $compile; then
20401 doubleinfbytes=`$run ./try 1`
20402 doublenanbytes=`$run ./try 2`
20403 case "$d_longdbl" in
20405 longdblinfbytes=`$run ./try 3`
20406 longdblnanbytes=`$run ./try 4`
20410 # Defaults in case the above test program failed.
20411 case "$doublekind" in
20412 1) # IEEE 754 32-bit LE
20413 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20414 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20416 2) # IEEE 754 32-bit BE
20417 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20418 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20420 3) # IEEE 754 64-bit LE
20421 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20422 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20424 4) # IEEE 754 64-bit BE
20425 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20426 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20428 5) # IEEE 754 128-bit LE
20429 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20430 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20432 6) # IEEE 754 128-bit BE
20433 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20434 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20436 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20437 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20438 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20440 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20441 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20442 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20444 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20445 doubleinfbytes=$undef
20446 doublenanbytes=$undef
20449 doubleinfbytes=$undef
20450 doublenanbytes=$undef
20453 case "$longdblkind" in
20454 1) # IEEE 754 128-bit LE
20455 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20456 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20458 2) # IEEE 754 128-bit BE
20459 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20460 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20462 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20463 case "$longdblsize" in
20464 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20465 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20466 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20469 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20470 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20473 longdblinfbytes=$undef
20474 longdblnanbytes=$undef
20478 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20479 case "$longdblsize" in
20480 12) # 32-bit system
20481 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20482 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20484 16) # 64-bit system
20485 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20486 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20489 longdblinfbytes=$undef
20490 longdblnanbytes=$undef
20494 5) # 128-bit LE-LE "double double"
20495 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20496 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20498 6) # 128-bit BE-BE "double double"
20499 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20500 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20502 7) # 128-bit LE-BE "double double"
20503 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20504 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20506 8) # 128-bit BE-LE "double double"
20507 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20508 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20510 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20511 longdblinfbytes=$undef
20512 longdblnanbytes=$undef
20515 longdblinfbytes=$undef
20516 longdblnanbytes=$undef
20520 # In case the program crashed the values are empty, turn them undef.
20521 case "$doubleinfbytes" in
20522 '') doubleinfbytes=$undef ;;
20524 case "$doublenanbytes" in
20525 '') doublenanbytes=$undef ;;
20527 case "$longdblinfbytes" in
20528 '') longdblinfbytes=$undef ;;
20530 case "$longdblnanbytes" in
20531 '') longdblnanbytes=$undef ;;
20535 : Check the length of the double mantissa
20536 $echo "Checking how many mantissa bits your doubles have..." >&4
20538 #$i_sunmath I_SUNMATH
20541 # include <sunmath.h>
20543 #ifdef DBL_MANT_DIG
20544 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20547 int main(int argc, char *argv[]) {
20549 printf("%d\n", BITS);
20555 if eval $compile; then
20556 doublemantbits=`$run ./try`
20558 doublemantbits="$undef"
20562 : Check the length of the longdouble mantissa
20563 $echo "Checking how many mantissa bits your long doubles have..." >&4
20565 #$i_sunmath I_SUNMATH
20568 # include <sunmath.h>
20570 #$d_longdbl HAS_LONG_DOUBLE
20571 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20572 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20573 /* This format has no implicit bit. Beware, however, that for
20574 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20575 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20576 * and the top bit must have been one since 387, zero is plain invalid.
20577 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20578 # define BITS LDBL_MANT_DIG
20579 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20580 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20581 * reason e.g. Irix thinks 107. But in any case, we want only
20582 * the number of real bits, the implicit bits are of no interest. */
20583 # define BITS 2 * (DBL_MANT_DIG - 1)
20585 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20589 int main(int argc, char *argv[]) {
20591 printf("%d\n", BITS);
20597 if eval $compile; then
20598 longdblmantbits=`$run ./try`
20600 longdblmantbits="$undef"
20604 : Check the length of the NV mantissa
20605 $echo "Checking how many mantissa bits your NVs have..." >&4
20606 if test "X$usequadmath" = "X$define"; then
20607 nvmantbits=112 # 128-1-15
20609 if test "X$nvsize" = "X$doublesize"; then
20610 nvmantbits="$doublemantbits"
20612 if test "X$nvsize" = "X$longdblsize"; then
20613 nvmantbits="$longdblmantbits"
20615 nvmantbits="$undef"
20620 : How can we generate normalized random numbers ?
20622 echo "Using our internal random number implementation..." >&4
20625 *-Dmy_rand=*|*-Dmy_srand=*)
20626 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20627 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20628 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20629 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20633 randfunc=Perl_drand48
20634 drand01="Perl_drand48()"
20635 seedfunc="Perl_drand48_init"
20639 : Probe whether dtrace builds an object, as newer Illumos requires an input
20640 : object file that uses at least one of the probes defined in the .d file
20641 case "$usedtrace" in
20643 case "$dtracexnolibs" in
20644 $define|true|[yY]*)
20645 dtracexnolibs=$define
20646 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20649 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20650 dtracexnolibs=$define
20651 echo "Your dtrace accepts -xnolibs"
20652 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20653 dtracexnolibs=$undef
20654 echo "Your dtrace doesn't accept -xnolibs"
20656 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20661 dtracexnolibs=$undef
20662 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20665 case $dtracexnolibs in
20666 $define) xnolibs=-xnolibs ;;
20670 case "$dtraceobject" in
20671 $define|true|[yY]*)
20672 dtraceobject=$define
20676 #include "perldtrace.h"
20678 PERL_LOADED_FILE("dummy");
20682 dtraceobject=$undef
20683 if $cc -c -o try.o $optimize $ccflags try.c \
20684 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20685 dtraceobject=$define
20686 echo "Your dtrace builds an object file"
20689 *) dtraceobject=$undef ;;
20691 $rm_try perldtrace.o perldtrace.h
20694 : Determine if this is an EBCDIC system
20696 echo "Determining whether or not we are on an EBCDIC system..." >&4
20697 $cat >try.c <<'EOM'
20700 if ('M'==0xd4) return 0;
20707 if eval $compile_ok; then
20708 if $run ./try; then
20709 echo "You seem to speak EBCDIC." >&4
20712 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20715 echo "I'm unable to compile the test program." >&4
20716 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20722 : Check how to flush
20725 Checking how to flush all pending stdio output...
20727 # I only know how to find the first 32 possibly open files on SunOS.
20728 # See also hints/sunos_4_1.sh and util.c --AD
20730 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20732 $cat >>try.c <<EOCP
20734 #$i_stdlib I_STDLIB
20736 #include <stdlib.h>
20738 #$i_unistd I_UNISTD
20740 # include <unistd.h>
20742 #$d_sysconf HAS_SYSCONF
20743 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20744 #ifdef HAS_STDIO_STREAM_ARRAY
20745 # define STDIO_STREAM_ARRAY $stdio_stream_array
20750 p = fopen("try.out", "w");
20754 # ifdef TRY_FPRINTF
20758 #ifdef TRY_FFLUSH_NULL
20761 #ifdef TRY_FFLUSH_ALL
20763 long open_max = -1;
20764 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20765 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20767 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20768 open_max = sysconf(_SC_OPEN_MAX);
20771 open_max = FOPEN_MAX;
20774 open_max = OPEN_MAX;
20783 # ifdef HAS_STDIO_STREAM_ARRAY
20784 if (open_max > 0) {
20786 for (i = 0; i < open_max; i++)
20787 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20788 STDIO_STREAM_ARRAY[i]._file < open_max &&
20789 STDIO_STREAM_ARRAY[i]._flag)
20790 fflush(&STDIO_STREAM_ARRAY[i]);
20798 : first we have to find out how _not_ to flush
20800 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20802 set try -DTRY_FPUTC
20803 if eval $compile; then
20804 $run ./try 2>/dev/null
20807 if $test ! -s try.out -a "X$code" = X42; then
20813 set try -DTRY_FPRINTF
20814 if eval $compile; then
20815 $run ./try 2>/dev/null
20818 if $test ! -s try.out -a "X$code" = X42; then
20819 output=-DTRY_FPRINTF
20825 : check for fflush NULL behavior
20826 case "$fflushNULL" in
20827 '') set try -DTRY_FFLUSH_NULL $output
20828 if eval $compile; then
20829 $run ./try 2>/dev/null
20832 if $test -s try.out -a "X$code" = X42; then
20833 fflushNULL="`$cat try.out`"
20835 if $test "X$code" != X42; then
20837 (If this test failed, don't worry, we'll try another method shortly.)
20842 $rm -f core try.core core.try.*
20843 case "$fflushNULL" in
20845 Your fflush(NULL) works okay for output streams.
20846 Let's see if it clobbers input pipes...
20848 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20849 # bug that improperly flushes the input end of pipes. So we avoid the
20850 # autoflush on fork/system/exec support for now. :-(
20851 $cat >tryp.c <<EOCP
20854 main(int argc, char **argv)
20860 while ((i = getc(stdin)) != -1
20861 && (*bp++ = i) != '\n'
20862 && bp < &buf[1024])
20865 fprintf(stdout, "%s", buf);
20873 fflushNULL="$define"
20875 if eval $compile; then
20877 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20878 if $test "X$targethost" != X; then
20881 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20883 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20885 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20887 fflush(NULL) seems to behave okay with input streams.
20889 fflushNULL="$define"
20892 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20894 fflushNULL="$undef"
20897 $rm -f core tryp.c tryp.core core.tryp.*
20900 Your fflush(NULL) isn't working (contrary to ANSI C).
20902 fflushNULL="$undef"
20905 Cannot figure out whether your fflush(NULL) works or not.
20906 I'm assuming it doesn't (contrary to ANSI C).
20908 fflushNULL="$undef"
20912 $define|true|[yY]*)
20913 fflushNULL="$define"
20916 fflushNULL="$undef"
20919 : check explicit looping only if NULL did not work, and if the pipe
20920 : bug does not show up on an explicit flush too
20921 case "$fflushNULL" in
20923 $cat >tryp.c <<EOCP
20926 main(int argc, char **argv)
20932 while ((i = getc(stdin)) != -1
20933 && (*bp++ = i) != '\n'
20934 && bp < &buf[1024])
20937 fprintf(stdout, "%s", buf);
20946 if eval $compile; then
20948 if $test "X$targethost" != X; then
20951 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20953 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20955 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20957 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20959 : now check for fflushall behaviour
20960 case "$fflushall" in
20961 '') set try -DTRY_FFLUSH_ALL $output
20962 if eval $compile; then
20964 (Now testing the other method--but note that this also may fail.)
20966 $run ./try 2>/dev/null
20969 if $test -s try.out -a "X$code" = X42; then
20970 fflushall="`$cat try.out`"
20974 case "$fflushall" in
20976 Whew. Flushing explicitly all the stdio streams works.
20978 fflushall="$define"
20981 Sigh. Flushing explicitly all the stdio streams doesn't work.
20986 Cannot figure out whether flushing stdio streams explicitly works or not.
20987 I'm assuming it doesn't.
20993 "$define"|true|[yY]*)
20994 fflushall="$define"
21002 All is futile. Even fflush(stdin) clobbers input pipes!
21009 $rm -f core tryp.c tryp.core core.tryp.*
21011 *) fflushall="$undef"
21015 case "$fflushNULL$fflushall" in
21018 OK, I give up. I cannot figure out how to flush pending stdio output.
21019 We won't be flushing handles at all before fork/exec/popen.
21025 : Store the full pathname to the ar program for use in the C program
21026 : Respect a hint or command line value for full_ar.
21031 : Store the full pathname to the sed program for use in the C program
21034 : see what type gids are declared as in the kernel
21036 echo "Looking for the type for group ids returned by getgid()."
21037 set gid_t gidtype xxx stdio.h sys/types.h
21041 xxx=`./findhdr sys/user.h`
21042 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21044 unsigned) dflt="$1 $2" ;;
21048 *) dflt="$gidtype";;
21051 gid_t) echo "gid_t found." ;;
21052 *) rp="What is the type for group ids returned by getgid()?"
21058 : Check the size of GID
21061 *_t) zzz="$gidtype" ;;
21064 echo "Checking the size of $zzz..." >&4
21066 #include <sys/types.h>
21068 #$i_stdlib I_STDLIB
21070 #include <stdlib.h>
21073 printf("%d\n", (int)sizeof($gidtype));
21078 if eval $compile_ok; then
21082 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21085 echo "Your $zzz is $gidsize bytes long."
21090 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21093 : Check if GID is signed
21096 *_t) zzz="$gidtype" ;;
21099 echo "Checking the sign of $zzz..." >&4
21101 #include <sys/types.h>
21112 if eval $compile; then
21116 echo "(I can't execute the test program--guessing unsigned.)" >&4
21120 1) echo "Your $zzz is unsigned." ;;
21121 -1) echo "Your $zzz is signed." ;;
21127 echo "(I can't compile the test program--guessing unsigned.)" >&4
21130 : Check 64bit sizes
21133 if $test X"$quadtype" != X; then
21135 echo "Checking how to print 64-bit integers..." >&4
21137 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21138 $cat >try.c <<'EOCP'
21139 #include <sys/types.h>
21142 int q = 12345678901;
21143 printf("%ld\n", q);
21147 if eval $compile; then
21151 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21152 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21153 echo "We will use %d."
21159 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21160 $cat >try.c <<'EOCP'
21161 #include <sys/types.h>
21164 long q = 12345678901;
21165 printf("%ld\n", q);
21169 if eval $compile; then
21173 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21174 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21175 echo "We will use %ld."
21181 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21182 $cat >try.c <<'EOCP'
21183 #include <sys/types.h>
21184 #include <inttypes.h>
21187 int64_t q = 12345678901;
21188 printf("%" PRId64 "\n", q);
21192 if eval $compile; then
21196 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21197 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21198 echo "We will use the C9X style."
21204 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21206 #include <sys/types.h>
21209 $quadtype q = 12345678901;
21210 printf("%Ld\n", q);
21214 if eval $compile; then
21218 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21219 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21220 echo "We will use %Ld."
21226 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21227 $cat >try.c <<'EOCP'
21228 #include <sys/types.h>
21231 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21232 printf("%lld\n", q);
21236 if eval $compile; then
21240 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21241 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21242 echo "We will use the %lld style."
21248 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21250 #include <sys/types.h>
21253 $quadtype q = 12345678901;
21254 printf("%qd\n", q);
21258 if eval $compile; then
21262 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21263 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21264 echo "We will use %qd."
21270 if $test X"$sPRId64" = X; then
21271 echo "Cannot figure out how to print 64-bit integers." >&4
21278 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21279 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21281 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21282 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21286 : Check format strings for internal types
21288 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21290 if $test X"$ivsize" = X8; then
21291 ivdformat="$sPRId64"
21292 uvuformat="$sPRIu64"
21293 uvoformat="$sPRIo64"
21294 uvxformat="$sPRIx64"
21295 uvXUformat="$sPRIXU64"
21297 if $test X"$ivsize" = X"$longsize"; then
21304 if $test X"$ivsize" = X"$intsize"; then
21312 if $test X"$ivsize" = X"$shortsize"; then
21323 if $test X"$usequadmath" = X"$define"; then
21331 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21332 nveformat="$sPRIeldbl"
21333 nvfformat="$sPRIfldbl"
21334 nvgformat="$sPRIgldbl"
21335 nvEUformat="$sPRIEUldbl"
21336 nvFUformat="$sPRIFUldbl"
21337 nvGUformat="$sPRIGUldbl"
21348 case "$ivdformat" in
21349 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21354 : Check format string for GID
21357 $echo "Checking the format string to be used for gids..." >&4
21360 -1) if $test X"$gidsize" = X"$ivsize"; then
21361 gidformat="$ivdformat"
21363 if $test X"$gidsize" = X"$longsize"; then
21366 if $test X"$gidsize" = X"$intsize"; then
21369 if $test X"$gidsize" = X"$shortsize"; then
21376 *) if $test X"$gidsize" = X"$uvsize"; then
21377 gidformat="$uvuformat"
21379 if $test X"$gidsize" = X"$longsize"; then
21382 if $test X"$gidsize" = X"$intsize"; then
21385 if $test X"$gidsize" = X"$shortsize"; then
21394 : see if getgroups exists
21395 set getgroups d_getgrps
21398 : see if setgroups exists
21399 set setgroups d_setgrps
21402 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21404 case "$d_getgrps$d_setgrps" in
21406 case "$groupstype" in
21407 '') dflt="$gidtype" ;;
21408 *) dflt="$groupstype" ;;
21411 What type of pointer is the second argument to getgroups() and setgroups()?
21412 Usually this is the same as group ids, $gidtype, but not always.
21415 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21419 *) groupstype="$gidtype";;
21422 : check whether make sets MAKE
21424 echo "Checking if your $make program sets \$(MAKE)..." >&4
21425 case "$make_set_make" in
21427 $sed 's/^X //' > testmake.mak << 'EOF'
21429 X @echo 'maketemp="$(MAKE)"'
21431 case "`$make -f testmake.mak 2>/dev/null`" in
21432 *maketemp=*) make_set_make='#' ;;
21433 *) make_set_make="MAKE=$make" ;;
21435 $rm -f testmake.mak
21438 case "$make_set_make" in
21439 '#') echo "Yup, it does.";;
21440 *) echo "Nope, it doesn't.";;
21443 : see what type is used for mode_t
21444 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21445 set mode_t modetype int stdio.h sys/types.h
21448 : see if we need va_copy
21451 #include <stdarg.h>
21453 #include <stdlib.h>
21454 #include <signal.h>
21457 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21459 return vfprintf(f, fmt, *valp);
21463 myvfprintf(FILE *f, const char *fmt, va_list val)
21465 return ivfprintf(f, fmt, &val);
21469 myprintf(char *fmt, ...)
21472 va_start(val, fmt);
21473 return myvfprintf(stdout, fmt, val);
21477 main(int ac, char **av)
21479 signal(SIGSEGV, exit);
21481 myprintf("%s%cs all right, then\n", "that", '\'');
21486 if eval $compile && $run ./try 2>&1 >/dev/null; then
21487 case "`$run ./try`" in
21488 "that's all right, then")
21494 yes) echo "It seems that you don't need va_copy()." >&4
21495 need_va_copy="$undef"
21497 *) echo "It seems that va_copy() or similar will be needed." >&4
21498 need_va_copy="$define"
21503 : see what type is used for size_t
21504 rp="What is the type used for the length parameter for string functions?"
21505 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21508 : check for type of arguments to gethostbyaddr.
21509 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21510 case "$d_gethbyaddr" in
21514 Checking to see what type of arguments are accepted by gethostbyaddr().
21516 hdrs="$define sys/types.h
21517 $d_socket sys/socket.h
21518 $i_niin netinet/in.h
21520 $i_unistd unistd.h"
21521 : The first arg can 'char *' or 'void *'
21522 : The second arg is some of integral type
21523 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21524 for yyy in size_t long int; do
21525 case "$netdb_host_type" in
21526 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21527 if ./protochk "$try" $hdrs; then
21528 echo "Your system accepts $xxx for the first arg."
21529 echo "...and $yyy for the second arg."
21530 netdb_host_type="$xxx"
21531 netdb_hlen_type="$yyy"
21537 : In case none of those worked, prompt the user.
21538 case "$netdb_host_type" in
21539 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21542 netdb_host_type=$ans
21543 rp='What is the type for the 2nd argument to gethostbyaddr?'
21546 netdb_hlen_type=$ans
21550 *) : no gethostbyaddr, so pick harmless defaults
21551 netdb_host_type='char *'
21552 netdb_hlen_type="$sizetype"
21555 # Remove the "const" if needed. -- but then we'll have a
21557 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21560 : check for type of argument to gethostbyname.
21561 if test "X$netdb_name_type" = X ; then
21562 case "$d_gethbyname" in
21566 Checking to see what type of argument is accepted by gethostbyname().
21568 hdrs="$define sys/types.h
21569 $d_socket sys/socket.h
21570 $i_niin netinet/in.h
21572 $i_unistd unistd.h"
21573 for xxx in "const char *" "char *"; do
21574 case "$netdb_name_type" in
21575 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21576 if ./protochk "$try" $hdrs; then
21577 echo "Your system accepts $xxx."
21578 netdb_name_type="$xxx"
21583 : In case none of those worked, prompt the user.
21584 case "$netdb_name_type" in
21585 '') rp='What is the type for the 1st argument to gethostbyname?'
21588 netdb_name_type=$ans
21592 *) : no gethostbyname, so pick harmless default
21593 netdb_name_type='char *'
21598 : check for type of 1st argument to getnetbyaddr.
21599 if test "X$netdb_net_type" = X ; then
21600 case "$d_getnbyaddr" in
21604 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21606 hdrs="$define sys/types.h
21607 $d_socket sys/socket.h
21608 $i_niin netinet/in.h
21610 $i_unistd unistd.h"
21611 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21612 case "$netdb_net_type" in
21613 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21614 if ./protochk "$try" $hdrs; then
21615 echo "Your system accepts $xxx."
21616 netdb_net_type="$xxx"
21621 : In case none of those worked, prompt the user.
21622 case "$netdb_net_type" in
21623 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21626 netdb_net_type=$ans
21630 *) : no getnetbyaddr, so pick harmless default
21631 netdb_net_type='long'
21635 : locate the preferred pager for this system
21642 [a-zA-Z]:/*) dflt=$pg;;
21646 [a-zA-Z]:/*) dflt=$more;;
21650 [a-zA-Z]:/*) dflt=$less;;
21653 '') dflt=/usr/ucb/more;;
21661 rp='What pager is used on your system?'
21665 : see if ar generates random libraries by itself
21667 echo "Checking how to generate random libraries on your machine..." >&4
21668 echo 'int bar1() { return bar2(); }' > bar1.c
21669 echo 'int bar2() { return 2; }' > bar2.c
21671 #$i_stdlib I_STDLIB
21673 #include <stdlib.h>
21675 int main() { printf("%d\n", bar1()); exit(0); }
21677 $cc $ccflags -c bar1.c >/dev/null 2>&1
21678 $cc $ccflags -c bar2.c >/dev/null 2>&1
21679 $cc $ccflags -c foo.c >/dev/null 2>&1
21680 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21681 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21682 $run ./foobar >/dev/null 2>&1; then
21683 echo "$ar appears to generate random libraries itself."
21685 if [ "X$ranlib" = "X" ]; then
21688 elif $ar s bar$_a >/dev/null 2>&1 &&
21689 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21690 $run ./foobar >/dev/null 2>&1; then
21691 echo "a table of contents needs to be added with '$ar s'."
21694 elif $ar ts bar$_a >/dev/null 2>&1 &&
21695 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21696 $run ./foobar >/dev/null 2>&1; then
21697 echo "a table of contents needs to be added with '$ar ts'."
21704 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21705 $test -f $ranlib || ranlib=''
21708 if $test -n "$ranlib"; then
21709 echo "your system has '$ranlib'; we'll use that."
21712 echo "your system doesn't seem to support random libraries"
21713 echo "so we'll use lorder and tsort to order the libraries."
21720 : Check the max offset that gmtime and localtime accept
21721 echo "Checking max offsets that gmtime () accepts"
21723 case "$sGMTIME_min/$sGMTIME_max" in
21726 #include <sys/types.h>
21734 void gm_check (time_t t, int min_year, int max_year)
21737 if ( tmp == NULL ||
21738 /* Check tm_year overflow */
21739 tmp->tm_year < min_year || tmp->tm_year > max_year)
21750 gm_check (MAXLONG, 69, 0x7fffffff);
21752 if (tmp == NULL || tmp->tm_year < 0) {
21753 for (i = 63; i >= 0; i--) {
21754 time_t x = pt | ((time_t)1 << i);
21755 if (x < 0 || x < pt) continue;
21756 gm_check (x, 69, 0x7fffffff);
21759 printf ("sGMTIME_max=%ld\n", pt);
21768 gm_check (MINLONG, -1900, 70);
21771 for (i = 36; i >= 0; i--) {
21772 time_t x = pt - ((time_t)1 << i);
21773 if (x > 0) continue;
21774 gm_check (x, -1900, 70);
21777 printf ("sGMTIME_min=%ld\n", pt);
21781 int main (int argc, char *argv[])
21783 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21790 if eval $compile; then
21791 eval `$run ./try 2>/dev/null`
21793 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21799 echo "Checking max offsets that localtime () accepts"
21801 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21804 #include <sys/types.h>
21812 void local_check (time_t t, int min_year, int max_year)
21814 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21817 tmp = localtime (&t);
21818 if ( tmp == NULL ||
21819 /* Check tm_year overflow */
21820 tmp->tm_year < min_year || tmp->tm_year > max_year)
21824 } /* local_check */
21831 local_check (MAXLONG, 69, 0x7fffffff);
21833 if (tmp == NULL || tmp->tm_year < 0) {
21834 for (i = 63; i >= 0; i--) {
21835 time_t x = pt | ((time_t)1 << i);
21836 if (x < 0 || x < pt) continue;
21837 local_check (x, 69, 0x7fffffff);
21840 printf ("sLOCALTIME_max=%ld\n", pt);
21849 local_check (MINLONG, -1900, 70);
21852 for (i = 36; i >= 0; i--) {
21853 time_t x = pt - ((time_t)1 << i);
21854 if (x > 0) continue;
21855 local_check (x, -1900, 70);
21858 printf ("sLOCALTIME_min=%ld\n", pt);
21862 int main (int argc, char *argv[])
21870 if eval $compile; then
21871 eval `$run ./try 2>/dev/null`
21873 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21879 : check for type of arguments to select.
21880 case "$selecttype" in
21881 '') case "$d_select" in
21885 Checking to see what type of arguments are accepted by select().
21887 hdrs="$define sys/types.h
21888 $i_systime sys/time.h
21889 $i_sysselct sys/select.h
21890 $d_socket sys/socket.h"
21891 : The first arg can be int, unsigned, or size_t
21892 : The last arg may or may not be 'const'
21894 : void pointer has been seen but using that
21895 : breaks the selectminbits test
21896 for xxx in 'fd_set *' 'int *'; do
21897 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21898 for tmo in 'struct timeval *' 'const struct timeval *'; do
21900 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21901 if ./protochk "$try" $hdrs; then
21902 echo "Your system accepts $xxx."
21911 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21912 case "$d_fd_set" in
21913 $define) dflt="fd_set *" ;;
21922 *) : no select, so pick a harmless default
21929 : check for the select 'width'
21930 case "$selectminbits" in
21931 '') safebits=`expr $ptrsize \* 8`
21932 case "$d_select" in
21936 Checking to see on how many bits at a time your select() operates...
21939 #include <sys/types.h>
21941 #$i_systime I_SYS_TIME
21942 #$i_systimek I_SYS_TIME_KERNEL
21947 # ifdef I_SYS_TIME_KERNEL
21950 # include <sys/time.h>
21951 # ifdef I_SYS_TIME_KERNEL
21955 #$i_sysselct I_SYS_SELECT
21956 #ifdef I_SYS_SELECT
21957 #include <sys/select.h>
21959 #$d_socket HAS_SOCKET
21961 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21964 #$i_stdlib I_STDLIB
21966 #include <stdlib.h>
21969 #define S sizeof(*(b))
21971 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21972 #define NBITS (NBYTES * 8)
21974 char *s = (char *)malloc(NBYTES);
21983 fp = fopen("try.c", "r");
21989 b = ($selecttype)s;
21990 for (i = 0; i < NBITS; i++)
21994 select(fd + 1, b, 0, 0, &t);
21995 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21997 printf("%d\n", i + 1);
22002 if eval $compile_ok; then
22003 selectminbits=`$run ./try 2>/dev/null`
22004 case "$selectminbits" in
22006 Cannot figure out on how many bits at a time your select() operates.
22007 I'll play safe and guess it is $safebits bits.
22009 selectminbits=$safebits
22010 bits="$safebits bits"
22013 *) bits="$selectminbits bits" ;;
22015 echo "Your select() operates on $bits at a time." >&4
22017 rp='What is the minimum number of bits your select() operates on?'
22018 case "$byteorder" in
22019 12345678) dflt=64 ;;
22025 selectminbits="$val"
22029 *) : no select, so pick a harmless default
22030 selectminbits=$safebits
22036 : Trace out the files included by signal.h, then look for SIGxxx names.
22037 case "$sig_num_init" in
22039 if [ "X$fieldn" = X ]; then
22040 : Just make some guesses. We check them later.
22041 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22043 xxx=`echo '#include <signal.h>' |
22044 $cppstdin $cppminus $cppflags 2>/dev/null |
22045 $grep '^[ ]*#.*include' |
22046 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22047 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22050 for xx in $xxx /dev/null ; do
22051 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22053 case "$xxxfiles" in
22054 '') xxxfiles=`./findhdr signal.h` ;;
22057 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22058 print substr($2, 4, 20)
22060 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22061 print substr($3, 4, 20)
22063 : Append some common names just in case the awk scan failed.
22064 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22065 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22066 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22067 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22068 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22070 : generate a few handy files for later
22071 $cat > signal.c <<EOCP
22072 #include <sys/types.h>
22073 #include <signal.h>
22074 #$i_stdlib I_STDLIB
22076 #include <stdlib.h>
22081 /* Strange style to avoid deeply-nested #if/#else/#endif */
22084 # define NSIG (_NSIG)
22090 # define NSIG (SIGMAX+1)
22096 # define NSIG (SIG_MAX+1)
22102 # define NSIG (_SIG_MAX+1)
22108 # define NSIG (MAXSIG+1)
22114 # define NSIG (MAX_SIG+1)
22119 # ifdef SIGARRAYSIZE
22120 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22126 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22130 /* Default to some arbitrary number that's big enough to get most
22131 of the common signals.
22137 printf("NSIG %d\n", NSIG);
22143 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22145 printf "#ifdef SIG"; printf $1; printf "\n"
22146 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22147 printf $1; printf ");\n"
22151 printf "#endif /* JUST_NSIG */\n";
22152 printf "exit(0);\n}\n";
22155 $cat >signal.awk <<'EOP'
22156 BEGIN { ndups = 0 }
22157 $1 ~ /^NSIG$/ { nsig = $2 }
22158 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22159 if ($2 > maxsig) { maxsig = $2 }
22160 if (sig_name[$2]) {
22161 dup_name[ndups] = $1
22162 dup_num[ndups] = $2
22174 printf("NSIG %d\n", nsig);
22175 for (n = 1; n < nsig; n++) {
22177 printf("%s %d\n", sig_name[n], sig_num[n])
22180 printf("NUM%d %d\n", n, n)
22183 for (n = 0; n < ndups; n++) {
22184 printf("%s %d\n", dup_name[n], dup_num[n])
22188 $cat >signal_cmd <<EOS
22190 if $test -s signal.lst; then
22191 echo "Using your existing signal.lst file"
22196 $cat >>signal_cmd <<'EOS'
22199 if eval $compile_ok; then
22200 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22201 $uniq | $awk -f signal.awk >signal.lst
22203 echo "(I can't seem be able to compile the whole test program)" >&4
22204 echo "(I'll try it in little pieces.)" >&4
22205 set signal -DJUST_NSIG
22206 if eval $compile_ok; then
22207 $run ./signal$_exe > signal.nsg
22210 echo "I can't seem to figure out how many signals you have." >&4
22211 echo "Guessing 50." >&4
22212 echo 'NSIG 50' > signal.nsg
22214 : Now look at all the signal names, one at a time.
22215 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22216 $cat > signal.c <<EOCP
22217 #include <sys/types.h>
22218 #include <signal.h>
22221 printf("$xx %d\n", SIG${xx});
22226 if eval $compile; then
22227 echo "SIG${xx} found."
22228 $run ./signal$_exe >> signal.ls1
22230 echo "SIG${xx} NOT found."
22233 if $test -s signal.ls1; then
22234 $cat signal.nsg signal.ls1 |
22235 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22239 if $test -s signal.lst; then
22242 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22243 echo 'kill -l' >signal
22244 set X `csh -f <signal`
22248 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22250 echo $@ | $tr ' ' $trnl | \
22251 $awk '{ printf "%s %d\n", $1, ++s; }
22252 END { printf "NSIG %d\n", ++s }' >signal.lst
22254 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22256 chmod a+x signal_cmd
22257 $eunicefix signal_cmd
22261 : generate list of signal names
22262 case "$sig_num_init" in
22265 case "$sig_name_init" in
22267 *) case "$sig_num_init" in
22268 ''|*,*) doinit=yes ;;
22273 echo "Generating a list of signal names and numbers..." >&4
22275 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22276 sig_name=`$awk 'BEGIN { printf "ZERO " }
22277 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22278 sig_num=`$awk 'BEGIN { printf "0 " }
22279 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22280 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22281 !/^NSIG/ { printf "\"%s\", ", $1 }
22282 END { printf "0\n" }' signal.lst`
22283 sig_num_init=`$awk 'BEGIN { printf "0, " }
22284 !/^NSIG/ { printf "%d, ", $2}
22285 END { printf "0\n"}' signal.lst`
22288 echo "The following $sig_count signals are available:"
22290 echo $sig_name | $awk \
22291 'BEGIN { linelen = 0 }
22293 for (i = 1; i <= NF; i++) {
22294 name = "SIG" $i " "
22295 linelen = linelen + length(name)
22296 if (linelen > 70) {
22298 linelen = length(name)
22304 sig_size=`echo $sig_name | awk '{print NF}'`
22305 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22309 : Check size of size
22311 case "$sizetype" in
22312 *_t) zzz="$sizetype" ;;
22313 *) zzz="filesize" ;;
22315 echo "Checking the size of $zzz..." >&4
22317 #include <sys/types.h>
22319 #$i_stdlib I_STDLIB
22321 #include <stdlib.h>
22324 printf("%d\n", (int)sizeof($sizetype));
22329 if eval $compile_ok; then
22333 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22336 echo "Your $zzz size is $sizesize bytes."
22341 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22344 : check for socklen_t
22346 echo "Checking to see if you have socklen_t..." >&4
22348 #include <sys/types.h>
22349 #$d_socket HAS_SOCKET
22351 #include <sys/socket.h>
22353 int main() { socklen_t x = 16; }
22356 if eval $compile; then
22358 echo "You have socklen_t."
22361 echo "You do not have socklen_t."
22362 case "$sizetype" in
22363 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22370 : see if this is a socks.h system
22371 set socks.h i_socks
22374 : check for type of the size argument to socket calls
22375 case "$d_socket" in
22379 Checking to see what type is the last argument of accept().
22382 case "$d_socklen_t" in
22383 "$define") yyy="$yyy socklen_t"
22385 yyy="$yyy $sizetype int long unsigned"
22386 for xxx in $yyy; do
22387 case "$socksizetype" in
22388 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22389 case "$usesocks" in
22391 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22392 echo "Your system accepts '$xxx *' for the last argument of accept()."
22393 socksizetype="$xxx"
22396 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22397 echo "Your system accepts '$xxx *' for the last argument of accept()."
22398 socksizetype="$xxx"
22405 : In case none of those worked, prompt the user.
22406 case "$socksizetype" in
22407 '') rp='What is the type for socket address structure sizes?'
22414 *) : no sockets, so pick relatively harmless default
22419 : see what type is used for signed size_t
22420 set ssize_t ssizetype int stdio.h sys/types.h
22425 #$i_stdlib I_STDLIB
22427 #include <stdlib.h>
22429 #include <sys/types.h>
22430 #define Size_t $sizetype
22431 #define SSize_t $dflt
22434 if (sizeof(Size_t) == sizeof(SSize_t))
22436 else if (sizeof(Size_t) == sizeof(int))
22445 if eval $compile_ok && $run ./try > /dev/null; then
22446 ssizetype=`$run ./try`
22447 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22450 Help! I can't compile and run the ssize_t test program: please enlighten me!
22451 (This is probably a misconfiguration in your system or libraries, and
22452 you really ought to fix it. Still, I'll try anyway.)
22454 I need a type that is the same size as $sizetype, but is guaranteed to
22455 be signed. Common values are ssize_t, int and long.
22458 rp="What signed type is the same size as $sizetype?"
22464 : Check the size of st_ino
22466 $echo "Checking the size of st_ino..." >&4
22467 $cat > try.c <<EOCP
22468 #include <sys/stat.h>
22470 #$i_stdlib I_STDLIB
22472 #include <stdlib.h>
22476 printf("%d\n", (int)sizeof(st.st_ino));
22481 if eval $compile_ok; then
22485 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22487 *) st_ino_size=$val
22488 $echo "Your st_ino is $st_ino_size bytes long."
22493 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22497 : Check if st_ino is signed
22499 $echo "Checking the sign of st_ino..." >&4
22500 $cat > try.c <<EOCP
22501 #include <sys/stat.h>
22506 if (foo.st_ino < 0)
22513 if eval $compile; then
22517 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22519 *) st_ino_sign=$val
22520 case "$st_ino_sign" in
22521 1) $echo "Your st_ino is unsigned." ;;
22522 -1) $echo "Your st_ino is signed." ;;
22528 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22532 : see what type of char stdio uses.
22534 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22535 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22536 echo "Your stdio uses unsigned chars." >&4
22537 stdchar="unsigned char"
22539 echo "Your stdio uses signed chars." >&4
22544 : Check size of UID
22547 *_t) zzz="$uidtype" ;;
22550 echo "Checking the size of $zzz..." >&4
22552 #include <sys/types.h>
22554 #$i_stdlib I_STDLIB
22556 #include <stdlib.h>
22559 printf("%d\n", (int)sizeof($uidtype));
22564 if eval $compile_ok; then
22568 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22571 echo "Your $zzz is $uidsize bytes long."
22576 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22579 : Check if UID is signed
22582 *_t) zzz="$uidtype" ;;
22585 echo "Checking the sign of $zzz..." >&4
22587 #include <sys/types.h>
22598 if eval $compile; then
22602 echo "(I can't execute the test program--guessing unsigned.)" >&4
22606 1) echo "Your $zzz is unsigned." ;;
22607 -1) echo "Your $zzz is signed." ;;
22613 echo "(I can't compile the test program--guessing unsigned.)" >&4
22616 : Check format string for UID
22618 $echo "Checking the format string to be used for uids..." >&4
22621 -1) if $test X"$uidsize" = X"$ivsize"; then
22622 uidformat="$ivdformat"
22624 if $test X"$uidsize" = X"$longsize"; then
22627 if $test X"$uidsize" = X"$intsize"; then
22630 if $test X"$uidsize" = X"$shortsize"; then
22637 *) if $test X"$uidsize" = X"$uvsize"; then
22638 uidformat="$uvuformat"
22640 if $test X"$uidsize" = X"$longsize"; then
22643 if $test X"$uidsize" = X"$intsize"; then
22646 if $test X"$uidsize" = X"$shortsize"; then
22655 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22657 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22658 $cat >try.c <<'EOM'
22659 /* Intentionally a long probe as I'd like to sanity check that the exact
22660 approach is going to work, as thinking it will work, but only having it
22661 part working at runtime is worse than not having it. */
22663 #include <sys/types.h>
22664 #include <sys/sysctl.h>
22665 #include <sys/param.h>
22667 #include <string.h>
22668 #include <stdlib.h>
22669 #include <unistd.h>
22672 main(int argc, char **argv) {
22674 char *argv_leaf = strrchr(argv[0], '/');
22680 mib[1] = KERN_PROC;
22681 mib[2] = KERN_PROC_PATHNAME;
22685 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22689 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22694 if (size < strlen(argv_leaf) + 1) {
22695 fprintf(stderr, "size %lu is too short for a path\n",
22696 (unsigned long) size);
22700 if (size > MAXPATHLEN * MAXPATHLEN) {
22701 fprintf(stderr, "size %lu is too long for a path\n",
22702 (unsigned long) size);
22706 buffer = (char *)malloc(size);
22712 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22717 if (strlen(buffer) + 1 != size) {
22718 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22719 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22724 if (*buffer != '/') {
22725 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22729 if (strstr(buffer, "/./")) {
22730 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22734 if (strstr(buffer, "/../")) {
22735 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22739 buffer_leaf = strrchr(buffer, '/');
22740 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22741 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22753 if eval $compile; then
22754 if $run ./try; then
22755 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22758 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22762 echo "I'm unable to compile the test program." >&4
22763 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22767 set usekernprocpathname
22770 : Determine if we can use _NSGetExecutablePath to find executing program
22772 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22773 $cat >try.c <<'EOM'
22774 /* Intentionally a long probe as I'd like to sanity check that the exact
22775 approach is going to work, as thinking it will work, but only having it
22776 part working at runtime is worse than not having it. */
22777 #include <mach-o/dyld.h>
22779 #include <stdlib.h>
22780 #include <sys/param.h>
22781 #include <string.h>
22784 main(int argc, char **argv) {
22786 uint32_t size = sizeof(buf);
22790 char *argv_leaf = strrchr(argv[0], '/');
22794 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22798 _NSGetExecutablePath(buf, &size);
22799 if (size > MAXPATHLEN * MAXPATHLEN) {
22800 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22801 (unsigned int) size);
22805 buffer = (char *)malloc(size);
22811 result = _NSGetExecutablePath(buffer, &size);
22813 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22814 result, (unsigned int) size);
22818 tidied = realpath(buffer, NULL);
22820 perror("realpath");
22826 if (*tidied != '/') {
22827 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22831 if (strstr(tidied, "/./")) {
22832 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22836 if (strstr(tidied, "/../")) {
22837 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22841 tidied_leaf = strrchr(tidied, '/');
22842 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22843 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22855 if eval $compile; then
22856 if $run ./try; then
22857 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22860 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22863 echo "I'm unable to compile the test program." >&4
22864 echo "I'll assume no _NSGetExecutablePath here." >&4
22867 set usensgetexecutablepath
22870 : Check if site customization support was requested
22871 case "$usesitecustomize" in
22872 $define|true|[Yy]*)
22873 usesitecustomize="$define"
22876 usesitecustomize="$undef"
22880 : determine compiler compiler
22889 if $test -f "$byacc$_exe"; then
22891 comp="byacc or $comp"
22893 if $test -f "$bison$_exe"; then
22894 comp="$comp or bison -y"
22896 rp="Which compiler compiler ($comp) shall I use?"
22905 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22911 : see if this is a bfd.h system
22915 : see if this is an execinfo.h system
22916 set execinfo.h i_execinfo
22919 : see if this is a fenv.h system
22923 : see if this is a fp.h system
22927 : see if this is a fp_class.h system
22928 set fp_class.h i_fp_class
22931 : see if gdbm.h is available
22936 : see if gdbm_open exists
22937 set gdbm_open d_gdbm_open
22939 case "$d_gdbm_open" in
22942 echo "We won't be including <gdbm.h>"
22951 : see if this is a ieeefp.h system
22952 case "$i_ieeefp" in
22953 '' ) set ieeefp.h i_ieeefp
22958 : see if this is a libutil.h system
22959 set libutil.h i_libutil
22962 : see if mach cthreads are available
22963 if test "X$usethreads" = "X$define"; then
22964 set mach/cthreads.h i_machcthr
22967 i_machcthr="$undef"
22970 : see if this is a mntent.h system
22971 set mntent.h i_mntent
22974 : see if net/errno.h is available
22976 set net/errno.h val
22979 : Unfortunately, it causes problems on some systems. Arrgh.
22982 cat > try.c <<'EOM'
22985 #include <net/errno.h>
22991 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22992 echo "We'll be including <net/errno.h>." >&4
22994 echo "We won't be including <net/errno.h>." >&4
23003 : see if netinet/tcp.h is available
23004 set netinet/tcp.h i_netinettcp
23007 : see if this is a poll.h system
23011 : see if this is a prot.h system
23015 : Preprocessor symbols
23017 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23018 $cat <<'EOSH' > Cppsym.know
23019 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23020 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23021 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23022 arch_pwr ardent ARM ARM32 atarist att386 att3b
23023 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23024 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23025 byteorder byte_order
23026 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23027 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23028 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23029 ELF encore EPI EXTENSIONS
23030 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23031 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23032 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23033 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23034 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23035 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23036 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23037 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23038 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23040 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23041 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23042 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23044 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23045 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23046 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23047 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23048 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23049 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23050 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23051 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23052 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23053 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23054 ns32000 ns32016 ns32332 ns32k nsc32000
23055 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23056 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23057 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23058 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23060 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23061 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23062 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23063 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23064 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23065 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23066 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23067 SYSV4 SYSV5 sysV68 sysV88
23068 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23069 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23070 tower32_800 tower32_850 tss
23071 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23072 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23073 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23074 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23075 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23076 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23078 vax venix VMESA vms
23079 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23080 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23083 # Maybe put other stuff here too.
23084 ./tr '-' '_' <<EOSH >>Cppsym.know
23087 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23088 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23089 $cat Cppsym.know > Cppsym.c
23090 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23091 $rm -f Cppsym.a Cppsym.b Cppsym.c
23092 cat <<EOSH > Cppsym
23094 if $test \$# -gt 0; then
23095 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23096 if $test -s Cppsym.got; then
23103 $tr " " "$trnl" | ./Cppsym.try
23109 cat <<EOSH > Cppsym.try
23111 cat <<'EOCP' > try.c
23114 #define STRINGIFY(a) "a"
23116 #if cpp_stuff == 42
23117 #define StGiFy(a) #a
23118 #define STRINGIFY(a) StGiFy(a)
23120 #if $cpp_stuff != 1 && $cpp_stuff != 42
23121 # include "Bletch: How does this C preprocessor stringify macros?"
23127 cat <<'EOSH' >> Cppsym.try
23129 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23130 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23131 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23132 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23134 echo 'return 0;}' >> try.c
23136 cat <<EOSH >> Cppsym.try
23138 case "$osname-$gccversion" in
23139 irix-) ccflags="\$ccflags -woff 1178" ;;
23140 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23142 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23144 chmod +x Cppsym.try
23145 $eunicefix Cppsym.try
23146 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23147 : Add in any Linux cpp "predefined macros":
23148 case "$osname::$gccversion" in
23149 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23151 rm -f $tHdrH'.h' $tHdrH
23153 # Filter out macro arguments, such as Linux's __INT8_C(c)
23154 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23155 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23156 if [ -s $tHdrH'_cppsym.real' ]; then
23157 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23160 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23163 : now check the C compiler for additional symbols
23164 postprocess_cc_v=''
23166 aix) postprocess_cc_v="|$tr , ' '" ;;
23173 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23176 -D*) echo "\$i" | $sed 's/^-D//';;
23177 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23182 postprocess_cc_v=''
23185 ./ccsym > ccsym1.raw
23186 if $test -s ccsym1.raw; then
23187 $sort ccsym1.raw | $uniq >ccsym.raw
23189 mv ccsym1.raw ccsym.raw
23192 $awk '/\=/ { print $0; next }
23193 { print $0"=1" }' ccsym.raw >ccsym.list
23194 $comm -13 Cppsym.true ccsym.list >ccsym.own
23195 $comm -12 Cppsym.true ccsym.list >ccsym.com
23196 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23198 if $test -z ccsym.raw; then
23199 echo "Your C compiler doesn't seem to define any symbols!" >&4
23201 echo "However, your C preprocessor defines the following symbols:"
23204 cppsymbols=`$cat Cppsym.true`
23205 cppsymbols=`echo $cppsymbols`
23206 cppccsymbols="$cppsymbols"
23208 if $test -s ccsym.com; then
23209 echo "Your C compiler and pre-processor define these symbols:"
23210 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23213 cppccsymbols=`$cat ccsym.com`
23214 cppccsymbols=`echo $cppccsymbols`
23215 $test "$silent" || sleep 1
23217 if $test -s ccsym.cpp; then
23218 $test "$also" && echo " "
23219 echo "Your C pre-processor ${also}defines the following symbols:"
23220 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23222 cppsymbols=`$cat ccsym.cpp`
23223 cppsymbols=`echo $cppsymbols`
23224 $test "$silent" || sleep 1
23226 if $test -s ccsym.own; then
23227 $test "$also" && echo " "
23228 echo "Your C compiler ${also}defines the following cpp symbols:"
23229 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23230 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23231 ccsymbols=`$cat ccsym.own`
23232 ccsymbols=`echo $ccsymbols`
23233 $test "$silent" || sleep 1
23237 : add -D_FORTIFY_SOURCE if feasible and not already there
23238 case "$gccversion" in
23239 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
23240 *-O*) case "$ccflags$cppsymbols" in
23241 *_FORTIFY_SOURCE=*) # Don't add it again.
23242 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23244 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23245 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23249 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23253 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23257 : script used to emit important warnings
23260 if test \$# -gt 0; then
23265 echo "*** WARNING:" >&4
23266 sed -e 's/^/*** /' <msg >&4
23268 cat msg >>config.msg
23269 echo " " >>config.msg
23275 : see if this is a termio system
23279 if $test `./findhdr termios.h`; then
23280 set tcsetattr i_termios
23286 "$define") echo "You have POSIX termios.h... good!" >&4;;
23287 *) if ./Cppsym pyr; then
23288 case "`$run /bin/universe`" in
23289 ucb) if $test `./findhdr sgtty.h`; then
23291 echo "<sgtty.h> found." >&4
23293 echo "System is pyramid with BSD universe."
23294 ./warn "<sgtty.h> not found--you could have problems."
23296 *) if $test `./findhdr termio.h`; then
23298 echo "<termio.h> found." >&4
23300 echo "System is pyramid with USG universe."
23301 ./warn "<termio.h> not found--you could have problems."
23305 if $test `./findhdr termio.h`; then
23306 echo "<termio.h> found." >&4
23308 elif $test `./findhdr sgtty.h`; then
23309 echo "<sgtty.h> found." >&4
23312 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23315 if $test `./findhdr sgtty.h`; then
23316 echo "<sgtty.h> found." >&4
23318 elif $test `./findhdr termio.h`; then
23319 echo "<termio.h> found." >&4
23322 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23326 set i_termio; eval $setvar
23327 val=$val2; set i_sgtty; eval $setvar
23328 val=$val3; set i_termios; eval $setvar
23330 : see if stdbool is available
23331 : we want a real compile instead of Inhdr because some Solaris systems
23332 : have stdbool.h, but it can only be used if the compiler indicates it
23333 : is sufficiently c99-compliant.
23337 #include <stdbool.h>
23342 int main(int argc, char **argv)
23348 if eval $compile; then
23349 echo "<stdbool.h> found." >&4
23352 echo "<stdbool.h> NOT found." >&4
23359 : see if stdint is available
23360 set stdint.h i_stdint
23363 : see if sys/access.h is available
23364 set sys/access.h i_sysaccess
23367 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23368 set sys/filio.h i_sysfilio
23371 if $test `./findhdr sys/ioctl.h`; then
23373 echo '<sys/ioctl.h> found.' >&4
23376 if $test $i_sysfilio = "$define"; then
23377 echo '<sys/ioctl.h> NOT found.' >&4
23379 $test $i_sgtty = "$define" && xxx="sgtty.h"
23380 $test $i_termio = "$define" && xxx="termio.h"
23381 $test $i_termios = "$define" && xxx="termios.h"
23382 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23388 : see if socket ioctl defs are in sys/sockio.h
23390 xxx=`./findhdr sys/sockio.h`
23391 if $test "$xxx"; then
23392 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23394 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23397 echo "No socket ioctls found in <sys/sockio.h>." >&4
23402 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23408 : see if this is a syslog.h system
23409 set syslog.h i_syslog
23412 : see if this is a sys/mode.h system
23413 set sys/mode.h i_sysmode
23416 : see if there is a sys/poll.h file
23417 set sys/poll.h i_syspoll
23420 : see if sys/resource.h has to be included
23421 set sys/resource.h i_sysresrc
23424 : see if sys/security.h is available
23425 set sys/security.h i_syssecrt
23428 : see if this is a sys/statvfs.h system
23429 set sys/statvfs.h i_sysstatvfs
23432 : see if this is a sys/un.h system
23433 set sys/un.h i_sysun
23436 : see if this is a sys/utsname.h system
23437 set sys/utsname.h i_sysutsname
23440 : see if this is a syswait system
23441 set sys/wait.h i_syswait
23444 : see if this is a ustat.h system
23445 set ustat.h i_ustat
23448 : see if this is an utime system
23449 set utime.h i_utime
23452 : see if this is a vfork system
23455 set vfork.h i_vfork
23463 : see if wchar.h is present
23464 set wchar.h i_wchar
23469 echo "Looking for extensions..." >&4
23470 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23471 : contain old or inaccurate or duplicate values.
23472 nonxs_extensions=''
23474 : We do not use find because it might not be available.
23475 : We do not just use MANIFEST because the user may have dropped
23476 : some additional extensions into the source tree and expect them
23479 : Function to recursively find available extensions, ignoring DynaLoader
23480 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23481 : In 5.10.1 and later, extensions are stored in directories
23482 : like File-Glob instead of the older File/Glob/.
23486 DynaLoader|dynaload) ;;
23488 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23489 case "$this_ext" in
23490 Scalar/List/Utils) this_ext="List/Util" ;;
23491 PathTools) this_ext="Cwd" ;;
23493 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23494 if $contains " $this_ext " "$tdir/$$.tmp"; then
23496 echo "Duplicate directories detected for extension $xxx" >&4;
23497 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23498 case "$knowitall" in
23506 echo "Ok. Stopping Configure." >&4;
23507 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23510 echo "Ok. You will need to correct config.sh before running make." >&4;
23512 $ls -1 "$xxx" > "$tdir/$$.tmp";
23513 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23514 xs_extensions="$xs_extensions $this_ext";
23515 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23516 xs_extensions="$xs_extensions $this_ext";
23517 elif $test -d "$xxx"; then
23518 nonxs_extensions="$nonxs_extensions $this_ext";
23520 $rm -f "$tdir/$$.tmp";
23528 eval $find_extensions
23532 eval $find_extensions
23536 eval $find_extensions
23537 set X $xs_extensions
23539 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23540 set X $nonxs_extensions
23542 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23544 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23546 : Now see which are supported on this system.
23548 for xxx in $xs_extensions ; do
23552 amigaos) avail_ext="$avail_ext $xxx" ;;
23557 $define) avail_ext="$avail_ext $xxx" ;;
23560 GDBM_File|gdbm_fil)
23562 $define) avail_ext="$avail_ext $xxx" ;;
23566 : XXX Do we need a useipcsysv variable here
23567 case "${d_msg}${d_sem}${d_shm}" in
23568 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23571 NDBM_File|ndbm_fil)
23574 case "$osname-$use64bitint" in
23577 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23580 *) avail_ext="$avail_ext $xxx" ;;
23585 ODBM_File|odbm_fil)
23586 case "${i_dbm}${i_rpcsvcdbm}" in
23588 case "$d_cplusplus" in
23589 define) ;; # delete as a function name will not work
23590 *) case "$osname-$use64bitint" in
23593 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23596 *) avail_ext="$avail_ext $xxx" ;;
23604 case "$useopcode" in
23605 true|define|y) avail_ext="$avail_ext $xxx" ;;
23609 case "$useposix" in
23610 true|define|y) avail_ext="$avail_ext $xxx" ;;
23614 case "$d_socket" in
23615 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23618 I18N/Langinfo|langinfo)
23619 case "$uselanginfo" in
23620 true|define|y) avail_ext="$avail_ext $xxx" ;;
23623 Sys/Syslog|sys/syslog)
23625 amigaos) ;; # not really very useful on AmigaOS
23627 : XXX syslog requires socket
23628 case "$d_socket" in
23629 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23635 case "$usethreads" in
23637 case "$use5005threads" in
23638 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23642 threads|threads/shared)
23643 # threads and threads::shared are special cases.
23644 # To stop people from asking "Perl 5.8.0 was supposed
23645 # to have this new fancy threads implementation but my
23646 # perl doesn't have it" and from people trying to
23647 # (re)install the threads module using CPAN.pm and
23648 # CPAN.pm then offering to reinstall Perl 5.8.0,
23649 # the threads.pm and threads/shared.pm will always be
23650 # there, croaking informatively ("you need to rebuild
23651 # all of Perl with threads, sorry") when threads haven't
23652 # been compiled in.
23654 avail_ext="$avail_ext $xxx"
23660 cygwin) avail_ext="$avail_ext $xxx" ;;
23663 XS/APItest|xs/apitest)
23664 # This is just for testing. Skip it unless we have dynamic loading.
23667 $define) avail_ext="$avail_ext $xxx" ;;
23670 XS/Typemap|xs/typemap)
23671 # This is just for testing. Skip it unless we have dynamic loading.
23673 $define) avail_ext="$avail_ext $xxx" ;;
23676 *) avail_ext="$avail_ext $xxx"
23685 case "$onlyextensions" in
23687 *) keepextensions=''
23688 echo "You have requested that only certain extensions be included..." >&4
23689 for i in $onlyextensions; do
23690 case " $avail_ext " in
23692 echo "Keeping extension $i."
23693 keepextensions="$keepextensions $i"
23695 *) echo "Ignoring extension $i." ;;
23698 avail_ext="$keepextensions"
23702 case "$noextensions" in
23704 *) keepextensions=''
23705 echo "You have requested that certain extensions be ignored..." >&4
23706 for i in $avail_ext; do
23707 case " $noextensions " in
23708 *" $i "*) echo "Ignoring extension $i." ;;
23709 *) echo "Keeping extension $i.";
23710 keepextensions="$keepextensions $i"
23714 avail_ext="$keepextensions"
23718 : Now see which nonxs extensions are supported on this system.
23719 : For now assume all are.
23721 for xxx in $nonxs_extensions ; do
23725 *) nonxs_ext="$nonxs_ext $xxx"
23737 A number of extensions are supplied with $package. You may choose to
23738 compile these extensions for dynamic loading (the default), compile
23739 them into the $package executable (static loading), or not include
23740 them at all. Answer "none" to include no extensions.
23741 Note that DynaLoader is always built and need not be mentioned here.
23744 case "$dynamic_ext" in
23746 : Exclude those listed in static_ext
23748 for xxx in $avail_ext; do
23749 case " $static_ext " in
23751 *) dflt="$dflt $xxx" ;;
23758 *) dflt="$dynamic_ext"
23759 # Perhaps we are reusing an old out-of-date config.sh.
23762 if test X"$dynamic_ext" != X"$avail_ext"; then
23764 NOTICE: Your previous config.sh list may be incorrect.
23765 The extensions now available to you are
23767 but the default list from your previous config.sh is
23779 rp="What extensions do you wish to load dynamically?"
23782 none) dynamic_ext=' ' ;;
23783 *) dynamic_ext="$ans" ;;
23786 case "$static_ext" in
23788 : Exclude those already listed in dynamic linking
23790 for xxx in $avail_ext; do
23791 case " $dynamic_ext " in
23793 *) dflt="$dflt $xxx" ;;
23800 *) dflt="$static_ext"
23807 rp="What extensions do you wish to load statically?"
23810 none) static_ext=' ' ;;
23811 *) static_ext="$ans" ;;
23816 A number of extensions are supplied with $package. Answer "none"
23817 to include no extensions.
23818 Note that DynaLoader is always built and need not be mentioned here.
23821 case "$static_ext" in
23822 '') dflt="$avail_ext" ;;
23823 *) dflt="$static_ext"
23824 # Perhaps we are reusing an old out-of-date config.sh.
23827 if test X"$static_ext" != X"$avail_ext"; then
23829 NOTICE: Your previous config.sh list may be incorrect.
23830 The extensions now available to you are
23832 but the default list from your previous config.sh is
23841 : Exclude those that are not xs extensions
23845 rp="What extensions do you wish to include?"
23848 none) static_ext=' ' ;;
23849 *) static_ext="$ans" ;;
23854 # Encode is a special case. If we are building Encode as a static
23855 # extension, we need to explicitly list its subextensions as well.
23856 # For other nested extensions, this is handled automatically by
23857 # the appropriate Makefile.PL.
23858 case " $static_ext " in
23859 *" Encode "*) # Add the subextensions of Encode
23861 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23862 static_ext="$static_ext Encode/$xxx"
23863 known_extensions="$known_extensions Encode/$xxx"
23869 set X $dynamic_ext $static_ext $nonxs_ext
23873 # Sanity check: We require an extension suitable for use with
23874 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23875 # should show up as failures in the test suite, but it's helpful to
23876 # catch them now.) The 'extensions' list is normally sorted
23877 # alphabetically, so we need to accept either
23878 # DB_File ... Fcntl ... IO ....
23879 # or something like
23880 # Fcntl ... NDBM_File ... IO ....
23881 case " $extensions" in
23882 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23883 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23884 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23885 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23886 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23890 : Remove libraries needed only for extensions
23891 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23892 : The exception is SunOS 4.x, which needs them.
23893 case "${osname}X${osvers}" in
23897 *) case "$usedl" in
23898 $define|true|[yY]*)
23899 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23903 *) perllibs="$libs"
23909 : Remove build directory name from cppstdin so it can be used from
23910 : either the present location or the final installed location.
23912 : Get out of the UU directory to get correct path name.
23914 case "$cppstdin" in
23916 echo "Stripping down cppstdin path name"
23922 : end of configuration questions
23924 echo "End of configuration questions."
23927 : back to where it started
23928 if test -d ../UU; then
23932 : configuration may be unconditionally patched via a 'config.arch' file
23933 if $test -f config.arch; then
23934 echo "I see a config.arch file, loading it." >&4
23938 : configuration may be patched via a 'config.over' file
23939 if $test -f config.over; then
23942 rp='I see a config.over file. Do you wish to load it?'
23945 n*) echo "OK, I'll ignore it.";;
23947 echo "Configuration override changes have been loaded."
23952 : in case they want portability, strip down executable paths
23953 case "$d_portable" in
23956 echo "Stripping down executable paths..." >&4
23957 for file in $loclist $trylist; do
23959 eval $file=`basename $temp`
23964 : create config.sh file
23966 echo "Creating config.sh..." >&4
23967 $spitshell <<EOT >config.sh
23970 # This file was produced by running the Configure script. It holds all the
23971 # definitions figured out by Configure. Should you modify one of these values,
23972 # do not forget to propagate your changes by running "Configure -der". You may
23973 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23976 # Package name : $package
23977 # Source directory : $src
23978 # Configuration time: $cf_time
23979 # Configured by : $cf_by
23980 # Target system : $myuname
23983 : Add in command line options if available
23984 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23986 $spitshell <<EOT >>config.sh
23995 Revision='$Revision'
24003 alignbytes='$alignbytes'
24004 aphostname='$aphostname'
24005 api_revision='$api_revision'
24006 api_subversion='$api_subversion'
24007 api_version='$api_version'
24008 api_versionstring='$api_versionstring'
24011 archlibexp='$archlibexp'
24012 archname64='$archname64'
24013 archname='$archname'
24014 archobjs='$archobjs'
24015 asctime_r_proto='$asctime_r_proto'
24024 byteorder='$byteorder'
24026 castflags='$castflags'
24029 cccdlflags='$cccdlflags'
24030 ccdlflags='$ccdlflags'
24032 ccflags_uselargefiles='$ccflags_uselargefiles'
24034 ccsymbols='$ccsymbols'
24035 ccversion='$ccversion'
24037 cf_email='$cf_email'
24039 charbits='$charbits'
24040 charsize='$charsize'
24044 clocktype='$clocktype'
24046 compress='$compress'
24047 contains='$contains'
24051 cpp_stuff='$cpp_stuff'
24052 cppccsymbols='$cppccsymbols'
24053 cppflags='$cppflags'
24055 cppminus='$cppminus'
24057 cppstdin='$cppstdin'
24058 cppsymbols='$cppsymbols'
24059 crypt_r_proto='$crypt_r_proto'
24060 cryptlib='$cryptlib'
24062 ctermid_r_proto='$ctermid_r_proto'
24063 ctime_r_proto='$ctime_r_proto'
24064 d_Gconvert='$d_Gconvert'
24065 d_PRIEUldbl='$d_PRIEUldbl'
24066 d_PRIFUldbl='$d_PRIFUldbl'
24067 d_PRIGUldbl='$d_PRIGUldbl'
24068 d_PRIXU64='$d_PRIXU64'
24069 d_PRId64='$d_PRId64'
24070 d_PRIeldbl='$d_PRIeldbl'
24071 d_PRIfldbl='$d_PRIfldbl'
24072 d_PRIgldbl='$d_PRIgldbl'
24073 d_PRIi64='$d_PRIi64'
24074 d_PRIo64='$d_PRIo64'
24075 d_PRIu64='$d_PRIu64'
24076 d_PRIx64='$d_PRIx64'
24077 d_SCNfldbl='$d_SCNfldbl'
24078 d__fwalk='$d__fwalk'
24079 d_accept4='$d_accept4'
24080 d_access='$d_access'
24081 d_accessx='$d_accessx'
24085 d_archlib='$d_archlib'
24086 d_asctime64='$d_asctime64'
24087 d_asctime_r='$d_asctime_r'
24092 d_attribute_always_inline='$d_attribute_always_inline'
24093 d_attribute_deprecated='$d_attribute_deprecated'
24094 d_attribute_format='$d_attribute_format'
24095 d_attribute_malloc='$d_attribute_malloc'
24096 d_attribute_nonnull='$d_attribute_nonnull'
24097 d_attribute_noreturn='$d_attribute_noreturn'
24098 d_attribute_pure='$d_attribute_pure'
24099 d_attribute_unused='$d_attribute_unused'
24100 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24101 d_backtrace='$d_backtrace'
24103 d_bsdgetpgrp='$d_bsdgetpgrp'
24104 d_bsdsetpgrp='$d_bsdsetpgrp'
24105 d_builtin_add_overflow='$d_builtin_add_overflow'
24106 d_builtin_choose_expr='$d_builtin_choose_expr'
24107 d_builtin_expect='$d_builtin_expect'
24108 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24109 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24110 d_c99_variadic_macros='$d_c99_variadic_macros'
24111 d_casti32='$d_casti32'
24112 d_castneg='$d_castneg'
24115 d_chroot='$d_chroot'
24116 d_chsize='$d_chsize'
24118 d_clearenv='$d_clearenv'
24119 d_closedir='$d_closedir'
24120 d_cmsghdr_s='$d_cmsghdr_s'
24121 d_copysign='$d_copysign'
24122 d_copysignl='$d_copysignl'
24123 d_cplusplus='$d_cplusplus'
24125 d_crypt_r='$d_crypt_r'
24127 d_ctermid='$d_ctermid'
24128 d_ctermid_r='$d_ctermid_r'
24129 d_ctime64='$d_ctime64'
24130 d_ctime_r='$d_ctime_r'
24131 d_cuserid='$d_cuserid'
24132 d_dbminitproto='$d_dbminitproto'
24133 d_difftime64='$d_difftime64'
24134 d_difftime='$d_difftime'
24135 d_dir_dd_fd='$d_dir_dd_fd'
24137 d_dirnamlen='$d_dirnamlen'
24138 d_dladdr='$d_dladdr'
24139 d_dlerror='$d_dlerror'
24140 d_dlopen='$d_dlopen'
24141 d_dlsymun='$d_dlsymun'
24142 d_dosuid='$d_dosuid'
24143 d_double_has_inf='$d_double_has_inf'
24144 d_double_has_nan='$d_double_has_nan'
24145 d_double_has_negative_zero='$d_double_has_negative_zero'
24146 d_double_has_subnormals='$d_double_has_subnormals'
24147 d_double_style_cray='$d_double_style_cray'
24148 d_double_style_ibm='$d_double_style_ibm'
24149 d_double_style_ieee='$d_double_style_ieee'
24150 d_double_style_vax='$d_double_style_vax'
24151 d_drand48_r='$d_drand48_r'
24152 d_drand48proto='$d_drand48proto'
24155 d_duplocale='$d_duplocale'
24156 d_eaccess='$d_eaccess'
24157 d_endgrent='$d_endgrent'
24158 d_endgrent_r='$d_endgrent_r'
24159 d_endhent='$d_endhent'
24160 d_endhostent_r='$d_endhostent_r'
24161 d_endnent='$d_endnent'
24162 d_endnetent_r='$d_endnetent_r'
24163 d_endpent='$d_endpent'
24164 d_endprotoent_r='$d_endprotoent_r'
24165 d_endpwent='$d_endpwent'
24166 d_endpwent_r='$d_endpwent_r'
24167 d_endsent='$d_endsent'
24168 d_endservent_r='$d_endservent_r'
24169 d_eofnblk='$d_eofnblk'
24172 d_eunice='$d_eunice'
24175 d_faststdio='$d_faststdio'
24176 d_fchdir='$d_fchdir'
24177 d_fchmod='$d_fchmod'
24178 d_fchmodat='$d_fchmodat'
24179 d_fchown='$d_fchown'
24181 d_fcntl_can_lock='$d_fcntl_can_lock'
24182 d_fd_macros='$d_fd_macros'
24183 d_fd_set='$d_fd_set'
24184 d_fdclose='$d_fdclose'
24186 d_fds_bits='$d_fds_bits'
24187 d_fegetround='$d_fegetround'
24188 d_fgetpos='$d_fgetpos'
24189 d_finite='$d_finite'
24190 d_finitel='$d_finitel'
24191 d_flexfnam='$d_flexfnam'
24193 d_flockproto='$d_flockproto'
24198 d_fp_class='$d_fp_class'
24199 d_fp_classify='$d_fp_classify'
24200 d_fp_classl='$d_fp_classl'
24201 d_fpathconf='$d_fpathconf'
24202 d_fpclass='$d_fpclass'
24203 d_fpclassify='$d_fpclassify'
24204 d_fpclassl='$d_fpclassl'
24205 d_fpgetround='$d_fpgetround'
24206 d_fpos64_t='$d_fpos64_t'
24207 d_freelocale='$d_freelocale'
24208 d_frexpl='$d_frexpl'
24209 d_fs_data_s='$d_fs_data_s'
24210 d_fseeko='$d_fseeko'
24211 d_fsetpos='$d_fsetpos'
24212 d_fstatfs='$d_fstatfs'
24213 d_fstatvfs='$d_fstatvfs'
24215 d_ftello='$d_ftello'
24217 d_futimes='$d_futimes'
24218 d_gai_strerror='$d_gai_strerror'
24219 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24220 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24221 d_getaddrinfo='$d_getaddrinfo'
24222 d_getcwd='$d_getcwd'
24223 d_getespwnam='$d_getespwnam'
24224 d_getfsstat='$d_getfsstat'
24225 d_getgrent='$d_getgrent'
24226 d_getgrent_r='$d_getgrent_r'
24227 d_getgrgid_r='$d_getgrgid_r'
24228 d_getgrnam_r='$d_getgrnam_r'
24229 d_getgrps='$d_getgrps'
24230 d_gethbyaddr='$d_gethbyaddr'
24231 d_gethbyname='$d_gethbyname'
24232 d_gethent='$d_gethent'
24233 d_gethname='$d_gethname'
24234 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24235 d_gethostbyname_r='$d_gethostbyname_r'
24236 d_gethostent_r='$d_gethostent_r'
24237 d_gethostprotos='$d_gethostprotos'
24238 d_getitimer='$d_getitimer'
24239 d_getlogin='$d_getlogin'
24240 d_getlogin_r='$d_getlogin_r'
24241 d_getmnt='$d_getmnt'
24242 d_getmntent='$d_getmntent'
24243 d_getnameinfo='$d_getnameinfo'
24244 d_getnbyaddr='$d_getnbyaddr'
24245 d_getnbyname='$d_getnbyname'
24246 d_getnent='$d_getnent'
24247 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24248 d_getnetbyname_r='$d_getnetbyname_r'
24249 d_getnetent_r='$d_getnetent_r'
24250 d_getnetprotos='$d_getnetprotos'
24251 d_getpagsz='$d_getpagsz'
24252 d_getpbyname='$d_getpbyname'
24253 d_getpbynumber='$d_getpbynumber'
24254 d_getpent='$d_getpent'
24255 d_getpgid='$d_getpgid'
24256 d_getpgrp2='$d_getpgrp2'
24257 d_getpgrp='$d_getpgrp'
24258 d_getppid='$d_getppid'
24259 d_getprior='$d_getprior'
24260 d_getprotobyname_r='$d_getprotobyname_r'
24261 d_getprotobynumber_r='$d_getprotobynumber_r'
24262 d_getprotoent_r='$d_getprotoent_r'
24263 d_getprotoprotos='$d_getprotoprotos'
24264 d_getprpwnam='$d_getprpwnam'
24265 d_getpwent='$d_getpwent'
24266 d_getpwent_r='$d_getpwent_r'
24267 d_getpwnam_r='$d_getpwnam_r'
24268 d_getpwuid_r='$d_getpwuid_r'
24269 d_getsbyname='$d_getsbyname'
24270 d_getsbyport='$d_getsbyport'
24271 d_getsent='$d_getsent'
24272 d_getservbyname_r='$d_getservbyname_r'
24273 d_getservbyport_r='$d_getservbyport_r'
24274 d_getservent_r='$d_getservent_r'
24275 d_getservprotos='$d_getservprotos'
24276 d_getspnam='$d_getspnam'
24277 d_getspnam_r='$d_getspnam_r'
24278 d_gettimeod='$d_gettimeod'
24279 d_gmtime64='$d_gmtime64'
24280 d_gmtime_r='$d_gmtime_r'
24281 d_gnulibc='$d_gnulibc'
24282 d_grpasswd='$d_grpasswd'
24283 d_has_C_UTF8='$d_has_C_UTF8'
24284 d_hasmntopt='$d_hasmntopt'
24288 d_ilogbl='$d_ilogbl'
24289 d_inc_version_list='$d_inc_version_list'
24290 d_inetaton='$d_inetaton'
24291 d_inetntop='$d_inetntop'
24292 d_inetpton='$d_inetpton'
24293 d_int64_t='$d_int64_t'
24294 d_ip_mreq='$d_ip_mreq'
24295 d_ip_mreq_source='$d_ip_mreq_source'
24296 d_ipv6_mreq='$d_ipv6_mreq'
24297 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24298 d_isascii='$d_isascii'
24299 d_isblank='$d_isblank'
24300 d_isfinite='$d_isfinite'
24301 d_isfinitel='$d_isfinitel'
24303 d_isinfl='$d_isinfl'
24304 d_isless='$d_isless'
24306 d_isnanl='$d_isnanl'
24307 d_isnormal='$d_isnormal'
24310 d_killpg='$d_killpg'
24311 d_lc_monetary_2008='$d_lc_monetary_2008'
24312 d_lchown='$d_lchown'
24313 d_ldbl_dig='$d_ldbl_dig'
24314 d_ldexpl='$d_ldexpl'
24315 d_lgamma='$d_lgamma'
24316 d_lgamma_r='$d_lgamma_r'
24317 d_libm_lib_version='$d_libm_lib_version'
24318 d_libname_unique='$d_libname_unique'
24320 d_linkat='$d_linkat'
24321 d_llrint='$d_llrint'
24322 d_llrintl='$d_llrintl'
24323 d_llround='$d_llround'
24324 d_llroundl='$d_llroundl'
24325 d_localeconv_l='$d_localeconv_l'
24326 d_localtime64='$d_localtime64'
24327 d_localtime_r='$d_localtime_r'
24328 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24329 d_locconv='$d_locconv'
24334 d_long_double_style_ieee='$d_long_double_style_ieee'
24335 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24336 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24337 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24338 d_long_double_style_vax='$d_long_double_style_vax'
24339 d_longdbl='$d_longdbl'
24340 d_longlong='$d_longlong'
24342 d_lrintl='$d_lrintl'
24343 d_lround='$d_lround'
24344 d_lroundl='$d_lroundl'
24345 d_lseekproto='$d_lseekproto'
24347 d_madvise='$d_madvise'
24348 d_malloc_good_size='$d_malloc_good_size'
24349 d_malloc_size='$d_malloc_size'
24350 d_malloc_usable_size='$d_malloc_usable_size'
24352 d_mbrlen='$d_mbrlen'
24353 d_mbrtowc='$d_mbrtowc'
24354 d_mbstowcs='$d_mbstowcs'
24355 d_mbtowc='$d_mbtowc'
24356 d_memmem='$d_memmem'
24357 d_memrchr='$d_memrchr'
24359 d_mkdtemp='$d_mkdtemp'
24360 d_mkfifo='$d_mkfifo'
24361 d_mkostemp='$d_mkostemp'
24362 d_mkstemp='$d_mkstemp'
24363 d_mkstemps='$d_mkstemps'
24364 d_mktime64='$d_mktime64'
24365 d_mktime='$d_mktime'
24368 d_modflproto='$d_modflproto'
24369 d_mprotect='$d_mprotect'
24371 d_msg_ctrunc='$d_msg_ctrunc'
24372 d_msg_dontroute='$d_msg_dontroute'
24373 d_msg_oob='$d_msg_oob'
24374 d_msg_peek='$d_msg_peek'
24375 d_msg_proxy='$d_msg_proxy'
24376 d_msgctl='$d_msgctl'
24377 d_msgget='$d_msgget'
24378 d_msghdr_s='$d_msghdr_s'
24379 d_msgrcv='$d_msgrcv'
24380 d_msgsnd='$d_msgsnd'
24382 d_munmap='$d_munmap'
24383 d_mymalloc='$d_mymalloc'
24385 d_nanosleep='$d_nanosleep'
24387 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24388 d_nearbyint='$d_nearbyint'
24389 d_newlocale='$d_newlocale'
24390 d_nextafter='$d_nextafter'
24391 d_nexttoward='$d_nexttoward'
24393 d_nl_langinfo='$d_nl_langinfo'
24394 d_nv_preserves_uv='$d_nv_preserves_uv'
24395 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24396 d_off64_t='$d_off64_t'
24397 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24398 d_oldpthreads='$d_oldpthreads'
24399 d_oldsock='$d_oldsock'
24401 d_openat='$d_openat'
24402 d_pathconf='$d_pathconf'
24404 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24405 d_phostname='$d_phostname'
24409 d_portable='$d_portable'
24411 d_prctl_set_name='$d_prctl_set_name'
24412 d_printf_format_null='$d_printf_format_null'
24413 d_procselfexe='$d_procselfexe'
24414 d_pseudofork='$d_pseudofork'
24415 d_pthread_atfork='$d_pthread_atfork'
24416 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24417 d_pthread_yield='$d_pthread_yield'
24418 d_ptrdiff_t='$d_ptrdiff_t'
24420 d_pwchange='$d_pwchange'
24421 d_pwclass='$d_pwclass'
24422 d_pwcomment='$d_pwcomment'
24423 d_pwexpire='$d_pwexpire'
24424 d_pwgecos='$d_pwgecos'
24425 d_pwpasswd='$d_pwpasswd'
24426 d_pwquota='$d_pwquota'
24429 d_querylocale='$d_querylocale'
24430 d_random_r='$d_random_r'
24431 d_re_comp='$d_re_comp'
24432 d_readdir64_r='$d_readdir64_r'
24433 d_readdir='$d_readdir'
24434 d_readdir_r='$d_readdir_r'
24435 d_readlink='$d_readlink'
24437 d_recvmsg='$d_recvmsg'
24438 d_regcmp='$d_regcmp'
24439 d_regcomp='$d_regcomp'
24440 d_remainder='$d_remainder'
24441 d_remquo='$d_remquo'
24442 d_rename='$d_rename'
24443 d_renameat='$d_renameat'
24444 d_rewinddir='$d_rewinddir'
24448 d_sbrkproto='$d_sbrkproto'
24449 d_scalbn='$d_scalbn'
24450 d_scalbnl='$d_scalbnl'
24451 d_sched_yield='$d_sched_yield'
24452 d_scm_rights='$d_scm_rights'
24453 d_seekdir='$d_seekdir'
24454 d_select='$d_select'
24456 d_semctl='$d_semctl'
24457 d_semctl_semid_ds='$d_semctl_semid_ds'
24458 d_semctl_semun='$d_semctl_semun'
24459 d_semget='$d_semget'
24461 d_sendmsg='$d_sendmsg'
24462 d_setegid='$d_setegid'
24463 d_seteuid='$d_seteuid'
24464 d_setgrent='$d_setgrent'
24465 d_setgrent_r='$d_setgrent_r'
24466 d_setgrps='$d_setgrps'
24467 d_sethent='$d_sethent'
24468 d_sethostent_r='$d_sethostent_r'
24469 d_setitimer='$d_setitimer'
24470 d_setlinebuf='$d_setlinebuf'
24471 d_setlocale='$d_setlocale'
24472 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24473 d_setlocale_r='$d_setlocale_r'
24474 d_setnent='$d_setnent'
24475 d_setnetent_r='$d_setnetent_r'
24476 d_setpent='$d_setpent'
24477 d_setpgid='$d_setpgid'
24478 d_setpgrp2='$d_setpgrp2'
24479 d_setpgrp='$d_setpgrp'
24480 d_setprior='$d_setprior'
24481 d_setproctitle='$d_setproctitle'
24482 d_setprotoent_r='$d_setprotoent_r'
24483 d_setpwent='$d_setpwent'
24484 d_setpwent_r='$d_setpwent_r'
24485 d_setregid='$d_setregid'
24486 d_setresgid='$d_setresgid'
24487 d_setresuid='$d_setresuid'
24488 d_setreuid='$d_setreuid'
24489 d_setrgid='$d_setrgid'
24490 d_setruid='$d_setruid'
24491 d_setsent='$d_setsent'
24492 d_setservent_r='$d_setservent_r'
24493 d_setsid='$d_setsid'
24494 d_setvbuf='$d_setvbuf'
24497 d_shmatprototype='$d_shmatprototype'
24498 d_shmctl='$d_shmctl'
24500 d_shmget='$d_shmget'
24501 d_sigaction='$d_sigaction'
24502 d_siginfo_si_addr='$d_siginfo_si_addr'
24503 d_siginfo_si_band='$d_siginfo_si_band'
24504 d_siginfo_si_errno='$d_siginfo_si_errno'
24505 d_siginfo_si_fd='$d_siginfo_si_fd'
24506 d_siginfo_si_pid='$d_siginfo_si_pid'
24507 d_siginfo_si_status='$d_siginfo_si_status'
24508 d_siginfo_si_uid='$d_siginfo_si_uid'
24509 d_siginfo_si_value='$d_siginfo_si_value'
24510 d_signbit='$d_signbit'
24511 d_sigprocmask='$d_sigprocmask'
24512 d_sigsetjmp='$d_sigsetjmp'
24513 d_sin6_scope_id='$d_sin6_scope_id'
24514 d_sitearch='$d_sitearch'
24515 d_snprintf='$d_snprintf'
24516 d_sockaddr_in6='$d_sockaddr_in6'
24517 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24518 d_sockaddr_storage='$d_sockaddr_storage'
24519 d_sockatmark='$d_sockatmark'
24520 d_sockatmarkproto='$d_sockatmarkproto'
24521 d_socket='$d_socket'
24522 d_socklen_t='$d_socklen_t'
24523 d_sockpair='$d_sockpair'
24524 d_socks5_init='$d_socks5_init'
24526 d_srand48_r='$d_srand48_r'
24527 d_srandom_r='$d_srandom_r'
24528 d_sresgproto='$d_sresgproto'
24529 d_sresuproto='$d_sresuproto'
24531 d_statblks='$d_statblks'
24532 d_statfs_f_flags='$d_statfs_f_flags'
24533 d_statfs_s='$d_statfs_s'
24534 d_static_inline='$d_static_inline'
24535 d_statvfs='$d_statvfs'
24536 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24537 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24538 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24539 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24540 d_stdio_stream_array='$d_stdio_stream_array'
24541 d_stdiobase='$d_stdiobase'
24542 d_stdstdio='$d_stdstdio'
24543 d_strcoll='$d_strcoll'
24544 d_strerror_l='$d_strerror_l'
24545 d_strerror_r='$d_strerror_r'
24546 d_strftime='$d_strftime'
24547 d_strlcat='$d_strlcat'
24548 d_strlcpy='$d_strlcpy'
24549 d_strnlen='$d_strnlen'
24550 d_strtod='$d_strtod'
24551 d_strtod_l='$d_strtod_l'
24552 d_strtol='$d_strtol'
24553 d_strtold='$d_strtold'
24554 d_strtold_l='$d_strtold_l'
24555 d_strtoll='$d_strtoll'
24556 d_strtoq='$d_strtoq'
24557 d_strtoul='$d_strtoul'
24558 d_strtoull='$d_strtoull'
24559 d_strtouq='$d_strtouq'
24560 d_strxfrm='$d_strxfrm'
24561 d_suidsafe='$d_suidsafe'
24562 d_symlink='$d_symlink'
24563 d_syscall='$d_syscall'
24564 d_syscallproto='$d_syscallproto'
24565 d_sysconf='$d_sysconf'
24566 d_sysernlst='$d_sysernlst'
24567 d_syserrlst='$d_syserrlst'
24568 d_system='$d_system'
24569 d_tcgetpgrp='$d_tcgetpgrp'
24570 d_tcsetpgrp='$d_tcsetpgrp'
24571 d_telldir='$d_telldir'
24572 d_telldirproto='$d_telldirproto'
24573 d_tgamma='$d_tgamma'
24574 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24576 d_timegm='$d_timegm'
24578 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24579 d_tm_tm_zone='$d_tm_tm_zone'
24580 d_tmpnam_r='$d_tmpnam_r'
24581 d_towlower='$d_towlower'
24582 d_towupper='$d_towupper'
24584 d_truncate='$d_truncate'
24585 d_truncl='$d_truncl'
24586 d_ttyname_r='$d_ttyname_r'
24587 d_tzname='$d_tzname'
24588 d_u32align='$d_u32align'
24589 d_ualarm='$d_ualarm'
24592 d_union_semun='$d_union_semun'
24593 d_unlinkat='$d_unlinkat'
24594 d_unordered='$d_unordered'
24595 d_unsetenv='$d_unsetenv'
24596 d_uselocale='$d_uselocale'
24597 d_usleep='$d_usleep'
24598 d_usleepproto='$d_usleepproto'
24600 d_vendorarch='$d_vendorarch'
24601 d_vendorbin='$d_vendorbin'
24602 d_vendorlib='$d_vendorlib'
24603 d_vendorscript='$d_vendorscript'
24605 d_void_closedir='$d_void_closedir'
24606 d_voidsig='$d_voidsig'
24607 d_voidtty='$d_voidtty'
24608 d_vsnprintf='$d_vsnprintf'
24610 d_waitpid='$d_waitpid'
24611 d_wcrtomb='$d_wcrtomb'
24612 d_wcscmp='$d_wcscmp'
24613 d_wcstombs='$d_wcstombs'
24614 d_wcsxfrm='$d_wcsxfrm'
24615 d_wctomb='$d_wctomb'
24616 d_writev='$d_writev'
24619 db_hashtype='$db_hashtype'
24620 db_prefixtype='$db_prefixtype'
24621 db_version_major='$db_version_major'
24622 db_version_minor='$db_version_minor'
24623 db_version_patch='$db_version_patch'
24624 default_inc_excludes_dot='$default_inc_excludes_dot'
24625 direntrytype='$direntrytype'
24628 doubleinfbytes='$doubleinfbytes'
24629 doublekind='$doublekind'
24630 doublemantbits='$doublemantbits'
24631 doublenanbytes='$doublenanbytes'
24632 doublesize='$doublesize'
24634 drand48_r_proto='$drand48_r_proto'
24636 dtraceobject='$dtraceobject'
24637 dtracexnolibs='$dtracexnolibs'
24638 dynamic_ext='$dynamic_ext'
24644 endgrent_r_proto='$endgrent_r_proto'
24645 endhostent_r_proto='$endhostent_r_proto'
24646 endnetent_r_proto='$endnetent_r_proto'
24647 endprotoent_r_proto='$endprotoent_r_proto'
24648 endpwent_r_proto='$endpwent_r_proto'
24649 endservent_r_proto='$endservent_r_proto'
24650 eunicefix='$eunicefix'
24653 extensions='$extensions'
24654 extern_C='$extern_C'
24656 fflushNULL='$fflushNULL'
24657 fflushall='$fflushall'
24659 firstmakefile='$firstmakefile'
24661 fpossize='$fpossize'
24662 fpostype='$fpostype'
24663 freetype='$freetype'
24666 full_csh='$full_csh'
24667 full_sed='$full_sed'
24668 gccansipedantic='$gccansipedantic'
24669 gccosandvers='$gccosandvers'
24670 gccversion='$gccversion'
24671 getgrent_r_proto='$getgrent_r_proto'
24672 getgrgid_r_proto='$getgrgid_r_proto'
24673 getgrnam_r_proto='$getgrnam_r_proto'
24674 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24675 gethostbyname_r_proto='$gethostbyname_r_proto'
24676 gethostent_r_proto='$gethostent_r_proto'
24677 getlogin_r_proto='$getlogin_r_proto'
24678 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24679 getnetbyname_r_proto='$getnetbyname_r_proto'
24680 getnetent_r_proto='$getnetent_r_proto'
24681 getprotobyname_r_proto='$getprotobyname_r_proto'
24682 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24683 getprotoent_r_proto='$getprotoent_r_proto'
24684 getpwent_r_proto='$getpwent_r_proto'
24685 getpwnam_r_proto='$getpwnam_r_proto'
24686 getpwuid_r_proto='$getpwuid_r_proto'
24687 getservbyname_r_proto='$getservbyname_r_proto'
24688 getservbyport_r_proto='$getservbyport_r_proto'
24689 getservent_r_proto='$getservent_r_proto'
24690 getspnam_r_proto='$getspnam_r_proto'
24691 gidformat='$gidformat'
24697 gmtime_r_proto='$gmtime_r_proto'
24698 gnulibc_version='$gnulibc_version'
24700 groupcat='$groupcat'
24701 groupstype='$groupstype'
24704 h_sysfile='$h_sysfile'
24707 hostgenerate='$hostgenerate'
24708 hostosname='$hostosname'
24709 hostperl='$hostperl'
24710 html1dir='$html1dir'
24711 html1direxp='$html1direxp'
24712 html3dir='$html3dir'
24713 html3direxp='$html3direxp'
24722 i_arpainet='$i_arpainet'
24724 i_bsdioctl='$i_bsdioctl'
24728 i_dirent='$i_dirent'
24730 i_execinfo='$i_execinfo'
24734 i_fp_class='$i_fp_class'
24736 i_gdbm_ndbm='$i_gdbm_ndbm'
24737 i_gdbmndbm='$i_gdbmndbm'
24739 i_ieeefp='$i_ieeefp'
24740 i_inttypes='$i_inttypes'
24741 i_langinfo='$i_langinfo'
24742 i_libutil='$i_libutil'
24743 i_locale='$i_locale'
24744 i_machcthr='$i_machcthr'
24745 i_malloc='$i_malloc'
24746 i_mallocmalloc='$i_mallocmalloc'
24747 i_mntent='$i_mntent'
24750 i_neterrno='$i_neterrno'
24751 i_netinettcp='$i_netinettcp'
24755 i_pthread='$i_pthread'
24757 i_quadmath='$i_quadmath'
24758 i_rpcsvcdbm='$i_rpcsvcdbm'
24760 i_shadow='$i_shadow'
24762 i_stdbool='$i_stdbool'
24763 i_stdint='$i_stdint'
24764 i_stdlib='$i_stdlib'
24765 i_sunmath='$i_sunmath'
24766 i_sysaccess='$i_sysaccess'
24767 i_sysdir='$i_sysdir'
24768 i_sysfile='$i_sysfile'
24769 i_sysfilio='$i_sysfilio'
24771 i_sysioctl='$i_sysioctl'
24772 i_syslog='$i_syslog'
24773 i_sysmman='$i_sysmman'
24774 i_sysmode='$i_sysmode'
24775 i_sysmount='$i_sysmount'
24776 i_sysndir='$i_sysndir'
24777 i_sysparam='$i_sysparam'
24778 i_syspoll='$i_syspoll'
24779 i_sysresrc='$i_sysresrc'
24780 i_syssecrt='$i_syssecrt'
24781 i_sysselct='$i_sysselct'
24782 i_syssockio='$i_syssockio'
24783 i_sysstat='$i_sysstat'
24784 i_sysstatfs='$i_sysstatfs'
24785 i_sysstatvfs='$i_sysstatvfs'
24786 i_systime='$i_systime'
24787 i_systimek='$i_systimek'
24788 i_systimes='$i_systimes'
24789 i_systypes='$i_systypes'
24790 i_sysuio='$i_sysuio'
24792 i_sysutsname='$i_sysutsname'
24793 i_sysvfs='$i_sysvfs'
24794 i_syswait='$i_syswait'
24795 i_termio='$i_termio'
24796 i_termios='$i_termios'
24798 i_unistd='$i_unistd'
24803 i_wctype='$i_wctype'
24804 i_xlocale='$i_xlocale'
24805 ignore_versioned_solibs='$ignore_versioned_solibs'
24806 inc_version_list='$inc_version_list'
24807 inc_version_list_init='$inc_version_list_init'
24811 initialinstalllocation='$initialinstalllocation'
24812 installarchlib='$installarchlib'
24813 installbin='$installbin'
24814 installhtml1dir='$installhtml1dir'
24815 installhtml3dir='$installhtml3dir'
24816 installman1dir='$installman1dir'
24817 installman3dir='$installman3dir'
24818 installprefix='$installprefix'
24819 installprefixexp='$installprefixexp'
24820 installprivlib='$installprivlib'
24821 installscript='$installscript'
24822 installsitearch='$installsitearch'
24823 installsitebin='$installsitebin'
24824 installsitehtml1dir='$installsitehtml1dir'
24825 installsitehtml3dir='$installsitehtml3dir'
24826 installsitelib='$installsitelib'
24827 installsiteman1dir='$installsiteman1dir'
24828 installsiteman3dir='$installsiteman3dir'
24829 installsitescript='$installsitescript'
24830 installstyle='$installstyle'
24831 installusrbinperl='$installusrbinperl'
24832 installvendorarch='$installvendorarch'
24833 installvendorbin='$installvendorbin'
24834 installvendorhtml1dir='$installvendorhtml1dir'
24835 installvendorhtml3dir='$installvendorhtml3dir'
24836 installvendorlib='$installvendorlib'
24837 installvendorman1dir='$installvendorman1dir'
24838 installvendorman3dir='$installvendorman3dir'
24839 installvendorscript='$installvendorscript'
24841 issymlink='$issymlink'
24842 ivdformat='$ivdformat'
24845 known_extensions='$known_extensions'
24848 ld_can_script='$ld_can_script'
24849 lddlflags='$lddlflags'
24851 ldflags_uselargefiles='$ldflags_uselargefiles'
24852 ldlibpthname='$ldlibpthname'
24859 libsdirs='$libsdirs'
24860 libsfiles='$libsfiles'
24861 libsfound='$libsfound'
24862 libspath='$libspath'
24863 libswanted='$libswanted'
24864 libswanted_uselargefiles='$libswanted_uselargefiles'
24870 localtime_r_proto='$localtime_r_proto'
24871 locincpth='$locincpth'
24872 loclibpth='$loclibpth'
24873 longdblinfbytes='$longdblinfbytes'
24874 longdblkind='$longdblkind'
24875 longdblmantbits='$longdblmantbits'
24876 longdblnanbytes='$longdblnanbytes'
24877 longdblsize='$longdblsize'
24878 longlongsize='$longlongsize'
24879 longsize='$longsize'
24883 lseeksize='$lseeksize'
24884 lseektype='$lseektype'
24888 make_set_make='$make_set_make'
24889 mallocobj='$mallocobj'
24890 mallocsrc='$mallocsrc'
24891 malloctype='$malloctype'
24893 man1direxp='$man1direxp'
24896 man3direxp='$man3direxp'
24898 mips_type='$mips_type'
24899 mistrustnm='$mistrustnm'
24901 mmaptype='$mmaptype'
24902 modetype='$modetype'
24904 multiarch='$multiarch'
24906 myarchname='$myarchname'
24907 mydomain='$mydomain'
24908 myhostname='$myhostname'
24911 need_va_copy='$need_va_copy'
24912 netdb_hlen_type='$netdb_hlen_type'
24913 netdb_host_type='$netdb_host_type'
24914 netdb_name_type='$netdb_name_type'
24915 netdb_net_type='$netdb_net_type'
24918 nm_so_opt='$nm_so_opt'
24919 nonxs_ext='$nonxs_ext'
24921 nvEUformat='$nvEUformat'
24922 nvFUformat='$nvFUformat'
24923 nvGUformat='$nvGUformat'
24924 nv_overflows_integers_at='$nv_overflows_integers_at'
24925 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24926 nveformat='$nveformat'
24927 nvfformat='$nvfformat'
24928 nvgformat='$nvgformat'
24929 nvmantbits='$nvmantbits'
24932 o_nonblock='$o_nonblock'
24934 old_pthread_create_joinable='$old_pthread_create_joinable'
24935 optimize='$optimize'
24936 orderlib='$orderlib'
24939 otherlibdirs='$otherlibdirs'
24943 patchlevel='$patchlevel'
24944 path_sep='$path_sep'
24947 perl_patchlevel='$perl_patchlevel'
24948 perl_static_inline='$perl_static_inline'
24949 perladmin='$perladmin'
24950 perllibs='$perllibs'
24951 perlpath='$perlpath'
24953 phostname='$phostname'
24959 prefixexp='$prefixexp'
24961 privlibexp='$privlibexp'
24962 procselfexe='$procselfexe'
24964 quadkind='$quadkind'
24965 quadtype='$quadtype'
24966 randbits='$randbits'
24967 randfunc='$randfunc'
24968 random_r_proto='$random_r_proto'
24969 randseedtype='$randseedtype'
24971 rd_nodata='$rd_nodata'
24972 readdir64_r_proto='$readdir64_r_proto'
24973 readdir_r_proto='$readdir_r_proto'
24974 revision='$revision'
24980 sGMTIME_max='$sGMTIME_max'
24981 sGMTIME_min='$sGMTIME_min'
24982 sLOCALTIME_max='$sLOCALTIME_max'
24983 sLOCALTIME_min='$sLOCALTIME_min'
24984 sPRIEUldbl='$sPRIEUldbl'
24985 sPRIFUldbl='$sPRIFUldbl'
24986 sPRIGUldbl='$sPRIGUldbl'
24987 sPRIXU64='$sPRIXU64'
24989 sPRIeldbl='$sPRIeldbl'
24990 sPRIfldbl='$sPRIfldbl'
24991 sPRIgldbl='$sPRIgldbl'
24996 sSCNfldbl='$sSCNfldbl'
24997 sched_yield='$sched_yield'
24998 scriptdir='$scriptdir'
24999 scriptdirexp='$scriptdirexp'
25001 seedfunc='$seedfunc'
25002 selectminbits='$selectminbits'
25003 selecttype='$selecttype'
25004 sendmail='$sendmail'
25005 setgrent_r_proto='$setgrent_r_proto'
25006 sethostent_r_proto='$sethostent_r_proto'
25007 setlocale_r_proto='$setlocale_r_proto'
25008 setnetent_r_proto='$setnetent_r_proto'
25009 setprotoent_r_proto='$setprotoent_r_proto'
25010 setpwent_r_proto='$setpwent_r_proto'
25011 setservent_r_proto='$setservent_r_proto'
25014 sharpbang='$sharpbang'
25015 shmattype='$shmattype'
25016 shortsize='$shortsize'
25019 sig_count='$sig_count'
25020 sig_name='$sig_name'
25021 sig_name_init='$sig_name_init'
25023 sig_num_init='$sig_num_init'
25024 sig_size='$sig_size'
25025 signal_t='$signal_t'
25026 sitearch='$sitearch'
25027 sitearchexp='$sitearchexp'
25029 sitebinexp='$sitebinexp'
25030 sitehtml1dir='$sitehtml1dir'
25031 sitehtml1direxp='$sitehtml1direxp'
25032 sitehtml3dir='$sitehtml3dir'
25033 sitehtml3direxp='$sitehtml3direxp'
25035 sitelib_stem='$sitelib_stem'
25036 sitelibexp='$sitelibexp'
25037 siteman1dir='$siteman1dir'
25038 siteman1direxp='$siteman1direxp'
25039 siteman3dir='$siteman3dir'
25040 siteman3direxp='$siteman3direxp'
25041 siteprefix='$siteprefix'
25042 siteprefixexp='$siteprefixexp'
25043 sitescript='$sitescript'
25044 sitescriptexp='$sitescriptexp'
25045 sizesize='$sizesize'
25046 sizetype='$sizetype'
25050 sockethdr='$sockethdr'
25051 socketlib='$socketlib'
25052 socksizetype='$socksizetype'
25054 spackage='$spackage'
25055 spitshell='$spitshell'
25056 srand48_r_proto='$srand48_r_proto'
25057 srandom_r_proto='$srandom_r_proto'
25059 ssizetype='$ssizetype'
25060 st_ino_sign='$st_ino_sign'
25061 st_ino_size='$st_ino_size'
25062 startperl='$startperl'
25064 static_ext='$static_ext'
25066 stdio_base='$stdio_base'
25067 stdio_bufsiz='$stdio_bufsiz'
25068 stdio_cnt='$stdio_cnt'
25069 stdio_filbuf='$stdio_filbuf'
25070 stdio_ptr='$stdio_ptr'
25071 stdio_stream_array='$stdio_stream_array'
25072 strerror_r_proto='$strerror_r_proto'
25074 subversion='$subversion'
25079 targetarch='$targetarch'
25080 targetdir='$targetdir'
25081 targetenv='$targetenv'
25082 targethost='$targethost'
25083 targetmkdir='$targetmkdir'
25084 targetport='$targetport'
25085 targetsh='$targetsh'
25089 timeincl='$timeincl'
25090 timetype='$timetype'
25091 tmpnam_r_proto='$tmpnam_r_proto'
25097 ttyname_r_proto='$ttyname_r_proto'
25106 uidformat='$uidformat'
25112 uquadtype='$uquadtype'
25113 use5005threads='$use5005threads'
25114 use64bitall='$use64bitall'
25115 use64bitint='$use64bitint'
25116 usecbacktrace='$usecbacktrace'
25117 usecrosscompile='$usecrosscompile'
25118 usedevel='$usedevel'
25120 usedtrace='$usedtrace'
25121 usefaststdio='$usefaststdio'
25122 useithreads='$useithreads'
25123 usekernprocpathname='$usekernprocpathname'
25124 uselanginfo='$uselanginfo'
25125 uselargefiles='$uselargefiles'
25126 uselongdouble='$uselongdouble'
25127 usemallocwrap='$usemallocwrap'
25128 usemorebits='$usemorebits'
25129 usemultiplicity='$usemultiplicity'
25130 usemymalloc='$usemymalloc'
25132 usensgetexecutablepath='$usensgetexecutablepath'
25133 useopcode='$useopcode'
25134 useperlio='$useperlio'
25135 useposix='$useposix'
25136 usequadmath='$usequadmath'
25137 usereentrant='$usereentrant'
25138 userelocatableinc='$userelocatableinc'
25139 useshrplib='$useshrplib'
25140 usesitecustomize='$usesitecustomize'
25141 usesocks='$usesocks'
25142 usethreads='$usethreads'
25143 usevendorprefix='$usevendorprefix'
25144 useversionedarchname='$useversionedarchname'
25145 usevfork='$usevfork'
25148 uvXUformat='$uvXUformat'
25149 uvoformat='$uvoformat'
25152 uvuformat='$uvuformat'
25153 uvxformat='$uvxformat'
25154 vendorarch='$vendorarch'
25155 vendorarchexp='$vendorarchexp'
25156 vendorbin='$vendorbin'
25157 vendorbinexp='$vendorbinexp'
25158 vendorhtml1dir='$vendorhtml1dir'
25159 vendorhtml1direxp='$vendorhtml1direxp'
25160 vendorhtml3dir='$vendorhtml3dir'
25161 vendorhtml3direxp='$vendorhtml3direxp'
25162 vendorlib='$vendorlib'
25163 vendorlib_stem='$vendorlib_stem'
25164 vendorlibexp='$vendorlibexp'
25165 vendorman1dir='$vendorman1dir'
25166 vendorman1direxp='$vendorman1direxp'
25167 vendorman3dir='$vendorman3dir'
25168 vendorman3direxp='$vendorman3direxp'
25169 vendorprefix='$vendorprefix'
25170 vendorprefixexp='$vendorprefixexp'
25171 vendorscript='$vendorscript'
25172 vendorscriptexp='$vendorscriptexp'
25174 version_patchlevel_string='$version_patchlevel_string'
25175 versiononly='$versiononly'
25179 yaccflags='$yaccflags'
25184 : add special variables
25185 $test -f $src/patchlevel.h && \
25186 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25187 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25188 echo "PERL_CONFIG_SH=true" >>config.sh
25190 : propagate old symbols
25191 if $test -f UU/config.sh; then
25192 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25193 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25194 config.sh config.sh UU/oldconfig.sh |\
25195 $sort | $uniq -u >UU/oldsyms
25196 set X `$cat UU/oldsyms`
25202 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25204 echo ": Variables propagated from previous config.sh file." >>config.sh
25205 for sym in `$cat UU/oldsyms`; do
25206 echo " Propagating $hint variable "'$'"$sym..."
25207 eval 'tmp="$'"${sym}"'"'
25209 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25215 : preserve RCS keywords in files with variable substitution, grrr
25218 : Finish up by extracting the .SH files
25221 echo "Stopping at your request, leaving temporary files around."
25231 If you'd like to make any changes to the config.sh file before I begin
25232 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25235 rp="Press return or use a shell escape to edit config.sh:"
25240 *) : in case they cannot read
25241 sh 1>&4 -c "$ans";;
25246 : if this fails, just run all the .SH files by hand
25255 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25262 Now you need to generate make dependencies by running "$make depend".
25263 You might prefer to run it in background: "$make depend > makedepend.out &"
25264 It can take a while, so you might not want to run it right now.
25269 rp="Run $make depend now?"
25273 $make depend && echo "Now you must run '$make'."
25276 echo "You must run '$make depend' then '$make'."
25279 elif test -f [Mm]akefile; then
25281 echo "Now you must run a $make."
25283 echo "Configure done."
25286 if $test -f Policy.sh; then
25289 If you compile $package on a different machine or from a different object
25290 directory, copy the Policy.sh file from this object directory to the
25291 new one before you run Configure -- this will help you with most of
25292 the policy defaults.
25296 if $test -f UU/config.msg; then
25297 echo "Hmm. I also noted the following information while running:"
25299 $cat UU/config.msg >&4
25301 $rm -f kit*isdone ark*isdone