3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
531 gethostbyaddr_r_proto=''
533 gethostbyname_r_proto=''
535 gethostent_r_proto=''
548 getnetbyaddr_r_proto=''
550 getnetbyname_r_proto=''
564 d_getprotobyname_r=''
565 getprotobyname_r_proto=''
566 d_getprotobynumber_r=''
567 getprotobynumber_r_proto=''
569 getprotoent_r_proto=''
581 getservbyname_r_proto=''
583 getservbyport_r_proto=''
585 getservent_r_proto=''
618 d_lc_monetary_2008=''
623 d_libm_lib_version=''
630 d_localtime_r_needs_tzset=''
650 d_malloc_good_size=''
704 d_old_pthread_create_joinable=''
705 old_pthread_create_joinable=''
707 d_pthread_attr_setscope=''
755 sethostent_r_proto=''
772 setprotoent_r_proto=''
784 setservent_r_proto=''
797 d_siginfo_si_errno=''
800 d_siginfo_si_status=''
802 d_siginfo_si_value=''
814 d_ipv6_mreq_source=''
831 d_sprintf_returns_strlen=''
844 perl_static_inline=''
849 d_stdio_ptr_lval_nochange_cnt=''
850 d_stdio_ptr_lval_sets_cnt=''
1004 d_gdbm_ndbm_h_uses_prototypes=''
1005 d_gdbmndbm_h_uses_prototypes=''
1007 d_ndbm_h_uses_prototypes=''
1083 d_inc_version_list=''
1085 inc_version_list_init=''
1093 installusrbinperl=''
1109 ignore_versioned_solibs=''
1173 d_perl_otherlibdirs=''
1181 api_versionstring=''
1187 version_patchlevel_string=''
1191 d_nv_preserves_uv=''
1192 d_nv_zero_is_allbits_zero=''
1203 nv_overflows_integers_at=''
1204 nv_preserves_uv_bits=''
1277 installsitehtml1dir=''
1280 installsitehtml3dir=''
1287 installsiteman1dir=''
1290 installsiteman3dir=''
1295 installsitescript=''
1313 d_stdio_stream_array=''
1314 stdio_stream_array=''
1332 usekernprocpathname=''
1333 ccflags_uselargefiles=''
1334 ldflags_uselargefiles=''
1335 libswanted_uselargefiles=''
1344 usensgetexecutablepath=''
1358 installvendorarch=''
1365 installvendorhtml1dir=''
1367 vendorhtml1direxp=''
1368 installvendorhtml3dir=''
1370 vendorhtml3direxp=''
1376 installvendorman1dir=''
1379 installvendorman3dir=''
1386 installvendorscript=''
1397 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1400 : We must find out about Eunice early
1402 if test -f /etc/unixtovms; then
1403 eunicefix=/etc/unixtovms
1405 if test -f /etc/unixtovms.exe; then
1406 eunicefix=/etc/unixtovms.exe
1409 : Set executable suffix now -- needed before hints available
1410 if test -f "/libs/version.library"; then
1413 elif test -f "/system/gnu_library/bin/ar.pm"; then
1416 elif test -n "$DJGPP"; then
1419 elif test -f /kern/cookiejar; then
1422 elif test -d c:/. -o -n "$is_os2" ; then
1429 : Possible local include directories to search.
1430 : Set locincpth to "" in a hint file to defeat local include searches.
1431 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1432 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1434 : no include file wanted by default
1437 : Enable -DEBUGGING and -DDEBUGGING from the command line
1441 : Trailing extension. Override this in a hint file, if needed.
1442 : Extra object files, if any, needed on this platform.
1445 : change the next line if compiling for Xenix/286 on Xenix/386
1446 xlibpth='/usr/lib/386 /lib/386'
1447 : Possible local library directories to search.
1448 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1449 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1451 : general looking path for locating libraries
1452 glibpth="/lib /usr/lib $xlibpth"
1453 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1454 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1455 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1456 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1458 : Private path used by Configure to find libraries. Its value
1459 : is prepended to libpth. This variable takes care of special
1460 : machines, like the mips. Usually, it should be empty.
1463 : default library list
1465 : some systems want to use only the non-versioned libso:s
1466 ignore_versioned_solibs=''
1470 : set useposix=false in your hint file to disable the POSIX extension.
1472 : set useopcode=false in your hint file to disable the Opcode extension.
1475 ccflags_uselargefiles=''
1476 ldflags_uselargefiles=''
1477 libswanted_uselargefiles=''
1478 : set usemultiplicity on the Configure command line to enable multiplicity.
1479 : set usesocks on the Configure command line to enable socks.
1481 : set usethreads on the Configure command line to enable threads.
1482 usereentrant='undef'
1483 : List of libraries we want.
1484 : If anyone needs extra -lxxx, put those in a hint file.
1485 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1486 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1487 : We probably want to search /usr/shlib before most other libraries.
1488 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1489 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1490 glibpth="/usr/shlib $glibpth"
1491 : Do not use vfork unless overridden by a hint file.
1494 : Find the basic shell for Bourne shell scripts
1498 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1501 if test -f "$xxx"; then
1504 : Build up a list and do a single loop so we can 'break' out.
1505 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1506 for xxx in sh bash ksh pdksh ash; do
1508 try="$try ${p}/${xxx}"
1512 if test -f "$xxx"; then
1515 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1518 elif test -f "$xxx.exe"; then
1529 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1531 Usually it's in /bin/sh. How did you even get this far?
1532 Please contact me (Perl Maintainers) at perlbug@perl.org and
1533 we'll try to straighten this all out.
1539 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1540 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1543 : see if sh knows # comments
1544 if `$sh -c '#' >/dev/null 2>&1`; then
1548 test -f $xcat$_exe || xcat=/usr/bin/cat
1549 if test ! -f $xcat$_exe; then
1550 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1551 if test -f $p/cat$_exe; then
1556 if test ! -f $xcat$_exe; then
1557 echo "Can't find cat anywhere!"
1561 echo "#!$xcat" >sharp
1564 ./sharp > today 2>/dev/null
1565 if test -s today; then
1568 echo "#! $xcat" > sharp
1571 ./sharp > today 2>/dev/null
1572 if test -s today; then
1580 echo "Your $sh doesn't grok # comments--I will strip them later on."
1583 echo "exec grep -v '^[ ]*#'" >spitshell
1585 $eunicefix spitshell
1586 spitshell=`pwd`/spitshell
1588 echo "I presume that if # doesn't work, #! won't work either!"
1593 : figure out how to guarantee sh startup
1595 '') startsh=${sharpbang}${sh} ;;
1607 : echo "Yup, it does."
1609 echo "Hmm... '$startsh' does not guarantee sh startup..."
1610 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1614 : Save command line options in file UU/cmdline.opt for later use in
1615 : generating config.sh.
1616 cat > cmdline.opt <<EOSH
1617 : Configure command line arguments.
1626 cat >>cmdline.opt <<EOSH
1627 config_arg$argn='$arg'
1629 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1632 arg_exp=`cat cmdl.opt`
1633 args_exp="$args_exp$args_sep'$arg_exp'"
1634 argn=`expr $argn + 1`
1639 : produce awk script to parse command line options
1640 cat >options.awk <<'EOF'
1642 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1644 len = length(optstr);
1645 for (i = 1; i <= len; i++) {
1646 c = substr(optstr, i, 1);
1647 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1658 if (substr(str, 1, 1) != "-") {
1659 printf("'%s'\n", str);
1663 for (i = 2; i <= len; i++) {
1664 c = substr(str, i, 1);
1666 printf("-%s\n", substr(str, i));
1672 printf("'%s'\n", substr(str, i + 1));
1685 : process the command line options
1686 set X `for arg in "$@"; do echo "X$arg"; done |
1687 sed -e s/X// | awk -f options.awk`
1692 : set up default values
1701 rm -f optdef.sh posthint.sh
1702 cat >optdef.sh <<EOS
1708 while test $# -gt 0; do
1710 -d) shift; fastread=yes;;
1711 -e) shift; alldone=cont;;
1715 if test -r "$1"; then
1718 echo "$me: cannot read config file $1." >&2
1724 -h) shift; error=true;;
1725 -r) shift; reuseval=true;;
1726 -s) shift; silent=true; realsilent=true;;
1727 -E) shift; alldone=exit;;
1728 -K) shift; knowitall=true;;
1730 -S) shift; silent=true; extractsh=true;;
1735 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1736 echo "$me: ignoring -D $1" >&2
1739 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1740 *) echo "$1='define'" >> optdef.sh;;
1747 *=) echo "$1" >> optdef.sh;;
1749 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1750 echo "$me: ignoring -U $1" >&2
1752 *) echo "$1='undef'" >> optdef.sh;;
1763 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1767 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1768 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1774 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1775 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1776 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1777 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1778 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1779 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1785 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1787 echo "$yyy=''" >> posthint.sh ;;
1792 echo "$yyy='$zzz'" >> posthint.sh ;;
1794 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1796 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1801 echo "$yyy=$zzz" >> posthint.sh ;;
1802 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1806 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1809 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1817 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1818 [-U symbol] [-U symbol=] [-A command:symbol...]
1819 -d : use defaults for all answers.
1820 -e : go on without questioning past the production of config.sh.
1821 -f : specify an alternate default configuration file.
1822 -h : print this help message and exit (with an error status).
1823 -r : reuse C symbols value if possible (skips costly nm extraction).
1824 -s : silent mode, only echoes questions and essential information.
1825 -D : define symbol to have some value:
1826 -D symbol symbol gets the value 'define'
1827 -D symbol=value symbol gets the value 'value'
1828 common used examples (see INSTALL for more info):
1829 -Duse64bitint use 64bit integers
1830 -Duse64bitall use 64bit integers and pointers
1831 -Dusethreads use thread support
1832 -Dinc_version_list=none do not include older perl trees in @INC
1833 -DEBUGGING=none DEBUGGING options
1834 -Dcc=gcc choose your compiler
1835 -Dprefix=/opt/perl5 choose your destination
1836 -E : stop at the end of questions, after having produced config.sh.
1837 -K : do not use unless you know what you are doing.
1838 -O : ignored for backward compatibility
1839 -S : perform variable substitutions on all .SH files (can mix with -f)
1840 -U : undefine symbol:
1841 -U symbol symbol gets the value 'undef'
1842 -U symbol= symbol gets completely empty
1844 -A : manipulate symbol after the platform specific hints have been applied:
1845 -A append:symbol=value append value to symbol
1846 -A symbol=value like append:, but with a separating space
1847 -A define:symbol=value define symbol to have value
1848 -A clear:symbol define symbol to be ''
1849 -A define:symbol define symbol to be 'define'
1850 -A eval:symbol=value define symbol to be eval of value
1851 -A prepend:symbol=value prepend value to symbol
1852 -A undef:symbol define symbol to be 'undef'
1853 -A undef:symbol= define symbol to be ''
1854 e.g.: -A prepend:libswanted='cl pthread '
1855 -A ccflags=-DSOME_MACRO
1856 -V : print version number and exit (with a zero status).
1863 case "$fastread$alldone" in
1866 case "$extractsh" in
1869 if test ! -t 0; then
1870 echo "Say 'sh Configure', not 'sh <Configure'"
1880 true) exec 1>/dev/null;;
1883 : run the defines and the undefines, if any, but leave the file out there...
1885 grep '\\' optdef.sh >/dev/null 2>&1
1886 if test $? = 0; then
1887 echo "Configure does not support \\ in -D arguments"
1891 : create the posthint manipulation script and leave the file out there...
1896 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1897 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1898 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1899 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1900 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1903 : Some greps do not return status, grrr.
1904 echo "grimblepritz" >grimble
1905 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1907 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1913 : the following should work in any shell
1917 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1918 cat >contains <<'EOSS'
1919 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1924 : Find the path to the source tree
1927 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1931 *) src=`cd ../$src && pwd` ;;
1944 if test -f $rsrc/Configure && \
1945 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1947 : found it, so we are ok.
1950 for src in . .. ../.. ../../.. ../../../..; do
1951 if test -f ../$src/Configure && \
1952 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1963 Sorry, I can't seem to locate the source dir for $package. Please start
1964 Configure with an explicit path -- i.e. /some/path/Configure.
1972 echo "Sources for $package found in \"$src\"." >&4
1976 : script used to extract .SH files with variable substitutions
1977 cat >extract <<'EOS'
1979 echo "Doing variable substitutions on .SH files..."
1980 if test -f MANIFEST; then
1981 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1983 echo "(Looking for .SH files under the source directory.)"
1984 set x `(cd "$src"; find . -name "*.SH" -print)`
1988 0) set x `(cd "$src"; echo *.SH)`; shift;;
1990 if test ! -f "$src/$1"; then
1996 while test $name; do
1997 if test ! -d "$name"; then
1998 create="$name $create";
1999 name=`echo $name | sed -e "s|^[^/]*$||"`;
2000 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2005 for file in $create; do
2014 dir=`expr X$file : 'X\(.*\)/'`
2015 file=`expr X$file : 'X.*/\(.*\)'`
2016 (cd "$dir" && . ./$file)
2026 dir=`expr X$file : 'X\(.*\)/'`
2027 file=`expr X$file : 'X.*/\(.*\)'`
2028 (set x $dir; shift; eval $mkdir_p)
2029 sh <"$src/$dir/$file"
2038 if test -f "$src/config_h.SH"; then
2039 if test ! -f config.h; then
2040 : oops, they left it out of MANIFEST, probably, so do it anyway.
2041 . "$src/config_h.SH"
2046 : extract files and exit if asked to do so
2047 case "$extractsh" in
2049 case "$realsilent" in
2053 case "$config_sh" in
2054 '') config_sh='config.sh';;
2057 echo "Fetching answers from $config_sh..."
2064 echo "Extraction done."
2069 : Eunice requires " " instead of "", can you believe it
2072 echo "Beginning of configuration questions for $package."
2074 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2076 : first determine how to suppress newline on echo command
2078 echo "Checking echo to see how to suppress newlines..."
2079 (echo "hi there\c" ; echo " ") >.echotmp
2080 if $contains c .echotmp >/dev/null 2>&1 ; then
2091 echo $n "The star should be here-->$c"
2095 : Now test for existence of everything in MANIFEST
2097 if test -f "$rsrc/MANIFEST"; then
2098 echo "First let's make sure your kit is complete. Checking..." >&4
2099 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2100 (split -l 50 2>/dev/null || split -50)
2103 for filelist in x??; do
2104 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2105 >/dev/null 2>>"$tmppwd/missing")
2107 if test -s missing; then
2111 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2113 You have the option of continuing the configuration process, despite the
2114 distinct possibility that your kit is damaged, by typing 'y'es. If you
2115 do, don't blame me if something goes wrong. I advise you to type 'n'o
2116 and contact the author (perlbug@perl.org).
2119 echo $n "Continue? [n] $c" >&4
2123 echo "Continuing..." >&4
2127 echo "ABORTING..." >&4
2132 echo "Looks good..."
2135 echo "There is no MANIFEST file. I hope your kit is complete !"
2139 : Find the appropriate value for a newline for tr
2140 if test -n "$DJGPP"; then
2143 if test X"$trnl" = X; then
2144 case "`echo foo | tr '\n' x 2>/dev/null`" in
2148 if test X"$trnl" = X; then
2149 case "`echo foo | tr '\012' x 2>/dev/null`" in
2150 foox) trnl='\012' ;;
2153 if test X"$trnl" = X; then
2154 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2155 fooxy) trnl='\n\r' ;;
2158 if test X"$trnl" = X; then
2161 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2167 : compute the number of columns on the terminal for proper question formatting
2172 : set up the echo used in my read
2173 myecho="case \"\$xxxm\" in
2174 '') echo $n \"\$rp $c\" >&4;;
2176 '') echo $n \"[\$xxxm] $c\";;
2178 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2180 echo $n \"[\$xxxm] $c\" >&4
2182 echo $n \"\$rp [\$xxxm] $c\" >&4
2188 : now set up to do reads with possible shell escape and default assignment
2194 case "\$fastread" in
2195 yes) case "\$dflt" in
2198 case "\$silent-\$rp" in
2203 *) case "\$silent" in
2204 true) case "\$rp" in
2209 while expr "X\$ans" : "X!" >/dev/null; do
2213 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2221 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2230 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2235 echo "(OK, I'll run with -d after this question.)" >&4
2238 echo "*** Sorry, \$1 not supported yet." >&4
2248 echo "*** Substitution done -- please confirm."
2250 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2255 echo "*** Error -- try again."
2262 case "\$ans\$xxxm\$nostick" in
2274 : create .config dir to save info across Configure sessions
2275 test -d ../.config || mkdir ../.config
2276 cat >../.config/README <<EOF
2277 This directory created by Configure to save information that should
2278 persist across sessions for $package.
2280 You may safely delete it if you wish.
2283 : See if we are using a devel version and want that
2284 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2287 usedevel="$define" ;;
2288 *) case "$xversion" in
2291 *** WHOA THERE!!! ***
2293 This is an UNSTABLE DEVELOPMENT release.
2294 The version of this $package distribution is $xversion, that is, odd,
2295 (as opposed to even) and that signifies a development release.
2296 If you want a maintenance release, you want an even-numbered version.
2298 Do ***NOT*** install this into production use.
2299 Data corruption and crashes are possible.
2301 It is most seriously suggested that you do not continue any further
2302 unless you want to help in developing and debugging Perl.
2304 If you *still* want to build perl, you can answer 'y' now,
2305 or pass -Dusedevel to Configure.
2308 rp='Do you really want to continue?'
2312 [yY]) echo >&4 "Okay, continuing."
2313 usedevel="$define" ;;
2314 *) echo >&4 "Okay, bye."
2325 case "$versiononly" in
2326 '') versiononly="$define" ;;
2328 case "$installusrbinperl" in
2329 '') installusrbinperl="$undef" ;;
2334 : general instructions
2337 user=`(logname) 2>/dev/null`
2339 '') user=`whoami 2>&1`;;
2341 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2344 rp='Would you like to see the instructions?'
2355 This installation shell script will examine your system and ask you questions
2356 to determine how the perl5 package should be installed. If you get
2357 stuck on a question, you may use a ! shell escape to start a subshell or
2358 execute a command. Many of the questions will have default answers in square
2359 brackets; typing carriage return will give you the default.
2361 On some of the questions which ask for file or directory names you are allowed
2362 to use the ~name construct to specify the login directory belonging to "name",
2363 even if you don't have a shell which knows about that. Questions where this is
2364 allowed will be marked "(~name ok)".
2368 dflt='Type carriage return to continue'
2372 The prompter used in this script allows you to use shell variables and
2373 backticks in your answers. You may use $1, $2, etc... to refer to the words
2374 in the default answer, as if the default line was a set of arguments given to a
2375 script shell. This means you may also use $* to repeat the whole default line,
2376 so you do not have to re-type everything to add something to the default.
2378 Every time there is a substitution, you will have to confirm. If there is an
2379 error (e.g. an unmatched backtick), the default answer will remain unchanged
2380 and you will be prompted again.
2382 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2383 the questions and use the computed defaults (or the previous answers if there
2384 was already a config.sh file). Type 'Configure -h' for a list of options.
2385 You may also start interactively and then answer '& -d' at any prompt to turn
2386 on the non-interactive behaviour for the remainder of the execution.
2392 Much effort has been expended to ensure that this shell script will run on any
2393 Unix system. If despite that it blows up on yours, your best bet is to edit
2394 Configure and run it again. If you can't run Configure for some reason,
2395 you'll have to generate a config.sh file by hand. Whatever problems you
2396 have, let me (perlbug@perl.org) know how I blew it.
2398 This installation script affects things in two ways:
2400 1) it may do direct variable substitutions on some of the files included
2402 2) it builds a config.h file for inclusion in C programs. You may edit
2403 any of these files as the need arises after running this script.
2405 If you make a mistake on a question, there is no easy way to back up to it
2406 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2407 files. Configure will offer to let you do this before it runs the SH files.
2410 dflt='Type carriage return to continue'
2412 case "$firsttime" in
2413 true) echo $user >>../.config/instruct;;
2417 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2418 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2419 if test "X$sysroot" = X; then
2424 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2425 # _sysroot is used in places where we need --sysroot=foo
2426 # but using the rest of the flags could cause issues.
2427 _sysroot="--sysroot=$sysroot";
2431 ccflags="$ccflags $_sysroot"
2436 ldflags="$ldflags $_sysroot"
2441 cppflags="$cppflags $_sysroot"
2443 # lddlflags updated below in lddlflags section;
2444 # same with cccdlflags
2448 # Adjust some defaults to also use $sysroot
2449 for var in xlibpth loclibpth locincpth glibpth; do
2452 for path in $xxx; do
2453 eval $var=\"\$$var $sysroot$path\"
2459 : find out where common programs are
2461 echo "Locating common programs..." >&4
2474 if test -d \$dir/\$thing; then
2480 for thisthing in \$dir/\$thing; do
2481 : just loop through to pick last item
2483 if test -f \$thisthing; then
2486 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2489 elif test -f \$dir/\$thing.exe; then
2490 if test -n "$DJGPP"; then
2491 echo \$dir/\$thing.exe
2492 elif test "$eunicefix" != ":"; then
2493 : on Eunice apparently
2546 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2547 pth="$pth $sysroot/lib $sysroot/usr/lib"
2548 for file in $loclist; do
2552 if test -f "$xxx"; then
2555 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2556 xxx=`./loc $file $file $pth`
2559 '') xxx=`./loc $file $file $pth`;;
2560 *) xxx=`./loc $xxx $xxx $pth`;;
2562 eval $file=$xxx$_exe
2566 echo $file is in $xxx.
2569 echo $file is in $xxx.
2572 echo "I don't know where '$file' is, and my life depends on it." >&4
2573 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2579 echo "Don't worry if any of the following aren't found..."
2581 for file in $trylist; do
2585 if test -f "$xxx"; then
2588 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2589 xxx=`./loc $file $file $pth`
2592 '') xxx=`./loc $file $file $pth`;;
2593 *) xxx=`./loc $xxx $xxx $pth`;;
2595 eval $file=$xxx$_exe
2599 echo $file is in $xxx.
2602 echo $file is in $xxx.
2605 echo "I don't see $file out there, $say."
2612 echo "Substituting grep for egrep."
2619 *) if $less -R </dev/null >/dev/null 2>&1; then
2620 echo "Substituting less -R for less."
2628 echo "Substituting cp for ln."
2637 echo "I can't find make or gmake, and my life depends on it." >&4
2638 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2646 *) # We can't have osname yet.
2647 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2648 # Assume that gmake, if found, is definitely GNU make
2649 # and prefer it over the system make.
2650 echo "Substituting gmake for make."
2658 echo "Hopefully test is built into your sh."
2661 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2662 echo "Using the test built into your sh."
2670 echo "Hopefully echo is built into your sh."
2675 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2676 $echo $n "hi there$c" >foo1
2677 echo $n "hi there$c" >foo2
2678 if cmp foo1 foo2 >/dev/null 2>&1; then
2679 echo "They are compatible. In fact, they may be identical."
2686 They are not compatible! You are probably running ksh on a non-USG system.
2687 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2688 have echo built in and we may have to run some Bourne shell scripts. That
2689 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2692 $echo $n "The star should be here-->$c"
2699 # This question was auctioned at YAPC::Europe-2007 in Vienna
2700 # I never promised you could answer it. I only auctioned the question.
2702 The following message is sponsored by
2704 Dresden.pm<--The stars should be here.
2706 Dear Perl user, system administrator or package
2707 maintainer, the Perl community sends greetings to
2708 you. Do you (emblematical) greet back [Y/n]? n
2712 : Check what type of C compiler we use
2716 cat <<'EOSC' >>trygcc
2721 int main(int argc, char *argv[]) {
2725 if $cc -o try $ccflags $ldflags try.c; then
2728 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2734 # Skip this test because it gives a false match on output like:
2735 # ./trygcc: line 23: cc: command not found
2736 # case "`$cc -v -c try.c 2>&1`" in
2737 # *gcc*) trygcc=no ;;
2739 if $test X"$trygcc" = Xyes; then
2740 if gcc -o try -c try.c; then
2742 echo "You seem to have a working gcc, though." >&4
2743 # Switching compilers may undo the work of hints files.
2744 # The most common problem is -D_REENTRANT for threads.
2745 # This heuristic catches that case, but gets false positives
2746 # if -Dusethreads was not actually specified. Better to
2747 # bail out here with a useful message than fail
2748 # mysteriously later. Should we perhaps just try to
2749 # re-invoke Configure -Dcc=gcc config_args ?
2750 if $test -f usethreads.cbu; then
2753 *** However, any setting of the C compiler flags (e.g. for thread support)
2754 *** will be lost. It may be necessary for you to restart Configure and
2755 *** add -Dcc=gcc to your Configure command line.
2758 rp="Would you like to go ahead and try gcc anyway?"
2761 rp="Would you like to use it?"
2764 if $test -f myread; then
2767 if $test -f UU/myread; then
2770 echo "Cannot find myread, sorry. Aborting." >&2
2775 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2788 cat <<'EOSC' >>checkcc
2793 int main(int argc, char *argv[]) {
2797 if $cc -o try $ccflags $ldflags try.c; then
2800 if $test X"$despair" = Xyes; then
2801 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2804 You need to find a working C compiler.
2805 Either (purchase and) install the C compiler supplied by your OS vendor,
2806 or for a free C compiler try http://gcc.gnu.org/
2807 I cannot continue any further, aborting.
2816 : determine whether symbolic links are supported
2819 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2820 echo "Symbolic links are supported." >&4
2823 echo "Symbolic links are NOT supported." >&4
2828 : determine whether symbolic links are supported
2832 echo "Checking how to test for symbolic links..." >&4
2834 if $test "X$issymlink" = X; then
2836 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2837 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2839 if test $? = 0; then
2842 echo "Your builtin 'test -h' may be broken." >&4
2845 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2848 if test -f "$p/$test"; then
2857 echo "Trying external '$test -h'." >&4
2858 issymlink="$test -h"
2859 if $test ! -h sym >/dev/null 2>&1; then
2860 echo "External '$test -h' is broken, too." >&4
2868 if $test "X$issymlink" = X; then
2869 if $test -L sym 2>/dev/null; then
2870 issymlink="$test -L"
2871 echo "The builtin '$test -L' worked." >&4
2874 if $test "X$issymlink" != X; then
2875 echo "You can test for symbolic links with '$issymlink'." >&4
2877 echo "I do not know how you can test for symbolic links." >&4
2881 *) echo "No symbolic links, so not testing for their testing..." >&4
2886 : Make symlinks util
2887 case "$mksymlinks" in
2890 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2893 *) case "$lns:$issymlink" in
2894 *"ln"*" -s:"*"test -"?)
2895 echo "Creating the symbolic links..." >&4
2897 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2907 print "# dir = ", dir, "file = ", file
2908 mf[dir] = mf[dir]" "source"/"dir"/"file;
2911 if (d != ".") { print("mkdir -p "d) }
2912 print("ln -sf "mf[d]" "d);
2914 }' source="$src" > UU/mksymlinks.$$
2918 if test ! -d t/base; then
2919 echo "Failed to create the subdirectories. Aborting." >&4
2923 if test ! -f t/base/lex.t; then
2924 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2927 if test ! -f win32/win32.c; then
2928 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2933 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2941 : Check for Cross-Compilation
2942 if $test "X$targethost" = "X"; then
2945 if $test "X$targetenv" = "X"; then
2948 case "$usecrosscompile" in
2950 $echo "Cross-compiling..."
2953 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2954 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2955 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2956 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2957 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2958 # leave out ld, choosing it is more complex
2959 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2960 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2961 # We are in a weird spot. Just before us, some values
2962 # were 'saved', to be restored after the hints are
2963 # run. This means that the changes we made to ar,
2964 # nm and ranlib will get reverted.
2965 # To avoid that, we hijack the saving mechanism and
2966 # have it save our new values.
2967 for file in ar nm ranlib; do
2969 eval $file=$xxx$_exe
2974 case "$targetarch" in
2975 '') echo "Targetarch not defined." >&4; croak=y ;;
2976 *) echo "Using targetarch $targetarch." >&4 ;;
2978 case "$targethost" in
2979 '') echo "Targethost not defined." >&4; croak=n ;;
2980 *) echo "Using targethost $targethost." >&4
2985 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2987 : compile a host miniperl and generate_uudmap, unless we got passed them
2988 if $test "X$hostperl" = X; then
2989 echo "Building host miniperl and generate_uudmap binaries" >&4
2997 $src/Configure -des -Dusedevel -Dmksymlinks
2999 case "$hostgenerate" in
3000 '') $make generate_uudmap
3001 hostgenerate=$src/host/generate_uudmap
3003 "$undef") hostgenerate=''
3006 hostperl=$src/host/miniperl
3009 hostosname=`$hostperl -le 'print $^O'`
3012 usecrosscompile="$undef"
3016 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3017 case "$targethost" in
3018 '') echo "Checking for cross-compile" >&4
3019 case "$usecrosscompile$multiarch" in
3020 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3021 if [ -f Makefile ]; then
3023 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3025 echo "Configure done."
3029 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3036 *) echo "Using targethost $targethost." >&4
3038 /*) run=$src/Cross/run
3039 targetmkdir=$src/Cross/mkdir
3041 from=$src/Cross/from
3043 *) pwd=`$test -f ../Configure & cd ..; pwd`
3045 targetmkdir=$pwd/Cross/mkdir
3047 from=$pwd/Cross/from
3050 case "$targetrun" in
3051 '') targetrun=ssh ;;
3056 case "$targetfrom" in
3057 '') targetfrom=scp ;;
3061 from=$from-$targetfrom
3062 case "$targetdir" in
3064 echo "Guessing targetdir $targetdir." >&4
3067 case "$targetuser" in
3069 echo "Guessing targetuser $targetuser." >&4
3072 case "$targetport" in
3074 echo "Guessing targetport $targetport." >&4
3077 case "$targetfrom" in
3081 case "$targetrun" in
3101 '') cwd=$targetdir ;;
3106 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3112 *) echo "Unknown targetrun '$targetrun'" >&4
3116 case "$targetmkdir" in
3118 cat >$targetmkdir <<EOF
3120 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3122 $chmod a+rx $targetmkdir
3124 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3136 $targetmkdir \`dirname \$f\`
3137 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3140 $targetmkdir $targetdir/\`dirname \$f\`
3141 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3154 $mkdir -p $targetdir/\`dirname \$f\`
3155 $cp \$f $targetdir/\$f || exit 1
3158 $targetmkdir $targetdir/\`dirname \$f\`
3159 $cp \$f $targetdir/\$f || exit 1
3166 *) echo "Unknown targetto '$targetto'" >&4
3170 case "$targetfrom" in
3177 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3182 cp) cat >$from <<EOF
3187 cp $targetdir/\$f . || exit 1
3192 *) echo "Unknown targetfrom '$targetfrom'" >&4
3196 if $test ! -f $run; then
3197 echo "Target 'run' script '$run' not found." >&4
3201 if $test ! -f $to; then
3202 echo "Target 'to' script '$to' not found." >&4
3206 if $test ! -f $from; then
3207 echo "Target 'from' script '$from' not found." >&4
3211 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3215 Using '$run' for remote execution,
3216 and '$from' and '$to'
3217 for remote file transfer.
3223 usecrosscompile="$undef"
3228 : see whether [:lower:] and [:upper:] are supported character classes
3230 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3232 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3236 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3237 # (0xd9 and 0xe2), therefore that is a nice testing point.
3238 if test "X$up" = X -o "X$low" = X; then
3239 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
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 | od -x 2>/dev/null`" in
3255 echo "Hey, this might be EBCDIC." >&4
3256 if test "X$up" = X -o "X$low" = X; then
3257 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3258 rs) up='[A-IJ-RS-Z]'
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
3274 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3276 echo "Using $up and $low to convert case." >&4
3279 echo "I don't know how to translate letters from upper to lower case." >&4
3280 echo "Your tr is not acting any way I know of." >&4
3284 : set up the translation script tr, must be called with ./tr of course
3288 '[A-Z][a-z]') exec $tr '$up' '$low';;
3289 '[a-z][A-Z]') exec $tr '$low' '$up';;
3296 : Try to determine whether config.sh was made on this system
3297 case "$config_sh" in
3299 myuname=`$uname -a 2>/dev/null`
3300 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3301 # Downcase everything to avoid ambiguity.
3302 # Remove slashes and single quotes so we can use parts of this in
3303 # directory and file names.
3304 # Remove newlines so myuname is sane to use elsewhere.
3305 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3306 # because the A-Z/a-z are not consecutive.
3307 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3308 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3309 newmyuname="$myuname"
3311 case "$knowitall" in
3313 if test -f ../config.sh; then
3314 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3315 eval "`grep myuname= ../config.sh`"
3317 if test "X$myuname" = "X$newmyuname"; then
3325 : Get old answers from old config file if Configure was run on the
3326 : same system, otherwise use the hints.
3329 if test -f config.sh; then
3331 rp="I see a config.sh file. Shall I use it to set the defaults?"
3334 n*|N*) echo "OK, I'll ignore it."
3335 mv config.sh config.sh.old
3336 myuname="$newmyuname"
3338 *) echo "Fetching default answers from your old config.sh file..." >&4
3346 : Older versions did not always set $sh. Catch re-use of such
3356 if test ! -f config.sh; then
3359 First time through, eh? I have some defaults handy for some systems
3360 that need some extra help getting the Configure answers right:
3363 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3365 : Half the following guesses are probably wrong... If you have better
3366 : tests or hints, please send them to perlbug@perl.org
3367 : The metaconfig authors would also appreciate a copy...
3368 $test -f /irix && osname=irix
3369 $test -f /xenix && osname=sco_xenix
3370 $test -f /dynix && osname=dynix
3371 $test -f /dnix && osname=dnix
3372 $test -f /lynx.os && osname=lynxos
3373 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3374 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3375 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3376 $test -f /bin/mips && /bin/mips && osname=mips
3377 $test -d /usr/apollo/bin && osname=apollo
3378 $test -f /etc/saf/_sactab && osname=svr4
3379 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3380 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3381 $test -f /sys/utilities/MultiView && osname=amigaos
3382 if $test -d /MachTen -o -d /MachTen_Folder; then
3384 if $test -x /sbin/version; then
3385 osvers=`/sbin/version | $awk '{print $2}' |
3386 $sed -e 's/[A-Za-z]$//'`
3387 elif $test -x /usr/etc/version; then
3388 osvers=`/usr/etc/version | $awk '{print $2}' |
3389 $sed -e 's/[A-Za-z]$//'`
3395 $test -f /sys/posix.dll &&
3396 $test -f /usr/bin/what &&
3397 set X `/usr/bin/what /sys/posix.dll` &&
3398 $test "$3" = UWIN &&
3402 if $test -f $uname; then
3410 umips) osname=umips ;;
3413 [23]100) osname=mips ;;
3415 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3416 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3419 elif $test -f /etc/kconfig; then
3421 if test "$lns" = "$ln -s"; then
3423 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3425 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3432 if test -n "$DJGPP"; then
3441 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3443 # oslevel can fail with:
3444 # oslevel: Unable to acquire lock.
3445 *not\ found) osvers="$4"."$3" ;;
3446 '<3240'|'<>3240') osvers=3.2.0 ;;
3447 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3448 '=3250'|'>3250') osvers=3.2.5 ;;
3452 bitrig) osname=bitrig
3455 bsd386) osname=bsd386
3458 cygwin*) osname=cygwin
3461 *dc.osx) osname=dcosx
3467 domainos) osname=apollo
3473 dragonfly) osname=dragonfly
3476 dynixptx*) osname=dynixptx
3477 osvers=`echo "$4"|sed 's/^v//'`
3479 freebsd) osname=freebsd
3481 genix) osname=genix ;;
3485 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3498 $test -f /system/lib/libandroid.so && osname=linux-android
3502 netbsd*) osname=netbsd
3505 news-os) osvers="$3"
3507 4*) osname=newsos4 ;;
3511 nonstop-ux) osname=nonstopux ;;
3512 openbsd) osname=openbsd
3518 POSIX-BC | posix-bc ) osname=posix-bc
3521 powerux | power_ux | powermax_os | powermaxos | \
3522 powerunix | power_unix) osname=powerux
3528 solaris) osname=solaris
3530 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3537 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3541 titanos) osname=titanos
3550 ultrix) osname=ultrix
3553 osf1|mls+) case "$5" in
3556 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3559 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3562 hp*) osname=hp_osf1 ;;
3563 mips) osname=mips_osf1 ;;
3566 # UnixWare 7.1.2 is known as Open UNIX 8
3567 openunix|unixware) osname=svr5
3575 $2) case "$osname" in
3579 : svr4.x or possibly later
3589 if test -f /stand/boot ; then
3590 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3591 if test -n "$INITPROG" -a -f "$INITPROG"; then
3592 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3593 if test -n "$isesix"; then
3601 *) if test -f /etc/systemid; then
3603 set `echo $3 | $sed 's/\./ /g'` $4
3604 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3606 elif $test -f $src/hints/sco_$1_$2.sh; then
3608 elif $test -f $src/hints/sco_$1.sh; then
3613 '') : Still unknown. Probably a generic Sys V.
3622 *) case "$osname" in
3623 '') : Still unknown. Probably a generic BSD.
3631 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3632 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3633 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3636 $rm -f UU/kernel.what
3637 elif test -d c:/. -o -n "$is_os2" ; then
3644 case "$targetarch" in
3647 case "$targetarch" in
3649 # Will load qnx.sh, which should change osname to nto
3654 # Catch arm-linux-androideabi, mipsel-linux-android,
3655 # and i686-linux-android
3656 osname=linux-android
3660 # Something like arm-linux-gnueabihf is really just
3667 # XXX perhaps we should just assume
3668 # osvers to be 2, or maybe take the value
3669 # from targetarch. Using $run before the
3670 # hints are run is somewhat icky.
3671 set X `$run $uname -a 2>/dev/null`
3674 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3679 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3686 : Now look for a hint file osname_osvers, unless one has been
3687 : specified already.
3690 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3691 : Also try without trailing minor version numbers.
3692 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3693 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3694 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3695 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3698 *) case "$osvers" in
3701 *) if $test -f $src/hints/$file.sh ; then
3703 elif $test -f $src/hints/$xfile.sh ; then
3705 elif $test -f $src/hints/$xxfile.sh ; then
3707 elif $test -f $src/hints/$xxxfile.sh ; then
3709 elif $test -f $src/hints/$xxxxfile.sh ; then
3711 elif $test -f "$src/hints/${osname}.sh" ; then
3720 if $test -f Policy.sh ; then
3723 none) dflt="Policy" ;;
3724 *) dflt="Policy $dflt" ;;
3729 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3733 if $test -f Policy.sh ; then
3736 There's also a Policy hint file available, which should make the
3737 site-specific (policy) questions easier to answer.
3744 You may give one or more space-separated answers, or "none" if appropriate.
3745 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3746 previous run of Configure, you may specify it as well as or instead of
3747 OS-specific hints. If hints are provided for your OS, you should use them:
3748 although Perl can probably be built without hints on many platforms, using
3749 hints often improve performance and may enable features that Configure can't
3750 set up on its own. If there are no hints that match your OS, specify "none";
3751 DO NOT give a wrong version or a wrong OS.
3755 rp="Which of these apply, if any?"
3758 for file in $tans; do
3759 if $test X$file = XPolicy -a -f Policy.sh; then
3761 $cat Policy.sh >> UU/config.sh
3762 elif $test -f $src/hints/$file.sh; then
3763 . $src/hints/$file.sh
3764 $cat $src/hints/$file.sh >> UU/config.sh
3765 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3768 : Give one chance to correct a possible typo.
3769 echo "$file.sh does not exist"
3771 rp="hint to use instead?"
3773 for file in $ans; do
3774 if $test -f "$src/hints/$file.sh"; then
3775 . $src/hints/$file.sh
3776 $cat $src/hints/$file.sh >> UU/config.sh
3777 elif $test X$ans = X -o X$ans = Xnone ; then
3780 echo "$file.sh does not exist -- ignored."
3787 : Remember our hint file for later.
3788 if $test -f "$src/hints/$file.sh" ; then
3798 echo "Fetching default answers from $config_sh..." >&4
3802 cp $config_sh config.sh 2>/dev/null
3814 : Restore computed paths
3815 for file in $loclist $trylist; do
3816 eval $file="\$_$file"
3821 Configure uses the operating system name and version to set some defaults.
3822 The default value is probably right if the name rings a bell. Otherwise,
3823 since spelling matters for me, either accept the default or answer "none"
3830 ''|' '|none) dflt=none ;;
3831 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3834 *) dflt="$osname" ;;
3836 rp="Operating system name?"
3840 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3846 ''|' '|none) dflt=none ;;
3847 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3848 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3850 ''|' ') dflt=none ;;
3855 *) dflt="$osvers" ;;
3857 rp="Operating system version?"
3867 : who configured the system
3868 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3871 cf_by=`(logname) 2>/dev/null`
3874 cf_by=`(whoami) 2>/dev/null`
3876 "") cf_by=unknown ;;
3881 : decide how portable to be. Allow command line overrides.
3882 case "$d_portable" in
3884 *) d_portable="$define" ;;
3887 : set up shell script to do ~ expansion
3893 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3896 if $test -f /bin/csh; then
3897 /bin/csh -f -c "glob \$1"
3902 name=\`$expr x\$1 : '..\([^/]*\)'\`
3903 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3904 if $test ! -d "\$dir"; then
3906 echo "\$me: can't locate home directory for: \$name" >&2
3911 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3927 : now set up to get a file name
3931 cat <<'EOSC' >>getfile
3947 : getfile will accept an answer from the comma-separated list
3948 : enclosed in parentheses even if it does not meet other criteria.
3949 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3950 fn=`echo $fn | sed 's/(.*)//'`
3956 loc_file=`expr $fn : '.*:\(.*\)'`
3957 fn=`expr $fn : '\(.*\):.*'`
3965 */*) fullpath=true;;
3974 *e*) exp_file=true;;
3977 *p*) nopath_ok=true;;
3982 *d*) type='Directory';;
3983 *l*) type='Locate';;
3988 Locate) what='File';;
3993 case "$d_portable" in
4001 while test "$type"; do
4006 true) rp="$rp (~name ok)";;
4009 if test -f UU/getfile.ok && \
4010 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4029 value=`UU/filexp $ans`
4032 if test "$ans" != "$value"; then
4033 echo "(That expands to $value on this system.)"
4047 /*) value="$ansexp" ;;
4048 [a-zA-Z]:/*) value="$ansexp" ;;
4053 echo "I shall only accept a full path name, as in /bin/ls." >&4
4054 echo "Use a ! shell escape if you wish to check pathnames." >&4
4057 echo "Please give a full path name, starting with slash." >&4
4060 echo "Note that using ~name is ok provided it expands well." >&4
4073 for fp in $gfpth; do
4074 if test "X$fp" = X.; then
4079 if test -f "$pf"; then
4081 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4083 echo "($value is not a plain file, but that's ok.)"
4086 if test X"$type" = X; then
4093 for fp in $gfpth; do
4094 if test "X$fp" = X.; then
4099 direxp="$fp/$ansexp"
4101 if test -d "$direxp"; then
4109 if test -d "$ansexp"; then
4110 echo "(Looking for $loc_file in directory $value.)"
4111 value="$value/$loc_file"
4112 ansexp="$ansexp/$loc_file"
4114 if test -f "$ansexp"; then
4117 case "$nopath_ok" in
4118 true) case "$value" in
4120 *) echo "Assuming $value will be in people's path."
4136 if test "$fastread" = yes; then
4141 rp="$what $value doesn't exist. Use that name anyway?"
4160 test "X$gfpthkeep" != Xy && gfpth=""
4163 : determine root of directory hierarchy where package will be installed.
4166 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4169 dflt=`echo "$prefix" | sed 's/.$//'`
4177 By default, $package will be installed in $dflt/bin, manual pages
4178 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4179 installation directories. Typically this is something like /usr/local.
4180 If you wish to have binaries under /usr/bin but other parts of the
4181 installation under /usr/local, that's ok: you will be prompted
4182 separately for each of the installation directories, the prefix being
4183 only used to set the defaults.
4187 rp='Installation prefix to use?'
4195 *) oldprefix="$prefix";;
4202 : allow them to override the AFS root
4205 *) afsroot=$afsroot ;;
4211 $define|true) afs=true ;;
4212 $undef|false) afs=false ;;
4213 *) if $test -d $afsroot; then
4221 echo "AFS may be running... I'll be extra cautious then..." >&4
4223 echo "AFS does not seem to be running..." >&4
4226 : determine installation prefix for where package is to be installed.
4230 Since you are running AFS, I need to distinguish the directory in which
4231 files will reside from the directory in which they are installed (and from
4232 which they are presumably copied to the former directory by occult means).
4235 case "$installprefix" in
4236 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4237 *) dflt="$installprefix";;
4242 In some special cases, particularly when building $package for distribution,
4243 it is convenient to distinguish the directory in which files should be
4244 installed from the directory ($prefix) in which they will
4245 eventually reside. For most users, these two directories are the same.
4248 case "$installprefix" in
4250 *) dflt=$installprefix;;
4254 rp='What installation prefix should I use for installing files?'
4256 installprefix="$ans"
4257 installprefixexp="$ansexp"
4259 : Perform the prefixexp/installprefixexp correction if necessary
4260 cat <<EOS >installprefix
4263 cat <<'EOSC' >>installprefix
4264 : Change installation prefix, if necessary.
4265 if $test X"$prefix" != X"$installprefix"; then
4266 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4268 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4271 chmod +x installprefix
4272 $eunicefix installprefix
4274 : Set variables such as privlib and privlibexp from the output of ./getfile
4275 : performing the prefixexp/installprefixexp correction if necessary.
4276 cat <<EOS >setprefixvar
4279 cat <<'EOSC' >>setprefixvar
4280 eval "${prefixvar}=\"\$ans\""
4281 eval "${prefixvar}exp=\"\$ansexp\""
4284 chmod +x setprefixvar
4285 $eunicefix setprefixvar
4287 : set up the script used to warn in case of inconsistency
4296 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4298 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4299 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4304 echo "*** WHOA THERE!!! ***" >&4
4305 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4308 rp=" Keep the $hint value?"
4311 y) td=$was; tu=$was;;
4315 : function used to set '$1' to '$val'
4316 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4318 $define$undef) . ./whoa; eval "$var=\$td";;
4319 $undef$define) . ./whoa; eval "$var=\$tu";;
4320 *) eval "$var=$val";;
4323 : get the patchlevel
4325 echo "Getting the current patchlevel..." >&4
4326 if $test -r $rsrc/patchlevel.h;then
4327 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4328 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4329 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4330 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4331 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4332 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4333 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4342 $echo "(You do not have patchlevel.h. Eek.)"
4344 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4345 version_patchlevel_string="version $patchlevel subversion $subversion"
4346 case "$perl_patchlevel" in
4348 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4349 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4353 $echo "(You have $package $version_patchlevel_string.)"
4357 : XXX Should be a Configure test for double-dots in filenames.
4358 version=`echo $revision $patchlevel $subversion | \
4359 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4360 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4361 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4364 version=`echo $revision $patchlevel $subversion | \
4365 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4366 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4367 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4370 : Special case the 5.005_xx maintenance series, which used 5.005
4371 : without any subversion label as a subdirectory in $sitelib
4372 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4373 api_versionstring='5.005'
4376 : Do we want threads support and if so, what type
4377 case "$usethreads" in
4378 $define|true|[yY]*) dflt='y';;
4379 *) # Catch case where user specified ithreads or 5005threads but
4380 # forgot -Dusethreads (A.D. 4/2002)
4381 case "$useithreads$use5005threads" in
4382 *$define*) dflt='y';;
4389 Perl can be built to offer a form of threading support on some systems
4390 To do so, Configure can be run with -Dusethreads.
4392 Note that Perl built with threading support runs slightly slower
4393 and uses slightly more memory than plain Perl.
4395 If this doesn't make any sense to you, just accept the default '$dflt'.
4397 rp='Build a threading Perl?'
4400 y|Y) val="$define" ;;
4406 if $test $patchlevel -lt 9; then
4407 case "$usethreads" in
4409 : Default to ithreads unless overridden on command line or with
4412 case "$use5005threads" in
4414 echo "5.005 threads are no longer supported"
4418 case "$useithreads" in
4419 $undef|false|[nN]*) dflt='n';;
4421 rp='Use the newer interpreter-based ithreads?'
4424 y|Y) val="$define" ;;
4429 : Now set use5005threads to the opposite value.
4430 case "$useithreads" in
4431 $define) val="$undef" ;;
4438 useithreads="$undef"
4439 use5005threads="$undef"
4443 case "$useithreads$use5005threads" in
4447 You cannot have both the ithreads and the 5.005 threads enabled
4448 at the same time. Disabling the 5.005 threads since they are
4449 much less stable than the ithreads.
4452 use5005threads="$undef"
4457 : perl-5.9.x and later
4459 if test X"$usethreads" = "X$define"; then
4460 case "$use5005threads" in
4464 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4471 use5005threads="$undef"
4472 useithreads="$usethreads"
4475 case "$d_oldpthreads" in
4476 '') : Configure tests would be welcome here. For now, assume undef.
4478 *) val="$d_oldpthreads" ;;
4484 : Look for a hint-file generated 'call-back-unit'. If the
4485 : user has specified that a threading perl is to be built,
4486 : we may need to set or change some other defaults.
4487 if $test -f usethreads.cbu; then
4488 echo "Your platform has some specific hints regarding threaded builds, using them..."
4491 case "$usethreads" in
4492 "$define"|true|[yY]*)
4494 (Your platform does not have any specific hints for threaded builds.
4495 Assuming POSIX threads, then.)
4501 : Check if multiplicity is required
4504 Perl can be built so that multiple Perl interpreters can coexist
4505 within the same Perl executable.
4508 case "$useithreads" in
4511 This multiple interpreter support is required for interpreter-based threads.
4515 *) case "$usemultiplicity" in
4516 $define|true|[yY]*) dflt='y';;
4520 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4521 rp='Build Perl for multiplicity?'
4524 y|Y) val="$define" ;;
4532 : Check if morebits is requested
4533 case "$usemorebits" in
4534 "$define"|true|[yY]*)
4535 use64bitint="$define"
4536 uselongdouble="$define"
4537 usemorebits="$define"
4539 *) usemorebits="$undef"
4543 : Determine the C compiler to be used
4549 rp="Use which C compiler?"
4553 : See whether they have no cc but they do have gcc
4555 if $test -f cc.cbu; then
4560 : make some quick guesses about what we are up against
4562 $echo $n "Hmm... $c"
4572 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4573 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4575 echo "Looks kind of like an OSF/1 system, but we'll see..."
4577 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4578 xxx=`./loc addbib blurfl $pth`
4579 if $test -f $xxx; then
4580 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4584 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4585 echo "Looks kind of like an extended USG system, but we'll see..."
4587 echo "Looks kind of like a USG system, but we'll see..."
4591 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4592 echo "Looks kind of like a BSD system, but we'll see..."
4596 echo "Looks kind of like a Version 7 system, but we'll see..."
4599 case "$eunicefix" in
4602 There is, however, a strange, musty smell in the air that reminds me of
4603 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4607 : it so happens the Eunice I know will not run shell scripts in Unix format
4611 echo "Congratulations. You aren't running Eunice."
4615 : Detect OS2. The p_ variable is set above in the Head.U unit.
4616 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4617 : semicolon as a patch separator
4622 I have the feeling something is not exactly right, however...don't tell me...
4623 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4624 (Or you may be running DOS with DJGPP.)
4629 if test -f /xenix; then
4630 echo "Actually, this looks more like a XENIX system..."
4635 echo "It's not Xenix..."
4640 if test -f /venix; then
4641 echo "Actually, this looks more like a VENIX system..."
4648 echo "Nor is it Venix..."
4651 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4652 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4655 : Check if we are using GNU gcc and what its version is
4657 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4661 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4663 printf("%s\n", __VERSION__);
4665 printf("%s\n", "1");
4671 if $cc -o try $ccflags $ldflags try.c; then
4672 gccversion=`$run ./try`
4673 case "$gccversion" in
4674 '') echo "You are not using GNU cc." ;;
4675 *) echo "You are using GNU cc $gccversion."
4681 echo "*** WHOA THERE!!! ***" >&4
4682 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4683 case "$knowitall" in
4685 echo " You'd better start hunting for one and let me know about it." >&4
4691 case "$gccversion" in
4692 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4694 case "$gccversion" in
4695 '') gccosandvers='' ;;
4696 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4697 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4699 case "$gccosandvers" in
4700 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4701 $osname$osvers) ;; # looking good
4702 $osname*) cat <<EOM >&4
4704 *** WHOA THERE!!! ***
4706 Your gcc has not been compiled for the exact release of
4707 your operating system ($gccosandvers versus $osname$osvers).
4709 In general it is a good idea to keep gcc synchronized with
4710 the operating system because otherwise serious problems
4711 may ensue when trying to compile software, like Perl.
4713 I'm trying to be optimistic here, though, and will continue.
4714 If later during the configuration and build icky compilation
4715 problems appear (headerfile conflicts being the most common
4716 manifestation), I suggest reinstalling the gcc to match
4717 your operating system release.
4721 *) gccosandvers='' ;; # failed to parse, better be silent
4729 # gcc 3.* complain about adding -Idirectories that they already know about,
4730 # so we will take those off from locincpth.
4731 case "$gccversion" in
4733 echo "main(){}">try.c
4734 for incdir in $locincpth; do
4735 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4736 grep '^c[cp]p*[01]: warning: changing search order '`
4737 if test "X$warn" != X; then
4738 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4744 # gcc 4.9 by default does some optimizations that break perl.
4745 # see ticket 121505.
4747 # The -fwrapv disables those optimizations (and probably others,) so
4748 # for gcc 4.9 (and later, since the optimizations probably won't go
4749 # away), add -fwrapv unless the user requests -fno-wrapv, which
4750 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4751 # which turns the overflows -fwrapv ignores into runtime errors.
4752 case "$gccversion" in
4753 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4755 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4756 *) ccflags="$ccflags -fwrapv" ;;
4760 : What should the include directory be ?
4761 : Use sysroot if set, so findhdr looks in the right place.
4763 $echo $n "Hmm... $c"
4764 dflt="$sysroot/usr/include"
4767 if $test -f /bin/mips && /bin/mips; then
4768 echo "Looks like a MIPS system..."
4769 $cat >usr.c <<'EOCP'
4770 #ifdef SYSTYPE_BSD43
4774 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4775 dflt='/bsd43/usr/include'
4779 mips_type='System V'
4781 $rm -f usr.c usr.out
4782 echo "and you're compiling with the $mips_type compiler and libraries."
4786 echo "Doesn't look like a MIPS system."
4796 case "$xxx_prompt" in
4799 rp='Where are the include files you want to use?'
4807 : see how we invoke the C preprocessor
4809 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4810 cat <<'EOT' >testcpp.c
4816 if test ! -f cppstdin; then
4817 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4818 # AIX cc -E doesn't show the absolute headerfile
4819 # locations but we'll cheat by using the -M flag.
4820 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
4822 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4825 echo "Keeping your $hint cppstdin wrapper."
4828 wrapper=`pwd`/cppstdin
4832 if $test "X$cppstdin" != "X" && \
4833 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4834 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4836 echo "You used to use $cppstdin $cppminus so we'll use that again."
4838 '') echo "But let's see if we can live without a wrapper..." ;;
4840 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4841 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4843 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4846 echo "(However, $cpprun $cpplast does not work, let's see...)"
4854 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4861 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4862 $cc -E <testcpp.c >testcpp.out 2>&1; \
4863 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4864 echo "Yup, it does."
4865 x_cpp="$cc $cppflags -E"
4867 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4868 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4869 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4870 echo "Yup, it does."
4871 x_cpp="$cc $cppflags -E"
4873 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4874 $cc -P <testcpp.c >testcpp.out 2>&1; \
4875 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4876 echo "Yipee, that works!"
4877 x_cpp="$cc $cppflags -P"
4879 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4880 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4881 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4882 echo "At long last!"
4883 x_cpp="$cc $cppflags -P"
4885 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4886 $cpp <testcpp.c >testcpp.out 2>&1; \
4887 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4889 x_cpp="$cpp $cppflags"
4891 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4892 $cpp - <testcpp.c >testcpp.out 2>&1; \
4893 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4894 echo "Hooray, it works! I was beginning to wonder."
4895 x_cpp="$cpp $cppflags"
4897 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4898 $wrapper <testcpp.c >testcpp.out 2>&1; \
4899 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4905 rp="No dice. I can't find a C preprocessor. Name one:"
4909 $x_cpp <testcpp.c >testcpp.out 2>&1
4910 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4911 echo "OK, that will do." >&4
4913 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4928 echo "Perhaps can we force $cc -E using a wrapper..."
4929 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4930 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4936 echo "Nope, we'll have to live without it..."
4950 "$wrapper"|'cppstdin') ;;
4951 *) $rm -f $wrapper;;
4953 $rm -f testcpp.c testcpp.out
4955 : Adjust cppfilter for path component separator
4957 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4958 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4962 : Use gcc to determine libpth and incpth
4963 # If using gcc or clang, we can get better values for libpth, incpth
4964 # and usrinc directly from the compiler.
4965 # Note that ccname for clang is also gcc.
4968 $echo 'extern int foo;' > try.c
4969 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4971 if $test $# -gt 0; then
4973 incpth="`$echo $incpth|$sed 's/^ //'`"
4975 j="`$echo $i|$sed 's,/include$,/lib,'`"
4976 if $test -d $j; then
4980 libpth="`$echo $libpth|$sed 's/^ //'`"
4981 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4982 if $test -d $xxx; then
4985 *) libpth="$libpth $xxx";;
4992 '') for i in $incpth; do
4993 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5001 case "$usecrosscompile" in
5004 '') echo "Incpth not defined." >&4; croak=y ;;
5005 *) echo "Using incpth '$incpth'." >&4 ;;
5008 '') echo "Libpth not defined." >&4; croak=y ;;
5009 *) echo "Using libpth '$libpth'." >&4 ;;
5012 '') echo "Usrinc not defined." >&4; croak=y ;;
5013 *) echo "Using usrinc $usrinc." >&4 ;;
5017 if test "X$sysroot" = X; then
5018 echo "Cannot continue, aborting." >&4; exit 1
5020 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5029 : Default value for incpth is just usrinc
5031 '') incpth="$usrinc";;
5034 : Set private lib path
5037 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5042 '') dlist="$loclibpth $plibpth $glibpth";;
5043 *) dlist="$libpth";;
5046 : Now check and see which directories actually exist, avoiding duplicates
5049 if $test -d $xxx; then
5052 *) libpth="$libpth $xxx";;
5058 Some systems have incompatible or broken versions of libraries. Among
5059 the directories listed in the question below, please remove any you
5060 know not to be holding relevant libraries, and add any that are needed.
5061 Say "none" for none.
5065 if test "X$sysroot" != X; then
5067 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5080 rp="Directories to use for library searches?"
5087 : compute shared library extension
5090 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5100 On some systems, shared libraries may be available. Answer 'none' if
5101 you want to suppress searching of shared libraries for the remainder
5102 of this configuration.
5105 rp='What is the file extension used for shared libraries?'
5109 : Does target system insist that shared library basenames are unique
5112 Some dynamic loaders assume that the *basename* of shared library filenames
5113 are globally unique. We'll default this to undef as we assume your system
5114 is not this weird. Set to defined if you're on one of them.
5119 rp='Make shared library basenames unique?'
5122 y|Y) val="$define" ;;
5125 set d_libname_unique
5128 : Define several unixisms.
5129 : Hints files or command line option can be used to override them.
5130 : The convoluted testing is in case hints files set either the old
5133 '') case "$exe_ext" in
5135 *) _exe="$exe_ext" ;;
5140 '') case "$lib_ext" in
5147 '') case "$obj_ext" in
5154 '') case "$path_sep" in
5165 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5167 : Which makefile gets called first. This is used by make depend.
5168 case "$firstmakefile" in
5169 '') firstmakefile='makefile';;
5172 : Check is we will use socks
5174 $define|true|[yY]*) dflt='y';;
5179 Perl can be built to use the SOCKS proxy protocol library. To do so,
5180 Configure must be run with -Dusesocks. If you use SOCKS you also need
5181 to use the PerlIO abstraction layer, this will be implicitly selected.
5183 If this doesn't make any sense to you, just accept the default '$dflt'.
5185 rp='Build Perl for SOCKS?'
5188 y|Y) val="$define" ;;
5194 : Check for uselongdouble support
5196 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5199 case "$uselongdouble" in
5200 $define|true|[yY]*) dflt='y';;
5205 Perl can be built to take advantage of long doubles which
5206 (if available) may give more accuracy and range for floating point numbers.
5208 If this doesn't make any sense to you, just accept the default '$dflt'.
5210 rp='Try to use long doubles if available?'
5213 y|Y) val="$define" ;;
5219 case "$uselongdouble" in
5220 true|[yY]*) uselongdouble="$define" ;;
5223 : Look for a hint-file generated 'call-back-unit'. If the
5224 : user has specified that long doubles should be used,
5225 : we may need to set or change some other defaults.
5226 if $test -f uselongdouble.cbu; then
5227 echo "Your platform has some specific hints regarding long doubles, using them..."
5228 . ./uselongdouble.cbu
5230 case "$uselongdouble" in
5233 (Your platform does not have any specific hints for long doubles.)
5239 : Check if quadmath is requested
5240 case "$usequadmath" in
5241 "$define"|true|[yY]*) usequadmath="$define" ;;
5242 *) usequadmath="$undef" ;;
5245 : Fail if both uselongdouble and usequadmath are requested
5246 case "$usequadmath:$uselongdouble" in
5250 *** You requested the use of the quadmath library and use
5251 *** of long doubles.
5253 *** Please select one or the other.
5259 : Looking for optional libraries
5261 echo "Checking for optional libraries..." >&4
5266 case "$libswanted" in
5267 '') libswanted='c_s';;
5270 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5272 case "$usecbacktrace" in
5273 "$define") libswanted="$libswanted bfd" ;;
5275 case "$usequadmath" in
5276 "$define") libswanted="$libswanted quadmath" ;;
5282 for thisdir in $libpth $xlibpth; do
5283 test -d $thisdir && libspath="$libspath $thisdir"
5285 for thislib in $libswanted; do
5286 for thisdir in $libspath; do
5288 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5289 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5290 $test -f "$xxx" && eval $libscheck
5291 $test -f "$xxx" && libstyle=shared
5292 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5293 $test -f "$xxx" && eval $libscheck
5294 $test -f "$xxx" && libstyle=shared
5296 if test ! -f "$xxx"; then
5297 xxx=$thisdir/lib$thislib.$so
5298 $test -f "$xxx" && eval $libscheck
5299 $test -f "$xxx" && libstyle=shared
5301 if test ! -f "$xxx"; then
5302 xxx=$thisdir/lib$thislib$_a
5303 $test -f "$xxx" && eval $libscheck
5304 $test -f "$xxx" && libstyle=static
5306 if test ! -f "$xxx"; then
5307 xxx=$thisdir/$thislib$_a
5308 $test -f "$xxx" && eval $libscheck
5309 $test -f "$xxx" && libstyle=static
5311 if test ! -f "$xxx"; then
5312 xxx=$thisdir/lib${thislib}_s$_a
5313 $test -f "$xxx" && eval $libscheck
5314 $test -f "$xxx" && libstyle=static
5315 $test -f "$xxx" && thislib=${thislib}_s
5317 if test ! -f "$xxx"; then
5318 xxx=$thisdir/Slib$thislib$_a
5319 $test -f "$xxx" && eval $libscheck
5320 $test -f "$xxx" && libstyle=static
5322 if $test -f "$xxx"; then
5324 shared) echo "Found -l$thislib (shared)." ;;
5325 static) echo "Found -l$thislib." ;;
5326 *) echo "Found -l$thislib ($libstyle)." ;;
5330 *) dflt="$dflt -l$thislib"
5331 libsfound="$libsfound $xxx"
5333 libsfiles="$libsfiles $yyy"
5334 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5335 case " $libsdirs " in
5337 *) libsdirs="$libsdirs $yyy" ;;
5344 if $test ! -f "$xxx"; then
5345 echo "No -l$thislib."
5356 ' '|'') dflt='none';;
5361 In order to compile $package on your machine, a number of libraries
5362 are usually needed. Include any other special libraries here as well.
5363 Say "none" for none. The default list is almost always right.
5367 rp="What libraries to use?"
5374 : determine optimization, if desired, or use for debug flag also
5376 ' '|$undef) dflt='none';;
5378 *) dflt="$optimize";;
5382 By default, $package compiles with the -O flag to use the optimizer.
5383 Alternately, you might want to use the symbolic debugger, which uses
5384 the -g flag (on traditional Unix systems). Either flag can be
5385 specified here. To use neither flag, specify the word "none".
5388 rp="What optimizer/debugger flag should be used?"
5392 'none') optimize=" ";;
5395 : Check what DEBUGGING is required from the command line
5396 : -DEBUGGING or -DDEBUGGING or
5397 : -DEBUGGING=both = -g + -DDEBUGGING
5398 : -DEBUGGING=-g or -Doptimize=-g = -g
5399 : -DEBUGGING=none or -UDEBUGGING =
5400 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5403 *) DEBUGGING=$EBUGGING ;;
5406 case "$DEBUGGING" in
5410 *) optimize="$optimize -g" ;;
5414 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5422 case "$DEBUGGING" in
5423 both|$define) dflt='-DDEBUGGING'
5426 : argument order is deliberate, as the flag will start with - which set could
5427 : think is an option
5428 checkccflag='check=$1; flag=$2; callback=$3;
5430 echo "Checking if your compiler accepts $flag" 2>&1;
5431 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5432 echo "int main(void) { return 0; }" > gcctest.c;
5433 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5434 echo "Yes, it does." 2>&1;
5435 if $test -s gcctest.out ; then
5436 echo "But your platform does not like it:";
5441 echo "Leaving current flags $ccflags alone." 2>&1
5443 *) dflt="$dflt $flag";
5449 echo "Nope, it does not, but that is ok." 2>&1;
5453 : We will not override a previous value, but we might want to
5454 : augment a hint file
5456 default|recommended)
5457 case "$gccversion" in
5458 1*) dflt="$dflt -fpcc-struct-return" ;;
5460 case "$optimize:$DEBUGGING" in
5461 *-g*:old) dflt="$dflt -DDEBUGGING";;
5463 case "$gccversion" in
5464 2*) if $test -d /etc/conf/kconfig.d &&
5465 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5467 # Interactive Systems (ISC) POSIX mode.
5472 case "$gccversion" in
5475 ?*) set strict-aliasing -fno-strict-aliasing
5479 # For gcc, adding -pipe speeds up compilations for some, but apparently
5480 # some assemblers can't read from stdin. (It also slows down compilations
5481 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5482 case "$gccversion" in
5488 # on x86_64 (at least) we require an extra library (libssp) in the
5489 # link command line. This library is not named, so I infer that it is
5490 # an implementation detail that may change. Hence the safest approach
5491 # is to add the flag to the flags passed to the compiler at link time,
5492 # as that way the compiler can do the right implementation dependant
5495 amigaos) ;; # -fstack-protector builds but doesn't work
5496 *) case "$gccversion" in
5497 ?*) set stack-protector-strong -fstack-protector-strong
5500 *-fstack-protector-strong*) ;; # It got added.
5501 *) # Try the plain/older -fstack-protector.
5502 set stack-protector -fstack-protector
5513 case "$mips_type" in
5514 *BSD*|'') inclwanted="$locincpth $usrinc";;
5515 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5517 for thisincl in $inclwanted; do
5518 if $test -d $thisincl; then
5519 if $test x$thisincl != x$usrinc; then
5521 *" -I$thisincl "*);;
5522 *) dflt="$dflt -I$thisincl ";;
5528 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5530 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5538 *) dflt="$dflt -D$2";;
5542 set signal.h LANGUAGE_C; eval $inctest
5546 ccflags="$ccflags -DSOCKS"
5551 default|recommended) dflt="$ccflags $dflt" ;;
5552 *) dflt="$ccflags";;
5561 Your C compiler may want other flags. For this question you should include
5562 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5563 but you should NOT include libraries or ld flags like -lwhatever. If you
5564 want $package to honor its debug switch, you should include -DDEBUGGING here.
5565 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5567 To use no flags, specify the word "none".
5573 rp="Any additional cc flags?"
5580 : the following weeds options from ccflags that are of no interest to cpp
5582 '') cppflags="$ccflags" ;;
5583 *) set X $ccflags; shift
5584 case " $cppflags " in
5585 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5586 *) cppflags="$cppflags $ccflags" ;;
5590 case "$gccversion" in
5591 1*) cppflags="$cppflags -D__GNUC__"
5593 case "$mips_type" in
5595 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5601 echo "Let me guess what the preprocessor flags are..." >&4
5615 *) ftry="$previous $flag";;
5617 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5618 >cpp1.out 2>/dev/null && \
5619 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5620 >cpp2.out 2>/dev/null && \
5621 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5622 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5624 cppflags="$cppflags $ftry"
5634 *-*) echo "They appear to be: $cppflags";;
5636 $rm -f cpp.c cpp?.out
5640 : flags used in final linking phase
5642 '') if ./venix; then
5648 *-posix*) dflt="$dflt -posix" ;;
5651 *) dflt="$ldflags";;
5653 # See note above about -fstack-protector
5655 *-fstack-protector-strong*)
5657 *-fstack-protector-strong*) ;; # Don't add it again
5658 *) dflt="$dflt -fstack-protector-strong" ;;
5661 *-fstack-protector*)
5663 *-fstack-protector*) ;; # Don't add it again
5664 *) dflt="$dflt -fstack-protector" ;;
5669 : Try to guess additional flags to pick up local libraries.
5670 for thislibdir in $libpth; do
5671 case " $loclibpth " in
5674 *"-L$thislibdir "*) ;;
5675 *) dflt="$dflt -L$thislibdir" ;;
5687 Your C linker may need flags. For this question you should
5688 include -L/whatever and any other flags used by the C linker, but you
5689 should NOT include libraries like -lwhatever.
5691 Make sure you include the appropriate -L/path flags if your C linker
5692 does not normally search all of the directories you specified above,
5695 To use no flags, specify the word "none".
5699 rp="Any additional ld flags (NOT including libraries)?"
5705 rmlist="$rmlist pdp11"
5709 echo "Checking your choice of C compiler and flags for coherency..." >&4
5710 $cat > try.c <<'EOF'
5712 int main() { printf("Ok\n"); return(0); }
5714 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5716 $cat >try.msg <<'EOM'
5717 I've tried to compile and run the following simple program:
5720 $cat try.c >> try.msg
5722 $cat >> try.msg <<EOM
5729 and I got the following output:
5733 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5734 if $sh -c "$run ./try " >>try.msg 2>&1; then
5738 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5741 echo "The program compiled OK, but exited with status $?." >>try.msg
5742 rp="You have a problem. Shall I abort Configure"
5746 echo "I can't compile the test program." >>try.msg
5747 rp="You have a BIG problem. Shall I abort Configure"
5753 case "$knowitall" in
5755 echo "(The supplied flags or libraries might be incorrect.)"
5763 *) echo "Ok. Stopping Configure." >&4
5768 n) echo "OK, that should do.";;
5770 $rm_try gcctest gcctest.out
5772 : define a shorthand compile call
5776 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5777 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5781 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5782 : define a shorthand compile call for compilations that should be ok.
5786 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5788 : determine filename position in cpp output
5790 echo "Computing filename position in cpp output for #include directives..." >&4
5792 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5797 vos) testaccess=-e ;;
5800 echo '#include <stdio.h>' > foo.c
5803 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5804 $grep '^[ ]*#.*stdio\.h' | \
5805 while read cline; do
5808 while $test \$# -gt 0; do
5809 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5814 pos=\`expr \$pos + 1\`
5828 *) pos="${fieldn}th";;
5830 echo "Your cpp writes the filename in the $pos field of the line."
5832 : locate header file
5837 for usrincdir in $incpth
5839 if test -f \$usrincdir/\$wanted; then
5840 echo "\$usrincdir/\$wanted"
5844 awkprg='{ print \$$fieldn }'
5845 echo "#include <\$wanted>" > foo\$\$.c
5846 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5847 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5848 while read cline; do
5849 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5851 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5852 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5857 # status = 0: grep returned 0 lines, case statement not executed
5858 # status = 1: headerfile found
5859 # status = 2: while loop executed, no headerfile found
5863 if test \$status -eq 1; then
5870 : define an alternate in-header-list? function
5871 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5872 cont=true; xxf="echo \"<\$1> found.\" >&4";
5873 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5874 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5876 case $# in 4) instead=instead;; *) instead="at last";; esac;
5877 while $test "$cont"; do
5879 var=$2; eval "was=\$$2";
5880 if $test "$xxx" && $test -r "$xxx";
5882 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5885 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5886 set $yyy; shift; shift; yyy=$@;
5887 case $# in 0) cont="";;
5888 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5889 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5890 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5891 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5895 do set $yyy; var=$2; eval "was=\$$2";
5896 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5897 set $yyy; shift; shift; yyy=$@;
5900 : see if stdlib is available
5901 set stdlib.h i_stdlib
5904 : check for lengths of integral types
5908 echo "Checking to see how big your integers are..." >&4
5917 printf("intsize=%d;\n", (int)sizeof(int));
5918 printf("longsize=%d;\n", (int)sizeof(long));
5919 printf("shortsize=%d;\n", (int)sizeof(short));
5924 if eval $compile_ok && $run ./try > /dev/null; then
5926 echo "Your integers are $intsize bytes long."
5927 echo "Your long integers are $longsize bytes long."
5928 echo "Your short integers are $shortsize bytes long."
5932 Help! I can't compile and run the intsize test program: please enlighten me!
5933 (This is probably a misconfiguration in your system or libraries, and
5934 you really ought to fix it. Still, I'll try anyway.)
5938 rp="What is the size of an integer (in bytes)?"
5942 rp="What is the size of a long integer (in bytes)?"
5946 rp="What is the size of a short integer (in bytes)?"
5954 : check for long long
5956 echo "Checking to see if you have long long..." >&4
5957 echo 'int main() { long long x = 7; return 0; }' > try.c
5959 if eval $compile; then
5961 echo "You have long long."
5964 echo "You do not have long long."
5970 : check for length of long long
5971 case "${d_longlong}${longlongsize}" in
5974 echo "Checking to see how big your long longs are..." >&4
5975 $cat >try.c <<'EOCP'
5979 printf("%d\n", (int)sizeof(long long));
5984 if eval $compile_ok; then
5985 longlongsize=`$run ./try`
5986 echo "Your long longs are $longlongsize bytes long."
5990 echo "(I can't seem to compile the test program. Guessing...)"
5991 rp="What is the size of a long long (in bytes)?"
5995 if $test "X$longsize" = "X$longlongsize"; then
5996 echo "(That isn't any different from an ordinary long.)"
6002 : see if inttypes.h is available
6003 : we want a real compile instead of Inhdr because some systems
6004 : have an inttypes.h which includes non-existent headers
6007 #include <inttypes.h>
6009 static int32_t foo32 = 0x12345678;
6013 if eval $compile; then
6014 echo "<inttypes.h> found." >&4
6017 echo "<inttypes.h> NOT found." >&4
6026 echo "Checking to see if you have int64_t..." >&4
6028 #include <sys/types.h>
6029 #$i_inttypes I_INTTYPES
6031 #include <inttypes.h>
6033 int main() { int64_t x = 7; }
6036 if eval $compile; then
6038 echo "You have int64_t."
6041 echo "You do not have int64_t."
6047 : Check if 64bit ints have a quad type
6049 echo "Checking which 64-bit integer type we could use..." >&4
6055 val='"unsigned int"'
6060 *) case "$longsize" in
6064 val='"unsigned long"'
6069 *) case "$d_longlong:$longlongsize" in
6074 val='"unsigned long long"'
6079 *) case "$d_int64_t" in
6098 '') echo "Alas, no 64-bit integer types in sight." >&4
6101 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6106 : Do we want 64bit support
6107 case "$uselonglong" in
6108 "$define"|true|[yY]*)
6111 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6113 use64bitint="$define"
6116 case "$use64bits" in
6117 "$define"|true|[yY]*)
6120 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6122 use64bitint="$define"
6125 case "$use64bitints" in
6126 "$define"|true|[yY]*)
6129 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6131 use64bitint="$define"
6134 case "$use64bitsint" in
6135 "$define"|true|[yY]*)
6138 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6140 use64bitint="$define"
6143 case "$uselonglongs" in
6144 "$define"|true|[yY]*)
6147 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6149 use64bitint="$define"
6152 case "$use64bitsall" in
6153 "$define"|true|[yY]*)
6156 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6158 use64bitall="$define"
6163 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6165 case "$use64bitall" in
6166 "$define"|true|[yY]*) use64bitint="$define" ;;
6172 You have natively 64-bit long integers.
6176 *) case "$use64bitint" in
6177 "$define"|true|[yY]*) dflt='y';;
6186 Perl can be built to take advantage of 64-bit integer types
6187 on some systems. To do so, Configure can be run with -Duse64bitint.
6188 Choosing this option will most probably introduce binary incompatibilities.
6190 If this doesn't make any sense to you, just accept the default '$dflt'.
6191 (The default has been chosen based on your configuration.)
6193 rp='Try to use 64-bit integers, if available?'
6196 [yY]*) val="$define" ;;
6204 case "$use64bitall" in
6205 "$define"|true|[yY]*) dflt='y' ;;
6206 *) case "$longsize" in
6214 You may also choose to try maximal 64-bitness. It means using as much
6215 64-bitness as possible on the platform. This in turn means even more
6216 binary incompatibilities. On the other hand, your platform may not
6217 have any more 64-bitness available than what you already have chosen.
6219 If this doesn't make any sense to you, just accept the default '$dflt'.
6220 (The default has been chosen based on your configuration.)
6222 rp='Try to use maximal 64-bit support, if available?'
6225 [yY]*) val="$define" ;;
6230 case "$use64bitall" in
6232 case "$use64bitint" in
6236 Since you have chosen a maximally 64-bit build, I'm also turning on
6237 the use of 64-bit integers.
6239 use64bitint="$define" ;;
6244 : Look for a hint-file generated 'call-back-unit'. If the
6245 : user has specified that a 64-bit perl is to be built,
6246 : we may need to set or change some other defaults.
6247 if $test -f use64bitint.cbu; then
6248 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6251 case "$use64bitint" in
6252 "$define"|true|[yY]*)
6253 : This test was common to all the OpenBSD forks, and seems harmless for
6256 echo "Checking if your C library has broken 64-bit functions..." >&4
6259 typedef $uquadtype myULL;
6266 {4294967303.15, 4294967303ULL},
6267 {4294967294.2, 4294967294ULL},
6268 {4294967295.7, 4294967295ULL},
6271 for (p = test; p->u; p++) {
6272 myULL x = (myULL)p->d;
6283 if eval $compile_ok; then
6284 libcquad=`$run ./try`
6285 echo "Your C library's 64-bit functions are $libcquad."
6287 echo "(I can't seem to compile the test program.)"
6288 echo "Assuming that your C library's 64-bit functions are ok."
6297 *** You have a C library with broken 64-bit functions.
6298 *** 64-bit support does not work reliably in this configuration.
6299 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6300 *** Cannot continue, aborting.
6307 4) case "$archname64" in
6308 '') archname64=64int ;;
6315 : Look for a hint-file generated 'call-back-unit'. If the
6316 : user has specified that a maximally 64-bit perl is to be built,
6317 : we may need to set or change some other defaults.
6318 if $test -f use64bitall.cbu; then
6319 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6322 case "$use64bitall" in
6323 "$define"|true|[yY]*)
6325 4) case "$archname64" in
6326 ''|64int) archname64=64all ;;
6333 case "$d_quad:$use64bitint" in
6337 *** You have chosen to use 64-bit integers,
6338 *** but none can be found.
6339 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6340 *** Cannot continue, aborting.
6347 : Check if we are using the GNU C library
6349 echo "Checking for GNU C Library..." >&4
6351 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6352 alone are insufficient to distinguish different versions, such as
6353 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6354 libc version 2.1.0. A. Dougherty, June 3, 2002.
6360 # ifdef __GLIBC_MINOR__
6361 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6362 # include <gnu/libc-version.h>
6363 printf("%s\n", gnu_get_libc_version());
6365 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6368 printf("%d\n", __GLIBC__);
6377 if eval $compile_ok && $run ./try > glibc.ver; then
6379 gnulibc_version=`$cat glibc.ver`
6380 echo "You are using the GNU C Library version $gnulibc_version"
6384 echo "You are not using the GNU C Library"
6390 : see if nm is to be used to determine whether a symbol is defined or not
6394 case "$d_gnulibc" in
6397 echo "nm probably won't work on the GNU C Library." >&4
6403 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6405 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6406 echo "'nm' won't be sufficient on this system." >&4
6412 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6413 if $test $dflt -gt 20; then
6423 true|$define) dflt=y;;
6430 I can use $nm to extract the symbols from your C libraries. This
6431 is a time consuming task which may generate huge output on the disk (up
6432 to 3 megabytes) but that should make the symbols extraction faster. The
6433 alternative is to skip the 'nm' extraction part and to compile a small
6434 test program instead to determine whether each symbol is present. If
6435 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6436 this may be the best solution.
6438 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6441 rp="Shall I use $nm to extract C symbols from the libraries?"
6444 [Nn]*) usenm=false;;
6453 : nm options which may be necessary
6455 '') if $test -f /mach_boot; then
6457 elif $test -d /usr/ccs/lib; then
6458 nm_opt='-p' # Solaris (and SunOS?)
6459 elif $test -f /dgux; then
6461 elif $test -f /lib64/rld; then
6462 nm_opt='-p' # 64-bit Irix
6468 : nm options which may be necessary for shared libraries but illegal
6469 : for archive libraries. Thank you, Linux.
6470 case "$nm_so_opt" in
6471 '') case "$myuname" in
6473 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6474 nm_so_opt='--dynamic'
6481 : Figure out where the libc is located
6484 : get list of predefined functions in a handy place
6489 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6495 *) for thislib in $libs; do
6498 : Handle C library specially below.
6501 thislib=`echo $thislib | $sed -e 's/^-l//'`
6502 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6504 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6506 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6508 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6510 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6512 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6514 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6519 libnames="$libnames $try"
6521 *) libnames="$libnames $thislib" ;;
6530 for xxx in $libpth; do
6531 $test -r $1 || set $xxx/libc.$so
6532 : The messy sed command sorts on library version numbers.
6534 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6535 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6537 s/[0-9][0-9]*/0000&/g
6538 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6541 $sort | $sed -e 's/^.* //'`
6544 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6545 $test -r $1 || set $sysroot/lib/libsys_s$_a
6551 if $test -r "$1"; then
6552 echo "Your (shared) C library seems to be in $1."
6554 elif $test -r /lib/libc && $test -r /lib/clib; then
6555 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6557 libc='/lib/clib /lib/libc'
6558 if $test -r /lib/syslib; then
6559 echo "(Your math library is in /lib/syslib.)"
6560 libc="$libc /lib/syslib"
6562 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6563 echo "Your C library seems to be in $libc, as you said before."
6564 elif $test -r $incpath/usr/lib/libc$_a; then
6565 libc=$incpath/usr/lib/libc$_a;
6566 echo "Your C library seems to be in $libc. That's fine."
6567 elif $test -r /lib/libc$_a; then
6569 echo "Your C library seems to be in $libc. You're normal."
6571 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6573 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6574 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6575 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6577 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6579 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6582 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6584 if $test -r "$tans"; then
6585 echo "Your C library seems to be in $tans, of all places."
6591 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6595 If the guess above is wrong (which it might be if you're using a strange
6596 compiler, or your machine supports multiple models), you can override it here.
6601 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6603 I can't seem to find your C library. I've looked in the following places:
6606 $sed 's/^/ /' libpath
6609 None of these seems to contain your C library. I need to get its name...
6614 rp='Where is your C library?'
6619 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6620 set X `cat libnames`
6623 case $# in 1) xxx=file; esac
6624 echo "Extracting names from the following $xxx for later perusal:" >&4
6626 $sed 's/^/ /' libnames >&4
6628 $echo $n "This may take a while...$c" >&4
6632 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6633 *) $nm $nm_opt $file 2>/dev/null;;
6638 $grep fprintf libc.tmp > libc.ptf
6639 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6640 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6642 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6646 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6650 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6654 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6658 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6662 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6666 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6667 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6671 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6675 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6679 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6683 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6687 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6691 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6695 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6700 $nm -p $* 2>/dev/null >libc.tmp
6701 $grep fprintf libc.tmp > libc.ptf
6702 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6703 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6709 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6711 if $ar t $libc > libc.tmp && \
6712 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6714 for thisname in $libnames $libc; do
6715 $ar t $thisname >>libc.tmp
6717 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6719 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6720 for thisname in $libnames $libc; do
6721 $ar tv $thisname >>libc.tmp
6722 emximp -o tmp.imp $thisname \
6724 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6725 < tmp.imp >>libc.tmp
6728 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6731 echo "$ar didn't seem to work right." >&4
6732 echo "Maybe this is a Cray...trying bld instead..." >&4
6734 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6737 for thisname in $libnames; do
6739 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6740 $ar t $thisname >>libc.tmp
6744 echo "That didn't work either. Giving up." >&4
6754 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6755 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6757 *) if $test -f /lib/syscalls.exp; then
6759 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6760 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6761 /lib/syscalls.exp >>libc.list
6767 $rm -f libnames libpath
6769 : Check if we are using C++
6771 echo "Checking for C++..." >&4
6772 $cat >try.c <<'EOCP'
6784 if eval $compile_ok && $run ./try; then
6786 echo "You are using a C++ compiler."
6789 echo "You are not using a C++ compiler."
6795 : is a C symbol defined?
6798 -v) tf=libc.tmp; tdc="";;
6799 -a) tf=libc.tmp; tdc="[]";;
6800 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6802 case "$d_cplusplus" in
6803 $define) extern_C="extern \"C\"" ;;
6804 *) extern_C="extern" ;;
6807 case "$reuseval-$4" in
6809 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6814 if $test "$runnm" = true; then
6815 if $contains $tlook $tf >/dev/null 2>&1; then
6817 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6818 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;
6819 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6820 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6824 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;
6825 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6831 $define) tval=true;;
6838 : define an is-in-libc? function
6839 inlibc='echo " "; td=$define; tu=$undef;
6840 sym=$1; var=$2; eval "was=\$$2";
6842 case "$reuseval$was" in
6852 echo "$sym() found." >&4;
6853 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6855 echo "$sym() NOT found." >&4;
6856 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6860 $define) echo "$sym() found." >&4;;
6861 *) echo "$sym() NOT found." >&4;;
6865 : check for length of double
6867 case "$doublesize" in
6869 echo "Checking to see how big your double precision numbers are..." >&4
6878 printf("%d\n", (int)sizeof(double));
6883 if eval $compile_ok; then
6884 doublesize=`$run ./try`
6885 echo "Your double is $doublesize bytes long."
6888 echo "(I can't seem to compile the test program. Guessing...)"
6889 rp="What is the size of a double precision number (in bytes)?"
6897 : see if this is a float.h system
6901 : check for long doubles
6903 echo "Checking to see if you have long double..." >&4
6904 echo 'int main() { long double x = 7.0; }' > try.c
6906 if eval $compile; then
6908 echo "You have long double."
6911 echo "You do not have long double."
6917 : see if ldexpl exists
6921 : check for length of long double
6922 case "${d_longdbl}${longdblsize}" in
6925 echo "Checking to see how big your long doubles are..." >&4
6926 $cat >try.c <<'EOCP'
6930 printf("%d\n", sizeof(long double));
6935 if eval $compile; then
6936 longdblsize=`$run ./try`
6937 echo "Your long doubles are $longdblsize bytes long."
6941 echo "(I can't seem to compile the test program. Guessing...)" >&4
6942 rp="What is the size of a long double (in bytes)?"
6946 if $test "X$doublesize" = "X$longdblsize"; then
6947 echo "That isn't any different from an ordinary double."
6948 echo "I'll keep your setting anyway, but you may see some"
6949 echo "harmless compilation warnings."
6955 $echo "Checking the kind of long doubles you have..." >&4
6956 case "$d_longdbl" in
6961 #define LONGDBLSIZE $longdblsize
6962 #define DOUBLESIZE $doublesize
6970 static const long double d = -0.1L;
6972 unsigned const char* b = (unsigned const char*)(&d);
6973 #if DOUBLESIZE == LONGDBLSIZE
6974 printf("0\n"); /* if it floats like double */
6977 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6978 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6979 /* IEEE 754 128-bit little-endian */
6983 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6984 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6989 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6990 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6991 * cannot be trusted. */
6992 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6993 if (b[0] == 0xCD && b[9] == 0xBF) {
6994 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6995 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6996 * Also known as "extended precision". */
7000 if (b[0] == 0xBF && b[9] == 0xCD) {
7001 /* Is there ever big-endian 80-bit, really?
7003 * The Motorola 68881 had another "extended precision" format:
7004 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7005 * for total of 96 bits of bytes. The zero bits were unused.
7006 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7007 * If it ever becomes relevant, this format should be allocated
7008 * a new doublekind code since it's quite different from the Intel x87.
7014 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7015 /* software "double double", the 106 is 53+53.
7016 * but irix thinks it is 107. */
7017 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7018 /* double double 128-bit fully little-endian,
7019 * little-endian doubles in little-endian order,
7020 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7024 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7025 /* double double 128-bit fully big-endian,
7026 * big-endian doubles in big-endian order,
7027 * e.g. PPC/Power and MIPS:
7028 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7032 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7033 /* double double 128-bit mixed endian.
7034 * little-endian doubles in big-endian order,
7036 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7040 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7041 /* double double 128-bit mixed endian,
7042 * big-endian doubles in little-endian order,
7043 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7048 /* We are largely making this up because it may well be
7049 * that the VAX format H was never made available to C,
7050 * only to Fortran. */
7051 #if LONGDBLSIZE == 16 && defined(__vax__)
7052 if (b[0] == 0xFD && b[15] == 0x99) {
7053 /* VAX format H, PDP-11 mixed endian. */
7058 printf("-1\n"); /* unknown */
7063 if eval $compile; then
7064 longdblkind=`$run ./try`
7071 case "$longdblkind" in
7072 0) echo "Your long doubles are doubles." >&4 ;;
7073 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7074 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7075 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7076 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7077 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7078 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7079 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7080 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7081 9) echo "You have 128-bit PDP-style mixed-endian long doubles." >& 4 ;;
7082 *) echo "Cannot figure out your long double." >&4 ;;
7086 : determine the architecture name
7088 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7089 tarch=`arch`"-$osname"
7090 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7091 if uname -m > tmparch 2>&1 ; then
7092 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7093 -e 's/$/'"-$osname/" tmparch`
7101 case "$myarchname" in
7104 echo "(Your architecture name used to be $myarchname.)"
7108 case "$targetarch" in
7110 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7115 *) dflt="$archname";;
7117 rp='What is your architecture name'
7121 : optionally add API version to the architecture for versioned archlibs
7122 case "$useversionedarchname" in
7123 $define|true|[yY]*) dflt='y';;
7126 rp='Add the Perl API version to your archname?'
7129 y|Y) useversionedarchname="$define" ;;
7130 *) useversionedarchname="$undef" ;;
7132 case "$useversionedarchname" in
7135 *-$api_versionstring)
7136 echo "...and architecture name already has -$api_versionstring" >&4
7139 archname="$archname-$api_versionstring"
7140 echo "...setting architecture name to $archname." >&4
7146 case "$usethreads" in
7148 echo "Threads selected." >&4
7150 *-thread*) echo "...and architecture name already has -thread." >&4
7152 *) archname="$archname-thread"
7153 echo "...setting architecture name to $archname." >&4
7158 case "$usemultiplicity" in
7160 echo "Multiplicity selected." >&4
7162 *-multi*) echo "...and architecture name already has -multi." >&4
7164 *) archname="$archname-multi"
7165 echo "...setting architecture name to $archname." >&4
7170 case "$use64bitint$use64bitall" in
7172 case "$archname64" in
7174 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7177 case "$use64bitint" in
7178 "$define") echo "64 bit integers selected." >&4 ;;
7180 case "$use64bitall" in
7181 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7184 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7186 *) archname="$archname-$archname64"
7187 echo "...setting architecture name to $archname." >&4
7193 case "$uselongdouble" in
7195 echo "Long doubles selected." >&4
7196 case "$longdblsize" in
7198 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7202 *-ld*) echo "...and architecture name already has -ld." >&4
7204 *) archname="$archname-ld"
7205 echo "...setting architecture name to $archname." >&4
7212 case "$usequadmath" in
7214 echo "quadmath selected." >&4
7216 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7218 *) archname="$archname-quadmath"
7219 echo "...setting architecture name to $archname." >&4
7224 if $test -f archname.cbu; then
7225 echo "Your platform has some specific hints for architecture name, using them..."
7229 : set the prefixit variable, to compute a suitable default value
7230 prefixit='case "$3" in
7232 case "$oldprefix" in
7233 "") eval "$1=\"\$$2\"";;
7240 ""|" ") eval "$1=\"\$$2\"";;
7246 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7248 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7249 /*-$oldprefix/*|\~*-$oldprefix/*)
7250 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7251 *) eval "$1=\"\$$2\"";;
7255 : determine installation style
7256 : For now, try to deduce it from prefix unless it is already set.
7257 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7258 case "$installstyle" in
7259 '') case "$prefix" in
7260 *perl*) dflt='lib';;
7261 *) dflt='lib/perl5' ;;
7264 *) dflt="$installstyle" ;;
7266 : Probably not worth prompting for this since we prompt for all
7267 : the directories individually, and the prompt would be too long and
7271 : determine where public executables go
7276 rp='Pathname where the public executables will reside?'
7278 if $test "X$ansexp" != "X$binexp"; then
7282 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7283 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7284 : this via initialinstalllocation
7287 case "$userelocatableinc" in
7288 $define|true|[yY]*) dflt='y' ;;
7293 Would you like to build Perl so that the installation is relocatable, so that
7294 library paths in @INC are determined relative to the path of the perl binary?
7295 This is not advised for system Perl installs, or if you need to run setid
7296 scripts or scripts under taint mode.
7298 If this doesn't make any sense to you, just accept the default '$dflt'.
7300 rp='Use relocatable @INC?'
7303 y|Y) val="$define" ;;
7306 set userelocatableinc
7309 initialinstalllocation="$binexp"
7310 : Default prefix is now "up one level from where the binaries are"
7311 case "$userelocatableinc" in
7317 installprefixexp=".../.."
7321 : determine where private library files go
7322 : Usual default is /usr/local/lib/perl5/$version.
7323 : Also allow things like /opt/perl/lib/$version, since
7324 : /opt/perl/lib/perl5... would be redundant.
7325 : The default "style" setting is made in installstyle.U
7326 case "$installstyle" in
7327 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7328 *) set dflt privlib lib/$version ;;
7333 There are some auxiliary files for $package that need to be put into a
7334 private library directory that is accessible by everyone.
7339 rp='Pathname where the private library files will reside?'
7344 : set the prefixup variable, to restore leading tilda escape
7345 prefixup='case "$prefixexp" in
7347 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7350 : determine where public architecture dependent libraries go
7353 : privlib default is /usr/local/lib/$package/$version
7354 : archlib default is /usr/local/lib/$package/$version/$archname
7355 : privlib may have an optional trailing /share.
7356 tdflt=`echo $privlib | $sed 's,/share$,,'`
7357 tdflt=$tdflt/$archname
7366 $spackage contains architecture-dependent library files. If you are
7367 sharing libraries in a heterogeneous environment, you might store
7368 these files in a separate location. Otherwise, you can just include
7369 them with the rest of the public library files.
7374 rp='Where do you want to put the public architecture-dependent libraries?'
7378 if $test X"$archlib" = X"$privlib"; then
7384 : see if setuid scripts can be secure
7387 Some kernels have a bug that prevents setuid #! scripts from being
7388 secure. Some sites have disabled setuid #! scripts because of this.
7390 First let's decide if your kernel supports secure setuid #! scripts.
7391 (If setuid #! scripts would be secure but have been disabled anyway,
7392 don't say that they are secure if asked.)
7397 if $test -d /dev/fd; then
7398 echo "#!$ls" >reflect
7399 chmod +x,u+s reflect
7400 ./reflect >flect 2>&1
7401 if $contains "/dev/fd" flect >/dev/null; then
7402 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7406 If you are not sure if they are secure, I can check but I'll need a
7407 username and password different from the one you are using right now.
7408 If you don't have such a username or don't want me to test, simply
7412 rp='Other username to test security of setuid scripts with?'
7417 case "$d_suidsafe" in
7418 '') echo "I'll assume setuid scripts are *not* secure." >&4
7421 echo "Well, the $hint value is *not* secure." >&4
7423 *) echo "Well, the $hint value *is* secure." >&4
7428 $rm -f reflect flect
7429 echo "#!$ls" >reflect
7430 chmod +x,u+s reflect
7433 echo '"su" will (probably) prompt you for '"$ans's password."
7434 su $ans -c './reflect >flect'
7435 if $contains "/dev/fd" flect >/dev/null; then
7436 echo "Okay, it looks like setuid scripts are secure." >&4
7439 echo "I don't think setuid scripts are secure." >&4
7444 rp='Does your kernel have *secure* setuid scripts?'
7447 [yY]*) val="$define";;
7452 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7453 echo "(That's for file descriptors, not floppy disks.)"
7459 $rm -f reflect flect
7461 : now see if they want to do setuid emulation
7462 if $test $patchlevel -lt 11; then
7465 case "$d_suidsafe" in
7468 echo "No need to emulate SUID scripts since they are secure here." >&4
7472 Some systems have disabled setuid scripts, especially systems where
7473 setuid scripts cannot be secure. On systems where setuid scripts have
7474 been disabled, the setuid/setgid bits on scripts are currently
7475 useless. It is possible for $package to detect those bits and emulate
7476 setuid/setgid in a secure fashion. This emulation will only work if
7477 setuid scripts have been disabled in your kernel.
7481 "$define") dflt=y ;;
7484 rp="Do you want to do setuid/setgid emulation?"
7487 [yY]*) val="$define";;
7499 SUID emulation has been removed for 5.12
7500 Please re-run Configure without -Dd_dosuid
7509 : Find perl5.005 or later.
7510 echo "Looking for a previously installed perl5.005 or later... "
7512 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7513 : Check if this perl is recent and can load a simple module
7514 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7517 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7527 '') echo "None found. That's ok.";;
7528 *) echo "Using $perl5." ;;
7531 : Set the siteprefix variables
7534 After $package is installed, you may wish to install various
7535 add-on modules and utilities. Typically, these add-ons will
7536 be installed under $prefix with the rest
7537 of this package. However, you may wish to install such add-ons
7538 elsewhere under a different prefix.
7540 If you do not wish to put everything under a single prefix, that's
7541 ok. You will be prompted for the individual locations; this siteprefix
7542 is only used to suggest the defaults.
7544 The default should be fine for most people.
7548 rp='Installation prefix to use for add-on modules and utilities?'
7549 : XXX Here might be another good place for an installstyle setting.
7550 case "$siteprefix" in
7552 *) dflt=$siteprefix ;;
7555 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7557 case "$siteprefix" in
7561 *) oldsiteprefix="$prefix";;
7566 siteprefixexp="$ansexp"
7568 : determine where site specific libraries go.
7569 : Usual default is /usr/local/lib/perl5/site_perl/$version
7570 : The default "style" setting is made in installstyle.U
7571 : XXX No longer works with Prefixit stuff.
7572 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7574 '') case "$installstyle" in
7575 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7576 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7584 The installation process will create a directory for
7585 site-specific extensions and modules. Most users find it convenient
7586 to place all site-specific files in this directory rather than in the
7587 main distribution directory.
7591 rp='Pathname for the site-specific library files?'
7595 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7597 : Determine list of previous versions to include in @INC
7598 $cat > getverlist <<EOPL
7601 \$api_versionstring = "$api_versionstring";
7602 \$version = "$version";
7603 \$stem = "$sitelib_stem";
7604 \$archname = "$archname";
7606 $cat >> getverlist <<'EOPL'
7607 # The list found is store twice for each entry: the original name, and
7608 # the binary broken down version as pack "sss", so sorting is easy and
7609 # unambiguous. This will work for all versions that have a maximum of
7610 # three digit groups, separate by '.'s or '_'s. Names are extended with
7611 # ".0.0" to ensure at least three elements for the pack.
7612 # -- H.Merijn Brand (m)'06 23-10-2006
7614 # Can't have leading @ because metaconfig interprets it as a command!
7615 ;@inc_version_list=();
7616 # XXX Redo to do opendir/readdir?
7619 ;@candidates = map {
7620 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7621 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7627 ($pversion, $aversion, $vsn5005) = map {
7628 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7629 foreach $d (@candidates) {
7630 if ($d->[1] lt $pversion) {
7631 if ($d->[1] ge $aversion) {
7632 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7634 elsif ($d->[1] ge $vsn5005) {
7635 unshift(@inc_version_list, grep { -d } $d->[0]);
7639 # Skip newer version. I.e. don't look in
7640 # 5.7.0 if we're installing 5.6.1.
7644 if (@inc_version_list) {
7645 print join(' ', @inc_version_list);
7648 # Blank space to preserve value for next Configure run.
7653 case "$inc_version_list" in
7654 '') if test -x "$perl5$exe_ext"; then
7655 dflt=`$perl5 getverlist`
7660 $undef) dflt='none' ;;
7661 *) eval dflt=\"$inc_version_list\" ;;
7664 ''|' ') dflt=none ;;
7671 In order to ease the process of upgrading, this version of perl
7672 can be configured to use modules built and installed with earlier
7673 versions of perl that were installed under $prefix. Specify here
7674 the list of earlier versions that this version of perl should check.
7675 If Configure detected no earlier versions of perl installed under
7676 $prefix, then the list will be empty. Answer 'none' to tell perl
7677 to not search earlier versions.
7679 The default should almost always be sensible, so if you're not sure,
7680 just accept the default.
7683 rp='List of earlier versions to include in @INC?'
7686 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7687 *) inc_version_list="$ans" ;;
7689 case "$inc_version_list" in
7691 inc_version_list_init='0'
7692 d_inc_version_list="$undef"
7694 *) inc_version_list_init=`echo $inc_version_list |
7695 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7696 d_inc_version_list="$define"
7701 : see if malloc/malloc.h has to be included
7702 set malloc/malloc.h i_mallocmalloc
7705 : see if this is a malloc.h system
7706 : we want a real compile instead of Inhdr because some systems have a
7707 : malloc.h that just gives a compile error saying to use stdlib.h instead
7712 #$i_mallocmalloc I_MALLOCMALLOC
7713 #ifdef I_MALLOCMALLOC
7714 # include <malloc/malloc.h>
7717 int main () { return 0; }
7720 if eval $compile; then
7721 echo "<malloc.h> found." >&4
7724 echo "<malloc.h> NOT found." >&4
7731 : check for length of pointer
7735 echo "Checking to see how big your pointers are..." >&4
7744 printf("%d\n", (int)sizeof(void *));
7749 if eval $compile_ok; then
7750 ptrsize=`$run ./try`
7751 echo "Your pointers are $ptrsize bytes long."
7754 echo "(I can't seem to compile the test program. Guessing...)" >&4
7755 rp="What is the size of a pointer (in bytes)?"
7762 case "$use64bitall" in
7763 "$define"|true|[yY]*)
7767 *** You have chosen a maximally 64-bit build,
7768 *** but your pointers are only 4 bytes wide.
7769 *** Please rerun Configure without -Duse64bitall.
7774 *** Since you have quads, you could possibly try with -Duse64bitint.
7779 *** Cannot continue, aborting.
7790 : determine whether to use malloc wrapping
7792 case "$usemallocwrap" in
7793 [yY]*|true|$define) dflt='y' ;;
7794 [nN]*|false|$undef) dflt='n' ;;
7795 *) case "$usedevel" in
7796 [yY]*|true|$define) dflt='y' ;;
7801 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7803 usemallocwrap="$ans"
7806 usemallocwrap="$define" ;;
7808 usemallocwrap="$undef" ;;
7811 : determine which malloc to compile in
7813 case "$usemymalloc" in
7814 [yY]*|true|$define) dflt='y' ;;
7815 [nN]*|false|$undef) dflt='n' ;;
7816 *) case "$ptrsize" in
7820 if test "$useithreads" = "$define"; then dflt='n'; fi
7823 rp="Do you wish to attempt to use the malloc that comes with $package?"
7829 mallocsrc='malloc.c'
7830 mallocobj="malloc$_o"
7831 d_mymalloc="$define"
7834 : Remove malloc from list of libraries to use
7835 echo "Removing unneeded -lmalloc from library list" >&4
7836 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7839 echo "libs = $libs" >&4
7851 : compute the return types of malloc and free
7853 $cat >malloc.c <<END
7857 #include <sys/types.h>
7871 case "$malloctype" in
7873 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7880 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7884 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7891 echo "Your system uses $freetype free(), it would seem." >&4
7893 : determine where site specific architecture-dependent libraries go.
7894 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7895 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7896 : sitelib may have an optional trailing /share.
7898 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7899 dflt="$dflt/$archname"
7904 set sitearch sitearch none
7908 The installation process will also create a directory for
7909 architecture-dependent site-specific extensions and modules.
7913 rp='Pathname for the site-specific architecture-dependent library files?'
7917 if $test X"$sitearch" = X"$sitelib"; then
7920 d_sitearch="$define"
7923 : Set the vendorprefix variables
7926 The installation process will also create a directory for
7927 vendor-supplied add-ons. Vendors who supply perl with their system
7928 may find it convenient to place all vendor-supplied files in this
7929 directory rather than in the main distribution directory. This will
7930 ease upgrades between binary-compatible maintenance versions of perl.
7932 Of course you may also use these directories in whatever way you see
7933 fit. For example, you might use them to access modules shared over a
7934 company-wide network.
7936 The default answer should be fine for most people.
7937 This causes further questions about vendor add-ons to be skipped
7938 and no vendor-specific directories will be configured for perl.
7941 rp='Do you want to configure vendor-specific add-on directories?'
7942 case "$usevendorprefix" in
7943 define|true|[yY]*) dflt=y ;;
7944 *) : User may have set vendorprefix directly on Configure command line.
7945 case "$vendorprefix" in
7954 rp='Installation prefix to use for vendor-supplied add-ons?'
7955 case "$vendorprefix" in
7956 '') dflt="$prefix" ;;
7957 *) dflt=$vendorprefix ;;
7960 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7962 case "$vendorprefix" in
7966 *) oldvendorprefix="$prefix";;
7970 usevendorprefix="$define"
7972 vendorprefixexp="$ansexp"
7974 *) usevendorprefix="$undef"
7980 : Set the vendorlib variables
7981 case "$vendorprefix" in
7982 '') d_vendorlib="$undef"
7986 *) d_vendorlib="$define"
7987 : determine where vendor-supplied modules go.
7988 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7989 case "$vendorlib" in
7991 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7992 case "$installstyle" in
7993 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7994 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7997 *) dflt="$vendorlib"
8001 rp='Pathname for the vendor-supplied library files?'
8004 vendorlibexp="$ansexp"
8007 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8011 : Set the vendorarch variables
8012 case "$vendorprefix" in
8013 '') d_vendorarch="$undef"
8017 *) d_vendorarch="$define"
8018 : determine where vendor-supplied architecture-dependent libraries go.
8019 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8020 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8021 : vendorlib may have an optional trailing /share.
8022 case "$vendorarch" in
8023 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8024 dflt="$dflt/$archname"
8026 *) dflt="$vendorarch" ;;
8029 rp='Pathname for vendor-supplied architecture-dependent files?'
8032 vendorarchexp="$ansexp"
8035 prefixvar=vendorarch
8037 if $test X"$vendorarch" = X"$vendorlib"; then
8038 d_vendorarch="$undef"
8040 d_vendorarch="$define"
8043 : Final catch-all directories to search
8046 Lastly, you can have perl look in other directories for extensions and
8047 modules in addition to those already specified.
8048 These directories will be searched after
8052 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8053 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8055 case "$otherlibdirs" in
8056 ''|' ') dflt='none' ;;
8057 *) dflt="$otherlibdirs" ;;
8060 Enter a colon-separated set of extra paths to include in perl's @INC
8061 search path, or enter 'none' for no extra paths.
8065 rp='Colon-separated list of additional directories for perl to search?'
8068 ' '|''|none) otherlibdirs=' ' ;;
8069 *) otherlibdirs="$ans" ;;
8071 case "$otherlibdirs" in
8075 set d_perl_otherlibdirs
8078 : Cruising for prototypes
8080 echo "Checking out function prototypes..." >&4
8081 $cat >prototype.c <<EOCP
8086 int main(int argc, char *argv[]) {
8089 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8090 echo "Your C compiler appears to support function prototypes."
8093 echo "Your C compiler doesn't seem to understand function prototypes."
8100 : Check if ansi2knr is required
8101 case "$prototype" in
8103 *) ansi2knr='ansi2knr'
8108 This version of $package can only be compiled by a compiler that
8109 understands function prototypes. Unfortunately, your C compiler
8111 doesn't seem to understand them. Sorry about that.
8113 If GNU cc is available for your system, perhaps you could try that instead.
8115 Eventually, we hope to support building Perl with pre-ANSI compilers.
8116 If you would like to help in that effort, please contact <perlbug@perl.org>.
8118 Aborting Configure now.
8125 dflt_dtrace='/usr/sbin/dtrace'
8126 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8130 Perl can be built to support DTrace on platforms that support it.
8131 DTrace is a diagnosis and performance analysis tool from Sun.
8133 If this doesn't make any sense to you, just accept the default.
8137 case "$usedtrace" in
8143 dflt_dtrace=$usedtrace
8150 rp='Support DTrace if available?'
8153 y|Y) val="$define" ;;
8159 test "X$usedtrace" != "X$define" && break
8162 rp='Where is the dtrace executable?'
8171 if $dtrace -h -s ../perldtrace.d \
8172 -o perldtrace.tmp >/dev/null 2>&1 \
8173 && rm -f perldtrace.tmp
8176 echo "Good: your $dtrace knows about the -h flag."
8180 *** $me: Fatal Error: $dtrace doesn't support -h flag
8182 *** Your installed dtrace doesn't support the -h switch to compile a D
8183 *** program into a C header. Can't continue.
8195 *** $me: Fatal Error: $dtrace not found.
8202 echo "*** $dtrace was not found."
8208 : See if we want extra modules installed
8215 Perl can be built with extra modules or bundles of modules which
8216 will be fetched from the CPAN and installed alongside Perl.
8218 Notice that you will need access to the CPAN; either via the Internet,
8219 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8220 be asked later to configure the CPAN.pm module which will in turn do
8221 the installation of the rest of the extra modules or bundles.)
8223 Notice also that if the modules require any external software such as
8224 libraries and headers (the libz library and the zlib.h header for the
8225 Compress::Zlib module, for example) you MUST have any such software
8226 already installed, this configuration process will NOT install such
8229 If this doesn't make any sense to you, just accept the default '$dflt'.
8231 rp='Install any extra modules (y or n)?'
8237 Please list any extra modules or bundles to be installed from CPAN,
8238 with spaces between the names. The names can be in any format the
8239 'install' command of CPAN.pm will understand. (Answer 'none',
8240 without the quotes, to install no extra modules or bundles.)
8250 $rm -f ../extras.lst
8252 *) echo "(Saving the list of extras for later...)"
8253 echo "$extras" > ../extras.lst
8261 : determine where html pages for programs go
8262 set html1dir html1dir none
8266 If you wish to install html files for programs in $spackage, indicate
8267 the appropriate directory here. To skip installing html files,
8271 ''|none|$undef|' ') dflt=none ;;
8272 *) dflt=$html1dir ;;
8275 rp="Directory for the main $spackage html pages?"
8279 : Use ' ' for none so value is preserved next time through Configure
8280 $test X"$html1dir" = "X" && html1dir=' '
8282 : determine where html pages for libraries and modules go
8283 set html3dir html3dir none
8287 If you wish to install html files for modules associated with $spackage,
8288 indicate the appropriate directory here. To skip installing html files,
8291 : There is no obvious default. If they have specified html1dir, then
8292 : try to key off that, possibly changing .../html1 into .../html3.
8294 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8295 *) dflt=$html3dir ;;
8298 rp="Directory for the $spackage module html pages?"
8302 : Use ' ' for none so value is preserved next time through Configure
8303 $test X"$html3dir" = "X" && html3dir=' '
8305 : determine whether to install perl also as /usr/bin/perl
8308 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8310 Many scripts expect perl to be installed as /usr/bin/perl.
8312 If you want to, I can install the perl you are about to compile
8313 as /usr/bin/perl (in addition to $bin/perl).
8315 if test -f /usr/bin/perl; then
8318 However, please note that because you already have a /usr/bin/perl,
8319 overwriting that with a new Perl would very probably cause problems.
8320 Therefore I'm assuming you don't want to do that (unless you insist).
8323 case "$installusrbinperl" in
8324 "$define"|[yY]*) dflt='y';;
8330 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8333 case "$installusrbinperl" in
8334 "$undef"|[nN]*) dflt='n';;
8338 rp="Do you want to install perl as /usr/bin/perl?"
8341 [yY]*) val="$define";;
8347 set installusrbinperl
8350 : see if dlopen exists
8352 xxx_ccflags="$ccflags"
8354 : with g++ one needs -shared to get is-in-libc to work for dlopen
8355 case "$gccversion" in
8358 *) case "$d_cplusplus" in
8359 "$define") ccflags="$ccflags -shared" ;;
8366 ccflags="$xxx_ccflags"
8368 : see if this is a unistd.h system
8369 set unistd.h i_unistd
8372 : determine which dynamic loading, if any, to compile in
8374 dldir="ext/DynaLoader"
8387 $define) dflt='y' ;;
8389 : Does a dl_xxx.xs file exist for this operating system
8390 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8393 rp="Do you wish to use dynamic loading?"
8400 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8401 dflt="$dldir/dl_${osname}.xs"
8402 elif $test "$d_dlopen" = "$define" ; then
8403 dflt="$dldir/dl_dlopen.xs"
8408 *) dflt="$dldir/$dlsrc"
8411 echo "The following dynamic loading files are available:"
8412 : Can not go over to $dldir because getfile has path hard-coded in.
8413 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8414 rp="Source file to use for dynamic loading"
8420 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8424 Some systems may require passing special flags to $cc -c to
8425 compile modules that will be used to create a shared library.
8426 To use no flags, say "none".
8429 case "$cccdlflags" in
8430 '') case "$gccversion" in
8431 '') case "$osname" in
8433 irix*) dflt='-KPIC' ;;
8434 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8435 sunos) dflt='-pic' ;;
8439 *) case "$osname" in
8440 darwin) dflt='none' ;;
8441 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8446 *) dflt="$cccdlflags" ;;
8453 # If -Dsysroot was specified, now's the time to add it
8455 if test "X$sysroot" != X; then
8456 case "$gccversion" in
8461 dflt="$dflt --sysroot=$sysroot" ;;
8471 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8474 none) cccdlflags=' ' ;;
8475 *) cccdlflags="$ans" ;;
8480 Some systems use ld to create libraries that can be dynamically loaded,
8481 while other systems (such as those using ELF) use $cc.
8485 : Determine if this is ELF
8487 /* Test for whether ELF binaries are produced */
8499 int i = open("a.out",O_RDONLY);
8502 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8503 exit(0); /* succeed (yes, it is ELF) */
8507 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8513 '') if $test $bin_ELF = "$define"; then
8515 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8519 echo "I'll use ld to build dynamic libraries."
8527 rp="What command should be used to create dynamic libraries?"
8533 Some systems may require passing special flags to $ld to create a
8534 library that can be dynamically loaded. If your ld flags include
8535 -L/other/path options to locate libraries outside your loader's normal
8536 search path, you may need to specify those -L options here as well. To
8537 use no flags, say "none".
8540 case "$lddlflags" in
8541 '') case "$osname" in
8542 haiku) dflt='-shared' ;;
8544 case "$gccversion" in
8545 '') dflt="$dflt +vnocompatwarnings" ;;
8548 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8549 solaris) # See [perl #66604].
8550 # On Solaris 11, gcc -m64 on amd64
8551 # appears not to understand -G. gcc versions at
8552 # least as old as 3.4.3 support -shared, so just
8553 # use that with Solaris 11 and later, but keep
8554 # the old behavior for older Solaris versions.
8555 case "$gccversion" in
8557 *) case "$osvers" in
8558 2.?|2.10) dflt='-G' ;;
8559 *) dflt='-shared' ;;
8564 sunos) dflt='-assert nodefinitions' ;;
8565 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8569 *) dflt="$lddlflags" ;;
8572 : Only do this for gcc, since, for example, qcc has no concept
8574 if $test "X$sysroot" != X; then
8575 case "$gccversion" in
8577 *) dflt="$dflt --sysroot $sysroot" ;;
8581 : Try to guess additional flags to pick up local libraries.
8582 : Be careful not to append to a plain 'none'
8586 for thisflag in $ldflags; do
8591 *) dflt="$dflt $thisflag" ;;
8598 ''|' ') dflt='none' ;;
8602 *-fstack-protector-strong*)
8604 *-fstack-protector-strong*) ;; # Don't add it again
8605 *) dflt="$dflt -fstack-protector-strong" ;;
8608 *-fstack-protector*)
8610 *-fstack-protector*) ;; # Don't add it again
8611 *) dflt="$dflt -fstack-protector" ;;
8616 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8619 none) lddlflags=' ' ;;
8620 *) lddlflags="$ans" ;;
8625 Some systems may require passing special flags to $cc to indicate that
8626 the resulting executable will use dynamic linking. To use no flags,
8630 case "$ccdlflags" in
8631 '') case "$osname" in
8632 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8633 sunos) dflt='none' ;;
8637 *) dflt="$ccdlflags" ;;
8639 rp="Any special flags to pass to $cc to use dynamic linking?"
8642 none) ccdlflags=' ' ;;
8643 *) ccdlflags="$ans" ;;
8655 ld_can_script="$undef"
8656 case "$bin_ELF$usedl" in
8658 # Abuse try.h and a.out names for neat cleanup
8670 if $cc $cccdlflags $ccdlflags $ccflags \
8671 $ldflags $lddlflags -o a.out try.c \
8672 -Wl,--version-script=try.h >/dev/null 2>&1 \
8673 && $test -s a.out ; then
8674 echo "ld supports scripting" >&4
8675 ld_can_script="$define"
8677 echo "ld does not support scripting" >&4
8683 : Do we want a shared libperl?
8687 # No dynamic loading being used, so don't bother even to prompt.
8690 *) case "$useshrplib" in
8691 '') case "$osname" in
8692 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8694 also='Building a shared libperl is required for dynamic loading to work on your system.'
8708 The perl executable is normally obtained by linking perlmain.c with
8709 libperl${_a}, any static extensions (usually just DynaLoader), and
8710 any other libraries needed on this system (such as -lm, etc.). Since
8711 your system supports dynamic loading, it is probably possible to build
8712 a shared libperl.$so. If you will have more than one executable linked
8713 to libperl.$so, this will significantly reduce the size of each
8714 executable, but it may have a noticeable effect on performance. The
8715 default is probably sensible for your system.
8719 rp="Build a shared libperl.$so (y/n)"
8723 useshrplib='true' ;;
8724 *) useshrplib='false' ;;
8729 case "$useshrplib" in
8731 case "$userelocatableinc" in
8733 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8734 echo "See INSTALL for an explanation why that won't work." >&4
8740 # Figure out a good name for libperl.so. Since it gets stored in
8741 # a version-specific architecture-dependent library, the version
8742 # number isn't really that important, except for making cc/ld happy.
8744 # A name such as libperl.so.10.1
8745 majmin="libperl.$so.$patchlevel.$subversion"
8746 # A name such as libperl.so.100
8747 majonly=`echo $patchlevel $subversion |
8748 $awk '{printf "%d%02d", $1, $2}'`
8749 majonly=libperl.$so.$majonly
8750 # I'd prefer to keep the os-specific stuff here to a minimum, and
8751 # rely on figuring it out from the naming of libc.
8752 case "${osname}${osvers}" in
8753 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8756 cygwin*) # ld links now against the dll directly
8757 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8758 majonly=`echo $patchlevel $subversion |
8759 $awk '{printf "%03d%03d", $1, $2}'`
8760 majonly=cygperl5.$majonly.$so
8763 *) # Try to guess based on whether libc has major.minor.
8765 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8766 *libc.$so.[0-9]*) dflt=$majonly ;;
8767 *) dflt=libperl.$so ;;
8777 I need to select a good name for the shared libperl. If your system uses
8778 library names with major and minor numbers, then you might want something
8779 like $majmin. Alternatively, if your system uses a single version
8780 number for shared libraries, then you might want to use $majonly.
8781 Or, your system might be quite happy with a simple libperl.$so.
8783 Since the shared libperl will get installed into a version-specific
8784 architecture-dependent directory, the version number of the shared perl
8785 library probably isn't important, so the default should be o.k.
8788 rp='What name do you want to give to the shared libperl?'
8791 echo "Ok, I'll use $libperl"
8794 libperl="libperl${_a}"
8798 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8802 WARNING: Use of the shrpdir variable for the installation location of
8803 the shared $libperl is not supported. It was never documented and
8804 will not work in this version. Let me (perlbug@perl.org)
8805 know of any problems this may cause.
8811 But your current setting of $shrpdir is
8812 the default anyway, so it's harmless.
8817 Further, your current attempted setting of $shrpdir
8818 conflicts with the value of $archlibexp/CORE
8819 that installperl will use.
8826 # How will the perl executable find the installed shared $libperl?
8827 # Add $xxx to ccdlflags.
8828 # If we can't figure out a command-line option, use $shrpenv to
8829 # set env LD_RUN_PATH. The main perl makefile uses this.
8830 shrpdir=$archlibexp/CORE
8833 if "$useshrplib"; then
8836 # We'll set it in Makefile.SH...
8841 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8842 xxx="-Wl,-R$shrpdir"
8844 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8845 xxx="-Wl,-rpath,$shrpdir"
8848 # hpux doesn't like the default, either.
8849 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8852 # cygwin needs only ldlibpth
8855 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8861 # Only add $xxx if it isn't already in ccdlflags.
8862 case " $ccdlflags " in
8864 *) ccdlflags="$ccdlflags $xxx"
8867 Adding $xxx to the flags
8868 passed to $ld so that the perl executable will find the
8869 installed shared $libperl.
8877 # Fix ccdlflags in AIX for building external extensions.
8878 # (For building Perl itself bare -bE:perl.exp is needed,
8879 # Makefile.SH takes care of this.)
8881 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8883 # Respect a hint or command-line value.
8885 '') shrpenv="$tmp_shrpenv" ;;
8887 case "$ldlibpthname" in
8888 '') ldlibpthname=LD_LIBRARY_PATH ;;
8889 none) ldlibpthname='' ;;
8892 : determine where manual pages are on this system
8896 syspath='/usr/share/man/man1 /usr/man/man1'
8897 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8898 syspath="$syspath /usr/man/u_man/man1"
8899 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8900 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8901 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8902 sysman=`./loc . /usr/man/man1 $syspath`
8905 if $test -d "$sysman"; then
8906 echo "System manual is in $sysman." >&4
8908 echo "Could not find manual pages in source form." >&4
8911 : determine where manual pages go
8912 set man1dir man1dir none
8916 $spackage has manual pages available in source form.
8920 echo "However, you don't have nroff, so they're probably useless to you."
8922 '') man1dir="none";;
8925 echo "If you don't want the manual sources installed, answer 'none'."
8930 lookpath="$prefixexp/share/man/man1"
8931 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8932 lookpath="$lookpath $prefixexp/man/p_man/man1"
8933 lookpath="$lookpath $prefixexp/man/u_man/man1"
8934 lookpath="$lookpath $prefixexp/man/man.1"
8936 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8937 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8947 rp="Where do the main $spackage manual pages (source) go?"
8949 if $test "X$man1direxp" != "X$ansexp"; then
8960 : What suffix to use on installed man pages
8967 rp="What suffix should be used for the main $spackage man pages?"
8969 '') case "$man1dir" in
8983 *) dflt="$man1ext";;
8990 : see if we can have long filenames
8992 first=123456789abcdef
8994 if (echo hi >$first) 2>/dev/null; then
8995 if $test -f 123456789abcde; then
8996 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8999 echo 'You can have filenames longer than 14 characters.'>&4
9004 You can't have filenames longer than 14 chars.
9005 You can't even think about them!
9011 $rm -rf 123456789abcde*
9013 : determine where library module manual pages go
9014 set man3dir man3dir none
9018 $spackage has manual pages for many of the library modules.
9024 However, you don't have nroff, so they're probably useless to you.
9027 '') man3dir="none";;
9031 case "$d_flexfnam" in
9034 However, your system can't handle the long file names like File::Basename.3.
9037 '') man3dir="none";;
9041 echo "If you don't want the manual sources installed, answer 'none'."
9042 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9044 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9045 if $test -d "$privlib/man/man3"; then
9048 WARNING: Previous versions of perl installed man3 pages into
9049 $privlib/man/man3. This version will suggest a
9050 new default of $dflt.
9054 rp='Do you wish to preserve the old behavior?(y/n)'
9057 y*) dflt="$privlib/man/man3" ;;
9062 *) dflt="$man3dir" ;;
9069 rp="Where do the $package library man pages (source) go?"
9079 : What suffix to use on installed man pages
9085 rp="What suffix should be used for the $package library man pages?"
9087 '') case "$man3dir" in
9101 *) dflt="$man3ext";;
9108 : see if we have to deal with yellow pages, now NIS.
9109 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9115 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9123 rp='Are you getting the hosts file via yellow pages?'
9126 y*) hostcat='ypcat hosts';;
9127 *) hostcat='cat /etc/hosts';;
9133 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9136 '') test -f /etc/group && groupcat='cat /etc/group';;
9139 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9142 : now get the host name
9144 echo "Figuring out host name..." >&4
9145 case "$myhostname" in
9147 echo 'Maybe "hostname" will work...'
9148 if tans=`sh -c hostname 2>&1` ; then
9156 if $test "$cont"; then
9158 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9159 if tans=`cat /etc/systemid 2>&1` ; then
9161 phostname='cat /etc/systemid'
9162 echo "Whadyaknow. Xenix always was a bit strange..."
9165 elif $test -r /etc/systemid; then
9166 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9169 if $test "$cont"; then
9170 echo 'No, maybe "uuname -l" will work...'
9171 if tans=`sh -c 'uuname -l' 2>&1` ; then
9173 phostname='uuname -l'
9175 echo 'Strange. Maybe "uname -n" will work...'
9176 if tans=`sh -c 'uname -n' 2>&1` ; then
9178 phostname='uname -n'
9180 echo 'Oh well, maybe I can mine it out of whoami.h...'
9181 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9182 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9183 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9185 case "$myhostname" in
9186 '') echo "Does this machine have an identity crisis or something?"
9189 echo "Well, you said $myhostname before..."
9190 phostname='echo $myhostname';;
9196 case "$myhostname" in
9197 '') myhostname=noname ;;
9199 : you do not want to know about this
9204 if $test "$myhostname" ; then
9206 rp='Your host name appears to be "'$myhostname'".'" Right?"
9214 : bad guess or no guess
9215 while $test "X$myhostname" = X ; do
9217 rp="Please type the (one word) name of your host:"
9222 : translate upper to lower if necessary
9223 case "$myhostname" in
9225 echo "(Normalizing case in your host name)"
9226 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9230 case "$myhostname" in
9232 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9233 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9234 echo "(Trimming domain name from host name--host name is now $myhostname)"
9236 *) case "$mydomain" in
9239 test "X$hostcat" = "Xypcat hosts" &&
9240 ypmatch "$myhostname" hosts 2>/dev/null |\
9241 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9244 test "X$hostcat" != "X" &&
9245 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9246 /[ ]$myhostname[ . ]/p" > hosts
9249 if $test -f hosts; then
9250 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9251 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9252 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9253 hosts | $sort | $uniq | \
9254 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9255 case `$echo X$dflt` in
9256 X*\ *) echo "(Several hosts in the database matched hostname)"
9259 X.) echo "(You do not have fully-qualified names in the hosts database)"
9263 echo "(I cannot locate a hosts database anywhere)"
9268 tans=`./loc resolv.conf X /etc /usr/etc`
9269 if $test -f "$tans"; then
9270 echo "(Attempting domain name extraction from $tans)"
9271 dflt=.`$sed -n -e 's/ / /g' \
9272 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9275 .) dflt=.`$sed -n -e 's/ / /g' \
9276 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9284 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9285 dflt=.`sh -c domainname 2>/dev/null`
9288 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9292 case "$dflt$osname" in
9293 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9294 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9298 .) echo "(Lost all hope -- silly guess then)"
9304 *) dflt="$mydomain";;
9308 rp="What is your domain name?"
9318 : translate upper to lower if necessary
9321 echo "(Normalizing case in your domain name)"
9322 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9326 : a little sanity check here
9327 case "$phostname" in
9330 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9331 $myhostname$mydomain|$myhostname) ;;
9333 case "$phostname" in
9335 echo "(That doesn't agree with your whoami.h file, by the way.)"
9338 echo "(That doesn't agree with your $phostname command, by the way.)"
9346 : determine the e-mail address of the user who is running us
9349 I need to get your e-mail address in Internet format if possible, i.e.
9350 something like user@host.domain. Please answer accurately since I have
9351 no easy means to double check it. The default value provided below
9352 is most probably close to reality but may not be valid from outside
9353 your organization...
9357 while test "$cont"; do
9358 case "$MAILDOMAIN" in
9360 if $test -s /etc/mailname; then
9361 maildomain=`$cat /etc/mailname`
9363 maildomain="$myhostname$mydomain"
9366 *) maildomain="$MAILDOMAIN";;
9369 '') dflt="$cf_by@$maildomain";;
9370 *) dflt="$cf_email";;
9372 rp='What is your e-mail address?'
9378 rp='Address does not look like an Internet one. Use it anyway?'
9392 : Ask e-mail of administrator
9395 If you or somebody else will be maintaining perl at your site, please
9396 fill in the correct e-mail address here so that they may be contacted
9397 if necessary. Currently, the "perlbug" program included with perl
9398 will send mail to this address in addition to perlbug@perl.org. You may
9399 enter "none" for no administrator.
9402 case "$perladmin" in
9403 '') dflt="$cf_email";;
9404 *) dflt="$perladmin";;
9406 rp='Perl administrator e-mail address'
9410 : determine whether to use a version number suffix for installed binaries
9413 Do you want to use a version number suffix for installed binaries? This
9414 will install 'perl$version' instead of 'perl', and likewise for other
9415 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9416 to be installed side-by-side. Unless you are a developer, you probably
9417 do *not* want to do this.
9419 case "$versiononly" in
9420 "$define"|[Yy]*|true) dflt='y' ;;
9423 rp="Do you want to use a version number suffix for installed binaries?"
9426 [yY]*) val="$define";;
9432 case "$versiononly" in
9433 "$define") inc_version_list=''
9434 inc_version_list_init=0
9438 : figure out how to guarantee perl startup
9439 : XXX Note that this currently takes advantage of the bug that binexp ignores
9440 : the Configure -Dinstallprefix setting, which in turn means that under
9441 : relocatable @INC, initialinstalllocation is what binexp started as.
9442 case "$startperl" in
9444 case "$sharpbang" in
9448 I can use the #! construct to start perl on your system. This will
9449 make startup of perl scripts faster, but may cause problems if you
9450 want to share those scripts and perl is not in a standard place
9451 ($initialinstalllocation/perl) on all your platforms. The alternative
9452 is to force a shell by starting the script with a single ':' character.
9455 case "$versiononly" in
9456 "$define") dflt="$initialinstalllocation/perl$version";;
9457 *) dflt="$initialinstalllocation/perl";;
9459 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9462 none) startperl=": # use perl";;
9463 *) startperl="#!$ans"
9464 if $test 30 -lt `echo "$ans" | wc -c`; then
9467 WARNING: Some systems limit the #! command to 32 characters.
9468 If you experience difficulty running Perl scripts with #!, try
9469 installing Perl in a directory with a shorter pathname.
9475 *) startperl=": # use perl"
9480 echo "I'll use $startperl to start perl scripts."
9482 : figure best path for perl in scripts
9485 case "$versiononly" in
9486 "$define") perlpath="$initialinstalllocation/perl$version";;
9487 *) perlpath="$initialinstalllocation/perl";;
9489 case "$startperl" in
9494 I will use the "eval 'exec'" idiom to start Perl on your system.
9495 I can use the full path of your Perl binary for this purpose, but
9496 doing so may cause problems if you want to share those scripts and
9497 Perl is not always in a standard place ($initialinstalllocation/perl).
9500 dflt="$initialinstalllocation/perl"
9501 rp="What path shall I use in \"eval 'exec'\"?"
9508 case "$startperl" in
9510 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9513 : determine where public executable scripts go
9514 set scriptdir scriptdir
9516 case "$scriptdir" in
9519 : guess some guesses
9520 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9521 $test -d /usr/share/bin && dflt=/usr/share/bin
9522 $test -d /usr/local/script && dflt=/usr/local/script
9523 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9524 $test -d $prefixexp/script && dflt=$prefixexp/script
9528 *) dflt="$scriptdir"
9533 Some installations have a separate directory just for executable scripts so
9534 that they can mount it across multiple architectures but keep the scripts in
9535 one spot. You might, for example, have a subdirectory of /usr/share for this.
9536 Or you might just lump your scripts in with all your other executables.
9540 rp='Where do you keep publicly executable scripts?'
9542 if $test "X$ansexp" != "X$scriptdirexp"; then
9548 : A little fix up for an irregularly named variable.
9549 installscript="$installscriptdir"
9551 : determine where add-on public executables go
9553 '') dflt=$siteprefix/bin ;;
9557 rp='Pathname where the add-on public executables should be installed?'
9562 : determine where add-on html pages go
9563 : There is no standard location, so try to copy the previously-selected
9564 : directory structure for the core html pages.
9565 case "$sitehtml1dir" in
9566 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9567 *) dflt=$sitehtml1dir ;;
9570 ''|' ') dflt=none ;;
9573 rp='Pathname where the site-specific html pages should be installed?'
9575 prefixvar=sitehtml1dir
9578 : determine where add-on library html pages go
9579 : There is no standard location, so try to copy the previously-selected
9580 : directory structure for the core html pages.
9581 case "$sitehtml3dir" in
9582 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9583 *) dflt=$sitehtml3dir ;;
9586 ''|' ') dflt=none ;;
9589 rp='Pathname where the site-specific library html pages should be installed?'
9591 prefixvar=sitehtml3dir
9594 : determine where add-on manual pages go
9595 case "$siteman1dir" in
9596 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9597 *) dflt=$siteman1dir ;;
9600 ''|' ') dflt=none ;;
9603 rp='Pathname where the site-specific manual pages should be installed?'
9605 prefixvar=siteman1dir
9608 : determine where add-on library man pages go
9609 case "$siteman3dir" in
9610 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9611 *) dflt=$siteman3dir ;;
9614 ''|' ') dflt=none ;;
9617 rp='Pathname where the site-specific library manual pages should be installed?'
9619 prefixvar=siteman3dir
9622 : determine where add-on public executable scripts go
9623 case "$sitescript" in
9624 '') dflt=$siteprefix/script
9625 $test -d $dflt || dflt=$sitebin ;;
9626 *) dflt="$sitescript" ;;
9629 rp='Pathname where add-on public executable scripts should be installed?'
9631 prefixvar=sitescript
9634 : see if backtrace exists
9635 set backtrace d_backtrace
9638 : add flags if using c backtrace
9639 case "$usecbacktrace" in
9640 "") usecbacktrace=$undef ;;
9642 case "$d_backtrace" in
9644 case " $ccflags " in
9645 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9646 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9650 echo "This system does not support backtrace" >&4
9651 usecbacktrace=$undef
9657 : Check if faststdio is requested and available
9658 case "$usefaststdio" in
9659 $define|true|[yY]*|'')
9660 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9670 Perl can be built to use 'fast stdio', which means using the stdio
9671 library but also directly manipulating the stdio buffers to enable
9672 faster I/O. Using stdio is better for backward compatibility (especially
9673 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9674 interface has been preferred instead of stdio.
9676 If this doesn't make any sense to you, just accept the default '$dflt'.
9678 rp='Use the "fast stdio" if available?'
9681 y|Y) val="$define" ;;
9688 : define an is-a-typedef? function
9689 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9691 "") inclist="sys/types.h";;
9693 eval "varval=\$$var";
9697 for inc in $inclist; do
9698 echo "#include <$inc>" >>temp.c;
9700 echo "#ifdef $type" >> temp.c;
9701 echo "printf(\"We have $type\");" >> temp.c;
9702 echo "#endif" >> temp.c;
9703 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9704 if $contains $type temp.E >/dev/null 2>&1; then
9710 *) eval "$var=\$varval";;
9713 : define an is-a-typedef? function that prompts if the type is not available.
9714 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9716 "") inclist="sys/types.h";;
9718 eval "varval=\$$var";
9722 for inc in $inclist; do
9723 echo "#include <$inc>" >>temp.c;
9725 echo "#ifdef $type" >> temp.c;
9726 echo "printf(\"We have $type\");" >> temp.c;
9727 echo "#endif" >> temp.c;
9728 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9730 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9731 if $contains $type temp.E >/dev/null 2>&1; then
9732 echo "$type found." >&4;
9735 echo "$type NOT found." >&4;
9741 *) eval "$var=\$varval";;
9744 : see what type lseek is declared as in the kernel
9745 rp="What is the type used for lseek's offset on this system?"
9746 set off_t lseektype long stdio.h sys/types.h
9750 echo "Checking to see how big your file offsets are..." >&4
9752 #include <sys/types.h>
9756 printf("%d\n", (int)sizeof($lseektype));
9761 if eval $compile_ok; then
9762 lseeksize=`$run ./try`
9763 echo "Your file offsets are $lseeksize bytes long."
9767 echo "(I can't seem to compile the test program. Guessing...)"
9768 rp="What is the size of your file offsets (in bytes)?"
9774 : see what type file positions are declared as in the library
9775 rp="What is the type for file position used by fsetpos()?"
9776 set fpos_t fpostype long stdio.h sys/types.h
9779 : Check size for Fpos_t
9782 *_t) zzz="$fpostype" ;;
9785 echo "Checking the size of $zzz..." >&4
9787 #include <sys/types.h>
9794 printf("%d\n", (int)sizeof($fpostype));
9799 if eval $compile_ok; then
9803 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9806 echo "Your $zzz is $fpossize bytes long."
9812 echo "(I can't compile the test program. Guessing...)" >&4
9813 rp="What is the size of your file positions (in bytes)?"
9818 : Check for large file support
9819 # Backward compatibility (uselfs is deprecated).
9821 "$define"|true|[yY]*)
9824 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9826 uselargefiles="$define"
9830 case "$lseeksize:$fpossize" in
9833 You can have files larger than 2 gigabytes.
9836 *) case "$uselargefiles" in
9837 "$undef"|false|[nN]*) dflt='n' ;;
9842 Perl can be built to understand large files (files larger than 2 gigabytes)
9843 on some systems. To do so, Configure can be run with -Duselargefiles.
9845 If this doesn't make any sense to you, just accept the default '$dflt'.
9847 rp='Try to understand large files, if available?'
9850 y|Y) val="$define" ;;
9857 : Look for a hint-file generated 'call-back-unit'. If the
9858 : user has specified that a large files perl is to be built,
9859 : we may need to set or change some other defaults.
9860 if $test -f uselargefiles.cbu; then
9861 echo "Your platform has some specific hints regarding large file builds, using them..."
9862 . ./uselargefiles.cbu
9864 case "$uselargefiles" in
9866 if $test -f uselargefiles.cbu; then
9868 echo "Rechecking to see how big your file offsets are..." >&4
9870 #include <sys/types.h>
9874 printf("%d\n", (int)sizeof($lseektype));
9879 if eval $compile_ok; then
9880 lseeksize=`$run ./try`
9881 $echo "Your file offsets are now $lseeksize bytes long."
9885 echo "(I can't seem to compile the test program. Guessing...)"
9886 rp="What is the size of your file offsets (in bytes)?"
9891 *_t) zzz="$fpostype" ;;
9894 $echo $n "Rechecking the size of $zzz...$c" >&4
9896 #include <sys/types.h>
9903 printf("%d\n", (int)sizeof($fpostype));
9908 if eval $compile_ok; then
9913 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9916 echo " $fpossize bytes." >&4
9922 echo "(I can't compile the test program. Guessing...)" >&4
9923 rp="What is the size of your file positions (in bytes)?"
9932 : Check if we want perlio
9935 : Set the vendorbin variables
9936 case "$vendorprefix" in
9937 '') d_vendorbin="$undef"
9941 *) d_vendorbin="$define"
9942 : determine where vendor-supplied executables go.
9943 case "$vendorbin" in
9944 '') dflt=$vendorprefix/bin ;;
9945 *) dflt="$vendorbin" ;;
9948 rp='Pathname for the vendor-supplied executables directory?'
9951 vendorbinexp="$ansexp"
9957 : Set the vendorhtml1dir variables
9958 case "$vendorprefix" in
9959 '') vendorhtml1dir=''
9960 vendorhtml1direxp=''
9962 *) : determine where vendor-supplied html pages go.
9963 : There is no standard location, so try to copy the previously-selected
9964 : directory structure for the core html pages.
9965 : XXX Better default suggestions would be welcome.
9966 case "$vendorhtml1dir" in
9967 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9968 *) dflt=$vendorhtml1dir ;;
9971 ''|' ') dflt=none ;;
9974 rp='Pathname for the vendor-supplied html pages?'
9976 vendorhtml1dir="$ans"
9977 vendorhtml1direxp="$ansexp"
9980 : Use ' ' for none so value is preserved next time through Configure
9981 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9982 prefixvar=vendorhtml1dir
9985 : Set the vendorhtml3dir variables
9986 case "$vendorprefix" in
9987 '') vendorhtml3dir=''
9988 vendorhtml3direxp=''
9990 *) : determine where vendor-supplied module html pages go.
9991 : There is no standard location, so try to copy the previously-selected
9992 : directory structure for the core html pages.
9993 : XXX Better default suggestions would be welcome.
9994 case "$vendorhtml3dir" in
9995 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9996 *) dflt=$vendorhtml3dir ;;
9999 ''|' ') dflt=none ;;
10002 rp='Pathname for the vendor-supplied html pages?'
10004 vendorhtml3dir="$ans"
10005 vendorhtml3direxp="$ansexp"
10008 : Use ' ' for none so value is preserved next time through Configure
10009 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10010 prefixvar=vendorhtml3dir
10013 : Set the vendorman1dir variables
10014 case "$vendorprefix" in
10015 '') vendorman1dir=''
10016 vendorman1direxp=''
10018 *) : determine where vendor-supplied manual pages go.
10019 case "$vendorman1dir" in
10020 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10021 *) dflt=$vendorman1dir ;;
10024 ''|' ') dflt=none ;;
10027 rp='Pathname for the vendor-supplied manual section 1 pages?'
10029 vendorman1dir="$ans"
10030 vendorman1direxp="$ansexp"
10033 : Use ' ' for none so value is preserved next time through Configure
10034 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10035 prefixvar=vendorman1dir
10038 : Set the vendorman3dir variables
10039 case "$vendorprefix" in
10040 '') vendorman3dir=''
10041 vendorman3direxp=''
10043 *) : determine where vendor-supplied module manual pages go.
10044 case "$vendorman3dir" in
10045 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10046 *) dflt=$vendorman3dir ;;
10049 ''|' ') dflt=none ;;
10052 rp='Pathname for the vendor-supplied manual section 3 pages?'
10054 vendorman3dir="$ans"
10055 vendorman3direxp="$ansexp"
10058 : Use ' ' for none so value is preserved next time through Configure
10059 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10060 prefixvar=vendorman3dir
10063 : Set the vendorscript variables
10064 case "$vendorprefix" in
10065 '') d_vendorscript="$undef"
10069 *) d_vendorscript="$define"
10070 : determine where vendor-supplied scripts go.
10071 case "$vendorscript" in
10072 '') dflt=$vendorprefix/script
10073 $test -d $dflt || dflt=$vendorbin ;;
10074 *) dflt="$vendorscript" ;;
10078 The installation process will create a directory for
10079 vendor-supplied scripts.
10083 rp='Pathname for the vendor-supplied scripts directory?'
10085 vendorscript="$ans"
10086 vendorscriptexp="$ansexp"
10089 prefixvar=vendorscript
10092 : script used to emit important warnings
10095 if test \$# -gt 0; then
10100 echo "*** WARNING:" >&4
10101 sed -e 's/^/*** /' <msg >&4
10103 cat msg >>config.msg
10104 echo " " >>config.msg
10110 : see which of string.h or strings.h is needed
10112 strings=`./findhdr string.h`
10113 if $test "$strings" && $test -r "$strings"; then
10114 echo "Using <string.h> instead of <strings.h>." >&4
10118 strings=`./findhdr strings.h`
10119 if $test "$strings" && $test -r "$strings"; then
10120 echo "Using <strings.h> instead of <string.h>." >&4
10122 ./warn "No string header found -- You'll surely have problems."
10127 case "$i_string" in
10128 "$undef") strings=`./findhdr strings.h`;;
10129 *) strings=`./findhdr string.h`;;
10132 : see if qgcvt exists
10136 : Check what kind of doubles your system has
10137 $echo "Checking the kind of doubles you have..." >&4
10139 #$i_stdlib I_STDLIB
10140 #define DOUBLESIZE $doublesize
10142 #include <stdlib.h>
10145 static const double d = -0.1;
10147 unsigned const char* b = (unsigned const char*)(&d);
10148 #if DOUBLESIZE == 4
10149 if (b[0] == 0xCD && b[3] == 0xBD) {
10150 /* IEEE 754 32-bit little-endian */
10154 if (b[0] == 0xBD && b[3] == 0xCD) {
10155 /* IEEE 754 32-bit big-endian */
10159 if (b[0] == 0xCC && b[3] == 0xCC) {
10160 /* VAX format F, 32-bit PDP-style mixed endian. */
10165 #if DOUBLESIZE == 8
10166 if (b[0] == 0x9A && b[7] == 0xBF) {
10167 /* IEEE 754 64-bit little-endian */
10171 if (b[0] == 0xBF && b[7] == 0x9A) {
10172 /* IEEE 754 64-bit big-endian */
10176 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10177 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10178 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10179 * 99 99 b9 bf 9a 99 99 99 */
10183 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10184 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10185 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10186 * 99 99 99 9a bf b9 99 99 */
10190 if (b[0] == 0xCC && b[7] == 0xCC) {
10191 /* VAX format D, 64-bit PDP-style mixed endian. */
10195 if (b[0] == 0xD9 && b[7] == 0x99) {
10196 /* VAX format G, 64-bit PDP-style mixed endian. */
10201 #if DOUBLESIZE == 16
10202 if (b[0] == 0x9A && b[15] == 0xBF) {
10203 /* IEEE 754 128-bit little-endian */
10207 if (b[0] == 0xBF && b[15] == 0x9A) {
10208 /* IEEE 754 128-bit big-endian */
10213 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10214 * Whether those environments can still build Perl is debatable. */
10215 printf("-1\n"); /* unknown */
10220 if eval $compile; then
10221 doublekind=`$run ./try`
10225 case "$doublekind" in
10226 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10227 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10228 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10229 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10230 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10231 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10232 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10233 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10234 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10235 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10236 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10237 *) echo "Cannot figure out your double. You CRAY, or something?" >&4 ;;
10241 : Check print/scan long double stuff
10244 if $test X"$d_longdbl" = X"$define"; then
10246 echo "Checking how to print long doubles..." >&4
10248 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10249 $cat >try.c <<'EOCP'
10250 #include <sys/types.h>
10253 double d = 123.456;
10254 printf("%.3f\n", d);
10258 if eval $compile; then
10262 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10263 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10264 echo "We will use %f."
10270 if $test X"$sPRIfldbl" = X; then
10271 $cat >try.c <<'EOCP'
10272 #include <sys/types.h>
10275 long double d = 123.456;
10276 printf("%.3Lf\n", d);
10280 if eval $compile; then
10284 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10285 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10286 echo "We will use %Lf."
10292 if $test X"$sPRIfldbl" = X; then
10293 $cat >try.c <<'EOCP'
10294 #include <sys/types.h>
10297 long double d = 123.456;
10298 printf("%.3llf\n", d);
10302 if eval $compile; then
10306 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10307 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10308 echo "We will use %llf."
10314 if $test X"$sPRIfldbl" = X; then
10315 $cat >try.c <<'EOCP'
10316 #include <sys/types.h>
10319 long double d = 123.456;
10320 printf("%.3lf\n", d);
10324 if eval $compile; then
10328 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10329 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10330 echo "We will use %lf."
10336 if $test X"$sPRIfldbl" = X; then
10337 echo "Cannot figure out how to print long doubles." >&4
10339 sSCNfldbl=$sPRIfldbl # expect consistency
10346 case "$sPRIfldbl" in
10347 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10348 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10349 d_SCNfldbl="$undef";
10351 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10352 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10353 d_SCNfldbl="$define";
10357 : Before committing on uselongdouble, see whether that looks sane.
10358 if $test "$uselongdouble" = "$define"; then
10361 echo "Checking if your long double math functions work right..." >&4
10366 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10369 case "$osname:$gccversion" in
10370 aix:) saveccflags="$ccflags"
10371 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10374 if eval $compile_ok; then
10378 3) echo "Your long double math functions are working correctly." >&4 ;;
10379 *) echo "Your long double math functions are broken, not using long doubles." >&4
10380 uselongdouble=$undef
10384 case "$osname:$gccversion" in
10385 aix:) ccflags="$saveccflags" ;; # restore
10389 : Check how to convert floats to strings.
10391 if test "X$d_Gconvert" = X; then
10394 echo "Checking for an efficient way to convert floats to strings."
10396 case "$uselongdouble" in
10397 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10399 case "$d_longdbl" in
10400 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10402 case "$d_PRIgldbl" in
10403 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10406 #ifdef TRY_gconvert
10407 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10408 char *myname = "gconvert";
10411 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10412 char *myname = "gcvt";
10415 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10416 char *myname = "qgcvt";
10417 #define DOUBLETYPE long double
10420 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10421 #ifdef HAS_PRIgldbl
10422 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10424 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10427 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10429 char *myname = "sprintf";
10433 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10434 #define DOUBLETYPE long double
10436 #define DOUBLETYPE double
10442 #$i_stdlib I_STDLIB
10444 #include <stdlib.h>
10446 #$i_string I_STRING
10448 # include <string.h>
10450 # include <strings.h>
10453 int checkit(char *expect, char *got)
10455 if (strcmp(expect, got)) {
10456 printf("%s oddity: Expected %s, got %s\n",
10457 myname, expect, got);
10467 /* This must be 1st test on (which?) platform */
10468 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10469 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10470 checkit("0.1", buf);
10472 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10473 checkit("0.01", buf);
10475 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10476 checkit("0.001", buf);
10478 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10479 checkit("0.0001", buf);
10481 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10482 if (strlen(buf) > 5)
10483 checkit("9e-005", buf); /* for Microsoft ?? */
10485 checkit("9e-05", buf);
10487 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10490 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10491 checkit("1.1", buf);
10493 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10494 checkit("1.01", buf);
10496 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10497 checkit("1.001", buf);
10499 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10500 checkit("1.0001", buf);
10502 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10503 checkit("1.00001", buf);
10505 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10506 checkit("1.000001", buf);
10508 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10511 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10512 checkit("-1", buf);
10514 /* Some Linux gcvt's give 1.e+5 here. */
10515 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10516 checkit("100000", buf);
10518 /* Some Linux gcvt's give -1.e+5 here. */
10519 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10520 checkit("-100000", buf);
10522 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10523 checkit("123.456", buf);
10525 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10526 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10527 /* 34 should be enough to scare even long double
10528 * places into using the e notation. */
10529 if (strlen(buf) > 5)
10530 checkit("1e+034", buf); /* for Microsoft */
10532 checkit("1e+34", buf);
10534 /* For Perl, if you add additional tests here, also add them to
10535 * t/base/num.t for benefit of platforms not using Configure or
10536 * overriding d_Gconvert */
10541 : first add preferred functions to our list
10543 for xxx_convert in $gconvert_preference; do
10544 case $xxx_convert in
10545 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10546 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10549 : then add any others
10550 for xxx_convert in gconvert gcvt sprintf; do
10551 case "$xxx_list" in
10553 *) xxx_list="$xxx_list $xxx_convert" ;;
10557 case "$d_longdbl$uselongdouble" in
10559 : again, add preferred functions to our list first
10561 for xxx_convert in $gconvert_ld_preference; do
10562 case $xxx_convert in
10563 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10564 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10567 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10568 for xxx_convert in qgcvt sprintf $xxx_list; do
10569 case "$xxx_ld_list" in
10570 $xxx_convert*|*" $xxx_convert"*) ;;
10571 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10574 : if sprintf cannot do long doubles, move it to the end
10575 if test "$d_PRIgldbl" != "$define"; then
10576 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10578 : if no qgcvt, remove it
10579 if test "$d_qgcvt" != "$define"; then
10580 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10583 xxx_list="$xxx_ld_list"
10587 for xxx_convert in $xxx_list; do
10588 echo "Trying $xxx_convert..."
10589 $rm -f try try$_o core
10590 set try -DTRY_$xxx_convert
10591 if eval $compile; then
10592 echo "$xxx_convert() found." >&4
10593 if $run ./try; then
10594 echo "I'll use $xxx_convert to convert floats into a string." >&4
10597 echo "...But $xxx_convert didn't work as I expected."
10601 echo "$xxx_convert NOT found." >&4
10605 if test X$xxx_convert = X; then
10606 echo "*** WHOA THERE!!! ***" >&4
10607 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10608 xxx_convert=sprintf
10611 case "$xxx_convert" in
10612 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10613 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10614 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10615 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10616 "$define$define$define")
10617 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10618 "$define$define$undef")
10619 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10620 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10628 : see if _fwalk exists
10632 : Initialize h_fcntl
10635 : Initialize h_sysfile
10638 : access call always available on UNIX
10639 set access d_access
10642 : locate the flags for 'access()'
10643 case "$d_access" in
10646 $cat >access.c <<EOCP
10647 #include <sys/types.h>
10652 #include <sys/file.h>
10655 #include <unistd.h>
10657 #$i_stdlib I_STDLIB
10659 #include <stdlib.h>
10665 : check sys/file.h first, no particular reason here
10666 if $test `./findhdr sys/file.h` && \
10667 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10669 echo "<sys/file.h> defines the *_OK access constants." >&4
10670 elif $test `./findhdr fcntl.h` && \
10671 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10673 echo "<fcntl.h> defines the *_OK access constants." >&4
10674 elif $test `./findhdr unistd.h` && \
10675 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10676 echo "<unistd.h> defines the *_OK access constants." >&4
10678 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10684 : see if accessx exists
10685 set accessx d_accessx
10688 : see if acosh exists
10692 : see if aintl exists
10696 : see if alarm exists
10700 : see if 64bit time functions exists
10702 set ctime64 d_ctime64
10705 set localtime64 d_localtime64
10708 set gmtime64 d_gmtime64
10711 set mktime64 d_mktime64
10714 set difftime64 d_difftime64
10717 set asctime64 d_asctime64
10720 : see if POSIX threads are available
10721 set pthread.h i_pthread
10724 : define a function to check prototypes
10725 $cat > protochk <<EOSH
10728 optimize="$optimize"
10730 prototype="$prototype"
10733 usethreads=$usethreads
10734 i_pthread=$i_pthread
10735 pthread_h_first=$pthread_h_first
10738 $cat >> protochk <<'EOSH'
10743 while test $# -ge 2; do
10745 $define) echo "#include <$2>" >> try.c ;;
10746 literal) echo "$2" >> try.c ;;
10748 # Extra magic for the benefit of systems that need pthread.h
10749 # to be included early to correctly detect threadsafe functions.
10750 # Such functions must guarantee themselves, though, that the usethreads
10751 # and i_pthread have been defined, before calling protochk.
10752 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10753 echo "#include <pthread.h>" >> try.c
10758 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10759 cat >> try.c <<'EOCP'
10760 #ifdef CAN_PROTOTYPE
10761 #define _(args) args
10766 echo "$foo" >> try.c
10767 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10768 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10774 $eunicefix protochk
10776 : Define hasproto macro for Configure internal use
10777 hasproto='varname=$1; func=$2; shift; shift;
10778 while $test $# -ge 2; do
10780 $define) echo "#include <$2>";;
10784 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10785 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10786 echo "$func() prototype found.";
10789 echo "$func() prototype NOT found.";
10796 : see if sys/types.h has to be included
10797 set sys/types.h i_systypes
10800 : see if sys/select.h has to be included
10801 set sys/select.h i_sysselct
10804 : Define hasfield macro for Configure internal use
10805 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10806 while $test $# -ge 2; do
10808 $define) echo "#include <$2>";;
10812 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10814 if eval $compile; then
10823 : see if we should include time.h, sys/time.h, or both
10825 if test "X$timeincl" = X; then
10826 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10827 $echo $n "I'm now running the test program...$c"
10829 #include <sys/types.h>
10834 #ifdef SYSTIMEKERNEL
10837 #include <sys/time.h>
10840 #include <sys/select.h>
10842 #$i_stdlib I_STDLIB
10844 #include <stdlib.h>
10850 struct timeval bar;
10853 struct timezone tzp;
10855 if (foo.tm_sec == foo.tm_sec)
10858 if (bar.tv_sec == bar.tv_sec)
10865 for s_timezone in '-DS_TIMEZONE' ''; do
10867 for s_timeval in '-DS_TIMEVAL' ''; do
10868 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10869 for i_time in '' '-DI_TIME'; do
10870 for i_systime in '-DI_SYSTIME' ''; do
10873 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10874 if eval $compile; then
10875 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10879 $echo $n "Succeeded with $flags$c"
10891 *SYSTIMEKERNEL*) i_systimek="$define"
10892 timeincl=`./findhdr sys/time.h`
10893 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10894 *) i_systimek="$undef";;
10897 *I_TIME*) i_time="$define"
10898 timeincl=`./findhdr time.h`" $timeincl"
10899 echo "We'll include <time.h>." >&4;;
10900 *) i_time="$undef";;
10903 *I_SYSTIME*) i_systime="$define"
10904 timeincl=`./findhdr sys/time.h`" $timeincl"
10905 echo "We'll include <sys/time.h>." >&4;;
10906 *) i_systime="$undef";;
10910 : see if struct tm knows about tm_zone
10911 case "$i_systime$i_time" in
10914 echo "Checking to see if your struct tm has tm_zone field..." >&4
10915 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10923 case "$d_tm_tm_zone" in
10924 "$define") echo "Yes, it does." ;;
10925 *) echo "No, it doesn't." ;;
10927 : see if struct tm knows about tm_gmtoff
10928 case "$i_systime$i_time" in
10931 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10932 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10940 case "$d_tm_tm_gmtoff" in
10941 "$define") echo "Yes, it does." ;;
10942 *) echo "No, it doesn't." ;;
10945 : see if asctime_r exists
10946 set asctime_r d_asctime_r
10948 case "$d_asctime_r" in
10950 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10951 case "$d_asctime_r_proto:$usethreads" in
10952 ":define") d_asctime_r_proto=define
10953 set d_asctime_r_proto asctime_r $hdrs
10957 case "$d_asctime_r_proto" in
10959 case "$asctime_r_proto" in
10960 ''|0) try='char* asctime_r(const struct tm*, char*);'
10961 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10963 case "$asctime_r_proto" in
10964 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10965 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10967 case "$asctime_r_proto" in
10968 ''|0) try='int asctime_r(const struct tm*, char*);'
10969 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10971 case "$asctime_r_proto" in
10972 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10973 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10975 case "$asctime_r_proto" in
10976 ''|0) d_asctime_r=undef
10978 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10979 * ) case "$asctime_r_proto" in
10980 REENTRANT_PROTO*) ;;
10981 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10983 echo "Prototype: $try" ;;
10986 *) case "$usethreads" in
10987 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10994 *) asctime_r_proto=0
10998 : see if asinh exists
11002 : see if atanh exists
11006 : see if atolf exists
11010 : see if atoll exists
11014 : Look for GCC-style attribute format
11015 case "$d_attribute_format" in
11018 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11019 $cat >attrib.c <<'EOCP'
11021 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11023 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11024 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11025 echo "Your C compiler doesn't support __attribute__((format))."
11028 echo "Your C compiler supports __attribute__((format))."
11032 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11036 *) val="$d_attribute_format" ;;
11038 set d_attribute_format
11042 : Look for GCC-style attribute format with null format allowed
11043 case "$d_printf_format_null" in
11044 '') case "$d_attribute_format" in
11047 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11048 $cat >attrib.c <<EOCP
11050 #$i_stdlib I_STDLIB
11052 #include <stdlib.h>
11054 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11055 int null_printf (char* pat,...) { return (int)pat; }
11056 int main () { exit(null_printf(NULL)); }
11058 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11059 : run the executable in case it produces a run-time warning
11060 if $run ./attrib >>attrib.out 2>&1; then
11061 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11062 echo "Your C compiler doesn't allow __printf__ format to be null."
11065 echo "Your C compiler allows __printf__ format to be null."
11069 echo "Your C compiler executable failed with __printf__ format null."
11073 echo "Your C compiler fails with __printf__ format null."
11080 *) val="$d_printf_format_null" ;;
11082 set d_printf_format_null
11086 : Look for GCC-style attribute malloc
11087 case "$d_attribute_malloc" in
11090 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11091 $cat >attrib.c <<'EOCP'
11093 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11095 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11096 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11097 echo "Your C compiler doesn't support __attribute__((malloc))."
11100 echo "Your C compiler supports __attribute__((malloc))."
11104 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11108 *) val="$d_attribute_malloc" ;;
11110 set d_attribute_malloc
11114 : Look for GCC-style attribute nonnull
11115 case "$d_attribute_nonnull" in
11118 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11119 $cat >attrib.c <<'EOCP'
11121 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11123 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11124 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11125 echo "Your C compiler doesn't support __attribute__((nonnull))."
11128 echo "Your C compiler supports __attribute__((nonnull))."
11132 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11136 *) val="$d_attribute_nonnull" ;;
11138 set d_attribute_nonnull
11142 : Look for GCC-style attribute noreturn
11143 case "$d_attribute_noreturn" in
11146 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11147 $cat >attrib.c <<'EOCP'
11149 void fall_over_dead( void ) __attribute__((noreturn));
11151 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11152 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11153 echo "Your C compiler doesn't support __attribute__((noreturn))."
11156 echo "Your C compiler supports __attribute__((noreturn))."
11160 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11164 *) val="$d_attribute_noreturn" ;;
11166 set d_attribute_noreturn
11170 : Look for GCC-style attribute pure
11171 case "$d_attribute_pure" in
11174 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11175 $cat >attrib.c <<'EOCP'
11177 int square( int n ) __attribute__((pure));
11179 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11180 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11181 echo "Your C compiler doesn't support __attribute__((pure))."
11184 echo "Your C compiler supports __attribute__((pure))."
11188 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11192 *) val="$d_attribute_pure" ;;
11194 set d_attribute_pure
11198 : Look for GCC-style attribute unused
11199 case "$d_attribute_unused" in
11202 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11203 $cat >attrib.c <<'EOCP'
11205 int do_something( int dummy __attribute__((unused)), int n );
11207 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11208 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11209 echo "Your C compiler doesn't support __attribute__((unused))."
11212 echo "Your C compiler supports __attribute__((unused))."
11216 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11220 *) val="$d_attribute_unused" ;;
11222 set d_attribute_unused
11226 : Look for GCC-style attribute deprecated
11227 case "$d_attribute_deprecated" in
11230 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11231 $cat >attrib.c <<'EOCP'
11233 int I_am_deprecated(void) __attribute__((deprecated));
11235 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11236 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11237 echo "Your C compiler doesn't support __attribute__((deprecated))."
11240 echo "Your C compiler supports __attribute__((deprecated))."
11244 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11248 *) val="$d_attribute_deprecated" ;;
11250 set d_attribute_deprecated
11254 : Look for GCC-style attribute warn_unused_result
11255 case "$d_attribute_warn_unused_result" in
11258 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11259 $cat >attrib.c <<'EOCP'
11261 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11263 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11264 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11265 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11268 echo "Your C compiler supports __attribute__((warn_unused_result))."
11272 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11276 *) val="$d_attribute_warn_unused_result" ;;
11278 set d_attribute_warn_unused_result
11282 : see if bcmp exists
11286 : see if bcopy exists
11290 : see if getpgrp exists
11291 set getpgrp d_getpgrp
11294 case "$d_getpgrp" in
11297 echo "Checking to see which flavor of getpgrp is in use..."
11299 #$i_unistd I_UNISTD
11300 #include <sys/types.h>
11302 # include <unistd.h>
11304 #$i_stdlib I_STDLIB
11306 #include <stdlib.h>
11310 if (getuid() == 0) {
11311 printf("(I see you are running Configure as super-user...)\n");
11314 #ifdef TRY_BSD_PGRP
11315 if (getpgrp(1) == 0)
11324 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11325 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11327 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11328 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11331 echo "I can't seem to compile and run the test program."
11333 xxx="a USG one, i.e. you use getpgrp()."
11335 # SVR4 systems can appear rather BSD-ish.
11336 case "$i_unistd" in
11338 xxx="a BSD one, i.e. you use getpgrp(pid)."
11342 xxx="probably a USG one, i.e. you use getpgrp()."
11347 echo "Assuming your getpgrp is $xxx" >&4
11356 : see if setpgrp exists
11357 set setpgrp d_setpgrp
11360 case "$d_setpgrp" in
11363 echo "Checking to see which flavor of setpgrp is in use..."
11365 #$i_unistd I_UNISTD
11366 #include <sys/types.h>
11368 # include <unistd.h>
11370 #$i_stdlib I_STDLIB
11372 #include <stdlib.h>
11376 if (getuid() == 0) {
11377 printf("(I see you are running Configure as super-user...)\n");
11380 #ifdef TRY_BSD_PGRP
11381 if (-1 == setpgrp(1, 1))
11384 if (setpgrp() != -1)
11390 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11391 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11393 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11394 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11397 echo "(I can't seem to compile and run the test program.)"
11399 xxx="a USG one, i.e. you use setpgrp()."
11401 # SVR4 systems can appear rather BSD-ish.
11402 case "$i_unistd" in
11404 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11408 xxx="probably a USG one, i.e. you use setpgrp()."
11413 echo "Assuming your setpgrp is $xxx" >&4
11422 : Look for GCC-style __builtin_choose_expr
11423 case "$d_builtin_choose_expr" in
11426 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11427 $cat >try.c <<'EOCP'
11428 #include <assert.h>
11429 #include <stdlib.h>
11432 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11435 assert( SYRINX(1) == 2112 );
11436 assert( SYRINX(1) != 5150 );
11437 assert( SYRINX(0) == 5150 );
11438 assert( SYRINX(0) != 2112 );
11439 puts( "All good!" );
11445 if eval $compile && $run ./try; then
11446 echo "Your C compiler supports __builtin_choose_expr."
11449 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11453 *) val="$d_builtin_choose_expr" ;;
11456 set d_builtin_choose_expr
11460 : Look for GCC-style __builtin_expect
11461 case "$d_builtin_expect" in
11464 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11465 $cat >try.c <<'EOCP'
11468 if ( __builtin_expect(n, 0) ) n = 1;
11469 /* Remember shell exit code truth is 0, C truth is non-zero */
11474 if eval $compile && $run ./try; then
11475 echo "Your C compiler supports __builtin_expect."
11478 echo "Your C compiler doesn't seem to understand __builtin_expect."
11482 *) val="$d_builtin_expect" ;;
11485 set d_builtin_expect
11489 : see if bzero exists
11493 : see if stdarg is available
11495 if $test `./findhdr stdarg.h`; then
11496 echo "<stdarg.h> found." >&4
11499 echo "<stdarg.h> NOT found." >&4
11503 : see if varargs is available
11505 if $test `./findhdr varargs.h`; then
11506 echo "<varargs.h> found." >&4
11508 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11511 : set up the varargs testing programs
11512 $cat > varargs.c <<EOP
11514 #include <stdarg.h>
11517 #include <varargs.h>
11521 int f(char *p, ...)
11535 p = va_arg(ap, char *);
11541 $cat > varargs <<EOP
11543 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11552 : now check which varargs header should be included
11558 if `./varargs I_STDARG`; then
11560 elif `./varargs I_VARARGS`; then
11565 if `./varargs I_VARARGS`; then
11573 echo "*** WHOA THERE!!! ***" >&4
11574 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11575 case "$knowitall" in
11577 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11581 echo "I could not find the definition for va_dcl... You have problems..." >&4
11582 val="$undef"; set i_stdarg; eval $setvar
11583 val="$undef"; set i_varargs; eval $setvar
11588 case "$i_varhdr" in
11590 val="$define"; set i_stdarg; eval $setvar
11591 val="$undef"; set i_varargs; eval $setvar
11594 val="$undef"; set i_stdarg; eval $setvar
11595 val="$define"; set i_varargs; eval $setvar
11598 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11602 : see if the Compiler supports C99 variadic macros
11603 case "$i_stdarg$i_stdlib" in
11605 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11608 #include <stdarg.h>
11610 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11614 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11620 if eval $compile && $run ./try 2>&1 >/dev/null; then
11621 case "`$run ./try`" in
11623 echo "You have C99 variadic macros." >&4
11624 d_c99_variadic_macros="$define"
11627 echo "You don't have functional C99 variadic macros." >&4
11628 d_c99_variadic_macros="$undef"
11632 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11633 d_c99_variadic_macros="$undef"
11638 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11639 d_c99_variadic_macros="$undef"
11643 : see if signal is declared as pointer to function returning int or void
11645 xxx=`./findhdr signal.h`
11646 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11647 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11648 echo "You have int (*signal())() instead of void." >&4
11650 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11651 echo "You have void (*signal())()." >&4
11653 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11654 echo "You have int (*signal())() instead of void." >&4
11656 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11657 echo "You have void (*signal())()." >&4
11660 case "$d_voidsig" in
11662 echo "I can't determine whether signal handler returns void or int..." >&4
11664 rp="What type does your signal handler return?"
11667 v*) val="$define";;
11671 echo "As you already told me, signal handler returns void." >&4
11674 *) echo "As you already told me, signal handler returns int." >&4
11681 case "$d_voidsig" in
11682 "$define") signal_t="void";;
11683 *) signal_t="int";;
11687 : check for ability to cast large floats to 32-bit ints.
11689 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11690 if $test "$intsize" -ge 4; then
11697 #$i_stdlib I_STDLIB
11699 #include <stdlib.h>
11701 #include <sys/types.h>
11702 #include <signal.h>
11703 $signal_t blech(int s) { exit(3); }
11710 signal(SIGFPE, blech);
11712 /* Don't let compiler optimize the test away. Store the number
11713 in a writable string for gcc to pass to sscanf under HP-UX.
11715 sprintf(str, "2147483647");
11716 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11720 /* x86 processors will probably give 0x8000 0000, which is a
11721 sign change. We don't want that. We want to mimic SPARC
11722 behavior here, which is to preserve the sign and give
11725 if (i32 != ($xxx) f)
11731 if eval $compile_ok; then
11732 $run ./try 2>/dev/null
11735 echo "(I can't seem to compile the test program--assuming it can't)"
11740 echo "Yup, it can."
11743 echo "Nope, it can't."
11750 : check for ability to cast negative floats to unsigned
11752 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11755 #$i_stdlib I_STDLIB
11757 #include <stdlib.h>
11759 #include <sys/types.h>
11760 #include <signal.h>
11761 $signal_t blech(int s) { exit(7); }
11762 $signal_t blech_in_list(int s) { exit(4); }
11763 unsigned long dummy_long(unsigned long p) { return p; }
11764 unsigned int dummy_int(unsigned int p) { return p; }
11765 unsigned short dummy_short(unsigned short p) { return p; }
11769 unsigned long along;
11771 unsigned short ashort;
11775 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11776 a direct f = -123. assignment. gcc-2.8.0 reportedly
11777 optimized the whole file away
11779 /* Store the number in a writable string for gcc to pass to
11780 sscanf under HP-UX.
11782 sprintf(str, "-123");
11783 sscanf(str, "%lf", &f); /* f = -123.; */
11785 signal(SIGFPE, blech);
11786 along = (unsigned long)f;
11787 aint = (unsigned int)f;
11788 ashort = (unsigned short)f;
11789 if (along != (unsigned long)-123)
11791 if (aint != (unsigned int)-123)
11793 if (ashort != (unsigned short)-123)
11795 sprintf(str, "1073741824.");
11796 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11799 along = (unsigned long)f;
11800 if (along != 0x80000000)
11804 along = (unsigned long)f;
11805 if (along != 0x7fffffff)
11809 along = (unsigned long)f;
11810 if (along != 0x80000001)
11814 signal(SIGFPE, blech_in_list);
11815 sprintf(str, "123.");
11816 sscanf(str, "%lf", &f); /* f = 123.; */
11817 along = dummy_long((unsigned long)f);
11818 aint = dummy_int((unsigned int)f);
11819 ashort = dummy_short((unsigned short)f);
11820 if (along != (unsigned long)123)
11822 if (aint != (unsigned int)123)
11824 if (ashort != (unsigned short)123)
11831 if eval $compile_ok; then
11832 $run ./try 2>/dev/null
11835 echo "(I can't seem to compile the test program--assuming it can't)"
11838 case "$castflags" in
11840 echo "Yup, it can."
11843 echo "Nope, it can't."
11850 : see if cbrt exists
11854 : see if vprintf exists
11856 if set vprintf val -f d_vprintf; eval $csym; $val; then
11857 echo 'vprintf() found.' >&4
11860 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11861 #$i_varargs I_VARARGS
11863 #$i_stdlib I_STDLIB
11864 #$i_unistd I_UNISTD
11867 # include <stdarg.h>
11868 #else /* I_VARARGS */
11869 # include <varargs.h>
11873 # include <unistd.h>
11877 # include <stdlib.h>
11880 #include <stdio.h> /* vsprintf prototype */
11883 void xxx(int n, ...)
11888 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11890 int main() { xxx(1, "foo"); }
11892 #else /* I_VARARGS */
11900 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11902 int main() { xxx("foo"); }
11908 if eval $compile_ok; then
11909 if $run ./try; then
11910 echo "Your vsprintf() returns (int)." >&4
11913 echo "Your vsprintf() returns (char*)." >&4
11917 echo 'I am unable to compile the vsprintf() test program.' >&4
11918 # We shouldn't get here. If we do, assume the standard signature,
11919 # not the old BSD one.
11920 echo 'Guessing that vsprintf() returns (int).' >&4
11924 echo 'vprintf() NOT found.' >&4
11935 : see if chown exists
11939 : see if chroot exists
11940 set chroot d_chroot
11943 : see if chsize exists
11944 set chsize d_chsize
11947 : see if class exists
11951 : see if clearenv exists
11952 set clearenv d_clearenv
11955 : Define hasstruct macro for Configure internal use
11956 hasstruct='varname=$1; struct=$2; shift; shift;
11957 while $test $# -ge 2; do
11959 $define) echo "#include <$2>";;
11963 echo "int main () { struct $struct foo; }" >> try.c;
11965 if eval $compile; then
11974 : see whether socket exists
11978 $echo $n "Hmm... $c" >&4
11979 if set socket val -f d_socket; eval $csym; $val; then
11980 echo "Looks like you have Berkeley networking support." >&4
11982 if set setsockopt val -f; eval $csym; $val; then
11985 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11986 d_oldsock="$define"
11989 if $contains socklib libc.list >/dev/null 2>&1; then
11990 echo "Looks like you have Berkeley networking support." >&4
11992 : we will have to assume that it supports the 4.2 BSD interface
11995 echo "You don't have Berkeley networking in libc$_a..." >&4
11996 if test "X$d_socket" = "X$define"; then
11997 echo "...but you seem to believe that you have sockets." >&4
11999 for net in net socket
12001 if test -f $sysroot/usr/lib/lib$net$_a; then
12002 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12003 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12004 if $contains socket libc.list >/dev/null 2>&1; then
12009 echo "...but the Wollongong group seems to have hacked it in." >&4
12010 sockethdr="-I$sysroot/usr/netinclude"
12013 echo "Found Berkeley sockets interface in lib$net." >&4
12014 if $contains setsockopt libc.list >/dev/null 2>&1; then
12017 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12018 d_oldsock="$define"
12024 if test "X$d_socket" != "X$define"; then
12025 echo "or anywhere else I see." >&4
12033 : see if socketpair exists
12034 set socketpair d_sockpair
12039 echo "Checking the availability sa_len in the sock struct ..." >&4
12041 #include <sys/types.h>
12042 #include <sys/socket.h>
12044 struct sockaddr sa;
12045 return (sa.sa_len);
12049 set try; if eval $compile; then
12052 set d_sockaddr_sa_len; eval $setvar
12056 echo "Checking the availability struct sockaddr_in6 ..." >&4
12058 #include <sys/types.h>
12059 #include <sys/socket.h>
12060 #include <netinet/in.h>
12062 struct sockaddr_in6 sin6;
12063 return (sin6.sin6_family);
12067 set try; if eval $compile; then
12070 set d_sockaddr_in6; eval $setvar
12074 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12076 #include <sys/types.h>
12077 #include <sys/socket.h>
12078 #include <netinet/in.h>
12080 struct sockaddr_in6 sin6;
12081 return (sin6.sin6_scope_id);
12085 set try; if eval $compile; then
12088 set d_sin6_scope_id; eval $setvar
12092 echo "Checking the availability struct ip_mreq ..." >&4
12094 #include <sys/types.h>
12095 #include <sys/socket.h>
12096 #include <netinet/in.h>
12098 struct ip_mreq mreq;
12099 return (mreq.imr_multiaddr.s_addr);
12103 set try; if eval $compile; then
12106 set d_ip_mreq; eval $setvar
12110 echo "Checking the availability struct ip_mreq_source ..." >&4
12112 #include <sys/types.h>
12113 #include <sys/socket.h>
12114 #include <netinet/in.h>
12116 struct ip_mreq_source mreq;
12117 return (mreq.imr_multiaddr.s_addr);
12121 set try; if eval $compile; then
12124 set d_ip_mreq_source; eval $setvar
12128 echo "Checking the availability struct ipv6_mreq ..." >&4
12130 #include <sys/types.h>
12131 #include <sys/socket.h>
12132 #include <netinet/in.h>
12134 struct ipv6_mreq mreq;
12135 return (mreq.ipv6mr_interface);
12139 set try; if eval $compile; then
12142 set d_ipv6_mreq; eval $setvar
12146 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12148 #include <sys/types.h>
12149 #include <sys/socket.h>
12150 #include <netinet/in.h>
12152 struct ipv6_mreq_source mreq;
12153 return (mreq.imr_multiaddr.s_addr);
12157 set try; if eval $compile; then
12160 set d_ipv6_mreq_source; eval $setvar
12164 echo "Checking the availability of certain socket constants..." >&4
12165 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12166 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12168 #include <sys/types.h>
12169 #include <sys/socket.h>
12175 set try; if eval $compile; then
12178 set d_${enum}; eval $setvar
12182 : see if this is a sys/uio.h system
12183 set sys/uio.h i_sysuio
12186 : Check for cmsghdr support
12188 echo "Checking to see if your system supports struct cmsghdr..." >&4
12189 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12191 case "$d_cmsghdr_s" in
12192 "$define") echo "Yes, it does." ;;
12193 *) echo "No, it doesn't." ;;
12197 : check for const keyword
12199 echo 'Checking to see if your C compiler knows about "const"...' >&4
12200 $cat >const.c <<'EOCP'
12201 typedef struct spug { int drokk; } spug;
12205 const spug y = { 0 };
12208 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12210 echo "Yup, it does."
12213 echo "Nope, it doesn't."
12218 : see if copysign exists
12219 set copysign d_copysign
12222 : see if copysignl exists
12223 set copysignl d_copysignl
12226 : see if crypt exists
12231 $define) cryptlib='' ;;
12232 *) if set crypt val -f d_crypt; eval $csym; $val; then
12233 echo 'crypt() found.' >&4
12237 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12238 if $test -z "$cryptlib"; then
12239 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12243 if $test -z "$cryptlib"; then
12244 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12248 if $test -z "$cryptlib"; then
12249 cryptlib=`./loc libcrypt$_a "" $libpth`
12253 if $test -z "$cryptlib"; then
12254 echo 'crypt() NOT found.' >&4
12265 : see if this is a crypt.h system
12266 set crypt.h i_crypt
12269 : see if crypt_r exists
12270 set crypt_r d_crypt_r
12272 case "$d_crypt_r" in
12274 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12275 case "$d_crypt_r_proto:$usethreads" in
12276 ":define") d_crypt_r_proto=define
12277 set d_crypt_r_proto crypt_r $hdrs
12281 case "$d_crypt_r_proto" in
12283 case "$crypt_r_proto" in
12284 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12285 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12287 case "$crypt_r_proto" in
12288 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12289 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12291 case "$crypt_r_proto" in
12292 ''|0) d_crypt_r=undef
12294 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12295 * ) case "$crypt_r_proto" in
12296 REENTRANT_PROTO*) ;;
12297 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12299 echo "Prototype: $try" ;;
12302 *) case "$usethreads" in
12303 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12314 : get csh whereabouts
12316 'csh') val="$undef" ;;
12317 *) val="$define" ;;
12321 : Respect a hint or command line value for full_csh.
12322 case "$full_csh" in
12323 '') full_csh=$csh ;;
12326 : see if ctermid exists
12327 set ctermid d_ctermid
12330 : see if ctermid_r exists
12331 set ctermid_r d_ctermid_r
12333 case "$d_ctermid_r" in
12335 hdrs="$i_systypes sys/types.h define stdio.h "
12336 case "$d_ctermid_r_proto:$usethreads" in
12337 ":define") d_ctermid_r_proto=define
12338 set d_ctermid_r_proto ctermid_r $hdrs
12342 case "$d_ctermid_r_proto" in
12344 case "$ctermid_r_proto" in
12345 ''|0) try='char* ctermid_r(char*);'
12346 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12348 case "$ctermid_r_proto" in
12349 ''|0) d_ctermid_r=undef
12351 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12352 * ) case "$ctermid_r_proto" in
12353 REENTRANT_PROTO*) ;;
12354 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12356 echo "Prototype: $try" ;;
12359 *) case "$usethreads" in
12360 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12367 *) ctermid_r_proto=0
12371 : see if ctime_r exists
12372 set ctime_r d_ctime_r
12374 case "$d_ctime_r" in
12376 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12377 case "$d_ctime_r_proto:$usethreads" in
12378 ":define") d_ctime_r_proto=define
12379 set d_ctime_r_proto ctime_r $hdrs
12383 case "$d_ctime_r_proto" in
12385 case "$ctime_r_proto" in
12386 ''|0) try='char* ctime_r(const time_t*, char*);'
12387 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12389 case "$ctime_r_proto" in
12390 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12391 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12393 case "$ctime_r_proto" in
12394 ''|0) try='int ctime_r(const time_t*, char*);'
12395 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12397 case "$ctime_r_proto" in
12398 ''|0) try='int ctime_r(const time_t*, char*, int);'
12399 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12401 case "$ctime_r_proto" in
12402 ''|0) d_ctime_r=undef
12404 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12405 * ) case "$ctime_r_proto" in
12406 REENTRANT_PROTO*) ;;
12407 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12409 echo "Prototype: $try" ;;
12412 *) case "$usethreads" in
12413 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12424 : see if cuserid exists
12425 set cuserid d_cuserid
12428 : see if this is a limits.h system
12429 set limits.h i_limits
12432 : See if number of significant digits in a double precision number is known
12434 $cat >dbl_dig.c <<EOM
12435 #$i_limits I_LIMITS
12438 #include <limits.h>
12444 printf("Contains DBL_DIG");
12447 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12448 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12449 echo "DBL_DIG found." >&4
12452 echo "DBL_DIG NOT found." >&4
12459 : see if dbm.h is available
12460 : see if dbmclose exists
12461 set dbmclose d_dbmclose
12464 case "$d_dbmclose" in
12474 *) set rpcsvc/dbm.h i_rpcsvcdbm
12479 *) echo "We won't be including <dbm.h>"
12489 : see if prototype for dbminit is available
12491 set d_dbminitproto dbminit $i_dbm dbm.h
12494 : see if difftime exists
12495 set difftime d_difftime
12498 : see if this is a dirent system
12500 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12502 echo "<dirent.h> found." >&4
12505 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12506 echo "<sys/dir.h> found." >&4
12509 xinc=`./findhdr sys/ndir.h`
12511 echo "<dirent.h> NOT found." >&4
12516 : Look for type of directory structure.
12518 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12520 case "$direntrytype" in
12522 case "$i_dirent" in
12523 $define) guess1='struct dirent' ;;
12524 *) guess1='struct direct' ;;
12527 *) guess1="$direntrytype"
12532 'struct dirent') guess2='struct direct' ;;
12533 *) guess2='struct dirent' ;;
12536 if $contains "$guess1" try.c >/dev/null 2>&1; then
12537 direntrytype="$guess1"
12538 echo "Your directory entries are $direntrytype." >&4
12539 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12540 direntrytype="$guess2"
12541 echo "Your directory entries seem to be $direntrytype." >&4
12543 echo "I don't recognize your system's directory entries." >&4
12544 rp="What type is used for directory entries on this system?"
12547 direntrytype="$ans"
12551 : see if the directory entry stores field length
12553 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12554 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12555 echo "Good, your directory entry keeps length information in d_namlen." >&4
12558 echo "Your directory entry does not know about the d_namlen field." >&4
12565 : Look for DIR.dd_fd
12566 case "$i_dirent" in
12568 echo "Checking to see if DIR has a dd_fd member variable" >&4
12570 #$i_stdlib I_STDLIB
12572 #include <stdlib.h>
12574 #include <dirent.h>
12584 if eval $compile; then
12585 echo "Yes, it does."
12588 echo "No, it does not."
12593 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12601 : see if this is an sysdir system
12602 set sys/dir.h i_sysdir
12605 : see if this is an sysndir system
12606 set sys/ndir.h i_sysndir
12611 $cat >dirfd.c <<EOM
12613 #$i_stdlib I_STDLIB
12615 #include <stdlib.h>
12617 #$i_dirent I_DIRENT /**/
12618 #$i_sysdir I_SYS_DIR /**/
12619 #$i_sysndir I_SYS_NDIR /**/
12620 #$i_systypes I_SYS_TYPES /**/
12621 #if defined(I_SYS_TYPES)
12622 #include <sys/types.h>
12624 #if defined(I_DIRENT)
12625 #include <dirent.h>
12628 #include <sys/ndir.h>
12632 #include <ndir.h> /* may be wrong in the future */
12634 #include <sys/dir.h>
12640 DIR *dirp = opendir(".");
12641 if (dirfd(dirp) >= 0)
12649 if eval $compile; then
12653 $define) echo "dirfd() found." >&4 ;;
12654 *) echo "dirfd() NOT found." >&4 ;;
12660 : see if dladdr exists
12661 set dladdr d_dladdr
12664 : see if dlerror exists
12667 set dlerror d_dlerror
12671 : see if dlfcn is available
12672 set dlfcn.h i_dlfcn
12675 : Check what extension to use for shared libs
12680 On a few systems, the dynamically loaded modules that perl generates and uses
12681 will need a different extension than shared libs. The default will probably
12687 *) dflt="$dlext" ;;
12689 rp='What is the extension of dynamically loaded modules'
12698 : Check if dlsym need a leading underscore
12704 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12705 $cat >dyna.c <<'EOM'
12712 #$i_stdlib I_STDLIB
12714 #include <stdlib.h>
12718 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12720 #include <sys/types.h>
12725 extern int fred() ;
12734 int mode = RTLD_LAZY ;
12736 handle = dlopen("./dyna.$dlext", mode) ;
12737 if (handle == NULL) {
12742 symbol = dlsym(handle, "fred") ;
12743 if (symbol == NULL) {
12744 /* try putting a leading underscore */
12745 symbol = dlsym(handle, "_fred") ;
12746 if (symbol == NULL) {
12759 : Call the object file tmp-dyna.o in case dlext=o.
12760 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12761 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12762 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12763 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12766 1) echo "Test program failed using dlopen." >&4
12767 echo "Perhaps you should not use dynamic loading." >&4;;
12768 2) echo "Test program failed using dlsym." >&4
12769 echo "Perhaps you should not use dynamic loading." >&4;;
12770 3) echo "dlsym needs a leading underscore" >&4
12772 4) echo "dlsym doesn't need a leading underscore." >&4;;
12775 echo "I can't compile and run the test program." >&4
12776 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12781 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12786 : see if drand48_r exists
12787 set drand48_r d_drand48_r
12789 case "$d_drand48_r" in
12791 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12792 case "$d_drand48_r_proto:$usethreads" in
12793 ":define") d_drand48_r_proto=define
12794 set d_drand48_r_proto drand48_r $hdrs
12798 case "$d_drand48_r_proto" in
12800 case "$drand48_r_proto" in
12801 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12802 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12804 case "$drand48_r_proto" in
12805 ''|0) d_drand48_r=undef
12807 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12808 * ) case "$drand48_r_proto" in
12809 REENTRANT_PROTO*) ;;
12810 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12812 echo "Prototype: $try" ;;
12815 *) case "$usethreads" in
12816 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12823 *) drand48_r_proto=0
12827 : see if prototype for drand48 is available
12829 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12832 : see if dup2 exists
12836 : see if eaccess exists
12837 set eaccess d_eaccess
12840 : see if endgrent exists
12841 set endgrent d_endgrent
12844 : see if this is an grp system
12850 xxx=`./findhdr grp.h`
12851 $cppstdin $cppflags $cppminus < $xxx >$$.h
12853 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12865 set d_grpasswd; eval $setvar
12869 : see if endgrent_r exists
12870 set endgrent_r d_endgrent_r
12872 case "$d_endgrent_r" in
12874 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12875 case "$d_endgrent_r_proto:$usethreads" in
12876 ":define") d_endgrent_r_proto=define
12877 set d_endgrent_r_proto endgrent_r $hdrs
12881 case "$d_endgrent_r_proto" in
12883 case "$endgrent_r_proto" in
12884 ''|0) try='int endgrent_r(FILE**);'
12885 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12887 case "$endgrent_r_proto" in
12888 ''|0) try='void endgrent_r(FILE**);'
12889 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12891 case "$endgrent_r_proto" in
12892 ''|0) d_endgrent_r=undef
12894 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12895 * ) case "$endgrent_r_proto" in
12896 REENTRANT_PROTO*) ;;
12897 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12899 echo "Prototype: $try" ;;
12902 *) case "$usethreads" in
12903 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12910 *) endgrent_r_proto=0
12914 : see if endhostent exists
12915 set endhostent d_endhent
12918 : see if this is a netdb.h system
12919 set netdb.h i_netdb
12922 : see if endhostent_r exists
12923 set endhostent_r d_endhostent_r
12925 case "$d_endhostent_r" in
12927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12928 case "$d_endhostent_r_proto:$usethreads" in
12929 ":define") d_endhostent_r_proto=define
12930 set d_endhostent_r_proto endhostent_r $hdrs
12934 case "$d_endhostent_r_proto" in
12936 case "$endhostent_r_proto" in
12937 ''|0) try='int endhostent_r(struct hostent_data*);'
12938 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12940 case "$endhostent_r_proto" in
12941 ''|0) try='void endhostent_r(struct hostent_data*);'
12942 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12944 case "$endhostent_r_proto" in
12945 ''|0) d_endhostent_r=undef
12946 endhostent_r_proto=0
12947 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12948 * ) case "$endhostent_r_proto" in
12949 REENTRANT_PROTO*) ;;
12950 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12952 echo "Prototype: $try" ;;
12955 *) case "$usethreads" in
12956 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12958 d_endhostent_r=undef
12959 endhostent_r_proto=0
12963 *) endhostent_r_proto=0
12967 : see if endnetent exists
12968 set endnetent d_endnent
12971 : see if endnetent_r exists
12972 set endnetent_r d_endnetent_r
12974 case "$d_endnetent_r" in
12976 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12977 case "$d_endnetent_r_proto:$usethreads" in
12978 ":define") d_endnetent_r_proto=define
12979 set d_endnetent_r_proto endnetent_r $hdrs
12983 case "$d_endnetent_r_proto" in
12985 case "$endnetent_r_proto" in
12986 ''|0) try='int endnetent_r(struct netent_data*);'
12987 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12989 case "$endnetent_r_proto" in
12990 ''|0) try='void endnetent_r(struct netent_data*);'
12991 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12993 case "$endnetent_r_proto" in
12994 ''|0) d_endnetent_r=undef
12995 endnetent_r_proto=0
12996 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12997 * ) case "$endnetent_r_proto" in
12998 REENTRANT_PROTO*) ;;
12999 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13001 echo "Prototype: $try" ;;
13004 *) case "$usethreads" in
13005 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13007 d_endnetent_r=undef
13008 endnetent_r_proto=0
13012 *) endnetent_r_proto=0
13016 : see if endprotoent exists
13017 set endprotoent d_endpent
13020 : see if endprotoent_r exists
13021 set endprotoent_r d_endprotoent_r
13023 case "$d_endprotoent_r" in
13025 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13026 case "$d_endprotoent_r_proto:$usethreads" in
13027 ":define") d_endprotoent_r_proto=define
13028 set d_endprotoent_r_proto endprotoent_r $hdrs
13032 case "$d_endprotoent_r_proto" in
13034 case "$endprotoent_r_proto" in
13035 ''|0) try='int endprotoent_r(struct protoent_data*);'
13036 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13038 case "$endprotoent_r_proto" in
13039 ''|0) try='void endprotoent_r(struct protoent_data*);'
13040 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13042 case "$endprotoent_r_proto" in
13043 ''|0) d_endprotoent_r=undef
13044 endprotoent_r_proto=0
13045 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13046 * ) case "$endprotoent_r_proto" in
13047 REENTRANT_PROTO*) ;;
13048 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13050 echo "Prototype: $try" ;;
13053 *) case "$usethreads" in
13054 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13056 d_endprotoent_r=undef
13057 endprotoent_r_proto=0
13061 *) endprotoent_r_proto=0
13065 : see if endpwent exists
13066 set endpwent d_endpwent
13069 : see if this is a pwd.h system
13075 xxx=`./findhdr pwd.h`
13076 $cppstdin $cppflags $cppminus < $xxx >$$.h
13078 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13086 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13094 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13102 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13110 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13118 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13126 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13134 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13146 set d_pwquota; eval $setvar
13147 set d_pwage; eval $setvar
13148 set d_pwchange; eval $setvar
13149 set d_pwclass; eval $setvar
13150 set d_pwexpire; eval $setvar
13151 set d_pwcomment; eval $setvar
13152 set d_pwgecos; eval $setvar
13153 set d_pwpasswd; eval $setvar
13157 : see if endpwent_r exists
13158 set endpwent_r d_endpwent_r
13160 case "$d_endpwent_r" in
13162 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13163 case "$d_endpwent_r_proto:$usethreads" in
13164 ":define") d_endpwent_r_proto=define
13165 set d_endpwent_r_proto endpwent_r $hdrs
13169 case "$d_endpwent_r_proto" in
13171 case "$endpwent_r_proto" in
13172 ''|0) try='int endpwent_r(FILE**);'
13173 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13175 case "$endpwent_r_proto" in
13176 ''|0) try='void endpwent_r(FILE**);'
13177 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13179 case "$endpwent_r_proto" in
13180 ''|0) d_endpwent_r=undef
13182 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13183 * ) case "$endpwent_r_proto" in
13184 REENTRANT_PROTO*) ;;
13185 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13187 echo "Prototype: $try" ;;
13190 *) case "$usethreads" in
13191 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13198 *) endpwent_r_proto=0
13202 : see if endservent exists
13203 set endservent d_endsent
13206 : see if endservent_r exists
13207 set endservent_r d_endservent_r
13209 case "$d_endservent_r" in
13211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13212 case "$d_endservent_r_proto:$usethreads" in
13213 ":define") d_endservent_r_proto=define
13214 set d_endservent_r_proto endservent_r $hdrs
13218 case "$d_endservent_r_proto" in
13220 case "$endservent_r_proto" in
13221 ''|0) try='int endservent_r(struct servent_data*);'
13222 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13224 case "$endservent_r_proto" in
13225 ''|0) try='void endservent_r(struct servent_data*);'
13226 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13228 case "$endservent_r_proto" in
13229 ''|0) d_endservent_r=undef
13230 endservent_r_proto=0
13231 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13232 * ) case "$endservent_r_proto" in
13233 REENTRANT_PROTO*) ;;
13234 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13236 echo "Prototype: $try" ;;
13239 *) case "$usethreads" in
13240 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13242 d_endservent_r=undef
13243 endservent_r_proto=0
13247 *) endservent_r_proto=0
13251 : Locate the flags for 'open()'
13254 #include <sys/types.h>
13259 #include <sys/file.h>
13261 #$i_stdlib I_STDLIB
13263 #include <stdlib.h>
13274 : check sys/file.h first to get FREAD on Sun
13275 if $test `./findhdr sys/file.h` && \
13276 set try -DI_SYS_FILE && eval $compile; then
13278 echo "<sys/file.h> defines the O_* constants..." >&4
13279 if $run ./try; then
13280 echo "and you have the 3 argument form of open()." >&4
13283 echo "but not the 3 argument form of open(). Oh, well." >&4
13286 elif $test `./findhdr fcntl.h` && \
13287 set try -DI_FCNTL && eval $compile; then
13289 echo "<fcntl.h> defines the O_* constants..." >&4
13290 if $run ./try; then
13291 echo "and you have the 3 argument form of open()." >&4
13294 echo "but not the 3 argument form of open(). Oh, well." >&4
13299 echo "I can't find the O_* constant definitions! You got problems." >&4
13305 : see if this is a sys/file.h system
13310 : do we need to include sys/file.h ?
13314 if $h_sysfile; then
13316 echo "We'll be including <sys/file.h>." >&4
13319 echo "We won't be including <sys/file.h>." >&4
13329 : see if fcntl.h is there
13334 : see if we can include fcntl.h
13340 echo "We'll be including <fcntl.h>." >&4
13343 if $h_sysfile; then
13344 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13346 echo "We won't be including <fcntl.h>." >&4
13358 : see if fork exists
13362 : see if pipe exists
13366 : check for non-blocking I/O stuff
13367 case "$h_sysfile" in
13368 true) echo "#include <sys/file.h>" > head.c;;
13371 true) echo "#include <fcntl.h>" > head.c;;
13372 *) echo "#include <sys/fcntl.h>" > head.c;;
13377 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13378 case "$o_nonblock" in
13380 $cat head.c > try.c
13381 $cat >>try.c <<EOCP
13383 #$i_stdlib I_STDLIB
13385 #include <stdlib.h>
13393 printf("O_NONBLOCK\n");
13397 printf("O_NDELAY\n");
13401 printf("FNDELAY\n");
13408 if eval $compile_ok; then
13409 o_nonblock=`$run ./try`
13410 case "$o_nonblock" in
13411 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13412 *) echo "Seems like we can use $o_nonblock.";;
13415 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13418 *) echo "Using $hint value $o_nonblock.";;
13423 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13426 case "$d_fork:$d_pipe:$d_alarm" in
13427 define:define:define)
13428 $cat head.c > try.c
13429 $cat >>try.c <<EOCP
13431 #include <sys/types.h>
13432 #include <signal.h>
13434 #$i_stdlib I_STDLIB
13436 #include <stdlib.h>
13442 #define MY_O_NONBLOCK $o_nonblock
13443 #ifndef errno /* XXX need better Configure test */
13446 #$i_unistd I_UNISTD
13448 #include <unistd.h>
13450 #$i_string I_STRING
13452 #include <string.h>
13454 #include <strings.h>
13456 $signal_t blech(int x) { exit(3); }
13458 $cat >> try.c <<'EOCP'
13467 ret = pipe(pd); /* Down: child -> parent */
13470 ret = pipe(pu); /* Up: parent -> child */
13474 close(pd[1]); /* Parent reads from pd[0] */
13475 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13477 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13482 signal(SIGALRM, blech);
13484 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13486 sprintf(string, "%d\n", ret);
13487 ret = write(2, string, strlen(string));
13488 if (ret != strlen(string))
13492 if (errno == EAGAIN) {
13493 printf("EAGAIN\n");
13498 if (errno == EWOULDBLOCK)
13499 printf("EWOULDBLOCK\n");
13502 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13505 sleep(2); /* Give it time to close our pipe */
13507 ret = read(pd[0], buf, 1); /* Should read EOF */
13509 sprintf(string, "%d\n", ret);
13510 ret = write(4, string, strlen(string));
13511 if (ret != strlen(string))
13516 close(pd[0]); /* We write to pd[1] */
13517 close(pu[1]); /* We read from pu[0] */
13518 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13521 close(pd[1]); /* Pipe pd is now fully closed! */
13522 exit(0); /* Bye bye, thank you for playing! */
13526 if eval $compile_ok; then
13527 echo "$startsh" >mtry
13528 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13530 $run ./mtry >/dev/null 2>&1
13532 0) eagain=`$cat try.out`;;
13533 1) echo "Could not perform non-blocking setting!";;
13534 2) echo "I did a successful read() for something that was not there!";;
13535 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13536 4) echo "Could not find F_SETFL!";;
13537 *) echo "Something terribly wrong happened during testing.";;
13539 rd_nodata=`$cat try.ret`
13540 echo "A read() system call with no data present returns $rd_nodata."
13541 case "$rd_nodata" in
13544 echo "(That's peculiar, fixing that to be -1.)"
13550 echo "Forcing errno EAGAIN on read() with no data available."
13554 echo "Your read() sets errno to $eagain when no data is available."
13557 status=`$cat try.err`
13559 0) echo "And it correctly returns 0 to signal EOF.";;
13560 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13561 *) echo "However, your read() returns '$status' on EOF??";;
13564 if test "$status" = "$rd_nodata"; then
13565 echo "WARNING: you can't distinguish between EOF and no data!"
13569 echo "I can't compile the test program--assuming errno EAGAIN will do."
13573 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13582 echo "Using $hint value $eagain."
13583 echo "Your read() returns $rd_nodata when no data is present."
13584 case "$d_eofnblk" in
13585 "$define") echo "And you can see EOF because read() returns 0.";;
13586 "$undef") echo "But you can't see EOF status from read() returned value.";;
13588 echo "(Assuming you can't see EOF status from read anyway.)"
13594 $rm_try head.c mtry
13596 : see if erf exists
13600 : see if erfc exists
13604 : see if exp2 exists
13608 : see if expm1 exists
13612 : see if _ptr and _cnt from stdio act std
13615 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13616 echo "(Looks like you have stdio.h from BSD.)"
13617 case "$stdio_ptr" in
13618 '') stdio_ptr='((fp)->_p)'
13621 *) ptr_lval=$d_stdio_ptr_lval;;
13623 case "$stdio_cnt" in
13624 '') stdio_cnt='((fp)->_r)'
13627 *) cnt_lval=$d_stdio_cnt_lval;;
13629 case "$stdio_base" in
13630 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13632 case "$stdio_bufsiz" in
13633 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13635 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13636 echo "(Looks like you have stdio.h from Linux.)"
13637 case "$stdio_ptr" in
13638 '') stdio_ptr='((fp)->_IO_read_ptr)'
13641 *) ptr_lval=$d_stdio_ptr_lval;;
13643 case "$stdio_cnt" in
13644 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13647 *) cnt_lval=$d_stdio_cnt_lval;;
13649 case "$stdio_base" in
13650 '') stdio_base='((fp)->_IO_read_base)';;
13652 case "$stdio_bufsiz" in
13653 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13656 case "$stdio_ptr" in
13657 '') stdio_ptr='((fp)->_ptr)'
13660 *) ptr_lval=$d_stdio_ptr_lval;;
13662 case "$stdio_cnt" in
13663 '') stdio_cnt='((fp)->_cnt)'
13666 *) cnt_lval=$d_stdio_cnt_lval;;
13668 case "$stdio_base" in
13669 '') stdio_base='((fp)->_base)';;
13671 case "$stdio_bufsiz" in
13672 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13676 : test whether _ptr and _cnt really work
13677 echo "Checking how std your stdio is..." >&4
13680 #$i_stdlib I_STDLIB
13682 #include <stdlib.h>
13684 #define FILE_ptr(fp) $stdio_ptr
13685 #define FILE_cnt(fp) $stdio_cnt
13687 FILE *fp = fopen("try.c", "r");
13690 18 <= FILE_cnt(fp) &&
13691 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13699 if eval $compile && $to try.c; then
13700 if $run ./try; then
13701 echo "Your stdio acts pretty std."
13704 echo "Your stdio isn't very std."
13707 echo "Your stdio doesn't appear very std."
13711 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13712 # direct buffer manipulation no longer works. The Configure tests
13713 # should be changed to correctly detect this, but until then,
13714 # the following check should at least let perl compile and run.
13715 # (This quick fix should be updated before 5.8.1.)
13716 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13717 # A. Dougherty, June 3, 2002.
13718 case "$d_gnulibc" in
13720 case "$gnulibc_version" in
13724 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13733 : Can _ptr be used as an lvalue?
13734 case "$d_stdstdio$ptr_lval" in
13735 $define$define) val=$define ;;
13738 set d_stdio_ptr_lval
13741 : Can _cnt be used as an lvalue?
13742 case "$d_stdstdio$cnt_lval" in
13743 $define$define) val=$define ;;
13746 set d_stdio_cnt_lval
13750 : test whether setting _ptr sets _cnt as a side effect
13751 d_stdio_ptr_lval_sets_cnt="$undef"
13752 d_stdio_ptr_lval_nochange_cnt="$undef"
13753 case "$d_stdio_ptr_lval$d_stdstdio" in
13755 echo "Checking to see what happens if we set the stdio ptr..." >&4
13758 /* Can we scream? */
13759 /* Eat dust sed :-) */
13760 /* In the buffer space, no one can hear you scream. */
13761 #$i_stdlib I_STDLIB
13763 #include <stdlib.h>
13765 #define FILE_ptr(fp) $stdio_ptr
13766 #define FILE_cnt(fp) $stdio_cnt
13767 #include <sys/types.h>
13769 FILE *fp = fopen("try.c", "r");
13774 puts("Fail even to read");
13777 c = getc(fp); /* Read away the first # */
13779 puts("Fail even to read");
13783 18 <= FILE_cnt(fp) &&
13784 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13786 puts("Fail even to read");
13789 ptr = (char*) FILE_ptr(fp);
13790 cnt = (size_t)FILE_cnt(fp);
13792 FILE_ptr(fp) += 42;
13794 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13795 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13798 if (FILE_cnt(fp) <= 20) {
13799 printf ("Fail (<20 chars to test)");
13802 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13803 puts("Fail compare");
13806 if (cnt == FILE_cnt(fp)) {
13807 puts("Pass_unchanged");
13810 if (FILE_cnt(fp) == (cnt - 42)) {
13811 puts("Pass_changed");
13814 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13820 if eval $compile && $to try.c; then
13821 case `$run ./try` in
13823 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13824 d_stdio_ptr_lval_sets_cnt="$define" ;;
13826 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13827 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13829 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13831 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13834 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13840 : see if _base is also standard
13842 case "$d_stdstdio" in
13846 #$i_stdlib I_STDLIB
13848 #include <stdlib.h>
13850 #define FILE_base(fp) $stdio_base
13851 #define FILE_bufsiz(fp) $stdio_bufsiz
13853 FILE *fp = fopen("try.c", "r");
13856 19 <= FILE_bufsiz(fp) &&
13857 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13864 if eval $compile && $to try.c; then
13865 if $run ./try; then
13866 echo "And its _base field acts std."
13869 echo "But its _base field isn't std."
13872 echo "However, it seems to be lacking the _base field."
13880 : see if fast_stdio exists
13882 case "$d_stdstdio:$d_stdio_ptr_lval" in
13884 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13886 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13897 : see if fchdir exists
13898 set fchdir d_fchdir
13901 : see if fchmod exists
13902 set fchmod d_fchmod
13905 : see if fchown exists
13906 set fchown d_fchown
13909 : see if this is an fcntl system
13913 : See if fcntl-based locking works.
13916 #$i_stdlib I_STDLIB
13918 #include <stdlib.h>
13920 #include <unistd.h>
13922 #include <signal.h>
13923 $signal_t blech(int x) { exit(3); }
13925 #if defined(F_SETLK) && defined(F_SETLKW)
13926 struct flock flock;
13928 fd = open("try.c", O_RDONLY);
13929 flock.l_type = F_RDLCK;
13930 flock.l_whence = SEEK_SET;
13931 flock.l_start = flock.l_len = 0;
13932 signal(SIGALRM, blech);
13934 retval = fcntl(fd, F_SETLK, &flock);
13936 (retval < 0 ? exit(2) : exit(0));
13942 echo "Checking if fcntl-based file locking works... "
13946 if eval $compile_ok; then
13947 if $run ./try; then
13948 echo "Yes, it seems to work."
13951 echo "Nope, it didn't work."
13956 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13957 *** This is (almost) impossible.
13958 *** If your NFS lock daemons are not feeling well, something like
13959 *** this may happen, please investigate. Cannot continue, aborting.
13967 echo "I'm unable to compile the test program, so I'll assume not."
13972 echo "Nope, since you don't even have fcntl()."
13975 set d_fcntl_can_lock
13979 : check for fd_set items
13982 Checking to see how well your C compiler handles fd_set and friends ...
13985 #$i_stdlib I_STDLIB
13987 #include <stdlib.h>
13989 #$i_systime I_SYS_TIME
13990 #$i_sysselct I_SYS_SELECT
13991 #$d_socket HAS_SOCKET
13992 #include <sys/types.h>
13994 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13997 #include <sys/time.h>
13999 #ifdef I_SYS_SELECT
14000 #include <sys/select.h>
14009 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14017 if eval $compile; then
14018 d_fds_bits="$define"
14020 echo "Well, your system knows about the normal fd_set typedef..." >&4
14021 if $run ./try; then
14022 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14023 d_fd_macros="$define"
14026 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14028 d_fd_macros="$undef"
14032 Hmm, your compiler has some difficulty with fd_set. Checking further...
14035 if eval $compile; then
14036 d_fds_bits="$undef"
14038 echo "Well, your system has some sort of fd_set available..." >&4
14039 if $run ./try; then
14040 echo "and you have the normal fd_set macros." >&4
14041 d_fd_macros="$define"
14044 but not the normal fd_set macros! Gross! More work for me...
14046 d_fd_macros="$undef"
14049 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14051 d_fds_bits="$undef"
14052 d_fd_macros="$undef"
14057 : see if fdclose exists
14058 set fdclose d_fdclose
14061 : see if fdim exists
14065 : see if fegetround exists
14066 set fegetround d_fegetround
14069 : see if fgetpos exists
14070 set fgetpos d_fgetpos
14073 : see if finite exists
14074 set finite d_finite
14077 : see if finitel exists
14078 set finitel d_finitel
14081 : see if flock exists
14085 : see if prototype for flock is available
14087 set d_flockproto flock $i_sysfile sys/file.h
14090 : see if fma exists
14094 : see if fmax exists
14098 : see if fmin exists
14102 : see if fp_class exists
14103 set fp_class d_fp_class
14106 : see if this is a math.h system
14110 : check for fpclassify
14111 echo "Checking to see if you have fpclassify..." >&4
14117 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14120 if eval $compile; then
14122 echo "You have fpclassify."
14125 echo "You do not have fpclassify."
14131 : see if fp_classify exists
14132 set fp_classify d_fp_classify
14135 : see if fp_classl exists
14136 set fp_classl d_fp_classl
14139 : see if pathconf exists
14140 set pathconf d_pathconf
14143 : see if fpathconf exists
14144 set fpathconf d_fpathconf
14147 : see if fpclass exists
14148 set fpclass d_fpclass
14151 : see if fpclassl exists
14152 set fpclassl d_fpclassl
14155 : see if fpgetround exists
14156 set fpgetround d_fpgetround
14159 : check for fpos64_t
14161 echo "Checking to see if you have fpos64_t..." >&4
14164 int main() { fpos64_t x = 7; }
14167 if eval $compile; then
14169 echo "You have fpos64_t."
14172 echo "You do not have fpos64_t."
14173 case "$fpossize" in
14174 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14181 : see if this is an xlocale.h system
14182 set xlocale.h i_xlocale
14185 : see if newlocale exists
14186 set newlocale d_newlocale
14189 : see if freelocale exists
14190 set freelocale d_freelocale
14193 : see if uselocale exists
14194 set uselocale d_uselocale
14197 : see if duplocale exists
14198 set duplocale d_duplocale
14201 : see if querylocale exists
14202 set querylocale d_querylocale
14205 : see if frexpl exists
14206 set frexpl d_frexpl
14209 : see if this is a sys/param system
14210 set sys/param.h i_sysparam
14213 : see if this is a sys/mount.h system
14214 set sys/mount.h i_sysmount
14217 : Check for fs_data_s
14219 echo "Checking to see if your system supports struct fs_data..." >&4
14220 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14222 case "$d_fs_data_s" in
14223 "$define") echo "Yes, it does." ;;
14224 *) echo "No, it doesn't." ;;
14227 : see if fseeko exists
14228 set fseeko d_fseeko
14230 case "$longsize" in
14231 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14234 : see if fsetpos exists
14235 set fsetpos d_fsetpos
14238 : see if fstatfs exists
14239 set fstatfs d_fstatfs
14242 : see if statvfs exists
14243 set statvfs d_statvfs
14246 : see if fstatvfs exists
14247 set fstatvfs d_fstatvfs
14251 : see if fsync exists
14255 : see if ftello exists
14256 set ftello d_ftello
14258 case "$longsize" in
14259 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14262 : check for a working futimes
14265 echo "Checking if you have a working futimes()" >&4
14268 #include <sys/time.h>
14275 fd = open ("try.c", O_RDWR);
14276 if (-1 == fd) exit (1);
14277 rv = futimes (fd, NULL);
14278 exit (rv == -1 ? errno : 0);
14282 if eval $compile; then
14286 0) echo "Yes, you have" >&4
14287 d_futimes="$define"
14289 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14293 echo "No, it does not (probably harmless)" >&4
14297 : look for gai_strerror
14299 $cat >try.c <<'EOCP'
14300 #include <sys/types.h>
14301 #include <sys/socket.h>
14305 return (gai_strerror (0) ? 0 : 1);
14310 if eval $compile; then
14313 0) echo "A working gai_strerror() found." >&4
14315 *) echo "gai_strerror() found, but it doesn't work" >&4
14319 echo "gai_strerror() NOT found." >&4
14325 : see if ndbm.h is available
14328 : Compatibility location for RedHat 7.1
14329 set gdbm/ndbm.h i_gdbmndbm
14331 : Compatibility location for Debian 4.0
14332 set gdbm-ndbm.h i_gdbm_ndbm
14336 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14337 : see if dbm_open exists
14338 set dbm_open d_dbm_open
14340 case "$d_dbm_open" in
14343 i_gdbmndbm="$undef"
14344 i_gdbm_ndbm="$undef"
14345 echo "We won't be including <ndbm.h>"
14355 ndbm_hdr_protochk='name=$1; hdr=$2;
14356 eval "ihdr=\$""i_$name";
14358 if $test "$ihdr" = "$define"; then
14359 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14360 case "$d_cplusplus" in
14361 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14362 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14365 $define) $echo "Your <$hdr> seems to have prototypes";;
14366 *) $echo "Your <$hdr> does not seem to have prototypes";;
14369 set "d_${name}_h_uses_prototypes";
14373 eval $ndbm_hdr_protochk
14374 set gdbmndbm gdbm/ndbm.h
14375 eval $ndbm_hdr_protochk
14376 set gdbm_ndbm gdbm-ndbm.h
14377 eval $ndbm_hdr_protochk
14379 : see if getaddrinfo exists
14380 set getaddrinfo d_getaddrinfo
14383 : see if getcwd exists
14384 set getcwd d_getcwd
14387 : see if getespwnam exists
14388 set getespwnam d_getespwnam
14391 : see if getfsstat exists
14392 set getfsstat d_getfsstat
14395 : see if getgrent exists
14396 set getgrent d_getgrent
14399 : see if getgrent_r exists
14400 set getgrent_r d_getgrent_r
14402 case "$d_getgrent_r" in
14404 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14405 case "$d_getgrent_r_proto:$usethreads" in
14406 ":define") d_getgrent_r_proto=define
14407 set d_getgrent_r_proto getgrent_r $hdrs
14411 case "$d_getgrent_r_proto" in
14413 case "$getgrent_r_proto" in
14414 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14415 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14417 case "$getgrent_r_proto" in
14418 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14419 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14421 case "$getgrent_r_proto" in
14422 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14423 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14425 case "$getgrent_r_proto" in
14426 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14427 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14429 case "$getgrent_r_proto" in
14430 ''|0) try='int getgrent_r(struct group*, char*, int);'
14431 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14433 case "$getgrent_r_proto" in
14434 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14435 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14437 case "$getgrent_r_proto" in
14438 ''|0) d_getgrent_r=undef
14440 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14441 * ) case "$getgrent_r_proto" in
14442 REENTRANT_PROTO*) ;;
14443 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14445 echo "Prototype: $try" ;;
14448 *) case "$usethreads" in
14449 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14456 *) getgrent_r_proto=0
14460 : see if getgrgid_r exists
14461 set getgrgid_r d_getgrgid_r
14463 case "$d_getgrgid_r" in
14465 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14466 case "$d_getgrgid_r_proto:$usethreads" in
14467 ":define") d_getgrgid_r_proto=define
14468 set d_getgrgid_r_proto getgrgid_r $hdrs
14472 case "$d_getgrgid_r_proto" in
14474 case "$getgrgid_r_proto" in
14475 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14476 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14478 case "$getgrgid_r_proto" in
14479 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14480 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14482 case "$getgrgid_r_proto" in
14483 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14484 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14486 case "$getgrgid_r_proto" in
14487 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14488 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14490 case "$getgrgid_r_proto" in
14491 ''|0) d_getgrgid_r=undef
14493 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14494 * ) case "$getgrgid_r_proto" in
14495 REENTRANT_PROTO*) ;;
14496 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14498 echo "Prototype: $try" ;;
14501 *) case "$usethreads" in
14502 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14509 *) getgrgid_r_proto=0
14513 : see if getgrnam_r exists
14514 set getgrnam_r d_getgrnam_r
14516 case "$d_getgrnam_r" in
14518 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14519 case "$d_getgrnam_r_proto:$usethreads" in
14520 ":define") d_getgrnam_r_proto=define
14521 set d_getgrnam_r_proto getgrnam_r $hdrs
14525 case "$d_getgrnam_r_proto" in
14527 case "$getgrnam_r_proto" in
14528 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14529 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14531 case "$getgrnam_r_proto" in
14532 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14533 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14535 case "$getgrnam_r_proto" in
14536 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14537 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14539 case "$getgrnam_r_proto" in
14540 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14541 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14543 case "$getgrnam_r_proto" in
14544 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14545 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14547 case "$getgrnam_r_proto" in
14548 ''|0) d_getgrnam_r=undef
14550 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14551 * ) case "$getgrnam_r_proto" in
14552 REENTRANT_PROTO*) ;;
14553 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14555 echo "Prototype: $try" ;;
14558 *) case "$usethreads" in
14559 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14566 *) getgrnam_r_proto=0
14570 : see if gethostbyaddr exists
14571 set gethostbyaddr d_gethbyaddr
14574 : see if gethostbyname exists
14575 set gethostbyname d_gethbyname
14578 : see if gethostent exists
14579 set gethostent d_gethent
14582 : see how we will look up host name
14585 if set gethostname val -f d_gethname; eval $csym; $val; then
14586 echo 'gethostname() found.' >&4
14587 d_gethname="$define"
14590 if set uname val -f d_uname; eval $csym; $val; then
14593 uname() was found, but you're running xenix, and older versions of xenix
14594 have a broken uname(). If you don't really know whether your xenix is old
14595 enough to have a broken system call, use the default answer.
14600 "$define") dflt=n;;
14602 rp='Is your uname() broken?'
14605 n*) d_uname="$define"; call=uname;;
14608 echo 'uname() found.' >&4
14615 case "$d_gethname" in
14616 '') d_gethname="$undef";;
14619 '') d_uname="$undef";;
14621 case "$d_uname$d_gethname" in
14626 Every now and then someone has a $call() that lies about the hostname
14627 but can't be fixed for political or economic reasons. If you wish, I can
14628 pretend $call() isn't there and maybe compute hostname at run-time
14629 thanks to the '$phostname' command.
14632 rp="Shall I ignore $call() from now on?"
14635 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14638 case "$phostname" in
14639 '') aphostname='';;
14640 *) case "$aphostname" in
14642 *) set X $phostname
14646 file=`./loc $file $file $pth`
14647 aphostname=`echo $file $*`
14652 case "$d_uname$d_gethname" in
14655 case "$phostname" in
14657 echo "There will be no way for $package to get your hostname." >&4;;
14659 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14663 case "$d_phostname" in
14664 '') d_phostname="$undef";;
14667 : see if gethostbyaddr_r exists
14668 set gethostbyaddr_r d_gethostbyaddr_r
14670 case "$d_gethostbyaddr_r" in
14672 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14673 case "$d_gethostbyaddr_r_proto:$usethreads" in
14674 ":define") d_gethostbyaddr_r_proto=define
14675 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14679 case "$d_gethostbyaddr_r_proto" in
14681 case "$gethostbyaddr_r_proto" in
14682 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14683 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14685 case "$gethostbyaddr_r_proto" in
14686 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14687 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14689 case "$gethostbyaddr_r_proto" in
14690 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14691 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14693 case "$gethostbyaddr_r_proto" in
14694 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14695 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14697 case "$gethostbyaddr_r_proto" in
14698 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14699 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14701 case "$gethostbyaddr_r_proto" in
14702 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14703 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14705 case "$gethostbyaddr_r_proto" in
14706 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14707 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14709 case "$gethostbyaddr_r_proto" in
14710 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14711 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14713 case "$gethostbyaddr_r_proto" in
14714 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14715 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14717 case "$gethostbyaddr_r_proto" in
14718 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14719 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14721 case "$gethostbyaddr_r_proto" in
14722 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14723 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14725 case "$gethostbyaddr_r_proto" in
14726 ''|0) d_gethostbyaddr_r=undef
14727 gethostbyaddr_r_proto=0
14728 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14729 * ) case "$gethostbyaddr_r_proto" in
14730 REENTRANT_PROTO*) ;;
14731 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14733 echo "Prototype: $try" ;;
14736 *) case "$usethreads" in
14737 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14739 d_gethostbyaddr_r=undef
14740 gethostbyaddr_r_proto=0
14744 *) gethostbyaddr_r_proto=0
14748 : see if gethostbyname_r exists
14749 set gethostbyname_r d_gethostbyname_r
14751 case "$d_gethostbyname_r" in
14753 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14754 case "$d_gethostbyname_r_proto:$usethreads" in
14755 ":define") d_gethostbyname_r_proto=define
14756 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14760 case "$d_gethostbyname_r_proto" in
14762 case "$gethostbyname_r_proto" in
14763 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14764 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14766 case "$gethostbyname_r_proto" in
14767 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14768 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14770 case "$gethostbyname_r_proto" in
14771 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14772 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14774 case "$gethostbyname_r_proto" in
14775 ''|0) d_gethostbyname_r=undef
14776 gethostbyname_r_proto=0
14777 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14778 * ) case "$gethostbyname_r_proto" in
14779 REENTRANT_PROTO*) ;;
14780 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14782 echo "Prototype: $try" ;;
14785 *) case "$usethreads" in
14786 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14788 d_gethostbyname_r=undef
14789 gethostbyname_r_proto=0
14793 *) gethostbyname_r_proto=0
14797 : see if gethostent_r exists
14798 set gethostent_r d_gethostent_r
14800 case "$d_gethostent_r" in
14802 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14803 case "$d_gethostent_r_proto:$usethreads" in
14804 ":define") d_gethostent_r_proto=define
14805 set d_gethostent_r_proto gethostent_r $hdrs
14809 case "$d_gethostent_r_proto" in
14811 case "$gethostent_r_proto" in
14812 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14813 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14815 case "$gethostent_r_proto" in
14816 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14817 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14819 case "$gethostent_r_proto" in
14820 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14821 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14823 case "$gethostent_r_proto" in
14824 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14825 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14827 case "$gethostent_r_proto" in
14828 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14829 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14831 case "$gethostent_r_proto" in
14832 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14833 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14835 case "$gethostent_r_proto" in
14836 ''|0) d_gethostent_r=undef
14837 gethostent_r_proto=0
14838 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14839 * ) case "$gethostent_r_proto" in
14840 REENTRANT_PROTO*) ;;
14841 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14843 echo "Prototype: $try" ;;
14846 *) case "$usethreads" in
14847 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14849 d_gethostent_r=undef
14850 gethostent_r_proto=0
14854 *) gethostent_r_proto=0
14858 : see if prototypes for various gethostxxx netdb.h functions are available
14860 set d_gethostprotos gethostent $i_netdb netdb.h
14863 : see if getitimer exists
14864 set getitimer d_getitimer
14867 : see if getlogin exists
14868 set getlogin d_getlogin
14871 : see if getlogin_r exists
14872 set getlogin_r d_getlogin_r
14874 case "$d_getlogin_r" in
14876 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14877 case "$d_getlogin_r_proto:$usethreads" in
14878 ":define") d_getlogin_r_proto=define
14879 set d_getlogin_r_proto getlogin_r $hdrs
14883 case "$d_getlogin_r_proto" in
14885 case "$getlogin_r_proto" in
14886 ''|0) try='int getlogin_r(char*, size_t);'
14887 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14889 case "$getlogin_r_proto" in
14890 ''|0) try='int getlogin_r(char*, int);'
14891 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14893 case "$getlogin_r_proto" in
14894 ''|0) try='char* getlogin_r(char*, size_t);'
14895 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14897 case "$getlogin_r_proto" in
14898 ''|0) try='char* getlogin_r(char*, int);'
14899 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14901 case "$getlogin_r_proto" in
14902 ''|0) d_getlogin_r=undef
14904 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14905 * ) case "$getlogin_r_proto" in
14906 REENTRANT_PROTO*) ;;
14907 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14909 echo "Prototype: $try" ;;
14912 *) case "$usethreads" in
14913 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14920 *) getlogin_r_proto=0
14924 : see if getmnt exists
14925 set getmnt d_getmnt
14928 : see if getmntent exists
14929 set getmntent d_getmntent
14932 : see if getnameinfo exists
14933 set getnameinfo d_getnameinfo
14936 : see if getnetbyaddr exists
14937 set getnetbyaddr d_getnbyaddr
14940 : see if getnetbyname exists
14941 set getnetbyname d_getnbyname
14944 : see if getnetent exists
14945 set getnetent d_getnent
14948 : see if getnetbyaddr_r exists
14949 set getnetbyaddr_r d_getnetbyaddr_r
14951 case "$d_getnetbyaddr_r" in
14953 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14954 case "$d_getnetbyaddr_r_proto:$usethreads" in
14955 ":define") d_getnetbyaddr_r_proto=define
14956 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14960 case "$d_getnetbyaddr_r_proto" in
14962 case "$getnetbyaddr_r_proto" in
14963 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14964 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14966 case "$getnetbyaddr_r_proto" in
14967 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14968 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14970 case "$getnetbyaddr_r_proto" in
14971 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14972 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14974 case "$getnetbyaddr_r_proto" in
14975 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14976 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14978 case "$getnetbyaddr_r_proto" in
14979 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14980 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14982 case "$getnetbyaddr_r_proto" in
14983 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14984 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14986 case "$getnetbyaddr_r_proto" in
14987 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14988 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14990 case "$getnetbyaddr_r_proto" in
14991 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14992 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14994 case "$getnetbyaddr_r_proto" in
14995 ''|0) d_getnetbyaddr_r=undef
14996 getnetbyaddr_r_proto=0
14997 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14998 * ) case "$getnetbyaddr_r_proto" in
14999 REENTRANT_PROTO*) ;;
15000 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15002 echo "Prototype: $try" ;;
15005 *) case "$usethreads" in
15006 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15008 d_getnetbyaddr_r=undef
15009 getnetbyaddr_r_proto=0
15013 *) getnetbyaddr_r_proto=0
15017 : see if getnetbyname_r exists
15018 set getnetbyname_r d_getnetbyname_r
15020 case "$d_getnetbyname_r" in
15022 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15023 case "$d_getnetbyname_r_proto:$usethreads" in
15024 ":define") d_getnetbyname_r_proto=define
15025 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15029 case "$d_getnetbyname_r_proto" in
15031 case "$getnetbyname_r_proto" in
15032 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15033 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15035 case "$getnetbyname_r_proto" in
15036 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15037 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15039 case "$getnetbyname_r_proto" in
15040 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15041 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15043 case "$getnetbyname_r_proto" in
15044 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15045 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15047 case "$getnetbyname_r_proto" in
15048 ''|0) d_getnetbyname_r=undef
15049 getnetbyname_r_proto=0
15050 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15051 * ) case "$getnetbyname_r_proto" in
15052 REENTRANT_PROTO*) ;;
15053 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15055 echo "Prototype: $try" ;;
15058 *) case "$usethreads" in
15059 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15061 d_getnetbyname_r=undef
15062 getnetbyname_r_proto=0
15066 *) getnetbyname_r_proto=0
15070 : see if getnetent_r exists
15071 set getnetent_r d_getnetent_r
15073 case "$d_getnetent_r" in
15075 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15076 case "$d_getnetent_r_proto:$usethreads" in
15077 ":define") d_getnetent_r_proto=define
15078 set d_getnetent_r_proto getnetent_r $hdrs
15082 case "$d_getnetent_r_proto" in
15084 case "$getnetent_r_proto" in
15085 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15086 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15088 case "$getnetent_r_proto" in
15089 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15090 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15092 case "$getnetent_r_proto" in
15093 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15094 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15096 case "$getnetent_r_proto" in
15097 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15098 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15100 case "$getnetent_r_proto" in
15101 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15102 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15104 case "$getnetent_r_proto" in
15105 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15106 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15108 case "$getnetent_r_proto" in
15109 ''|0) d_getnetent_r=undef
15110 getnetent_r_proto=0
15111 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15112 * ) case "$getnetent_r_proto" in
15113 REENTRANT_PROTO*) ;;
15114 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15116 echo "Prototype: $try" ;;
15119 *) case "$usethreads" in
15120 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15122 d_getnetent_r=undef
15123 getnetent_r_proto=0
15127 *) getnetent_r_proto=0
15131 : see if prototypes for various getnetxxx netdb.h functions are available
15133 set d_getnetprotos getnetent $i_netdb netdb.h
15136 : see if getpagesize exists
15137 set getpagesize d_getpagsz
15140 : Optional checks for getprotobyname and getprotobynumber
15142 : see if getprotobyname exists
15143 set getprotobyname d_getpbyname
15146 : see if getprotobynumber exists
15147 set getprotobynumber d_getpbynumber
15150 : see if getprotoent exists
15151 set getprotoent d_getpent
15154 : see if getpgid exists
15155 set getpgid d_getpgid
15158 : see if getpgrp2 exists
15159 set getpgrp2 d_getpgrp2
15162 : see if getppid exists
15163 set getppid d_getppid
15166 : see if getpriority exists
15167 set getpriority d_getprior
15170 : see if getprotobyname_r exists
15171 set getprotobyname_r d_getprotobyname_r
15173 case "$d_getprotobyname_r" in
15175 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15176 case "$d_getprotobyname_r_proto:$usethreads" in
15177 ":define") d_getprotobyname_r_proto=define
15178 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15182 case "$d_getprotobyname_r_proto" in
15184 case "$getprotobyname_r_proto" in
15185 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15186 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15188 case "$getprotobyname_r_proto" in
15189 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15190 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15192 case "$getprotobyname_r_proto" in
15193 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15194 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15196 case "$getprotobyname_r_proto" in
15197 ''|0) d_getprotobyname_r=undef
15198 getprotobyname_r_proto=0
15199 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15200 * ) case "$getprotobyname_r_proto" in
15201 REENTRANT_PROTO*) ;;
15202 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15204 echo "Prototype: $try" ;;
15207 *) case "$usethreads" in
15208 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15210 d_getprotobyname_r=undef
15211 getprotobyname_r_proto=0
15215 *) getprotobyname_r_proto=0
15219 : see if getprotobynumber_r exists
15220 set getprotobynumber_r d_getprotobynumber_r
15222 case "$d_getprotobynumber_r" in
15224 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15225 case "$d_getprotobynumber_r_proto:$usethreads" in
15226 ":define") d_getprotobynumber_r_proto=define
15227 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15231 case "$d_getprotobynumber_r_proto" in
15233 case "$getprotobynumber_r_proto" in
15234 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15235 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15237 case "$getprotobynumber_r_proto" in
15238 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15239 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15241 case "$getprotobynumber_r_proto" in
15242 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15243 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15245 case "$getprotobynumber_r_proto" in
15246 ''|0) d_getprotobynumber_r=undef
15247 getprotobynumber_r_proto=0
15248 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15249 * ) case "$getprotobynumber_r_proto" in
15250 REENTRANT_PROTO*) ;;
15251 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15253 echo "Prototype: $try" ;;
15256 *) case "$usethreads" in
15257 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15259 d_getprotobynumber_r=undef
15260 getprotobynumber_r_proto=0
15264 *) getprotobynumber_r_proto=0
15268 : see if getprotoent_r exists
15269 set getprotoent_r d_getprotoent_r
15271 case "$d_getprotoent_r" in
15273 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15274 case "$d_getprotoent_r_proto:$usethreads" in
15275 ":define") d_getprotoent_r_proto=define
15276 set d_getprotoent_r_proto getprotoent_r $hdrs
15280 case "$d_getprotoent_r_proto" in
15282 case "$getprotoent_r_proto" in
15283 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15284 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15286 case "$getprotoent_r_proto" in
15287 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15288 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15290 case "$getprotoent_r_proto" in
15291 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15292 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15294 case "$getprotoent_r_proto" in
15295 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15296 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15298 case "$getprotoent_r_proto" in
15299 ''|0) d_getprotoent_r=undef
15300 getprotoent_r_proto=0
15301 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15302 * ) case "$getprotoent_r_proto" in
15303 REENTRANT_PROTO*) ;;
15304 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15306 echo "Prototype: $try" ;;
15309 *) case "$usethreads" in
15310 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15312 d_getprotoent_r=undef
15313 getprotoent_r_proto=0
15317 *) getprotoent_r_proto=0
15321 : see if prototypes for various getprotoxxx netdb.h functions are available
15323 set d_getprotoprotos getprotoent $i_netdb netdb.h
15326 : see if getprpwnam exists
15327 set getprpwnam d_getprpwnam
15330 : see if getpwent exists
15331 set getpwent d_getpwent
15334 : see if getpwent_r exists
15335 set getpwent_r d_getpwent_r
15337 case "$d_getpwent_r" in
15339 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15340 case "$d_getpwent_r_proto:$usethreads" in
15341 ":define") d_getpwent_r_proto=define
15342 set d_getpwent_r_proto getpwent_r $hdrs
15346 case "$d_getpwent_r_proto" in
15348 case "$getpwent_r_proto" in
15349 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15350 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15352 case "$getpwent_r_proto" in
15353 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15354 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15356 case "$getpwent_r_proto" in
15357 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15358 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15360 case "$getpwent_r_proto" in
15361 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15362 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15364 case "$getpwent_r_proto" in
15365 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15366 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15368 case "$getpwent_r_proto" in
15369 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15370 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15372 case "$getpwent_r_proto" in
15373 ''|0) d_getpwent_r=undef
15375 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15376 * ) case "$getpwent_r_proto" in
15377 REENTRANT_PROTO*) ;;
15378 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15380 echo "Prototype: $try" ;;
15383 *) case "$usethreads" in
15384 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15391 *) getpwent_r_proto=0
15395 : see if getpwnam_r exists
15396 set getpwnam_r d_getpwnam_r
15398 case "$d_getpwnam_r" in
15400 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15401 case "$d_getpwnam_r_proto:$usethreads" in
15402 ":define") d_getpwnam_r_proto=define
15403 set d_getpwnam_r_proto getpwnam_r $hdrs
15407 case "$d_getpwnam_r_proto" in
15409 case "$getpwnam_r_proto" in
15410 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15411 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15413 case "$getpwnam_r_proto" in
15414 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15415 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15417 case "$getpwnam_r_proto" in
15418 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15419 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15421 case "$getpwnam_r_proto" in
15422 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15423 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15425 case "$getpwnam_r_proto" in
15426 ''|0) d_getpwnam_r=undef
15428 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15429 * ) case "$getpwnam_r_proto" in
15430 REENTRANT_PROTO*) ;;
15431 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15433 echo "Prototype: $try" ;;
15436 *) case "$usethreads" in
15437 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15444 *) getpwnam_r_proto=0
15448 : see if getpwuid_r exists
15449 set getpwuid_r d_getpwuid_r
15451 case "$d_getpwuid_r" in
15453 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15454 case "$d_getpwuid_r_proto:$usethreads" in
15455 ":define") d_getpwuid_r_proto=define
15456 set d_getpwuid_r_proto getpwuid_r $hdrs
15460 case "$d_getpwuid_r_proto" in
15462 case "$getpwuid_r_proto" in
15463 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15464 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15466 case "$getpwuid_r_proto" in
15467 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15468 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15470 case "$getpwuid_r_proto" in
15471 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15472 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15474 case "$getpwuid_r_proto" in
15475 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15476 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15478 case "$getpwuid_r_proto" in
15479 ''|0) d_getpwuid_r=undef
15481 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15482 * ) case "$getpwuid_r_proto" in
15483 REENTRANT_PROTO*) ;;
15484 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15486 echo "Prototype: $try" ;;
15489 *) case "$usethreads" in
15490 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15497 *) getpwuid_r_proto=0
15501 : Optional checks for getsbyname and getsbyport
15503 : see if getservbyname exists
15504 set getservbyname d_getsbyname
15507 : see if getservbyport exists
15508 set getservbyport d_getsbyport
15511 : see if getservent exists
15512 set getservent d_getsent
15515 : see if getservbyname_r exists
15516 set getservbyname_r d_getservbyname_r
15518 case "$d_getservbyname_r" in
15520 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15521 case "$d_getservbyname_r_proto:$usethreads" in
15522 ":define") d_getservbyname_r_proto=define
15523 set d_getservbyname_r_proto getservbyname_r $hdrs
15527 case "$d_getservbyname_r_proto" in
15529 case "$getservbyname_r_proto" in
15530 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15531 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15533 case "$getservbyname_r_proto" in
15534 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15535 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15537 case "$getservbyname_r_proto" in
15538 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15539 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15541 case "$getservbyname_r_proto" in
15542 ''|0) d_getservbyname_r=undef
15543 getservbyname_r_proto=0
15544 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15545 * ) case "$getservbyname_r_proto" in
15546 REENTRANT_PROTO*) ;;
15547 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15549 echo "Prototype: $try" ;;
15552 *) case "$usethreads" in
15553 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15555 d_getservbyname_r=undef
15556 getservbyname_r_proto=0
15560 *) getservbyname_r_proto=0
15564 : see if getservbyport_r exists
15565 set getservbyport_r d_getservbyport_r
15567 case "$d_getservbyport_r" in
15569 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15570 case "$d_getservbyport_r_proto:$usethreads" in
15571 ":define") d_getservbyport_r_proto=define
15572 set d_getservbyport_r_proto getservbyport_r $hdrs
15576 case "$d_getservbyport_r_proto" in
15578 case "$getservbyport_r_proto" in
15579 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15580 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15582 case "$getservbyport_r_proto" in
15583 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15584 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15586 case "$getservbyport_r_proto" in
15587 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15588 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15590 case "$getservbyport_r_proto" in
15591 ''|0) d_getservbyport_r=undef
15592 getservbyport_r_proto=0
15593 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15594 * ) case "$getservbyport_r_proto" in
15595 REENTRANT_PROTO*) ;;
15596 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15598 echo "Prototype: $try" ;;
15601 *) case "$usethreads" in
15602 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15604 d_getservbyport_r=undef
15605 getservbyport_r_proto=0
15609 *) getservbyport_r_proto=0
15613 : see if getservent_r exists
15614 set getservent_r d_getservent_r
15616 case "$d_getservent_r" in
15618 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15619 case "$d_getservent_r_proto:$usethreads" in
15620 ":define") d_getservent_r_proto=define
15621 set d_getservent_r_proto getservent_r $hdrs
15625 case "$d_getservent_r_proto" in
15627 case "$getservent_r_proto" in
15628 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15629 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15631 case "$getservent_r_proto" in
15632 ''|0) try='int getservent_r(struct servent*, char*, int);'
15633 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15635 case "$getservent_r_proto" in
15636 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15637 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15639 case "$getservent_r_proto" in
15640 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15641 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15643 case "$getservent_r_proto" in
15644 ''|0) d_getservent_r=undef
15645 getservent_r_proto=0
15646 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15647 * ) case "$getservent_r_proto" in
15648 REENTRANT_PROTO*) ;;
15649 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15651 echo "Prototype: $try" ;;
15654 *) case "$usethreads" in
15655 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15657 d_getservent_r=undef
15658 getservent_r_proto=0
15662 *) getservent_r_proto=0
15666 : see if prototypes for various getservxxx netdb.h functions are available
15668 set d_getservprotos getservent $i_netdb netdb.h
15671 : see if getspnam exists
15672 set getspnam d_getspnam
15675 : see if this is a shadow.h system
15676 set shadow.h i_shadow
15679 : see if getspnam_r exists
15680 set getspnam_r d_getspnam_r
15682 case "$d_getspnam_r" in
15684 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15685 case "$d_getspnam_r_proto:$usethreads" in
15686 ":define") d_getspnam_r_proto=define
15687 set d_getspnam_r_proto getspnam_r $hdrs
15691 case "$d_getspnam_r_proto" in
15693 case "$getspnam_r_proto" in
15694 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15695 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15697 case "$getspnam_r_proto" in
15698 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15699 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15701 case "$getspnam_r_proto" in
15702 ''|0) d_getspnam_r=undef
15704 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15705 * ) case "$getspnam_r_proto" in
15706 REENTRANT_PROTO*) ;;
15707 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15709 echo "Prototype: $try" ;;
15712 *) case "$usethreads" in
15713 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15720 *) getspnam_r_proto=0
15724 : see if gettimeofday or ftime exists
15725 set gettimeofday d_gettimeod
15727 case "$d_gettimeod" in
15733 val="$undef"; set d_ftime; eval $setvar
15736 case "$d_gettimeod$d_ftime" in
15739 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15743 : see if gmtime_r exists
15744 set gmtime_r d_gmtime_r
15746 case "$d_gmtime_r" in
15748 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15749 case "$d_gmtime_r_proto:$usethreads" in
15750 ":define") d_gmtime_r_proto=define
15751 set d_gmtime_r_proto gmtime_r $hdrs
15755 case "$d_gmtime_r_proto" in
15757 case "$gmtime_r_proto" in
15758 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15759 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15761 case "$gmtime_r_proto" in
15762 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15763 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15765 case "$gmtime_r_proto" in
15766 ''|0) d_gmtime_r=undef
15768 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15769 * ) case "$gmtime_r_proto" in
15770 REENTRANT_PROTO*) ;;
15771 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15773 echo "Prototype: $try" ;;
15776 *) case "$usethreads" in
15777 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15784 *) gmtime_r_proto=0
15788 : see if hasmntopt exists
15789 set hasmntopt d_hasmntopt
15792 : see if this is a netinet/in.h or sys/in.h system
15793 set netinet/in.h i_niin sys/in.h i_sysin
15796 : see if arpa/inet.h has to be included
15797 set arpa/inet.h i_arpainet
15800 : see if htonl --and friends-- exists
15805 : Maybe they are macros.
15808 $cat >htonl.c <<EOM
15810 #include <sys/types.h>
15811 #$i_niin I_NETINET_IN
15813 #$i_arpainet I_ARPA_INET
15814 #ifdef I_NETINET_IN
15815 #include <netinet/in.h>
15818 #include <sys/in.h>
15821 #include <arpa/inet.h>
15824 printf("Defined as a macro.");
15827 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15828 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15830 echo "But it seems to be defined as a macro." >&4
15838 : see if hypot exists
15842 : see if ilogb exists
15846 : see if ilogbl exists
15847 set ilogbl d_ilogbl
15852 if set index val -f; eval $csym; $val; then
15853 if set strchr val -f d_strchr; eval $csym; $val; then
15854 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15857 echo "strchr() found." >&4
15861 echo "index() found." >&4
15866 echo "index() found." >&4
15869 if set strchr val -f d_strchr; eval $csym; $val; then
15872 echo "strchr() found." >&4
15874 echo "No index() or strchr() found!" >&4
15879 set d_strchr; eval $setvar
15881 set d_index; eval $setvar
15883 : check whether inet_aton exists
15884 set inet_aton d_inetaton
15887 : see if inet_ntop exists
15888 set inet_ntop d_inetntop
15891 : see if inet_pton exists
15892 set inet_pton d_inetpton
15897 $cat >isascii.c <<EOCP
15900 #$i_stdlib I_STDLIB
15902 #include <stdlib.h>
15913 if eval $compile; then
15914 echo "isascii() found." >&4
15917 echo "isascii() NOT found." >&4
15926 $cat >isblank.c <<'EOCP'
15937 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15938 echo "isblank() found." >&4
15941 echo "isblank() NOT found." >&4
15948 : check for isfinite
15949 echo "Checking to see if you have isfinite..." >&4
15955 int main() { return isfinite(0.0); }
15958 if eval $compile; then
15960 echo "You have isfinite."
15963 echo "You do not have isfinite."
15969 : see if isfinitel exists
15970 set isfinitel d_isfinitel
15974 echo "Checking to see if you have isinf..." >&4
15980 int main() { return isinf(0.0); }
15983 if eval $compile; then
15985 echo "You have isinf."
15988 echo "You do not have isinf."
15994 : see if isinfl exists
15995 set isinfl d_isinfl
15999 echo "Checking to see if you have isless..." >&4
16005 int main() { return isless(0.0); }
16008 if eval $compile; then
16010 echo "You have isless."
16013 echo "You do not have isless."
16020 echo "Checking to see if you have isnan..." >&4
16026 int main() { return isnan(0.0); }
16029 if eval $compile; then
16031 echo "You have isnan."
16034 echo "You do not have isnan."
16040 : see if isnanl exists
16041 set isnanl d_isnanl
16044 : check for isnormal
16045 echo "Checking to see if you have isnormal..." >&4
16051 int main() { return isnormal(0.0); }
16054 if eval $compile; then
16056 echo "You have isnormal."
16059 echo "You do not have isnormal."
16069 : see if j0l exists
16073 : see if killpg exists
16074 set killpg d_killpg
16077 : see if localeconv exists
16078 set localeconv d_locconv
16081 : see if libc has the POSIX.1-2008 currency locale rules
16082 case "$d_locconv:$d_lc_monetary_2008" in
16085 #include <locale.h>
16087 struct lconv *lc = localeconv();
16088 char int_p_cs_precedes = lc->int_p_cs_precedes;
16093 if eval $compile; then
16094 d_lc_monetary_2008="$define"
16096 d_lc_monetary_2008="$undef"
16102 : see if lchown exists
16104 $cat > try.c <<'EOCP'
16105 /* System header to define __stub macros and hopefully few prototypes,
16106 which can conflict with char lchown(); below. */
16107 #include <assert.h>
16108 /* Override any gcc2 internal prototype to avoid an error. */
16109 /* We use char because int might match the return type of a gcc2
16110 builtin and then its argument prototype would still apply. */
16113 /* The GNU C library defines this for functions which it implements
16114 to always fail with ENOSYS. Some functions are actually named
16115 something starting with __ and the normal name is an alias. */
16116 #if defined (__stub_lchown) || defined (__stub___lchown)
16124 if eval $compile; then
16125 $echo "lchown() found." >&4
16128 $echo "lchown() NOT found." >&4
16134 : See if number of significant digits in a double precision number is known
16136 $cat >ldbl_dig.c <<EOM
16137 #$i_limits I_LIMITS
16140 #include <limits.h>
16146 printf("Contains LDBL_DIG");
16149 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16150 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16151 echo "LDBL_DIG found." >&4
16154 echo "LDBL_DIG NOT found." >&4
16161 : see if lgamma exists
16162 set lgamma d_lgamma
16165 : see if lgamma_r exists
16166 set lgamma_r d_lgamma_r
16169 : check to see if math.h defines _LIB_VERSION
16170 d_libm_lib_version="$undef"
16174 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16176 #include <unistd.h>
16178 int main (int argc, char *argv[])
16180 printf ("%d\n", _LIB_VERSION);
16185 if eval $compile; then
16187 echo "Yes, it does ($foo)" >&4
16188 d_libm_lib_version="$define"
16190 echo "No, it does not (probably harmless)" >&4
16197 : see if link exists
16201 : see if llrint exists
16202 set llrint d_llrint
16205 : see if llrintl exists
16206 set llrintl d_llrintl
16209 : see if llround exists
16210 set llround d_llround
16213 : see if llroundl exists
16214 set llroundl d_llroundl
16217 : see if localtime_r exists
16218 set localtime_r d_localtime_r
16220 case "$d_localtime_r" in
16222 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16223 case "$d_localtime_r_proto:$usethreads" in
16224 ":define") d_localtime_r_proto=define
16225 set d_localtime_r_proto localtime_r $hdrs
16229 case "$d_localtime_r_proto" in
16231 case "$localtime_r_proto" in
16232 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16233 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16235 case "$localtime_r_proto" in
16236 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16237 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16239 case "$localtime_r_proto" in
16240 ''|0) d_localtime_r=undef
16241 localtime_r_proto=0
16242 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16243 * ) case "$localtime_r_proto" in
16244 REENTRANT_PROTO*) ;;
16245 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16247 echo "Prototype: $try" ;;
16250 *) case "$usethreads" in
16251 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16253 d_localtime_r=undef
16254 localtime_r_proto=0
16258 *) localtime_r_proto=0
16262 : see if localtime_r calls tzset
16263 case "$localtime_r_proto" in
16266 /* Does our libc's localtime_r call tzset ?
16267 * return 0 if so, 1 otherwise.
16269 #$i_systypes I_SYS_TYPES
16270 #$i_unistd I_UNISTD
16272 #$i_stdlib I_STDLIB
16273 #$i_string I_STRING
16274 #$i_malloc I_MALLOC
16276 # include <sys/types.h>
16279 # include <unistd.h>
16285 #include <stdlib.h>
16288 # include <string.h>
16290 # include <strings.h>
16293 # include <malloc.h>
16297 time_t t = time(0L);
16298 char w_tz[]="TZ" "=GMT+5",
16299 e_tz[]="TZ" "=GMT-5",
16300 *tz_e = (char*)malloc(16),
16301 *tz_w = (char*)malloc(16);
16302 struct tm tm_e, tm_w;
16303 memset(&tm_e,'\0',sizeof(struct tm));
16304 memset(&tm_w,'\0',sizeof(struct tm));
16309 localtime_r(&t, &tm_e);
16312 localtime_r(&t, &tm_w);
16314 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16320 if eval $compile; then
16321 if $run ./try; then
16322 d_localtime_r_needs_tzset=undef;
16324 d_localtime_r_needs_tzset=define;
16327 d_localtime_r_needs_tzset=undef;
16331 d_localtime_r_needs_tzset=undef;
16336 : see if lockf exists
16340 : see if log1p exists
16344 : see if log2 exists
16348 : see if logb exists
16352 : see if lrint exists
16356 : see if lrintl exists
16357 set lrintl d_lrintl
16360 : see if lround exists
16361 set lround d_lround
16364 : see if lroundl exists
16365 set lroundl d_lroundl
16368 : see if prototype for lseek is available
16370 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16373 : see if lstat exists
16377 : see if madvise exists
16378 set madvise d_madvise
16381 : see if malloc_size exists
16382 set malloc_size d_malloc_size
16385 : see if malloc_size_good exists
16386 set malloc_good_size d_malloc_good_size
16389 : see if mblen exists
16393 : see if mbstowcs exists
16394 set mbstowcs d_mbstowcs
16397 : see if mbtowc exists
16398 set mbtowc d_mbtowc
16401 : see if memchr exists
16402 set memchr d_memchr
16405 : see if memcmp exists
16406 set memcmp d_memcmp
16409 : see if memcpy exists
16410 set memcpy d_memcpy
16413 : see if memmem exists
16414 set memmem d_memmem
16417 : see if memmove exists
16418 set memmove d_memmove
16421 : see if memset exists
16422 set memset d_memset
16425 : see if mkdir exists
16429 : see if mkdtemp exists
16430 set mkdtemp d_mkdtemp
16433 : see if mkfifo exists
16434 set mkfifo d_mkfifo
16437 : see if mkstemp exists
16438 set mkstemp d_mkstemp
16441 : see if mkstemps exists
16442 set mkstemps d_mkstemps
16445 : see if mktime exists
16446 set mktime d_mktime
16449 : see if this is a sys/mman.h system
16450 set sys/mman.h i_sysmman
16453 : see if mmap exists
16456 : see what shmat returns
16457 : default to something harmless
16459 case "$i_sysmman$d_mmap" in
16461 $cat >mmap.c <<'END'
16462 #include <sys/mman.h>
16465 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16470 echo "and it returns ($mmaptype)." >&4
16476 : see if sqrtl exists
16480 : see if scalbnl exists
16481 set scalbnl d_scalbnl
16484 : see if truncl exists
16485 set truncl d_truncl
16488 : see if modfl exists
16492 : see if prototype for modfl is available
16494 set d_modflproto modfl $i_math math.h
16497 if $test "$uselongdouble" = "$define"; then
16499 if $test "$d_sqrtl" != "$define"; then
16500 message="$message sqrtl"
16502 if $test "$d_modfl" != "$define"; then
16503 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16504 echo "You have both truncl and copysignl, so I can emulate modfl."
16506 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16507 echo "You have both aintl and copysignl, so I can emulate modfl."
16509 message="$message modfl"
16513 if $test "$d_frexpl" != "$define"; then
16514 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16515 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16517 message="$message frexpl"
16520 if $test "$d_ldexpl" != "$define"; then
16521 message="$message ldexpl"
16524 if $test "$message" != ""; then
16527 *** You requested the use of long doubles but you do not seem to have
16528 *** the following mathematical functions needed for long double support:
16530 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16531 *** Cannot continue, aborting.
16539 : see if mprotect exists
16540 set mprotect d_mprotect
16543 : see if msgctl exists
16544 set msgctl d_msgctl
16547 : see if msgget exists
16548 set msgget d_msgget
16551 : see if msgsnd exists
16552 set msgsnd d_msgsnd
16555 : see if msgrcv exists
16556 set msgrcv d_msgrcv
16559 : see how much of the 'msg*(2)' library is present.
16562 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16563 *"$undef"*) h_msg=false;;
16567 case "`ipcs 2>&1`" in
16568 "SVID messages"*"not configured"*)
16569 echo "Your $osname does not have the msg*(2) configured." >&4
16572 set msgctl d_msgctl
16574 set msgget d_msgget
16576 set msgsnd d_msgsnd
16578 set msgrcv d_msgrcv
16584 : we could also check for sys/ipc.h ...
16585 if $h_msg && $test `./findhdr sys/msg.h`; then
16586 echo "You have the full msg*(2) library." >&4
16589 echo "You don't have the full msg*(2) library." >&4
16595 : Check for msghdr_s
16597 echo "Checking to see if your system supports struct msghdr..." >&4
16598 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16600 case "$d_msghdr_s" in
16601 "$define") echo "Yes, it does." ;;
16602 *) echo "No, it doesn't." ;;
16606 : see if msync exists
16610 : see if munmap exists
16611 set munmap d_munmap
16614 : see if nan exists
16618 : see if nearbyint exists
16619 set nearbyint d_nearbyint
16622 : see if nextafter exists
16623 set nextafter d_nextafter
16626 : see if nexttoward exists
16627 set nexttoward d_nexttoward
16630 : see if nice exists
16634 : see if this is a langinfo.h system
16635 set langinfo.h i_langinfo
16638 : see if nl_langinfo exists
16639 set nl_langinfo d_nl_langinfo
16642 : see if this is a quadmath.h system
16643 set quadmath.h i_quadmath
16646 : check for volatile keyword
16648 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16649 $cat >try.c <<'EOCP'
16652 typedef struct _goo_struct goo_struct;
16653 goo_struct * volatile goo = ((goo_struct *)0);
16654 struct _goo_struct {
16659 typedef unsigned short foo_t;
16660 char *volatile foo;
16662 volatile foo_t blech;
16666 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16668 echo "Yup, it does."
16671 echo "Nope, it doesn't."
16677 : Check basic sizes
16679 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16681 case "$use64bitint:$d_quad:$quadtype" in
16684 uvtype="$uquadtype"
16689 uvtype="unsigned long"
16695 case "$uselongdouble:$d_longdbl" in
16697 nvtype="long double"
16698 nvsize=$longdblsize
16705 case "$usequadmath:$i_quadmath" in
16707 nvtype="__float128"
16713 *** You requested the use of the quadmath library, but you
16714 *** do not seem to have the quadmath library installed.
16715 *** Cannot continue, aborting.
16721 define:*) $cat <<EOM >&4
16723 *** You requested the use of the quadmath library, but you
16724 *** do not seem to have the required header, <quadmath.h>.
16726 case "$gccversion" in
16729 *** Your gcc looks a bit old:
16735 *** You are not running a gcc.
16740 *** For the quadmath library you need at least gcc 4.6.
16741 *** Cannot continue, aborting.
16747 $echo "(IV will be "$ivtype", $ivsize bytes)"
16748 $echo "(UV will be "$uvtype", $uvsize bytes)"
16749 $echo "(NV will be "$nvtype", $nvsize bytes)"
16752 #$i_inttypes I_INTTYPES
16754 #include <inttypes.h>
16759 int8_t i = INT8_MAX;
16760 uint8_t u = UINT8_MAX;
16761 printf("int8_t\n");
16764 int16_t i = INT16_MAX;
16765 uint16_t u = UINT16_MAX;
16766 printf("int16_t\n");
16769 int32_t i = INT32_MAX;
16770 uint32_t u = UINT32_MAX;
16771 printf("int32_t\n");
16776 i8type="signed char"
16777 u8type="unsigned char"
16782 '') case "$shortsize" in
16784 u16type="unsigned short"
16792 '') set try -DINT16
16793 if eval $compile; then
16794 case "`$run ./try`" in
16806 '') if $test $shortsize -ge 2; then
16808 u16type="unsigned short"
16816 '') case "$longsize" in
16818 u32type="unsigned long"
16822 *) case "$intsize" in
16824 u32type="unsigned int"
16834 '') set try -DINT32
16835 if eval $compile; then
16836 case "`$run ./try`" in
16848 '') if $test $intsize -ge 4; then
16850 u32type="unsigned int"
16858 '') case "$d_quad:$quadtype" in
16860 i64type="$quadtype"
16861 u64type="$uquadtype"
16869 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16870 : volatile so that the compiler has to store it out to memory.
16871 if test X"$d_volatile" = X"$define"; then
16876 #$i_stdlib I_STDLIB
16878 #include <stdlib.h>
16880 #include <sys/types.h>
16881 #include <signal.h>
16883 $volatile int bletched = 0;
16884 $signal_t blech(int s) { bletched = 1; }
16889 int n = 8 * $uvsize;
16892 signal(SIGFPE, blech);
16895 for (i = 0; i < n; i++) {
16896 u = u << 1 | ($uvtype)1;
16898 if (($uvtype)d != u)
16902 d = ($nvtype)(u - 1);
16903 if (($uvtype)d != (u - 1))
16910 printf("%d\n", ((i == n) ? -n : i));
16916 d_nv_preserves_uv="$undef"
16917 if eval $compile; then
16918 nv_preserves_uv_bits="`$run ./try`"
16920 case "$nv_preserves_uv_bits" in
16922 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16923 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16924 d_nv_preserves_uv="$define"
16926 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16927 d_nv_preserves_uv="$undef" ;;
16928 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16929 nv_preserves_uv_bits="0" ;;
16933 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16934 : volatile so that the compiler has to store it out to memory.
16935 if test X"$d_volatile" = X"$define"; then
16941 typedef $nvtype NV;
16948 while(count < 256) {
16949 $volatile NV up = value + 1.0;
16950 $volatile NV negated = -value;
16951 $volatile NV down = negated - 1.0;
16952 $volatile NV got_up = up - value;
16953 int up_good = got_up == 1.0;
16954 int got_down = down - negated;
16955 int down_good = got_down == -1.0;
16957 if (down_good != up_good) {
16959 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16960 up_good, (double) got_up, down_good, (double) got_down,
16961 count, (double) value);
16968 fputs("256.0", stdout);
16971 fputs("2.0", stdout);
16977 fputs("*", stdout);
16983 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16984 count, (double) value);
16990 nv_overflows_integers_at='0'
16991 if eval $compile; then
16997 The largest integer your NVs can preserve is equal to $xxx
16999 nv_overflows_integers_at="$xxx"
17002 Cannot determine the largest integer value your NVs can hold, unexpected output
17009 Cannot determine the largest integer value your NVs can hold
17016 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17017 : volatile so that the compiler has to store it out to memory.
17018 if test X"$d_volatile" = X"$define"; then
17023 #$i_stdlib I_STDLIB
17025 #include <stdlib.h>
17027 #$i_string I_STRING
17029 # include <string.h>
17031 # include <strings.h>
17033 #include <sys/types.h>
17034 #include <signal.h>
17036 $volatile int bletched = 0;
17037 $signal_t blech(int s) { bletched = 1; }
17040 int checkit($nvtype d, char *where) {
17041 unsigned char *p = (char *)&d;
17042 unsigned char *end = p + sizeof(d);
17052 printf("No - %s: 0x", where);
17054 printf ("%02X", *p++);
17059 int main(int argc, char **argv) {
17062 fail += checkit(d, "0.0");
17064 /* The compiler shouldn't be assuming that bletched is 0 */
17067 fail += checkit(d, "bleched");
17070 signal(SIGFPE, blech);
17073 /* Paranoia - the compiler should have no way of knowing that ANSI says
17074 that argv[argc] will always be NULL. Actually, if it did assume this it
17075 would be buggy, as this is C and main() can be called from elsewhere in
17077 d = argv[argc] ? 1 : 0;
17080 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17083 fail += checkit(d, "ternary");
17085 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17088 printf("No - memset doesn't give 0.0\n");
17089 /* This might just blow up: */
17090 printf("(gives %g)\n", d);
17096 printf("No - something bleched\n");
17101 printf("No - %d fail(s)\n", fail);
17110 d_nv_zero_is_allbits_zero="$undef"
17111 if eval $compile; then
17117 0.0 is represented as all bits zero in memory
17119 d_nv_zero_is_allbits_zero="$define"
17122 0.0 is not represented as all bits zero in memory
17124 d_nv_zero_is_allbits_zero="$undef"
17129 0.0 is not represented as all bits zero in memory
17131 d_nv_zero_is_allbits_zero="$undef"
17137 : check for off64_t
17139 echo "Checking to see if you have off64_t..." >&4
17141 #include <sys/types.h>
17142 #include <unistd.h>
17143 int main() { off64_t x = 7; }
17146 if eval $compile; then
17148 echo "You have off64_t."
17151 echo "You do not have off64_t."
17152 case "$lseeksize" in
17153 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17160 : how to create joinable pthreads
17161 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17163 echo "Checking what constant to use for creating joinable pthreads..." >&4
17164 $cat >try.c <<'EOCP'
17165 #include <pthread.h>
17167 int detachstate = JOINABLE;
17170 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17171 if eval $compile; then
17172 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17173 val="$undef" # Yes, undef.
17174 set d_old_pthread_create_joinable
17177 set old_pthread_create_joinable
17180 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17181 if eval $compile; then
17182 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17184 set d_old_pthread_create_joinable
17186 val=PTHREAD_CREATE_UNDETACHED
17187 set old_pthread_create_joinable
17190 set try -DJOINABLE=__UNDETACHED
17191 if eval $compile; then
17192 echo "You seem to use __UNDETACHED." >&4
17194 set d_old_pthread_create_joinable
17197 set old_pthread_create_joinable
17200 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17202 set d_old_pthread_create_joinable
17205 set old_pthread_create_joinable
17212 d_old_pthread_create_joinable="$undef"
17213 old_pthread_create_joinable=""
17216 : see if pause exists
17220 : see if poll exists
17224 : see if prctl exists
17228 : see if prctl supports PR_SET_NAME
17229 d_prctl_set_name=$undef
17234 #include <unistd.h>
17236 #include <sys/prctl.h>
17238 int main (int argc, char *argv[])
17240 return (prctl (PR_SET_NAME, "Test"));
17244 if eval $compile_ok && $run ./try; then
17245 echo "Your prctl (PR_SET_NAME, ...) works"
17246 d_prctl_set_name=$define
17252 : see if readlink exists
17253 set readlink d_readlink
17256 : Check if there is a /proc symlink to the abs path of
17257 : the executing program. We will honor hints of d_procselfexe=$undef
17258 : or procselfexe being non-empty, otherwise will try to determine both
17259 : if we have readlink.
17260 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17261 : referenced, and AmigaOS does not have a proc filesystem anyway.
17264 if $test "X$d_procselfexe" = Xundef; then
17266 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17268 elif $test "X$d_readlink" = Xdefine; then
17269 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17270 : and it feels more tidy to avoid an extra level of symlink
17271 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17272 while test $# -gt 0; do
17275 if $issymlink $try; then
17276 $ls -l $try > reflect
17277 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17278 echo "You have $type-like $try."
17279 procselfexe='"'$try'"'
17281 : This will break out of the loop
17291 : backward compatibility for d_hvfork
17292 if test X$d_hvfork != X; then
17293 d_vfork="$d_hvfork"
17296 : see if there is a vfork
17301 d_pseudofork=$undef
17303 : Ok, but do we want to use it. vfork is reportedly unreliable in
17304 : perl on Solaris 2.x, and probably elsewhere.
17308 case "$usevfork" in
17314 Perl can only use a vfork() that doesn't suffer from strict
17315 restrictions on calling functions or modifying global data in
17316 the child. For example, glibc-2.1 contains such a vfork()
17317 that is unsuitable. If your system provides a proper fork()
17318 call, chances are that you do NOT want perl to use vfork().
17321 rp="Do you still want to use vfork()?"
17326 echo "Ok, we won't use vfork()."
17335 $define) usevfork='true';;
17336 *) usevfork='false';;
17339 : see whether the pthread_atfork exists
17341 #include <pthread.h>
17344 #ifdef PTHREAD_ATFORK
17345 pthread_atfork(NULL,NULL,NULL);
17350 : see if pthread_atfork exists
17351 set try -DPTHREAD_ATFORK
17352 if eval $compile; then
17357 case "$usethreads" in
17360 $define) echo 'pthread_atfork found.' >&4 ;;
17361 *) echo 'pthread_atfork NOT found.' >&4 ;;
17364 set d_pthread_atfork
17367 : see if pthread_attr_setscope exists
17368 set pthread_attr_setscope d_pthread_attr_setscope
17371 : see whether the various POSIXish _yields exist
17373 #include <pthread.h>
17379 #ifdef PTHREAD_YIELD
17382 #ifdef PTHREAD_YIELD_NULL
17383 pthread_yield(NULL);
17389 : see if sched_yield exists
17390 set try -DSCHED_YIELD
17391 if eval $compile; then
17393 sched_yield='sched_yield()'
17397 case "$usethreads" in
17400 $define) echo 'sched_yield() found.' >&4 ;;
17401 *) echo 'sched_yield() NOT found.' >&4 ;;
17407 : see if pthread_yield exists
17408 set try -DPTHREAD_YIELD
17409 if eval $compile; then
17411 case "$sched_yield" in
17412 '') sched_yield='pthread_yield()' ;;
17415 set try -DPTHREAD_YIELD_NULL
17416 if eval $compile; then
17418 case "$sched_yield" in
17419 '') sched_yield='pthread_yield(NULL)' ;;
17425 case "$usethreads" in
17428 $define) echo 'pthread_yield() found.' >&4 ;;
17429 *) echo 'pthread_yield() NOT found.' >&4 ;;
17433 set d_pthread_yield
17435 case "$sched_yield" in
17436 '') sched_yield=undef ;;
17440 : check for ptrdiff_t
17442 echo "Checking to see if you have ptrdiff_t..." >&4
17444 #include <stddef.h>
17445 int main() { ptrdiff_t x = 7; }
17448 if eval $compile; then
17450 echo "You have ptrdiff_t."
17453 echo "You do not have ptrdiff_t."
17459 : see if random_r exists
17460 set random_r d_random_r
17462 case "$d_random_r" in
17464 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17465 case "$d_random_r_proto:$usethreads" in
17466 ":define") d_random_r_proto=define
17467 set d_random_r_proto random_r $hdrs
17471 case "$d_random_r_proto" in
17473 case "$random_r_proto" in
17474 ''|0) try='int random_r(int*, struct random_data*);'
17475 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17477 case "$random_r_proto" in
17478 ''|0) try='int random_r(long*, struct random_data*);'
17479 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17481 case "$random_r_proto" in
17482 ''|0) try='int random_r(struct random_data*, int32_t*);'
17483 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17485 case "$random_r_proto" in
17486 ''|0) d_random_r=undef
17488 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17489 * ) case "$random_r_proto" in
17490 REENTRANT_PROTO*) ;;
17491 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17493 echo "Prototype: $try" ;;
17496 *) case "$usethreads" in
17497 define) echo "random_r has no prototype, not using it." >&4 ;;
17504 *) random_r_proto=0
17508 : see if readdir and friends exist
17509 set readdir d_readdir
17511 set seekdir d_seekdir
17513 set telldir d_telldir
17515 set rewinddir d_rewinddir
17518 : see if readdir64_r exists
17519 set readdir64_r d_readdir64_r
17521 case "$d_readdir64_r" in
17523 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17524 case "$d_readdir64_r_proto:$usethreads" in
17525 ":define") d_readdir64_r_proto=define
17526 set d_readdir64_r_proto readdir64_r $hdrs
17530 case "$d_readdir64_r_proto" in
17532 case "$readdir64_r_proto" in
17533 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17534 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17536 case "$readdir64_r_proto" in
17537 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17538 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17540 case "$readdir64_r_proto" in
17541 ''|0) d_readdir64_r=undef
17542 readdir64_r_proto=0
17543 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17544 * ) case "$readdir64_r_proto" in
17545 REENTRANT_PROTO*) ;;
17546 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17548 echo "Prototype: $try" ;;
17551 *) case "$usethreads" in
17552 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17554 d_readdir64_r=undef
17555 readdir64_r_proto=0
17559 *) readdir64_r_proto=0
17563 : see if readdir_r exists
17564 set readdir_r d_readdir_r
17566 case "$d_readdir_r" in
17568 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17569 case "$d_readdir_r_proto:$usethreads" in
17570 ":define") d_readdir_r_proto=define
17571 set d_readdir_r_proto readdir_r $hdrs
17575 case "$d_readdir_r_proto" in
17577 case "$readdir_r_proto" in
17578 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17579 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17581 case "$readdir_r_proto" in
17582 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17583 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17585 case "$readdir_r_proto" in
17586 ''|0) d_readdir_r=undef
17588 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17589 * ) case "$readdir_r_proto" in
17590 REENTRANT_PROTO*) ;;
17591 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17593 echo "Prototype: $try" ;;
17596 *) case "$usethreads" in
17597 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17604 *) readdir_r_proto=0
17608 : see if readv exists
17612 : see if recvmsg exists
17613 set recvmsg d_recvmsg
17616 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17618 if set regcomp val -f d_regcomp; eval $csym; $val; then
17619 echo 'regcomp() found.' >&4
17620 d_regcomp="$define"
17623 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17624 echo 'regcmp() found.' >&4
17628 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17629 echo 're_comp() found, assuming re_exec() also exists.' >&4
17630 d_re_comp="$define"
17635 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17642 : see if remainder exists
17643 set remainder d_remainder
17646 : see if remquo exists
17647 set remquo d_remquo
17650 : see if rename exists
17651 set rename d_rename
17654 : see if rint exists
17658 : see if rmdir exists
17662 : see if round exists
17666 : see if memory.h is available.
17671 : See if it conflicts with string.h
17677 $cppstdin $cppflags $cppminus < $strings > mem.h
17678 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17680 echo "We won't be including <memory.h>."
17690 : can bcopy handle overlapping blocks?
17693 case "$d_memmove" in
17694 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17695 *) case "$d_bcopy" in
17697 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17699 #$i_memory I_MEMORY
17700 #$i_stdlib I_STDLIB
17701 #$i_string I_STRING
17702 #$i_unistd I_UNISTD
17704 $cat >>try.c <<'EOCP'
17707 # include <memory.h>
17710 # include <stdlib.h>
17713 # include <string.h>
17715 # include <strings.h>
17718 # include <unistd.h> /* Needed for NetBSD */
17722 char buf[128], abc[128];
17728 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17729 try to store the string in read-only memory. */
17730 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17732 for (align = 7; align >= 0; align--) {
17733 for (len = 36; len; len--) {
17735 bcopy(abc, b, len);
17736 for (off = 1; off <= len; off++) {
17737 bcopy(b, b+off, len);
17738 bcopy(b+off, b, len);
17739 if (bcmp(b, abc, len))
17748 if eval $compile_ok; then
17749 if $run ./try 2>/dev/null; then
17750 echo "Yes, it can."
17753 echo "It can't, sorry."
17756 echo "(I can't compile the test program, so we'll assume not...)"
17766 : can memcpy handle overlapping blocks?
17769 case "$d_memmove" in
17770 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17771 *) case "$d_memcpy" in
17773 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17775 #$i_memory I_MEMORY
17776 #$i_stdlib I_STDLIB
17777 #$i_string I_STRING
17778 #$i_unistd I_UNISTD
17780 $cat >>try.c <<'EOCP'
17783 # include <memory.h>
17786 # include <stdlib.h>
17789 # include <string.h>
17791 # include <strings.h>
17794 # include <unistd.h> /* Needed for NetBSD */
17798 char buf[128], abc[128];
17804 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17805 try to store the string in read-only memory. */
17806 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17808 for (align = 7; align >= 0; align--) {
17809 for (len = 36; len; len--) {
17811 memcpy(b, abc, len);
17812 for (off = 1; off <= len; off++) {
17813 memcpy(b+off, b, len);
17814 memcpy(b, b+off, len);
17815 if (memcmp(b, abc, len))
17824 if eval $compile_ok; then
17825 if $run ./try 2>/dev/null; then
17826 echo "Yes, it can."
17829 echo "It can't, sorry."
17832 echo "(I can't compile the test program, so we'll assume not...)"
17842 : can memcmp be trusted to compare relative magnitude?
17844 case "$d_memcmp" in
17847 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17849 #$i_memory I_MEMORY
17850 #$i_stdlib I_STDLIB
17851 #$i_string I_STRING
17852 #$i_unistd I_UNISTD
17854 $cat >>try.c <<'EOCP'
17857 # include <memory.h>
17860 # include <stdlib.h>
17863 # include <string.h>
17865 # include <strings.h>
17868 # include <unistd.h> /* Needed for NetBSD */
17874 if ((a < b) && memcmp(&a, &b, 1) < 0)
17880 if eval $compile_ok; then
17881 if $run ./try 2>/dev/null; then
17882 echo "Yes, it can."
17885 echo "No, it can't (it uses signed chars)."
17888 echo "(I can't compile the test program, so we'll assume not...)"
17896 : see if prototype for sbrk is available
17898 set d_sbrkproto sbrk $i_unistd unistd.h
17901 : see if scalbn exists
17902 set scalbn d_scalbn
17905 : see if select exists
17906 set select d_select
17909 : see if semctl exists
17910 set semctl d_semctl
17913 : see if semget exists
17914 set semget d_semget
17917 : see if semop exists
17921 : see how much of the 'sem*(2)' library is present.
17924 case "$d_semctl$d_semget$d_semop" in
17925 *"$undef"*) h_sem=false;;
17929 case "`ipcs 2>&1`" in
17930 "SVID messages"*"not configured"*)
17931 echo "Your $osname does not have the sem*(2) configured." >&4
17934 set semctl d_semctl
17936 set semget d_semget
17944 : we could also check for sys/ipc.h ...
17945 if $h_sem && $test `./findhdr sys/sem.h`; then
17946 echo "You have the full sem*(2) library." >&4
17949 echo "You don't have the full sem*(2) library." >&4
17955 : see whether sys/sem.h defines union semun
17957 $cat > try.c <<'END'
17958 #include <sys/types.h>
17959 #include <sys/ipc.h>
17960 #include <sys/sem.h>
17961 int main () { union semun semun; semun.buf = 0; }
17964 if eval $compile; then
17965 echo "You have union semun in <sys/sem.h>." >&4
17968 echo "You do not have union semun in <sys/sem.h>." >&4
17975 : see how to do semctl IPC_STAT
17979 $cat > tryh.h <<END
17982 # define S_IRUSR S_IREAD
17983 # define S_IWUSR S_IWRITE
17984 # define S_IXUSR S_IEXEC
17986 # define S_IRUSR 0400
17987 # define S_IWUSR 0200
17988 # define S_IXUSR 0100
17990 # define S_IRGRP (S_IRUSR>>3)
17991 # define S_IWGRP (S_IWUSR>>3)
17992 # define S_IXGRP (S_IXUSR>>3)
17993 # define S_IROTH (S_IRUSR>>6)
17994 # define S_IWOTH (S_IWUSR>>6)
17995 # define S_IXOTH (S_IXUSR>>6)
17998 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17999 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18000 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18003 : see whether semctl IPC_STAT can use union semun
18004 case "$d_semctl_semun" in
18008 #include <sys/types.h>
18009 #include <sys/ipc.h>
18010 #include <sys/sem.h>
18011 #include <sys/stat.h>
18018 #$d_union_semun HAS_UNION_SEMUN
18021 #ifndef HAS_UNION_SEMUN
18024 struct semid_ds *buf;
18025 unsigned short *array;
18031 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18032 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18034 struct semid_ds argbuf;
18037 st = semctl(sem, 0, IPC_STAT, arg);
18041 # endif /* IPC_STAT */
18042 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18044 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18045 # endif /* IPC_RMID */
18046 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18048 #endif /* IPC_PRIVATE && ... */
18049 printf("semget failed: errno = %d\n", errno);
18054 if eval $compile; then
18057 semun) val="$define" ;;
18065 case "$d_semctl_semun" in
18067 echo "You can use union semun for semctl IPC_STAT." >&4
18070 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18075 : see whether semctl IPC_STAT can use struct semid_ds pointer
18076 case "$d_semctl_semid_ds" in
18079 $cat > try.c <<'END'
18080 #include <sys/types.h>
18081 #include <sys/ipc.h>
18082 #include <sys/sem.h>
18083 #include <sys/stat.h>
18091 struct semid_ds arg;
18094 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18095 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18098 st = semctl(sem, 0, IPC_STAT, &arg);
18100 printf("semid_ds\n");
18102 # endif /* IPC_STAT */
18103 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18105 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18106 # endif /* IPC_RMID */
18107 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18109 #endif /* IPC_PRIVATE && ... */
18110 printf("semget failed: errno = %d\n", errno);
18116 if eval $compile; then
18119 semid_ds) val="$define" ;;
18123 set d_semctl_semid_ds
18127 case "$d_semctl_semid_ds" in
18129 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18131 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18137 # We do not have the full sem*(2) library, so assume we can not
18143 set d_semctl_semid_ds
18149 : see if sendmsg exists
18150 set sendmsg d_sendmsg
18153 : see if setegid exists
18154 set setegid d_setegid
18157 : see if seteuid exists
18158 set seteuid d_seteuid
18161 : see if setgrent exists
18162 set setgrent d_setgrent
18165 : see if setgrent_r exists
18166 set setgrent_r d_setgrent_r
18168 case "$d_setgrent_r" in
18170 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18171 case "$d_setgrent_r_proto:$usethreads" in
18172 ":define") d_setgrent_r_proto=define
18173 set d_setgrent_r_proto setgrent_r $hdrs
18177 case "$d_setgrent_r_proto" in
18179 case "$setgrent_r_proto" in
18180 ''|0) try='int setgrent_r(FILE**);'
18181 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18183 case "$setgrent_r_proto" in
18184 ''|0) try='void setgrent_r(FILE**);'
18185 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18187 case "$setgrent_r_proto" in
18188 ''|0) d_setgrent_r=undef
18190 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18191 * ) case "$setgrent_r_proto" in
18192 REENTRANT_PROTO*) ;;
18193 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18195 echo "Prototype: $try" ;;
18198 *) case "$usethreads" in
18199 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18206 *) setgrent_r_proto=0
18210 : see if sethostent exists
18211 set sethostent d_sethent
18214 : see if sethostent_r exists
18215 set sethostent_r d_sethostent_r
18217 case "$d_sethostent_r" in
18219 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18220 case "$d_sethostent_r_proto:$usethreads" in
18221 ":define") d_sethostent_r_proto=define
18222 set d_sethostent_r_proto sethostent_r $hdrs
18226 case "$d_sethostent_r_proto" in
18228 case "$sethostent_r_proto" in
18229 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18230 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18232 case "$sethostent_r_proto" in
18233 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18234 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18236 case "$sethostent_r_proto" in
18237 ''|0) d_sethostent_r=undef
18238 sethostent_r_proto=0
18239 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18240 * ) case "$sethostent_r_proto" in
18241 REENTRANT_PROTO*) ;;
18242 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18244 echo "Prototype: $try" ;;
18247 *) case "$usethreads" in
18248 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18250 d_sethostent_r=undef
18251 sethostent_r_proto=0
18255 *) sethostent_r_proto=0
18259 : see if setitimer exists
18260 set setitimer d_setitimer
18263 : see if setlinebuf exists
18264 set setlinebuf d_setlinebuf
18267 : see if setlocale exists
18268 set setlocale d_setlocale
18271 : see if locale.h is available
18272 set locale.h i_locale
18275 : see if setlocale_r exists
18276 set setlocale_r d_setlocale_r
18278 case "$d_setlocale_r" in
18280 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18281 case "$d_setlocale_r_proto:$usethreads" in
18282 ":define") d_setlocale_r_proto=define
18283 set d_setlocale_r_proto setlocale_r $hdrs
18287 case "$d_setlocale_r_proto" in
18289 case "$setlocale_r_proto" in
18290 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18291 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18293 case "$setlocale_r_proto" in
18294 ''|0) d_setlocale_r=undef
18295 setlocale_r_proto=0
18296 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18297 * ) case "$setlocale_r_proto" in
18298 REENTRANT_PROTO*) ;;
18299 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18301 echo "Prototype: $try" ;;
18304 *) case "$usethreads" in
18305 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18307 d_setlocale_r=undef
18308 setlocale_r_proto=0
18312 *) setlocale_r_proto=0
18316 : see if setnetent exists
18317 set setnetent d_setnent
18320 : see if setnetent_r exists
18321 set setnetent_r d_setnetent_r
18323 case "$d_setnetent_r" in
18325 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18326 case "$d_setnetent_r_proto:$usethreads" in
18327 ":define") d_setnetent_r_proto=define
18328 set d_setnetent_r_proto setnetent_r $hdrs
18332 case "$d_setnetent_r_proto" in
18334 case "$setnetent_r_proto" in
18335 ''|0) try='int setnetent_r(int, struct netent_data*);'
18336 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18338 case "$setnetent_r_proto" in
18339 ''|0) try='void setnetent_r(int, struct netent_data*);'
18340 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18342 case "$setnetent_r_proto" in
18343 ''|0) d_setnetent_r=undef
18344 setnetent_r_proto=0
18345 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18346 * ) case "$setnetent_r_proto" in
18347 REENTRANT_PROTO*) ;;
18348 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18350 echo "Prototype: $try" ;;
18353 *) case "$usethreads" in
18354 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18356 d_setnetent_r=undef
18357 setnetent_r_proto=0
18361 *) setnetent_r_proto=0
18365 : see if setprotoent exists
18366 set setprotoent d_setpent
18369 : see if setpgid exists
18370 set setpgid d_setpgid
18373 : see if setpgrp2 exists
18374 set setpgrp2 d_setpgrp2
18377 : see if setpriority exists
18378 set setpriority d_setprior
18381 : see if setproctitle exists
18382 set setproctitle d_setproctitle
18385 : see if setprotoent_r exists
18386 set setprotoent_r d_setprotoent_r
18388 case "$d_setprotoent_r" in
18390 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18391 case "$d_setprotoent_r_proto:$usethreads" in
18392 ":define") d_setprotoent_r_proto=define
18393 set d_setprotoent_r_proto setprotoent_r $hdrs
18397 case "$d_setprotoent_r_proto" in
18399 case "$setprotoent_r_proto" in
18400 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18401 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18403 case "$setprotoent_r_proto" in
18404 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18405 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18407 case "$setprotoent_r_proto" in
18408 ''|0) d_setprotoent_r=undef
18409 setprotoent_r_proto=0
18410 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18411 * ) case "$setprotoent_r_proto" in
18412 REENTRANT_PROTO*) ;;
18413 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18415 echo "Prototype: $try" ;;
18418 *) case "$usethreads" in
18419 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18421 d_setprotoent_r=undef
18422 setprotoent_r_proto=0
18426 *) setprotoent_r_proto=0
18430 : see if setpwent exists
18431 set setpwent d_setpwent
18434 : see if setpwent_r exists
18435 set setpwent_r d_setpwent_r
18437 case "$d_setpwent_r" in
18439 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18440 case "$d_setpwent_r_proto:$usethreads" in
18441 ":define") d_setpwent_r_proto=define
18442 set d_setpwent_r_proto setpwent_r $hdrs
18446 case "$d_setpwent_r_proto" in
18448 case "$setpwent_r_proto" in
18449 ''|0) try='int setpwent_r(FILE**);'
18450 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18452 case "$setpwent_r_proto" in
18453 ''|0) try='void setpwent_r(FILE**);'
18454 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18456 case "$setpwent_r_proto" in
18457 ''|0) d_setpwent_r=undef
18459 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18460 * ) case "$setpwent_r_proto" in
18461 REENTRANT_PROTO*) ;;
18462 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18464 echo "Prototype: $try" ;;
18467 *) case "$usethreads" in
18468 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18475 *) setpwent_r_proto=0
18479 : see if setregid exists
18480 set setregid d_setregid
18482 set setresgid d_setresgid
18485 : see if setreuid exists
18486 set setreuid d_setreuid
18488 set setresuid d_setresuid
18491 : see if setrgid exists
18492 set setrgid d_setrgid
18495 : see if setruid exists
18496 set setruid d_setruid
18499 : see if setservent exists
18500 set setservent d_setsent
18503 : see if setservent_r exists
18504 set setservent_r d_setservent_r
18506 case "$d_setservent_r" in
18508 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18509 case "$d_setservent_r_proto:$usethreads" in
18510 ":define") d_setservent_r_proto=define
18511 set d_setservent_r_proto setservent_r $hdrs
18515 case "$d_setservent_r_proto" in
18517 case "$setservent_r_proto" in
18518 ''|0) try='int setservent_r(int, struct servent_data*);'
18519 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18521 case "$setservent_r_proto" in
18522 ''|0) try='void setservent_r(int, struct servent_data*);'
18523 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18525 case "$setservent_r_proto" in
18526 ''|0) d_setservent_r=undef
18527 setservent_r_proto=0
18528 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18529 * ) case "$setservent_r_proto" in
18530 REENTRANT_PROTO*) ;;
18531 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18533 echo "Prototype: $try" ;;
18536 *) case "$usethreads" in
18537 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18539 d_setservent_r=undef
18540 setservent_r_proto=0
18544 *) setservent_r_proto=0
18548 : see if setsid exists
18549 set setsid d_setsid
18552 : see if setvbuf exists
18553 set setvbuf d_setvbuf
18556 : see if shmctl exists
18557 set shmctl d_shmctl
18560 : see if shmget exists
18561 set shmget d_shmget
18564 : see if shmat exists
18567 : see what shmat returns
18570 $cat >shmat.c <<'END'
18571 #include <sys/shm.h>
18574 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18579 echo "and it returns ($shmattype)." >&4
18580 : see if a prototype for shmat is available
18581 xxx=`./findhdr sys/shm.h`
18582 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18583 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18594 set d_shmatprototype
18597 : see if shmdt exists
18601 : see how much of the 'shm*(2)' library is present.
18604 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18605 *"$undef"*) h_shm=false;;
18609 case "`ipcs 2>&1`" in
18610 "SVID shared memory"*"not configured"*)
18611 echo "Your $osname does not have the shm*(2) configured." >&4
18614 set shmctl d_shmctl
18616 set shmget d_shmget
18626 : we could also check for sys/ipc.h ...
18627 if $h_shm && $test `./findhdr sys/shm.h`; then
18628 echo "You have the full shm*(2) library." >&4
18631 echo "You don't have the full shm*(2) library." >&4
18637 : see if we have sigaction
18639 if set sigaction val -f d_sigaction; eval $csym; $val; then
18640 echo 'sigaction() found.' >&4
18643 #include <sys/types.h>
18644 #include <signal.h>
18645 #$i_stdlib I_STDLIB
18647 #include <stdlib.h>
18651 struct sigaction act, oact;
18653 oact.sa_handler = 0;
18654 /* so that act and oact are used */
18655 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18659 if eval $compile_ok; then
18662 echo "But you don't seem to have a usable struct sigaction." >&4
18666 echo 'sigaction NOT found.' >&4
18669 set d_sigaction; eval $setvar
18672 : see what type pids are declared as in the kernel
18673 rp="What is the type of process ids on this system?"
18674 set pid_t pidtype int stdio.h sys/types.h
18677 : see what type uids are declared as in the kernel
18679 echo "Looking for the type for user ids returned by getuid()."
18680 set uid_t uidtype xxx stdio.h sys/types.h
18684 xxx=`./findhdr sys/user.h`
18685 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18687 unsigned) dflt="$1 $2" ;;
18691 *) dflt="$uidtype";;
18694 uid_t) echo "uid_t found." ;;
18695 *) rp="What is the type for user ids returned by getuid()?"
18701 : Define hasfield_t macro for Configure internal use
18702 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18703 while $test $# -ge 2; do
18705 $define) echo "#include <$2>";;
18709 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18711 if eval $compile; then
18720 : see what siginfo fields we have
18721 case "$d_sigaction" in
18723 echo "Checking if your siginfo_t has si_errno field...">&4
18724 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18727 echo "Checking if your siginfo_t has si_pid field...">&4
18728 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18731 echo "Checking if your siginfo_t has si_uid field...">&4
18732 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18735 echo "Checking if your siginfo_t has si_addr field...">&4
18736 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18739 echo "Checking if your siginfo_t has si_status field...">&4
18740 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18743 echo "Checking if your siginfo_t has si_band field...">&4
18744 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18747 echo "Checking if your siginfo_t has si_value field...">&4
18748 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18751 echo "Checking if your siginfo_t has si_fd field...">&4
18752 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18757 d_siginfo_si_errno="$undef"
18758 d_siginfo_si_pid="$undef"
18759 d_siginfo_si_uid="$undef"
18760 d_siginfo_si_addr="$undef"
18761 d_siginfo_si_status="$undef"
18762 d_siginfo_si_band="$undef"
18763 d_siginfo_si_value="$undef"
18764 d_siginfo_si_fd="$undef"
18768 : see if this is a sunmath.h system
18769 set sunmath.h i_sunmath
18772 : see if signbit exists
18773 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18776 #$i_sunmath I_SUNMATH
18780 #ifdef I_SUNMATH /* Solaris special math library */
18781 # include <sunmath.h>
18784 int main(int argc, char **argv)
18788 if ((signbit(x) == 0) && (signbit(y) != 0))
18796 if eval $compile; then
18797 if $run ./try; then
18801 $echo "Signbit seems to be available, but doesn't work as I expected."
18802 $echo "I won't use it." >&4
18813 : see if sigprocmask exists
18814 set sigprocmask d_sigprocmask
18817 : see if sigsetjmp exists
18819 case "$d_sigsetjmp" in
18822 #include <setjmp.h>
18823 #$i_stdlib I_STDLIB
18825 #include <stdlib.h>
18831 if (sigsetjmp(env,1))
18834 siglongjmp(env, 1);
18839 if eval $compile; then
18840 if $run ./try >/dev/null 2>&1; then
18841 echo "POSIX sigsetjmp found." >&4
18845 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18851 echo "sigsetjmp not found." >&4
18855 *) val="$d_sigsetjmp"
18856 case "$d_sigsetjmp" in
18857 $define) echo "POSIX sigsetjmp found." >&4;;
18858 $undef) echo "sigsetjmp not found." >&4;;
18866 : see if snprintf exists
18867 set snprintf d_snprintf
18870 : see if vsnprintf exists
18871 set vsnprintf d_vsnprintf
18874 case "$d_snprintf-$d_vsnprintf" in
18877 Checking whether your snprintf() and vsnprintf() work okay...
18879 $cat >try.c <<'EOCP'
18880 /* v?snprintf testing logic courtesy of Russ Allbery.
18881 * According to C99:
18882 * - if the buffer is too short it still must be \0-terminated
18883 * - if the buffer is too short the potentially required length
18884 * must be returned and not -1
18885 * - if the buffer is NULL the potentially required length
18886 * must be returned and not -1 or core dump
18889 #include <stdarg.h>
18893 int test (char *format, ...)
18898 va_start (args, format);
18899 count = vsnprintf (buf, sizeof buf, format, args);
18906 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18907 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18911 if eval $compile; then
18914 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18916 Your snprintf() and snprintf() don't seem to be working okay.
18918 d_snprintf="$undef"
18919 d_vsnprintf="$undef"
18923 echo "(I can't seem to compile the test program--assuming they don't)"
18924 d_snprintf="$undef"
18925 d_vsnprintf="$undef"
18931 : see if sockatmark exists
18932 set sockatmark d_sockatmark
18935 : see if prototype for sockatmark is available
18937 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18940 : see if socks5_init exists
18941 set socks5_init d_socks5_init
18944 : see if sprintf returns the length of the string in the buffer as per ANSI
18945 $echo "Checking whether sprintf returns the length of the string..." >&4
18948 #$i_stdlib I_STDLIB
18950 #include <stdlib.h>
18952 #$i_string I_STRING
18954 # include <string.h>
18956 # include <strings.h>
18965 int check (size_t expect, int test) {
18966 size_t got = strlen(buffer);
18970 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18975 int main(int argc, char **argv) {
18978 check(sprintf(buffer, ""), ++test);
18979 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18980 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18987 if eval $compile; then
18991 sprintf returns the length of the string (as ANSI says it should)
18993 d_sprintf_returns_strlen="$define"
18996 sprintf does not return the length of the string (how old is this system?)
18998 d_sprintf_returns_strlen="$undef"
19002 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
19003 d_sprintf_returns_strlen="$undef"
19007 : see if srand48_r exists
19008 set srand48_r d_srand48_r
19010 case "$d_srand48_r" in
19012 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19013 case "$d_srand48_r_proto:$usethreads" in
19014 ":define") d_srand48_r_proto=define
19015 set d_srand48_r_proto srand48_r $hdrs
19019 case "$d_srand48_r_proto" in
19021 case "$srand48_r_proto" in
19022 ''|0) try='int srand48_r(long, struct drand48_data*);'
19023 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19025 case "$srand48_r_proto" in
19026 ''|0) d_srand48_r=undef
19028 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19029 * ) case "$srand48_r_proto" in
19030 REENTRANT_PROTO*) ;;
19031 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19033 echo "Prototype: $try" ;;
19036 *) case "$usethreads" in
19037 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19044 *) srand48_r_proto=0
19048 : see if srandom_r exists
19049 set srandom_r d_srandom_r
19051 case "$d_srandom_r" in
19053 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19054 case "$d_srandom_r_proto:$usethreads" in
19055 ":define") d_srandom_r_proto=define
19056 set d_srandom_r_proto srandom_r $hdrs
19060 case "$d_srandom_r_proto" in
19062 case "$srandom_r_proto" in
19063 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19064 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19066 case "$srandom_r_proto" in
19067 ''|0) d_srandom_r=undef
19069 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19070 * ) case "$srandom_r_proto" in
19071 REENTRANT_PROTO*) ;;
19072 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19074 echo "Prototype: $try" ;;
19077 *) case "$usethreads" in
19078 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19085 *) srandom_r_proto=0
19089 : see if prototype for setresgid is available
19091 set d_sresgproto setresgid $i_unistd unistd.h
19094 : see if prototype for setresuid is available
19096 set d_sresuproto setresuid $i_unistd unistd.h
19099 : see if stat exists
19103 : see if sys/stat.h is available
19104 set sys/stat.h i_sysstat
19107 : see if stat knows about block sizes
19109 echo "Checking to see if your struct stat has st_blocks field..." >&4
19110 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19113 : see if this is a sys/vfs.h system
19114 set sys/vfs.h i_sysvfs
19117 : see if this is a sys/statfs.h system
19118 set sys/statfs.h i_sysstatfs
19121 : Check for statfs_s
19123 echo "Checking to see if your system supports struct statfs..." >&4
19124 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
19126 case "$d_statfs_s" in
19127 "$define") echo "Yes, it does." ;;
19128 *) echo "No, it doesn't." ;;
19132 : see if struct statfs knows about f_flags
19133 case "$d_statfs_s" in
19136 echo "Checking to see if your struct statfs has f_flags field..." >&4
19137 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
19141 set d_statfs_f_flags
19145 case "$d_statfs_f_flags" in
19146 "$define") echo "Yes, it does." ;;
19147 *) echo "No, it doesn't." ;;
19150 : see what flavor, if any, of static inline is supported
19152 echo "Checking to see if your system supports static inline..."
19153 $cat > try.c <<'EOCP'
19154 #include <stdlib.h>
19155 extern int f_via_a(int x);
19156 extern int f_via_b(int x);
19157 int main(int argc, char **argv)
19166 return EXIT_SUCCESS;
19169 return EXIT_FAILURE;
19173 $cat > a.c <<'EOCP'
19174 static INLINE int f(int x) {
19185 $cat > b.c <<'EOCP'
19186 extern int f(int x);
19194 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19195 case "$perl_static_inline" in
19196 '') # Check the various possibilities, and break out on success.
19197 # For gcc, prefer __inline__, which will still permit
19198 # cflags.SH to add in -ansi.
19199 case "$gccversion" in
19200 '') xxx="inline __inline__ __inline _inline";;
19201 *) xxx="__inline__ inline __inline _inline";;
19203 for inline in $xxx; do
19204 set try -DINLINE=$inline a.c
19205 if eval $compile && $run ./try; then
19206 # Now make sure there is no external linkage of static
19208 set try -DINLINE=$inline -DUSE_B a.c b.c
19209 if eval $compile && $run ./try; then
19210 $echo "Your compiler supports static $inline, " >&4
19211 $echo "but it also creates an external definition," >&4
19212 $echo "so I won't use it." >&4
19215 $echo "Your compiler supports static $inline." >&4
19217 perl_static_inline="static $inline";
19221 $echo "Your compiler does NOT support static $inline." >&4
19226 *inline*) # Some variant of inline exists.
19227 echo "Keeping your $hint value of $perl_static_inline."
19230 static) # No inline capabilities
19231 echo "Keeping your $hint value of $perl_static_inline."
19234 *) # Unrecognized previous value -- blindly trust the supplied
19235 # value and hope it makes sense. Use old value for
19236 # d_static_inline, if there is one.
19237 echo "Keeping your $hint value of $perl_static_inline."
19238 case "$d_static_inline" in
19240 *) val=$d_static_inline ;;
19244 # Fallback to plain 'static' if nothing worked.
19245 case "$perl_static_inline" in
19247 perl_static_inline="static"
19251 set d_static_inline
19253 $rm -f a.[co] b.[co]
19256 : Check stream access
19258 Checking how to access stdio streams by file descriptor number...
19260 case "$stdio_stream_array" in
19261 '') $cat >try.c <<EOCP
19264 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19268 for s in _iob __iob __sF
19270 set try -DSTDIO_STREAM_ARRAY=$s
19271 if eval $compile; then
19272 case "`$run ./try`" in
19273 yes) stdio_stream_array=$s; break ;;
19279 case "$stdio_stream_array" in
19281 I can't figure out how to access stdio streams by file descriptor number.
19283 d_stdio_stream_array="$undef"
19286 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19288 d_stdio_stream_array="$define"
19292 : see if strcoll exists
19293 set strcoll d_strcoll
19296 : check for structure copying
19298 echo "Checking to see if your C compiler can copy structs..." >&4
19299 $cat >try.c <<'EOCP'
19309 if $cc -c try.c >/dev/null 2>&1 ; then
19311 echo "Yup, it can."
19314 echo "Nope, it can't."
19320 : see if strerror and/or sys_errlist[] exist
19322 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19323 if set strerror val -f d_strerror; eval $csym; $val; then
19324 echo 'strerror() found.' >&4
19325 d_strerror="$define"
19326 d_strerrm='strerror(e)'
19327 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19328 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19329 d_syserrlst="$define"
19331 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19332 d_syserrlst="$undef"
19334 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19335 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19336 echo 'strerror() found in string header.' >&4
19337 d_strerror="$define"
19338 d_strerrm='strerror(e)'
19339 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19340 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19341 d_syserrlst="$define"
19343 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19344 d_syserrlst="$undef"
19346 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19347 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19348 d_strerror="$undef"
19349 d_syserrlst="$define"
19350 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19352 echo 'strerror() and sys_errlist[] NOT found.' >&4
19353 d_strerror="$undef"
19354 d_syserrlst="$undef"
19355 d_strerrm='"unknown"'
19359 : see if strerror_l exists
19360 set strerror_l d_strerror_l
19363 : see if strerror_r exists
19364 set strerror_r d_strerror_r
19366 case "$d_strerror_r" in
19368 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19369 case "$d_strerror_r_proto:$usethreads" in
19370 ":define") d_strerror_r_proto=define
19371 set d_strerror_r_proto strerror_r $hdrs
19375 case "$d_strerror_r_proto" in
19377 case "$strerror_r_proto" in
19378 ''|0) try='int strerror_r(int, char*, size_t);'
19379 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19381 case "$strerror_r_proto" in
19382 ''|0) try='int strerror_r(int, char*, int);'
19383 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19385 case "$strerror_r_proto" in
19386 ''|0) try='char* strerror_r(int, char*, size_t);'
19387 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19389 case "$strerror_r_proto" in
19390 ''|0) d_strerror_r=undef
19392 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19393 * ) case "$strerror_r_proto" in
19394 REENTRANT_PROTO*) ;;
19395 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19397 echo "Prototype: $try" ;;
19400 *) case "$usethreads" in
19401 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19408 *) strerror_r_proto=0
19412 : see if strftime exists
19413 set strftime d_strftime
19416 : see if strlcat exists
19417 set strlcat d_strlcat
19420 : see if strlcpy exists
19421 set strlcpy d_strlcpy
19424 : see if strtod exists
19425 set strtod d_strtod
19428 : see if strtol exists
19429 set strtol d_strtol
19432 : see if strtold exists
19433 set strtold d_strtold
19436 : see if strtoll exists
19437 set strtoll d_strtoll
19440 case "$d_longlong-$d_strtoll" in
19443 Checking whether your strtoll() works okay...
19445 $cat >try.c <<'EOCP'
19448 #define strtoll __strtoll
19451 #define strtoll _strtoll
19454 extern long long int strtoll(char *s, char **, int);
19455 static int bad = 0;
19456 int check(char *s, long long ell, int een) {
19459 gll = strtoll(s, 0, 10);
19460 if (!((gll == ell) && (errno == een)))
19464 check(" 1", 1LL, 0);
19465 check(" 0", 0LL, 0);
19466 check("-1", -1LL, 0);
19467 check("-9223372036854775808", -9223372036854775808LL, 0);
19468 check("-9223372036854775808", -9223372036854775808LL, 0);
19469 check(" 9223372036854775807", 9223372036854775807LL, 0);
19470 check("-9223372036854775808", -9223372036854775808LL, 0);
19471 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19472 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19478 if eval $compile; then
19481 ok) echo "Your strtoll() seems to be working okay." ;;
19483 Your strtoll() doesn't seem to be working okay.
19489 echo "(I can't seem to compile the test program--assuming it doesn't)"
19495 : see if strtoq exists
19496 set strtoq d_strtoq
19499 : see if strtoul exists
19500 set strtoul d_strtoul
19503 case "$d_strtoul" in
19506 Checking whether your strtoul() works okay...
19508 $cat >try.c <<'EOCP'
19511 extern unsigned long int strtoul(char *s, char **, int);
19512 static int bad = 0;
19513 void check(char *s, unsigned long eul, int een) {
19516 gul = strtoul(s, 0, 10);
19517 if (!((gul == eul) && (errno == een)))
19521 check(" 1", 1L, 0);
19522 check(" 0", 0L, 0);
19524 case "$longsize" in
19526 $cat >>try.c <<'EOCP'
19527 check("18446744073709551615", 18446744073709551615UL, 0);
19528 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19529 #if 0 /* strtoul() for /^-/ strings is undefined. */
19530 check("-1", 18446744073709551615UL, 0);
19531 check("-18446744073709551614", 2, 0);
19532 check("-18446744073709551615", 1, 0);
19533 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19534 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19539 $cat >>try.c <<'EOCP'
19540 check("4294967295", 4294967295UL, 0);
19541 check("4294967296", 4294967295UL, ERANGE);
19542 #if 0 /* strtoul() for /^-/ strings is undefined. */
19543 check("-1", 4294967295UL, 0);
19544 check("-4294967294", 2, 0);
19545 check("-4294967295", 1, 0);
19546 check("-4294967296", 4294967295UL, ERANGE);
19547 check("-4294967297", 4294967295UL, ERANGE);
19552 : Should we write these tests to be more portable by sprintf-ing
19553 : ~0 and then manipulating that char string as input for strtol?
19556 $cat >>try.c <<'EOCP'
19563 if eval $compile; then
19564 case "`$run ./try`" in
19565 ok) echo "Your strtoul() seems to be working okay." ;;
19567 Your strtoul() doesn't seem to be working okay.
19573 echo "(I can't seem to compile the test program--assuming it doesn't)"
19579 : see if strtoull exists
19580 set strtoull d_strtoull
19583 case "$d_longlong-$d_strtoull" in
19586 Checking whether your strtoull() works okay...
19588 $cat >try.c <<'EOCP'
19591 #define strtoull __strtoull
19594 extern unsigned long long int strtoull(char *s, char **, int);
19595 static int bad = 0;
19596 int check(char *s, long long eull, int een) {
19599 gull = strtoull(s, 0, 10);
19600 if (!((gull == eull) && (errno == een)))
19604 check(" 1", 1LL, 0);
19605 check(" 0", 0LL, 0);
19606 check("18446744073709551615", 18446744073709551615ULL, 0);
19607 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19608 #if 0 /* strtoull() for /^-/ strings is undefined. */
19609 check("-1", 18446744073709551615ULL, 0);
19610 check("-18446744073709551614", 2LL, 0);
19611 check("-18446744073709551615", 1LL, 0);
19612 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19613 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19620 if eval $compile; then
19621 case "`$run ./try`" in
19622 ok) echo "Your strtoull() seems to be working okay." ;;
19624 Your strtoull() doesn't seem to be working okay.
19626 d_strtoull="$undef"
19630 echo "(I can't seem to compile the test program--assuming it doesn't)"
19631 d_strtoull="$undef"
19636 : see if strtouq exists
19637 set strtouq d_strtouq
19640 case "$d_strtouq" in
19643 Checking whether your strtouq() works okay...
19645 $cat >try.c <<'EOCP'
19648 extern unsigned long long int strtouq(char *s, char **, int);
19649 static int bad = 0;
19650 void check(char *s, unsigned long long eull, int een) {
19651 unsigned long long gull;
19653 gull = strtouq(s, 0, 10);
19654 if (!((gull == eull) && (errno == een)))
19658 check(" 1", 1LL, 0);
19659 check(" 0", 0LL, 0);
19660 check("18446744073709551615", 18446744073709551615ULL, 0);
19661 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19662 #if 0 /* strtouq() for /^-/ strings is undefined. */
19663 check("-1", 18446744073709551615ULL, 0);
19664 check("-18446744073709551614", 2LL, 0);
19665 check("-18446744073709551615", 1LL, 0);
19666 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19667 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19675 if eval $compile; then
19676 case "`$run ./try`" in
19677 ok) echo "Your strtouq() seems to be working okay." ;;
19679 Your strtouq() doesn't seem to be working okay.
19685 echo "(I can't seem to compile the test program--assuming it doesn't)"
19691 : see if strxfrm exists
19692 set strxfrm d_strxfrm
19695 : see if symlink exists
19696 set symlink d_symlink
19699 : see if syscall exists
19700 set syscall d_syscall
19703 : see if prototype for syscall is available
19705 set d_syscallproto syscall $i_unistd unistd.h
19708 : see if sysconf exists
19709 set sysconf d_sysconf
19712 : see if system exists
19713 set system d_system
19716 : see if tcgetpgrp exists
19717 set tcgetpgrp d_tcgetpgrp
19720 : see if tcsetpgrp exists
19721 set tcsetpgrp d_tcsetpgrp
19724 : see if prototype for telldir is available
19726 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19729 : see if tgamma exists
19730 set tgamma d_tgamma
19733 : see if time exists
19735 if test "X$d_time" = X -o X"$timetype" = X; then
19736 if set time val -f d_time; eval $csym; $val; then
19737 echo 'time() found.' >&4
19739 rp="What is the type returned by time() on this system?"
19740 set time_t timetype long stdio.h sys/types.h
19743 echo 'time() not found, hope that will do.' >&4
19751 : see if timegm exists
19752 set timegm d_timegm
19755 : see if this is a sys/times.h system
19756 set sys/times.h i_systimes
19759 : see if times exists
19761 if set times val -f d_times; eval $csym; $val; then
19762 echo 'times() found.' >&4
19765 case "$i_systimes" in
19766 "$define") inc='sys/times.h';;
19768 rp="What is the type returned by times() on this system?"
19769 set clock_t clocktype long stdio.h sys/types.h $inc
19772 echo 'times() NOT found, hope that will do.' >&4
19777 : see if tmpnam_r exists
19778 set tmpnam_r d_tmpnam_r
19780 case "$d_tmpnam_r" in
19782 hdrs="$i_systypes sys/types.h define stdio.h "
19783 case "$d_tmpnam_r_proto:$usethreads" in
19784 ":define") d_tmpnam_r_proto=define
19785 set d_tmpnam_r_proto tmpnam_r $hdrs
19789 case "$d_tmpnam_r_proto" in
19791 case "$tmpnam_r_proto" in
19792 ''|0) try='char* tmpnam_r(char*);'
19793 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19795 case "$tmpnam_r_proto" in
19796 ''|0) d_tmpnam_r=undef
19798 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19799 * ) case "$tmpnam_r_proto" in
19800 REENTRANT_PROTO*) ;;
19801 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19803 echo "Prototype: $try" ;;
19806 *) case "$usethreads" in
19807 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19814 *) tmpnam_r_proto=0
19818 : see if trunc exists
19822 : see if truncate exists
19823 set truncate d_truncate
19826 : see if ttyname_r exists
19827 set ttyname_r d_ttyname_r
19829 case "$d_ttyname_r" in
19831 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19832 case "$d_ttyname_r_proto:$usethreads" in
19833 ":define") d_ttyname_r_proto=define
19834 set d_ttyname_r_proto ttyname_r $hdrs
19838 case "$d_ttyname_r_proto" in
19840 case "$ttyname_r_proto" in
19841 ''|0) try='int ttyname_r(int, char*, size_t);'
19842 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19844 case "$ttyname_r_proto" in
19845 ''|0) try='int ttyname_r(int, char*, int);'
19846 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19848 case "$ttyname_r_proto" in
19849 ''|0) try='char* ttyname_r(int, char*, int);'
19850 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19852 case "$ttyname_r_proto" in
19853 ''|0) d_ttyname_r=undef
19855 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19856 * ) case "$ttyname_r_proto" in
19857 REENTRANT_PROTO*) ;;
19858 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19860 echo "Prototype: $try" ;;
19863 *) case "$usethreads" in
19864 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19871 *) ttyname_r_proto=0
19875 : see if tzname[] exists
19877 if set tzname val -a d_tzname; eval $csym; $val; then
19879 echo 'tzname[] found.' >&4
19882 echo 'tzname[] NOT found.' >&4
19887 : Check if is a multiplatform env
19889 darwin) multiarch="$define" ;;
19891 case "$multiarch" in
19892 ''|[nN]*) multiarch="$undef" ;;
19895 : check for ordering of bytes in a UV
19897 case "$multiarch" in
19900 You seem to be doing a multiarchitecture build,
19901 skipping the byteorder check.
19907 case "$byteorder" in
19910 In the following, larger digits indicate more significance. A big-endian
19911 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19912 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19913 machines may have weird orders like 3412. A Cray will report 87654321,
19914 an Alpha will report 12345678. If the test program works the default is
19916 I'm now running the test program...
19920 #$i_stdlib I_STDLIB
19922 #include <stdlib.h>
19924 #include <sys/types.h>
19925 typedef $uvtype UV;
19935 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19937 u.l = (UV)0x04030201;
19938 for (i = 0; i < $uvsize; i++)
19939 printf("%c", u.c[i]+'0');
19946 if eval $compile && $run ./try > /dev/null; then
19949 [1-4][1-4][1-4][1-4]|12345678|87654321)
19950 echo "(The test program ran ok.)"
19951 echo "byteorder=$dflt"
19954 ????|????????) echo "(The test program ran ok.)" ;;
19955 *) echo "(The test program didn't run right for some reason.)" ;;
19960 (I can't seem to compile the test program. Guessing big-endian...)
19963 case "$xxx_prompt" in
19965 rp="What is the order of bytes in $uvtype?"
19978 : Checking 32bit alignedness
19981 Checking to see whether you can access character data unalignedly...
19983 case "$d_u32align" in
19984 '') $cat >try.c <<EOCP
19986 #$i_stdlib I_STDLIB
19988 #include <stdlib.h>
19990 #define U32 $u32type
19991 #define BYTEORDER 0x$byteorder
19993 #include <signal.h>
19995 $signal_t bletch(int s) { exit(4); }
19998 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19999 volatile U8 buf[8];
20003 if (sizeof(U32) != 4) {
20004 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20011 signal(SIGBUS, bletch);
20023 for (i = 0; i < 4; i++) {
20024 up = (U32*)(buf + i);
20025 if (! ((*up == 1 << (8*i)) || /* big-endian */
20026 (*up == 1 << (8*(3-i))) /* little-endian */
20030 printf("read failed (%x)\n", *up);
20036 for (i = 0; i < 4; i++) {
20037 up = (U32*)(buf + i);
20039 if (*up != 0xBeef) {
20040 printf("write failed (%x)\n", *up);
20054 if eval $compile_ok; then
20055 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20056 $run ./try 2>&1 >/dev/null
20059 You can access character data pretty unalignedly.
20061 d_u32align="$undef"
20064 It seems that you must access character data in an aligned manner.
20066 d_u32align="$define"
20070 rp='Can you access character data at unaligned addresses?'
20074 [yY]*) d_u32align="$undef" ;;
20075 *) d_u32align="$define" ;;
20082 : see if ualarm exists
20083 set ualarm d_ualarm
20086 : see if umask exists
20090 : see if unordered exists
20091 set unordered d_unordered
20094 : see if unsetenv exists
20095 set unsetenv d_unsetenv
20098 : see if usleep exists
20099 set usleep d_usleep
20102 : see if prototype for usleep is available
20104 set d_usleepproto usleep $i_unistd unistd.h
20107 : see if ustat exists
20111 : see if closedir exists
20112 set closedir d_closedir
20115 case "$d_closedir" in
20118 echo "Checking whether closedir() returns a status..." >&4
20120 #$i_dirent I_DIRENT /**/
20121 #$i_sysdir I_SYS_DIR /**/
20122 #$i_sysndir I_SYS_NDIR /**/
20123 #$i_systypes I_SYS_TYPES /**/
20125 #if defined(I_SYS_TYPES)
20126 #include <sys/types.h>
20128 #if defined(I_DIRENT)
20129 #include <dirent.h>
20132 #include <sys/ndir.h>
20136 #include <ndir.h> /* may be wrong in the future */
20138 #include <sys/dir.h>
20143 int main() { return closedir(opendir(".")); }
20146 if eval $compile_ok; then
20147 if $run ./try > /dev/null 2>&1 ; then
20148 echo "Yes, it does."
20151 echo "No, it doesn't."
20155 echo "(I can't seem to compile the test program--assuming it doesn't)"
20163 set d_void_closedir
20167 : see if there is a wait4
20171 : see if waitpid exists
20172 set waitpid d_waitpid
20177 $cat >try.c <<'EOCP'
20183 return (wcscmp (s, s) ? 1 : 0);
20188 if eval $compile; then
20191 0) echo "A working wcscmp() found." >&4
20193 *) echo "wcscmp() found, but it doesn't work" >&4
20197 echo "wcscmp() NOT found." >&4
20203 : see if wcstombs exists
20204 set wcstombs d_wcstombs
20209 $cat >try.c <<'EOCP'
20214 wchar_t dst[4], *src = L" ";
20216 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20221 if eval $compile; then
20224 0) echo "A working wcsxfrm() found." >&4
20226 *) echo "wcsxfrm() found, but it doesn't work" >&4
20230 echo "wcsxfrm() NOT found." >&4
20236 : see if wctomb exists
20237 set wctomb d_wctomb
20240 : see if writev exists
20241 set writev d_writev
20244 : check for alignment requirements
20246 case "$alignbytes" in
20247 '') echo "Checking alignment constraints..." >&4
20256 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20261 if eval $compile_ok; then
20265 echo "(I can't seem to compile the test program...)"
20267 case "$multiarch" in
20269 : The usual safe value is 8, but Darwin with -Duselongdouble
20270 : needs 16. Hence, we will take 8 as a minimum, but allow
20271 : Configure to pick a larger value if needed.
20272 if $test "$dflt" -lt 8; then
20274 echo "Setting alignment to 8 for multiarch support.">&4
20279 *) dflt="$alignbytes"
20282 rp="Doubles must be aligned on a how-many-byte boundary?"
20287 : set the base revision
20290 : length of character in bytes. Is always 1, otherwise it is not C
20291 : This used to be a test using sizeof
20294 : Check for the number of bits in a character
20295 case "$charbits" in
20296 '') echo "Checking how long a character is (in bits)..." >&4
20303 for (c = 1, n = 0; c; c <<= 1, n++) ;
20304 printf ("%d\n", n);
20309 if eval $compile_ok; then
20313 echo "(I can't seem to compile the test program. Guessing...)"
20320 rp="What is the length of a character (in bits)?"
20324 case "$charbits" in
20327 Your system has an unsigned character size of $charbits bits, which
20328 is rather unusual (normally it is 8 bits). Perl likely will not work
20329 correctly on your system, with subtle bugs in various places.
20331 rp='Do you really want to continue?'
20335 [yY]) echo >&4 "Okay, continuing." ;;
20340 : how do we concatenate cpp tokens here?
20342 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20343 $cat >cpp_stuff.c <<'EOCP'
20344 #define RCAT(a,b)a/**/b
20345 #define ACAT(a,b)a ## b
20349 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20350 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20351 echo "Oh! Smells like ANSI's been here." >&4
20352 echo "We can catify or stringify, separately or together!"
20354 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20355 echo "Ah, yes! The good old days!" >&4
20356 echo "However, in the good old days we don't know how to stringify and"
20357 echo "catify at the same time."
20361 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20362 You're going to have to edit the values of CAT[2-5] in config.h...
20364 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20368 : see if this is a db.h system
20374 : Check db version.
20376 echo "Checking Berkeley DB version ..." >&4
20382 #include <sys/types.h>
20384 #$i_stdlib I_STDLIB
20386 #include <stdlib.h>
20389 int main(int argc, char *argv[])
20391 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20392 int Major, Minor, Patch ;
20393 unsigned long Version ;
20394 (void)db_version(&Major, &Minor, &Patch) ;
20396 printf("%d %d %d %d %d %d\n",
20397 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20398 Major, Minor, Patch);
20401 printf("You have Berkeley DB Version 2 or greater.\n");
20403 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20404 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20405 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20406 Major, Minor, Patch) ;
20408 /* check that db.h & libdb are compatible */
20409 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20410 printf("db.h and libdb are incompatible.\n") ;
20414 printf("db.h and libdb are compatible.\n") ;
20416 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20417 + DB_VERSION_PATCH ;
20419 /* needs to be >= 2.3.4 */
20420 if (Version < 2003004) {
20421 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20422 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20428 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20433 printf("You have Berkeley DB Version 1.\n");
20434 exit(0); /* DB version < 2: the coast is clear. */
20436 exit(1); /* <db.h> not Berkeley DB? */
20442 if eval $compile_ok && $run ./try; then
20443 echo 'Looks OK.' >&4
20445 db_version_major=$1
20446 db_version_minor=$2
20447 db_version_patch=$3
20449 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20453 : Remove db from list of libraries to use
20454 echo "Removing unusable -ldb from library list" >&4
20455 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20458 echo "libs = $libs" >&4
20468 : Check the return type needed for hash
20470 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20476 #include <sys/types.h>
20479 #ifndef DB_VERSION_MAJOR
20480 u_int32_t hash_cb (const void* ptr, size_t size)
20486 info.hash = hash_cb;
20490 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20491 if $contains warning try.out >>/dev/null 2>&1 ; then
20494 db_hashtype='u_int32_t'
20497 : XXX Maybe we should just give up here.
20498 db_hashtype=u_int32_t
20500 echo "Help: I can't seem to compile the db test program." >&4
20501 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20504 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20506 *) db_hashtype=u_int32_t
20511 : Check the return type needed for prefix
20513 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20519 #include <sys/types.h>
20522 #ifndef DB_VERSION_MAJOR
20523 size_t prefix_cb (const DBT *key1, const DBT *key2)
20529 info.prefix = prefix_cb;
20533 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20534 if $contains warning try.out >>/dev/null 2>&1 ; then
20535 db_prefixtype='int'
20537 db_prefixtype='size_t'
20540 db_prefixtype='size_t'
20541 : XXX Maybe we should just give up here.
20543 echo "Help: I can't seem to compile the db test program." >&4
20544 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20547 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20549 *) db_prefixtype='size_t'
20553 : Check what kind of inf/nan your system has
20554 $echo "Checking the kind of infinities and nans you have..." >&4
20555 $echo "(The following tests may crash. That's okay.)" >&4
20557 #define DOUBLESIZE $doublesize
20558 #$d_longdbl HAS_LONG_DOUBLE
20559 #ifdef HAS_LONG_DOUBLE
20560 #define LONGDBLSIZE $longdblsize
20561 #define LONGDBLKIND $longdblkind
20568 /* Note that whether the sign bit is on or off
20569 * for NaN depends on the CPU/FPU, and possibly
20570 * can be affected by the build toolchain.
20572 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20573 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20574 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20575 * (respectively) as opposed to the more usual
20576 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20578 static void bytes(unsigned char *p, unsigned int n) {
20580 for (i = 0; i < n; i++) {
20581 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20584 int main(int argc, char *argv[]) {
20585 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20586 * because some compilers are 'smart' and not only warn but refuse to
20587 * compile such 'illegal' values. */
20588 double dinf = exp(1e9);
20589 double dnan = sqrt(-1.0);
20590 #ifdef HAS_LONG_DOUBLE
20591 long double ldinf = (long double)exp(1e9);
20592 long double ldnan = (long double)sqrt(-1.0);
20595 switch (argv[1][0]) {
20596 case '1': bytes(&dinf, sizeof(dinf)); break;
20597 case '2': bytes(&dnan, sizeof(dnan)); break;
20598 #ifdef HAS_LONG_DOUBLE
20599 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20600 /* the 80-bit long doubles might have garbage in their excess bytes */
20601 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20603 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20604 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20612 if eval $compile; then
20613 doubleinfbytes=`$run ./try 1`
20614 doublenanbytes=`$run ./try 2`
20615 case "$d_longdbl" in
20617 longdblinfbytes=`$run ./try 3`
20618 longdblnanbytes=`$run ./try 4`
20622 # Defaults in case the above test program failed.
20623 case "$doublekind" in
20624 1) # IEEE 754 32-bit LE
20625 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20626 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20628 2) # IEEE 754 32-bit BE
20629 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20630 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20632 3) # IEEE 754 64-bit LE
20633 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20634 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20636 4) # IEEE 754 64-bit BE
20637 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20638 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20640 5) # IEEE 754 128-bit LE
20641 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20642 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20644 6) # IEEE 754 128-bit BE
20645 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20646 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20648 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20649 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20650 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20652 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20653 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20654 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20657 doubleinfbytes=$undef
20658 doublenanbytes=$undef
20661 case "$longdblkind" in
20662 1) # IEEE 754 128-bit LE
20663 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20664 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20666 2) # IEEE 754 128-bit BE
20667 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20668 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20670 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20671 case "$longdblsize" in
20672 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20673 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20674 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20677 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20678 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20681 longdblinfbytes=$undef
20682 longdblnanbytes=$undef
20686 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20687 case "$longdblsize" in
20688 12) # 32-bit system
20689 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20690 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20692 16) # 64-bit system
20693 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20694 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20697 longdblinfbytes=$undef
20698 longdblnanbytes=$undef
20702 5) # 128-bit LE-LE "double double"
20703 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20704 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20706 6) # 128-bit BE-BE "double double"
20707 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20708 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20710 7) # 128-bit LE-BE "double double"
20711 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20712 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20714 8) # 128-bit BE-LE "double double"
20715 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20716 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20719 longdblinfbytes=$undef
20720 longdblnanbytes=$undef
20726 : Check the length of the double mantissa
20727 $echo "Checking how many mantissa bits your doubles have..." >&4
20730 #$i_sunmath I_SUNMATH
20732 # include <float.h>
20735 # include <sunmath.h>
20737 #ifdef DBL_MANT_DIG
20738 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20741 int main(int argc, char *argv[]) {
20743 printf("%d\n", BITS);
20749 if eval $compile; then
20750 doublemantbits=`$run ./try`
20752 doublemantbits="$undef"
20756 : Check the length of the longdouble mantissa
20757 $echo "Checking how many mantissa bits your long doubles have..." >&4
20760 #$i_sunmath I_SUNMATH
20762 # include <float.h>
20765 # include <sunmath.h>
20767 #$d_longdbl HAS_LONG_DOUBLE
20768 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20769 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20770 /* This format has no implicit bit. Beware, however, that for
20771 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20772 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20773 * and the top bit must have been one since 387, zero is plain invalid.
20774 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20775 # define BITS LDBL_MANT_DIG
20776 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20777 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20778 * reason e.g. Irix thinks 107. But in any case, we want only
20779 * the number of real bits, the implicit bits are of no interest. */
20780 # define BITS 2 * (DBL_MANT_DIG - 1)
20782 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20786 int main(int argc, char *argv[]) {
20788 printf("%d\n", BITS);
20794 if eval $compile; then
20795 longdblmantbits=`$run ./try`
20797 longdblmantbits="$undef"
20801 : Check the length of the NV mantissa
20802 $echo "Checking how many mantissa bits your NVs have..." >&4
20803 if test "X$usequadmath" = "X$define"; then
20804 nvmantbits=112 # 128-1-15
20806 if test "X$nvsize" = "X$doublesize"; then
20807 nvmantbits="$doublemantbits"
20809 if test "X$nvsize" = "X$longdblsize"; then
20810 nvmantbits="$longdblmantbits"
20812 nvmantbits="$undef"
20817 : How can we generate normalized random numbers ?
20819 echo "Using our internal random number implementation..." >&4
20822 *-Dmy_rand=*|*-Dmy_srand=*)
20823 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20824 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20825 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20826 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20830 randfunc=Perl_drand48
20831 drand01="Perl_drand48()"
20832 seedfunc="Perl_drand48_init"
20836 : Probe whether dtrace builds an object, as newer Illumos requires an input
20837 : object file that uses at least one of the probes defined in the .d file
20838 case "$usedtrace" in
20840 case "$dtraceobject" in
20841 $define|true|[yY]*)
20842 dtraceobject=$define
20845 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20847 #include "perldtrace.h"
20849 PERL_LOADED_FILE("dummy");
20853 dtraceobject=$undef
20854 if $cc -c -o try.o $optimize $ccflags try.c \
20855 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
20856 dtraceobject=$define
20857 echo "Your dtrace builds an object file"
20859 $rm -f try.c try.o perldtrace.o
20861 *) dtraceobject=$undef ;;
20865 : Determine if this is an EBCDIC system
20867 echo "Determining whether or not we are on an EBCDIC system..." >&4
20868 $cat >try.c <<'EOM'
20871 if ('M'==0xd4) return 0;
20878 if eval $compile_ok; then
20879 if $run ./try; then
20880 echo "You seem to speak EBCDIC." >&4
20883 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20886 echo "I'm unable to compile the test program." >&4
20887 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20893 : Check how to flush
20896 Checking how to flush all pending stdio output...
20898 # I only know how to find the first 32 possibly open files on SunOS.
20899 # See also hints/sunos_4_1.sh and util.c --AD
20901 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20903 $cat >>try.c <<EOCP
20905 #$i_stdlib I_STDLIB
20907 #include <stdlib.h>
20909 #$i_unistd I_UNISTD
20911 # include <unistd.h>
20913 #$d_sysconf HAS_SYSCONF
20914 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20915 #ifdef HAS_STDIO_STREAM_ARRAY
20916 # define STDIO_STREAM_ARRAY $stdio_stream_array
20921 p = fopen("try.out", "w");
20925 # ifdef TRY_FPRINTF
20929 #ifdef TRY_FFLUSH_NULL
20932 #ifdef TRY_FFLUSH_ALL
20934 long open_max = -1;
20935 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20936 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20938 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20939 open_max = sysconf(_SC_OPEN_MAX);
20942 open_max = FOPEN_MAX;
20945 open_max = OPEN_MAX;
20954 # ifdef HAS_STDIO_STREAM_ARRAY
20955 if (open_max > 0) {
20957 for (i = 0; i < open_max; i++)
20958 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20959 STDIO_STREAM_ARRAY[i]._file < open_max &&
20960 STDIO_STREAM_ARRAY[i]._flag)
20961 fflush(&STDIO_STREAM_ARRAY[i]);
20969 : first we have to find out how _not_ to flush
20971 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20973 set try -DTRY_FPUTC
20974 if eval $compile; then
20975 $run ./try 2>/dev/null
20978 if $test ! -s try.out -a "X$code" = X42; then
20984 set try -DTRY_FPRINTF
20985 if eval $compile; then
20986 $run ./try 2>/dev/null
20989 if $test ! -s try.out -a "X$code" = X42; then
20990 output=-DTRY_FPRINTF
20996 : check for fflush NULL behavior
20997 case "$fflushNULL" in
20998 '') set try -DTRY_FFLUSH_NULL $output
20999 if eval $compile; then
21000 $run ./try 2>/dev/null
21003 if $test -s try.out -a "X$code" = X42; then
21004 fflushNULL="`$cat try.out`"
21006 if $test "X$code" != X42; then
21008 (If this test failed, don't worry, we'll try another method shortly.)
21013 $rm -f core try.core core.try.*
21014 case "$fflushNULL" in
21016 Your fflush(NULL) works okay for output streams.
21017 Let's see if it clobbers input pipes...
21019 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21020 # bug that improperly flushes the input end of pipes. So we avoid the
21021 # autoflush on fork/system/exec support for now. :-(
21022 $cat >tryp.c <<EOCP
21025 main(int argc, char **argv)
21031 while ((i = getc(stdin)) != -1
21032 && (*bp++ = i) != '\n'
21033 && bp < &buf[1024])
21036 fprintf(stdout, "%s", buf);
21044 fflushNULL="$define"
21046 if eval $compile; then
21048 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21049 if $test "X$targethost" != X; then
21052 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21054 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21056 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21058 fflush(NULL) seems to behave okay with input streams.
21060 fflushNULL="$define"
21063 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21065 fflushNULL="$undef"
21068 $rm -f core tryp.c tryp.core core.tryp.*
21071 Your fflush(NULL) isn't working (contrary to ANSI C).
21073 fflushNULL="$undef"
21076 Cannot figure out whether your fflush(NULL) works or not.
21077 I'm assuming it doesn't (contrary to ANSI C).
21079 fflushNULL="$undef"
21083 $define|true|[yY]*)
21084 fflushNULL="$define"
21087 fflushNULL="$undef"
21090 : check explicit looping only if NULL did not work, and if the pipe
21091 : bug does not show up on an explicit flush too
21092 case "$fflushNULL" in
21094 $cat >tryp.c <<EOCP
21097 main(int argc, char **argv)
21103 while ((i = getc(stdin)) != -1
21104 && (*bp++ = i) != '\n'
21105 && bp < &buf[1024])
21108 fprintf(stdout, "%s", buf);
21117 if eval $compile; then
21119 if $test "X$targethost" != X; then
21122 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21124 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21126 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21128 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21130 : now check for fflushall behaviour
21131 case "$fflushall" in
21132 '') set try -DTRY_FFLUSH_ALL $output
21133 if eval $compile; then
21135 (Now testing the other method--but note that this also may fail.)
21137 $run ./try 2>/dev/null
21140 if $test -s try.out -a "X$code" = X42; then
21141 fflushall="`$cat try.out`"
21145 case "$fflushall" in
21147 Whew. Flushing explicitly all the stdio streams works.
21149 fflushall="$define"
21152 Sigh. Flushing explicitly all the stdio streams doesn't work.
21157 Cannot figure out whether flushing stdio streams explicitly works or not.
21158 I'm assuming it doesn't.
21164 "$define"|true|[yY]*)
21165 fflushall="$define"
21173 All is futile. Even fflush(stdin) clobbers input pipes!
21180 $rm -f core tryp.c tryp.core core.tryp.*
21182 *) fflushall="$undef"
21186 case "$fflushNULL$fflushall" in
21189 OK, I give up. I cannot figure out how to flush pending stdio output.
21190 We won't be flushing handles at all before fork/exec/popen.
21196 : Store the full pathname to the ar program for use in the C program
21197 : Respect a hint or command line value for full_ar.
21202 : Store the full pathname to the sed program for use in the C program
21205 : see what type gids are declared as in the kernel
21207 echo "Looking for the type for group ids returned by getgid()."
21208 set gid_t gidtype xxx stdio.h sys/types.h
21212 xxx=`./findhdr sys/user.h`
21213 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21215 unsigned) dflt="$1 $2" ;;
21219 *) dflt="$gidtype";;
21222 gid_t) echo "gid_t found." ;;
21223 *) rp="What is the type for group ids returned by getgid()?"
21229 : Check the size of GID
21232 *_t) zzz="$gidtype" ;;
21235 echo "Checking the size of $zzz..." >&4
21237 #include <sys/types.h>
21239 #$i_stdlib I_STDLIB
21241 #include <stdlib.h>
21244 printf("%d\n", (int)sizeof($gidtype));
21249 if eval $compile_ok; then
21253 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21256 echo "Your $zzz is $gidsize bytes long."
21261 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21265 : Check if GID is signed
21268 *_t) zzz="$gidtype" ;;
21271 echo "Checking the sign of $zzz..." >&4
21273 #include <sys/types.h>
21284 if eval $compile; then
21288 echo "(I can't execute the test program--guessing unsigned.)" >&4
21292 1) echo "Your $zzz is unsigned." ;;
21293 -1) echo "Your $zzz is signed." ;;
21299 echo "(I can't compile the test program--guessing unsigned.)" >&4
21303 : Check 64bit sizes
21306 if $test X"$quadtype" != X; then
21308 echo "Checking how to print 64-bit integers..." >&4
21310 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21311 $cat >try.c <<'EOCP'
21312 #include <sys/types.h>
21315 int q = 12345678901;
21316 printf("%ld\n", q);
21320 if eval $compile; then
21324 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21325 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21326 echo "We will use %d."
21332 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21333 $cat >try.c <<'EOCP'
21334 #include <sys/types.h>
21337 long q = 12345678901;
21338 printf("%ld\n", q);
21342 if eval $compile; then
21346 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21347 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21348 echo "We will use %ld."
21354 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21355 $cat >try.c <<'EOCP'
21356 #include <sys/types.h>
21357 #include <inttypes.h>
21360 int64_t q = 12345678901;
21361 printf("%" PRId64 "\n", q);
21365 if eval $compile; then
21369 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21370 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21371 echo "We will use the C9X style."
21377 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21379 #include <sys/types.h>
21382 $quadtype q = 12345678901;
21383 printf("%Ld\n", q);
21387 if eval $compile; then
21391 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21392 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21393 echo "We will use %Ld."
21399 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21400 $cat >try.c <<'EOCP'
21401 #include <sys/types.h>
21404 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21405 printf("%lld\n", q);
21409 if eval $compile; then
21413 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21414 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21415 echo "We will use the %lld style."
21421 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21423 #include <sys/types.h>
21426 $quadtype q = 12345678901;
21427 printf("%qd\n", q);
21431 if eval $compile; then
21435 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21436 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21437 echo "We will use %qd."
21443 if $test X"$sPRId64" = X; then
21444 echo "Cannot figure out how to print 64-bit integers." >&4
21451 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21452 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21454 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21455 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21459 : Check format strings for internal types
21461 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21463 if $test X"$ivsize" = X8; then
21464 ivdformat="$sPRId64"
21465 uvuformat="$sPRIu64"
21466 uvoformat="$sPRIo64"
21467 uvxformat="$sPRIx64"
21468 uvXUformat="$sPRIXU64"
21470 if $test X"$ivsize" = X"$longsize"; then
21477 if $test X"$ivsize" = X"$intsize"; then
21485 if $test X"$ivsize" = X"$shortsize"; then
21496 if $test X"$usequadmath" = X"$define"; then
21504 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21505 nveformat="$sPRIeldbl"
21506 nvfformat="$sPRIfldbl"
21507 nvgformat="$sPRIgldbl"
21508 nvEUformat="$sPRIEUldbl"
21509 nvFUformat="$sPRIFUldbl"
21510 nvGUformat="$sPRIGUldbl"
21521 case "$ivdformat" in
21522 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21527 : Check format string for GID
21530 $echo "Checking the format string to be used for gids..." >&4
21533 -1) if $test X"$gidsize" = X"$ivsize"; then
21534 gidformat="$ivdformat"
21536 if $test X"$gidsize" = X"$longsize"; then
21539 if $test X"$gidsize" = X"$intsize"; then
21542 if $test X"$gidsize" = X"$shortsize"; then
21549 *) if $test X"$gidsize" = X"$uvsize"; then
21550 gidformat="$uvuformat"
21552 if $test X"$gidsize" = X"$longsize"; then
21555 if $test X"$gidsize" = X"$intsize"; then
21558 if $test X"$gidsize" = X"$shortsize"; then
21567 : see if getgroups exists
21568 set getgroups d_getgrps
21571 : see if setgroups exists
21572 set setgroups d_setgrps
21575 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21577 case "$d_getgrps$d_setgrps" in
21579 case "$groupstype" in
21580 '') dflt="$gidtype" ;;
21581 *) dflt="$groupstype" ;;
21584 What type of pointer is the second argument to getgroups() and setgroups()?
21585 Usually this is the same as group ids, $gidtype, but not always.
21588 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21592 *) groupstype="$gidtype";;
21595 : check whether make sets MAKE
21597 echo "Checking if your $make program sets \$(MAKE)..." >&4
21598 case "$make_set_make" in
21600 $sed 's/^X //' > testmake.mak << 'EOF'
21602 X @echo 'maketemp="$(MAKE)"'
21604 case "`$make -f testmake.mak 2>/dev/null`" in
21605 *maketemp=*) make_set_make='#' ;;
21606 *) make_set_make="MAKE=$make" ;;
21608 $rm -f testmake.mak
21611 case "$make_set_make" in
21612 '#') echo "Yup, it does.";;
21613 *) echo "Nope, it doesn't.";;
21616 : see what type is used for mode_t
21617 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21618 set mode_t modetype int stdio.h sys/types.h
21621 : see if we need va_copy
21623 case "$i_stdarg" in
21626 #include <stdarg.h>
21628 #$i_stdlib I_STDLIB
21630 #include <stdlib.h>
21632 #include <signal.h>
21635 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21637 return vfprintf(f, fmt, *valp);
21641 myvfprintf(FILE *f, const char *fmt, va_list val)
21643 return ivfprintf(f, fmt, &val);
21647 myprintf(char *fmt, ...)
21650 va_start(val, fmt);
21651 return myvfprintf(stdout, fmt, val);
21655 main(int ac, char **av)
21657 signal(SIGSEGV, exit);
21659 myprintf("%s%cs all right, then\n", "that", '\'');
21664 if eval $compile && $run ./try 2>&1 >/dev/null; then
21665 case "`$run ./try`" in
21666 "that's all right, then")
21672 yes) echo "It seems that you don't need va_copy()." >&4
21673 need_va_copy="$undef"
21675 *) echo "It seems that va_copy() or similar will be needed." >&4
21676 need_va_copy="$define"
21681 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21682 need_va_copy="$undef"
21686 : see what type is used for size_t
21687 rp="What is the type used for the length parameter for string functions?"
21688 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21691 : check for type of arguments to gethostbyaddr.
21692 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21693 case "$d_gethbyaddr" in
21697 Checking to see what type of arguments are accepted by gethostbyaddr().
21699 hdrs="$define sys/types.h
21700 $d_socket sys/socket.h
21701 $i_niin netinet/in.h
21703 $i_unistd unistd.h"
21704 : The first arg can 'char *' or 'void *'
21705 : The second arg is some of integral type
21706 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21707 for yyy in size_t long int; do
21708 case "$netdb_host_type" in
21709 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21710 if ./protochk "$try" $hdrs; then
21711 echo "Your system accepts $xxx for the first arg."
21712 echo "...and $yyy for the second arg."
21713 netdb_host_type="$xxx"
21714 netdb_hlen_type="$yyy"
21720 : In case none of those worked, prompt the user.
21721 case "$netdb_host_type" in
21722 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21725 netdb_host_type=$ans
21726 rp='What is the type for the 2nd argument to gethostbyaddr?'
21729 netdb_hlen_type=$ans
21733 *) : no gethostbyaddr, so pick harmless defaults
21734 netdb_host_type='char *'
21735 netdb_hlen_type="$sizetype"
21738 # Remove the "const" if needed. -- but then we'll have a
21740 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21743 : check for type of argument to gethostbyname.
21744 if test "X$netdb_name_type" = X ; then
21745 case "$d_gethbyname" in
21749 Checking to see what type of argument is accepted by gethostbyname().
21751 hdrs="$define sys/types.h
21752 $d_socket sys/socket.h
21753 $i_niin netinet/in.h
21755 $i_unistd unistd.h"
21756 for xxx in "const char *" "char *"; do
21757 case "$netdb_name_type" in
21758 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21759 if ./protochk "$try" $hdrs; then
21760 echo "Your system accepts $xxx."
21761 netdb_name_type="$xxx"
21766 : In case none of those worked, prompt the user.
21767 case "$netdb_name_type" in
21768 '') rp='What is the type for the 1st argument to gethostbyname?'
21771 netdb_name_type=$ans
21775 *) : no gethostbyname, so pick harmless default
21776 netdb_name_type='char *'
21781 : check for type of 1st argument to getnetbyaddr.
21782 if test "X$netdb_net_type" = X ; then
21783 case "$d_getnbyaddr" in
21787 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21789 hdrs="$define sys/types.h
21790 $d_socket sys/socket.h
21791 $i_niin netinet/in.h
21793 $i_unistd unistd.h"
21794 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21795 case "$netdb_net_type" in
21796 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21797 if ./protochk "$try" $hdrs; then
21798 echo "Your system accepts $xxx."
21799 netdb_net_type="$xxx"
21804 : In case none of those worked, prompt the user.
21805 case "$netdb_net_type" in
21806 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21809 netdb_net_type=$ans
21813 *) : no getnetbyaddr, so pick harmless default
21814 netdb_net_type='long'
21818 : locate the preferred pager for this system
21825 [a-zA-Z]:/*) dflt=$pg;;
21829 [a-zA-Z]:/*) dflt=$more;;
21833 [a-zA-Z]:/*) dflt=$less;;
21836 '') dflt=/usr/ucb/more;;
21844 rp='What pager is used on your system?'
21848 : see if ar generates random libraries by itself
21850 echo "Checking how to generate random libraries on your machine..." >&4
21851 echo 'int bar1() { return bar2(); }' > bar1.c
21852 echo 'int bar2() { return 2; }' > bar2.c
21854 #$i_stdlib I_STDLIB
21856 #include <stdlib.h>
21858 int main() { printf("%d\n", bar1()); exit(0); }
21860 $cc $ccflags -c bar1.c >/dev/null 2>&1
21861 $cc $ccflags -c bar2.c >/dev/null 2>&1
21862 $cc $ccflags -c foo.c >/dev/null 2>&1
21863 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21864 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21865 $run ./foobar >/dev/null 2>&1; then
21866 echo "$ar appears to generate random libraries itself."
21868 if [ "X$ranlib" = "X" ]; then
21871 elif $ar s bar$_a >/dev/null 2>&1 &&
21872 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21873 $run ./foobar >/dev/null 2>&1; then
21874 echo "a table of contents needs to be added with '$ar s'."
21877 elif $ar ts bar$_a >/dev/null 2>&1 &&
21878 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21879 $run ./foobar >/dev/null 2>&1; then
21880 echo "a table of contents needs to be added with '$ar ts'."
21887 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21888 $test -f $ranlib || ranlib=''
21891 if $test -n "$ranlib"; then
21892 echo "your system has '$ranlib'; we'll use that."
21895 echo "your system doesn't seem to support random libraries"
21896 echo "so we'll use lorder and tsort to order the libraries."
21903 : see if this is a values.h system
21904 set values.h i_values
21907 : Check the max offset that gmtime and localtime accept
21908 echo "Checking max offsets that gmtime () accepts"
21911 define) yyy="#include <values.h>" ;;
21915 case "$sGMTIME_min/$sGMTIME_max" in
21918 #include <sys/types.h>
21927 void gm_check (time_t t, int min_year, int max_year)
21930 if ( tmp == NULL ||
21931 /* Check tm_year overflow */
21932 tmp->tm_year < min_year || tmp->tm_year > max_year)
21943 gm_check (MAXLONG, 69, 0x7fffffff);
21945 if (tmp == NULL || tmp->tm_year < 0) {
21946 for (i = 63; i >= 0; i--) {
21947 time_t x = pt | ((time_t)1 << i);
21948 if (x < 0 || x < pt) continue;
21949 gm_check (x, 69, 0x7fffffff);
21952 printf ("sGMTIME_max=%ld\n", pt);
21961 gm_check (MINLONG, -1900, 70);
21964 for (i = 36; i >= 0; i--) {
21965 time_t x = pt - ((time_t)1 << i);
21966 if (x > 0) continue;
21967 gm_check (x, -1900, 70);
21970 printf ("sGMTIME_min=%ld\n", pt);
21974 int main (int argc, char *argv[])
21976 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21983 if eval $compile; then
21984 eval `$run ./try 2>/dev/null`
21986 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21992 echo "Checking max offsets that localtime () accepts"
21994 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21997 #include <sys/types.h>
22006 void local_check (time_t t, int min_year, int max_year)
22008 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22011 tmp = localtime (&t);
22012 if ( tmp == NULL ||
22013 /* Check tm_year overflow */
22014 tmp->tm_year < min_year || tmp->tm_year > max_year)
22018 } /* local_check */
22025 local_check (MAXLONG, 69, 0x7fffffff);
22027 if (tmp == NULL || tmp->tm_year < 0) {
22028 for (i = 63; i >= 0; i--) {
22029 time_t x = pt | ((time_t)1 << i);
22030 if (x < 0 || x < pt) continue;
22031 local_check (x, 69, 0x7fffffff);
22034 printf ("sLOCALTIME_max=%ld\n", pt);
22043 local_check (MINLONG, -1900, 70);
22046 for (i = 36; i >= 0; i--) {
22047 time_t x = pt - ((time_t)1 << i);
22048 if (x > 0) continue;
22049 local_check (x, -1900, 70);
22052 printf ("sLOCALTIME_min=%ld\n", pt);
22056 int main (int argc, char *argv[])
22064 if eval $compile; then
22065 eval `$run ./try 2>/dev/null`
22067 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22073 : check for type of arguments to select.
22074 case "$selecttype" in
22075 '') case "$d_select" in
22079 Checking to see what type of arguments are accepted by select().
22081 hdrs="$define sys/types.h
22082 $i_systime sys/time.h
22083 $i_sysselct sys/select.h
22084 $d_socket sys/socket.h"
22085 : The first arg can be int, unsigned, or size_t
22086 : The last arg may or may not be 'const'
22088 : void pointer has been seen but using that
22089 : breaks the selectminbits test
22090 for xxx in 'fd_set *' 'int *'; do
22091 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22092 for tmo in 'struct timeval *' 'const struct timeval *'; do
22094 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22095 if ./protochk "$try" $hdrs; then
22096 echo "Your system accepts $xxx."
22105 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22106 case "$d_fd_set" in
22107 $define) dflt="fd_set *" ;;
22116 *) : no select, so pick a harmless default
22123 : check for the select 'width'
22124 case "$selectminbits" in
22125 '') safebits=`expr $ptrsize \* 8`
22126 case "$d_select" in
22130 Checking to see on how many bits at a time your select() operates...
22133 #include <sys/types.h>
22135 #$i_systime I_SYS_TIME
22136 #$i_systimek I_SYS_TIME_KERNEL
22141 # ifdef I_SYS_TIME_KERNEL
22144 # include <sys/time.h>
22145 # ifdef I_SYS_TIME_KERNEL
22149 #$i_sysselct I_SYS_SELECT
22150 #ifdef I_SYS_SELECT
22151 #include <sys/select.h>
22153 #$d_socket HAS_SOCKET
22155 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22158 #$i_stdlib I_STDLIB
22160 #include <stdlib.h>
22163 #define S sizeof(*(b))
22165 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22166 #define NBITS (NBYTES * 8)
22168 char *s = (char *)malloc(NBYTES);
22177 fp = fopen("try.c", "r");
22183 b = ($selecttype)s;
22184 for (i = 0; i < NBITS; i++)
22188 select(fd + 1, b, 0, 0, &t);
22189 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22191 printf("%d\n", i + 1);
22196 if eval $compile_ok; then
22197 selectminbits=`$run ./try 2>/dev/null`
22198 case "$selectminbits" in
22200 Cannot figure out on how many bits at a time your select() operates.
22201 I'll play safe and guess it is $safebits bits.
22203 selectminbits=$safebits
22204 bits="$safebits bits"
22207 *) bits="$selectminbits bits" ;;
22209 echo "Your select() operates on $bits at a time." >&4
22211 rp='What is the minimum number of bits your select() operates on?'
22212 case "$byteorder" in
22213 12345678) dflt=64 ;;
22219 selectminbits="$val"
22223 *) : no select, so pick a harmless default
22224 selectminbits=$safebits
22230 : Trace out the files included by signal.h, then look for SIGxxx names.
22231 case "$sig_num_init" in
22233 if [ "X$fieldn" = X ]; then
22234 : Just make some guesses. We check them later.
22235 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22237 xxx=`echo '#include <signal.h>' |
22238 $cppstdin $cppminus $cppflags 2>/dev/null |
22239 $grep '^[ ]*#.*include' |
22240 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22241 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22244 for xx in $xxx /dev/null ; do
22245 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22247 case "$xxxfiles" in
22248 '') xxxfiles=`./findhdr signal.h` ;;
22251 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22252 print substr($2, 4, 20)
22254 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22255 print substr($3, 4, 20)
22257 : Append some common names just in case the awk scan failed.
22258 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22259 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22260 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22261 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22262 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22264 : generate a few handy files for later
22265 $cat > signal.c <<EOCP
22266 #include <sys/types.h>
22267 #include <signal.h>
22268 #$i_stdlib I_STDLIB
22270 #include <stdlib.h>
22275 /* Strange style to avoid deeply-nested #if/#else/#endif */
22278 # define NSIG (_NSIG)
22284 # define NSIG (SIGMAX+1)
22290 # define NSIG (SIG_MAX+1)
22296 # define NSIG (_SIG_MAX+1)
22302 # define NSIG (MAXSIG+1)
22308 # define NSIG (MAX_SIG+1)
22313 # ifdef SIGARRAYSIZE
22314 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22320 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22324 /* Default to some arbitrary number that's big enough to get most
22325 of the common signals.
22331 printf("NSIG %d\n", NSIG);
22337 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22339 printf "#ifdef SIG"; printf $1; printf "\n"
22340 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22341 printf $1; printf ");\n"
22345 printf "#endif /* JUST_NSIG */\n";
22346 printf "exit(0);\n}\n";
22349 $cat >signal.awk <<'EOP'
22350 BEGIN { ndups = 0 }
22351 $1 ~ /^NSIG$/ { nsig = $2 }
22352 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22353 if ($2 > maxsig) { maxsig = $2 }
22354 if (sig_name[$2]) {
22355 dup_name[ndups] = $1
22356 dup_num[ndups] = $2
22368 printf("NSIG %d\n", nsig);
22369 for (n = 1; n < nsig; n++) {
22371 printf("%s %d\n", sig_name[n], sig_num[n])
22374 printf("NUM%d %d\n", n, n)
22377 for (n = 0; n < ndups; n++) {
22378 printf("%s %d\n", dup_name[n], dup_num[n])
22382 $cat >signal_cmd <<EOS
22384 if $test -s signal.lst; then
22385 echo "Using your existing signal.lst file"
22390 $cat >>signal_cmd <<'EOS'
22393 if eval $compile_ok; then
22394 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22395 $uniq | $awk -f signal.awk >signal.lst
22397 echo "(I can't seem be able to compile the whole test program)" >&4
22398 echo "(I'll try it in little pieces.)" >&4
22399 set signal -DJUST_NSIG
22400 if eval $compile_ok; then
22401 $run ./signal$_exe > signal.nsg
22404 echo "I can't seem to figure out how many signals you have." >&4
22405 echo "Guessing 50." >&4
22406 echo 'NSIG 50' > signal.nsg
22408 : Now look at all the signal names, one at a time.
22409 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22410 $cat > signal.c <<EOCP
22411 #include <sys/types.h>
22412 #include <signal.h>
22415 printf("$xx %d\n", SIG${xx});
22420 if eval $compile; then
22421 echo "SIG${xx} found."
22422 $run ./signal$_exe >> signal.ls1
22424 echo "SIG${xx} NOT found."
22427 if $test -s signal.ls1; then
22428 $cat signal.nsg signal.ls1 |
22429 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22433 if $test -s signal.lst; then
22436 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22437 echo 'kill -l' >signal
22438 set X `csh -f <signal`
22442 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22444 echo $@ | $tr ' ' $trnl | \
22445 $awk '{ printf "%s %d\n", $1, ++s; }
22446 END { printf "NSIG %d\n", ++s }' >signal.lst
22448 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22450 chmod a+x signal_cmd
22451 $eunicefix signal_cmd
22455 : generate list of signal names
22456 case "$sig_num_init" in
22459 case "$sig_name_init" in
22461 *) case "$sig_num_init" in
22462 ''|*,*) doinit=yes ;;
22467 echo "Generating a list of signal names and numbers..." >&4
22469 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22470 sig_name=`$awk 'BEGIN { printf "ZERO " }
22471 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22472 sig_num=`$awk 'BEGIN { printf "0 " }
22473 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22474 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22475 !/^NSIG/ { printf "\"%s\", ", $1 }
22476 END { printf "0\n" }' signal.lst`
22477 sig_num_init=`$awk 'BEGIN { printf "0, " }
22478 !/^NSIG/ { printf "%d, ", $2}
22479 END { printf "0\n"}' signal.lst`
22482 echo "The following $sig_count signals are available:"
22484 echo $sig_name | $awk \
22485 'BEGIN { linelen = 0 }
22487 for (i = 1; i <= NF; i++) {
22488 name = "SIG" $i " "
22489 linelen = linelen + length(name)
22490 if (linelen > 70) {
22492 linelen = length(name)
22498 sig_size=`echo $sig_name | awk '{print NF}'`
22499 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22503 : Check size of size
22505 case "$sizetype" in
22506 *_t) zzz="$sizetype" ;;
22507 *) zzz="filesize" ;;
22509 echo "Checking the size of $zzz..." >&4
22511 #include <sys/types.h>
22513 #$i_stdlib I_STDLIB
22515 #include <stdlib.h>
22518 printf("%d\n", (int)sizeof($sizetype));
22523 if eval $compile_ok; then
22527 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22530 echo "Your $zzz size is $sizesize bytes."
22535 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22539 : check for socklen_t
22541 echo "Checking to see if you have socklen_t..." >&4
22543 #include <sys/types.h>
22544 #$d_socket HAS_SOCKET
22546 #include <sys/socket.h>
22548 int main() { socklen_t x = 16; }
22551 if eval $compile; then
22553 echo "You have socklen_t."
22556 echo "You do not have socklen_t."
22557 case "$sizetype" in
22558 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22565 : see if this is a socks.h system
22566 set socks.h i_socks
22569 : check for type of the size argument to socket calls
22570 case "$d_socket" in
22574 Checking to see what type is the last argument of accept().
22577 case "$d_socklen_t" in
22578 "$define") yyy="$yyy socklen_t"
22580 yyy="$yyy $sizetype int long unsigned"
22581 for xxx in $yyy; do
22582 case "$socksizetype" in
22583 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22584 case "$usesocks" in
22586 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22587 echo "Your system accepts '$xxx *' for the last argument of accept()."
22588 socksizetype="$xxx"
22591 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22592 echo "Your system accepts '$xxx *' for the last argument of accept()."
22593 socksizetype="$xxx"
22600 : In case none of those worked, prompt the user.
22601 case "$socksizetype" in
22602 '') rp='What is the type for socket address structure sizes?'
22609 *) : no sockets, so pick relatively harmless default
22614 : see what type is used for signed size_t
22615 set ssize_t ssizetype int stdio.h sys/types.h
22620 #$i_stdlib I_STDLIB
22622 #include <stdlib.h>
22624 #include <sys/types.h>
22625 #define Size_t $sizetype
22626 #define SSize_t $dflt
22629 if (sizeof(Size_t) == sizeof(SSize_t))
22631 else if (sizeof(Size_t) == sizeof(int))
22640 if eval $compile_ok && $run ./try > /dev/null; then
22641 ssizetype=`$run ./try`
22642 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22645 Help! I can't compile and run the ssize_t test program: please enlighten me!
22646 (This is probably a misconfiguration in your system or libraries, and
22647 you really ought to fix it. Still, I'll try anyway.)
22649 I need a type that is the same size as $sizetype, but is guaranteed to
22650 be signed. Common values are ssize_t, int and long.
22653 rp="What signed type is the same size as $sizetype?"
22659 : Check the size of st_ino
22661 $echo "Checking the size of st_ino..." >&4
22662 $cat > try.c <<EOCP
22663 #include <sys/stat.h>
22665 #$i_stdlib I_STDLIB
22667 #include <stdlib.h>
22671 printf("%d\n", (int)sizeof(st.st_ino));
22676 if eval $compile_ok; then
22680 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22682 *) st_ino_size=$val
22683 $echo "Your st_ino is $st_ino_size bytes long."
22688 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22692 : Check if st_ino is signed
22694 $echo "Checking the sign of st_ino..." >&4
22695 $cat > try.c <<EOCP
22696 #include <sys/stat.h>
22701 if (foo.st_ino < 0)
22708 if eval $compile; then
22712 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22714 *) st_ino_sign=$val
22715 case "$st_ino_sign" in
22716 1) $echo "Your st_ino is unsigned." ;;
22717 -1) $echo "Your st_ino is signed." ;;
22723 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22727 : see what type of char stdio uses.
22729 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22730 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22731 echo "Your stdio uses unsigned chars." >&4
22732 stdchar="unsigned char"
22734 echo "Your stdio uses signed chars." >&4
22739 : Check size of UID
22742 *_t) zzz="$uidtype" ;;
22745 echo "Checking the size of $zzz..." >&4
22747 #include <sys/types.h>
22749 #$i_stdlib I_STDLIB
22751 #include <stdlib.h>
22754 printf("%d\n", (int)sizeof($uidtype));
22759 if eval $compile_ok; then
22763 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22766 echo "Your $zzz is $uidsize bytes long."
22771 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22774 : Check if UID is signed
22777 *_t) zzz="$uidtype" ;;
22780 echo "Checking the sign of $zzz..." >&4
22782 #include <sys/types.h>
22793 if eval $compile; then
22797 echo "(I can't execute the test program--guessing unsigned.)" >&4
22801 1) echo "Your $zzz is unsigned." ;;
22802 -1) echo "Your $zzz is signed." ;;
22808 echo "(I can't compile the test program--guessing unsigned.)" >&4
22812 : Check format string for UID
22814 $echo "Checking the format string to be used for uids..." >&4
22817 -1) if $test X"$uidsize" = X"$ivsize"; then
22818 uidformat="$ivdformat"
22820 if $test X"$uidsize" = X"$longsize"; then
22823 if $test X"$uidsize" = X"$intsize"; then
22826 if $test X"$uidsize" = X"$shortsize"; then
22833 *) if $test X"$uidsize" = X"$uvsize"; then
22834 uidformat="$uvuformat"
22836 if $test X"$uidsize" = X"$longsize"; then
22839 if $test X"$uidsize" = X"$intsize"; then
22842 if $test X"$uidsize" = X"$shortsize"; then
22851 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22853 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22854 $cat >try.c <<'EOM'
22855 /* Intentionally a long probe as I'd like to sanity check that the exact
22856 approach is going to work, as thinking it will work, but only having it
22857 part working at runtime is worse than not having it. */
22859 #include <sys/types.h>
22860 #include <sys/sysctl.h>
22861 #include <sys/param.h>
22863 #include <string.h>
22864 #include <stdlib.h>
22865 #include <unistd.h>
22868 main(int argc, char **argv) {
22870 char *argv_leaf = strrchr(argv[0], '/');
22876 mib[1] = KERN_PROC;
22877 mib[2] = KERN_PROC_PATHNAME;
22881 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22885 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22890 if (size < strlen(argv_leaf) + 1) {
22891 fprintf(stderr, "size %lu is too short for a path\n",
22892 (unsigned long) size);
22896 if (size > MAXPATHLEN * MAXPATHLEN) {
22897 fprintf(stderr, "size %lu is too long for a path\n",
22898 (unsigned long) size);
22902 buffer = malloc(size);
22908 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22913 if (strlen(buffer) + 1 != size) {
22914 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22915 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22920 if (*buffer != '/') {
22921 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22925 if (strstr(buffer, "/./")) {
22926 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22930 if (strstr(buffer, "/../")) {
22931 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22935 buffer_leaf = strrchr(buffer, '/');
22936 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22937 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22949 if eval $compile; then
22950 if $run ./try; then
22951 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22954 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22958 echo "I'm unable to compile the test program." >&4
22959 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22963 set usekernprocpathname
22966 : Determine if we can use _NSGetExecutablePath to find executing program
22968 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22969 $cat >try.c <<'EOM'
22970 /* Intentionally a long probe as I'd like to sanity check that the exact
22971 approach is going to work, as thinking it will work, but only having it
22972 part working at runtime is worse than not having it. */
22973 #include <mach-o/dyld.h>
22975 #include <stdlib.h>
22976 #include <sys/param.h>
22977 #include <string.h>
22980 main(int argc, char **argv) {
22982 uint32_t size = sizeof(buf);
22986 char *argv_leaf = strrchr(argv[0], '/');
22990 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22994 _NSGetExecutablePath(buf, &size);
22995 if (size > MAXPATHLEN * MAXPATHLEN) {
22996 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22997 (unsigned int) size);
23001 buffer = malloc(size);
23007 result = _NSGetExecutablePath(buffer, &size);
23009 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23010 result, (unsigned int) size);
23014 tidied = realpath(buffer, NULL);
23016 perror("realpath");
23022 if (*tidied != '/') {
23023 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23027 if (strstr(tidied, "/./")) {
23028 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23032 if (strstr(tidied, "/../")) {
23033 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23037 tidied_leaf = strrchr(tidied, '/');
23038 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23039 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23051 if eval $compile; then
23052 if $run ./try; then
23053 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23056 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23059 echo "I'm unable to compile the test program." >&4
23060 echo "I'll assume no _NSGetExecutablePath here." >&4
23063 set usensgetexecutablepath
23066 : Check if site customization support was requested
23067 case "$usesitecustomize" in
23068 $define|true|[Yy]*)
23069 usesitecustomize="$define"
23072 usesitecustomize="$undef"
23076 : see if prototypes support variable argument declarations
23078 case "$prototype$i_stdarg" in
23080 echo "It appears we'll be able to prototype varargs functions." >&4
23084 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23091 : determine compiler compiler
23100 if $test -f "$byacc$_exe"; then
23102 comp="byacc or $comp"
23104 if $test -f "$bison$_exe"; then
23105 comp="$comp or bison -y"
23107 rp="Which compiler compiler ($comp) shall I use?"
23116 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23122 : see if this is a assert.h system
23123 set assert.h i_assert
23126 : see if this is a bfd.h system
23130 : see if this is an execinfo.h system
23131 set execinfo.h i_execinfo
23134 : see if this is a fenv.h system
23138 : see if this is a fp.h system
23142 : see if this is a fp_class.h system
23143 set fp_class.h i_fp_class
23146 : see if gdbm.h is available
23151 : see if gdbm_open exists
23152 set gdbm_open d_gdbm_open
23154 case "$d_gdbm_open" in
23157 echo "We won't be including <gdbm.h>"
23166 : see if this is a ieeefp.h system
23167 case "$i_ieeefp" in
23168 '' ) set ieeefp.h i_ieeefp
23173 : see if this is a libutil.h system
23174 set libutil.h i_libutil
23177 : see if mach cthreads are available
23178 if test "X$usethreads" = "X$define"; then
23179 set mach/cthreads.h i_machcthr
23182 i_machcthr="$undef"
23185 : see if this is a mntent.h system
23186 set mntent.h i_mntent
23189 : see if net/errno.h is available
23191 set net/errno.h val
23194 : Unfortunately, it causes problems on some systems. Arrgh.
23197 cat > try.c <<'EOM'
23200 #include <net/errno.h>
23206 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23207 echo "We'll be including <net/errno.h>." >&4
23209 echo "We won't be including <net/errno.h>." >&4
23218 : see if netinet/tcp.h is available
23219 set netinet/tcp.h i_netinettcp
23222 : see if this is a poll.h system
23226 : see if this is a prot.h system
23230 : Preprocessor symbols
23232 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23233 $cat <<'EOSH' > Cppsym.know
23234 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23235 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23236 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23237 arch_pwr ardent ARM ARM32 atarist att386 att3b
23238 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23239 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23240 byteorder byte_order
23241 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23242 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23243 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23244 ELF encore EPI EXTENSIONS
23245 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23246 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23247 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23248 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23249 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23250 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23251 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23252 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23253 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23255 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23256 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23257 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23259 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23260 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23261 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23262 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23263 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23264 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23265 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23266 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23267 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23268 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23269 ns32000 ns32016 ns32332 ns32k nsc32000
23270 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23271 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23272 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23273 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23275 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23276 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23277 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23278 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23279 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23280 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23281 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23282 SYSV4 SYSV5 sysV68 sysV88
23283 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23284 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23285 tower32_800 tower32_850 tss
23286 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23287 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23288 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23289 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23290 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23291 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23293 vax venix VMESA vms
23294 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23295 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23298 # Maybe put other stuff here too.
23299 ./tr '-' '_' <<EOSH >>Cppsym.know
23302 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23303 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23304 $cat Cppsym.know > Cppsym.c
23305 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23306 $rm -f Cppsym.a Cppsym.b Cppsym.c
23307 cat <<EOSH > Cppsym
23309 if $test \$# -gt 0; then
23310 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23311 if $test -s Cppsym.got; then
23318 $tr " " "$trnl" | ./Cppsym.try
23324 cat <<EOSH > Cppsym.try
23326 cat <<'EOCP' > try.c
23329 #define STRINGIFY(a) "a"
23331 #if cpp_stuff == 42
23332 #define StGiFy(a) #a
23333 #define STRINGIFY(a) StGiFy(a)
23335 #if $cpp_stuff != 1 && $cpp_stuff != 42
23336 # include "Bletch: How does this C preprocessor stringify macros?"
23342 cat <<'EOSH' >> Cppsym.try
23344 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23345 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23346 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23347 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23349 echo 'return 0;}' >> try.c
23351 cat <<EOSH >> Cppsym.try
23353 case "$osname-$gccversion" in
23354 irix-) ccflags="\$ccflags -woff 1178" ;;
23355 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23357 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23359 chmod +x Cppsym.try
23360 $eunicefix Cppsym.try
23361 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23362 : Add in any Linux cpp "predefined macros":
23363 case "$osname::$gccversion" in
23364 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23366 rm -f $tHdrH'.h' $tHdrH
23368 # Filter out macro arguments, such as Linux's __INT8_C(c)
23369 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23370 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23371 if [ -s $tHdrH'_cppsym.real' ]; then
23372 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23375 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23378 : now check the C compiler for additional symbols
23379 postprocess_cc_v=''
23381 aix) postprocess_cc_v="|$tr , ' '" ;;
23388 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23391 -D*) echo "\$i" | $sed 's/^-D//';;
23392 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23397 postprocess_cc_v=''
23400 ./ccsym > ccsym1.raw
23401 if $test -s ccsym1.raw; then
23402 $sort ccsym1.raw | $uniq >ccsym.raw
23404 mv ccsym1.raw ccsym.raw
23407 $awk '/\=/ { print $0; next }
23408 { print $0"=1" }' ccsym.raw >ccsym.list
23409 $comm -13 Cppsym.true ccsym.list >ccsym.own
23410 $comm -12 Cppsym.true ccsym.list >ccsym.com
23411 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23413 if $test -z ccsym.raw; then
23414 echo "Your C compiler doesn't seem to define any symbols!" >&4
23416 echo "However, your C preprocessor defines the following symbols:"
23419 cppsymbols=`$cat Cppsym.true`
23420 cppsymbols=`echo $cppsymbols`
23421 cppccsymbols="$cppsymbols"
23423 if $test -s ccsym.com; then
23424 echo "Your C compiler and pre-processor define these symbols:"
23425 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23428 cppccsymbols=`$cat ccsym.com`
23429 cppccsymbols=`echo $cppccsymbols`
23430 $test "$silent" || sleep 1
23432 if $test -s ccsym.cpp; then
23433 $test "$also" && echo " "
23434 echo "Your C pre-processor ${also}defines the following symbols:"
23435 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23437 cppsymbols=`$cat ccsym.cpp`
23438 cppsymbols=`echo $cppsymbols`
23439 $test "$silent" || sleep 1
23441 if $test -s ccsym.own; then
23442 $test "$also" && echo " "
23443 echo "Your C compiler ${also}defines the following cpp symbols:"
23444 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23445 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23446 ccsymbols=`$cat ccsym.own`
23447 ccsymbols=`echo $ccsymbols`
23448 $test "$silent" || sleep 1
23452 : add -D_FORTIFY_SOURCE if feasible and not already there
23453 case "$gccversion" in
23454 [45].*) case "$optimize$ccflags" in
23455 *-O*) case "$ccflags$cppsymbols" in
23456 *_FORTIFY_SOURCE=*) # Don't add it again.
23457 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23459 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23460 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23464 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23468 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23472 : see if this is a termio system
23476 if $test `./findhdr termios.h`; then
23477 set tcsetattr i_termios
23483 "$define") echo "You have POSIX termios.h... good!" >&4;;
23484 *) if ./Cppsym pyr; then
23485 case "`$run /bin/universe`" in
23486 ucb) if $test `./findhdr sgtty.h`; then
23488 echo "<sgtty.h> found." >&4
23490 echo "System is pyramid with BSD universe."
23491 ./warn "<sgtty.h> not found--you could have problems."
23493 *) if $test `./findhdr termio.h`; then
23495 echo "<termio.h> found." >&4
23497 echo "System is pyramid with USG universe."
23498 ./warn "<termio.h> not found--you could have problems."
23502 if $test `./findhdr termio.h`; then
23503 echo "<termio.h> found." >&4
23505 elif $test `./findhdr sgtty.h`; then
23506 echo "<sgtty.h> found." >&4
23509 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23512 if $test `./findhdr sgtty.h`; then
23513 echo "<sgtty.h> found." >&4
23515 elif $test `./findhdr termio.h`; then
23516 echo "<termio.h> found." >&4
23519 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23523 set i_termio; eval $setvar
23524 val=$val2; set i_sgtty; eval $setvar
23525 val=$val3; set i_termios; eval $setvar
23527 : see if stdbool is available
23528 : we want a real compile instead of Inhdr because some Solaris systems
23529 : have stdbool.h, but it can only be used if the compiler indicates it
23530 : is sufficiently c99-compliant.
23534 #include <stdbool.h>
23539 int main(int argc, char **argv)
23545 if eval $compile; then
23546 echo "<stdbool.h> found." >&4
23549 echo "<stdbool.h> NOT found." >&4
23556 : see if stddef is available
23557 set stddef.h i_stddef
23560 : see if stdint is available
23561 set stdint.h i_stdint
23564 : see if sys/access.h is available
23565 set sys/access.h i_sysaccess
23568 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23569 set sys/filio.h i_sysfilio
23572 if $test `./findhdr sys/ioctl.h`; then
23574 echo '<sys/ioctl.h> found.' >&4
23577 if $test $i_sysfilio = "$define"; then
23578 echo '<sys/ioctl.h> NOT found.' >&4
23580 $test $i_sgtty = "$define" && xxx="sgtty.h"
23581 $test $i_termio = "$define" && xxx="termio.h"
23582 $test $i_termios = "$define" && xxx="termios.h"
23583 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23589 : see if socket ioctl defs are in sys/sockio.h
23591 xxx=`./findhdr sys/sockio.h`
23592 if $test "$xxx"; then
23593 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23595 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23598 echo "No socket ioctls found in <sys/sockio.h>." >&4
23603 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23609 : see if this is a syslog.h system
23610 set syslog.h i_syslog
23613 : see if this is a sys/mode.h system
23614 set sys/mode.h i_sysmode
23617 : see if there is a sys/poll.h file
23618 set sys/poll.h i_syspoll
23621 : see if sys/resource.h has to be included
23622 set sys/resource.h i_sysresrc
23625 : see if sys/security.h is available
23626 set sys/security.h i_syssecrt
23629 : see if this is a sys/statvfs.h system
23630 set sys/statvfs.h i_sysstatvfs
23633 : see if this is a sys/un.h system
23634 set sys/un.h i_sysun
23637 : see if this is a sys/utsname.h system
23638 set sys/utsname.h i_sysutsname
23641 : see if this is a syswait system
23642 set sys/wait.h i_syswait
23645 : see if this is a ustat.h system
23646 set ustat.h i_ustat
23649 : see if this is an utime system
23650 set utime.h i_utime
23653 : see if this is a vfork system
23656 set vfork.h i_vfork
23666 echo "Looking for extensions..." >&4
23667 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23668 : contain old or inaccurate or duplicate values.
23669 nonxs_extensions=''
23671 : We do not use find because it might not be available.
23672 : We do not just use MANIFEST because the user may have dropped
23673 : some additional extensions into the source tree and expect them
23676 : Function to recursively find available extensions, ignoring DynaLoader
23677 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23678 : In 5.10.1 and later, extensions are stored in directories
23679 : like File-Glob instead of the older File/Glob/.
23683 DynaLoader|dynaload) ;;
23685 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23686 case "$this_ext" in
23687 Scalar/List/Utils) this_ext="List/Util" ;;
23688 PathTools) this_ext="Cwd" ;;
23690 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23691 if $contains " $this_ext " "$tdir/$$.tmp"; then
23693 echo "Duplicate directories detected for extension $xxx" >&4;
23694 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23695 case "$knowitall" in
23703 echo "Ok. Stopping Configure." >&4;
23704 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23707 echo "Ok. You will need to correct config.sh before running make." >&4;
23709 $ls -1 "$xxx" > "$tdir/$$.tmp";
23710 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23711 xs_extensions="$xs_extensions $this_ext";
23712 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23713 xs_extensions="$xs_extensions $this_ext";
23714 elif $test -d "$xxx"; then
23715 nonxs_extensions="$nonxs_extensions $this_ext";
23717 $rm -f "$tdir/$$.tmp";
23725 eval $find_extensions
23729 eval $find_extensions
23733 eval $find_extensions
23734 set X $xs_extensions
23736 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23737 set X $nonxs_extensions
23739 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23741 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23743 : Now see which are supported on this system.
23745 for xxx in $xs_extensions ; do
23749 amigaos) avail_ext="$avail_ext $xxx" ;;
23754 $define) avail_ext="$avail_ext $xxx" ;;
23757 GDBM_File|gdbm_fil)
23759 $define) avail_ext="$avail_ext $xxx" ;;
23762 I18N/Langinfo|i18n_lan)
23763 case "$i_langinfo$d_nl_langinfo" in
23764 $define$define) avail_ext="$avail_ext $xxx" ;;
23768 : XXX Do we need a useipcsysv variable here
23769 case "${d_msg}${d_sem}${d_shm}" in
23770 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23773 NDBM_File|ndbm_fil)
23776 case "$osname-$use64bitint" in
23779 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23782 *) avail_ext="$avail_ext $xxx" ;;
23787 ODBM_File|odbm_fil)
23788 case "${i_dbm}${i_rpcsvcdbm}" in
23790 case "$d_cplusplus" in
23791 define) ;; # delete as a function name will not work
23792 *) case "$osname-$use64bitint" in
23795 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23798 *) avail_ext="$avail_ext $xxx" ;;
23806 case "$useopcode" in
23807 true|define|y) avail_ext="$avail_ext $xxx" ;;
23811 case "$useposix" in
23812 true|define|y) avail_ext="$avail_ext $xxx" ;;
23816 case "$d_socket" in
23817 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23820 Sys/Syslog|sys/syslog)
23822 amigaos) ;; # not really very useful on AmigaOS
23824 : XXX syslog requires socket
23825 case "$d_socket" in
23826 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23832 case "$usethreads" in
23834 case "$use5005threads" in
23835 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23839 threads|threads/shared)
23840 # threads and threads::shared are special cases.
23841 # To stop people from asking "Perl 5.8.0 was supposed
23842 # to have this new fancy threads implementation but my
23843 # perl doesn't have it" and from people trying to
23844 # (re)install the threads module using CPAN.pm and
23845 # CPAN.pm then offering to reinstall Perl 5.8.0,
23846 # the threads.pm and threads/shared.pm will always be
23847 # there, croaking informatively ("you need to rebuild
23848 # all of Perl with threads, sorry") when threads haven't
23849 # been compiled in.
23851 avail_ext="$avail_ext $xxx"
23857 cygwin) avail_ext="$avail_ext $xxx" ;;
23860 XS/APItest|xs/apitest)
23861 # This is just for testing. Skip it unless we have dynamic loading.
23864 $define) avail_ext="$avail_ext $xxx" ;;
23867 XS/Typemap|xs/typemap)
23868 # This is just for testing. Skip it unless we have dynamic loading.
23870 $define) avail_ext="$avail_ext $xxx" ;;
23873 *) avail_ext="$avail_ext $xxx"
23882 case "$onlyextensions" in
23884 *) keepextensions=''
23885 echo "You have requested that only certain extensions be included..." >&4
23886 for i in $onlyextensions; do
23887 case " $avail_ext " in
23889 echo "Keeping extension $i."
23890 keepextensions="$keepextensions $i"
23892 *) echo "Ignoring extension $i." ;;
23895 avail_ext="$keepextensions"
23899 case "$noextensions" in
23901 *) keepextensions=''
23902 echo "You have requested that certain extensions be ignored..." >&4
23903 for i in $avail_ext; do
23904 case " $noextensions " in
23905 *" $i "*) echo "Ignoring extension $i." ;;
23906 *) echo "Keeping extension $i.";
23907 keepextensions="$keepextensions $i"
23911 avail_ext="$keepextensions"
23915 : Now see which nonxs extensions are supported on this system.
23916 : For now assume all are.
23918 for xxx in $nonxs_extensions ; do
23922 *) nonxs_ext="$nonxs_ext $xxx"
23934 A number of extensions are supplied with $package. You may choose to
23935 compile these extensions for dynamic loading (the default), compile
23936 them into the $package executable (static loading), or not include
23937 them at all. Answer "none" to include no extensions.
23938 Note that DynaLoader is always built and need not be mentioned here.
23941 case "$dynamic_ext" in
23943 : Exclude those listed in static_ext
23945 for xxx in $avail_ext; do
23946 case " $static_ext " in
23948 *) dflt="$dflt $xxx" ;;
23955 *) dflt="$dynamic_ext"
23956 # Perhaps we are reusing an old out-of-date config.sh.
23959 if test X"$dynamic_ext" != X"$avail_ext"; then
23961 NOTICE: Your previous config.sh list may be incorrect.
23962 The extensions now available to you are
23964 but the default list from your previous config.sh is
23976 rp="What extensions do you wish to load dynamically?"
23979 none) dynamic_ext=' ' ;;
23980 *) dynamic_ext="$ans" ;;
23983 case "$static_ext" in
23985 : Exclude those already listed in dynamic linking
23987 for xxx in $avail_ext; do
23988 case " $dynamic_ext " in
23990 *) dflt="$dflt $xxx" ;;
23997 *) dflt="$static_ext"
24004 rp="What extensions do you wish to load statically?"
24007 none) static_ext=' ' ;;
24008 *) static_ext="$ans" ;;
24013 A number of extensions are supplied with $package. Answer "none"
24014 to include no extensions.
24015 Note that DynaLoader is always built and need not be mentioned here.
24018 case "$static_ext" in
24019 '') dflt="$avail_ext" ;;
24020 *) dflt="$static_ext"
24021 # Perhaps we are reusing an old out-of-date config.sh.
24024 if test X"$static_ext" != X"$avail_ext"; then
24026 NOTICE: Your previous config.sh list may be incorrect.
24027 The extensions now available to you are
24029 but the default list from your previous config.sh is
24038 : Exclude those that are not xs extensions
24042 rp="What extensions do you wish to include?"
24045 none) static_ext=' ' ;;
24046 *) static_ext="$ans" ;;
24051 # Encode is a special case. If we are building Encode as a static
24052 # extension, we need to explicitly list its subextensions as well.
24053 # For other nested extensions, this is handled automatically by
24054 # the appropriate Makefile.PL.
24055 case " $static_ext " in
24056 *" Encode "*) # Add the subextensions of Encode
24058 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24059 static_ext="$static_ext Encode/$xxx"
24060 known_extensions="$known_extensions Encode/$xxx"
24066 set X $dynamic_ext $static_ext $nonxs_ext
24070 # Sanity check: We require an extension suitable for use with
24071 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24072 # should show up as failures in the test suite, but it's helpful to
24073 # catch them now.) The 'extensions' list is normally sorted
24074 # alphabetically, so we need to accept either
24075 # DB_File ... Fcntl ... IO ....
24076 # or something like
24077 # Fcntl ... NDBM_File ... IO ....
24078 case " $extensions" in
24079 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24080 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24081 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24082 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24083 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24087 : Remove libraries needed only for extensions
24088 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24089 : The exception is SunOS 4.x, which needs them.
24090 case "${osname}X${osvers}" in
24094 *) case "$usedl" in
24095 $define|true|[yY]*)
24096 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24100 *) perllibs="$libs"
24106 : Remove build directory name from cppstdin so it can be used from
24107 : either the present location or the final installed location.
24109 : Get out of the UU directory to get correct path name.
24111 case "$cppstdin" in
24113 echo "Stripping down cppstdin path name"
24119 : end of configuration questions
24121 echo "End of configuration questions."
24124 : back to where it started
24125 if test -d ../UU; then
24129 : configuration may be unconditionally patched via a 'config.arch' file
24130 if $test -f config.arch; then
24131 echo "I see a config.arch file, loading it." >&4
24135 : configuration may be patched via a 'config.over' file
24136 if $test -f config.over; then
24139 rp='I see a config.over file. Do you wish to load it?'
24142 n*) echo "OK, I'll ignore it.";;
24144 echo "Configuration override changes have been loaded."
24149 : in case they want portability, strip down executable paths
24150 case "$d_portable" in
24153 echo "Stripping down executable paths..." >&4
24154 for file in $loclist $trylist; do
24156 eval $file=`basename $temp`
24161 : create config.sh file
24163 echo "Creating config.sh..." >&4
24164 $spitshell <<EOT >config.sh
24167 # This file was produced by running the Configure script. It holds all the
24168 # definitions figured out by Configure. Should you modify one of these values,
24169 # do not forget to propagate your changes by running "Configure -der". You may
24170 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24173 # Package name : $package
24174 # Source directory : $src
24175 # Configuration time: $cf_time
24176 # Configured by : $cf_by
24177 # Target system : $myuname
24180 : Add in command line options if available
24181 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24183 $spitshell <<EOT >>config.sh
24192 Revision='$Revision'
24200 alignbytes='$alignbytes'
24201 ansi2knr='$ansi2knr'
24202 aphostname='$aphostname'
24203 api_revision='$api_revision'
24204 api_subversion='$api_subversion'
24205 api_version='$api_version'
24206 api_versionstring='$api_versionstring'
24209 archlibexp='$archlibexp'
24210 archname64='$archname64'
24211 archname='$archname'
24212 archobjs='$archobjs'
24213 asctime_r_proto='$asctime_r_proto'
24222 byteorder='$byteorder'
24224 castflags='$castflags'
24227 cccdlflags='$cccdlflags'
24228 ccdlflags='$ccdlflags'
24230 ccflags_uselargefiles='$ccflags_uselargefiles'
24232 ccsymbols='$ccsymbols'
24233 ccversion='$ccversion'
24235 cf_email='$cf_email'
24237 charbits='$charbits'
24238 charsize='$charsize'
24242 clocktype='$clocktype'
24244 compress='$compress'
24245 contains='$contains'
24249 cpp_stuff='$cpp_stuff'
24250 cppccsymbols='$cppccsymbols'
24251 cppflags='$cppflags'
24253 cppminus='$cppminus'
24255 cppstdin='$cppstdin'
24256 cppsymbols='$cppsymbols'
24257 crypt_r_proto='$crypt_r_proto'
24258 cryptlib='$cryptlib'
24260 ctermid_r_proto='$ctermid_r_proto'
24261 ctime_r_proto='$ctime_r_proto'
24262 d_Gconvert='$d_Gconvert'
24263 d_PRIEUldbl='$d_PRIEUldbl'
24264 d_PRIFUldbl='$d_PRIFUldbl'
24265 d_PRIGUldbl='$d_PRIGUldbl'
24266 d_PRIXU64='$d_PRIXU64'
24267 d_PRId64='$d_PRId64'
24268 d_PRIeldbl='$d_PRIeldbl'
24269 d_PRIfldbl='$d_PRIfldbl'
24270 d_PRIgldbl='$d_PRIgldbl'
24271 d_PRIi64='$d_PRIi64'
24272 d_PRIo64='$d_PRIo64'
24273 d_PRIu64='$d_PRIu64'
24274 d_PRIx64='$d_PRIx64'
24275 d_SCNfldbl='$d_SCNfldbl'
24276 d__fwalk='$d__fwalk'
24277 d_access='$d_access'
24278 d_accessx='$d_accessx'
24282 d_archlib='$d_archlib'
24283 d_asctime64='$d_asctime64'
24284 d_asctime_r='$d_asctime_r'
24289 d_attribute_deprecated='$d_attribute_deprecated'
24290 d_attribute_format='$d_attribute_format'
24291 d_attribute_malloc='$d_attribute_malloc'
24292 d_attribute_nonnull='$d_attribute_nonnull'
24293 d_attribute_noreturn='$d_attribute_noreturn'
24294 d_attribute_pure='$d_attribute_pure'
24295 d_attribute_unused='$d_attribute_unused'
24296 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24297 d_backtrace='$d_backtrace'
24301 d_bsdgetpgrp='$d_bsdgetpgrp'
24302 d_bsdsetpgrp='$d_bsdsetpgrp'
24303 d_builtin_choose_expr='$d_builtin_choose_expr'
24304 d_builtin_expect='$d_builtin_expect'
24306 d_c99_variadic_macros='$d_c99_variadic_macros'
24307 d_casti32='$d_casti32'
24308 d_castneg='$d_castneg'
24310 d_charvspr='$d_charvspr'
24312 d_chroot='$d_chroot'
24313 d_chsize='$d_chsize'
24315 d_clearenv='$d_clearenv'
24316 d_closedir='$d_closedir'
24317 d_cmsghdr_s='$d_cmsghdr_s'
24319 d_copysign='$d_copysign'
24320 d_copysignl='$d_copysignl'
24321 d_cplusplus='$d_cplusplus'
24323 d_crypt_r='$d_crypt_r'
24325 d_ctermid='$d_ctermid'
24326 d_ctermid_r='$d_ctermid_r'
24327 d_ctime64='$d_ctime64'
24328 d_ctime_r='$d_ctime_r'
24329 d_cuserid='$d_cuserid'
24330 d_dbl_dig='$d_dbl_dig'
24331 d_dbminitproto='$d_dbminitproto'
24332 d_difftime64='$d_difftime64'
24333 d_difftime='$d_difftime'
24334 d_dir_dd_fd='$d_dir_dd_fd'
24336 d_dirnamlen='$d_dirnamlen'
24337 d_dladdr='$d_dladdr'
24338 d_dlerror='$d_dlerror'
24339 d_dlopen='$d_dlopen'
24340 d_dlsymun='$d_dlsymun'
24341 d_dosuid='$d_dosuid'
24342 d_drand48_r='$d_drand48_r'
24343 d_drand48proto='$d_drand48proto'
24345 d_duplocale='$d_duplocale'
24346 d_eaccess='$d_eaccess'
24347 d_endgrent='$d_endgrent'
24348 d_endgrent_r='$d_endgrent_r'
24349 d_endhent='$d_endhent'
24350 d_endhostent_r='$d_endhostent_r'
24351 d_endnent='$d_endnent'
24352 d_endnetent_r='$d_endnetent_r'
24353 d_endpent='$d_endpent'
24354 d_endprotoent_r='$d_endprotoent_r'
24355 d_endpwent='$d_endpwent'
24356 d_endpwent_r='$d_endpwent_r'
24357 d_endsent='$d_endsent'
24358 d_endservent_r='$d_endservent_r'
24359 d_eofnblk='$d_eofnblk'
24362 d_eunice='$d_eunice'
24365 d_faststdio='$d_faststdio'
24366 d_fchdir='$d_fchdir'
24367 d_fchmod='$d_fchmod'
24368 d_fchown='$d_fchown'
24370 d_fcntl_can_lock='$d_fcntl_can_lock'
24371 d_fd_macros='$d_fd_macros'
24372 d_fd_set='$d_fd_set'
24373 d_fdclose='$d_fdclose'
24375 d_fds_bits='$d_fds_bits'
24376 d_fegetround='$d_fegetround'
24377 d_fgetpos='$d_fgetpos'
24378 d_finite='$d_finite'
24379 d_finitel='$d_finitel'
24380 d_flexfnam='$d_flexfnam'
24382 d_flockproto='$d_flockproto'
24387 d_fp_class='$d_fp_class'
24388 d_fp_classify='$d_fp_classify'
24389 d_fp_classl='$d_fp_classl'
24390 d_fpathconf='$d_fpathconf'
24391 d_fpclass='$d_fpclass'
24392 d_fpclassify='$d_fpclassify'
24393 d_fpclassl='$d_fpclassl'
24394 d_fpgetround='$d_fpgetround'
24395 d_fpos64_t='$d_fpos64_t'
24396 d_freelocale='$d_freelocale'
24397 d_frexpl='$d_frexpl'
24398 d_fs_data_s='$d_fs_data_s'
24399 d_fseeko='$d_fseeko'
24400 d_fsetpos='$d_fsetpos'
24401 d_fstatfs='$d_fstatfs'
24402 d_fstatvfs='$d_fstatvfs'
24404 d_ftello='$d_ftello'
24406 d_futimes='$d_futimes'
24407 d_gai_strerror='$d_gai_strerror'
24408 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24409 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24410 d_getaddrinfo='$d_getaddrinfo'
24411 d_getcwd='$d_getcwd'
24412 d_getespwnam='$d_getespwnam'
24413 d_getfsstat='$d_getfsstat'
24414 d_getgrent='$d_getgrent'
24415 d_getgrent_r='$d_getgrent_r'
24416 d_getgrgid_r='$d_getgrgid_r'
24417 d_getgrnam_r='$d_getgrnam_r'
24418 d_getgrps='$d_getgrps'
24419 d_gethbyaddr='$d_gethbyaddr'
24420 d_gethbyname='$d_gethbyname'
24421 d_gethent='$d_gethent'
24422 d_gethname='$d_gethname'
24423 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24424 d_gethostbyname_r='$d_gethostbyname_r'
24425 d_gethostent_r='$d_gethostent_r'
24426 d_gethostprotos='$d_gethostprotos'
24427 d_getitimer='$d_getitimer'
24428 d_getlogin='$d_getlogin'
24429 d_getlogin_r='$d_getlogin_r'
24430 d_getmnt='$d_getmnt'
24431 d_getmntent='$d_getmntent'
24432 d_getnameinfo='$d_getnameinfo'
24433 d_getnbyaddr='$d_getnbyaddr'
24434 d_getnbyname='$d_getnbyname'
24435 d_getnent='$d_getnent'
24436 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24437 d_getnetbyname_r='$d_getnetbyname_r'
24438 d_getnetent_r='$d_getnetent_r'
24439 d_getnetprotos='$d_getnetprotos'
24440 d_getpagsz='$d_getpagsz'
24441 d_getpbyname='$d_getpbyname'
24442 d_getpbynumber='$d_getpbynumber'
24443 d_getpent='$d_getpent'
24444 d_getpgid='$d_getpgid'
24445 d_getpgrp2='$d_getpgrp2'
24446 d_getpgrp='$d_getpgrp'
24447 d_getppid='$d_getppid'
24448 d_getprior='$d_getprior'
24449 d_getprotobyname_r='$d_getprotobyname_r'
24450 d_getprotobynumber_r='$d_getprotobynumber_r'
24451 d_getprotoent_r='$d_getprotoent_r'
24452 d_getprotoprotos='$d_getprotoprotos'
24453 d_getprpwnam='$d_getprpwnam'
24454 d_getpwent='$d_getpwent'
24455 d_getpwent_r='$d_getpwent_r'
24456 d_getpwnam_r='$d_getpwnam_r'
24457 d_getpwuid_r='$d_getpwuid_r'
24458 d_getsbyname='$d_getsbyname'
24459 d_getsbyport='$d_getsbyport'
24460 d_getsent='$d_getsent'
24461 d_getservbyname_r='$d_getservbyname_r'
24462 d_getservbyport_r='$d_getservbyport_r'
24463 d_getservent_r='$d_getservent_r'
24464 d_getservprotos='$d_getservprotos'
24465 d_getspnam='$d_getspnam'
24466 d_getspnam_r='$d_getspnam_r'
24467 d_gettimeod='$d_gettimeod'
24468 d_gmtime64='$d_gmtime64'
24469 d_gmtime_r='$d_gmtime_r'
24470 d_gnulibc='$d_gnulibc'
24471 d_grpasswd='$d_grpasswd'
24472 d_hasmntopt='$d_hasmntopt'
24476 d_ilogbl='$d_ilogbl'
24477 d_inc_version_list='$d_inc_version_list'
24479 d_inetaton='$d_inetaton'
24480 d_inetntop='$d_inetntop'
24481 d_inetpton='$d_inetpton'
24482 d_int64_t='$d_int64_t'
24483 d_ip_mreq='$d_ip_mreq'
24484 d_ip_mreq_source='$d_ip_mreq_source'
24485 d_ipv6_mreq='$d_ipv6_mreq'
24486 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24487 d_isascii='$d_isascii'
24488 d_isblank='$d_isblank'
24489 d_isfinite='$d_isfinite'
24490 d_isfinitel='$d_isfinitel'
24492 d_isinfl='$d_isinfl'
24493 d_isless='$d_isless'
24495 d_isnanl='$d_isnanl'
24496 d_isnormal='$d_isnormal'
24499 d_killpg='$d_killpg'
24500 d_lc_monetary_2008='$d_lc_monetary_2008'
24501 d_lchown='$d_lchown'
24502 d_ldbl_dig='$d_ldbl_dig'
24503 d_ldexpl='$d_ldexpl'
24504 d_lgamma='$d_lgamma'
24505 d_lgamma_r='$d_lgamma_r'
24506 d_libm_lib_version='$d_libm_lib_version'
24507 d_libname_unique='$d_libname_unique'
24509 d_llrint='$d_llrint'
24510 d_llrintl='$d_llrintl'
24511 d_llround='$d_llround'
24512 d_llroundl='$d_llroundl'
24513 d_localtime64='$d_localtime64'
24514 d_localtime_r='$d_localtime_r'
24515 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24516 d_locconv='$d_locconv'
24521 d_longdbl='$d_longdbl'
24522 d_longlong='$d_longlong'
24524 d_lrintl='$d_lrintl'
24525 d_lround='$d_lround'
24526 d_lroundl='$d_lroundl'
24527 d_lseekproto='$d_lseekproto'
24529 d_madvise='$d_madvise'
24530 d_malloc_good_size='$d_malloc_good_size'
24531 d_malloc_size='$d_malloc_size'
24533 d_mbstowcs='$d_mbstowcs'
24534 d_mbtowc='$d_mbtowc'
24535 d_memchr='$d_memchr'
24536 d_memcmp='$d_memcmp'
24537 d_memcpy='$d_memcpy'
24538 d_memmem='$d_memmem'
24539 d_memmove='$d_memmove'
24540 d_memset='$d_memset'
24542 d_mkdtemp='$d_mkdtemp'
24543 d_mkfifo='$d_mkfifo'
24544 d_mkstemp='$d_mkstemp'
24545 d_mkstemps='$d_mkstemps'
24546 d_mktime64='$d_mktime64'
24547 d_mktime='$d_mktime'
24550 d_modflproto='$d_modflproto'
24551 d_mprotect='$d_mprotect'
24553 d_msg_ctrunc='$d_msg_ctrunc'
24554 d_msg_dontroute='$d_msg_dontroute'
24555 d_msg_oob='$d_msg_oob'
24556 d_msg_peek='$d_msg_peek'
24557 d_msg_proxy='$d_msg_proxy'
24558 d_msgctl='$d_msgctl'
24559 d_msgget='$d_msgget'
24560 d_msghdr_s='$d_msghdr_s'
24561 d_msgrcv='$d_msgrcv'
24562 d_msgsnd='$d_msgsnd'
24564 d_munmap='$d_munmap'
24565 d_mymalloc='$d_mymalloc'
24568 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24569 d_nearbyint='$d_nearbyint'
24570 d_newlocale='$d_newlocale'
24571 d_nextafter='$d_nextafter'
24572 d_nexttoward='$d_nexttoward'
24574 d_nl_langinfo='$d_nl_langinfo'
24575 d_nv_preserves_uv='$d_nv_preserves_uv'
24576 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24577 d_off64_t='$d_off64_t'
24578 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24579 d_oldpthreads='$d_oldpthreads'
24580 d_oldsock='$d_oldsock'
24582 d_pathconf='$d_pathconf'
24584 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24585 d_phostname='$d_phostname'
24588 d_portable='$d_portable'
24590 d_prctl_set_name='$d_prctl_set_name'
24591 d_printf_format_null='$d_printf_format_null'
24592 d_procselfexe='$d_procselfexe'
24593 d_pseudofork='$d_pseudofork'
24594 d_pthread_atfork='$d_pthread_atfork'
24595 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24596 d_pthread_yield='$d_pthread_yield'
24597 d_ptrdiff_t='$d_ptrdiff_t'
24599 d_pwchange='$d_pwchange'
24600 d_pwclass='$d_pwclass'
24601 d_pwcomment='$d_pwcomment'
24602 d_pwexpire='$d_pwexpire'
24603 d_pwgecos='$d_pwgecos'
24604 d_pwpasswd='$d_pwpasswd'
24605 d_pwquota='$d_pwquota'
24608 d_querylocale='$d_querylocale'
24609 d_random_r='$d_random_r'
24610 d_re_comp='$d_re_comp'
24611 d_readdir64_r='$d_readdir64_r'
24612 d_readdir='$d_readdir'
24613 d_readdir_r='$d_readdir_r'
24614 d_readlink='$d_readlink'
24616 d_recvmsg='$d_recvmsg'
24617 d_regcmp='$d_regcmp'
24618 d_regcomp='$d_regcomp'
24619 d_remainder='$d_remainder'
24620 d_remquo='$d_remquo'
24621 d_rename='$d_rename'
24622 d_rewinddir='$d_rewinddir'
24626 d_safebcpy='$d_safebcpy'
24627 d_safemcpy='$d_safemcpy'
24628 d_sanemcmp='$d_sanemcmp'
24629 d_sbrkproto='$d_sbrkproto'
24630 d_scalbn='$d_scalbn'
24631 d_scalbnl='$d_scalbnl'
24632 d_sched_yield='$d_sched_yield'
24633 d_scm_rights='$d_scm_rights'
24634 d_seekdir='$d_seekdir'
24635 d_select='$d_select'
24637 d_semctl='$d_semctl'
24638 d_semctl_semid_ds='$d_semctl_semid_ds'
24639 d_semctl_semun='$d_semctl_semun'
24640 d_semget='$d_semget'
24642 d_sendmsg='$d_sendmsg'
24643 d_setegid='$d_setegid'
24644 d_seteuid='$d_seteuid'
24645 d_setgrent='$d_setgrent'
24646 d_setgrent_r='$d_setgrent_r'
24647 d_setgrps='$d_setgrps'
24648 d_sethent='$d_sethent'
24649 d_sethostent_r='$d_sethostent_r'
24650 d_setitimer='$d_setitimer'
24651 d_setlinebuf='$d_setlinebuf'
24652 d_setlocale='$d_setlocale'
24653 d_setlocale_r='$d_setlocale_r'
24654 d_setnent='$d_setnent'
24655 d_setnetent_r='$d_setnetent_r'
24656 d_setpent='$d_setpent'
24657 d_setpgid='$d_setpgid'
24658 d_setpgrp2='$d_setpgrp2'
24659 d_setpgrp='$d_setpgrp'
24660 d_setprior='$d_setprior'
24661 d_setproctitle='$d_setproctitle'
24662 d_setprotoent_r='$d_setprotoent_r'
24663 d_setpwent='$d_setpwent'
24664 d_setpwent_r='$d_setpwent_r'
24665 d_setregid='$d_setregid'
24666 d_setresgid='$d_setresgid'
24667 d_setresuid='$d_setresuid'
24668 d_setreuid='$d_setreuid'
24669 d_setrgid='$d_setrgid'
24670 d_setruid='$d_setruid'
24671 d_setsent='$d_setsent'
24672 d_setservent_r='$d_setservent_r'
24673 d_setsid='$d_setsid'
24674 d_setvbuf='$d_setvbuf'
24677 d_shmatprototype='$d_shmatprototype'
24678 d_shmctl='$d_shmctl'
24680 d_shmget='$d_shmget'
24681 d_sigaction='$d_sigaction'
24682 d_siginfo_si_addr='$d_siginfo_si_addr'
24683 d_siginfo_si_band='$d_siginfo_si_band'
24684 d_siginfo_si_errno='$d_siginfo_si_errno'
24685 d_siginfo_si_fd='$d_siginfo_si_fd'
24686 d_siginfo_si_pid='$d_siginfo_si_pid'
24687 d_siginfo_si_status='$d_siginfo_si_status'
24688 d_siginfo_si_uid='$d_siginfo_si_uid'
24689 d_siginfo_si_value='$d_siginfo_si_value'
24690 d_signbit='$d_signbit'
24691 d_sigprocmask='$d_sigprocmask'
24692 d_sigsetjmp='$d_sigsetjmp'
24693 d_sin6_scope_id='$d_sin6_scope_id'
24694 d_sitearch='$d_sitearch'
24695 d_snprintf='$d_snprintf'
24696 d_sockaddr_in6='$d_sockaddr_in6'
24697 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24698 d_sockatmark='$d_sockatmark'
24699 d_sockatmarkproto='$d_sockatmarkproto'
24700 d_socket='$d_socket'
24701 d_socklen_t='$d_socklen_t'
24702 d_sockpair='$d_sockpair'
24703 d_socks5_init='$d_socks5_init'
24704 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24706 d_srand48_r='$d_srand48_r'
24707 d_srandom_r='$d_srandom_r'
24708 d_sresgproto='$d_sresgproto'
24709 d_sresuproto='$d_sresuproto'
24711 d_statblks='$d_statblks'
24712 d_statfs_f_flags='$d_statfs_f_flags'
24713 d_statfs_s='$d_statfs_s'
24714 d_static_inline='$d_static_inline'
24715 d_statvfs='$d_statvfs'
24716 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24717 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24718 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24719 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24720 d_stdio_stream_array='$d_stdio_stream_array'
24721 d_stdiobase='$d_stdiobase'
24722 d_stdstdio='$d_stdstdio'
24723 d_strchr='$d_strchr'
24724 d_strcoll='$d_strcoll'
24725 d_strctcpy='$d_strctcpy'
24726 d_strerrm='$d_strerrm'
24727 d_strerror='$d_strerror'
24728 d_strerror_l='$d_strerror_l'
24729 d_strerror_r='$d_strerror_r'
24730 d_strftime='$d_strftime'
24731 d_strlcat='$d_strlcat'
24732 d_strlcpy='$d_strlcpy'
24733 d_strtod='$d_strtod'
24734 d_strtol='$d_strtol'
24735 d_strtold='$d_strtold'
24736 d_strtoll='$d_strtoll'
24737 d_strtoq='$d_strtoq'
24738 d_strtoul='$d_strtoul'
24739 d_strtoull='$d_strtoull'
24740 d_strtouq='$d_strtouq'
24741 d_strxfrm='$d_strxfrm'
24742 d_suidsafe='$d_suidsafe'
24743 d_symlink='$d_symlink'
24744 d_syscall='$d_syscall'
24745 d_syscallproto='$d_syscallproto'
24746 d_sysconf='$d_sysconf'
24747 d_sysernlst='$d_sysernlst'
24748 d_syserrlst='$d_syserrlst'
24749 d_system='$d_system'
24750 d_tcgetpgrp='$d_tcgetpgrp'
24751 d_tcsetpgrp='$d_tcsetpgrp'
24752 d_telldir='$d_telldir'
24753 d_telldirproto='$d_telldirproto'
24754 d_tgamma='$d_tgamma'
24756 d_timegm='$d_timegm'
24758 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24759 d_tm_tm_zone='$d_tm_tm_zone'
24760 d_tmpnam_r='$d_tmpnam_r'
24762 d_truncate='$d_truncate'
24763 d_truncl='$d_truncl'
24764 d_ttyname_r='$d_ttyname_r'
24765 d_tzname='$d_tzname'
24766 d_u32align='$d_u32align'
24767 d_ualarm='$d_ualarm'
24770 d_union_semun='$d_union_semun'
24771 d_unordered='$d_unordered'
24772 d_unsetenv='$d_unsetenv'
24773 d_uselocale='$d_uselocale'
24774 d_usleep='$d_usleep'
24775 d_usleepproto='$d_usleepproto'
24777 d_vendorarch='$d_vendorarch'
24778 d_vendorbin='$d_vendorbin'
24779 d_vendorlib='$d_vendorlib'
24780 d_vendorscript='$d_vendorscript'
24782 d_void_closedir='$d_void_closedir'
24783 d_voidsig='$d_voidsig'
24784 d_voidtty='$d_voidtty'
24785 d_volatile='$d_volatile'
24786 d_vprintf='$d_vprintf'
24787 d_vsnprintf='$d_vsnprintf'
24789 d_waitpid='$d_waitpid'
24790 d_wcscmp='$d_wcscmp'
24791 d_wcstombs='$d_wcstombs'
24792 d_wcsxfrm='$d_wcsxfrm'
24793 d_wctomb='$d_wctomb'
24794 d_writev='$d_writev'
24797 db_hashtype='$db_hashtype'
24798 db_prefixtype='$db_prefixtype'
24799 db_version_major='$db_version_major'
24800 db_version_minor='$db_version_minor'
24801 db_version_patch='$db_version_patch'
24802 direntrytype='$direntrytype'
24805 doubleinfbytes='$doubleinfbytes'
24806 doublekind='$doublekind'
24807 doublemantbits='$doublemantbits'
24808 doublenanbytes='$doublenanbytes'
24809 doublesize='$doublesize'
24811 drand48_r_proto='$drand48_r_proto'
24813 dtraceobject='$dtraceobject'
24814 dynamic_ext='$dynamic_ext'
24820 endgrent_r_proto='$endgrent_r_proto'
24821 endhostent_r_proto='$endhostent_r_proto'
24822 endnetent_r_proto='$endnetent_r_proto'
24823 endprotoent_r_proto='$endprotoent_r_proto'
24824 endpwent_r_proto='$endpwent_r_proto'
24825 endservent_r_proto='$endservent_r_proto'
24826 eunicefix='$eunicefix'
24829 extensions='$extensions'
24830 extern_C='$extern_C'
24832 fflushNULL='$fflushNULL'
24833 fflushall='$fflushall'
24835 firstmakefile='$firstmakefile'
24837 fpossize='$fpossize'
24838 fpostype='$fpostype'
24839 freetype='$freetype'
24842 full_csh='$full_csh'
24843 full_sed='$full_sed'
24844 gccansipedantic='$gccansipedantic'
24845 gccosandvers='$gccosandvers'
24846 gccversion='$gccversion'
24847 getgrent_r_proto='$getgrent_r_proto'
24848 getgrgid_r_proto='$getgrgid_r_proto'
24849 getgrnam_r_proto='$getgrnam_r_proto'
24850 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24851 gethostbyname_r_proto='$gethostbyname_r_proto'
24852 gethostent_r_proto='$gethostent_r_proto'
24853 getlogin_r_proto='$getlogin_r_proto'
24854 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24855 getnetbyname_r_proto='$getnetbyname_r_proto'
24856 getnetent_r_proto='$getnetent_r_proto'
24857 getprotobyname_r_proto='$getprotobyname_r_proto'
24858 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24859 getprotoent_r_proto='$getprotoent_r_proto'
24860 getpwent_r_proto='$getpwent_r_proto'
24861 getpwnam_r_proto='$getpwnam_r_proto'
24862 getpwuid_r_proto='$getpwuid_r_proto'
24863 getservbyname_r_proto='$getservbyname_r_proto'
24864 getservbyport_r_proto='$getservbyport_r_proto'
24865 getservent_r_proto='$getservent_r_proto'
24866 getspnam_r_proto='$getspnam_r_proto'
24867 gidformat='$gidformat'
24873 gmtime_r_proto='$gmtime_r_proto'
24874 gnulibc_version='$gnulibc_version'
24876 groupcat='$groupcat'
24877 groupstype='$groupstype'
24880 h_sysfile='$h_sysfile'
24883 hostgenerate='$hostgenerate'
24884 hostosname='$hostosname'
24885 hostperl='$hostperl'
24886 html1dir='$html1dir'
24887 html1direxp='$html1direxp'
24888 html3dir='$html3dir'
24889 html3direxp='$html3direxp'
24898 i_arpainet='$i_arpainet'
24899 i_assert='$i_assert'
24901 i_bsdioctl='$i_bsdioctl'
24905 i_dirent='$i_dirent'
24907 i_execinfo='$i_execinfo'
24912 i_fp_class='$i_fp_class'
24914 i_gdbm_ndbm='$i_gdbm_ndbm'
24915 i_gdbmndbm='$i_gdbmndbm'
24917 i_ieeefp='$i_ieeefp'
24918 i_inttypes='$i_inttypes'
24919 i_langinfo='$i_langinfo'
24920 i_libutil='$i_libutil'
24921 i_limits='$i_limits'
24922 i_locale='$i_locale'
24923 i_machcthr='$i_machcthr'
24924 i_malloc='$i_malloc'
24925 i_mallocmalloc='$i_mallocmalloc'
24927 i_memory='$i_memory'
24928 i_mntent='$i_mntent'
24931 i_neterrno='$i_neterrno'
24932 i_netinettcp='$i_netinettcp'
24936 i_pthread='$i_pthread'
24938 i_quadmath='$i_quadmath'
24939 i_rpcsvcdbm='$i_rpcsvcdbm'
24941 i_shadow='$i_shadow'
24943 i_stdarg='$i_stdarg'
24944 i_stdbool='$i_stdbool'
24945 i_stddef='$i_stddef'
24946 i_stdint='$i_stdint'
24947 i_stdlib='$i_stdlib'
24948 i_string='$i_string'
24949 i_sunmath='$i_sunmath'
24950 i_sysaccess='$i_sysaccess'
24951 i_sysdir='$i_sysdir'
24952 i_sysfile='$i_sysfile'
24953 i_sysfilio='$i_sysfilio'
24955 i_sysioctl='$i_sysioctl'
24956 i_syslog='$i_syslog'
24957 i_sysmman='$i_sysmman'
24958 i_sysmode='$i_sysmode'
24959 i_sysmount='$i_sysmount'
24960 i_sysndir='$i_sysndir'
24961 i_sysparam='$i_sysparam'
24962 i_syspoll='$i_syspoll'
24963 i_sysresrc='$i_sysresrc'
24964 i_syssecrt='$i_syssecrt'
24965 i_sysselct='$i_sysselct'
24966 i_syssockio='$i_syssockio'
24967 i_sysstat='$i_sysstat'
24968 i_sysstatfs='$i_sysstatfs'
24969 i_sysstatvfs='$i_sysstatvfs'
24970 i_systime='$i_systime'
24971 i_systimek='$i_systimek'
24972 i_systimes='$i_systimes'
24973 i_systypes='$i_systypes'
24974 i_sysuio='$i_sysuio'
24976 i_sysutsname='$i_sysutsname'
24977 i_sysvfs='$i_sysvfs'
24978 i_syswait='$i_syswait'
24979 i_termio='$i_termio'
24980 i_termios='$i_termios'
24982 i_unistd='$i_unistd'
24985 i_values='$i_values'
24986 i_varargs='$i_varargs'
24987 i_varhdr='$i_varhdr'
24989 i_xlocale='$i_xlocale'
24990 ignore_versioned_solibs='$ignore_versioned_solibs'
24991 inc_version_list='$inc_version_list'
24992 inc_version_list_init='$inc_version_list_init'
24996 initialinstalllocation='$initialinstalllocation'
24997 installarchlib='$installarchlib'
24998 installbin='$installbin'
24999 installhtml1dir='$installhtml1dir'
25000 installhtml3dir='$installhtml3dir'
25001 installman1dir='$installman1dir'
25002 installman3dir='$installman3dir'
25003 installprefix='$installprefix'
25004 installprefixexp='$installprefixexp'
25005 installprivlib='$installprivlib'
25006 installscript='$installscript'
25007 installsitearch='$installsitearch'
25008 installsitebin='$installsitebin'
25009 installsitehtml1dir='$installsitehtml1dir'
25010 installsitehtml3dir='$installsitehtml3dir'
25011 installsitelib='$installsitelib'
25012 installsiteman1dir='$installsiteman1dir'
25013 installsiteman3dir='$installsiteman3dir'
25014 installsitescript='$installsitescript'
25015 installstyle='$installstyle'
25016 installusrbinperl='$installusrbinperl'
25017 installvendorarch='$installvendorarch'
25018 installvendorbin='$installvendorbin'
25019 installvendorhtml1dir='$installvendorhtml1dir'
25020 installvendorhtml3dir='$installvendorhtml3dir'
25021 installvendorlib='$installvendorlib'
25022 installvendorman1dir='$installvendorman1dir'
25023 installvendorman3dir='$installvendorman3dir'
25024 installvendorscript='$installvendorscript'
25026 issymlink='$issymlink'
25027 ivdformat='$ivdformat'
25030 known_extensions='$known_extensions'
25033 ld_can_script='$ld_can_script'
25034 lddlflags='$lddlflags'
25036 ldflags_uselargefiles='$ldflags_uselargefiles'
25037 ldlibpthname='$ldlibpthname'
25044 libsdirs='$libsdirs'
25045 libsfiles='$libsfiles'
25046 libsfound='$libsfound'
25047 libspath='$libspath'
25048 libswanted='$libswanted'
25049 libswanted_uselargefiles='$libswanted_uselargefiles'
25055 localtime_r_proto='$localtime_r_proto'
25056 locincpth='$locincpth'
25057 loclibpth='$loclibpth'
25058 longdblinfbytes='$longdblinfbytes'
25059 longdblkind='$longdblkind'
25060 longdblmantbits='$longdblmantbits'
25061 longdblnanbytes='$longdblnanbytes'
25062 longdblsize='$longdblsize'
25063 longlongsize='$longlongsize'
25064 longsize='$longsize'
25068 lseeksize='$lseeksize'
25069 lseektype='$lseektype'
25073 make_set_make='$make_set_make'
25074 mallocobj='$mallocobj'
25075 mallocsrc='$mallocsrc'
25076 malloctype='$malloctype'
25078 man1direxp='$man1direxp'
25081 man3direxp='$man3direxp'
25083 mips_type='$mips_type'
25084 mistrustnm='$mistrustnm'
25086 mmaptype='$mmaptype'
25087 modetype='$modetype'
25089 multiarch='$multiarch'
25091 myarchname='$myarchname'
25092 mydomain='$mydomain'
25093 myhostname='$myhostname'
25096 need_va_copy='$need_va_copy'
25097 netdb_hlen_type='$netdb_hlen_type'
25098 netdb_host_type='$netdb_host_type'
25099 netdb_name_type='$netdb_name_type'
25100 netdb_net_type='$netdb_net_type'
25103 nm_so_opt='$nm_so_opt'
25104 nonxs_ext='$nonxs_ext'
25106 nvEUformat='$nvEUformat'
25107 nvFUformat='$nvFUformat'
25108 nvGUformat='$nvGUformat'
25109 nv_overflows_integers_at='$nv_overflows_integers_at'
25110 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25111 nveformat='$nveformat'
25112 nvfformat='$nvfformat'
25113 nvgformat='$nvgformat'
25114 nvmantbits='$nvmantbits'
25117 o_nonblock='$o_nonblock'
25119 old_pthread_create_joinable='$old_pthread_create_joinable'
25120 optimize='$optimize'
25121 orderlib='$orderlib'
25124 otherlibdirs='$otherlibdirs'
25128 patchlevel='$patchlevel'
25129 path_sep='$path_sep'
25132 perl_patchlevel='$perl_patchlevel'
25133 perl_static_inline='$perl_static_inline'
25134 perladmin='$perladmin'
25135 perllibs='$perllibs'
25136 perlpath='$perlpath'
25138 phostname='$phostname'
25144 prefixexp='$prefixexp'
25146 privlibexp='$privlibexp'
25147 procselfexe='$procselfexe'
25148 prototype='$prototype'
25150 quadkind='$quadkind'
25151 quadtype='$quadtype'
25152 randbits='$randbits'
25153 randfunc='$randfunc'
25154 random_r_proto='$random_r_proto'
25155 randseedtype='$randseedtype'
25157 rd_nodata='$rd_nodata'
25158 readdir64_r_proto='$readdir64_r_proto'
25159 readdir_r_proto='$readdir_r_proto'
25160 revision='$revision'
25166 sGMTIME_max='$sGMTIME_max'
25167 sGMTIME_min='$sGMTIME_min'
25168 sLOCALTIME_max='$sLOCALTIME_max'
25169 sLOCALTIME_min='$sLOCALTIME_min'
25170 sPRIEUldbl='$sPRIEUldbl'
25171 sPRIFUldbl='$sPRIFUldbl'
25172 sPRIGUldbl='$sPRIGUldbl'
25173 sPRIXU64='$sPRIXU64'
25175 sPRIeldbl='$sPRIeldbl'
25176 sPRIfldbl='$sPRIfldbl'
25177 sPRIgldbl='$sPRIgldbl'
25182 sSCNfldbl='$sSCNfldbl'
25183 sched_yield='$sched_yield'
25184 scriptdir='$scriptdir'
25185 scriptdirexp='$scriptdirexp'
25187 seedfunc='$seedfunc'
25188 selectminbits='$selectminbits'
25189 selecttype='$selecttype'
25190 sendmail='$sendmail'
25191 setgrent_r_proto='$setgrent_r_proto'
25192 sethostent_r_proto='$sethostent_r_proto'
25193 setlocale_r_proto='$setlocale_r_proto'
25194 setnetent_r_proto='$setnetent_r_proto'
25195 setprotoent_r_proto='$setprotoent_r_proto'
25196 setpwent_r_proto='$setpwent_r_proto'
25197 setservent_r_proto='$setservent_r_proto'
25200 sharpbang='$sharpbang'
25201 shmattype='$shmattype'
25202 shortsize='$shortsize'
25205 sig_count='$sig_count'
25206 sig_name='$sig_name'
25207 sig_name_init='$sig_name_init'
25209 sig_num_init='$sig_num_init'
25210 sig_size='$sig_size'
25211 signal_t='$signal_t'
25212 sitearch='$sitearch'
25213 sitearchexp='$sitearchexp'
25215 sitebinexp='$sitebinexp'
25216 sitehtml1dir='$sitehtml1dir'
25217 sitehtml1direxp='$sitehtml1direxp'
25218 sitehtml3dir='$sitehtml3dir'
25219 sitehtml3direxp='$sitehtml3direxp'
25221 sitelib_stem='$sitelib_stem'
25222 sitelibexp='$sitelibexp'
25223 siteman1dir='$siteman1dir'
25224 siteman1direxp='$siteman1direxp'
25225 siteman3dir='$siteman3dir'
25226 siteman3direxp='$siteman3direxp'
25227 siteprefix='$siteprefix'
25228 siteprefixexp='$siteprefixexp'
25229 sitescript='$sitescript'
25230 sitescriptexp='$sitescriptexp'
25231 sizesize='$sizesize'
25232 sizetype='$sizetype'
25236 sockethdr='$sockethdr'
25237 socketlib='$socketlib'
25238 socksizetype='$socksizetype'
25240 spackage='$spackage'
25241 spitshell='$spitshell'
25242 srand48_r_proto='$srand48_r_proto'
25243 srandom_r_proto='$srandom_r_proto'
25245 ssizetype='$ssizetype'
25246 st_ino_sign='$st_ino_sign'
25247 st_ino_size='$st_ino_size'
25248 startperl='$startperl'
25250 static_ext='$static_ext'
25252 stdio_base='$stdio_base'
25253 stdio_bufsiz='$stdio_bufsiz'
25254 stdio_cnt='$stdio_cnt'
25255 stdio_filbuf='$stdio_filbuf'
25256 stdio_ptr='$stdio_ptr'
25257 stdio_stream_array='$stdio_stream_array'
25258 strerror_r_proto='$strerror_r_proto'
25261 subversion='$subversion'
25266 targetarch='$targetarch'
25267 targetdir='$targetdir'
25268 targetenv='$targetenv'
25269 targethost='$targethost'
25270 targetmkdir='$targetmkdir'
25271 targetport='$targetport'
25272 targetsh='$targetsh'
25276 timeincl='$timeincl'
25277 timetype='$timetype'
25278 tmpnam_r_proto='$tmpnam_r_proto'
25284 ttyname_r_proto='$ttyname_r_proto'
25293 uidformat='$uidformat'
25299 uquadtype='$uquadtype'
25300 use5005threads='$use5005threads'
25301 use64bitall='$use64bitall'
25302 use64bitint='$use64bitint'
25303 usecbacktrace='$usecbacktrace'
25304 usecrosscompile='$usecrosscompile'
25305 usedevel='$usedevel'
25307 usedtrace='$usedtrace'
25308 usefaststdio='$usefaststdio'
25309 useithreads='$useithreads'
25310 usekernprocpathname='$usekernprocpathname'
25311 uselargefiles='$uselargefiles'
25312 uselongdouble='$uselongdouble'
25313 usemallocwrap='$usemallocwrap'
25314 usemorebits='$usemorebits'
25315 usemultiplicity='$usemultiplicity'
25316 usemymalloc='$usemymalloc'
25318 usensgetexecutablepath='$usensgetexecutablepath'
25319 useopcode='$useopcode'
25320 useperlio='$useperlio'
25321 useposix='$useposix'
25322 usequadmath='$usequadmath'
25323 usereentrant='$usereentrant'
25324 userelocatableinc='$userelocatableinc'
25325 useshrplib='$useshrplib'
25326 usesitecustomize='$usesitecustomize'
25327 usesocks='$usesocks'
25328 usethreads='$usethreads'
25329 usevendorprefix='$usevendorprefix'
25330 useversionedarchname='$useversionedarchname'
25331 usevfork='$usevfork'
25334 uvXUformat='$uvXUformat'
25335 uvoformat='$uvoformat'
25338 uvuformat='$uvuformat'
25339 uvxformat='$uvxformat'
25341 vendorarch='$vendorarch'
25342 vendorarchexp='$vendorarchexp'
25343 vendorbin='$vendorbin'
25344 vendorbinexp='$vendorbinexp'
25345 vendorhtml1dir='$vendorhtml1dir'
25346 vendorhtml1direxp='$vendorhtml1direxp'
25347 vendorhtml3dir='$vendorhtml3dir'
25348 vendorhtml3direxp='$vendorhtml3direxp'
25349 vendorlib='$vendorlib'
25350 vendorlib_stem='$vendorlib_stem'
25351 vendorlibexp='$vendorlibexp'
25352 vendorman1dir='$vendorman1dir'
25353 vendorman1direxp='$vendorman1direxp'
25354 vendorman3dir='$vendorman3dir'
25355 vendorman3direxp='$vendorman3direxp'
25356 vendorprefix='$vendorprefix'
25357 vendorprefixexp='$vendorprefixexp'
25358 vendorscript='$vendorscript'
25359 vendorscriptexp='$vendorscriptexp'
25361 version_patchlevel_string='$version_patchlevel_string'
25362 versiononly='$versiononly'
25366 yaccflags='$yaccflags'
25371 : add special variables
25372 $test -f $src/patchlevel.h && \
25373 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25374 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25375 echo "PERL_CONFIG_SH=true" >>config.sh
25377 : propagate old symbols
25378 if $test -f UU/config.sh; then
25379 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25380 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25381 config.sh config.sh UU/oldconfig.sh |\
25382 $sort | $uniq -u >UU/oldsyms
25383 set X `$cat UU/oldsyms`
25389 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25391 echo ": Variables propagated from previous config.sh file." >>config.sh
25392 for sym in `$cat UU/oldsyms`; do
25393 echo " Propagating $hint variable "'$'"$sym..."
25394 eval 'tmp="$'"${sym}"'"'
25396 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25402 : preserve RCS keywords in files with variable substitution, grrr
25405 : Finish up by extracting the .SH files
25408 echo "Stopping at your request, leaving temporary files around."
25418 If you'd like to make any changes to the config.sh file before I begin
25419 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25422 rp="Press return or use a shell escape to edit config.sh:"
25427 *) : in case they cannot read
25428 sh 1>&4 -c "$ans";;
25433 : if this fails, just run all the .SH files by hand
25442 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25449 Now you need to generate make dependencies by running "$make depend".
25450 You might prefer to run it in background: "$make depend > makedepend.out &"
25451 It can take a while, so you might not want to run it right now.
25456 rp="Run $make depend now?"
25460 $make depend && echo "Now you must run '$make'."
25463 echo "You must run '$make depend' then '$make'."
25466 elif test -f [Mm]akefile; then
25468 echo "Now you must run a $make."
25470 echo "Configure done."
25473 if $test -f Policy.sh; then
25476 If you compile $package on a different machine or from a different object
25477 directory, copy the Policy.sh file from this object directory to the
25478 new one before you run Configure -- this will help you with most of
25479 the policy defaults.
25483 if $test -f UU/config.msg; then
25484 echo "Hmm. I also noted the following information while running:"
25486 $cat UU/config.msg >&4
25488 $rm -f kit*isdone ark*isdone