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. */
10164 if (b[0] == 0xC0 && b[3] == 0x9A) {
10165 /* IBM single 32-bit */
10170 #if DOUBLESIZE == 8
10171 if (b[0] == 0x9A && b[7] == 0xBF) {
10172 /* IEEE 754 64-bit little-endian */
10176 if (b[0] == 0xBF && b[7] == 0x9A) {
10177 /* IEEE 754 64-bit big-endian */
10181 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10182 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10183 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10184 * 99 99 b9 bf 9a 99 99 99 */
10188 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10189 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10190 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10191 * 99 99 99 9a bf b9 99 99 */
10195 if (b[0] == 0xCC && b[7] == 0xCC) {
10196 /* VAX format D, 64-bit PDP-style mixed endian. */
10200 if (b[0] == 0xD9 && b[7] == 0x99) {
10201 /* VAX format G, 64-bit PDP-style mixed endian. */
10205 if (b[0] == 0xC0 && b[7] == 0x9A) {
10206 /* IBM double 64-bit */
10210 if (b[0] == 0xBF && b[7] == 0xCD) {
10211 /* CRAY single 64-bit */
10216 #if DOUBLESIZE == 16
10217 if (b[0] == 0x9A && b[15] == 0xBF) {
10218 /* IEEE 754 128-bit little-endian */
10222 if (b[0] == 0xBF && b[15] == 0x9A) {
10223 /* IEEE 754 128-bit big-endian */
10228 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10229 * Whether those environments can still build Perl is debatable. */
10230 printf("-1\n"); /* unknown */
10235 if eval $compile; then
10236 doublekind=`$run ./try`
10240 case "$doublekind" in
10241 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10242 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10243 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10244 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10245 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10246 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10247 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10248 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10249 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10250 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10251 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10252 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10253 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10254 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10255 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10259 : Check print/scan long double stuff
10262 if $test X"$d_longdbl" = X"$define"; then
10264 echo "Checking how to print long doubles..." >&4
10266 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10267 $cat >try.c <<'EOCP'
10268 #include <sys/types.h>
10271 double d = 123.456;
10272 printf("%.3f\n", d);
10276 if eval $compile; then
10280 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10281 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10282 echo "We will use %f."
10288 if $test X"$sPRIfldbl" = X; then
10289 $cat >try.c <<'EOCP'
10290 #include <sys/types.h>
10293 long double d = 123.456;
10294 printf("%.3Lf\n", d);
10298 if eval $compile; then
10302 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10303 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10304 echo "We will use %Lf."
10310 if $test X"$sPRIfldbl" = X; then
10311 $cat >try.c <<'EOCP'
10312 #include <sys/types.h>
10315 long double d = 123.456;
10316 printf("%.3llf\n", d);
10320 if eval $compile; then
10324 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10325 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10326 echo "We will use %llf."
10332 if $test X"$sPRIfldbl" = X; then
10333 $cat >try.c <<'EOCP'
10334 #include <sys/types.h>
10337 long double d = 123.456;
10338 printf("%.3lf\n", d);
10342 if eval $compile; then
10346 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10347 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10348 echo "We will use %lf."
10354 if $test X"$sPRIfldbl" = X; then
10355 echo "Cannot figure out how to print long doubles." >&4
10357 sSCNfldbl=$sPRIfldbl # expect consistency
10364 case "$sPRIfldbl" in
10365 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10366 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10367 d_SCNfldbl="$undef";
10369 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10370 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10371 d_SCNfldbl="$define";
10375 : Before committing on uselongdouble, see whether that looks sane.
10376 if $test "$uselongdouble" = "$define"; then
10379 echo "Checking if your long double math functions work right..." >&4
10384 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10387 case "$osname:$gccversion" in
10388 aix:) saveccflags="$ccflags"
10389 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10392 if eval $compile_ok; then
10396 3) echo "Your long double math functions are working correctly." >&4 ;;
10397 *) echo "Your long double math functions are broken, not using long doubles." >&4
10398 uselongdouble=$undef
10402 case "$osname:$gccversion" in
10403 aix:) ccflags="$saveccflags" ;; # restore
10407 : Check how to convert floats to strings.
10409 if test "X$d_Gconvert" = X; then
10412 echo "Checking for an efficient way to convert floats to strings."
10414 case "$uselongdouble" in
10415 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10417 case "$d_longdbl" in
10418 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10420 case "$d_PRIgldbl" in
10421 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10424 #ifdef TRY_gconvert
10425 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10426 char *myname = "gconvert";
10429 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10430 char *myname = "gcvt";
10433 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10434 char *myname = "qgcvt";
10435 #define DOUBLETYPE long double
10438 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10439 #ifdef HAS_PRIgldbl
10440 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10442 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10445 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10447 char *myname = "sprintf";
10451 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10452 #define DOUBLETYPE long double
10454 #define DOUBLETYPE double
10460 #$i_stdlib I_STDLIB
10462 #include <stdlib.h>
10464 #$i_string I_STRING
10466 # include <string.h>
10468 # include <strings.h>
10471 int checkit(char *expect, char *got)
10473 if (strcmp(expect, got)) {
10474 printf("%s oddity: Expected %s, got %s\n",
10475 myname, expect, got);
10485 /* This must be 1st test on (which?) platform */
10486 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10487 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10488 checkit("0.1", buf);
10490 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10491 checkit("0.01", buf);
10493 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10494 checkit("0.001", buf);
10496 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10497 checkit("0.0001", buf);
10499 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10500 if (strlen(buf) > 5)
10501 checkit("9e-005", buf); /* for Microsoft ?? */
10503 checkit("9e-05", buf);
10505 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10508 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10509 checkit("1.1", buf);
10511 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10512 checkit("1.01", buf);
10514 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10515 checkit("1.001", buf);
10517 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10518 checkit("1.0001", buf);
10520 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10521 checkit("1.00001", buf);
10523 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10524 checkit("1.000001", buf);
10526 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10529 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10530 checkit("-1", buf);
10532 /* Some Linux gcvt's give 1.e+5 here. */
10533 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10534 checkit("100000", buf);
10536 /* Some Linux gcvt's give -1.e+5 here. */
10537 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10538 checkit("-100000", buf);
10540 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10541 checkit("123.456", buf);
10543 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10544 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10545 /* 34 should be enough to scare even long double
10546 * places into using the e notation. */
10547 if (strlen(buf) > 5)
10548 checkit("1e+034", buf); /* for Microsoft */
10550 checkit("1e+34", buf);
10552 /* For Perl, if you add additional tests here, also add them to
10553 * t/base/num.t for benefit of platforms not using Configure or
10554 * overriding d_Gconvert */
10559 : first add preferred functions to our list
10561 for xxx_convert in $gconvert_preference; do
10562 case $xxx_convert in
10563 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10564 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10567 : then add any others
10568 for xxx_convert in gconvert gcvt sprintf; do
10569 case "$xxx_list" in
10571 *) xxx_list="$xxx_list $xxx_convert" ;;
10575 case "$d_longdbl$uselongdouble" in
10577 : again, add preferred functions to our list first
10579 for xxx_convert in $gconvert_ld_preference; do
10580 case $xxx_convert in
10581 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10582 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10585 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10586 for xxx_convert in qgcvt sprintf $xxx_list; do
10587 case "$xxx_ld_list" in
10588 $xxx_convert*|*" $xxx_convert"*) ;;
10589 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10592 : if sprintf cannot do long doubles, move it to the end
10593 if test "$d_PRIgldbl" != "$define"; then
10594 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10596 : if no qgcvt, remove it
10597 if test "$d_qgcvt" != "$define"; then
10598 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10601 xxx_list="$xxx_ld_list"
10605 for xxx_convert in $xxx_list; do
10606 echo "Trying $xxx_convert..."
10607 $rm -f try try$_o core
10608 set try -DTRY_$xxx_convert
10609 if eval $compile; then
10610 echo "$xxx_convert() found." >&4
10611 if $run ./try; then
10612 echo "I'll use $xxx_convert to convert floats into a string." >&4
10615 echo "...But $xxx_convert didn't work as I expected."
10619 echo "$xxx_convert NOT found." >&4
10623 if test X$xxx_convert = X; then
10624 echo "*** WHOA THERE!!! ***" >&4
10625 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10626 xxx_convert=sprintf
10629 case "$xxx_convert" in
10630 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10631 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10632 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10633 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10634 "$define$define$define")
10635 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10636 "$define$define$undef")
10637 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10638 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10646 : see if _fwalk exists
10650 : Initialize h_fcntl
10653 : Initialize h_sysfile
10656 : access call always available on UNIX
10657 set access d_access
10660 : locate the flags for 'access()'
10661 case "$d_access" in
10664 $cat >access.c <<EOCP
10665 #include <sys/types.h>
10670 #include <sys/file.h>
10673 #include <unistd.h>
10675 #$i_stdlib I_STDLIB
10677 #include <stdlib.h>
10683 : check sys/file.h first, no particular reason here
10684 if $test `./findhdr sys/file.h` && \
10685 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10687 echo "<sys/file.h> defines the *_OK access constants." >&4
10688 elif $test `./findhdr fcntl.h` && \
10689 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10691 echo "<fcntl.h> defines the *_OK access constants." >&4
10692 elif $test `./findhdr unistd.h` && \
10693 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10694 echo "<unistd.h> defines the *_OK access constants." >&4
10696 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10702 : see if accessx exists
10703 set accessx d_accessx
10706 : see if acosh exists
10710 : see if aintl exists
10714 : see if alarm exists
10718 : see if 64bit time functions exists
10720 set ctime64 d_ctime64
10723 set localtime64 d_localtime64
10726 set gmtime64 d_gmtime64
10729 set mktime64 d_mktime64
10732 set difftime64 d_difftime64
10735 set asctime64 d_asctime64
10738 : see if POSIX threads are available
10739 set pthread.h i_pthread
10742 : define a function to check prototypes
10743 $cat > protochk <<EOSH
10746 optimize="$optimize"
10748 prototype="$prototype"
10751 usethreads=$usethreads
10752 i_pthread=$i_pthread
10753 pthread_h_first=$pthread_h_first
10756 $cat >> protochk <<'EOSH'
10761 while test $# -ge 2; do
10763 $define) echo "#include <$2>" >> try.c ;;
10764 literal) echo "$2" >> try.c ;;
10766 # Extra magic for the benefit of systems that need pthread.h
10767 # to be included early to correctly detect threadsafe functions.
10768 # Such functions must guarantee themselves, though, that the usethreads
10769 # and i_pthread have been defined, before calling protochk.
10770 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10771 echo "#include <pthread.h>" >> try.c
10776 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10777 cat >> try.c <<'EOCP'
10778 #ifdef CAN_PROTOTYPE
10779 #define _(args) args
10784 echo "$foo" >> try.c
10785 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10786 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10792 $eunicefix protochk
10794 : Define hasproto macro for Configure internal use
10795 hasproto='varname=$1; func=$2; shift; shift;
10796 while $test $# -ge 2; do
10798 $define) echo "#include <$2>";;
10802 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10803 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10804 echo "$func() prototype found.";
10807 echo "$func() prototype NOT found.";
10814 : see if sys/types.h has to be included
10815 set sys/types.h i_systypes
10818 : see if sys/select.h has to be included
10819 set sys/select.h i_sysselct
10822 : Define hasfield macro for Configure internal use
10823 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10824 while $test $# -ge 2; do
10826 $define) echo "#include <$2>";;
10830 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10832 if eval $compile; then
10841 : see if we should include time.h, sys/time.h, or both
10843 if test "X$timeincl" = X; then
10844 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10845 $echo $n "I'm now running the test program...$c"
10847 #include <sys/types.h>
10852 #ifdef SYSTIMEKERNEL
10855 #include <sys/time.h>
10858 #include <sys/select.h>
10860 #$i_stdlib I_STDLIB
10862 #include <stdlib.h>
10868 struct timeval bar;
10871 struct timezone tzp;
10873 if (foo.tm_sec == foo.tm_sec)
10876 if (bar.tv_sec == bar.tv_sec)
10883 for s_timezone in '-DS_TIMEZONE' ''; do
10885 for s_timeval in '-DS_TIMEVAL' ''; do
10886 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10887 for i_time in '' '-DI_TIME'; do
10888 for i_systime in '-DI_SYSTIME' ''; do
10891 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10892 if eval $compile; then
10893 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10897 $echo $n "Succeeded with $flags$c"
10909 *SYSTIMEKERNEL*) i_systimek="$define"
10910 timeincl=`./findhdr sys/time.h`
10911 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10912 *) i_systimek="$undef";;
10915 *I_TIME*) i_time="$define"
10916 timeincl=`./findhdr time.h`" $timeincl"
10917 echo "We'll include <time.h>." >&4;;
10918 *) i_time="$undef";;
10921 *I_SYSTIME*) i_systime="$define"
10922 timeincl=`./findhdr sys/time.h`" $timeincl"
10923 echo "We'll include <sys/time.h>." >&4;;
10924 *) i_systime="$undef";;
10928 : see if struct tm knows about tm_zone
10929 case "$i_systime$i_time" in
10932 echo "Checking to see if your struct tm has tm_zone field..." >&4
10933 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10941 case "$d_tm_tm_zone" in
10942 "$define") echo "Yes, it does." ;;
10943 *) echo "No, it doesn't." ;;
10945 : see if struct tm knows about tm_gmtoff
10946 case "$i_systime$i_time" in
10949 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10950 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10958 case "$d_tm_tm_gmtoff" in
10959 "$define") echo "Yes, it does." ;;
10960 *) echo "No, it doesn't." ;;
10963 : see if asctime_r exists
10964 set asctime_r d_asctime_r
10966 case "$d_asctime_r" in
10968 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10969 case "$d_asctime_r_proto:$usethreads" in
10970 ":define") d_asctime_r_proto=define
10971 set d_asctime_r_proto asctime_r $hdrs
10975 case "$d_asctime_r_proto" in
10977 case "$asctime_r_proto" in
10978 ''|0) try='char* asctime_r(const struct tm*, char*);'
10979 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10981 case "$asctime_r_proto" in
10982 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10983 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10985 case "$asctime_r_proto" in
10986 ''|0) try='int asctime_r(const struct tm*, char*);'
10987 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10989 case "$asctime_r_proto" in
10990 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10991 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10993 case "$asctime_r_proto" in
10994 ''|0) d_asctime_r=undef
10996 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10997 * ) case "$asctime_r_proto" in
10998 REENTRANT_PROTO*) ;;
10999 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
11001 echo "Prototype: $try" ;;
11004 *) case "$usethreads" in
11005 define) echo "asctime_r has no prototype, not using it." >&4 ;;
11012 *) asctime_r_proto=0
11016 : see if asinh exists
11020 : see if atanh exists
11024 : see if atolf exists
11028 : see if atoll exists
11032 : Look for GCC-style attribute format
11033 case "$d_attribute_format" in
11036 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11037 $cat >attrib.c <<'EOCP'
11039 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11041 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11042 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11043 echo "Your C compiler doesn't support __attribute__((format))."
11046 echo "Your C compiler supports __attribute__((format))."
11050 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11054 *) val="$d_attribute_format" ;;
11056 set d_attribute_format
11060 : Look for GCC-style attribute format with null format allowed
11061 case "$d_printf_format_null" in
11062 '') case "$d_attribute_format" in
11065 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11066 $cat >attrib.c <<EOCP
11068 #$i_stdlib I_STDLIB
11070 #include <stdlib.h>
11072 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11073 int null_printf (char* pat,...) { return (int)pat; }
11074 int main () { exit(null_printf(NULL)); }
11076 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11077 : run the executable in case it produces a run-time warning
11078 if $run ./attrib >>attrib.out 2>&1; then
11079 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11080 echo "Your C compiler doesn't allow __printf__ format to be null."
11083 echo "Your C compiler allows __printf__ format to be null."
11087 echo "Your C compiler executable failed with __printf__ format null."
11091 echo "Your C compiler fails with __printf__ format null."
11098 *) val="$d_printf_format_null" ;;
11100 set d_printf_format_null
11104 : Look for GCC-style attribute malloc
11105 case "$d_attribute_malloc" in
11108 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11109 $cat >attrib.c <<'EOCP'
11111 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11113 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11114 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11115 echo "Your C compiler doesn't support __attribute__((malloc))."
11118 echo "Your C compiler supports __attribute__((malloc))."
11122 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11126 *) val="$d_attribute_malloc" ;;
11128 set d_attribute_malloc
11132 : Look for GCC-style attribute nonnull
11133 case "$d_attribute_nonnull" in
11136 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11137 $cat >attrib.c <<'EOCP'
11139 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11141 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11142 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11143 echo "Your C compiler doesn't support __attribute__((nonnull))."
11146 echo "Your C compiler supports __attribute__((nonnull))."
11150 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11154 *) val="$d_attribute_nonnull" ;;
11156 set d_attribute_nonnull
11160 : Look for GCC-style attribute noreturn
11161 case "$d_attribute_noreturn" in
11164 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11165 $cat >attrib.c <<'EOCP'
11167 void fall_over_dead( void ) __attribute__((noreturn));
11169 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11170 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11171 echo "Your C compiler doesn't support __attribute__((noreturn))."
11174 echo "Your C compiler supports __attribute__((noreturn))."
11178 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11182 *) val="$d_attribute_noreturn" ;;
11184 set d_attribute_noreturn
11188 : Look for GCC-style attribute pure
11189 case "$d_attribute_pure" in
11192 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11193 $cat >attrib.c <<'EOCP'
11195 int square( int n ) __attribute__((pure));
11197 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11198 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11199 echo "Your C compiler doesn't support __attribute__((pure))."
11202 echo "Your C compiler supports __attribute__((pure))."
11206 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11210 *) val="$d_attribute_pure" ;;
11212 set d_attribute_pure
11216 : Look for GCC-style attribute unused
11217 case "$d_attribute_unused" in
11220 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11221 $cat >attrib.c <<'EOCP'
11223 int do_something( int dummy __attribute__((unused)), int n );
11225 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11226 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11227 echo "Your C compiler doesn't support __attribute__((unused))."
11230 echo "Your C compiler supports __attribute__((unused))."
11234 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11238 *) val="$d_attribute_unused" ;;
11240 set d_attribute_unused
11244 : Look for GCC-style attribute deprecated
11245 case "$d_attribute_deprecated" in
11248 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11249 $cat >attrib.c <<'EOCP'
11251 int I_am_deprecated(void) __attribute__((deprecated));
11253 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11254 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11255 echo "Your C compiler doesn't support __attribute__((deprecated))."
11258 echo "Your C compiler supports __attribute__((deprecated))."
11262 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11266 *) val="$d_attribute_deprecated" ;;
11268 set d_attribute_deprecated
11272 : Look for GCC-style attribute warn_unused_result
11273 case "$d_attribute_warn_unused_result" in
11276 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11277 $cat >attrib.c <<'EOCP'
11279 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11281 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11282 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11283 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11286 echo "Your C compiler supports __attribute__((warn_unused_result))."
11290 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11294 *) val="$d_attribute_warn_unused_result" ;;
11296 set d_attribute_warn_unused_result
11300 : see if bcmp exists
11304 : see if bcopy exists
11308 : see if getpgrp exists
11309 set getpgrp d_getpgrp
11312 case "$d_getpgrp" in
11315 echo "Checking to see which flavor of getpgrp is in use..."
11317 #$i_unistd I_UNISTD
11318 #include <sys/types.h>
11320 # include <unistd.h>
11322 #$i_stdlib I_STDLIB
11324 #include <stdlib.h>
11328 if (getuid() == 0) {
11329 printf("(I see you are running Configure as super-user...)\n");
11332 #ifdef TRY_BSD_PGRP
11333 if (getpgrp(1) == 0)
11342 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11343 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11345 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11346 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11349 echo "I can't seem to compile and run the test program."
11351 xxx="a USG one, i.e. you use getpgrp()."
11353 # SVR4 systems can appear rather BSD-ish.
11354 case "$i_unistd" in
11356 xxx="a BSD one, i.e. you use getpgrp(pid)."
11360 xxx="probably a USG one, i.e. you use getpgrp()."
11365 echo "Assuming your getpgrp is $xxx" >&4
11374 : see if setpgrp exists
11375 set setpgrp d_setpgrp
11378 case "$d_setpgrp" in
11381 echo "Checking to see which flavor of setpgrp is in use..."
11383 #$i_unistd I_UNISTD
11384 #include <sys/types.h>
11386 # include <unistd.h>
11388 #$i_stdlib I_STDLIB
11390 #include <stdlib.h>
11394 if (getuid() == 0) {
11395 printf("(I see you are running Configure as super-user...)\n");
11398 #ifdef TRY_BSD_PGRP
11399 if (-1 == setpgrp(1, 1))
11402 if (setpgrp() != -1)
11408 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11409 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11411 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11412 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11415 echo "(I can't seem to compile and run the test program.)"
11417 xxx="a USG one, i.e. you use setpgrp()."
11419 # SVR4 systems can appear rather BSD-ish.
11420 case "$i_unistd" in
11422 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11426 xxx="probably a USG one, i.e. you use setpgrp()."
11431 echo "Assuming your setpgrp is $xxx" >&4
11440 : Look for GCC-style __builtin_choose_expr
11441 case "$d_builtin_choose_expr" in
11444 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11445 $cat >try.c <<'EOCP'
11446 #include <assert.h>
11447 #include <stdlib.h>
11450 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11453 assert( SYRINX(1) == 2112 );
11454 assert( SYRINX(1) != 5150 );
11455 assert( SYRINX(0) == 5150 );
11456 assert( SYRINX(0) != 2112 );
11457 puts( "All good!" );
11463 if eval $compile && $run ./try; then
11464 echo "Your C compiler supports __builtin_choose_expr."
11467 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11471 *) val="$d_builtin_choose_expr" ;;
11474 set d_builtin_choose_expr
11478 : Look for GCC-style __builtin_expect
11479 case "$d_builtin_expect" in
11482 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11483 $cat >try.c <<'EOCP'
11486 if ( __builtin_expect(n, 0) ) n = 1;
11487 /* Remember shell exit code truth is 0, C truth is non-zero */
11492 if eval $compile && $run ./try; then
11493 echo "Your C compiler supports __builtin_expect."
11496 echo "Your C compiler doesn't seem to understand __builtin_expect."
11500 *) val="$d_builtin_expect" ;;
11503 set d_builtin_expect
11507 : see if bzero exists
11511 : see if stdarg is available
11513 if $test `./findhdr stdarg.h`; then
11514 echo "<stdarg.h> found." >&4
11517 echo "<stdarg.h> NOT found." >&4
11521 : see if varargs is available
11523 if $test `./findhdr varargs.h`; then
11524 echo "<varargs.h> found." >&4
11526 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11529 : set up the varargs testing programs
11530 $cat > varargs.c <<EOP
11532 #include <stdarg.h>
11535 #include <varargs.h>
11539 int f(char *p, ...)
11553 p = va_arg(ap, char *);
11559 $cat > varargs <<EOP
11561 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11570 : now check which varargs header should be included
11576 if `./varargs I_STDARG`; then
11578 elif `./varargs I_VARARGS`; then
11583 if `./varargs I_VARARGS`; then
11591 echo "*** WHOA THERE!!! ***" >&4
11592 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11593 case "$knowitall" in
11595 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11599 echo "I could not find the definition for va_dcl... You have problems..." >&4
11600 val="$undef"; set i_stdarg; eval $setvar
11601 val="$undef"; set i_varargs; eval $setvar
11606 case "$i_varhdr" in
11608 val="$define"; set i_stdarg; eval $setvar
11609 val="$undef"; set i_varargs; eval $setvar
11612 val="$undef"; set i_stdarg; eval $setvar
11613 val="$define"; set i_varargs; eval $setvar
11616 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11620 : see if the Compiler supports C99 variadic macros
11621 case "$i_stdarg$i_stdlib" in
11623 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11626 #include <stdarg.h>
11628 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11632 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11638 if eval $compile && $run ./try 2>&1 >/dev/null; then
11639 case "`$run ./try`" in
11641 echo "You have C99 variadic macros." >&4
11642 d_c99_variadic_macros="$define"
11645 echo "You don't have functional C99 variadic macros." >&4
11646 d_c99_variadic_macros="$undef"
11650 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11651 d_c99_variadic_macros="$undef"
11656 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11657 d_c99_variadic_macros="$undef"
11661 : see if signal is declared as pointer to function returning int or void
11663 xxx=`./findhdr signal.h`
11664 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11665 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11666 echo "You have int (*signal())() instead of void." >&4
11668 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11669 echo "You have void (*signal())()." >&4
11671 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11672 echo "You have int (*signal())() instead of void." >&4
11674 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11675 echo "You have void (*signal())()." >&4
11678 case "$d_voidsig" in
11680 echo "I can't determine whether signal handler returns void or int..." >&4
11682 rp="What type does your signal handler return?"
11685 v*) val="$define";;
11689 echo "As you already told me, signal handler returns void." >&4
11692 *) echo "As you already told me, signal handler returns int." >&4
11699 case "$d_voidsig" in
11700 "$define") signal_t="void";;
11701 *) signal_t="int";;
11705 : check for ability to cast large floats to 32-bit ints.
11707 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11708 if $test "$intsize" -ge 4; then
11715 #$i_stdlib I_STDLIB
11717 #include <stdlib.h>
11719 #include <sys/types.h>
11720 #include <signal.h>
11721 $signal_t blech(int s) { exit(3); }
11728 signal(SIGFPE, blech);
11730 /* Don't let compiler optimize the test away. Store the number
11731 in a writable string for gcc to pass to sscanf under HP-UX.
11733 sprintf(str, "2147483647");
11734 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11738 /* x86 processors will probably give 0x8000 0000, which is a
11739 sign change. We don't want that. We want to mimic SPARC
11740 behavior here, which is to preserve the sign and give
11743 if (i32 != ($xxx) f)
11749 if eval $compile_ok; then
11750 $run ./try 2>/dev/null
11753 echo "(I can't seem to compile the test program--assuming it can't)"
11758 echo "Yup, it can."
11761 echo "Nope, it can't."
11768 : check for ability to cast negative floats to unsigned
11770 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11773 #$i_stdlib I_STDLIB
11775 #include <stdlib.h>
11777 #include <sys/types.h>
11778 #include <signal.h>
11779 $signal_t blech(int s) { exit(7); }
11780 $signal_t blech_in_list(int s) { exit(4); }
11781 unsigned long dummy_long(unsigned long p) { return p; }
11782 unsigned int dummy_int(unsigned int p) { return p; }
11783 unsigned short dummy_short(unsigned short p) { return p; }
11787 unsigned long along;
11789 unsigned short ashort;
11793 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11794 a direct f = -123. assignment. gcc-2.8.0 reportedly
11795 optimized the whole file away
11797 /* Store the number in a writable string for gcc to pass to
11798 sscanf under HP-UX.
11800 sprintf(str, "-123");
11801 sscanf(str, "%lf", &f); /* f = -123.; */
11803 signal(SIGFPE, blech);
11804 along = (unsigned long)f;
11805 aint = (unsigned int)f;
11806 ashort = (unsigned short)f;
11807 if (along != (unsigned long)-123)
11809 if (aint != (unsigned int)-123)
11811 if (ashort != (unsigned short)-123)
11813 sprintf(str, "1073741824.");
11814 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11817 along = (unsigned long)f;
11818 if (along != 0x80000000)
11822 along = (unsigned long)f;
11823 if (along != 0x7fffffff)
11827 along = (unsigned long)f;
11828 if (along != 0x80000001)
11832 signal(SIGFPE, blech_in_list);
11833 sprintf(str, "123.");
11834 sscanf(str, "%lf", &f); /* f = 123.; */
11835 along = dummy_long((unsigned long)f);
11836 aint = dummy_int((unsigned int)f);
11837 ashort = dummy_short((unsigned short)f);
11838 if (along != (unsigned long)123)
11840 if (aint != (unsigned int)123)
11842 if (ashort != (unsigned short)123)
11849 if eval $compile_ok; then
11850 $run ./try 2>/dev/null
11853 echo "(I can't seem to compile the test program--assuming it can't)"
11856 case "$castflags" in
11858 echo "Yup, it can."
11861 echo "Nope, it can't."
11868 : see if cbrt exists
11872 : see if vprintf exists
11874 if set vprintf val -f d_vprintf; eval $csym; $val; then
11875 echo 'vprintf() found.' >&4
11878 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11879 #$i_varargs I_VARARGS
11881 #$i_stdlib I_STDLIB
11882 #$i_unistd I_UNISTD
11885 # include <stdarg.h>
11886 #else /* I_VARARGS */
11887 # include <varargs.h>
11891 # include <unistd.h>
11895 # include <stdlib.h>
11898 #include <stdio.h> /* vsprintf prototype */
11901 void xxx(int n, ...)
11906 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11908 int main() { xxx(1, "foo"); }
11910 #else /* I_VARARGS */
11918 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11920 int main() { xxx("foo"); }
11926 if eval $compile_ok; then
11927 if $run ./try; then
11928 echo "Your vsprintf() returns (int)." >&4
11931 echo "Your vsprintf() returns (char*)." >&4
11935 echo 'I am unable to compile the vsprintf() test program.' >&4
11936 # We shouldn't get here. If we do, assume the standard signature,
11937 # not the old BSD one.
11938 echo 'Guessing that vsprintf() returns (int).' >&4
11942 echo 'vprintf() NOT found.' >&4
11953 : see if chown exists
11957 : see if chroot exists
11958 set chroot d_chroot
11961 : see if chsize exists
11962 set chsize d_chsize
11965 : see if class exists
11969 : see if clearenv exists
11970 set clearenv d_clearenv
11973 : Define hasstruct macro for Configure internal use
11974 hasstruct='varname=$1; struct=$2; shift; shift;
11975 while $test $# -ge 2; do
11977 $define) echo "#include <$2>";;
11981 echo "int main () { struct $struct foo; }" >> try.c;
11983 if eval $compile; then
11992 : see whether socket exists
11996 $echo $n "Hmm... $c" >&4
11997 if set socket val -f d_socket; eval $csym; $val; then
11998 echo "Looks like you have Berkeley networking support." >&4
12000 if set setsockopt val -f; eval $csym; $val; then
12003 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
12004 d_oldsock="$define"
12007 if $contains socklib libc.list >/dev/null 2>&1; then
12008 echo "Looks like you have Berkeley networking support." >&4
12010 : we will have to assume that it supports the 4.2 BSD interface
12013 echo "You don't have Berkeley networking in libc$_a..." >&4
12014 if test "X$d_socket" = "X$define"; then
12015 echo "...but you seem to believe that you have sockets." >&4
12017 for net in net socket
12019 if test -f $sysroot/usr/lib/lib$net$_a; then
12020 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
12021 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12022 if $contains socket libc.list >/dev/null 2>&1; then
12027 echo "...but the Wollongong group seems to have hacked it in." >&4
12028 sockethdr="-I$sysroot/usr/netinclude"
12031 echo "Found Berkeley sockets interface in lib$net." >&4
12032 if $contains setsockopt libc.list >/dev/null 2>&1; then
12035 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12036 d_oldsock="$define"
12042 if test "X$d_socket" != "X$define"; then
12043 echo "or anywhere else I see." >&4
12051 : see if socketpair exists
12052 set socketpair d_sockpair
12057 echo "Checking the availability sa_len in the sock struct ..." >&4
12059 #include <sys/types.h>
12060 #include <sys/socket.h>
12062 struct sockaddr sa;
12063 return (sa.sa_len);
12067 set try; if eval $compile; then
12070 set d_sockaddr_sa_len; eval $setvar
12074 echo "Checking the availability 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_family);
12085 set try; if eval $compile; then
12088 set d_sockaddr_in6; eval $setvar
12092 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12094 #include <sys/types.h>
12095 #include <sys/socket.h>
12096 #include <netinet/in.h>
12098 struct sockaddr_in6 sin6;
12099 return (sin6.sin6_scope_id);
12103 set try; if eval $compile; then
12106 set d_sin6_scope_id; eval $setvar
12110 echo "Checking the availability struct ip_mreq ..." >&4
12112 #include <sys/types.h>
12113 #include <sys/socket.h>
12114 #include <netinet/in.h>
12116 struct ip_mreq mreq;
12117 return (mreq.imr_multiaddr.s_addr);
12121 set try; if eval $compile; then
12124 set d_ip_mreq; eval $setvar
12128 echo "Checking the availability struct ip_mreq_source ..." >&4
12130 #include <sys/types.h>
12131 #include <sys/socket.h>
12132 #include <netinet/in.h>
12134 struct ip_mreq_source mreq;
12135 return (mreq.imr_multiaddr.s_addr);
12139 set try; if eval $compile; then
12142 set d_ip_mreq_source; eval $setvar
12146 echo "Checking the availability struct ipv6_mreq ..." >&4
12148 #include <sys/types.h>
12149 #include <sys/socket.h>
12150 #include <netinet/in.h>
12152 struct ipv6_mreq mreq;
12153 return (mreq.ipv6mr_interface);
12157 set try; if eval $compile; then
12160 set d_ipv6_mreq; eval $setvar
12164 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12166 #include <sys/types.h>
12167 #include <sys/socket.h>
12168 #include <netinet/in.h>
12170 struct ipv6_mreq_source mreq;
12171 return (mreq.imr_multiaddr.s_addr);
12175 set try; if eval $compile; then
12178 set d_ipv6_mreq_source; eval $setvar
12182 echo "Checking the availability of certain socket constants..." >&4
12183 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12184 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12186 #include <sys/types.h>
12187 #include <sys/socket.h>
12193 set try; if eval $compile; then
12196 set d_${enum}; eval $setvar
12200 : see if this is a sys/uio.h system
12201 set sys/uio.h i_sysuio
12204 : Check for cmsghdr support
12206 echo "Checking to see if your system supports struct cmsghdr..." >&4
12207 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12209 case "$d_cmsghdr_s" in
12210 "$define") echo "Yes, it does." ;;
12211 *) echo "No, it doesn't." ;;
12215 : check for const keyword
12217 echo 'Checking to see if your C compiler knows about "const"...' >&4
12218 $cat >const.c <<'EOCP'
12219 typedef struct spug { int drokk; } spug;
12223 const spug y = { 0 };
12226 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12228 echo "Yup, it does."
12231 echo "Nope, it doesn't."
12236 : see if copysign exists
12237 set copysign d_copysign
12240 : see if copysignl exists
12241 set copysignl d_copysignl
12244 : see if crypt exists
12249 $define) cryptlib='' ;;
12250 *) if set crypt val -f d_crypt; eval $csym; $val; then
12251 echo 'crypt() found.' >&4
12255 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12256 if $test -z "$cryptlib"; then
12257 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12261 if $test -z "$cryptlib"; then
12262 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12266 if $test -z "$cryptlib"; then
12267 cryptlib=`./loc libcrypt$_a "" $libpth`
12271 if $test -z "$cryptlib"; then
12272 echo 'crypt() NOT found.' >&4
12283 : see if this is a crypt.h system
12284 set crypt.h i_crypt
12287 : see if crypt_r exists
12288 set crypt_r d_crypt_r
12290 case "$d_crypt_r" in
12292 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12293 case "$d_crypt_r_proto:$usethreads" in
12294 ":define") d_crypt_r_proto=define
12295 set d_crypt_r_proto crypt_r $hdrs
12299 case "$d_crypt_r_proto" in
12301 case "$crypt_r_proto" in
12302 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12303 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12305 case "$crypt_r_proto" in
12306 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12307 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12309 case "$crypt_r_proto" in
12310 ''|0) d_crypt_r=undef
12312 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12313 * ) case "$crypt_r_proto" in
12314 REENTRANT_PROTO*) ;;
12315 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12317 echo "Prototype: $try" ;;
12320 *) case "$usethreads" in
12321 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12332 : get csh whereabouts
12334 'csh') val="$undef" ;;
12335 *) val="$define" ;;
12339 : Respect a hint or command line value for full_csh.
12340 case "$full_csh" in
12341 '') full_csh=$csh ;;
12344 : see if ctermid exists
12345 set ctermid d_ctermid
12348 : see if ctermid_r exists
12349 set ctermid_r d_ctermid_r
12351 case "$d_ctermid_r" in
12353 hdrs="$i_systypes sys/types.h define stdio.h "
12354 case "$d_ctermid_r_proto:$usethreads" in
12355 ":define") d_ctermid_r_proto=define
12356 set d_ctermid_r_proto ctermid_r $hdrs
12360 case "$d_ctermid_r_proto" in
12362 case "$ctermid_r_proto" in
12363 ''|0) try='char* ctermid_r(char*);'
12364 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12366 case "$ctermid_r_proto" in
12367 ''|0) d_ctermid_r=undef
12369 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12370 * ) case "$ctermid_r_proto" in
12371 REENTRANT_PROTO*) ;;
12372 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12374 echo "Prototype: $try" ;;
12377 *) case "$usethreads" in
12378 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12385 *) ctermid_r_proto=0
12389 : see if ctime_r exists
12390 set ctime_r d_ctime_r
12392 case "$d_ctime_r" in
12394 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12395 case "$d_ctime_r_proto:$usethreads" in
12396 ":define") d_ctime_r_proto=define
12397 set d_ctime_r_proto ctime_r $hdrs
12401 case "$d_ctime_r_proto" in
12403 case "$ctime_r_proto" in
12404 ''|0) try='char* ctime_r(const time_t*, char*);'
12405 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12407 case "$ctime_r_proto" in
12408 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12409 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12411 case "$ctime_r_proto" in
12412 ''|0) try='int ctime_r(const time_t*, char*);'
12413 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12415 case "$ctime_r_proto" in
12416 ''|0) try='int ctime_r(const time_t*, char*, int);'
12417 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12419 case "$ctime_r_proto" in
12420 ''|0) d_ctime_r=undef
12422 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12423 * ) case "$ctime_r_proto" in
12424 REENTRANT_PROTO*) ;;
12425 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12427 echo "Prototype: $try" ;;
12430 *) case "$usethreads" in
12431 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12442 : see if cuserid exists
12443 set cuserid d_cuserid
12446 : see if this is a limits.h system
12447 set limits.h i_limits
12450 : See if number of significant digits in a double precision number is known
12452 $cat >dbl_dig.c <<EOM
12453 #$i_limits I_LIMITS
12456 #include <limits.h>
12462 printf("Contains DBL_DIG");
12465 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12466 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12467 echo "DBL_DIG found." >&4
12470 echo "DBL_DIG NOT found." >&4
12477 : see if dbm.h is available
12478 : see if dbmclose exists
12479 set dbmclose d_dbmclose
12482 case "$d_dbmclose" in
12492 *) set rpcsvc/dbm.h i_rpcsvcdbm
12497 *) echo "We won't be including <dbm.h>"
12507 : see if prototype for dbminit is available
12509 set d_dbminitproto dbminit $i_dbm dbm.h
12512 : see if difftime exists
12513 set difftime d_difftime
12516 : see if this is a dirent system
12518 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12520 echo "<dirent.h> found." >&4
12523 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12524 echo "<sys/dir.h> found." >&4
12527 xinc=`./findhdr sys/ndir.h`
12529 echo "<dirent.h> NOT found." >&4
12534 : Look for type of directory structure.
12536 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12538 case "$direntrytype" in
12540 case "$i_dirent" in
12541 $define) guess1='struct dirent' ;;
12542 *) guess1='struct direct' ;;
12545 *) guess1="$direntrytype"
12550 'struct dirent') guess2='struct direct' ;;
12551 *) guess2='struct dirent' ;;
12554 if $contains "$guess1" try.c >/dev/null 2>&1; then
12555 direntrytype="$guess1"
12556 echo "Your directory entries are $direntrytype." >&4
12557 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12558 direntrytype="$guess2"
12559 echo "Your directory entries seem to be $direntrytype." >&4
12561 echo "I don't recognize your system's directory entries." >&4
12562 rp="What type is used for directory entries on this system?"
12565 direntrytype="$ans"
12569 : see if the directory entry stores field length
12571 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12572 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12573 echo "Good, your directory entry keeps length information in d_namlen." >&4
12576 echo "Your directory entry does not know about the d_namlen field." >&4
12583 : Look for DIR.dd_fd
12584 case "$i_dirent" in
12586 echo "Checking to see if DIR has a dd_fd member variable" >&4
12588 #$i_stdlib I_STDLIB
12590 #include <stdlib.h>
12592 #include <dirent.h>
12602 if eval $compile; then
12603 echo "Yes, it does."
12606 echo "No, it does not."
12611 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12619 : see if this is an sysdir system
12620 set sys/dir.h i_sysdir
12623 : see if this is an sysndir system
12624 set sys/ndir.h i_sysndir
12629 $cat >dirfd.c <<EOM
12631 #$i_stdlib I_STDLIB
12633 #include <stdlib.h>
12635 #$i_dirent I_DIRENT /**/
12636 #$i_sysdir I_SYS_DIR /**/
12637 #$i_sysndir I_SYS_NDIR /**/
12638 #$i_systypes I_SYS_TYPES /**/
12639 #if defined(I_SYS_TYPES)
12640 #include <sys/types.h>
12642 #if defined(I_DIRENT)
12643 #include <dirent.h>
12646 #include <sys/ndir.h>
12650 #include <ndir.h> /* may be wrong in the future */
12652 #include <sys/dir.h>
12658 DIR *dirp = opendir(".");
12659 if (dirfd(dirp) >= 0)
12667 if eval $compile; then
12671 $define) echo "dirfd() found." >&4 ;;
12672 *) echo "dirfd() NOT found." >&4 ;;
12678 : see if dladdr exists
12679 set dladdr d_dladdr
12682 : see if dlerror exists
12685 set dlerror d_dlerror
12689 : see if dlfcn is available
12690 set dlfcn.h i_dlfcn
12693 : Check what extension to use for shared libs
12698 On a few systems, the dynamically loaded modules that perl generates and uses
12699 will need a different extension than shared libs. The default will probably
12705 *) dflt="$dlext" ;;
12707 rp='What is the extension of dynamically loaded modules'
12716 : Check if dlsym need a leading underscore
12722 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12723 $cat >dyna.c <<'EOM'
12730 #$i_stdlib I_STDLIB
12732 #include <stdlib.h>
12736 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12738 #include <sys/types.h>
12743 extern int fred() ;
12752 int mode = RTLD_LAZY ;
12754 handle = dlopen("./dyna.$dlext", mode) ;
12755 if (handle == NULL) {
12760 symbol = dlsym(handle, "fred") ;
12761 if (symbol == NULL) {
12762 /* try putting a leading underscore */
12763 symbol = dlsym(handle, "_fred") ;
12764 if (symbol == NULL) {
12777 : Call the object file tmp-dyna.o in case dlext=o.
12778 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12779 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12780 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12781 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12784 1) echo "Test program failed using dlopen." >&4
12785 echo "Perhaps you should not use dynamic loading." >&4;;
12786 2) echo "Test program failed using dlsym." >&4
12787 echo "Perhaps you should not use dynamic loading." >&4;;
12788 3) echo "dlsym needs a leading underscore" >&4
12790 4) echo "dlsym doesn't need a leading underscore." >&4;;
12793 echo "I can't compile and run the test program." >&4
12794 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12799 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12804 : see if drand48_r exists
12805 set drand48_r d_drand48_r
12807 case "$d_drand48_r" in
12809 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12810 case "$d_drand48_r_proto:$usethreads" in
12811 ":define") d_drand48_r_proto=define
12812 set d_drand48_r_proto drand48_r $hdrs
12816 case "$d_drand48_r_proto" in
12818 case "$drand48_r_proto" in
12819 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12820 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12822 case "$drand48_r_proto" in
12823 ''|0) d_drand48_r=undef
12825 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12826 * ) case "$drand48_r_proto" in
12827 REENTRANT_PROTO*) ;;
12828 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12830 echo "Prototype: $try" ;;
12833 *) case "$usethreads" in
12834 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12841 *) drand48_r_proto=0
12845 : see if prototype for drand48 is available
12847 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12850 : see if dup2 exists
12854 : see if eaccess exists
12855 set eaccess d_eaccess
12858 : see if endgrent exists
12859 set endgrent d_endgrent
12862 : see if this is an grp system
12868 xxx=`./findhdr grp.h`
12869 $cppstdin $cppflags $cppminus < $xxx >$$.h
12871 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12883 set d_grpasswd; eval $setvar
12887 : see if endgrent_r exists
12888 set endgrent_r d_endgrent_r
12890 case "$d_endgrent_r" in
12892 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12893 case "$d_endgrent_r_proto:$usethreads" in
12894 ":define") d_endgrent_r_proto=define
12895 set d_endgrent_r_proto endgrent_r $hdrs
12899 case "$d_endgrent_r_proto" in
12901 case "$endgrent_r_proto" in
12902 ''|0) try='int endgrent_r(FILE**);'
12903 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12905 case "$endgrent_r_proto" in
12906 ''|0) try='void endgrent_r(FILE**);'
12907 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12909 case "$endgrent_r_proto" in
12910 ''|0) d_endgrent_r=undef
12912 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12913 * ) case "$endgrent_r_proto" in
12914 REENTRANT_PROTO*) ;;
12915 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12917 echo "Prototype: $try" ;;
12920 *) case "$usethreads" in
12921 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12928 *) endgrent_r_proto=0
12932 : see if endhostent exists
12933 set endhostent d_endhent
12936 : see if this is a netdb.h system
12937 set netdb.h i_netdb
12940 : see if endhostent_r exists
12941 set endhostent_r d_endhostent_r
12943 case "$d_endhostent_r" in
12945 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12946 case "$d_endhostent_r_proto:$usethreads" in
12947 ":define") d_endhostent_r_proto=define
12948 set d_endhostent_r_proto endhostent_r $hdrs
12952 case "$d_endhostent_r_proto" in
12954 case "$endhostent_r_proto" in
12955 ''|0) try='int endhostent_r(struct hostent_data*);'
12956 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12958 case "$endhostent_r_proto" in
12959 ''|0) try='void endhostent_r(struct hostent_data*);'
12960 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12962 case "$endhostent_r_proto" in
12963 ''|0) d_endhostent_r=undef
12964 endhostent_r_proto=0
12965 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12966 * ) case "$endhostent_r_proto" in
12967 REENTRANT_PROTO*) ;;
12968 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12970 echo "Prototype: $try" ;;
12973 *) case "$usethreads" in
12974 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12976 d_endhostent_r=undef
12977 endhostent_r_proto=0
12981 *) endhostent_r_proto=0
12985 : see if endnetent exists
12986 set endnetent d_endnent
12989 : see if endnetent_r exists
12990 set endnetent_r d_endnetent_r
12992 case "$d_endnetent_r" in
12994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12995 case "$d_endnetent_r_proto:$usethreads" in
12996 ":define") d_endnetent_r_proto=define
12997 set d_endnetent_r_proto endnetent_r $hdrs
13001 case "$d_endnetent_r_proto" in
13003 case "$endnetent_r_proto" in
13004 ''|0) try='int endnetent_r(struct netent_data*);'
13005 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
13007 case "$endnetent_r_proto" in
13008 ''|0) try='void endnetent_r(struct netent_data*);'
13009 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
13011 case "$endnetent_r_proto" in
13012 ''|0) d_endnetent_r=undef
13013 endnetent_r_proto=0
13014 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
13015 * ) case "$endnetent_r_proto" in
13016 REENTRANT_PROTO*) ;;
13017 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
13019 echo "Prototype: $try" ;;
13022 *) case "$usethreads" in
13023 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13025 d_endnetent_r=undef
13026 endnetent_r_proto=0
13030 *) endnetent_r_proto=0
13034 : see if endprotoent exists
13035 set endprotoent d_endpent
13038 : see if endprotoent_r exists
13039 set endprotoent_r d_endprotoent_r
13041 case "$d_endprotoent_r" in
13043 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13044 case "$d_endprotoent_r_proto:$usethreads" in
13045 ":define") d_endprotoent_r_proto=define
13046 set d_endprotoent_r_proto endprotoent_r $hdrs
13050 case "$d_endprotoent_r_proto" in
13052 case "$endprotoent_r_proto" in
13053 ''|0) try='int endprotoent_r(struct protoent_data*);'
13054 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13056 case "$endprotoent_r_proto" in
13057 ''|0) try='void endprotoent_r(struct protoent_data*);'
13058 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13060 case "$endprotoent_r_proto" in
13061 ''|0) d_endprotoent_r=undef
13062 endprotoent_r_proto=0
13063 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13064 * ) case "$endprotoent_r_proto" in
13065 REENTRANT_PROTO*) ;;
13066 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13068 echo "Prototype: $try" ;;
13071 *) case "$usethreads" in
13072 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13074 d_endprotoent_r=undef
13075 endprotoent_r_proto=0
13079 *) endprotoent_r_proto=0
13083 : see if endpwent exists
13084 set endpwent d_endpwent
13087 : see if this is a pwd.h system
13093 xxx=`./findhdr pwd.h`
13094 $cppstdin $cppflags $cppminus < $xxx >$$.h
13096 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13104 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13112 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13120 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13128 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13136 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13144 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13152 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13164 set d_pwquota; eval $setvar
13165 set d_pwage; eval $setvar
13166 set d_pwchange; eval $setvar
13167 set d_pwclass; eval $setvar
13168 set d_pwexpire; eval $setvar
13169 set d_pwcomment; eval $setvar
13170 set d_pwgecos; eval $setvar
13171 set d_pwpasswd; eval $setvar
13175 : see if endpwent_r exists
13176 set endpwent_r d_endpwent_r
13178 case "$d_endpwent_r" in
13180 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13181 case "$d_endpwent_r_proto:$usethreads" in
13182 ":define") d_endpwent_r_proto=define
13183 set d_endpwent_r_proto endpwent_r $hdrs
13187 case "$d_endpwent_r_proto" in
13189 case "$endpwent_r_proto" in
13190 ''|0) try='int endpwent_r(FILE**);'
13191 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13193 case "$endpwent_r_proto" in
13194 ''|0) try='void endpwent_r(FILE**);'
13195 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13197 case "$endpwent_r_proto" in
13198 ''|0) d_endpwent_r=undef
13200 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13201 * ) case "$endpwent_r_proto" in
13202 REENTRANT_PROTO*) ;;
13203 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13205 echo "Prototype: $try" ;;
13208 *) case "$usethreads" in
13209 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13216 *) endpwent_r_proto=0
13220 : see if endservent exists
13221 set endservent d_endsent
13224 : see if endservent_r exists
13225 set endservent_r d_endservent_r
13227 case "$d_endservent_r" in
13229 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13230 case "$d_endservent_r_proto:$usethreads" in
13231 ":define") d_endservent_r_proto=define
13232 set d_endservent_r_proto endservent_r $hdrs
13236 case "$d_endservent_r_proto" in
13238 case "$endservent_r_proto" in
13239 ''|0) try='int endservent_r(struct servent_data*);'
13240 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13242 case "$endservent_r_proto" in
13243 ''|0) try='void endservent_r(struct servent_data*);'
13244 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13246 case "$endservent_r_proto" in
13247 ''|0) d_endservent_r=undef
13248 endservent_r_proto=0
13249 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13250 * ) case "$endservent_r_proto" in
13251 REENTRANT_PROTO*) ;;
13252 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13254 echo "Prototype: $try" ;;
13257 *) case "$usethreads" in
13258 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13260 d_endservent_r=undef
13261 endservent_r_proto=0
13265 *) endservent_r_proto=0
13269 : Locate the flags for 'open()'
13272 #include <sys/types.h>
13277 #include <sys/file.h>
13279 #$i_stdlib I_STDLIB
13281 #include <stdlib.h>
13292 : check sys/file.h first to get FREAD on Sun
13293 if $test `./findhdr sys/file.h` && \
13294 set try -DI_SYS_FILE && eval $compile; then
13296 echo "<sys/file.h> defines the O_* constants..." >&4
13297 if $run ./try; then
13298 echo "and you have the 3 argument form of open()." >&4
13301 echo "but not the 3 argument form of open(). Oh, well." >&4
13304 elif $test `./findhdr fcntl.h` && \
13305 set try -DI_FCNTL && eval $compile; then
13307 echo "<fcntl.h> defines the O_* constants..." >&4
13308 if $run ./try; then
13309 echo "and you have the 3 argument form of open()." >&4
13312 echo "but not the 3 argument form of open(). Oh, well." >&4
13317 echo "I can't find the O_* constant definitions! You got problems." >&4
13323 : see if this is a sys/file.h system
13328 : do we need to include sys/file.h ?
13332 if $h_sysfile; then
13334 echo "We'll be including <sys/file.h>." >&4
13337 echo "We won't be including <sys/file.h>." >&4
13347 : see if fcntl.h is there
13352 : see if we can include fcntl.h
13358 echo "We'll be including <fcntl.h>." >&4
13361 if $h_sysfile; then
13362 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13364 echo "We won't be including <fcntl.h>." >&4
13376 : see if fork exists
13380 : see if pipe exists
13384 : check for non-blocking I/O stuff
13385 case "$h_sysfile" in
13386 true) echo "#include <sys/file.h>" > head.c;;
13389 true) echo "#include <fcntl.h>" > head.c;;
13390 *) echo "#include <sys/fcntl.h>" > head.c;;
13395 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13396 case "$o_nonblock" in
13398 $cat head.c > try.c
13399 $cat >>try.c <<EOCP
13401 #$i_stdlib I_STDLIB
13403 #include <stdlib.h>
13411 printf("O_NONBLOCK\n");
13415 printf("O_NDELAY\n");
13419 printf("FNDELAY\n");
13426 if eval $compile_ok; then
13427 o_nonblock=`$run ./try`
13428 case "$o_nonblock" in
13429 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13430 *) echo "Seems like we can use $o_nonblock.";;
13433 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13436 *) echo "Using $hint value $o_nonblock.";;
13441 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13444 case "$d_fork:$d_pipe:$d_alarm" in
13445 define:define:define)
13446 $cat head.c > try.c
13447 $cat >>try.c <<EOCP
13449 #include <sys/types.h>
13450 #include <signal.h>
13452 #$i_stdlib I_STDLIB
13454 #include <stdlib.h>
13460 #define MY_O_NONBLOCK $o_nonblock
13461 #ifndef errno /* XXX need better Configure test */
13464 #$i_unistd I_UNISTD
13466 #include <unistd.h>
13468 #$i_string I_STRING
13470 #include <string.h>
13472 #include <strings.h>
13474 $signal_t blech(int x) { exit(3); }
13476 $cat >> try.c <<'EOCP'
13485 ret = pipe(pd); /* Down: child -> parent */
13488 ret = pipe(pu); /* Up: parent -> child */
13492 close(pd[1]); /* Parent reads from pd[0] */
13493 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13495 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13500 signal(SIGALRM, blech);
13502 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13504 sprintf(string, "%d\n", ret);
13505 ret = write(2, string, strlen(string));
13506 if (ret != strlen(string))
13510 if (errno == EAGAIN) {
13511 printf("EAGAIN\n");
13516 if (errno == EWOULDBLOCK)
13517 printf("EWOULDBLOCK\n");
13520 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13523 sleep(2); /* Give it time to close our pipe */
13525 ret = read(pd[0], buf, 1); /* Should read EOF */
13527 sprintf(string, "%d\n", ret);
13528 ret = write(4, string, strlen(string));
13529 if (ret != strlen(string))
13534 close(pd[0]); /* We write to pd[1] */
13535 close(pu[1]); /* We read from pu[0] */
13536 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13539 close(pd[1]); /* Pipe pd is now fully closed! */
13540 exit(0); /* Bye bye, thank you for playing! */
13544 if eval $compile_ok; then
13545 echo "$startsh" >mtry
13546 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13548 $run ./mtry >/dev/null 2>&1
13550 0) eagain=`$cat try.out`;;
13551 1) echo "Could not perform non-blocking setting!";;
13552 2) echo "I did a successful read() for something that was not there!";;
13553 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13554 4) echo "Could not find F_SETFL!";;
13555 *) echo "Something terribly wrong happened during testing.";;
13557 rd_nodata=`$cat try.ret`
13558 echo "A read() system call with no data present returns $rd_nodata."
13559 case "$rd_nodata" in
13562 echo "(That's peculiar, fixing that to be -1.)"
13568 echo "Forcing errno EAGAIN on read() with no data available."
13572 echo "Your read() sets errno to $eagain when no data is available."
13575 status=`$cat try.err`
13577 0) echo "And it correctly returns 0 to signal EOF.";;
13578 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13579 *) echo "However, your read() returns '$status' on EOF??";;
13582 if test "$status" = "$rd_nodata"; then
13583 echo "WARNING: you can't distinguish between EOF and no data!"
13587 echo "I can't compile the test program--assuming errno EAGAIN will do."
13591 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13600 echo "Using $hint value $eagain."
13601 echo "Your read() returns $rd_nodata when no data is present."
13602 case "$d_eofnblk" in
13603 "$define") echo "And you can see EOF because read() returns 0.";;
13604 "$undef") echo "But you can't see EOF status from read() returned value.";;
13606 echo "(Assuming you can't see EOF status from read anyway.)"
13612 $rm_try head.c mtry
13614 : see if erf exists
13618 : see if erfc exists
13622 : see if exp2 exists
13626 : see if expm1 exists
13630 : see if _ptr and _cnt from stdio act std
13633 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13634 echo "(Looks like you have stdio.h from BSD.)"
13635 case "$stdio_ptr" in
13636 '') stdio_ptr='((fp)->_p)'
13639 *) ptr_lval=$d_stdio_ptr_lval;;
13641 case "$stdio_cnt" in
13642 '') stdio_cnt='((fp)->_r)'
13645 *) cnt_lval=$d_stdio_cnt_lval;;
13647 case "$stdio_base" in
13648 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13650 case "$stdio_bufsiz" in
13651 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13653 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13654 echo "(Looks like you have stdio.h from Linux.)"
13655 case "$stdio_ptr" in
13656 '') stdio_ptr='((fp)->_IO_read_ptr)'
13659 *) ptr_lval=$d_stdio_ptr_lval;;
13661 case "$stdio_cnt" in
13662 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13665 *) cnt_lval=$d_stdio_cnt_lval;;
13667 case "$stdio_base" in
13668 '') stdio_base='((fp)->_IO_read_base)';;
13670 case "$stdio_bufsiz" in
13671 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13674 case "$stdio_ptr" in
13675 '') stdio_ptr='((fp)->_ptr)'
13678 *) ptr_lval=$d_stdio_ptr_lval;;
13680 case "$stdio_cnt" in
13681 '') stdio_cnt='((fp)->_cnt)'
13684 *) cnt_lval=$d_stdio_cnt_lval;;
13686 case "$stdio_base" in
13687 '') stdio_base='((fp)->_base)';;
13689 case "$stdio_bufsiz" in
13690 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13694 : test whether _ptr and _cnt really work
13695 echo "Checking how std your stdio is..." >&4
13698 #$i_stdlib I_STDLIB
13700 #include <stdlib.h>
13702 #define FILE_ptr(fp) $stdio_ptr
13703 #define FILE_cnt(fp) $stdio_cnt
13705 FILE *fp = fopen("try.c", "r");
13708 18 <= FILE_cnt(fp) &&
13709 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13717 if eval $compile && $to try.c; then
13718 if $run ./try; then
13719 echo "Your stdio acts pretty std."
13722 echo "Your stdio isn't very std."
13725 echo "Your stdio doesn't appear very std."
13729 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13730 # direct buffer manipulation no longer works. The Configure tests
13731 # should be changed to correctly detect this, but until then,
13732 # the following check should at least let perl compile and run.
13733 # (This quick fix should be updated before 5.8.1.)
13734 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13735 # A. Dougherty, June 3, 2002.
13736 case "$d_gnulibc" in
13738 case "$gnulibc_version" in
13742 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13751 : Can _ptr be used as an lvalue?
13752 case "$d_stdstdio$ptr_lval" in
13753 $define$define) val=$define ;;
13756 set d_stdio_ptr_lval
13759 : Can _cnt be used as an lvalue?
13760 case "$d_stdstdio$cnt_lval" in
13761 $define$define) val=$define ;;
13764 set d_stdio_cnt_lval
13768 : test whether setting _ptr sets _cnt as a side effect
13769 d_stdio_ptr_lval_sets_cnt="$undef"
13770 d_stdio_ptr_lval_nochange_cnt="$undef"
13771 case "$d_stdio_ptr_lval$d_stdstdio" in
13773 echo "Checking to see what happens if we set the stdio ptr..." >&4
13776 /* Can we scream? */
13777 /* Eat dust sed :-) */
13778 /* In the buffer space, no one can hear you scream. */
13779 #$i_stdlib I_STDLIB
13781 #include <stdlib.h>
13783 #define FILE_ptr(fp) $stdio_ptr
13784 #define FILE_cnt(fp) $stdio_cnt
13785 #include <sys/types.h>
13787 FILE *fp = fopen("try.c", "r");
13792 puts("Fail even to read");
13795 c = getc(fp); /* Read away the first # */
13797 puts("Fail even to read");
13801 18 <= FILE_cnt(fp) &&
13802 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13804 puts("Fail even to read");
13807 ptr = (char*) FILE_ptr(fp);
13808 cnt = (size_t)FILE_cnt(fp);
13810 FILE_ptr(fp) += 42;
13812 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13813 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13816 if (FILE_cnt(fp) <= 20) {
13817 printf ("Fail (<20 chars to test)");
13820 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13821 puts("Fail compare");
13824 if (cnt == FILE_cnt(fp)) {
13825 puts("Pass_unchanged");
13828 if (FILE_cnt(fp) == (cnt - 42)) {
13829 puts("Pass_changed");
13832 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13838 if eval $compile && $to try.c; then
13839 case `$run ./try` in
13841 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13842 d_stdio_ptr_lval_sets_cnt="$define" ;;
13844 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13845 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13847 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13849 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13852 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13858 : see if _base is also standard
13860 case "$d_stdstdio" in
13864 #$i_stdlib I_STDLIB
13866 #include <stdlib.h>
13868 #define FILE_base(fp) $stdio_base
13869 #define FILE_bufsiz(fp) $stdio_bufsiz
13871 FILE *fp = fopen("try.c", "r");
13874 19 <= FILE_bufsiz(fp) &&
13875 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13882 if eval $compile && $to try.c; then
13883 if $run ./try; then
13884 echo "And its _base field acts std."
13887 echo "But its _base field isn't std."
13890 echo "However, it seems to be lacking the _base field."
13898 : see if fast_stdio exists
13900 case "$d_stdstdio:$d_stdio_ptr_lval" in
13902 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13904 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13915 : see if fchdir exists
13916 set fchdir d_fchdir
13919 : see if fchmod exists
13920 set fchmod d_fchmod
13923 : see if fchown exists
13924 set fchown d_fchown
13927 : see if this is an fcntl system
13931 : See if fcntl-based locking works.
13934 #$i_stdlib I_STDLIB
13936 #include <stdlib.h>
13938 #include <unistd.h>
13940 #include <signal.h>
13941 $signal_t blech(int x) { exit(3); }
13943 #if defined(F_SETLK) && defined(F_SETLKW)
13944 struct flock flock;
13946 fd = open("try.c", O_RDONLY);
13947 flock.l_type = F_RDLCK;
13948 flock.l_whence = SEEK_SET;
13949 flock.l_start = flock.l_len = 0;
13950 signal(SIGALRM, blech);
13952 retval = fcntl(fd, F_SETLK, &flock);
13954 (retval < 0 ? exit(2) : exit(0));
13960 echo "Checking if fcntl-based file locking works... "
13964 if eval $compile_ok; then
13965 if $run ./try; then
13966 echo "Yes, it seems to work."
13969 echo "Nope, it didn't work."
13974 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13975 *** This is (almost) impossible.
13976 *** If your NFS lock daemons are not feeling well, something like
13977 *** this may happen, please investigate. Cannot continue, aborting.
13985 echo "I'm unable to compile the test program, so I'll assume not."
13990 echo "Nope, since you don't even have fcntl()."
13993 set d_fcntl_can_lock
13997 : check for fd_set items
14000 Checking to see how well your C compiler handles fd_set and friends ...
14003 #$i_stdlib I_STDLIB
14005 #include <stdlib.h>
14007 #$i_systime I_SYS_TIME
14008 #$i_sysselct I_SYS_SELECT
14009 #$d_socket HAS_SOCKET
14010 #include <sys/types.h>
14012 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14015 #include <sys/time.h>
14017 #ifdef I_SYS_SELECT
14018 #include <sys/select.h>
14027 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14035 if eval $compile; then
14036 d_fds_bits="$define"
14038 echo "Well, your system knows about the normal fd_set typedef..." >&4
14039 if $run ./try; then
14040 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14041 d_fd_macros="$define"
14044 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14046 d_fd_macros="$undef"
14050 Hmm, your compiler has some difficulty with fd_set. Checking further...
14053 if eval $compile; then
14054 d_fds_bits="$undef"
14056 echo "Well, your system has some sort of fd_set available..." >&4
14057 if $run ./try; then
14058 echo "and you have the normal fd_set macros." >&4
14059 d_fd_macros="$define"
14062 but not the normal fd_set macros! Gross! More work for me...
14064 d_fd_macros="$undef"
14067 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14069 d_fds_bits="$undef"
14070 d_fd_macros="$undef"
14075 : see if fdclose exists
14076 set fdclose d_fdclose
14079 : see if fdim exists
14083 : see if fegetround exists
14084 set fegetround d_fegetround
14087 : see if fgetpos exists
14088 set fgetpos d_fgetpos
14091 : see if finite exists
14092 set finite d_finite
14095 : see if finitel exists
14096 set finitel d_finitel
14099 : see if flock exists
14103 : see if prototype for flock is available
14105 set d_flockproto flock $i_sysfile sys/file.h
14108 : see if fma exists
14112 : see if fmax exists
14116 : see if fmin exists
14120 : see if fp_class exists
14121 set fp_class d_fp_class
14124 : see if this is a math.h system
14128 : check for fpclassify
14129 echo "Checking to see if you have fpclassify..." >&4
14135 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14138 if eval $compile; then
14140 echo "You have fpclassify."
14143 echo "You do not have fpclassify."
14149 : see if fp_classify exists
14150 set fp_classify d_fp_classify
14153 : see if fp_classl exists
14154 set fp_classl d_fp_classl
14157 : see if pathconf exists
14158 set pathconf d_pathconf
14161 : see if fpathconf exists
14162 set fpathconf d_fpathconf
14165 : see if fpclass exists
14166 set fpclass d_fpclass
14169 : see if fpclassl exists
14170 set fpclassl d_fpclassl
14173 : see if fpgetround exists
14174 set fpgetround d_fpgetround
14177 : check for fpos64_t
14179 echo "Checking to see if you have fpos64_t..." >&4
14182 int main() { fpos64_t x = 7; }
14185 if eval $compile; then
14187 echo "You have fpos64_t."
14190 echo "You do not have fpos64_t."
14191 case "$fpossize" in
14192 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14199 : see if this is an xlocale.h system
14200 set xlocale.h i_xlocale
14203 : see if newlocale exists
14204 set newlocale d_newlocale
14207 : see if freelocale exists
14208 set freelocale d_freelocale
14211 : see if uselocale exists
14212 set uselocale d_uselocale
14215 : see if duplocale exists
14216 set duplocale d_duplocale
14219 : see if querylocale exists
14220 set querylocale d_querylocale
14223 : see if frexpl exists
14224 set frexpl d_frexpl
14227 : see if this is a sys/param system
14228 set sys/param.h i_sysparam
14231 : see if this is a sys/mount.h system
14232 set sys/mount.h i_sysmount
14235 : Check for fs_data_s
14237 echo "Checking to see if your system supports struct fs_data..." >&4
14238 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14240 case "$d_fs_data_s" in
14241 "$define") echo "Yes, it does." ;;
14242 *) echo "No, it doesn't." ;;
14245 : see if fseeko exists
14246 set fseeko d_fseeko
14248 case "$longsize" in
14249 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14252 : see if fsetpos exists
14253 set fsetpos d_fsetpos
14256 : see if fstatfs exists
14257 set fstatfs d_fstatfs
14260 : see if statvfs exists
14261 set statvfs d_statvfs
14264 : see if fstatvfs exists
14265 set fstatvfs d_fstatvfs
14269 : see if fsync exists
14273 : see if ftello exists
14274 set ftello d_ftello
14276 case "$longsize" in
14277 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14280 : check for a working futimes
14283 echo "Checking if you have a working futimes()" >&4
14286 #include <sys/time.h>
14293 fd = open ("try.c", O_RDWR);
14294 if (-1 == fd) exit (1);
14295 rv = futimes (fd, NULL);
14296 exit (rv == -1 ? errno : 0);
14300 if eval $compile; then
14304 0) echo "Yes, you have" >&4
14305 d_futimes="$define"
14307 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14311 echo "No, it does not (probably harmless)" >&4
14315 : look for gai_strerror
14317 $cat >try.c <<'EOCP'
14318 #include <sys/types.h>
14319 #include <sys/socket.h>
14323 return (gai_strerror (0) ? 0 : 1);
14328 if eval $compile; then
14331 0) echo "A working gai_strerror() found." >&4
14333 *) echo "gai_strerror() found, but it doesn't work" >&4
14337 echo "gai_strerror() NOT found." >&4
14343 : see if ndbm.h is available
14346 : Compatibility location for RedHat 7.1
14347 set gdbm/ndbm.h i_gdbmndbm
14349 : Compatibility location for Debian 4.0
14350 set gdbm-ndbm.h i_gdbm_ndbm
14354 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14355 : see if dbm_open exists
14356 set dbm_open d_dbm_open
14358 case "$d_dbm_open" in
14361 i_gdbmndbm="$undef"
14362 i_gdbm_ndbm="$undef"
14363 echo "We won't be including <ndbm.h>"
14373 ndbm_hdr_protochk='name=$1; hdr=$2;
14374 eval "ihdr=\$""i_$name";
14376 if $test "$ihdr" = "$define"; then
14377 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14378 case "$d_cplusplus" in
14379 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14380 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14383 $define) $echo "Your <$hdr> seems to have prototypes";;
14384 *) $echo "Your <$hdr> does not seem to have prototypes";;
14387 set "d_${name}_h_uses_prototypes";
14391 eval $ndbm_hdr_protochk
14392 set gdbmndbm gdbm/ndbm.h
14393 eval $ndbm_hdr_protochk
14394 set gdbm_ndbm gdbm-ndbm.h
14395 eval $ndbm_hdr_protochk
14397 : see if getaddrinfo exists
14398 set getaddrinfo d_getaddrinfo
14401 : see if getcwd exists
14402 set getcwd d_getcwd
14405 : see if getespwnam exists
14406 set getespwnam d_getespwnam
14409 : see if getfsstat exists
14410 set getfsstat d_getfsstat
14413 : see if getgrent exists
14414 set getgrent d_getgrent
14417 : see if getgrent_r exists
14418 set getgrent_r d_getgrent_r
14420 case "$d_getgrent_r" in
14422 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14423 case "$d_getgrent_r_proto:$usethreads" in
14424 ":define") d_getgrent_r_proto=define
14425 set d_getgrent_r_proto getgrent_r $hdrs
14429 case "$d_getgrent_r_proto" in
14431 case "$getgrent_r_proto" in
14432 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14433 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14435 case "$getgrent_r_proto" in
14436 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14437 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14439 case "$getgrent_r_proto" in
14440 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14441 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14443 case "$getgrent_r_proto" in
14444 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14445 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14447 case "$getgrent_r_proto" in
14448 ''|0) try='int getgrent_r(struct group*, char*, int);'
14449 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14451 case "$getgrent_r_proto" in
14452 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14453 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14455 case "$getgrent_r_proto" in
14456 ''|0) d_getgrent_r=undef
14458 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14459 * ) case "$getgrent_r_proto" in
14460 REENTRANT_PROTO*) ;;
14461 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14463 echo "Prototype: $try" ;;
14466 *) case "$usethreads" in
14467 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14474 *) getgrent_r_proto=0
14478 : see if getgrgid_r exists
14479 set getgrgid_r d_getgrgid_r
14481 case "$d_getgrgid_r" in
14483 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14484 case "$d_getgrgid_r_proto:$usethreads" in
14485 ":define") d_getgrgid_r_proto=define
14486 set d_getgrgid_r_proto getgrgid_r $hdrs
14490 case "$d_getgrgid_r_proto" in
14492 case "$getgrgid_r_proto" in
14493 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14494 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14496 case "$getgrgid_r_proto" in
14497 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14498 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14500 case "$getgrgid_r_proto" in
14501 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14502 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14504 case "$getgrgid_r_proto" in
14505 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14506 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14508 case "$getgrgid_r_proto" in
14509 ''|0) d_getgrgid_r=undef
14511 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14512 * ) case "$getgrgid_r_proto" in
14513 REENTRANT_PROTO*) ;;
14514 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14516 echo "Prototype: $try" ;;
14519 *) case "$usethreads" in
14520 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14527 *) getgrgid_r_proto=0
14531 : see if getgrnam_r exists
14532 set getgrnam_r d_getgrnam_r
14534 case "$d_getgrnam_r" in
14536 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14537 case "$d_getgrnam_r_proto:$usethreads" in
14538 ":define") d_getgrnam_r_proto=define
14539 set d_getgrnam_r_proto getgrnam_r $hdrs
14543 case "$d_getgrnam_r_proto" in
14545 case "$getgrnam_r_proto" in
14546 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14547 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14549 case "$getgrnam_r_proto" in
14550 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14551 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14553 case "$getgrnam_r_proto" in
14554 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14555 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14557 case "$getgrnam_r_proto" in
14558 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14559 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14561 case "$getgrnam_r_proto" in
14562 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14563 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14565 case "$getgrnam_r_proto" in
14566 ''|0) d_getgrnam_r=undef
14568 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14569 * ) case "$getgrnam_r_proto" in
14570 REENTRANT_PROTO*) ;;
14571 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14573 echo "Prototype: $try" ;;
14576 *) case "$usethreads" in
14577 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14584 *) getgrnam_r_proto=0
14588 : see if gethostbyaddr exists
14589 set gethostbyaddr d_gethbyaddr
14592 : see if gethostbyname exists
14593 set gethostbyname d_gethbyname
14596 : see if gethostent exists
14597 set gethostent d_gethent
14600 : see how we will look up host name
14603 if set gethostname val -f d_gethname; eval $csym; $val; then
14604 echo 'gethostname() found.' >&4
14605 d_gethname="$define"
14608 if set uname val -f d_uname; eval $csym; $val; then
14611 uname() was found, but you're running xenix, and older versions of xenix
14612 have a broken uname(). If you don't really know whether your xenix is old
14613 enough to have a broken system call, use the default answer.
14618 "$define") dflt=n;;
14620 rp='Is your uname() broken?'
14623 n*) d_uname="$define"; call=uname;;
14626 echo 'uname() found.' >&4
14633 case "$d_gethname" in
14634 '') d_gethname="$undef";;
14637 '') d_uname="$undef";;
14639 case "$d_uname$d_gethname" in
14644 Every now and then someone has a $call() that lies about the hostname
14645 but can't be fixed for political or economic reasons. If you wish, I can
14646 pretend $call() isn't there and maybe compute hostname at run-time
14647 thanks to the '$phostname' command.
14650 rp="Shall I ignore $call() from now on?"
14653 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14656 case "$phostname" in
14657 '') aphostname='';;
14658 *) case "$aphostname" in
14660 *) set X $phostname
14664 file=`./loc $file $file $pth`
14665 aphostname=`echo $file $*`
14670 case "$d_uname$d_gethname" in
14673 case "$phostname" in
14675 echo "There will be no way for $package to get your hostname." >&4;;
14677 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14681 case "$d_phostname" in
14682 '') d_phostname="$undef";;
14685 : see if gethostbyaddr_r exists
14686 set gethostbyaddr_r d_gethostbyaddr_r
14688 case "$d_gethostbyaddr_r" in
14690 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14691 case "$d_gethostbyaddr_r_proto:$usethreads" in
14692 ":define") d_gethostbyaddr_r_proto=define
14693 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14697 case "$d_gethostbyaddr_r_proto" in
14699 case "$gethostbyaddr_r_proto" in
14700 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14701 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14703 case "$gethostbyaddr_r_proto" in
14704 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14705 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14707 case "$gethostbyaddr_r_proto" in
14708 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14709 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14711 case "$gethostbyaddr_r_proto" in
14712 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14713 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14715 case "$gethostbyaddr_r_proto" in
14716 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14717 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14719 case "$gethostbyaddr_r_proto" in
14720 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14721 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14723 case "$gethostbyaddr_r_proto" in
14724 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14725 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14727 case "$gethostbyaddr_r_proto" in
14728 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14729 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14731 case "$gethostbyaddr_r_proto" in
14732 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14733 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14735 case "$gethostbyaddr_r_proto" in
14736 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14739 case "$gethostbyaddr_r_proto" in
14740 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14741 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14743 case "$gethostbyaddr_r_proto" in
14744 ''|0) d_gethostbyaddr_r=undef
14745 gethostbyaddr_r_proto=0
14746 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14747 * ) case "$gethostbyaddr_r_proto" in
14748 REENTRANT_PROTO*) ;;
14749 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14751 echo "Prototype: $try" ;;
14754 *) case "$usethreads" in
14755 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14757 d_gethostbyaddr_r=undef
14758 gethostbyaddr_r_proto=0
14762 *) gethostbyaddr_r_proto=0
14766 : see if gethostbyname_r exists
14767 set gethostbyname_r d_gethostbyname_r
14769 case "$d_gethostbyname_r" in
14771 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14772 case "$d_gethostbyname_r_proto:$usethreads" in
14773 ":define") d_gethostbyname_r_proto=define
14774 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14778 case "$d_gethostbyname_r_proto" in
14780 case "$gethostbyname_r_proto" in
14781 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14782 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14784 case "$gethostbyname_r_proto" in
14785 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14786 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14788 case "$gethostbyname_r_proto" in
14789 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14790 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14792 case "$gethostbyname_r_proto" in
14793 ''|0) d_gethostbyname_r=undef
14794 gethostbyname_r_proto=0
14795 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14796 * ) case "$gethostbyname_r_proto" in
14797 REENTRANT_PROTO*) ;;
14798 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14800 echo "Prototype: $try" ;;
14803 *) case "$usethreads" in
14804 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14806 d_gethostbyname_r=undef
14807 gethostbyname_r_proto=0
14811 *) gethostbyname_r_proto=0
14815 : see if gethostent_r exists
14816 set gethostent_r d_gethostent_r
14818 case "$d_gethostent_r" in
14820 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14821 case "$d_gethostent_r_proto:$usethreads" in
14822 ":define") d_gethostent_r_proto=define
14823 set d_gethostent_r_proto gethostent_r $hdrs
14827 case "$d_gethostent_r_proto" in
14829 case "$gethostent_r_proto" in
14830 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14831 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14833 case "$gethostent_r_proto" in
14834 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14835 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14837 case "$gethostent_r_proto" in
14838 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14839 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14841 case "$gethostent_r_proto" in
14842 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14843 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14845 case "$gethostent_r_proto" in
14846 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14847 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14849 case "$gethostent_r_proto" in
14850 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14851 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14853 case "$gethostent_r_proto" in
14854 ''|0) d_gethostent_r=undef
14855 gethostent_r_proto=0
14856 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14857 * ) case "$gethostent_r_proto" in
14858 REENTRANT_PROTO*) ;;
14859 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14861 echo "Prototype: $try" ;;
14864 *) case "$usethreads" in
14865 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14867 d_gethostent_r=undef
14868 gethostent_r_proto=0
14872 *) gethostent_r_proto=0
14876 : see if prototypes for various gethostxxx netdb.h functions are available
14878 set d_gethostprotos gethostent $i_netdb netdb.h
14881 : see if getitimer exists
14882 set getitimer d_getitimer
14885 : see if getlogin exists
14886 set getlogin d_getlogin
14889 : see if getlogin_r exists
14890 set getlogin_r d_getlogin_r
14892 case "$d_getlogin_r" in
14894 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14895 case "$d_getlogin_r_proto:$usethreads" in
14896 ":define") d_getlogin_r_proto=define
14897 set d_getlogin_r_proto getlogin_r $hdrs
14901 case "$d_getlogin_r_proto" in
14903 case "$getlogin_r_proto" in
14904 ''|0) try='int getlogin_r(char*, size_t);'
14905 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14907 case "$getlogin_r_proto" in
14908 ''|0) try='int getlogin_r(char*, int);'
14909 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14911 case "$getlogin_r_proto" in
14912 ''|0) try='char* getlogin_r(char*, size_t);'
14913 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14915 case "$getlogin_r_proto" in
14916 ''|0) try='char* getlogin_r(char*, int);'
14917 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14919 case "$getlogin_r_proto" in
14920 ''|0) d_getlogin_r=undef
14922 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14923 * ) case "$getlogin_r_proto" in
14924 REENTRANT_PROTO*) ;;
14925 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14927 echo "Prototype: $try" ;;
14930 *) case "$usethreads" in
14931 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14938 *) getlogin_r_proto=0
14942 : see if getmnt exists
14943 set getmnt d_getmnt
14946 : see if getmntent exists
14947 set getmntent d_getmntent
14950 : see if getnameinfo exists
14951 set getnameinfo d_getnameinfo
14954 : see if getnetbyaddr exists
14955 set getnetbyaddr d_getnbyaddr
14958 : see if getnetbyname exists
14959 set getnetbyname d_getnbyname
14962 : see if getnetent exists
14963 set getnetent d_getnent
14966 : see if getnetbyaddr_r exists
14967 set getnetbyaddr_r d_getnetbyaddr_r
14969 case "$d_getnetbyaddr_r" in
14971 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14972 case "$d_getnetbyaddr_r_proto:$usethreads" in
14973 ":define") d_getnetbyaddr_r_proto=define
14974 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14978 case "$d_getnetbyaddr_r_proto" in
14980 case "$getnetbyaddr_r_proto" in
14981 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14982 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14984 case "$getnetbyaddr_r_proto" in
14985 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14986 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14988 case "$getnetbyaddr_r_proto" in
14989 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14990 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14992 case "$getnetbyaddr_r_proto" in
14993 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14994 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14996 case "$getnetbyaddr_r_proto" in
14997 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14998 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
15000 case "$getnetbyaddr_r_proto" in
15001 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
15002 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
15004 case "$getnetbyaddr_r_proto" in
15005 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
15006 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
15008 case "$getnetbyaddr_r_proto" in
15009 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
15010 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
15012 case "$getnetbyaddr_r_proto" in
15013 ''|0) d_getnetbyaddr_r=undef
15014 getnetbyaddr_r_proto=0
15015 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
15016 * ) case "$getnetbyaddr_r_proto" in
15017 REENTRANT_PROTO*) ;;
15018 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
15020 echo "Prototype: $try" ;;
15023 *) case "$usethreads" in
15024 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
15026 d_getnetbyaddr_r=undef
15027 getnetbyaddr_r_proto=0
15031 *) getnetbyaddr_r_proto=0
15035 : see if getnetbyname_r exists
15036 set getnetbyname_r d_getnetbyname_r
15038 case "$d_getnetbyname_r" in
15040 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15041 case "$d_getnetbyname_r_proto:$usethreads" in
15042 ":define") d_getnetbyname_r_proto=define
15043 set d_getnetbyname_r_proto getnetbyname_r $hdrs
15047 case "$d_getnetbyname_r_proto" in
15049 case "$getnetbyname_r_proto" in
15050 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
15051 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
15053 case "$getnetbyname_r_proto" in
15054 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
15055 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
15057 case "$getnetbyname_r_proto" in
15058 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15059 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15061 case "$getnetbyname_r_proto" in
15062 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15063 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15065 case "$getnetbyname_r_proto" in
15066 ''|0) d_getnetbyname_r=undef
15067 getnetbyname_r_proto=0
15068 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15069 * ) case "$getnetbyname_r_proto" in
15070 REENTRANT_PROTO*) ;;
15071 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15073 echo "Prototype: $try" ;;
15076 *) case "$usethreads" in
15077 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15079 d_getnetbyname_r=undef
15080 getnetbyname_r_proto=0
15084 *) getnetbyname_r_proto=0
15088 : see if getnetent_r exists
15089 set getnetent_r d_getnetent_r
15091 case "$d_getnetent_r" in
15093 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15094 case "$d_getnetent_r_proto:$usethreads" in
15095 ":define") d_getnetent_r_proto=define
15096 set d_getnetent_r_proto getnetent_r $hdrs
15100 case "$d_getnetent_r_proto" in
15102 case "$getnetent_r_proto" in
15103 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15104 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15106 case "$getnetent_r_proto" in
15107 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15108 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15110 case "$getnetent_r_proto" in
15111 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15112 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15114 case "$getnetent_r_proto" in
15115 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15116 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15118 case "$getnetent_r_proto" in
15119 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15120 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15122 case "$getnetent_r_proto" in
15123 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15124 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15126 case "$getnetent_r_proto" in
15127 ''|0) d_getnetent_r=undef
15128 getnetent_r_proto=0
15129 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15130 * ) case "$getnetent_r_proto" in
15131 REENTRANT_PROTO*) ;;
15132 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15134 echo "Prototype: $try" ;;
15137 *) case "$usethreads" in
15138 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15140 d_getnetent_r=undef
15141 getnetent_r_proto=0
15145 *) getnetent_r_proto=0
15149 : see if prototypes for various getnetxxx netdb.h functions are available
15151 set d_getnetprotos getnetent $i_netdb netdb.h
15154 : see if getpagesize exists
15155 set getpagesize d_getpagsz
15158 : Optional checks for getprotobyname and getprotobynumber
15160 : see if getprotobyname exists
15161 set getprotobyname d_getpbyname
15164 : see if getprotobynumber exists
15165 set getprotobynumber d_getpbynumber
15168 : see if getprotoent exists
15169 set getprotoent d_getpent
15172 : see if getpgid exists
15173 set getpgid d_getpgid
15176 : see if getpgrp2 exists
15177 set getpgrp2 d_getpgrp2
15180 : see if getppid exists
15181 set getppid d_getppid
15184 : see if getpriority exists
15185 set getpriority d_getprior
15188 : see if getprotobyname_r exists
15189 set getprotobyname_r d_getprotobyname_r
15191 case "$d_getprotobyname_r" in
15193 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15194 case "$d_getprotobyname_r_proto:$usethreads" in
15195 ":define") d_getprotobyname_r_proto=define
15196 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15200 case "$d_getprotobyname_r_proto" in
15202 case "$getprotobyname_r_proto" in
15203 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15204 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15206 case "$getprotobyname_r_proto" in
15207 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15208 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15210 case "$getprotobyname_r_proto" in
15211 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15212 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15214 case "$getprotobyname_r_proto" in
15215 ''|0) d_getprotobyname_r=undef
15216 getprotobyname_r_proto=0
15217 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15218 * ) case "$getprotobyname_r_proto" in
15219 REENTRANT_PROTO*) ;;
15220 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15222 echo "Prototype: $try" ;;
15225 *) case "$usethreads" in
15226 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15228 d_getprotobyname_r=undef
15229 getprotobyname_r_proto=0
15233 *) getprotobyname_r_proto=0
15237 : see if getprotobynumber_r exists
15238 set getprotobynumber_r d_getprotobynumber_r
15240 case "$d_getprotobynumber_r" in
15242 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15243 case "$d_getprotobynumber_r_proto:$usethreads" in
15244 ":define") d_getprotobynumber_r_proto=define
15245 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15249 case "$d_getprotobynumber_r_proto" in
15251 case "$getprotobynumber_r_proto" in
15252 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15253 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15255 case "$getprotobynumber_r_proto" in
15256 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15257 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15259 case "$getprotobynumber_r_proto" in
15260 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15261 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15263 case "$getprotobynumber_r_proto" in
15264 ''|0) d_getprotobynumber_r=undef
15265 getprotobynumber_r_proto=0
15266 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15267 * ) case "$getprotobynumber_r_proto" in
15268 REENTRANT_PROTO*) ;;
15269 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15271 echo "Prototype: $try" ;;
15274 *) case "$usethreads" in
15275 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15277 d_getprotobynumber_r=undef
15278 getprotobynumber_r_proto=0
15282 *) getprotobynumber_r_proto=0
15286 : see if getprotoent_r exists
15287 set getprotoent_r d_getprotoent_r
15289 case "$d_getprotoent_r" in
15291 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15292 case "$d_getprotoent_r_proto:$usethreads" in
15293 ":define") d_getprotoent_r_proto=define
15294 set d_getprotoent_r_proto getprotoent_r $hdrs
15298 case "$d_getprotoent_r_proto" in
15300 case "$getprotoent_r_proto" in
15301 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15302 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15304 case "$getprotoent_r_proto" in
15305 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15306 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15308 case "$getprotoent_r_proto" in
15309 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15310 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15312 case "$getprotoent_r_proto" in
15313 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15314 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15316 case "$getprotoent_r_proto" in
15317 ''|0) d_getprotoent_r=undef
15318 getprotoent_r_proto=0
15319 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15320 * ) case "$getprotoent_r_proto" in
15321 REENTRANT_PROTO*) ;;
15322 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15324 echo "Prototype: $try" ;;
15327 *) case "$usethreads" in
15328 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15330 d_getprotoent_r=undef
15331 getprotoent_r_proto=0
15335 *) getprotoent_r_proto=0
15339 : see if prototypes for various getprotoxxx netdb.h functions are available
15341 set d_getprotoprotos getprotoent $i_netdb netdb.h
15344 : see if getprpwnam exists
15345 set getprpwnam d_getprpwnam
15348 : see if getpwent exists
15349 set getpwent d_getpwent
15352 : see if getpwent_r exists
15353 set getpwent_r d_getpwent_r
15355 case "$d_getpwent_r" in
15357 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15358 case "$d_getpwent_r_proto:$usethreads" in
15359 ":define") d_getpwent_r_proto=define
15360 set d_getpwent_r_proto getpwent_r $hdrs
15364 case "$d_getpwent_r_proto" in
15366 case "$getpwent_r_proto" in
15367 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15368 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15370 case "$getpwent_r_proto" in
15371 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15372 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15374 case "$getpwent_r_proto" in
15375 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15376 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15378 case "$getpwent_r_proto" in
15379 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15380 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15382 case "$getpwent_r_proto" in
15383 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15384 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15386 case "$getpwent_r_proto" in
15387 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15388 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15390 case "$getpwent_r_proto" in
15391 ''|0) d_getpwent_r=undef
15393 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15394 * ) case "$getpwent_r_proto" in
15395 REENTRANT_PROTO*) ;;
15396 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15398 echo "Prototype: $try" ;;
15401 *) case "$usethreads" in
15402 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15409 *) getpwent_r_proto=0
15413 : see if getpwnam_r exists
15414 set getpwnam_r d_getpwnam_r
15416 case "$d_getpwnam_r" in
15418 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15419 case "$d_getpwnam_r_proto:$usethreads" in
15420 ":define") d_getpwnam_r_proto=define
15421 set d_getpwnam_r_proto getpwnam_r $hdrs
15425 case "$d_getpwnam_r_proto" in
15427 case "$getpwnam_r_proto" in
15428 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15429 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15431 case "$getpwnam_r_proto" in
15432 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15433 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15435 case "$getpwnam_r_proto" in
15436 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15437 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15439 case "$getpwnam_r_proto" in
15440 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15441 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15443 case "$getpwnam_r_proto" in
15444 ''|0) d_getpwnam_r=undef
15446 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15447 * ) case "$getpwnam_r_proto" in
15448 REENTRANT_PROTO*) ;;
15449 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15451 echo "Prototype: $try" ;;
15454 *) case "$usethreads" in
15455 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15462 *) getpwnam_r_proto=0
15466 : see if getpwuid_r exists
15467 set getpwuid_r d_getpwuid_r
15469 case "$d_getpwuid_r" in
15471 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15472 case "$d_getpwuid_r_proto:$usethreads" in
15473 ":define") d_getpwuid_r_proto=define
15474 set d_getpwuid_r_proto getpwuid_r $hdrs
15478 case "$d_getpwuid_r_proto" in
15480 case "$getpwuid_r_proto" in
15481 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15482 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15484 case "$getpwuid_r_proto" in
15485 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15486 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15488 case "$getpwuid_r_proto" in
15489 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15490 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15492 case "$getpwuid_r_proto" in
15493 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15494 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15496 case "$getpwuid_r_proto" in
15497 ''|0) d_getpwuid_r=undef
15499 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15500 * ) case "$getpwuid_r_proto" in
15501 REENTRANT_PROTO*) ;;
15502 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15504 echo "Prototype: $try" ;;
15507 *) case "$usethreads" in
15508 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15515 *) getpwuid_r_proto=0
15519 : Optional checks for getsbyname and getsbyport
15521 : see if getservbyname exists
15522 set getservbyname d_getsbyname
15525 : see if getservbyport exists
15526 set getservbyport d_getsbyport
15529 : see if getservent exists
15530 set getservent d_getsent
15533 : see if getservbyname_r exists
15534 set getservbyname_r d_getservbyname_r
15536 case "$d_getservbyname_r" in
15538 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15539 case "$d_getservbyname_r_proto:$usethreads" in
15540 ":define") d_getservbyname_r_proto=define
15541 set d_getservbyname_r_proto getservbyname_r $hdrs
15545 case "$d_getservbyname_r_proto" in
15547 case "$getservbyname_r_proto" in
15548 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15549 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15551 case "$getservbyname_r_proto" in
15552 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15553 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15555 case "$getservbyname_r_proto" in
15556 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15557 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15559 case "$getservbyname_r_proto" in
15560 ''|0) d_getservbyname_r=undef
15561 getservbyname_r_proto=0
15562 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15563 * ) case "$getservbyname_r_proto" in
15564 REENTRANT_PROTO*) ;;
15565 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15567 echo "Prototype: $try" ;;
15570 *) case "$usethreads" in
15571 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15573 d_getservbyname_r=undef
15574 getservbyname_r_proto=0
15578 *) getservbyname_r_proto=0
15582 : see if getservbyport_r exists
15583 set getservbyport_r d_getservbyport_r
15585 case "$d_getservbyport_r" in
15587 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15588 case "$d_getservbyport_r_proto:$usethreads" in
15589 ":define") d_getservbyport_r_proto=define
15590 set d_getservbyport_r_proto getservbyport_r $hdrs
15594 case "$d_getservbyport_r_proto" in
15596 case "$getservbyport_r_proto" in
15597 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15598 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15600 case "$getservbyport_r_proto" in
15601 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15602 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15604 case "$getservbyport_r_proto" in
15605 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15606 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15608 case "$getservbyport_r_proto" in
15609 ''|0) d_getservbyport_r=undef
15610 getservbyport_r_proto=0
15611 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15612 * ) case "$getservbyport_r_proto" in
15613 REENTRANT_PROTO*) ;;
15614 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15616 echo "Prototype: $try" ;;
15619 *) case "$usethreads" in
15620 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15622 d_getservbyport_r=undef
15623 getservbyport_r_proto=0
15627 *) getservbyport_r_proto=0
15631 : see if getservent_r exists
15632 set getservent_r d_getservent_r
15634 case "$d_getservent_r" in
15636 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15637 case "$d_getservent_r_proto:$usethreads" in
15638 ":define") d_getservent_r_proto=define
15639 set d_getservent_r_proto getservent_r $hdrs
15643 case "$d_getservent_r_proto" in
15645 case "$getservent_r_proto" in
15646 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15647 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15649 case "$getservent_r_proto" in
15650 ''|0) try='int getservent_r(struct servent*, char*, int);'
15651 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15653 case "$getservent_r_proto" in
15654 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15655 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15657 case "$getservent_r_proto" in
15658 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15659 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15661 case "$getservent_r_proto" in
15662 ''|0) d_getservent_r=undef
15663 getservent_r_proto=0
15664 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15665 * ) case "$getservent_r_proto" in
15666 REENTRANT_PROTO*) ;;
15667 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15669 echo "Prototype: $try" ;;
15672 *) case "$usethreads" in
15673 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15675 d_getservent_r=undef
15676 getservent_r_proto=0
15680 *) getservent_r_proto=0
15684 : see if prototypes for various getservxxx netdb.h functions are available
15686 set d_getservprotos getservent $i_netdb netdb.h
15689 : see if getspnam exists
15690 set getspnam d_getspnam
15693 : see if this is a shadow.h system
15694 set shadow.h i_shadow
15697 : see if getspnam_r exists
15698 set getspnam_r d_getspnam_r
15700 case "$d_getspnam_r" in
15702 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15703 case "$d_getspnam_r_proto:$usethreads" in
15704 ":define") d_getspnam_r_proto=define
15705 set d_getspnam_r_proto getspnam_r $hdrs
15709 case "$d_getspnam_r_proto" in
15711 case "$getspnam_r_proto" in
15712 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15713 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15715 case "$getspnam_r_proto" in
15716 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15717 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15719 case "$getspnam_r_proto" in
15720 ''|0) d_getspnam_r=undef
15722 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15723 * ) case "$getspnam_r_proto" in
15724 REENTRANT_PROTO*) ;;
15725 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15727 echo "Prototype: $try" ;;
15730 *) case "$usethreads" in
15731 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15738 *) getspnam_r_proto=0
15742 : see if gettimeofday or ftime exists
15743 set gettimeofday d_gettimeod
15745 case "$d_gettimeod" in
15751 val="$undef"; set d_ftime; eval $setvar
15754 case "$d_gettimeod$d_ftime" in
15757 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15761 : see if gmtime_r exists
15762 set gmtime_r d_gmtime_r
15764 case "$d_gmtime_r" in
15766 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15767 case "$d_gmtime_r_proto:$usethreads" in
15768 ":define") d_gmtime_r_proto=define
15769 set d_gmtime_r_proto gmtime_r $hdrs
15773 case "$d_gmtime_r_proto" in
15775 case "$gmtime_r_proto" in
15776 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15777 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15779 case "$gmtime_r_proto" in
15780 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15781 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15783 case "$gmtime_r_proto" in
15784 ''|0) d_gmtime_r=undef
15786 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15787 * ) case "$gmtime_r_proto" in
15788 REENTRANT_PROTO*) ;;
15789 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15791 echo "Prototype: $try" ;;
15794 *) case "$usethreads" in
15795 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15802 *) gmtime_r_proto=0
15806 : see if hasmntopt exists
15807 set hasmntopt d_hasmntopt
15810 : see if this is a netinet/in.h or sys/in.h system
15811 set netinet/in.h i_niin sys/in.h i_sysin
15814 : see if arpa/inet.h has to be included
15815 set arpa/inet.h i_arpainet
15818 : see if htonl --and friends-- exists
15823 : Maybe they are macros.
15826 $cat >htonl.c <<EOM
15828 #include <sys/types.h>
15829 #$i_niin I_NETINET_IN
15831 #$i_arpainet I_ARPA_INET
15832 #ifdef I_NETINET_IN
15833 #include <netinet/in.h>
15836 #include <sys/in.h>
15839 #include <arpa/inet.h>
15842 printf("Defined as a macro.");
15845 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15846 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15848 echo "But it seems to be defined as a macro." >&4
15856 : see if hypot exists
15860 : see if ilogb exists
15864 : see if ilogbl exists
15865 set ilogbl d_ilogbl
15870 if set index val -f; eval $csym; $val; then
15871 if set strchr val -f d_strchr; eval $csym; $val; then
15872 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15875 echo "strchr() found." >&4
15879 echo "index() found." >&4
15884 echo "index() found." >&4
15887 if set strchr val -f d_strchr; eval $csym; $val; then
15890 echo "strchr() found." >&4
15892 echo "No index() or strchr() found!" >&4
15897 set d_strchr; eval $setvar
15899 set d_index; eval $setvar
15901 : check whether inet_aton exists
15902 set inet_aton d_inetaton
15905 : see if inet_ntop exists
15906 set inet_ntop d_inetntop
15909 : see if inet_pton exists
15910 set inet_pton d_inetpton
15915 $cat >isascii.c <<EOCP
15918 #$i_stdlib I_STDLIB
15920 #include <stdlib.h>
15931 if eval $compile; then
15932 echo "isascii() found." >&4
15935 echo "isascii() NOT found." >&4
15944 $cat >isblank.c <<'EOCP'
15955 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15956 echo "isblank() found." >&4
15959 echo "isblank() NOT found." >&4
15966 : check for isfinite
15967 echo "Checking to see if you have isfinite..." >&4
15973 int main() { return isfinite(0.0); }
15976 if eval $compile; then
15978 echo "You have isfinite."
15981 echo "You do not have isfinite."
15987 : see if isfinitel exists
15988 set isfinitel d_isfinitel
15992 echo "Checking to see if you have isinf..." >&4
15998 int main() { return isinf(0.0); }
16001 if eval $compile; then
16003 echo "You have isinf."
16006 echo "You do not have isinf."
16012 : see if isinfl exists
16013 set isinfl d_isinfl
16017 echo "Checking to see if you have isless..." >&4
16023 int main() { return isless(0.0); }
16026 if eval $compile; then
16028 echo "You have isless."
16031 echo "You do not have isless."
16038 echo "Checking to see if you have isnan..." >&4
16044 int main() { return isnan(0.0); }
16047 if eval $compile; then
16049 echo "You have isnan."
16052 echo "You do not have isnan."
16058 : see if isnanl exists
16059 set isnanl d_isnanl
16062 : check for isnormal
16063 echo "Checking to see if you have isnormal..." >&4
16069 int main() { return isnormal(0.0); }
16072 if eval $compile; then
16074 echo "You have isnormal."
16077 echo "You do not have isnormal."
16087 : see if j0l exists
16091 : see if killpg exists
16092 set killpg d_killpg
16095 : see if localeconv exists
16096 set localeconv d_locconv
16099 : see if libc has the POSIX.1-2008 currency locale rules
16100 case "$d_locconv:$d_lc_monetary_2008" in
16103 #include <locale.h>
16105 struct lconv *lc = localeconv();
16106 char int_p_cs_precedes = lc->int_p_cs_precedes;
16111 if eval $compile; then
16112 d_lc_monetary_2008="$define"
16114 d_lc_monetary_2008="$undef"
16120 : see if lchown exists
16122 $cat > try.c <<'EOCP'
16123 /* System header to define __stub macros and hopefully few prototypes,
16124 which can conflict with char lchown(); below. */
16125 #include <assert.h>
16126 /* Override any gcc2 internal prototype to avoid an error. */
16127 /* We use char because int might match the return type of a gcc2
16128 builtin and then its argument prototype would still apply. */
16131 /* The GNU C library defines this for functions which it implements
16132 to always fail with ENOSYS. Some functions are actually named
16133 something starting with __ and the normal name is an alias. */
16134 #if defined (__stub_lchown) || defined (__stub___lchown)
16142 if eval $compile; then
16143 $echo "lchown() found." >&4
16146 $echo "lchown() NOT found." >&4
16152 : See if number of significant digits in a double precision number is known
16154 $cat >ldbl_dig.c <<EOM
16155 #$i_limits I_LIMITS
16158 #include <limits.h>
16164 printf("Contains LDBL_DIG");
16167 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16168 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16169 echo "LDBL_DIG found." >&4
16172 echo "LDBL_DIG NOT found." >&4
16179 : see if lgamma exists
16180 set lgamma d_lgamma
16183 : see if lgamma_r exists
16184 set lgamma_r d_lgamma_r
16187 : check to see if math.h defines _LIB_VERSION
16188 d_libm_lib_version="$undef"
16192 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16194 #include <unistd.h>
16196 int main (int argc, char *argv[])
16198 printf ("%d\n", _LIB_VERSION);
16203 if eval $compile; then
16205 echo "Yes, it does ($foo)" >&4
16206 d_libm_lib_version="$define"
16208 echo "No, it does not (probably harmless)" >&4
16215 : see if link exists
16219 : see if llrint exists
16220 set llrint d_llrint
16223 : see if llrintl exists
16224 set llrintl d_llrintl
16227 : see if llround exists
16228 set llround d_llround
16231 : see if llroundl exists
16232 set llroundl d_llroundl
16235 : see if localtime_r exists
16236 set localtime_r d_localtime_r
16238 case "$d_localtime_r" in
16240 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16241 case "$d_localtime_r_proto:$usethreads" in
16242 ":define") d_localtime_r_proto=define
16243 set d_localtime_r_proto localtime_r $hdrs
16247 case "$d_localtime_r_proto" in
16249 case "$localtime_r_proto" in
16250 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16251 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16253 case "$localtime_r_proto" in
16254 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16255 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16257 case "$localtime_r_proto" in
16258 ''|0) d_localtime_r=undef
16259 localtime_r_proto=0
16260 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16261 * ) case "$localtime_r_proto" in
16262 REENTRANT_PROTO*) ;;
16263 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16265 echo "Prototype: $try" ;;
16268 *) case "$usethreads" in
16269 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16271 d_localtime_r=undef
16272 localtime_r_proto=0
16276 *) localtime_r_proto=0
16280 : see if localtime_r calls tzset
16281 case "$localtime_r_proto" in
16284 /* Does our libc's localtime_r call tzset ?
16285 * return 0 if so, 1 otherwise.
16287 #$i_systypes I_SYS_TYPES
16288 #$i_unistd I_UNISTD
16290 #$i_stdlib I_STDLIB
16291 #$i_string I_STRING
16292 #$i_malloc I_MALLOC
16294 # include <sys/types.h>
16297 # include <unistd.h>
16303 #include <stdlib.h>
16306 # include <string.h>
16308 # include <strings.h>
16311 # include <malloc.h>
16315 time_t t = time(0L);
16316 char w_tz[]="TZ" "=GMT+5",
16317 e_tz[]="TZ" "=GMT-5",
16318 *tz_e = (char*)malloc(16),
16319 *tz_w = (char*)malloc(16);
16320 struct tm tm_e, tm_w;
16321 memset(&tm_e,'\0',sizeof(struct tm));
16322 memset(&tm_w,'\0',sizeof(struct tm));
16327 localtime_r(&t, &tm_e);
16330 localtime_r(&t, &tm_w);
16332 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16338 if eval $compile; then
16339 if $run ./try; then
16340 d_localtime_r_needs_tzset=undef;
16342 d_localtime_r_needs_tzset=define;
16345 d_localtime_r_needs_tzset=undef;
16349 d_localtime_r_needs_tzset=undef;
16354 : see if lockf exists
16358 : see if log1p exists
16362 : see if log2 exists
16366 : see if logb exists
16370 : see if lrint exists
16374 : see if lrintl exists
16375 set lrintl d_lrintl
16378 : see if lround exists
16379 set lround d_lround
16382 : see if lroundl exists
16383 set lroundl d_lroundl
16386 : see if prototype for lseek is available
16388 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16391 : see if lstat exists
16395 : see if madvise exists
16396 set madvise d_madvise
16399 : see if malloc_size exists
16400 set malloc_size d_malloc_size
16403 : see if malloc_size_good exists
16404 set malloc_good_size d_malloc_good_size
16407 : see if mblen exists
16411 : see if mbstowcs exists
16412 set mbstowcs d_mbstowcs
16415 : see if mbtowc exists
16416 set mbtowc d_mbtowc
16419 : see if memchr exists
16420 set memchr d_memchr
16423 : see if memcmp exists
16424 set memcmp d_memcmp
16427 : see if memcpy exists
16428 set memcpy d_memcpy
16431 : see if memmem exists
16432 set memmem d_memmem
16435 : see if memmove exists
16436 set memmove d_memmove
16439 : see if memset exists
16440 set memset d_memset
16443 : see if mkdir exists
16447 : see if mkdtemp exists
16448 set mkdtemp d_mkdtemp
16451 : see if mkfifo exists
16452 set mkfifo d_mkfifo
16455 : see if mkstemp exists
16456 set mkstemp d_mkstemp
16459 : see if mkstemps exists
16460 set mkstemps d_mkstemps
16463 : see if mktime exists
16464 set mktime d_mktime
16467 : see if this is a sys/mman.h system
16468 set sys/mman.h i_sysmman
16471 : see if mmap exists
16474 : see what shmat returns
16475 : default to something harmless
16477 case "$i_sysmman$d_mmap" in
16479 $cat >mmap.c <<'END'
16480 #include <sys/mman.h>
16483 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16488 echo "and it returns ($mmaptype)." >&4
16494 : see if sqrtl exists
16498 : see if scalbnl exists
16499 set scalbnl d_scalbnl
16502 : see if truncl exists
16503 set truncl d_truncl
16506 : see if modfl exists
16510 : see if prototype for modfl is available
16512 set d_modflproto modfl $i_math math.h
16515 if $test "$uselongdouble" = "$define"; then
16517 if $test "$d_sqrtl" != "$define"; then
16518 message="$message sqrtl"
16520 if $test "$d_modfl" != "$define"; then
16521 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16522 echo "You have both truncl and copysignl, so I can emulate modfl."
16524 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16525 echo "You have both aintl and copysignl, so I can emulate modfl."
16527 message="$message modfl"
16531 if $test "$d_frexpl" != "$define"; then
16532 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16533 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16535 message="$message frexpl"
16538 if $test "$d_ldexpl" != "$define"; then
16539 message="$message ldexpl"
16542 if $test "$message" != ""; then
16545 *** You requested the use of long doubles but you do not seem to have
16546 *** the following mathematical functions needed for long double support:
16548 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16549 *** Cannot continue, aborting.
16557 : see if mprotect exists
16558 set mprotect d_mprotect
16561 : see if msgctl exists
16562 set msgctl d_msgctl
16565 : see if msgget exists
16566 set msgget d_msgget
16569 : see if msgsnd exists
16570 set msgsnd d_msgsnd
16573 : see if msgrcv exists
16574 set msgrcv d_msgrcv
16577 : see how much of the 'msg*(2)' library is present.
16580 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16581 *"$undef"*) h_msg=false;;
16585 case "`ipcs 2>&1`" in
16586 "SVID messages"*"not configured"*)
16587 echo "Your $osname does not have the msg*(2) configured." >&4
16590 set msgctl d_msgctl
16592 set msgget d_msgget
16594 set msgsnd d_msgsnd
16596 set msgrcv d_msgrcv
16602 : we could also check for sys/ipc.h ...
16603 if $h_msg && $test `./findhdr sys/msg.h`; then
16604 echo "You have the full msg*(2) library." >&4
16607 echo "You don't have the full msg*(2) library." >&4
16613 : Check for msghdr_s
16615 echo "Checking to see if your system supports struct msghdr..." >&4
16616 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16618 case "$d_msghdr_s" in
16619 "$define") echo "Yes, it does." ;;
16620 *) echo "No, it doesn't." ;;
16624 : see if msync exists
16628 : see if munmap exists
16629 set munmap d_munmap
16632 : see if nan exists
16636 : see if nearbyint exists
16637 set nearbyint d_nearbyint
16640 : see if nextafter exists
16641 set nextafter d_nextafter
16644 : see if nexttoward exists
16645 set nexttoward d_nexttoward
16648 : see if nice exists
16652 : see if this is a langinfo.h system
16653 set langinfo.h i_langinfo
16656 : see if nl_langinfo exists
16657 set nl_langinfo d_nl_langinfo
16660 : see if this is a quadmath.h system
16661 set quadmath.h i_quadmath
16664 : check for volatile keyword
16666 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16667 $cat >try.c <<'EOCP'
16670 typedef struct _goo_struct goo_struct;
16671 goo_struct * volatile goo = ((goo_struct *)0);
16672 struct _goo_struct {
16677 typedef unsigned short foo_t;
16678 char *volatile foo;
16680 volatile foo_t blech;
16684 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16686 echo "Yup, it does."
16689 echo "Nope, it doesn't."
16695 : Check basic sizes
16697 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16699 case "$use64bitint:$d_quad:$quadtype" in
16702 uvtype="$uquadtype"
16707 uvtype="unsigned long"
16713 case "$uselongdouble:$d_longdbl" in
16715 nvtype="long double"
16716 nvsize=$longdblsize
16723 case "$usequadmath:$i_quadmath" in
16725 nvtype="__float128"
16731 *** You requested the use of the quadmath library, but you
16732 *** do not seem to have the quadmath library installed.
16733 *** Cannot continue, aborting.
16739 define:*) $cat <<EOM >&4
16741 *** You requested the use of the quadmath library, but you
16742 *** do not seem to have the required header, <quadmath.h>.
16744 case "$gccversion" in
16747 *** Your gcc looks a bit old:
16753 *** You are not running a gcc.
16758 *** For the quadmath library you need at least gcc 4.6.
16759 *** Cannot continue, aborting.
16765 $echo "(IV will be "$ivtype", $ivsize bytes)"
16766 $echo "(UV will be "$uvtype", $uvsize bytes)"
16767 $echo "(NV will be "$nvtype", $nvsize bytes)"
16770 #$i_inttypes I_INTTYPES
16772 #include <inttypes.h>
16777 int8_t i = INT8_MAX;
16778 uint8_t u = UINT8_MAX;
16779 printf("int8_t\n");
16782 int16_t i = INT16_MAX;
16783 uint16_t u = UINT16_MAX;
16784 printf("int16_t\n");
16787 int32_t i = INT32_MAX;
16788 uint32_t u = UINT32_MAX;
16789 printf("int32_t\n");
16794 i8type="signed char"
16795 u8type="unsigned char"
16800 '') case "$shortsize" in
16802 u16type="unsigned short"
16810 '') set try -DINT16
16811 if eval $compile; then
16812 case "`$run ./try`" in
16824 '') if $test $shortsize -ge 2; then
16826 u16type="unsigned short"
16834 '') case "$longsize" in
16836 u32type="unsigned long"
16840 *) case "$intsize" in
16842 u32type="unsigned int"
16852 '') set try -DINT32
16853 if eval $compile; then
16854 case "`$run ./try`" in
16866 '') if $test $intsize -ge 4; then
16868 u32type="unsigned int"
16876 '') case "$d_quad:$quadtype" in
16878 i64type="$quadtype"
16879 u64type="$uquadtype"
16887 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16888 : volatile so that the compiler has to store it out to memory.
16889 if test X"$d_volatile" = X"$define"; then
16894 #$i_stdlib I_STDLIB
16896 #include <stdlib.h>
16898 #include <sys/types.h>
16899 #include <signal.h>
16901 $volatile int bletched = 0;
16902 $signal_t blech(int s) { bletched = 1; }
16907 int n = 8 * $uvsize;
16910 signal(SIGFPE, blech);
16913 for (i = 0; i < n; i++) {
16914 u = u << 1 | ($uvtype)1;
16916 if (($uvtype)d != u)
16920 d = ($nvtype)(u - 1);
16921 if (($uvtype)d != (u - 1))
16928 printf("%d\n", ((i == n) ? -n : i));
16934 d_nv_preserves_uv="$undef"
16935 if eval $compile; then
16936 nv_preserves_uv_bits="`$run ./try`"
16938 case "$nv_preserves_uv_bits" in
16940 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16941 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16942 d_nv_preserves_uv="$define"
16944 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16945 d_nv_preserves_uv="$undef" ;;
16946 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16947 nv_preserves_uv_bits="0" ;;
16951 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16952 : volatile so that the compiler has to store it out to memory.
16953 if test X"$d_volatile" = X"$define"; then
16959 typedef $nvtype NV;
16966 while(count < 256) {
16967 $volatile NV up = value + 1.0;
16968 $volatile NV negated = -value;
16969 $volatile NV down = negated - 1.0;
16970 $volatile NV got_up = up - value;
16971 int up_good = got_up == 1.0;
16972 int got_down = down - negated;
16973 int down_good = got_down == -1.0;
16975 if (down_good != up_good) {
16977 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16978 up_good, (double) got_up, down_good, (double) got_down,
16979 count, (double) value);
16986 fputs("256.0", stdout);
16989 fputs("2.0", stdout);
16995 fputs("*", stdout);
17001 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17002 count, (double) value);
17008 nv_overflows_integers_at='0'
17009 if eval $compile; then
17015 The largest integer your NVs can preserve is equal to $xxx
17017 nv_overflows_integers_at="$xxx"
17020 Cannot determine the largest integer value your NVs can hold, unexpected output
17027 Cannot determine the largest integer value your NVs can hold
17034 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17035 : volatile so that the compiler has to store it out to memory.
17036 if test X"$d_volatile" = X"$define"; then
17041 #$i_stdlib I_STDLIB
17043 #include <stdlib.h>
17045 #$i_string I_STRING
17047 # include <string.h>
17049 # include <strings.h>
17051 #include <sys/types.h>
17052 #include <signal.h>
17054 $volatile int bletched = 0;
17055 $signal_t blech(int s) { bletched = 1; }
17058 int checkit($nvtype d, char *where) {
17059 unsigned char *p = (char *)&d;
17060 unsigned char *end = p + sizeof(d);
17070 printf("No - %s: 0x", where);
17072 printf ("%02X", *p++);
17077 int main(int argc, char **argv) {
17080 fail += checkit(d, "0.0");
17082 /* The compiler shouldn't be assuming that bletched is 0 */
17085 fail += checkit(d, "bleched");
17088 signal(SIGFPE, blech);
17091 /* Paranoia - the compiler should have no way of knowing that ANSI says
17092 that argv[argc] will always be NULL. Actually, if it did assume this it
17093 would be buggy, as this is C and main() can be called from elsewhere in
17095 d = argv[argc] ? 1 : 0;
17098 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17101 fail += checkit(d, "ternary");
17103 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17106 printf("No - memset doesn't give 0.0\n");
17107 /* This might just blow up: */
17108 printf("(gives %g)\n", d);
17114 printf("No - something bleched\n");
17119 printf("No - %d fail(s)\n", fail);
17128 d_nv_zero_is_allbits_zero="$undef"
17129 if eval $compile; then
17135 0.0 is represented as all bits zero in memory
17137 d_nv_zero_is_allbits_zero="$define"
17140 0.0 is not represented as all bits zero in memory
17142 d_nv_zero_is_allbits_zero="$undef"
17147 0.0 is not represented as all bits zero in memory
17149 d_nv_zero_is_allbits_zero="$undef"
17155 : check for off64_t
17157 echo "Checking to see if you have off64_t..." >&4
17159 #include <sys/types.h>
17160 #include <unistd.h>
17161 int main() { off64_t x = 7; }
17164 if eval $compile; then
17166 echo "You have off64_t."
17169 echo "You do not have off64_t."
17170 case "$lseeksize" in
17171 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17178 : how to create joinable pthreads
17179 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17181 echo "Checking what constant to use for creating joinable pthreads..." >&4
17182 $cat >try.c <<'EOCP'
17183 #include <pthread.h>
17185 int detachstate = JOINABLE;
17188 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17189 if eval $compile; then
17190 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17191 val="$undef" # Yes, undef.
17192 set d_old_pthread_create_joinable
17195 set old_pthread_create_joinable
17198 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17199 if eval $compile; then
17200 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17202 set d_old_pthread_create_joinable
17204 val=PTHREAD_CREATE_UNDETACHED
17205 set old_pthread_create_joinable
17208 set try -DJOINABLE=__UNDETACHED
17209 if eval $compile; then
17210 echo "You seem to use __UNDETACHED." >&4
17212 set d_old_pthread_create_joinable
17215 set old_pthread_create_joinable
17218 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17220 set d_old_pthread_create_joinable
17223 set old_pthread_create_joinable
17230 d_old_pthread_create_joinable="$undef"
17231 old_pthread_create_joinable=""
17234 : see if pause exists
17238 : see if poll exists
17242 : see if prctl exists
17246 : see if prctl supports PR_SET_NAME
17247 d_prctl_set_name=$undef
17252 #include <unistd.h>
17254 #include <sys/prctl.h>
17256 int main (int argc, char *argv[])
17258 return (prctl (PR_SET_NAME, "Test"));
17262 if eval $compile_ok && $run ./try; then
17263 echo "Your prctl (PR_SET_NAME, ...) works"
17264 d_prctl_set_name=$define
17270 : see if readlink exists
17271 set readlink d_readlink
17274 : Check if there is a /proc symlink to the abs path of
17275 : the executing program. We will honor hints of d_procselfexe=$undef
17276 : or procselfexe being non-empty, otherwise will try to determine both
17277 : if we have readlink.
17278 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17279 : referenced, and AmigaOS does not have a proc filesystem anyway.
17282 if $test "X$d_procselfexe" = Xundef; then
17284 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17286 elif $test "X$d_readlink" = Xdefine; then
17287 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17288 : and it feels more tidy to avoid an extra level of symlink
17289 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17290 while test $# -gt 0; do
17293 if $issymlink $try; then
17294 $ls -l $try > reflect
17295 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17296 echo "You have $type-like $try."
17297 procselfexe='"'$try'"'
17299 : This will break out of the loop
17309 : backward compatibility for d_hvfork
17310 if test X$d_hvfork != X; then
17311 d_vfork="$d_hvfork"
17314 : see if there is a vfork
17319 d_pseudofork=$undef
17321 : Ok, but do we want to use it. vfork is reportedly unreliable in
17322 : perl on Solaris 2.x, and probably elsewhere.
17326 case "$usevfork" in
17332 Perl can only use a vfork() that doesn't suffer from strict
17333 restrictions on calling functions or modifying global data in
17334 the child. For example, glibc-2.1 contains such a vfork()
17335 that is unsuitable. If your system provides a proper fork()
17336 call, chances are that you do NOT want perl to use vfork().
17339 rp="Do you still want to use vfork()?"
17344 echo "Ok, we won't use vfork()."
17353 $define) usevfork='true';;
17354 *) usevfork='false';;
17357 : see whether the pthread_atfork exists
17359 #include <pthread.h>
17362 #ifdef PTHREAD_ATFORK
17363 pthread_atfork(NULL,NULL,NULL);
17368 : see if pthread_atfork exists
17369 set try -DPTHREAD_ATFORK
17370 if eval $compile; then
17375 case "$usethreads" in
17378 $define) echo 'pthread_atfork found.' >&4 ;;
17379 *) echo 'pthread_atfork NOT found.' >&4 ;;
17382 set d_pthread_atfork
17385 : see if pthread_attr_setscope exists
17386 set pthread_attr_setscope d_pthread_attr_setscope
17389 : see whether the various POSIXish _yields exist
17391 #include <pthread.h>
17397 #ifdef PTHREAD_YIELD
17400 #ifdef PTHREAD_YIELD_NULL
17401 pthread_yield(NULL);
17407 : see if sched_yield exists
17408 set try -DSCHED_YIELD
17409 if eval $compile; then
17411 sched_yield='sched_yield()'
17415 case "$usethreads" in
17418 $define) echo 'sched_yield() found.' >&4 ;;
17419 *) echo 'sched_yield() NOT found.' >&4 ;;
17425 : see if pthread_yield exists
17426 set try -DPTHREAD_YIELD
17427 if eval $compile; then
17429 case "$sched_yield" in
17430 '') sched_yield='pthread_yield()' ;;
17433 set try -DPTHREAD_YIELD_NULL
17434 if eval $compile; then
17436 case "$sched_yield" in
17437 '') sched_yield='pthread_yield(NULL)' ;;
17443 case "$usethreads" in
17446 $define) echo 'pthread_yield() found.' >&4 ;;
17447 *) echo 'pthread_yield() NOT found.' >&4 ;;
17451 set d_pthread_yield
17453 case "$sched_yield" in
17454 '') sched_yield=undef ;;
17458 : check for ptrdiff_t
17460 echo "Checking to see if you have ptrdiff_t..." >&4
17462 #include <stddef.h>
17463 int main() { ptrdiff_t x = 7; }
17466 if eval $compile; then
17468 echo "You have ptrdiff_t."
17471 echo "You do not have ptrdiff_t."
17477 : see if random_r exists
17478 set random_r d_random_r
17480 case "$d_random_r" in
17482 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17483 case "$d_random_r_proto:$usethreads" in
17484 ":define") d_random_r_proto=define
17485 set d_random_r_proto random_r $hdrs
17489 case "$d_random_r_proto" in
17491 case "$random_r_proto" in
17492 ''|0) try='int random_r(int*, struct random_data*);'
17493 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17495 case "$random_r_proto" in
17496 ''|0) try='int random_r(long*, struct random_data*);'
17497 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17499 case "$random_r_proto" in
17500 ''|0) try='int random_r(struct random_data*, int32_t*);'
17501 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17503 case "$random_r_proto" in
17504 ''|0) d_random_r=undef
17506 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17507 * ) case "$random_r_proto" in
17508 REENTRANT_PROTO*) ;;
17509 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17511 echo "Prototype: $try" ;;
17514 *) case "$usethreads" in
17515 define) echo "random_r has no prototype, not using it." >&4 ;;
17522 *) random_r_proto=0
17526 : see if readdir and friends exist
17527 set readdir d_readdir
17529 set seekdir d_seekdir
17531 set telldir d_telldir
17533 set rewinddir d_rewinddir
17536 : see if readdir64_r exists
17537 set readdir64_r d_readdir64_r
17539 case "$d_readdir64_r" in
17541 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17542 case "$d_readdir64_r_proto:$usethreads" in
17543 ":define") d_readdir64_r_proto=define
17544 set d_readdir64_r_proto readdir64_r $hdrs
17548 case "$d_readdir64_r_proto" in
17550 case "$readdir64_r_proto" in
17551 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17552 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17554 case "$readdir64_r_proto" in
17555 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17556 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17558 case "$readdir64_r_proto" in
17559 ''|0) d_readdir64_r=undef
17560 readdir64_r_proto=0
17561 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17562 * ) case "$readdir64_r_proto" in
17563 REENTRANT_PROTO*) ;;
17564 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17566 echo "Prototype: $try" ;;
17569 *) case "$usethreads" in
17570 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17572 d_readdir64_r=undef
17573 readdir64_r_proto=0
17577 *) readdir64_r_proto=0
17581 : see if readdir_r exists
17582 set readdir_r d_readdir_r
17584 case "$d_readdir_r" in
17586 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17587 case "$d_readdir_r_proto:$usethreads" in
17588 ":define") d_readdir_r_proto=define
17589 set d_readdir_r_proto readdir_r $hdrs
17593 case "$d_readdir_r_proto" in
17595 case "$readdir_r_proto" in
17596 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17597 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17599 case "$readdir_r_proto" in
17600 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17601 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17603 case "$readdir_r_proto" in
17604 ''|0) d_readdir_r=undef
17606 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17607 * ) case "$readdir_r_proto" in
17608 REENTRANT_PROTO*) ;;
17609 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17611 echo "Prototype: $try" ;;
17614 *) case "$usethreads" in
17615 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17622 *) readdir_r_proto=0
17626 : see if readv exists
17630 : see if recvmsg exists
17631 set recvmsg d_recvmsg
17634 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17636 if set regcomp val -f d_regcomp; eval $csym; $val; then
17637 echo 'regcomp() found.' >&4
17638 d_regcomp="$define"
17641 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17642 echo 'regcmp() found.' >&4
17646 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17647 echo 're_comp() found, assuming re_exec() also exists.' >&4
17648 d_re_comp="$define"
17653 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17660 : see if remainder exists
17661 set remainder d_remainder
17664 : see if remquo exists
17665 set remquo d_remquo
17668 : see if rename exists
17669 set rename d_rename
17672 : see if rint exists
17676 : see if rmdir exists
17680 : see if round exists
17684 : see if memory.h is available.
17689 : See if it conflicts with string.h
17695 $cppstdin $cppflags $cppminus < $strings > mem.h
17696 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17698 echo "We won't be including <memory.h>."
17708 : can bcopy handle overlapping blocks?
17711 case "$d_memmove" in
17712 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17713 *) case "$d_bcopy" in
17715 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17717 #$i_memory I_MEMORY
17718 #$i_stdlib I_STDLIB
17719 #$i_string I_STRING
17720 #$i_unistd I_UNISTD
17722 $cat >>try.c <<'EOCP'
17725 # include <memory.h>
17728 # include <stdlib.h>
17731 # include <string.h>
17733 # include <strings.h>
17736 # include <unistd.h> /* Needed for NetBSD */
17740 char buf[128], abc[128];
17746 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17747 try to store the string in read-only memory. */
17748 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17750 for (align = 7; align >= 0; align--) {
17751 for (len = 36; len; len--) {
17753 bcopy(abc, b, len);
17754 for (off = 1; off <= len; off++) {
17755 bcopy(b, b+off, len);
17756 bcopy(b+off, b, len);
17757 if (bcmp(b, abc, len))
17766 if eval $compile_ok; then
17767 if $run ./try 2>/dev/null; then
17768 echo "Yes, it can."
17771 echo "It can't, sorry."
17774 echo "(I can't compile the test program, so we'll assume not...)"
17784 : can memcpy handle overlapping blocks?
17787 case "$d_memmove" in
17788 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17789 *) case "$d_memcpy" in
17791 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17793 #$i_memory I_MEMORY
17794 #$i_stdlib I_STDLIB
17795 #$i_string I_STRING
17796 #$i_unistd I_UNISTD
17798 $cat >>try.c <<'EOCP'
17801 # include <memory.h>
17804 # include <stdlib.h>
17807 # include <string.h>
17809 # include <strings.h>
17812 # include <unistd.h> /* Needed for NetBSD */
17816 char buf[128], abc[128];
17822 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17823 try to store the string in read-only memory. */
17824 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17826 for (align = 7; align >= 0; align--) {
17827 for (len = 36; len; len--) {
17829 memcpy(b, abc, len);
17830 for (off = 1; off <= len; off++) {
17831 memcpy(b+off, b, len);
17832 memcpy(b, b+off, len);
17833 if (memcmp(b, abc, len))
17842 if eval $compile_ok; then
17843 if $run ./try 2>/dev/null; then
17844 echo "Yes, it can."
17847 echo "It can't, sorry."
17850 echo "(I can't compile the test program, so we'll assume not...)"
17860 : can memcmp be trusted to compare relative magnitude?
17862 case "$d_memcmp" in
17865 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17867 #$i_memory I_MEMORY
17868 #$i_stdlib I_STDLIB
17869 #$i_string I_STRING
17870 #$i_unistd I_UNISTD
17872 $cat >>try.c <<'EOCP'
17875 # include <memory.h>
17878 # include <stdlib.h>
17881 # include <string.h>
17883 # include <strings.h>
17886 # include <unistd.h> /* Needed for NetBSD */
17892 if ((a < b) && memcmp(&a, &b, 1) < 0)
17898 if eval $compile_ok; then
17899 if $run ./try 2>/dev/null; then
17900 echo "Yes, it can."
17903 echo "No, it can't (it uses signed chars)."
17906 echo "(I can't compile the test program, so we'll assume not...)"
17914 : see if prototype for sbrk is available
17916 set d_sbrkproto sbrk $i_unistd unistd.h
17919 : see if scalbn exists
17920 set scalbn d_scalbn
17923 : see if select exists
17924 set select d_select
17927 : see if semctl exists
17928 set semctl d_semctl
17931 : see if semget exists
17932 set semget d_semget
17935 : see if semop exists
17939 : see how much of the 'sem*(2)' library is present.
17942 case "$d_semctl$d_semget$d_semop" in
17943 *"$undef"*) h_sem=false;;
17947 case "`ipcs 2>&1`" in
17948 "SVID messages"*"not configured"*)
17949 echo "Your $osname does not have the sem*(2) configured." >&4
17952 set semctl d_semctl
17954 set semget d_semget
17962 : we could also check for sys/ipc.h ...
17963 if $h_sem && $test `./findhdr sys/sem.h`; then
17964 echo "You have the full sem*(2) library." >&4
17967 echo "You don't have the full sem*(2) library." >&4
17973 : see whether sys/sem.h defines union semun
17975 $cat > try.c <<'END'
17976 #include <sys/types.h>
17977 #include <sys/ipc.h>
17978 #include <sys/sem.h>
17979 int main () { union semun semun; semun.buf = 0; }
17982 if eval $compile; then
17983 echo "You have union semun in <sys/sem.h>." >&4
17986 echo "You do not have union semun in <sys/sem.h>." >&4
17993 : see how to do semctl IPC_STAT
17997 $cat > tryh.h <<END
18000 # define S_IRUSR S_IREAD
18001 # define S_IWUSR S_IWRITE
18002 # define S_IXUSR S_IEXEC
18004 # define S_IRUSR 0400
18005 # define S_IWUSR 0200
18006 # define S_IXUSR 0100
18008 # define S_IRGRP (S_IRUSR>>3)
18009 # define S_IWGRP (S_IWUSR>>3)
18010 # define S_IXGRP (S_IXUSR>>3)
18011 # define S_IROTH (S_IRUSR>>6)
18012 # define S_IWOTH (S_IWUSR>>6)
18013 # define S_IXOTH (S_IXUSR>>6)
18016 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18017 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18018 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18021 : see whether semctl IPC_STAT can use union semun
18022 case "$d_semctl_semun" in
18026 #include <sys/types.h>
18027 #include <sys/ipc.h>
18028 #include <sys/sem.h>
18029 #include <sys/stat.h>
18036 #$d_union_semun HAS_UNION_SEMUN
18039 #ifndef HAS_UNION_SEMUN
18042 struct semid_ds *buf;
18043 unsigned short *array;
18049 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18050 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18052 struct semid_ds argbuf;
18055 st = semctl(sem, 0, IPC_STAT, arg);
18059 # endif /* IPC_STAT */
18060 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18062 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18063 # endif /* IPC_RMID */
18064 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18066 #endif /* IPC_PRIVATE && ... */
18067 printf("semget failed: errno = %d\n", errno);
18072 if eval $compile; then
18075 semun) val="$define" ;;
18083 case "$d_semctl_semun" in
18085 echo "You can use union semun for semctl IPC_STAT." >&4
18088 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18093 : see whether semctl IPC_STAT can use struct semid_ds pointer
18094 case "$d_semctl_semid_ds" in
18097 $cat > try.c <<'END'
18098 #include <sys/types.h>
18099 #include <sys/ipc.h>
18100 #include <sys/sem.h>
18101 #include <sys/stat.h>
18109 struct semid_ds arg;
18112 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18113 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18116 st = semctl(sem, 0, IPC_STAT, &arg);
18118 printf("semid_ds\n");
18120 # endif /* IPC_STAT */
18121 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18123 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18124 # endif /* IPC_RMID */
18125 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18127 #endif /* IPC_PRIVATE && ... */
18128 printf("semget failed: errno = %d\n", errno);
18134 if eval $compile; then
18137 semid_ds) val="$define" ;;
18141 set d_semctl_semid_ds
18145 case "$d_semctl_semid_ds" in
18147 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18149 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18155 # We do not have the full sem*(2) library, so assume we can not
18161 set d_semctl_semid_ds
18167 : see if sendmsg exists
18168 set sendmsg d_sendmsg
18171 : see if setegid exists
18172 set setegid d_setegid
18175 : see if seteuid exists
18176 set seteuid d_seteuid
18179 : see if setgrent exists
18180 set setgrent d_setgrent
18183 : see if setgrent_r exists
18184 set setgrent_r d_setgrent_r
18186 case "$d_setgrent_r" in
18188 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18189 case "$d_setgrent_r_proto:$usethreads" in
18190 ":define") d_setgrent_r_proto=define
18191 set d_setgrent_r_proto setgrent_r $hdrs
18195 case "$d_setgrent_r_proto" in
18197 case "$setgrent_r_proto" in
18198 ''|0) try='int setgrent_r(FILE**);'
18199 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18201 case "$setgrent_r_proto" in
18202 ''|0) try='void setgrent_r(FILE**);'
18203 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18205 case "$setgrent_r_proto" in
18206 ''|0) d_setgrent_r=undef
18208 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18209 * ) case "$setgrent_r_proto" in
18210 REENTRANT_PROTO*) ;;
18211 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18213 echo "Prototype: $try" ;;
18216 *) case "$usethreads" in
18217 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18224 *) setgrent_r_proto=0
18228 : see if sethostent exists
18229 set sethostent d_sethent
18232 : see if sethostent_r exists
18233 set sethostent_r d_sethostent_r
18235 case "$d_sethostent_r" in
18237 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18238 case "$d_sethostent_r_proto:$usethreads" in
18239 ":define") d_sethostent_r_proto=define
18240 set d_sethostent_r_proto sethostent_r $hdrs
18244 case "$d_sethostent_r_proto" in
18246 case "$sethostent_r_proto" in
18247 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18248 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18250 case "$sethostent_r_proto" in
18251 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18252 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18254 case "$sethostent_r_proto" in
18255 ''|0) d_sethostent_r=undef
18256 sethostent_r_proto=0
18257 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18258 * ) case "$sethostent_r_proto" in
18259 REENTRANT_PROTO*) ;;
18260 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18262 echo "Prototype: $try" ;;
18265 *) case "$usethreads" in
18266 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18268 d_sethostent_r=undef
18269 sethostent_r_proto=0
18273 *) sethostent_r_proto=0
18277 : see if setitimer exists
18278 set setitimer d_setitimer
18281 : see if setlinebuf exists
18282 set setlinebuf d_setlinebuf
18285 : see if setlocale exists
18286 set setlocale d_setlocale
18289 : see if locale.h is available
18290 set locale.h i_locale
18293 : see if setlocale_r exists
18294 set setlocale_r d_setlocale_r
18296 case "$d_setlocale_r" in
18298 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18299 case "$d_setlocale_r_proto:$usethreads" in
18300 ":define") d_setlocale_r_proto=define
18301 set d_setlocale_r_proto setlocale_r $hdrs
18305 case "$d_setlocale_r_proto" in
18307 case "$setlocale_r_proto" in
18308 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18309 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18311 case "$setlocale_r_proto" in
18312 ''|0) d_setlocale_r=undef
18313 setlocale_r_proto=0
18314 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18315 * ) case "$setlocale_r_proto" in
18316 REENTRANT_PROTO*) ;;
18317 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18319 echo "Prototype: $try" ;;
18322 *) case "$usethreads" in
18323 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18325 d_setlocale_r=undef
18326 setlocale_r_proto=0
18330 *) setlocale_r_proto=0
18334 : see if setnetent exists
18335 set setnetent d_setnent
18338 : see if setnetent_r exists
18339 set setnetent_r d_setnetent_r
18341 case "$d_setnetent_r" in
18343 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18344 case "$d_setnetent_r_proto:$usethreads" in
18345 ":define") d_setnetent_r_proto=define
18346 set d_setnetent_r_proto setnetent_r $hdrs
18350 case "$d_setnetent_r_proto" in
18352 case "$setnetent_r_proto" in
18353 ''|0) try='int setnetent_r(int, struct netent_data*);'
18354 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18356 case "$setnetent_r_proto" in
18357 ''|0) try='void setnetent_r(int, struct netent_data*);'
18358 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18360 case "$setnetent_r_proto" in
18361 ''|0) d_setnetent_r=undef
18362 setnetent_r_proto=0
18363 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18364 * ) case "$setnetent_r_proto" in
18365 REENTRANT_PROTO*) ;;
18366 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18368 echo "Prototype: $try" ;;
18371 *) case "$usethreads" in
18372 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18374 d_setnetent_r=undef
18375 setnetent_r_proto=0
18379 *) setnetent_r_proto=0
18383 : see if setprotoent exists
18384 set setprotoent d_setpent
18387 : see if setpgid exists
18388 set setpgid d_setpgid
18391 : see if setpgrp2 exists
18392 set setpgrp2 d_setpgrp2
18395 : see if setpriority exists
18396 set setpriority d_setprior
18399 : see if setproctitle exists
18400 set setproctitle d_setproctitle
18403 : see if setprotoent_r exists
18404 set setprotoent_r d_setprotoent_r
18406 case "$d_setprotoent_r" in
18408 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18409 case "$d_setprotoent_r_proto:$usethreads" in
18410 ":define") d_setprotoent_r_proto=define
18411 set d_setprotoent_r_proto setprotoent_r $hdrs
18415 case "$d_setprotoent_r_proto" in
18417 case "$setprotoent_r_proto" in
18418 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18419 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18421 case "$setprotoent_r_proto" in
18422 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18423 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18425 case "$setprotoent_r_proto" in
18426 ''|0) d_setprotoent_r=undef
18427 setprotoent_r_proto=0
18428 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18429 * ) case "$setprotoent_r_proto" in
18430 REENTRANT_PROTO*) ;;
18431 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18433 echo "Prototype: $try" ;;
18436 *) case "$usethreads" in
18437 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18439 d_setprotoent_r=undef
18440 setprotoent_r_proto=0
18444 *) setprotoent_r_proto=0
18448 : see if setpwent exists
18449 set setpwent d_setpwent
18452 : see if setpwent_r exists
18453 set setpwent_r d_setpwent_r
18455 case "$d_setpwent_r" in
18457 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18458 case "$d_setpwent_r_proto:$usethreads" in
18459 ":define") d_setpwent_r_proto=define
18460 set d_setpwent_r_proto setpwent_r $hdrs
18464 case "$d_setpwent_r_proto" in
18466 case "$setpwent_r_proto" in
18467 ''|0) try='int setpwent_r(FILE**);'
18468 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18470 case "$setpwent_r_proto" in
18471 ''|0) try='void setpwent_r(FILE**);'
18472 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18474 case "$setpwent_r_proto" in
18475 ''|0) d_setpwent_r=undef
18477 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18478 * ) case "$setpwent_r_proto" in
18479 REENTRANT_PROTO*) ;;
18480 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18482 echo "Prototype: $try" ;;
18485 *) case "$usethreads" in
18486 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18493 *) setpwent_r_proto=0
18497 : see if setregid exists
18498 set setregid d_setregid
18500 set setresgid d_setresgid
18503 : see if setreuid exists
18504 set setreuid d_setreuid
18506 set setresuid d_setresuid
18509 : see if setrgid exists
18510 set setrgid d_setrgid
18513 : see if setruid exists
18514 set setruid d_setruid
18517 : see if setservent exists
18518 set setservent d_setsent
18521 : see if setservent_r exists
18522 set setservent_r d_setservent_r
18524 case "$d_setservent_r" in
18526 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18527 case "$d_setservent_r_proto:$usethreads" in
18528 ":define") d_setservent_r_proto=define
18529 set d_setservent_r_proto setservent_r $hdrs
18533 case "$d_setservent_r_proto" in
18535 case "$setservent_r_proto" in
18536 ''|0) try='int setservent_r(int, struct servent_data*);'
18537 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18539 case "$setservent_r_proto" in
18540 ''|0) try='void setservent_r(int, struct servent_data*);'
18541 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18543 case "$setservent_r_proto" in
18544 ''|0) d_setservent_r=undef
18545 setservent_r_proto=0
18546 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18547 * ) case "$setservent_r_proto" in
18548 REENTRANT_PROTO*) ;;
18549 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18551 echo "Prototype: $try" ;;
18554 *) case "$usethreads" in
18555 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18557 d_setservent_r=undef
18558 setservent_r_proto=0
18562 *) setservent_r_proto=0
18566 : see if setsid exists
18567 set setsid d_setsid
18570 : see if setvbuf exists
18571 set setvbuf d_setvbuf
18574 : see if shmctl exists
18575 set shmctl d_shmctl
18578 : see if shmget exists
18579 set shmget d_shmget
18582 : see if shmat exists
18585 : see what shmat returns
18588 $cat >shmat.c <<'END'
18589 #include <sys/shm.h>
18592 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18597 echo "and it returns ($shmattype)." >&4
18598 : see if a prototype for shmat is available
18599 xxx=`./findhdr sys/shm.h`
18600 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18601 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18612 set d_shmatprototype
18615 : see if shmdt exists
18619 : see how much of the 'shm*(2)' library is present.
18622 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18623 *"$undef"*) h_shm=false;;
18627 case "`ipcs 2>&1`" in
18628 "SVID shared memory"*"not configured"*)
18629 echo "Your $osname does not have the shm*(2) configured." >&4
18632 set shmctl d_shmctl
18634 set shmget d_shmget
18644 : we could also check for sys/ipc.h ...
18645 if $h_shm && $test `./findhdr sys/shm.h`; then
18646 echo "You have the full shm*(2) library." >&4
18649 echo "You don't have the full shm*(2) library." >&4
18655 : see if we have sigaction
18657 if set sigaction val -f d_sigaction; eval $csym; $val; then
18658 echo 'sigaction() found.' >&4
18661 #include <sys/types.h>
18662 #include <signal.h>
18663 #$i_stdlib I_STDLIB
18665 #include <stdlib.h>
18669 struct sigaction act, oact;
18671 oact.sa_handler = 0;
18672 /* so that act and oact are used */
18673 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18677 if eval $compile_ok; then
18680 echo "But you don't seem to have a usable struct sigaction." >&4
18684 echo 'sigaction NOT found.' >&4
18687 set d_sigaction; eval $setvar
18690 : see what type pids are declared as in the kernel
18691 rp="What is the type of process ids on this system?"
18692 set pid_t pidtype int stdio.h sys/types.h
18695 : see what type uids are declared as in the kernel
18697 echo "Looking for the type for user ids returned by getuid()."
18698 set uid_t uidtype xxx stdio.h sys/types.h
18702 xxx=`./findhdr sys/user.h`
18703 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18705 unsigned) dflt="$1 $2" ;;
18709 *) dflt="$uidtype";;
18712 uid_t) echo "uid_t found." ;;
18713 *) rp="What is the type for user ids returned by getuid()?"
18719 : Define hasfield_t macro for Configure internal use
18720 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18721 while $test $# -ge 2; do
18723 $define) echo "#include <$2>";;
18727 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18729 if eval $compile; then
18738 : see what siginfo fields we have
18739 case "$d_sigaction" in
18741 echo "Checking if your siginfo_t has si_errno field...">&4
18742 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18745 echo "Checking if your siginfo_t has si_pid field...">&4
18746 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18749 echo "Checking if your siginfo_t has si_uid field...">&4
18750 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18753 echo "Checking if your siginfo_t has si_addr field...">&4
18754 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18757 echo "Checking if your siginfo_t has si_status field...">&4
18758 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18761 echo "Checking if your siginfo_t has si_band field...">&4
18762 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18765 echo "Checking if your siginfo_t has si_value field...">&4
18766 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18769 echo "Checking if your siginfo_t has si_fd field...">&4
18770 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18775 d_siginfo_si_errno="$undef"
18776 d_siginfo_si_pid="$undef"
18777 d_siginfo_si_uid="$undef"
18778 d_siginfo_si_addr="$undef"
18779 d_siginfo_si_status="$undef"
18780 d_siginfo_si_band="$undef"
18781 d_siginfo_si_value="$undef"
18782 d_siginfo_si_fd="$undef"
18786 : see if this is a sunmath.h system
18787 set sunmath.h i_sunmath
18790 : see if signbit exists
18791 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18794 #$i_sunmath I_SUNMATH
18798 #ifdef I_SUNMATH /* Solaris special math library */
18799 # include <sunmath.h>
18802 int main(int argc, char **argv)
18806 if ((signbit(x) == 0) && (signbit(y) != 0))
18814 if eval $compile; then
18815 if $run ./try; then
18819 $echo "Signbit seems to be available, but doesn't work as I expected."
18820 $echo "I won't use it." >&4
18831 : see if sigprocmask exists
18832 set sigprocmask d_sigprocmask
18835 : see if sigsetjmp exists
18837 case "$d_sigsetjmp" in
18840 #include <setjmp.h>
18841 #$i_stdlib I_STDLIB
18843 #include <stdlib.h>
18849 if (sigsetjmp(env,1))
18852 siglongjmp(env, 1);
18857 if eval $compile; then
18858 if $run ./try >/dev/null 2>&1; then
18859 echo "POSIX sigsetjmp found." >&4
18863 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18869 echo "sigsetjmp not found." >&4
18873 *) val="$d_sigsetjmp"
18874 case "$d_sigsetjmp" in
18875 $define) echo "POSIX sigsetjmp found." >&4;;
18876 $undef) echo "sigsetjmp not found." >&4;;
18884 : see if snprintf exists
18885 set snprintf d_snprintf
18888 : see if vsnprintf exists
18889 set vsnprintf d_vsnprintf
18892 case "$d_snprintf-$d_vsnprintf" in
18895 Checking whether your snprintf() and vsnprintf() work okay...
18897 $cat >try.c <<'EOCP'
18898 /* v?snprintf testing logic courtesy of Russ Allbery.
18899 * According to C99:
18900 * - if the buffer is too short it still must be \0-terminated
18901 * - if the buffer is too short the potentially required length
18902 * must be returned and not -1
18903 * - if the buffer is NULL the potentially required length
18904 * must be returned and not -1 or core dump
18907 #include <stdarg.h>
18911 int test (char *format, ...)
18916 va_start (args, format);
18917 count = vsnprintf (buf, sizeof buf, format, args);
18924 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18925 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18929 if eval $compile; then
18932 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18934 Your snprintf() and snprintf() don't seem to be working okay.
18936 d_snprintf="$undef"
18937 d_vsnprintf="$undef"
18941 echo "(I can't seem to compile the test program--assuming they don't)"
18942 d_snprintf="$undef"
18943 d_vsnprintf="$undef"
18949 : see if sockatmark exists
18950 set sockatmark d_sockatmark
18953 : see if prototype for sockatmark is available
18955 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18958 : see if socks5_init exists
18959 set socks5_init d_socks5_init
18962 : see if sprintf returns the length of the string in the buffer as per ANSI
18963 $echo "Checking whether sprintf returns the length of the string..." >&4
18966 #$i_stdlib I_STDLIB
18968 #include <stdlib.h>
18970 #$i_string I_STRING
18972 # include <string.h>
18974 # include <strings.h>
18983 int check (size_t expect, int test) {
18984 size_t got = strlen(buffer);
18988 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18993 int main(int argc, char **argv) {
18996 check(sprintf(buffer, ""), ++test);
18997 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18998 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
19005 if eval $compile; then
19009 sprintf returns the length of the string (as ANSI says it should)
19011 d_sprintf_returns_strlen="$define"
19014 sprintf does not return the length of the string (how old is this system?)
19016 d_sprintf_returns_strlen="$undef"
19020 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
19021 d_sprintf_returns_strlen="$undef"
19025 : see if srand48_r exists
19026 set srand48_r d_srand48_r
19028 case "$d_srand48_r" in
19030 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19031 case "$d_srand48_r_proto:$usethreads" in
19032 ":define") d_srand48_r_proto=define
19033 set d_srand48_r_proto srand48_r $hdrs
19037 case "$d_srand48_r_proto" in
19039 case "$srand48_r_proto" in
19040 ''|0) try='int srand48_r(long, struct drand48_data*);'
19041 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
19043 case "$srand48_r_proto" in
19044 ''|0) d_srand48_r=undef
19046 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
19047 * ) case "$srand48_r_proto" in
19048 REENTRANT_PROTO*) ;;
19049 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
19051 echo "Prototype: $try" ;;
19054 *) case "$usethreads" in
19055 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19062 *) srand48_r_proto=0
19066 : see if srandom_r exists
19067 set srandom_r d_srandom_r
19069 case "$d_srandom_r" in
19071 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19072 case "$d_srandom_r_proto:$usethreads" in
19073 ":define") d_srandom_r_proto=define
19074 set d_srandom_r_proto srandom_r $hdrs
19078 case "$d_srandom_r_proto" in
19080 case "$srandom_r_proto" in
19081 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19082 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19084 case "$srandom_r_proto" in
19085 ''|0) d_srandom_r=undef
19087 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19088 * ) case "$srandom_r_proto" in
19089 REENTRANT_PROTO*) ;;
19090 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19092 echo "Prototype: $try" ;;
19095 *) case "$usethreads" in
19096 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19103 *) srandom_r_proto=0
19107 : see if prototype for setresgid is available
19109 set d_sresgproto setresgid $i_unistd unistd.h
19112 : see if prototype for setresuid is available
19114 set d_sresuproto setresuid $i_unistd unistd.h
19117 : see if stat exists
19121 : see if sys/stat.h is available
19122 set sys/stat.h i_sysstat
19125 : see if stat knows about block sizes
19127 echo "Checking to see if your struct stat has st_blocks field..." >&4
19128 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19131 : see if this is a sys/vfs.h system
19132 set sys/vfs.h i_sysvfs
19135 : see if this is a sys/statfs.h system
19136 set sys/statfs.h i_sysstatfs
19139 : Check for statfs_s
19141 echo "Checking to see if your system supports struct statfs..." >&4
19142 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
19144 case "$d_statfs_s" in
19145 "$define") echo "Yes, it does." ;;
19146 *) echo "No, it doesn't." ;;
19150 : see if struct statfs knows about f_flags
19151 case "$d_statfs_s" in
19154 echo "Checking to see if your struct statfs has f_flags field..." >&4
19155 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
19159 set d_statfs_f_flags
19163 case "$d_statfs_f_flags" in
19164 "$define") echo "Yes, it does." ;;
19165 *) echo "No, it doesn't." ;;
19168 : see what flavor, if any, of static inline is supported
19170 echo "Checking to see if your system supports static inline..."
19171 $cat > try.c <<'EOCP'
19172 #include <stdlib.h>
19173 extern int f_via_a(int x);
19174 extern int f_via_b(int x);
19175 int main(int argc, char **argv)
19184 return EXIT_SUCCESS;
19187 return EXIT_FAILURE;
19191 $cat > a.c <<'EOCP'
19192 static INLINE int f(int x) {
19203 $cat > b.c <<'EOCP'
19204 extern int f(int x);
19212 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19213 case "$perl_static_inline" in
19214 '') # Check the various possibilities, and break out on success.
19215 # For gcc, prefer __inline__, which will still permit
19216 # cflags.SH to add in -ansi.
19217 case "$gccversion" in
19218 '') xxx="inline __inline__ __inline _inline";;
19219 *) xxx="__inline__ inline __inline _inline";;
19221 for inline in $xxx; do
19222 set try -DINLINE=$inline a.c
19223 if eval $compile && $run ./try; then
19224 # Now make sure there is no external linkage of static
19226 set try -DINLINE=$inline -DUSE_B a.c b.c
19227 if eval $compile && $run ./try; then
19228 $echo "Your compiler supports static $inline, " >&4
19229 $echo "but it also creates an external definition," >&4
19230 $echo "so I won't use it." >&4
19233 $echo "Your compiler supports static $inline." >&4
19235 perl_static_inline="static $inline";
19239 $echo "Your compiler does NOT support static $inline." >&4
19244 *inline*) # Some variant of inline exists.
19245 echo "Keeping your $hint value of $perl_static_inline."
19248 static) # No inline capabilities
19249 echo "Keeping your $hint value of $perl_static_inline."
19252 *) # Unrecognized previous value -- blindly trust the supplied
19253 # value and hope it makes sense. Use old value for
19254 # d_static_inline, if there is one.
19255 echo "Keeping your $hint value of $perl_static_inline."
19256 case "$d_static_inline" in
19258 *) val=$d_static_inline ;;
19262 # Fallback to plain 'static' if nothing worked.
19263 case "$perl_static_inline" in
19265 perl_static_inline="static"
19269 set d_static_inline
19271 $rm -f a.[co] b.[co]
19274 : Check stream access
19276 Checking how to access stdio streams by file descriptor number...
19278 case "$stdio_stream_array" in
19279 '') $cat >try.c <<EOCP
19282 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19286 for s in _iob __iob __sF
19288 set try -DSTDIO_STREAM_ARRAY=$s
19289 if eval $compile; then
19290 case "`$run ./try`" in
19291 yes) stdio_stream_array=$s; break ;;
19297 case "$stdio_stream_array" in
19299 I can't figure out how to access stdio streams by file descriptor number.
19301 d_stdio_stream_array="$undef"
19304 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19306 d_stdio_stream_array="$define"
19310 : see if strcoll exists
19311 set strcoll d_strcoll
19314 : check for structure copying
19316 echo "Checking to see if your C compiler can copy structs..." >&4
19317 $cat >try.c <<'EOCP'
19327 if $cc -c try.c >/dev/null 2>&1 ; then
19329 echo "Yup, it can."
19332 echo "Nope, it can't."
19338 : see if strerror and/or sys_errlist[] exist
19340 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19341 if set strerror val -f d_strerror; eval $csym; $val; then
19342 echo 'strerror() found.' >&4
19343 d_strerror="$define"
19344 d_strerrm='strerror(e)'
19345 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19346 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19347 d_syserrlst="$define"
19349 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19350 d_syserrlst="$undef"
19352 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19353 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19354 echo 'strerror() found in string header.' >&4
19355 d_strerror="$define"
19356 d_strerrm='strerror(e)'
19357 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19358 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19359 d_syserrlst="$define"
19361 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19362 d_syserrlst="$undef"
19364 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19365 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19366 d_strerror="$undef"
19367 d_syserrlst="$define"
19368 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19370 echo 'strerror() and sys_errlist[] NOT found.' >&4
19371 d_strerror="$undef"
19372 d_syserrlst="$undef"
19373 d_strerrm='"unknown"'
19377 : see if strerror_l exists
19378 set strerror_l d_strerror_l
19381 : see if strerror_r exists
19382 set strerror_r d_strerror_r
19384 case "$d_strerror_r" in
19386 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19387 case "$d_strerror_r_proto:$usethreads" in
19388 ":define") d_strerror_r_proto=define
19389 set d_strerror_r_proto strerror_r $hdrs
19393 case "$d_strerror_r_proto" in
19395 case "$strerror_r_proto" in
19396 ''|0) try='int strerror_r(int, char*, size_t);'
19397 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19399 case "$strerror_r_proto" in
19400 ''|0) try='int strerror_r(int, char*, int);'
19401 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19403 case "$strerror_r_proto" in
19404 ''|0) try='char* strerror_r(int, char*, size_t);'
19405 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19407 case "$strerror_r_proto" in
19408 ''|0) d_strerror_r=undef
19410 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19411 * ) case "$strerror_r_proto" in
19412 REENTRANT_PROTO*) ;;
19413 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19415 echo "Prototype: $try" ;;
19418 *) case "$usethreads" in
19419 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19426 *) strerror_r_proto=0
19430 : see if strftime exists
19431 set strftime d_strftime
19434 : see if strlcat exists
19435 set strlcat d_strlcat
19438 : see if strlcpy exists
19439 set strlcpy d_strlcpy
19442 : see if strtod exists
19443 set strtod d_strtod
19446 : see if strtol exists
19447 set strtol d_strtol
19450 : see if strtold exists
19451 set strtold d_strtold
19454 : see if strtoll exists
19455 set strtoll d_strtoll
19458 case "$d_longlong-$d_strtoll" in
19461 Checking whether your strtoll() works okay...
19463 $cat >try.c <<'EOCP'
19466 #define strtoll __strtoll
19469 #define strtoll _strtoll
19472 extern long long int strtoll(char *s, char **, int);
19473 static int bad = 0;
19474 int check(char *s, long long ell, int een) {
19477 gll = strtoll(s, 0, 10);
19478 if (!((gll == ell) && (errno == een)))
19482 check(" 1", 1LL, 0);
19483 check(" 0", 0LL, 0);
19484 check("-1", -1LL, 0);
19485 check("-9223372036854775808", -9223372036854775808LL, 0);
19486 check("-9223372036854775808", -9223372036854775808LL, 0);
19487 check(" 9223372036854775807", 9223372036854775807LL, 0);
19488 check("-9223372036854775808", -9223372036854775808LL, 0);
19489 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19490 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19496 if eval $compile; then
19499 ok) echo "Your strtoll() seems to be working okay." ;;
19501 Your strtoll() doesn't seem to be working okay.
19507 echo "(I can't seem to compile the test program--assuming it doesn't)"
19513 : see if strtoq exists
19514 set strtoq d_strtoq
19517 : see if strtoul exists
19518 set strtoul d_strtoul
19521 case "$d_strtoul" in
19524 Checking whether your strtoul() works okay...
19526 $cat >try.c <<'EOCP'
19529 extern unsigned long int strtoul(char *s, char **, int);
19530 static int bad = 0;
19531 void check(char *s, unsigned long eul, int een) {
19534 gul = strtoul(s, 0, 10);
19535 if (!((gul == eul) && (errno == een)))
19539 check(" 1", 1L, 0);
19540 check(" 0", 0L, 0);
19542 case "$longsize" in
19544 $cat >>try.c <<'EOCP'
19545 check("18446744073709551615", 18446744073709551615UL, 0);
19546 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19547 #if 0 /* strtoul() for /^-/ strings is undefined. */
19548 check("-1", 18446744073709551615UL, 0);
19549 check("-18446744073709551614", 2, 0);
19550 check("-18446744073709551615", 1, 0);
19551 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19552 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19557 $cat >>try.c <<'EOCP'
19558 check("4294967295", 4294967295UL, 0);
19559 check("4294967296", 4294967295UL, ERANGE);
19560 #if 0 /* strtoul() for /^-/ strings is undefined. */
19561 check("-1", 4294967295UL, 0);
19562 check("-4294967294", 2, 0);
19563 check("-4294967295", 1, 0);
19564 check("-4294967296", 4294967295UL, ERANGE);
19565 check("-4294967297", 4294967295UL, ERANGE);
19570 : Should we write these tests to be more portable by sprintf-ing
19571 : ~0 and then manipulating that char string as input for strtol?
19574 $cat >>try.c <<'EOCP'
19581 if eval $compile; then
19582 case "`$run ./try`" in
19583 ok) echo "Your strtoul() seems to be working okay." ;;
19585 Your strtoul() doesn't seem to be working okay.
19591 echo "(I can't seem to compile the test program--assuming it doesn't)"
19597 : see if strtoull exists
19598 set strtoull d_strtoull
19601 case "$d_longlong-$d_strtoull" in
19604 Checking whether your strtoull() works okay...
19606 $cat >try.c <<'EOCP'
19609 #define strtoull __strtoull
19612 extern unsigned long long int strtoull(char *s, char **, int);
19613 static int bad = 0;
19614 int check(char *s, long long eull, int een) {
19617 gull = strtoull(s, 0, 10);
19618 if (!((gull == eull) && (errno == een)))
19622 check(" 1", 1LL, 0);
19623 check(" 0", 0LL, 0);
19624 check("18446744073709551615", 18446744073709551615ULL, 0);
19625 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19626 #if 0 /* strtoull() for /^-/ strings is undefined. */
19627 check("-1", 18446744073709551615ULL, 0);
19628 check("-18446744073709551614", 2LL, 0);
19629 check("-18446744073709551615", 1LL, 0);
19630 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19631 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19638 if eval $compile; then
19639 case "`$run ./try`" in
19640 ok) echo "Your strtoull() seems to be working okay." ;;
19642 Your strtoull() doesn't seem to be working okay.
19644 d_strtoull="$undef"
19648 echo "(I can't seem to compile the test program--assuming it doesn't)"
19649 d_strtoull="$undef"
19654 : see if strtouq exists
19655 set strtouq d_strtouq
19658 case "$d_strtouq" in
19661 Checking whether your strtouq() works okay...
19663 $cat >try.c <<'EOCP'
19666 extern unsigned long long int strtouq(char *s, char **, int);
19667 static int bad = 0;
19668 void check(char *s, unsigned long long eull, int een) {
19669 unsigned long long gull;
19671 gull = strtouq(s, 0, 10);
19672 if (!((gull == eull) && (errno == een)))
19676 check(" 1", 1LL, 0);
19677 check(" 0", 0LL, 0);
19678 check("18446744073709551615", 18446744073709551615ULL, 0);
19679 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19680 #if 0 /* strtouq() for /^-/ strings is undefined. */
19681 check("-1", 18446744073709551615ULL, 0);
19682 check("-18446744073709551614", 2LL, 0);
19683 check("-18446744073709551615", 1LL, 0);
19684 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19685 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19693 if eval $compile; then
19694 case "`$run ./try`" in
19695 ok) echo "Your strtouq() seems to be working okay." ;;
19697 Your strtouq() doesn't seem to be working okay.
19703 echo "(I can't seem to compile the test program--assuming it doesn't)"
19709 : see if strxfrm exists
19710 set strxfrm d_strxfrm
19713 : see if symlink exists
19714 set symlink d_symlink
19717 : see if syscall exists
19718 set syscall d_syscall
19721 : see if prototype for syscall is available
19723 set d_syscallproto syscall $i_unistd unistd.h
19726 : see if sysconf exists
19727 set sysconf d_sysconf
19730 : see if system exists
19731 set system d_system
19734 : see if tcgetpgrp exists
19735 set tcgetpgrp d_tcgetpgrp
19738 : see if tcsetpgrp exists
19739 set tcsetpgrp d_tcsetpgrp
19742 : see if prototype for telldir is available
19744 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19747 : see if tgamma exists
19748 set tgamma d_tgamma
19751 : see if time exists
19753 if test "X$d_time" = X -o X"$timetype" = X; then
19754 if set time val -f d_time; eval $csym; $val; then
19755 echo 'time() found.' >&4
19757 rp="What is the type returned by time() on this system?"
19758 set time_t timetype long stdio.h sys/types.h
19761 echo 'time() not found, hope that will do.' >&4
19769 : see if timegm exists
19770 set timegm d_timegm
19773 : see if this is a sys/times.h system
19774 set sys/times.h i_systimes
19777 : see if times exists
19779 if set times val -f d_times; eval $csym; $val; then
19780 echo 'times() found.' >&4
19783 case "$i_systimes" in
19784 "$define") inc='sys/times.h';;
19786 rp="What is the type returned by times() on this system?"
19787 set clock_t clocktype long stdio.h sys/types.h $inc
19790 echo 'times() NOT found, hope that will do.' >&4
19795 : see if tmpnam_r exists
19796 set tmpnam_r d_tmpnam_r
19798 case "$d_tmpnam_r" in
19800 hdrs="$i_systypes sys/types.h define stdio.h "
19801 case "$d_tmpnam_r_proto:$usethreads" in
19802 ":define") d_tmpnam_r_proto=define
19803 set d_tmpnam_r_proto tmpnam_r $hdrs
19807 case "$d_tmpnam_r_proto" in
19809 case "$tmpnam_r_proto" in
19810 ''|0) try='char* tmpnam_r(char*);'
19811 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19813 case "$tmpnam_r_proto" in
19814 ''|0) d_tmpnam_r=undef
19816 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19817 * ) case "$tmpnam_r_proto" in
19818 REENTRANT_PROTO*) ;;
19819 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19821 echo "Prototype: $try" ;;
19824 *) case "$usethreads" in
19825 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19832 *) tmpnam_r_proto=0
19836 : see if trunc exists
19840 : see if truncate exists
19841 set truncate d_truncate
19844 : see if ttyname_r exists
19845 set ttyname_r d_ttyname_r
19847 case "$d_ttyname_r" in
19849 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19850 case "$d_ttyname_r_proto:$usethreads" in
19851 ":define") d_ttyname_r_proto=define
19852 set d_ttyname_r_proto ttyname_r $hdrs
19856 case "$d_ttyname_r_proto" in
19858 case "$ttyname_r_proto" in
19859 ''|0) try='int ttyname_r(int, char*, size_t);'
19860 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19862 case "$ttyname_r_proto" in
19863 ''|0) try='int ttyname_r(int, char*, int);'
19864 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19866 case "$ttyname_r_proto" in
19867 ''|0) try='char* ttyname_r(int, char*, int);'
19868 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19870 case "$ttyname_r_proto" in
19871 ''|0) d_ttyname_r=undef
19873 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19874 * ) case "$ttyname_r_proto" in
19875 REENTRANT_PROTO*) ;;
19876 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19878 echo "Prototype: $try" ;;
19881 *) case "$usethreads" in
19882 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19889 *) ttyname_r_proto=0
19893 : see if tzname[] exists
19895 if set tzname val -a d_tzname; eval $csym; $val; then
19897 echo 'tzname[] found.' >&4
19900 echo 'tzname[] NOT found.' >&4
19905 : Check if is a multiplatform env
19907 darwin) multiarch="$define" ;;
19909 case "$multiarch" in
19910 ''|[nN]*) multiarch="$undef" ;;
19913 : check for ordering of bytes in a UV
19915 case "$multiarch" in
19918 You seem to be doing a multiarchitecture build,
19919 skipping the byteorder check.
19925 case "$byteorder" in
19928 In the following, larger digits indicate more significance. A big-endian
19929 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19930 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19931 machines may have weird orders like 3412. A Cray will report 87654321,
19932 an Alpha will report 12345678. If the test program works the default is
19934 I'm now running the test program...
19938 #$i_stdlib I_STDLIB
19940 #include <stdlib.h>
19942 #include <sys/types.h>
19943 typedef $uvtype UV;
19953 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19955 u.l = (UV)0x04030201;
19956 for (i = 0; i < $uvsize; i++)
19957 printf("%c", u.c[i]+'0');
19964 if eval $compile && $run ./try > /dev/null; then
19967 [1-4][1-4][1-4][1-4]|12345678|87654321)
19968 echo "(The test program ran ok.)"
19969 echo "byteorder=$dflt"
19972 ????|????????) echo "(The test program ran ok.)" ;;
19973 *) echo "(The test program didn't run right for some reason.)" ;;
19978 (I can't seem to compile the test program. Guessing big-endian...)
19981 case "$xxx_prompt" in
19983 rp="What is the order of bytes in $uvtype?"
19996 : Checking 32bit alignedness
19999 Checking to see whether you can access character data unalignedly...
20001 case "$d_u32align" in
20002 '') $cat >try.c <<EOCP
20004 #$i_stdlib I_STDLIB
20006 #include <stdlib.h>
20008 #define U32 $u32type
20009 #define BYTEORDER 0x$byteorder
20011 #include <signal.h>
20013 $signal_t bletch(int s) { exit(4); }
20016 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
20017 volatile U8 buf[8];
20021 if (sizeof(U32) != 4) {
20022 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
20029 signal(SIGBUS, bletch);
20041 for (i = 0; i < 4; i++) {
20042 up = (U32*)(buf + i);
20043 if (! ((*up == 1 << (8*i)) || /* big-endian */
20044 (*up == 1 << (8*(3-i))) /* little-endian */
20048 printf("read failed (%x)\n", *up);
20054 for (i = 0; i < 4; i++) {
20055 up = (U32*)(buf + i);
20057 if (*up != 0xBeef) {
20058 printf("write failed (%x)\n", *up);
20072 if eval $compile_ok; then
20073 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20074 $run ./try 2>&1 >/dev/null
20077 You can access character data pretty unalignedly.
20079 d_u32align="$undef"
20082 It seems that you must access character data in an aligned manner.
20084 d_u32align="$define"
20088 rp='Can you access character data at unaligned addresses?'
20092 [yY]*) d_u32align="$undef" ;;
20093 *) d_u32align="$define" ;;
20100 : see if ualarm exists
20101 set ualarm d_ualarm
20104 : see if umask exists
20108 : see if unordered exists
20109 set unordered d_unordered
20112 : see if unsetenv exists
20113 set unsetenv d_unsetenv
20116 : see if usleep exists
20117 set usleep d_usleep
20120 : see if prototype for usleep is available
20122 set d_usleepproto usleep $i_unistd unistd.h
20125 : see if ustat exists
20129 : see if closedir exists
20130 set closedir d_closedir
20133 case "$d_closedir" in
20136 echo "Checking whether closedir() returns a status..." >&4
20138 #$i_dirent I_DIRENT /**/
20139 #$i_sysdir I_SYS_DIR /**/
20140 #$i_sysndir I_SYS_NDIR /**/
20141 #$i_systypes I_SYS_TYPES /**/
20143 #if defined(I_SYS_TYPES)
20144 #include <sys/types.h>
20146 #if defined(I_DIRENT)
20147 #include <dirent.h>
20150 #include <sys/ndir.h>
20154 #include <ndir.h> /* may be wrong in the future */
20156 #include <sys/dir.h>
20161 int main() { return closedir(opendir(".")); }
20164 if eval $compile_ok; then
20165 if $run ./try > /dev/null 2>&1 ; then
20166 echo "Yes, it does."
20169 echo "No, it doesn't."
20173 echo "(I can't seem to compile the test program--assuming it doesn't)"
20181 set d_void_closedir
20185 : see if there is a wait4
20189 : see if waitpid exists
20190 set waitpid d_waitpid
20195 $cat >try.c <<'EOCP'
20201 return (wcscmp (s, s) ? 1 : 0);
20206 if eval $compile; then
20209 0) echo "A working wcscmp() found." >&4
20211 *) echo "wcscmp() found, but it doesn't work" >&4
20215 echo "wcscmp() NOT found." >&4
20221 : see if wcstombs exists
20222 set wcstombs d_wcstombs
20227 $cat >try.c <<'EOCP'
20232 wchar_t dst[4], *src = L" ";
20234 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20239 if eval $compile; then
20242 0) echo "A working wcsxfrm() found." >&4
20244 *) echo "wcsxfrm() found, but it doesn't work" >&4
20248 echo "wcsxfrm() NOT found." >&4
20254 : see if wctomb exists
20255 set wctomb d_wctomb
20258 : see if writev exists
20259 set writev d_writev
20262 : check for alignment requirements
20264 case "$alignbytes" in
20265 '') echo "Checking alignment constraints..." >&4
20274 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20279 if eval $compile_ok; then
20283 echo "(I can't seem to compile the test program...)"
20285 case "$multiarch" in
20287 : The usual safe value is 8, but Darwin with -Duselongdouble
20288 : needs 16. Hence, we will take 8 as a minimum, but allow
20289 : Configure to pick a larger value if needed.
20290 if $test "$dflt" -lt 8; then
20292 echo "Setting alignment to 8 for multiarch support.">&4
20297 *) dflt="$alignbytes"
20300 rp="Doubles must be aligned on a how-many-byte boundary?"
20305 : set the base revision
20308 : length of character in bytes. Is always 1, otherwise it is not C
20309 : This used to be a test using sizeof
20312 : Check for the number of bits in a character
20313 case "$charbits" in
20314 '') echo "Checking how long a character is (in bits)..." >&4
20321 for (c = 1, n = 0; c; c <<= 1, n++) ;
20322 printf ("%d\n", n);
20327 if eval $compile_ok; then
20331 echo "(I can't seem to compile the test program. Guessing...)"
20338 rp="What is the length of a character (in bits)?"
20342 case "$charbits" in
20345 Your system has an unsigned character size of $charbits bits, which
20346 is rather unusual (normally it is 8 bits). Perl likely will not work
20347 correctly on your system, with subtle bugs in various places.
20349 rp='Do you really want to continue?'
20353 [yY]) echo >&4 "Okay, continuing." ;;
20358 : how do we concatenate cpp tokens here?
20360 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20361 $cat >cpp_stuff.c <<'EOCP'
20362 #define RCAT(a,b)a/**/b
20363 #define ACAT(a,b)a ## b
20367 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20368 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20369 echo "Oh! Smells like ANSI's been here." >&4
20370 echo "We can catify or stringify, separately or together!"
20372 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20373 echo "Ah, yes! The good old days!" >&4
20374 echo "However, in the good old days we don't know how to stringify and"
20375 echo "catify at the same time."
20379 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20380 You're going to have to edit the values of CAT[2-5] in config.h...
20382 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20386 : see if this is a db.h system
20392 : Check db version.
20394 echo "Checking Berkeley DB version ..." >&4
20400 #include <sys/types.h>
20402 #$i_stdlib I_STDLIB
20404 #include <stdlib.h>
20407 int main(int argc, char *argv[])
20409 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20410 int Major, Minor, Patch ;
20411 unsigned long Version ;
20412 (void)db_version(&Major, &Minor, &Patch) ;
20414 printf("%d %d %d %d %d %d\n",
20415 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20416 Major, Minor, Patch);
20419 printf("You have Berkeley DB Version 2 or greater.\n");
20421 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20422 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20423 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20424 Major, Minor, Patch) ;
20426 /* check that db.h & libdb are compatible */
20427 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20428 printf("db.h and libdb are incompatible.\n") ;
20432 printf("db.h and libdb are compatible.\n") ;
20434 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20435 + DB_VERSION_PATCH ;
20437 /* needs to be >= 2.3.4 */
20438 if (Version < 2003004) {
20439 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20440 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20446 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20451 printf("You have Berkeley DB Version 1.\n");
20452 exit(0); /* DB version < 2: the coast is clear. */
20454 exit(1); /* <db.h> not Berkeley DB? */
20460 if eval $compile_ok && $run ./try; then
20461 echo 'Looks OK.' >&4
20463 db_version_major=$1
20464 db_version_minor=$2
20465 db_version_patch=$3
20467 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20471 : Remove db from list of libraries to use
20472 echo "Removing unusable -ldb from library list" >&4
20473 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20476 echo "libs = $libs" >&4
20486 : Check the return type needed for hash
20488 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20494 #include <sys/types.h>
20497 #ifndef DB_VERSION_MAJOR
20498 u_int32_t hash_cb (const void* ptr, size_t size)
20504 info.hash = hash_cb;
20508 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20509 if $contains warning try.out >>/dev/null 2>&1 ; then
20512 db_hashtype='u_int32_t'
20515 : XXX Maybe we should just give up here.
20516 db_hashtype=u_int32_t
20518 echo "Help: I can't seem to compile the db test program." >&4
20519 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20522 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20524 *) db_hashtype=u_int32_t
20529 : Check the return type needed for prefix
20531 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20537 #include <sys/types.h>
20540 #ifndef DB_VERSION_MAJOR
20541 size_t prefix_cb (const DBT *key1, const DBT *key2)
20547 info.prefix = prefix_cb;
20551 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20552 if $contains warning try.out >>/dev/null 2>&1 ; then
20553 db_prefixtype='int'
20555 db_prefixtype='size_t'
20558 db_prefixtype='size_t'
20559 : XXX Maybe we should just give up here.
20561 echo "Help: I can't seem to compile the db test program." >&4
20562 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20565 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20567 *) db_prefixtype='size_t'
20571 : Check what kind of inf/nan your system has
20572 $echo "Checking the kind of infinities and nans you have..." >&4
20573 $echo "(The following tests may crash. That's okay.)" >&4
20575 #define DOUBLESIZE $doublesize
20576 #$d_longdbl HAS_LONG_DOUBLE
20577 #ifdef HAS_LONG_DOUBLE
20578 #define LONGDBLSIZE $longdblsize
20579 #define LONGDBLKIND $longdblkind
20586 /* Note that whether the sign bit is on or off
20587 * for NaN depends on the CPU/FPU, and possibly
20588 * can be affected by the build toolchain.
20590 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20591 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20592 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20593 * (respectively) as opposed to the more usual
20594 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20596 static void bytes(unsigned char *p, unsigned int n) {
20598 for (i = 0; i < n; i++) {
20599 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20602 int main(int argc, char *argv[]) {
20603 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20604 * because some compilers are 'smart' and not only warn but refuse to
20605 * compile such 'illegal' values. */
20606 double dinf = exp(1e9);
20607 double dnan = sqrt(-1.0);
20608 #ifdef HAS_LONG_DOUBLE
20609 long double ldinf = (long double)exp(1e9);
20610 long double ldnan = (long double)sqrt(-1.0);
20613 switch (argv[1][0]) {
20614 case '1': bytes(&dinf, sizeof(dinf)); break;
20615 case '2': bytes(&dnan, sizeof(dnan)); break;
20616 #ifdef HAS_LONG_DOUBLE
20617 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20618 /* the 80-bit long doubles might have garbage in their excess bytes */
20619 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20621 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20622 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20630 if eval $compile; then
20631 doubleinfbytes=`$run ./try 1`
20632 doublenanbytes=`$run ./try 2`
20633 case "$d_longdbl" in
20635 longdblinfbytes=`$run ./try 3`
20636 longdblnanbytes=`$run ./try 4`
20640 # Defaults in case the above test program failed.
20641 case "$doublekind" in
20642 1) # IEEE 754 32-bit LE
20643 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20644 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20646 2) # IEEE 754 32-bit BE
20647 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20648 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20650 3) # IEEE 754 64-bit LE
20651 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20652 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20654 4) # IEEE 754 64-bit BE
20655 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20656 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20658 5) # IEEE 754 128-bit LE
20659 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20660 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20662 6) # IEEE 754 128-bit BE
20663 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20664 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20666 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20667 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20668 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20670 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20671 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20672 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20675 doubleinfbytes=$undef
20676 doublenanbytes=$undef
20679 case "$longdblkind" in
20680 1) # IEEE 754 128-bit LE
20681 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20682 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20684 2) # IEEE 754 128-bit BE
20685 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20686 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20688 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20689 case "$longdblsize" in
20690 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20691 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20692 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20695 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20696 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20699 longdblinfbytes=$undef
20700 longdblnanbytes=$undef
20704 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20705 case "$longdblsize" in
20706 12) # 32-bit system
20707 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20708 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20710 16) # 64-bit system
20711 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20712 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20715 longdblinfbytes=$undef
20716 longdblnanbytes=$undef
20720 5) # 128-bit LE-LE "double double"
20721 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20722 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20724 6) # 128-bit BE-BE "double double"
20725 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20726 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20728 7) # 128-bit LE-BE "double double"
20729 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20730 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20732 8) # 128-bit BE-LE "double double"
20733 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20734 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20737 longdblinfbytes=$undef
20738 longdblnanbytes=$undef
20744 : Check the length of the double mantissa
20745 $echo "Checking how many mantissa bits your doubles have..." >&4
20748 #$i_sunmath I_SUNMATH
20750 # include <float.h>
20753 # include <sunmath.h>
20755 #ifdef DBL_MANT_DIG
20756 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20759 int main(int argc, char *argv[]) {
20761 printf("%d\n", BITS);
20767 if eval $compile; then
20768 doublemantbits=`$run ./try`
20770 doublemantbits="$undef"
20774 : Check the length of the longdouble mantissa
20775 $echo "Checking how many mantissa bits your long doubles have..." >&4
20778 #$i_sunmath I_SUNMATH
20780 # include <float.h>
20783 # include <sunmath.h>
20785 #$d_longdbl HAS_LONG_DOUBLE
20786 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20787 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20788 /* This format has no implicit bit. Beware, however, that for
20789 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20790 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20791 * and the top bit must have been one since 387, zero is plain invalid.
20792 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20793 # define BITS LDBL_MANT_DIG
20794 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20795 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20796 * reason e.g. Irix thinks 107. But in any case, we want only
20797 * the number of real bits, the implicit bits are of no interest. */
20798 # define BITS 2 * (DBL_MANT_DIG - 1)
20800 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20804 int main(int argc, char *argv[]) {
20806 printf("%d\n", BITS);
20812 if eval $compile; then
20813 longdblmantbits=`$run ./try`
20815 longdblmantbits="$undef"
20819 : Check the length of the NV mantissa
20820 $echo "Checking how many mantissa bits your NVs have..." >&4
20821 if test "X$usequadmath" = "X$define"; then
20822 nvmantbits=112 # 128-1-15
20824 if test "X$nvsize" = "X$doublesize"; then
20825 nvmantbits="$doublemantbits"
20827 if test "X$nvsize" = "X$longdblsize"; then
20828 nvmantbits="$longdblmantbits"
20830 nvmantbits="$undef"
20835 : How can we generate normalized random numbers ?
20837 echo "Using our internal random number implementation..." >&4
20840 *-Dmy_rand=*|*-Dmy_srand=*)
20841 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20842 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20843 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20844 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20848 randfunc=Perl_drand48
20849 drand01="Perl_drand48()"
20850 seedfunc="Perl_drand48_init"
20854 : Probe whether dtrace builds an object, as newer Illumos requires an input
20855 : object file that uses at least one of the probes defined in the .d file
20856 case "$usedtrace" in
20858 case "$dtraceobject" in
20859 $define|true|[yY]*)
20860 dtraceobject=$define
20863 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20865 #include "perldtrace.h"
20867 PERL_LOADED_FILE("dummy");
20871 dtraceobject=$undef
20872 if $cc -c -o try.o $optimize $ccflags try.c \
20873 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
20874 dtraceobject=$define
20875 echo "Your dtrace builds an object file"
20877 $rm -f try.c try.o perldtrace.o
20879 *) dtraceobject=$undef ;;
20883 : Determine if this is an EBCDIC system
20885 echo "Determining whether or not we are on an EBCDIC system..." >&4
20886 $cat >try.c <<'EOM'
20889 if ('M'==0xd4) return 0;
20896 if eval $compile_ok; then
20897 if $run ./try; then
20898 echo "You seem to speak EBCDIC." >&4
20901 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20904 echo "I'm unable to compile the test program." >&4
20905 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20911 : Check how to flush
20914 Checking how to flush all pending stdio output...
20916 # I only know how to find the first 32 possibly open files on SunOS.
20917 # See also hints/sunos_4_1.sh and util.c --AD
20919 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20921 $cat >>try.c <<EOCP
20923 #$i_stdlib I_STDLIB
20925 #include <stdlib.h>
20927 #$i_unistd I_UNISTD
20929 # include <unistd.h>
20931 #$d_sysconf HAS_SYSCONF
20932 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20933 #ifdef HAS_STDIO_STREAM_ARRAY
20934 # define STDIO_STREAM_ARRAY $stdio_stream_array
20939 p = fopen("try.out", "w");
20943 # ifdef TRY_FPRINTF
20947 #ifdef TRY_FFLUSH_NULL
20950 #ifdef TRY_FFLUSH_ALL
20952 long open_max = -1;
20953 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20954 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20956 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20957 open_max = sysconf(_SC_OPEN_MAX);
20960 open_max = FOPEN_MAX;
20963 open_max = OPEN_MAX;
20972 # ifdef HAS_STDIO_STREAM_ARRAY
20973 if (open_max > 0) {
20975 for (i = 0; i < open_max; i++)
20976 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20977 STDIO_STREAM_ARRAY[i]._file < open_max &&
20978 STDIO_STREAM_ARRAY[i]._flag)
20979 fflush(&STDIO_STREAM_ARRAY[i]);
20987 : first we have to find out how _not_ to flush
20989 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20991 set try -DTRY_FPUTC
20992 if eval $compile; then
20993 $run ./try 2>/dev/null
20996 if $test ! -s try.out -a "X$code" = X42; then
21002 set try -DTRY_FPRINTF
21003 if eval $compile; then
21004 $run ./try 2>/dev/null
21007 if $test ! -s try.out -a "X$code" = X42; then
21008 output=-DTRY_FPRINTF
21014 : check for fflush NULL behavior
21015 case "$fflushNULL" in
21016 '') set try -DTRY_FFLUSH_NULL $output
21017 if eval $compile; then
21018 $run ./try 2>/dev/null
21021 if $test -s try.out -a "X$code" = X42; then
21022 fflushNULL="`$cat try.out`"
21024 if $test "X$code" != X42; then
21026 (If this test failed, don't worry, we'll try another method shortly.)
21031 $rm -f core try.core core.try.*
21032 case "$fflushNULL" in
21034 Your fflush(NULL) works okay for output streams.
21035 Let's see if it clobbers input pipes...
21037 # As of mid-March 2000 all versions of Solaris appear to have a stdio
21038 # bug that improperly flushes the input end of pipes. So we avoid the
21039 # autoflush on fork/system/exec support for now. :-(
21040 $cat >tryp.c <<EOCP
21043 main(int argc, char **argv)
21049 while ((i = getc(stdin)) != -1
21050 && (*bp++ = i) != '\n'
21051 && bp < &buf[1024])
21054 fprintf(stdout, "%s", buf);
21062 fflushNULL="$define"
21064 if eval $compile; then
21066 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21067 if $test "X$targethost" != X; then
21070 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21072 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21074 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21076 fflush(NULL) seems to behave okay with input streams.
21078 fflushNULL="$define"
21081 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21083 fflushNULL="$undef"
21086 $rm -f core tryp.c tryp.core core.tryp.*
21089 Your fflush(NULL) isn't working (contrary to ANSI C).
21091 fflushNULL="$undef"
21094 Cannot figure out whether your fflush(NULL) works or not.
21095 I'm assuming it doesn't (contrary to ANSI C).
21097 fflushNULL="$undef"
21101 $define|true|[yY]*)
21102 fflushNULL="$define"
21105 fflushNULL="$undef"
21108 : check explicit looping only if NULL did not work, and if the pipe
21109 : bug does not show up on an explicit flush too
21110 case "$fflushNULL" in
21112 $cat >tryp.c <<EOCP
21115 main(int argc, char **argv)
21121 while ((i = getc(stdin)) != -1
21122 && (*bp++ = i) != '\n'
21123 && bp < &buf[1024])
21126 fprintf(stdout, "%s", buf);
21135 if eval $compile; then
21137 if $test "X$targethost" != X; then
21140 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21142 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21144 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21146 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21148 : now check for fflushall behaviour
21149 case "$fflushall" in
21150 '') set try -DTRY_FFLUSH_ALL $output
21151 if eval $compile; then
21153 (Now testing the other method--but note that this also may fail.)
21155 $run ./try 2>/dev/null
21158 if $test -s try.out -a "X$code" = X42; then
21159 fflushall="`$cat try.out`"
21163 case "$fflushall" in
21165 Whew. Flushing explicitly all the stdio streams works.
21167 fflushall="$define"
21170 Sigh. Flushing explicitly all the stdio streams doesn't work.
21175 Cannot figure out whether flushing stdio streams explicitly works or not.
21176 I'm assuming it doesn't.
21182 "$define"|true|[yY]*)
21183 fflushall="$define"
21191 All is futile. Even fflush(stdin) clobbers input pipes!
21198 $rm -f core tryp.c tryp.core core.tryp.*
21200 *) fflushall="$undef"
21204 case "$fflushNULL$fflushall" in
21207 OK, I give up. I cannot figure out how to flush pending stdio output.
21208 We won't be flushing handles at all before fork/exec/popen.
21214 : Store the full pathname to the ar program for use in the C program
21215 : Respect a hint or command line value for full_ar.
21220 : Store the full pathname to the sed program for use in the C program
21223 : see what type gids are declared as in the kernel
21225 echo "Looking for the type for group ids returned by getgid()."
21226 set gid_t gidtype xxx stdio.h sys/types.h
21230 xxx=`./findhdr sys/user.h`
21231 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21233 unsigned) dflt="$1 $2" ;;
21237 *) dflt="$gidtype";;
21240 gid_t) echo "gid_t found." ;;
21241 *) rp="What is the type for group ids returned by getgid()?"
21247 : Check the size of GID
21250 *_t) zzz="$gidtype" ;;
21253 echo "Checking the size of $zzz..." >&4
21255 #include <sys/types.h>
21257 #$i_stdlib I_STDLIB
21259 #include <stdlib.h>
21262 printf("%d\n", (int)sizeof($gidtype));
21267 if eval $compile_ok; then
21271 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21274 echo "Your $zzz is $gidsize bytes long."
21279 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21283 : Check if GID is signed
21286 *_t) zzz="$gidtype" ;;
21289 echo "Checking the sign of $zzz..." >&4
21291 #include <sys/types.h>
21302 if eval $compile; then
21306 echo "(I can't execute the test program--guessing unsigned.)" >&4
21310 1) echo "Your $zzz is unsigned." ;;
21311 -1) echo "Your $zzz is signed." ;;
21317 echo "(I can't compile the test program--guessing unsigned.)" >&4
21321 : Check 64bit sizes
21324 if $test X"$quadtype" != X; then
21326 echo "Checking how to print 64-bit integers..." >&4
21328 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21329 $cat >try.c <<'EOCP'
21330 #include <sys/types.h>
21333 int q = 12345678901;
21334 printf("%ld\n", q);
21338 if eval $compile; then
21342 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21343 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21344 echo "We will use %d."
21350 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21351 $cat >try.c <<'EOCP'
21352 #include <sys/types.h>
21355 long q = 12345678901;
21356 printf("%ld\n", q);
21360 if eval $compile; then
21364 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21365 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21366 echo "We will use %ld."
21372 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21373 $cat >try.c <<'EOCP'
21374 #include <sys/types.h>
21375 #include <inttypes.h>
21378 int64_t q = 12345678901;
21379 printf("%" PRId64 "\n", q);
21383 if eval $compile; then
21387 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21388 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21389 echo "We will use the C9X style."
21395 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21397 #include <sys/types.h>
21400 $quadtype q = 12345678901;
21401 printf("%Ld\n", q);
21405 if eval $compile; then
21409 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21410 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21411 echo "We will use %Ld."
21417 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21418 $cat >try.c <<'EOCP'
21419 #include <sys/types.h>
21422 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21423 printf("%lld\n", q);
21427 if eval $compile; then
21431 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21432 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21433 echo "We will use the %lld style."
21439 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21441 #include <sys/types.h>
21444 $quadtype q = 12345678901;
21445 printf("%qd\n", q);
21449 if eval $compile; then
21453 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21454 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21455 echo "We will use %qd."
21461 if $test X"$sPRId64" = X; then
21462 echo "Cannot figure out how to print 64-bit integers." >&4
21469 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21470 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21472 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21473 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21477 : Check format strings for internal types
21479 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21481 if $test X"$ivsize" = X8; then
21482 ivdformat="$sPRId64"
21483 uvuformat="$sPRIu64"
21484 uvoformat="$sPRIo64"
21485 uvxformat="$sPRIx64"
21486 uvXUformat="$sPRIXU64"
21488 if $test X"$ivsize" = X"$longsize"; then
21495 if $test X"$ivsize" = X"$intsize"; then
21503 if $test X"$ivsize" = X"$shortsize"; then
21514 if $test X"$usequadmath" = X"$define"; then
21522 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21523 nveformat="$sPRIeldbl"
21524 nvfformat="$sPRIfldbl"
21525 nvgformat="$sPRIgldbl"
21526 nvEUformat="$sPRIEUldbl"
21527 nvFUformat="$sPRIFUldbl"
21528 nvGUformat="$sPRIGUldbl"
21539 case "$ivdformat" in
21540 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21545 : Check format string for GID
21548 $echo "Checking the format string to be used for gids..." >&4
21551 -1) if $test X"$gidsize" = X"$ivsize"; then
21552 gidformat="$ivdformat"
21554 if $test X"$gidsize" = X"$longsize"; then
21557 if $test X"$gidsize" = X"$intsize"; then
21560 if $test X"$gidsize" = X"$shortsize"; then
21567 *) if $test X"$gidsize" = X"$uvsize"; then
21568 gidformat="$uvuformat"
21570 if $test X"$gidsize" = X"$longsize"; then
21573 if $test X"$gidsize" = X"$intsize"; then
21576 if $test X"$gidsize" = X"$shortsize"; then
21585 : see if getgroups exists
21586 set getgroups d_getgrps
21589 : see if setgroups exists
21590 set setgroups d_setgrps
21593 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21595 case "$d_getgrps$d_setgrps" in
21597 case "$groupstype" in
21598 '') dflt="$gidtype" ;;
21599 *) dflt="$groupstype" ;;
21602 What type of pointer is the second argument to getgroups() and setgroups()?
21603 Usually this is the same as group ids, $gidtype, but not always.
21606 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21610 *) groupstype="$gidtype";;
21613 : check whether make sets MAKE
21615 echo "Checking if your $make program sets \$(MAKE)..." >&4
21616 case "$make_set_make" in
21618 $sed 's/^X //' > testmake.mak << 'EOF'
21620 X @echo 'maketemp="$(MAKE)"'
21622 case "`$make -f testmake.mak 2>/dev/null`" in
21623 *maketemp=*) make_set_make='#' ;;
21624 *) make_set_make="MAKE=$make" ;;
21626 $rm -f testmake.mak
21629 case "$make_set_make" in
21630 '#') echo "Yup, it does.";;
21631 *) echo "Nope, it doesn't.";;
21634 : see what type is used for mode_t
21635 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21636 set mode_t modetype int stdio.h sys/types.h
21639 : see if we need va_copy
21641 case "$i_stdarg" in
21644 #include <stdarg.h>
21646 #$i_stdlib I_STDLIB
21648 #include <stdlib.h>
21650 #include <signal.h>
21653 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21655 return vfprintf(f, fmt, *valp);
21659 myvfprintf(FILE *f, const char *fmt, va_list val)
21661 return ivfprintf(f, fmt, &val);
21665 myprintf(char *fmt, ...)
21668 va_start(val, fmt);
21669 return myvfprintf(stdout, fmt, val);
21673 main(int ac, char **av)
21675 signal(SIGSEGV, exit);
21677 myprintf("%s%cs all right, then\n", "that", '\'');
21682 if eval $compile && $run ./try 2>&1 >/dev/null; then
21683 case "`$run ./try`" in
21684 "that's all right, then")
21690 yes) echo "It seems that you don't need va_copy()." >&4
21691 need_va_copy="$undef"
21693 *) echo "It seems that va_copy() or similar will be needed." >&4
21694 need_va_copy="$define"
21699 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21700 need_va_copy="$undef"
21704 : see what type is used for size_t
21705 rp="What is the type used for the length parameter for string functions?"
21706 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21709 : check for type of arguments to gethostbyaddr.
21710 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21711 case "$d_gethbyaddr" in
21715 Checking to see what type of arguments are accepted by gethostbyaddr().
21717 hdrs="$define sys/types.h
21718 $d_socket sys/socket.h
21719 $i_niin netinet/in.h
21721 $i_unistd unistd.h"
21722 : The first arg can 'char *' or 'void *'
21723 : The second arg is some of integral type
21724 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21725 for yyy in size_t long int; do
21726 case "$netdb_host_type" in
21727 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21728 if ./protochk "$try" $hdrs; then
21729 echo "Your system accepts $xxx for the first arg."
21730 echo "...and $yyy for the second arg."
21731 netdb_host_type="$xxx"
21732 netdb_hlen_type="$yyy"
21738 : In case none of those worked, prompt the user.
21739 case "$netdb_host_type" in
21740 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21743 netdb_host_type=$ans
21744 rp='What is the type for the 2nd argument to gethostbyaddr?'
21747 netdb_hlen_type=$ans
21751 *) : no gethostbyaddr, so pick harmless defaults
21752 netdb_host_type='char *'
21753 netdb_hlen_type="$sizetype"
21756 # Remove the "const" if needed. -- but then we'll have a
21758 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21761 : check for type of argument to gethostbyname.
21762 if test "X$netdb_name_type" = X ; then
21763 case "$d_gethbyname" in
21767 Checking to see what type of argument is accepted by gethostbyname().
21769 hdrs="$define sys/types.h
21770 $d_socket sys/socket.h
21771 $i_niin netinet/in.h
21773 $i_unistd unistd.h"
21774 for xxx in "const char *" "char *"; do
21775 case "$netdb_name_type" in
21776 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21777 if ./protochk "$try" $hdrs; then
21778 echo "Your system accepts $xxx."
21779 netdb_name_type="$xxx"
21784 : In case none of those worked, prompt the user.
21785 case "$netdb_name_type" in
21786 '') rp='What is the type for the 1st argument to gethostbyname?'
21789 netdb_name_type=$ans
21793 *) : no gethostbyname, so pick harmless default
21794 netdb_name_type='char *'
21799 : check for type of 1st argument to getnetbyaddr.
21800 if test "X$netdb_net_type" = X ; then
21801 case "$d_getnbyaddr" in
21805 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21807 hdrs="$define sys/types.h
21808 $d_socket sys/socket.h
21809 $i_niin netinet/in.h
21811 $i_unistd unistd.h"
21812 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21813 case "$netdb_net_type" in
21814 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21815 if ./protochk "$try" $hdrs; then
21816 echo "Your system accepts $xxx."
21817 netdb_net_type="$xxx"
21822 : In case none of those worked, prompt the user.
21823 case "$netdb_net_type" in
21824 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21827 netdb_net_type=$ans
21831 *) : no getnetbyaddr, so pick harmless default
21832 netdb_net_type='long'
21836 : locate the preferred pager for this system
21843 [a-zA-Z]:/*) dflt=$pg;;
21847 [a-zA-Z]:/*) dflt=$more;;
21851 [a-zA-Z]:/*) dflt=$less;;
21854 '') dflt=/usr/ucb/more;;
21862 rp='What pager is used on your system?'
21866 : see if ar generates random libraries by itself
21868 echo "Checking how to generate random libraries on your machine..." >&4
21869 echo 'int bar1() { return bar2(); }' > bar1.c
21870 echo 'int bar2() { return 2; }' > bar2.c
21872 #$i_stdlib I_STDLIB
21874 #include <stdlib.h>
21876 int main() { printf("%d\n", bar1()); exit(0); }
21878 $cc $ccflags -c bar1.c >/dev/null 2>&1
21879 $cc $ccflags -c bar2.c >/dev/null 2>&1
21880 $cc $ccflags -c foo.c >/dev/null 2>&1
21881 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21882 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21883 $run ./foobar >/dev/null 2>&1; then
21884 echo "$ar appears to generate random libraries itself."
21886 if [ "X$ranlib" = "X" ]; then
21889 elif $ar s bar$_a >/dev/null 2>&1 &&
21890 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21891 $run ./foobar >/dev/null 2>&1; then
21892 echo "a table of contents needs to be added with '$ar s'."
21895 elif $ar ts bar$_a >/dev/null 2>&1 &&
21896 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21897 $run ./foobar >/dev/null 2>&1; then
21898 echo "a table of contents needs to be added with '$ar ts'."
21905 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21906 $test -f $ranlib || ranlib=''
21909 if $test -n "$ranlib"; then
21910 echo "your system has '$ranlib'; we'll use that."
21913 echo "your system doesn't seem to support random libraries"
21914 echo "so we'll use lorder and tsort to order the libraries."
21921 : see if this is a values.h system
21922 set values.h i_values
21925 : Check the max offset that gmtime and localtime accept
21926 echo "Checking max offsets that gmtime () accepts"
21929 define) yyy="#include <values.h>" ;;
21933 case "$sGMTIME_min/$sGMTIME_max" in
21936 #include <sys/types.h>
21945 void gm_check (time_t t, int min_year, int max_year)
21948 if ( tmp == NULL ||
21949 /* Check tm_year overflow */
21950 tmp->tm_year < min_year || tmp->tm_year > max_year)
21961 gm_check (MAXLONG, 69, 0x7fffffff);
21963 if (tmp == NULL || tmp->tm_year < 0) {
21964 for (i = 63; i >= 0; i--) {
21965 time_t x = pt | ((time_t)1 << i);
21966 if (x < 0 || x < pt) continue;
21967 gm_check (x, 69, 0x7fffffff);
21970 printf ("sGMTIME_max=%ld\n", pt);
21979 gm_check (MINLONG, -1900, 70);
21982 for (i = 36; i >= 0; i--) {
21983 time_t x = pt - ((time_t)1 << i);
21984 if (x > 0) continue;
21985 gm_check (x, -1900, 70);
21988 printf ("sGMTIME_min=%ld\n", pt);
21992 int main (int argc, char *argv[])
21994 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
22001 if eval $compile; then
22002 eval `$run ./try 2>/dev/null`
22004 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
22010 echo "Checking max offsets that localtime () accepts"
22012 case "$sLOCALTIME_min/$sLOCALTIME_max" in
22015 #include <sys/types.h>
22024 void local_check (time_t t, int min_year, int max_year)
22026 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
22029 tmp = localtime (&t);
22030 if ( tmp == NULL ||
22031 /* Check tm_year overflow */
22032 tmp->tm_year < min_year || tmp->tm_year > max_year)
22036 } /* local_check */
22043 local_check (MAXLONG, 69, 0x7fffffff);
22045 if (tmp == NULL || tmp->tm_year < 0) {
22046 for (i = 63; i >= 0; i--) {
22047 time_t x = pt | ((time_t)1 << i);
22048 if (x < 0 || x < pt) continue;
22049 local_check (x, 69, 0x7fffffff);
22052 printf ("sLOCALTIME_max=%ld\n", pt);
22061 local_check (MINLONG, -1900, 70);
22064 for (i = 36; i >= 0; i--) {
22065 time_t x = pt - ((time_t)1 << i);
22066 if (x > 0) continue;
22067 local_check (x, -1900, 70);
22070 printf ("sLOCALTIME_min=%ld\n", pt);
22074 int main (int argc, char *argv[])
22082 if eval $compile; then
22083 eval `$run ./try 2>/dev/null`
22085 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22091 : check for type of arguments to select.
22092 case "$selecttype" in
22093 '') case "$d_select" in
22097 Checking to see what type of arguments are accepted by select().
22099 hdrs="$define sys/types.h
22100 $i_systime sys/time.h
22101 $i_sysselct sys/select.h
22102 $d_socket sys/socket.h"
22103 : The first arg can be int, unsigned, or size_t
22104 : The last arg may or may not be 'const'
22106 : void pointer has been seen but using that
22107 : breaks the selectminbits test
22108 for xxx in 'fd_set *' 'int *'; do
22109 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22110 for tmo in 'struct timeval *' 'const struct timeval *'; do
22112 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22113 if ./protochk "$try" $hdrs; then
22114 echo "Your system accepts $xxx."
22123 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22124 case "$d_fd_set" in
22125 $define) dflt="fd_set *" ;;
22134 *) : no select, so pick a harmless default
22141 : check for the select 'width'
22142 case "$selectminbits" in
22143 '') safebits=`expr $ptrsize \* 8`
22144 case "$d_select" in
22148 Checking to see on how many bits at a time your select() operates...
22151 #include <sys/types.h>
22153 #$i_systime I_SYS_TIME
22154 #$i_systimek I_SYS_TIME_KERNEL
22159 # ifdef I_SYS_TIME_KERNEL
22162 # include <sys/time.h>
22163 # ifdef I_SYS_TIME_KERNEL
22167 #$i_sysselct I_SYS_SELECT
22168 #ifdef I_SYS_SELECT
22169 #include <sys/select.h>
22171 #$d_socket HAS_SOCKET
22173 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22176 #$i_stdlib I_STDLIB
22178 #include <stdlib.h>
22181 #define S sizeof(*(b))
22183 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22184 #define NBITS (NBYTES * 8)
22186 char *s = (char *)malloc(NBYTES);
22195 fp = fopen("try.c", "r");
22201 b = ($selecttype)s;
22202 for (i = 0; i < NBITS; i++)
22206 select(fd + 1, b, 0, 0, &t);
22207 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22209 printf("%d\n", i + 1);
22214 if eval $compile_ok; then
22215 selectminbits=`$run ./try 2>/dev/null`
22216 case "$selectminbits" in
22218 Cannot figure out on how many bits at a time your select() operates.
22219 I'll play safe and guess it is $safebits bits.
22221 selectminbits=$safebits
22222 bits="$safebits bits"
22225 *) bits="$selectminbits bits" ;;
22227 echo "Your select() operates on $bits at a time." >&4
22229 rp='What is the minimum number of bits your select() operates on?'
22230 case "$byteorder" in
22231 12345678) dflt=64 ;;
22237 selectminbits="$val"
22241 *) : no select, so pick a harmless default
22242 selectminbits=$safebits
22248 : Trace out the files included by signal.h, then look for SIGxxx names.
22249 case "$sig_num_init" in
22251 if [ "X$fieldn" = X ]; then
22252 : Just make some guesses. We check them later.
22253 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22255 xxx=`echo '#include <signal.h>' |
22256 $cppstdin $cppminus $cppflags 2>/dev/null |
22257 $grep '^[ ]*#.*include' |
22258 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22259 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22262 for xx in $xxx /dev/null ; do
22263 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22265 case "$xxxfiles" in
22266 '') xxxfiles=`./findhdr signal.h` ;;
22269 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22270 print substr($2, 4, 20)
22272 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22273 print substr($3, 4, 20)
22275 : Append some common names just in case the awk scan failed.
22276 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22277 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22278 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22279 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22280 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22282 : generate a few handy files for later
22283 $cat > signal.c <<EOCP
22284 #include <sys/types.h>
22285 #include <signal.h>
22286 #$i_stdlib I_STDLIB
22288 #include <stdlib.h>
22293 /* Strange style to avoid deeply-nested #if/#else/#endif */
22296 # define NSIG (_NSIG)
22302 # define NSIG (SIGMAX+1)
22308 # define NSIG (SIG_MAX+1)
22314 # define NSIG (_SIG_MAX+1)
22320 # define NSIG (MAXSIG+1)
22326 # define NSIG (MAX_SIG+1)
22331 # ifdef SIGARRAYSIZE
22332 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22338 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22342 /* Default to some arbitrary number that's big enough to get most
22343 of the common signals.
22349 printf("NSIG %d\n", NSIG);
22355 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22357 printf "#ifdef SIG"; printf $1; printf "\n"
22358 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22359 printf $1; printf ");\n"
22363 printf "#endif /* JUST_NSIG */\n";
22364 printf "exit(0);\n}\n";
22367 $cat >signal.awk <<'EOP'
22368 BEGIN { ndups = 0 }
22369 $1 ~ /^NSIG$/ { nsig = $2 }
22370 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22371 if ($2 > maxsig) { maxsig = $2 }
22372 if (sig_name[$2]) {
22373 dup_name[ndups] = $1
22374 dup_num[ndups] = $2
22386 printf("NSIG %d\n", nsig);
22387 for (n = 1; n < nsig; n++) {
22389 printf("%s %d\n", sig_name[n], sig_num[n])
22392 printf("NUM%d %d\n", n, n)
22395 for (n = 0; n < ndups; n++) {
22396 printf("%s %d\n", dup_name[n], dup_num[n])
22400 $cat >signal_cmd <<EOS
22402 if $test -s signal.lst; then
22403 echo "Using your existing signal.lst file"
22408 $cat >>signal_cmd <<'EOS'
22411 if eval $compile_ok; then
22412 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22413 $uniq | $awk -f signal.awk >signal.lst
22415 echo "(I can't seem be able to compile the whole test program)" >&4
22416 echo "(I'll try it in little pieces.)" >&4
22417 set signal -DJUST_NSIG
22418 if eval $compile_ok; then
22419 $run ./signal$_exe > signal.nsg
22422 echo "I can't seem to figure out how many signals you have." >&4
22423 echo "Guessing 50." >&4
22424 echo 'NSIG 50' > signal.nsg
22426 : Now look at all the signal names, one at a time.
22427 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22428 $cat > signal.c <<EOCP
22429 #include <sys/types.h>
22430 #include <signal.h>
22433 printf("$xx %d\n", SIG${xx});
22438 if eval $compile; then
22439 echo "SIG${xx} found."
22440 $run ./signal$_exe >> signal.ls1
22442 echo "SIG${xx} NOT found."
22445 if $test -s signal.ls1; then
22446 $cat signal.nsg signal.ls1 |
22447 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22451 if $test -s signal.lst; then
22454 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22455 echo 'kill -l' >signal
22456 set X `csh -f <signal`
22460 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22462 echo $@ | $tr ' ' $trnl | \
22463 $awk '{ printf "%s %d\n", $1, ++s; }
22464 END { printf "NSIG %d\n", ++s }' >signal.lst
22466 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22468 chmod a+x signal_cmd
22469 $eunicefix signal_cmd
22473 : generate list of signal names
22474 case "$sig_num_init" in
22477 case "$sig_name_init" in
22479 *) case "$sig_num_init" in
22480 ''|*,*) doinit=yes ;;
22485 echo "Generating a list of signal names and numbers..." >&4
22487 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22488 sig_name=`$awk 'BEGIN { printf "ZERO " }
22489 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22490 sig_num=`$awk 'BEGIN { printf "0 " }
22491 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22492 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22493 !/^NSIG/ { printf "\"%s\", ", $1 }
22494 END { printf "0\n" }' signal.lst`
22495 sig_num_init=`$awk 'BEGIN { printf "0, " }
22496 !/^NSIG/ { printf "%d, ", $2}
22497 END { printf "0\n"}' signal.lst`
22500 echo "The following $sig_count signals are available:"
22502 echo $sig_name | $awk \
22503 'BEGIN { linelen = 0 }
22505 for (i = 1; i <= NF; i++) {
22506 name = "SIG" $i " "
22507 linelen = linelen + length(name)
22508 if (linelen > 70) {
22510 linelen = length(name)
22516 sig_size=`echo $sig_name | awk '{print NF}'`
22517 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22521 : Check size of size
22523 case "$sizetype" in
22524 *_t) zzz="$sizetype" ;;
22525 *) zzz="filesize" ;;
22527 echo "Checking the size of $zzz..." >&4
22529 #include <sys/types.h>
22531 #$i_stdlib I_STDLIB
22533 #include <stdlib.h>
22536 printf("%d\n", (int)sizeof($sizetype));
22541 if eval $compile_ok; then
22545 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22548 echo "Your $zzz size is $sizesize bytes."
22553 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22557 : check for socklen_t
22559 echo "Checking to see if you have socklen_t..." >&4
22561 #include <sys/types.h>
22562 #$d_socket HAS_SOCKET
22564 #include <sys/socket.h>
22566 int main() { socklen_t x = 16; }
22569 if eval $compile; then
22571 echo "You have socklen_t."
22574 echo "You do not have socklen_t."
22575 case "$sizetype" in
22576 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22583 : see if this is a socks.h system
22584 set socks.h i_socks
22587 : check for type of the size argument to socket calls
22588 case "$d_socket" in
22592 Checking to see what type is the last argument of accept().
22595 case "$d_socklen_t" in
22596 "$define") yyy="$yyy socklen_t"
22598 yyy="$yyy $sizetype int long unsigned"
22599 for xxx in $yyy; do
22600 case "$socksizetype" in
22601 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22602 case "$usesocks" in
22604 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22605 echo "Your system accepts '$xxx *' for the last argument of accept()."
22606 socksizetype="$xxx"
22609 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22610 echo "Your system accepts '$xxx *' for the last argument of accept()."
22611 socksizetype="$xxx"
22618 : In case none of those worked, prompt the user.
22619 case "$socksizetype" in
22620 '') rp='What is the type for socket address structure sizes?'
22627 *) : no sockets, so pick relatively harmless default
22632 : see what type is used for signed size_t
22633 set ssize_t ssizetype int stdio.h sys/types.h
22638 #$i_stdlib I_STDLIB
22640 #include <stdlib.h>
22642 #include <sys/types.h>
22643 #define Size_t $sizetype
22644 #define SSize_t $dflt
22647 if (sizeof(Size_t) == sizeof(SSize_t))
22649 else if (sizeof(Size_t) == sizeof(int))
22658 if eval $compile_ok && $run ./try > /dev/null; then
22659 ssizetype=`$run ./try`
22660 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22663 Help! I can't compile and run the ssize_t test program: please enlighten me!
22664 (This is probably a misconfiguration in your system or libraries, and
22665 you really ought to fix it. Still, I'll try anyway.)
22667 I need a type that is the same size as $sizetype, but is guaranteed to
22668 be signed. Common values are ssize_t, int and long.
22671 rp="What signed type is the same size as $sizetype?"
22677 : Check the size of st_ino
22679 $echo "Checking the size of st_ino..." >&4
22680 $cat > try.c <<EOCP
22681 #include <sys/stat.h>
22683 #$i_stdlib I_STDLIB
22685 #include <stdlib.h>
22689 printf("%d\n", (int)sizeof(st.st_ino));
22694 if eval $compile_ok; then
22698 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22700 *) st_ino_size=$val
22701 $echo "Your st_ino is $st_ino_size bytes long."
22706 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22710 : Check if st_ino is signed
22712 $echo "Checking the sign of st_ino..." >&4
22713 $cat > try.c <<EOCP
22714 #include <sys/stat.h>
22719 if (foo.st_ino < 0)
22726 if eval $compile; then
22730 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22732 *) st_ino_sign=$val
22733 case "$st_ino_sign" in
22734 1) $echo "Your st_ino is unsigned." ;;
22735 -1) $echo "Your st_ino is signed." ;;
22741 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22745 : see what type of char stdio uses.
22747 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22748 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22749 echo "Your stdio uses unsigned chars." >&4
22750 stdchar="unsigned char"
22752 echo "Your stdio uses signed chars." >&4
22757 : Check size of UID
22760 *_t) zzz="$uidtype" ;;
22763 echo "Checking the size of $zzz..." >&4
22765 #include <sys/types.h>
22767 #$i_stdlib I_STDLIB
22769 #include <stdlib.h>
22772 printf("%d\n", (int)sizeof($uidtype));
22777 if eval $compile_ok; then
22781 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22784 echo "Your $zzz is $uidsize bytes long."
22789 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22792 : Check if UID is signed
22795 *_t) zzz="$uidtype" ;;
22798 echo "Checking the sign of $zzz..." >&4
22800 #include <sys/types.h>
22811 if eval $compile; then
22815 echo "(I can't execute the test program--guessing unsigned.)" >&4
22819 1) echo "Your $zzz is unsigned." ;;
22820 -1) echo "Your $zzz is signed." ;;
22826 echo "(I can't compile the test program--guessing unsigned.)" >&4
22830 : Check format string for UID
22832 $echo "Checking the format string to be used for uids..." >&4
22835 -1) if $test X"$uidsize" = X"$ivsize"; then
22836 uidformat="$ivdformat"
22838 if $test X"$uidsize" = X"$longsize"; then
22841 if $test X"$uidsize" = X"$intsize"; then
22844 if $test X"$uidsize" = X"$shortsize"; then
22851 *) if $test X"$uidsize" = X"$uvsize"; then
22852 uidformat="$uvuformat"
22854 if $test X"$uidsize" = X"$longsize"; then
22857 if $test X"$uidsize" = X"$intsize"; then
22860 if $test X"$uidsize" = X"$shortsize"; then
22869 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22871 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22872 $cat >try.c <<'EOM'
22873 /* Intentionally a long probe as I'd like to sanity check that the exact
22874 approach is going to work, as thinking it will work, but only having it
22875 part working at runtime is worse than not having it. */
22877 #include <sys/types.h>
22878 #include <sys/sysctl.h>
22879 #include <sys/param.h>
22881 #include <string.h>
22882 #include <stdlib.h>
22883 #include <unistd.h>
22886 main(int argc, char **argv) {
22888 char *argv_leaf = strrchr(argv[0], '/');
22894 mib[1] = KERN_PROC;
22895 mib[2] = KERN_PROC_PATHNAME;
22899 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22903 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22908 if (size < strlen(argv_leaf) + 1) {
22909 fprintf(stderr, "size %lu is too short for a path\n",
22910 (unsigned long) size);
22914 if (size > MAXPATHLEN * MAXPATHLEN) {
22915 fprintf(stderr, "size %lu is too long for a path\n",
22916 (unsigned long) size);
22920 buffer = malloc(size);
22926 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22931 if (strlen(buffer) + 1 != size) {
22932 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22933 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22938 if (*buffer != '/') {
22939 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22943 if (strstr(buffer, "/./")) {
22944 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22948 if (strstr(buffer, "/../")) {
22949 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22953 buffer_leaf = strrchr(buffer, '/');
22954 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22955 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22967 if eval $compile; then
22968 if $run ./try; then
22969 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22972 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22976 echo "I'm unable to compile the test program." >&4
22977 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22981 set usekernprocpathname
22984 : Determine if we can use _NSGetExecutablePath to find executing program
22986 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22987 $cat >try.c <<'EOM'
22988 /* Intentionally a long probe as I'd like to sanity check that the exact
22989 approach is going to work, as thinking it will work, but only having it
22990 part working at runtime is worse than not having it. */
22991 #include <mach-o/dyld.h>
22993 #include <stdlib.h>
22994 #include <sys/param.h>
22995 #include <string.h>
22998 main(int argc, char **argv) {
23000 uint32_t size = sizeof(buf);
23004 char *argv_leaf = strrchr(argv[0], '/');
23008 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
23012 _NSGetExecutablePath(buf, &size);
23013 if (size > MAXPATHLEN * MAXPATHLEN) {
23014 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
23015 (unsigned int) size);
23019 buffer = malloc(size);
23025 result = _NSGetExecutablePath(buffer, &size);
23027 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
23028 result, (unsigned int) size);
23032 tidied = realpath(buffer, NULL);
23034 perror("realpath");
23040 if (*tidied != '/') {
23041 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
23045 if (strstr(tidied, "/./")) {
23046 fprintf(stderr, "Contains /./: '%s'\n", tidied);
23050 if (strstr(tidied, "/../")) {
23051 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23055 tidied_leaf = strrchr(tidied, '/');
23056 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23057 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23069 if eval $compile; then
23070 if $run ./try; then
23071 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23074 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23077 echo "I'm unable to compile the test program." >&4
23078 echo "I'll assume no _NSGetExecutablePath here." >&4
23081 set usensgetexecutablepath
23084 : Check if site customization support was requested
23085 case "$usesitecustomize" in
23086 $define|true|[Yy]*)
23087 usesitecustomize="$define"
23090 usesitecustomize="$undef"
23094 : see if prototypes support variable argument declarations
23096 case "$prototype$i_stdarg" in
23098 echo "It appears we'll be able to prototype varargs functions." >&4
23102 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23109 : determine compiler compiler
23118 if $test -f "$byacc$_exe"; then
23120 comp="byacc or $comp"
23122 if $test -f "$bison$_exe"; then
23123 comp="$comp or bison -y"
23125 rp="Which compiler compiler ($comp) shall I use?"
23134 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23140 : see if this is a assert.h system
23141 set assert.h i_assert
23144 : see if this is a bfd.h system
23148 : see if this is an execinfo.h system
23149 set execinfo.h i_execinfo
23152 : see if this is a fenv.h system
23156 : see if this is a fp.h system
23160 : see if this is a fp_class.h system
23161 set fp_class.h i_fp_class
23164 : see if gdbm.h is available
23169 : see if gdbm_open exists
23170 set gdbm_open d_gdbm_open
23172 case "$d_gdbm_open" in
23175 echo "We won't be including <gdbm.h>"
23184 : see if this is a ieeefp.h system
23185 case "$i_ieeefp" in
23186 '' ) set ieeefp.h i_ieeefp
23191 : see if this is a libutil.h system
23192 set libutil.h i_libutil
23195 : see if mach cthreads are available
23196 if test "X$usethreads" = "X$define"; then
23197 set mach/cthreads.h i_machcthr
23200 i_machcthr="$undef"
23203 : see if this is a mntent.h system
23204 set mntent.h i_mntent
23207 : see if net/errno.h is available
23209 set net/errno.h val
23212 : Unfortunately, it causes problems on some systems. Arrgh.
23215 cat > try.c <<'EOM'
23218 #include <net/errno.h>
23224 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23225 echo "We'll be including <net/errno.h>." >&4
23227 echo "We won't be including <net/errno.h>." >&4
23236 : see if netinet/tcp.h is available
23237 set netinet/tcp.h i_netinettcp
23240 : see if this is a poll.h system
23244 : see if this is a prot.h system
23248 : Preprocessor symbols
23250 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23251 $cat <<'EOSH' > Cppsym.know
23252 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23253 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23254 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23255 arch_pwr ardent ARM ARM32 atarist att386 att3b
23256 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23257 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23258 byteorder byte_order
23259 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23260 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23261 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23262 ELF encore EPI EXTENSIONS
23263 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23264 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23265 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23266 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23267 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23268 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23269 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23270 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23271 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23273 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23274 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23275 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23277 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23278 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23279 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23280 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23281 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23282 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23283 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23284 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23285 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23286 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23287 ns32000 ns32016 ns32332 ns32k nsc32000
23288 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23289 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23290 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23291 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23293 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23294 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23295 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23296 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23297 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23298 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23299 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23300 SYSV4 SYSV5 sysV68 sysV88
23301 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23302 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23303 tower32_800 tower32_850 tss
23304 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23305 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23306 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23307 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23308 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23309 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23311 vax venix VMESA vms
23312 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23313 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23316 # Maybe put other stuff here too.
23317 ./tr '-' '_' <<EOSH >>Cppsym.know
23320 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23321 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23322 $cat Cppsym.know > Cppsym.c
23323 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23324 $rm -f Cppsym.a Cppsym.b Cppsym.c
23325 cat <<EOSH > Cppsym
23327 if $test \$# -gt 0; then
23328 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23329 if $test -s Cppsym.got; then
23336 $tr " " "$trnl" | ./Cppsym.try
23342 cat <<EOSH > Cppsym.try
23344 cat <<'EOCP' > try.c
23347 #define STRINGIFY(a) "a"
23349 #if cpp_stuff == 42
23350 #define StGiFy(a) #a
23351 #define STRINGIFY(a) StGiFy(a)
23353 #if $cpp_stuff != 1 && $cpp_stuff != 42
23354 # include "Bletch: How does this C preprocessor stringify macros?"
23360 cat <<'EOSH' >> Cppsym.try
23362 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23363 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23364 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23365 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23367 echo 'return 0;}' >> try.c
23369 cat <<EOSH >> Cppsym.try
23371 case "$osname-$gccversion" in
23372 irix-) ccflags="\$ccflags -woff 1178" ;;
23373 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23375 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23377 chmod +x Cppsym.try
23378 $eunicefix Cppsym.try
23379 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23380 : Add in any Linux cpp "predefined macros":
23381 case "$osname::$gccversion" in
23382 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23384 rm -f $tHdrH'.h' $tHdrH
23386 # Filter out macro arguments, such as Linux's __INT8_C(c)
23387 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23388 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23389 if [ -s $tHdrH'_cppsym.real' ]; then
23390 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23393 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23396 : now check the C compiler for additional symbols
23397 postprocess_cc_v=''
23399 aix) postprocess_cc_v="|$tr , ' '" ;;
23406 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23409 -D*) echo "\$i" | $sed 's/^-D//';;
23410 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23415 postprocess_cc_v=''
23418 ./ccsym > ccsym1.raw
23419 if $test -s ccsym1.raw; then
23420 $sort ccsym1.raw | $uniq >ccsym.raw
23422 mv ccsym1.raw ccsym.raw
23425 $awk '/\=/ { print $0; next }
23426 { print $0"=1" }' ccsym.raw >ccsym.list
23427 $comm -13 Cppsym.true ccsym.list >ccsym.own
23428 $comm -12 Cppsym.true ccsym.list >ccsym.com
23429 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23431 if $test -z ccsym.raw; then
23432 echo "Your C compiler doesn't seem to define any symbols!" >&4
23434 echo "However, your C preprocessor defines the following symbols:"
23437 cppsymbols=`$cat Cppsym.true`
23438 cppsymbols=`echo $cppsymbols`
23439 cppccsymbols="$cppsymbols"
23441 if $test -s ccsym.com; then
23442 echo "Your C compiler and pre-processor define these symbols:"
23443 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23446 cppccsymbols=`$cat ccsym.com`
23447 cppccsymbols=`echo $cppccsymbols`
23448 $test "$silent" || sleep 1
23450 if $test -s ccsym.cpp; then
23451 $test "$also" && echo " "
23452 echo "Your C pre-processor ${also}defines the following symbols:"
23453 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23455 cppsymbols=`$cat ccsym.cpp`
23456 cppsymbols=`echo $cppsymbols`
23457 $test "$silent" || sleep 1
23459 if $test -s ccsym.own; then
23460 $test "$also" && echo " "
23461 echo "Your C compiler ${also}defines the following cpp symbols:"
23462 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23463 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23464 ccsymbols=`$cat ccsym.own`
23465 ccsymbols=`echo $ccsymbols`
23466 $test "$silent" || sleep 1
23470 : add -D_FORTIFY_SOURCE if feasible and not already there
23471 case "$gccversion" in
23472 [45].*) case "$optimize$ccflags" in
23473 *-O*) case "$ccflags$cppsymbols" in
23474 *_FORTIFY_SOURCE=*) # Don't add it again.
23475 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23477 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23478 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23482 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23486 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23490 : see if this is a termio system
23494 if $test `./findhdr termios.h`; then
23495 set tcsetattr i_termios
23501 "$define") echo "You have POSIX termios.h... good!" >&4;;
23502 *) if ./Cppsym pyr; then
23503 case "`$run /bin/universe`" in
23504 ucb) if $test `./findhdr sgtty.h`; then
23506 echo "<sgtty.h> found." >&4
23508 echo "System is pyramid with BSD universe."
23509 ./warn "<sgtty.h> not found--you could have problems."
23511 *) if $test `./findhdr termio.h`; then
23513 echo "<termio.h> found." >&4
23515 echo "System is pyramid with USG universe."
23516 ./warn "<termio.h> not found--you could have problems."
23520 if $test `./findhdr termio.h`; then
23521 echo "<termio.h> found." >&4
23523 elif $test `./findhdr sgtty.h`; then
23524 echo "<sgtty.h> found." >&4
23527 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23530 if $test `./findhdr sgtty.h`; then
23531 echo "<sgtty.h> found." >&4
23533 elif $test `./findhdr termio.h`; then
23534 echo "<termio.h> found." >&4
23537 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23541 set i_termio; eval $setvar
23542 val=$val2; set i_sgtty; eval $setvar
23543 val=$val3; set i_termios; eval $setvar
23545 : see if stdbool is available
23546 : we want a real compile instead of Inhdr because some Solaris systems
23547 : have stdbool.h, but it can only be used if the compiler indicates it
23548 : is sufficiently c99-compliant.
23552 #include <stdbool.h>
23557 int main(int argc, char **argv)
23563 if eval $compile; then
23564 echo "<stdbool.h> found." >&4
23567 echo "<stdbool.h> NOT found." >&4
23574 : see if stddef is available
23575 set stddef.h i_stddef
23578 : see if stdint is available
23579 set stdint.h i_stdint
23582 : see if sys/access.h is available
23583 set sys/access.h i_sysaccess
23586 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23587 set sys/filio.h i_sysfilio
23590 if $test `./findhdr sys/ioctl.h`; then
23592 echo '<sys/ioctl.h> found.' >&4
23595 if $test $i_sysfilio = "$define"; then
23596 echo '<sys/ioctl.h> NOT found.' >&4
23598 $test $i_sgtty = "$define" && xxx="sgtty.h"
23599 $test $i_termio = "$define" && xxx="termio.h"
23600 $test $i_termios = "$define" && xxx="termios.h"
23601 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23607 : see if socket ioctl defs are in sys/sockio.h
23609 xxx=`./findhdr sys/sockio.h`
23610 if $test "$xxx"; then
23611 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23613 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23616 echo "No socket ioctls found in <sys/sockio.h>." >&4
23621 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23627 : see if this is a syslog.h system
23628 set syslog.h i_syslog
23631 : see if this is a sys/mode.h system
23632 set sys/mode.h i_sysmode
23635 : see if there is a sys/poll.h file
23636 set sys/poll.h i_syspoll
23639 : see if sys/resource.h has to be included
23640 set sys/resource.h i_sysresrc
23643 : see if sys/security.h is available
23644 set sys/security.h i_syssecrt
23647 : see if this is a sys/statvfs.h system
23648 set sys/statvfs.h i_sysstatvfs
23651 : see if this is a sys/un.h system
23652 set sys/un.h i_sysun
23655 : see if this is a sys/utsname.h system
23656 set sys/utsname.h i_sysutsname
23659 : see if this is a syswait system
23660 set sys/wait.h i_syswait
23663 : see if this is a ustat.h system
23664 set ustat.h i_ustat
23667 : see if this is an utime system
23668 set utime.h i_utime
23671 : see if this is a vfork system
23674 set vfork.h i_vfork
23684 echo "Looking for extensions..." >&4
23685 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23686 : contain old or inaccurate or duplicate values.
23687 nonxs_extensions=''
23689 : We do not use find because it might not be available.
23690 : We do not just use MANIFEST because the user may have dropped
23691 : some additional extensions into the source tree and expect them
23694 : Function to recursively find available extensions, ignoring DynaLoader
23695 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23696 : In 5.10.1 and later, extensions are stored in directories
23697 : like File-Glob instead of the older File/Glob/.
23701 DynaLoader|dynaload) ;;
23703 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23704 case "$this_ext" in
23705 Scalar/List/Utils) this_ext="List/Util" ;;
23706 PathTools) this_ext="Cwd" ;;
23708 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23709 if $contains " $this_ext " "$tdir/$$.tmp"; then
23711 echo "Duplicate directories detected for extension $xxx" >&4;
23712 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23713 case "$knowitall" in
23721 echo "Ok. Stopping Configure." >&4;
23722 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23725 echo "Ok. You will need to correct config.sh before running make." >&4;
23727 $ls -1 "$xxx" > "$tdir/$$.tmp";
23728 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23729 xs_extensions="$xs_extensions $this_ext";
23730 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23731 xs_extensions="$xs_extensions $this_ext";
23732 elif $test -d "$xxx"; then
23733 nonxs_extensions="$nonxs_extensions $this_ext";
23735 $rm -f "$tdir/$$.tmp";
23743 eval $find_extensions
23747 eval $find_extensions
23751 eval $find_extensions
23752 set X $xs_extensions
23754 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23755 set X $nonxs_extensions
23757 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23759 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23761 : Now see which are supported on this system.
23763 for xxx in $xs_extensions ; do
23767 amigaos) avail_ext="$avail_ext $xxx" ;;
23772 $define) avail_ext="$avail_ext $xxx" ;;
23775 GDBM_File|gdbm_fil)
23777 $define) avail_ext="$avail_ext $xxx" ;;
23780 I18N/Langinfo|i18n_lan)
23781 case "$i_langinfo$d_nl_langinfo" in
23782 $define$define) avail_ext="$avail_ext $xxx" ;;
23786 : XXX Do we need a useipcsysv variable here
23787 case "${d_msg}${d_sem}${d_shm}" in
23788 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23791 NDBM_File|ndbm_fil)
23794 case "$osname-$use64bitint" in
23797 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23800 *) avail_ext="$avail_ext $xxx" ;;
23805 ODBM_File|odbm_fil)
23806 case "${i_dbm}${i_rpcsvcdbm}" in
23808 case "$d_cplusplus" in
23809 define) ;; # delete as a function name will not work
23810 *) case "$osname-$use64bitint" in
23813 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23816 *) avail_ext="$avail_ext $xxx" ;;
23824 case "$useopcode" in
23825 true|define|y) avail_ext="$avail_ext $xxx" ;;
23829 case "$useposix" in
23830 true|define|y) avail_ext="$avail_ext $xxx" ;;
23834 case "$d_socket" in
23835 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23838 Sys/Syslog|sys/syslog)
23840 amigaos) ;; # not really very useful on AmigaOS
23842 : XXX syslog requires socket
23843 case "$d_socket" in
23844 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23850 case "$usethreads" in
23852 case "$use5005threads" in
23853 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23857 threads|threads/shared)
23858 # threads and threads::shared are special cases.
23859 # To stop people from asking "Perl 5.8.0 was supposed
23860 # to have this new fancy threads implementation but my
23861 # perl doesn't have it" and from people trying to
23862 # (re)install the threads module using CPAN.pm and
23863 # CPAN.pm then offering to reinstall Perl 5.8.0,
23864 # the threads.pm and threads/shared.pm will always be
23865 # there, croaking informatively ("you need to rebuild
23866 # all of Perl with threads, sorry") when threads haven't
23867 # been compiled in.
23869 avail_ext="$avail_ext $xxx"
23875 cygwin) avail_ext="$avail_ext $xxx" ;;
23878 XS/APItest|xs/apitest)
23879 # This is just for testing. Skip it unless we have dynamic loading.
23882 $define) avail_ext="$avail_ext $xxx" ;;
23885 XS/Typemap|xs/typemap)
23886 # This is just for testing. Skip it unless we have dynamic loading.
23888 $define) avail_ext="$avail_ext $xxx" ;;
23891 *) avail_ext="$avail_ext $xxx"
23900 case "$onlyextensions" in
23902 *) keepextensions=''
23903 echo "You have requested that only certain extensions be included..." >&4
23904 for i in $onlyextensions; do
23905 case " $avail_ext " in
23907 echo "Keeping extension $i."
23908 keepextensions="$keepextensions $i"
23910 *) echo "Ignoring extension $i." ;;
23913 avail_ext="$keepextensions"
23917 case "$noextensions" in
23919 *) keepextensions=''
23920 echo "You have requested that certain extensions be ignored..." >&4
23921 for i in $avail_ext; do
23922 case " $noextensions " in
23923 *" $i "*) echo "Ignoring extension $i." ;;
23924 *) echo "Keeping extension $i.";
23925 keepextensions="$keepextensions $i"
23929 avail_ext="$keepextensions"
23933 : Now see which nonxs extensions are supported on this system.
23934 : For now assume all are.
23936 for xxx in $nonxs_extensions ; do
23940 *) nonxs_ext="$nonxs_ext $xxx"
23952 A number of extensions are supplied with $package. You may choose to
23953 compile these extensions for dynamic loading (the default), compile
23954 them into the $package executable (static loading), or not include
23955 them at all. Answer "none" to include no extensions.
23956 Note that DynaLoader is always built and need not be mentioned here.
23959 case "$dynamic_ext" in
23961 : Exclude those listed in static_ext
23963 for xxx in $avail_ext; do
23964 case " $static_ext " in
23966 *) dflt="$dflt $xxx" ;;
23973 *) dflt="$dynamic_ext"
23974 # Perhaps we are reusing an old out-of-date config.sh.
23977 if test X"$dynamic_ext" != X"$avail_ext"; then
23979 NOTICE: Your previous config.sh list may be incorrect.
23980 The extensions now available to you are
23982 but the default list from your previous config.sh is
23994 rp="What extensions do you wish to load dynamically?"
23997 none) dynamic_ext=' ' ;;
23998 *) dynamic_ext="$ans" ;;
24001 case "$static_ext" in
24003 : Exclude those already listed in dynamic linking
24005 for xxx in $avail_ext; do
24006 case " $dynamic_ext " in
24008 *) dflt="$dflt $xxx" ;;
24015 *) dflt="$static_ext"
24022 rp="What extensions do you wish to load statically?"
24025 none) static_ext=' ' ;;
24026 *) static_ext="$ans" ;;
24031 A number of extensions are supplied with $package. Answer "none"
24032 to include no extensions.
24033 Note that DynaLoader is always built and need not be mentioned here.
24036 case "$static_ext" in
24037 '') dflt="$avail_ext" ;;
24038 *) dflt="$static_ext"
24039 # Perhaps we are reusing an old out-of-date config.sh.
24042 if test X"$static_ext" != X"$avail_ext"; then
24044 NOTICE: Your previous config.sh list may be incorrect.
24045 The extensions now available to you are
24047 but the default list from your previous config.sh is
24056 : Exclude those that are not xs extensions
24060 rp="What extensions do you wish to include?"
24063 none) static_ext=' ' ;;
24064 *) static_ext="$ans" ;;
24069 # Encode is a special case. If we are building Encode as a static
24070 # extension, we need to explicitly list its subextensions as well.
24071 # For other nested extensions, this is handled automatically by
24072 # the appropriate Makefile.PL.
24073 case " $static_ext " in
24074 *" Encode "*) # Add the subextensions of Encode
24076 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24077 static_ext="$static_ext Encode/$xxx"
24078 known_extensions="$known_extensions Encode/$xxx"
24084 set X $dynamic_ext $static_ext $nonxs_ext
24088 # Sanity check: We require an extension suitable for use with
24089 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24090 # should show up as failures in the test suite, but it's helpful to
24091 # catch them now.) The 'extensions' list is normally sorted
24092 # alphabetically, so we need to accept either
24093 # DB_File ... Fcntl ... IO ....
24094 # or something like
24095 # Fcntl ... NDBM_File ... IO ....
24096 case " $extensions" in
24097 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24098 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24099 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24100 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24101 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24105 : Remove libraries needed only for extensions
24106 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24107 : The exception is SunOS 4.x, which needs them.
24108 case "${osname}X${osvers}" in
24112 *) case "$usedl" in
24113 $define|true|[yY]*)
24114 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24118 *) perllibs="$libs"
24124 : Remove build directory name from cppstdin so it can be used from
24125 : either the present location or the final installed location.
24127 : Get out of the UU directory to get correct path name.
24129 case "$cppstdin" in
24131 echo "Stripping down cppstdin path name"
24137 : end of configuration questions
24139 echo "End of configuration questions."
24142 : back to where it started
24143 if test -d ../UU; then
24147 : configuration may be unconditionally patched via a 'config.arch' file
24148 if $test -f config.arch; then
24149 echo "I see a config.arch file, loading it." >&4
24153 : configuration may be patched via a 'config.over' file
24154 if $test -f config.over; then
24157 rp='I see a config.over file. Do you wish to load it?'
24160 n*) echo "OK, I'll ignore it.";;
24162 echo "Configuration override changes have been loaded."
24167 : in case they want portability, strip down executable paths
24168 case "$d_portable" in
24171 echo "Stripping down executable paths..." >&4
24172 for file in $loclist $trylist; do
24174 eval $file=`basename $temp`
24179 : create config.sh file
24181 echo "Creating config.sh..." >&4
24182 $spitshell <<EOT >config.sh
24185 # This file was produced by running the Configure script. It holds all the
24186 # definitions figured out by Configure. Should you modify one of these values,
24187 # do not forget to propagate your changes by running "Configure -der". You may
24188 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24191 # Package name : $package
24192 # Source directory : $src
24193 # Configuration time: $cf_time
24194 # Configured by : $cf_by
24195 # Target system : $myuname
24198 : Add in command line options if available
24199 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24201 $spitshell <<EOT >>config.sh
24210 Revision='$Revision'
24218 alignbytes='$alignbytes'
24219 ansi2knr='$ansi2knr'
24220 aphostname='$aphostname'
24221 api_revision='$api_revision'
24222 api_subversion='$api_subversion'
24223 api_version='$api_version'
24224 api_versionstring='$api_versionstring'
24227 archlibexp='$archlibexp'
24228 archname64='$archname64'
24229 archname='$archname'
24230 archobjs='$archobjs'
24231 asctime_r_proto='$asctime_r_proto'
24240 byteorder='$byteorder'
24242 castflags='$castflags'
24245 cccdlflags='$cccdlflags'
24246 ccdlflags='$ccdlflags'
24248 ccflags_uselargefiles='$ccflags_uselargefiles'
24250 ccsymbols='$ccsymbols'
24251 ccversion='$ccversion'
24253 cf_email='$cf_email'
24255 charbits='$charbits'
24256 charsize='$charsize'
24260 clocktype='$clocktype'
24262 compress='$compress'
24263 contains='$contains'
24267 cpp_stuff='$cpp_stuff'
24268 cppccsymbols='$cppccsymbols'
24269 cppflags='$cppflags'
24271 cppminus='$cppminus'
24273 cppstdin='$cppstdin'
24274 cppsymbols='$cppsymbols'
24275 crypt_r_proto='$crypt_r_proto'
24276 cryptlib='$cryptlib'
24278 ctermid_r_proto='$ctermid_r_proto'
24279 ctime_r_proto='$ctime_r_proto'
24280 d_Gconvert='$d_Gconvert'
24281 d_PRIEUldbl='$d_PRIEUldbl'
24282 d_PRIFUldbl='$d_PRIFUldbl'
24283 d_PRIGUldbl='$d_PRIGUldbl'
24284 d_PRIXU64='$d_PRIXU64'
24285 d_PRId64='$d_PRId64'
24286 d_PRIeldbl='$d_PRIeldbl'
24287 d_PRIfldbl='$d_PRIfldbl'
24288 d_PRIgldbl='$d_PRIgldbl'
24289 d_PRIi64='$d_PRIi64'
24290 d_PRIo64='$d_PRIo64'
24291 d_PRIu64='$d_PRIu64'
24292 d_PRIx64='$d_PRIx64'
24293 d_SCNfldbl='$d_SCNfldbl'
24294 d__fwalk='$d__fwalk'
24295 d_access='$d_access'
24296 d_accessx='$d_accessx'
24300 d_archlib='$d_archlib'
24301 d_asctime64='$d_asctime64'
24302 d_asctime_r='$d_asctime_r'
24307 d_attribute_deprecated='$d_attribute_deprecated'
24308 d_attribute_format='$d_attribute_format'
24309 d_attribute_malloc='$d_attribute_malloc'
24310 d_attribute_nonnull='$d_attribute_nonnull'
24311 d_attribute_noreturn='$d_attribute_noreturn'
24312 d_attribute_pure='$d_attribute_pure'
24313 d_attribute_unused='$d_attribute_unused'
24314 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24315 d_backtrace='$d_backtrace'
24319 d_bsdgetpgrp='$d_bsdgetpgrp'
24320 d_bsdsetpgrp='$d_bsdsetpgrp'
24321 d_builtin_choose_expr='$d_builtin_choose_expr'
24322 d_builtin_expect='$d_builtin_expect'
24324 d_c99_variadic_macros='$d_c99_variadic_macros'
24325 d_casti32='$d_casti32'
24326 d_castneg='$d_castneg'
24328 d_charvspr='$d_charvspr'
24330 d_chroot='$d_chroot'
24331 d_chsize='$d_chsize'
24333 d_clearenv='$d_clearenv'
24334 d_closedir='$d_closedir'
24335 d_cmsghdr_s='$d_cmsghdr_s'
24337 d_copysign='$d_copysign'
24338 d_copysignl='$d_copysignl'
24339 d_cplusplus='$d_cplusplus'
24341 d_crypt_r='$d_crypt_r'
24343 d_ctermid='$d_ctermid'
24344 d_ctermid_r='$d_ctermid_r'
24345 d_ctime64='$d_ctime64'
24346 d_ctime_r='$d_ctime_r'
24347 d_cuserid='$d_cuserid'
24348 d_dbl_dig='$d_dbl_dig'
24349 d_dbminitproto='$d_dbminitproto'
24350 d_difftime64='$d_difftime64'
24351 d_difftime='$d_difftime'
24352 d_dir_dd_fd='$d_dir_dd_fd'
24354 d_dirnamlen='$d_dirnamlen'
24355 d_dladdr='$d_dladdr'
24356 d_dlerror='$d_dlerror'
24357 d_dlopen='$d_dlopen'
24358 d_dlsymun='$d_dlsymun'
24359 d_dosuid='$d_dosuid'
24360 d_drand48_r='$d_drand48_r'
24361 d_drand48proto='$d_drand48proto'
24363 d_duplocale='$d_duplocale'
24364 d_eaccess='$d_eaccess'
24365 d_endgrent='$d_endgrent'
24366 d_endgrent_r='$d_endgrent_r'
24367 d_endhent='$d_endhent'
24368 d_endhostent_r='$d_endhostent_r'
24369 d_endnent='$d_endnent'
24370 d_endnetent_r='$d_endnetent_r'
24371 d_endpent='$d_endpent'
24372 d_endprotoent_r='$d_endprotoent_r'
24373 d_endpwent='$d_endpwent'
24374 d_endpwent_r='$d_endpwent_r'
24375 d_endsent='$d_endsent'
24376 d_endservent_r='$d_endservent_r'
24377 d_eofnblk='$d_eofnblk'
24380 d_eunice='$d_eunice'
24383 d_faststdio='$d_faststdio'
24384 d_fchdir='$d_fchdir'
24385 d_fchmod='$d_fchmod'
24386 d_fchown='$d_fchown'
24388 d_fcntl_can_lock='$d_fcntl_can_lock'
24389 d_fd_macros='$d_fd_macros'
24390 d_fd_set='$d_fd_set'
24391 d_fdclose='$d_fdclose'
24393 d_fds_bits='$d_fds_bits'
24394 d_fegetround='$d_fegetround'
24395 d_fgetpos='$d_fgetpos'
24396 d_finite='$d_finite'
24397 d_finitel='$d_finitel'
24398 d_flexfnam='$d_flexfnam'
24400 d_flockproto='$d_flockproto'
24405 d_fp_class='$d_fp_class'
24406 d_fp_classify='$d_fp_classify'
24407 d_fp_classl='$d_fp_classl'
24408 d_fpathconf='$d_fpathconf'
24409 d_fpclass='$d_fpclass'
24410 d_fpclassify='$d_fpclassify'
24411 d_fpclassl='$d_fpclassl'
24412 d_fpgetround='$d_fpgetround'
24413 d_fpos64_t='$d_fpos64_t'
24414 d_freelocale='$d_freelocale'
24415 d_frexpl='$d_frexpl'
24416 d_fs_data_s='$d_fs_data_s'
24417 d_fseeko='$d_fseeko'
24418 d_fsetpos='$d_fsetpos'
24419 d_fstatfs='$d_fstatfs'
24420 d_fstatvfs='$d_fstatvfs'
24422 d_ftello='$d_ftello'
24424 d_futimes='$d_futimes'
24425 d_gai_strerror='$d_gai_strerror'
24426 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24427 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24428 d_getaddrinfo='$d_getaddrinfo'
24429 d_getcwd='$d_getcwd'
24430 d_getespwnam='$d_getespwnam'
24431 d_getfsstat='$d_getfsstat'
24432 d_getgrent='$d_getgrent'
24433 d_getgrent_r='$d_getgrent_r'
24434 d_getgrgid_r='$d_getgrgid_r'
24435 d_getgrnam_r='$d_getgrnam_r'
24436 d_getgrps='$d_getgrps'
24437 d_gethbyaddr='$d_gethbyaddr'
24438 d_gethbyname='$d_gethbyname'
24439 d_gethent='$d_gethent'
24440 d_gethname='$d_gethname'
24441 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24442 d_gethostbyname_r='$d_gethostbyname_r'
24443 d_gethostent_r='$d_gethostent_r'
24444 d_gethostprotos='$d_gethostprotos'
24445 d_getitimer='$d_getitimer'
24446 d_getlogin='$d_getlogin'
24447 d_getlogin_r='$d_getlogin_r'
24448 d_getmnt='$d_getmnt'
24449 d_getmntent='$d_getmntent'
24450 d_getnameinfo='$d_getnameinfo'
24451 d_getnbyaddr='$d_getnbyaddr'
24452 d_getnbyname='$d_getnbyname'
24453 d_getnent='$d_getnent'
24454 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24455 d_getnetbyname_r='$d_getnetbyname_r'
24456 d_getnetent_r='$d_getnetent_r'
24457 d_getnetprotos='$d_getnetprotos'
24458 d_getpagsz='$d_getpagsz'
24459 d_getpbyname='$d_getpbyname'
24460 d_getpbynumber='$d_getpbynumber'
24461 d_getpent='$d_getpent'
24462 d_getpgid='$d_getpgid'
24463 d_getpgrp2='$d_getpgrp2'
24464 d_getpgrp='$d_getpgrp'
24465 d_getppid='$d_getppid'
24466 d_getprior='$d_getprior'
24467 d_getprotobyname_r='$d_getprotobyname_r'
24468 d_getprotobynumber_r='$d_getprotobynumber_r'
24469 d_getprotoent_r='$d_getprotoent_r'
24470 d_getprotoprotos='$d_getprotoprotos'
24471 d_getprpwnam='$d_getprpwnam'
24472 d_getpwent='$d_getpwent'
24473 d_getpwent_r='$d_getpwent_r'
24474 d_getpwnam_r='$d_getpwnam_r'
24475 d_getpwuid_r='$d_getpwuid_r'
24476 d_getsbyname='$d_getsbyname'
24477 d_getsbyport='$d_getsbyport'
24478 d_getsent='$d_getsent'
24479 d_getservbyname_r='$d_getservbyname_r'
24480 d_getservbyport_r='$d_getservbyport_r'
24481 d_getservent_r='$d_getservent_r'
24482 d_getservprotos='$d_getservprotos'
24483 d_getspnam='$d_getspnam'
24484 d_getspnam_r='$d_getspnam_r'
24485 d_gettimeod='$d_gettimeod'
24486 d_gmtime64='$d_gmtime64'
24487 d_gmtime_r='$d_gmtime_r'
24488 d_gnulibc='$d_gnulibc'
24489 d_grpasswd='$d_grpasswd'
24490 d_hasmntopt='$d_hasmntopt'
24494 d_ilogbl='$d_ilogbl'
24495 d_inc_version_list='$d_inc_version_list'
24497 d_inetaton='$d_inetaton'
24498 d_inetntop='$d_inetntop'
24499 d_inetpton='$d_inetpton'
24500 d_int64_t='$d_int64_t'
24501 d_ip_mreq='$d_ip_mreq'
24502 d_ip_mreq_source='$d_ip_mreq_source'
24503 d_ipv6_mreq='$d_ipv6_mreq'
24504 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24505 d_isascii='$d_isascii'
24506 d_isblank='$d_isblank'
24507 d_isfinite='$d_isfinite'
24508 d_isfinitel='$d_isfinitel'
24510 d_isinfl='$d_isinfl'
24511 d_isless='$d_isless'
24513 d_isnanl='$d_isnanl'
24514 d_isnormal='$d_isnormal'
24517 d_killpg='$d_killpg'
24518 d_lc_monetary_2008='$d_lc_monetary_2008'
24519 d_lchown='$d_lchown'
24520 d_ldbl_dig='$d_ldbl_dig'
24521 d_ldexpl='$d_ldexpl'
24522 d_lgamma='$d_lgamma'
24523 d_lgamma_r='$d_lgamma_r'
24524 d_libm_lib_version='$d_libm_lib_version'
24525 d_libname_unique='$d_libname_unique'
24527 d_llrint='$d_llrint'
24528 d_llrintl='$d_llrintl'
24529 d_llround='$d_llround'
24530 d_llroundl='$d_llroundl'
24531 d_localtime64='$d_localtime64'
24532 d_localtime_r='$d_localtime_r'
24533 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24534 d_locconv='$d_locconv'
24539 d_longdbl='$d_longdbl'
24540 d_longlong='$d_longlong'
24542 d_lrintl='$d_lrintl'
24543 d_lround='$d_lround'
24544 d_lroundl='$d_lroundl'
24545 d_lseekproto='$d_lseekproto'
24547 d_madvise='$d_madvise'
24548 d_malloc_good_size='$d_malloc_good_size'
24549 d_malloc_size='$d_malloc_size'
24551 d_mbstowcs='$d_mbstowcs'
24552 d_mbtowc='$d_mbtowc'
24553 d_memchr='$d_memchr'
24554 d_memcmp='$d_memcmp'
24555 d_memcpy='$d_memcpy'
24556 d_memmem='$d_memmem'
24557 d_memmove='$d_memmove'
24558 d_memset='$d_memset'
24560 d_mkdtemp='$d_mkdtemp'
24561 d_mkfifo='$d_mkfifo'
24562 d_mkstemp='$d_mkstemp'
24563 d_mkstemps='$d_mkstemps'
24564 d_mktime64='$d_mktime64'
24565 d_mktime='$d_mktime'
24568 d_modflproto='$d_modflproto'
24569 d_mprotect='$d_mprotect'
24571 d_msg_ctrunc='$d_msg_ctrunc'
24572 d_msg_dontroute='$d_msg_dontroute'
24573 d_msg_oob='$d_msg_oob'
24574 d_msg_peek='$d_msg_peek'
24575 d_msg_proxy='$d_msg_proxy'
24576 d_msgctl='$d_msgctl'
24577 d_msgget='$d_msgget'
24578 d_msghdr_s='$d_msghdr_s'
24579 d_msgrcv='$d_msgrcv'
24580 d_msgsnd='$d_msgsnd'
24582 d_munmap='$d_munmap'
24583 d_mymalloc='$d_mymalloc'
24586 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24587 d_nearbyint='$d_nearbyint'
24588 d_newlocale='$d_newlocale'
24589 d_nextafter='$d_nextafter'
24590 d_nexttoward='$d_nexttoward'
24592 d_nl_langinfo='$d_nl_langinfo'
24593 d_nv_preserves_uv='$d_nv_preserves_uv'
24594 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24595 d_off64_t='$d_off64_t'
24596 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24597 d_oldpthreads='$d_oldpthreads'
24598 d_oldsock='$d_oldsock'
24600 d_pathconf='$d_pathconf'
24602 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24603 d_phostname='$d_phostname'
24606 d_portable='$d_portable'
24608 d_prctl_set_name='$d_prctl_set_name'
24609 d_printf_format_null='$d_printf_format_null'
24610 d_procselfexe='$d_procselfexe'
24611 d_pseudofork='$d_pseudofork'
24612 d_pthread_atfork='$d_pthread_atfork'
24613 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24614 d_pthread_yield='$d_pthread_yield'
24615 d_ptrdiff_t='$d_ptrdiff_t'
24617 d_pwchange='$d_pwchange'
24618 d_pwclass='$d_pwclass'
24619 d_pwcomment='$d_pwcomment'
24620 d_pwexpire='$d_pwexpire'
24621 d_pwgecos='$d_pwgecos'
24622 d_pwpasswd='$d_pwpasswd'
24623 d_pwquota='$d_pwquota'
24626 d_querylocale='$d_querylocale'
24627 d_random_r='$d_random_r'
24628 d_re_comp='$d_re_comp'
24629 d_readdir64_r='$d_readdir64_r'
24630 d_readdir='$d_readdir'
24631 d_readdir_r='$d_readdir_r'
24632 d_readlink='$d_readlink'
24634 d_recvmsg='$d_recvmsg'
24635 d_regcmp='$d_regcmp'
24636 d_regcomp='$d_regcomp'
24637 d_remainder='$d_remainder'
24638 d_remquo='$d_remquo'
24639 d_rename='$d_rename'
24640 d_rewinddir='$d_rewinddir'
24644 d_safebcpy='$d_safebcpy'
24645 d_safemcpy='$d_safemcpy'
24646 d_sanemcmp='$d_sanemcmp'
24647 d_sbrkproto='$d_sbrkproto'
24648 d_scalbn='$d_scalbn'
24649 d_scalbnl='$d_scalbnl'
24650 d_sched_yield='$d_sched_yield'
24651 d_scm_rights='$d_scm_rights'
24652 d_seekdir='$d_seekdir'
24653 d_select='$d_select'
24655 d_semctl='$d_semctl'
24656 d_semctl_semid_ds='$d_semctl_semid_ds'
24657 d_semctl_semun='$d_semctl_semun'
24658 d_semget='$d_semget'
24660 d_sendmsg='$d_sendmsg'
24661 d_setegid='$d_setegid'
24662 d_seteuid='$d_seteuid'
24663 d_setgrent='$d_setgrent'
24664 d_setgrent_r='$d_setgrent_r'
24665 d_setgrps='$d_setgrps'
24666 d_sethent='$d_sethent'
24667 d_sethostent_r='$d_sethostent_r'
24668 d_setitimer='$d_setitimer'
24669 d_setlinebuf='$d_setlinebuf'
24670 d_setlocale='$d_setlocale'
24671 d_setlocale_r='$d_setlocale_r'
24672 d_setnent='$d_setnent'
24673 d_setnetent_r='$d_setnetent_r'
24674 d_setpent='$d_setpent'
24675 d_setpgid='$d_setpgid'
24676 d_setpgrp2='$d_setpgrp2'
24677 d_setpgrp='$d_setpgrp'
24678 d_setprior='$d_setprior'
24679 d_setproctitle='$d_setproctitle'
24680 d_setprotoent_r='$d_setprotoent_r'
24681 d_setpwent='$d_setpwent'
24682 d_setpwent_r='$d_setpwent_r'
24683 d_setregid='$d_setregid'
24684 d_setresgid='$d_setresgid'
24685 d_setresuid='$d_setresuid'
24686 d_setreuid='$d_setreuid'
24687 d_setrgid='$d_setrgid'
24688 d_setruid='$d_setruid'
24689 d_setsent='$d_setsent'
24690 d_setservent_r='$d_setservent_r'
24691 d_setsid='$d_setsid'
24692 d_setvbuf='$d_setvbuf'
24695 d_shmatprototype='$d_shmatprototype'
24696 d_shmctl='$d_shmctl'
24698 d_shmget='$d_shmget'
24699 d_sigaction='$d_sigaction'
24700 d_siginfo_si_addr='$d_siginfo_si_addr'
24701 d_siginfo_si_band='$d_siginfo_si_band'
24702 d_siginfo_si_errno='$d_siginfo_si_errno'
24703 d_siginfo_si_fd='$d_siginfo_si_fd'
24704 d_siginfo_si_pid='$d_siginfo_si_pid'
24705 d_siginfo_si_status='$d_siginfo_si_status'
24706 d_siginfo_si_uid='$d_siginfo_si_uid'
24707 d_siginfo_si_value='$d_siginfo_si_value'
24708 d_signbit='$d_signbit'
24709 d_sigprocmask='$d_sigprocmask'
24710 d_sigsetjmp='$d_sigsetjmp'
24711 d_sin6_scope_id='$d_sin6_scope_id'
24712 d_sitearch='$d_sitearch'
24713 d_snprintf='$d_snprintf'
24714 d_sockaddr_in6='$d_sockaddr_in6'
24715 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24716 d_sockatmark='$d_sockatmark'
24717 d_sockatmarkproto='$d_sockatmarkproto'
24718 d_socket='$d_socket'
24719 d_socklen_t='$d_socklen_t'
24720 d_sockpair='$d_sockpair'
24721 d_socks5_init='$d_socks5_init'
24722 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24724 d_srand48_r='$d_srand48_r'
24725 d_srandom_r='$d_srandom_r'
24726 d_sresgproto='$d_sresgproto'
24727 d_sresuproto='$d_sresuproto'
24729 d_statblks='$d_statblks'
24730 d_statfs_f_flags='$d_statfs_f_flags'
24731 d_statfs_s='$d_statfs_s'
24732 d_static_inline='$d_static_inline'
24733 d_statvfs='$d_statvfs'
24734 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24735 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24736 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24737 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24738 d_stdio_stream_array='$d_stdio_stream_array'
24739 d_stdiobase='$d_stdiobase'
24740 d_stdstdio='$d_stdstdio'
24741 d_strchr='$d_strchr'
24742 d_strcoll='$d_strcoll'
24743 d_strctcpy='$d_strctcpy'
24744 d_strerrm='$d_strerrm'
24745 d_strerror='$d_strerror'
24746 d_strerror_l='$d_strerror_l'
24747 d_strerror_r='$d_strerror_r'
24748 d_strftime='$d_strftime'
24749 d_strlcat='$d_strlcat'
24750 d_strlcpy='$d_strlcpy'
24751 d_strtod='$d_strtod'
24752 d_strtol='$d_strtol'
24753 d_strtold='$d_strtold'
24754 d_strtoll='$d_strtoll'
24755 d_strtoq='$d_strtoq'
24756 d_strtoul='$d_strtoul'
24757 d_strtoull='$d_strtoull'
24758 d_strtouq='$d_strtouq'
24759 d_strxfrm='$d_strxfrm'
24760 d_suidsafe='$d_suidsafe'
24761 d_symlink='$d_symlink'
24762 d_syscall='$d_syscall'
24763 d_syscallproto='$d_syscallproto'
24764 d_sysconf='$d_sysconf'
24765 d_sysernlst='$d_sysernlst'
24766 d_syserrlst='$d_syserrlst'
24767 d_system='$d_system'
24768 d_tcgetpgrp='$d_tcgetpgrp'
24769 d_tcsetpgrp='$d_tcsetpgrp'
24770 d_telldir='$d_telldir'
24771 d_telldirproto='$d_telldirproto'
24772 d_tgamma='$d_tgamma'
24774 d_timegm='$d_timegm'
24776 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24777 d_tm_tm_zone='$d_tm_tm_zone'
24778 d_tmpnam_r='$d_tmpnam_r'
24780 d_truncate='$d_truncate'
24781 d_truncl='$d_truncl'
24782 d_ttyname_r='$d_ttyname_r'
24783 d_tzname='$d_tzname'
24784 d_u32align='$d_u32align'
24785 d_ualarm='$d_ualarm'
24788 d_union_semun='$d_union_semun'
24789 d_unordered='$d_unordered'
24790 d_unsetenv='$d_unsetenv'
24791 d_uselocale='$d_uselocale'
24792 d_usleep='$d_usleep'
24793 d_usleepproto='$d_usleepproto'
24795 d_vendorarch='$d_vendorarch'
24796 d_vendorbin='$d_vendorbin'
24797 d_vendorlib='$d_vendorlib'
24798 d_vendorscript='$d_vendorscript'
24800 d_void_closedir='$d_void_closedir'
24801 d_voidsig='$d_voidsig'
24802 d_voidtty='$d_voidtty'
24803 d_volatile='$d_volatile'
24804 d_vprintf='$d_vprintf'
24805 d_vsnprintf='$d_vsnprintf'
24807 d_waitpid='$d_waitpid'
24808 d_wcscmp='$d_wcscmp'
24809 d_wcstombs='$d_wcstombs'
24810 d_wcsxfrm='$d_wcsxfrm'
24811 d_wctomb='$d_wctomb'
24812 d_writev='$d_writev'
24815 db_hashtype='$db_hashtype'
24816 db_prefixtype='$db_prefixtype'
24817 db_version_major='$db_version_major'
24818 db_version_minor='$db_version_minor'
24819 db_version_patch='$db_version_patch'
24820 direntrytype='$direntrytype'
24823 doubleinfbytes='$doubleinfbytes'
24824 doublekind='$doublekind'
24825 doublemantbits='$doublemantbits'
24826 doublenanbytes='$doublenanbytes'
24827 doublesize='$doublesize'
24829 drand48_r_proto='$drand48_r_proto'
24831 dtraceobject='$dtraceobject'
24832 dynamic_ext='$dynamic_ext'
24838 endgrent_r_proto='$endgrent_r_proto'
24839 endhostent_r_proto='$endhostent_r_proto'
24840 endnetent_r_proto='$endnetent_r_proto'
24841 endprotoent_r_proto='$endprotoent_r_proto'
24842 endpwent_r_proto='$endpwent_r_proto'
24843 endservent_r_proto='$endservent_r_proto'
24844 eunicefix='$eunicefix'
24847 extensions='$extensions'
24848 extern_C='$extern_C'
24850 fflushNULL='$fflushNULL'
24851 fflushall='$fflushall'
24853 firstmakefile='$firstmakefile'
24855 fpossize='$fpossize'
24856 fpostype='$fpostype'
24857 freetype='$freetype'
24860 full_csh='$full_csh'
24861 full_sed='$full_sed'
24862 gccansipedantic='$gccansipedantic'
24863 gccosandvers='$gccosandvers'
24864 gccversion='$gccversion'
24865 getgrent_r_proto='$getgrent_r_proto'
24866 getgrgid_r_proto='$getgrgid_r_proto'
24867 getgrnam_r_proto='$getgrnam_r_proto'
24868 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24869 gethostbyname_r_proto='$gethostbyname_r_proto'
24870 gethostent_r_proto='$gethostent_r_proto'
24871 getlogin_r_proto='$getlogin_r_proto'
24872 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24873 getnetbyname_r_proto='$getnetbyname_r_proto'
24874 getnetent_r_proto='$getnetent_r_proto'
24875 getprotobyname_r_proto='$getprotobyname_r_proto'
24876 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24877 getprotoent_r_proto='$getprotoent_r_proto'
24878 getpwent_r_proto='$getpwent_r_proto'
24879 getpwnam_r_proto='$getpwnam_r_proto'
24880 getpwuid_r_proto='$getpwuid_r_proto'
24881 getservbyname_r_proto='$getservbyname_r_proto'
24882 getservbyport_r_proto='$getservbyport_r_proto'
24883 getservent_r_proto='$getservent_r_proto'
24884 getspnam_r_proto='$getspnam_r_proto'
24885 gidformat='$gidformat'
24891 gmtime_r_proto='$gmtime_r_proto'
24892 gnulibc_version='$gnulibc_version'
24894 groupcat='$groupcat'
24895 groupstype='$groupstype'
24898 h_sysfile='$h_sysfile'
24901 hostgenerate='$hostgenerate'
24902 hostosname='$hostosname'
24903 hostperl='$hostperl'
24904 html1dir='$html1dir'
24905 html1direxp='$html1direxp'
24906 html3dir='$html3dir'
24907 html3direxp='$html3direxp'
24916 i_arpainet='$i_arpainet'
24917 i_assert='$i_assert'
24919 i_bsdioctl='$i_bsdioctl'
24923 i_dirent='$i_dirent'
24925 i_execinfo='$i_execinfo'
24930 i_fp_class='$i_fp_class'
24932 i_gdbm_ndbm='$i_gdbm_ndbm'
24933 i_gdbmndbm='$i_gdbmndbm'
24935 i_ieeefp='$i_ieeefp'
24936 i_inttypes='$i_inttypes'
24937 i_langinfo='$i_langinfo'
24938 i_libutil='$i_libutil'
24939 i_limits='$i_limits'
24940 i_locale='$i_locale'
24941 i_machcthr='$i_machcthr'
24942 i_malloc='$i_malloc'
24943 i_mallocmalloc='$i_mallocmalloc'
24945 i_memory='$i_memory'
24946 i_mntent='$i_mntent'
24949 i_neterrno='$i_neterrno'
24950 i_netinettcp='$i_netinettcp'
24954 i_pthread='$i_pthread'
24956 i_quadmath='$i_quadmath'
24957 i_rpcsvcdbm='$i_rpcsvcdbm'
24959 i_shadow='$i_shadow'
24961 i_stdarg='$i_stdarg'
24962 i_stdbool='$i_stdbool'
24963 i_stddef='$i_stddef'
24964 i_stdint='$i_stdint'
24965 i_stdlib='$i_stdlib'
24966 i_string='$i_string'
24967 i_sunmath='$i_sunmath'
24968 i_sysaccess='$i_sysaccess'
24969 i_sysdir='$i_sysdir'
24970 i_sysfile='$i_sysfile'
24971 i_sysfilio='$i_sysfilio'
24973 i_sysioctl='$i_sysioctl'
24974 i_syslog='$i_syslog'
24975 i_sysmman='$i_sysmman'
24976 i_sysmode='$i_sysmode'
24977 i_sysmount='$i_sysmount'
24978 i_sysndir='$i_sysndir'
24979 i_sysparam='$i_sysparam'
24980 i_syspoll='$i_syspoll'
24981 i_sysresrc='$i_sysresrc'
24982 i_syssecrt='$i_syssecrt'
24983 i_sysselct='$i_sysselct'
24984 i_syssockio='$i_syssockio'
24985 i_sysstat='$i_sysstat'
24986 i_sysstatfs='$i_sysstatfs'
24987 i_sysstatvfs='$i_sysstatvfs'
24988 i_systime='$i_systime'
24989 i_systimek='$i_systimek'
24990 i_systimes='$i_systimes'
24991 i_systypes='$i_systypes'
24992 i_sysuio='$i_sysuio'
24994 i_sysutsname='$i_sysutsname'
24995 i_sysvfs='$i_sysvfs'
24996 i_syswait='$i_syswait'
24997 i_termio='$i_termio'
24998 i_termios='$i_termios'
25000 i_unistd='$i_unistd'
25003 i_values='$i_values'
25004 i_varargs='$i_varargs'
25005 i_varhdr='$i_varhdr'
25007 i_xlocale='$i_xlocale'
25008 ignore_versioned_solibs='$ignore_versioned_solibs'
25009 inc_version_list='$inc_version_list'
25010 inc_version_list_init='$inc_version_list_init'
25014 initialinstalllocation='$initialinstalllocation'
25015 installarchlib='$installarchlib'
25016 installbin='$installbin'
25017 installhtml1dir='$installhtml1dir'
25018 installhtml3dir='$installhtml3dir'
25019 installman1dir='$installman1dir'
25020 installman3dir='$installman3dir'
25021 installprefix='$installprefix'
25022 installprefixexp='$installprefixexp'
25023 installprivlib='$installprivlib'
25024 installscript='$installscript'
25025 installsitearch='$installsitearch'
25026 installsitebin='$installsitebin'
25027 installsitehtml1dir='$installsitehtml1dir'
25028 installsitehtml3dir='$installsitehtml3dir'
25029 installsitelib='$installsitelib'
25030 installsiteman1dir='$installsiteman1dir'
25031 installsiteman3dir='$installsiteman3dir'
25032 installsitescript='$installsitescript'
25033 installstyle='$installstyle'
25034 installusrbinperl='$installusrbinperl'
25035 installvendorarch='$installvendorarch'
25036 installvendorbin='$installvendorbin'
25037 installvendorhtml1dir='$installvendorhtml1dir'
25038 installvendorhtml3dir='$installvendorhtml3dir'
25039 installvendorlib='$installvendorlib'
25040 installvendorman1dir='$installvendorman1dir'
25041 installvendorman3dir='$installvendorman3dir'
25042 installvendorscript='$installvendorscript'
25044 issymlink='$issymlink'
25045 ivdformat='$ivdformat'
25048 known_extensions='$known_extensions'
25051 ld_can_script='$ld_can_script'
25052 lddlflags='$lddlflags'
25054 ldflags_uselargefiles='$ldflags_uselargefiles'
25055 ldlibpthname='$ldlibpthname'
25062 libsdirs='$libsdirs'
25063 libsfiles='$libsfiles'
25064 libsfound='$libsfound'
25065 libspath='$libspath'
25066 libswanted='$libswanted'
25067 libswanted_uselargefiles='$libswanted_uselargefiles'
25073 localtime_r_proto='$localtime_r_proto'
25074 locincpth='$locincpth'
25075 loclibpth='$loclibpth'
25076 longdblinfbytes='$longdblinfbytes'
25077 longdblkind='$longdblkind'
25078 longdblmantbits='$longdblmantbits'
25079 longdblnanbytes='$longdblnanbytes'
25080 longdblsize='$longdblsize'
25081 longlongsize='$longlongsize'
25082 longsize='$longsize'
25086 lseeksize='$lseeksize'
25087 lseektype='$lseektype'
25091 make_set_make='$make_set_make'
25092 mallocobj='$mallocobj'
25093 mallocsrc='$mallocsrc'
25094 malloctype='$malloctype'
25096 man1direxp='$man1direxp'
25099 man3direxp='$man3direxp'
25101 mips_type='$mips_type'
25102 mistrustnm='$mistrustnm'
25104 mmaptype='$mmaptype'
25105 modetype='$modetype'
25107 multiarch='$multiarch'
25109 myarchname='$myarchname'
25110 mydomain='$mydomain'
25111 myhostname='$myhostname'
25114 need_va_copy='$need_va_copy'
25115 netdb_hlen_type='$netdb_hlen_type'
25116 netdb_host_type='$netdb_host_type'
25117 netdb_name_type='$netdb_name_type'
25118 netdb_net_type='$netdb_net_type'
25121 nm_so_opt='$nm_so_opt'
25122 nonxs_ext='$nonxs_ext'
25124 nvEUformat='$nvEUformat'
25125 nvFUformat='$nvFUformat'
25126 nvGUformat='$nvGUformat'
25127 nv_overflows_integers_at='$nv_overflows_integers_at'
25128 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25129 nveformat='$nveformat'
25130 nvfformat='$nvfformat'
25131 nvgformat='$nvgformat'
25132 nvmantbits='$nvmantbits'
25135 o_nonblock='$o_nonblock'
25137 old_pthread_create_joinable='$old_pthread_create_joinable'
25138 optimize='$optimize'
25139 orderlib='$orderlib'
25142 otherlibdirs='$otherlibdirs'
25146 patchlevel='$patchlevel'
25147 path_sep='$path_sep'
25150 perl_patchlevel='$perl_patchlevel'
25151 perl_static_inline='$perl_static_inline'
25152 perladmin='$perladmin'
25153 perllibs='$perllibs'
25154 perlpath='$perlpath'
25156 phostname='$phostname'
25162 prefixexp='$prefixexp'
25164 privlibexp='$privlibexp'
25165 procselfexe='$procselfexe'
25166 prototype='$prototype'
25168 quadkind='$quadkind'
25169 quadtype='$quadtype'
25170 randbits='$randbits'
25171 randfunc='$randfunc'
25172 random_r_proto='$random_r_proto'
25173 randseedtype='$randseedtype'
25175 rd_nodata='$rd_nodata'
25176 readdir64_r_proto='$readdir64_r_proto'
25177 readdir_r_proto='$readdir_r_proto'
25178 revision='$revision'
25184 sGMTIME_max='$sGMTIME_max'
25185 sGMTIME_min='$sGMTIME_min'
25186 sLOCALTIME_max='$sLOCALTIME_max'
25187 sLOCALTIME_min='$sLOCALTIME_min'
25188 sPRIEUldbl='$sPRIEUldbl'
25189 sPRIFUldbl='$sPRIFUldbl'
25190 sPRIGUldbl='$sPRIGUldbl'
25191 sPRIXU64='$sPRIXU64'
25193 sPRIeldbl='$sPRIeldbl'
25194 sPRIfldbl='$sPRIfldbl'
25195 sPRIgldbl='$sPRIgldbl'
25200 sSCNfldbl='$sSCNfldbl'
25201 sched_yield='$sched_yield'
25202 scriptdir='$scriptdir'
25203 scriptdirexp='$scriptdirexp'
25205 seedfunc='$seedfunc'
25206 selectminbits='$selectminbits'
25207 selecttype='$selecttype'
25208 sendmail='$sendmail'
25209 setgrent_r_proto='$setgrent_r_proto'
25210 sethostent_r_proto='$sethostent_r_proto'
25211 setlocale_r_proto='$setlocale_r_proto'
25212 setnetent_r_proto='$setnetent_r_proto'
25213 setprotoent_r_proto='$setprotoent_r_proto'
25214 setpwent_r_proto='$setpwent_r_proto'
25215 setservent_r_proto='$setservent_r_proto'
25218 sharpbang='$sharpbang'
25219 shmattype='$shmattype'
25220 shortsize='$shortsize'
25223 sig_count='$sig_count'
25224 sig_name='$sig_name'
25225 sig_name_init='$sig_name_init'
25227 sig_num_init='$sig_num_init'
25228 sig_size='$sig_size'
25229 signal_t='$signal_t'
25230 sitearch='$sitearch'
25231 sitearchexp='$sitearchexp'
25233 sitebinexp='$sitebinexp'
25234 sitehtml1dir='$sitehtml1dir'
25235 sitehtml1direxp='$sitehtml1direxp'
25236 sitehtml3dir='$sitehtml3dir'
25237 sitehtml3direxp='$sitehtml3direxp'
25239 sitelib_stem='$sitelib_stem'
25240 sitelibexp='$sitelibexp'
25241 siteman1dir='$siteman1dir'
25242 siteman1direxp='$siteman1direxp'
25243 siteman3dir='$siteman3dir'
25244 siteman3direxp='$siteman3direxp'
25245 siteprefix='$siteprefix'
25246 siteprefixexp='$siteprefixexp'
25247 sitescript='$sitescript'
25248 sitescriptexp='$sitescriptexp'
25249 sizesize='$sizesize'
25250 sizetype='$sizetype'
25254 sockethdr='$sockethdr'
25255 socketlib='$socketlib'
25256 socksizetype='$socksizetype'
25258 spackage='$spackage'
25259 spitshell='$spitshell'
25260 srand48_r_proto='$srand48_r_proto'
25261 srandom_r_proto='$srandom_r_proto'
25263 ssizetype='$ssizetype'
25264 st_ino_sign='$st_ino_sign'
25265 st_ino_size='$st_ino_size'
25266 startperl='$startperl'
25268 static_ext='$static_ext'
25270 stdio_base='$stdio_base'
25271 stdio_bufsiz='$stdio_bufsiz'
25272 stdio_cnt='$stdio_cnt'
25273 stdio_filbuf='$stdio_filbuf'
25274 stdio_ptr='$stdio_ptr'
25275 stdio_stream_array='$stdio_stream_array'
25276 strerror_r_proto='$strerror_r_proto'
25279 subversion='$subversion'
25284 targetarch='$targetarch'
25285 targetdir='$targetdir'
25286 targetenv='$targetenv'
25287 targethost='$targethost'
25288 targetmkdir='$targetmkdir'
25289 targetport='$targetport'
25290 targetsh='$targetsh'
25294 timeincl='$timeincl'
25295 timetype='$timetype'
25296 tmpnam_r_proto='$tmpnam_r_proto'
25302 ttyname_r_proto='$ttyname_r_proto'
25311 uidformat='$uidformat'
25317 uquadtype='$uquadtype'
25318 use5005threads='$use5005threads'
25319 use64bitall='$use64bitall'
25320 use64bitint='$use64bitint'
25321 usecbacktrace='$usecbacktrace'
25322 usecrosscompile='$usecrosscompile'
25323 usedevel='$usedevel'
25325 usedtrace='$usedtrace'
25326 usefaststdio='$usefaststdio'
25327 useithreads='$useithreads'
25328 usekernprocpathname='$usekernprocpathname'
25329 uselargefiles='$uselargefiles'
25330 uselongdouble='$uselongdouble'
25331 usemallocwrap='$usemallocwrap'
25332 usemorebits='$usemorebits'
25333 usemultiplicity='$usemultiplicity'
25334 usemymalloc='$usemymalloc'
25336 usensgetexecutablepath='$usensgetexecutablepath'
25337 useopcode='$useopcode'
25338 useperlio='$useperlio'
25339 useposix='$useposix'
25340 usequadmath='$usequadmath'
25341 usereentrant='$usereentrant'
25342 userelocatableinc='$userelocatableinc'
25343 useshrplib='$useshrplib'
25344 usesitecustomize='$usesitecustomize'
25345 usesocks='$usesocks'
25346 usethreads='$usethreads'
25347 usevendorprefix='$usevendorprefix'
25348 useversionedarchname='$useversionedarchname'
25349 usevfork='$usevfork'
25352 uvXUformat='$uvXUformat'
25353 uvoformat='$uvoformat'
25356 uvuformat='$uvuformat'
25357 uvxformat='$uvxformat'
25359 vendorarch='$vendorarch'
25360 vendorarchexp='$vendorarchexp'
25361 vendorbin='$vendorbin'
25362 vendorbinexp='$vendorbinexp'
25363 vendorhtml1dir='$vendorhtml1dir'
25364 vendorhtml1direxp='$vendorhtml1direxp'
25365 vendorhtml3dir='$vendorhtml3dir'
25366 vendorhtml3direxp='$vendorhtml3direxp'
25367 vendorlib='$vendorlib'
25368 vendorlib_stem='$vendorlib_stem'
25369 vendorlibexp='$vendorlibexp'
25370 vendorman1dir='$vendorman1dir'
25371 vendorman1direxp='$vendorman1direxp'
25372 vendorman3dir='$vendorman3dir'
25373 vendorman3direxp='$vendorman3direxp'
25374 vendorprefix='$vendorprefix'
25375 vendorprefixexp='$vendorprefixexp'
25376 vendorscript='$vendorscript'
25377 vendorscriptexp='$vendorscriptexp'
25379 version_patchlevel_string='$version_patchlevel_string'
25380 versiononly='$versiononly'
25384 yaccflags='$yaccflags'
25389 : add special variables
25390 $test -f $src/patchlevel.h && \
25391 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25392 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25393 echo "PERL_CONFIG_SH=true" >>config.sh
25395 : propagate old symbols
25396 if $test -f UU/config.sh; then
25397 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25398 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25399 config.sh config.sh UU/oldconfig.sh |\
25400 $sort | $uniq -u >UU/oldsyms
25401 set X `$cat UU/oldsyms`
25407 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25409 echo ": Variables propagated from previous config.sh file." >>config.sh
25410 for sym in `$cat UU/oldsyms`; do
25411 echo " Propagating $hint variable "'$'"$sym..."
25412 eval 'tmp="$'"${sym}"'"'
25414 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25420 : preserve RCS keywords in files with variable substitution, grrr
25423 : Finish up by extracting the .SH files
25426 echo "Stopping at your request, leaving temporary files around."
25436 If you'd like to make any changes to the config.sh file before I begin
25437 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25440 rp="Press return or use a shell escape to edit config.sh:"
25445 *) : in case they cannot read
25446 sh 1>&4 -c "$ans";;
25451 : if this fails, just run all the .SH files by hand
25460 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25467 Now you need to generate make dependencies by running "$make depend".
25468 You might prefer to run it in background: "$make depend > makedepend.out &"
25469 It can take a while, so you might not want to run it right now.
25474 rp="Run $make depend now?"
25478 $make depend && echo "Now you must run '$make'."
25481 echo "You must run '$make depend' then '$make'."
25484 elif test -f [Mm]akefile; then
25486 echo "Now you must run a $make."
25488 echo "Configure done."
25491 if $test -f Policy.sh; then
25494 If you compile $package on a different machine or from a different object
25495 directory, copy the Policy.sh file from this object directory to the
25496 new one before you run Configure -- this will help you with most of
25497 the policy defaults.
25501 if $test -f UU/config.msg; then
25502 echo "Hmm. I also noted the following information while running:"
25504 $cat UU/config.msg >&4
25506 $rm -f kit*isdone ark*isdone