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=''
854 perl_static_inline=''
859 d_stdio_ptr_lval_nochange_cnt=''
860 d_stdio_ptr_lval_sets_cnt=''
943 default_inc_excludes_dot=''
1009 d_gdbm_ndbm_h_uses_prototypes=''
1010 d_gdbmndbm_h_uses_prototypes=''
1012 d_ndbm_h_uses_prototypes=''
1083 d_inc_version_list=''
1085 inc_version_list_init=''
1093 installusrbinperl=''
1109 ignore_versioned_solibs=''
1125 d_double_has_negative_zero=''
1126 d_double_has_subnormals=''
1127 d_double_style_cray=''
1128 d_double_style_ibm=''
1129 d_double_style_ieee=''
1130 d_double_style_vax=''
1181 d_perl_otherlibdirs=''
1189 api_versionstring=''
1195 version_patchlevel_string=''
1199 d_nv_preserves_uv=''
1200 d_nv_zero_is_allbits_zero=''
1211 nv_overflows_integers_at=''
1212 nv_preserves_uv_bits=''
1284 installsitehtml1dir=''
1287 installsitehtml3dir=''
1294 installsiteman1dir=''
1297 installsiteman3dir=''
1302 installsitescript=''
1320 d_stdio_stream_array=''
1321 stdio_stream_array=''
1339 usekernprocpathname=''
1340 ccflags_uselargefiles=''
1341 ldflags_uselargefiles=''
1342 libswanted_uselargefiles=''
1351 usensgetexecutablepath=''
1364 installvendorarch=''
1371 installvendorhtml1dir=''
1373 vendorhtml1direxp=''
1374 installvendorhtml3dir=''
1376 vendorhtml3direxp=''
1382 installvendorman1dir=''
1385 installvendorman3dir=''
1392 installvendorscript=''
1403 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1406 : We must find out about Eunice early
1408 if test -f /etc/unixtovms; then
1409 eunicefix=/etc/unixtovms
1411 if test -f /etc/unixtovms.exe; then
1412 eunicefix=/etc/unixtovms.exe
1415 : Set executable suffix now -- needed before hints available
1416 if test -f "/libs/version.library"; then
1419 elif test -f "/system/gnu_library/bin/ar.pm"; then
1422 elif test -n "$DJGPP"; then
1425 elif test -f /kern/cookiejar; then
1428 elif test -d c:/. -o -n "$is_os2" ; then
1435 : Possible local include directories to search.
1436 : Set locincpth to "" in a hint file to defeat local include searches.
1437 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1438 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1440 : no include file wanted by default
1443 : Enable -DEBUGGING and -DDEBUGGING from the command line
1447 : Trailing extension. Override this in a hint file, if needed.
1448 : Extra object files, if any, needed on this platform.
1451 : change the next line if compiling for Xenix/286 on Xenix/386
1452 xlibpth='/usr/lib/386 /lib/386'
1453 : Possible local library directories to search.
1454 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1455 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1457 : general looking path for locating libraries
1458 glibpth="/lib /usr/lib $xlibpth"
1459 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1460 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1461 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1462 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1464 : Private path used by Configure to find libraries. Its value
1465 : is prepended to libpth. This variable takes care of special
1466 : machines, like the mips. Usually, it should be empty.
1469 : default library list
1471 : some systems want to use only the non-versioned libso:s
1472 ignore_versioned_solibs=''
1476 : set useposix=false in your hint file to disable the POSIX extension.
1478 : set useopcode=false in your hint file to disable the Opcode extension.
1480 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1483 ccflags_uselargefiles=''
1484 ldflags_uselargefiles=''
1485 libswanted_uselargefiles=''
1486 : set usemultiplicity on the Configure command line to enable multiplicity.
1487 : set usesocks on the Configure command line to enable socks.
1489 : set usethreads on the Configure command line to enable threads.
1490 usereentrant='undef'
1491 : List of libraries we want.
1492 : If anyone needs extra -lxxx, put those in a hint file.
1493 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1494 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1495 : We probably want to search /usr/shlib before most other libraries.
1496 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1497 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1498 glibpth="/usr/shlib $glibpth"
1499 : Do not use vfork unless overridden by a hint file.
1502 : Find the basic shell for Bourne shell scripts
1506 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1509 if test -f "$xxx"; then
1512 : Build up a list and do a single loop so we can 'break' out.
1513 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1514 for xxx in sh bash ksh pdksh ash; do
1516 try="$try ${p}/${xxx}"
1520 if test -f "$xxx"; then
1523 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1526 elif test -f "$xxx.exe"; then
1537 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1539 Usually it's in /bin/sh. How did you even get this far?
1540 Please contact me (Perl Maintainers) at https://github.com/Perl/perl5/issues
1541 and we'll try to straighten this all out.
1547 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1548 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1551 : see if sh knows # comments
1552 if `$sh -c '#' >/dev/null 2>&1`; then
1556 test -f $xcat$_exe || xcat=/usr/bin/cat
1557 if test ! -f $xcat$_exe; then
1558 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1559 if test -f $p/cat$_exe; then
1564 if test ! -f $xcat$_exe; then
1565 echo "Can't find cat anywhere!"
1569 echo "#!$xcat" >sharp
1572 ./sharp > today 2>/dev/null
1573 if test -s today; then
1576 echo "#! $xcat" > sharp
1579 ./sharp > today 2>/dev/null
1580 if test -s today; then
1588 echo "Your $sh doesn't grok # comments--I will strip them later on."
1591 echo "exec grep -v '^[ ]*#'" >spitshell
1593 $eunicefix spitshell
1594 spitshell=`pwd`/spitshell
1596 echo "I presume that if # doesn't work, #! won't work either!"
1601 : figure out how to guarantee sh startup
1603 '') startsh=${sharpbang}${sh} ;;
1615 : echo "Yup, it does."
1617 echo "Hmm... '$startsh' does not guarantee sh startup..."
1618 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1622 : Save command line options in file UU/cmdline.opt for later use in
1623 : generating config.sh.
1624 cat > cmdline.opt <<EOSH
1625 : Configure command line arguments.
1634 cat >>cmdline.opt <<EOSH
1635 config_arg$argn='$arg'
1637 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1640 arg_exp=`cat cmdl.opt`
1641 args_exp="$args_exp$args_sep'$arg_exp'"
1642 argn=`expr $argn + 1`
1647 : produce awk script to parse command line options
1648 cat >options.awk <<'EOF'
1650 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1652 len = length(optstr);
1653 for (i = 1; i <= len; i++) {
1654 c = substr(optstr, i, 1);
1655 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1666 if (substr(str, 1, 1) != "-") {
1667 printf("'%s'\n", str);
1671 for (i = 2; i <= len; i++) {
1672 c = substr(str, i, 1);
1674 printf("-%s\n", substr(str, i));
1680 printf("'%s'\n", substr(str, i + 1));
1693 : process the command line options
1694 set X `for arg in "$@"; do echo "X$arg"; done |
1695 sed -e s/X// | awk -f options.awk`
1700 : set up default values
1709 rm -f optdef.sh posthint.sh
1710 cat >optdef.sh <<EOS
1716 while test $# -gt 0; do
1718 -d) shift; fastread=yes;;
1719 -e) shift; alldone=cont;;
1723 if test -r "$1"; then
1726 echo "$me: cannot read config file $1." >&2
1732 -h) shift; error=true;;
1733 -r) shift; reuseval=true;;
1734 -s) shift; silent=true; realsilent=true;;
1735 -E) shift; alldone=exit;;
1736 -K) shift; knowitall=true;;
1738 -S) shift; silent=true; extractsh=true;;
1743 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1744 echo "$me: ignoring -D $1" >&2
1747 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1748 *) echo "$1='define'" >> optdef.sh;;
1755 *=) echo "$1" >> optdef.sh;;
1757 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1758 echo "$me: ignoring -U $1" >&2
1760 *) echo "$1='undef'" >> optdef.sh;;
1771 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1775 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1776 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1782 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1783 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1784 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1785 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1786 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1787 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1793 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1795 echo "$yyy=''" >> posthint.sh ;;
1800 echo "$yyy='$zzz'" >> posthint.sh ;;
1802 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1804 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1809 echo "$yyy=$zzz" >> posthint.sh ;;
1810 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1814 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1817 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1825 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1826 [-U symbol] [-U symbol=] [-A command:symbol...]
1827 -d : use defaults for all answers.
1828 -e : go on without questioning past the production of config.sh.
1829 -f : specify an alternate default configuration file.
1830 -h : print this help message and exit (with an error status).
1831 -r : reuse C symbols value if possible (skips costly nm extraction).
1832 -s : silent mode, only echoes questions and essential information.
1833 -D : define symbol to have some value:
1834 -D symbol symbol gets the value 'define'
1835 -D symbol=value symbol gets the value 'value'
1836 common used examples (see INSTALL for more info):
1837 -Duse64bitint use 64bit integers
1838 -Duse64bitall use 64bit integers and pointers
1839 -Dusethreads use thread support
1840 -Dinc_version_list=none do not include older perl trees in @INC
1841 -DEBUGGING=none DEBUGGING options
1842 -Dcc=gcc choose your compiler
1843 -Dprefix=/opt/perl5 choose your destination
1844 -E : stop at the end of questions, after having produced config.sh.
1845 -K : do not use unless you know what you are doing.
1846 -O : ignored for backward compatibility
1847 -S : perform variable substitutions on all .SH files (can mix with -f)
1848 -U : undefine symbol:
1849 -U symbol symbol gets the value 'undef'
1850 -U symbol= symbol gets completely empty
1852 -A : manipulate symbol after the platform specific hints have been applied:
1853 -A append:symbol=value append value to symbol
1854 -A symbol=value like append:, but with a separating space
1855 -A define:symbol=value define symbol to have value
1856 -A clear:symbol define symbol to be ''
1857 -A define:symbol define symbol to be 'define'
1858 -A eval:symbol=value define symbol to be eval of value
1859 -A prepend:symbol=value prepend value to symbol
1860 -A undef:symbol define symbol to be 'undef'
1861 -A undef:symbol= define symbol to be ''
1862 e.g.: -A prepend:libswanted='cl pthread '
1863 -A ccflags=-DSOME_MACRO
1864 -V : print version number and exit (with a zero status).
1871 case "$fastread$alldone" in
1874 case "$extractsh" in
1877 if test ! -t 0; then
1878 echo "Say 'sh Configure', not 'sh <Configure'"
1888 true) exec 1>/dev/null;;
1891 : run the defines and the undefines, if any, but leave the file out there...
1893 grep '\\' optdef.sh >/dev/null 2>&1
1894 if test $? = 0; then
1895 echo "Configure does not support \\ in -D arguments"
1899 : create the posthint manipulation script and leave the file out there...
1904 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1905 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1906 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1907 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1908 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1911 : Some greps do not return status, grrr.
1912 echo "grimblepritz" >grimble
1913 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1915 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1921 : the following should work in any shell
1925 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1926 cat >contains <<'EOSS'
1927 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1932 : Find the path to the source tree
1935 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1939 *) src=`cd ../$src && pwd` ;;
1952 if test -f $rsrc/Configure && \
1953 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1955 : found it, so we are ok.
1958 for src in . .. ../.. ../../.. ../../../..; do
1959 if test -f ../$src/Configure && \
1960 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1971 Sorry, I can't seem to locate the source dir for $package. Please start
1972 Configure with an explicit path -- i.e. /some/path/Configure.
1980 echo "Sources for $package found in \"$src\"." >&4
1984 : script used to extract .SH files with variable substitutions
1985 cat >extract <<'EOS'
1987 echo "Doing variable substitutions on .SH files..."
1988 if test -f MANIFEST; then
1989 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1991 echo "(Looking for .SH files under the source directory.)"
1992 set x `(cd "$src"; find . -name "*.SH" -print)`
1996 0) set x `(cd "$src"; echo *.SH)`; shift;;
1998 if test ! -f "$src/$1"; then
2004 while test $name; do
2005 if test ! -d "$name"; then
2006 create="$name $create";
2007 name=`echo $name | sed -e "s|^[^/]*$||"`;
2008 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2013 for file in $create; do
2022 dir=`expr X$file : 'X\(.*\)/'`
2023 file=`expr X$file : 'X.*/\(.*\)'`
2024 (cd "$dir" && . ./$file)
2034 dir=`expr X$file : 'X\(.*\)/'`
2035 file=`expr X$file : 'X.*/\(.*\)'`
2036 (set x $dir; shift; eval $mkdir_p)
2037 sh <"$src/$dir/$file"
2046 if test -f "$src/config_h.SH"; then
2047 if test ! -f config.h; then
2048 : oops, they left it out of MANIFEST, probably, so do it anyway.
2049 . "$src/config_h.SH"
2054 : extract files and exit if asked to do so
2055 case "$extractsh" in
2057 case "$realsilent" in
2061 case "$config_sh" in
2062 '') config_sh='config.sh';;
2065 echo "Fetching answers from $config_sh..."
2072 echo "Extraction done."
2077 : Eunice requires " " instead of "", can you believe it
2080 echo "Beginning of configuration questions for $package."
2082 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2084 : first determine how to suppress newline on echo command
2086 echo "Checking echo to see how to suppress newlines..."
2087 (echo "hi there\c" ; echo " ") >.echotmp
2088 if $contains c .echotmp >/dev/null 2>&1 ; then
2099 echo $n "The star should be here-->$c"
2103 : Now test for existence of everything in MANIFEST
2105 if test -f "$rsrc/MANIFEST"; then
2106 echo "First let's make sure your kit is complete. Checking..." >&4
2107 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2108 (split -l 50 2>/dev/null || split -50)
2111 for filelist in x??; do
2112 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2113 >/dev/null 2>>"$tmppwd/missing")
2115 if test -s missing; then
2119 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2121 You have the option of continuing the configuration process, despite the
2122 distinct possibility that your kit is damaged, by typing 'y'es. If you
2123 do, don't blame me if something goes wrong. I advise you to type 'n'o
2124 and contact the author (https://github.com/Perl/perl5/issues).
2127 echo $n "Continue? [n] $c" >&4
2131 echo "Continuing..." >&4
2135 echo "ABORTING..." >&4
2140 echo "Looks good..."
2143 echo "There is no MANIFEST file. I hope your kit is complete !"
2147 : Find the appropriate value for a newline for tr
2148 if test -n "$DJGPP"; then
2151 if test X"$trnl" = X; then
2152 case "`echo foo | tr '\n' x 2>/dev/null`" in
2156 if test X"$trnl" = X; then
2157 case "`echo foo | tr '\012' x 2>/dev/null`" in
2158 foox) trnl='\012' ;;
2161 if test X"$trnl" = X; then
2162 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2163 fooxy) trnl='\n\r' ;;
2166 if test X"$trnl" = X; then
2169 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2175 : compute the number of columns on the terminal for proper question formatting
2180 : set up the echo used in my read
2181 myecho="case \"\$xxxm\" in
2182 '') echo $n \"\$rp $c\" >&4;;
2184 '') echo $n \"[\$xxxm] $c\";;
2186 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2188 echo $n \"[\$xxxm] $c\" >&4
2190 echo $n \"\$rp [\$xxxm] $c\" >&4
2196 : now set up to do reads with possible shell escape and default assignment
2202 case "\$fastread" in
2203 yes) case "\$dflt" in
2206 case "\$silent-\$rp" in
2211 *) case "\$silent" in
2212 true) case "\$rp" in
2217 while expr "X\$ans" : "X!" >/dev/null; do
2221 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2229 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2238 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2243 echo "(OK, I'll run with -d after this question.)" >&4
2246 echo "*** Sorry, \$1 not supported yet." >&4
2256 echo "*** Substitution done -- please confirm."
2258 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2263 echo "*** Error -- try again."
2270 case "\$ans\$xxxm\$nostick" in
2282 : create .config dir to save info across Configure sessions
2283 test -d ../.config || mkdir ../.config
2284 cat >../.config/README <<EOF
2285 This directory created by Configure to save information that should
2286 persist across sessions for $package.
2288 You may safely delete it if you wish.
2291 : See if we are using a devel version and want that
2292 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2295 usedevel="$define" ;;
2296 *) case "$xversion" in
2299 *** WHOA THERE!!! ***
2301 This is an UNSTABLE DEVELOPMENT release.
2302 The version of this $package distribution is $xversion, that is, odd,
2303 (as opposed to even) and that signifies a development release.
2304 If you want a maintenance release, you want an even-numbered version.
2306 Do ***NOT*** install this into production use.
2307 Data corruption and crashes are possible.
2309 It is most seriously suggested that you do not continue any further
2310 unless you want to help in developing and debugging Perl.
2312 If you *still* want to build perl, you can answer 'y' now,
2313 or pass -Dusedevel to Configure.
2316 rp='Do you really want to continue?'
2320 [yY]) echo >&4 "Okay, continuing."
2321 usedevel="$define" ;;
2322 *) echo >&4 "Okay, bye."
2333 case "$versiononly" in
2334 '') versiononly="$define" ;;
2336 case "$installusrbinperl" in
2337 '') installusrbinperl="$undef" ;;
2342 : general instructions
2345 user=`(logname) 2>/dev/null`
2347 '') user=`whoami 2>&1`;;
2349 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2352 rp='Would you like to see the instructions?'
2363 This installation shell script will examine your system and ask you questions
2364 to determine how the perl5 package should be installed. If you get
2365 stuck on a question, you may use a ! shell escape to start a subshell or
2366 execute a command. Many of the questions will have default answers in square
2367 brackets; typing carriage return will give you the default.
2369 On some of the questions which ask for file or directory names you are allowed
2370 to use the ~name construct to specify the login directory belonging to "name",
2371 even if you don't have a shell which knows about that. Questions where this is
2372 allowed will be marked "(~name ok)".
2376 dflt='Type carriage return to continue'
2380 The prompter used in this script allows you to use shell variables and
2381 backticks in your answers. You may use $1, $2, etc... to refer to the words
2382 in the default answer, as if the default line was a set of arguments given to a
2383 script shell. This means you may also use $* to repeat the whole default line,
2384 so you do not have to re-type everything to add something to the default.
2386 Every time there is a substitution, you will have to confirm. If there is an
2387 error (e.g. an unmatched backtick), the default answer will remain unchanged
2388 and you will be prompted again.
2390 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2391 the questions and use the computed defaults (or the previous answers if there
2392 was already a config.sh file). Type 'Configure -h' for a list of options.
2393 You may also start interactively and then answer '& -d' at any prompt to turn
2394 on the non-interactive behaviour for the remainder of the execution.
2400 Much effort has been expended to ensure that this shell script will run on any
2401 Unix system. If despite that it blows up on yours, your best bet is to edit
2402 Configure and run it again. If you can't run Configure for some reason,
2403 you'll have to generate a config.sh file by hand. Whatever problems you
2404 have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
2406 This installation script affects things in two ways:
2408 1) it may do direct variable substitutions on some of the files included
2410 2) it builds a config.h file for inclusion in C programs. You may edit
2411 any of these files as the need arises after running this script.
2413 If you make a mistake on a question, there is no easy way to back up to it
2414 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2415 files. Configure will offer to let you do this before it runs the SH files.
2418 dflt='Type carriage return to continue'
2420 case "$firsttime" in
2421 true) echo $user >>../.config/instruct;;
2425 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2426 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2427 if test "X$sysroot" = X; then
2432 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2433 # _sysroot is used in places where we need --sysroot=foo
2434 # but using the rest of the flags could cause issues.
2435 _sysroot="--sysroot=$sysroot";
2439 ccflags="$ccflags $_sysroot"
2444 ldflags="$ldflags $_sysroot"
2449 cppflags="$cppflags $_sysroot"
2451 # lddlflags updated below in lddlflags section;
2452 # same with cccdlflags
2456 # Adjust some defaults to also use $sysroot
2457 for var in xlibpth loclibpth locincpth glibpth; do
2460 for path in $xxx; do
2461 eval $var=\"\$$var $sysroot$path\"
2467 : find out where common programs are
2469 echo "Locating common programs..." >&4
2482 if test -d \$dir/\$thing; then
2488 for thisthing in \$dir/\$thing; do
2489 : just loop through to pick last item
2491 if test -f \$thisthing; then
2494 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2497 elif test -f \$dir/\$thing.exe; then
2498 if test -n "$DJGPP"; then
2499 echo \$dir/\$thing.exe
2500 elif test "$eunicefix" != ":"; then
2501 : on Eunice apparently
2554 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2555 pth="$pth $sysroot/lib $sysroot/usr/lib"
2556 for file in $loclist; do
2560 if test -f "$xxx"; then
2563 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2564 xxx=`./loc $file $file $pth`
2567 '') xxx=`./loc $file $file $pth`;;
2568 *) xxx=`./loc $xxx $xxx $pth`;;
2570 eval $file=$xxx$_exe
2574 echo $file is in $xxx.
2577 echo $file is in $xxx.
2580 echo "I don't know where '$file' is, and my life depends on it." >&4
2581 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2587 echo "Don't worry if any of the following aren't found..."
2589 for file in $trylist; do
2593 if test -f "$xxx"; then
2596 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2597 xxx=`./loc $file $file $pth`
2600 '') xxx=`./loc $file $file $pth`;;
2601 *) xxx=`./loc $xxx $xxx $pth`;;
2603 eval $file=$xxx$_exe
2607 echo $file is in $xxx.
2610 echo $file is in $xxx.
2613 echo "I don't see $file out there, $say."
2620 echo "Substituting grep for egrep."
2627 *) if $less -R </dev/null >/dev/null 2>&1; then
2628 echo "Substituting less -R for less."
2636 echo "Substituting cp for ln."
2645 echo "I can't find make or gmake, and my life depends on it." >&4
2646 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2654 *) # We can't have osname yet.
2655 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2656 # Assume that gmake, if found, is definitely GNU make
2657 # and prefer it over the system make.
2658 echo "Substituting gmake for make."
2666 echo "Hopefully test is built into your sh."
2669 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2670 echo "Using the test built into your sh."
2678 echo "Hopefully echo is built into your sh."
2683 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2684 $echo $n "hi there$c" >foo1
2685 echo $n "hi there$c" >foo2
2686 if cmp foo1 foo2 >/dev/null 2>&1; then
2687 echo "They are compatible. In fact, they may be identical."
2694 They are not compatible! You are probably running ksh on a non-USG system.
2695 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2696 have echo built in and we may have to run some Bourne shell scripts. That
2697 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2700 $echo $n "The star should be here-->$c"
2707 # This question was auctioned at YAPC::Europe-2007 in Vienna
2708 # I never promised you could answer it. I only auctioned the question.
2710 The following message is sponsored by
2712 Dresden.pm<--The stars should be here.
2714 Dear Perl user, system administrator or package
2715 maintainer, the Perl community sends greetings to
2716 you. Do you (emblematical) greet back [Y/n]? n
2720 : Check what type of C compiler we use
2724 cat <<'EOSC' >>trygcc
2729 int main(int argc, char *argv[]) {
2733 if $cc -o try $ccflags $ldflags try.c; then
2736 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2742 # Skip this test because it gives a false match on output like:
2743 # ./trygcc: line 23: cc: command not found
2744 # case "`$cc -v -c try.c 2>&1`" in
2745 # *gcc*) trygcc=no ;;
2747 if $test X"$trygcc" = Xyes; then
2748 if gcc -o try -c try.c; then
2750 echo "You seem to have a working gcc, though." >&4
2751 # Switching compilers may undo the work of hints files.
2752 # The most common problem is -D_REENTRANT for threads.
2753 # This heuristic catches that case, but gets false positives
2754 # if -Dusethreads was not actually specified. Better to
2755 # bail out here with a useful message than fail
2756 # mysteriously later. Should we perhaps just try to
2757 # re-invoke Configure -Dcc=gcc config_args ?
2758 if $test -f usethreads.cbu; then
2761 *** However, any setting of the C compiler flags (e.g. for thread support)
2762 *** will be lost. It may be necessary for you to restart Configure and
2763 *** add -Dcc=gcc to your Configure command line.
2766 rp="Would you like to go ahead and try gcc anyway?"
2769 rp="Would you like to use it?"
2772 if $test -f myread; then
2775 if $test -f UU/myread; then
2778 echo "Cannot find myread, sorry. Aborting." >&2
2783 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2796 cat <<'EOSC' >>checkcc
2801 int main(int argc, char *argv[]) {
2805 if $cc -o try $ccflags $ldflags try.c; then
2808 if $test X"$despair" = Xyes; then
2809 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2812 You need to find a working C compiler.
2813 Either (purchase and) install the C compiler supplied by your OS vendor,
2814 or for a free C compiler try http://gcc.gnu.org/
2815 I cannot continue any further, aborting.
2824 : determine whether symbolic links are supported
2827 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2828 echo "Symbolic links are supported." >&4
2831 echo "Symbolic links are NOT supported." >&4
2836 : determine whether symbolic links are supported
2840 echo "Checking how to test for symbolic links..." >&4
2842 if $test "X$issymlink" = X; then
2844 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2845 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2847 if test $? = 0; then
2850 echo "Your builtin 'test -h' may be broken." >&4
2853 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2856 if test -f "$p/$test"; then
2865 echo "Trying external '$test -h'." >&4
2866 issymlink="$test -h"
2867 if $test ! -h sym >/dev/null 2>&1; then
2868 echo "External '$test -h' is broken, too." >&4
2876 if $test "X$issymlink" = X; then
2877 if $test -L sym 2>/dev/null; then
2878 issymlink="$test -L"
2879 echo "The builtin '$test -L' worked." >&4
2882 if $test "X$issymlink" != X; then
2883 echo "You can test for symbolic links with '$issymlink'." >&4
2885 echo "I do not know how you can test for symbolic links." >&4
2889 *) echo "No symbolic links, so not testing for their testing..." >&4
2893 : Make symlinks util
2894 case "$mksymlinks" in
2897 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2900 *) case "$lns:$issymlink" in
2901 *"ln"*" -s:"*"test -"?)
2902 echo "Creating the symbolic links..." >&4
2904 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2914 print "# dir = ", dir, "file = ", file
2915 mf[dir] = mf[dir]" "source"/"dir"/"file;
2918 if (d != ".") { print("mkdir -p "d) }
2919 print("ln -sf "mf[d]" "d);
2921 }' source="$src" > UU/mksymlinks.$$
2925 if test ! -d t/base; then
2926 echo "Failed to create the subdirectories. Aborting." >&4
2930 if test ! -f t/base/lex.t; then
2931 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2934 if test ! -f win32/win32.c; then
2935 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2940 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2948 : Check for Cross-Compilation
2949 if $test "X$targethost" = "X"; then
2952 if $test "X$targetenv" = "X"; then
2955 case "$usecrosscompile" in
2957 $echo "Cross-compiling..."
2960 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2961 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2962 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2963 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2964 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2965 # leave out ld, choosing it is more complex
2966 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2967 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2968 # We are in a weird spot. Just before us, some values
2969 # were 'saved', to be restored after the hints are
2970 # run. This means that the changes we made to ar,
2971 # nm and ranlib will get reverted.
2972 # To avoid that, we hijack the saving mechanism and
2973 # have it save our new values.
2974 for file in ar nm ranlib; do
2976 eval $file=$xxx$_exe
2981 case "$targetarch" in
2982 '') echo "Targetarch not defined." >&4; croak=y ;;
2983 *) echo "Using targetarch $targetarch." >&4 ;;
2985 case "$targethost" in
2986 '') echo "Targethost not defined." >&4; croak=n ;;
2987 *) echo "Using targethost $targethost." >&4
2992 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2994 : compile a host miniperl and generate_uudmap, unless we got passed them
2995 if $test "X$hostperl" = X; then
2996 echo "Building host miniperl and generate_uudmap binaries" >&4
3004 $src/Configure -des -Dusedevel -Dmksymlinks
3006 case "$hostgenerate" in
3007 '') $make generate_uudmap
3008 hostgenerate=$src/host/generate_uudmap
3010 "$undef") hostgenerate=''
3013 hostperl=$src/host/miniperl
3016 hostosname=`$hostperl -le 'print $^O'`
3019 usecrosscompile="$undef"
3023 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3024 case "$targethost" in
3025 '') echo "Checking for cross-compile" >&4
3026 case "$usecrosscompile$multiarch" in
3027 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3028 if [ -f Makefile ]; then
3030 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3032 echo "Configure done."
3036 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3043 *) echo "Using targethost $targethost." >&4
3045 /*) run=$src/Cross/run
3046 targetmkdir=$src/Cross/mkdir
3048 from=$src/Cross/from
3050 *) pwd=`$test -f ../Configure & cd ..; pwd`
3052 targetmkdir=$pwd/Cross/mkdir
3054 from=$pwd/Cross/from
3057 case "$targetrun" in
3058 '') targetrun=ssh ;;
3063 case "$targetfrom" in
3064 '') targetfrom=scp ;;
3068 from=$from-$targetfrom
3069 case "$targetdir" in
3071 echo "Guessing targetdir $targetdir." >&4
3074 case "$targetuser" in
3076 echo "Guessing targetuser $targetuser." >&4
3079 case "$targetport" in
3081 echo "Guessing targetport $targetport." >&4
3084 case "$targetfrom" in
3088 case "$targetrun" in
3108 '') cwd=$targetdir ;;
3113 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3119 *) echo "Unknown targetrun '$targetrun'" >&4
3123 case "$targetmkdir" in
3125 cat >$targetmkdir <<EOF
3127 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3129 $chmod a+rx $targetmkdir
3131 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3143 $targetmkdir \`dirname \$f\`
3144 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3147 $targetmkdir $targetdir/\`dirname \$f\`
3148 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3161 $mkdir -p $targetdir/\`dirname \$f\`
3162 $cp \$f $targetdir/\$f || exit 1
3165 $targetmkdir $targetdir/\`dirname \$f\`
3166 $cp \$f $targetdir/\$f || exit 1
3173 *) echo "Unknown targetto '$targetto'" >&4
3177 case "$targetfrom" in
3184 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3189 cp) cat >$from <<EOF
3194 cp $targetdir/\$f . || exit 1
3199 *) echo "Unknown targetfrom '$targetfrom'" >&4
3203 if $test ! -f $run; then
3204 echo "Target 'run' script '$run' not found." >&4
3208 if $test ! -f $to; then
3209 echo "Target 'to' script '$to' not found." >&4
3213 if $test ! -f $from; then
3214 echo "Target 'from' script '$from' not found." >&4
3218 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3222 Using '$run' for remote execution,
3223 and '$from' and '$to'
3224 for remote file transfer.
3230 usecrosscompile="$undef"
3235 : see whether [:lower:] and [:upper:] are supported character classes
3237 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3239 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3243 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3244 # (0xd9 and 0xe2), therefore that is a nice testing point.
3245 if test "X$up" = X -o "X$low" = X; then
3246 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3252 if test "X$up" = X -o "X$low" = X; then
3253 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3259 if test "X$up" = X -o "X$low" = X; then
3260 case "`echo RS | od -x 2>/dev/null`" in
3262 echo "Hey, this might be EBCDIC." >&4
3263 if test "X$up" = X -o "X$low" = X; then
3264 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3265 rs) up='[A-IJ-RS-Z]'
3270 if test "X$up" = X -o "X$low" = X; then
3271 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3281 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3283 echo "Using $up and $low to convert case." >&4
3286 echo "I don't know how to translate letters from upper to lower case." >&4
3287 echo "Your tr is not acting any way I know of." >&4
3291 : set up the translation script tr, must be called with ./tr of course
3295 '[A-Z][a-z]') exec $tr '$up' '$low';;
3296 '[a-z][A-Z]') exec $tr '$low' '$up';;
3303 : Try to determine whether config.sh was made on this system
3304 case "$config_sh" in
3306 myuname=`$uname -a 2>/dev/null`
3307 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3308 # Downcase everything to avoid ambiguity.
3309 # Remove slashes and single quotes so we can use parts of this in
3310 # directory and file names.
3311 # Remove newlines so myuname is sane to use elsewhere.
3312 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3313 # because the A-Z/a-z are not consecutive.
3314 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3315 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3316 newmyuname="$myuname"
3318 case "$knowitall" in
3320 if test -f ../config.sh; then
3321 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3322 eval "`grep myuname= ../config.sh`"
3324 if test "X$myuname" = "X$newmyuname"; then
3332 : Get old answers from old config file if Configure was run on the
3333 : same system, otherwise use the hints.
3336 if test -f config.sh; then
3338 rp="I see a config.sh file. Shall I use it to set the defaults?"
3341 n*|N*) echo "OK, I'll ignore it."
3342 mv config.sh config.sh.old
3343 myuname="$newmyuname"
3345 *) echo "Fetching default answers from your old config.sh file..." >&4
3353 : Older versions did not always set $sh. Catch re-use of such
3363 if test ! -f config.sh; then
3366 First time through, eh? I have some defaults handy for some systems
3367 that need some extra help getting the Configure answers right:
3370 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3372 : Half the following guesses are probably wrong... If you have better
3373 : tests or hints, please send them to https://github.com/Perl/perl5/issues
3374 : The metaconfig authors would also appreciate a copy...
3375 $test -f /irix && osname=irix
3376 $test -f /xenix && osname=sco_xenix
3377 $test -f /dynix && osname=dynix
3378 $test -f /dnix && osname=dnix
3379 $test -f /lynx.os && osname=lynxos
3380 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3381 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3382 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3383 $test -f /bin/mips && /bin/mips && osname=mips
3384 $test -d /usr/apollo/bin && osname=apollo
3385 $test -f /etc/saf/_sactab && osname=svr4
3386 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3387 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3388 $test -f /sys/utilities/MultiView && osname=amigaos
3389 if $test -d /MachTen -o -d /MachTen_Folder; then
3391 if $test -x /sbin/version; then
3392 osvers=`/sbin/version | $awk '{print $2}' |
3393 $sed -e 's/[A-Za-z]$//'`
3394 elif $test -x /usr/etc/version; then
3395 osvers=`/usr/etc/version | $awk '{print $2}' |
3396 $sed -e 's/[A-Za-z]$//'`
3402 $test -f /sys/posix.dll &&
3403 $test -f /usr/bin/what &&
3404 set X `/usr/bin/what /sys/posix.dll` &&
3405 $test "$3" = UWIN &&
3409 if $test -f $uname; then
3417 umips) osname=umips ;;
3420 [23]100) osname=mips ;;
3422 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3423 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3426 elif $test -f /etc/kconfig; then
3428 if test "$lns" = "$ln -s"; then
3430 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3432 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3439 if test -n "$DJGPP"; then
3448 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3450 # oslevel can fail with:
3451 # oslevel: Unable to acquire lock.
3452 *not\ found) osvers="$4"."$3" ;;
3453 '<3240'|'<>3240') osvers=3.2.0 ;;
3454 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3455 '=3250'|'>3250') osvers=3.2.5 ;;
3459 bitrig) osname=bitrig
3462 bsd386) osname=bsd386
3465 cygwin*) osname=cygwin
3468 *dc.osx) osname=dcosx
3474 domainos) osname=apollo
3480 dragonfly) osname=dragonfly
3483 dynixptx*) osname=dynixptx
3484 osvers=`echo "$4"|sed 's/^v//'`
3486 freebsd) osname=freebsd
3488 genix) osname=genix ;;
3492 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3505 $test -f /system/lib/libandroid.so && osname=linux-android
3512 netbsd*) osname=netbsd
3515 news-os) osvers="$3"
3517 4*) osname=newsos4 ;;
3521 nonstop-ux) osname=nonstopux ;;
3522 openbsd) osname=openbsd
3528 POSIX-BC | posix-bc ) osname=posix-bc
3531 powerux | power_ux | powermax_os | powermaxos | \
3532 powerunix | power_unix) osname=powerux
3538 solaris) osname=solaris
3540 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3547 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3551 titanos) osname=titanos
3560 ultrix) osname=ultrix
3563 osf1|mls+) case "$5" in
3566 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3569 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3572 hp*) osname=hp_osf1 ;;
3573 mips) osname=mips_osf1 ;;
3576 # UnixWare 7.1.2 is known as Open UNIX 8
3577 openunix|unixware) osname=svr5
3585 $2) case "$osname" in
3589 : svr4.x or possibly later
3599 if test -f /stand/boot ; then
3600 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3601 if test -n "$INITPROG" -a -f "$INITPROG"; then
3602 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3603 if test -n "$isesix"; then
3611 *) if test -f /etc/systemid; then
3613 set `echo $3 | $sed 's/\./ /g'` $4
3614 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3616 elif $test -f $src/hints/sco_$1_$2.sh; then
3618 elif $test -f $src/hints/sco_$1.sh; then
3623 '') : Still unknown. Probably a generic Sys V.
3632 *) case "$osname" in
3633 '') : Still unknown. Probably a generic BSD.
3641 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3642 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3643 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3646 $rm -f UU/kernel.what
3647 elif test -d c:/. -o -n "$is_os2" ; then
3654 case "$targetarch" in
3657 case "$targetarch" in
3659 # Will load qnx.sh, which should change osname to nto
3664 # Catch arm-linux-androideabi, mipsel-linux-android,
3665 # and i686-linux-android
3666 osname=linux-android
3670 # Something like arm-linux-gnueabihf is really just
3677 # XXX perhaps we should just assume
3678 # osvers to be 2, or maybe take the value
3679 # from targetarch. Using $run before the
3680 # hints are run is somewhat icky.
3681 set X `$run $uname -a 2>/dev/null`
3684 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3689 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3696 : Now look for a hint file osname_osvers, unless one has been
3697 : specified already.
3700 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3701 : Also try without trailing minor version numbers.
3702 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3703 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3704 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3705 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3708 *) case "$osvers" in
3711 *) if $test -f $src/hints/$file.sh ; then
3713 elif $test -f $src/hints/$xfile.sh ; then
3715 elif $test -f $src/hints/$xxfile.sh ; then
3717 elif $test -f $src/hints/$xxxfile.sh ; then
3719 elif $test -f $src/hints/$xxxxfile.sh ; then
3721 elif $test -f "$src/hints/${osname}.sh" ; then
3730 if $test -f Policy.sh ; then
3733 none) dflt="Policy" ;;
3734 *) dflt="Policy $dflt" ;;
3739 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3743 if $test -f Policy.sh ; then
3746 There's also a Policy hint file available, which should make the
3747 site-specific (policy) questions easier to answer.
3754 You may give one or more space-separated answers, or "none" if appropriate.
3755 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3756 previous run of Configure, you may specify it as well as or instead of
3757 OS-specific hints. If hints are provided for your OS, you should use them:
3758 although Perl can probably be built without hints on many platforms, using
3759 hints often improve performance and may enable features that Configure can't
3760 set up on its own. If there are no hints that match your OS, specify "none";
3761 DO NOT give a wrong version or a wrong OS.
3765 rp="Which of these apply, if any?"
3768 for file in $tans; do
3769 if $test X$file = XPolicy -a -f Policy.sh; then
3771 $cat Policy.sh >> UU/config.sh
3772 elif $test -f $src/hints/$file.sh; then
3773 . $src/hints/$file.sh
3774 $cat $src/hints/$file.sh >> UU/config.sh
3775 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3778 : Give one chance to correct a possible typo.
3779 echo "$file.sh does not exist"
3781 rp="hint to use instead?"
3783 for file in $ans; do
3784 if $test -f "$src/hints/$file.sh"; then
3785 . $src/hints/$file.sh
3786 $cat $src/hints/$file.sh >> UU/config.sh
3787 elif $test X$ans = X -o X$ans = Xnone ; then
3790 echo "$file.sh does not exist -- ignored."
3797 : Remember our hint file for later.
3798 if $test -f "$src/hints/$file.sh" ; then
3808 echo "Fetching default answers from $config_sh..." >&4
3812 cp $config_sh config.sh 2>/dev/null
3824 : Restore computed paths
3825 for file in $loclist $trylist; do
3826 eval $file="\$_$file"
3831 Configure uses the operating system name and version to set some defaults.
3832 The default value is probably right if the name rings a bell. Otherwise,
3833 since spelling matters for me, either accept the default or answer "none"
3840 ''|' '|none) dflt=none ;;
3841 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3844 *) dflt="$osname" ;;
3846 rp="Operating system name?"
3850 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3856 ''|' '|none) dflt=none ;;
3857 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3858 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3860 ''|' ') dflt=none ;;
3865 *) dflt="$osvers" ;;
3867 rp="Operating system version?"
3877 : who configured the system
3878 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3881 cf_by=`(logname) 2>/dev/null`
3884 cf_by=`(whoami) 2>/dev/null`
3886 "") cf_by=unknown ;;
3891 : decide how portable to be. Allow command line overrides.
3892 case "$d_portable" in
3894 *) d_portable="$define" ;;
3897 : set up shell script to do ~ expansion
3903 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3906 if $test -f /bin/csh; then
3907 /bin/csh -f -c "glob \$1"
3912 name=\`$expr x\$1 : '..\([^/]*\)'\`
3913 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3914 if $test ! -d "\$dir"; then
3916 echo "\$me: can't locate home directory for: \$name" >&2
3921 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3937 : now set up to get a file name
3941 cat <<'EOSC' >>getfile
3957 : getfile will accept an answer from the comma-separated list
3958 : enclosed in parentheses even if it does not meet other criteria.
3959 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3960 fn=`echo $fn | sed 's/(.*)//'`
3966 loc_file=`expr $fn : '.*:\(.*\)'`
3967 fn=`expr $fn : '\(.*\):.*'`
3975 */*) fullpath=true;;
3984 *e*) exp_file=true;;
3987 *p*) nopath_ok=true;;
3992 *d*) type='Directory';;
3993 *l*) type='Locate';;
3998 Locate) what='File';;
4003 case "$d_portable" in
4011 while test "$type"; do
4016 true) rp="$rp (~name ok)";;
4019 if test -f UU/getfile.ok && \
4020 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4039 value=`UU/filexp $ans`
4042 if test "$ans" != "$value"; then
4043 echo "(That expands to $value on this system.)"
4057 /*) value="$ansexp" ;;
4058 [a-zA-Z]:/*) value="$ansexp" ;;
4063 echo "I shall only accept a full path name, as in /bin/ls." >&4
4064 echo "Use a ! shell escape if you wish to check pathnames." >&4
4067 echo "Please give a full path name, starting with slash." >&4
4070 echo "Note that using ~name is ok provided it expands well." >&4
4083 for fp in $gfpth; do
4084 if test "X$fp" = X.; then
4089 if test -f "$pf"; then
4091 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4093 echo "($value is not a plain file, but that's ok.)"
4096 if test X"$type" = X; then
4103 for fp in $gfpth; do
4104 if test "X$fp" = X.; then
4109 direxp="$fp/$ansexp"
4111 if test -d "$direxp"; then
4119 if test -d "$ansexp"; then
4120 echo "(Looking for $loc_file in directory $value.)"
4121 value="$value/$loc_file"
4122 ansexp="$ansexp/$loc_file"
4124 if test -f "$ansexp"; then
4127 case "$nopath_ok" in
4128 true) case "$value" in
4130 *) echo "Assuming $value will be in people's path."
4146 if test "$fastread" = yes; then
4151 rp="$what $value doesn't exist. Use that name anyway?"
4170 test "X$gfpthkeep" != Xy && gfpth=""
4173 : determine root of directory hierarchy where package will be installed.
4175 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4182 By default, $package will be installed in $dflt/bin, manual pages
4183 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4184 installation directories. Typically this is something like /usr/local.
4185 If you wish to have binaries under /usr/bin but other parts of the
4186 installation under /usr/local, that's ok: you will be prompted
4187 separately for each of the installation directories, the prefix being
4188 only used to set the defaults.
4192 rp='Installation prefix to use?'
4199 *) oldprefix="$prefix";;
4205 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4211 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4213 *) prefixexp="$ansexp"
4216 : allow them to override the AFS root
4219 *) afsroot=$afsroot ;;
4225 $define|true) afs=true ;;
4226 $undef|false) afs=false ;;
4227 *) if $test -d $afsroot; then
4235 echo "AFS may be running... I'll be extra cautious then..." >&4
4237 echo "AFS does not seem to be running..." >&4
4240 : determine installation prefix for where package is to be installed.
4244 Since you are running AFS, I need to distinguish the directory in which
4245 files will reside from the directory in which they are installed (and from
4246 which they are presumably copied to the former directory by occult means).
4249 case "$installprefix" in
4250 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4251 *) dflt="$installprefix";;
4256 In some special cases, particularly when building $package for distribution,
4257 it is convenient to distinguish the directory in which files should be
4258 installed from the directory ($prefix) in which they will
4259 eventually reside. For most users, these two directories are the same.
4262 case "$installprefix" in
4264 *) dflt=$installprefix;;
4268 rp='What installation prefix should I use for installing files?'
4270 installprefix="$ans"
4271 installprefixexp="$ansexp"
4273 : Perform the prefixexp/installprefixexp correction if necessary
4274 cat <<EOS >installprefix
4277 cat <<'EOSC' >>installprefix
4278 : Change installation prefix, if necessary.
4279 if $test X"$prefix" != X"$installprefix"; then
4280 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4282 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4285 chmod +x installprefix
4286 $eunicefix installprefix
4288 : Set variables such as privlib and privlibexp from the output of ./getfile
4289 : performing the prefixexp/installprefixexp correction if necessary.
4290 cat <<EOS >setprefixvar
4293 cat <<'EOSC' >>setprefixvar
4294 eval "${prefixvar}=\"\$ans\""
4295 eval "${prefixvar}exp=\"\$ansexp\""
4298 chmod +x setprefixvar
4299 $eunicefix setprefixvar
4301 : set up the script used to warn in case of inconsistency
4310 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4312 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4313 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4318 echo "*** WHOA THERE!!! ***" >&4
4319 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4322 rp=" Keep the $hint value?"
4325 y) td=$was; tu=$was;;
4329 : function used to set '$1' to '$val'
4330 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4332 $define$undef) . ./whoa; eval "$var=\$td";;
4333 $undef$define) . ./whoa; eval "$var=\$tu";;
4334 *) eval "$var=$val";;
4337 : get the patchlevel
4339 echo "Getting the current patchlevel..." >&4
4340 if $test -r $rsrc/patchlevel.h;then
4341 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4342 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4343 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4344 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4345 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4346 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4347 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4356 $echo "(You do not have patchlevel.h. Eek.)"
4358 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4359 version_patchlevel_string="version $patchlevel subversion $subversion"
4360 case "$perl_patchlevel" in
4362 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4363 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4367 $echo "(You have $package $version_patchlevel_string.)"
4371 : XXX Should be a Configure test for double-dots in filenames.
4372 version=`echo $revision $patchlevel $subversion | \
4373 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4374 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4375 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4378 version=`echo $revision $patchlevel $subversion | \
4379 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4380 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4381 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4384 : Special case the 5.005_xx maintenance series, which used 5.005
4385 : without any subversion label as a subdirectory in $sitelib
4386 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4387 api_versionstring='5.005'
4390 : Do we want threads support and if so, what type
4391 case "$usethreads" in
4392 $define|true|[yY]*) dflt='y';;
4393 *) # Catch case where user specified ithreads or 5005threads but
4394 # forgot -Dusethreads (A.D. 4/2002)
4395 case "$useithreads$use5005threads" in
4396 *$define*) dflt='y';;
4403 Perl can be built to offer a form of threading support on some systems
4404 To do so, Configure can be run with -Dusethreads.
4406 Note that Perl built with threading support runs slightly slower
4407 and uses slightly more memory than plain Perl.
4409 If this doesn't make any sense to you, just accept the default '$dflt'.
4411 rp='Build a threading Perl?'
4414 y|Y) val="$define" ;;
4420 if $test $patchlevel -lt 9; then
4421 case "$usethreads" in
4423 : Default to ithreads unless overridden on command line or with
4426 case "$use5005threads" in
4428 echo "5.005 threads are no longer supported"
4432 case "$useithreads" in
4433 $undef|false|[nN]*) dflt='n';;
4435 rp='Use the newer interpreter-based ithreads?'
4438 y|Y) val="$define" ;;
4443 : Now set use5005threads to the opposite value.
4444 case "$useithreads" in
4445 $define) val="$undef" ;;
4452 useithreads="$undef"
4453 use5005threads="$undef"
4457 case "$useithreads$use5005threads" in
4461 You cannot have both the ithreads and the 5.005 threads enabled
4462 at the same time. Disabling the 5.005 threads since they are
4463 much less stable than the ithreads.
4466 use5005threads="$undef"
4471 : perl-5.9.x and later
4473 if test X"$usethreads" = "X$define"; then
4474 case "$use5005threads" in
4478 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4485 use5005threads="$undef"
4486 useithreads="$usethreads"
4489 case "$d_oldpthreads" in
4490 '') : Configure tests would be welcome here. For now, assume undef.
4492 *) val="$d_oldpthreads" ;;
4498 : Look for a hint-file generated 'call-back-unit'. If the
4499 : user has specified that a threading perl is to be built,
4500 : we may need to set or change some other defaults.
4501 if $test -f usethreads.cbu; then
4502 echo "Your platform has some specific hints regarding threaded builds, using them..."
4505 case "$usethreads" in
4506 "$define"|true|[yY]*)
4508 (Your platform does not have any specific hints for threaded builds.
4509 Assuming POSIX threads, then.)
4515 : Check if multiplicity is required
4518 Perl can be built so that multiple Perl interpreters can coexist
4519 within the same Perl executable.
4522 case "$useithreads" in
4525 This multiple interpreter support is required for interpreter-based threads.
4529 *) case "$usemultiplicity" in
4530 $define|true|[yY]*) dflt='y';;
4534 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4535 rp='Build Perl for multiplicity?'
4538 y|Y) val="$define" ;;
4546 : Check if morebits is requested
4547 case "$usemorebits" in
4548 "$define"|true|[yY]*)
4549 use64bitint="$define"
4550 uselongdouble="$define"
4551 usemorebits="$define"
4553 *) usemorebits="$undef"
4557 : Determine the C compiler to be used
4563 rp="Use which C compiler?"
4567 : See whether they have no cc but they do have gcc
4569 if $test -f cc.cbu; then
4574 : make some quick guesses about what we are up against
4576 $echo $n "Hmm... $c"
4586 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4587 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4589 echo "Looks kind of like an OSF/1 system, but we'll see..."
4591 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4592 xxx=`./loc addbib blurfl $pth`
4593 if $test -f $xxx; then
4594 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4598 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4599 echo "Looks kind of like an extended USG system, but we'll see..."
4601 echo "Looks kind of like a USG system, but we'll see..."
4605 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4606 echo "Looks kind of like a BSD system, but we'll see..."
4610 echo "Looks kind of like a Version 7 system, but we'll see..."
4613 case "$eunicefix" in
4616 There is, however, a strange, musty smell in the air that reminds me of
4617 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4621 : it so happens the Eunice I know will not run shell scripts in Unix format
4625 echo "Congratulations. You aren't running Eunice."
4629 : Detect OS2. The p_ variable is set above in the Head.U unit.
4630 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4631 : semicolon as a patch separator
4636 I have the feeling something is not exactly right, however...don't tell me...
4637 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4638 (Or you may be running DOS with DJGPP.)
4643 if test -f /xenix; then
4644 echo "Actually, this looks more like a XENIX system..."
4649 echo "It's not Xenix..."
4654 if test -f /venix; then
4655 echo "Actually, this looks more like a VENIX system..."
4662 echo "Nor is it Venix..."
4665 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4666 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4669 : Check if we are using GNU gcc and what its version is
4671 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4675 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4677 printf("%s\n", __VERSION__);
4679 printf("%s\n", "1");
4685 if $cc -o try $ccflags $ldflags try.c; then
4686 gccversion=`$run ./try`
4687 case "$gccversion" in
4688 '') echo "You are not using GNU cc." ;;
4689 *) echo "You are using GNU cc $gccversion."
4695 echo "*** WHOA THERE!!! ***" >&4
4696 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4697 case "$knowitall" in
4699 echo " You'd better start hunting for one and let me know about it." >&4
4705 case "$gccversion" in
4706 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4708 case "$gccversion" in
4709 '') gccosandvers='' ;;
4710 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4711 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4713 case "$gccosandvers" in
4714 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4715 $osname$osvers) ;; # looking good
4716 $osname*) cat <<EOM >&4
4718 *** WHOA THERE!!! ***
4720 Your gcc has not been compiled for the exact release of
4721 your operating system ($gccosandvers versus $osname$osvers).
4723 In general it is a good idea to keep gcc synchronized with
4724 the operating system because otherwise serious problems
4725 may ensue when trying to compile software, like Perl.
4727 I'm trying to be optimistic here, though, and will continue.
4728 If later during the configuration and build icky compilation
4729 problems appear (headerfile conflicts being the most common
4730 manifestation), I suggest reinstalling the gcc to match
4731 your operating system release.
4735 *) gccosandvers='' ;; # failed to parse, better be silent
4743 # gcc 3.* complain about adding -Idirectories that they already know about,
4744 # so we will take those off from locincpth.
4745 case "$gccversion" in
4747 echo "main(){}">try.c
4748 for incdir in $locincpth; do
4749 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4750 grep '^c[cp]p*[01]: warning: changing search order '`
4751 if test "X$warn" != X; then
4752 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4758 # gcc 4.9 by default does some optimizations that break perl.
4759 # see ticket 121505.
4761 # The -fwrapv disables those optimizations (and probably others,) so
4762 # for gcc 4.9 (and later, since the optimizations probably won't go
4763 # away), add -fwrapv unless the user requests -fno-wrapv, which
4764 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4765 # which turns the overflows -fwrapv ignores into runtime errors.
4766 case "$gccversion" in
4767 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4769 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4770 *) ccflags="$ccflags -fwrapv" ;;
4774 : What should the include directory be ?
4775 : Use sysroot if set, so findhdr looks in the right place.
4777 $echo $n "Hmm... $c"
4778 dflt="$sysroot/usr/include"
4781 if $test -f /bin/mips && /bin/mips; then
4782 echo "Looks like a MIPS system..."
4783 $cat >usr.c <<'EOCP'
4784 #ifdef SYSTYPE_BSD43
4788 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4789 dflt='/bsd43/usr/include'
4793 mips_type='System V'
4795 $rm -f usr.c usr.out
4796 echo "and you're compiling with the $mips_type compiler and libraries."
4800 echo "Doesn't look like a MIPS system."
4810 case "$xxx_prompt" in
4813 rp='Where are the include files you want to use?'
4821 : see how we invoke the C preprocessor
4823 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4824 cat <<'EOT' >testcpp.c
4830 if test ! -f cppstdin; then
4831 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4832 # AIX cc -E doesn't show the absolute headerfile
4833 # locations but we'll cheat by using the -M flag.
4834 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
4836 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4839 echo "Keeping your $hint cppstdin wrapper."
4842 wrapper=`pwd`/cppstdin
4846 if $test "X$cppstdin" != "X" && \
4847 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4848 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4850 echo "You used to use $cppstdin $cppminus so we'll use that again."
4852 '') echo "But let's see if we can live without a wrapper..." ;;
4854 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4857 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4860 echo "(However, $cpprun $cpplast does not work, let's see...)"
4868 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4875 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4876 $cc -E <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4878 echo "Yup, it does."
4879 x_cpp="$cc $cppflags -E"
4881 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4882 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4884 echo "Yup, it does."
4885 x_cpp="$cc $cppflags -E"
4887 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4888 $cc -P <testcpp.c >testcpp.out 2>&1; \
4889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4890 echo "Yipee, that works!"
4891 x_cpp="$cc $cppflags -P"
4893 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4894 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4895 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4896 echo "At long last!"
4897 x_cpp="$cc $cppflags -P"
4899 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4900 $cpp <testcpp.c >testcpp.out 2>&1; \
4901 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4903 x_cpp="$cpp $cppflags"
4905 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4906 $cpp - <testcpp.c >testcpp.out 2>&1; \
4907 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4908 echo "Hooray, it works! I was beginning to wonder."
4909 x_cpp="$cpp $cppflags"
4911 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4912 $wrapper <testcpp.c >testcpp.out 2>&1; \
4913 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4919 rp="No dice. I can't find a C preprocessor. Name one:"
4923 $x_cpp <testcpp.c >testcpp.out 2>&1
4924 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4925 echo "OK, that will do." >&4
4927 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4942 echo "Perhaps can we force $cc -E using a wrapper..."
4943 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4944 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4950 echo "Nope, we'll have to live without it..."
4964 "$wrapper"|'cppstdin') ;;
4965 *) $rm -f $wrapper;;
4967 $rm -f testcpp.c testcpp.out
4969 : Adjust cppfilter for path component separator
4971 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4972 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4976 : Use gcc to determine libpth and incpth
4977 # If using gcc or clang, we can get better values for libpth, incpth
4978 # and usrinc directly from the compiler.
4979 # Note that ccname for clang is also gcc.
4982 $echo 'extern int foo;' > try.c
4983 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4985 if $test $# -gt 0; then
4987 incpth="`$echo $incpth|$sed 's/^ //'`"
4989 j="`$echo $i|$sed 's,/include$,/lib,'`"
4990 if $test -d $j; then
4994 libpth="`$echo $libpth|$sed 's/^ //'`"
4995 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4996 if $test -d $xxx; then
4999 *) libpth="$libpth $xxx";;
5006 '') for i in $incpth; do
5007 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5015 case "$usecrosscompile" in
5018 '') echo "Incpth not defined." >&4; croak=y ;;
5019 *) echo "Using incpth '$incpth'." >&4 ;;
5022 '') echo "Libpth not defined." >&4; croak=y ;;
5023 *) echo "Using libpth '$libpth'." >&4 ;;
5026 '') echo "Usrinc not defined." >&4; croak=y ;;
5027 *) echo "Using usrinc $usrinc." >&4 ;;
5031 if test "X$sysroot" = X; then
5032 echo "Cannot continue, aborting." >&4; exit 1
5034 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5043 : Default value for incpth is just usrinc
5045 '') incpth="$usrinc";;
5048 : Set private lib path
5051 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5056 '') dlist="$loclibpth $plibpth $glibpth";;
5057 *) dlist="$libpth";;
5060 : Now check and see which directories actually exist, avoiding duplicates
5063 if $test -d $xxx; then
5066 *) libpth="$libpth $xxx";;
5072 Some systems have incompatible or broken versions of libraries. Among
5073 the directories listed in the question below, please remove any you
5074 know not to be holding relevant libraries, and add any that are needed.
5075 Say "none" for none.
5079 if test "X$sysroot" != X; then
5081 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5094 rp="Directories to use for library searches?"
5101 : compute shared library extension
5104 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5114 On some systems, shared libraries may be available. Answer 'none' if
5115 you want to suppress searching of shared libraries for the remainder
5116 of this configuration.
5119 rp='What is the file extension used for shared libraries?'
5123 : Does target system insist that shared library basenames are unique
5126 Some dynamic loaders assume that the *basename* of shared library filenames
5127 are globally unique. We'll default this to undef as we assume your system
5128 is not this weird. Set to defined if you're on one of them.
5133 rp='Make shared library basenames unique?'
5136 y|Y) val="$define" ;;
5139 set d_libname_unique
5142 : Define several unixisms.
5143 : Hints files or command line option can be used to override them.
5144 : The convoluted testing is in case hints files set either the old
5147 '') case "$exe_ext" in
5149 *) _exe="$exe_ext" ;;
5154 '') case "$lib_ext" in
5161 '') case "$obj_ext" in
5168 '') case "$path_sep" in
5179 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5181 : Which makefile gets called first. This is used by make depend.
5182 case "$firstmakefile" in
5183 '') firstmakefile='makefile';;
5186 : Check is we will use socks
5188 $define|true|[yY]*) dflt='y';;
5193 Perl can be built to use the SOCKS proxy protocol library. To do so,
5194 Configure must be run with -Dusesocks. If you use SOCKS you also need
5195 to use the PerlIO abstraction layer, this will be implicitly selected.
5197 If this doesn't make any sense to you, just accept the default '$dflt'.
5199 rp='Build Perl for SOCKS?'
5202 y|Y) val="$define" ;;
5208 : Check for uselongdouble support
5210 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5213 case "$uselongdouble" in
5214 $define|true|[yY]*) dflt='y';;
5219 Perl can be built to take advantage of long doubles which
5220 (if available) may give more accuracy and range for floating point numbers.
5222 If this doesn't make any sense to you, just accept the default '$dflt'.
5224 rp='Try to use long doubles if available?'
5227 y|Y) val="$define" ;;
5233 case "$uselongdouble" in
5234 true|[yY]*) uselongdouble="$define" ;;
5237 : Look for a hint-file generated 'call-back-unit'. If the
5238 : user has specified that long doubles should be used,
5239 : we may need to set or change some other defaults.
5240 if $test -f uselongdouble.cbu; then
5241 echo "Your platform has some specific hints regarding long doubles, using them..."
5242 . ./uselongdouble.cbu
5244 case "$uselongdouble" in
5247 (Your platform does not have any specific hints for long doubles.)
5253 : Check if quadmath is requested
5254 case "$usequadmath" in
5255 "$define"|true|[yY]*) usequadmath="$define" ;;
5256 *) usequadmath="$undef" ;;
5259 : Fail if both uselongdouble and usequadmath are requested
5260 case "$usequadmath:$uselongdouble" in
5264 *** You requested the use of the quadmath library and use
5265 *** of long doubles.
5267 *** Please select one or the other.
5273 : Looking for optional libraries
5275 echo "Checking for optional libraries..." >&4
5280 case "$libswanted" in
5281 '') libswanted='c_s';;
5284 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5286 case "$usecbacktrace" in
5287 "$define") libswanted="$libswanted bfd" ;;
5289 case "$usequadmath" in
5290 "$define") libswanted="$libswanted quadmath" ;;
5296 for thisdir in $libpth $xlibpth; do
5297 test -d $thisdir && libspath="$libspath $thisdir"
5299 for thislib in $libswanted; do
5300 for thisdir in $libspath; do
5302 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5303 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5304 $test -f "$xxx" && eval $libscheck
5305 $test -f "$xxx" && libstyle=shared
5306 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5307 $test -f "$xxx" && eval $libscheck
5308 $test -f "$xxx" && libstyle=shared
5310 if test ! -f "$xxx"; then
5311 xxx=$thisdir/lib$thislib.$so
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=shared
5315 if test ! -f "$xxx"; then
5316 xxx=$thisdir/lib$thislib$_a
5317 $test -f "$xxx" && eval $libscheck
5318 $test -f "$xxx" && libstyle=static
5320 if test ! -f "$xxx"; then
5321 xxx=$thisdir/$thislib$_a
5322 $test -f "$xxx" && eval $libscheck
5323 $test -f "$xxx" && libstyle=static
5325 if test ! -f "$xxx"; then
5326 xxx=$thisdir/lib${thislib}_s$_a
5327 $test -f "$xxx" && eval $libscheck
5328 $test -f "$xxx" && libstyle=static
5329 $test -f "$xxx" && thislib=${thislib}_s
5331 if test ! -f "$xxx"; then
5332 xxx=$thisdir/Slib$thislib$_a
5333 $test -f "$xxx" && eval $libscheck
5334 $test -f "$xxx" && libstyle=static
5336 if $test -f "$xxx"; then
5338 shared) echo "Found -l$thislib (shared)." ;;
5339 static) echo "Found -l$thislib." ;;
5340 *) echo "Found -l$thislib ($libstyle)." ;;
5344 *) dflt="$dflt -l$thislib"
5345 libsfound="$libsfound $xxx"
5347 libsfiles="$libsfiles $yyy"
5348 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5349 case " $libsdirs " in
5351 *) libsdirs="$libsdirs $yyy" ;;
5358 if $test ! -f "$xxx"; then
5359 echo "No -l$thislib."
5370 ' '|'') dflt='none';;
5375 In order to compile $package on your machine, a number of libraries
5376 are usually needed. Include any other special libraries here as well.
5377 Say "none" for none. The default list is almost always right.
5381 rp="What libraries to use?"
5388 : determine optimization, if desired, or use for debug flag also
5390 ' '|$undef) dflt='none';;
5392 *) dflt="$optimize";;
5396 By default, $package compiles with the -O flag to use the optimizer.
5397 Alternately, you might want to use the symbolic debugger, which uses
5398 the -g flag (on traditional Unix systems). Either flag can be
5399 specified here. To use neither flag, specify the word "none".
5402 rp="What optimizer/debugger flag should be used?"
5406 'none') optimize=" ";;
5409 : Check what DEBUGGING is required from the command line
5410 : -DEBUGGING or -DDEBUGGING or
5411 : -DEBUGGING=both = -g + -DDEBUGGING
5412 : -DEBUGGING=-g or -Doptimize=-g = -g
5413 : -DEBUGGING=none or -UDEBUGGING =
5414 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5417 *) DEBUGGING=$EBUGGING ;;
5420 case "$DEBUGGING" in
5424 *) optimize="$optimize -g" ;;
5428 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5436 case "$DEBUGGING" in
5437 both|$define) dflt='-DDEBUGGING'
5440 : argument order is deliberate, as the flag will start with - which set could
5441 : think is an option
5442 checkccflag='check=$1; flag=$2; callback=$3;
5444 echo "Checking if your compiler accepts $flag" 2>&1;
5445 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5446 echo "int main(void) { return 0; }" > gcctest.c;
5447 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5448 echo "Yes, it does." 2>&1;
5449 if $test -s gcctest.out ; then
5450 echo "But your platform does not like it:";
5455 echo "Leaving current flags $ccflags alone." 2>&1
5457 *) dflt="$dflt $flag";
5463 echo "Nope, it does not, but that is ok." 2>&1;
5467 : We will not override a previous value, but we might want to
5468 : augment a hint file
5470 default|recommended)
5471 case "$gccversion" in
5472 1.*) dflt="$dflt -fpcc-struct-return" ;;
5474 case "$optimize:$DEBUGGING" in
5475 *-g*:old) dflt="$dflt -DDEBUGGING";;
5477 case "$gccversion" in
5478 2.*) if $test -d /etc/conf/kconfig.d &&
5479 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5481 # Interactive Systems (ISC) POSIX mode.
5486 case "$gccversion" in
5489 ?*) set strict-aliasing -fno-strict-aliasing
5493 # For gcc, adding -pipe speeds up compilations for some, but apparently
5494 # some assemblers can't read from stdin. (It also slows down compilations
5495 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5496 case "$gccversion" in
5502 # on x86_64 (at least) we require an extra library (libssp) in the
5503 # link command line. This library is not named, so I infer that it is
5504 # an implementation detail that may change. Hence the safest approach
5505 # is to add the flag to the flags passed to the compiler at link time,
5506 # as that way the compiler can do the right implementation dependant
5509 amigaos) ;; # -fstack-protector builds but doesn't work
5510 *) case "$gccversion" in
5511 ?*) set stack-protector-strong -fstack-protector-strong
5514 *-fstack-protector-strong*) ;; # It got added.
5515 *) # Try the plain/older -fstack-protector.
5516 set stack-protector -fstack-protector
5527 case "$mips_type" in
5528 *BSD*|'') inclwanted="$locincpth $usrinc";;
5529 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5531 for thisincl in $inclwanted; do
5532 if $test -d $thisincl; then
5533 if $test x$thisincl != x$usrinc; then
5535 *" -I$thisincl "*);;
5536 *) dflt="$dflt -I$thisincl ";;
5542 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5544 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5552 *) dflt="$dflt -D$2";;
5556 set signal.h LANGUAGE_C; eval $inctest
5560 ccflags="$ccflags -DSOCKS"
5565 default|recommended) dflt="$ccflags $dflt" ;;
5566 *) dflt="$ccflags";;
5575 Your C compiler may want other flags. For this question you should include
5576 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5577 but you should NOT include libraries or ld flags like -lwhatever. If you
5578 want $package to honor its debug switch, you should include -DDEBUGGING here.
5579 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5581 To use no flags, specify the word "none".
5587 rp="Any additional cc flags?"
5594 : the following weeds options from ccflags that are of no interest to cpp
5596 '') cppflags="$ccflags" ;;
5597 *) set X $ccflags; shift
5598 case " $cppflags " in
5599 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5600 *) cppflags="$cppflags $ccflags" ;;
5604 case "$gccversion" in
5605 1.*) cppflags="$cppflags -D__GNUC__"
5607 case "$mips_type" in
5609 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5615 echo "Let me guess what the preprocessor flags are..." >&4
5629 *) ftry="$previous $flag";;
5631 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5632 >cpp1.out 2>/dev/null && \
5633 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5634 >cpp2.out 2>/dev/null && \
5635 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5636 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5638 cppflags="$cppflags $ftry"
5648 *-*) echo "They appear to be: $cppflags";;
5650 $rm -f cpp.c cpp?.out
5654 : flags used in final linking phase
5656 '') if ./venix; then
5662 *-posix*) dflt="$dflt -posix" ;;
5665 *) dflt="$ldflags";;
5667 # See note above about -fstack-protector
5669 *-fstack-protector-strong*)
5671 *-fstack-protector-strong*) ;; # Don't add it again
5672 *) dflt="$dflt -fstack-protector-strong" ;;
5675 *-fstack-protector*)
5677 *-fstack-protector*) ;; # Don't add it again
5678 *) dflt="$dflt -fstack-protector" ;;
5683 : Try to guess additional flags to pick up local libraries.
5684 for thislibdir in $libpth; do
5685 case " $loclibpth " in
5688 *"-L$thislibdir "*) ;;
5689 *) dflt="$dflt -L$thislibdir" ;;
5701 Your C linker may need flags. For this question you should
5702 include -L/whatever and any other flags used by the C linker, but you
5703 should NOT include libraries like -lwhatever.
5705 Make sure you include the appropriate -L/path flags if your C linker
5706 does not normally search all of the directories you specified above,
5709 To use no flags, specify the word "none".
5713 rp="Any additional ld flags (NOT including libraries)?"
5719 rmlist="$rmlist pdp11"
5723 echo "Checking your choice of C compiler and flags for coherency..." >&4
5724 $cat > try.c <<'EOF'
5726 int main() { printf("Ok\n"); return(0); }
5728 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5730 $cat >try.msg <<'EOM'
5731 I've tried to compile and run the following simple program:
5734 $cat try.c >> try.msg
5736 $cat >> try.msg <<EOM
5743 and I got the following output:
5747 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5748 if $sh -c "$run ./try " >>try.msg 2>&1; then
5752 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5755 echo "The program compiled OK, but exited with status $?." >>try.msg
5756 rp="You have a problem. Shall I abort Configure"
5760 echo "I can't compile the test program." >>try.msg
5761 rp="You have a BIG problem. Shall I abort Configure"
5767 case "$knowitall" in
5769 echo "(The supplied flags or libraries might be incorrect.)"
5777 *) echo "Ok. Stopping Configure." >&4
5782 n) echo "OK, that should do.";;
5784 $rm_try gcctest gcctest.out
5786 : define a shorthand compile call
5790 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5791 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
5795 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5796 : define a shorthand compile call for compilations that should be ok.
5800 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5802 : stub, used only to satisfy other units
5805 : check for lengths of integral types
5809 echo "Checking to see how big your integers are..." >&4
5818 printf("intsize=%d;\n", (int)sizeof(int));
5819 printf("longsize=%d;\n", (int)sizeof(long));
5820 printf("shortsize=%d;\n", (int)sizeof(short));
5825 if eval $compile_ok && $run ./try > /dev/null; then
5827 echo "Your integers are $intsize bytes long."
5828 echo "Your long integers are $longsize bytes long."
5829 echo "Your short integers are $shortsize bytes long."
5833 Help! I can't compile and run the intsize test program: please enlighten me!
5834 (This is probably a misconfiguration in your system or libraries, and
5835 you really ought to fix it. Still, I'll try anyway.)
5839 rp="What is the size of an integer (in bytes)?"
5843 rp="What is the size of a long integer (in bytes)?"
5847 rp="What is the size of a short integer (in bytes)?"
5855 : check for long long
5857 echo "Checking to see if you have long long..." >&4
5858 echo 'int main() { long long x = 7; return 0; }' > try.c
5860 if eval $compile; then
5862 echo "You have long long."
5865 echo "You do not have long long."
5871 : check for length of long long
5872 case "${d_longlong}${longlongsize}" in
5875 echo "Checking to see how big your long longs are..." >&4
5876 $cat >try.c <<'EOCP'
5880 printf("%d\n", (int)sizeof(long long));
5885 if eval $compile_ok; then
5886 longlongsize=`$run ./try`
5887 echo "Your long longs are $longlongsize bytes long."
5891 echo "(I can't seem to compile the test program. Guessing...)"
5892 rp="What is the size of a long long (in bytes)?"
5896 if $test "X$longsize" = "X$longlongsize"; then
5897 echo "(That isn't any different from an ordinary long.)"
5903 : determine filename position in cpp output
5905 echo "Computing filename position in cpp output for #include directives..." >&4
5907 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5912 vos) testaccess=-e ;;
5915 echo '#include <stdio.h>' > foo.c
5918 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5919 $grep '^[ ]*#.*stdio\.h' | \
5920 while read cline; do
5923 while $test \$# -gt 0; do
5924 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5929 pos=\`expr \$pos + 1\`
5943 *) pos="${fieldn}th";;
5945 echo "Your cpp writes the filename in the $pos field of the line."
5947 : locate header file
5952 for usrincdir in $incpth
5954 if test -f \$usrincdir/\$wanted; then
5955 echo "\$usrincdir/\$wanted"
5959 awkprg='{ print \$$fieldn }'
5960 echo "#include <\$wanted>" > foo\$\$.c
5961 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5962 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5963 while read cline; do
5964 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5966 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5967 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5972 # status = 0: grep returned 0 lines, case statement not executed
5973 # status = 1: headerfile found
5974 # status = 2: while loop executed, no headerfile found
5978 if test \$status -eq 1; then
5985 : define an alternate in-header-list? function
5986 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5987 cont=true; xxf="echo \"<\$1> found.\" >&4";
5988 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5989 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5991 case $# in 4) instead=instead;; *) instead="at last";; esac;
5992 while $test "$cont"; do
5994 var=$2; eval "was=\$$2";
5995 if $test "$xxx" && $test -r "$xxx";
5997 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
6000 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
6001 set $yyy; shift; shift; yyy=$@;
6002 case $# in 0) cont="";;
6003 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
6004 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
6005 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
6006 xxnf="echo \"there is no <\$1>, ...\" >&4";;
6010 do set $yyy; var=$2; eval "was=\$$2";
6011 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6012 set $yyy; shift; shift; yyy=$@;
6015 : see if inttypes.h is available
6016 : we want a real compile instead of Inhdr because some systems
6017 : have an inttypes.h which includes non-existent headers
6020 #include <inttypes.h>
6022 static int32_t foo32 = 0x12345678;
6026 if eval $compile; then
6027 echo "<inttypes.h> found." >&4
6030 echo "<inttypes.h> NOT found." >&4
6039 echo "Checking to see if you have int64_t..." >&4
6041 #include <sys/types.h>
6042 #$i_inttypes I_INTTYPES
6044 #include <inttypes.h>
6046 int main() { int64_t x = 7; }
6049 if eval $compile; then
6051 echo "You have int64_t."
6054 echo "You do not have int64_t."
6060 : Check if 64bit ints have a quad type
6062 echo "Checking which 64-bit integer type we could use..." >&4
6068 val='"unsigned int"'
6073 *) case "$longsize" in
6077 val='"unsigned long"'
6082 *) case "$d_longlong:$longlongsize" in
6087 val='"unsigned long long"'
6092 *) case "$d_int64_t" in
6111 '') echo "Alas, no 64-bit integer types in sight." >&4
6114 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6119 : Do we want 64bit support
6120 case "$uselonglong" in
6121 "$define"|true|[yY]*)
6124 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6126 use64bitint="$define"
6129 case "$use64bits" in
6130 "$define"|true|[yY]*)
6133 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6135 use64bitint="$define"
6138 case "$use64bitints" in
6139 "$define"|true|[yY]*)
6142 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6144 use64bitint="$define"
6147 case "$use64bitsint" in
6148 "$define"|true|[yY]*)
6151 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6153 use64bitint="$define"
6156 case "$uselonglongs" in
6157 "$define"|true|[yY]*)
6160 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6162 use64bitint="$define"
6165 case "$use64bitsall" in
6166 "$define"|true|[yY]*)
6169 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6171 use64bitall="$define"
6176 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6178 case "$use64bitall" in
6179 "$define"|true|[yY]*) use64bitint="$define" ;;
6185 You have natively 64-bit long integers.
6189 *) case "$use64bitint" in
6190 "$define"|true|[yY]*) dflt='y';;
6199 Perl can be built to take advantage of 64-bit integer types
6200 on some systems. To do so, Configure can be run with -Duse64bitint.
6201 Choosing this option will most probably introduce binary incompatibilities.
6203 If this doesn't make any sense to you, just accept the default '$dflt'.
6204 (The default has been chosen based on your configuration.)
6206 rp='Try to use 64-bit integers, if available?'
6209 [yY]*) val="$define" ;;
6217 case "$use64bitall" in
6218 "$define"|true|[yY]*) dflt='y' ;;
6219 *) case "$longsize" in
6227 You may also choose to try maximal 64-bitness. It means using as much
6228 64-bitness as possible on the platform. This in turn means even more
6229 binary incompatibilities. On the other hand, your platform may not
6230 have any more 64-bitness available than what you already have chosen.
6232 If this doesn't make any sense to you, just accept the default '$dflt'.
6233 (The default has been chosen based on your configuration.)
6235 rp='Try to use maximal 64-bit support, if available?'
6238 [yY]*) val="$define" ;;
6243 case "$use64bitall" in
6245 case "$use64bitint" in
6249 Since you have chosen a maximally 64-bit build, I'm also turning on
6250 the use of 64-bit integers.
6252 use64bitint="$define" ;;
6257 : Look for a hint-file generated 'call-back-unit'. If the
6258 : user has specified that a 64-bit perl is to be built,
6259 : we may need to set or change some other defaults.
6260 if $test -f use64bitint.cbu; then
6261 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6264 case "$use64bitint" in
6265 "$define"|true|[yY]*)
6266 : This test was common to all the OpenBSD forks, and seems harmless for
6269 echo "Checking if your C library has broken 64-bit functions..." >&4
6272 typedef $uquadtype myULL;
6279 {4294967303.15, 4294967303ULL},
6280 {4294967294.2, 4294967294ULL},
6281 {4294967295.7, 4294967295ULL},
6284 for (p = test; p->u; p++) {
6285 myULL x = (myULL)p->d;
6296 if eval $compile_ok; then
6297 libcquad=`$run ./try`
6298 echo "Your C library's 64-bit functions are $libcquad."
6300 echo "(I can't seem to compile the test program.)"
6301 echo "Assuming that your C library's 64-bit functions are ok."
6310 *** You have a C library with broken 64-bit functions.
6311 *** 64-bit support does not work reliably in this configuration.
6312 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6313 *** Cannot continue, aborting.
6320 4) case "$archname64" in
6321 '') archname64=64int ;;
6328 : Look for a hint-file generated 'call-back-unit'. If the
6329 : user has specified that a maximally 64-bit perl is to be built,
6330 : we may need to set or change some other defaults.
6331 if $test -f use64bitall.cbu; then
6332 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6335 case "$use64bitall" in
6336 "$define"|true|[yY]*)
6338 4) case "$archname64" in
6339 ''|64int) archname64=64all ;;
6346 case "$d_quad:$use64bitint" in
6350 *** You have chosen to use 64-bit integers,
6351 *** but none can be found.
6352 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6353 *** Cannot continue, aborting.
6360 : Check if we are using the GNU C library
6362 echo "Checking for GNU C Library..." >&4
6364 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6365 alone are insufficient to distinguish different versions, such as
6366 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6367 libc version 2.1.0. A. Dougherty, June 3, 2002.
6373 # ifdef __GLIBC_MINOR__
6374 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6375 # include <gnu/libc-version.h>
6376 printf("%s\n", gnu_get_libc_version());
6378 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6381 printf("%d\n", __GLIBC__);
6390 if eval $compile_ok && $run ./try > glibc.ver; then
6392 gnulibc_version=`$cat glibc.ver`
6393 echo "You are using the GNU C Library version $gnulibc_version"
6397 echo "You are not using the GNU C Library"
6403 : see if nm is to be used to determine whether a symbol is defined or not
6407 case "$d_gnulibc" in
6410 echo "nm probably won't work on the GNU C Library." >&4
6416 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6418 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6419 echo "'nm' won't be sufficient on this system." >&4
6425 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6426 if $test $dflt -gt 20; then
6436 true|$define) dflt=y;;
6443 I can use $nm to extract the symbols from your C libraries. This
6444 is a time consuming task which may generate huge output on the disk (up
6445 to 3 megabytes) but that should make the symbols extraction faster. The
6446 alternative is to skip the 'nm' extraction part and to compile a small
6447 test program instead to determine whether each symbol is present. If
6448 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6449 this may be the best solution.
6451 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6454 rp="Shall I use $nm to extract C symbols from the libraries?"
6457 [Nn]*) usenm=false;;
6466 : nm options which may be necessary
6468 '') if $test -f /mach_boot; then
6470 elif $test -d /usr/ccs/lib; then
6471 nm_opt='-p' # Solaris (and SunOS?)
6472 elif $test -f /dgux; then
6474 elif $test -f /lib64/rld; then
6475 nm_opt='-p' # 64-bit Irix
6481 : nm options which may be necessary for shared libraries but illegal
6482 : for archive libraries. Thank you, Linux.
6483 case "$nm_so_opt" in
6484 '') case "$myuname" in
6486 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6487 nm_so_opt='--dynamic'
6494 : Figure out where the libc is located
6497 : get list of predefined functions in a handy place
6502 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6508 *) for thislib in $libs; do
6511 : Handle C library specially below.
6514 thislib=`echo $thislib | $sed -e 's/^-l//'`
6515 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6517 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6519 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6521 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6523 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6525 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6527 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6532 libnames="$libnames $try"
6534 *) libnames="$libnames $thislib" ;;
6543 for xxx in $libpth; do
6544 $test -r $1 || set $xxx/libc.$so
6545 : The messy sed command sorts on library version numbers.
6547 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6548 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6550 s/[0-9][0-9]*/0000&/g
6551 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6554 $sort | $sed -e 's/^.* //'`
6557 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6558 $test -r $1 || set $sysroot/lib/libsys_s$_a
6564 if $test -r "$1"; then
6565 echo "Your (shared) C library seems to be in $1."
6567 elif $test -r /lib/libc && $test -r /lib/clib; then
6568 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6570 libc='/lib/clib /lib/libc'
6571 if $test -r /lib/syslib; then
6572 echo "(Your math library is in /lib/syslib.)"
6573 libc="$libc /lib/syslib"
6575 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6576 echo "Your C library seems to be in $libc, as you said before."
6577 elif $test -r $incpath/usr/lib/libc$_a; then
6578 libc=$incpath/usr/lib/libc$_a;
6579 echo "Your C library seems to be in $libc. That's fine."
6580 elif $test -r /lib/libc$_a; then
6582 echo "Your C library seems to be in $libc. You're normal."
6584 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6586 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6587 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6588 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6590 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6592 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6595 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6597 if $test -r "$tans"; then
6598 echo "Your C library seems to be in $tans, of all places."
6604 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6608 If the guess above is wrong (which it might be if you're using a strange
6609 compiler, or your machine supports multiple models), you can override it here.
6614 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6616 I can't seem to find your C library. I've looked in the following places:
6619 $sed 's/^/ /' libpath
6622 None of these seems to contain your C library. I need to get its name...
6627 rp='Where is your C library?'
6632 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6633 set X `cat libnames`
6636 case $# in 1) xxx=file; esac
6637 echo "Extracting names from the following $xxx for later perusal:" >&4
6639 $sed 's/^/ /' libnames >&4
6641 $echo $n "This may take a while...$c" >&4
6645 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6646 *) $nm $nm_opt $file 2>/dev/null;;
6651 $grep fprintf libc.tmp > libc.ptf
6652 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6653 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6655 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6659 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6663 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6667 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6671 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6675 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6679 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6680 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6684 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6688 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6692 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6696 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6700 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6704 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6708 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6713 $nm -p $* 2>/dev/null >libc.tmp
6714 $grep fprintf libc.tmp > libc.ptf
6715 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6716 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6722 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6724 if $ar t $libc > libc.tmp && \
6725 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6727 for thisname in $libnames $libc; do
6728 $ar t $thisname >>libc.tmp
6730 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6732 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6733 for thisname in $libnames $libc; do
6734 $ar tv $thisname >>libc.tmp
6735 emximp -o tmp.imp $thisname \
6737 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6738 < tmp.imp >>libc.tmp
6741 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6744 echo "$ar didn't seem to work right." >&4
6745 echo "Maybe this is a Cray...trying bld instead..." >&4
6747 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6750 for thisname in $libnames; do
6752 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6753 $ar t $thisname >>libc.tmp
6757 echo "That didn't work either. Giving up." >&4
6767 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6768 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6770 *) if $test -f /lib/syscalls.exp; then
6772 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6773 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6774 /lib/syscalls.exp >>libc.list
6780 $rm -f libnames libpath
6782 : Check if we are using C++
6784 echo "Checking for C++..." >&4
6785 $cat >try.c <<'EOCP'
6797 if eval $compile_ok && $run ./try; then
6799 echo "You are using a C++ compiler."
6802 echo "You are not using a C++ compiler."
6808 : is a C symbol defined?
6811 -v) tf=libc.tmp; tdc="";;
6812 -a) tf=libc.tmp; tdc="[]";;
6813 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6815 case "$d_cplusplus" in
6816 $define) extern_C="extern \"C\"" ;;
6817 *) extern_C="extern" ;;
6820 case "$reuseval-$4" in
6822 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6827 if $test "$runnm" = true; then
6828 if $contains $tlook $tf >/dev/null 2>&1; then
6830 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6831 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;
6832 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6833 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6837 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6838 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6844 $define) tval=true;;
6851 : define an is-in-libc? function
6852 inlibc='echo " "; td=$define; tu=$undef;
6853 sym=$1; var=$2; eval "was=\$$2";
6855 case "$reuseval$was" in
6865 echo "$sym() found." >&4;
6866 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6868 echo "$sym() NOT found." >&4;
6869 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6873 $define) echo "$sym() found." >&4;;
6874 *) echo "$sym() NOT found." >&4;;
6878 : check for length of double
6880 case "$doublesize" in
6882 echo "Checking to see how big your double precision numbers are..." >&4
6891 printf("%d\n", (int)sizeof(double));
6896 if eval $compile_ok; then
6897 doublesize=`$run ./try`
6898 echo "Your double is $doublesize bytes long."
6901 echo "(I can't seem to compile the test program. Guessing...)"
6902 rp="What is the size of a double precision number (in bytes)?"
6910 : check for long doubles
6912 echo "Checking to see if you have long double..." >&4
6913 echo 'int main() { long double x = 7.0; }' > try.c
6915 if eval $compile; then
6917 echo "You have long double."
6920 echo "You do not have long double."
6926 : see if ldexpl exists
6930 : check for length of long double
6931 case "${d_longdbl}${longdblsize}" in
6934 echo "Checking to see how big your long doubles are..." >&4
6935 $cat >try.c <<'EOCP'
6939 printf("%d\n", sizeof(long double));
6944 if eval $compile; then
6945 longdblsize=`$run ./try`
6946 echo "Your long doubles are $longdblsize bytes long."
6950 echo "(I can't seem to compile the test program. Guessing...)" >&4
6951 rp="What is the size of a long double (in bytes)?"
6955 if $test "X$doublesize" = "X$longdblsize"; then
6956 echo "That isn't any different from an ordinary double."
6957 echo "I'll keep your setting anyway, but you may see some"
6958 echo "harmless compilation warnings."
6964 $echo "Checking the kind of long doubles you have..." >&4
6965 case "$d_longdbl" in
6969 #define LONGDBLSIZE $longdblsize
6970 #define DOUBLESIZE $doublesize
6976 static const long double d = -0.1L;
6978 unsigned const char* b = (unsigned const char*)(&d);
6979 #if DOUBLESIZE == LONGDBLSIZE
6980 printf("0\n"); /* if it floats like double */
6983 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6984 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6985 /* IEEE 754 128-bit little-endian */
6989 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6990 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6995 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6996 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6997 * cannot be trusted. */
6998 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6999 if (b[0] == 0xCD && b[9] == 0xBF) {
7000 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
7001 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
7002 * Also known as "extended precision". */
7006 if (b[0] == 0xBF && b[9] == 0xCD) {
7007 /* Is there ever big-endian 80-bit, really?
7009 * The Motorola 68881 had another "extended precision" format:
7010 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7011 * for total of 96 bits of bytes. The zero bits were unused.
7012 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7013 * If it ever becomes relevant, this format should be allocated
7014 * a new doublekind code since it's quite different from the Intel x87.
7020 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7021 /* software "double double", the 106 is 53+53.
7022 * but irix thinks it is 107. */
7023 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7024 /* double double 128-bit fully little-endian,
7025 * little-endian doubles in little-endian order,
7026 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7030 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7031 /* double double 128-bit fully big-endian,
7032 * big-endian doubles in big-endian order,
7033 * e.g. PPC/Power and MIPS:
7034 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7038 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7039 /* double double 128-bit mixed endian.
7040 * little-endian doubles in big-endian order,
7042 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7046 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7047 /* double double 128-bit mixed endian,
7048 * big-endian doubles in little-endian order,
7049 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7054 /* We are largely making this up because it may well be
7055 * that the VAX format H was never made available to C,
7056 * only to Fortran. */
7057 #if LONGDBLSIZE == 16 && defined(__vax__)
7058 if (b[0] == 0xFD && b[15] == 0x99) {
7059 /* VAX format H, PDP-11 mixed endian. */
7064 printf("-1\n"); /* unknown */
7069 if eval $compile; then
7070 longdblkind=`$run ./try`
7077 case "$longdblkind" in
7078 0) echo "Your long doubles are doubles." >&4 ;;
7079 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7080 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7081 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7082 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7083 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7084 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7085 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7086 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7087 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7088 *) echo "Cannot figure out your long double." >&4 ;;
7090 d_long_double_style_ieee=$undef
7091 d_long_double_style_ieee_std=$undef
7092 d_long_double_style_ieee_extended=$undef
7093 d_long_double_style_ieee_doubledouble=$undef
7094 d_long_double_style_vax=$undef
7095 case "$longdblkind" in
7096 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7098 case "$longdblkind" in
7099 1|2) d_long_double_style_ieee_std=$define ;;
7101 case "$longdblkind" in
7102 3|4) d_long_double_style_ieee_extended=$define ;;
7104 case "$longdblkind" in
7105 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7107 case "$longdblkind" in
7108 9) d_long_double_style_vax=$define ;;
7112 : determine the architecture name
7114 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7115 tarch=`arch`"-$osname"
7116 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7117 if uname -m > tmparch 2>&1 ; then
7118 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7119 -e 's/$/'"-$osname/" tmparch`
7127 case "$myarchname" in
7130 echo "(Your architecture name used to be $myarchname.)"
7134 case "$targetarch" in
7136 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7141 *) dflt="$archname";;
7143 rp='What is your architecture name'
7147 : optionally add API version to the architecture for versioned archlibs
7148 case "$useversionedarchname" in
7149 $define|true|[yY]*) dflt='y';;
7152 rp='Add the Perl API version to your archname?'
7155 y|Y) useversionedarchname="$define" ;;
7156 *) useversionedarchname="$undef" ;;
7158 case "$useversionedarchname" in
7161 *-$api_versionstring)
7162 echo "...and architecture name already has -$api_versionstring" >&4
7165 archname="$archname-$api_versionstring"
7166 echo "...setting architecture name to $archname." >&4
7172 case "$usethreads" in
7174 echo "Threads selected." >&4
7176 *-thread*) echo "...and architecture name already has -thread." >&4
7178 *) archname="$archname-thread"
7179 echo "...setting architecture name to $archname." >&4
7184 case "$usemultiplicity" in
7186 echo "Multiplicity selected." >&4
7188 *-multi*) echo "...and architecture name already has -multi." >&4
7190 *) archname="$archname-multi"
7191 echo "...setting architecture name to $archname." >&4
7196 case "$use64bitint$use64bitall" in
7198 case "$archname64" in
7200 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7203 case "$use64bitint" in
7204 "$define") echo "64 bit integers selected." >&4 ;;
7206 case "$use64bitall" in
7207 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7210 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7212 *) archname="$archname-$archname64"
7213 echo "...setting architecture name to $archname." >&4
7219 case "$uselongdouble" in
7221 echo "Long doubles selected." >&4
7222 case "$longdblsize" in
7224 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7228 *-ld*) echo "...and architecture name already has -ld." >&4
7230 *) archname="$archname-ld"
7231 echo "...setting architecture name to $archname." >&4
7238 case "$usequadmath" in
7240 echo "quadmath selected." >&4
7242 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7244 *) archname="$archname-quadmath"
7245 echo "...setting architecture name to $archname." >&4
7250 if $test -f archname.cbu; then
7251 echo "Your platform has some specific hints for architecture name, using them..."
7255 : set the prefixit variable, to compute a suitable default value
7256 prefixit='case "$3" in
7258 case "$oldprefix" in
7259 "") eval "$1=\"\$$2\"";;
7266 ""|" "|none) eval "$1=\"\$$2\"";;
7272 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7274 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7275 /*-$oldprefix/*|\~*-$oldprefix/*)
7276 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7277 *) eval "$1=\"\$$2\"";;
7281 : determine installation style
7282 : For now, try to deduce it from prefix unless it is already set.
7283 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7284 case "$installstyle" in
7285 '') case "$prefix" in
7286 *perl*) dflt='lib';;
7287 *) dflt='lib/perl5' ;;
7290 *) dflt="$installstyle" ;;
7292 : Probably not worth prompting for this since we prompt for all
7293 : the directories individually, and the prompt would be too long and
7297 : determine where public executables go
7302 rp='Pathname where the public executables will reside?'
7304 if $test "X$ansexp" != "X$binexp"; then
7308 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7309 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7310 : this via initialinstalllocation
7313 case "$userelocatableinc" in
7314 $define|true|[yY]*) dflt='y' ;;
7319 Would you like to build Perl so that the installation is relocatable, so that
7320 library paths in @INC are determined relative to the path of the perl binary?
7321 This is not advised for system Perl installs, or if you need to run setid
7322 scripts or scripts under taint mode.
7324 If this doesn't make any sense to you, just accept the default '$dflt'.
7326 rp='Use relocatable @INC?'
7329 y|Y) val="$define" ;;
7332 set userelocatableinc
7335 initialinstalllocation="$binexp"
7336 : Default prefix is now "up one level from where the binaries are"
7337 case "$userelocatableinc" in
7343 installprefixexp=".../.."
7347 : determine where private library files go
7348 : Usual default is /usr/local/lib/perl5/$version.
7349 : Also allow things like /opt/perl/lib/$version, since
7350 : /opt/perl/lib/perl5... would be redundant.
7351 : The default "style" setting is made in installstyle.U
7352 case "$installstyle" in
7353 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7354 *) set dflt privlib lib/$version ;;
7359 There are some auxiliary files for $package that need to be put into a
7360 private library directory that is accessible by everyone.
7365 rp='Pathname where the private library files will reside?'
7370 : set the prefixup variable, to restore leading tilda escape
7371 prefixup='case "$prefixexp" in
7373 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7376 : determine where public architecture dependent libraries go
7379 : privlib default is /usr/local/lib/$package/$version
7380 : archlib default is /usr/local/lib/$package/$version/$archname
7381 : privlib may have an optional trailing /share.
7382 tdflt=`echo $privlib | $sed 's,/share$,,'`
7383 tdflt=$tdflt/$archname
7392 $spackage contains architecture-dependent library files. If you are
7393 sharing libraries in a heterogeneous environment, you might store
7394 these files in a separate location. Otherwise, you can just include
7395 them with the rest of the public library files.
7400 rp='Where do you want to put the public architecture-dependent libraries?'
7404 if $test X"$archlib" = X"$privlib"; then
7410 : see if setuid scripts can be secure
7413 Some kernels have a bug that prevents setuid #! scripts from being
7414 secure. Some sites have disabled setuid #! scripts because of this.
7416 First let's decide if your kernel supports secure setuid #! scripts.
7417 (If setuid #! scripts would be secure but have been disabled anyway,
7418 don't say that they are secure if asked.)
7423 if $test -d /dev/fd; then
7424 echo "#!$ls" >reflect
7425 chmod +x,u+s reflect
7426 ./reflect >flect 2>&1
7427 if $contains "/dev/fd" flect >/dev/null; then
7428 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7432 If you are not sure if they are secure, I can check but I'll need a
7433 username and password different from the one you are using right now.
7434 If you don't have such a username or don't want me to test, simply
7438 rp='Other username to test security of setuid scripts with?'
7443 case "$d_suidsafe" in
7444 '') echo "I'll assume setuid scripts are *not* secure." >&4
7447 echo "Well, the $hint value is *not* secure." >&4
7449 *) echo "Well, the $hint value *is* secure." >&4
7454 $rm -f reflect flect
7455 echo "#!$ls" >reflect
7456 chmod +x,u+s reflect
7459 echo '"su" will (probably) prompt you for '"$ans's password."
7460 su $ans -c './reflect >flect'
7461 if $contains "/dev/fd" flect >/dev/null; then
7462 echo "Okay, it looks like setuid scripts are secure." >&4
7465 echo "I don't think setuid scripts are secure." >&4
7470 rp='Does your kernel have *secure* setuid scripts?'
7473 [yY]*) val="$define";;
7478 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7479 echo "(That's for file descriptors, not floppy disks.)"
7485 $rm -f reflect flect
7487 : now see if they want to do setuid emulation
7488 if $test $patchlevel -lt 11; then
7491 case "$d_suidsafe" in
7494 echo "No need to emulate SUID scripts since they are secure here." >&4
7498 Some systems have disabled setuid scripts, especially systems where
7499 setuid scripts cannot be secure. On systems where setuid scripts have
7500 been disabled, the setuid/setgid bits on scripts are currently
7501 useless. It is possible for $package to detect those bits and emulate
7502 setuid/setgid in a secure fashion. This emulation will only work if
7503 setuid scripts have been disabled in your kernel.
7507 "$define") dflt=y ;;
7510 rp="Do you want to do setuid/setgid emulation?"
7513 [yY]*) val="$define";;
7525 SUID emulation has been removed for 5.12
7526 Please re-run Configure without -Dd_dosuid
7535 : Find perl5.005 or later.
7536 echo "Looking for a previously installed perl5.005 or later... "
7538 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7539 : Check if this perl is recent and can load a simple module
7540 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7543 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7553 '') echo "None found. That's ok.";;
7554 *) echo "Using $perl5." ;;
7557 : Set the siteprefix variables
7560 After $package is installed, you may wish to install various
7561 add-on modules and utilities. Typically, these add-ons will
7562 be installed under $prefix with the rest
7563 of this package. However, you may wish to install such add-ons
7564 elsewhere under a different prefix.
7566 If you do not wish to put everything under a single prefix, that's
7567 ok. You will be prompted for the individual locations; this siteprefix
7568 is only used to suggest the defaults.
7570 The default should be fine for most people.
7574 rp='Installation prefix to use for add-on modules and utilities?'
7575 : XXX Here might be another good place for an installstyle setting.
7576 case "$siteprefix" in
7578 *) dflt=$siteprefix ;;
7581 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7583 case "$siteprefix" in
7587 *) oldsiteprefix="$prefix";;
7592 siteprefixexp="$ansexp"
7594 : determine where site specific libraries go.
7595 : Usual default is /usr/local/lib/perl5/site_perl/$version
7596 : The default "style" setting is made in installstyle.U
7597 : XXX No longer works with Prefixit stuff.
7598 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7600 '') case "$installstyle" in
7601 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7602 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7610 The installation process will create a directory for
7611 site-specific extensions and modules. Most users find it convenient
7612 to place all site-specific files in this directory rather than in the
7613 main distribution directory.
7617 rp='Pathname for the site-specific library files?'
7621 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7623 : Determine list of previous versions to include in @INC
7624 $cat > getverlist <<EOPL
7627 \$api_versionstring = "$api_versionstring";
7628 \$version = "$version";
7629 \$stem = "$sitelib_stem";
7630 \$archname = "$archname";
7632 $cat >> getverlist <<'EOPL'
7633 # The list found is store twice for each entry: the original name, and
7634 # the binary broken down version as pack "sss", so sorting is easy and
7635 # unambiguous. This will work for all versions that have a maximum of
7636 # three digit groups, separate by '.'s or '_'s. Names are extended with
7637 # ".0.0" to ensure at least three elements for the pack.
7638 # -- H.Merijn Brand (m)'06 23-10-2006
7640 # Can't have leading @ because metaconfig interprets it as a command!
7641 ;@inc_version_list=();
7642 # XXX Redo to do opendir/readdir?
7645 ;@candidates = map {
7646 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7647 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7653 ($pversion, $aversion, $vsn5005) = map {
7654 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7655 foreach $d (@candidates) {
7656 if ($d->[1] lt $pversion) {
7657 if ($d->[1] ge $aversion) {
7658 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7660 elsif ($d->[1] ge $vsn5005) {
7661 unshift(@inc_version_list, grep { -d } $d->[0]);
7665 # Skip newer version. I.e. don't look in
7666 # 5.7.0 if we're installing 5.6.1.
7670 if (@inc_version_list) {
7671 print join(' ', @inc_version_list);
7674 # Blank space to preserve value for next Configure run.
7679 case "$inc_version_list" in
7680 '') if test -x "$perl5$exe_ext"; then
7681 dflt=`$perl5 getverlist`
7686 $undef) dflt='none' ;;
7687 *) eval dflt=\"$inc_version_list\" ;;
7690 ''|' ') dflt=none ;;
7697 In order to ease the process of upgrading, this version of perl
7698 can be configured to use modules built and installed with earlier
7699 versions of perl that were installed under $prefix. Specify here
7700 the list of earlier versions that this version of perl should check.
7701 If Configure detected no earlier versions of perl installed under
7702 $prefix, then the list will be empty. Answer 'none' to tell perl
7703 to not search earlier versions.
7705 The default should almost always be sensible, so if you're not sure,
7706 just accept the default.
7709 rp='List of earlier versions to include in @INC?'
7712 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7713 *) inc_version_list="$ans" ;;
7715 case "$inc_version_list" in
7717 inc_version_list_init='0'
7718 d_inc_version_list="$undef"
7720 *) inc_version_list_init=`echo $inc_version_list |
7721 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7722 d_inc_version_list="$define"
7727 : see if malloc/malloc.h has to be included
7728 set malloc/malloc.h i_mallocmalloc
7731 : see if this is a malloc.h system
7732 : we want a real compile instead of Inhdr because some systems have a
7733 : malloc.h that just gives a compile error saying to use stdlib.h instead
7738 #$i_mallocmalloc I_MALLOCMALLOC
7739 #ifdef I_MALLOCMALLOC
7740 # include <malloc/malloc.h>
7743 int main () { return 0; }
7746 if eval $compile; then
7747 echo "<malloc.h> found." >&4
7750 echo "<malloc.h> NOT found." >&4
7757 : check for length of pointer
7761 echo "Checking to see how big your pointers are..." >&4
7770 printf("%d\n", (int)sizeof(void *));
7775 if eval $compile_ok; then
7776 ptrsize=`$run ./try`
7777 echo "Your pointers are $ptrsize bytes long."
7780 echo "(I can't seem to compile the test program. Guessing...)" >&4
7781 rp="What is the size of a pointer (in bytes)?"
7788 case "$use64bitall" in
7789 "$define"|true|[yY]*)
7793 *** You have chosen a maximally 64-bit build,
7794 *** but your pointers are only 4 bytes wide.
7795 *** Please rerun Configure without -Duse64bitall.
7800 *** Since you have quads, you could possibly try with -Duse64bitint.
7805 *** Cannot continue, aborting.
7815 : determine whether to use malloc wrapping
7817 case "$usemallocwrap" in
7818 [yY]*|true|$define) dflt='y' ;;
7819 [nN]*|false|$undef) dflt='n' ;;
7820 *) case "$usedevel" in
7821 [yY]*|true|$define) dflt='y' ;;
7826 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7828 usemallocwrap="$ans"
7831 usemallocwrap="$define" ;;
7833 usemallocwrap="$undef" ;;
7836 : determine which malloc to compile in
7838 case "$usemymalloc" in
7839 [yY]*|true|$define) dflt='y' ;;
7840 [nN]*|false|$undef) dflt='n' ;;
7841 *) case "$ptrsize" in
7845 if test "$useithreads" = "$define"; then dflt='n'; fi
7848 rp="Do you wish to attempt to use the malloc that comes with $package?"
7854 mallocsrc='malloc.c'
7855 mallocobj="malloc$_o"
7856 d_mymalloc="$define"
7859 : Remove malloc from list of libraries to use
7860 echo "Removing unneeded -lmalloc from library list" >&4
7861 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7864 echo "libs = $libs" >&4
7876 : compute the return types of malloc and free
7878 $cat >malloc.c <<END
7882 #include <sys/types.h>
7896 case "$malloctype" in
7898 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7905 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7909 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7916 echo "Your system uses $freetype free(), it would seem." >&4
7918 : determine where site specific architecture-dependent libraries go.
7919 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7920 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7921 : sitelib may have an optional trailing /share.
7923 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7924 dflt="$dflt/$archname"
7929 set sitearch sitearch none
7933 The installation process will also create a directory for
7934 architecture-dependent site-specific extensions and modules.
7938 rp='Pathname for the site-specific architecture-dependent library files?'
7942 if $test X"$sitearch" = X"$sitelib"; then
7945 d_sitearch="$define"
7948 : Set the vendorprefix variables
7951 The installation process will also create a directory for
7952 vendor-supplied add-ons. Vendors who supply perl with their system
7953 may find it convenient to place all vendor-supplied files in this
7954 directory rather than in the main distribution directory. This will
7955 ease upgrades between binary-compatible maintenance versions of perl.
7957 Of course you may also use these directories in whatever way you see
7958 fit. For example, you might use them to access modules shared over a
7959 company-wide network.
7961 The default answer should be fine for most people.
7962 This causes further questions about vendor add-ons to be skipped
7963 and no vendor-specific directories will be configured for perl.
7966 rp='Do you want to configure vendor-specific add-on directories?'
7967 case "$usevendorprefix" in
7968 define|true|[yY]*) dflt=y ;;
7969 *) : User may have set vendorprefix directly on Configure command line.
7970 case "$vendorprefix" in
7979 rp='Installation prefix to use for vendor-supplied add-ons?'
7980 case "$vendorprefix" in
7981 '') dflt="$prefix" ;;
7982 *) dflt=$vendorprefix ;;
7985 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7987 case "$vendorprefix" in
7991 *) oldvendorprefix="$prefix";;
7995 usevendorprefix="$define"
7997 vendorprefixexp="$ansexp"
7999 *) usevendorprefix="$undef"
8005 : Set the vendorlib variables
8006 case "$vendorprefix" in
8007 '') d_vendorlib="$undef"
8011 *) d_vendorlib="$define"
8012 : determine where vendor-supplied modules go.
8013 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8014 case "$vendorlib" in
8016 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8017 case "$installstyle" in
8018 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8019 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8022 *) dflt="$vendorlib"
8026 rp='Pathname for the vendor-supplied library files?'
8029 vendorlibexp="$ansexp"
8032 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8036 : Set the vendorarch variables
8037 case "$vendorprefix" in
8038 '') d_vendorarch="$undef"
8042 *) d_vendorarch="$define"
8043 : determine where vendor-supplied architecture-dependent libraries go.
8044 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8045 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8046 : vendorlib may have an optional trailing /share.
8047 case "$vendorarch" in
8048 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8049 dflt="$dflt/$archname"
8051 *) dflt="$vendorarch" ;;
8054 rp='Pathname for vendor-supplied architecture-dependent files?'
8057 vendorarchexp="$ansexp"
8060 prefixvar=vendorarch
8062 if $test X"$vendorarch" = X"$vendorlib"; then
8063 d_vendorarch="$undef"
8065 d_vendorarch="$define"
8068 : Final catch-all directories to search
8071 Lastly, you can have perl look in other directories for extensions and
8072 modules in addition to those already specified.
8073 These directories will be searched after
8077 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8078 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8080 case "$otherlibdirs" in
8081 ''|' ') dflt='none' ;;
8082 *) dflt="$otherlibdirs" ;;
8085 Enter a colon-separated set of extra paths to include in perl's @INC
8086 search path, or enter 'none' for no extra paths.
8090 rp='Colon-separated list of additional directories for perl to search?'
8093 ' '|''|none) otherlibdirs=' ' ;;
8094 *) otherlibdirs="$ans" ;;
8096 case "$otherlibdirs" in
8100 set d_perl_otherlibdirs
8104 dflt_dtrace='/usr/sbin/dtrace'
8105 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8109 Perl can be built to support DTrace on platforms that support it.
8110 DTrace is a diagnosis and performance analysis tool from Sun.
8112 If this doesn't make any sense to you, just accept the default.
8116 case "$usedtrace" in
8126 dflt_dtrace=$usedtrace
8133 rp='Support DTrace if available?'
8136 y|Y) val="$define" ;;
8142 test "X$usedtrace" != "X$define" && break
8145 rp='Where is the dtrace executable?'
8154 if $dtrace -h -s ../perldtrace.d \
8155 -o perldtrace.tmp >/dev/null 2>&1 \
8156 && rm -f perldtrace.tmp
8159 echo "Good: your $dtrace knows about the -h flag."
8163 *** $me: Fatal Error: $dtrace doesn't support -h flag
8165 *** Your installed dtrace doesn't support the -h switch to compile a D
8166 *** program into a C header. Can't continue.
8178 *** $me: Fatal Error: $dtrace not found.
8185 echo "*** $dtrace was not found."
8191 : See if we want extra modules installed
8198 Perl can be built with extra modules or bundles of modules which
8199 will be fetched from the CPAN and installed alongside Perl.
8201 Notice that you will need access to the CPAN; either via the Internet,
8202 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8203 be asked later to configure the CPAN.pm module which will in turn do
8204 the installation of the rest of the extra modules or bundles.)
8206 Notice also that if the modules require any external software such as
8207 libraries and headers (the libz library and the zlib.h header for the
8208 Compress::Zlib module, for example) you MUST have any such software
8209 already installed, this configuration process will NOT install such
8212 If this doesn't make any sense to you, just accept the default '$dflt'.
8214 rp='Install any extra modules (y or n)?'
8220 Please list any extra modules or bundles to be installed from CPAN,
8221 with spaces between the names. The names can be in any format the
8222 'install' command of CPAN.pm will understand. (Answer 'none',
8223 without the quotes, to install no extra modules or bundles.)
8233 $rm -f ../extras.lst
8235 *) echo "(Saving the list of extras for later...)"
8236 echo "$extras" > ../extras.lst
8244 : determine where html pages for programs go
8245 set html1dir html1dir none
8249 If you wish to install html files for programs in $spackage, indicate
8250 the appropriate directory here. To skip installing html files,
8254 ''|none|$undef|' ') dflt=none ;;
8255 *) dflt=$html1dir ;;
8258 rp="Directory for the main $spackage html pages?"
8262 : Use ' ' for none so value is preserved next time through Configure
8263 $test X"$html1dir" = "X" && html1dir=' '
8265 : determine where html pages for libraries and modules go
8266 set html3dir html3dir none
8270 If you wish to install html files for modules associated with $spackage,
8271 indicate the appropriate directory here. To skip installing html files,
8274 : There is no obvious default. If they have specified html1dir, then
8275 : try to key off that, possibly changing .../html1 into .../html3.
8277 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8278 *) dflt=$html3dir ;;
8281 rp="Directory for the $spackage module html pages?"
8285 : Use ' ' for none so value is preserved next time through Configure
8286 $test X"$html3dir" = "X" && html3dir=' '
8288 : determine whether to install perl also as /usr/bin/perl
8291 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8293 Many scripts expect perl to be installed as /usr/bin/perl.
8295 If you want to, I can install the perl you are about to compile
8296 as /usr/bin/perl (in addition to $bin/perl).
8298 if test -f /usr/bin/perl; then
8301 However, please note that because you already have a /usr/bin/perl,
8302 overwriting that with a new Perl would very probably cause problems.
8303 Therefore I'm assuming you don't want to do that (unless you insist).
8306 case "$installusrbinperl" in
8307 "$define"|[yY]*) dflt='y';;
8313 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8316 case "$installusrbinperl" in
8317 "$undef"|[nN]*) dflt='n';;
8321 rp="Do you want to install perl as /usr/bin/perl?"
8324 [yY]*) val="$define";;
8330 set installusrbinperl
8333 : see if dlopen exists
8335 xxx_ccflags="$ccflags"
8337 : with g++ one needs -shared to get is-in-libc to work for dlopen
8338 case "$gccversion" in
8341 *) case "$d_cplusplus" in
8342 "$define") ccflags="$ccflags -shared" ;;
8349 ccflags="$xxx_ccflags"
8351 : see if this is a unistd.h system
8352 set unistd.h i_unistd
8355 : determine which dynamic loading, if any, to compile in
8357 dldir="ext/DynaLoader"
8370 $define) dflt='y' ;;
8372 : Does a dl_xxx.xs file exist for this operating system
8373 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8376 rp="Do you wish to use dynamic loading?"
8383 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8384 dflt="$dldir/dl_${osname}.xs"
8385 elif $test "$d_dlopen" = "$define" ; then
8386 dflt="$dldir/dl_dlopen.xs"
8391 *) dflt="$dldir/$dlsrc"
8394 echo "The following dynamic loading files are available:"
8395 : Can not go over to $dldir because getfile has path hard-coded in.
8396 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8397 rp="Source file to use for dynamic loading"
8403 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8407 Some systems may require passing special flags to $cc -c to
8408 compile modules that will be used to create a shared library.
8409 To use no flags, say "none".
8412 case "$cccdlflags" in
8413 '') case "$gccversion" in
8414 '') case "$osname" in
8416 irix*) dflt='-KPIC' ;;
8417 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8418 sunos) dflt='-pic' ;;
8422 *) case "$osname" in
8423 darwin) dflt='none' ;;
8424 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8429 *) dflt="$cccdlflags" ;;
8436 # If -Dsysroot was specified, now's the time to add it
8438 if test "X$sysroot" != X; then
8439 case "$gccversion" in
8444 dflt="$dflt --sysroot=$sysroot" ;;
8454 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8457 none) cccdlflags=' ' ;;
8458 *) cccdlflags="$ans" ;;
8463 Some systems use ld to create libraries that can be dynamically loaded,
8464 while other systems (such as those using ELF) use $cc.
8468 : Determine if this is ELF
8470 /* Test for whether ELF binaries are produced */
8482 int i = open("a.out",O_RDONLY);
8485 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8486 exit(0); /* succeed (yes, it is ELF) */
8490 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8496 '') if $test $bin_ELF = "$define"; then
8498 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8502 echo "I'll use ld to build dynamic libraries."
8510 rp="What command should be used to create dynamic libraries?"
8516 Some systems may require passing special flags to $ld to create a
8517 library that can be dynamically loaded. If your ld flags include
8518 -L/other/path options to locate libraries outside your loader's normal
8519 search path, you may need to specify those -L options here as well. To
8520 use no flags, say "none".
8523 case "$lddlflags" in
8524 '') case "$osname" in
8525 haiku) dflt='-shared' ;;
8527 case "$gccversion" in
8528 '') dflt="$dflt +vnocompatwarnings" ;;
8531 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8532 solaris) # See [perl #66604].
8533 # On Solaris 11, gcc -m64 on amd64
8534 # appears not to understand -G. gcc versions at
8535 # least as old as 3.4.3 support -shared, so just
8536 # use that with Solaris 11 and later, but keep
8537 # the old behavior for older Solaris versions.
8538 case "$gccversion" in
8540 *) case "$osvers" in
8541 2.?|2.10) dflt='-G' ;;
8542 *) dflt='-shared' ;;
8547 sunos) dflt='-assert nodefinitions' ;;
8548 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8552 *) dflt="$lddlflags" ;;
8555 : Only do this for gcc, since, for example, qcc has no concept
8557 if $test "X$sysroot" != X; then
8558 case "$gccversion" in
8560 *) dflt="$dflt --sysroot=$sysroot" ;;
8564 : Try to guess additional flags to pick up local libraries.
8565 : Be careful not to append to a plain 'none'
8569 for thisflag in $ldflags; do
8574 *) dflt="$dflt $thisflag" ;;
8581 ''|' ') dflt='none' ;;
8585 *-fstack-protector-strong*)
8587 *-fstack-protector-strong*) ;; # Don't add it again
8588 *) dflt="$dflt -fstack-protector-strong" ;;
8591 *-fstack-protector*)
8593 *-fstack-protector*) ;; # Don't add it again
8594 *) dflt="$dflt -fstack-protector" ;;
8599 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8602 none) lddlflags=' ' ;;
8603 *) lddlflags="$ans" ;;
8608 Some systems may require passing special flags to $cc to indicate that
8609 the resulting executable will use dynamic linking. To use no flags,
8613 case "$ccdlflags" in
8614 '') case "$osname" in
8615 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8616 sunos) dflt='none' ;;
8620 *) dflt="$ccdlflags" ;;
8622 rp="Any special flags to pass to $cc to use dynamic linking?"
8625 none) ccdlflags=' ' ;;
8626 *) ccdlflags="$ans" ;;
8638 ld_can_script="$undef"
8639 case "$bin_ELF$usedl" in
8641 # Abuse try.h and a.out names for neat cleanup
8653 if $cc $cccdlflags $ccdlflags $ccflags \
8654 $ldflags $lddlflags -o a.out try.c \
8655 -Wl,--version-script=try.h >/dev/null 2>&1 \
8656 && $test -s a.out ; then
8657 echo "ld supports scripting" >&4
8658 ld_can_script="$define"
8660 echo "ld does not support scripting" >&4
8666 : Do we want a shared libperl?
8670 # No dynamic loading being used, so don't bother even to prompt.
8673 *) case "$useshrplib" in
8674 '') case "$osname" in
8675 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8677 also='Building a shared libperl is required for dynamic loading to work on your system.'
8691 The perl executable is normally obtained by linking perlmain.c with
8692 libperl${_a}, any static extensions (usually just DynaLoader), and
8693 any other libraries needed on this system (such as -lm, etc.). Since
8694 your system supports dynamic loading, it is probably possible to build
8695 a shared libperl.$so. If you will have more than one executable linked
8696 to libperl.$so, this will significantly reduce the size of each
8697 executable, but it may have a noticeable effect on performance. The
8698 default is probably sensible for your system.
8702 rp="Build a shared libperl.$so (y/n)"
8706 useshrplib='true' ;;
8707 *) useshrplib='false' ;;
8712 case "$useshrplib" in
8714 case "$userelocatableinc" in
8716 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8717 echo "See INSTALL for an explanation why that won't work." >&4
8723 # Figure out a good name for libperl.so. Since it gets stored in
8724 # a version-specific architecture-dependent library, the version
8725 # number isn't really that important, except for making cc/ld happy.
8727 # A name such as libperl.so.10.1
8728 majmin="libperl.$so.$patchlevel.$subversion"
8729 # A name such as libperl.so.100
8730 majonly=`echo $patchlevel $subversion |
8731 $awk '{printf "%d%02d", $1, $2}'`
8732 majonly=libperl.$so.$majonly
8733 # I'd prefer to keep the os-specific stuff here to a minimum, and
8734 # rely on figuring it out from the naming of libc.
8735 case "${osname}${osvers}" in
8736 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8739 cygwin*) # ld links now against the dll directly
8740 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8741 majonly=`echo $patchlevel $subversion |
8742 $awk '{printf "%03d%03d", $1, $2}'`
8743 majonly=cygperl5.$majonly.$so
8746 *) # Try to guess based on whether libc has major.minor.
8748 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8749 *libc.$so.[0-9]*) dflt=$majonly ;;
8750 *) dflt=libperl.$so ;;
8760 I need to select a good name for the shared libperl. If your system uses
8761 library names with major and minor numbers, then you might want something
8762 like $majmin. Alternatively, if your system uses a single version
8763 number for shared libraries, then you might want to use $majonly.
8764 Or, your system might be quite happy with a simple libperl.$so.
8766 Since the shared libperl will get installed into a version-specific
8767 architecture-dependent directory, the version number of the shared perl
8768 library probably isn't important, so the default should be o.k.
8771 rp='What name do you want to give to the shared libperl?'
8774 echo "Ok, I'll use $libperl"
8777 libperl="libperl${_a}"
8781 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8785 WARNING: Use of the shrpdir variable for the installation location of
8786 the shared $libperl is not supported. It was never documented and
8787 will not work in this version. Let me (https://github.com/Perl/perl5/issues)
8788 know of any problems this may cause.
8794 But your current setting of $shrpdir is
8795 the default anyway, so it's harmless.
8800 Further, your current attempted setting of $shrpdir
8801 conflicts with the value of $archlibexp/CORE
8802 that installperl will use.
8809 # How will the perl executable find the installed shared $libperl?
8810 # Add $xxx to ccdlflags.
8811 # If we can't figure out a command-line option, use $shrpenv to
8812 # set env LD_RUN_PATH. The main perl makefile uses this.
8813 shrpdir=$archlibexp/CORE
8816 if "$useshrplib"; then
8819 # We'll set it in Makefile.SH...
8824 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8825 xxx="-Wl,-R$shrpdir"
8827 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8828 xxx="-Wl,-rpath,$shrpdir"
8831 # hpux doesn't like the default, either.
8832 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8835 # cygwin needs only ldlibpth
8838 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8844 # Only add $xxx if it isn't already in ccdlflags.
8845 case " $ccdlflags " in
8847 *) ccdlflags="$ccdlflags $xxx"
8850 Adding $xxx to the flags
8851 passed to $ld so that the perl executable will find the
8852 installed shared $libperl.
8860 # Fix ccdlflags in AIX for building external extensions.
8861 # (For building Perl itself bare -bE:perl.exp is needed,
8862 # Makefile.SH takes care of this.)
8864 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8866 # Respect a hint or command-line value.
8868 '') shrpenv="$tmp_shrpenv" ;;
8870 case "$ldlibpthname" in
8871 '') ldlibpthname=LD_LIBRARY_PATH ;;
8872 none) ldlibpthname='' ;;
8875 : determine where manual pages are on this system
8879 syspath='/usr/share/man/man1 /usr/man/man1'
8880 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8881 syspath="$syspath /usr/man/u_man/man1"
8882 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8883 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8884 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8885 sysman=`./loc . /usr/man/man1 $syspath`
8888 if $test -d "$sysman"; then
8889 echo "System manual is in $sysman." >&4
8891 echo "Could not find manual pages in source form." >&4
8894 : determine where manual pages go
8895 set man1dir man1dir none
8899 $spackage has manual pages available in source form.
8903 echo "However, you don't have nroff, so they're probably useless to you."
8905 '') man1dir="none";;
8908 echo "If you don't want the manual sources installed, answer 'none'."
8913 lookpath="$prefixexp/share/man/man1"
8914 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8915 lookpath="$lookpath $prefixexp/man/p_man/man1"
8916 lookpath="$lookpath $prefixexp/man/u_man/man1"
8917 lookpath="$lookpath $prefixexp/man/man.1"
8919 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8920 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8930 rp="Where do the main $spackage manual pages (source) go?"
8932 if $test "X$man1direxp" != "X$ansexp"; then
8943 : What suffix to use on installed man pages
8950 rp="What suffix should be used for the main $spackage man pages?"
8952 '') case "$man1dir" in
8966 *) dflt="$man1ext";;
8973 : see if we can have long filenames
8975 first=123456789abcdef
8977 if (echo hi >$first) 2>/dev/null; then
8978 if $test -f 123456789abcde; then
8979 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8982 echo 'You can have filenames longer than 14 characters.'>&4
8987 You can't have filenames longer than 14 chars.
8988 You can't even think about them!
8994 $rm -rf 123456789abcde*
8996 : determine where library module manual pages go
8997 set man3dir man3dir none
9001 $spackage has manual pages for many of the library modules.
9007 However, you don't have nroff, so they're probably useless to you.
9010 '') man3dir="none";;
9014 case "$d_flexfnam" in
9017 However, your system can't handle the long file names like File::Basename.3.
9020 '') man3dir="none";;
9024 echo "If you don't want the manual sources installed, answer 'none'."
9025 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9027 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9028 if $test -d "$privlib/man/man3"; then
9031 WARNING: Previous versions of perl installed man3 pages into
9032 $privlib/man/man3. This version will suggest a
9033 new default of $dflt.
9037 rp='Do you wish to preserve the old behavior?(y/n)'
9040 y*) dflt="$privlib/man/man3" ;;
9045 *) dflt="$man3dir" ;;
9052 rp="Where do the $package library man pages (source) go?"
9062 : What suffix to use on installed man pages
9068 rp="What suffix should be used for the $package library man pages?"
9070 '') case "$man3dir" in
9084 *) dflt="$man3ext";;
9091 : see if we have to deal with yellow pages, now NIS.
9092 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9098 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9106 rp='Are you getting the hosts file via yellow pages?'
9109 y*) hostcat='ypcat hosts';;
9110 *) hostcat='cat /etc/hosts';;
9116 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9119 '') test -f /etc/group && groupcat='cat /etc/group';;
9122 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9125 : now get the host name
9127 echo "Figuring out host name..." >&4
9128 case "$myhostname" in
9130 echo 'Maybe "hostname" will work...'
9131 if tans=`sh -c hostname 2>&1` ; then
9139 if $test "$cont"; then
9141 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9142 if tans=`cat /etc/systemid 2>&1` ; then
9144 phostname='cat /etc/systemid'
9145 echo "Whadyaknow. Xenix always was a bit strange..."
9148 elif $test -r /etc/systemid; then
9149 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9152 if $test "$cont"; then
9153 echo 'No, maybe "uuname -l" will work...'
9154 if tans=`sh -c 'uuname -l' 2>&1` ; then
9156 phostname='uuname -l'
9158 echo 'Strange. Maybe "uname -n" will work...'
9159 if tans=`sh -c 'uname -n' 2>&1` ; then
9161 phostname='uname -n'
9163 echo 'Oh well, maybe I can mine it out of whoami.h...'
9164 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9165 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9166 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9168 case "$myhostname" in
9169 '') echo "Does this machine have an identity crisis or something?"
9172 echo "Well, you said $myhostname before..."
9173 phostname='echo $myhostname';;
9179 case "$myhostname" in
9180 '') myhostname=noname ;;
9182 : you do not want to know about this
9187 if $test "$myhostname" ; then
9189 rp='Your host name appears to be "'$myhostname'".'" Right?"
9197 : bad guess or no guess
9198 while $test "X$myhostname" = X ; do
9200 rp="Please type the (one word) name of your host:"
9205 : translate upper to lower if necessary
9206 case "$myhostname" in
9208 echo "(Normalizing case in your host name)"
9209 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9213 case "$myhostname" in
9215 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9216 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9217 echo "(Trimming domain name from host name--host name is now $myhostname)"
9219 *) case "$mydomain" in
9222 test "X$hostcat" = "Xypcat hosts" &&
9223 ypmatch "$myhostname" hosts 2>/dev/null |\
9224 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9227 test "X$hostcat" != "X" &&
9228 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9229 /[ ]$myhostname[ . ]/p" > hosts
9232 if $test -f hosts; then
9233 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9234 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9235 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9236 hosts | $sort | $uniq | \
9237 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9238 case `$echo X$dflt` in
9239 X*\ *) echo "(Several hosts in the database matched hostname)"
9242 X.) echo "(You do not have fully-qualified names in the hosts database)"
9246 echo "(I cannot locate a hosts database anywhere)"
9251 tans=`./loc resolv.conf X /etc /usr/etc`
9252 if $test -f "$tans"; then
9253 echo "(Attempting domain name extraction from $tans)"
9254 dflt=.`$sed -n -e 's/ / /g' \
9255 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9258 .) dflt=.`$sed -n -e 's/ / /g' \
9259 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9267 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9268 dflt=.`sh -c domainname 2>/dev/null`
9271 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9275 case "$dflt$osname" in
9276 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9277 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9281 .) echo "(Lost all hope -- silly guess then)"
9287 *) dflt="$mydomain";;
9291 rp="What is your domain name?"
9301 : translate upper to lower if necessary
9304 echo "(Normalizing case in your domain name)"
9305 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9309 : a little sanity check here
9310 case "$phostname" in
9313 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9314 $myhostname$mydomain|$myhostname) ;;
9316 case "$phostname" in
9318 echo "(That doesn't agree with your whoami.h file, by the way.)"
9321 echo "(That doesn't agree with your $phostname command, by the way.)"
9329 : determine the e-mail address of the user who is running us
9332 I need to get your e-mail address in Internet format if possible, i.e.
9333 something like user@host.domain. Please answer accurately since I have
9334 no easy means to double check it. The default value provided below
9335 is most probably close to reality but may not be valid from outside
9336 your organization...
9340 while test "$cont"; do
9341 case "$MAILDOMAIN" in
9343 if $test -s /etc/mailname; then
9344 maildomain=`$cat /etc/mailname`
9346 maildomain="$myhostname$mydomain"
9349 *) maildomain="$MAILDOMAIN";;
9352 '') dflt="$cf_by@$maildomain";;
9353 *) dflt="$cf_email";;
9355 rp='What is your e-mail address?'
9361 rp='Address does not look like an Internet one. Use it anyway?'
9375 : Ask e-mail of administrator
9378 If you or somebody else will be maintaining perl at your site, please
9379 fill in the correct e-mail address here so that they may be contacted
9380 if necessary. Currently, the "perlbug" program included with perl
9381 will send mail to this address in addition to perlbug@perl.org. You may
9382 enter "none" for no administrator.
9385 case "$perladmin" in
9386 '') dflt="$cf_email";;
9387 *) dflt="$perladmin";;
9389 rp='Perl administrator e-mail address'
9393 : determine whether to use a version number suffix for installed binaries
9396 Do you want to use a version number suffix for installed binaries? This
9397 will install 'perl$version' instead of 'perl', and likewise for other
9398 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9399 to be installed side-by-side. Unless you are a developer, you probably
9400 do *not* want to do this.
9402 case "$versiononly" in
9403 "$define"|[Yy]*|true) dflt='y' ;;
9406 rp="Do you want to use a version number suffix for installed binaries?"
9409 [yY]*) val="$define";;
9415 case "$versiononly" in
9416 "$define") inc_version_list=''
9417 inc_version_list_init=0
9421 : figure out how to guarantee perl startup
9422 : XXX Note that this currently takes advantage of the bug that binexp ignores
9423 : the Configure -Dinstallprefix setting, which in turn means that under
9424 : relocatable @INC, initialinstalllocation is what binexp started as.
9425 case "$startperl" in
9427 case "$sharpbang" in
9431 I can use the #! construct to start perl on your system. This will
9432 make startup of perl scripts faster, but may cause problems if you
9433 want to share those scripts and perl is not in a standard place
9434 ($initialinstalllocation/perl) on all your platforms. The alternative
9435 is to force a shell by starting the script with a single ':' character.
9438 case "$versiononly" in
9439 "$define") dflt="$initialinstalllocation/perl$version";;
9440 *) dflt="$initialinstalllocation/perl";;
9442 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9445 none) startperl=": # use perl";;
9446 *) startperl="#!$ans"
9447 if $test 30 -lt `echo "$ans" | wc -c`; then
9450 WARNING: Some systems limit the #! command to 32 characters.
9451 If you experience difficulty running Perl scripts with #!, try
9452 installing Perl in a directory with a shorter pathname.
9458 *) startperl=": # use perl"
9463 echo "I'll use $startperl to start perl scripts."
9465 : figure best path for perl in scripts
9468 case "$versiononly" in
9469 "$define") perlpath="$initialinstalllocation/perl$version";;
9470 *) perlpath="$initialinstalllocation/perl";;
9472 case "$startperl" in
9477 I will use the "eval 'exec'" idiom to start Perl on your system.
9478 I can use the full path of your Perl binary for this purpose, but
9479 doing so may cause problems if you want to share those scripts and
9480 Perl is not always in a standard place ($initialinstalllocation/perl).
9483 dflt="$initialinstalllocation/perl"
9484 rp="What path shall I use in \"eval 'exec'\"?"
9491 case "$startperl" in
9493 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9496 : determine where public executable scripts go
9497 set scriptdir scriptdir
9499 case "$scriptdir" in
9502 : guess some guesses
9503 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9504 $test -d /usr/share/bin && dflt=/usr/share/bin
9505 $test -d /usr/local/script && dflt=/usr/local/script
9506 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9507 $test -d $prefixexp/script && dflt=$prefixexp/script
9511 *) dflt="$scriptdir"
9516 Some installations have a separate directory just for executable scripts so
9517 that they can mount it across multiple architectures but keep the scripts in
9518 one spot. You might, for example, have a subdirectory of /usr/share for this.
9519 Or you might just lump your scripts in with all your other executables.
9523 rp='Where do you keep publicly executable scripts?'
9525 if $test "X$ansexp" != "X$scriptdirexp"; then
9531 : A little fix up for an irregularly named variable.
9532 installscript="$installscriptdir"
9534 : determine where add-on public executables go
9536 '') dflt=$siteprefix/bin ;;
9540 rp='Pathname where the add-on public executables should be installed?'
9545 : determine where add-on html pages go
9546 : There is no standard location, so try to copy the previously-selected
9547 : directory structure for the core html pages.
9548 case "$sitehtml1dir" in
9549 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9550 *) dflt=$sitehtml1dir ;;
9553 ''|' ') dflt=none ;;
9556 rp='Pathname where the site-specific html pages should be installed?'
9558 prefixvar=sitehtml1dir
9561 : determine where add-on library html pages go
9562 : There is no standard location, so try to copy the previously-selected
9563 : directory structure for the core html pages.
9564 case "$sitehtml3dir" in
9565 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9566 *) dflt=$sitehtml3dir ;;
9569 ''|' ') dflt=none ;;
9572 rp='Pathname where the site-specific library html pages should be installed?'
9574 prefixvar=sitehtml3dir
9577 : determine where add-on manual pages go
9578 case "$siteman1dir" in
9579 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9580 *) dflt=$siteman1dir ;;
9583 ''|' ') dflt=none ;;
9586 rp='Pathname where the site-specific manual pages should be installed?'
9588 prefixvar=siteman1dir
9591 : determine where add-on library man pages go
9592 case "$siteman3dir" in
9593 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9594 *) dflt=$siteman3dir ;;
9597 ''|' ') dflt=none ;;
9600 rp='Pathname where the site-specific library manual pages should be installed?'
9602 prefixvar=siteman3dir
9605 : determine where add-on public executable scripts go
9606 case "$sitescript" in
9607 '') dflt=$siteprefix/script
9608 $test -d $dflt || dflt=$sitebin ;;
9609 *) dflt="$sitescript" ;;
9612 rp='Pathname where add-on public executable scripts should be installed?'
9614 prefixvar=sitescript
9617 : see if backtrace exists
9618 set backtrace d_backtrace
9621 : Check if C backtrace is actually supported.
9622 case "$usecbacktrace" in
9623 "") usecbacktrace=$undef ;;
9625 case "$d_backtrace" in
9629 echo "This system does not support backtrace" >&4
9630 usecbacktrace=$undef
9636 : Check if faststdio is requested and available
9637 case "$usefaststdio" in
9638 $define|true|[yY]*|'')
9639 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9649 Perl can be built to use 'fast stdio', which means using the stdio
9650 library but also directly manipulating the stdio buffers to enable
9651 faster I/O. Using stdio is better for backward compatibility (especially
9652 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9653 interface has been preferred instead of stdio.
9655 If this doesn't make any sense to you, just accept the default '$dflt'.
9657 rp='Use the "fast stdio" if available?'
9660 y|Y) val="$define" ;;
9666 : define an is-a-typedef? function
9667 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9669 "") inclist="sys/types.h";;
9671 eval "varval=\$$var";
9675 for inc in $inclist; do
9676 echo "#include <$inc>" >>temp.c;
9678 echo "#ifdef $type" >> temp.c;
9679 echo "printf(\"We have $type\");" >> temp.c;
9680 echo "#endif" >> temp.c;
9681 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9682 if $contains $type temp.E >/dev/null 2>&1; then
9688 *) eval "$var=\$varval";;
9691 : define an is-a-typedef? function that prompts if the type is not available.
9692 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9694 "") inclist="sys/types.h";;
9696 eval "varval=\$$var";
9700 for inc in $inclist; do
9701 echo "#include <$inc>" >>temp.c;
9703 echo "#ifdef $type" >> temp.c;
9704 echo "printf(\"We have $type\");" >> temp.c;
9705 echo "#endif" >> temp.c;
9706 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9708 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9709 if $contains $type temp.E >/dev/null 2>&1; then
9710 echo "$type found." >&4;
9713 echo "$type NOT found." >&4;
9719 *) eval "$var=\$varval";;
9722 : see what type lseek is declared as in the kernel
9723 rp="What is the type used for lseek's offset on this system?"
9724 set off_t lseektype long stdio.h sys/types.h
9728 echo "Checking to see how big your file offsets are..." >&4
9730 #include <sys/types.h>
9734 printf("%d\n", (int)sizeof($lseektype));
9739 if eval $compile_ok; then
9740 lseeksize=`$run ./try`
9741 echo "Your file offsets are $lseeksize bytes long."
9745 echo "(I can't seem to compile the test program. Guessing...)"
9746 rp="What is the size of your file offsets (in bytes)?"
9752 : see what type file positions are declared as in the library
9753 rp="What is the type for file position used by fsetpos()?"
9754 set fpos_t fpostype long stdio.h sys/types.h
9757 : Check size for Fpos_t
9760 *_t) zzz="$fpostype" ;;
9763 echo "Checking the size of $zzz..." >&4
9765 #include <sys/types.h>
9772 printf("%d\n", (int)sizeof($fpostype));
9777 if eval $compile_ok; then
9781 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9784 echo "Your $zzz is $fpossize bytes long."
9790 echo "(I can't compile the test program. Guessing...)" >&4
9791 rp="What is the size of your file positions (in bytes)?"
9796 : Check for large file support
9797 # Backward compatibility (uselfs is deprecated).
9799 "$define"|true|[yY]*)
9802 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9804 uselargefiles="$define"
9808 case "$lseeksize:$fpossize" in
9811 You can have files larger than 2 gigabytes.
9814 *) case "$uselargefiles" in
9815 "$undef"|false|[nN]*) dflt='n' ;;
9820 Perl can be built to understand large files (files larger than 2 gigabytes)
9821 on some systems. To do so, Configure can be run with -Duselargefiles.
9823 If this doesn't make any sense to you, just accept the default '$dflt'.
9825 rp='Try to understand large files, if available?'
9828 y|Y) val="$define" ;;
9835 : Look for a hint-file generated 'call-back-unit'. If the
9836 : user has specified that a large files perl is to be built,
9837 : we may need to set or change some other defaults.
9838 if $test -f uselargefiles.cbu; then
9839 echo "Your platform has some specific hints regarding large file builds, using them..."
9840 . ./uselargefiles.cbu
9842 case "$uselargefiles" in
9844 if $test -f uselargefiles.cbu; then
9846 echo "Rechecking to see how big your file offsets are..." >&4
9848 #include <sys/types.h>
9852 printf("%d\n", (int)sizeof($lseektype));
9857 if eval $compile_ok; then
9858 lseeksize=`$run ./try`
9859 $echo "Your file offsets are now $lseeksize bytes long."
9863 echo "(I can't seem to compile the test program. Guessing...)"
9864 rp="What is the size of your file offsets (in bytes)?"
9869 *_t) zzz="$fpostype" ;;
9872 $echo $n "Rechecking the size of $zzz...$c" >&4
9874 #include <sys/types.h>
9881 printf("%d\n", (int)sizeof($fpostype));
9886 if eval $compile_ok; then
9891 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9894 echo " $fpossize bytes." >&4
9900 echo "(I can't compile the test program. Guessing...)" >&4
9901 rp="What is the size of your file positions (in bytes)?"
9910 : Check if we want perlio
9913 : Set the vendorbin variables
9914 case "$vendorprefix" in
9915 '') d_vendorbin="$undef"
9919 *) d_vendorbin="$define"
9920 : determine where vendor-supplied executables go.
9921 case "$vendorbin" in
9922 '') dflt=$vendorprefix/bin ;;
9923 *) dflt="$vendorbin" ;;
9926 rp='Pathname for the vendor-supplied executables directory?'
9929 vendorbinexp="$ansexp"
9935 : Set the vendorhtml1dir variables
9936 case "$vendorprefix" in
9937 '') vendorhtml1dir=''
9938 vendorhtml1direxp=''
9940 *) : determine where vendor-supplied html pages go.
9941 : There is no standard location, so try to copy the previously-selected
9942 : directory structure for the core html pages.
9943 : XXX Better default suggestions would be welcome.
9944 case "$vendorhtml1dir" in
9945 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9946 *) dflt=$vendorhtml1dir ;;
9949 ''|' ') dflt=none ;;
9952 rp='Pathname for the vendor-supplied html pages?'
9954 vendorhtml1dir="$ans"
9955 vendorhtml1direxp="$ansexp"
9958 : Use ' ' for none so value is preserved next time through Configure
9959 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9960 prefixvar=vendorhtml1dir
9963 : Set the vendorhtml3dir variables
9964 case "$vendorprefix" in
9965 '') vendorhtml3dir=''
9966 vendorhtml3direxp=''
9968 *) : determine where vendor-supplied module html pages go.
9969 : There is no standard location, so try to copy the previously-selected
9970 : directory structure for the core html pages.
9971 : XXX Better default suggestions would be welcome.
9972 case "$vendorhtml3dir" in
9973 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9974 *) dflt=$vendorhtml3dir ;;
9977 ''|' ') dflt=none ;;
9980 rp='Pathname for the vendor-supplied html pages?'
9982 vendorhtml3dir="$ans"
9983 vendorhtml3direxp="$ansexp"
9986 : Use ' ' for none so value is preserved next time through Configure
9987 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9988 prefixvar=vendorhtml3dir
9991 : Set the vendorman1dir variables
9992 case "$vendorprefix" in
9993 '') vendorman1dir=''
9996 *) : determine where vendor-supplied manual pages go.
9997 case "$vendorman1dir" in
9998 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9999 *) dflt=$vendorman1dir ;;
10002 ''|' ') dflt=none ;;
10005 rp='Pathname for the vendor-supplied manual section 1 pages?'
10007 vendorman1dir="$ans"
10008 vendorman1direxp="$ansexp"
10011 : Use ' ' for none so value is preserved next time through Configure
10012 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10013 prefixvar=vendorman1dir
10016 : Set the vendorman3dir variables
10017 case "$vendorprefix" in
10018 '') vendorman3dir=''
10019 vendorman3direxp=''
10021 *) : determine where vendor-supplied module manual pages go.
10022 case "$vendorman3dir" in
10023 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10024 *) dflt=$vendorman3dir ;;
10027 ''|' ') dflt=none ;;
10030 rp='Pathname for the vendor-supplied manual section 3 pages?'
10032 vendorman3dir="$ans"
10033 vendorman3direxp="$ansexp"
10036 : Use ' ' for none so value is preserved next time through Configure
10037 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10038 prefixvar=vendorman3dir
10041 : Set the vendorscript variables
10042 case "$vendorprefix" in
10043 '') d_vendorscript="$undef"
10047 *) d_vendorscript="$define"
10048 : determine where vendor-supplied scripts go.
10049 case "$vendorscript" in
10050 '') dflt=$vendorprefix/script
10051 $test -d $dflt || dflt=$vendorbin ;;
10052 *) dflt="$vendorscript" ;;
10056 The installation process will create a directory for
10057 vendor-supplied scripts.
10061 rp='Pathname for the vendor-supplied scripts directory?'
10063 vendorscript="$ans"
10064 vendorscriptexp="$ansexp"
10067 prefixvar=vendorscript
10070 : see if qgcvt exists
10074 : Check what kind of doubles your system has
10075 $echo "Checking the kind of doubles you have..." >&4
10077 #$i_stdlib I_STDLIB
10078 #define DOUBLESIZE $doublesize
10080 #include <stdlib.h>
10083 static const double d = -0.1;
10085 unsigned const char* b = (unsigned const char*)(&d);
10086 #if DOUBLESIZE == 4
10087 if (b[0] == 0xCD && b[3] == 0xBD) {
10088 /* IEEE 754 32-bit little-endian */
10092 if (b[0] == 0xBD && b[3] == 0xCD) {
10093 /* IEEE 754 32-bit big-endian */
10097 if (b[0] == 0xCC && b[3] == 0xCC) {
10098 /* VAX format F, 32-bit PDP-style mixed endian. */
10102 if (b[0] == 0xC0 && b[3] == 0x9A) {
10103 /* IBM single 32-bit */
10108 #if DOUBLESIZE == 8
10109 if (b[0] == 0x9A && b[7] == 0xBF) {
10110 /* IEEE 754 64-bit little-endian */
10114 if (b[0] == 0xBF && b[7] == 0x9A) {
10115 /* IEEE 754 64-bit big-endian */
10119 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10120 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10121 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10122 * 99 99 b9 bf 9a 99 99 99 */
10126 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10127 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10128 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10129 * 99 99 99 9a bf b9 99 99 */
10133 if (b[0] == 0xCC && b[7] == 0xCC) {
10134 /* VAX format D, 64-bit PDP-style mixed endian. */
10138 if (b[0] == 0xD9 && b[7] == 0x99) {
10139 /* VAX format G, 64-bit PDP-style mixed endian. */
10143 if (b[0] == 0xC0 && b[7] == 0x9A) {
10144 /* IBM double 64-bit */
10148 if (b[0] == 0xBF && b[7] == 0xCD) {
10149 /* CRAY single 64-bit */
10154 #if DOUBLESIZE == 16
10155 if (b[0] == 0x9A && b[15] == 0xBF) {
10156 /* IEEE 754 128-bit little-endian */
10160 if (b[0] == 0xBF && b[15] == 0x9A) {
10161 /* IEEE 754 128-bit big-endian */
10166 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10167 * Whether those environments can still build Perl is debatable. */
10168 printf("-1\n"); /* unknown */
10173 if eval $compile; then
10174 doublekind=`$run ./try`
10178 case "$doublekind" in
10179 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10180 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10181 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10182 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10183 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10184 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10185 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10186 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10187 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10188 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10189 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10190 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10191 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10192 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10193 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10195 d_double_style_ieee=$undef
10196 d_double_style_vax=$undef
10197 d_double_style_ibm=$undef
10198 d_double_style_cray=$undef
10199 case "$doublekind" in
10200 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10201 9|10|11) d_double_style_vax=$define ;;
10202 12|13) d_double_style_ibm=$define ;;
10203 14) d_double_style_cray=$define ;;
10205 case "$d_double_style_ieee" in
10207 d_double_has_inf=$define
10208 d_double_has_nan=$define
10209 d_double_has_negative_zero=$define
10210 d_double_has_subnormals=$define
10213 d_double_has_inf=$undef
10214 d_double_has_nan=$undef
10215 d_double_has_negative_zero=$undef
10216 d_double_has_subnormals=$undef
10221 : Check print/scan long double stuff
10224 if $test X"$d_longdbl" = X"$define"; then
10226 echo "Checking how to print long doubles..." >&4
10228 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10229 $cat >try.c <<'EOCP'
10230 #include <sys/types.h>
10233 double d = 123.456;
10234 printf("%.3f\n", d);
10238 if eval $compile; then
10242 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10243 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10244 echo "We will use %f."
10250 if $test X"$sPRIfldbl" = X; then
10251 $cat >try.c <<'EOCP'
10252 #include <sys/types.h>
10255 long double d = 123.456;
10256 printf("%.3Lf\n", d);
10260 if eval $compile; then
10264 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10265 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10266 echo "We will use %Lf."
10272 if $test X"$sPRIfldbl" = X; then
10273 $cat >try.c <<'EOCP'
10274 #include <sys/types.h>
10277 long double d = 123.456;
10278 printf("%.3llf\n", d);
10282 if eval $compile; then
10286 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10287 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10288 echo "We will use %llf."
10294 if $test X"$sPRIfldbl" = X; then
10295 $cat >try.c <<'EOCP'
10296 #include <sys/types.h>
10299 long double d = 123.456;
10300 printf("%.3lf\n", d);
10304 if eval $compile; then
10308 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10309 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10310 echo "We will use %lf."
10316 if $test X"$sPRIfldbl" = X; then
10317 echo "Cannot figure out how to print long doubles." >&4
10319 sSCNfldbl=$sPRIfldbl # expect consistency
10326 case "$sPRIfldbl" in
10327 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10328 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10329 d_SCNfldbl="$undef";
10331 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10332 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10333 d_SCNfldbl="$define";
10337 : Before committing on uselongdouble, see whether that looks sane.
10338 if $test "$uselongdouble" = "$define"; then
10341 echo "Checking if your long double math functions work right..." >&4
10346 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10349 case "$osname:$gccversion" in
10350 aix:) saveccflags="$ccflags"
10351 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10354 if eval $compile_ok; then
10358 3) echo "Your long double math functions are working correctly." >&4 ;;
10359 *) echo "Your long double math functions are broken, not using long doubles." >&4
10360 uselongdouble=$undef
10364 case "$osname:$gccversion" in
10365 aix:) ccflags="$saveccflags" ;; # restore
10369 : Check how to convert floats to strings.
10371 if test "X$d_Gconvert" = X; then
10374 echo "Checking for an efficient way to convert floats to strings."
10376 case "$uselongdouble" in
10377 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10379 case "$d_longdbl" in
10380 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10382 case "$d_PRIgldbl" in
10383 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10386 #ifdef TRY_gconvert
10387 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10388 const char *myname = "gconvert";
10391 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10392 const char *myname = "gcvt";
10395 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10396 const char *myname = "qgcvt";
10397 #define DOUBLETYPE long double
10400 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10401 #ifdef HAS_PRIgldbl
10402 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10404 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10407 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10409 const char *myname = "sprintf";
10413 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10414 #define DOUBLETYPE long double
10416 #define DOUBLETYPE double
10422 #$i_stdlib I_STDLIB
10424 #include <stdlib.h>
10426 #include <string.h>
10428 void checkit(const char *expect, char *got)
10430 if (strcmp(expect, got)) {
10431 printf("%s oddity: Expected %s, got %s\n",
10432 myname, expect, got);
10442 /* This must be 1st test on (which?) platform */
10443 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10444 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10445 checkit("0.1", buf);
10447 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10448 checkit("0.01", buf);
10450 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10451 checkit("0.001", buf);
10453 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10454 checkit("0.0001", buf);
10456 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10457 if (strlen(buf) > 5)
10458 checkit("9e-005", buf); /* for Microsoft ?? */
10460 checkit("9e-05", buf);
10462 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10465 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10466 checkit("1.1", buf);
10468 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10469 checkit("1.01", buf);
10471 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10472 checkit("1.001", buf);
10474 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10475 checkit("1.0001", buf);
10477 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10478 checkit("1.00001", buf);
10480 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10481 checkit("1.000001", buf);
10483 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10486 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10487 checkit("-1", buf);
10489 /* Some Linux gcvt's give 1.e+5 here. */
10490 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10491 checkit("100000", buf);
10493 /* Some Linux gcvt's give -1.e+5 here. */
10494 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10495 checkit("-100000", buf);
10497 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10498 checkit("123.456", buf);
10500 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10501 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10502 /* 34 should be enough to scare even long double
10503 * places into using the e notation. */
10504 if (strlen(buf) > 5)
10505 checkit("1e+034", buf); /* for Microsoft */
10507 checkit("1e+34", buf);
10509 /* For Perl, if you add additional tests here, also add them to
10510 * t/base/num.t for benefit of platforms not using Configure or
10511 * overriding d_Gconvert */
10516 : first add preferred functions to our list
10518 for xxx_convert in $gconvert_preference; do
10519 case $xxx_convert in
10520 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10521 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10524 : then add any others
10525 for xxx_convert in gconvert gcvt sprintf; do
10526 case "$xxx_list" in
10528 *) xxx_list="$xxx_list $xxx_convert" ;;
10532 case "$d_longdbl$uselongdouble" in
10534 : again, add preferred functions to our list first
10536 for xxx_convert in $gconvert_ld_preference; do
10537 case $xxx_convert in
10538 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10539 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10542 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10543 for xxx_convert in qgcvt sprintf $xxx_list; do
10544 case "$xxx_ld_list" in
10545 $xxx_convert*|*" $xxx_convert"*) ;;
10546 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10549 : if sprintf cannot do long doubles, move it to the end
10550 if test "$d_PRIgldbl" != "$define"; then
10551 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10553 : if no qgcvt, remove it
10554 if test "$d_qgcvt" != "$define"; then
10555 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10558 xxx_list="$xxx_ld_list"
10562 for xxx_convert in $xxx_list; do
10563 echo "Trying $xxx_convert..."
10564 $rm -f try try$_o core
10565 set try -DTRY_$xxx_convert
10566 if eval $compile; then
10567 echo "$xxx_convert() found." >&4
10568 if $run ./try; then
10569 echo "I'll use $xxx_convert to convert floats into a string." >&4
10572 echo "...But $xxx_convert didn't work as I expected."
10576 echo "$xxx_convert NOT found." >&4
10581 if test X$xxx_convert = X; then
10582 echo "*** WHOA THERE!!! ***" >&4
10583 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10584 xxx_convert=sprintf
10587 case "$xxx_convert" in
10588 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10589 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10590 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10591 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10592 "$define$define$define")
10593 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10594 "$define$define$undef")
10595 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10596 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10604 : see if _fwalk exists
10608 : see if accept4 exists
10609 set accept4 d_accept4
10612 : Initialize h_fcntl
10615 : Initialize h_sysfile
10618 : access call always available on UNIX
10619 set access d_access
10622 : locate the flags for 'access()'
10623 case "$d_access" in
10626 $cat >access.c <<EOCP
10627 #include <sys/types.h>
10632 #include <sys/file.h>
10635 #include <unistd.h>
10637 #$i_stdlib I_STDLIB
10639 #include <stdlib.h>
10645 : check sys/file.h first, no particular reason here
10646 if $test `./findhdr sys/file.h` && \
10647 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10649 echo "<sys/file.h> defines the *_OK access constants." >&4
10650 elif $test `./findhdr fcntl.h` && \
10651 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10653 echo "<fcntl.h> defines the *_OK access constants." >&4
10654 elif $test `./findhdr unistd.h` && \
10655 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10656 echo "<unistd.h> defines the *_OK access constants." >&4
10658 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10664 : see if accessx exists
10665 set accessx d_accessx
10668 : see if acosh exists
10672 : see if aintl exists
10676 : see if alarm exists
10680 : see if 64bit time functions exists
10682 set ctime64 d_ctime64
10685 set localtime64 d_localtime64
10688 set gmtime64 d_gmtime64
10691 set mktime64 d_mktime64
10694 set difftime64 d_difftime64
10697 set asctime64 d_asctime64
10700 : see if POSIX threads are available
10701 set pthread.h i_pthread
10704 : define a function to check prototypes
10705 $cat > protochk <<EOSH
10708 optimize="$optimize"
10712 usethreads=$usethreads
10713 i_pthread=$i_pthread
10714 pthread_h_first=$pthread_h_first
10717 $cat >> protochk <<'EOSH'
10722 while test $# -ge 2; do
10724 $define) echo "#include <$2>" >> try.c ;;
10725 literal) echo "$2" >> try.c ;;
10727 # Extra magic for the benefit of systems that need pthread.h
10728 # to be included early to correctly detect threadsafe functions.
10729 # Such functions must guarantee themselves, though, that the usethreads
10730 # and i_pthread have been defined, before calling protochk.
10731 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10732 echo "#include <pthread.h>" >> try.c
10737 cat >> try.c <<'EOCP'
10738 #define _(args) args
10740 echo "$foo" >> try.c
10741 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10742 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10748 $eunicefix protochk
10750 : Define hasproto macro for Configure internal use
10751 hasproto='varname=$1; func=$2; shift; shift;
10752 while $test $# -ge 2; do
10754 $define) echo "#include <$2>";;
10755 literal) echo "$2" ;;
10759 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10760 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10761 echo "$func() prototype found.";
10764 echo "$func() prototype NOT found.";
10771 : see if sys/types.h has to be included
10772 set sys/types.h i_systypes
10775 : see if sys/select.h has to be included
10776 set sys/select.h i_sysselct
10779 : Define hasfield macro for Configure internal use
10780 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10781 while $test $# -ge 2; do
10783 $define) echo "#include <$2>";;
10787 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10789 if eval $compile; then
10798 : see if we should include sys/time.h
10801 if test "X$timeincl" = X; then
10802 echo "Testing to see if we should include <sys/time.h>." >&4
10803 $echo $n "I'm now running the test program...$c"
10805 #include <sys/types.h>
10808 #ifdef SYSTIMEKERNEL
10811 #include <sys/time.h>
10814 #include <sys/select.h>
10816 #$i_stdlib I_STDLIB
10818 #include <stdlib.h>
10824 struct timeval bar;
10827 struct timezone tzp;
10829 if (foo.tm_sec == foo.tm_sec)
10832 if (bar.tv_sec == bar.tv_sec)
10839 for s_timezone in '-DS_TIMEZONE' ''; do
10841 for s_timeval in '-DS_TIMEVAL' ''; do
10842 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10843 for i_systime in '-DI_SYSTIME' ''; do
10846 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10847 if eval $compile; then
10848 set X $i_systime $i_systimek $sysselect $s_timeval
10852 $echo $n "Succeeded with $flags$c"
10863 *SYSTIMEKERNEL*) i_systimek="$define"
10864 timeincl=`./findhdr sys/time.h`
10865 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10866 *) i_systimek="$undef";;
10869 *I_SYSTIME*) i_systime="$define"
10870 timeincl=`./findhdr sys/time.h`" $timeincl"
10871 echo "We'll include <sys/time.h>." >&4;;
10872 *) i_systime="$undef";;
10876 : see if struct tm knows about tm_zone
10877 case "$i_systime$i_time" in
10880 echo "Checking to see if your struct tm has tm_zone field..." >&4
10881 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10889 case "$d_tm_tm_zone" in
10890 "$define") echo "Yes, it does." ;;
10891 *) echo "No, it doesn't." ;;
10893 : see if struct tm knows about tm_gmtoff
10894 case "$i_systime$i_time" in
10897 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10898 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10906 case "$d_tm_tm_gmtoff" in
10907 "$define") echo "Yes, it does." ;;
10908 *) echo "No, it doesn't." ;;
10911 : see if asctime_r exists
10912 set asctime_r d_asctime_r
10914 case "$d_asctime_r" in
10916 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10917 case "$d_asctime_r_proto:$usethreads" in
10918 ":define") d_asctime_r_proto=define
10919 set d_asctime_r_proto asctime_r $hdrs
10923 case "$d_asctime_r_proto" in
10925 case "$asctime_r_proto" in
10926 ''|0) try='char* asctime_r(const struct tm*, char*);'
10927 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10929 case "$asctime_r_proto" in
10930 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10931 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10933 case "$asctime_r_proto" in
10934 ''|0) try='int asctime_r(const struct tm*, char*);'
10935 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10937 case "$asctime_r_proto" in
10938 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10939 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10941 case "$asctime_r_proto" in
10942 ''|0) d_asctime_r=undef
10944 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10945 * ) case "$asctime_r_proto" in
10946 REENTRANT_PROTO*) ;;
10947 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10949 echo "Prototype: $try" ;;
10952 *) case "$usethreads" in
10953 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10960 *) asctime_r_proto=0
10964 : see if asinh exists
10968 : see if atanh exists
10972 : see if atolf exists
10976 : see if atoll exists
10980 : Look for GCC-style attribute format
10981 case "$d_attribute_format" in
10984 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10985 $cat >attrib.c <<'EOCP'
10987 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10989 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10990 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10991 echo "Your C compiler doesn't support __attribute__((format))."
10994 echo "Your C compiler supports __attribute__((format))."
10998 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11002 *) val="$d_attribute_format" ;;
11004 set d_attribute_format
11008 : Look for GCC-style attribute format with null format allowed
11009 case "$d_printf_format_null" in
11010 '') case "$d_attribute_format" in
11013 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11014 $cat >attrib.c <<EOCP
11016 #$i_stdlib I_STDLIB
11018 #include <stdlib.h>
11020 #$i_inttypes I_INTTYPES
11022 #include <inttypes.h>
11025 #define intptr_t int
11027 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11028 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11029 int main () { exit(null_printf(NULL)); }
11031 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11032 : run the executable in case it produces a run-time warning
11033 if $run ./attrib >>attrib.out 2>&1; then
11034 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11035 echo "Your C compiler doesn't allow __printf__ format to be null."
11038 echo "Your C compiler allows __printf__ format to be null."
11042 echo "Your C compiler executable failed with __printf__ format null."
11046 echo "Your C compiler fails with __printf__ format null."
11053 *) val="$d_printf_format_null" ;;
11055 set d_printf_format_null
11059 : Look for GCC-style attribute malloc
11060 case "$d_attribute_malloc" in
11063 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11064 $cat >attrib.c <<'EOCP'
11066 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11068 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11069 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11070 echo "Your C compiler doesn't support __attribute__((malloc))."
11073 echo "Your C compiler supports __attribute__((malloc))."
11077 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11081 *) val="$d_attribute_malloc" ;;
11083 set d_attribute_malloc
11087 : Look for GCC-style attribute nonnull
11088 case "$d_attribute_nonnull" in
11091 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11092 $cat >attrib.c <<'EOCP'
11094 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11096 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11097 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11098 echo "Your C compiler doesn't support __attribute__((nonnull))."
11101 echo "Your C compiler supports __attribute__((nonnull))."
11105 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11109 *) val="$d_attribute_nonnull" ;;
11111 set d_attribute_nonnull
11115 : Look for GCC-style attribute noreturn
11116 case "$d_attribute_noreturn" in
11119 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11120 $cat >attrib.c <<'EOCP'
11122 void fall_over_dead( void ) __attribute__((noreturn));
11124 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11125 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11126 echo "Your C compiler doesn't support __attribute__((noreturn))."
11129 echo "Your C compiler supports __attribute__((noreturn))."
11133 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11137 *) val="$d_attribute_noreturn" ;;
11139 set d_attribute_noreturn
11143 : Look for GCC-style attribute pure
11144 case "$d_attribute_pure" in
11147 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11148 $cat >attrib.c <<'EOCP'
11150 int square( int n ) __attribute__((pure));
11152 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11153 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11154 echo "Your C compiler doesn't support __attribute__((pure))."
11157 echo "Your C compiler supports __attribute__((pure))."
11161 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11165 *) val="$d_attribute_pure" ;;
11167 set d_attribute_pure
11171 : Look for GCC-style attribute unused
11172 case "$d_attribute_unused" in
11175 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11176 $cat >attrib.c <<'EOCP'
11178 int do_something( int dummy __attribute__((unused)), int n );
11180 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11181 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11182 echo "Your C compiler doesn't support __attribute__((unused))."
11185 echo "Your C compiler supports __attribute__((unused))."
11189 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11193 *) val="$d_attribute_unused" ;;
11195 set d_attribute_unused
11199 : Look for GCC-style attribute deprecated
11200 case "$d_attribute_deprecated" in
11203 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11204 $cat >attrib.c <<'EOCP'
11206 int I_am_deprecated(void) __attribute__((deprecated));
11208 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11209 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11210 echo "Your C compiler doesn't support __attribute__((deprecated))."
11213 echo "Your C compiler supports __attribute__((deprecated))."
11217 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11221 *) val="$d_attribute_deprecated" ;;
11223 set d_attribute_deprecated
11227 : Look for GCC-style attribute warn_unused_result
11228 case "$d_attribute_warn_unused_result" in
11231 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11232 $cat >attrib.c <<'EOCP'
11234 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11236 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11237 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11238 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11241 echo "Your C compiler supports __attribute__((warn_unused_result))."
11245 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11249 *) val="$d_attribute_warn_unused_result" ;;
11251 set d_attribute_warn_unused_result
11255 : Look for GCC-style attribute always_inline
11256 case "$d_attribute_always_inline" in
11259 echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
11260 $cat >attrib.c <<'EOCP'
11262 static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
11264 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11265 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11266 echo "Your C compiler doesn't support __attribute__((always_inline))."
11269 echo "Your C compiler supports __attribute__((always_inline))."
11273 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11277 *) val="$d_attribute_always_inline" ;;
11279 set d_attribute_always_inline
11283 : see if getpgrp exists
11284 set getpgrp d_getpgrp
11287 case "$d_getpgrp" in
11290 echo "Checking to see which flavor of getpgrp is in use..."
11293 #$i_unistd I_UNISTD
11294 #include <sys/types.h>
11296 # include <unistd.h>
11298 #$i_stdlib I_STDLIB
11300 #include <stdlib.h>
11304 if (getuid() == 0) {
11305 printf("(I see you are running Configure as super-user...)\n");
11308 #ifdef TRY_BSD_PGRP
11309 if (getpgrp(1) == 0)
11318 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11319 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11321 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11322 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11325 echo "I can't seem to compile and run the test program."
11327 xxx="a USG one, i.e. you use getpgrp()."
11329 # SVR4 systems can appear rather BSD-ish.
11330 case "$i_unistd" in
11332 xxx="a BSD one, i.e. you use getpgrp(pid)."
11336 xxx="probably a USG one, i.e. you use getpgrp()."
11341 echo "Assuming your getpgrp is $xxx" >&4
11350 : see if setpgrp exists
11351 set setpgrp d_setpgrp
11354 case "$d_setpgrp" in
11357 echo "Checking to see which flavor of setpgrp is in use..."
11360 #$i_unistd I_UNISTD
11361 #include <sys/types.h>
11363 # include <unistd.h>
11365 #$i_stdlib I_STDLIB
11367 #include <stdlib.h>
11371 if (getuid() == 0) {
11372 printf("(I see you are running Configure as super-user...)\n");
11375 #ifdef TRY_BSD_PGRP
11376 if (-1 == setpgrp(1, 1))
11379 if (setpgrp() != -1)
11385 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11386 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11388 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11389 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11392 echo "(I can't seem to compile and run the test program.)"
11394 xxx="a USG one, i.e. you use setpgrp()."
11396 # SVR4 systems can appear rather BSD-ish.
11397 case "$i_unistd" in
11399 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11403 xxx="probably a USG one, i.e. you use setpgrp()."
11408 echo "Assuming your setpgrp is $xxx" >&4
11417 : Look for GCC-style __builtin_add_overflow
11418 case "$d_builtin_add_overflow" in
11421 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11422 $cat >try.c <<'EOCP'
11424 const unsigned int uint_max = ~0u;
11425 int target_int = 0;
11426 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11429 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11432 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11439 if eval $compile && $run ./try; then
11440 echo "Your C compiler supports __builtin_add_overflow."
11443 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11447 *) val="$d_builtin_add_overflow" ;;
11450 set d_builtin_add_overflow
11454 : Look for GCC-style __builtin_sub_overflow
11455 case "$d_builtin_sub_overflow" in
11458 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11459 $cat >try.c <<'EOCP'
11461 const unsigned int uint_max = ~0u;
11462 int target_int = 0;
11463 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11466 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11469 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11476 if eval $compile && $run ./try; then
11477 echo "Your C compiler supports __builtin_sub_overflow."
11480 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11484 *) val="$d_builtin_sub_overflow" ;;
11487 set d_builtin_sub_overflow
11491 : Look for GCC-style __builtin_mul_overflow
11492 case "$d_builtin_mul_overflow" in
11495 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11496 $cat >try.c <<'EOCP'
11498 const unsigned int uint_max = ~0u;
11499 int target_int = 0;
11500 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11503 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11506 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11513 if eval $compile && $run ./try; then
11514 echo "Your C compiler supports __builtin_mul_overflow."
11517 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11521 *) val="$d_builtin_mul_overflow" ;;
11524 set d_builtin_mul_overflow
11528 : Look for GCC-style __builtin_choose_expr
11529 case "$d_builtin_choose_expr" in
11532 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11533 $cat >try.c <<'EOCP'
11534 #include <assert.h>
11535 #include <stdlib.h>
11538 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11541 assert( SYRINX(1) == 2112 );
11542 assert( SYRINX(1) != 5150 );
11543 assert( SYRINX(0) == 5150 );
11544 assert( SYRINX(0) != 2112 );
11545 puts( "All good!" );
11551 if eval $compile && $run ./try; then
11552 echo "Your C compiler supports __builtin_choose_expr."
11555 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11559 *) val="$d_builtin_choose_expr" ;;
11562 set d_builtin_choose_expr
11566 : Look for GCC-style __builtin_expect
11567 case "$d_builtin_expect" in
11570 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11571 $cat >try.c <<'EOCP'
11574 if ( __builtin_expect(n, 0) ) n = 1;
11575 /* Remember shell exit code truth is 0, C truth is non-zero */
11580 if eval $compile && $run ./try; then
11581 echo "Your C compiler supports __builtin_expect."
11584 echo "Your C compiler doesn't seem to understand __builtin_expect."
11588 *) val="$d_builtin_expect" ;;
11591 set d_builtin_expect
11595 : see if the Compiler supports C99 variadic macros
11596 echo "Checking for C99 variadic macros." >&4
11599 #include <stdarg.h>
11601 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11605 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11611 if eval $compile && $run ./try 2>&1 >/dev/null; then
11612 case "`$run ./try`" in
11614 echo "You have C99 variadic macros." >&4
11615 d_c99_variadic_macros="$define"
11618 echo "You don't have functional C99 variadic macros." >&4
11619 d_c99_variadic_macros="$undef"
11623 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11624 d_c99_variadic_macros="$undef"
11628 : see if signal is declared as pointer to function returning int or void
11630 xxx=`./findhdr signal.h`
11631 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11632 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11633 echo "You have int (*signal())() instead of void." >&4
11635 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11636 echo "You have void (*signal())()." >&4
11638 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11639 echo "You have int (*signal())() instead of void." >&4
11641 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11642 echo "You have void (*signal())()." >&4
11645 case "$d_voidsig" in
11647 echo "I can't determine whether signal handler returns void or int..." >&4
11649 rp="What type does your signal handler return?"
11652 v*) val="$define";;
11656 echo "As you already told me, signal handler returns void." >&4
11659 *) echo "As you already told me, signal handler returns int." >&4
11666 case "$d_voidsig" in
11667 "$define") signal_t="void";;
11668 *) signal_t="int";;
11672 : check for ability to cast large floats to 32-bit ints.
11674 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11675 if $test "$intsize" -ge 4; then
11682 #$i_stdlib I_STDLIB
11684 #include <stdlib.h>
11686 #include <sys/types.h>
11687 #include <signal.h>
11688 $signal_t blech(int s) { exit(3); }
11695 signal(SIGFPE, blech);
11697 /* Don't let compiler optimize the test away. Store the number
11698 in a writable string for gcc to pass to sscanf under HP-UX.
11700 sprintf(str, "2147483647");
11701 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11705 /* x86 processors will probably give 0x8000 0000, which is a
11706 sign change. We don't want that. We want to mimic SPARC
11707 behavior here, which is to preserve the sign and give
11710 if (i32 != ($xxx) f)
11716 if eval $compile_ok; then
11717 $run ./try 2>/dev/null
11720 echo "(I can't seem to compile the test program--assuming it can't)"
11725 echo "Yup, it can."
11728 echo "Nope, it can't."
11735 : check for ability to cast negative floats to unsigned
11737 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11740 #$i_stdlib I_STDLIB
11742 #include <stdlib.h>
11744 #include <sys/types.h>
11745 #include <signal.h>
11746 $signal_t blech(int s) { exit(7); }
11747 $signal_t blech_in_list(int s) { exit(4); }
11748 unsigned long dummy_long(unsigned long p) { return p; }
11749 unsigned int dummy_int(unsigned int p) { return p; }
11750 unsigned short dummy_short(unsigned short p) { return p; }
11754 unsigned long along;
11756 unsigned short ashort;
11760 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11761 a direct f = -123. assignment. gcc-2.8.0 reportedly
11762 optimized the whole file away
11764 /* Store the number in a writable string for gcc to pass to
11765 sscanf under HP-UX.
11767 sprintf(str, "-123");
11768 sscanf(str, "%lf", &f); /* f = -123.; */
11770 signal(SIGFPE, blech);
11771 along = (unsigned long)f;
11772 aint = (unsigned int)f;
11773 ashort = (unsigned short)f;
11774 if (along != (unsigned long)-123)
11776 if (aint != (unsigned int)-123)
11778 if (ashort != (unsigned short)-123)
11780 sprintf(str, "1073741824.");
11781 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11784 along = (unsigned long)f;
11785 if (along != 0x80000000)
11789 along = (unsigned long)f;
11790 if (along != 0x7fffffff)
11794 along = (unsigned long)f;
11795 if (along != 0x80000001)
11799 signal(SIGFPE, blech_in_list);
11800 sprintf(str, "123.");
11801 sscanf(str, "%lf", &f); /* f = 123.; */
11802 along = dummy_long((unsigned long)f);
11803 aint = dummy_int((unsigned int)f);
11804 ashort = dummy_short((unsigned short)f);
11805 if (along != (unsigned long)123)
11807 if (aint != (unsigned int)123)
11809 if (ashort != (unsigned short)123)
11816 if eval $compile_ok; then
11817 $run ./try 2>/dev/null
11820 echo "(I can't seem to compile the test program--assuming it can't)"
11823 case "$castflags" in
11825 echo "Yup, it can."
11828 echo "Nope, it can't."
11835 : see if cbrt exists
11839 : see if chown exists
11843 : see if chroot exists
11844 set chroot d_chroot
11847 : see if chsize exists
11848 set chsize d_chsize
11851 : see if class exists
11855 : see if clearenv exists
11856 set clearenv d_clearenv
11859 : Define hasstruct macro for Configure internal use
11860 hasstruct='varname=$1; struct=$2; shift; shift;
11861 while $test $# -ge 2; do
11863 $define) echo "#include <$2>";;
11867 echo "int main () { struct $struct foo; }" >> try.c;
11869 if eval $compile; then
11878 : see whether socket exists
11882 $echo $n "Hmm... $c" >&4
11883 if set socket val -f d_socket; eval $csym; $val; then
11884 echo "Looks like you have Berkeley networking support." >&4
11886 if set setsockopt val -f; eval $csym; $val; then
11889 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11890 d_oldsock="$define"
11893 if $contains socklib libc.list >/dev/null 2>&1; then
11894 echo "Looks like you have Berkeley networking support." >&4
11896 : we will have to assume that it supports the 4.2 BSD interface
11899 echo "You don't have Berkeley networking in libc$_a..." >&4
11900 if test "X$d_socket" = "X$define"; then
11901 echo "...but you seem to believe that you have sockets." >&4
11903 for net in net socket
11905 if test -f $sysroot/usr/lib/lib$net$_a; then
11906 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11907 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11908 if $contains socket libc.list >/dev/null 2>&1; then
11913 echo "...but the Wollongong group seems to have hacked it in." >&4
11914 sockethdr="-I$sysroot/usr/netinclude"
11917 echo "Found Berkeley sockets interface in lib$net." >&4
11918 if $contains setsockopt libc.list >/dev/null 2>&1; then
11921 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11922 d_oldsock="$define"
11928 if test "X$d_socket" != "X$define"; then
11929 echo "or anywhere else I see." >&4
11937 : see if socketpair exists
11938 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
11960 echo "Checking the availability struct sockaddr_in6 ..." >&4
11962 #include <sys/types.h>
11963 #include <sys/socket.h>
11964 #include <netinet/in.h>
11966 struct sockaddr_in6 sin6;
11967 return (sin6.sin6_family);
11971 set try; if eval $compile; then
11974 set d_sockaddr_in6; eval $setvar
11978 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11980 #include <sys/types.h>
11981 #include <sys/socket.h>
11982 #include <netinet/in.h>
11984 struct sockaddr_in6 sin6;
11985 return (sin6.sin6_scope_id);
11989 set try; if eval $compile; then
11992 set d_sin6_scope_id; eval $setvar
11996 echo "Checking the availability struct ip_mreq ..." >&4
11998 #include <sys/types.h>
11999 #include <sys/socket.h>
12000 #include <netinet/in.h>
12002 struct ip_mreq mreq;
12003 return (mreq.imr_multiaddr.s_addr);
12007 set try; if eval $compile; then
12010 set d_ip_mreq; eval $setvar
12014 echo "Checking the availability struct ip_mreq_source ..." >&4
12016 #include <sys/types.h>
12017 #include <sys/socket.h>
12018 #include <netinet/in.h>
12020 struct ip_mreq_source mreq;
12021 return (mreq.imr_multiaddr.s_addr);
12025 set try; if eval $compile; then
12028 set d_ip_mreq_source; eval $setvar
12032 echo "Checking the availability struct ipv6_mreq ..." >&4
12034 #include <sys/types.h>
12035 #include <sys/socket.h>
12036 #include <netinet/in.h>
12038 struct ipv6_mreq mreq;
12039 return (mreq.ipv6mr_interface);
12043 set try; if eval $compile; then
12046 set d_ipv6_mreq; eval $setvar
12050 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12052 #include <sys/types.h>
12053 #include <sys/socket.h>
12054 #include <netinet/in.h>
12056 struct ipv6_mreq_source mreq;
12057 return (mreq.imr_multiaddr.s_addr);
12061 set try; if eval $compile; then
12064 set d_ipv6_mreq_source; eval $setvar
12068 echo "Checking the availability of certain socket constants..." >&4
12069 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12070 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12072 #include <sys/types.h>
12073 #include <sys/socket.h>
12079 set try; if eval $compile; then
12082 set d_${enum}; eval $setvar
12086 : see if this is a sys/uio.h system
12087 set sys/uio.h i_sysuio
12090 : Check for cmsghdr support
12092 echo "Checking to see if your system supports struct cmsghdr..." >&4
12093 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12095 case "$d_cmsghdr_s" in
12096 "$define") echo "Yes, it does." ;;
12097 *) echo "No, it doesn't." ;;
12100 : see if copysign exists
12101 set copysign d_copysign
12104 : see if copysignl exists
12105 set copysignl d_copysignl
12108 : see if crypt exists
12113 $define) cryptlib='' ;;
12114 *) if set crypt val -f d_crypt; eval $csym; $val; then
12115 echo 'crypt() found.' >&4
12119 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12120 if $test -z "$cryptlib"; then
12121 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12125 if $test -z "$cryptlib"; then
12126 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12130 if $test -z "$cryptlib"; then
12131 cryptlib=`./loc libcrypt$_a "" $libpth`
12135 if $test -z "$cryptlib"; then
12136 echo 'crypt() NOT found.' >&4
12147 : see if this is a crypt.h system
12148 set crypt.h i_crypt
12151 : see if crypt_r exists
12152 set crypt_r d_crypt_r
12154 case "$d_crypt_r" in
12156 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12157 case "$d_crypt_r_proto:$usethreads" in
12158 ":define") d_crypt_r_proto=define
12159 set d_crypt_r_proto crypt_r $hdrs
12163 case "$d_crypt_r_proto" in
12165 case "$crypt_r_proto" in
12166 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12167 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12169 case "$crypt_r_proto" in
12170 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12171 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12173 case "$crypt_r_proto" in
12174 ''|0) d_crypt_r=undef
12176 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12177 * ) case "$crypt_r_proto" in
12178 REENTRANT_PROTO*) ;;
12179 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12181 echo "Prototype: $try" ;;
12184 *) case "$usethreads" in
12185 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12196 : get csh whereabouts
12198 'csh') val="$undef" ;;
12199 *) val="$define" ;;
12203 : Respect a hint or command line value for full_csh.
12204 case "$full_csh" in
12205 '') full_csh=$csh ;;
12208 : see if ctermid exists
12209 set ctermid d_ctermid
12212 : see if ctermid_r exists
12213 set ctermid_r d_ctermid_r
12215 case "$d_ctermid_r" in
12217 hdrs="$i_systypes sys/types.h define stdio.h "
12218 case "$d_ctermid_r_proto:$usethreads" in
12219 ":define") d_ctermid_r_proto=define
12220 set d_ctermid_r_proto ctermid_r $hdrs
12224 case "$d_ctermid_r_proto" in
12226 case "$ctermid_r_proto" in
12227 ''|0) try='char* ctermid_r(char*);'
12228 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12230 case "$ctermid_r_proto" in
12231 ''|0) d_ctermid_r=undef
12233 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12234 * ) case "$ctermid_r_proto" in
12235 REENTRANT_PROTO*) ;;
12236 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12238 echo "Prototype: $try" ;;
12241 *) case "$usethreads" in
12242 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12249 *) ctermid_r_proto=0
12253 : see if ctime_r exists
12254 set ctime_r d_ctime_r
12256 case "$d_ctime_r" in
12258 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12259 case "$d_ctime_r_proto:$usethreads" in
12260 ":define") d_ctime_r_proto=define
12261 set d_ctime_r_proto ctime_r $hdrs
12265 case "$d_ctime_r_proto" in
12267 case "$ctime_r_proto" in
12268 ''|0) try='char* ctime_r(const time_t*, char*);'
12269 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12271 case "$ctime_r_proto" in
12272 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12273 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12275 case "$ctime_r_proto" in
12276 ''|0) try='int ctime_r(const time_t*, char*);'
12277 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12279 case "$ctime_r_proto" in
12280 ''|0) try='int ctime_r(const time_t*, char*, int);'
12281 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12283 case "$ctime_r_proto" in
12284 ''|0) d_ctime_r=undef
12286 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12287 * ) case "$ctime_r_proto" in
12288 REENTRANT_PROTO*) ;;
12289 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12291 echo "Prototype: $try" ;;
12294 *) case "$usethreads" in
12295 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12306 : see if cuserid exists
12307 set cuserid d_cuserid
12310 : see if dbm.h is available
12311 : see if dbmclose exists
12312 set dbmclose d_dbmclose
12315 case "$d_dbmclose" in
12325 *) set rpcsvc/dbm.h i_rpcsvcdbm
12330 *) echo "We won't be including <dbm.h>"
12340 : see if prototype for dbminit is available
12342 set d_dbminitproto dbminit $i_dbm dbm.h
12345 : see if difftime exists
12346 set difftime d_difftime
12349 : see if this is a dirent system
12351 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12353 echo "<dirent.h> found." >&4
12356 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12357 echo "<sys/dir.h> found." >&4
12360 xinc=`./findhdr sys/ndir.h`
12362 echo "<dirent.h> NOT found." >&4
12367 : Look for type of directory structure.
12369 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12371 case "$direntrytype" in
12373 case "$i_dirent" in
12374 $define) guess1='struct dirent' ;;
12375 *) guess1='struct direct' ;;
12378 *) guess1="$direntrytype"
12383 'struct dirent') guess2='struct direct' ;;
12384 *) guess2='struct dirent' ;;
12387 if $contains "$guess1" try.c >/dev/null 2>&1; then
12388 direntrytype="$guess1"
12389 echo "Your directory entries are $direntrytype." >&4
12390 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12391 direntrytype="$guess2"
12392 echo "Your directory entries seem to be $direntrytype." >&4
12394 echo "I don't recognize your system's directory entries." >&4
12395 rp="What type is used for directory entries on this system?"
12398 direntrytype="$ans"
12402 : see if the directory entry stores field length
12404 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12405 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12406 echo "Good, your directory entry keeps length information in d_namlen." >&4
12409 echo "Your directory entry does not know about the d_namlen field." >&4
12416 : Look for DIR.dd_fd
12417 case "$i_dirent" in
12419 echo "Checking to see if DIR has a dd_fd member variable" >&4
12421 #$i_stdlib I_STDLIB
12423 #include <stdlib.h>
12425 #include <dirent.h>
12435 if eval $compile; then
12436 echo "Yes, it does."
12439 echo "No, it does not."
12444 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12452 : see if this is an sysdir system
12453 set sys/dir.h i_sysdir
12456 : see if this is an sysndir system
12457 set sys/ndir.h i_sysndir
12462 $cat >dirfd.c <<EOM
12464 #$i_stdlib I_STDLIB
12466 #include <stdlib.h>
12468 #$i_dirent I_DIRENT /**/
12469 #$i_sysdir I_SYS_DIR /**/
12470 #$i_sysndir I_SYS_NDIR /**/
12471 #$i_systypes I_SYS_TYPES /**/
12472 #if defined(I_SYS_TYPES)
12473 #include <sys/types.h>
12475 #if defined(I_DIRENT)
12476 #include <dirent.h>
12479 #include <sys/ndir.h>
12482 #include <sys/dir.h>
12487 DIR *dirp = opendir(".");
12488 if (dirfd(dirp) >= 0)
12496 if eval $compile; then
12500 $define) echo "dirfd() found." >&4 ;;
12501 *) echo "dirfd() NOT found." >&4 ;;
12507 : see if dladdr exists
12508 set dladdr d_dladdr
12511 : see if dlerror exists
12514 set dlerror d_dlerror
12518 : see if dlfcn is available
12519 set dlfcn.h i_dlfcn
12522 : Check what extension to use for shared libs
12527 On a few systems, the dynamically loaded modules that perl generates and uses
12528 will need a different extension than shared libs. The default will probably
12534 *) dflt="$dlext" ;;
12536 rp='What is the extension of dynamically loaded modules'
12545 : Check if dlsym need a leading underscore
12551 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12552 $cat >dyna.c <<'EOM'
12559 #$i_stdlib I_STDLIB
12561 #include <stdlib.h>
12565 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12567 #include <sys/types.h>
12572 extern int fred() ;
12581 int mode = RTLD_LAZY ;
12583 handle = dlopen("./dyna.$dlext", mode) ;
12584 if (handle == NULL) {
12589 symbol = dlsym(handle, "fred") ;
12590 if (symbol == NULL) {
12591 /* try putting a leading underscore */
12592 symbol = dlsym(handle, "_fred") ;
12593 if (symbol == NULL) {
12606 : Call the object file tmp-dyna.o in case dlext=o.
12607 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12608 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12609 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12610 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12613 1) echo "Test program failed using dlopen." >&4
12614 echo "Perhaps you should not use dynamic loading." >&4;;
12615 2) echo "Test program failed using dlsym." >&4
12616 echo "Perhaps you should not use dynamic loading." >&4;;
12617 3) echo "dlsym needs a leading underscore" >&4
12619 4) echo "dlsym doesn't need a leading underscore." >&4;;
12622 echo "I can't compile and run the test program." >&4
12623 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12628 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12633 : see if drand48_r exists
12634 set drand48_r d_drand48_r
12636 case "$d_drand48_r" in
12638 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12639 case "$d_drand48_r_proto:$usethreads" in
12640 ":define") d_drand48_r_proto=define
12641 set d_drand48_r_proto drand48_r $hdrs
12645 case "$d_drand48_r_proto" in
12647 case "$drand48_r_proto" in
12648 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12649 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12651 case "$drand48_r_proto" in
12652 ''|0) d_drand48_r=undef
12654 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12655 * ) case "$drand48_r_proto" in
12656 REENTRANT_PROTO*) ;;
12657 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12659 echo "Prototype: $try" ;;
12662 *) case "$usethreads" in
12663 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12670 *) drand48_r_proto=0
12674 : see if prototype for drand48 is available
12676 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12679 : see if dup2 exists
12683 : see if dup3 exists
12687 : see if this is an xlocale.h system
12688 set xlocale.h i_xlocale
12691 : see if newlocale exists
12692 set newlocale d_newlocale
12695 : see if freelocale exists
12696 set freelocale d_freelocale
12699 : see if uselocale exists
12700 set uselocale d_uselocale
12703 : see if duplocale exists
12704 set duplocale d_duplocale
12707 : see if querylocale exists
12708 set querylocale d_querylocale
12711 : see if eaccess exists
12712 set eaccess d_eaccess
12715 : see if endgrent exists
12716 set endgrent d_endgrent
12719 : see if this is an grp system
12725 xxx=`./findhdr grp.h`
12726 $cppstdin $cppflags $cppminus < $xxx >$$.h
12728 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12740 set d_grpasswd; eval $setvar
12744 : see if endgrent_r exists
12745 set endgrent_r d_endgrent_r
12747 case "$d_endgrent_r" in
12749 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12750 case "$d_endgrent_r_proto:$usethreads" in
12751 ":define") d_endgrent_r_proto=define
12752 set d_endgrent_r_proto endgrent_r $hdrs
12756 case "$d_endgrent_r_proto" in
12758 case "$endgrent_r_proto" in
12759 ''|0) try='int endgrent_r(FILE**);'
12760 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12762 case "$endgrent_r_proto" in
12763 ''|0) try='void endgrent_r(FILE**);'
12764 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12766 case "$endgrent_r_proto" in
12767 ''|0) d_endgrent_r=undef
12769 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12770 * ) case "$endgrent_r_proto" in
12771 REENTRANT_PROTO*) ;;
12772 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12774 echo "Prototype: $try" ;;
12777 *) case "$usethreads" in
12778 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12785 *) endgrent_r_proto=0
12789 : see if endhostent exists
12790 set endhostent d_endhent
12793 : see if this is a netdb.h system
12794 set netdb.h i_netdb
12797 : see if endhostent_r exists
12798 set endhostent_r d_endhostent_r
12800 case "$d_endhostent_r" in
12802 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12803 case "$d_endhostent_r_proto:$usethreads" in
12804 ":define") d_endhostent_r_proto=define
12805 set d_endhostent_r_proto endhostent_r $hdrs
12809 case "$d_endhostent_r_proto" in
12811 case "$endhostent_r_proto" in
12812 ''|0) try='int endhostent_r(struct hostent_data*);'
12813 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12815 case "$endhostent_r_proto" in
12816 ''|0) try='void endhostent_r(struct hostent_data*);'
12817 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12819 case "$endhostent_r_proto" in
12820 ''|0) d_endhostent_r=undef
12821 endhostent_r_proto=0
12822 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12823 * ) case "$endhostent_r_proto" in
12824 REENTRANT_PROTO*) ;;
12825 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12827 echo "Prototype: $try" ;;
12830 *) case "$usethreads" in
12831 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12833 d_endhostent_r=undef
12834 endhostent_r_proto=0
12838 *) endhostent_r_proto=0
12842 : see if endnetent exists
12843 set endnetent d_endnent
12846 : see if endnetent_r exists
12847 set endnetent_r d_endnetent_r
12849 case "$d_endnetent_r" in
12851 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12852 case "$d_endnetent_r_proto:$usethreads" in
12853 ":define") d_endnetent_r_proto=define
12854 set d_endnetent_r_proto endnetent_r $hdrs
12858 case "$d_endnetent_r_proto" in
12860 case "$endnetent_r_proto" in
12861 ''|0) try='int endnetent_r(struct netent_data*);'
12862 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12864 case "$endnetent_r_proto" in
12865 ''|0) try='void endnetent_r(struct netent_data*);'
12866 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12868 case "$endnetent_r_proto" in
12869 ''|0) d_endnetent_r=undef
12870 endnetent_r_proto=0
12871 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12872 * ) case "$endnetent_r_proto" in
12873 REENTRANT_PROTO*) ;;
12874 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12876 echo "Prototype: $try" ;;
12879 *) case "$usethreads" in
12880 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12882 d_endnetent_r=undef
12883 endnetent_r_proto=0
12887 *) endnetent_r_proto=0
12891 : see if endprotoent exists
12892 set endprotoent d_endpent
12895 : see if endprotoent_r exists
12896 set endprotoent_r d_endprotoent_r
12898 case "$d_endprotoent_r" in
12900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12901 case "$d_endprotoent_r_proto:$usethreads" in
12902 ":define") d_endprotoent_r_proto=define
12903 set d_endprotoent_r_proto endprotoent_r $hdrs
12907 case "$d_endprotoent_r_proto" in
12909 case "$endprotoent_r_proto" in
12910 ''|0) try='int endprotoent_r(struct protoent_data*);'
12911 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12913 case "$endprotoent_r_proto" in
12914 ''|0) try='void endprotoent_r(struct protoent_data*);'
12915 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12917 case "$endprotoent_r_proto" in
12918 ''|0) d_endprotoent_r=undef
12919 endprotoent_r_proto=0
12920 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12921 * ) case "$endprotoent_r_proto" in
12922 REENTRANT_PROTO*) ;;
12923 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12925 echo "Prototype: $try" ;;
12928 *) case "$usethreads" in
12929 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12931 d_endprotoent_r=undef
12932 endprotoent_r_proto=0
12936 *) endprotoent_r_proto=0
12940 : see if endpwent exists
12941 set endpwent d_endpwent
12944 : see if this is a pwd.h system
12950 xxx=`./findhdr pwd.h`
12951 $cppstdin $cppflags $cppminus < $xxx >$$.h
12953 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12961 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12969 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12977 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12985 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12993 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13001 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13009 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13021 set d_pwquota; eval $setvar
13022 set d_pwage; eval $setvar
13023 set d_pwchange; eval $setvar
13024 set d_pwclass; eval $setvar
13025 set d_pwexpire; eval $setvar
13026 set d_pwcomment; eval $setvar
13027 set d_pwgecos; eval $setvar
13028 set d_pwpasswd; eval $setvar
13032 : see if endpwent_r exists
13033 set endpwent_r d_endpwent_r
13035 case "$d_endpwent_r" in
13037 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13038 case "$d_endpwent_r_proto:$usethreads" in
13039 ":define") d_endpwent_r_proto=define
13040 set d_endpwent_r_proto endpwent_r $hdrs
13044 case "$d_endpwent_r_proto" in
13046 case "$endpwent_r_proto" in
13047 ''|0) try='int endpwent_r(FILE**);'
13048 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13050 case "$endpwent_r_proto" in
13051 ''|0) try='void endpwent_r(FILE**);'
13052 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13054 case "$endpwent_r_proto" in
13055 ''|0) d_endpwent_r=undef
13057 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13058 * ) case "$endpwent_r_proto" in
13059 REENTRANT_PROTO*) ;;
13060 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13062 echo "Prototype: $try" ;;
13065 *) case "$usethreads" in
13066 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13073 *) endpwent_r_proto=0
13077 : see if endservent exists
13078 set endservent d_endsent
13081 : see if endservent_r exists
13082 set endservent_r d_endservent_r
13084 case "$d_endservent_r" in
13086 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13087 case "$d_endservent_r_proto:$usethreads" in
13088 ":define") d_endservent_r_proto=define
13089 set d_endservent_r_proto endservent_r $hdrs
13093 case "$d_endservent_r_proto" in
13095 case "$endservent_r_proto" in
13096 ''|0) try='int endservent_r(struct servent_data*);'
13097 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13099 case "$endservent_r_proto" in
13100 ''|0) try='void endservent_r(struct servent_data*);'
13101 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13103 case "$endservent_r_proto" in
13104 ''|0) d_endservent_r=undef
13105 endservent_r_proto=0
13106 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13107 * ) case "$endservent_r_proto" in
13108 REENTRANT_PROTO*) ;;
13109 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13111 echo "Prototype: $try" ;;
13114 *) case "$usethreads" in
13115 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13117 d_endservent_r=undef
13118 endservent_r_proto=0
13122 *) endservent_r_proto=0
13126 : Locate the flags for 'open()'
13129 #include <sys/types.h>
13134 #include <sys/file.h>
13136 #$i_stdlib I_STDLIB
13138 #include <stdlib.h>
13149 : check sys/file.h first to get FREAD on Sun
13150 if $test `./findhdr sys/file.h` && \
13151 set try -DI_SYS_FILE && eval $compile; then
13153 echo "<sys/file.h> defines the O_* constants..." >&4
13154 if $run ./try; then
13155 echo "and you have the 3 argument form of open()." >&4
13158 echo "but not the 3 argument form of open(). Oh, well." >&4
13161 elif $test `./findhdr fcntl.h` && \
13162 set try -DI_FCNTL && eval $compile; then
13164 echo "<fcntl.h> defines the O_* constants..." >&4
13165 if $run ./try; then
13166 echo "and you have the 3 argument form of open()." >&4
13169 echo "but not the 3 argument form of open(). Oh, well." >&4
13174 echo "I can't find the O_* constant definitions! You got problems." >&4
13180 : see if this is a sys/file.h system
13185 : do we need to include sys/file.h ?
13189 if $h_sysfile; then
13191 echo "We'll be including <sys/file.h>." >&4
13194 echo "We won't be including <sys/file.h>." >&4
13204 : see if fcntl.h is there
13209 : see if we can include fcntl.h
13215 echo "We'll be including <fcntl.h>." >&4
13218 if $h_sysfile; then
13219 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13221 echo "We won't be including <fcntl.h>." >&4
13233 : see if fork exists
13237 : see if pipe exists
13241 : check for non-blocking I/O stuff
13242 case "$h_sysfile" in
13243 true) echo "#include <sys/file.h>" > head.c;;
13246 true) echo "#include <fcntl.h>" > head.c;;
13247 *) echo "#include <sys/fcntl.h>" > head.c;;
13252 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13253 case "$o_nonblock" in
13255 $cat head.c > try.c
13256 $cat >>try.c <<EOCP
13258 #$i_stdlib I_STDLIB
13260 #include <stdlib.h>
13268 printf("O_NONBLOCK\n");
13272 printf("O_NDELAY\n");
13276 printf("FNDELAY\n");
13283 if eval $compile_ok; then
13284 o_nonblock=`$run ./try`
13285 case "$o_nonblock" in
13286 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13287 *) echo "Seems like we can use $o_nonblock.";;
13290 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13293 *) echo "Using $hint value $o_nonblock.";;
13298 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13301 case "$d_fork:$d_pipe:$d_alarm" in
13302 define:define:define)
13303 $cat head.c > try.c
13304 $cat >>try.c <<EOCP
13306 #include <sys/types.h>
13307 #include <signal.h>
13309 #$i_stdlib I_STDLIB
13311 #include <stdlib.h>
13317 #define MY_O_NONBLOCK $o_nonblock
13318 #ifndef errno /* XXX need better Configure test */
13321 #$i_unistd I_UNISTD
13323 #include <unistd.h>
13325 #include <string.h>
13326 $signal_t blech(int x) { exit(3); }
13328 $cat >> try.c <<'EOCP'
13337 ret = pipe(pd); /* Down: child -> parent */
13340 ret = pipe(pu); /* Up: parent -> child */
13344 close(pd[1]); /* Parent reads from pd[0] */
13345 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13347 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13352 signal(SIGALRM, blech);
13354 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13356 sprintf(string, "%d\n", ret);
13357 ret = write(2, string, strlen(string));
13358 if (ret != strlen(string))
13362 if (errno == EAGAIN) {
13363 printf("EAGAIN\n");
13368 if (errno == EWOULDBLOCK)
13369 printf("EWOULDBLOCK\n");
13372 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13375 sleep(2); /* Give it time to close our pipe */
13377 ret = read(pd[0], buf, 1); /* Should read EOF */
13379 sprintf(string, "%d\n", ret);
13380 ret = write(4, string, strlen(string));
13381 if (ret != strlen(string))
13386 close(pd[0]); /* We write to pd[1] */
13387 close(pu[1]); /* We read from pu[0] */
13388 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13391 close(pd[1]); /* Pipe pd is now fully closed! */
13392 exit(0); /* Bye bye, thank you for playing! */
13396 if eval $compile_ok; then
13397 echo "$startsh" >mtry
13398 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13400 $run ./mtry >/dev/null 2>&1
13402 0) eagain=`$cat try.out`;;
13403 1) echo "Could not perform non-blocking setting!";;
13404 2) echo "I did a successful read() for something that was not there!";;
13405 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13406 4) echo "Could not find F_SETFL!";;
13407 *) echo "Something terribly wrong happened during testing.";;
13409 rd_nodata=`$cat try.ret`
13410 echo "A read() system call with no data present returns $rd_nodata."
13411 case "$rd_nodata" in
13414 echo "(That's peculiar, fixing that to be -1.)"
13420 echo "Forcing errno EAGAIN on read() with no data available."
13424 echo "Your read() sets errno to $eagain when no data is available."
13427 status=`$cat try.err`
13429 0) echo "And it correctly returns 0 to signal EOF.";;
13430 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13431 *) echo "However, your read() returns '$status' on EOF??";;
13434 if test "$status" = "$rd_nodata"; then
13435 echo "WARNING: you can't distinguish between EOF and no data!"
13439 echo "I can't compile the test program--assuming errno EAGAIN will do."
13443 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13452 echo "Using $hint value $eagain."
13453 echo "Your read() returns $rd_nodata when no data is present."
13454 case "$d_eofnblk" in
13455 "$define") echo "And you can see EOF because read() returns 0.";;
13456 "$undef") echo "But you can't see EOF status from read() returned value.";;
13458 echo "(Assuming you can't see EOF status from read anyway.)"
13464 $rm_try head.c mtry
13466 : see if erf exists
13470 : see if erfc exists
13474 : see if exp2 exists
13478 : see if expm1 exists
13482 : see if _ptr and _cnt from stdio act std
13485 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13486 echo "(Looks like you have stdio.h from BSD.)"
13487 case "$stdio_ptr" in
13488 '') stdio_ptr='((fp)->_p)'
13491 *) ptr_lval=$d_stdio_ptr_lval;;
13493 case "$stdio_cnt" in
13494 '') stdio_cnt='((fp)->_r)'
13497 *) cnt_lval=$d_stdio_cnt_lval;;
13499 case "$stdio_base" in
13500 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13502 case "$stdio_bufsiz" in
13503 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13505 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13506 echo "(Looks like you have stdio.h from Linux.)"
13507 case "$stdio_ptr" in
13508 '') stdio_ptr='((fp)->_IO_read_ptr)'
13511 *) ptr_lval=$d_stdio_ptr_lval;;
13513 case "$stdio_cnt" in
13514 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13517 *) cnt_lval=$d_stdio_cnt_lval;;
13519 case "$stdio_base" in
13520 '') stdio_base='((fp)->_IO_read_base)';;
13522 case "$stdio_bufsiz" in
13523 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13526 case "$stdio_ptr" in
13527 '') stdio_ptr='((fp)->_ptr)'
13530 *) ptr_lval=$d_stdio_ptr_lval;;
13532 case "$stdio_cnt" in
13533 '') stdio_cnt='((fp)->_cnt)'
13536 *) cnt_lval=$d_stdio_cnt_lval;;
13538 case "$stdio_base" in
13539 '') stdio_base='((fp)->_base)';;
13541 case "$stdio_bufsiz" in
13542 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13546 : test whether _ptr and _cnt really work
13547 echo "Checking how std your stdio is..." >&4
13550 #$i_stdlib I_STDLIB
13552 #include <stdlib.h>
13554 #define FILE_ptr(fp) $stdio_ptr
13555 #define FILE_cnt(fp) $stdio_cnt
13557 FILE *fp = fopen("try.c", "r");
13560 18 <= FILE_cnt(fp) &&
13561 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13569 if eval $compile && $to try.c; then
13570 if $run ./try; then
13571 echo "Your stdio acts pretty std."
13574 echo "Your stdio isn't very std."
13577 echo "Your stdio doesn't appear very std."
13581 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13582 # direct buffer manipulation no longer works. The Configure tests
13583 # should be changed to correctly detect this, but until then,
13584 # the following check should at least let perl compile and run.
13585 # (This quick fix should be updated before 5.8.1.)
13586 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13587 # A. Dougherty, June 3, 2002.
13588 case "$d_gnulibc" in
13590 case "$gnulibc_version" in
13594 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13603 : Can _ptr be used as an lvalue?
13604 case "$d_stdstdio$ptr_lval" in
13605 $define$define) val=$define ;;
13608 set d_stdio_ptr_lval
13611 : Can _cnt be used as an lvalue?
13612 case "$d_stdstdio$cnt_lval" in
13613 $define$define) val=$define ;;
13616 set d_stdio_cnt_lval
13620 : test whether setting _ptr sets _cnt as a side effect
13621 d_stdio_ptr_lval_sets_cnt="$undef"
13622 d_stdio_ptr_lval_nochange_cnt="$undef"
13623 case "$d_stdio_ptr_lval$d_stdstdio" in
13625 echo "Checking to see what happens if we set the stdio ptr..." >&4
13628 /* Can we scream? */
13629 /* Eat dust sed :-) */
13630 /* In the buffer space, no one can hear you scream. */
13631 #$i_stdlib I_STDLIB
13633 #include <stdlib.h>
13635 #define FILE_ptr(fp) $stdio_ptr
13636 #define FILE_cnt(fp) $stdio_cnt
13637 #include <sys/types.h>
13639 FILE *fp = fopen("try.c", "r");
13644 puts("Fail even to read");
13647 c = getc(fp); /* Read away the first # */
13649 puts("Fail even to read");
13653 18 <= FILE_cnt(fp) &&
13654 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13656 puts("Fail even to read");
13659 ptr = (char*) FILE_ptr(fp);
13660 cnt = (size_t)FILE_cnt(fp);
13662 FILE_ptr(fp) += 42;
13664 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13665 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13668 if (FILE_cnt(fp) <= 20) {
13669 printf ("Fail (<20 chars to test)");
13672 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13673 puts("Fail compare");
13676 if (cnt == FILE_cnt(fp)) {
13677 puts("Pass_unchanged");
13680 if (FILE_cnt(fp) == (cnt - 42)) {
13681 puts("Pass_changed");
13684 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13690 if eval $compile && $to try.c; then
13691 case `$run ./try` in
13693 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13694 d_stdio_ptr_lval_sets_cnt="$define" ;;
13696 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13697 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13699 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13701 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13704 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13710 : see if _base is also standard
13712 case "$d_stdstdio" in
13716 #$i_stdlib I_STDLIB
13718 #include <stdlib.h>
13720 #define FILE_base(fp) $stdio_base
13721 #define FILE_bufsiz(fp) $stdio_bufsiz
13723 FILE *fp = fopen("try.c", "r");
13726 19 <= FILE_bufsiz(fp) &&
13727 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13734 if eval $compile && $to try.c; then
13735 if $run ./try; then
13736 echo "And its _base field acts std."
13739 echo "But its _base field isn't std."
13742 echo "However, it seems to be lacking the _base field."
13750 : see if fast_stdio exists
13752 case "$d_stdstdio:$d_stdio_ptr_lval" in
13754 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13756 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13765 : see if fchdir exists
13766 set fchdir d_fchdir
13769 : see if fchmod exists
13770 set fchmod d_fchmod
13773 : check for openat, unlinkat, renameat, linkat, fchmodat
13774 set openat d_openat
13777 set unlinkat d_unlinkat
13780 set renameat d_renameat
13783 set linkat d_linkat
13786 set fchmodat d_fchmodat
13789 : see if fchown exists
13790 set fchown d_fchown
13793 : see if this is an fcntl system
13797 : See if fcntl-based locking works.
13800 #$i_stdlib I_STDLIB
13802 #include <stdlib.h>
13804 #include <unistd.h>
13806 #include <signal.h>
13807 $signal_t blech(int x) { exit(3); }
13809 #if defined(F_SETLK) && defined(F_SETLKW)
13810 struct flock flock;
13812 fd = open("try.c", O_RDONLY);
13813 flock.l_type = F_RDLCK;
13814 flock.l_whence = SEEK_SET;
13815 flock.l_start = flock.l_len = 0;
13816 signal(SIGALRM, blech);
13818 retval = fcntl(fd, F_SETLK, &flock);
13820 (retval < 0 ? exit(2) : exit(0));
13826 echo "Checking if fcntl-based file locking works... "
13830 if eval $compile_ok; then
13831 if $run ./try; then
13832 echo "Yes, it seems to work."
13835 echo "Nope, it didn't work."
13840 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13841 *** This is (almost) impossible.
13842 *** If your NFS lock daemons are not feeling well, something like
13843 *** this may happen, please investigate. Cannot continue, aborting.
13851 echo "I'm unable to compile the test program, so I'll assume not."
13856 echo "Nope, since you don't even have fcntl()."
13859 set d_fcntl_can_lock
13863 : check for fd_set items
13866 Checking to see how well your C compiler handles fd_set and friends ...
13869 #$i_stdlib I_STDLIB
13871 #include <stdlib.h>
13873 #$i_systime I_SYS_TIME
13874 #$i_sysselct I_SYS_SELECT
13875 #$d_socket HAS_SOCKET
13876 #include <sys/types.h>
13878 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13881 #include <sys/time.h>
13883 #ifdef I_SYS_SELECT
13884 #include <sys/select.h>
13893 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13901 if eval $compile; then
13902 d_fds_bits="$define"
13904 echo "Well, your system knows about the normal fd_set typedef..." >&4
13905 if $run ./try; then
13906 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13907 d_fd_macros="$define"
13910 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13912 d_fd_macros="$undef"
13916 Hmm, your compiler has some difficulty with fd_set. Checking further...
13919 if eval $compile; then
13920 d_fds_bits="$undef"
13922 echo "Well, your system has some sort of fd_set available..." >&4
13923 if $run ./try; then
13924 echo "and you have the normal fd_set macros." >&4
13925 d_fd_macros="$define"
13928 but not the normal fd_set macros! Gross! More work for me...
13930 d_fd_macros="$undef"
13933 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13935 d_fds_bits="$undef"
13936 d_fd_macros="$undef"
13941 : see if fdclose exists
13942 set fdclose d_fdclose
13945 : see if fdim exists
13949 : see if fegetround exists
13950 set fegetround d_fegetround
13953 : see if fgetpos exists
13954 set fgetpos d_fgetpos
13957 : see if finite exists
13958 set finite d_finite
13961 : see if finitel exists
13962 set finitel d_finitel
13965 : see if flock exists
13969 : see if prototype for flock is available
13971 set d_flockproto flock $i_sysfile sys/file.h
13974 : see if fma exists
13978 : see if fmax exists
13982 : see if fmin exists
13986 : see if fp_class exists
13987 set fp_class d_fp_class
13990 : check for fpclassify
13991 echo "Checking to see if you have fpclassify..." >&4
13994 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13997 if eval $compile; then
13999 echo "You have fpclassify."
14002 echo "You do not have fpclassify."
14008 : see if fp_classify exists
14009 set fp_classify d_fp_classify
14012 : see if fp_classl exists
14013 set fp_classl d_fp_classl
14016 : see if pathconf exists
14017 set pathconf d_pathconf
14020 : see if fpathconf exists
14021 set fpathconf d_fpathconf
14024 : see if fpclass exists
14025 set fpclass d_fpclass
14028 : see if fpclassl exists
14029 set fpclassl d_fpclassl
14032 : see if fpgetround exists
14033 set fpgetround d_fpgetround
14036 : check for fpos64_t
14038 echo "Checking to see if you have fpos64_t..." >&4
14041 int main() { fpos64_t x = 7; }
14044 if eval $compile; then
14046 echo "You have fpos64_t."
14049 echo "You do not have fpos64_t."
14050 case "$fpossize" in
14051 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14058 : see if frexpl exists
14059 set frexpl d_frexpl
14062 : see if this is a sys/param system
14063 set sys/param.h i_sysparam
14066 : see if this is a sys/mount.h system
14067 set sys/mount.h i_sysmount
14070 : Check for fs_data_s
14072 echo "Checking to see if your system supports struct fs_data..." >&4
14073 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14075 case "$d_fs_data_s" in
14076 "$define") echo "Yes, it does." ;;
14077 *) echo "No, it doesn't." ;;
14080 : see if fseeko exists
14081 set fseeko d_fseeko
14083 case "$longsize" in
14084 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14087 : see if fsetpos exists
14088 set fsetpos d_fsetpos
14091 : see if fstatfs exists
14092 set fstatfs d_fstatfs
14095 : see if statvfs exists
14096 set statvfs d_statvfs
14099 : see if fstatvfs exists
14100 set fstatvfs d_fstatvfs
14103 : see if fsync exists
14107 : see if ftello exists
14108 set ftello d_ftello
14110 case "$longsize" in
14111 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14114 : check for a working futimes
14117 echo "Checking if you have a working futimes()" >&4
14120 #include <stdlib.h>
14121 #include <sys/time.h>
14124 #include <stdlib.h>
14129 fd = open ("try.c", O_RDWR);
14130 if (-1 == fd) exit (1);
14131 rv = futimes (fd, NULL);
14132 exit (rv == -1 ? errno : 0);
14136 if eval $compile; then
14140 0) echo "Yes, you have" >&4
14141 d_futimes="$define"
14143 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14147 echo "No, it does not (probably harmless)" >&4
14151 : look for gai_strerror
14153 $cat >try.c <<'EOCP'
14154 #include <sys/types.h>
14155 #include <sys/socket.h>
14159 return (gai_strerror (0) ? 0 : 1);
14164 if eval $compile; then
14167 0) echo "A working gai_strerror() found." >&4
14169 *) echo "gai_strerror() found, but it doesn't work" >&4
14173 echo "gai_strerror() NOT found." >&4
14179 : see if ndbm.h is available
14182 : Compatibility location for RedHat 7.1
14183 set gdbm/ndbm.h i_gdbmndbm
14185 : Compatibility location for Debian 4.0
14186 set gdbm-ndbm.h i_gdbm_ndbm
14190 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14191 : see if dbm_open exists
14192 set dbm_open d_dbm_open
14194 case "$d_dbm_open" in
14197 i_gdbmndbm="$undef"
14198 i_gdbm_ndbm="$undef"
14199 echo "We won't be including <ndbm.h>"
14209 ndbm_hdr_protochk='name=$1; hdr=$2;
14210 eval "ihdr=\$""i_$name";
14212 if $test "$ihdr" = "$define"; then
14213 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14214 case "$d_cplusplus" in
14215 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14216 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14219 $define) $echo "Your <$hdr> seems to have prototypes";;
14220 *) $echo "Your <$hdr> does not seem to have prototypes";;
14223 set "d_${name}_h_uses_prototypes";
14227 eval $ndbm_hdr_protochk
14228 set gdbmndbm gdbm/ndbm.h
14229 eval $ndbm_hdr_protochk
14230 set gdbm_ndbm gdbm-ndbm.h
14231 eval $ndbm_hdr_protochk
14233 : see if getaddrinfo exists
14234 set getaddrinfo d_getaddrinfo
14237 : see if getcwd exists
14238 set getcwd d_getcwd
14241 : see if getespwnam exists
14242 set getespwnam d_getespwnam
14245 : see if getfsstat exists
14246 set getfsstat d_getfsstat
14249 : see if getgrent exists
14250 set getgrent d_getgrent
14253 : see if getgrent_r exists
14254 set getgrent_r d_getgrent_r
14256 case "$d_getgrent_r" in
14258 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14259 case "$d_getgrent_r_proto:$usethreads" in
14260 ":define") d_getgrent_r_proto=define
14261 set d_getgrent_r_proto getgrent_r $hdrs
14265 case "$d_getgrent_r_proto" in
14267 case "$getgrent_r_proto" in
14268 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14269 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14271 case "$getgrent_r_proto" in
14272 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14273 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14275 case "$getgrent_r_proto" in
14276 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14277 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14279 case "$getgrent_r_proto" in
14280 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14281 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14283 case "$getgrent_r_proto" in
14284 ''|0) try='int getgrent_r(struct group*, char*, int);'
14285 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14287 case "$getgrent_r_proto" in
14288 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14289 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14291 case "$getgrent_r_proto" in
14292 ''|0) d_getgrent_r=undef
14294 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14295 * ) case "$getgrent_r_proto" in
14296 REENTRANT_PROTO*) ;;
14297 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14299 echo "Prototype: $try" ;;
14302 *) case "$usethreads" in
14303 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14310 *) getgrent_r_proto=0
14314 : see if getgrgid_r exists
14315 set getgrgid_r d_getgrgid_r
14317 case "$d_getgrgid_r" in
14319 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14320 case "$d_getgrgid_r_proto:$usethreads" in
14321 ":define") d_getgrgid_r_proto=define
14322 set d_getgrgid_r_proto getgrgid_r $hdrs
14326 case "$d_getgrgid_r_proto" in
14328 case "$getgrgid_r_proto" in
14329 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14330 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14332 case "$getgrgid_r_proto" in
14333 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14334 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14336 case "$getgrgid_r_proto" in
14337 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14338 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14340 case "$getgrgid_r_proto" in
14341 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14342 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14344 case "$getgrgid_r_proto" in
14345 ''|0) d_getgrgid_r=undef
14347 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14348 * ) case "$getgrgid_r_proto" in
14349 REENTRANT_PROTO*) ;;
14350 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14352 echo "Prototype: $try" ;;
14355 *) case "$usethreads" in
14356 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14363 *) getgrgid_r_proto=0
14367 : see if getgrnam_r exists
14368 set getgrnam_r d_getgrnam_r
14370 case "$d_getgrnam_r" in
14372 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14373 case "$d_getgrnam_r_proto:$usethreads" in
14374 ":define") d_getgrnam_r_proto=define
14375 set d_getgrnam_r_proto getgrnam_r $hdrs
14379 case "$d_getgrnam_r_proto" in
14381 case "$getgrnam_r_proto" in
14382 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14383 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14385 case "$getgrnam_r_proto" in
14386 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14387 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14389 case "$getgrnam_r_proto" in
14390 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14391 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14393 case "$getgrnam_r_proto" in
14394 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14395 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14397 case "$getgrnam_r_proto" in
14398 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14399 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14401 case "$getgrnam_r_proto" in
14402 ''|0) d_getgrnam_r=undef
14404 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14405 * ) case "$getgrnam_r_proto" in
14406 REENTRANT_PROTO*) ;;
14407 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14409 echo "Prototype: $try" ;;
14412 *) case "$usethreads" in
14413 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14420 *) getgrnam_r_proto=0
14424 : see if gethostbyaddr exists
14425 set gethostbyaddr d_gethbyaddr
14428 : see if gethostbyname exists
14429 set gethostbyname d_gethbyname
14432 : see if gethostent exists
14433 set gethostent d_gethent
14436 : see how we will look up host name
14439 if set gethostname val -f d_gethname; eval $csym; $val; then
14440 echo 'gethostname() found.' >&4
14441 d_gethname="$define"
14444 if set uname val -f d_uname; eval $csym; $val; then
14447 uname() was found, but you're running xenix, and older versions of xenix
14448 have a broken uname(). If you don't really know whether your xenix is old
14449 enough to have a broken system call, use the default answer.
14454 "$define") dflt=n;;
14456 rp='Is your uname() broken?'
14459 n*) d_uname="$define"; call=uname;;
14462 echo 'uname() found.' >&4
14469 case "$d_gethname" in
14470 '') d_gethname="$undef";;
14473 '') d_uname="$undef";;
14475 case "$d_uname$d_gethname" in
14480 Every now and then someone has a $call() that lies about the hostname
14481 but can't be fixed for political or economic reasons. If you wish, I can
14482 pretend $call() isn't there and maybe compute hostname at run-time
14483 thanks to the '$phostname' command.
14486 rp="Shall I ignore $call() from now on?"
14489 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14492 case "$phostname" in
14493 '') aphostname='';;
14494 *) case "$aphostname" in
14496 *) set X $phostname
14500 file=`./loc $file $file $pth`
14501 aphostname=`echo $file $*`
14506 case "$d_uname$d_gethname" in
14509 case "$phostname" in
14511 echo "There will be no way for $package to get your hostname." >&4;;
14513 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14517 case "$d_phostname" in
14518 '') d_phostname="$undef";;
14521 : see if gethostbyaddr_r exists
14522 set gethostbyaddr_r d_gethostbyaddr_r
14524 case "$d_gethostbyaddr_r" in
14526 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14527 case "$d_gethostbyaddr_r_proto:$usethreads" in
14528 ":define") d_gethostbyaddr_r_proto=define
14529 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14533 case "$d_gethostbyaddr_r_proto" in
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14537 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14539 case "$gethostbyaddr_r_proto" in
14540 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14541 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14543 case "$gethostbyaddr_r_proto" in
14544 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14545 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14547 case "$gethostbyaddr_r_proto" in
14548 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14549 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14551 case "$gethostbyaddr_r_proto" in
14552 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14553 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14555 case "$gethostbyaddr_r_proto" in
14556 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14557 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14559 case "$gethostbyaddr_r_proto" in
14560 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14561 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14563 case "$gethostbyaddr_r_proto" in
14564 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14565 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14567 case "$gethostbyaddr_r_proto" in
14568 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14569 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14571 case "$gethostbyaddr_r_proto" in
14572 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14573 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14575 case "$gethostbyaddr_r_proto" in
14576 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14577 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14579 case "$gethostbyaddr_r_proto" in
14580 ''|0) d_gethostbyaddr_r=undef
14581 gethostbyaddr_r_proto=0
14582 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14583 * ) case "$gethostbyaddr_r_proto" in
14584 REENTRANT_PROTO*) ;;
14585 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14587 echo "Prototype: $try" ;;
14590 *) case "$usethreads" in
14591 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14593 d_gethostbyaddr_r=undef
14594 gethostbyaddr_r_proto=0
14598 *) gethostbyaddr_r_proto=0
14602 : see if gethostbyname_r exists
14603 set gethostbyname_r d_gethostbyname_r
14605 case "$d_gethostbyname_r" in
14607 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14608 case "$d_gethostbyname_r_proto:$usethreads" in
14609 ":define") d_gethostbyname_r_proto=define
14610 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14614 case "$d_gethostbyname_r_proto" in
14616 case "$gethostbyname_r_proto" in
14617 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14618 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14620 case "$gethostbyname_r_proto" in
14621 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14622 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14624 case "$gethostbyname_r_proto" in
14625 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14626 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14628 case "$gethostbyname_r_proto" in
14629 ''|0) d_gethostbyname_r=undef
14630 gethostbyname_r_proto=0
14631 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14632 * ) case "$gethostbyname_r_proto" in
14633 REENTRANT_PROTO*) ;;
14634 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14636 echo "Prototype: $try" ;;
14639 *) case "$usethreads" in
14640 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14642 d_gethostbyname_r=undef
14643 gethostbyname_r_proto=0
14647 *) gethostbyname_r_proto=0
14651 : see if gethostent_r exists
14652 set gethostent_r d_gethostent_r
14654 case "$d_gethostent_r" in
14656 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14657 case "$d_gethostent_r_proto:$usethreads" in
14658 ":define") d_gethostent_r_proto=define
14659 set d_gethostent_r_proto gethostent_r $hdrs
14663 case "$d_gethostent_r_proto" in
14665 case "$gethostent_r_proto" in
14666 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14667 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14669 case "$gethostent_r_proto" in
14670 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14671 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14673 case "$gethostent_r_proto" in
14674 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14675 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14677 case "$gethostent_r_proto" in
14678 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14679 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14681 case "$gethostent_r_proto" in
14682 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14683 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14685 case "$gethostent_r_proto" in
14686 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14687 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14689 case "$gethostent_r_proto" in
14690 ''|0) d_gethostent_r=undef
14691 gethostent_r_proto=0
14692 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14693 * ) case "$gethostent_r_proto" in
14694 REENTRANT_PROTO*) ;;
14695 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14697 echo "Prototype: $try" ;;
14700 *) case "$usethreads" in
14701 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14703 d_gethostent_r=undef
14704 gethostent_r_proto=0
14708 *) gethostent_r_proto=0
14712 : see if prototypes for various gethostxxx netdb.h functions are available
14714 set d_gethostprotos gethostent $i_netdb netdb.h
14717 : see if getitimer exists
14718 set getitimer d_getitimer
14721 : see if getlogin exists
14722 set getlogin d_getlogin
14725 : see if getlogin_r exists
14726 set getlogin_r d_getlogin_r
14728 case "$d_getlogin_r" in
14730 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14731 case "$d_getlogin_r_proto:$usethreads" in
14732 ":define") d_getlogin_r_proto=define
14733 set d_getlogin_r_proto getlogin_r $hdrs
14737 case "$d_getlogin_r_proto" in
14739 case "$getlogin_r_proto" in
14740 ''|0) try='int getlogin_r(char*, size_t);'
14741 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14743 case "$getlogin_r_proto" in
14744 ''|0) try='int getlogin_r(char*, int);'
14745 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14747 case "$getlogin_r_proto" in
14748 ''|0) try='char* getlogin_r(char*, size_t);'
14749 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14751 case "$getlogin_r_proto" in
14752 ''|0) try='char* getlogin_r(char*, int);'
14753 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14755 case "$getlogin_r_proto" in
14756 ''|0) d_getlogin_r=undef
14758 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14759 * ) case "$getlogin_r_proto" in
14760 REENTRANT_PROTO*) ;;
14761 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14763 echo "Prototype: $try" ;;
14766 *) case "$usethreads" in
14767 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14774 *) getlogin_r_proto=0
14778 : see if getmnt exists
14779 set getmnt d_getmnt
14782 : see if getmntent exists
14783 set getmntent d_getmntent
14786 : see if getnameinfo exists
14787 set getnameinfo d_getnameinfo
14790 : see if getnetbyaddr exists
14791 set getnetbyaddr d_getnbyaddr
14794 : see if getnetbyname exists
14795 set getnetbyname d_getnbyname
14798 : see if getnetent exists
14799 set getnetent d_getnent
14802 : see if getnetbyaddr_r exists
14803 set getnetbyaddr_r d_getnetbyaddr_r
14805 case "$d_getnetbyaddr_r" in
14807 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14808 case "$d_getnetbyaddr_r_proto:$usethreads" in
14809 ":define") d_getnetbyaddr_r_proto=define
14810 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14814 case "$d_getnetbyaddr_r_proto" in
14816 case "$getnetbyaddr_r_proto" in
14817 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14818 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14820 case "$getnetbyaddr_r_proto" in
14821 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14822 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14824 case "$getnetbyaddr_r_proto" in
14825 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14826 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14828 case "$getnetbyaddr_r_proto" in
14829 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14830 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14832 case "$getnetbyaddr_r_proto" in
14833 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14834 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14836 case "$getnetbyaddr_r_proto" in
14837 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14838 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14840 case "$getnetbyaddr_r_proto" in
14841 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14842 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14844 case "$getnetbyaddr_r_proto" in
14845 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14846 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14848 case "$getnetbyaddr_r_proto" in
14849 ''|0) d_getnetbyaddr_r=undef
14850 getnetbyaddr_r_proto=0
14851 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14852 * ) case "$getnetbyaddr_r_proto" in
14853 REENTRANT_PROTO*) ;;
14854 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14856 echo "Prototype: $try" ;;
14859 *) case "$usethreads" in
14860 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14862 d_getnetbyaddr_r=undef
14863 getnetbyaddr_r_proto=0
14867 *) getnetbyaddr_r_proto=0
14871 : see if getnetbyname_r exists
14872 set getnetbyname_r d_getnetbyname_r
14874 case "$d_getnetbyname_r" in
14876 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14877 case "$d_getnetbyname_r_proto:$usethreads" in
14878 ":define") d_getnetbyname_r_proto=define
14879 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14883 case "$d_getnetbyname_r_proto" in
14885 case "$getnetbyname_r_proto" in
14886 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14887 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14889 case "$getnetbyname_r_proto" in
14890 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14891 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14893 case "$getnetbyname_r_proto" in
14894 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14895 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14897 case "$getnetbyname_r_proto" in
14898 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14899 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14901 case "$getnetbyname_r_proto" in
14902 ''|0) d_getnetbyname_r=undef
14903 getnetbyname_r_proto=0
14904 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14905 * ) case "$getnetbyname_r_proto" in
14906 REENTRANT_PROTO*) ;;
14907 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14909 echo "Prototype: $try" ;;
14912 *) case "$usethreads" in
14913 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14915 d_getnetbyname_r=undef
14916 getnetbyname_r_proto=0
14920 *) getnetbyname_r_proto=0
14924 : see if getnetent_r exists
14925 set getnetent_r d_getnetent_r
14927 case "$d_getnetent_r" in
14929 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14930 case "$d_getnetent_r_proto:$usethreads" in
14931 ":define") d_getnetent_r_proto=define
14932 set d_getnetent_r_proto getnetent_r $hdrs
14936 case "$d_getnetent_r_proto" in
14938 case "$getnetent_r_proto" in
14939 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14940 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14942 case "$getnetent_r_proto" in
14943 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14944 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14946 case "$getnetent_r_proto" in
14947 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14948 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14950 case "$getnetent_r_proto" in
14951 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14952 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14954 case "$getnetent_r_proto" in
14955 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14956 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14958 case "$getnetent_r_proto" in
14959 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14960 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14962 case "$getnetent_r_proto" in
14963 ''|0) d_getnetent_r=undef
14964 getnetent_r_proto=0
14965 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14966 * ) case "$getnetent_r_proto" in
14967 REENTRANT_PROTO*) ;;
14968 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14970 echo "Prototype: $try" ;;
14973 *) case "$usethreads" in
14974 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14976 d_getnetent_r=undef
14977 getnetent_r_proto=0
14981 *) getnetent_r_proto=0
14985 : see if prototypes for various getnetxxx netdb.h functions are available
14987 set d_getnetprotos getnetent $i_netdb netdb.h
14990 : see if getpagesize exists
14991 set getpagesize d_getpagsz
14994 : Optional checks for getprotobyname and getprotobynumber
14996 : see if getprotobyname exists
14997 set getprotobyname d_getpbyname
15000 : see if getprotobynumber exists
15001 set getprotobynumber d_getpbynumber
15004 : see if getprotoent exists
15005 set getprotoent d_getpent
15008 : see if getpgid exists
15009 set getpgid d_getpgid
15012 : see if getpgrp2 exists
15013 set getpgrp2 d_getpgrp2
15016 : see if getppid exists
15017 set getppid d_getppid
15020 : see if getpriority exists
15021 set getpriority d_getprior
15024 : see if getprotobyname_r exists
15025 set getprotobyname_r d_getprotobyname_r
15027 case "$d_getprotobyname_r" in
15029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15030 case "$d_getprotobyname_r_proto:$usethreads" in
15031 ":define") d_getprotobyname_r_proto=define
15032 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15036 case "$d_getprotobyname_r_proto" in
15038 case "$getprotobyname_r_proto" in
15039 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15040 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15042 case "$getprotobyname_r_proto" in
15043 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15044 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15046 case "$getprotobyname_r_proto" in
15047 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15048 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15050 case "$getprotobyname_r_proto" in
15051 ''|0) d_getprotobyname_r=undef
15052 getprotobyname_r_proto=0
15053 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15054 * ) case "$getprotobyname_r_proto" in
15055 REENTRANT_PROTO*) ;;
15056 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15058 echo "Prototype: $try" ;;
15061 *) case "$usethreads" in
15062 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15064 d_getprotobyname_r=undef
15065 getprotobyname_r_proto=0
15069 *) getprotobyname_r_proto=0
15073 : see if getprotobynumber_r exists
15074 set getprotobynumber_r d_getprotobynumber_r
15076 case "$d_getprotobynumber_r" in
15078 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15079 case "$d_getprotobynumber_r_proto:$usethreads" in
15080 ":define") d_getprotobynumber_r_proto=define
15081 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15085 case "$d_getprotobynumber_r_proto" in
15087 case "$getprotobynumber_r_proto" in
15088 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15089 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15091 case "$getprotobynumber_r_proto" in
15092 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15093 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15095 case "$getprotobynumber_r_proto" in
15096 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15097 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15099 case "$getprotobynumber_r_proto" in
15100 ''|0) d_getprotobynumber_r=undef
15101 getprotobynumber_r_proto=0
15102 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15103 * ) case "$getprotobynumber_r_proto" in
15104 REENTRANT_PROTO*) ;;
15105 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15107 echo "Prototype: $try" ;;
15110 *) case "$usethreads" in
15111 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15113 d_getprotobynumber_r=undef
15114 getprotobynumber_r_proto=0
15118 *) getprotobynumber_r_proto=0
15122 : see if getprotoent_r exists
15123 set getprotoent_r d_getprotoent_r
15125 case "$d_getprotoent_r" in
15127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15128 case "$d_getprotoent_r_proto:$usethreads" in
15129 ":define") d_getprotoent_r_proto=define
15130 set d_getprotoent_r_proto getprotoent_r $hdrs
15134 case "$d_getprotoent_r_proto" in
15136 case "$getprotoent_r_proto" in
15137 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15138 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15140 case "$getprotoent_r_proto" in
15141 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15142 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15144 case "$getprotoent_r_proto" in
15145 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15146 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15148 case "$getprotoent_r_proto" in
15149 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15150 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15152 case "$getprotoent_r_proto" in
15153 ''|0) d_getprotoent_r=undef
15154 getprotoent_r_proto=0
15155 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15156 * ) case "$getprotoent_r_proto" in
15157 REENTRANT_PROTO*) ;;
15158 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15160 echo "Prototype: $try" ;;
15163 *) case "$usethreads" in
15164 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15166 d_getprotoent_r=undef
15167 getprotoent_r_proto=0
15171 *) getprotoent_r_proto=0
15175 : see if prototypes for various getprotoxxx netdb.h functions are available
15177 set d_getprotoprotos getprotoent $i_netdb netdb.h
15180 : see if getprpwnam exists
15181 set getprpwnam d_getprpwnam
15184 : see if getpwent exists
15185 set getpwent d_getpwent
15188 : see if getpwent_r exists
15189 set getpwent_r d_getpwent_r
15191 case "$d_getpwent_r" in
15193 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15194 case "$d_getpwent_r_proto:$usethreads" in
15195 ":define") d_getpwent_r_proto=define
15196 set d_getpwent_r_proto getpwent_r $hdrs
15200 case "$d_getpwent_r_proto" in
15202 case "$getpwent_r_proto" in
15203 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15204 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15206 case "$getpwent_r_proto" in
15207 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15208 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15210 case "$getpwent_r_proto" in
15211 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15212 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15214 case "$getpwent_r_proto" in
15215 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15216 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15218 case "$getpwent_r_proto" in
15219 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15220 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15222 case "$getpwent_r_proto" in
15223 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15224 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15226 case "$getpwent_r_proto" in
15227 ''|0) d_getpwent_r=undef
15229 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15230 * ) case "$getpwent_r_proto" in
15231 REENTRANT_PROTO*) ;;
15232 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15234 echo "Prototype: $try" ;;
15237 *) case "$usethreads" in
15238 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15245 *) getpwent_r_proto=0
15249 : see if getpwnam_r exists
15250 set getpwnam_r d_getpwnam_r
15252 case "$d_getpwnam_r" in
15254 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15255 case "$d_getpwnam_r_proto:$usethreads" in
15256 ":define") d_getpwnam_r_proto=define
15257 set d_getpwnam_r_proto getpwnam_r $hdrs
15261 case "$d_getpwnam_r_proto" in
15263 case "$getpwnam_r_proto" in
15264 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15265 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15267 case "$getpwnam_r_proto" in
15268 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15269 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15271 case "$getpwnam_r_proto" in
15272 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15273 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15275 case "$getpwnam_r_proto" in
15276 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15277 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15279 case "$getpwnam_r_proto" in
15280 ''|0) d_getpwnam_r=undef
15282 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15283 * ) case "$getpwnam_r_proto" in
15284 REENTRANT_PROTO*) ;;
15285 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15287 echo "Prototype: $try" ;;
15290 *) case "$usethreads" in
15291 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15298 *) getpwnam_r_proto=0
15302 : see if getpwuid_r exists
15303 set getpwuid_r d_getpwuid_r
15305 case "$d_getpwuid_r" in
15307 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15308 case "$d_getpwuid_r_proto:$usethreads" in
15309 ":define") d_getpwuid_r_proto=define
15310 set d_getpwuid_r_proto getpwuid_r $hdrs
15314 case "$d_getpwuid_r_proto" in
15316 case "$getpwuid_r_proto" in
15317 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15318 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15320 case "$getpwuid_r_proto" in
15321 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15322 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15324 case "$getpwuid_r_proto" in
15325 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15326 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15328 case "$getpwuid_r_proto" in
15329 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15330 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15332 case "$getpwuid_r_proto" in
15333 ''|0) d_getpwuid_r=undef
15335 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15336 * ) case "$getpwuid_r_proto" in
15337 REENTRANT_PROTO*) ;;
15338 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15340 echo "Prototype: $try" ;;
15343 *) case "$usethreads" in
15344 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15351 *) getpwuid_r_proto=0
15355 : Optional checks for getsbyname and getsbyport
15357 : see if getservbyname exists
15358 set getservbyname d_getsbyname
15361 : see if getservbyport exists
15362 set getservbyport d_getsbyport
15365 : see if getservent exists
15366 set getservent d_getsent
15369 : see if getservbyname_r exists
15370 set getservbyname_r d_getservbyname_r
15372 case "$d_getservbyname_r" in
15374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15375 case "$d_getservbyname_r_proto:$usethreads" in
15376 ":define") d_getservbyname_r_proto=define
15377 set d_getservbyname_r_proto getservbyname_r $hdrs
15381 case "$d_getservbyname_r_proto" in
15383 case "$getservbyname_r_proto" in
15384 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15385 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15387 case "$getservbyname_r_proto" in
15388 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15389 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15391 case "$getservbyname_r_proto" in
15392 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15393 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15395 case "$getservbyname_r_proto" in
15396 ''|0) d_getservbyname_r=undef
15397 getservbyname_r_proto=0
15398 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15399 * ) case "$getservbyname_r_proto" in
15400 REENTRANT_PROTO*) ;;
15401 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15403 echo "Prototype: $try" ;;
15406 *) case "$usethreads" in
15407 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15409 d_getservbyname_r=undef
15410 getservbyname_r_proto=0
15414 *) getservbyname_r_proto=0
15418 : see if getservbyport_r exists
15419 set getservbyport_r d_getservbyport_r
15421 case "$d_getservbyport_r" in
15423 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15424 case "$d_getservbyport_r_proto:$usethreads" in
15425 ":define") d_getservbyport_r_proto=define
15426 set d_getservbyport_r_proto getservbyport_r $hdrs
15430 case "$d_getservbyport_r_proto" in
15432 case "$getservbyport_r_proto" in
15433 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15434 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15436 case "$getservbyport_r_proto" in
15437 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15438 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15440 case "$getservbyport_r_proto" in
15441 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15442 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15444 case "$getservbyport_r_proto" in
15445 ''|0) d_getservbyport_r=undef
15446 getservbyport_r_proto=0
15447 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15448 * ) case "$getservbyport_r_proto" in
15449 REENTRANT_PROTO*) ;;
15450 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15452 echo "Prototype: $try" ;;
15455 *) case "$usethreads" in
15456 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15458 d_getservbyport_r=undef
15459 getservbyport_r_proto=0
15463 *) getservbyport_r_proto=0
15467 : see if getservent_r exists
15468 set getservent_r d_getservent_r
15470 case "$d_getservent_r" in
15472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15473 case "$d_getservent_r_proto:$usethreads" in
15474 ":define") d_getservent_r_proto=define
15475 set d_getservent_r_proto getservent_r $hdrs
15479 case "$d_getservent_r_proto" in
15481 case "$getservent_r_proto" in
15482 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15483 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15485 case "$getservent_r_proto" in
15486 ''|0) try='int getservent_r(struct servent*, char*, int);'
15487 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15489 case "$getservent_r_proto" in
15490 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15491 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15493 case "$getservent_r_proto" in
15494 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15495 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15497 case "$getservent_r_proto" in
15498 ''|0) d_getservent_r=undef
15499 getservent_r_proto=0
15500 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15501 * ) case "$getservent_r_proto" in
15502 REENTRANT_PROTO*) ;;
15503 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15505 echo "Prototype: $try" ;;
15508 *) case "$usethreads" in
15509 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15511 d_getservent_r=undef
15512 getservent_r_proto=0
15516 *) getservent_r_proto=0
15520 : see if prototypes for various getservxxx netdb.h functions are available
15522 set d_getservprotos getservent $i_netdb netdb.h
15525 : see if getspnam exists
15526 set getspnam d_getspnam
15529 : see if this is a shadow.h system
15530 set shadow.h i_shadow
15533 : see if getspnam_r exists
15534 set getspnam_r d_getspnam_r
15536 case "$d_getspnam_r" in
15538 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15539 case "$d_getspnam_r_proto:$usethreads" in
15540 ":define") d_getspnam_r_proto=define
15541 set d_getspnam_r_proto getspnam_r $hdrs
15545 case "$d_getspnam_r_proto" in
15547 case "$getspnam_r_proto" in
15548 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15549 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15551 case "$getspnam_r_proto" in
15552 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15553 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15555 case "$getspnam_r_proto" in
15556 ''|0) d_getspnam_r=undef
15558 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15559 * ) case "$getspnam_r_proto" in
15560 REENTRANT_PROTO*) ;;
15561 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15563 echo "Prototype: $try" ;;
15566 *) case "$usethreads" in
15567 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15574 *) getspnam_r_proto=0
15578 : see if gettimeofday or ftime exists
15579 set gettimeofday d_gettimeod
15581 case "$d_gettimeod" in
15587 val="$undef"; set d_ftime; eval $setvar
15590 case "$d_gettimeod$d_ftime" in
15593 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15597 : see if gmtime_r exists
15598 set gmtime_r d_gmtime_r
15600 case "$d_gmtime_r" in
15602 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15603 case "$d_gmtime_r_proto:$usethreads" in
15604 ":define") d_gmtime_r_proto=define
15605 set d_gmtime_r_proto gmtime_r $hdrs
15609 case "$d_gmtime_r_proto" in
15611 case "$gmtime_r_proto" in
15612 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15613 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15615 case "$gmtime_r_proto" in
15616 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15617 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15619 case "$gmtime_r_proto" in
15620 ''|0) d_gmtime_r=undef
15622 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15623 * ) case "$gmtime_r_proto" in
15624 REENTRANT_PROTO*) ;;
15625 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15627 echo "Prototype: $try" ;;
15630 *) case "$usethreads" in
15631 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15638 *) gmtime_r_proto=0
15642 : see if hasmntopt exists
15643 set hasmntopt d_hasmntopt
15646 : see if this is a netinet/in.h or sys/in.h system
15647 set netinet/in.h i_niin sys/in.h i_sysin
15650 : see if arpa/inet.h has to be included
15651 set arpa/inet.h i_arpainet
15654 : see if htonl --and friends-- exists
15659 : Maybe they are macros.
15662 $cat >htonl.c <<EOM
15664 #include <sys/types.h>
15665 #$i_niin I_NETINET_IN
15667 #$i_arpainet I_ARPA_INET
15668 #ifdef I_NETINET_IN
15669 #include <netinet/in.h>
15672 #include <sys/in.h>
15675 #include <arpa/inet.h>
15678 printf("Defined as a macro.");
15681 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15682 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15684 echo "But it seems to be defined as a macro." >&4
15692 : see if hypot exists
15696 : see if ilogb exists
15700 : see if ilogbl exists
15701 set ilogbl d_ilogbl
15704 : check whether inet_aton exists
15705 set inet_aton d_inetaton
15708 : see if inet_ntop exists
15709 set inet_ntop d_inetntop
15712 : see if inet_pton exists
15713 set inet_pton d_inetpton
15718 $cat >isascii.c <<EOCP
15721 #$i_stdlib I_STDLIB
15723 #include <stdlib.h>
15734 if eval $compile; then
15735 echo "isascii() found." >&4
15738 echo "isascii() NOT found." >&4
15747 $cat >isblank.c <<'EOCP'
15758 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15759 echo "isblank() found." >&4
15762 echo "isblank() NOT found." >&4
15769 : check for isfinite
15770 echo "Checking to see if you have isfinite..." >&4
15773 int main() { return isfinite(0.0); }
15776 if eval $compile; then
15778 echo "You have isfinite."
15781 echo "You do not have isfinite."
15787 : see if isfinitel exists
15788 set isfinitel d_isfinitel
15792 echo "Checking to see if you have isinf..." >&4
15795 int main() { return isinf(0.0); }
15798 if eval $compile; then
15800 echo "You have isinf."
15803 echo "You do not have isinf."
15809 : see if isinfl exists
15810 set isinfl d_isinfl
15814 echo "Checking to see if you have isless..." >&4
15817 int main() { return isless(2.0, 1.0); }
15820 if eval $compile; then
15822 echo "You have isless."
15825 echo "You do not have isless."
15832 echo "Checking to see if you have isnan..." >&4
15835 int main() { return isnan(0.0); }
15838 if eval $compile; then
15840 echo "You have isnan."
15843 echo "You do not have isnan."
15849 : see if isnanl exists
15850 set isnanl d_isnanl
15853 : check for isnormal
15854 echo "Checking to see if you have isnormal..." >&4
15857 int main() { return isnormal(0.0); }
15860 if eval $compile; then
15862 echo "You have isnormal."
15865 echo "You do not have isnormal."
15875 : see if j0l exists
15879 : see if killpg exists
15880 set killpg d_killpg
15883 : see if localeconv exists
15884 set localeconv d_locconv
15887 : see if libc has the POSIX.1-2008 currency locale rules
15888 case "$d_locconv:$d_lc_monetary_2008" in
15891 #include <locale.h>
15893 struct lconv *lc = localeconv();
15894 char int_p_cs_precedes = lc->int_p_cs_precedes;
15899 if eval $compile; then
15900 d_lc_monetary_2008="$define"
15902 d_lc_monetary_2008="$undef"
15908 : see if lchown exists
15910 $cat > try.c <<EOCP
15913 #include <stdlib.h>
15914 #$i_unistd I_UNISTD
15916 # include <unistd.h>
15918 int main(int argc, char *argv[])
15920 if (lchown("./try.c", -1, getgid()) == -1) {
15921 exit(EXIT_FAILURE);
15923 exit(EXIT_SUCCESS);
15927 if eval $compile && ./try; then
15928 $echo "lchown() found." >&4
15931 $echo "lchown() NOT found." >&4
15938 : See if number of significant digits in a double precision number is known
15940 $cat >ldbl_dig.c <<EOM
15941 #include <limits.h>
15944 printf("Contains LDBL_DIG");
15947 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15948 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15949 echo "LDBL_DIG found." >&4
15952 echo "LDBL_DIG NOT found." >&4
15959 : see if lgamma exists
15960 set lgamma d_lgamma
15963 : see if lgamma_r exists
15964 set lgamma_r d_lgamma_r
15967 : check to see if math.h defines _LIB_VERSION
15968 d_libm_lib_version="$undef"
15970 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15972 #include <unistd.h>
15974 int main (int argc, char *argv[])
15976 printf ("%d\n", _LIB_VERSION);
15981 if eval $compile; then
15983 echo "Yes, it does ($foo)" >&4
15984 d_libm_lib_version="$define"
15986 echo "No, it does not (probably harmless)" >&4
15990 : see if link exists
15994 : see if llrint exists
15995 set llrint d_llrint
15998 : see if llrintl exists
15999 set llrintl d_llrintl
16002 : see if llround exists
16003 set llround d_llround
16006 : see if llroundl exists
16007 set llroundl d_llroundl
16010 : see if localeconv_l exists
16011 set localeconv_l d_localeconv_l
16014 : see if localtime_r exists
16015 set localtime_r d_localtime_r
16017 case "$d_localtime_r" in
16019 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16020 case "$d_localtime_r_proto:$usethreads" in
16021 ":define") d_localtime_r_proto=define
16022 set d_localtime_r_proto localtime_r $hdrs
16026 case "$d_localtime_r_proto" in
16028 case "$localtime_r_proto" in
16029 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16030 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16032 case "$localtime_r_proto" in
16033 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16034 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16036 case "$localtime_r_proto" in
16037 ''|0) d_localtime_r=undef
16038 localtime_r_proto=0
16039 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16040 * ) case "$localtime_r_proto" in
16041 REENTRANT_PROTO*) ;;
16042 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16044 echo "Prototype: $try" ;;
16047 *) case "$usethreads" in
16048 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16050 d_localtime_r=undef
16051 localtime_r_proto=0
16055 *) localtime_r_proto=0
16059 : see if localtime_r calls tzset
16060 case "$localtime_r_proto" in
16063 /* Does our libc's localtime_r call tzset ?
16064 * return 0 if so, 1 otherwise.
16066 #$i_systypes I_SYS_TYPES
16067 #$i_unistd I_UNISTD
16069 #$i_stdlib I_STDLIB
16070 #$i_malloc I_MALLOC
16072 # include <sys/types.h>
16075 # include <unistd.h>
16081 #include <stdlib.h>
16083 #include <string.h>
16085 # include <malloc.h>
16089 time_t t = time(0L);
16090 char w_tz[]="TZ" "=GMT+5",
16091 e_tz[]="TZ" "=GMT-5",
16092 *tz_e = (char*)malloc(16),
16093 *tz_w = (char*)malloc(16);
16094 struct tm tm_e, tm_w;
16095 memset(&tm_e,'\0',sizeof(struct tm));
16096 memset(&tm_w,'\0',sizeof(struct tm));
16101 localtime_r(&t, &tm_e);
16104 localtime_r(&t, &tm_w);
16106 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16112 if eval $compile; then
16113 if $run ./try; then
16114 d_localtime_r_needs_tzset=undef;
16116 d_localtime_r_needs_tzset=define;
16119 d_localtime_r_needs_tzset=undef;
16123 d_localtime_r_needs_tzset=undef;
16128 : see if lockf exists
16132 : see if log1p exists
16136 : see if log2 exists
16140 : see if logb exists
16144 : see if lrint exists
16148 : see if lrintl exists
16149 set lrintl d_lrintl
16152 : see if lround exists
16153 set lround d_lround
16156 : see if lroundl exists
16157 set lroundl d_lroundl
16160 : see if prototype for lseek is available
16162 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16165 : see if lstat exists
16169 : see if madvise exists
16170 set madvise d_madvise
16173 : see if malloc_size exists
16174 set malloc_size d_malloc_size
16177 : see if malloc_size_good exists
16178 set malloc_good_size d_malloc_good_size
16181 : see if malloc_usable_size exists
16182 set malloc_usable_size d_malloc_usable_size
16185 : see if mblen exists
16189 : see if mbrlen exists
16190 set mbrlen d_mbrlen
16193 : see if mbrtowc exists
16194 set mbrtowc d_mbrtowc
16197 : see if mbstowcs exists
16198 set mbstowcs d_mbstowcs
16201 : see if mbtowc exists
16202 set mbtowc d_mbtowc
16205 : see if memmem exists
16206 : We need both a prototype in string.h and the symbol in libc.
16209 xx1="#$d_gnulibc HAS_GNULIBC"
16210 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16211 xx3='# define _GNU_SOURCE'
16213 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16215 case "$d_memmem_proto" in
16216 define) # see if memmem exists
16217 set memmem d_memmem
16226 : see if memrchr exists
16227 : We need both a prototype in string.h and the symbol in libc.
16230 xx1="#$d_gnulibc HAS_GNULIBC"
16231 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16232 xx3='# define _GNU_SOURCE'
16234 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16236 case "$d_memrchr_proto" in
16237 define) # see if memrchr exists
16238 set memrchr d_memrchr
16247 : see if mkdir exists
16251 : see if mkdtemp exists
16252 set mkdtemp d_mkdtemp
16255 : see if mkfifo exists
16256 set mkfifo d_mkfifo
16259 : see if mkostemp exists
16260 set mkostemp d_mkostemp
16263 : see if mkstemp exists
16264 set mkstemp d_mkstemp
16267 : see if mkstemps exists
16268 set mkstemps d_mkstemps
16271 : see if mktime exists
16272 set mktime d_mktime
16275 : see if sys/mman.h has to be included
16276 set sys/mman.h i_sysmman
16279 : see if mmap exists
16282 : see what shmat returns
16283 : default to something harmless
16285 case "$i_sysmman$d_mmap" in
16287 $cat >mmap.c <<'END'
16288 #include <sys/mman.h>
16291 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16296 echo "and it returns ($mmaptype)." >&4
16300 : see if sqrtl exists
16304 : see if scalbnl exists
16305 set scalbnl d_scalbnl
16308 : see if truncl exists
16309 set truncl d_truncl
16312 : see if modfl exists
16316 : see if prototype for modfl is available
16318 set d_modflproto modfl define math.h
16321 if $test "$uselongdouble" = "$define"; then
16323 if $test "$d_sqrtl" != "$define"; then
16324 message="$message sqrtl"
16326 if $test "$d_modfl" != "$define"; then
16327 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16328 echo "You have both truncl and copysignl, so I can emulate modfl."
16330 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16331 echo "You have both aintl and copysignl, so I can emulate modfl."
16333 message="$message modfl"
16337 if $test "$d_frexpl" != "$define"; then
16338 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16339 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16341 message="$message frexpl"
16344 if $test "$d_ldexpl" != "$define"; then
16345 message="$message ldexpl"
16348 if $test "$message" != ""; then
16351 *** You requested the use of long doubles but you do not seem to have
16352 *** the following mathematical functions needed for long double support:
16354 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16355 *** Cannot continue, aborting.
16363 : see if mprotect exists
16364 set mprotect d_mprotect
16367 : see if msgctl exists
16368 set msgctl d_msgctl
16371 : see if msgget exists
16372 set msgget d_msgget
16375 : see if msgsnd exists
16376 set msgsnd d_msgsnd
16379 : see if msgrcv exists
16380 set msgrcv d_msgrcv
16383 : see how much of the 'msg*(2)' library is present.
16386 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16387 *"$undef"*) h_msg=false;;
16391 case "`ipcs 2>&1`" in
16392 "SVID messages"*"not configured"*)
16393 echo "Your $osname does not have the msg*(2) configured." >&4
16396 set msgctl d_msgctl
16398 set msgget d_msgget
16400 set msgsnd d_msgsnd
16402 set msgrcv d_msgrcv
16408 : we could also check for sys/ipc.h ...
16409 if $h_msg && $test `./findhdr sys/msg.h`; then
16410 echo "You have the full msg*(2) library." >&4
16413 echo "You don't have the full msg*(2) library." >&4
16419 : Check for msghdr_s
16421 echo "Checking to see if your system supports struct msghdr..." >&4
16422 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16424 case "$d_msghdr_s" in
16425 "$define") echo "Yes, it does." ;;
16426 *) echo "No, it doesn't." ;;
16429 : see if msync exists
16433 : see if munmap exists
16434 set munmap d_munmap
16437 : see if nan exists
16441 : see if nanosleep exists
16442 set nanosleep d_nanosleep
16445 : see if nearbyint exists
16446 set nearbyint d_nearbyint
16449 : see if nextafter exists
16450 set nextafter d_nextafter
16453 : see if nexttoward exists
16454 set nexttoward d_nexttoward
16457 : see if nice exists
16461 : see if this is a langinfo.h system
16462 set langinfo.h i_langinfo
16465 : see if nl_langinfo exists
16466 set nl_langinfo d_nl_langinfo
16469 : see if this is a quadmath.h system
16470 set quadmath.h i_quadmath
16473 : Check basic sizes
16475 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16477 case "$use64bitint:$d_quad:$quadtype" in
16480 uvtype="$uquadtype"
16485 uvtype="unsigned long"
16491 case "$uselongdouble:$d_longdbl" in
16493 nvtype="long double"
16494 nvsize=$longdblsize
16501 case "$usequadmath:$i_quadmath" in
16503 nvtype="__float128"
16509 *** You requested the use of the quadmath library, but you
16510 *** do not seem to have the quadmath library installed.
16511 *** Cannot continue, aborting.
16517 define:*) $cat <<EOM >&4
16519 *** You requested the use of the quadmath library, but you
16520 *** do not seem to have the required header, <quadmath.h>.
16522 case "$gccversion" in
16525 *** Your gcc looks a bit old:
16531 *** You are not running a gcc.
16536 *** For the quadmath library you need at least gcc 4.6.
16537 *** Cannot continue, aborting.
16543 $echo "(IV will be "$ivtype", $ivsize bytes)"
16544 $echo "(UV will be "$uvtype", $uvsize bytes)"
16545 $echo "(NV will be "$nvtype", $nvsize bytes)"
16548 #$i_inttypes I_INTTYPES
16550 #include <inttypes.h>
16555 int8_t i = INT8_MAX;
16556 uint8_t u = UINT8_MAX;
16557 printf("int8_t\n");
16560 int16_t i = INT16_MAX;
16561 uint16_t u = UINT16_MAX;
16562 printf("int16_t\n");
16565 int32_t i = INT32_MAX;
16566 uint32_t u = UINT32_MAX;
16567 printf("int32_t\n");
16572 i8type="signed char"
16573 u8type="unsigned char"
16578 '') case "$shortsize" in
16580 u16type="unsigned short"
16588 '') set try -DINT16
16589 if eval $compile; then
16590 case "`$run ./try`" in
16602 '') if $test $shortsize -ge 2; then
16604 u16type="unsigned short"
16612 '') case "$longsize" in
16614 u32type="unsigned long"
16618 *) case "$intsize" in
16620 u32type="unsigned int"
16630 '') set try -DINT32
16631 if eval $compile; then
16632 case "`$run ./try`" in
16644 '') if $test $intsize -ge 4; then
16646 u32type="unsigned int"
16654 '') case "$d_quad:$quadtype" in
16656 i64type="$quadtype"
16657 u64type="$uquadtype"
16665 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16668 #$i_stdlib I_STDLIB
16670 #include <stdlib.h>
16672 #include <sys/types.h>
16673 #include <signal.h>
16675 /* volatile so that the compiler has to store it out to memory */
16676 volatile int bletched = 0;
16677 $signal_t blech(int s) { bletched = 1; }
16682 int n = 8 * $uvsize;
16685 signal(SIGFPE, blech);
16688 for (i = 0; i < n; i++) {
16689 u = u << 1 | ($uvtype)1;
16691 if (($uvtype)d != u)
16695 d = ($nvtype)(u - 1);
16696 if (($uvtype)d != (u - 1))
16703 printf("%d\n", ((i == n) ? -n : i));
16709 d_nv_preserves_uv="$undef"
16710 if eval $compile; then
16711 nv_preserves_uv_bits="`$run ./try`"
16713 case "$nv_preserves_uv_bits" in
16715 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16716 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16717 d_nv_preserves_uv="$define"
16719 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16720 d_nv_preserves_uv="$undef" ;;
16721 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16722 nv_preserves_uv_bits="0" ;;
16726 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16730 typedef $nvtype NV;
16737 while(count < 256) {
16738 /* volatile so that the compiler has to store it out to memory */
16739 volatile NV up = value + 1.0;
16740 volatile NV negated = -value;
16741 volatile NV down = negated - 1.0;
16742 volatile NV got_up = up - value;
16743 int up_good = got_up == 1.0;
16744 int got_down = down - negated;
16745 int down_good = got_down == -1.0;
16747 if (down_good != up_good) {
16749 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16750 up_good, (double) got_up, down_good, (double) got_down,
16751 count, (double) value);
16758 fputs("256.0", stdout);
16761 fputs("2.0", stdout);
16767 fputs("*", stdout);
16773 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16774 count, (double) value);
16780 nv_overflows_integers_at='0'
16781 if eval $compile; then
16787 The largest integer your NVs can preserve is equal to $xxx
16789 nv_overflows_integers_at="$xxx"
16792 Cannot determine the largest integer value your NVs can hold, unexpected output
16799 Cannot determine the largest integer value your NVs can hold
16806 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16809 #$i_stdlib I_STDLIB
16811 #include <stdlib.h>
16813 #include <string.h>
16814 #include <sys/types.h>
16815 #include <signal.h>
16817 /* volatile so that the compiler has to store it out to memory */
16818 volatile int bletched = 0;
16819 $signal_t blech(int s) { bletched = 1; }
16822 int checkit($nvtype d, const char *where) {
16824 unsigned char *p = (unsigned char *)v;
16825 unsigned char *end = p + sizeof(d);
16834 p = (unsigned char *)v;
16835 printf("No - %s: 0x", where);
16837 printf ("%02X", *p++);
16842 int main(int argc, char **argv) {
16845 fail += checkit(d, "0.0");
16847 /* The compiler shouldn't be assuming that bletched is 0 */
16850 fail += checkit(d, "bleched");
16853 signal(SIGFPE, blech);
16856 /* Paranoia - the compiler should have no way of knowing that ANSI says
16857 that argv[argc] will always be NULL. Actually, if it did assume this it
16858 would be buggy, as this is C and main() can be called from elsewhere in
16860 d = argv[argc] ? 1 : 0;
16863 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16866 fail += checkit(d, "ternary");
16868 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16871 printf("No - memset doesn't give 0.0\n");
16872 /* This might just blow up: */
16873 printf("(gives %g)\n", d);
16879 printf("No - something bleched\n");
16884 printf("No - %d fail(s)\n", fail);
16893 d_nv_zero_is_allbits_zero="$undef"
16894 if eval $compile; then
16900 0.0 is represented as all bits zero in memory
16902 d_nv_zero_is_allbits_zero="$define"
16905 0.0 is not represented as all bits zero in memory
16907 d_nv_zero_is_allbits_zero="$undef"
16912 0.0 is not represented as all bits zero in memory
16914 d_nv_zero_is_allbits_zero="$undef"
16920 : check for off64_t
16922 echo "Checking to see if you have off64_t..." >&4
16924 #include <sys/types.h>
16925 #include <unistd.h>
16926 int main() { off64_t x = 7; }
16929 if eval $compile; then
16931 echo "You have off64_t."
16934 echo "You do not have off64_t."
16935 case "$lseeksize" in
16936 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16943 : how to create joinable pthreads
16944 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16946 echo "Checking what constant to use for creating joinable pthreads..." >&4
16947 $cat >try.c <<'EOCP'
16948 #include <pthread.h>
16950 int detachstate = JOINABLE;
16953 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16954 if eval $compile; then
16955 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16956 val="$undef" # Yes, undef.
16957 set d_old_pthread_create_joinable
16960 set old_pthread_create_joinable
16963 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16964 if eval $compile; then
16965 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16967 set d_old_pthread_create_joinable
16969 val=PTHREAD_CREATE_UNDETACHED
16970 set old_pthread_create_joinable
16973 set try -DJOINABLE=__UNDETACHED
16974 if eval $compile; then
16975 echo "You seem to use __UNDETACHED." >&4
16977 set d_old_pthread_create_joinable
16980 set old_pthread_create_joinable
16983 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16985 set d_old_pthread_create_joinable
16988 set old_pthread_create_joinable
16995 d_old_pthread_create_joinable="$undef"
16996 old_pthread_create_joinable=""
16999 : see if pause exists
17003 : see if pipe2 exists
17007 : see if poll exists
17011 : see if prctl exists
17015 : see if prctl supports PR_SET_NAME
17016 d_prctl_set_name=$undef
17021 #include <unistd.h>
17023 #include <sys/prctl.h>
17025 int main (int argc, char *argv[])
17027 return (prctl (PR_SET_NAME, "Test"));
17031 if eval $compile_ok && $run ./try; then
17032 echo "Your prctl (PR_SET_NAME, ...) works"
17033 d_prctl_set_name=$define
17039 : see if readlink exists
17040 set readlink d_readlink
17043 : Check if there is a /proc symlink to the abs path of
17044 : the executing program. We will honor hints of d_procselfexe=$undef
17045 : or procselfexe being non-empty, otherwise will try to determine both
17046 : if we have readlink.
17047 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17048 : referenced, and AmigaOS does not have a proc filesystem anyway.
17051 if $test "X$d_procselfexe" = Xundef; then
17053 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17055 elif $test "X$d_readlink" = Xdefine; then
17056 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17057 : and it feels more tidy to avoid an extra level of symlink
17058 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17059 while test $# -gt 0; do
17062 if $issymlink $try; then
17063 $ls -l $try > reflect
17064 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17065 echo "You have $type-like $try."
17066 procselfexe='"'$try'"'
17068 : This will break out of the loop
17078 : backward compatibility for d_hvfork
17079 if test X$d_hvfork != X; then
17080 d_vfork="$d_hvfork"
17083 : see if there is a vfork
17088 d_pseudofork=$undef
17090 : Ok, but do we want to use it. vfork is reportedly unreliable in
17091 : perl on Solaris 2.x, and probably elsewhere.
17095 case "$usevfork" in
17101 Perl can only use a vfork() that doesn't suffer from strict
17102 restrictions on calling functions or modifying global data in
17103 the child. For example, glibc-2.1 contains such a vfork()
17104 that is unsuitable. If your system provides a proper fork()
17105 call, chances are that you do NOT want perl to use vfork().
17108 rp="Do you still want to use vfork()?"
17113 echo "Ok, we won't use vfork()."
17122 $define) usevfork='true';;
17123 *) usevfork='false';;
17126 : see whether the pthread_atfork exists
17128 #include <pthread.h>
17131 #ifdef PTHREAD_ATFORK
17132 pthread_atfork(NULL,NULL,NULL);
17137 : see if pthread_atfork exists
17138 set try -DPTHREAD_ATFORK
17139 if eval $compile; then
17144 case "$usethreads" in
17147 $define) echo 'pthread_atfork found.' >&4 ;;
17148 *) echo 'pthread_atfork NOT found.' >&4 ;;
17151 set d_pthread_atfork
17154 : see if pthread_attr_setscope exists
17155 set pthread_attr_setscope d_pthread_attr_setscope
17158 : see whether the various POSIXish _yields exist
17160 #include <pthread.h>
17166 #ifdef PTHREAD_YIELD
17169 #ifdef PTHREAD_YIELD_NULL
17170 pthread_yield(NULL);
17176 : see if sched_yield exists
17177 set try -DSCHED_YIELD
17178 if eval $compile; then
17180 sched_yield='sched_yield()'
17184 case "$usethreads" in
17187 $define) echo 'sched_yield() found.' >&4 ;;
17188 *) echo 'sched_yield() NOT found.' >&4 ;;
17194 : see if pthread_yield exists
17195 set try -DPTHREAD_YIELD
17196 if eval $compile; then
17198 case "$sched_yield" in
17199 '') sched_yield='pthread_yield()' ;;
17202 set try -DPTHREAD_YIELD_NULL
17203 if eval $compile; then
17205 case "$sched_yield" in
17206 '') sched_yield='pthread_yield(NULL)' ;;
17212 case "$usethreads" in
17215 $define) echo 'pthread_yield() found.' >&4 ;;
17216 *) echo 'pthread_yield() NOT found.' >&4 ;;
17220 set d_pthread_yield
17222 case "$sched_yield" in
17223 '') sched_yield=undef ;;
17227 : check for ptrdiff_t
17229 echo "Checking to see if you have ptrdiff_t..." >&4
17231 #include <stddef.h>
17232 int main() { ptrdiff_t x = 7; }
17235 if eval $compile; then
17237 echo "You have ptrdiff_t."
17240 echo "You do not have ptrdiff_t."
17246 : see if random_r exists
17247 set random_r d_random_r
17249 case "$d_random_r" in
17251 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17252 case "$d_random_r_proto:$usethreads" in
17253 ":define") d_random_r_proto=define
17254 set d_random_r_proto random_r $hdrs
17258 case "$d_random_r_proto" in
17260 case "$random_r_proto" in
17261 ''|0) try='int random_r(int*, struct random_data*);'
17262 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17264 case "$random_r_proto" in
17265 ''|0) try='int random_r(long*, struct random_data*);'
17266 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17268 case "$random_r_proto" in
17269 ''|0) try='int random_r(struct random_data*, int32_t*);'
17270 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17272 case "$random_r_proto" in
17273 ''|0) d_random_r=undef
17275 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17276 * ) case "$random_r_proto" in
17277 REENTRANT_PROTO*) ;;
17278 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17280 echo "Prototype: $try" ;;
17283 *) case "$usethreads" in
17284 define) echo "random_r has no prototype, not using it." >&4 ;;
17291 *) random_r_proto=0
17295 : see if readdir and friends exist
17296 set readdir d_readdir
17298 set seekdir d_seekdir
17300 set telldir d_telldir
17302 set rewinddir d_rewinddir
17305 : see if readdir64_r exists
17306 set readdir64_r d_readdir64_r
17308 case "$d_readdir64_r" in
17310 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17311 case "$d_readdir64_r_proto:$usethreads" in
17312 ":define") d_readdir64_r_proto=define
17313 set d_readdir64_r_proto readdir64_r $hdrs
17317 case "$d_readdir64_r_proto" in
17319 case "$readdir64_r_proto" in
17320 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17321 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17323 case "$readdir64_r_proto" in
17324 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17325 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17327 case "$readdir64_r_proto" in
17328 ''|0) d_readdir64_r=undef
17329 readdir64_r_proto=0
17330 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17331 * ) case "$readdir64_r_proto" in
17332 REENTRANT_PROTO*) ;;
17333 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17335 echo "Prototype: $try" ;;
17338 *) case "$usethreads" in
17339 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17341 d_readdir64_r=undef
17342 readdir64_r_proto=0
17346 *) readdir64_r_proto=0
17350 : see if readdir_r exists
17351 set readdir_r d_readdir_r
17353 case "$d_readdir_r" in
17355 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17356 case "$d_readdir_r_proto:$usethreads" in
17357 ":define") d_readdir_r_proto=define
17358 set d_readdir_r_proto readdir_r $hdrs
17362 case "$d_readdir_r_proto" in
17364 case "$readdir_r_proto" in
17365 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17366 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17368 case "$readdir_r_proto" in
17369 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17370 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17372 case "$readdir_r_proto" in
17373 ''|0) d_readdir_r=undef
17375 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17376 * ) case "$readdir_r_proto" in
17377 REENTRANT_PROTO*) ;;
17378 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17380 echo "Prototype: $try" ;;
17383 *) case "$usethreads" in
17384 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17391 *) readdir_r_proto=0
17395 : see if readv exists
17399 : see if recvmsg exists
17400 set recvmsg d_recvmsg
17403 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17405 if set regcomp val -f d_regcomp; eval $csym; $val; then
17406 echo 'regcomp() found.' >&4
17407 d_regcomp="$define"
17410 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17411 echo 'regcmp() found.' >&4
17415 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17416 echo 're_comp() found, assuming re_exec() also exists.' >&4
17417 d_re_comp="$define"
17422 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17429 : see if remainder exists
17430 set remainder d_remainder
17433 : see if remquo exists
17434 set remquo d_remquo
17437 : see if rename exists
17438 set rename d_rename
17441 : see if rint exists
17445 : see if rmdir exists
17449 : see if round exists
17453 : see if prototype for sbrk is available
17455 set d_sbrkproto sbrk $i_unistd unistd.h
17458 : see if scalbn exists
17459 set scalbn d_scalbn
17462 : see if select exists
17463 set select d_select
17466 : see if semctl exists
17467 set semctl d_semctl
17470 : see if semget exists
17471 set semget d_semget
17474 : see if semop exists
17478 : see how much of the 'sem*(2)' library is present.
17481 case "$d_semctl$d_semget$d_semop" in
17482 *"$undef"*) h_sem=false;;
17486 case "`ipcs 2>&1`" in
17487 "SVID messages"*"not configured"*)
17488 echo "Your $osname does not have the sem*(2) configured." >&4
17491 set semctl d_semctl
17493 set semget d_semget
17501 : we could also check for sys/ipc.h ...
17502 if $h_sem && $test `./findhdr sys/sem.h`; then
17503 echo "You have the full sem*(2) library." >&4
17506 echo "You don't have the full sem*(2) library." >&4
17512 : see whether sys/sem.h defines union semun
17514 $cat > try.c <<'END'
17515 #include <sys/types.h>
17516 #include <sys/ipc.h>
17517 #include <sys/sem.h>
17518 int main () { union semun semun; semun.buf = 0; }
17521 if eval $compile; then
17522 echo "You have union semun in <sys/sem.h>." >&4
17525 echo "You do not have union semun in <sys/sem.h>." >&4
17532 : see how to do semctl IPC_STAT
17536 $cat > tryh.h <<END
17539 # define S_IRUSR S_IREAD
17540 # define S_IWUSR S_IWRITE
17541 # define S_IXUSR S_IEXEC
17543 # define S_IRUSR 0400
17544 # define S_IWUSR 0200
17545 # define S_IXUSR 0100
17547 # define S_IRGRP (S_IRUSR>>3)
17548 # define S_IWGRP (S_IWUSR>>3)
17549 # define S_IXGRP (S_IXUSR>>3)
17550 # define S_IROTH (S_IRUSR>>6)
17551 # define S_IWOTH (S_IWUSR>>6)
17552 # define S_IXOTH (S_IXUSR>>6)
17555 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17556 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17557 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17560 : see whether semctl IPC_STAT can use union semun
17561 case "$d_semctl_semun" in
17565 #include <sys/types.h>
17566 #include <sys/ipc.h>
17567 #include <sys/sem.h>
17568 #include <sys/stat.h>
17575 #$d_union_semun HAS_UNION_SEMUN
17578 #ifndef HAS_UNION_SEMUN
17581 struct semid_ds *buf;
17582 unsigned short *array;
17588 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17589 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17591 struct semid_ds argbuf;
17594 st = semctl(sem, 0, IPC_STAT, arg);
17598 # endif /* IPC_STAT */
17599 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17601 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17602 # endif /* IPC_RMID */
17603 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17605 #endif /* IPC_PRIVATE && ... */
17606 printf("semget failed: errno = %d\n", errno);
17611 if eval $compile; then
17614 semun) val="$define" ;;
17622 case "$d_semctl_semun" in
17624 echo "You can use union semun for semctl IPC_STAT." >&4
17627 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17632 : see whether semctl IPC_STAT can use struct semid_ds pointer
17633 case "$d_semctl_semid_ds" in
17636 $cat > try.c <<'END'
17637 #include <sys/types.h>
17638 #include <sys/ipc.h>
17639 #include <sys/sem.h>
17640 #include <sys/stat.h>
17649 #ifndef HAS_UNION_SEMUN
17652 struct semid_ds *buf;
17653 unsigned short *array;
17657 struct semid_ds argbuf;
17660 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17661 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17665 st = semctl(sem, 0, IPC_STAT, arg);
17667 printf("semid_ds\n");
17669 # endif /* IPC_STAT */
17670 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17672 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17673 # endif /* IPC_RMID */
17674 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17676 #endif /* IPC_PRIVATE && ... */
17677 printf("semget failed: errno = %d\n", errno);
17683 if eval $compile; then
17686 semid_ds) val="$define" ;;
17690 set d_semctl_semid_ds
17694 case "$d_semctl_semid_ds" in
17696 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17698 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17704 # We do not have the full sem*(2) library, so assume we can not
17710 set d_semctl_semid_ds
17716 : see if sendmsg exists
17717 set sendmsg d_sendmsg
17720 : see if setegid exists
17721 set setegid d_setegid
17724 : see if seteuid exists
17725 set seteuid d_seteuid
17728 : see if setgrent exists
17729 set setgrent d_setgrent
17732 : see if setgrent_r exists
17733 set setgrent_r d_setgrent_r
17735 case "$d_setgrent_r" in
17737 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17738 case "$d_setgrent_r_proto:$usethreads" in
17739 ":define") d_setgrent_r_proto=define
17740 set d_setgrent_r_proto setgrent_r $hdrs
17744 case "$d_setgrent_r_proto" in
17746 case "$setgrent_r_proto" in
17747 ''|0) try='int setgrent_r(FILE**);'
17748 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17750 case "$setgrent_r_proto" in
17751 ''|0) try='void setgrent_r(FILE**);'
17752 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17754 case "$setgrent_r_proto" in
17755 ''|0) d_setgrent_r=undef
17757 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17758 * ) case "$setgrent_r_proto" in
17759 REENTRANT_PROTO*) ;;
17760 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17762 echo "Prototype: $try" ;;
17765 *) case "$usethreads" in
17766 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17773 *) setgrent_r_proto=0
17777 : see if sethostent exists
17778 set sethostent d_sethent
17781 : see if sethostent_r exists
17782 set sethostent_r d_sethostent_r
17784 case "$d_sethostent_r" in
17786 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17787 case "$d_sethostent_r_proto:$usethreads" in
17788 ":define") d_sethostent_r_proto=define
17789 set d_sethostent_r_proto sethostent_r $hdrs
17793 case "$d_sethostent_r_proto" in
17795 case "$sethostent_r_proto" in
17796 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17797 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17799 case "$sethostent_r_proto" in
17800 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17801 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17803 case "$sethostent_r_proto" in
17804 ''|0) d_sethostent_r=undef
17805 sethostent_r_proto=0
17806 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17807 * ) case "$sethostent_r_proto" in
17808 REENTRANT_PROTO*) ;;
17809 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17811 echo "Prototype: $try" ;;
17814 *) case "$usethreads" in
17815 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17817 d_sethostent_r=undef
17818 sethostent_r_proto=0
17822 *) sethostent_r_proto=0
17826 : see if setitimer exists
17827 set setitimer d_setitimer
17830 : see if setlinebuf exists
17831 set setlinebuf d_setlinebuf
17834 : see if locale.h is available
17835 set locale.h i_locale
17838 : see if this system has wctype.h
17839 set wctype.h i_wctype
17842 : see if towupper exists
17843 set towupper d_towupper
17846 : check for setlocale function and behavior
17849 Checking to see if you have setlocale() and its behavior
17852 #include <stdlib.h>
17853 #include <string.h>
17854 #$i_locale I_LOCALE
17856 # include <locale.h>
17858 #$i_wctype I_WCTYPE
17860 # include <wctype.h>
17864 const char * invalid_name = "\a"; /* This is really invalid! */
17865 int accepts_any_locale_name = 0;
17866 int has_C_UTF8 = 0;
17867 unsigned char bad_setlocale = 255;
17869 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17870 * disabled. It's hard to imagine an instance where meaningful locale
17871 * handling could be done without LC_CTYPE */
17872 const char * name = setlocale(LC_CTYPE, "C");
17874 if (name == NULL || strcmp(name, "C") != 0) {
17875 exit(bad_setlocale);
17878 name = setlocale(LC_CTYPE, invalid_name);
17879 if (name != NULL) {
17881 /* Let it pass if it accepts the name but gives back one of the C
17883 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17884 accepts_any_locale_name = 1;
17888 name = setlocale(LC_CTYPE, "C.UTF-8");
17889 if (name != NULL) {
17890 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17892 #$d_towupper HAS_TOWUPPER
17893 #ifdef HAS_TOWUPPER
17895 /* We assume that if the machine doesn't have the C99 towupper, it
17896 * doesn't have C.UTF-8, even if we successfully changed locales to
17897 * include it. This seems safer even on platforms that didn't accept
17898 * the really invalid name */
17900 if (towupper(y_with_diaeresis) == 0x178) {
17910 /* Currently unused code to determine if LC_ALL with disparate values uses
17911 * category = value pairs or positional, and to determine the separator
17912 * between the categories. We could add code so that if the separator were
17913 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17914 * every possible ASCII separator would fit in the 5 bits available in the
17915 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17916 * positional, we probably would want to know the order of the categories.
17917 * Using a file between the C program and the shell script would really be
17918 * require to do that */
17921 unsigned char min_separator = ' ' - 1;
17922 unsigned char separator = min_separator;
17923 int uses_name_value_pair_names = 0;
17925 name = setlocale(LC_ALL, "C");
17926 if (name == NULL || strcmp(name, "C") != 0) {
17927 exit(bad_setlocale);
17933 name = setlocale(LC_CTYPE, "C.UTF-8");
17934 if (name == NULL) {
17935 exit(bad_setlocale);
17937 name = setlocale(LC_ALL, NULL);
17938 if (name == NULL) {
17939 exit(bad_setlocale);
17942 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17944 uses_name_value_pair_names = 1;
17946 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17949 separator = *(pos - 1);
17953 pos = strstr(name, "C.UTF-8");
17957 else if (pos == name) {
17958 separator = name[sizeof("C.UTF-8") - 1];
17961 separator = *(pos - 1);
17969 exit( 0 /* (separator - min_separator) << 3
17970 | uses_name_value_pair_names << 2
17973 | accepts_any_locale_name);
17978 if eval $compile; then
17979 echo "Your system has setlocale()..." >&4
17982 0) echo "and it seems sane" >&4
17983 d_setlocale="$define"
17984 d_setlocale_accepts_any_locale_name="$undef"
17985 d_has_C_UTF8="false"
17987 1) echo "and it seems sane, but accepts any locale name as valid" >&4
17988 d_setlocale="$define"
17989 d_setlocale_accepts_any_locale_name="$define"
17990 d_has_C_UTF8="false"
17992 2) echo "and it seems sane" >&4
17993 d_setlocale="$define"
17994 d_setlocale_accepts_any_locale_name="$undef"
17995 d_has_C_UTF8="true"
17997 3) 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="true"
18002 *) echo "but it doesn't seem to work, so we won't use it." >&4
18003 d_setlocale="$undef"
18004 d_setlocale_accepts_any_locale_name="$undef"
18005 d_has_C_UTF8="false"
18009 echo "your system does not have setlocale()" >&4
18010 d_setlocale="$undef"
18011 d_setlocale_accepts_any_locale_name="$undef"
18012 d_has_C_UTF8="false"
18016 : see if setlocale_r exists
18017 set setlocale_r d_setlocale_r
18019 case "$d_setlocale_r" in
18021 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18022 case "$d_setlocale_r_proto:$usethreads" in
18023 ":define") d_setlocale_r_proto=define
18024 set d_setlocale_r_proto setlocale_r $hdrs
18028 case "$d_setlocale_r_proto" in
18030 case "$setlocale_r_proto" in
18031 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18032 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18034 case "$setlocale_r_proto" in
18035 ''|0) d_setlocale_r=undef
18036 setlocale_r_proto=0
18037 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18038 * ) case "$setlocale_r_proto" in
18039 REENTRANT_PROTO*) ;;
18040 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18042 echo "Prototype: $try" ;;
18045 *) case "$usethreads" in
18046 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18048 d_setlocale_r=undef
18049 setlocale_r_proto=0
18053 *) setlocale_r_proto=0
18057 : see if setnetent exists
18058 set setnetent d_setnent
18061 : see if setnetent_r exists
18062 set setnetent_r d_setnetent_r
18064 case "$d_setnetent_r" in
18066 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18067 case "$d_setnetent_r_proto:$usethreads" in
18068 ":define") d_setnetent_r_proto=define
18069 set d_setnetent_r_proto setnetent_r $hdrs
18073 case "$d_setnetent_r_proto" in
18075 case "$setnetent_r_proto" in
18076 ''|0) try='int setnetent_r(int, struct netent_data*);'
18077 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18079 case "$setnetent_r_proto" in
18080 ''|0) try='void setnetent_r(int, struct netent_data*);'
18081 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18083 case "$setnetent_r_proto" in
18084 ''|0) d_setnetent_r=undef
18085 setnetent_r_proto=0
18086 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18087 * ) case "$setnetent_r_proto" in
18088 REENTRANT_PROTO*) ;;
18089 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18091 echo "Prototype: $try" ;;
18094 *) case "$usethreads" in
18095 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18097 d_setnetent_r=undef
18098 setnetent_r_proto=0
18102 *) setnetent_r_proto=0
18106 : see if setprotoent exists
18107 set setprotoent d_setpent
18110 : see if setpgid exists
18111 set setpgid d_setpgid
18114 : see if setpgrp2 exists
18115 set setpgrp2 d_setpgrp2
18118 : see if setpriority exists
18119 set setpriority d_setprior
18122 : see if setproctitle exists
18123 set setproctitle d_setproctitle
18126 : see if setprotoent_r exists
18127 set setprotoent_r d_setprotoent_r
18129 case "$d_setprotoent_r" in
18131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18132 case "$d_setprotoent_r_proto:$usethreads" in
18133 ":define") d_setprotoent_r_proto=define
18134 set d_setprotoent_r_proto setprotoent_r $hdrs
18138 case "$d_setprotoent_r_proto" in
18140 case "$setprotoent_r_proto" in
18141 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18142 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18144 case "$setprotoent_r_proto" in
18145 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18146 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18148 case "$setprotoent_r_proto" in
18149 ''|0) d_setprotoent_r=undef
18150 setprotoent_r_proto=0
18151 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18152 * ) case "$setprotoent_r_proto" in
18153 REENTRANT_PROTO*) ;;
18154 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18156 echo "Prototype: $try" ;;
18159 *) case "$usethreads" in
18160 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18162 d_setprotoent_r=undef
18163 setprotoent_r_proto=0
18167 *) setprotoent_r_proto=0
18171 : see if setpwent exists
18172 set setpwent d_setpwent
18175 : see if setpwent_r exists
18176 set setpwent_r d_setpwent_r
18178 case "$d_setpwent_r" in
18180 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18181 case "$d_setpwent_r_proto:$usethreads" in
18182 ":define") d_setpwent_r_proto=define
18183 set d_setpwent_r_proto setpwent_r $hdrs
18187 case "$d_setpwent_r_proto" in
18189 case "$setpwent_r_proto" in
18190 ''|0) try='int setpwent_r(FILE**);'
18191 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18193 case "$setpwent_r_proto" in
18194 ''|0) try='void setpwent_r(FILE**);'
18195 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18197 case "$setpwent_r_proto" in
18198 ''|0) d_setpwent_r=undef
18200 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18201 * ) case "$setpwent_r_proto" in
18202 REENTRANT_PROTO*) ;;
18203 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18205 echo "Prototype: $try" ;;
18208 *) case "$usethreads" in
18209 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18216 *) setpwent_r_proto=0
18220 : see if setregid exists
18221 set setregid d_setregid
18223 set setresgid d_setresgid
18226 : see if setreuid exists
18227 set setreuid d_setreuid
18229 set setresuid d_setresuid
18232 : see if setrgid exists
18233 set setrgid d_setrgid
18236 : see if setruid exists
18237 set setruid d_setruid
18240 : see if setservent exists
18241 set setservent d_setsent
18244 : see if setservent_r exists
18245 set setservent_r d_setservent_r
18247 case "$d_setservent_r" in
18249 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18250 case "$d_setservent_r_proto:$usethreads" in
18251 ":define") d_setservent_r_proto=define
18252 set d_setservent_r_proto setservent_r $hdrs
18256 case "$d_setservent_r_proto" in
18258 case "$setservent_r_proto" in
18259 ''|0) try='int setservent_r(int, struct servent_data*);'
18260 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18262 case "$setservent_r_proto" in
18263 ''|0) try='void setservent_r(int, struct servent_data*);'
18264 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18266 case "$setservent_r_proto" in
18267 ''|0) d_setservent_r=undef
18268 setservent_r_proto=0
18269 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18270 * ) case "$setservent_r_proto" in
18271 REENTRANT_PROTO*) ;;
18272 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18274 echo "Prototype: $try" ;;
18277 *) case "$usethreads" in
18278 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18280 d_setservent_r=undef
18281 setservent_r_proto=0
18285 *) setservent_r_proto=0
18289 : see if setsid exists
18290 set setsid d_setsid
18293 : see if setvbuf exists
18294 set setvbuf d_setvbuf
18297 : see if shmctl exists
18298 set shmctl d_shmctl
18301 : see if shmget exists
18302 set shmget d_shmget
18305 : see if shmat exists
18308 : see what shmat returns
18311 $cat >shmat.c <<'END'
18312 #include <sys/shm.h>
18315 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18320 echo "and it returns ($shmattype)." >&4
18321 : see if a prototype for shmat is available
18322 xxx=`./findhdr sys/shm.h`
18323 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18324 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18335 set d_shmatprototype
18338 : see if shmdt exists
18342 : see how much of the 'shm*(2)' library is present.
18345 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18346 *"$undef"*) h_shm=false;;
18350 case "`ipcs 2>&1`" in
18351 "SVID shared memory"*"not configured"*)
18352 echo "Your $osname does not have the shm*(2) configured." >&4
18355 set shmctl d_shmctl
18357 set shmget d_shmget
18367 : we could also check for sys/ipc.h ...
18368 if $h_shm && $test `./findhdr sys/shm.h`; then
18369 echo "You have the full shm*(2) library." >&4
18372 echo "You don't have the full shm*(2) library." >&4
18378 : see if we have sigaction
18380 if set sigaction val -f d_sigaction; eval $csym; $val; then
18381 echo 'sigaction() found.' >&4
18384 #include <sys/types.h>
18385 #include <signal.h>
18386 #$i_stdlib I_STDLIB
18388 #include <stdlib.h>
18392 struct sigaction act, oact;
18394 oact.sa_handler = 0;
18395 /* so that act and oact are used */
18396 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18400 if eval $compile_ok; then
18403 echo "But you don't seem to have a usable struct sigaction." >&4
18407 echo 'sigaction NOT found.' >&4
18410 set d_sigaction; eval $setvar
18413 : see what type pids are declared as in the kernel
18414 rp="What is the type of process ids on this system?"
18415 set pid_t pidtype int stdio.h sys/types.h
18418 : see what type uids are declared as in the kernel
18420 echo "Looking for the type for user ids returned by getuid()."
18421 set uid_t uidtype xxx stdio.h sys/types.h
18425 xxx=`./findhdr sys/user.h`
18426 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18428 unsigned) dflt="$1 $2" ;;
18432 *) dflt="$uidtype";;
18435 uid_t) echo "uid_t found." ;;
18436 *) rp="What is the type for user ids returned by getuid()?"
18442 : Define hasfield_t macro for Configure internal use
18443 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18444 while $test $# -ge 2; do
18446 $define) echo "#include <$2>";;
18450 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18452 if eval $compile; then
18461 : see what siginfo fields we have
18462 case "$d_sigaction" in
18464 echo "Checking if your siginfo_t has si_errno field...">&4
18465 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18468 echo "Checking if your siginfo_t has si_pid field...">&4
18469 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18472 echo "Checking if your siginfo_t has si_uid field...">&4
18473 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18476 echo "Checking if your siginfo_t has si_addr field...">&4
18477 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18480 echo "Checking if your siginfo_t has si_status field...">&4
18481 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18484 echo "Checking if your siginfo_t has si_band field...">&4
18485 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18488 echo "Checking if your siginfo_t has si_value field...">&4
18489 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18492 echo "Checking if your siginfo_t has si_fd field...">&4
18493 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18498 d_siginfo_si_errno="$undef"
18499 d_siginfo_si_pid="$undef"
18500 d_siginfo_si_uid="$undef"
18501 d_siginfo_si_addr="$undef"
18502 d_siginfo_si_status="$undef"
18503 d_siginfo_si_band="$undef"
18504 d_siginfo_si_value="$undef"
18505 d_siginfo_si_fd="$undef"
18509 : see if this is a sunmath.h system
18510 set sunmath.h i_sunmath
18513 : see if signbit exists
18514 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18516 #$i_sunmath I_SUNMATH
18518 #ifdef I_SUNMATH /* Solaris special math library */
18519 # include <sunmath.h>
18522 int main(int argc, char **argv)
18526 if ((signbit(x) == 0) && (signbit(y) != 0))
18534 if eval $compile; then
18535 if $run ./try; then
18539 $echo "Signbit seems to be available, but doesn't work as I expected."
18540 $echo "I won't use it." >&4
18551 : see if sigprocmask exists
18552 set sigprocmask d_sigprocmask
18555 : see if sigsetjmp exists
18557 case "$d_sigsetjmp" in
18560 #include <setjmp.h>
18561 #$i_stdlib I_STDLIB
18563 #include <stdlib.h>
18569 if (sigsetjmp(env,1))
18572 siglongjmp(env, 1);
18577 if eval $compile; then
18578 if $run ./try >/dev/null 2>&1; then
18579 echo "POSIX sigsetjmp found." >&4
18583 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18589 echo "sigsetjmp not found." >&4
18593 *) val="$d_sigsetjmp"
18594 case "$d_sigsetjmp" in
18595 $define) echo "POSIX sigsetjmp found." >&4;;
18596 $undef) echo "sigsetjmp not found." >&4;;
18604 : see if snprintf exists
18605 set snprintf d_snprintf
18608 : see if vsnprintf exists
18609 set vsnprintf d_vsnprintf
18612 case "$d_snprintf-$d_vsnprintf" in
18615 Checking whether your snprintf() and vsnprintf() work okay...
18617 $cat >try.c <<'EOCP'
18618 /* v?snprintf testing logic courtesy of Russ Allbery.
18619 * According to C99:
18620 * - if the buffer is too short it still must be \0-terminated
18621 * - if the buffer is too short the potentially required length
18622 * must be returned and not -1
18623 * - if the buffer is NULL the potentially required length
18624 * must be returned and not -1 or core dump
18627 #include <stdarg.h>
18631 int test (char *format, ...)
18636 va_start (args, format);
18637 count = vsnprintf (buf, sizeof buf, format, args);
18644 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18645 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18649 if eval $compile; then
18652 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18654 Your snprintf() and snprintf() don't seem to be working okay.
18656 d_snprintf="$undef"
18657 d_vsnprintf="$undef"
18661 echo "(I can't seem to compile the test program--assuming they don't)"
18662 d_snprintf="$undef"
18663 d_vsnprintf="$undef"
18669 : see if sockatmark exists
18670 set sockatmark d_sockatmark
18673 : see if prototype for sockatmark is available
18675 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18678 : see if socks5_init exists
18679 set socks5_init d_socks5_init
18682 : see if srand48_r exists
18683 set srand48_r d_srand48_r
18685 case "$d_srand48_r" in
18687 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18688 case "$d_srand48_r_proto:$usethreads" in
18689 ":define") d_srand48_r_proto=define
18690 set d_srand48_r_proto srand48_r $hdrs
18694 case "$d_srand48_r_proto" in
18696 case "$srand48_r_proto" in
18697 ''|0) try='int srand48_r(long, struct drand48_data*);'
18698 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18700 case "$srand48_r_proto" in
18701 ''|0) d_srand48_r=undef
18703 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18704 * ) case "$srand48_r_proto" in
18705 REENTRANT_PROTO*) ;;
18706 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18708 echo "Prototype: $try" ;;
18711 *) case "$usethreads" in
18712 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18719 *) srand48_r_proto=0
18723 : see if srandom_r exists
18724 set srandom_r d_srandom_r
18726 case "$d_srandom_r" in
18728 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18729 case "$d_srandom_r_proto:$usethreads" in
18730 ":define") d_srandom_r_proto=define
18731 set d_srandom_r_proto srandom_r $hdrs
18735 case "$d_srandom_r_proto" in
18737 case "$srandom_r_proto" in
18738 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18739 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18741 case "$srandom_r_proto" in
18742 ''|0) d_srandom_r=undef
18744 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18745 * ) case "$srandom_r_proto" in
18746 REENTRANT_PROTO*) ;;
18747 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18749 echo "Prototype: $try" ;;
18752 *) case "$usethreads" in
18753 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18760 *) srandom_r_proto=0
18764 : see if prototype for setresgid is available
18766 set d_sresgproto setresgid $i_unistd unistd.h
18769 : see if prototype for setresuid is available
18771 set d_sresuproto setresuid $i_unistd unistd.h
18774 : see if stat exists
18778 : see if sys/stat.h is available
18779 set sys/stat.h i_sysstat
18782 : see if stat knows about block sizes
18784 echo "Checking to see if your struct stat has st_blocks field..." >&4
18785 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18788 : see if this is a sys/vfs.h system
18789 set sys/vfs.h i_sysvfs
18792 : see if this is a sys/statfs.h system
18793 set sys/statfs.h i_sysstatfs
18796 : Check for statfs_s
18798 echo "Checking to see if your system supports struct statfs..." >&4
18799 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
18801 case "$d_statfs_s" in
18802 "$define") echo "Yes, it does." ;;
18803 *) echo "No, it doesn't." ;;
18806 : see if struct statfs knows about f_flags
18807 case "$d_statfs_s" in
18810 echo "Checking to see if your struct statfs has f_flags field..." >&4
18811 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
18815 set d_statfs_f_flags
18819 case "$d_statfs_f_flags" in
18820 "$define") echo "Yes, it does." ;;
18821 *) echo "No, it doesn't." ;;
18824 : see what flavor, if any, of static inline is supported
18826 echo "Checking to see if your system supports static inline..."
18827 $cat > try.c <<'EOCP'
18828 #include <stdlib.h>
18829 extern int f_via_a(int x);
18830 extern int f_via_b(int x);
18831 int main(int argc, char **argv)
18840 return EXIT_SUCCESS;
18843 return EXIT_FAILURE;
18847 $cat > a.c <<'EOCP'
18848 static INLINE int f(int x) {
18859 $cat > b.c <<'EOCP'
18860 extern int f(int x);
18868 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18869 case "$perl_static_inline" in
18870 '') # Check the various possibilities, and break out on success.
18871 # For gcc, prefer __inline__, which will still permit
18872 # cflags.SH to add in -ansi.
18873 case "$gccversion" in
18874 '') xxx="inline __inline__ __inline _inline";;
18875 *) xxx="__inline__ inline __inline _inline";;
18877 for inline in $xxx; do
18878 set try -DINLINE=$inline a.c
18879 if eval $compile && $run ./try; then
18880 # Now make sure there is no external linkage of static
18882 set try -DINLINE=$inline -DUSE_B a.c b.c
18883 if eval $compile && $run ./try; then
18884 $echo "Your compiler supports static $inline, " >&4
18885 $echo "but it also creates an external definition," >&4
18886 $echo "so I won't use it." >&4
18889 $echo "Your compiler supports static $inline." >&4
18891 perl_static_inline="static $inline";
18895 $echo "Your compiler does NOT support static $inline." >&4
18900 *inline*) # Some variant of inline exists.
18901 echo "Keeping your $hint value of $perl_static_inline."
18904 static) # No inline capabilities
18905 echo "Keeping your $hint value of $perl_static_inline."
18908 *) # Unrecognized previous value -- blindly trust the supplied
18909 # value and hope it makes sense. Use old value for
18910 # d_static_inline, if there is one.
18911 echo "Keeping your $hint value of $perl_static_inline."
18912 case "$d_static_inline" in
18914 *) val=$d_static_inline ;;
18918 # Fallback to plain 'static' if nothing worked.
18919 case "$perl_static_inline" in
18921 perl_static_inline="static"
18925 set d_static_inline
18927 $rm -f a.[co] b.[co]
18930 : Check stream access
18932 Checking how to access stdio streams by file descriptor number...
18934 case "$stdio_stream_array" in
18935 '') $cat >try.c <<EOCP
18938 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18942 for s in _iob __iob __sF
18944 set try -DSTDIO_STREAM_ARRAY=$s
18945 if eval $compile; then
18946 case "`$run ./try`" in
18947 yes) stdio_stream_array=$s; break ;;
18953 case "$stdio_stream_array" in
18955 I can't figure out how to access stdio streams by file descriptor number.
18957 d_stdio_stream_array="$undef"
18960 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18962 d_stdio_stream_array="$define"
18966 : see if strcoll exists
18967 set strcoll d_strcoll
18970 : see if strerror_l exists
18971 set strerror_l d_strerror_l
18974 : see if strerror_r exists
18975 set strerror_r d_strerror_r
18977 case "$d_strerror_r" in
18979 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18980 case "$d_strerror_r_proto:$usethreads" in
18981 ":define") d_strerror_r_proto=define
18982 set d_strerror_r_proto strerror_r $hdrs
18986 case "$d_strerror_r_proto" in
18988 case "$strerror_r_proto" in
18989 ''|0) try='int strerror_r(int, char*, size_t);'
18990 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18992 case "$strerror_r_proto" in
18993 ''|0) try='int strerror_r(int, char*, int);'
18994 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18996 case "$strerror_r_proto" in
18997 ''|0) try='char* strerror_r(int, char*, size_t);'
18998 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19000 case "$strerror_r_proto" in
19001 ''|0) d_strerror_r=undef
19003 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19004 * ) case "$strerror_r_proto" in
19005 REENTRANT_PROTO*) ;;
19006 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19008 echo "Prototype: $try" ;;
19011 *) case "$usethreads" in
19012 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19019 *) strerror_r_proto=0
19023 : see if strftime exists
19024 set strftime d_strftime
19027 : see if strlcat exists
19028 : We need both a prototype in string.h and the symbol in libc.
19031 xx1="#$d_gnulibc HAS_GNULIBC"
19032 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19033 xx3='# define _GNU_SOURCE'
19035 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19037 case "$d_strlcat_proto" in
19038 define) # see if strlcat exists
19039 set strlcat d_strlcat
19048 : see if strlcpy exists
19049 : We need both a prototype in string.h and the symbol in libc.
19052 xx1="#$d_gnulibc HAS_GNULIBC"
19053 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19054 xx3='# define _GNU_SOURCE'
19056 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19058 case "$d_strlcpy_proto" in
19059 define) # see if strlcpy exists
19060 set strlcpy d_strlcpy
19069 : see if strnlen exists
19070 set strnlen d_strnlen
19073 : see if strtod exists
19074 set strtod d_strtod
19077 : see if strtod_l exists
19078 set strtod_l d_strtod_l
19081 : see if strtol exists
19082 set strtol d_strtol
19085 : see if strtold exists
19086 set strtold d_strtold
19089 : see if strtold_l exists
19090 set strtold_l d_strtold_l
19093 : see if strtoll exists
19094 set strtoll d_strtoll
19097 case "$d_longlong-$d_strtoll" in
19100 Checking whether your strtoll() works okay...
19102 $cat >try.c <<'EOCP'
19105 #define strtoll __strtoll
19108 #define strtoll _strtoll
19111 #include <stdlib.h>
19112 static int bad = 0;
19113 void check(const char *s, long long ell, int een) {
19116 gll = strtoll(s, 0, 10);
19117 if (!((gll == ell) && (errno == een)))
19121 check(" 1", 1LL, 0);
19122 check(" 0", 0LL, 0);
19123 check("-1", -1LL, 0);
19124 check("-9223372036854775808", -9223372036854775808LL, 0);
19125 check("-9223372036854775808", -9223372036854775808LL, 0);
19126 check(" 9223372036854775807", 9223372036854775807LL, 0);
19127 check("-9223372036854775808", -9223372036854775808LL, 0);
19128 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19129 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19135 if eval $compile; then
19138 ok) echo "Your strtoll() seems to be working okay." ;;
19140 Your strtoll() doesn't seem to be working okay.
19146 echo "(I can't seem to compile the test program--assuming it doesn't)"
19152 : see if strtoq exists
19153 set strtoq d_strtoq
19156 : see if strtoul exists
19157 set strtoul d_strtoul
19160 case "$d_strtoul" in
19163 Checking whether your strtoul() works okay...
19165 $cat >try.c <<'EOCP'
19166 #include <stdlib.h>
19169 static int bad = 0;
19170 void check(const char *s, unsigned long eul, int een) {
19173 gul = strtoul(s, 0, 10);
19174 if (!((gul == eul) && (errno == een)))
19178 check(" 1", 1L, 0);
19179 check(" 0", 0L, 0);
19181 case "$longsize" in
19183 $cat >>try.c <<'EOCP'
19184 check("18446744073709551615", 18446744073709551615UL, 0);
19185 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19186 #if 0 /* strtoul() for /^-/ strings is undefined. */
19187 check("-1", 18446744073709551615UL, 0);
19188 check("-18446744073709551614", 2, 0);
19189 check("-18446744073709551615", 1, 0);
19190 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19191 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19196 $cat >>try.c <<'EOCP'
19197 check("4294967295", 4294967295UL, 0);
19198 check("4294967296", 4294967295UL, ERANGE);
19199 #if 0 /* strtoul() for /^-/ strings is undefined. */
19200 check("-1", 4294967295UL, 0);
19201 check("-4294967294", 2, 0);
19202 check("-4294967295", 1, 0);
19203 check("-4294967296", 4294967295UL, ERANGE);
19204 check("-4294967297", 4294967295UL, ERANGE);
19209 : Should we write these tests to be more portable by sprintf-ing
19210 : ~0 and then manipulating that char string as input for strtol?
19213 $cat >>try.c <<'EOCP'
19220 if eval $compile; then
19221 case "`$run ./try`" in
19222 ok) echo "Your strtoul() seems to be working okay." ;;
19224 Your strtoul() doesn't seem to be working okay.
19230 echo "(I can't seem to compile the test program--assuming it doesn't)"
19236 : see if strtoull exists
19237 set strtoull d_strtoull
19240 case "$d_longlong-$d_strtoull" in
19243 Checking whether your strtoull() works okay...
19245 $cat >try.c <<'EOCP'
19246 #include <stdlib.h>
19249 #define strtoull __strtoull
19252 static int bad = 0;
19253 void check(const char *s, long long eull, int een) {
19256 gull = strtoull(s, 0, 10);
19257 if (!((gull == eull) && (errno == een)))
19261 check(" 1", 1LL, 0);
19262 check(" 0", 0LL, 0);
19263 check("18446744073709551615", 18446744073709551615ULL, 0);
19264 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19265 #if 0 /* strtoull() for /^-/ strings is undefined. */
19266 check("-1", 18446744073709551615ULL, 0);
19267 check("-18446744073709551614", 2LL, 0);
19268 check("-18446744073709551615", 1LL, 0);
19269 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19270 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19277 if eval $compile; then
19278 case "`$run ./try`" in
19279 ok) echo "Your strtoull() seems to be working okay." ;;
19281 Your strtoull() doesn't seem to be working okay.
19283 d_strtoull="$undef"
19287 echo "(I can't seem to compile the test program--assuming it doesn't)"
19288 d_strtoull="$undef"
19293 : see if strtouq exists
19294 set strtouq d_strtouq
19297 case "$d_strtouq" in
19300 Checking whether your strtouq() works okay...
19302 $cat >try.c <<'EOCP'
19303 #include <stdlib.h>
19306 static int bad = 0;
19307 void check(const char *s, unsigned long long eull, int een) {
19308 unsigned long long gull;
19310 gull = strtouq(s, 0, 10);
19311 if (!((gull == eull) && (errno == een)))
19315 check(" 1", 1LL, 0);
19316 check(" 0", 0LL, 0);
19317 check("18446744073709551615", 18446744073709551615ULL, 0);
19318 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19319 #if 0 /* strtouq() for /^-/ strings is undefined. */
19320 check("-1", 18446744073709551615ULL, 0);
19321 check("-18446744073709551614", 2LL, 0);
19322 check("-18446744073709551615", 1LL, 0);
19323 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19324 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19332 if eval $compile; then
19333 case "`$run ./try`" in
19334 ok) echo "Your strtouq() seems to be working okay." ;;
19336 Your strtouq() doesn't seem to be working okay.
19342 echo "(I can't seem to compile the test program--assuming it doesn't)"
19348 : see if strxfrm exists
19349 set strxfrm d_strxfrm
19352 : see if symlink exists
19353 set symlink d_symlink
19356 : see if syscall exists
19357 set syscall d_syscall
19360 : see if prototype for syscall is available
19362 set d_syscallproto syscall $i_unistd unistd.h
19365 : see if sysconf exists
19366 set sysconf d_sysconf
19369 : see if sys_errlist[] exists
19371 if test "X$d_syserrlst" = X; then
19372 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19373 echo "You have sys_errlist[], so we could roll our own strerror."
19374 d_syserrlst="$define"
19376 echo "You don't have sys_errlist[], so strerror() is welcome."
19377 d_syserrlst="$undef"
19381 : see if system exists
19382 set system d_system
19385 : see if tcgetpgrp exists
19386 set tcgetpgrp d_tcgetpgrp
19389 : see if tcsetpgrp exists
19390 set tcsetpgrp d_tcsetpgrp
19393 : see if prototype for telldir is available
19395 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19398 : see if tgamma exists
19399 set tgamma d_tgamma
19402 : check for thread_safe_nl_langinfo_l item
19405 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19408 #$i_stdlib I_STDLIB
19410 # include <stdlib.h>
19412 #include <string.h>
19413 #$i_langinfo I_LANGINFO
19415 # include <langinfo.h>
19417 #$i_pthread I_PTHREAD
19419 # include <pthread.h>
19421 #$i_locale I_LOCALE
19423 # include <locale.h>
19427 thread_start(void * arg)
19429 nl_langinfo(RADIXCHAR);
19433 char * main_buffer;
19434 char save_main_buffer[1000];
19435 pthread_t subthread;
19436 pthread_attr_t attr;
19438 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19440 /* If too large for our generous allowance, just assume we don't have
19442 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19446 strcpy(save_main_buffer, main_buffer);
19448 if (pthread_attr_init(&attr) != 0) {
19452 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19456 if (pthread_join(subthread, NULL) != 0) {
19460 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19463 case "$usethreads" in
19466 if eval $compile; then
19467 echo "Your system has nl_langinfo_l()..." >&4
19468 if $run ./try; then
19469 echo "and it is thread-safe (just as I'd hoped)." >&4
19470 d_thread_safe_nl_langinfo_l="$define"
19471 echo "$d_thread_safe_nl_langinfo_l" >&4
19473 echo "but it isn't thread-safe, so we won't use it." >&4
19476 echo "your system does not have nl_langinfo_l()" >&4
19479 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19481 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19482 d_thread_safe_nl_langinfo_l="$undef"
19486 : see if time exists
19488 if test "X$d_time" = X -o X"$timetype" = X; then
19489 if set time val -f d_time; eval $csym; $val; then
19490 echo 'time() found.' >&4
19492 rp="What is the type returned by time() on this system?"
19493 set time_t timetype long stdio.h sys/types.h
19496 echo 'time() not found, hope that will do.' >&4
19504 : see if timegm exists
19505 set timegm d_timegm
19508 : see if this is a sys/times.h system
19509 set sys/times.h i_systimes
19512 : see if times exists
19514 if set times val -f d_times; eval $csym; $val; then
19515 echo 'times() found.' >&4
19518 case "$i_systimes" in
19519 "$define") inc='sys/times.h';;
19521 rp="What is the type returned by times() on this system?"
19522 set clock_t clocktype long stdio.h sys/types.h $inc
19525 echo 'times() NOT found, hope that will do.' >&4
19530 : see if tmpnam_r exists
19531 set tmpnam_r d_tmpnam_r
19533 case "$d_tmpnam_r" in
19535 hdrs="$i_systypes sys/types.h define stdio.h "
19536 case "$d_tmpnam_r_proto:$usethreads" in
19537 ":define") d_tmpnam_r_proto=define
19538 set d_tmpnam_r_proto tmpnam_r $hdrs
19542 case "$d_tmpnam_r_proto" in
19544 case "$tmpnam_r_proto" in
19545 ''|0) try='char* tmpnam_r(char*);'
19546 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19548 case "$tmpnam_r_proto" in
19549 ''|0) d_tmpnam_r=undef
19551 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19552 * ) case "$tmpnam_r_proto" in
19553 REENTRANT_PROTO*) ;;
19554 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19556 echo "Prototype: $try" ;;
19559 *) case "$usethreads" in
19560 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19567 *) tmpnam_r_proto=0
19571 : see if towlower exists
19572 set towlower d_towlower
19575 : see if trunc exists
19579 : see if truncate exists
19580 set truncate d_truncate
19583 : see if ttyname_r exists
19584 set ttyname_r d_ttyname_r
19586 case "$d_ttyname_r" in
19588 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19589 case "$d_ttyname_r_proto:$usethreads" in
19590 ":define") d_ttyname_r_proto=define
19591 set d_ttyname_r_proto ttyname_r $hdrs
19595 case "$d_ttyname_r_proto" in
19597 case "$ttyname_r_proto" in
19598 ''|0) try='int ttyname_r(int, char*, size_t);'
19599 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19601 case "$ttyname_r_proto" in
19602 ''|0) try='int ttyname_r(int, char*, int);'
19603 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19605 case "$ttyname_r_proto" in
19606 ''|0) try='char* ttyname_r(int, char*, int);'
19607 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19609 case "$ttyname_r_proto" in
19610 ''|0) d_ttyname_r=undef
19612 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19613 * ) case "$ttyname_r_proto" in
19614 REENTRANT_PROTO*) ;;
19615 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19617 echo "Prototype: $try" ;;
19620 *) case "$usethreads" in
19621 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19628 *) ttyname_r_proto=0
19632 : see if tzname[] exists
19634 if set tzname val -a d_tzname; eval $csym; $val; then
19636 echo 'tzname[] found.' >&4
19639 echo 'tzname[] NOT found.' >&4
19644 : Check if is a multiplatform env
19646 darwin) multiarch="$define" ;;
19648 case "$multiarch" in
19649 ''|[nN]*) multiarch="$undef" ;;
19652 : check for ordering of bytes in a UV
19654 case "$multiarch" in
19657 You seem to be doing a multiarchitecture build,
19658 skipping the byteorder check.
19664 case "$byteorder" in
19667 In the following, larger digits indicate more significance. A big-endian
19668 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19669 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19670 machines may have weird orders like 3412. A Cray will report 87654321,
19671 an Alpha will report 12345678. If the test program works the default is
19673 I'm now running the test program...
19677 #$i_stdlib I_STDLIB
19679 #include <stdlib.h>
19681 #include <sys/types.h>
19682 typedef $uvtype UV;
19692 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19694 u.l = (UV)0x04030201;
19695 for (i = 0; i < $uvsize; i++)
19696 printf("%c", u.c[i]+'0');
19703 if eval $compile && $run ./try > /dev/null; then
19706 [1-4][1-4][1-4][1-4]|12345678|87654321)
19707 echo "(The test program ran ok.)"
19708 echo "byteorder=$dflt"
19711 ????|????????) echo "(The test program ran ok.)" ;;
19712 *) echo "(The test program didn't run right for some reason.)" ;;
19717 (I can't seem to compile the test program. Guessing big-endian...)
19720 case "$xxx_prompt" in
19722 rp="What is the order of bytes in $uvtype?"
19735 : Checking 32bit alignedness
19738 Checking to see whether you can access character data unalignedly...
19740 case "$d_u32align" in
19741 '') $cat >try.c <<EOCP
19743 #$i_stdlib I_STDLIB
19745 #include <stdlib.h>
19747 #define U32 $u32type
19748 #define BYTEORDER 0x$byteorder
19750 #include <signal.h>
19752 $signal_t bletch(int s) { exit(4); }
19755 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19756 volatile U8 buf[8];
19760 if (sizeof(U32) != 4) {
19761 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19768 signal(SIGBUS, bletch);
19780 for (i = 0; i < 4; i++) {
19781 up = (U32*)(buf + i);
19782 if (! ((*up == 1 << (8*i)) || /* big-endian */
19783 (*up == 1 << (8*(3-i))) /* little-endian */
19787 printf("read failed (%x)\n", *up);
19793 for (i = 0; i < 4; i++) {
19794 up = (U32*)(buf + i);
19796 if (*up != 0xBeef) {
19797 printf("write failed (%x)\n", *up);
19811 if eval $compile_ok; then
19812 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19813 $run ./try 2>&1 >/dev/null
19816 You can access character data pretty unalignedly.
19818 d_u32align="$undef"
19821 It seems that you must access character data in an aligned manner.
19823 d_u32align="$define"
19827 rp='Can you access character data at unaligned addresses?'
19831 [yY]*) d_u32align="$undef" ;;
19832 *) d_u32align="$define" ;;
19839 : see if ualarm exists
19840 set ualarm d_ualarm
19843 : see if umask exists
19847 : see if unordered exists
19848 set unordered d_unordered
19851 : see if unsetenv exists
19852 set unsetenv d_unsetenv
19855 : see if usleep exists
19856 set usleep d_usleep
19859 : see if prototype for usleep is available
19861 set d_usleepproto usleep $i_unistd unistd.h
19864 : see if ustat exists
19868 : see if closedir exists
19869 set closedir d_closedir
19872 case "$d_closedir" in
19875 echo "Checking whether closedir() returns a status..." >&4
19877 #$i_dirent I_DIRENT /**/
19878 #$i_sysdir I_SYS_DIR /**/
19879 #$i_sysndir I_SYS_NDIR /**/
19880 #$i_systypes I_SYS_TYPES /**/
19882 #if defined(I_SYS_TYPES)
19883 #include <sys/types.h>
19885 #if defined(I_DIRENT)
19886 #include <dirent.h>
19889 #include <sys/ndir.h>
19892 #include <sys/dir.h>
19896 int main() { return closedir(opendir(".")); }
19899 if eval $compile_ok; then
19900 if $run ./try > /dev/null 2>&1 ; then
19901 echo "Yes, it does."
19904 echo "No, it doesn't."
19908 echo "(I can't seem to compile the test program--assuming it doesn't)"
19916 set d_void_closedir
19920 : see if there is a wait4
19924 : see if waitpid exists
19925 set waitpid d_waitpid
19928 : see if wcrtomb exists
19929 set wcrtomb d_wcrtomb
19934 $cat >try.c <<'EOCP'
19940 return (wcscmp (s, s) ? 1 : 0);
19945 if eval $compile; then
19948 0) echo "A working wcscmp() found." >&4
19950 *) echo "wcscmp() found, but it doesn't work" >&4
19954 echo "wcscmp() NOT found." >&4
19960 : see if wcstombs exists
19961 set wcstombs d_wcstombs
19966 $cat >try.c <<'EOCP'
19971 wchar_t dst[4], *src = L" ";
19973 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19978 if eval $compile; then
19981 0) echo "A working wcsxfrm() found." >&4
19983 *) echo "wcsxfrm() found, but it doesn't work" >&4
19987 echo "wcsxfrm() NOT found." >&4
19993 : see if wctomb exists
19994 set wctomb d_wctomb
19997 : see if writev exists
19998 set writev d_writev
20001 : check for alignment requirements
20003 case "$alignbytes" in
20004 '') echo "Checking alignment constraints..." >&4
20013 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20018 if eval $compile_ok; then
20022 echo "(I can't seem to compile the test program...)"
20024 case "$multiarch" in
20026 : The usual safe value is 8, but Darwin with -Duselongdouble
20027 : needs 16. Hence, we will take 8 as a minimum, but allow
20028 : Configure to pick a larger value if needed.
20029 if $test "$dflt" -lt 8; then
20031 echo "Setting alignment to 8 for multiarch support.">&4
20036 *) dflt="$alignbytes"
20039 rp="Doubles must be aligned on a how-many-byte boundary?"
20044 : set the base revision
20047 : length of character in bytes. Is always 1, otherwise it is not C
20048 : This used to be a test using sizeof
20051 : Check for the number of bits in a character
20052 case "$charbits" in
20053 '') echo "Checking how long a character is (in bits)..." >&4
20060 for (c = 1, n = 0; c; c <<= 1, n++) ;
20061 printf ("%d\n", n);
20066 if eval $compile_ok; then
20070 echo "(I can't seem to compile the test program. Guessing...)"
20077 rp="What is the length of a character (in bits)?"
20081 case "$charbits" in
20084 Your system has an unsigned character size of $charbits bits, which
20085 is rather unusual (normally it is 8 bits). Perl likely will not work
20086 correctly on your system, with subtle bugs in various places.
20088 rp='Do you really want to continue?'
20092 [yY]) echo >&4 "Okay, continuing." ;;
20097 : how do we concatenate cpp tokens here?
20099 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20100 $cat >cpp_stuff.c <<'EOCP'
20101 #define RCAT(a,b)a/**/b
20102 #define ACAT(a,b)a ## b
20106 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20107 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20108 echo "Oh! Smells like ANSI's been here." >&4
20109 echo "We can catify or stringify, separately or together!"
20111 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20112 echo "Ah, yes! The good old days!" >&4
20113 echo "However, in the good old days we don't know how to stringify and"
20114 echo "catify at the same time."
20118 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20119 You're going to have to edit the values of CAT[2-5] in config.h...
20121 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20125 : see if this is a db.h system
20131 : Check db version.
20133 echo "Checking Berkeley DB version ..." >&4
20135 #include <sys/types.h>
20137 #$i_stdlib I_STDLIB
20139 #include <stdlib.h>
20142 int main(int argc, char *argv[])
20144 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20145 int Major, Minor, Patch ;
20146 unsigned long Version ;
20147 (void)db_version(&Major, &Minor, &Patch) ;
20149 printf("%d %d %d %d %d %d\n",
20150 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20151 Major, Minor, Patch);
20154 printf("You have Berkeley DB Version 2 or greater.\n");
20156 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20157 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20158 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20159 Major, Minor, Patch) ;
20161 /* check that db.h & libdb are compatible */
20162 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20163 printf("db.h and libdb are incompatible.\n") ;
20167 printf("db.h and libdb are compatible.\n") ;
20169 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20170 + DB_VERSION_PATCH ;
20172 /* needs to be >= 2.3.4 */
20173 if (Version < 2003004) {
20174 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20175 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20181 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20186 printf("You have Berkeley DB Version 1.\n");
20187 exit(0); /* DB version < 2: the coast is clear. */
20189 exit(1); /* <db.h> not Berkeley DB? */
20195 if eval $compile_ok && $run ./try; then
20196 echo 'Looks OK.' >&4
20198 db_version_major=$1
20199 db_version_minor=$2
20200 db_version_patch=$3
20202 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20206 : Remove db from list of libraries to use
20207 echo "Removing unusable -ldb from library list" >&4
20208 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20211 echo "libs = $libs" >&4
20221 : Check the return type needed for hash
20223 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20225 #include <sys/types.h>
20228 #ifndef DB_VERSION_MAJOR
20229 u_int32_t hash_cb (const void* ptr, size_t size)
20236 info.hash = hash_cb;
20240 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20241 if $contains warning try.out >>/dev/null 2>&1 ; then
20244 db_hashtype='u_int32_t'
20247 : XXX Maybe we should just give up here.
20248 db_hashtype=u_int32_t
20250 echo "Help: I can't seem to compile the db test program." >&4
20251 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20254 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20256 *) db_hashtype=u_int32_t
20261 : Check the return type needed for prefix
20263 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20265 #include <sys/types.h>
20268 #ifndef DB_VERSION_MAJOR
20269 size_t prefix_cb (const DBT *key1, const DBT *key2)
20276 info.prefix = prefix_cb;
20280 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20281 if $contains warning try.out >>/dev/null 2>&1 ; then
20282 db_prefixtype='int'
20284 db_prefixtype='size_t'
20287 db_prefixtype='size_t'
20288 : XXX Maybe we should just give up here.
20290 echo "Help: I can't seem to compile the db test program." >&4
20291 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20294 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20296 *) db_prefixtype='size_t'
20300 : Include . in @INC
20303 Historically Perl has provided a final fallback of the current working
20304 directory '.' when searching for a library. This, however, can lead to
20305 problems when a Perl program which loads optional modules is called from
20306 a shared directory. This can lead to executing unexpected code.
20310 # When changing to exclude by default:
20311 case "$default_inc_excludes_dot" in
20312 $undef|false|[nN]*) dflt="n" ;;
20315 # To turn exclude off by default:
20316 #case "$default_inc_excludes_dot" in
20317 # $define|true|[yY]*) dflt="y" ;;
20321 rp='Exclude '.' from @INC by default? '
20324 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20325 *) default_inc_excludes_dot="$define" ;;
20328 : Check what kind of inf/nan your system has
20329 $echo "Checking the kind of infinities and nans you have..." >&4
20330 $echo "(The following tests may crash. That's okay.)" >&4
20332 #define DOUBLESIZE $doublesize
20333 #$d_longdbl HAS_LONG_DOUBLE
20334 #ifdef HAS_LONG_DOUBLE
20335 #define LONG_DOUBLESIZE $longdblsize
20336 #define LONG_DOUBLEKIND $longdblkind
20339 #include <string.h>
20341 /* Note that whether the sign bit is on or off
20342 * for NaN depends on the CPU/FPU, and possibly
20343 * can be affected by the build toolchain.
20345 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20346 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20347 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20348 * (respectively) as opposed to the more usual
20349 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20351 * Pre-IEEE-754 floating point format do not even have inf/nan support
20352 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20353 * to even mention, causing immediate SIGFPE or equivalent: this is
20354 * the case with VAX floating point, for example.
20356 static void bytes(void *v, unsigned int n) {
20357 unsigned char *p = (unsigned char *)v;
20359 for (i = 0; i < n; i++) {
20360 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20363 int main(int argc, char *argv[]) {
20364 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20365 * because some compilers are 'smart' and not only warn but refuse to
20366 * compile such 'illegal' values. */
20367 double dinf = exp(1e9);
20368 double dnan = sqrt(-1.0);
20369 #ifdef HAS_LONG_DOUBLE
20370 long double ldinf = (long double)exp(1e9);
20371 long double ldnan = (long double)sqrt(-1.0);
20372 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20373 /* the 80-bit long doubles might have garbage in their excess bytes */
20374 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20375 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20378 switch (argv[1][0]) {
20379 case '1': bytes(&dinf, sizeof(dinf)); break;
20380 case '2': bytes(&dnan, sizeof(dnan)); break;
20381 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20382 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20390 if eval $compile; then
20391 doubleinfbytes=`$run ./try 1`
20392 doublenanbytes=`$run ./try 2`
20393 case "$d_longdbl" in
20395 longdblinfbytes=`$run ./try 3`
20396 longdblnanbytes=`$run ./try 4`
20400 # Defaults in case the above test program failed.
20401 case "$doublekind" in
20402 1) # IEEE 754 32-bit LE
20403 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20404 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20406 2) # IEEE 754 32-bit BE
20407 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20408 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20410 3) # IEEE 754 64-bit LE
20411 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20412 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20414 4) # IEEE 754 64-bit BE
20415 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20416 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20418 5) # IEEE 754 128-bit LE
20419 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20420 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20422 6) # IEEE 754 128-bit BE
20423 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20424 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20426 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20427 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20428 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20430 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20431 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20432 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20434 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20435 doubleinfbytes=$undef
20436 doublenanbytes=$undef
20439 doubleinfbytes=$undef
20440 doublenanbytes=$undef
20443 case "$longdblkind" in
20444 1) # IEEE 754 128-bit LE
20445 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20446 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20448 2) # IEEE 754 128-bit BE
20449 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20450 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20452 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20453 case "$longdblsize" in
20454 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20455 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20456 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20459 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20460 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20463 longdblinfbytes=$undef
20464 longdblnanbytes=$undef
20468 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20469 case "$longdblsize" in
20470 12) # 32-bit system
20471 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20472 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20474 16) # 64-bit system
20475 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20476 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20479 longdblinfbytes=$undef
20480 longdblnanbytes=$undef
20484 5) # 128-bit LE-LE "double double"
20485 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20486 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20488 6) # 128-bit BE-BE "double double"
20489 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20490 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20492 7) # 128-bit LE-BE "double double"
20493 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20494 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20496 8) # 128-bit BE-LE "double double"
20497 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20498 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20500 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20501 longdblinfbytes=$undef
20502 longdblnanbytes=$undef
20505 longdblinfbytes=$undef
20506 longdblnanbytes=$undef
20510 # In case the program crashed the values are empty, turn them undef.
20511 case "$doubleinfbytes" in
20512 '') doubleinfbytes=$undef ;;
20514 case "$doublenanbytes" in
20515 '') doublenanbytes=$undef ;;
20517 case "$longdblinfbytes" in
20518 '') longdblinfbytes=$undef ;;
20520 case "$longdblnanbytes" in
20521 '') longdblnanbytes=$undef ;;
20525 : Check the length of the double mantissa
20526 $echo "Checking how many mantissa bits your doubles have..." >&4
20528 #$i_sunmath I_SUNMATH
20531 # include <sunmath.h>
20533 #ifdef DBL_MANT_DIG
20534 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20537 int main(int argc, char *argv[]) {
20539 printf("%d\n", BITS);
20545 if eval $compile; then
20546 doublemantbits=`$run ./try`
20548 doublemantbits="$undef"
20552 : Check the length of the longdouble mantissa
20553 $echo "Checking how many mantissa bits your long doubles have..." >&4
20555 #$i_sunmath I_SUNMATH
20558 # include <sunmath.h>
20560 #$d_longdbl HAS_LONG_DOUBLE
20561 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20562 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20563 /* This format has no implicit bit. Beware, however, that for
20564 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20565 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20566 * and the top bit must have been one since 387, zero is plain invalid.
20567 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20568 # define BITS LDBL_MANT_DIG
20569 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20570 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20571 * reason e.g. Irix thinks 107. But in any case, we want only
20572 * the number of real bits, the implicit bits are of no interest. */
20573 # define BITS 2 * (DBL_MANT_DIG - 1)
20575 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20579 int main(int argc, char *argv[]) {
20581 printf("%d\n", BITS);
20587 if eval $compile; then
20588 longdblmantbits=`$run ./try`
20590 longdblmantbits="$undef"
20594 : Check the length of the NV mantissa
20595 $echo "Checking how many mantissa bits your NVs have..." >&4
20596 if test "X$usequadmath" = "X$define"; then
20597 nvmantbits=112 # 128-1-15
20599 if test "X$nvsize" = "X$doublesize"; then
20600 nvmantbits="$doublemantbits"
20602 if test "X$nvsize" = "X$longdblsize"; then
20603 nvmantbits="$longdblmantbits"
20605 nvmantbits="$undef"
20610 : How can we generate normalized random numbers ?
20612 echo "Using our internal random number implementation..." >&4
20615 *-Dmy_rand=*|*-Dmy_srand=*)
20616 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20617 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20618 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20619 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20623 randfunc=Perl_drand48
20624 drand01="Perl_drand48()"
20625 seedfunc="Perl_drand48_init"
20629 : Probe whether dtrace builds an object, as newer Illumos requires an input
20630 : object file that uses at least one of the probes defined in the .d file
20631 case "$usedtrace" in
20633 case "$dtracexnolibs" in
20634 $define|true|[yY]*)
20635 dtracexnolibs=$define
20636 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20639 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20640 dtracexnolibs=$define
20641 echo "Your dtrace accepts -xnolibs"
20642 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20643 dtracexnolibs=$undef
20644 echo "Your dtrace doesn't accept -xnolibs"
20646 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20651 dtracexnolibs=$undef
20652 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20655 case $dtracexnolibs in
20656 $define) xnolibs=-xnolibs ;;
20660 case "$dtraceobject" in
20661 $define|true|[yY]*)
20662 dtraceobject=$define
20666 #include "perldtrace.h"
20668 PERL_LOADED_FILE("dummy");
20672 dtraceobject=$undef
20673 if $cc -c -o try.o $optimize $ccflags try.c \
20674 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20675 dtraceobject=$define
20676 echo "Your dtrace builds an object file"
20679 *) dtraceobject=$undef ;;
20681 $rm_try perldtrace.o perldtrace.h
20684 : Determine if this is an EBCDIC system
20686 echo "Determining whether or not we are on an EBCDIC system..." >&4
20687 $cat >try.c <<'EOM'
20690 if ('M'==0xd4) return 0;
20697 if eval $compile_ok; then
20698 if $run ./try; then
20699 echo "You seem to speak EBCDIC." >&4
20702 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20705 echo "I'm unable to compile the test program." >&4
20706 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20712 : Check how to flush
20715 Checking how to flush all pending stdio output...
20717 # I only know how to find the first 32 possibly open files on SunOS.
20718 # See also hints/sunos_4_1.sh and util.c --AD
20720 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20722 $cat >>try.c <<EOCP
20724 #$i_stdlib I_STDLIB
20726 #include <stdlib.h>
20728 #$i_unistd I_UNISTD
20730 # include <unistd.h>
20732 #$d_sysconf HAS_SYSCONF
20733 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20734 #ifdef HAS_STDIO_STREAM_ARRAY
20735 # define STDIO_STREAM_ARRAY $stdio_stream_array
20740 p = fopen("try.out", "w");
20744 # ifdef TRY_FPRINTF
20748 #ifdef TRY_FFLUSH_NULL
20751 #ifdef TRY_FFLUSH_ALL
20753 long open_max = -1;
20754 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20755 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20757 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20758 open_max = sysconf(_SC_OPEN_MAX);
20761 open_max = FOPEN_MAX;
20764 open_max = OPEN_MAX;
20773 # ifdef HAS_STDIO_STREAM_ARRAY
20774 if (open_max > 0) {
20776 for (i = 0; i < open_max; i++)
20777 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20778 STDIO_STREAM_ARRAY[i]._file < open_max &&
20779 STDIO_STREAM_ARRAY[i]._flag)
20780 fflush(&STDIO_STREAM_ARRAY[i]);
20788 : first we have to find out how _not_ to flush
20790 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20792 set try -DTRY_FPUTC
20793 if eval $compile; then
20794 $run ./try 2>/dev/null
20797 if $test ! -s try.out -a "X$code" = X42; then
20803 set try -DTRY_FPRINTF
20804 if eval $compile; then
20805 $run ./try 2>/dev/null
20808 if $test ! -s try.out -a "X$code" = X42; then
20809 output=-DTRY_FPRINTF
20815 : check for fflush NULL behavior
20816 case "$fflushNULL" in
20817 '') set try -DTRY_FFLUSH_NULL $output
20818 if eval $compile; then
20819 $run ./try 2>/dev/null
20822 if $test -s try.out -a "X$code" = X42; then
20823 fflushNULL="`$cat try.out`"
20825 if $test "X$code" != X42; then
20827 (If this test failed, don't worry, we'll try another method shortly.)
20832 $rm -f core try.core core.try.*
20833 case "$fflushNULL" in
20835 Your fflush(NULL) works okay for output streams.
20836 Let's see if it clobbers input pipes...
20838 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20839 # bug that improperly flushes the input end of pipes. So we avoid the
20840 # autoflush on fork/system/exec support for now. :-(
20841 $cat >tryp.c <<EOCP
20844 main(int argc, char **argv)
20850 while ((i = getc(stdin)) != -1
20851 && (*bp++ = i) != '\n'
20852 && bp < &buf[1024])
20855 fprintf(stdout, "%s", buf);
20863 fflushNULL="$define"
20865 if eval $compile; then
20867 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20868 if $test "X$targethost" != X; then
20871 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20873 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20875 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20877 fflush(NULL) seems to behave okay with input streams.
20879 fflushNULL="$define"
20882 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20884 fflushNULL="$undef"
20887 $rm -f core tryp.c tryp.core core.tryp.*
20890 Your fflush(NULL) isn't working (contrary to ANSI C).
20892 fflushNULL="$undef"
20895 Cannot figure out whether your fflush(NULL) works or not.
20896 I'm assuming it doesn't (contrary to ANSI C).
20898 fflushNULL="$undef"
20902 $define|true|[yY]*)
20903 fflushNULL="$define"
20906 fflushNULL="$undef"
20909 : check explicit looping only if NULL did not work, and if the pipe
20910 : bug does not show up on an explicit flush too
20911 case "$fflushNULL" in
20913 $cat >tryp.c <<EOCP
20916 main(int argc, char **argv)
20922 while ((i = getc(stdin)) != -1
20923 && (*bp++ = i) != '\n'
20924 && bp < &buf[1024])
20927 fprintf(stdout, "%s", buf);
20936 if eval $compile; then
20938 if $test "X$targethost" != X; then
20941 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20943 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20945 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20947 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20949 : now check for fflushall behaviour
20950 case "$fflushall" in
20951 '') set try -DTRY_FFLUSH_ALL $output
20952 if eval $compile; then
20954 (Now testing the other method--but note that this also may fail.)
20956 $run ./try 2>/dev/null
20959 if $test -s try.out -a "X$code" = X42; then
20960 fflushall="`$cat try.out`"
20964 case "$fflushall" in
20966 Whew. Flushing explicitly all the stdio streams works.
20968 fflushall="$define"
20971 Sigh. Flushing explicitly all the stdio streams doesn't work.
20976 Cannot figure out whether flushing stdio streams explicitly works or not.
20977 I'm assuming it doesn't.
20983 "$define"|true|[yY]*)
20984 fflushall="$define"
20992 All is futile. Even fflush(stdin) clobbers input pipes!
20999 $rm -f core tryp.c tryp.core core.tryp.*
21001 *) fflushall="$undef"
21005 case "$fflushNULL$fflushall" in
21008 OK, I give up. I cannot figure out how to flush pending stdio output.
21009 We won't be flushing handles at all before fork/exec/popen.
21015 : Store the full pathname to the ar program for use in the C program
21016 : Respect a hint or command line value for full_ar.
21021 : Store the full pathname to the sed program for use in the C program
21024 : see what type gids are declared as in the kernel
21026 echo "Looking for the type for group ids returned by getgid()."
21027 set gid_t gidtype xxx stdio.h sys/types.h
21031 xxx=`./findhdr sys/user.h`
21032 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21034 unsigned) dflt="$1 $2" ;;
21038 *) dflt="$gidtype";;
21041 gid_t) echo "gid_t found." ;;
21042 *) rp="What is the type for group ids returned by getgid()?"
21048 : Check the size of GID
21051 *_t) zzz="$gidtype" ;;
21054 echo "Checking the size of $zzz..." >&4
21056 #include <sys/types.h>
21058 #$i_stdlib I_STDLIB
21060 #include <stdlib.h>
21063 printf("%d\n", (int)sizeof($gidtype));
21068 if eval $compile_ok; then
21072 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21075 echo "Your $zzz is $gidsize bytes long."
21080 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21083 : Check if GID is signed
21086 *_t) zzz="$gidtype" ;;
21089 echo "Checking the sign of $zzz..." >&4
21091 #include <sys/types.h>
21102 if eval $compile; then
21106 echo "(I can't execute the test program--guessing unsigned.)" >&4
21110 1) echo "Your $zzz is unsigned." ;;
21111 -1) echo "Your $zzz is signed." ;;
21117 echo "(I can't compile the test program--guessing unsigned.)" >&4
21120 : Check 64bit sizes
21123 if $test X"$quadtype" != X; then
21125 echo "Checking how to print 64-bit integers..." >&4
21127 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21128 $cat >try.c <<'EOCP'
21129 #include <sys/types.h>
21132 int q = 12345678901;
21133 printf("%ld\n", q);
21137 if eval $compile; then
21141 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21142 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21143 echo "We will use %d."
21149 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21150 $cat >try.c <<'EOCP'
21151 #include <sys/types.h>
21154 long q = 12345678901;
21155 printf("%ld\n", q);
21159 if eval $compile; then
21163 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21164 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21165 echo "We will use %ld."
21171 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21172 $cat >try.c <<'EOCP'
21173 #include <sys/types.h>
21174 #include <inttypes.h>
21177 int64_t q = 12345678901;
21178 printf("%" PRId64 "\n", q);
21182 if eval $compile; then
21186 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21187 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21188 echo "We will use the C9X style."
21194 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21196 #include <sys/types.h>
21199 $quadtype q = 12345678901;
21200 printf("%Ld\n", q);
21204 if eval $compile; then
21208 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21209 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21210 echo "We will use %Ld."
21216 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21217 $cat >try.c <<'EOCP'
21218 #include <sys/types.h>
21221 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21222 printf("%lld\n", q);
21226 if eval $compile; then
21230 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21231 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21232 echo "We will use the %lld style."
21238 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21240 #include <sys/types.h>
21243 $quadtype q = 12345678901;
21244 printf("%qd\n", q);
21248 if eval $compile; then
21252 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21253 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21254 echo "We will use %qd."
21260 if $test X"$sPRId64" = X; then
21261 echo "Cannot figure out how to print 64-bit integers." >&4
21268 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21269 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21271 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21272 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21276 : Check format strings for internal types
21278 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21280 if $test X"$ivsize" = X8; then
21281 ivdformat="$sPRId64"
21282 uvuformat="$sPRIu64"
21283 uvoformat="$sPRIo64"
21284 uvxformat="$sPRIx64"
21285 uvXUformat="$sPRIXU64"
21287 if $test X"$ivsize" = X"$longsize"; then
21294 if $test X"$ivsize" = X"$intsize"; then
21302 if $test X"$ivsize" = X"$shortsize"; then
21313 if $test X"$usequadmath" = X"$define"; then
21321 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21322 nveformat="$sPRIeldbl"
21323 nvfformat="$sPRIfldbl"
21324 nvgformat="$sPRIgldbl"
21325 nvEUformat="$sPRIEUldbl"
21326 nvFUformat="$sPRIFUldbl"
21327 nvGUformat="$sPRIGUldbl"
21338 case "$ivdformat" in
21339 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21344 : Check format string for GID
21347 $echo "Checking the format string to be used for gids..." >&4
21350 -1) if $test X"$gidsize" = X"$ivsize"; then
21351 gidformat="$ivdformat"
21353 if $test X"$gidsize" = X"$longsize"; then
21356 if $test X"$gidsize" = X"$intsize"; then
21359 if $test X"$gidsize" = X"$shortsize"; then
21366 *) if $test X"$gidsize" = X"$uvsize"; then
21367 gidformat="$uvuformat"
21369 if $test X"$gidsize" = X"$longsize"; then
21372 if $test X"$gidsize" = X"$intsize"; then
21375 if $test X"$gidsize" = X"$shortsize"; then
21384 : see if getgroups exists
21385 set getgroups d_getgrps
21388 : see if setgroups exists
21389 set setgroups d_setgrps
21392 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21394 case "$d_getgrps$d_setgrps" in
21396 case "$groupstype" in
21397 '') dflt="$gidtype" ;;
21398 *) dflt="$groupstype" ;;
21401 What type of pointer is the second argument to getgroups() and setgroups()?
21402 Usually this is the same as group ids, $gidtype, but not always.
21405 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21409 *) groupstype="$gidtype";;
21412 : check whether make sets MAKE
21414 echo "Checking if your $make program sets \$(MAKE)..." >&4
21415 case "$make_set_make" in
21417 $sed 's/^X //' > testmake.mak << 'EOF'
21419 X @echo 'maketemp="$(MAKE)"'
21421 case "`$make -f testmake.mak 2>/dev/null`" in
21422 *maketemp=*) make_set_make='#' ;;
21423 *) make_set_make="MAKE=$make" ;;
21425 $rm -f testmake.mak
21428 case "$make_set_make" in
21429 '#') echo "Yup, it does.";;
21430 *) echo "Nope, it doesn't.";;
21433 : see what type is used for mode_t
21434 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21435 set mode_t modetype int stdio.h sys/types.h
21438 : see if we need va_copy
21441 #include <stdarg.h>
21443 #include <stdlib.h>
21444 #include <signal.h>
21447 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21449 return vfprintf(f, fmt, *valp);
21453 myvfprintf(FILE *f, const char *fmt, va_list val)
21455 return ivfprintf(f, fmt, &val);
21459 myprintf(char *fmt, ...)
21462 va_start(val, fmt);
21463 return myvfprintf(stdout, fmt, val);
21467 main(int ac, char **av)
21469 signal(SIGSEGV, exit);
21471 myprintf("%s%cs all right, then\n", "that", '\'');
21476 if eval $compile && $run ./try 2>&1 >/dev/null; then
21477 case "`$run ./try`" in
21478 "that's all right, then")
21484 yes) echo "It seems that you don't need va_copy()." >&4
21485 need_va_copy="$undef"
21487 *) echo "It seems that va_copy() or similar will be needed." >&4
21488 need_va_copy="$define"
21493 : see what type is used for size_t
21494 rp="What is the type used for the length parameter for string functions?"
21495 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21498 : check for type of arguments to gethostbyaddr.
21499 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21500 case "$d_gethbyaddr" in
21504 Checking to see what type of arguments are accepted by gethostbyaddr().
21506 hdrs="$define sys/types.h
21507 $d_socket sys/socket.h
21508 $i_niin netinet/in.h
21510 $i_unistd unistd.h"
21511 : The first arg can 'char *' or 'void *'
21512 : The second arg is some of integral type
21513 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21514 for yyy in size_t long int; do
21515 case "$netdb_host_type" in
21516 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21517 if ./protochk "$try" $hdrs; then
21518 echo "Your system accepts $xxx for the first arg."
21519 echo "...and $yyy for the second arg."
21520 netdb_host_type="$xxx"
21521 netdb_hlen_type="$yyy"
21527 : In case none of those worked, prompt the user.
21528 case "$netdb_host_type" in
21529 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21532 netdb_host_type=$ans
21533 rp='What is the type for the 2nd argument to gethostbyaddr?'
21536 netdb_hlen_type=$ans
21540 *) : no gethostbyaddr, so pick harmless defaults
21541 netdb_host_type='char *'
21542 netdb_hlen_type="$sizetype"
21545 # Remove the "const" if needed. -- but then we'll have a
21547 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21550 : check for type of argument to gethostbyname.
21551 if test "X$netdb_name_type" = X ; then
21552 case "$d_gethbyname" in
21556 Checking to see what type of argument is accepted by gethostbyname().
21558 hdrs="$define sys/types.h
21559 $d_socket sys/socket.h
21560 $i_niin netinet/in.h
21562 $i_unistd unistd.h"
21563 for xxx in "const char *" "char *"; do
21564 case "$netdb_name_type" in
21565 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21566 if ./protochk "$try" $hdrs; then
21567 echo "Your system accepts $xxx."
21568 netdb_name_type="$xxx"
21573 : In case none of those worked, prompt the user.
21574 case "$netdb_name_type" in
21575 '') rp='What is the type for the 1st argument to gethostbyname?'
21578 netdb_name_type=$ans
21582 *) : no gethostbyname, so pick harmless default
21583 netdb_name_type='char *'
21588 : check for type of 1st argument to getnetbyaddr.
21589 if test "X$netdb_net_type" = X ; then
21590 case "$d_getnbyaddr" in
21594 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21596 hdrs="$define sys/types.h
21597 $d_socket sys/socket.h
21598 $i_niin netinet/in.h
21600 $i_unistd unistd.h"
21601 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21602 case "$netdb_net_type" in
21603 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21604 if ./protochk "$try" $hdrs; then
21605 echo "Your system accepts $xxx."
21606 netdb_net_type="$xxx"
21611 : In case none of those worked, prompt the user.
21612 case "$netdb_net_type" in
21613 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21616 netdb_net_type=$ans
21620 *) : no getnetbyaddr, so pick harmless default
21621 netdb_net_type='long'
21625 : locate the preferred pager for this system
21632 [a-zA-Z]:/*) dflt=$pg;;
21636 [a-zA-Z]:/*) dflt=$more;;
21640 [a-zA-Z]:/*) dflt=$less;;
21643 '') dflt=/usr/ucb/more;;
21651 rp='What pager is used on your system?'
21655 : see if ar generates random libraries by itself
21657 echo "Checking how to generate random libraries on your machine..." >&4
21658 echo 'int bar1() { return bar2(); }' > bar1.c
21659 echo 'int bar2() { return 2; }' > bar2.c
21661 #$i_stdlib I_STDLIB
21663 #include <stdlib.h>
21665 int main() { printf("%d\n", bar1()); exit(0); }
21667 $cc $ccflags -c bar1.c >/dev/null 2>&1
21668 $cc $ccflags -c bar2.c >/dev/null 2>&1
21669 $cc $ccflags -c foo.c >/dev/null 2>&1
21670 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21671 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21672 $run ./foobar >/dev/null 2>&1; then
21673 echo "$ar appears to generate random libraries itself."
21675 if [ "X$ranlib" = "X" ]; then
21678 elif $ar s bar$_a >/dev/null 2>&1 &&
21679 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21680 $run ./foobar >/dev/null 2>&1; then
21681 echo "a table of contents needs to be added with '$ar s'."
21684 elif $ar ts bar$_a >/dev/null 2>&1 &&
21685 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21686 $run ./foobar >/dev/null 2>&1; then
21687 echo "a table of contents needs to be added with '$ar ts'."
21694 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21695 $test -f $ranlib || ranlib=''
21698 if $test -n "$ranlib"; then
21699 echo "your system has '$ranlib'; we'll use that."
21702 echo "your system doesn't seem to support random libraries"
21703 echo "so we'll use lorder and tsort to order the libraries."
21710 : Check the max offset that gmtime and localtime accept
21711 echo "Checking max offsets that gmtime () accepts"
21713 case "$sGMTIME_min/$sGMTIME_max" in
21716 #include <sys/types.h>
21724 void gm_check (time_t t, int min_year, int max_year)
21727 if ( tmp == NULL ||
21728 /* Check tm_year overflow */
21729 tmp->tm_year < min_year || tmp->tm_year > max_year)
21740 gm_check (MAXLONG, 69, 0x7fffffff);
21742 if (tmp == NULL || tmp->tm_year < 0) {
21743 for (i = 63; i >= 0; i--) {
21744 time_t x = pt | ((time_t)1 << i);
21745 if (x < 0 || x < pt) continue;
21746 gm_check (x, 69, 0x7fffffff);
21749 printf ("sGMTIME_max=%ld\n", pt);
21758 gm_check (MINLONG, -1900, 70);
21761 for (i = 36; i >= 0; i--) {
21762 time_t x = pt - ((time_t)1 << i);
21763 if (x > 0) continue;
21764 gm_check (x, -1900, 70);
21767 printf ("sGMTIME_min=%ld\n", pt);
21771 int main (int argc, char *argv[])
21773 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21780 if eval $compile; then
21781 eval `$run ./try 2>/dev/null`
21783 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21789 echo "Checking max offsets that localtime () accepts"
21791 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21794 #include <sys/types.h>
21802 void local_check (time_t t, int min_year, int max_year)
21804 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21807 tmp = localtime (&t);
21808 if ( tmp == NULL ||
21809 /* Check tm_year overflow */
21810 tmp->tm_year < min_year || tmp->tm_year > max_year)
21814 } /* local_check */
21821 local_check (MAXLONG, 69, 0x7fffffff);
21823 if (tmp == NULL || tmp->tm_year < 0) {
21824 for (i = 63; i >= 0; i--) {
21825 time_t x = pt | ((time_t)1 << i);
21826 if (x < 0 || x < pt) continue;
21827 local_check (x, 69, 0x7fffffff);
21830 printf ("sLOCALTIME_max=%ld\n", pt);
21839 local_check (MINLONG, -1900, 70);
21842 for (i = 36; i >= 0; i--) {
21843 time_t x = pt - ((time_t)1 << i);
21844 if (x > 0) continue;
21845 local_check (x, -1900, 70);
21848 printf ("sLOCALTIME_min=%ld\n", pt);
21852 int main (int argc, char *argv[])
21860 if eval $compile; then
21861 eval `$run ./try 2>/dev/null`
21863 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21869 : check for type of arguments to select.
21870 case "$selecttype" in
21871 '') case "$d_select" in
21875 Checking to see what type of arguments are accepted by select().
21877 hdrs="$define sys/types.h
21878 $i_systime sys/time.h
21879 $i_sysselct sys/select.h
21880 $d_socket sys/socket.h"
21881 : The first arg can be int, unsigned, or size_t
21882 : The last arg may or may not be 'const'
21884 : void pointer has been seen but using that
21885 : breaks the selectminbits test
21886 for xxx in 'fd_set *' 'int *'; do
21887 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21888 for tmo in 'struct timeval *' 'const struct timeval *'; do
21890 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21891 if ./protochk "$try" $hdrs; then
21892 echo "Your system accepts $xxx."
21901 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21902 case "$d_fd_set" in
21903 $define) dflt="fd_set *" ;;
21912 *) : no select, so pick a harmless default
21919 : check for the select 'width'
21920 case "$selectminbits" in
21921 '') safebits=`expr $ptrsize \* 8`
21922 case "$d_select" in
21926 Checking to see on how many bits at a time your select() operates...
21929 #include <sys/types.h>
21931 #$i_systime I_SYS_TIME
21932 #$i_systimek I_SYS_TIME_KERNEL
21937 # ifdef I_SYS_TIME_KERNEL
21940 # include <sys/time.h>
21941 # ifdef I_SYS_TIME_KERNEL
21945 #$i_sysselct I_SYS_SELECT
21946 #ifdef I_SYS_SELECT
21947 #include <sys/select.h>
21949 #$d_socket HAS_SOCKET
21951 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21954 #$i_stdlib I_STDLIB
21956 #include <stdlib.h>
21959 #define S sizeof(*(b))
21961 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21962 #define NBITS (NBYTES * 8)
21964 char *s = (char *)malloc(NBYTES);
21973 fp = fopen("try.c", "r");
21979 b = ($selecttype)s;
21980 for (i = 0; i < NBITS; i++)
21984 select(fd + 1, b, 0, 0, &t);
21985 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21987 printf("%d\n", i + 1);
21992 if eval $compile_ok; then
21993 selectminbits=`$run ./try 2>/dev/null`
21994 case "$selectminbits" in
21996 Cannot figure out on how many bits at a time your select() operates.
21997 I'll play safe and guess it is $safebits bits.
21999 selectminbits=$safebits
22000 bits="$safebits bits"
22003 *) bits="$selectminbits bits" ;;
22005 echo "Your select() operates on $bits at a time." >&4
22007 rp='What is the minimum number of bits your select() operates on?'
22008 case "$byteorder" in
22009 12345678) dflt=64 ;;
22015 selectminbits="$val"
22019 *) : no select, so pick a harmless default
22020 selectminbits=$safebits
22026 : Trace out the files included by signal.h, then look for SIGxxx names.
22027 case "$sig_num_init" in
22029 if [ "X$fieldn" = X ]; then
22030 : Just make some guesses. We check them later.
22031 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22033 xxx=`echo '#include <signal.h>' |
22034 $cppstdin $cppminus $cppflags 2>/dev/null |
22035 $grep '^[ ]*#.*include' |
22036 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22037 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22040 for xx in $xxx /dev/null ; do
22041 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22043 case "$xxxfiles" in
22044 '') xxxfiles=`./findhdr signal.h` ;;
22047 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22048 print substr($2, 4, 20)
22050 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22051 print substr($3, 4, 20)
22053 : Append some common names just in case the awk scan failed.
22054 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22055 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22056 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22057 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22058 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22060 : generate a few handy files for later
22061 $cat > signal.c <<EOCP
22062 #include <sys/types.h>
22063 #include <signal.h>
22064 #$i_stdlib I_STDLIB
22066 #include <stdlib.h>
22071 /* Strange style to avoid deeply-nested #if/#else/#endif */
22074 # define NSIG (_NSIG)
22080 # define NSIG (SIGMAX+1)
22086 # define NSIG (SIG_MAX+1)
22092 # define NSIG (_SIG_MAX+1)
22098 # define NSIG (MAXSIG+1)
22104 # define NSIG (MAX_SIG+1)
22109 # ifdef SIGARRAYSIZE
22110 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22116 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22120 /* Default to some arbitrary number that's big enough to get most
22121 of the common signals.
22127 printf("NSIG %d\n", NSIG);
22133 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22135 printf "#ifdef SIG"; printf $1; printf "\n"
22136 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22137 printf $1; printf ");\n"
22141 printf "#endif /* JUST_NSIG */\n";
22142 printf "exit(0);\n}\n";
22145 $cat >signal.awk <<'EOP'
22146 BEGIN { ndups = 0 }
22147 $1 ~ /^NSIG$/ { nsig = $2 }
22148 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22149 if ($2 > maxsig) { maxsig = $2 }
22150 if (sig_name[$2]) {
22151 dup_name[ndups] = $1
22152 dup_num[ndups] = $2
22164 printf("NSIG %d\n", nsig);
22165 for (n = 1; n < nsig; n++) {
22167 printf("%s %d\n", sig_name[n], sig_num[n])
22170 printf("NUM%d %d\n", n, n)
22173 for (n = 0; n < ndups; n++) {
22174 printf("%s %d\n", dup_name[n], dup_num[n])
22178 $cat >signal_cmd <<EOS
22180 if $test -s signal.lst; then
22181 echo "Using your existing signal.lst file"
22186 $cat >>signal_cmd <<'EOS'
22189 if eval $compile_ok; then
22190 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22191 $uniq | $awk -f signal.awk >signal.lst
22193 echo "(I can't seem be able to compile the whole test program)" >&4
22194 echo "(I'll try it in little pieces.)" >&4
22195 set signal -DJUST_NSIG
22196 if eval $compile_ok; then
22197 $run ./signal$_exe > signal.nsg
22200 echo "I can't seem to figure out how many signals you have." >&4
22201 echo "Guessing 50." >&4
22202 echo 'NSIG 50' > signal.nsg
22204 : Now look at all the signal names, one at a time.
22205 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22206 $cat > signal.c <<EOCP
22207 #include <sys/types.h>
22208 #include <signal.h>
22211 printf("$xx %d\n", SIG${xx});
22216 if eval $compile; then
22217 echo "SIG${xx} found."
22218 $run ./signal$_exe >> signal.ls1
22220 echo "SIG${xx} NOT found."
22223 if $test -s signal.ls1; then
22224 $cat signal.nsg signal.ls1 |
22225 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22229 if $test -s signal.lst; then
22232 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22233 echo 'kill -l' >signal
22234 set X `csh -f <signal`
22238 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22240 echo $@ | $tr ' ' $trnl | \
22241 $awk '{ printf "%s %d\n", $1, ++s; }
22242 END { printf "NSIG %d\n", ++s }' >signal.lst
22244 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22246 chmod a+x signal_cmd
22247 $eunicefix signal_cmd
22251 : generate list of signal names
22252 case "$sig_num_init" in
22255 case "$sig_name_init" in
22257 *) case "$sig_num_init" in
22258 ''|*,*) doinit=yes ;;
22263 echo "Generating a list of signal names and numbers..." >&4
22265 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22266 sig_name=`$awk 'BEGIN { printf "ZERO " }
22267 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22268 sig_num=`$awk 'BEGIN { printf "0 " }
22269 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22270 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22271 !/^NSIG/ { printf "\"%s\", ", $1 }
22272 END { printf "0\n" }' signal.lst`
22273 sig_num_init=`$awk 'BEGIN { printf "0, " }
22274 !/^NSIG/ { printf "%d, ", $2}
22275 END { printf "0\n"}' signal.lst`
22278 echo "The following $sig_count signals are available:"
22280 echo $sig_name | $awk \
22281 'BEGIN { linelen = 0 }
22283 for (i = 1; i <= NF; i++) {
22284 name = "SIG" $i " "
22285 linelen = linelen + length(name)
22286 if (linelen > 70) {
22288 linelen = length(name)
22294 sig_size=`echo $sig_name | awk '{print NF}'`
22295 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22299 : Check size of size
22301 case "$sizetype" in
22302 *_t) zzz="$sizetype" ;;
22303 *) zzz="filesize" ;;
22305 echo "Checking the size of $zzz..." >&4
22307 #include <sys/types.h>
22309 #$i_stdlib I_STDLIB
22311 #include <stdlib.h>
22314 printf("%d\n", (int)sizeof($sizetype));
22319 if eval $compile_ok; then
22323 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22326 echo "Your $zzz size is $sizesize bytes."
22331 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22334 : check for socklen_t
22336 echo "Checking to see if you have socklen_t..." >&4
22338 #include <sys/types.h>
22339 #$d_socket HAS_SOCKET
22341 #include <sys/socket.h>
22343 int main() { socklen_t x = 16; }
22346 if eval $compile; then
22348 echo "You have socklen_t."
22351 echo "You do not have socklen_t."
22352 case "$sizetype" in
22353 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22360 : see if this is a socks.h system
22361 set socks.h i_socks
22364 : check for type of the size argument to socket calls
22365 case "$d_socket" in
22369 Checking to see what type is the last argument of accept().
22372 case "$d_socklen_t" in
22373 "$define") yyy="$yyy socklen_t"
22375 yyy="$yyy $sizetype int long unsigned"
22376 for xxx in $yyy; do
22377 case "$socksizetype" in
22378 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22379 case "$usesocks" in
22381 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22382 echo "Your system accepts '$xxx *' for the last argument of accept()."
22383 socksizetype="$xxx"
22386 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22387 echo "Your system accepts '$xxx *' for the last argument of accept()."
22388 socksizetype="$xxx"
22395 : In case none of those worked, prompt the user.
22396 case "$socksizetype" in
22397 '') rp='What is the type for socket address structure sizes?'
22404 *) : no sockets, so pick relatively harmless default
22409 : see what type is used for signed size_t
22410 set ssize_t ssizetype int stdio.h sys/types.h
22415 #$i_stdlib I_STDLIB
22417 #include <stdlib.h>
22419 #include <sys/types.h>
22420 #define Size_t $sizetype
22421 #define SSize_t $dflt
22424 if (sizeof(Size_t) == sizeof(SSize_t))
22426 else if (sizeof(Size_t) == sizeof(int))
22435 if eval $compile_ok && $run ./try > /dev/null; then
22436 ssizetype=`$run ./try`
22437 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22440 Help! I can't compile and run the ssize_t test program: please enlighten me!
22441 (This is probably a misconfiguration in your system or libraries, and
22442 you really ought to fix it. Still, I'll try anyway.)
22444 I need a type that is the same size as $sizetype, but is guaranteed to
22445 be signed. Common values are ssize_t, int and long.
22448 rp="What signed type is the same size as $sizetype?"
22454 : Check the size of st_ino
22456 $echo "Checking the size of st_ino..." >&4
22457 $cat > try.c <<EOCP
22458 #include <sys/stat.h>
22460 #$i_stdlib I_STDLIB
22462 #include <stdlib.h>
22466 printf("%d\n", (int)sizeof(st.st_ino));
22471 if eval $compile_ok; then
22475 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22477 *) st_ino_size=$val
22478 $echo "Your st_ino is $st_ino_size bytes long."
22483 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22487 : Check if st_ino is signed
22489 $echo "Checking the sign of st_ino..." >&4
22490 $cat > try.c <<EOCP
22491 #include <sys/stat.h>
22496 if (foo.st_ino < 0)
22503 if eval $compile; then
22507 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22509 *) st_ino_sign=$val
22510 case "$st_ino_sign" in
22511 1) $echo "Your st_ino is unsigned." ;;
22512 -1) $echo "Your st_ino is signed." ;;
22518 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22522 : see what type of char stdio uses.
22524 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22525 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22526 echo "Your stdio uses unsigned chars." >&4
22527 stdchar="unsigned char"
22529 echo "Your stdio uses signed chars." >&4
22534 : Check size of UID
22537 *_t) zzz="$uidtype" ;;
22540 echo "Checking the size of $zzz..." >&4
22542 #include <sys/types.h>
22544 #$i_stdlib I_STDLIB
22546 #include <stdlib.h>
22549 printf("%d\n", (int)sizeof($uidtype));
22554 if eval $compile_ok; then
22558 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22561 echo "Your $zzz is $uidsize bytes long."
22566 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22569 : Check if UID is signed
22572 *_t) zzz="$uidtype" ;;
22575 echo "Checking the sign of $zzz..." >&4
22577 #include <sys/types.h>
22588 if eval $compile; then
22592 echo "(I can't execute the test program--guessing unsigned.)" >&4
22596 1) echo "Your $zzz is unsigned." ;;
22597 -1) echo "Your $zzz is signed." ;;
22603 echo "(I can't compile the test program--guessing unsigned.)" >&4
22606 : Check format string for UID
22608 $echo "Checking the format string to be used for uids..." >&4
22611 -1) if $test X"$uidsize" = X"$ivsize"; then
22612 uidformat="$ivdformat"
22614 if $test X"$uidsize" = X"$longsize"; then
22617 if $test X"$uidsize" = X"$intsize"; then
22620 if $test X"$uidsize" = X"$shortsize"; then
22627 *) if $test X"$uidsize" = X"$uvsize"; then
22628 uidformat="$uvuformat"
22630 if $test X"$uidsize" = X"$longsize"; then
22633 if $test X"$uidsize" = X"$intsize"; then
22636 if $test X"$uidsize" = X"$shortsize"; then
22645 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22647 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22648 $cat >try.c <<'EOM'
22649 /* Intentionally a long probe as I'd like to sanity check that the exact
22650 approach is going to work, as thinking it will work, but only having it
22651 part working at runtime is worse than not having it. */
22653 #include <sys/types.h>
22654 #include <sys/sysctl.h>
22655 #include <sys/param.h>
22657 #include <string.h>
22658 #include <stdlib.h>
22659 #include <unistd.h>
22662 main(int argc, char **argv) {
22664 char *argv_leaf = strrchr(argv[0], '/');
22670 mib[1] = KERN_PROC;
22671 mib[2] = KERN_PROC_PATHNAME;
22675 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22679 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22684 if (size < strlen(argv_leaf) + 1) {
22685 fprintf(stderr, "size %lu is too short for a path\n",
22686 (unsigned long) size);
22690 if (size > MAXPATHLEN * MAXPATHLEN) {
22691 fprintf(stderr, "size %lu is too long for a path\n",
22692 (unsigned long) size);
22696 buffer = (char *)malloc(size);
22702 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22707 if (strlen(buffer) + 1 != size) {
22708 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22709 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22714 if (*buffer != '/') {
22715 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22719 if (strstr(buffer, "/./")) {
22720 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22724 if (strstr(buffer, "/../")) {
22725 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22729 buffer_leaf = strrchr(buffer, '/');
22730 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22731 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22743 if eval $compile; then
22744 if $run ./try; then
22745 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22748 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22752 echo "I'm unable to compile the test program." >&4
22753 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22757 set usekernprocpathname
22760 : Determine if we can use _NSGetExecutablePath to find executing program
22762 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22763 $cat >try.c <<'EOM'
22764 /* Intentionally a long probe as I'd like to sanity check that the exact
22765 approach is going to work, as thinking it will work, but only having it
22766 part working at runtime is worse than not having it. */
22767 #include <mach-o/dyld.h>
22769 #include <stdlib.h>
22770 #include <sys/param.h>
22771 #include <string.h>
22774 main(int argc, char **argv) {
22776 uint32_t size = sizeof(buf);
22780 char *argv_leaf = strrchr(argv[0], '/');
22784 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22788 _NSGetExecutablePath(buf, &size);
22789 if (size > MAXPATHLEN * MAXPATHLEN) {
22790 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22791 (unsigned int) size);
22795 buffer = (char *)malloc(size);
22801 result = _NSGetExecutablePath(buffer, &size);
22803 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22804 result, (unsigned int) size);
22808 tidied = realpath(buffer, NULL);
22810 perror("realpath");
22816 if (*tidied != '/') {
22817 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22821 if (strstr(tidied, "/./")) {
22822 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22826 if (strstr(tidied, "/../")) {
22827 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22831 tidied_leaf = strrchr(tidied, '/');
22832 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22833 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22845 if eval $compile; then
22846 if $run ./try; then
22847 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22850 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22853 echo "I'm unable to compile the test program." >&4
22854 echo "I'll assume no _NSGetExecutablePath here." >&4
22857 set usensgetexecutablepath
22860 : Check if site customization support was requested
22861 case "$usesitecustomize" in
22862 $define|true|[Yy]*)
22863 usesitecustomize="$define"
22866 usesitecustomize="$undef"
22870 : determine compiler compiler
22879 if $test -f "$byacc$_exe"; then
22881 comp="byacc or $comp"
22883 if $test -f "$bison$_exe"; then
22884 comp="$comp or bison -y"
22886 rp="Which compiler compiler ($comp) shall I use?"
22895 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22901 : see if this is a bfd.h system
22905 : see if this is an execinfo.h system
22906 set execinfo.h i_execinfo
22909 : see if this is a fenv.h system
22913 : see if this is a fp.h system
22917 : see if this is a fp_class.h system
22918 set fp_class.h i_fp_class
22921 : see if gdbm.h is available
22926 : see if gdbm_open exists
22927 set gdbm_open d_gdbm_open
22929 case "$d_gdbm_open" in
22932 echo "We won't be including <gdbm.h>"
22941 : see if this is a ieeefp.h system
22942 case "$i_ieeefp" in
22943 '' ) set ieeefp.h i_ieeefp
22948 : see if this is a libutil.h system
22949 set libutil.h i_libutil
22952 : see if mach cthreads are available
22953 if test "X$usethreads" = "X$define"; then
22954 set mach/cthreads.h i_machcthr
22957 i_machcthr="$undef"
22960 : see if this is a mntent.h system
22961 set mntent.h i_mntent
22964 : see if net/errno.h is available
22966 set net/errno.h val
22969 : Unfortunately, it causes problems on some systems. Arrgh.
22972 cat > try.c <<'EOM'
22975 #include <net/errno.h>
22981 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22982 echo "We'll be including <net/errno.h>." >&4
22984 echo "We won't be including <net/errno.h>." >&4
22993 : see if netinet/tcp.h is available
22994 set netinet/tcp.h i_netinettcp
22997 : see if this is a poll.h system
23001 : see if this is a prot.h system
23005 : Preprocessor symbols
23007 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23008 $cat <<'EOSH' > Cppsym.know
23009 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23010 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23011 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23012 arch_pwr ardent ARM ARM32 atarist att386 att3b
23013 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23014 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23015 byteorder byte_order
23016 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23017 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23018 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23019 ELF encore EPI EXTENSIONS
23020 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23021 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23022 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23023 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23024 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
23025 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23026 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23027 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23028 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23030 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23031 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23032 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23034 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23035 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23036 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23037 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23038 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23039 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23040 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23041 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23042 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23043 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23044 ns32000 ns32016 ns32332 ns32k nsc32000
23045 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23046 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23047 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23048 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23050 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23051 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23052 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23053 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23054 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23055 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23056 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23057 SYSV4 SYSV5 sysV68 sysV88
23058 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23059 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23060 tower32_800 tower32_850 tss
23061 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23062 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23063 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23064 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23065 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23066 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23068 vax venix VMESA vms
23069 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23070 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23073 # Maybe put other stuff here too.
23074 ./tr '-' '_' <<EOSH >>Cppsym.know
23077 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23078 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23079 $cat Cppsym.know > Cppsym.c
23080 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23081 $rm -f Cppsym.a Cppsym.b Cppsym.c
23082 cat <<EOSH > Cppsym
23084 if $test \$# -gt 0; then
23085 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23086 if $test -s Cppsym.got; then
23093 $tr " " "$trnl" | ./Cppsym.try
23099 cat <<EOSH > Cppsym.try
23101 cat <<'EOCP' > try.c
23104 #define STRINGIFY(a) "a"
23106 #if cpp_stuff == 42
23107 #define StGiFy(a) #a
23108 #define STRINGIFY(a) StGiFy(a)
23110 #if $cpp_stuff != 1 && $cpp_stuff != 42
23111 # include "Bletch: How does this C preprocessor stringify macros?"
23117 cat <<'EOSH' >> Cppsym.try
23119 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23120 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23121 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23122 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23124 echo 'return 0;}' >> try.c
23126 cat <<EOSH >> Cppsym.try
23128 case "$osname-$gccversion" in
23129 irix-) ccflags="\$ccflags -woff 1178" ;;
23130 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23132 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23134 chmod +x Cppsym.try
23135 $eunicefix Cppsym.try
23136 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23137 : Add in any Linux cpp "predefined macros":
23138 case "$osname::$gccversion" in
23139 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23141 rm -f $tHdrH'.h' $tHdrH
23143 # Filter out macro arguments, such as Linux's __INT8_C(c)
23144 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23145 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23146 if [ -s $tHdrH'_cppsym.real' ]; then
23147 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23150 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23153 : now check the C compiler for additional symbols
23154 postprocess_cc_v=''
23156 aix) postprocess_cc_v="|$tr , ' '" ;;
23163 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23166 -D*) echo "\$i" | $sed 's/^-D//';;
23167 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23172 postprocess_cc_v=''
23175 ./ccsym > ccsym1.raw
23176 if $test -s ccsym1.raw; then
23177 $sort ccsym1.raw | $uniq >ccsym.raw
23179 mv ccsym1.raw ccsym.raw
23182 $awk '/\=/ { print $0; next }
23183 { print $0"=1" }' ccsym.raw >ccsym.list
23184 $comm -13 Cppsym.true ccsym.list >ccsym.own
23185 $comm -12 Cppsym.true ccsym.list >ccsym.com
23186 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23188 if $test -z ccsym.raw; then
23189 echo "Your C compiler doesn't seem to define any symbols!" >&4
23191 echo "However, your C preprocessor defines the following symbols:"
23194 cppsymbols=`$cat Cppsym.true`
23195 cppsymbols=`echo $cppsymbols`
23196 cppccsymbols="$cppsymbols"
23198 if $test -s ccsym.com; then
23199 echo "Your C compiler and pre-processor define these symbols:"
23200 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23203 cppccsymbols=`$cat ccsym.com`
23204 cppccsymbols=`echo $cppccsymbols`
23205 $test "$silent" || sleep 1
23207 if $test -s ccsym.cpp; then
23208 $test "$also" && echo " "
23209 echo "Your C pre-processor ${also}defines the following symbols:"
23210 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23212 cppsymbols=`$cat ccsym.cpp`
23213 cppsymbols=`echo $cppsymbols`
23214 $test "$silent" || sleep 1
23216 if $test -s ccsym.own; then
23217 $test "$also" && echo " "
23218 echo "Your C compiler ${also}defines the following cpp symbols:"
23219 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23220 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23221 ccsymbols=`$cat ccsym.own`
23222 ccsymbols=`echo $ccsymbols`
23223 $test "$silent" || sleep 1
23227 : add -D_FORTIFY_SOURCE if feasible and not already there
23228 case "$gccversion" in
23229 [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
23230 *-O*) case "$ccflags$cppsymbols" in
23231 *_FORTIFY_SOURCE=*) # Don't add it again.
23232 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23234 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23235 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23239 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23243 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23247 : script used to emit important warnings
23250 if test \$# -gt 0; then
23255 echo "*** WARNING:" >&4
23256 sed -e 's/^/*** /' <msg >&4
23258 cat msg >>config.msg
23259 echo " " >>config.msg
23265 : see if this is a termio system
23269 if $test `./findhdr termios.h`; then
23270 set tcsetattr i_termios
23276 "$define") echo "You have POSIX termios.h... good!" >&4;;
23277 *) if ./Cppsym pyr; then
23278 case "`$run /bin/universe`" in
23279 ucb) if $test `./findhdr sgtty.h`; then
23281 echo "<sgtty.h> found." >&4
23283 echo "System is pyramid with BSD universe."
23284 ./warn "<sgtty.h> not found--you could have problems."
23286 *) if $test `./findhdr termio.h`; then
23288 echo "<termio.h> found." >&4
23290 echo "System is pyramid with USG universe."
23291 ./warn "<termio.h> not found--you could have problems."
23295 if $test `./findhdr termio.h`; then
23296 echo "<termio.h> found." >&4
23298 elif $test `./findhdr sgtty.h`; then
23299 echo "<sgtty.h> found." >&4
23302 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23305 if $test `./findhdr sgtty.h`; then
23306 echo "<sgtty.h> found." >&4
23308 elif $test `./findhdr termio.h`; then
23309 echo "<termio.h> found." >&4
23312 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23316 set i_termio; eval $setvar
23317 val=$val2; set i_sgtty; eval $setvar
23318 val=$val3; set i_termios; eval $setvar
23320 : see if stdbool is available
23321 : we want a real compile instead of Inhdr because some Solaris systems
23322 : have stdbool.h, but it can only be used if the compiler indicates it
23323 : is sufficiently c99-compliant.
23327 #include <stdbool.h>
23332 int main(int argc, char **argv)
23338 if eval $compile; then
23339 echo "<stdbool.h> found." >&4
23342 echo "<stdbool.h> NOT found." >&4
23349 : see if stdint is available
23350 set stdint.h i_stdint
23353 : see if sys/access.h is available
23354 set sys/access.h i_sysaccess
23357 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23358 set sys/filio.h i_sysfilio
23361 if $test `./findhdr sys/ioctl.h`; then
23363 echo '<sys/ioctl.h> found.' >&4
23366 if $test $i_sysfilio = "$define"; then
23367 echo '<sys/ioctl.h> NOT found.' >&4
23369 $test $i_sgtty = "$define" && xxx="sgtty.h"
23370 $test $i_termio = "$define" && xxx="termio.h"
23371 $test $i_termios = "$define" && xxx="termios.h"
23372 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23378 : see if socket ioctl defs are in sys/sockio.h
23380 xxx=`./findhdr sys/sockio.h`
23381 if $test "$xxx"; then
23382 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23384 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23387 echo "No socket ioctls found in <sys/sockio.h>." >&4
23392 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23398 : see if this is a syslog.h system
23399 set syslog.h i_syslog
23402 : see if this is a sys/mode.h system
23403 set sys/mode.h i_sysmode
23406 : see if there is a sys/poll.h file
23407 set sys/poll.h i_syspoll
23410 : see if sys/resource.h has to be included
23411 set sys/resource.h i_sysresrc
23414 : see if sys/security.h is available
23415 set sys/security.h i_syssecrt
23418 : see if this is a sys/statvfs.h system
23419 set sys/statvfs.h i_sysstatvfs
23422 : see if this is a sys/un.h system
23423 set sys/un.h i_sysun
23426 : see if this is a sys/utsname.h system
23427 set sys/utsname.h i_sysutsname
23430 : see if this is a syswait system
23431 set sys/wait.h i_syswait
23434 : see if this is a ustat.h system
23435 set ustat.h i_ustat
23438 : see if this is an utime system
23439 set utime.h i_utime
23442 : see if this is a vfork system
23445 set vfork.h i_vfork
23453 : see if wchar.h is present
23454 set wchar.h i_wchar
23459 echo "Looking for extensions..." >&4
23460 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23461 : contain old or inaccurate or duplicate values.
23462 nonxs_extensions=''
23464 : We do not use find because it might not be available.
23465 : We do not just use MANIFEST because the user may have dropped
23466 : some additional extensions into the source tree and expect them
23469 : Function to recursively find available extensions, ignoring DynaLoader
23470 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23471 : In 5.10.1 and later, extensions are stored in directories
23472 : like File-Glob instead of the older File/Glob/.
23476 DynaLoader|dynaload) ;;
23478 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23479 case "$this_ext" in
23480 Scalar/List/Utils) this_ext="List/Util" ;;
23481 PathTools) this_ext="Cwd" ;;
23483 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23484 if $contains " $this_ext " "$tdir/$$.tmp"; then
23486 echo "Duplicate directories detected for extension $xxx" >&4;
23487 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23488 case "$knowitall" in
23496 echo "Ok. Stopping Configure." >&4;
23497 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23500 echo "Ok. You will need to correct config.sh before running make." >&4;
23502 $ls -1 "$xxx" > "$tdir/$$.tmp";
23503 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23504 xs_extensions="$xs_extensions $this_ext";
23505 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23506 xs_extensions="$xs_extensions $this_ext";
23507 elif $test -d "$xxx"; then
23508 nonxs_extensions="$nonxs_extensions $this_ext";
23510 $rm -f "$tdir/$$.tmp";
23518 eval $find_extensions
23522 eval $find_extensions
23526 eval $find_extensions
23527 set X $xs_extensions
23529 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23530 set X $nonxs_extensions
23532 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23534 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23536 : Now see which are supported on this system.
23538 for xxx in $xs_extensions ; do
23542 amigaos) avail_ext="$avail_ext $xxx" ;;
23547 $define) avail_ext="$avail_ext $xxx" ;;
23550 GDBM_File|gdbm_fil)
23552 $define) avail_ext="$avail_ext $xxx" ;;
23556 : XXX Do we need a useipcsysv variable here
23557 case "${d_msg}${d_sem}${d_shm}" in
23558 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23561 NDBM_File|ndbm_fil)
23564 case "$osname-$use64bitint" in
23567 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23570 *) avail_ext="$avail_ext $xxx" ;;
23575 ODBM_File|odbm_fil)
23576 case "${i_dbm}${i_rpcsvcdbm}" in
23578 case "$d_cplusplus" in
23579 define) ;; # delete as a function name will not work
23580 *) case "$osname-$use64bitint" in
23583 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23586 *) avail_ext="$avail_ext $xxx" ;;
23594 case "$useopcode" in
23595 true|define|y) avail_ext="$avail_ext $xxx" ;;
23599 case "$useposix" in
23600 true|define|y) avail_ext="$avail_ext $xxx" ;;
23604 case "$d_socket" in
23605 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23608 I18N/Langinfo|langinfo)
23609 case "$uselanginfo" in
23610 true|define|y) avail_ext="$avail_ext $xxx" ;;
23613 Sys/Syslog|sys/syslog)
23615 amigaos) ;; # not really very useful on AmigaOS
23617 : XXX syslog requires socket
23618 case "$d_socket" in
23619 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23625 case "$usethreads" in
23627 case "$use5005threads" in
23628 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23632 threads|threads/shared)
23633 # threads and threads::shared are special cases.
23634 # To stop people from asking "Perl 5.8.0 was supposed
23635 # to have this new fancy threads implementation but my
23636 # perl doesn't have it" and from people trying to
23637 # (re)install the threads module using CPAN.pm and
23638 # CPAN.pm then offering to reinstall Perl 5.8.0,
23639 # the threads.pm and threads/shared.pm will always be
23640 # there, croaking informatively ("you need to rebuild
23641 # all of Perl with threads, sorry") when threads haven't
23642 # been compiled in.
23644 avail_ext="$avail_ext $xxx"
23650 cygwin) avail_ext="$avail_ext $xxx" ;;
23653 XS/APItest|xs/apitest)
23654 # This is just for testing. Skip it unless we have dynamic loading.
23657 $define) avail_ext="$avail_ext $xxx" ;;
23660 XS/Typemap|xs/typemap)
23661 # This is just for testing. Skip it unless we have dynamic loading.
23663 $define) avail_ext="$avail_ext $xxx" ;;
23666 *) avail_ext="$avail_ext $xxx"
23675 case "$onlyextensions" in
23677 *) keepextensions=''
23678 echo "You have requested that only certain extensions be included..." >&4
23679 for i in $onlyextensions; do
23680 case " $avail_ext " in
23682 echo "Keeping extension $i."
23683 keepextensions="$keepextensions $i"
23685 *) echo "Ignoring extension $i." ;;
23688 avail_ext="$keepextensions"
23692 case "$noextensions" in
23694 *) keepextensions=''
23695 echo "You have requested that certain extensions be ignored..." >&4
23696 for i in $avail_ext; do
23697 case " $noextensions " in
23698 *" $i "*) echo "Ignoring extension $i." ;;
23699 *) echo "Keeping extension $i.";
23700 keepextensions="$keepextensions $i"
23704 avail_ext="$keepextensions"
23708 : Now see which nonxs extensions are supported on this system.
23709 : For now assume all are.
23711 for xxx in $nonxs_extensions ; do
23715 *) nonxs_ext="$nonxs_ext $xxx"
23727 A number of extensions are supplied with $package. You may choose to
23728 compile these extensions for dynamic loading (the default), compile
23729 them into the $package executable (static loading), or not include
23730 them at all. Answer "none" to include no extensions.
23731 Note that DynaLoader is always built and need not be mentioned here.
23734 case "$dynamic_ext" in
23736 : Exclude those listed in static_ext
23738 for xxx in $avail_ext; do
23739 case " $static_ext " in
23741 *) dflt="$dflt $xxx" ;;
23748 *) dflt="$dynamic_ext"
23749 # Perhaps we are reusing an old out-of-date config.sh.
23752 if test X"$dynamic_ext" != X"$avail_ext"; then
23754 NOTICE: Your previous config.sh list may be incorrect.
23755 The extensions now available to you are
23757 but the default list from your previous config.sh is
23769 rp="What extensions do you wish to load dynamically?"
23772 none) dynamic_ext=' ' ;;
23773 *) dynamic_ext="$ans" ;;
23776 case "$static_ext" in
23778 : Exclude those already listed in dynamic linking
23780 for xxx in $avail_ext; do
23781 case " $dynamic_ext " in
23783 *) dflt="$dflt $xxx" ;;
23790 *) dflt="$static_ext"
23797 rp="What extensions do you wish to load statically?"
23800 none) static_ext=' ' ;;
23801 *) static_ext="$ans" ;;
23806 A number of extensions are supplied with $package. Answer "none"
23807 to include no extensions.
23808 Note that DynaLoader is always built and need not be mentioned here.
23811 case "$static_ext" in
23812 '') dflt="$avail_ext" ;;
23813 *) dflt="$static_ext"
23814 # Perhaps we are reusing an old out-of-date config.sh.
23817 if test X"$static_ext" != X"$avail_ext"; then
23819 NOTICE: Your previous config.sh list may be incorrect.
23820 The extensions now available to you are
23822 but the default list from your previous config.sh is
23831 : Exclude those that are not xs extensions
23835 rp="What extensions do you wish to include?"
23838 none) static_ext=' ' ;;
23839 *) static_ext="$ans" ;;
23844 # Encode is a special case. If we are building Encode as a static
23845 # extension, we need to explicitly list its subextensions as well.
23846 # For other nested extensions, this is handled automatically by
23847 # the appropriate Makefile.PL.
23848 case " $static_ext " in
23849 *" Encode "*) # Add the subextensions of Encode
23851 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23852 static_ext="$static_ext Encode/$xxx"
23853 known_extensions="$known_extensions Encode/$xxx"
23859 set X $dynamic_ext $static_ext $nonxs_ext
23863 # Sanity check: We require an extension suitable for use with
23864 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23865 # should show up as failures in the test suite, but it's helpful to
23866 # catch them now.) The 'extensions' list is normally sorted
23867 # alphabetically, so we need to accept either
23868 # DB_File ... Fcntl ... IO ....
23869 # or something like
23870 # Fcntl ... NDBM_File ... IO ....
23871 case " $extensions" in
23872 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23873 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23874 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23875 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23876 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23880 : Remove libraries needed only for extensions
23881 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23882 : The exception is SunOS 4.x, which needs them.
23883 case "${osname}X${osvers}" in
23887 *) case "$usedl" in
23888 $define|true|[yY]*)
23889 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23893 *) perllibs="$libs"
23899 : Remove build directory name from cppstdin so it can be used from
23900 : either the present location or the final installed location.
23902 : Get out of the UU directory to get correct path name.
23904 case "$cppstdin" in
23906 echo "Stripping down cppstdin path name"
23912 : end of configuration questions
23914 echo "End of configuration questions."
23917 : back to where it started
23918 if test -d ../UU; then
23922 : configuration may be unconditionally patched via a 'config.arch' file
23923 if $test -f config.arch; then
23924 echo "I see a config.arch file, loading it." >&4
23928 : configuration may be patched via a 'config.over' file
23929 if $test -f config.over; then
23932 rp='I see a config.over file. Do you wish to load it?'
23935 n*) echo "OK, I'll ignore it.";;
23937 echo "Configuration override changes have been loaded."
23942 : in case they want portability, strip down executable paths
23943 case "$d_portable" in
23946 echo "Stripping down executable paths..." >&4
23947 for file in $loclist $trylist; do
23949 eval $file=`basename $temp`
23954 : create config.sh file
23956 echo "Creating config.sh..." >&4
23957 $spitshell <<EOT >config.sh
23960 # This file was produced by running the Configure script. It holds all the
23961 # definitions figured out by Configure. Should you modify one of these values,
23962 # do not forget to propagate your changes by running "Configure -der". You may
23963 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23966 # Package name : $package
23967 # Source directory : $src
23968 # Configuration time: $cf_time
23969 # Configured by : $cf_by
23970 # Target system : $myuname
23973 : Add in command line options if available
23974 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23976 $spitshell <<EOT >>config.sh
23985 Revision='$Revision'
23993 alignbytes='$alignbytes'
23994 aphostname='$aphostname'
23995 api_revision='$api_revision'
23996 api_subversion='$api_subversion'
23997 api_version='$api_version'
23998 api_versionstring='$api_versionstring'
24001 archlibexp='$archlibexp'
24002 archname64='$archname64'
24003 archname='$archname'
24004 archobjs='$archobjs'
24005 asctime_r_proto='$asctime_r_proto'
24014 byteorder='$byteorder'
24016 castflags='$castflags'
24019 cccdlflags='$cccdlflags'
24020 ccdlflags='$ccdlflags'
24022 ccflags_uselargefiles='$ccflags_uselargefiles'
24024 ccsymbols='$ccsymbols'
24025 ccversion='$ccversion'
24027 cf_email='$cf_email'
24029 charbits='$charbits'
24030 charsize='$charsize'
24034 clocktype='$clocktype'
24036 compress='$compress'
24037 contains='$contains'
24041 cpp_stuff='$cpp_stuff'
24042 cppccsymbols='$cppccsymbols'
24043 cppflags='$cppflags'
24045 cppminus='$cppminus'
24047 cppstdin='$cppstdin'
24048 cppsymbols='$cppsymbols'
24049 crypt_r_proto='$crypt_r_proto'
24050 cryptlib='$cryptlib'
24052 ctermid_r_proto='$ctermid_r_proto'
24053 ctime_r_proto='$ctime_r_proto'
24054 d_Gconvert='$d_Gconvert'
24055 d_PRIEUldbl='$d_PRIEUldbl'
24056 d_PRIFUldbl='$d_PRIFUldbl'
24057 d_PRIGUldbl='$d_PRIGUldbl'
24058 d_PRIXU64='$d_PRIXU64'
24059 d_PRId64='$d_PRId64'
24060 d_PRIeldbl='$d_PRIeldbl'
24061 d_PRIfldbl='$d_PRIfldbl'
24062 d_PRIgldbl='$d_PRIgldbl'
24063 d_PRIi64='$d_PRIi64'
24064 d_PRIo64='$d_PRIo64'
24065 d_PRIu64='$d_PRIu64'
24066 d_PRIx64='$d_PRIx64'
24067 d_SCNfldbl='$d_SCNfldbl'
24068 d__fwalk='$d__fwalk'
24069 d_accept4='$d_accept4'
24070 d_access='$d_access'
24071 d_accessx='$d_accessx'
24075 d_archlib='$d_archlib'
24076 d_asctime64='$d_asctime64'
24077 d_asctime_r='$d_asctime_r'
24082 d_attribute_always_inline='$d_attribute_always_inline'
24083 d_attribute_deprecated='$d_attribute_deprecated'
24084 d_attribute_format='$d_attribute_format'
24085 d_attribute_malloc='$d_attribute_malloc'
24086 d_attribute_nonnull='$d_attribute_nonnull'
24087 d_attribute_noreturn='$d_attribute_noreturn'
24088 d_attribute_pure='$d_attribute_pure'
24089 d_attribute_unused='$d_attribute_unused'
24090 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24091 d_backtrace='$d_backtrace'
24093 d_bsdgetpgrp='$d_bsdgetpgrp'
24094 d_bsdsetpgrp='$d_bsdsetpgrp'
24095 d_builtin_add_overflow='$d_builtin_add_overflow'
24096 d_builtin_choose_expr='$d_builtin_choose_expr'
24097 d_builtin_expect='$d_builtin_expect'
24098 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24099 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24100 d_c99_variadic_macros='$d_c99_variadic_macros'
24101 d_casti32='$d_casti32'
24102 d_castneg='$d_castneg'
24105 d_chroot='$d_chroot'
24106 d_chsize='$d_chsize'
24108 d_clearenv='$d_clearenv'
24109 d_closedir='$d_closedir'
24110 d_cmsghdr_s='$d_cmsghdr_s'
24111 d_copysign='$d_copysign'
24112 d_copysignl='$d_copysignl'
24113 d_cplusplus='$d_cplusplus'
24115 d_crypt_r='$d_crypt_r'
24117 d_ctermid='$d_ctermid'
24118 d_ctermid_r='$d_ctermid_r'
24119 d_ctime64='$d_ctime64'
24120 d_ctime_r='$d_ctime_r'
24121 d_cuserid='$d_cuserid'
24122 d_dbminitproto='$d_dbminitproto'
24123 d_difftime64='$d_difftime64'
24124 d_difftime='$d_difftime'
24125 d_dir_dd_fd='$d_dir_dd_fd'
24127 d_dirnamlen='$d_dirnamlen'
24128 d_dladdr='$d_dladdr'
24129 d_dlerror='$d_dlerror'
24130 d_dlopen='$d_dlopen'
24131 d_dlsymun='$d_dlsymun'
24132 d_dosuid='$d_dosuid'
24133 d_double_has_inf='$d_double_has_inf'
24134 d_double_has_nan='$d_double_has_nan'
24135 d_double_has_negative_zero='$d_double_has_negative_zero'
24136 d_double_has_subnormals='$d_double_has_subnormals'
24137 d_double_style_cray='$d_double_style_cray'
24138 d_double_style_ibm='$d_double_style_ibm'
24139 d_double_style_ieee='$d_double_style_ieee'
24140 d_double_style_vax='$d_double_style_vax'
24141 d_drand48_r='$d_drand48_r'
24142 d_drand48proto='$d_drand48proto'
24145 d_duplocale='$d_duplocale'
24146 d_eaccess='$d_eaccess'
24147 d_endgrent='$d_endgrent'
24148 d_endgrent_r='$d_endgrent_r'
24149 d_endhent='$d_endhent'
24150 d_endhostent_r='$d_endhostent_r'
24151 d_endnent='$d_endnent'
24152 d_endnetent_r='$d_endnetent_r'
24153 d_endpent='$d_endpent'
24154 d_endprotoent_r='$d_endprotoent_r'
24155 d_endpwent='$d_endpwent'
24156 d_endpwent_r='$d_endpwent_r'
24157 d_endsent='$d_endsent'
24158 d_endservent_r='$d_endservent_r'
24159 d_eofnblk='$d_eofnblk'
24162 d_eunice='$d_eunice'
24165 d_faststdio='$d_faststdio'
24166 d_fchdir='$d_fchdir'
24167 d_fchmod='$d_fchmod'
24168 d_fchmodat='$d_fchmodat'
24169 d_fchown='$d_fchown'
24171 d_fcntl_can_lock='$d_fcntl_can_lock'
24172 d_fd_macros='$d_fd_macros'
24173 d_fd_set='$d_fd_set'
24174 d_fdclose='$d_fdclose'
24176 d_fds_bits='$d_fds_bits'
24177 d_fegetround='$d_fegetround'
24178 d_fgetpos='$d_fgetpos'
24179 d_finite='$d_finite'
24180 d_finitel='$d_finitel'
24181 d_flexfnam='$d_flexfnam'
24183 d_flockproto='$d_flockproto'
24188 d_fp_class='$d_fp_class'
24189 d_fp_classify='$d_fp_classify'
24190 d_fp_classl='$d_fp_classl'
24191 d_fpathconf='$d_fpathconf'
24192 d_fpclass='$d_fpclass'
24193 d_fpclassify='$d_fpclassify'
24194 d_fpclassl='$d_fpclassl'
24195 d_fpgetround='$d_fpgetround'
24196 d_fpos64_t='$d_fpos64_t'
24197 d_freelocale='$d_freelocale'
24198 d_frexpl='$d_frexpl'
24199 d_fs_data_s='$d_fs_data_s'
24200 d_fseeko='$d_fseeko'
24201 d_fsetpos='$d_fsetpos'
24202 d_fstatfs='$d_fstatfs'
24203 d_fstatvfs='$d_fstatvfs'
24205 d_ftello='$d_ftello'
24207 d_futimes='$d_futimes'
24208 d_gai_strerror='$d_gai_strerror'
24209 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24210 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24211 d_getaddrinfo='$d_getaddrinfo'
24212 d_getcwd='$d_getcwd'
24213 d_getespwnam='$d_getespwnam'
24214 d_getfsstat='$d_getfsstat'
24215 d_getgrent='$d_getgrent'
24216 d_getgrent_r='$d_getgrent_r'
24217 d_getgrgid_r='$d_getgrgid_r'
24218 d_getgrnam_r='$d_getgrnam_r'
24219 d_getgrps='$d_getgrps'
24220 d_gethbyaddr='$d_gethbyaddr'
24221 d_gethbyname='$d_gethbyname'
24222 d_gethent='$d_gethent'
24223 d_gethname='$d_gethname'
24224 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24225 d_gethostbyname_r='$d_gethostbyname_r'
24226 d_gethostent_r='$d_gethostent_r'
24227 d_gethostprotos='$d_gethostprotos'
24228 d_getitimer='$d_getitimer'
24229 d_getlogin='$d_getlogin'
24230 d_getlogin_r='$d_getlogin_r'
24231 d_getmnt='$d_getmnt'
24232 d_getmntent='$d_getmntent'
24233 d_getnameinfo='$d_getnameinfo'
24234 d_getnbyaddr='$d_getnbyaddr'
24235 d_getnbyname='$d_getnbyname'
24236 d_getnent='$d_getnent'
24237 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24238 d_getnetbyname_r='$d_getnetbyname_r'
24239 d_getnetent_r='$d_getnetent_r'
24240 d_getnetprotos='$d_getnetprotos'
24241 d_getpagsz='$d_getpagsz'
24242 d_getpbyname='$d_getpbyname'
24243 d_getpbynumber='$d_getpbynumber'
24244 d_getpent='$d_getpent'
24245 d_getpgid='$d_getpgid'
24246 d_getpgrp2='$d_getpgrp2'
24247 d_getpgrp='$d_getpgrp'
24248 d_getppid='$d_getppid'
24249 d_getprior='$d_getprior'
24250 d_getprotobyname_r='$d_getprotobyname_r'
24251 d_getprotobynumber_r='$d_getprotobynumber_r'
24252 d_getprotoent_r='$d_getprotoent_r'
24253 d_getprotoprotos='$d_getprotoprotos'
24254 d_getprpwnam='$d_getprpwnam'
24255 d_getpwent='$d_getpwent'
24256 d_getpwent_r='$d_getpwent_r'
24257 d_getpwnam_r='$d_getpwnam_r'
24258 d_getpwuid_r='$d_getpwuid_r'
24259 d_getsbyname='$d_getsbyname'
24260 d_getsbyport='$d_getsbyport'
24261 d_getsent='$d_getsent'
24262 d_getservbyname_r='$d_getservbyname_r'
24263 d_getservbyport_r='$d_getservbyport_r'
24264 d_getservent_r='$d_getservent_r'
24265 d_getservprotos='$d_getservprotos'
24266 d_getspnam='$d_getspnam'
24267 d_getspnam_r='$d_getspnam_r'
24268 d_gettimeod='$d_gettimeod'
24269 d_gmtime64='$d_gmtime64'
24270 d_gmtime_r='$d_gmtime_r'
24271 d_gnulibc='$d_gnulibc'
24272 d_grpasswd='$d_grpasswd'
24273 d_has_C_UTF8='$d_has_C_UTF8'
24274 d_hasmntopt='$d_hasmntopt'
24278 d_ilogbl='$d_ilogbl'
24279 d_inc_version_list='$d_inc_version_list'
24280 d_inetaton='$d_inetaton'
24281 d_inetntop='$d_inetntop'
24282 d_inetpton='$d_inetpton'
24283 d_int64_t='$d_int64_t'
24284 d_ip_mreq='$d_ip_mreq'
24285 d_ip_mreq_source='$d_ip_mreq_source'
24286 d_ipv6_mreq='$d_ipv6_mreq'
24287 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24288 d_isascii='$d_isascii'
24289 d_isblank='$d_isblank'
24290 d_isfinite='$d_isfinite'
24291 d_isfinitel='$d_isfinitel'
24293 d_isinfl='$d_isinfl'
24294 d_isless='$d_isless'
24296 d_isnanl='$d_isnanl'
24297 d_isnormal='$d_isnormal'
24300 d_killpg='$d_killpg'
24301 d_lc_monetary_2008='$d_lc_monetary_2008'
24302 d_lchown='$d_lchown'
24303 d_ldbl_dig='$d_ldbl_dig'
24304 d_ldexpl='$d_ldexpl'
24305 d_lgamma='$d_lgamma'
24306 d_lgamma_r='$d_lgamma_r'
24307 d_libm_lib_version='$d_libm_lib_version'
24308 d_libname_unique='$d_libname_unique'
24310 d_linkat='$d_linkat'
24311 d_llrint='$d_llrint'
24312 d_llrintl='$d_llrintl'
24313 d_llround='$d_llround'
24314 d_llroundl='$d_llroundl'
24315 d_localeconv_l='$d_localeconv_l'
24316 d_localtime64='$d_localtime64'
24317 d_localtime_r='$d_localtime_r'
24318 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24319 d_locconv='$d_locconv'
24324 d_long_double_style_ieee='$d_long_double_style_ieee'
24325 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24326 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24327 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24328 d_long_double_style_vax='$d_long_double_style_vax'
24329 d_longdbl='$d_longdbl'
24330 d_longlong='$d_longlong'
24332 d_lrintl='$d_lrintl'
24333 d_lround='$d_lround'
24334 d_lroundl='$d_lroundl'
24335 d_lseekproto='$d_lseekproto'
24337 d_madvise='$d_madvise'
24338 d_malloc_good_size='$d_malloc_good_size'
24339 d_malloc_size='$d_malloc_size'
24340 d_malloc_usable_size='$d_malloc_usable_size'
24342 d_mbrlen='$d_mbrlen'
24343 d_mbrtowc='$d_mbrtowc'
24344 d_mbstowcs='$d_mbstowcs'
24345 d_mbtowc='$d_mbtowc'
24346 d_memmem='$d_memmem'
24347 d_memrchr='$d_memrchr'
24349 d_mkdtemp='$d_mkdtemp'
24350 d_mkfifo='$d_mkfifo'
24351 d_mkostemp='$d_mkostemp'
24352 d_mkstemp='$d_mkstemp'
24353 d_mkstemps='$d_mkstemps'
24354 d_mktime64='$d_mktime64'
24355 d_mktime='$d_mktime'
24358 d_modflproto='$d_modflproto'
24359 d_mprotect='$d_mprotect'
24361 d_msg_ctrunc='$d_msg_ctrunc'
24362 d_msg_dontroute='$d_msg_dontroute'
24363 d_msg_oob='$d_msg_oob'
24364 d_msg_peek='$d_msg_peek'
24365 d_msg_proxy='$d_msg_proxy'
24366 d_msgctl='$d_msgctl'
24367 d_msgget='$d_msgget'
24368 d_msghdr_s='$d_msghdr_s'
24369 d_msgrcv='$d_msgrcv'
24370 d_msgsnd='$d_msgsnd'
24372 d_munmap='$d_munmap'
24373 d_mymalloc='$d_mymalloc'
24375 d_nanosleep='$d_nanosleep'
24377 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24378 d_nearbyint='$d_nearbyint'
24379 d_newlocale='$d_newlocale'
24380 d_nextafter='$d_nextafter'
24381 d_nexttoward='$d_nexttoward'
24383 d_nl_langinfo='$d_nl_langinfo'
24384 d_nv_preserves_uv='$d_nv_preserves_uv'
24385 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24386 d_off64_t='$d_off64_t'
24387 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24388 d_oldpthreads='$d_oldpthreads'
24389 d_oldsock='$d_oldsock'
24391 d_openat='$d_openat'
24392 d_pathconf='$d_pathconf'
24394 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24395 d_phostname='$d_phostname'
24399 d_portable='$d_portable'
24401 d_prctl_set_name='$d_prctl_set_name'
24402 d_printf_format_null='$d_printf_format_null'
24403 d_procselfexe='$d_procselfexe'
24404 d_pseudofork='$d_pseudofork'
24405 d_pthread_atfork='$d_pthread_atfork'
24406 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24407 d_pthread_yield='$d_pthread_yield'
24408 d_ptrdiff_t='$d_ptrdiff_t'
24410 d_pwchange='$d_pwchange'
24411 d_pwclass='$d_pwclass'
24412 d_pwcomment='$d_pwcomment'
24413 d_pwexpire='$d_pwexpire'
24414 d_pwgecos='$d_pwgecos'
24415 d_pwpasswd='$d_pwpasswd'
24416 d_pwquota='$d_pwquota'
24419 d_querylocale='$d_querylocale'
24420 d_random_r='$d_random_r'
24421 d_re_comp='$d_re_comp'
24422 d_readdir64_r='$d_readdir64_r'
24423 d_readdir='$d_readdir'
24424 d_readdir_r='$d_readdir_r'
24425 d_readlink='$d_readlink'
24427 d_recvmsg='$d_recvmsg'
24428 d_regcmp='$d_regcmp'
24429 d_regcomp='$d_regcomp'
24430 d_remainder='$d_remainder'
24431 d_remquo='$d_remquo'
24432 d_rename='$d_rename'
24433 d_renameat='$d_renameat'
24434 d_rewinddir='$d_rewinddir'
24438 d_sbrkproto='$d_sbrkproto'
24439 d_scalbn='$d_scalbn'
24440 d_scalbnl='$d_scalbnl'
24441 d_sched_yield='$d_sched_yield'
24442 d_scm_rights='$d_scm_rights'
24443 d_seekdir='$d_seekdir'
24444 d_select='$d_select'
24446 d_semctl='$d_semctl'
24447 d_semctl_semid_ds='$d_semctl_semid_ds'
24448 d_semctl_semun='$d_semctl_semun'
24449 d_semget='$d_semget'
24451 d_sendmsg='$d_sendmsg'
24452 d_setegid='$d_setegid'
24453 d_seteuid='$d_seteuid'
24454 d_setgrent='$d_setgrent'
24455 d_setgrent_r='$d_setgrent_r'
24456 d_setgrps='$d_setgrps'
24457 d_sethent='$d_sethent'
24458 d_sethostent_r='$d_sethostent_r'
24459 d_setitimer='$d_setitimer'
24460 d_setlinebuf='$d_setlinebuf'
24461 d_setlocale='$d_setlocale'
24462 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24463 d_setlocale_r='$d_setlocale_r'
24464 d_setnent='$d_setnent'
24465 d_setnetent_r='$d_setnetent_r'
24466 d_setpent='$d_setpent'
24467 d_setpgid='$d_setpgid'
24468 d_setpgrp2='$d_setpgrp2'
24469 d_setpgrp='$d_setpgrp'
24470 d_setprior='$d_setprior'
24471 d_setproctitle='$d_setproctitle'
24472 d_setprotoent_r='$d_setprotoent_r'
24473 d_setpwent='$d_setpwent'
24474 d_setpwent_r='$d_setpwent_r'
24475 d_setregid='$d_setregid'
24476 d_setresgid='$d_setresgid'
24477 d_setresuid='$d_setresuid'
24478 d_setreuid='$d_setreuid'
24479 d_setrgid='$d_setrgid'
24480 d_setruid='$d_setruid'
24481 d_setsent='$d_setsent'
24482 d_setservent_r='$d_setservent_r'
24483 d_setsid='$d_setsid'
24484 d_setvbuf='$d_setvbuf'
24487 d_shmatprototype='$d_shmatprototype'
24488 d_shmctl='$d_shmctl'
24490 d_shmget='$d_shmget'
24491 d_sigaction='$d_sigaction'
24492 d_siginfo_si_addr='$d_siginfo_si_addr'
24493 d_siginfo_si_band='$d_siginfo_si_band'
24494 d_siginfo_si_errno='$d_siginfo_si_errno'
24495 d_siginfo_si_fd='$d_siginfo_si_fd'
24496 d_siginfo_si_pid='$d_siginfo_si_pid'
24497 d_siginfo_si_status='$d_siginfo_si_status'
24498 d_siginfo_si_uid='$d_siginfo_si_uid'
24499 d_siginfo_si_value='$d_siginfo_si_value'
24500 d_signbit='$d_signbit'
24501 d_sigprocmask='$d_sigprocmask'
24502 d_sigsetjmp='$d_sigsetjmp'
24503 d_sin6_scope_id='$d_sin6_scope_id'
24504 d_sitearch='$d_sitearch'
24505 d_snprintf='$d_snprintf'
24506 d_sockaddr_in6='$d_sockaddr_in6'
24507 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24508 d_sockatmark='$d_sockatmark'
24509 d_sockatmarkproto='$d_sockatmarkproto'
24510 d_socket='$d_socket'
24511 d_socklen_t='$d_socklen_t'
24512 d_sockpair='$d_sockpair'
24513 d_socks5_init='$d_socks5_init'
24515 d_srand48_r='$d_srand48_r'
24516 d_srandom_r='$d_srandom_r'
24517 d_sresgproto='$d_sresgproto'
24518 d_sresuproto='$d_sresuproto'
24520 d_statblks='$d_statblks'
24521 d_statfs_f_flags='$d_statfs_f_flags'
24522 d_statfs_s='$d_statfs_s'
24523 d_static_inline='$d_static_inline'
24524 d_statvfs='$d_statvfs'
24525 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24526 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24527 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24528 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24529 d_stdio_stream_array='$d_stdio_stream_array'
24530 d_stdiobase='$d_stdiobase'
24531 d_stdstdio='$d_stdstdio'
24532 d_strcoll='$d_strcoll'
24533 d_strerror_l='$d_strerror_l'
24534 d_strerror_r='$d_strerror_r'
24535 d_strftime='$d_strftime'
24536 d_strlcat='$d_strlcat'
24537 d_strlcpy='$d_strlcpy'
24538 d_strnlen='$d_strnlen'
24539 d_strtod='$d_strtod'
24540 d_strtod_l='$d_strtod_l'
24541 d_strtol='$d_strtol'
24542 d_strtold='$d_strtold'
24543 d_strtold_l='$d_strtold_l'
24544 d_strtoll='$d_strtoll'
24545 d_strtoq='$d_strtoq'
24546 d_strtoul='$d_strtoul'
24547 d_strtoull='$d_strtoull'
24548 d_strtouq='$d_strtouq'
24549 d_strxfrm='$d_strxfrm'
24550 d_suidsafe='$d_suidsafe'
24551 d_symlink='$d_symlink'
24552 d_syscall='$d_syscall'
24553 d_syscallproto='$d_syscallproto'
24554 d_sysconf='$d_sysconf'
24555 d_sysernlst='$d_sysernlst'
24556 d_syserrlst='$d_syserrlst'
24557 d_system='$d_system'
24558 d_tcgetpgrp='$d_tcgetpgrp'
24559 d_tcsetpgrp='$d_tcsetpgrp'
24560 d_telldir='$d_telldir'
24561 d_telldirproto='$d_telldirproto'
24562 d_tgamma='$d_tgamma'
24563 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24565 d_timegm='$d_timegm'
24567 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24568 d_tm_tm_zone='$d_tm_tm_zone'
24569 d_tmpnam_r='$d_tmpnam_r'
24570 d_towlower='$d_towlower'
24571 d_towupper='$d_towupper'
24573 d_truncate='$d_truncate'
24574 d_truncl='$d_truncl'
24575 d_ttyname_r='$d_ttyname_r'
24576 d_tzname='$d_tzname'
24577 d_u32align='$d_u32align'
24578 d_ualarm='$d_ualarm'
24581 d_union_semun='$d_union_semun'
24582 d_unlinkat='$d_unlinkat'
24583 d_unordered='$d_unordered'
24584 d_unsetenv='$d_unsetenv'
24585 d_uselocale='$d_uselocale'
24586 d_usleep='$d_usleep'
24587 d_usleepproto='$d_usleepproto'
24589 d_vendorarch='$d_vendorarch'
24590 d_vendorbin='$d_vendorbin'
24591 d_vendorlib='$d_vendorlib'
24592 d_vendorscript='$d_vendorscript'
24594 d_void_closedir='$d_void_closedir'
24595 d_voidsig='$d_voidsig'
24596 d_voidtty='$d_voidtty'
24597 d_vsnprintf='$d_vsnprintf'
24599 d_waitpid='$d_waitpid'
24600 d_wcrtomb='$d_wcrtomb'
24601 d_wcscmp='$d_wcscmp'
24602 d_wcstombs='$d_wcstombs'
24603 d_wcsxfrm='$d_wcsxfrm'
24604 d_wctomb='$d_wctomb'
24605 d_writev='$d_writev'
24608 db_hashtype='$db_hashtype'
24609 db_prefixtype='$db_prefixtype'
24610 db_version_major='$db_version_major'
24611 db_version_minor='$db_version_minor'
24612 db_version_patch='$db_version_patch'
24613 default_inc_excludes_dot='$default_inc_excludes_dot'
24614 direntrytype='$direntrytype'
24617 doubleinfbytes='$doubleinfbytes'
24618 doublekind='$doublekind'
24619 doublemantbits='$doublemantbits'
24620 doublenanbytes='$doublenanbytes'
24621 doublesize='$doublesize'
24623 drand48_r_proto='$drand48_r_proto'
24625 dtraceobject='$dtraceobject'
24626 dtracexnolibs='$dtracexnolibs'
24627 dynamic_ext='$dynamic_ext'
24633 endgrent_r_proto='$endgrent_r_proto'
24634 endhostent_r_proto='$endhostent_r_proto'
24635 endnetent_r_proto='$endnetent_r_proto'
24636 endprotoent_r_proto='$endprotoent_r_proto'
24637 endpwent_r_proto='$endpwent_r_proto'
24638 endservent_r_proto='$endservent_r_proto'
24639 eunicefix='$eunicefix'
24642 extensions='$extensions'
24643 extern_C='$extern_C'
24645 fflushNULL='$fflushNULL'
24646 fflushall='$fflushall'
24648 firstmakefile='$firstmakefile'
24650 fpossize='$fpossize'
24651 fpostype='$fpostype'
24652 freetype='$freetype'
24655 full_csh='$full_csh'
24656 full_sed='$full_sed'
24657 gccansipedantic='$gccansipedantic'
24658 gccosandvers='$gccosandvers'
24659 gccversion='$gccversion'
24660 getgrent_r_proto='$getgrent_r_proto'
24661 getgrgid_r_proto='$getgrgid_r_proto'
24662 getgrnam_r_proto='$getgrnam_r_proto'
24663 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24664 gethostbyname_r_proto='$gethostbyname_r_proto'
24665 gethostent_r_proto='$gethostent_r_proto'
24666 getlogin_r_proto='$getlogin_r_proto'
24667 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24668 getnetbyname_r_proto='$getnetbyname_r_proto'
24669 getnetent_r_proto='$getnetent_r_proto'
24670 getprotobyname_r_proto='$getprotobyname_r_proto'
24671 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24672 getprotoent_r_proto='$getprotoent_r_proto'
24673 getpwent_r_proto='$getpwent_r_proto'
24674 getpwnam_r_proto='$getpwnam_r_proto'
24675 getpwuid_r_proto='$getpwuid_r_proto'
24676 getservbyname_r_proto='$getservbyname_r_proto'
24677 getservbyport_r_proto='$getservbyport_r_proto'
24678 getservent_r_proto='$getservent_r_proto'
24679 getspnam_r_proto='$getspnam_r_proto'
24680 gidformat='$gidformat'
24686 gmtime_r_proto='$gmtime_r_proto'
24687 gnulibc_version='$gnulibc_version'
24689 groupcat='$groupcat'
24690 groupstype='$groupstype'
24693 h_sysfile='$h_sysfile'
24696 hostgenerate='$hostgenerate'
24697 hostosname='$hostosname'
24698 hostperl='$hostperl'
24699 html1dir='$html1dir'
24700 html1direxp='$html1direxp'
24701 html3dir='$html3dir'
24702 html3direxp='$html3direxp'
24711 i_arpainet='$i_arpainet'
24713 i_bsdioctl='$i_bsdioctl'
24717 i_dirent='$i_dirent'
24719 i_execinfo='$i_execinfo'
24723 i_fp_class='$i_fp_class'
24725 i_gdbm_ndbm='$i_gdbm_ndbm'
24726 i_gdbmndbm='$i_gdbmndbm'
24728 i_ieeefp='$i_ieeefp'
24729 i_inttypes='$i_inttypes'
24730 i_langinfo='$i_langinfo'
24731 i_libutil='$i_libutil'
24732 i_locale='$i_locale'
24733 i_machcthr='$i_machcthr'
24734 i_malloc='$i_malloc'
24735 i_mallocmalloc='$i_mallocmalloc'
24736 i_mntent='$i_mntent'
24739 i_neterrno='$i_neterrno'
24740 i_netinettcp='$i_netinettcp'
24744 i_pthread='$i_pthread'
24746 i_quadmath='$i_quadmath'
24747 i_rpcsvcdbm='$i_rpcsvcdbm'
24749 i_shadow='$i_shadow'
24751 i_stdbool='$i_stdbool'
24752 i_stdint='$i_stdint'
24753 i_stdlib='$i_stdlib'
24754 i_sunmath='$i_sunmath'
24755 i_sysaccess='$i_sysaccess'
24756 i_sysdir='$i_sysdir'
24757 i_sysfile='$i_sysfile'
24758 i_sysfilio='$i_sysfilio'
24760 i_sysioctl='$i_sysioctl'
24761 i_syslog='$i_syslog'
24762 i_sysmman='$i_sysmman'
24763 i_sysmode='$i_sysmode'
24764 i_sysmount='$i_sysmount'
24765 i_sysndir='$i_sysndir'
24766 i_sysparam='$i_sysparam'
24767 i_syspoll='$i_syspoll'
24768 i_sysresrc='$i_sysresrc'
24769 i_syssecrt='$i_syssecrt'
24770 i_sysselct='$i_sysselct'
24771 i_syssockio='$i_syssockio'
24772 i_sysstat='$i_sysstat'
24773 i_sysstatfs='$i_sysstatfs'
24774 i_sysstatvfs='$i_sysstatvfs'
24775 i_systime='$i_systime'
24776 i_systimek='$i_systimek'
24777 i_systimes='$i_systimes'
24778 i_systypes='$i_systypes'
24779 i_sysuio='$i_sysuio'
24781 i_sysutsname='$i_sysutsname'
24782 i_sysvfs='$i_sysvfs'
24783 i_syswait='$i_syswait'
24784 i_termio='$i_termio'
24785 i_termios='$i_termios'
24787 i_unistd='$i_unistd'
24792 i_wctype='$i_wctype'
24793 i_xlocale='$i_xlocale'
24794 ignore_versioned_solibs='$ignore_versioned_solibs'
24795 inc_version_list='$inc_version_list'
24796 inc_version_list_init='$inc_version_list_init'
24800 initialinstalllocation='$initialinstalllocation'
24801 installarchlib='$installarchlib'
24802 installbin='$installbin'
24803 installhtml1dir='$installhtml1dir'
24804 installhtml3dir='$installhtml3dir'
24805 installman1dir='$installman1dir'
24806 installman3dir='$installman3dir'
24807 installprefix='$installprefix'
24808 installprefixexp='$installprefixexp'
24809 installprivlib='$installprivlib'
24810 installscript='$installscript'
24811 installsitearch='$installsitearch'
24812 installsitebin='$installsitebin'
24813 installsitehtml1dir='$installsitehtml1dir'
24814 installsitehtml3dir='$installsitehtml3dir'
24815 installsitelib='$installsitelib'
24816 installsiteman1dir='$installsiteman1dir'
24817 installsiteman3dir='$installsiteman3dir'
24818 installsitescript='$installsitescript'
24819 installstyle='$installstyle'
24820 installusrbinperl='$installusrbinperl'
24821 installvendorarch='$installvendorarch'
24822 installvendorbin='$installvendorbin'
24823 installvendorhtml1dir='$installvendorhtml1dir'
24824 installvendorhtml3dir='$installvendorhtml3dir'
24825 installvendorlib='$installvendorlib'
24826 installvendorman1dir='$installvendorman1dir'
24827 installvendorman3dir='$installvendorman3dir'
24828 installvendorscript='$installvendorscript'
24830 issymlink='$issymlink'
24831 ivdformat='$ivdformat'
24834 known_extensions='$known_extensions'
24837 ld_can_script='$ld_can_script'
24838 lddlflags='$lddlflags'
24840 ldflags_uselargefiles='$ldflags_uselargefiles'
24841 ldlibpthname='$ldlibpthname'
24848 libsdirs='$libsdirs'
24849 libsfiles='$libsfiles'
24850 libsfound='$libsfound'
24851 libspath='$libspath'
24852 libswanted='$libswanted'
24853 libswanted_uselargefiles='$libswanted_uselargefiles'
24859 localtime_r_proto='$localtime_r_proto'
24860 locincpth='$locincpth'
24861 loclibpth='$loclibpth'
24862 longdblinfbytes='$longdblinfbytes'
24863 longdblkind='$longdblkind'
24864 longdblmantbits='$longdblmantbits'
24865 longdblnanbytes='$longdblnanbytes'
24866 longdblsize='$longdblsize'
24867 longlongsize='$longlongsize'
24868 longsize='$longsize'
24872 lseeksize='$lseeksize'
24873 lseektype='$lseektype'
24877 make_set_make='$make_set_make'
24878 mallocobj='$mallocobj'
24879 mallocsrc='$mallocsrc'
24880 malloctype='$malloctype'
24882 man1direxp='$man1direxp'
24885 man3direxp='$man3direxp'
24887 mips_type='$mips_type'
24888 mistrustnm='$mistrustnm'
24890 mmaptype='$mmaptype'
24891 modetype='$modetype'
24893 multiarch='$multiarch'
24895 myarchname='$myarchname'
24896 mydomain='$mydomain'
24897 myhostname='$myhostname'
24900 need_va_copy='$need_va_copy'
24901 netdb_hlen_type='$netdb_hlen_type'
24902 netdb_host_type='$netdb_host_type'
24903 netdb_name_type='$netdb_name_type'
24904 netdb_net_type='$netdb_net_type'
24907 nm_so_opt='$nm_so_opt'
24908 nonxs_ext='$nonxs_ext'
24910 nvEUformat='$nvEUformat'
24911 nvFUformat='$nvFUformat'
24912 nvGUformat='$nvGUformat'
24913 nv_overflows_integers_at='$nv_overflows_integers_at'
24914 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24915 nveformat='$nveformat'
24916 nvfformat='$nvfformat'
24917 nvgformat='$nvgformat'
24918 nvmantbits='$nvmantbits'
24921 o_nonblock='$o_nonblock'
24923 old_pthread_create_joinable='$old_pthread_create_joinable'
24924 optimize='$optimize'
24925 orderlib='$orderlib'
24928 otherlibdirs='$otherlibdirs'
24932 patchlevel='$patchlevel'
24933 path_sep='$path_sep'
24936 perl_patchlevel='$perl_patchlevel'
24937 perl_static_inline='$perl_static_inline'
24938 perladmin='$perladmin'
24939 perllibs='$perllibs'
24940 perlpath='$perlpath'
24942 phostname='$phostname'
24948 prefixexp='$prefixexp'
24950 privlibexp='$privlibexp'
24951 procselfexe='$procselfexe'
24953 quadkind='$quadkind'
24954 quadtype='$quadtype'
24955 randbits='$randbits'
24956 randfunc='$randfunc'
24957 random_r_proto='$random_r_proto'
24958 randseedtype='$randseedtype'
24960 rd_nodata='$rd_nodata'
24961 readdir64_r_proto='$readdir64_r_proto'
24962 readdir_r_proto='$readdir_r_proto'
24963 revision='$revision'
24969 sGMTIME_max='$sGMTIME_max'
24970 sGMTIME_min='$sGMTIME_min'
24971 sLOCALTIME_max='$sLOCALTIME_max'
24972 sLOCALTIME_min='$sLOCALTIME_min'
24973 sPRIEUldbl='$sPRIEUldbl'
24974 sPRIFUldbl='$sPRIFUldbl'
24975 sPRIGUldbl='$sPRIGUldbl'
24976 sPRIXU64='$sPRIXU64'
24978 sPRIeldbl='$sPRIeldbl'
24979 sPRIfldbl='$sPRIfldbl'
24980 sPRIgldbl='$sPRIgldbl'
24985 sSCNfldbl='$sSCNfldbl'
24986 sched_yield='$sched_yield'
24987 scriptdir='$scriptdir'
24988 scriptdirexp='$scriptdirexp'
24990 seedfunc='$seedfunc'
24991 selectminbits='$selectminbits'
24992 selecttype='$selecttype'
24993 sendmail='$sendmail'
24994 setgrent_r_proto='$setgrent_r_proto'
24995 sethostent_r_proto='$sethostent_r_proto'
24996 setlocale_r_proto='$setlocale_r_proto'
24997 setnetent_r_proto='$setnetent_r_proto'
24998 setprotoent_r_proto='$setprotoent_r_proto'
24999 setpwent_r_proto='$setpwent_r_proto'
25000 setservent_r_proto='$setservent_r_proto'
25003 sharpbang='$sharpbang'
25004 shmattype='$shmattype'
25005 shortsize='$shortsize'
25008 sig_count='$sig_count'
25009 sig_name='$sig_name'
25010 sig_name_init='$sig_name_init'
25012 sig_num_init='$sig_num_init'
25013 sig_size='$sig_size'
25014 signal_t='$signal_t'
25015 sitearch='$sitearch'
25016 sitearchexp='$sitearchexp'
25018 sitebinexp='$sitebinexp'
25019 sitehtml1dir='$sitehtml1dir'
25020 sitehtml1direxp='$sitehtml1direxp'
25021 sitehtml3dir='$sitehtml3dir'
25022 sitehtml3direxp='$sitehtml3direxp'
25024 sitelib_stem='$sitelib_stem'
25025 sitelibexp='$sitelibexp'
25026 siteman1dir='$siteman1dir'
25027 siteman1direxp='$siteman1direxp'
25028 siteman3dir='$siteman3dir'
25029 siteman3direxp='$siteman3direxp'
25030 siteprefix='$siteprefix'
25031 siteprefixexp='$siteprefixexp'
25032 sitescript='$sitescript'
25033 sitescriptexp='$sitescriptexp'
25034 sizesize='$sizesize'
25035 sizetype='$sizetype'
25039 sockethdr='$sockethdr'
25040 socketlib='$socketlib'
25041 socksizetype='$socksizetype'
25043 spackage='$spackage'
25044 spitshell='$spitshell'
25045 srand48_r_proto='$srand48_r_proto'
25046 srandom_r_proto='$srandom_r_proto'
25048 ssizetype='$ssizetype'
25049 st_ino_sign='$st_ino_sign'
25050 st_ino_size='$st_ino_size'
25051 startperl='$startperl'
25053 static_ext='$static_ext'
25055 stdio_base='$stdio_base'
25056 stdio_bufsiz='$stdio_bufsiz'
25057 stdio_cnt='$stdio_cnt'
25058 stdio_filbuf='$stdio_filbuf'
25059 stdio_ptr='$stdio_ptr'
25060 stdio_stream_array='$stdio_stream_array'
25061 strerror_r_proto='$strerror_r_proto'
25063 subversion='$subversion'
25068 targetarch='$targetarch'
25069 targetdir='$targetdir'
25070 targetenv='$targetenv'
25071 targethost='$targethost'
25072 targetmkdir='$targetmkdir'
25073 targetport='$targetport'
25074 targetsh='$targetsh'
25078 timeincl='$timeincl'
25079 timetype='$timetype'
25080 tmpnam_r_proto='$tmpnam_r_proto'
25086 ttyname_r_proto='$ttyname_r_proto'
25095 uidformat='$uidformat'
25101 uquadtype='$uquadtype'
25102 use5005threads='$use5005threads'
25103 use64bitall='$use64bitall'
25104 use64bitint='$use64bitint'
25105 usecbacktrace='$usecbacktrace'
25106 usecrosscompile='$usecrosscompile'
25107 usedevel='$usedevel'
25109 usedtrace='$usedtrace'
25110 usefaststdio='$usefaststdio'
25111 useithreads='$useithreads'
25112 usekernprocpathname='$usekernprocpathname'
25113 uselanginfo='$uselanginfo'
25114 uselargefiles='$uselargefiles'
25115 uselongdouble='$uselongdouble'
25116 usemallocwrap='$usemallocwrap'
25117 usemorebits='$usemorebits'
25118 usemultiplicity='$usemultiplicity'
25119 usemymalloc='$usemymalloc'
25121 usensgetexecutablepath='$usensgetexecutablepath'
25122 useopcode='$useopcode'
25123 useperlio='$useperlio'
25124 useposix='$useposix'
25125 usequadmath='$usequadmath'
25126 usereentrant='$usereentrant'
25127 userelocatableinc='$userelocatableinc'
25128 useshrplib='$useshrplib'
25129 usesitecustomize='$usesitecustomize'
25130 usesocks='$usesocks'
25131 usethreads='$usethreads'
25132 usevendorprefix='$usevendorprefix'
25133 useversionedarchname='$useversionedarchname'
25134 usevfork='$usevfork'
25137 uvXUformat='$uvXUformat'
25138 uvoformat='$uvoformat'
25141 uvuformat='$uvuformat'
25142 uvxformat='$uvxformat'
25143 vendorarch='$vendorarch'
25144 vendorarchexp='$vendorarchexp'
25145 vendorbin='$vendorbin'
25146 vendorbinexp='$vendorbinexp'
25147 vendorhtml1dir='$vendorhtml1dir'
25148 vendorhtml1direxp='$vendorhtml1direxp'
25149 vendorhtml3dir='$vendorhtml3dir'
25150 vendorhtml3direxp='$vendorhtml3direxp'
25151 vendorlib='$vendorlib'
25152 vendorlib_stem='$vendorlib_stem'
25153 vendorlibexp='$vendorlibexp'
25154 vendorman1dir='$vendorman1dir'
25155 vendorman1direxp='$vendorman1direxp'
25156 vendorman3dir='$vendorman3dir'
25157 vendorman3direxp='$vendorman3direxp'
25158 vendorprefix='$vendorprefix'
25159 vendorprefixexp='$vendorprefixexp'
25160 vendorscript='$vendorscript'
25161 vendorscriptexp='$vendorscriptexp'
25163 version_patchlevel_string='$version_patchlevel_string'
25164 versiononly='$versiononly'
25168 yaccflags='$yaccflags'
25173 : add special variables
25174 $test -f $src/patchlevel.h && \
25175 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25176 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25177 echo "PERL_CONFIG_SH=true" >>config.sh
25179 : propagate old symbols
25180 if $test -f UU/config.sh; then
25181 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25182 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25183 config.sh config.sh UU/oldconfig.sh |\
25184 $sort | $uniq -u >UU/oldsyms
25185 set X `$cat UU/oldsyms`
25191 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25193 echo ": Variables propagated from previous config.sh file." >>config.sh
25194 for sym in `$cat UU/oldsyms`; do
25195 echo " Propagating $hint variable "'$'"$sym..."
25196 eval 'tmp="$'"${sym}"'"'
25198 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25204 : preserve RCS keywords in files with variable substitution, grrr
25207 : Finish up by extracting the .SH files
25210 echo "Stopping at your request, leaving temporary files around."
25220 If you'd like to make any changes to the config.sh file before I begin
25221 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25224 rp="Press return or use a shell escape to edit config.sh:"
25229 *) : in case they cannot read
25230 sh 1>&4 -c "$ans";;
25235 : if this fails, just run all the .SH files by hand
25244 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25251 Now you need to generate make dependencies by running "$make depend".
25252 You might prefer to run it in background: "$make depend > makedepend.out &"
25253 It can take a while, so you might not want to run it right now.
25258 rp="Run $make depend now?"
25262 $make depend && echo "Now you must run '$make'."
25265 echo "You must run '$make depend' then '$make'."
25268 elif test -f [Mm]akefile; then
25270 echo "Now you must run a $make."
25272 echo "Configure done."
25275 if $test -f Policy.sh; then
25278 If you compile $package on a different machine or from a different object
25279 directory, copy the Policy.sh file from this object directory to the
25280 new one before you run Configure -- this will help you with most of
25281 the policy defaults.
25285 if $test -f UU/config.msg; then
25286 echo "Hmm. I also noted the following information while running:"
25288 $cat UU/config.msg >&4
25290 $rm -f kit*isdone ark*isdone