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=''
530 gethostbyaddr_r_proto=''
532 gethostbyname_r_proto=''
534 gethostent_r_proto=''
547 getnetbyaddr_r_proto=''
549 getnetbyname_r_proto=''
563 d_getprotobyname_r=''
564 getprotobyname_r_proto=''
565 d_getprotobynumber_r=''
566 getprotobynumber_r_proto=''
568 getprotoent_r_proto=''
580 getservbyname_r_proto=''
582 getservbyport_r_proto=''
584 getservent_r_proto=''
617 d_lc_monetary_2008=''
622 d_libm_lib_version=''
629 d_localtime_r_needs_tzset=''
649 d_malloc_good_size=''
702 d_old_pthread_create_joinable=''
703 old_pthread_create_joinable=''
705 d_pthread_attr_setscope=''
753 sethostent_r_proto=''
770 setprotoent_r_proto=''
782 setservent_r_proto=''
795 d_siginfo_si_errno=''
798 d_siginfo_si_status=''
800 d_siginfo_si_value=''
812 d_ipv6_mreq_source=''
829 d_sprintf_returns_strlen=''
842 perl_static_inline=''
847 d_stdio_ptr_lval_nochange_cnt=''
848 d_stdio_ptr_lval_sets_cnt=''
1001 d_gdbm_ndbm_h_uses_prototypes=''
1002 d_gdbmndbm_h_uses_prototypes=''
1004 d_ndbm_h_uses_prototypes=''
1080 d_inc_version_list=''
1082 inc_version_list_init=''
1090 installusrbinperl=''
1106 ignore_versioned_solibs=''
1170 d_perl_otherlibdirs=''
1178 api_versionstring=''
1184 version_patchlevel_string=''
1188 d_nv_preserves_uv=''
1189 d_nv_zero_is_allbits_zero=''
1200 nv_overflows_integers_at=''
1201 nv_preserves_uv_bits=''
1274 installsitehtml1dir=''
1277 installsitehtml3dir=''
1284 installsiteman1dir=''
1287 installsiteman3dir=''
1292 installsitescript=''
1310 d_stdio_stream_array=''
1311 stdio_stream_array=''
1329 usekernprocpathname=''
1330 ccflags_uselargefiles=''
1331 ldflags_uselargefiles=''
1332 libswanted_uselargefiles=''
1341 usensgetexecutablepath=''
1355 installvendorarch=''
1362 installvendorhtml1dir=''
1364 vendorhtml1direxp=''
1365 installvendorhtml3dir=''
1367 vendorhtml3direxp=''
1373 installvendorman1dir=''
1376 installvendorman3dir=''
1383 installvendorscript=''
1394 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1397 : We must find out about Eunice early
1399 if test -f /etc/unixtovms; then
1400 eunicefix=/etc/unixtovms
1402 if test -f /etc/unixtovms.exe; then
1403 eunicefix=/etc/unixtovms.exe
1406 : Set executable suffix now -- needed before hints available
1407 if test -f "/libs/version.library"; then
1410 elif test -f "/system/gnu_library/bin/ar.pm"; then
1413 elif test -n "$DJGPP"; then
1416 elif test -f /kern/cookiejar; then
1419 elif test -d c:/. -o -n "$is_os2" ; then
1426 : Possible local include directories to search.
1427 : Set locincpth to "" in a hint file to defeat local include searches.
1428 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1429 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1431 : no include file wanted by default
1434 : Enable -DEBUGGING and -DDEBUGGING from the command line
1438 : Trailing extension. Override this in a hint file, if needed.
1439 : Extra object files, if any, needed on this platform.
1442 : change the next line if compiling for Xenix/286 on Xenix/386
1443 xlibpth='/usr/lib/386 /lib/386'
1444 : Possible local library directories to search.
1445 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1446 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1448 : general looking path for locating libraries
1449 glibpth="/lib /usr/lib $xlibpth"
1450 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1451 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1452 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1453 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1455 : Private path used by Configure to find libraries. Its value
1456 : is prepended to libpth. This variable takes care of special
1457 : machines, like the mips. Usually, it should be empty.
1460 : default library list
1462 : some systems want to use only the non-versioned libso:s
1463 ignore_versioned_solibs=''
1467 : set useposix=false in your hint file to disable the POSIX extension.
1469 : set useopcode=false in your hint file to disable the Opcode extension.
1472 ccflags_uselargefiles=''
1473 ldflags_uselargefiles=''
1474 libswanted_uselargefiles=''
1475 : set usemultiplicity on the Configure command line to enable multiplicity.
1476 : set usesocks on the Configure command line to enable socks.
1478 : set usethreads on the Configure command line to enable threads.
1479 usereentrant='undef'
1480 : List of libraries we want.
1481 : If anyone needs extra -lxxx, put those in a hint file.
1482 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1483 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1484 : We probably want to search /usr/shlib before most other libraries.
1485 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1486 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1487 glibpth="/usr/shlib $glibpth"
1488 : Do not use vfork unless overridden by a hint file.
1491 : Find the basic shell for Bourne shell scripts
1495 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1498 if test -f "$xxx"; then
1501 : Build up a list and do a single loop so we can 'break' out.
1502 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1503 for xxx in sh bash ksh pdksh ash; do
1505 try="$try ${p}/${xxx}"
1509 if test -f "$xxx"; then
1512 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1515 elif test -f "$xxx.exe"; then
1526 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1528 Usually it's in /bin/sh. How did you even get this far?
1529 Please contact me (Perl Maintainers) at perlbug@perl.org and
1530 we'll try to straighten this all out.
1536 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1537 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1540 : see if sh knows # comments
1541 if `$sh -c '#' >/dev/null 2>&1`; then
1545 test -f $xcat$_exe || xcat=/usr/bin/cat
1546 if test ! -f $xcat$_exe; then
1547 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1548 if test -f $p/cat$_exe; then
1553 if test ! -f $xcat$_exe; then
1554 echo "Can't find cat anywhere!"
1558 echo "#!$xcat" >sharp
1561 ./sharp > today 2>/dev/null
1562 if test -s today; then
1565 echo "#! $xcat" > sharp
1568 ./sharp > today 2>/dev/null
1569 if test -s today; then
1577 echo "Your $sh doesn't grok # comments--I will strip them later on."
1580 echo "exec grep -v '^[ ]*#'" >spitshell
1582 $eunicefix spitshell
1583 spitshell=`pwd`/spitshell
1585 echo "I presume that if # doesn't work, #! won't work either!"
1590 : figure out how to guarantee sh startup
1592 '') startsh=${sharpbang}${sh} ;;
1604 : echo "Yup, it does."
1606 echo "Hmm... '$startsh' does not guarantee sh startup..."
1607 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1611 : Save command line options in file UU/cmdline.opt for later use in
1612 : generating config.sh.
1613 cat > cmdline.opt <<EOSH
1614 : Configure command line arguments.
1623 cat >>cmdline.opt <<EOSH
1624 config_arg$argn='$arg'
1626 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1629 arg_exp=`cat cmdl.opt`
1630 args_exp="$args_exp$args_sep'$arg_exp'"
1631 argn=`expr $argn + 1`
1636 : produce awk script to parse command line options
1637 cat >options.awk <<'EOF'
1639 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1641 len = length(optstr);
1642 for (i = 1; i <= len; i++) {
1643 c = substr(optstr, i, 1);
1644 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1655 if (substr(str, 1, 1) != "-") {
1656 printf("'%s'\n", str);
1660 for (i = 2; i <= len; i++) {
1661 c = substr(str, i, 1);
1663 printf("-%s\n", substr(str, i));
1669 printf("'%s'\n", substr(str, i + 1));
1682 : process the command line options
1683 set X `for arg in "$@"; do echo "X$arg"; done |
1684 sed -e s/X// | awk -f options.awk`
1689 : set up default values
1698 rm -f optdef.sh posthint.sh
1699 cat >optdef.sh <<EOS
1705 while test $# -gt 0; do
1707 -d) shift; fastread=yes;;
1708 -e) shift; alldone=cont;;
1712 if test -r "$1"; then
1715 echo "$me: cannot read config file $1." >&2
1721 -h) shift; error=true;;
1722 -r) shift; reuseval=true;;
1723 -s) shift; silent=true; realsilent=true;;
1724 -E) shift; alldone=exit;;
1725 -K) shift; knowitall=true;;
1727 -S) shift; silent=true; extractsh=true;;
1732 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1733 echo "$me: ignoring -D $1" >&2
1736 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1737 *) echo "$1='define'" >> optdef.sh;;
1744 *=) echo "$1" >> optdef.sh;;
1746 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1747 echo "$me: ignoring -U $1" >&2
1749 *) echo "$1='undef'" >> optdef.sh;;
1760 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1764 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1765 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1771 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1772 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1773 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1774 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1775 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1776 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1782 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1784 echo "$yyy=''" >> posthint.sh ;;
1789 echo "$yyy='$zzz'" >> posthint.sh ;;
1791 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1793 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1798 echo "$yyy=$zzz" >> posthint.sh ;;
1799 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1803 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1806 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1814 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1815 [-U symbol] [-U symbol=] [-A command:symbol...]
1816 -d : use defaults for all answers.
1817 -e : go on without questioning past the production of config.sh.
1818 -f : specify an alternate default configuration file.
1819 -h : print this help message and exit (with an error status).
1820 -r : reuse C symbols value if possible (skips costly nm extraction).
1821 -s : silent mode, only echoes questions and essential information.
1822 -D : define symbol to have some value:
1823 -D symbol symbol gets the value 'define'
1824 -D symbol=value symbol gets the value 'value'
1825 common used examples (see INSTALL for more info):
1826 -Duse64bitint use 64bit integers
1827 -Duse64bitall use 64bit integers and pointers
1828 -Dusethreads use thread support
1829 -Dinc_version_list=none do not include older perl trees in @INC
1830 -DEBUGGING=none DEBUGGING options
1831 -Dcc=gcc choose your compiler
1832 -Dprefix=/opt/perl5 choose your destination
1833 -E : stop at the end of questions, after having produced config.sh.
1834 -K : do not use unless you know what you are doing.
1835 -O : ignored for backward compatibility
1836 -S : perform variable substitutions on all .SH files (can mix with -f)
1837 -U : undefine symbol:
1838 -U symbol symbol gets the value 'undef'
1839 -U symbol= symbol gets completely empty
1841 -A : manipulate symbol after the platform specific hints have been applied:
1842 -A append:symbol=value append value to symbol
1843 -A symbol=value like append:, but with a separating space
1844 -A define:symbol=value define symbol to have value
1845 -A clear:symbol define symbol to be ''
1846 -A define:symbol define symbol to be 'define'
1847 -A eval:symbol=value define symbol to be eval of value
1848 -A prepend:symbol=value prepend value to symbol
1849 -A undef:symbol define symbol to be 'undef'
1850 -A undef:symbol= define symbol to be ''
1851 e.g.: -A prepend:libswanted='cl pthread '
1852 -A ccflags=-DSOME_MACRO
1853 -V : print version number and exit (with a zero status).
1860 case "$fastread$alldone" in
1863 case "$extractsh" in
1866 if test ! -t 0; then
1867 echo "Say 'sh Configure', not 'sh <Configure'"
1877 true) exec 1>/dev/null;;
1880 : run the defines and the undefines, if any, but leave the file out there...
1882 grep '\\' optdef.sh >/dev/null 2>&1
1883 if test $? = 0; then
1884 echo "Configure does not support \\ in -D arguments"
1888 : create the posthint manipulation script and leave the file out there...
1893 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1894 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1895 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1896 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1897 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1900 : Some greps do not return status, grrr.
1901 echo "grimblepritz" >grimble
1902 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1904 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1910 : the following should work in any shell
1914 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1915 cat >contains <<'EOSS'
1916 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1921 : Find the path to the source tree
1924 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1928 *) src=`cd ../$src && pwd` ;;
1941 if test -f $rsrc/Configure && \
1942 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1944 : found it, so we are ok.
1947 for src in . .. ../.. ../../.. ../../../..; do
1948 if test -f ../$src/Configure && \
1949 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1960 Sorry, I can't seem to locate the source dir for $package. Please start
1961 Configure with an explicit path -- i.e. /some/path/Configure.
1969 echo "Sources for $package found in \"$src\"." >&4
1973 : script used to extract .SH files with variable substitutions
1974 cat >extract <<'EOS'
1976 echo "Doing variable substitutions on .SH files..."
1977 if test -f MANIFEST; then
1978 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1980 echo "(Looking for .SH files under the source directory.)"
1981 set x `(cd "$src"; find . -name "*.SH" -print)`
1985 0) set x `(cd "$src"; echo *.SH)`; shift;;
1987 if test ! -f "$src/$1"; then
1993 while test $name; do
1994 if test ! -d "$name"; then
1995 create="$name $create";
1996 name=`echo $name | sed -e "s|^[^/]*$||"`;
1997 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2002 for file in $create; do
2011 dir=`expr X$file : 'X\(.*\)/'`
2012 file=`expr X$file : 'X.*/\(.*\)'`
2013 (cd "$dir" && . ./$file)
2023 dir=`expr X$file : 'X\(.*\)/'`
2024 file=`expr X$file : 'X.*/\(.*\)'`
2025 (set x $dir; shift; eval $mkdir_p)
2026 sh <"$src/$dir/$file"
2035 if test -f "$src/config_h.SH"; then
2036 if test ! -f config.h; then
2037 : oops, they left it out of MANIFEST, probably, so do it anyway.
2038 . "$src/config_h.SH"
2043 : extract files and exit if asked to do so
2044 case "$extractsh" in
2046 case "$realsilent" in
2050 case "$config_sh" in
2051 '') config_sh='config.sh';;
2054 echo "Fetching answers from $config_sh..."
2061 echo "Extraction done."
2066 : Eunice requires " " instead of "", can you believe it
2069 echo "Beginning of configuration questions for $package."
2071 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2073 : first determine how to suppress newline on echo command
2075 echo "Checking echo to see how to suppress newlines..."
2076 (echo "hi there\c" ; echo " ") >.echotmp
2077 if $contains c .echotmp >/dev/null 2>&1 ; then
2088 echo $n "The star should be here-->$c"
2092 : Now test for existence of everything in MANIFEST
2094 if test -f "$rsrc/MANIFEST"; then
2095 echo "First let's make sure your kit is complete. Checking..." >&4
2096 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2097 (split -l 50 2>/dev/null || split -50)
2100 for filelist in x??; do
2101 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2102 >/dev/null 2>>"$tmppwd/missing")
2104 if test -s missing; then
2108 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2110 You have the option of continuing the configuration process, despite the
2111 distinct possibility that your kit is damaged, by typing 'y'es. If you
2112 do, don't blame me if something goes wrong. I advise you to type 'n'o
2113 and contact the author (perlbug@perl.org).
2116 echo $n "Continue? [n] $c" >&4
2120 echo "Continuing..." >&4
2124 echo "ABORTING..." >&4
2129 echo "Looks good..."
2132 echo "There is no MANIFEST file. I hope your kit is complete !"
2136 : Find the appropriate value for a newline for tr
2137 if test -n "$DJGPP"; then
2140 if test X"$trnl" = X; then
2141 case "`echo foo | tr '\n' x 2>/dev/null`" in
2145 if test X"$trnl" = X; then
2146 case "`echo foo | tr '\012' x 2>/dev/null`" in
2147 foox) trnl='\012' ;;
2150 if test X"$trnl" = X; then
2151 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2152 fooxy) trnl='\n\r' ;;
2155 if test X"$trnl" = X; then
2158 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2164 : compute the number of columns on the terminal for proper question formatting
2169 : set up the echo used in my read
2170 myecho="case \"\$xxxm\" in
2171 '') echo $n \"\$rp $c\" >&4;;
2173 '') echo $n \"[\$xxxm] $c\";;
2175 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2177 echo $n \"[\$xxxm] $c\" >&4
2179 echo $n \"\$rp [\$xxxm] $c\" >&4
2185 : now set up to do reads with possible shell escape and default assignment
2191 case "\$fastread" in
2192 yes) case "\$dflt" in
2195 case "\$silent-\$rp" in
2200 *) case "\$silent" in
2201 true) case "\$rp" in
2206 while expr "X\$ans" : "X!" >/dev/null; do
2210 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2218 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2227 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2232 echo "(OK, I'll run with -d after this question.)" >&4
2235 echo "*** Sorry, \$1 not supported yet." >&4
2245 echo "*** Substitution done -- please confirm."
2247 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2252 echo "*** Error -- try again."
2259 case "\$ans\$xxxm\$nostick" in
2271 : create .config dir to save info across Configure sessions
2272 test -d ../.config || mkdir ../.config
2273 cat >../.config/README <<EOF
2274 This directory created by Configure to save information that should
2275 persist across sessions for $package.
2277 You may safely delete it if you wish.
2280 : See if we are using a devel version and want that
2281 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2284 usedevel="$define" ;;
2285 *) case "$xversion" in
2288 *** WHOA THERE!!! ***
2290 This is an UNSTABLE DEVELOPMENT release.
2291 The version of this $package distribution is $xversion, that is, odd,
2292 (as opposed to even) and that signifies a development release.
2293 If you want a maintenance release, you want an even-numbered version.
2295 Do ***NOT*** install this into production use.
2296 Data corruption and crashes are possible.
2298 It is most seriously suggested that you do not continue any further
2299 unless you want to help in developing and debugging Perl.
2301 If you *still* want to build perl, you can answer 'y' now,
2302 or pass -Dusedevel to Configure.
2305 rp='Do you really want to continue?'
2309 [yY]) echo >&4 "Okay, continuing."
2310 usedevel="$define" ;;
2311 *) echo >&4 "Okay, bye."
2322 case "$versiononly" in
2323 '') versiononly="$define" ;;
2325 case "$installusrbinperl" in
2326 '') installusrbinperl="$undef" ;;
2331 : general instructions
2334 user=`(logname) 2>/dev/null`
2336 '') user=`whoami 2>&1`;;
2338 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2341 rp='Would you like to see the instructions?'
2352 This installation shell script will examine your system and ask you questions
2353 to determine how the perl5 package should be installed. If you get
2354 stuck on a question, you may use a ! shell escape to start a subshell or
2355 execute a command. Many of the questions will have default answers in square
2356 brackets; typing carriage return will give you the default.
2358 On some of the questions which ask for file or directory names you are allowed
2359 to use the ~name construct to specify the login directory belonging to "name",
2360 even if you don't have a shell which knows about that. Questions where this is
2361 allowed will be marked "(~name ok)".
2365 dflt='Type carriage return to continue'
2369 The prompter used in this script allows you to use shell variables and
2370 backticks in your answers. You may use $1, $2, etc... to refer to the words
2371 in the default answer, as if the default line was a set of arguments given to a
2372 script shell. This means you may also use $* to repeat the whole default line,
2373 so you do not have to re-type everything to add something to the default.
2375 Every time there is a substitution, you will have to confirm. If there is an
2376 error (e.g. an unmatched backtick), the default answer will remain unchanged
2377 and you will be prompted again.
2379 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2380 the questions and use the computed defaults (or the previous answers if there
2381 was already a config.sh file). Type 'Configure -h' for a list of options.
2382 You may also start interactively and then answer '& -d' at any prompt to turn
2383 on the non-interactive behaviour for the remainder of the execution.
2389 Much effort has been expended to ensure that this shell script will run on any
2390 Unix system. If despite that it blows up on yours, your best bet is to edit
2391 Configure and run it again. If you can't run Configure for some reason,
2392 you'll have to generate a config.sh file by hand. Whatever problems you
2393 have, let me (perlbug@perl.org) know how I blew it.
2395 This installation script affects things in two ways:
2397 1) it may do direct variable substitutions on some of the files included
2399 2) it builds a config.h file for inclusion in C programs. You may edit
2400 any of these files as the need arises after running this script.
2402 If you make a mistake on a question, there is no easy way to back up to it
2403 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2404 files. Configure will offer to let you do this before it runs the SH files.
2407 dflt='Type carriage return to continue'
2409 case "$firsttime" in
2410 true) echo $user >>../.config/instruct;;
2414 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2415 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2416 if test "X$sysroot" = X; then
2421 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2422 # _sysroot is used in places where we need --sysroot=foo
2423 # but using the rest of the flags could cause issues.
2424 _sysroot="--sysroot=$sysroot";
2428 ccflags="$ccflags $_sysroot"
2433 ldflags="$ldflags $_sysroot"
2438 cppflags="$cppflags $_sysroot"
2440 # lddlflags updated below in lddlflags section;
2441 # same with cccdlflags
2445 # Adjust some defaults to also use $sysroot
2446 for var in xlibpth loclibpth locincpth glibpth; do
2449 for path in $xxx; do
2450 eval $var=\"\$$var $sysroot$path\"
2456 : find out where common programs are
2458 echo "Locating common programs..." >&4
2471 if test -d \$dir/\$thing; then
2477 for thisthing in \$dir/\$thing; do
2478 : just loop through to pick last item
2480 if test -f \$thisthing; then
2483 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2486 elif test -f \$dir/\$thing.exe; then
2487 if test -n "$DJGPP"; then
2488 echo \$dir/\$thing.exe
2489 elif test "$eunicefix" != ":"; then
2490 : on Eunice apparently
2543 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2544 pth="$pth $sysroot/lib $sysroot/usr/lib"
2545 for file in $loclist; do
2549 if test -f "$xxx"; then
2552 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2553 xxx=`./loc $file $file $pth`
2556 '') xxx=`./loc $file $file $pth`;;
2557 *) xxx=`./loc $xxx $xxx $pth`;;
2559 eval $file=$xxx$_exe
2563 echo $file is in $xxx.
2566 echo $file is in $xxx.
2569 echo "I don't know where '$file' is, and my life depends on it." >&4
2570 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2576 echo "Don't worry if any of the following aren't found..."
2578 for file in $trylist; do
2582 if test -f "$xxx"; then
2585 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2586 xxx=`./loc $file $file $pth`
2589 '') xxx=`./loc $file $file $pth`;;
2590 *) xxx=`./loc $xxx $xxx $pth`;;
2592 eval $file=$xxx$_exe
2596 echo $file is in $xxx.
2599 echo $file is in $xxx.
2602 echo "I don't see $file out there, $say."
2609 echo "Substituting grep for egrep."
2616 *) if $less -R </dev/null >/dev/null 2>&1; then
2617 echo "Substituting less -R for less."
2625 echo "Substituting cp for ln."
2634 echo "I can't find make or gmake, and my life depends on it." >&4
2635 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2643 *) # We can't have osname yet.
2644 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2645 # Assume that gmake, if found, is definitely GNU make
2646 # and prefer it over the system make.
2647 echo "Substituting gmake for make."
2655 echo "Hopefully test is built into your sh."
2658 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2659 echo "Using the test built into your sh."
2667 echo "Hopefully echo is built into your sh."
2672 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2673 $echo $n "hi there$c" >foo1
2674 echo $n "hi there$c" >foo2
2675 if cmp foo1 foo2 >/dev/null 2>&1; then
2676 echo "They are compatible. In fact, they may be identical."
2683 They are not compatible! You are probably running ksh on a non-USG system.
2684 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2685 have echo built in and we may have to run some Bourne shell scripts. That
2686 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2689 $echo $n "The star should be here-->$c"
2696 # This question was auctioned at YAPC::Europe-2007 in Vienna
2697 # I never promised you could answer it. I only auctioned the question.
2699 The following message is sponsored by
2701 Dresden.pm<--The stars should be here.
2703 Dear Perl user, system administrator or package
2704 maintainer, the Perl community sends greetings to
2705 you. Do you (emblematical) greet back [Y/n]? n
2709 : Check what type of C compiler we use
2713 cat <<'EOSC' >>trygcc
2718 int main(int argc, char *argv[]) {
2722 if $cc -o try $ccflags $ldflags try.c; then
2725 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2731 # Skip this test because it gives a false match on output like:
2732 # ./trygcc: line 23: cc: command not found
2733 # case "`$cc -v -c try.c 2>&1`" in
2734 # *gcc*) trygcc=no ;;
2736 if $test X"$trygcc" = Xyes; then
2737 if gcc -o try -c try.c; then
2739 echo "You seem to have a working gcc, though." >&4
2740 # Switching compilers may undo the work of hints files.
2741 # The most common problem is -D_REENTRANT for threads.
2742 # This heuristic catches that case, but gets false positives
2743 # if -Dusethreads was not actually specified. Better to
2744 # bail out here with a useful message than fail
2745 # mysteriously later. Should we perhaps just try to
2746 # re-invoke Configure -Dcc=gcc config_args ?
2747 if $test -f usethreads.cbu; then
2750 *** However, any setting of the C compiler flags (e.g. for thread support)
2751 *** will be lost. It may be necessary for you to restart Configure and
2752 *** add -Dcc=gcc to your Configure command line.
2755 rp="Would you like to go ahead and try gcc anyway?"
2758 rp="Would you like to use it?"
2761 if $test -f myread; then
2764 if $test -f UU/myread; then
2767 echo "Cannot find myread, sorry. Aborting." >&2
2772 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2785 cat <<'EOSC' >>checkcc
2790 int main(int argc, char *argv[]) {
2794 if $cc -o try $ccflags $ldflags try.c; then
2797 if $test X"$despair" = Xyes; then
2798 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2801 You need to find a working C compiler.
2802 Either (purchase and) install the C compiler supplied by your OS vendor,
2803 or for a free C compiler try http://gcc.gnu.org/
2804 I cannot continue any further, aborting.
2813 : determine whether symbolic links are supported
2816 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2817 echo "Symbolic links are supported." >&4
2820 echo "Symbolic links are NOT supported." >&4
2825 : determine whether symbolic links are supported
2829 echo "Checking how to test for symbolic links..." >&4
2831 if $test "X$issymlink" = X; then
2833 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2834 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2836 if test $? = 0; then
2839 echo "Your builtin 'test -h' may be broken." >&4
2842 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2845 if test -f "$p/$test"; then
2854 echo "Trying external '$test -h'." >&4
2855 issymlink="$test -h"
2856 if $test ! -h sym >/dev/null 2>&1; then
2857 echo "External '$test -h' is broken, too." >&4
2865 if $test "X$issymlink" = X; then
2866 if $test -L sym 2>/dev/null; then
2867 issymlink="$test -L"
2868 echo "The builtin '$test -L' worked." >&4
2871 if $test "X$issymlink" != X; then
2872 echo "You can test for symbolic links with '$issymlink'." >&4
2874 echo "I do not know how you can test for symbolic links." >&4
2878 *) echo "No symbolic links, so not testing for their testing..." >&4
2883 : Make symlinks util
2884 case "$mksymlinks" in
2887 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2890 *) case "$lns:$issymlink" in
2891 *"ln"*" -s:"*"test -"?)
2892 echo "Creating the symbolic links..." >&4
2894 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2904 print "# dir = ", dir, "file = ", file
2905 mf[dir] = mf[dir]" "source"/"dir"/"file;
2908 if (d != ".") { print("mkdir -p "d) }
2909 print("ln -sf "mf[d]" "d);
2911 }' source="$src" > UU/mksymlinks.$$
2915 if test ! -d t/base; then
2916 echo "Failed to create the subdirectories. Aborting." >&4
2920 if test ! -f t/base/lex.t; then
2921 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2924 if test ! -f win32/win32.c; then
2925 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2930 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2938 : Check for Cross-Compilation
2939 if $test "X$targethost" = "X"; then
2942 if $test "X$targetenv" = "X"; then
2945 case "$usecrosscompile" in
2947 $echo "Cross-compiling..."
2950 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2951 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2952 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2953 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2954 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2955 # leave out ld, choosing it is more complex
2956 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2957 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2958 # We are in a weird spot. Just before us, some values
2959 # were 'saved', to be restored after the hints are
2960 # run. This means that the changes we made to ar,
2961 # nm and ranlib will get reverted.
2962 # To avoid that, we hijack the saving mechanism and
2963 # have it save our new values.
2964 for file in ar nm ranlib; do
2966 eval $file=$xxx$_exe
2971 case "$targetarch" in
2972 '') echo "Targetarch not defined." >&4; croak=y ;;
2973 *) echo "Using targetarch $targetarch." >&4 ;;
2975 case "$targethost" in
2976 '') echo "Targethost not defined." >&4; croak=y ;;
2977 *) echo "Using targethost $targethost." >&4
2982 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2984 : compile a host miniperl and generate_uudmap, unless we got passed them
2985 if $test "X$hostperl" = X; then
2986 echo "Building host miniperl and generate_uudmap binaries" >&4
2994 $src/Configure -des -Dusedevel -Dmksymlinks
2996 case "$hostgenerate" in
2997 '') $make generate_uudmap
2998 hostgenerate=$src/host/generate_uudmap
3000 "$undef") hostgenerate=''
3003 hostperl=$src/host/miniperl
3006 hostosname=`$hostperl -le 'print $^O'`
3009 usecrosscompile="$undef"
3013 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3014 case "$targethost" in
3015 '') echo "Checking for cross-compile" >&4
3016 case "$usecrosscompile$multiarch" in
3017 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3018 if [ -f Makefile ]; then
3020 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3022 echo "Configure done."
3026 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3033 *) echo "Using targethost $targethost." >&4
3035 /*) run=$src/Cross/run
3036 targetmkdir=$src/Cross/mkdir
3038 from=$src/Cross/from
3040 *) pwd=`$test -f ../Configure & cd ..; pwd`
3042 targetmkdir=$pwd/Cross/mkdir
3044 from=$pwd/Cross/from
3047 case "$targetrun" in
3048 '') targetrun=ssh ;;
3053 case "$targetfrom" in
3054 '') targetfrom=scp ;;
3058 from=$from-$targetfrom
3059 case "$targetdir" in
3061 echo "Guessing targetdir $targetdir." >&4
3064 case "$targetuser" in
3066 echo "Guessing targetuser $targetuser." >&4
3069 case "$targetport" in
3071 echo "Guessing targetport $targetport." >&4
3074 case "$targetfrom" in
3078 case "$targetrun" in
3098 '') cwd=$targetdir ;;
3103 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3109 *) echo "Unknown targetrun '$targetrun'" >&4
3113 case "$targetmkdir" in
3115 cat >$targetmkdir <<EOF
3117 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3119 $chmod a+rx $targetmkdir
3121 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3133 $targetmkdir \`dirname \$f\`
3134 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3137 $targetmkdir $targetdir/\`dirname \$f\`
3138 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3151 $mkdir -p $targetdir/\`dirname \$f\`
3152 $cp \$f $targetdir/\$f || exit 1
3155 $targetmkdir $targetdir/\`dirname \$f\`
3156 $cp \$f $targetdir/\$f || exit 1
3163 *) echo "Unknown targetto '$targetto'" >&4
3167 case "$targetfrom" in
3174 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3179 cp) cat >$from <<EOF
3184 cp $targetdir/\$f . || exit 1
3189 *) echo "Unknown targetfrom '$targetfrom'" >&4
3193 if $test ! -f $run; then
3194 echo "Target 'run' script '$run' not found." >&4
3198 if $test ! -f $to; then
3199 echo "Target 'to' script '$to' not found." >&4
3203 if $test ! -f $from; then
3204 echo "Target 'from' script '$from' not found." >&4
3208 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3212 Using '$run' for remote execution,
3213 and '$from' and '$to'
3214 for remote file transfer.
3220 usecrosscompile="$undef"
3225 : see whether [:lower:] and [:upper:] are supported character classes
3227 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3229 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3233 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3234 # (0xd9 and 0xe2), therefore that is a nice testing point.
3235 if test "X$up" = X -o "X$low" = X; then
3236 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3242 if test "X$up" = X -o "X$low" = X; then
3243 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3249 if test "X$up" = X -o "X$low" = X; then
3250 case "`echo RS | od -x 2>/dev/null`" in
3252 echo "Hey, this might be EBCDIC." >&4
3253 if test "X$up" = X -o "X$low" = X; then
3254 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3255 rs) up='[A-IJ-RS-Z]'
3260 if test "X$up" = X -o "X$low" = X; then
3261 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3271 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3273 echo "Using $up and $low to convert case." >&4
3276 echo "I don't know how to translate letters from upper to lower case." >&4
3277 echo "Your tr is not acting any way I know of." >&4
3281 : set up the translation script tr, must be called with ./tr of course
3285 '[A-Z][a-z]') exec $tr '$up' '$low';;
3286 '[a-z][A-Z]') exec $tr '$low' '$up';;
3293 : Try to determine whether config.sh was made on this system
3294 case "$config_sh" in
3296 myuname=`$uname -a 2>/dev/null`
3297 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3298 # Downcase everything to avoid ambiguity.
3299 # Remove slashes and single quotes so we can use parts of this in
3300 # directory and file names.
3301 # Remove newlines so myuname is sane to use elsewhere.
3302 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3303 # because the A-Z/a-z are not consecutive.
3304 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3305 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3306 newmyuname="$myuname"
3308 case "$knowitall" in
3310 if test -f ../config.sh; then
3311 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3312 eval "`grep myuname= ../config.sh`"
3314 if test "X$myuname" = "X$newmyuname"; then
3322 : Get old answers from old config file if Configure was run on the
3323 : same system, otherwise use the hints.
3326 if test -f config.sh; then
3328 rp="I see a config.sh file. Shall I use it to set the defaults?"
3331 n*|N*) echo "OK, I'll ignore it."
3332 mv config.sh config.sh.old
3333 myuname="$newmyuname"
3335 *) echo "Fetching default answers from your old config.sh file..." >&4
3343 : Older versions did not always set $sh. Catch re-use of such
3353 if test ! -f config.sh; then
3356 First time through, eh? I have some defaults handy for some systems
3357 that need some extra help getting the Configure answers right:
3360 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3362 : Half the following guesses are probably wrong... If you have better
3363 : tests or hints, please send them to perlbug@perl.org
3364 : The metaconfig authors would also appreciate a copy...
3365 $test -f /irix && osname=irix
3366 $test -f /xenix && osname=sco_xenix
3367 $test -f /dynix && osname=dynix
3368 $test -f /dnix && osname=dnix
3369 $test -f /lynx.os && osname=lynxos
3370 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3371 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3372 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3373 $test -f /bin/mips && /bin/mips && osname=mips
3374 $test -d /usr/apollo/bin && osname=apollo
3375 $test -f /etc/saf/_sactab && osname=svr4
3376 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3377 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3378 $test -f /sys/utilities/MultiView && osname=amigaos
3379 if $test -d /MachTen -o -d /MachTen_Folder; then
3381 if $test -x /sbin/version; then
3382 osvers=`/sbin/version | $awk '{print $2}' |
3383 $sed -e 's/[A-Za-z]$//'`
3384 elif $test -x /usr/etc/version; then
3385 osvers=`/usr/etc/version | $awk '{print $2}' |
3386 $sed -e 's/[A-Za-z]$//'`
3392 $test -f /sys/posix.dll &&
3393 $test -f /usr/bin/what &&
3394 set X `/usr/bin/what /sys/posix.dll` &&
3395 $test "$3" = UWIN &&
3399 if $test -f $uname; then
3407 umips) osname=umips ;;
3410 [23]100) osname=mips ;;
3412 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3413 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3416 elif $test -f /etc/kconfig; then
3418 if test "$lns" = "$ln -s"; then
3420 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3422 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3429 if test -n "$DJGPP"; then
3438 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3440 # oslevel can fail with:
3441 # oslevel: Unable to acquire lock.
3442 *not\ found) osvers="$4"."$3" ;;
3443 '<3240'|'<>3240') osvers=3.2.0 ;;
3444 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3445 '=3250'|'>3250') osvers=3.2.5 ;;
3449 bitrig) osname=bitrig
3452 bsd386) osname=bsd386
3455 cygwin*) osname=cygwin
3458 *dc.osx) osname=dcosx
3464 domainos) osname=apollo
3470 dragonfly) osname=dragonfly
3473 dynixptx*) osname=dynixptx
3474 osvers=`echo "$4"|sed 's/^v//'`
3476 freebsd) osname=freebsd
3478 genix) osname=genix ;;
3482 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3495 $test -f /system/lib/libandroid.so && osname=linux-android
3499 netbsd*) osname=netbsd
3502 news-os) osvers="$3"
3504 4*) osname=newsos4 ;;
3508 nonstop-ux) osname=nonstopux ;;
3509 openbsd) osname=openbsd
3515 POSIX-BC | posix-bc ) osname=posix-bc
3518 powerux | power_ux | powermax_os | powermaxos | \
3519 powerunix | power_unix) osname=powerux
3525 solaris) osname=solaris
3527 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3534 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3538 titanos) osname=titanos
3547 ultrix) osname=ultrix
3550 osf1|mls+) case "$5" in
3553 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3556 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3559 hp*) osname=hp_osf1 ;;
3560 mips) osname=mips_osf1 ;;
3563 # UnixWare 7.1.2 is known as Open UNIX 8
3564 openunix|unixware) osname=svr5
3572 $2) case "$osname" in
3576 : svr4.x or possibly later
3586 if test -f /stand/boot ; then
3587 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3588 if test -n "$INITPROG" -a -f "$INITPROG"; then
3589 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3590 if test -n "$isesix"; then
3598 *) if test -f /etc/systemid; then
3600 set `echo $3 | $sed 's/\./ /g'` $4
3601 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3603 elif $test -f $src/hints/sco_$1_$2.sh; then
3605 elif $test -f $src/hints/sco_$1.sh; then
3610 '') : Still unknown. Probably a generic Sys V.
3619 *) case "$osname" in
3620 '') : Still unknown. Probably a generic BSD.
3628 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3629 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3630 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3633 $rm -f UU/kernel.what
3634 elif test -d c:/. -o -n "$is_os2" ; then
3641 case "$targetarch" in
3644 case "$targetarch" in
3646 # Will load qnx.sh, which should change osname to nto
3651 # Catch arm-linux-androideabi, mipsel-linux-android,
3652 # and i686-linux-android
3653 osname=linux-android
3657 # Something like arm-linux-gnueabihf is really just
3664 # XXX perhaps we should just assume
3665 # osvers to be 2, or maybe take the value
3666 # from targetarch. Using $run before the
3667 # hints are run is somewhat icky.
3668 set X `$run $uname -a 2>/dev/null`
3671 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3676 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3683 : Now look for a hint file osname_osvers, unless one has been
3684 : specified already.
3687 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3688 : Also try without trailing minor version numbers.
3689 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3690 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3691 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3692 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3695 *) case "$osvers" in
3698 *) if $test -f $src/hints/$file.sh ; then
3700 elif $test -f $src/hints/$xfile.sh ; then
3702 elif $test -f $src/hints/$xxfile.sh ; then
3704 elif $test -f $src/hints/$xxxfile.sh ; then
3706 elif $test -f $src/hints/$xxxxfile.sh ; then
3708 elif $test -f "$src/hints/${osname}.sh" ; then
3717 if $test -f Policy.sh ; then
3720 none) dflt="Policy" ;;
3721 *) dflt="Policy $dflt" ;;
3726 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3730 if $test -f Policy.sh ; then
3733 There's also a Policy hint file available, which should make the
3734 site-specific (policy) questions easier to answer.
3741 You may give one or more space-separated answers, or "none" if appropriate.
3742 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3743 previous run of Configure, you may specify it as well as or instead of
3744 OS-specific hints. If hints are provided for your OS, you should use them:
3745 although Perl can probably be built without hints on many platforms, using
3746 hints often improve performance and may enable features that Configure can't
3747 set up on its own. If there are no hints that match your OS, specify "none";
3748 DO NOT give a wrong version or a wrong OS.
3752 rp="Which of these apply, if any?"
3755 for file in $tans; do
3756 if $test X$file = XPolicy -a -f Policy.sh; then
3758 $cat Policy.sh >> UU/config.sh
3759 elif $test -f $src/hints/$file.sh; then
3760 . $src/hints/$file.sh
3761 $cat $src/hints/$file.sh >> UU/config.sh
3762 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3765 : Give one chance to correct a possible typo.
3766 echo "$file.sh does not exist"
3768 rp="hint to use instead?"
3770 for file in $ans; do
3771 if $test -f "$src/hints/$file.sh"; then
3772 . $src/hints/$file.sh
3773 $cat $src/hints/$file.sh >> UU/config.sh
3774 elif $test X$ans = X -o X$ans = Xnone ; then
3777 echo "$file.sh does not exist -- ignored."
3784 : Remember our hint file for later.
3785 if $test -f "$src/hints/$file.sh" ; then
3795 echo "Fetching default answers from $config_sh..." >&4
3799 cp $config_sh config.sh 2>/dev/null
3811 : Restore computed paths
3812 for file in $loclist $trylist; do
3813 eval $file="\$_$file"
3818 Configure uses the operating system name and version to set some defaults.
3819 The default value is probably right if the name rings a bell. Otherwise,
3820 since spelling matters for me, either accept the default or answer "none"
3827 ''|' '|none) dflt=none ;;
3828 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3831 *) dflt="$osname" ;;
3833 rp="Operating system name?"
3837 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3843 ''|' '|none) dflt=none ;;
3844 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3845 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3847 ''|' ') dflt=none ;;
3852 *) dflt="$osvers" ;;
3854 rp="Operating system version?"
3864 : who configured the system
3865 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3868 cf_by=`(logname) 2>/dev/null`
3871 cf_by=`(whoami) 2>/dev/null`
3873 "") cf_by=unknown ;;
3878 : decide how portable to be. Allow command line overrides.
3879 case "$d_portable" in
3881 *) d_portable="$define" ;;
3884 : set up shell script to do ~ expansion
3890 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3893 if $test -f /bin/csh; then
3894 /bin/csh -f -c "glob \$1"
3899 name=\`$expr x\$1 : '..\([^/]*\)'\`
3900 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3901 if $test ! -d "\$dir"; then
3903 echo "\$me: can't locate home directory for: \$name" >&2
3908 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3924 : now set up to get a file name
3928 cat <<'EOSC' >>getfile
3944 : getfile will accept an answer from the comma-separated list
3945 : enclosed in parentheses even if it does not meet other criteria.
3946 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3947 fn=`echo $fn | sed 's/(.*)//'`
3953 loc_file=`expr $fn : '.*:\(.*\)'`
3954 fn=`expr $fn : '\(.*\):.*'`
3962 */*) fullpath=true;;
3971 *e*) exp_file=true;;
3974 *p*) nopath_ok=true;;
3979 *d*) type='Directory';;
3980 *l*) type='Locate';;
3985 Locate) what='File';;
3990 case "$d_portable" in
3998 while test "$type"; do
4003 true) rp="$rp (~name ok)";;
4006 if test -f UU/getfile.ok && \
4007 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4026 value=`UU/filexp $ans`
4029 if test "$ans" != "$value"; then
4030 echo "(That expands to $value on this system.)"
4044 /*) value="$ansexp" ;;
4045 [a-zA-Z]:/*) value="$ansexp" ;;
4050 echo "I shall only accept a full path name, as in /bin/ls." >&4
4051 echo "Use a ! shell escape if you wish to check pathnames." >&4
4054 echo "Please give a full path name, starting with slash." >&4
4057 echo "Note that using ~name is ok provided it expands well." >&4
4070 for fp in $gfpth; do
4071 if test "X$fp" = X.; then
4076 if test -f "$pf"; then
4078 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4080 echo "($value is not a plain file, but that's ok.)"
4083 if test X"$type" = X; then
4090 for fp in $gfpth; do
4091 if test "X$fp" = X.; then
4096 direxp="$fp/$ansexp"
4098 if test -d "$direxp"; then
4106 if test -d "$ansexp"; then
4107 echo "(Looking for $loc_file in directory $value.)"
4108 value="$value/$loc_file"
4109 ansexp="$ansexp/$loc_file"
4111 if test -f "$ansexp"; then
4114 case "$nopath_ok" in
4115 true) case "$value" in
4117 *) echo "Assuming $value will be in people's path."
4133 if test "$fastread" = yes; then
4138 rp="$what $value doesn't exist. Use that name anyway?"
4157 test "X$gfpthkeep" != Xy && gfpth=""
4160 : determine root of directory hierarchy where package will be installed.
4163 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4166 dflt=`echo "$prefix" | sed 's/.$//'`
4174 By default, $package will be installed in $dflt/bin, manual pages
4175 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4176 installation directories. Typically this is something like /usr/local.
4177 If you wish to have binaries under /usr/bin but other parts of the
4178 installation under /usr/local, that's ok: you will be prompted
4179 separately for each of the installation directories, the prefix being
4180 only used to set the defaults.
4184 rp='Installation prefix to use?'
4192 *) oldprefix="$prefix";;
4199 : allow them to override the AFS root
4202 *) afsroot=$afsroot ;;
4208 $define|true) afs=true ;;
4209 $undef|false) afs=false ;;
4210 *) if $test -d $afsroot; then
4218 echo "AFS may be running... I'll be extra cautious then..." >&4
4220 echo "AFS does not seem to be running..." >&4
4223 : determine installation prefix for where package is to be installed.
4227 Since you are running AFS, I need to distinguish the directory in which
4228 files will reside from the directory in which they are installed (and from
4229 which they are presumably copied to the former directory by occult means).
4232 case "$installprefix" in
4233 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4234 *) dflt="$installprefix";;
4239 In some special cases, particularly when building $package for distribution,
4240 it is convenient to distinguish the directory in which files should be
4241 installed from the directory ($prefix) in which they will
4242 eventually reside. For most users, these two directories are the same.
4245 case "$installprefix" in
4247 *) dflt=$installprefix;;
4251 rp='What installation prefix should I use for installing files?'
4253 installprefix="$ans"
4254 installprefixexp="$ansexp"
4256 : Perform the prefixexp/installprefixexp correction if necessary
4257 cat <<EOS >installprefix
4260 cat <<'EOSC' >>installprefix
4261 : Change installation prefix, if necessary.
4262 if $test X"$prefix" != X"$installprefix"; then
4263 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4265 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4268 chmod +x installprefix
4269 $eunicefix installprefix
4271 : Set variables such as privlib and privlibexp from the output of ./getfile
4272 : performing the prefixexp/installprefixexp correction if necessary.
4273 cat <<EOS >setprefixvar
4276 cat <<'EOSC' >>setprefixvar
4277 eval "${prefixvar}=\"\$ans\""
4278 eval "${prefixvar}exp=\"\$ansexp\""
4281 chmod +x setprefixvar
4282 $eunicefix setprefixvar
4284 : set up the script used to warn in case of inconsistency
4293 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4295 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4296 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4301 echo "*** WHOA THERE!!! ***" >&4
4302 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4305 rp=" Keep the $hint value?"
4308 y) td=$was; tu=$was;;
4312 : function used to set '$1' to '$val'
4313 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4315 $define$undef) . ./whoa; eval "$var=\$td";;
4316 $undef$define) . ./whoa; eval "$var=\$tu";;
4317 *) eval "$var=$val";;
4320 : get the patchlevel
4322 echo "Getting the current patchlevel..." >&4
4323 if $test -r $rsrc/patchlevel.h;then
4324 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4325 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4326 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4327 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4328 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4329 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4330 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4339 $echo "(You do not have patchlevel.h. Eek.)"
4341 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4342 version_patchlevel_string="version $patchlevel subversion $subversion"
4343 case "$perl_patchlevel" in
4345 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4346 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4350 $echo "(You have $package $version_patchlevel_string.)"
4354 : XXX Should be a Configure test for double-dots in filenames.
4355 version=`echo $revision $patchlevel $subversion | \
4356 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4357 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4358 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4361 version=`echo $revision $patchlevel $subversion | \
4362 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4363 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4364 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4367 : Special case the 5.005_xx maintenance series, which used 5.005
4368 : without any subversion label as a subdirectory in $sitelib
4369 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4370 api_versionstring='5.005'
4373 : Do we want threads support and if so, what type
4374 case "$usethreads" in
4375 $define|true|[yY]*) dflt='y';;
4376 *) # Catch case where user specified ithreads or 5005threads but
4377 # forgot -Dusethreads (A.D. 4/2002)
4378 case "$useithreads$use5005threads" in
4379 *$define*) dflt='y';;
4386 Perl can be built to offer a form of threading support on some systems
4387 To do so, Configure can be run with -Dusethreads.
4389 Note that Perl built with threading support runs slightly slower
4390 and uses slightly more memory than plain Perl.
4392 If this doesn't make any sense to you, just accept the default '$dflt'.
4394 rp='Build a threading Perl?'
4397 y|Y) val="$define" ;;
4403 if $test $patchlevel -lt 9; then
4404 case "$usethreads" in
4406 : Default to ithreads unless overridden on command line or with
4409 case "$use5005threads" in
4411 echo "5.005 threads are no longer supported"
4415 case "$useithreads" in
4416 $undef|false|[nN]*) dflt='n';;
4418 rp='Use the newer interpreter-based ithreads?'
4421 y|Y) val="$define" ;;
4426 : Now set use5005threads to the opposite value.
4427 case "$useithreads" in
4428 $define) val="$undef" ;;
4435 useithreads="$undef"
4436 use5005threads="$undef"
4440 case "$useithreads$use5005threads" in
4444 You cannot have both the ithreads and the 5.005 threads enabled
4445 at the same time. Disabling the 5.005 threads since they are
4446 much less stable than the ithreads.
4449 use5005threads="$undef"
4454 : perl-5.9.x and later
4456 if test X"$usethreads" = "X$define"; then
4457 case "$use5005threads" in
4461 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4468 use5005threads="$undef"
4469 useithreads="$usethreads"
4472 case "$d_oldpthreads" in
4473 '') : Configure tests would be welcome here. For now, assume undef.
4475 *) val="$d_oldpthreads" ;;
4481 : Look for a hint-file generated 'call-back-unit'. If the
4482 : user has specified that a threading perl is to be built,
4483 : we may need to set or change some other defaults.
4484 if $test -f usethreads.cbu; then
4485 echo "Your platform has some specific hints regarding threaded builds, using them..."
4488 case "$usethreads" in
4489 "$define"|true|[yY]*)
4491 (Your platform does not have any specific hints for threaded builds.
4492 Assuming POSIX threads, then.)
4498 : Check if multiplicity is required
4501 Perl can be built so that multiple Perl interpreters can coexist
4502 within the same Perl executable.
4505 case "$useithreads" in
4508 This multiple interpreter support is required for interpreter-based threads.
4512 *) case "$usemultiplicity" in
4513 $define|true|[yY]*) dflt='y';;
4517 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4518 rp='Build Perl for multiplicity?'
4521 y|Y) val="$define" ;;
4529 : Check if morebits is requested
4530 case "$usemorebits" in
4531 "$define"|true|[yY]*)
4532 use64bitint="$define"
4533 uselongdouble="$define"
4534 usemorebits="$define"
4536 *) usemorebits="$undef"
4540 : Determine the C compiler to be used
4546 rp="Use which C compiler?"
4550 : See whether they have no cc but they do have gcc
4552 if $test -f cc.cbu; then
4557 : make some quick guesses about what we are up against
4559 $echo $n "Hmm... $c"
4569 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4570 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4572 echo "Looks kind of like an OSF/1 system, but we'll see..."
4574 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4575 xxx=`./loc addbib blurfl $pth`
4576 if $test -f $xxx; then
4577 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4581 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4582 echo "Looks kind of like an extended USG system, but we'll see..."
4584 echo "Looks kind of like a USG system, but we'll see..."
4588 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4589 echo "Looks kind of like a BSD system, but we'll see..."
4593 echo "Looks kind of like a Version 7 system, but we'll see..."
4596 case "$eunicefix" in
4599 There is, however, a strange, musty smell in the air that reminds me of
4600 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4604 : it so happens the Eunice I know will not run shell scripts in Unix format
4608 echo "Congratulations. You aren't running Eunice."
4612 : Detect OS2. The p_ variable is set above in the Head.U unit.
4613 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4614 : semicolon as a patch separator
4619 I have the feeling something is not exactly right, however...don't tell me...
4620 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4621 (Or you may be running DOS with DJGPP.)
4626 if test -f /xenix; then
4627 echo "Actually, this looks more like a XENIX system..."
4632 echo "It's not Xenix..."
4637 if test -f /venix; then
4638 echo "Actually, this looks more like a VENIX system..."
4645 echo "Nor is it Venix..."
4648 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4649 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4652 : Check if we are using GNU gcc and what its version is
4654 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4658 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4660 printf("%s\n", __VERSION__);
4662 printf("%s\n", "1");
4668 if $cc -o try $ccflags $ldflags try.c; then
4669 gccversion=`$run ./try`
4670 case "$gccversion" in
4671 '') echo "You are not using GNU cc." ;;
4672 *) echo "You are using GNU cc $gccversion."
4678 echo "*** WHOA THERE!!! ***" >&4
4679 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4680 case "$knowitall" in
4682 echo " You'd better start hunting for one and let me know about it." >&4
4688 case "$gccversion" in
4689 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4691 case "$gccversion" in
4692 '') gccosandvers='' ;;
4693 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4694 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4696 case "$gccosandvers" in
4697 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4698 $osname$osvers) ;; # looking good
4699 $osname*) cat <<EOM >&4
4701 *** WHOA THERE!!! ***
4703 Your gcc has not been compiled for the exact release of
4704 your operating system ($gccosandvers versus $osname$osvers).
4706 In general it is a good idea to keep gcc synchronized with
4707 the operating system because otherwise serious problems
4708 may ensue when trying to compile software, like Perl.
4710 I'm trying to be optimistic here, though, and will continue.
4711 If later during the configuration and build icky compilation
4712 problems appear (headerfile conflicts being the most common
4713 manifestation), I suggest reinstalling the gcc to match
4714 your operating system release.
4718 *) gccosandvers='' ;; # failed to parse, better be silent
4726 # gcc 3.* complain about adding -Idirectories that they already know about,
4727 # so we will take those off from locincpth.
4728 case "$gccversion" in
4730 echo "main(){}">try.c
4731 for incdir in $locincpth; do
4732 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4733 grep '^c[cp]p*[01]: warning: changing search order '`
4734 if test "X$warn" != X; then
4735 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4741 # gcc 4.9 by default does some optimizations that break perl.
4742 # see ticket 121505.
4744 # The -fwrapv disables those optimizations (and probably others,) so
4745 # for gcc 4.9 (and later, since the optimizations probably won't go
4746 # away), add -fwrapv unless the user requests -fno-wrapv, which
4747 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4748 # which turns the overflows -fwrapv ignores into runtime errors.
4749 case "$gccversion" in
4750 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4752 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4753 *) ccflags="$ccflags -fwrapv" ;;
4757 : What should the include directory be ?
4758 : Use sysroot if set, so findhdr looks in the right place.
4760 $echo $n "Hmm... $c"
4761 dflt="$sysroot/usr/include"
4764 if $test -f /bin/mips && /bin/mips; then
4765 echo "Looks like a MIPS system..."
4766 $cat >usr.c <<'EOCP'
4767 #ifdef SYSTYPE_BSD43
4771 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4772 dflt='/bsd43/usr/include'
4776 mips_type='System V'
4778 $rm -f usr.c usr.out
4779 echo "and you're compiling with the $mips_type compiler and libraries."
4783 echo "Doesn't look like a MIPS system."
4793 case "$xxx_prompt" in
4796 rp='Where are the include files you want to use?'
4804 : see how we invoke the C preprocessor
4806 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4807 cat <<'EOT' >testcpp.c
4813 if test ! -f cppstdin; then
4814 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4815 # AIX cc -E doesn't show the absolute headerfile
4816 # locations but we'll cheat by using the -M flag.
4817 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
4819 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4822 echo "Keeping your $hint cppstdin wrapper."
4825 wrapper=`pwd`/cppstdin
4829 if $test "X$cppstdin" != "X" && \
4830 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4833 echo "You used to use $cppstdin $cppminus so we'll use that again."
4835 '') echo "But let's see if we can live without a wrapper..." ;;
4837 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4838 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4840 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4843 echo "(However, $cpprun $cpplast does not work, let's see...)"
4851 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4858 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4859 $cc -E <testcpp.c >testcpp.out 2>&1; \
4860 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4861 echo "Yup, it does."
4862 x_cpp="$cc $cppflags -E"
4864 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4865 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4866 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4867 echo "Yup, it does."
4868 x_cpp="$cc $cppflags -E"
4870 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4871 $cc -P <testcpp.c >testcpp.out 2>&1; \
4872 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4873 echo "Yipee, that works!"
4874 x_cpp="$cc $cppflags -P"
4876 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4877 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4878 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 echo "At long last!"
4880 x_cpp="$cc $cppflags -P"
4882 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4883 $cpp <testcpp.c >testcpp.out 2>&1; \
4884 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4886 x_cpp="$cpp $cppflags"
4888 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4889 $cpp - <testcpp.c >testcpp.out 2>&1; \
4890 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4891 echo "Hooray, it works! I was beginning to wonder."
4892 x_cpp="$cpp $cppflags"
4894 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4895 $wrapper <testcpp.c >testcpp.out 2>&1; \
4896 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4902 rp="No dice. I can't find a C preprocessor. Name one:"
4906 $x_cpp <testcpp.c >testcpp.out 2>&1
4907 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4908 echo "OK, that will do." >&4
4910 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4925 echo "Perhaps can we force $cc -E using a wrapper..."
4926 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4927 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4933 echo "Nope, we'll have to live without it..."
4947 "$wrapper"|'cppstdin') ;;
4948 *) $rm -f $wrapper;;
4950 $rm -f testcpp.c testcpp.out
4952 : Adjust cppfilter for path component separator
4954 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4955 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4959 : Use gcc to determine libpth and incpth
4960 # If using gcc or clang, we can get better values for libpth, incpth
4961 # and usrinc directly from the compiler.
4962 # Note that ccname for clang is also gcc.
4965 $echo 'extern int foo;' > try.c
4966 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4968 if $test $# -gt 0; then
4970 incpth="`$echo $incpth|$sed 's/^ //'`"
4972 j="`$echo $i|$sed 's,/include$,/lib,'`"
4973 if $test -d $j; then
4977 libpth="`$echo $libpth|$sed 's/^ //'`"
4978 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4979 if $test -d $xxx; then
4982 *) libpth="$libpth $xxx";;
4989 '') for i in $incpth; do
4990 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4998 case "$usecrosscompile" in
5001 '') echo "Incpth not defined." >&4; croak=y ;;
5002 *) echo "Using incpth '$incpth'." >&4 ;;
5005 '') echo "Libpth not defined." >&4; croak=y ;;
5006 *) echo "Using libpth '$libpth'." >&4 ;;
5009 '') echo "Usrinc not defined." >&4; croak=y ;;
5010 *) echo "Using usrinc $usrinc." >&4 ;;
5014 if test "X$sysroot" = X; then
5015 echo "Cannot continue, aborting." >&4; exit 1
5017 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5026 : Default value for incpth is just usrinc
5028 '') incpth="$usrinc";;
5031 : Set private lib path
5034 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5039 '') dlist="$loclibpth $plibpth $glibpth";;
5040 *) dlist="$libpth";;
5043 : Now check and see which directories actually exist, avoiding duplicates
5046 if $test -d $xxx; then
5049 *) libpth="$libpth $xxx";;
5055 Some systems have incompatible or broken versions of libraries. Among
5056 the directories listed in the question below, please remove any you
5057 know not to be holding relevant libraries, and add any that are needed.
5058 Say "none" for none.
5062 if test "X$sysroot" != X; then
5064 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5077 rp="Directories to use for library searches?"
5084 : compute shared library extension
5087 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5097 On some systems, shared libraries may be available. Answer 'none' if
5098 you want to suppress searching of shared libraries for the remainder
5099 of this configuration.
5102 rp='What is the file extension used for shared libraries?'
5106 : Does target system insist that shared library basenames are unique
5109 Some dynamic loaders assume that the *basename* of shared library filenames
5110 are globally unique. We'll default this to undef as we assume your system
5111 is not this weird. Set to defined if you're on one of them.
5116 rp='Make shared library basenames unique?'
5119 y|Y) val="$define" ;;
5122 set d_libname_unique
5125 : Define several unixisms.
5126 : Hints files or command line option can be used to override them.
5127 : The convoluted testing is in case hints files set either the old
5130 '') case "$exe_ext" in
5132 *) _exe="$exe_ext" ;;
5137 '') case "$lib_ext" in
5144 '') case "$obj_ext" in
5151 '') case "$path_sep" in
5162 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5164 : Which makefile gets called first. This is used by make depend.
5165 case "$firstmakefile" in
5166 '') firstmakefile='makefile';;
5169 : Check is we will use socks
5171 $define|true|[yY]*) dflt='y';;
5176 Perl can be built to use the SOCKS proxy protocol library. To do so,
5177 Configure must be run with -Dusesocks. If you use SOCKS you also need
5178 to use the PerlIO abstraction layer, this will be implicitly selected.
5180 If this doesn't make any sense to you, just accept the default '$dflt'.
5182 rp='Build Perl for SOCKS?'
5185 y|Y) val="$define" ;;
5191 : Check for uselongdouble support
5193 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5196 case "$uselongdouble" in
5197 $define|true|[yY]*) dflt='y';;
5202 Perl can be built to take advantage of long doubles which
5203 (if available) may give more accuracy and range for floating point numbers.
5205 If this doesn't make any sense to you, just accept the default '$dflt'.
5207 rp='Try to use long doubles if available?'
5210 y|Y) val="$define" ;;
5216 case "$uselongdouble" in
5217 true|[yY]*) uselongdouble="$define" ;;
5220 : Look for a hint-file generated 'call-back-unit'. If the
5221 : user has specified that long doubles should be used,
5222 : we may need to set or change some other defaults.
5223 if $test -f uselongdouble.cbu; then
5224 echo "Your platform has some specific hints regarding long doubles, using them..."
5225 . ./uselongdouble.cbu
5227 case "$uselongdouble" in
5230 (Your platform does not have any specific hints for long doubles.)
5236 : Check if quadmath is requested
5237 case "$usequadmath" in
5238 "$define"|true|[yY]*) usequadmath="$define" ;;
5239 *) usequadmath="$undef" ;;
5242 : Looking for optional libraries
5244 echo "Checking for optional libraries..." >&4
5249 case "$libswanted" in
5250 '') libswanted='c_s';;
5253 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5255 case "$usecbacktrace" in
5256 "$define") libswanted="$libswanted bfd" ;;
5258 case "$usequadmath" in
5259 "$define") libswanted="$libswanted quadmath" ;;
5265 for thisdir in $libpth $xlibpth; do
5266 test -d $thisdir && libspath="$libspath $thisdir"
5268 for thislib in $libswanted; do
5269 for thisdir in $libspath; do
5271 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5272 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5273 $test -f "$xxx" && eval $libscheck
5274 $test -f "$xxx" && libstyle=shared
5275 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5276 $test -f "$xxx" && eval $libscheck
5277 $test -f "$xxx" && libstyle=shared
5279 if test ! -f "$xxx"; then
5280 xxx=$thisdir/lib$thislib.$so
5281 $test -f "$xxx" && eval $libscheck
5282 $test -f "$xxx" && libstyle=shared
5284 if test ! -f "$xxx"; then
5285 xxx=$thisdir/lib$thislib$_a
5286 $test -f "$xxx" && eval $libscheck
5287 $test -f "$xxx" && libstyle=static
5289 if test ! -f "$xxx"; then
5290 xxx=$thisdir/$thislib$_a
5291 $test -f "$xxx" && eval $libscheck
5292 $test -f "$xxx" && libstyle=static
5294 if test ! -f "$xxx"; then
5295 xxx=$thisdir/lib${thislib}_s$_a
5296 $test -f "$xxx" && eval $libscheck
5297 $test -f "$xxx" && libstyle=static
5298 $test -f "$xxx" && thislib=${thislib}_s
5300 if test ! -f "$xxx"; then
5301 xxx=$thisdir/Slib$thislib$_a
5302 $test -f "$xxx" && eval $libscheck
5303 $test -f "$xxx" && libstyle=static
5305 if $test -f "$xxx"; then
5307 shared) echo "Found -l$thislib (shared)." ;;
5308 static) echo "Found -l$thislib." ;;
5309 *) echo "Found -l$thislib ($libstyle)." ;;
5313 *) dflt="$dflt -l$thislib"
5314 libsfound="$libsfound $xxx"
5316 libsfiles="$libsfiles $yyy"
5317 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5318 case " $libsdirs " in
5320 *) libsdirs="$libsdirs $yyy" ;;
5327 if $test ! -f "$xxx"; then
5328 echo "No -l$thislib."
5339 ' '|'') dflt='none';;
5344 In order to compile $package on your machine, a number of libraries
5345 are usually needed. Include any other special libraries here as well.
5346 Say "none" for none. The default list is almost always right.
5350 rp="What libraries to use?"
5357 : determine optimization, if desired, or use for debug flag also
5359 ' '|$undef) dflt='none';;
5361 *) dflt="$optimize";;
5365 By default, $package compiles with the -O flag to use the optimizer.
5366 Alternately, you might want to use the symbolic debugger, which uses
5367 the -g flag (on traditional Unix systems). Either flag can be
5368 specified here. To use neither flag, specify the word "none".
5371 rp="What optimizer/debugger flag should be used?"
5375 'none') optimize=" ";;
5378 : Check what DEBUGGING is required from the command line
5379 : -DEBUGGING or -DDEBUGGING or
5380 : -DEBUGGING=both = -g + -DDEBUGGING
5381 : -DEBUGGING=-g or -Doptimize=-g = -g
5382 : -DEBUGGING=none or -UDEBUGGING =
5383 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5386 *) DEBUGGING=$EBUGGING ;;
5389 case "$DEBUGGING" in
5393 *) optimize="$optimize -g" ;;
5397 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5405 case "$DEBUGGING" in
5406 both|$define) dflt='-DDEBUGGING'
5409 : argument order is deliberate, as the flag will start with - which set could
5410 : think is an option
5411 checkccflag='check=$1; flag=$2; callback=$3;
5413 echo "Checking if your compiler accepts $flag" 2>&1;
5414 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5415 echo "int main(void) { return 0; }" > gcctest.c;
5416 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5417 echo "Yes, it does." 2>&1;
5418 if $test -s gcctest.out ; then
5419 echo "But your platform does not like it:";
5424 echo "Leaving current flags $ccflags alone." 2>&1
5426 *) dflt="$dflt $flag";
5432 echo "Nope, it does not, but that is ok." 2>&1;
5436 : We will not override a previous value, but we might want to
5437 : augment a hint file
5439 default|recommended)
5440 case "$gccversion" in
5441 1*) dflt="$dflt -fpcc-struct-return" ;;
5443 case "$optimize:$DEBUGGING" in
5444 *-g*:old) dflt="$dflt -DDEBUGGING";;
5446 case "$gccversion" in
5447 2*) if $test -d /etc/conf/kconfig.d &&
5448 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5450 # Interactive Systems (ISC) POSIX mode.
5455 case "$gccversion" in
5458 ?*) set strict-aliasing -fno-strict-aliasing
5462 # For gcc, adding -pipe speeds up compilations for some, but apparently
5463 # some assemblers can't read from stdin. (It also slows down compilations
5464 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5465 case "$gccversion" in
5471 # on x86_64 (at least) we require an extra library (libssp) in the
5472 # link command line. This library is not named, so I infer that it is
5473 # an implementation detail that may change. Hence the safest approach
5474 # is to add the flag to the flags passed to the compiler at link time,
5475 # as that way the compiler can do the right implementation dependant
5478 amigaos) ;; # -fstack-protector builds but doesn't work
5479 *) case "$gccversion" in
5480 ?*) set stack-protector-strong -fstack-protector-strong
5483 *-fstack-protector-strong*) ;; # It got added.
5484 *) # Try the plain/older -fstack-protector.
5485 set stack-protector -fstack-protector
5496 case "$mips_type" in
5497 *BSD*|'') inclwanted="$locincpth $usrinc";;
5498 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5500 for thisincl in $inclwanted; do
5501 if $test -d $thisincl; then
5502 if $test x$thisincl != x$usrinc; then
5504 *" -I$thisincl "*);;
5505 *) dflt="$dflt -I$thisincl ";;
5511 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5513 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5521 *) dflt="$dflt -D$2";;
5525 set signal.h LANGUAGE_C; eval $inctest
5529 ccflags="$ccflags -DSOCKS"
5534 default|recommended) dflt="$ccflags $dflt" ;;
5535 *) dflt="$ccflags";;
5544 Your C compiler may want other flags. For this question you should include
5545 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5546 but you should NOT include libraries or ld flags like -lwhatever. If you
5547 want $package to honor its debug switch, you should include -DDEBUGGING here.
5548 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5550 To use no flags, specify the word "none".
5556 rp="Any additional cc flags?"
5563 : the following weeds options from ccflags that are of no interest to cpp
5565 '') cppflags="$ccflags" ;;
5566 *) set X $ccflags; shift
5567 case " $cppflags " in
5568 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5569 *) cppflags="$cppflags $ccflags" ;;
5573 case "$gccversion" in
5574 1*) cppflags="$cppflags -D__GNUC__"
5576 case "$mips_type" in
5578 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5584 echo "Let me guess what the preprocessor flags are..." >&4
5598 *) ftry="$previous $flag";;
5600 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5601 >cpp1.out 2>/dev/null && \
5602 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5603 >cpp2.out 2>/dev/null && \
5604 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5605 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5607 cppflags="$cppflags $ftry"
5617 *-*) echo "They appear to be: $cppflags";;
5619 $rm -f cpp.c cpp?.out
5623 : flags used in final linking phase
5625 '') if ./venix; then
5631 *-posix*) dflt="$dflt -posix" ;;
5634 *) dflt="$ldflags";;
5636 # See note above about -fstack-protector
5638 *-fstack-protector-strong*)
5640 *-fstack-protector-strong*) ;; # Don't add it again
5641 *) dflt="$dflt -fstack-protector-strong" ;;
5644 *-fstack-protector*)
5646 *-fstack-protector*) ;; # Don't add it again
5647 *) dflt="$dflt -fstack-protector" ;;
5652 : Try to guess additional flags to pick up local libraries.
5653 for thislibdir in $libpth; do
5654 case " $loclibpth " in
5657 *"-L$thislibdir "*) ;;
5658 *) dflt="$dflt -L$thislibdir" ;;
5670 Your C linker may need flags. For this question you should
5671 include -L/whatever and any other flags used by the C linker, but you
5672 should NOT include libraries like -lwhatever.
5674 Make sure you include the appropriate -L/path flags if your C linker
5675 does not normally search all of the directories you specified above,
5678 To use no flags, specify the word "none".
5682 rp="Any additional ld flags (NOT including libraries)?"
5688 rmlist="$rmlist pdp11"
5692 echo "Checking your choice of C compiler and flags for coherency..." >&4
5693 $cat > try.c <<'EOF'
5695 int main() { printf("Ok\n"); return(0); }
5697 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5699 $cat >try.msg <<'EOM'
5700 I've tried to compile and run the following simple program:
5703 $cat try.c >> try.msg
5705 $cat >> try.msg <<EOM
5712 and I got the following output:
5716 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5717 if $sh -c "$run ./try " >>try.msg 2>&1; then
5721 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5724 echo "The program compiled OK, but exited with status $?." >>try.msg
5725 rp="You have a problem. Shall I abort Configure"
5729 echo "I can't compile the test program." >>try.msg
5730 rp="You have a BIG problem. Shall I abort Configure"
5736 case "$knowitall" in
5738 echo "(The supplied flags or libraries might be incorrect.)"
5746 *) echo "Ok. Stopping Configure." >&4
5751 n) echo "OK, that should do.";;
5753 $rm_try gcctest gcctest.out
5755 : define a shorthand compile call
5759 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5760 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5764 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5765 : define a shorthand compile call for compilations that should be ok.
5769 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5771 : determine filename position in cpp output
5773 echo "Computing filename position in cpp output for #include directives..." >&4
5775 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5780 vos) testaccess=-e ;;
5783 echo '#include <stdio.h>' > foo.c
5786 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5787 $grep '^[ ]*#.*stdio\.h' | \
5788 while read cline; do
5791 while $test \$# -gt 0; do
5792 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5797 pos=\`expr \$pos + 1\`
5811 *) pos="${fieldn}th";;
5813 echo "Your cpp writes the filename in the $pos field of the line."
5815 : locate header file
5820 for usrincdir in $incpth
5822 if test -f \$usrincdir/\$wanted; then
5823 echo "\$usrincdir/\$wanted"
5827 awkprg='{ print \$$fieldn }'
5828 echo "#include <\$wanted>" > foo\$\$.c
5829 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5830 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5831 while read cline; do
5832 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5834 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5835 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5840 # status = 0: grep returned 0 lines, case statement not executed
5841 # status = 1: headerfile found
5842 # status = 2: while loop executed, no headerfile found
5846 if test \$status -eq 1; then
5853 : define an alternate in-header-list? function
5854 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5855 cont=true; xxf="echo \"<\$1> found.\" >&4";
5856 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5857 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5859 case $# in 4) instead=instead;; *) instead="at last";; esac;
5860 while $test "$cont"; do
5862 var=$2; eval "was=\$$2";
5863 if $test "$xxx" && $test -r "$xxx";
5865 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5868 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5869 set $yyy; shift; shift; yyy=$@;
5870 case $# in 0) cont="";;
5871 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5872 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5873 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5874 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5878 do set $yyy; var=$2; eval "was=\$$2";
5879 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5880 set $yyy; shift; shift; yyy=$@;
5883 : see if stdlib is available
5884 set stdlib.h i_stdlib
5887 : check for lengths of integral types
5891 echo "Checking to see how big your integers are..." >&4
5900 printf("intsize=%d;\n", (int)sizeof(int));
5901 printf("longsize=%d;\n", (int)sizeof(long));
5902 printf("shortsize=%d;\n", (int)sizeof(short));
5907 if eval $compile_ok && $run ./try > /dev/null; then
5909 echo "Your integers are $intsize bytes long."
5910 echo "Your long integers are $longsize bytes long."
5911 echo "Your short integers are $shortsize bytes long."
5915 Help! I can't compile and run the intsize test program: please enlighten me!
5916 (This is probably a misconfiguration in your system or libraries, and
5917 you really ought to fix it. Still, I'll try anyway.)
5921 rp="What is the size of an integer (in bytes)?"
5925 rp="What is the size of a long integer (in bytes)?"
5929 rp="What is the size of a short integer (in bytes)?"
5937 : check for long long
5939 echo "Checking to see if you have long long..." >&4
5940 echo 'int main() { long long x = 7; return 0; }' > try.c
5942 if eval $compile; then
5944 echo "You have long long."
5947 echo "You do not have long long."
5953 : check for length of long long
5954 case "${d_longlong}${longlongsize}" in
5957 echo "Checking to see how big your long longs are..." >&4
5958 $cat >try.c <<'EOCP'
5962 printf("%d\n", (int)sizeof(long long));
5967 if eval $compile_ok; then
5968 longlongsize=`$run ./try`
5969 echo "Your long longs are $longlongsize bytes long."
5973 echo "(I can't seem to compile the test program. Guessing...)"
5974 rp="What is the size of a long long (in bytes)?"
5978 if $test "X$longsize" = "X$longlongsize"; then
5979 echo "(That isn't any different from an ordinary long.)"
5985 : see if inttypes.h is available
5986 : we want a real compile instead of Inhdr because some systems
5987 : have an inttypes.h which includes non-existent headers
5990 #include <inttypes.h>
5992 static int32_t foo32 = 0x12345678;
5996 if eval $compile; then
5997 echo "<inttypes.h> found." >&4
6000 echo "<inttypes.h> NOT found." >&4
6009 echo "Checking to see if you have int64_t..." >&4
6011 #include <sys/types.h>
6012 #$i_inttypes I_INTTYPES
6014 #include <inttypes.h>
6016 int main() { int64_t x = 7; }
6019 if eval $compile; then
6021 echo "You have int64_t."
6024 echo "You do not have int64_t."
6030 : Check if 64bit ints have a quad type
6032 echo "Checking which 64-bit integer type we could use..." >&4
6038 val='"unsigned int"'
6043 *) case "$longsize" in
6047 val='"unsigned long"'
6052 *) case "$d_longlong:$longlongsize" in
6057 val='"unsigned long long"'
6062 *) case "$d_int64_t" in
6081 '') echo "Alas, no 64-bit integer types in sight." >&4
6084 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6089 : Do we want 64bit support
6090 case "$uselonglong" in
6091 "$define"|true|[yY]*)
6094 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6096 use64bitint="$define"
6099 case "$use64bits" in
6100 "$define"|true|[yY]*)
6103 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6105 use64bitint="$define"
6108 case "$use64bitints" in
6109 "$define"|true|[yY]*)
6112 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6114 use64bitint="$define"
6117 case "$use64bitsint" in
6118 "$define"|true|[yY]*)
6121 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6123 use64bitint="$define"
6126 case "$uselonglongs" in
6127 "$define"|true|[yY]*)
6130 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6132 use64bitint="$define"
6135 case "$use64bitsall" in
6136 "$define"|true|[yY]*)
6139 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6141 use64bitall="$define"
6146 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6148 case "$use64bitall" in
6149 "$define"|true|[yY]*) use64bitint="$define" ;;
6155 You have natively 64-bit long integers.
6159 *) case "$use64bitint" in
6160 "$define"|true|[yY]*) dflt='y';;
6169 Perl can be built to take advantage of 64-bit integer types
6170 on some systems. To do so, Configure can be run with -Duse64bitint.
6171 Choosing this option will most probably introduce binary incompatibilities.
6173 If this doesn't make any sense to you, just accept the default '$dflt'.
6174 (The default has been chosen based on your configuration.)
6176 rp='Try to use 64-bit integers, if available?'
6179 [yY]*) val="$define" ;;
6187 case "$use64bitall" in
6188 "$define"|true|[yY]*) dflt='y' ;;
6189 *) case "$longsize" in
6197 You may also choose to try maximal 64-bitness. It means using as much
6198 64-bitness as possible on the platform. This in turn means even more
6199 binary incompatibilities. On the other hand, your platform may not
6200 have any more 64-bitness available than what you already have chosen.
6202 If this doesn't make any sense to you, just accept the default '$dflt'.
6203 (The default has been chosen based on your configuration.)
6205 rp='Try to use maximal 64-bit support, if available?'
6208 [yY]*) val="$define" ;;
6213 case "$use64bitall" in
6215 case "$use64bitint" in
6219 Since you have chosen a maximally 64-bit build, I'm also turning on
6220 the use of 64-bit integers.
6222 use64bitint="$define" ;;
6227 : Look for a hint-file generated 'call-back-unit'. If the
6228 : user has specified that a 64-bit perl is to be built,
6229 : we may need to set or change some other defaults.
6230 if $test -f use64bitint.cbu; then
6231 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6234 case "$use64bitint" in
6235 "$define"|true|[yY]*)
6236 : This test was common to all the OpenBSD forks, and seems harmless for
6239 echo "Checking if your C library has broken 64-bit functions..." >&4
6242 typedef $uquadtype myULL;
6249 {4294967303.15, 4294967303ULL},
6250 {4294967294.2, 4294967294ULL},
6251 {4294967295.7, 4294967295ULL},
6254 for (p = test; p->u; p++) {
6255 myULL x = (myULL)p->d;
6266 if eval $compile_ok; then
6267 libcquad=`$run ./try`
6268 echo "Your C library's 64-bit functions are $libcquad."
6270 echo "(I can't seem to compile the test program.)"
6271 echo "Assuming that your C library's 64-bit functions are ok."
6280 *** You have a C library with broken 64-bit functions.
6281 *** 64-bit support does not work reliably in this configuration.
6282 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6283 *** Cannot continue, aborting.
6290 4) case "$archname64" in
6291 '') archname64=64int ;;
6298 : Look for a hint-file generated 'call-back-unit'. If the
6299 : user has specified that a maximally 64-bit perl is to be built,
6300 : we may need to set or change some other defaults.
6301 if $test -f use64bitall.cbu; then
6302 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6305 case "$use64bitall" in
6306 "$define"|true|[yY]*)
6308 4) case "$archname64" in
6309 ''|64int) archname64=64all ;;
6316 case "$d_quad:$use64bitint" in
6320 *** You have chosen to use 64-bit integers,
6321 *** but none can be found.
6322 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6323 *** Cannot continue, aborting.
6330 : Check if we are using the GNU C library
6332 echo "Checking for GNU C Library..." >&4
6334 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6335 alone are insufficient to distinguish different versions, such as
6336 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6337 libc version 2.1.0. A. Dougherty, June 3, 2002.
6343 # ifdef __GLIBC_MINOR__
6344 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6345 # include <gnu/libc-version.h>
6346 printf("%s\n", gnu_get_libc_version());
6348 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6351 printf("%d\n", __GLIBC__);
6360 if eval $compile_ok && $run ./try > glibc.ver; then
6362 gnulibc_version=`$cat glibc.ver`
6363 echo "You are using the GNU C Library version $gnulibc_version"
6367 echo "You are not using the GNU C Library"
6373 : see if nm is to be used to determine whether a symbol is defined or not
6377 case "$d_gnulibc" in
6380 echo "nm probably won't work on the GNU C Library." >&4
6386 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6388 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6389 echo "'nm' won't be sufficient on this system." >&4
6395 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6396 if $test $dflt -gt 20; then
6406 true|$define) dflt=y;;
6413 I can use $nm to extract the symbols from your C libraries. This
6414 is a time consuming task which may generate huge output on the disk (up
6415 to 3 megabytes) but that should make the symbols extraction faster. The
6416 alternative is to skip the 'nm' extraction part and to compile a small
6417 test program instead to determine whether each symbol is present. If
6418 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6419 this may be the best solution.
6421 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6424 rp="Shall I use $nm to extract C symbols from the libraries?"
6427 [Nn]*) usenm=false;;
6436 : nm options which may be necessary
6438 '') if $test -f /mach_boot; then
6440 elif $test -d /usr/ccs/lib; then
6441 nm_opt='-p' # Solaris (and SunOS?)
6442 elif $test -f /dgux; then
6444 elif $test -f /lib64/rld; then
6445 nm_opt='-p' # 64-bit Irix
6451 : nm options which may be necessary for shared libraries but illegal
6452 : for archive libraries. Thank you, Linux.
6453 case "$nm_so_opt" in
6454 '') case "$myuname" in
6456 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6457 nm_so_opt='--dynamic'
6464 : Figure out where the libc is located
6467 : get list of predefined functions in a handy place
6472 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6478 *) for thislib in $libs; do
6481 : Handle C library specially below.
6484 thislib=`echo $thislib | $sed -e 's/^-l//'`
6485 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6487 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6489 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6491 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6493 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6495 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6497 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6502 libnames="$libnames $try"
6504 *) libnames="$libnames $thislib" ;;
6513 for xxx in $libpth; do
6514 $test -r $1 || set $xxx/libc.$so
6515 : The messy sed command sorts on library version numbers.
6517 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6518 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6520 s/[0-9][0-9]*/0000&/g
6521 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6524 $sort | $sed -e 's/^.* //'`
6527 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6528 $test -r $1 || set $sysroot/lib/libsys_s$_a
6534 if $test -r "$1"; then
6535 echo "Your (shared) C library seems to be in $1."
6537 elif $test -r /lib/libc && $test -r /lib/clib; then
6538 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6540 libc='/lib/clib /lib/libc'
6541 if $test -r /lib/syslib; then
6542 echo "(Your math library is in /lib/syslib.)"
6543 libc="$libc /lib/syslib"
6545 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6546 echo "Your C library seems to be in $libc, as you said before."
6547 elif $test -r $incpath/usr/lib/libc$_a; then
6548 libc=$incpath/usr/lib/libc$_a;
6549 echo "Your C library seems to be in $libc. That's fine."
6550 elif $test -r /lib/libc$_a; then
6552 echo "Your C library seems to be in $libc. You're normal."
6554 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6556 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6557 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6558 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6560 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6562 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6565 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6567 if $test -r "$tans"; then
6568 echo "Your C library seems to be in $tans, of all places."
6574 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6578 If the guess above is wrong (which it might be if you're using a strange
6579 compiler, or your machine supports multiple models), you can override it here.
6584 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6586 I can't seem to find your C library. I've looked in the following places:
6589 $sed 's/^/ /' libpath
6592 None of these seems to contain your C library. I need to get its name...
6597 rp='Where is your C library?'
6602 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6603 set X `cat libnames`
6606 case $# in 1) xxx=file; esac
6607 echo "Extracting names from the following $xxx for later perusal:" >&4
6609 $sed 's/^/ /' libnames >&4
6611 $echo $n "This may take a while...$c" >&4
6615 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6616 *) $nm $nm_opt $file 2>/dev/null;;
6621 $grep fprintf libc.tmp > libc.ptf
6622 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6623 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6625 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6629 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6633 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6637 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6641 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6650 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6654 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6658 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6662 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6666 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6674 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6683 $nm -p $* 2>/dev/null >libc.tmp
6684 $grep fprintf libc.tmp > libc.ptf
6685 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6686 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6692 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6694 if $ar t $libc > libc.tmp && \
6695 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6697 for thisname in $libnames $libc; do
6698 $ar t $thisname >>libc.tmp
6700 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6702 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6703 for thisname in $libnames $libc; do
6704 $ar tv $thisname >>libc.tmp
6705 emximp -o tmp.imp $thisname \
6707 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6708 < tmp.imp >>libc.tmp
6711 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6714 echo "$ar didn't seem to work right." >&4
6715 echo "Maybe this is a Cray...trying bld instead..." >&4
6717 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6720 for thisname in $libnames; do
6722 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6723 $ar t $thisname >>libc.tmp
6727 echo "That didn't work either. Giving up." >&4
6737 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6738 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6740 *) if $test -f /lib/syscalls.exp; then
6742 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6743 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6744 /lib/syscalls.exp >>libc.list
6750 $rm -f libnames libpath
6752 : Check if we are using C++
6754 echo "Checking for C++..." >&4
6755 $cat >try.c <<'EOCP'
6767 if eval $compile_ok && $run ./try; then
6769 echo "You are using a C++ compiler."
6772 echo "You are not using a C++ compiler."
6778 : is a C symbol defined?
6781 -v) tf=libc.tmp; tdc="";;
6782 -a) tf=libc.tmp; tdc="[]";;
6783 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6785 case "$d_cplusplus" in
6786 $define) extern_C="extern \"C\"" ;;
6787 *) extern_C="extern" ;;
6790 case "$reuseval-$4" in
6792 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6797 if $test "$runnm" = true; then
6798 if $contains $tlook $tf >/dev/null 2>&1; then
6800 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6801 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6802 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6803 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6807 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6808 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6814 $define) tval=true;;
6821 : define an is-in-libc? function
6822 inlibc='echo " "; td=$define; tu=$undef;
6823 sym=$1; var=$2; eval "was=\$$2";
6825 case "$reuseval$was" in
6835 echo "$sym() found." >&4;
6836 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6838 echo "$sym() NOT found." >&4;
6839 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6843 $define) echo "$sym() found." >&4;;
6844 *) echo "$sym() NOT found." >&4;;
6848 : check for length of double
6850 case "$doublesize" in
6852 echo "Checking to see how big your double precision numbers are..." >&4
6861 printf("%d\n", (int)sizeof(double));
6866 if eval $compile_ok; then
6867 doublesize=`$run ./try`
6868 echo "Your double is $doublesize bytes long."
6871 echo "(I can't seem to compile the test program. Guessing...)"
6872 rp="What is the size of a double precision number (in bytes)?"
6880 : see if this is a float.h system
6884 : check for long doubles
6886 echo "Checking to see if you have long double..." >&4
6887 echo 'int main() { long double x = 7.0; }' > try.c
6889 if eval $compile; then
6891 echo "You have long double."
6894 echo "You do not have long double."
6900 : see if ldexpl exists
6904 : check for length of long double
6905 case "${d_longdbl}${longdblsize}" in
6908 echo "Checking to see how big your long doubles are..." >&4
6909 $cat >try.c <<'EOCP'
6913 printf("%d\n", sizeof(long double));
6918 if eval $compile; then
6919 longdblsize=`$run ./try`
6920 echo "Your long doubles are $longdblsize bytes long."
6924 echo "(I can't seem to compile the test program. Guessing...)" >&4
6925 rp="What is the size of a long double (in bytes)?"
6929 if $test "X$doublesize" = "X$longdblsize"; then
6930 echo "That isn't any different from an ordinary double."
6931 echo "I'll keep your setting anyway, but you may see some"
6932 echo "harmless compilation warnings."
6938 $echo "Checking the kind of long doubles you have..." >&4
6939 case "$d_longdbl" in
6944 #define LONGDBLSIZE $longdblsize
6945 #define DOUBLESIZE $doublesize
6953 static const long double d = -0.1L;
6955 unsigned const char* b = (unsigned const char*)(&d);
6956 #if DOUBLESIZE == LONGDBLSIZE
6957 printf("0\n"); /* if it floats like double */
6960 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6961 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6962 /* IEEE 754 128-bit little-endian */
6966 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6967 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6972 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6973 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6974 * cannot be trusted. */
6975 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6976 if (b[0] == 0xCD && b[9] == 0xBF) {
6977 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6978 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6979 * Also known as "extended precision". */
6983 if (b[0] == 0xBF && b[9] == 0xCD) {
6984 /* Is there ever big-endian 80-bit, really?
6986 * The Motorola 68881 had another "extended precision" format:
6987 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6988 * for total of 96 bits of bytes. The zero bits were unused.
6989 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6990 * If it ever becomes relevant, this format should be allocated
6991 * a new doublekind code since it's quite different from the Intel x87.
6997 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6998 /* software "double double", the 106 is 53+53.
6999 * but irix thinks it is 107. */
7000 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7001 /* double double 128-bit fully little-endian,
7002 * little-endian doubles in little-endian order,
7003 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7007 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7008 /* double double 128-bit fully big-endian,
7009 * big-endian doubles in big-endian order,
7010 * e.g. PPC/Power and MIPS:
7011 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7015 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7016 /* double double 128-bit mixed endian.
7017 * little-endian doubles in big-endian order,
7019 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7023 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7024 /* double double 128-bit mixed endian,
7025 * big-endian doubles in little-endian order,
7026 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7031 printf("-1\n"); /* unknown */
7036 if eval $compile; then
7037 longdblkind=`$run ./try`
7044 case "$longdblkind" in
7045 0) echo "Your long doubles are doubles." >&4 ;;
7046 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7047 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7048 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7049 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7050 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7051 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7052 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7053 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7054 *) echo "Cannot figure out your long double." >&4 ;;
7058 : determine the architecture name
7060 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7061 tarch=`arch`"-$osname"
7062 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7063 if uname -m > tmparch 2>&1 ; then
7064 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7065 -e 's/$/'"-$osname/" tmparch`
7073 case "$myarchname" in
7076 echo "(Your architecture name used to be $myarchname.)"
7080 case "$targetarch" in
7082 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7087 *) dflt="$archname";;
7089 rp='What is your architecture name'
7093 : optionally add API version to the architecture for versioned archlibs
7094 case "$useversionedarchname" in
7095 $define|true|[yY]*) dflt='y';;
7098 rp='Add the Perl API version to your archname?'
7101 y|Y) useversionedarchname="$define" ;;
7102 *) useversionedarchname="$undef" ;;
7104 case "$useversionedarchname" in
7107 *-$api_versionstring)
7108 echo "...and architecture name already has -$api_versionstring" >&4
7111 archname="$archname-$api_versionstring"
7112 echo "...setting architecture name to $archname." >&4
7118 case "$usethreads" in
7120 echo "Threads selected." >&4
7122 *-thread*) echo "...and architecture name already has -thread." >&4
7124 *) archname="$archname-thread"
7125 echo "...setting architecture name to $archname." >&4
7130 case "$usemultiplicity" in
7132 echo "Multiplicity selected." >&4
7134 *-multi*) echo "...and architecture name already has -multi." >&4
7136 *) archname="$archname-multi"
7137 echo "...setting architecture name to $archname." >&4
7142 case "$use64bitint$use64bitall" in
7144 case "$archname64" in
7146 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7149 case "$use64bitint" in
7150 "$define") echo "64 bit integers selected." >&4 ;;
7152 case "$use64bitall" in
7153 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7156 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7158 *) archname="$archname-$archname64"
7159 echo "...setting architecture name to $archname." >&4
7165 case "$uselongdouble" in
7167 echo "Long doubles selected." >&4
7168 case "$longdblsize" in
7170 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7174 *-ld*) echo "...and architecture name already has -ld." >&4
7176 *) archname="$archname-ld"
7177 echo "...setting architecture name to $archname." >&4
7184 case "$usequadmath" in
7186 echo "quadmath selected." >&4
7188 *-ld*) echo "...and architecture name already has -quadmath." >&4
7190 *) archname="$archname-quadmath"
7191 echo "...setting architecture name to $archname." >&4
7196 if $test -f archname.cbu; then
7197 echo "Your platform has some specific hints for architecture name, using them..."
7201 : set the prefixit variable, to compute a suitable default value
7202 prefixit='case "$3" in
7204 case "$oldprefix" in
7205 "") eval "$1=\"\$$2\"";;
7212 ""|" ") eval "$1=\"\$$2\"";;
7218 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7220 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7221 /*-$oldprefix/*|\~*-$oldprefix/*)
7222 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7223 *) eval "$1=\"\$$2\"";;
7227 : determine installation style
7228 : For now, try to deduce it from prefix unless it is already set.
7229 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7230 case "$installstyle" in
7231 '') case "$prefix" in
7232 *perl*) dflt='lib';;
7233 *) dflt='lib/perl5' ;;
7236 *) dflt="$installstyle" ;;
7238 : Probably not worth prompting for this since we prompt for all
7239 : the directories individually, and the prompt would be too long and
7243 : determine where public executables go
7248 rp='Pathname where the public executables will reside?'
7250 if $test "X$ansexp" != "X$binexp"; then
7254 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7255 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7256 : this via initialinstalllocation
7259 case "$userelocatableinc" in
7260 $define|true|[yY]*) dflt='y' ;;
7265 Would you like to build Perl so that the installation is relocatable, so that
7266 library paths in @INC are determined relative to the path of the perl binary?
7267 This is not advised for system Perl installs, or if you need to run setid
7268 scripts or scripts under taint mode.
7270 If this doesn't make any sense to you, just accept the default '$dflt'.
7272 rp='Use relocatable @INC?'
7275 y|Y) val="$define" ;;
7278 set userelocatableinc
7281 initialinstalllocation="$binexp"
7282 : Default prefix is now "up one level from where the binaries are"
7283 case "$userelocatableinc" in
7289 installprefixexp=".../.."
7293 : determine where private library files go
7294 : Usual default is /usr/local/lib/perl5/$version.
7295 : Also allow things like /opt/perl/lib/$version, since
7296 : /opt/perl/lib/perl5... would be redundant.
7297 : The default "style" setting is made in installstyle.U
7298 case "$installstyle" in
7299 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7300 *) set dflt privlib lib/$version ;;
7305 There are some auxiliary files for $package that need to be put into a
7306 private library directory that is accessible by everyone.
7311 rp='Pathname where the private library files will reside?'
7316 : set the prefixup variable, to restore leading tilda escape
7317 prefixup='case "$prefixexp" in
7319 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7322 : determine where public architecture dependent libraries go
7325 : privlib default is /usr/local/lib/$package/$version
7326 : archlib default is /usr/local/lib/$package/$version/$archname
7327 : privlib may have an optional trailing /share.
7328 tdflt=`echo $privlib | $sed 's,/share$,,'`
7329 tdflt=$tdflt/$archname
7338 $spackage contains architecture-dependent library files. If you are
7339 sharing libraries in a heterogeneous environment, you might store
7340 these files in a separate location. Otherwise, you can just include
7341 them with the rest of the public library files.
7346 rp='Where do you want to put the public architecture-dependent libraries?'
7350 if $test X"$archlib" = X"$privlib"; then
7356 : see if setuid scripts can be secure
7359 Some kernels have a bug that prevents setuid #! scripts from being
7360 secure. Some sites have disabled setuid #! scripts because of this.
7362 First let's decide if your kernel supports secure setuid #! scripts.
7363 (If setuid #! scripts would be secure but have been disabled anyway,
7364 don't say that they are secure if asked.)
7369 if $test -d /dev/fd; then
7370 echo "#!$ls" >reflect
7371 chmod +x,u+s reflect
7372 ./reflect >flect 2>&1
7373 if $contains "/dev/fd" flect >/dev/null; then
7374 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7378 If you are not sure if they are secure, I can check but I'll need a
7379 username and password different from the one you are using right now.
7380 If you don't have such a username or don't want me to test, simply
7384 rp='Other username to test security of setuid scripts with?'
7389 case "$d_suidsafe" in
7390 '') echo "I'll assume setuid scripts are *not* secure." >&4
7393 echo "Well, the $hint value is *not* secure." >&4
7395 *) echo "Well, the $hint value *is* secure." >&4
7400 $rm -f reflect flect
7401 echo "#!$ls" >reflect
7402 chmod +x,u+s reflect
7405 echo '"su" will (probably) prompt you for '"$ans's password."
7406 su $ans -c './reflect >flect'
7407 if $contains "/dev/fd" flect >/dev/null; then
7408 echo "Okay, it looks like setuid scripts are secure." >&4
7411 echo "I don't think setuid scripts are secure." >&4
7416 rp='Does your kernel have *secure* setuid scripts?'
7419 [yY]*) val="$define";;
7424 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7425 echo "(That's for file descriptors, not floppy disks.)"
7431 $rm -f reflect flect
7433 : now see if they want to do setuid emulation
7434 if $test $patchlevel -lt 11; then
7437 case "$d_suidsafe" in
7440 echo "No need to emulate SUID scripts since they are secure here." >&4
7444 Some systems have disabled setuid scripts, especially systems where
7445 setuid scripts cannot be secure. On systems where setuid scripts have
7446 been disabled, the setuid/setgid bits on scripts are currently
7447 useless. It is possible for $package to detect those bits and emulate
7448 setuid/setgid in a secure fashion. This emulation will only work if
7449 setuid scripts have been disabled in your kernel.
7453 "$define") dflt=y ;;
7456 rp="Do you want to do setuid/setgid emulation?"
7459 [yY]*) val="$define";;
7471 SUID emulation has been removed for 5.12
7472 Please re-run Configure without -Dd_dosuid
7481 : Find perl5.005 or later.
7482 echo "Looking for a previously installed perl5.005 or later... "
7484 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7485 : Check if this perl is recent and can load a simple module
7486 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7489 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7499 '') echo "None found. That's ok.";;
7500 *) echo "Using $perl5." ;;
7503 : Set the siteprefix variables
7506 After $package is installed, you may wish to install various
7507 add-on modules and utilities. Typically, these add-ons will
7508 be installed under $prefix with the rest
7509 of this package. However, you may wish to install such add-ons
7510 elsewhere under a different prefix.
7512 If you do not wish to put everything under a single prefix, that's
7513 ok. You will be prompted for the individual locations; this siteprefix
7514 is only used to suggest the defaults.
7516 The default should be fine for most people.
7520 rp='Installation prefix to use for add-on modules and utilities?'
7521 : XXX Here might be another good place for an installstyle setting.
7522 case "$siteprefix" in
7524 *) dflt=$siteprefix ;;
7527 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7529 case "$siteprefix" in
7533 *) oldsiteprefix="$prefix";;
7538 siteprefixexp="$ansexp"
7540 : determine where site specific libraries go.
7541 : Usual default is /usr/local/lib/perl5/site_perl/$version
7542 : The default "style" setting is made in installstyle.U
7543 : XXX No longer works with Prefixit stuff.
7544 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7546 '') case "$installstyle" in
7547 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7548 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7556 The installation process will create a directory for
7557 site-specific extensions and modules. Most users find it convenient
7558 to place all site-specific files in this directory rather than in the
7559 main distribution directory.
7563 rp='Pathname for the site-specific library files?'
7567 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7569 : Determine list of previous versions to include in @INC
7570 $cat > getverlist <<EOPL
7573 \$api_versionstring = "$api_versionstring";
7574 \$version = "$version";
7575 \$stem = "$sitelib_stem";
7576 \$archname = "$archname";
7578 $cat >> getverlist <<'EOPL'
7579 # The list found is store twice for each entry: the original name, and
7580 # the binary broken down version as pack "sss", so sorting is easy and
7581 # unambiguous. This will work for all versions that have a maximum of
7582 # three digit groups, separate by '.'s or '_'s. Names are extended with
7583 # ".0.0" to ensure at least three elements for the pack.
7584 # -- H.Merijn Brand (m)'06 23-10-2006
7586 # Can't have leading @ because metaconfig interprets it as a command!
7587 ;@inc_version_list=();
7588 # XXX Redo to do opendir/readdir?
7591 ;@candidates = map {
7592 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7593 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7599 ($pversion, $aversion, $vsn5005) = map {
7600 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7601 foreach $d (@candidates) {
7602 if ($d->[1] lt $pversion) {
7603 if ($d->[1] ge $aversion) {
7604 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7606 elsif ($d->[1] ge $vsn5005) {
7607 unshift(@inc_version_list, grep { -d } $d->[0]);
7611 # Skip newer version. I.e. don't look in
7612 # 5.7.0 if we're installing 5.6.1.
7616 if (@inc_version_list) {
7617 print join(' ', @inc_version_list);
7620 # Blank space to preserve value for next Configure run.
7625 case "$inc_version_list" in
7626 '') if test -x "$perl5$exe_ext"; then
7627 dflt=`$perl5 getverlist`
7632 $undef) dflt='none' ;;
7633 *) eval dflt=\"$inc_version_list\" ;;
7636 ''|' ') dflt=none ;;
7643 In order to ease the process of upgrading, this version of perl
7644 can be configured to use modules built and installed with earlier
7645 versions of perl that were installed under $prefix. Specify here
7646 the list of earlier versions that this version of perl should check.
7647 If Configure detected no earlier versions of perl installed under
7648 $prefix, then the list will be empty. Answer 'none' to tell perl
7649 to not search earlier versions.
7651 The default should almost always be sensible, so if you're not sure,
7652 just accept the default.
7655 rp='List of earlier versions to include in @INC?'
7658 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7659 *) inc_version_list="$ans" ;;
7661 case "$inc_version_list" in
7663 inc_version_list_init='0'
7664 d_inc_version_list="$undef"
7666 *) inc_version_list_init=`echo $inc_version_list |
7667 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7668 d_inc_version_list="$define"
7673 : see if malloc/malloc.h has to be included
7674 set malloc/malloc.h i_mallocmalloc
7677 : see if this is a malloc.h system
7678 : we want a real compile instead of Inhdr because some systems have a
7679 : malloc.h that just gives a compile error saying to use stdlib.h instead
7684 #$i_mallocmalloc I_MALLOCMALLOC
7685 #ifdef I_MALLOCMALLOC
7686 # include <malloc/malloc.h>
7689 int main () { return 0; }
7692 if eval $compile; then
7693 echo "<malloc.h> found." >&4
7696 echo "<malloc.h> NOT found." >&4
7703 : check for length of pointer
7707 echo "Checking to see how big your pointers are..." >&4
7716 printf("%d\n", (int)sizeof(void *));
7721 if eval $compile_ok; then
7722 ptrsize=`$run ./try`
7723 echo "Your pointers are $ptrsize bytes long."
7726 echo "(I can't seem to compile the test program. Guessing...)" >&4
7727 rp="What is the size of a pointer (in bytes)?"
7734 case "$use64bitall" in
7735 "$define"|true|[yY]*)
7739 *** You have chosen a maximally 64-bit build,
7740 *** but your pointers are only 4 bytes wide.
7741 *** Please rerun Configure without -Duse64bitall.
7746 *** Since you have quads, you could possibly try with -Duse64bitint.
7751 *** Cannot continue, aborting.
7762 : determine whether to use malloc wrapping
7764 case "$usemallocwrap" in
7765 [yY]*|true|$define) dflt='y' ;;
7766 [nN]*|false|$undef) dflt='n' ;;
7767 *) case "$usedevel" in
7768 [yY]*|true|$define) dflt='y' ;;
7773 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7775 usemallocwrap="$ans"
7778 usemallocwrap="$define" ;;
7780 usemallocwrap="$undef" ;;
7783 : determine which malloc to compile in
7785 case "$usemymalloc" in
7786 [yY]*|true|$define) dflt='y' ;;
7787 [nN]*|false|$undef) dflt='n' ;;
7788 *) case "$ptrsize" in
7792 if test "$useithreads" = "$define"; then dflt='n'; fi
7795 rp="Do you wish to attempt to use the malloc that comes with $package?"
7801 mallocsrc='malloc.c'
7802 mallocobj="malloc$_o"
7803 d_mymalloc="$define"
7806 : Remove malloc from list of libraries to use
7807 echo "Removing unneeded -lmalloc from library list" >&4
7808 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7811 echo "libs = $libs" >&4
7823 : compute the return types of malloc and free
7825 $cat >malloc.c <<END
7829 #include <sys/types.h>
7843 case "$malloctype" in
7845 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7852 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7856 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7863 echo "Your system uses $freetype free(), it would seem." >&4
7865 : determine where site specific architecture-dependent libraries go.
7866 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7867 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7868 : sitelib may have an optional trailing /share.
7870 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7871 dflt="$dflt/$archname"
7876 set sitearch sitearch none
7880 The installation process will also create a directory for
7881 architecture-dependent site-specific extensions and modules.
7885 rp='Pathname for the site-specific architecture-dependent library files?'
7889 if $test X"$sitearch" = X"$sitelib"; then
7892 d_sitearch="$define"
7895 : Set the vendorprefix variables
7898 The installation process will also create a directory for
7899 vendor-supplied add-ons. Vendors who supply perl with their system
7900 may find it convenient to place all vendor-supplied files in this
7901 directory rather than in the main distribution directory. This will
7902 ease upgrades between binary-compatible maintenance versions of perl.
7904 Of course you may also use these directories in whatever way you see
7905 fit. For example, you might use them to access modules shared over a
7906 company-wide network.
7908 The default answer should be fine for most people.
7909 This causes further questions about vendor add-ons to be skipped
7910 and no vendor-specific directories will be configured for perl.
7913 rp='Do you want to configure vendor-specific add-on directories?'
7914 case "$usevendorprefix" in
7915 define|true|[yY]*) dflt=y ;;
7916 *) : User may have set vendorprefix directly on Configure command line.
7917 case "$vendorprefix" in
7926 rp='Installation prefix to use for vendor-supplied add-ons?'
7927 case "$vendorprefix" in
7928 '') dflt="$prefix" ;;
7929 *) dflt=$vendorprefix ;;
7932 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7934 case "$vendorprefix" in
7938 *) oldvendorprefix="$prefix";;
7942 usevendorprefix="$define"
7944 vendorprefixexp="$ansexp"
7946 *) usevendorprefix="$undef"
7952 : Set the vendorlib variables
7953 case "$vendorprefix" in
7954 '') d_vendorlib="$undef"
7958 *) d_vendorlib="$define"
7959 : determine where vendor-supplied modules go.
7960 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7961 case "$vendorlib" in
7963 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7964 case "$installstyle" in
7965 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7966 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7969 *) dflt="$vendorlib"
7973 rp='Pathname for the vendor-supplied library files?'
7976 vendorlibexp="$ansexp"
7979 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7983 : Set the vendorarch variables
7984 case "$vendorprefix" in
7985 '') d_vendorarch="$undef"
7989 *) d_vendorarch="$define"
7990 : determine where vendor-supplied architecture-dependent libraries go.
7991 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7992 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7993 : vendorlib may have an optional trailing /share.
7994 case "$vendorarch" in
7995 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7996 dflt="$dflt/$archname"
7998 *) dflt="$vendorarch" ;;
8001 rp='Pathname for vendor-supplied architecture-dependent files?'
8004 vendorarchexp="$ansexp"
8007 prefixvar=vendorarch
8009 if $test X"$vendorarch" = X"$vendorlib"; then
8010 d_vendorarch="$undef"
8012 d_vendorarch="$define"
8015 : Final catch-all directories to search
8018 Lastly, you can have perl look in other directories for extensions and
8019 modules in addition to those already specified.
8020 These directories will be searched after
8024 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8025 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8027 case "$otherlibdirs" in
8028 ''|' ') dflt='none' ;;
8029 *) dflt="$otherlibdirs" ;;
8032 Enter a colon-separated set of extra paths to include in perl's @INC
8033 search path, or enter 'none' for no extra paths.
8037 rp='Colon-separated list of additional directories for perl to search?'
8040 ' '|''|none) otherlibdirs=' ' ;;
8041 *) otherlibdirs="$ans" ;;
8043 case "$otherlibdirs" in
8047 set d_perl_otherlibdirs
8050 : Cruising for prototypes
8052 echo "Checking out function prototypes..." >&4
8053 $cat >prototype.c <<EOCP
8058 int main(int argc, char *argv[]) {
8061 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8062 echo "Your C compiler appears to support function prototypes."
8065 echo "Your C compiler doesn't seem to understand function prototypes."
8072 : Check if ansi2knr is required
8073 case "$prototype" in
8075 *) ansi2knr='ansi2knr'
8080 This version of $package can only be compiled by a compiler that
8081 understands function prototypes. Unfortunately, your C compiler
8083 doesn't seem to understand them. Sorry about that.
8085 If GNU cc is available for your system, perhaps you could try that instead.
8087 Eventually, we hope to support building Perl with pre-ANSI compilers.
8088 If you would like to help in that effort, please contact <perlbug@perl.org>.
8090 Aborting Configure now.
8097 dflt_dtrace='/usr/sbin/dtrace'
8098 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8102 Perl can be built to support DTrace on platforms that support it.
8103 DTrace is a diagnosis and performance analysis tool from Sun.
8105 If this doesn't make any sense to you, just accept the default.
8109 case "$usedtrace" in
8115 dflt_dtrace=$usedtrace
8122 rp='Support DTrace if available?'
8125 y|Y) val="$define" ;;
8131 test "X$usedtrace" != "X$define" && break
8134 rp='Where is the dtrace executable?'
8143 if $dtrace -h -s ../perldtrace.d \
8144 -o perldtrace.tmp >/dev/null 2>&1 \
8145 && rm -f perldtrace.tmp
8148 echo "Good: your $dtrace knows about the -h flag."
8152 *** $me: Fatal Error: $dtrace doesn't support -h flag
8154 *** Your installed dtrace doesn't support the -h switch to compile a D
8155 *** program into a C header. Can't continue.
8167 *** $me: Fatal Error: $dtrace not found.
8174 echo "*** $dtrace was not found."
8180 : See if we want extra modules installed
8187 Perl can be built with extra modules or bundles of modules which
8188 will be fetched from the CPAN and installed alongside Perl.
8190 Notice that you will need access to the CPAN; either via the Internet,
8191 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8192 be asked later to configure the CPAN.pm module which will in turn do
8193 the installation of the rest of the extra modules or bundles.)
8195 Notice also that if the modules require any external software such as
8196 libraries and headers (the libz library and the zlib.h header for the
8197 Compress::Zlib module, for example) you MUST have any such software
8198 already installed, this configuration process will NOT install such
8201 If this doesn't make any sense to you, just accept the default '$dflt'.
8203 rp='Install any extra modules (y or n)?'
8209 Please list any extra modules or bundles to be installed from CPAN,
8210 with spaces between the names. The names can be in any format the
8211 'install' command of CPAN.pm will understand. (Answer 'none',
8212 without the quotes, to install no extra modules or bundles.)
8222 $rm -f ../extras.lst
8224 *) echo "(Saving the list of extras for later...)"
8225 echo "$extras" > ../extras.lst
8233 : determine where html pages for programs go
8234 set html1dir html1dir none
8238 If you wish to install html files for programs in $spackage, indicate
8239 the appropriate directory here. To skip installing html files,
8243 ''|none|$undef|' ') dflt=none ;;
8244 *) dflt=$html1dir ;;
8247 rp="Directory for the main $spackage html pages?"
8251 : Use ' ' for none so value is preserved next time through Configure
8252 $test X"$html1dir" = "X" && html1dir=' '
8254 : determine where html pages for libraries and modules go
8255 set html3dir html3dir none
8259 If you wish to install html files for modules associated with $spackage,
8260 indicate the appropriate directory here. To skip installing html files,
8263 : There is no obvious default. If they have specified html1dir, then
8264 : try to key off that, possibly changing .../html1 into .../html3.
8266 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8267 *) dflt=$html3dir ;;
8270 rp="Directory for the $spackage module html pages?"
8274 : Use ' ' for none so value is preserved next time through Configure
8275 $test X"$html3dir" = "X" && html3dir=' '
8277 : determine whether to install perl also as /usr/bin/perl
8280 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8282 Many scripts expect perl to be installed as /usr/bin/perl.
8284 If you want to, I can install the perl you are about to compile
8285 as /usr/bin/perl (in addition to $bin/perl).
8287 if test -f /usr/bin/perl; then
8290 However, please note that because you already have a /usr/bin/perl,
8291 overwriting that with a new Perl would very probably cause problems.
8292 Therefore I'm assuming you don't want to do that (unless you insist).
8295 case "$installusrbinperl" in
8296 "$define"|[yY]*) dflt='y';;
8302 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8305 case "$installusrbinperl" in
8306 "$undef"|[nN]*) dflt='n';;
8310 rp="Do you want to install perl as /usr/bin/perl?"
8313 [yY]*) val="$define";;
8319 set installusrbinperl
8322 : see if dlopen exists
8324 xxx_ccflags="$ccflags"
8326 : with g++ one needs -shared to get is-in-libc to work for dlopen
8327 case "$gccversion" in
8330 *) case "$d_cplusplus" in
8331 "$define") ccflags="$ccflags -shared" ;;
8338 ccflags="$xxx_ccflags"
8340 : see if this is a unistd.h system
8341 set unistd.h i_unistd
8344 : determine which dynamic loading, if any, to compile in
8346 dldir="ext/DynaLoader"
8359 $define) dflt='y' ;;
8361 : Does a dl_xxx.xs file exist for this operating system
8362 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8365 rp="Do you wish to use dynamic loading?"
8372 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8373 dflt="$dldir/dl_${osname}.xs"
8374 elif $test "$d_dlopen" = "$define" ; then
8375 dflt="$dldir/dl_dlopen.xs"
8380 *) dflt="$dldir/$dlsrc"
8383 echo "The following dynamic loading files are available:"
8384 : Can not go over to $dldir because getfile has path hard-coded in.
8385 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8386 rp="Source file to use for dynamic loading"
8392 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8396 Some systems may require passing special flags to $cc -c to
8397 compile modules that will be used to create a shared library.
8398 To use no flags, say "none".
8401 case "$cccdlflags" in
8402 '') case "$gccversion" in
8403 '') case "$osname" in
8405 irix*) dflt='-KPIC' ;;
8406 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8407 sunos) dflt='-pic' ;;
8411 *) case "$osname" in
8412 darwin) dflt='none' ;;
8413 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8418 *) dflt="$cccdlflags" ;;
8425 # If -Dsysroot was specified, now's the time to add it
8427 if test "X$sysroot" != X; then
8428 case "$gccversion" in
8433 dflt="$dflt --sysroot=$sysroot" ;;
8443 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8446 none) cccdlflags=' ' ;;
8447 *) cccdlflags="$ans" ;;
8452 Some systems use ld to create libraries that can be dynamically loaded,
8453 while other systems (such as those using ELF) use $cc.
8457 : Determine if this is ELF
8459 /* Test for whether ELF binaries are produced */
8471 int i = open("a.out",O_RDONLY);
8474 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8475 exit(0); /* succeed (yes, it is ELF) */
8479 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8485 '') if $test $bin_ELF = "$define"; then
8487 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8491 echo "I'll use ld to build dynamic libraries."
8499 rp="What command should be used to create dynamic libraries?"
8505 Some systems may require passing special flags to $ld to create a
8506 library that can be dynamically loaded. If your ld flags include
8507 -L/other/path options to locate libraries outside your loader's normal
8508 search path, you may need to specify those -L options here as well. To
8509 use no flags, say "none".
8512 case "$lddlflags" in
8513 '') case "$osname" in
8514 haiku) dflt='-shared' ;;
8516 case "$gccversion" in
8517 '') dflt="$dflt +vnocompatwarnings" ;;
8520 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8521 solaris) # See [perl #66604].
8522 # On Solaris 11, gcc -m64 on amd64
8523 # appears not to understand -G. gcc versions at
8524 # least as old as 3.4.3 support -shared, so just
8525 # use that with Solaris 11 and later, but keep
8526 # the old behavior for older Solaris versions.
8527 case "$gccversion" in
8529 *) case "$osvers" in
8530 2.?|2.10) dflt='-G' ;;
8531 *) dflt='-shared' ;;
8536 sunos) dflt='-assert nodefinitions' ;;
8537 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8541 *) dflt="$lddlflags" ;;
8544 : Only do this for gcc, since, for example, qcc has no concept
8546 if $test "X$sysroot" != X; then
8547 case "$gccversion" in
8549 *) dflt="$dflt --sysroot $sysroot" ;;
8553 : Try to guess additional flags to pick up local libraries.
8554 : Be careful not to append to a plain 'none'
8558 for thisflag in $ldflags; do
8563 *) dflt="$dflt $thisflag" ;;
8570 ''|' ') dflt='none' ;;
8574 *-fstack-protector-strong*)
8576 *-fstack-protector-strong*) ;; # Don't add it again
8577 *) dflt="$dflt -fstack-protector-strong" ;;
8580 *-fstack-protector*)
8582 *-fstack-protector*) ;; # Don't add it again
8583 *) dflt="$dflt -fstack-protector" ;;
8588 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8591 none) lddlflags=' ' ;;
8592 *) lddlflags="$ans" ;;
8597 Some systems may require passing special flags to $cc to indicate that
8598 the resulting executable will use dynamic linking. To use no flags,
8602 case "$ccdlflags" in
8603 '') case "$osname" in
8604 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8605 sunos) dflt='none' ;;
8609 *) dflt="$ccdlflags" ;;
8611 rp="Any special flags to pass to $cc to use dynamic linking?"
8614 none) ccdlflags=' ' ;;
8615 *) ccdlflags="$ans" ;;
8627 ld_can_script="$undef"
8628 case "$bin_ELF$usedl" in
8630 # Abuse try.h and a.out names for neat cleanup
8642 if $cc $cccdlflags $ccdlflags $ccflags \
8643 $ldflags $lddlflags -o a.out try.c \
8644 -Wl,--version-script=try.h >/dev/null 2>&1 \
8645 && $test -s a.out ; then
8646 echo "ld supports scripting" >&4
8647 ld_can_script="$define"
8649 echo "ld does not support scripting" >&4
8655 : Do we want a shared libperl?
8659 # No dynamic loading being used, so don't bother even to prompt.
8662 *) case "$useshrplib" in
8663 '') case "$osname" in
8664 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8666 also='Building a shared libperl is required for dynamic loading to work on your system.'
8680 The perl executable is normally obtained by linking perlmain.c with
8681 libperl${_a}, any static extensions (usually just DynaLoader), and
8682 any other libraries needed on this system (such as -lm, etc.). Since
8683 your system supports dynamic loading, it is probably possible to build
8684 a shared libperl.$so. If you will have more than one executable linked
8685 to libperl.$so, this will significantly reduce the size of each
8686 executable, but it may have a noticeable effect on performance. The
8687 default is probably sensible for your system.
8691 rp="Build a shared libperl.$so (y/n)"
8695 useshrplib='true' ;;
8696 *) useshrplib='false' ;;
8701 case "$useshrplib" in
8703 case "$userelocatableinc" in
8705 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8706 echo "See INSTALL for an explanation why that won't work." >&4
8712 # Figure out a good name for libperl.so. Since it gets stored in
8713 # a version-specific architecture-dependent library, the version
8714 # number isn't really that important, except for making cc/ld happy.
8716 # A name such as libperl.so.10.1
8717 majmin="libperl.$so.$patchlevel.$subversion"
8718 # A name such as libperl.so.100
8719 majonly=`echo $patchlevel $subversion |
8720 $awk '{printf "%d%02d", $1, $2}'`
8721 majonly=libperl.$so.$majonly
8722 # I'd prefer to keep the os-specific stuff here to a minimum, and
8723 # rely on figuring it out from the naming of libc.
8724 case "${osname}${osvers}" in
8725 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8728 cygwin*) # ld links now against the dll directly
8729 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8730 majonly=`echo $patchlevel $subversion |
8731 $awk '{printf "%03d%03d", $1, $2}'`
8732 majonly=cygperl5.$majonly.$so
8735 *) # Try to guess based on whether libc has major.minor.
8737 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8738 *libc.$so.[0-9]*) dflt=$majonly ;;
8739 *) dflt=libperl.$so ;;
8749 I need to select a good name for the shared libperl. If your system uses
8750 library names with major and minor numbers, then you might want something
8751 like $majmin. Alternatively, if your system uses a single version
8752 number for shared libraries, then you might want to use $majonly.
8753 Or, your system might be quite happy with a simple libperl.$so.
8755 Since the shared libperl will get installed into a version-specific
8756 architecture-dependent directory, the version number of the shared perl
8757 library probably isn't important, so the default should be o.k.
8760 rp='What name do you want to give to the shared libperl?'
8763 echo "Ok, I'll use $libperl"
8766 libperl="libperl${_a}"
8770 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8774 WARNING: Use of the shrpdir variable for the installation location of
8775 the shared $libperl is not supported. It was never documented and
8776 will not work in this version. Let me (perlbug@perl.org)
8777 know of any problems this may cause.
8783 But your current setting of $shrpdir is
8784 the default anyway, so it's harmless.
8789 Further, your current attempted setting of $shrpdir
8790 conflicts with the value of $archlibexp/CORE
8791 that installperl will use.
8798 # How will the perl executable find the installed shared $libperl?
8799 # Add $xxx to ccdlflags.
8800 # If we can't figure out a command-line option, use $shrpenv to
8801 # set env LD_RUN_PATH. The main perl makefile uses this.
8802 shrpdir=$archlibexp/CORE
8805 if "$useshrplib"; then
8808 # We'll set it in Makefile.SH...
8813 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8814 xxx="-Wl,-R$shrpdir"
8816 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8817 xxx="-Wl,-rpath,$shrpdir"
8820 # hpux doesn't like the default, either.
8821 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8824 # cygwin needs only ldlibpth
8827 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8833 # Only add $xxx if it isn't already in ccdlflags.
8834 case " $ccdlflags " in
8836 *) ccdlflags="$ccdlflags $xxx"
8839 Adding $xxx to the flags
8840 passed to $ld so that the perl executable will find the
8841 installed shared $libperl.
8849 # Fix ccdlflags in AIX for building external extensions.
8850 # (For building Perl itself bare -bE:perl.exp is needed,
8851 # Makefile.SH takes care of this.)
8853 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8855 # Respect a hint or command-line value.
8857 '') shrpenv="$tmp_shrpenv" ;;
8859 case "$ldlibpthname" in
8860 '') ldlibpthname=LD_LIBRARY_PATH ;;
8861 none) ldlibpthname='' ;;
8864 : determine where manual pages are on this system
8868 syspath='/usr/share/man/man1 /usr/man/man1'
8869 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8870 syspath="$syspath /usr/man/u_man/man1"
8871 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8872 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8873 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8874 sysman=`./loc . /usr/man/man1 $syspath`
8877 if $test -d "$sysman"; then
8878 echo "System manual is in $sysman." >&4
8880 echo "Could not find manual pages in source form." >&4
8883 : determine where manual pages go
8884 set man1dir man1dir none
8888 $spackage has manual pages available in source form.
8892 echo "However, you don't have nroff, so they're probably useless to you."
8894 '') man1dir="none";;
8897 echo "If you don't want the manual sources installed, answer 'none'."
8902 lookpath="$prefixexp/share/man/man1"
8903 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8904 lookpath="$lookpath $prefixexp/man/p_man/man1"
8905 lookpath="$lookpath $prefixexp/man/u_man/man1"
8906 lookpath="$lookpath $prefixexp/man/man.1"
8908 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8909 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8919 rp="Where do the main $spackage manual pages (source) go?"
8921 if $test "X$man1direxp" != "X$ansexp"; then
8932 : What suffix to use on installed man pages
8939 rp="What suffix should be used for the main $spackage man pages?"
8941 '') case "$man1dir" in
8955 *) dflt="$man1ext";;
8962 : see if we can have long filenames
8964 first=123456789abcdef
8966 if (echo hi >$first) 2>/dev/null; then
8967 if $test -f 123456789abcde; then
8968 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8971 echo 'You can have filenames longer than 14 characters.'>&4
8976 You can't have filenames longer than 14 chars.
8977 You can't even think about them!
8983 $rm -rf 123456789abcde*
8985 : determine where library module manual pages go
8986 set man3dir man3dir none
8990 $spackage has manual pages for many of the library modules.
8996 However, you don't have nroff, so they're probably useless to you.
8999 '') man3dir="none";;
9003 case "$d_flexfnam" in
9006 However, your system can't handle the long file names like File::Basename.3.
9009 '') man3dir="none";;
9013 echo "If you don't want the manual sources installed, answer 'none'."
9014 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9016 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9017 if $test -d "$privlib/man/man3"; then
9020 WARNING: Previous versions of perl installed man3 pages into
9021 $privlib/man/man3. This version will suggest a
9022 new default of $dflt.
9026 rp='Do you wish to preserve the old behavior?(y/n)'
9029 y*) dflt="$privlib/man/man3" ;;
9034 *) dflt="$man3dir" ;;
9041 rp="Where do the $package library man pages (source) go?"
9051 : What suffix to use on installed man pages
9057 rp="What suffix should be used for the $package library man pages?"
9059 '') case "$man3dir" in
9073 *) dflt="$man3ext";;
9080 : see if we have to deal with yellow pages, now NIS.
9081 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9087 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9095 rp='Are you getting the hosts file via yellow pages?'
9098 y*) hostcat='ypcat hosts';;
9099 *) hostcat='cat /etc/hosts';;
9105 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9108 '') test -f /etc/group && groupcat='cat /etc/group';;
9111 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9114 : now get the host name
9116 echo "Figuring out host name..." >&4
9117 case "$myhostname" in
9119 echo 'Maybe "hostname" will work...'
9120 if tans=`sh -c hostname 2>&1` ; then
9128 if $test "$cont"; then
9130 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9131 if tans=`cat /etc/systemid 2>&1` ; then
9133 phostname='cat /etc/systemid'
9134 echo "Whadyaknow. Xenix always was a bit strange..."
9137 elif $test -r /etc/systemid; then
9138 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9141 if $test "$cont"; then
9142 echo 'No, maybe "uuname -l" will work...'
9143 if tans=`sh -c 'uuname -l' 2>&1` ; then
9145 phostname='uuname -l'
9147 echo 'Strange. Maybe "uname -n" will work...'
9148 if tans=`sh -c 'uname -n' 2>&1` ; then
9150 phostname='uname -n'
9152 echo 'Oh well, maybe I can mine it out of whoami.h...'
9153 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9154 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9155 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9157 case "$myhostname" in
9158 '') echo "Does this machine have an identity crisis or something?"
9161 echo "Well, you said $myhostname before..."
9162 phostname='echo $myhostname';;
9168 case "$myhostname" in
9169 '') myhostname=noname ;;
9171 : you do not want to know about this
9176 if $test "$myhostname" ; then
9178 rp='Your host name appears to be "'$myhostname'".'" Right?"
9186 : bad guess or no guess
9187 while $test "X$myhostname" = X ; do
9189 rp="Please type the (one word) name of your host:"
9194 : translate upper to lower if necessary
9195 case "$myhostname" in
9197 echo "(Normalizing case in your host name)"
9198 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9202 case "$myhostname" in
9204 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9205 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9206 echo "(Trimming domain name from host name--host name is now $myhostname)"
9208 *) case "$mydomain" in
9211 test "X$hostcat" = "Xypcat hosts" &&
9212 ypmatch "$myhostname" hosts 2>/dev/null |\
9213 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9216 test "X$hostcat" != "X" &&
9217 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9218 /[ ]$myhostname[ . ]/p" > hosts
9221 if $test -f hosts; then
9222 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9223 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9224 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9225 hosts | $sort | $uniq | \
9226 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9227 case `$echo X$dflt` in
9228 X*\ *) echo "(Several hosts in the database matched hostname)"
9231 X.) echo "(You do not have fully-qualified names in the hosts database)"
9235 echo "(I cannot locate a hosts database anywhere)"
9240 tans=`./loc resolv.conf X /etc /usr/etc`
9241 if $test -f "$tans"; then
9242 echo "(Attempting domain name extraction from $tans)"
9243 dflt=.`$sed -n -e 's/ / /g' \
9244 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9247 .) dflt=.`$sed -n -e 's/ / /g' \
9248 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9256 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9257 dflt=.`sh -c domainname 2>/dev/null`
9260 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9264 case "$dflt$osname" in
9265 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9266 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9270 .) echo "(Lost all hope -- silly guess then)"
9276 *) dflt="$mydomain";;
9280 rp="What is your domain name?"
9290 : translate upper to lower if necessary
9293 echo "(Normalizing case in your domain name)"
9294 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9298 : a little sanity check here
9299 case "$phostname" in
9302 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9303 $myhostname$mydomain|$myhostname) ;;
9305 case "$phostname" in
9307 echo "(That doesn't agree with your whoami.h file, by the way.)"
9310 echo "(That doesn't agree with your $phostname command, by the way.)"
9318 : determine the e-mail address of the user who is running us
9321 I need to get your e-mail address in Internet format if possible, i.e.
9322 something like user@host.domain. Please answer accurately since I have
9323 no easy means to double check it. The default value provided below
9324 is most probably close to reality but may not be valid from outside
9325 your organization...
9329 while test "$cont"; do
9330 case "$MAILDOMAIN" in
9332 if $test -s /etc/mailname; then
9333 maildomain=`$cat /etc/mailname`
9335 maildomain="$myhostname$mydomain"
9338 *) maildomain="$MAILDOMAIN";;
9341 '') dflt="$cf_by@$maildomain";;
9342 *) dflt="$cf_email";;
9344 rp='What is your e-mail address?'
9350 rp='Address does not look like an Internet one. Use it anyway?'
9364 : Ask e-mail of administrator
9367 If you or somebody else will be maintaining perl at your site, please
9368 fill in the correct e-mail address here so that they may be contacted
9369 if necessary. Currently, the "perlbug" program included with perl
9370 will send mail to this address in addition to perlbug@perl.org. You may
9371 enter "none" for no administrator.
9374 case "$perladmin" in
9375 '') dflt="$cf_email";;
9376 *) dflt="$perladmin";;
9378 rp='Perl administrator e-mail address'
9382 : determine whether to only install version-specific parts.
9385 Do you want to install only the version-specific parts of the perl
9386 distribution? Usually you do *not* want to do this.
9388 case "$versiononly" in
9389 "$define"|[Yy]*|true) dflt='y' ;;
9392 rp="Do you want to install only the version-specific parts of perl?"
9395 [yY]*) val="$define";;
9401 case "$versiononly" in
9402 "$define") inc_version_list=''
9403 inc_version_list_init=0
9407 : figure out how to guarantee perl startup
9408 : XXX Note that this currently takes advantage of the bug that binexp ignores
9409 : the Configure -Dinstallprefix setting, which in turn means that under
9410 : relocatable @INC, initialinstalllocation is what binexp started as.
9411 case "$startperl" in
9413 case "$sharpbang" in
9417 I can use the #! construct to start perl on your system. This will
9418 make startup of perl scripts faster, but may cause problems if you
9419 want to share those scripts and perl is not in a standard place
9420 ($initialinstalllocation/perl) on all your platforms. The alternative
9421 is to force a shell by starting the script with a single ':' character.
9424 case "$versiononly" in
9425 "$define") dflt="$initialinstalllocation/perl$version";;
9426 *) dflt="$initialinstalllocation/perl";;
9428 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9431 none) startperl=": # use perl";;
9432 *) startperl="#!$ans"
9433 if $test 30 -lt `echo "$ans" | wc -c`; then
9436 WARNING: Some systems limit the #! command to 32 characters.
9437 If you experience difficulty running Perl scripts with #!, try
9438 installing Perl in a directory with a shorter pathname.
9444 *) startperl=": # use perl"
9449 echo "I'll use $startperl to start perl scripts."
9451 : figure best path for perl in scripts
9454 case "$versiononly" in
9455 "$define") perlpath="$initialinstalllocation/perl$version";;
9456 *) perlpath="$initialinstalllocation/perl";;
9458 case "$startperl" in
9463 I will use the "eval 'exec'" idiom to start Perl on your system.
9464 I can use the full path of your Perl binary for this purpose, but
9465 doing so may cause problems if you want to share those scripts and
9466 Perl is not always in a standard place ($initialinstalllocation/perl).
9469 dflt="$initialinstalllocation/perl"
9470 rp="What path shall I use in \"eval 'exec'\"?"
9477 case "$startperl" in
9479 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9482 : determine where public executable scripts go
9483 set scriptdir scriptdir
9485 case "$scriptdir" in
9488 : guess some guesses
9489 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9490 $test -d /usr/share/bin && dflt=/usr/share/bin
9491 $test -d /usr/local/script && dflt=/usr/local/script
9492 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9493 $test -d $prefixexp/script && dflt=$prefixexp/script
9497 *) dflt="$scriptdir"
9502 Some installations have a separate directory just for executable scripts so
9503 that they can mount it across multiple architectures but keep the scripts in
9504 one spot. You might, for example, have a subdirectory of /usr/share for this.
9505 Or you might just lump your scripts in with all your other executables.
9509 rp='Where do you keep publicly executable scripts?'
9511 if $test "X$ansexp" != "X$scriptdirexp"; then
9517 : A little fix up for an irregularly named variable.
9518 installscript="$installscriptdir"
9520 : determine where add-on public executables go
9522 '') dflt=$siteprefix/bin ;;
9526 rp='Pathname where the add-on public executables should be installed?'
9531 : determine where add-on html pages go
9532 : There is no standard location, so try to copy the previously-selected
9533 : directory structure for the core html pages.
9534 case "$sitehtml1dir" in
9535 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9536 *) dflt=$sitehtml1dir ;;
9539 ''|' ') dflt=none ;;
9542 rp='Pathname where the site-specific html pages should be installed?'
9544 prefixvar=sitehtml1dir
9547 : determine where add-on library html pages go
9548 : There is no standard location, so try to copy the previously-selected
9549 : directory structure for the core html pages.
9550 case "$sitehtml3dir" in
9551 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9552 *) dflt=$sitehtml3dir ;;
9555 ''|' ') dflt=none ;;
9558 rp='Pathname where the site-specific library html pages should be installed?'
9560 prefixvar=sitehtml3dir
9563 : determine where add-on manual pages go
9564 case "$siteman1dir" in
9565 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9566 *) dflt=$siteman1dir ;;
9569 ''|' ') dflt=none ;;
9572 rp='Pathname where the site-specific manual pages should be installed?'
9574 prefixvar=siteman1dir
9577 : determine where add-on library man pages go
9578 case "$siteman3dir" in
9579 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9580 *) dflt=$siteman3dir ;;
9583 ''|' ') dflt=none ;;
9586 rp='Pathname where the site-specific library manual pages should be installed?'
9588 prefixvar=siteman3dir
9591 : determine where add-on public executable scripts go
9592 case "$sitescript" in
9593 '') dflt=$siteprefix/script
9594 $test -d $dflt || dflt=$sitebin ;;
9595 *) dflt="$sitescript" ;;
9598 rp='Pathname where add-on public executable scripts should be installed?'
9600 prefixvar=sitescript
9603 : see if backtrace exists
9604 set backtrace d_backtrace
9607 : add flags if using c backtrace
9608 case "$usecbacktrace" in
9609 "") usecbacktrace=$undef ;;
9611 case "$d_backtrace" in
9613 case " $ccflags " in
9614 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9615 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9619 echo "This system does not support backtrace" >&4
9620 usecbacktrace=$undef
9626 : Check if faststdio is requested and available
9627 case "$usefaststdio" in
9628 $define|true|[yY]*|'')
9629 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9639 Perl can be built to use 'fast stdio', which means using the stdio
9640 library but also directly manipulating the stdio buffers to enable
9641 faster I/O. Using stdio is better for backward compatibility (especially
9642 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9643 interface has been preferred instead of stdio.
9645 If this doesn't make any sense to you, just accept the default '$dflt'.
9647 rp='Use the "fast stdio" if available?'
9650 y|Y) val="$define" ;;
9657 : define an is-a-typedef? function
9658 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9660 "") inclist="sys/types.h";;
9662 eval "varval=\$$var";
9666 for inc in $inclist; do
9667 echo "#include <$inc>" >>temp.c;
9669 echo "#ifdef $type" >> temp.c;
9670 echo "printf(\"We have $type\");" >> temp.c;
9671 echo "#endif" >> temp.c;
9672 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9673 if $contains $type temp.E >/dev/null 2>&1; then
9679 *) eval "$var=\$varval";;
9682 : define an is-a-typedef? function that prompts if the type is not available.
9683 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9685 "") inclist="sys/types.h";;
9687 eval "varval=\$$var";
9691 for inc in $inclist; do
9692 echo "#include <$inc>" >>temp.c;
9694 echo "#ifdef $type" >> temp.c;
9695 echo "printf(\"We have $type\");" >> temp.c;
9696 echo "#endif" >> temp.c;
9697 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9699 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9700 if $contains $type temp.E >/dev/null 2>&1; then
9701 echo "$type found." >&4;
9704 echo "$type NOT found." >&4;
9710 *) eval "$var=\$varval";;
9713 : see what type lseek is declared as in the kernel
9714 rp="What is the type used for lseek's offset on this system?"
9715 set off_t lseektype long stdio.h sys/types.h
9719 echo "Checking to see how big your file offsets are..." >&4
9721 #include <sys/types.h>
9725 printf("%d\n", (int)sizeof($lseektype));
9730 if eval $compile_ok; then
9731 lseeksize=`$run ./try`
9732 echo "Your file offsets are $lseeksize bytes long."
9736 echo "(I can't seem to compile the test program. Guessing...)"
9737 rp="What is the size of your file offsets (in bytes)?"
9743 : see what type file positions are declared as in the library
9744 rp="What is the type for file position used by fsetpos()?"
9745 set fpos_t fpostype long stdio.h sys/types.h
9748 : Check size for Fpos_t
9751 *_t) zzz="$fpostype" ;;
9754 echo "Checking the size of $zzz..." >&4
9756 #include <sys/types.h>
9763 printf("%d\n", (int)sizeof($fpostype));
9768 if eval $compile_ok; then
9772 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9775 echo "Your $zzz is $fpossize bytes long."
9781 echo "(I can't compile the test program. Guessing...)" >&4
9782 rp="What is the size of your file positions (in bytes)?"
9787 : Check for large file support
9788 # Backward compatibility (uselfs is deprecated).
9790 "$define"|true|[yY]*)
9793 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9795 uselargefiles="$define"
9799 case "$lseeksize:$fpossize" in
9802 You can have files larger than 2 gigabytes.
9805 *) case "$uselargefiles" in
9806 "$undef"|false|[nN]*) dflt='n' ;;
9811 Perl can be built to understand large files (files larger than 2 gigabytes)
9812 on some systems. To do so, Configure can be run with -Duselargefiles.
9814 If this doesn't make any sense to you, just accept the default '$dflt'.
9816 rp='Try to understand large files, if available?'
9819 y|Y) val="$define" ;;
9826 : Look for a hint-file generated 'call-back-unit'. If the
9827 : user has specified that a large files perl is to be built,
9828 : we may need to set or change some other defaults.
9829 if $test -f uselargefiles.cbu; then
9830 echo "Your platform has some specific hints regarding large file builds, using them..."
9831 . ./uselargefiles.cbu
9833 case "$uselargefiles" in
9835 if $test -f uselargefiles.cbu; then
9837 echo "Rechecking to see how big your file offsets are..." >&4
9839 #include <sys/types.h>
9843 printf("%d\n", (int)sizeof($lseektype));
9848 if eval $compile_ok; then
9849 lseeksize=`$run ./try`
9850 $echo "Your file offsets are now $lseeksize bytes long."
9854 echo "(I can't seem to compile the test program. Guessing...)"
9855 rp="What is the size of your file offsets (in bytes)?"
9860 *_t) zzz="$fpostype" ;;
9863 $echo $n "Rechecking the size of $zzz...$c" >&4
9865 #include <sys/types.h>
9872 printf("%d\n", (int)sizeof($fpostype));
9877 if eval $compile_ok; then
9882 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9885 echo " $fpossize bytes." >&4
9891 echo "(I can't compile the test program. Guessing...)" >&4
9892 rp="What is the size of your file positions (in bytes)?"
9901 : Check if we want perlio
9904 : Set the vendorbin variables
9905 case "$vendorprefix" in
9906 '') d_vendorbin="$undef"
9910 *) d_vendorbin="$define"
9911 : determine where vendor-supplied executables go.
9912 case "$vendorbin" in
9913 '') dflt=$vendorprefix/bin ;;
9914 *) dflt="$vendorbin" ;;
9917 rp='Pathname for the vendor-supplied executables directory?'
9920 vendorbinexp="$ansexp"
9926 : Set the vendorhtml1dir variables
9927 case "$vendorprefix" in
9928 '') vendorhtml1dir=''
9929 vendorhtml1direxp=''
9931 *) : determine where vendor-supplied html pages go.
9932 : There is no standard location, so try to copy the previously-selected
9933 : directory structure for the core html pages.
9934 : XXX Better default suggestions would be welcome.
9935 case "$vendorhtml1dir" in
9936 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9937 *) dflt=$vendorhtml1dir ;;
9940 ''|' ') dflt=none ;;
9943 rp='Pathname for the vendor-supplied html pages?'
9945 vendorhtml1dir="$ans"
9946 vendorhtml1direxp="$ansexp"
9949 : Use ' ' for none so value is preserved next time through Configure
9950 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9951 prefixvar=vendorhtml1dir
9954 : Set the vendorhtml3dir variables
9955 case "$vendorprefix" in
9956 '') vendorhtml3dir=''
9957 vendorhtml3direxp=''
9959 *) : determine where vendor-supplied module html pages go.
9960 : There is no standard location, so try to copy the previously-selected
9961 : directory structure for the core html pages.
9962 : XXX Better default suggestions would be welcome.
9963 case "$vendorhtml3dir" in
9964 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9965 *) dflt=$vendorhtml3dir ;;
9968 ''|' ') dflt=none ;;
9971 rp='Pathname for the vendor-supplied html pages?'
9973 vendorhtml3dir="$ans"
9974 vendorhtml3direxp="$ansexp"
9977 : Use ' ' for none so value is preserved next time through Configure
9978 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9979 prefixvar=vendorhtml3dir
9982 : Set the vendorman1dir variables
9983 case "$vendorprefix" in
9984 '') vendorman1dir=''
9987 *) : determine where vendor-supplied manual pages go.
9988 case "$vendorman1dir" in
9989 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9990 *) dflt=$vendorman1dir ;;
9993 ''|' ') dflt=none ;;
9996 rp='Pathname for the vendor-supplied manual section 1 pages?'
9998 vendorman1dir="$ans"
9999 vendorman1direxp="$ansexp"
10002 : Use ' ' for none so value is preserved next time through Configure
10003 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10004 prefixvar=vendorman1dir
10007 : Set the vendorman3dir variables
10008 case "$vendorprefix" in
10009 '') vendorman3dir=''
10010 vendorman3direxp=''
10012 *) : determine where vendor-supplied module manual pages go.
10013 case "$vendorman3dir" in
10014 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10015 *) dflt=$vendorman3dir ;;
10018 ''|' ') dflt=none ;;
10021 rp='Pathname for the vendor-supplied manual section 3 pages?'
10023 vendorman3dir="$ans"
10024 vendorman3direxp="$ansexp"
10027 : Use ' ' for none so value is preserved next time through Configure
10028 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10029 prefixvar=vendorman3dir
10032 : Set the vendorscript variables
10033 case "$vendorprefix" in
10034 '') d_vendorscript="$undef"
10038 *) d_vendorscript="$define"
10039 : determine where vendor-supplied scripts go.
10040 case "$vendorscript" in
10041 '') dflt=$vendorprefix/script
10042 $test -d $dflt || dflt=$vendorbin ;;
10043 *) dflt="$vendorscript" ;;
10047 The installation process will create a directory for
10048 vendor-supplied scripts.
10052 rp='Pathname for the vendor-supplied scripts directory?'
10054 vendorscript="$ans"
10055 vendorscriptexp="$ansexp"
10058 prefixvar=vendorscript
10061 : script used to emit important warnings
10064 if test \$# -gt 0; then
10069 echo "*** WARNING:" >&4
10070 sed -e 's/^/*** /' <msg >&4
10072 cat msg >>config.msg
10073 echo " " >>config.msg
10079 : see which of string.h or strings.h is needed
10081 strings=`./findhdr string.h`
10082 if $test "$strings" && $test -r "$strings"; then
10083 echo "Using <string.h> instead of <strings.h>." >&4
10087 strings=`./findhdr strings.h`
10088 if $test "$strings" && $test -r "$strings"; then
10089 echo "Using <strings.h> instead of <string.h>." >&4
10091 ./warn "No string header found -- You'll surely have problems."
10096 case "$i_string" in
10097 "$undef") strings=`./findhdr strings.h`;;
10098 *) strings=`./findhdr string.h`;;
10101 : see if qgcvt exists
10105 : Check what kind of doubles your system has
10106 $echo "Checking the kind of doubles you have..." >&4
10108 #$i_stdlib I_STDLIB
10109 #define DOUBLESIZE $doublesize
10111 #include <stdlib.h>
10114 static const double d = -0.1;
10116 unsigned const char* b = (unsigned const char*)(&d);
10117 #if DOUBLESIZE == 4
10118 if (b[0] == 0xCD && b[3] == 0xBD) {
10119 /* IEEE 754 32-bit little-endian */
10123 if (b[0] == 0xBD && b[3] == 0xCD) {
10124 /* IEEE 754 32-bit big-endian */
10129 #if DOUBLESIZE == 8
10130 if (b[0] == 0x9A && b[7] == 0xBF) {
10131 /* IEEE 754 64-bit little-endian */
10135 if (b[0] == 0xBF && b[7] == 0x9A) {
10136 /* IEEE 754 64-bit big-endian */
10140 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10141 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10142 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10143 * 99 99 b9 bf 9a 99 99 99 */
10147 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10148 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10149 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10150 * 99 99 99 9a bf b9 99 99 */
10155 #if DOUBLESIZE == 16
10156 if (b[0] == 0x9A && b[15] == 0xBF) {
10157 /* IEEE 754 128-bit little-endian */
10161 if (b[0] == 0xBF && b[15] == 0x9A) {
10162 /* IEEE 754 128-bit big-endian */
10167 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10168 * Whether those environments can still build Perl is debatable. */
10169 printf("-1\n"); /* unknown */
10174 if eval $compile; then
10175 doublekind=`$run ./try`
10179 case "$doublekind" in
10180 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10181 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10182 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10183 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10184 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10185 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10186 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10187 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10188 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10192 : Check print/scan long double stuff
10195 if $test X"$d_longdbl" = X"$define"; then
10197 echo "Checking how to print long doubles..." >&4
10199 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10200 $cat >try.c <<'EOCP'
10201 #include <sys/types.h>
10204 double d = 123.456;
10205 printf("%.3f\n", d);
10209 if eval $compile; then
10213 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10214 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10215 echo "We will use %f."
10221 if $test X"$sPRIfldbl" = X; then
10222 $cat >try.c <<'EOCP'
10223 #include <sys/types.h>
10226 long double d = 123.456;
10227 printf("%.3Lf\n", d);
10231 if eval $compile; then
10235 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10236 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10237 echo "We will use %Lf."
10243 if $test X"$sPRIfldbl" = X; then
10244 $cat >try.c <<'EOCP'
10245 #include <sys/types.h>
10248 long double d = 123.456;
10249 printf("%.3llf\n", d);
10253 if eval $compile; then
10257 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10258 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10259 echo "We will use %llf."
10265 if $test X"$sPRIfldbl" = X; then
10266 $cat >try.c <<'EOCP'
10267 #include <sys/types.h>
10270 long double d = 123.456;
10271 printf("%.3lf\n", d);
10275 if eval $compile; then
10279 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10280 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10281 echo "We will use %lf."
10287 if $test X"$sPRIfldbl" = X; then
10288 echo "Cannot figure out how to print long doubles." >&4
10290 sSCNfldbl=$sPRIfldbl # expect consistency
10297 case "$sPRIfldbl" in
10298 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10299 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10300 d_SCNfldbl="$undef";
10302 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10303 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10304 d_SCNfldbl="$define";
10308 : Before committing on uselongdouble, see whether that looks sane.
10309 if $test "$uselongdouble" = "$define"; then
10312 echo "Checking if your long double math functions work right..." >&4
10317 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10320 case "$osname:$gccversion" in
10321 aix:) saveccflags="$ccflags"
10322 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10325 if eval $compile_ok; then
10329 3) echo "Your long double math functions are working correctly." >&4 ;;
10330 *) echo "Your long double math functions are broken, not using long doubles." >&4
10331 uselongdouble=$undef
10335 case "$osname:$gccversion" in
10336 aix:) ccflags="$saveccflags" ;; # restore
10340 : Check how to convert floats to strings.
10342 if test "X$d_Gconvert" = X; then
10345 echo "Checking for an efficient way to convert floats to strings."
10347 case "$uselongdouble" in
10348 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10350 case "$d_longdbl" in
10351 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10353 case "$d_PRIgldbl" in
10354 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10357 #ifdef TRY_gconvert
10358 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10359 char *myname = "gconvert";
10362 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10363 char *myname = "gcvt";
10366 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10367 char *myname = "qgcvt";
10368 #define DOUBLETYPE long double
10371 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10372 #ifdef HAS_PRIgldbl
10373 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10375 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10378 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10380 char *myname = "sprintf";
10384 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10385 #define DOUBLETYPE long double
10387 #define DOUBLETYPE double
10393 #$i_stdlib I_STDLIB
10395 #include <stdlib.h>
10397 #$i_string I_STRING
10399 # include <string.h>
10401 # include <strings.h>
10404 int checkit(char *expect, char *got)
10406 if (strcmp(expect, got)) {
10407 printf("%s oddity: Expected %s, got %s\n",
10408 myname, expect, got);
10418 /* This must be 1st test on (which?) platform */
10419 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10420 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10421 checkit("0.1", buf);
10423 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10424 checkit("0.01", buf);
10426 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10427 checkit("0.001", buf);
10429 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10430 checkit("0.0001", buf);
10432 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10433 if (strlen(buf) > 5)
10434 checkit("9e-005", buf); /* for Microsoft ?? */
10436 checkit("9e-05", buf);
10438 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10441 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10442 checkit("1.1", buf);
10444 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10445 checkit("1.01", buf);
10447 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10448 checkit("1.001", buf);
10450 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10451 checkit("1.0001", buf);
10453 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10454 checkit("1.00001", buf);
10456 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10457 checkit("1.000001", buf);
10459 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10462 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10463 checkit("-1", buf);
10465 /* Some Linux gcvt's give 1.e+5 here. */
10466 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10467 checkit("100000", buf);
10469 /* Some Linux gcvt's give -1.e+5 here. */
10470 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10471 checkit("-100000", buf);
10473 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10474 checkit("123.456", buf);
10476 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10477 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10478 /* 34 should be enough to scare even long double
10479 * places into using the e notation. */
10480 if (strlen(buf) > 5)
10481 checkit("1e+034", buf); /* for Microsoft */
10483 checkit("1e+34", buf);
10485 /* For Perl, if you add additional tests here, also add them to
10486 * t/base/num.t for benefit of platforms not using Configure or
10487 * overriding d_Gconvert */
10492 : first add preferred functions to our list
10494 for xxx_convert in $gconvert_preference; do
10495 case $xxx_convert in
10496 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10497 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10500 : then add any others
10501 for xxx_convert in gconvert gcvt sprintf; do
10502 case "$xxx_list" in
10504 *) xxx_list="$xxx_list $xxx_convert" ;;
10508 case "$d_longdbl$uselongdouble" in
10510 : again, add preferred functions to our list first
10512 for xxx_convert in $gconvert_ld_preference; do
10513 case $xxx_convert in
10514 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10515 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10518 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10519 for xxx_convert in qgcvt sprintf $xxx_list; do
10520 case "$xxx_ld_list" in
10521 $xxx_convert*|*" $xxx_convert"*) ;;
10522 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10525 : if sprintf cannot do long doubles, move it to the end
10526 if test "$d_PRIgldbl" != "$define"; then
10527 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10529 : if no qgcvt, remove it
10530 if test "$d_qgcvt" != "$define"; then
10531 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10534 xxx_list="$xxx_ld_list"
10538 for xxx_convert in $xxx_list; do
10539 echo "Trying $xxx_convert..."
10540 $rm -f try try$_o core
10541 set try -DTRY_$xxx_convert
10542 if eval $compile; then
10543 echo "$xxx_convert() found." >&4
10544 if $run ./try; then
10545 echo "I'll use $xxx_convert to convert floats into a string." >&4
10548 echo "...But $xxx_convert didn't work as I expected."
10552 echo "$xxx_convert NOT found." >&4
10556 if test X$xxx_convert = X; then
10557 echo "*** WHOA THERE!!! ***" >&4
10558 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10559 xxx_convert=sprintf
10562 case "$xxx_convert" in
10563 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10564 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10565 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10566 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10567 "$define$define$define")
10568 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10569 "$define$define$undef")
10570 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10571 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10579 : see if _fwalk exists
10583 : Initialize h_fcntl
10586 : Initialize h_sysfile
10589 : access call always available on UNIX
10590 set access d_access
10593 : locate the flags for 'access()'
10594 case "$d_access" in
10597 $cat >access.c <<EOCP
10598 #include <sys/types.h>
10603 #include <sys/file.h>
10606 #include <unistd.h>
10608 #$i_stdlib I_STDLIB
10610 #include <stdlib.h>
10616 : check sys/file.h first, no particular reason here
10617 if $test `./findhdr sys/file.h` && \
10618 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10620 echo "<sys/file.h> defines the *_OK access constants." >&4
10621 elif $test `./findhdr fcntl.h` && \
10622 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10624 echo "<fcntl.h> defines the *_OK access constants." >&4
10625 elif $test `./findhdr unistd.h` && \
10626 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10627 echo "<unistd.h> defines the *_OK access constants." >&4
10629 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10635 : see if accessx exists
10636 set accessx d_accessx
10639 : see if acosh exists
10643 : see if aintl exists
10647 : see if alarm exists
10651 : see if 64bit time functions exists
10653 set ctime64 d_ctime64
10656 set localtime64 d_localtime64
10659 set gmtime64 d_gmtime64
10662 set mktime64 d_mktime64
10665 set difftime64 d_difftime64
10668 set asctime64 d_asctime64
10671 : see if POSIX threads are available
10672 set pthread.h i_pthread
10675 : define a function to check prototypes
10676 $cat > protochk <<EOSH
10679 optimize="$optimize"
10681 prototype="$prototype"
10684 usethreads=$usethreads
10685 i_pthread=$i_pthread
10686 pthread_h_first=$pthread_h_first
10689 $cat >> protochk <<'EOSH'
10694 while test $# -ge 2; do
10696 $define) echo "#include <$2>" >> try.c ;;
10697 literal) echo "$2" >> try.c ;;
10699 # Extra magic for the benefit of systems that need pthread.h
10700 # to be included early to correctly detect threadsafe functions.
10701 # Such functions must guarantee themselves, though, that the usethreads
10702 # and i_pthread have been defined, before calling protochk.
10703 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10704 echo "#include <pthread.h>" >> try.c
10709 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10710 cat >> try.c <<'EOCP'
10711 #ifdef CAN_PROTOTYPE
10712 #define _(args) args
10717 echo "$foo" >> try.c
10718 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10719 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10725 $eunicefix protochk
10727 : Define hasproto macro for Configure internal use
10728 hasproto='varname=$1; func=$2; shift; shift;
10729 while $test $# -ge 2; do
10731 $define) echo "#include <$2>";;
10735 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10736 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10737 echo "$func() prototype found.";
10740 echo "$func() prototype NOT found.";
10747 : see if sys/types.h has to be included
10748 set sys/types.h i_systypes
10751 : see if sys/select.h has to be included
10752 set sys/select.h i_sysselct
10755 : Define hasfield macro for Configure internal use
10756 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10757 while $test $# -ge 2; do
10759 $define) echo "#include <$2>";;
10763 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10765 if eval $compile; then
10774 : see if we should include time.h, sys/time.h, or both
10776 if test "X$timeincl" = X; then
10777 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10778 $echo $n "I'm now running the test program...$c"
10780 #include <sys/types.h>
10785 #ifdef SYSTIMEKERNEL
10788 #include <sys/time.h>
10791 #include <sys/select.h>
10793 #$i_stdlib I_STDLIB
10795 #include <stdlib.h>
10801 struct timeval bar;
10804 struct timezone tzp;
10806 if (foo.tm_sec == foo.tm_sec)
10809 if (bar.tv_sec == bar.tv_sec)
10816 for s_timezone in '-DS_TIMEZONE' ''; do
10818 for s_timeval in '-DS_TIMEVAL' ''; do
10819 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10820 for i_time in '' '-DI_TIME'; do
10821 for i_systime in '-DI_SYSTIME' ''; do
10824 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10825 if eval $compile; then
10826 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10830 $echo $n "Succeeded with $flags$c"
10842 *SYSTIMEKERNEL*) i_systimek="$define"
10843 timeincl=`./findhdr sys/time.h`
10844 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10845 *) i_systimek="$undef";;
10848 *I_TIME*) i_time="$define"
10849 timeincl=`./findhdr time.h`" $timeincl"
10850 echo "We'll include <time.h>." >&4;;
10851 *) i_time="$undef";;
10854 *I_SYSTIME*) i_systime="$define"
10855 timeincl=`./findhdr sys/time.h`" $timeincl"
10856 echo "We'll include <sys/time.h>." >&4;;
10857 *) i_systime="$undef";;
10861 : see if struct tm knows about tm_zone
10862 case "$i_systime$i_time" in
10865 echo "Checking to see if your struct tm has tm_zone field..." >&4
10866 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10874 case "$d_tm_tm_zone" in
10875 "$define") echo "Yes, it does." ;;
10876 *) echo "No, it doesn't." ;;
10878 : see if struct tm knows about tm_gmtoff
10879 case "$i_systime$i_time" in
10882 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10883 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10891 case "$d_tm_tm_gmtoff" in
10892 "$define") echo "Yes, it does." ;;
10893 *) echo "No, it doesn't." ;;
10896 : see if asctime_r exists
10897 set asctime_r d_asctime_r
10899 case "$d_asctime_r" in
10901 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10902 case "$d_asctime_r_proto:$usethreads" in
10903 ":define") d_asctime_r_proto=define
10904 set d_asctime_r_proto asctime_r $hdrs
10908 case "$d_asctime_r_proto" in
10910 case "$asctime_r_proto" in
10911 ''|0) try='char* asctime_r(const struct tm*, char*);'
10912 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10914 case "$asctime_r_proto" in
10915 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10916 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10918 case "$asctime_r_proto" in
10919 ''|0) try='int asctime_r(const struct tm*, char*);'
10920 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10922 case "$asctime_r_proto" in
10923 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10924 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10926 case "$asctime_r_proto" in
10927 ''|0) d_asctime_r=undef
10929 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10930 * ) case "$asctime_r_proto" in
10931 REENTRANT_PROTO*) ;;
10932 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10934 echo "Prototype: $try" ;;
10937 *) case "$usethreads" in
10938 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10945 *) asctime_r_proto=0
10949 : see if asinh exists
10953 : see if atanh exists
10957 : see if atolf exists
10961 : see if atoll exists
10965 : Look for GCC-style attribute format
10966 case "$d_attribute_format" in
10969 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10970 $cat >attrib.c <<'EOCP'
10972 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10974 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10975 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10976 echo "Your C compiler doesn't support __attribute__((format))."
10979 echo "Your C compiler supports __attribute__((format))."
10983 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10987 *) val="$d_attribute_format" ;;
10989 set d_attribute_format
10993 : Look for GCC-style attribute format with null format allowed
10994 case "$d_printf_format_null" in
10995 '') case "$d_attribute_format" in
10998 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10999 $cat >attrib.c <<EOCP
11001 #$i_stdlib I_STDLIB
11003 #include <stdlib.h>
11005 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11006 int null_printf (char* pat,...) { return (int)pat; }
11007 int main () { exit(null_printf(NULL)); }
11009 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11010 : run the executable in case it produces a run-time warning
11011 if $run ./attrib >>attrib.out 2>&1; then
11012 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11013 echo "Your C compiler doesn't allow __printf__ format to be null."
11016 echo "Your C compiler allows __printf__ format to be null."
11020 echo "Your C compiler executable failed with __printf__ format null."
11024 echo "Your C compiler fails with __printf__ format null."
11031 *) val="$d_printf_format_null" ;;
11033 set d_printf_format_null
11037 : Look for GCC-style attribute malloc
11038 case "$d_attribute_malloc" in
11041 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11042 $cat >attrib.c <<'EOCP'
11044 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11046 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11047 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11048 echo "Your C compiler doesn't support __attribute__((malloc))."
11051 echo "Your C compiler supports __attribute__((malloc))."
11055 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11059 *) val="$d_attribute_malloc" ;;
11061 set d_attribute_malloc
11065 : Look for GCC-style attribute nonnull
11066 case "$d_attribute_nonnull" in
11069 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11070 $cat >attrib.c <<'EOCP'
11072 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11074 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11075 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11076 echo "Your C compiler doesn't support __attribute__((nonnull))."
11079 echo "Your C compiler supports __attribute__((nonnull))."
11083 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11087 *) val="$d_attribute_nonnull" ;;
11089 set d_attribute_nonnull
11093 : Look for GCC-style attribute noreturn
11094 case "$d_attribute_noreturn" in
11097 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11098 $cat >attrib.c <<'EOCP'
11100 void fall_over_dead( void ) __attribute__((noreturn));
11102 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11103 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11104 echo "Your C compiler doesn't support __attribute__((noreturn))."
11107 echo "Your C compiler supports __attribute__((noreturn))."
11111 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11115 *) val="$d_attribute_noreturn" ;;
11117 set d_attribute_noreturn
11121 : Look for GCC-style attribute pure
11122 case "$d_attribute_pure" in
11125 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11126 $cat >attrib.c <<'EOCP'
11128 int square( int n ) __attribute__((pure));
11130 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11131 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11132 echo "Your C compiler doesn't support __attribute__((pure))."
11135 echo "Your C compiler supports __attribute__((pure))."
11139 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11143 *) val="$d_attribute_pure" ;;
11145 set d_attribute_pure
11149 : Look for GCC-style attribute unused
11150 case "$d_attribute_unused" in
11153 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11154 $cat >attrib.c <<'EOCP'
11156 int do_something( int dummy __attribute__((unused)), int n );
11158 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11159 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11160 echo "Your C compiler doesn't support __attribute__((unused))."
11163 echo "Your C compiler supports __attribute__((unused))."
11167 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11171 *) val="$d_attribute_unused" ;;
11173 set d_attribute_unused
11177 : Look for GCC-style attribute deprecated
11178 case "$d_attribute_deprecated" in
11181 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11182 $cat >attrib.c <<'EOCP'
11184 int I_am_deprecated(void) __attribute__((deprecated));
11186 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11187 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11188 echo "Your C compiler doesn't support __attribute__((deprecated))."
11191 echo "Your C compiler supports __attribute__((deprecated))."
11195 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11199 *) val="$d_attribute_deprecated" ;;
11201 set d_attribute_deprecated
11205 : Look for GCC-style attribute warn_unused_result
11206 case "$d_attribute_warn_unused_result" in
11209 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11210 $cat >attrib.c <<'EOCP'
11212 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11214 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11215 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11216 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11219 echo "Your C compiler supports __attribute__((warn_unused_result))."
11223 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11227 *) val="$d_attribute_warn_unused_result" ;;
11229 set d_attribute_warn_unused_result
11233 : see if bcmp exists
11237 : see if bcopy exists
11241 : see if getpgrp exists
11242 set getpgrp d_getpgrp
11245 case "$d_getpgrp" in
11248 echo "Checking to see which flavor of getpgrp is in use..."
11250 #$i_unistd I_UNISTD
11251 #include <sys/types.h>
11253 # include <unistd.h>
11255 #$i_stdlib I_STDLIB
11257 #include <stdlib.h>
11261 if (getuid() == 0) {
11262 printf("(I see you are running Configure as super-user...)\n");
11265 #ifdef TRY_BSD_PGRP
11266 if (getpgrp(1) == 0)
11275 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11276 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11278 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11279 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11282 echo "I can't seem to compile and run the test program."
11284 xxx="a USG one, i.e. you use getpgrp()."
11286 # SVR4 systems can appear rather BSD-ish.
11287 case "$i_unistd" in
11289 xxx="a BSD one, i.e. you use getpgrp(pid)."
11293 xxx="probably a USG one, i.e. you use getpgrp()."
11298 echo "Assuming your getpgrp is $xxx" >&4
11307 : see if setpgrp exists
11308 set setpgrp d_setpgrp
11311 case "$d_setpgrp" in
11314 echo "Checking to see which flavor of setpgrp is in use..."
11316 #$i_unistd I_UNISTD
11317 #include <sys/types.h>
11319 # include <unistd.h>
11321 #$i_stdlib I_STDLIB
11323 #include <stdlib.h>
11327 if (getuid() == 0) {
11328 printf("(I see you are running Configure as super-user...)\n");
11331 #ifdef TRY_BSD_PGRP
11332 if (-1 == setpgrp(1, 1))
11335 if (setpgrp() != -1)
11341 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11342 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11344 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11345 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11348 echo "(I can't seem to compile and run the test program.)"
11350 xxx="a USG one, i.e. you use setpgrp()."
11352 # SVR4 systems can appear rather BSD-ish.
11353 case "$i_unistd" in
11355 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11359 xxx="probably a USG one, i.e. you use setpgrp()."
11364 echo "Assuming your setpgrp is $xxx" >&4
11373 : Look for GCC-style __builtin_choose_expr
11374 case "$d_builtin_choose_expr" in
11377 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11378 $cat >try.c <<'EOCP'
11379 #include <assert.h>
11380 #include <stdlib.h>
11383 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11386 assert( SYRINX(1) == 2112 );
11387 assert( SYRINX(1) != 5150 );
11388 assert( SYRINX(0) == 5150 );
11389 assert( SYRINX(0) != 2112 );
11390 puts( "All good!" );
11396 if eval $compile && $run ./try; then
11397 echo "Your C compiler supports __builtin_choose_expr."
11400 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11404 *) val="$d_builtin_choose_expr" ;;
11407 set d_builtin_choose_expr
11411 : Look for GCC-style __builtin_expect
11412 case "$d_builtin_expect" in
11415 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11416 $cat >try.c <<'EOCP'
11419 if ( __builtin_expect(n, 0) ) n = 1;
11420 /* Remember shell exit code truth is 0, C truth is non-zero */
11425 if eval $compile && $run ./try; then
11426 echo "Your C compiler supports __builtin_expect."
11429 echo "Your C compiler doesn't seem to understand __builtin_expect."
11433 *) val="$d_builtin_expect" ;;
11436 set d_builtin_expect
11440 : see if bzero exists
11444 : see if stdarg is available
11446 if $test `./findhdr stdarg.h`; then
11447 echo "<stdarg.h> found." >&4
11450 echo "<stdarg.h> NOT found." >&4
11454 : see if varargs is available
11456 if $test `./findhdr varargs.h`; then
11457 echo "<varargs.h> found." >&4
11459 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11462 : set up the varargs testing programs
11463 $cat > varargs.c <<EOP
11465 #include <stdarg.h>
11468 #include <varargs.h>
11472 int f(char *p, ...)
11486 p = va_arg(ap, char *);
11492 $cat > varargs <<EOP
11494 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11503 : now check which varargs header should be included
11509 if `./varargs I_STDARG`; then
11511 elif `./varargs I_VARARGS`; then
11516 if `./varargs I_VARARGS`; then
11524 echo "*** WHOA THERE!!! ***" >&4
11525 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11526 case "$knowitall" in
11528 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11532 echo "I could not find the definition for va_dcl... You have problems..." >&4
11533 val="$undef"; set i_stdarg; eval $setvar
11534 val="$undef"; set i_varargs; eval $setvar
11539 case "$i_varhdr" in
11541 val="$define"; set i_stdarg; eval $setvar
11542 val="$undef"; set i_varargs; eval $setvar
11545 val="$undef"; set i_stdarg; eval $setvar
11546 val="$define"; set i_varargs; eval $setvar
11549 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11553 : see if the Compiler supports C99 variadic macros
11554 case "$i_stdarg$i_stdlib" in
11556 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11559 #include <stdarg.h>
11561 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11565 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11571 if eval $compile && $run ./try 2>&1 >/dev/null; then
11572 case "`$run ./try`" in
11574 echo "You have C99 variadic macros." >&4
11575 d_c99_variadic_macros="$define"
11578 echo "You don't have functional C99 variadic macros." >&4
11579 d_c99_variadic_macros="$undef"
11583 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11584 d_c99_variadic_macros="$undef"
11589 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11590 d_c99_variadic_macros="$undef"
11594 : see if signal is declared as pointer to function returning int or void
11596 xxx=`./findhdr signal.h`
11597 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11598 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11599 echo "You have int (*signal())() instead of void." >&4
11601 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11602 echo "You have void (*signal())()." >&4
11604 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11605 echo "You have int (*signal())() instead of void." >&4
11607 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11608 echo "You have void (*signal())()." >&4
11611 case "$d_voidsig" in
11613 echo "I can't determine whether signal handler returns void or int..." >&4
11615 rp="What type does your signal handler return?"
11618 v*) val="$define";;
11622 echo "As you already told me, signal handler returns void." >&4
11625 *) echo "As you already told me, signal handler returns int." >&4
11632 case "$d_voidsig" in
11633 "$define") signal_t="void";;
11634 *) signal_t="int";;
11638 : check for ability to cast large floats to 32-bit ints.
11640 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11641 if $test "$intsize" -ge 4; then
11648 #$i_stdlib I_STDLIB
11650 #include <stdlib.h>
11652 #include <sys/types.h>
11653 #include <signal.h>
11654 $signal_t blech(int s) { exit(3); }
11661 signal(SIGFPE, blech);
11663 /* Don't let compiler optimize the test away. Store the number
11664 in a writable string for gcc to pass to sscanf under HP-UX.
11666 sprintf(str, "2147483647");
11667 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11671 /* x86 processors will probably give 0x8000 0000, which is a
11672 sign change. We don't want that. We want to mimic SPARC
11673 behavior here, which is to preserve the sign and give
11676 if (i32 != ($xxx) f)
11682 if eval $compile_ok; then
11683 $run ./try 2>/dev/null
11686 echo "(I can't seem to compile the test program--assuming it can't)"
11691 echo "Yup, it can."
11694 echo "Nope, it can't."
11701 : check for ability to cast negative floats to unsigned
11703 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11706 #$i_stdlib I_STDLIB
11708 #include <stdlib.h>
11710 #include <sys/types.h>
11711 #include <signal.h>
11712 $signal_t blech(int s) { exit(7); }
11713 $signal_t blech_in_list(int s) { exit(4); }
11714 unsigned long dummy_long(unsigned long p) { return p; }
11715 unsigned int dummy_int(unsigned int p) { return p; }
11716 unsigned short dummy_short(unsigned short p) { return p; }
11720 unsigned long along;
11722 unsigned short ashort;
11726 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11727 a direct f = -123. assignment. gcc-2.8.0 reportedly
11728 optimized the whole file away
11730 /* Store the number in a writable string for gcc to pass to
11731 sscanf under HP-UX.
11733 sprintf(str, "-123");
11734 sscanf(str, "%lf", &f); /* f = -123.; */
11736 signal(SIGFPE, blech);
11737 along = (unsigned long)f;
11738 aint = (unsigned int)f;
11739 ashort = (unsigned short)f;
11740 if (along != (unsigned long)-123)
11742 if (aint != (unsigned int)-123)
11744 if (ashort != (unsigned short)-123)
11746 sprintf(str, "1073741824.");
11747 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11750 along = (unsigned long)f;
11751 if (along != 0x80000000)
11755 along = (unsigned long)f;
11756 if (along != 0x7fffffff)
11760 along = (unsigned long)f;
11761 if (along != 0x80000001)
11765 signal(SIGFPE, blech_in_list);
11766 sprintf(str, "123.");
11767 sscanf(str, "%lf", &f); /* f = 123.; */
11768 along = dummy_long((unsigned long)f);
11769 aint = dummy_int((unsigned int)f);
11770 ashort = dummy_short((unsigned short)f);
11771 if (along != (unsigned long)123)
11773 if (aint != (unsigned int)123)
11775 if (ashort != (unsigned short)123)
11782 if eval $compile_ok; then
11783 $run ./try 2>/dev/null
11786 echo "(I can't seem to compile the test program--assuming it can't)"
11789 case "$castflags" in
11791 echo "Yup, it can."
11794 echo "Nope, it can't."
11801 : see if cbrt exists
11805 : see if vprintf exists
11807 if set vprintf val -f d_vprintf; eval $csym; $val; then
11808 echo 'vprintf() found.' >&4
11811 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11812 #$i_varargs I_VARARGS
11814 #$i_stdlib I_STDLIB
11815 #$i_unistd I_UNISTD
11818 # include <stdarg.h>
11819 #else /* I_VARARGS */
11820 # include <varargs.h>
11824 # include <unistd.h>
11828 # include <stdlib.h>
11831 #include <stdio.h> /* vsprintf prototype */
11834 void xxx(int n, ...)
11839 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11841 int main() { xxx(1, "foo"); }
11843 #else /* I_VARARGS */
11851 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11853 int main() { xxx("foo"); }
11859 if eval $compile_ok; then
11860 if $run ./try; then
11861 echo "Your vsprintf() returns (int)." >&4
11864 echo "Your vsprintf() returns (char*)." >&4
11868 echo 'I am unable to compile the vsprintf() test program.' >&4
11869 # We shouldn't get here. If we do, assume the standard signature,
11870 # not the old BSD one.
11871 echo 'Guessing that vsprintf() returns (int).' >&4
11875 echo 'vprintf() NOT found.' >&4
11886 : see if chown exists
11890 : see if chroot exists
11891 set chroot d_chroot
11894 : see if chsize exists
11895 set chsize d_chsize
11898 : see if class exists
11902 : see if clearenv exists
11903 set clearenv d_clearenv
11906 : Define hasstruct macro for Configure internal use
11907 hasstruct='varname=$1; struct=$2; shift; shift;
11908 while $test $# -ge 2; do
11910 $define) echo "#include <$2>";;
11914 echo "int main () { struct $struct foo; }" >> try.c;
11916 if eval $compile; then
11925 : see whether socket exists
11929 $echo $n "Hmm... $c" >&4
11930 if set socket val -f d_socket; eval $csym; $val; then
11931 echo "Looks like you have Berkeley networking support." >&4
11933 if set setsockopt val -f; eval $csym; $val; then
11936 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11937 d_oldsock="$define"
11940 if $contains socklib libc.list >/dev/null 2>&1; then
11941 echo "Looks like you have Berkeley networking support." >&4
11943 : we will have to assume that it supports the 4.2 BSD interface
11946 echo "You don't have Berkeley networking in libc$_a..." >&4
11947 if test "X$d_socket" = "X$define"; then
11948 echo "...but you seem to believe that you have sockets." >&4
11950 for net in net socket
11952 if test -f $sysroot/usr/lib/lib$net$_a; then
11953 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11954 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11955 if $contains socket libc.list >/dev/null 2>&1; then
11960 echo "...but the Wollongong group seems to have hacked it in." >&4
11961 sockethdr="-I$sysroot/usr/netinclude"
11964 echo "Found Berkeley sockets interface in lib$net." >&4
11965 if $contains setsockopt libc.list >/dev/null 2>&1; then
11968 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11969 d_oldsock="$define"
11975 if test "X$d_socket" != "X$define"; then
11976 echo "or anywhere else I see." >&4
11984 : see if socketpair exists
11985 set socketpair d_sockpair
11990 echo "Checking the availability sa_len in the sock struct ..." >&4
11992 #include <sys/types.h>
11993 #include <sys/socket.h>
11995 struct sockaddr sa;
11996 return (sa.sa_len);
12000 set try; if eval $compile; then
12003 set d_sockaddr_sa_len; eval $setvar
12007 echo "Checking the availability struct sockaddr_in6 ..." >&4
12009 #include <sys/types.h>
12010 #include <sys/socket.h>
12011 #include <netinet/in.h>
12013 struct sockaddr_in6 sin6;
12014 return (sin6.sin6_family);
12018 set try; if eval $compile; then
12021 set d_sockaddr_in6; eval $setvar
12025 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12027 #include <sys/types.h>
12028 #include <sys/socket.h>
12029 #include <netinet/in.h>
12031 struct sockaddr_in6 sin6;
12032 return (sin6.sin6_scope_id);
12036 set try; if eval $compile; then
12039 set d_sin6_scope_id; eval $setvar
12043 echo "Checking the availability struct ip_mreq ..." >&4
12045 #include <sys/types.h>
12046 #include <sys/socket.h>
12047 #include <netinet/in.h>
12049 struct ip_mreq mreq;
12050 return (mreq.imr_multiaddr.s_addr);
12054 set try; if eval $compile; then
12057 set d_ip_mreq; eval $setvar
12061 echo "Checking the availability struct ip_mreq_source ..." >&4
12063 #include <sys/types.h>
12064 #include <sys/socket.h>
12065 #include <netinet/in.h>
12067 struct ip_mreq_source mreq;
12068 return (mreq.imr_multiaddr.s_addr);
12072 set try; if eval $compile; then
12075 set d_ip_mreq_source; eval $setvar
12079 echo "Checking the availability struct ipv6_mreq ..." >&4
12081 #include <sys/types.h>
12082 #include <sys/socket.h>
12083 #include <netinet/in.h>
12085 struct ipv6_mreq mreq;
12086 return (mreq.ipv6mr_interface);
12090 set try; if eval $compile; then
12093 set d_ipv6_mreq; eval $setvar
12097 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12099 #include <sys/types.h>
12100 #include <sys/socket.h>
12101 #include <netinet/in.h>
12103 struct ipv6_mreq_source mreq;
12104 return (mreq.imr_multiaddr.s_addr);
12108 set try; if eval $compile; then
12111 set d_ipv6_mreq_source; eval $setvar
12115 echo "Checking the availability of certain socket constants..." >&4
12116 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12117 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12119 #include <sys/types.h>
12120 #include <sys/socket.h>
12126 set try; if eval $compile; then
12129 set d_${enum}; eval $setvar
12133 : see if this is a sys/uio.h system
12134 set sys/uio.h i_sysuio
12137 : Check for cmsghdr support
12139 echo "Checking to see if your system supports struct cmsghdr..." >&4
12140 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12142 case "$d_cmsghdr_s" in
12143 "$define") echo "Yes, it does." ;;
12144 *) echo "No, it doesn't." ;;
12148 : check for const keyword
12150 echo 'Checking to see if your C compiler knows about "const"...' >&4
12151 $cat >const.c <<'EOCP'
12152 typedef struct spug { int drokk; } spug;
12156 const spug y = { 0 };
12159 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12161 echo "Yup, it does."
12164 echo "Nope, it doesn't."
12169 : see if copysign exists
12170 set copysign d_copysign
12173 : see if copysignl exists
12174 set copysignl d_copysignl
12177 : see if crypt exists
12182 $define) cryptlib='' ;;
12183 *) if set crypt val -f d_crypt; eval $csym; $val; then
12184 echo 'crypt() found.' >&4
12188 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12189 if $test -z "$cryptlib"; then
12190 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12194 if $test -z "$cryptlib"; then
12195 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12199 if $test -z "$cryptlib"; then
12200 cryptlib=`./loc libcrypt$_a "" $libpth`
12204 if $test -z "$cryptlib"; then
12205 echo 'crypt() NOT found.' >&4
12216 : see if this is a crypt.h system
12217 set crypt.h i_crypt
12220 : see if crypt_r exists
12221 set crypt_r d_crypt_r
12223 case "$d_crypt_r" in
12225 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12226 case "$d_crypt_r_proto:$usethreads" in
12227 ":define") d_crypt_r_proto=define
12228 set d_crypt_r_proto crypt_r $hdrs
12232 case "$d_crypt_r_proto" in
12234 case "$crypt_r_proto" in
12235 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12236 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12238 case "$crypt_r_proto" in
12239 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12240 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12242 case "$crypt_r_proto" in
12243 ''|0) d_crypt_r=undef
12245 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12246 * ) case "$crypt_r_proto" in
12247 REENTRANT_PROTO*) ;;
12248 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12250 echo "Prototype: $try" ;;
12253 *) case "$usethreads" in
12254 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12265 : get csh whereabouts
12267 'csh') val="$undef" ;;
12268 *) val="$define" ;;
12272 : Respect a hint or command line value for full_csh.
12273 case "$full_csh" in
12274 '') full_csh=$csh ;;
12277 : see if ctermid exists
12278 set ctermid d_ctermid
12281 : see if ctermid_r exists
12282 set ctermid_r d_ctermid_r
12284 case "$d_ctermid_r" in
12286 hdrs="$i_systypes sys/types.h define stdio.h "
12287 case "$d_ctermid_r_proto:$usethreads" in
12288 ":define") d_ctermid_r_proto=define
12289 set d_ctermid_r_proto ctermid_r $hdrs
12293 case "$d_ctermid_r_proto" in
12295 case "$ctermid_r_proto" in
12296 ''|0) try='char* ctermid_r(char*);'
12297 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12299 case "$ctermid_r_proto" in
12300 ''|0) d_ctermid_r=undef
12302 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12303 * ) case "$ctermid_r_proto" in
12304 REENTRANT_PROTO*) ;;
12305 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12307 echo "Prototype: $try" ;;
12310 *) case "$usethreads" in
12311 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12318 *) ctermid_r_proto=0
12322 : see if ctime_r exists
12323 set ctime_r d_ctime_r
12325 case "$d_ctime_r" in
12327 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12328 case "$d_ctime_r_proto:$usethreads" in
12329 ":define") d_ctime_r_proto=define
12330 set d_ctime_r_proto ctime_r $hdrs
12334 case "$d_ctime_r_proto" in
12336 case "$ctime_r_proto" in
12337 ''|0) try='char* ctime_r(const time_t*, char*);'
12338 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12340 case "$ctime_r_proto" in
12341 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12342 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12344 case "$ctime_r_proto" in
12345 ''|0) try='int ctime_r(const time_t*, char*);'
12346 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12348 case "$ctime_r_proto" in
12349 ''|0) try='int ctime_r(const time_t*, char*, int);'
12350 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12352 case "$ctime_r_proto" in
12353 ''|0) d_ctime_r=undef
12355 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12356 * ) case "$ctime_r_proto" in
12357 REENTRANT_PROTO*) ;;
12358 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12360 echo "Prototype: $try" ;;
12363 *) case "$usethreads" in
12364 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12375 : see if cuserid exists
12376 set cuserid d_cuserid
12379 : see if this is a limits.h system
12380 set limits.h i_limits
12383 : See if number of significant digits in a double precision number is known
12385 $cat >dbl_dig.c <<EOM
12386 #$i_limits I_LIMITS
12389 #include <limits.h>
12395 printf("Contains DBL_DIG");
12398 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12399 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12400 echo "DBL_DIG found." >&4
12403 echo "DBL_DIG NOT found." >&4
12410 : see if dbm.h is available
12411 : see if dbmclose exists
12412 set dbmclose d_dbmclose
12415 case "$d_dbmclose" in
12425 *) set rpcsvc/dbm.h i_rpcsvcdbm
12430 *) echo "We won't be including <dbm.h>"
12440 : see if prototype for dbminit is available
12442 set d_dbminitproto dbminit $i_dbm dbm.h
12445 : see if difftime exists
12446 set difftime d_difftime
12449 : see if this is a dirent system
12451 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12453 echo "<dirent.h> found." >&4
12456 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12457 echo "<sys/dir.h> found." >&4
12460 xinc=`./findhdr sys/ndir.h`
12462 echo "<dirent.h> NOT found." >&4
12467 : Look for type of directory structure.
12469 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12471 case "$direntrytype" in
12473 case "$i_dirent" in
12474 $define) guess1='struct dirent' ;;
12475 *) guess1='struct direct' ;;
12478 *) guess1="$direntrytype"
12483 'struct dirent') guess2='struct direct' ;;
12484 *) guess2='struct dirent' ;;
12487 if $contains "$guess1" try.c >/dev/null 2>&1; then
12488 direntrytype="$guess1"
12489 echo "Your directory entries are $direntrytype." >&4
12490 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12491 direntrytype="$guess2"
12492 echo "Your directory entries seem to be $direntrytype." >&4
12494 echo "I don't recognize your system's directory entries." >&4
12495 rp="What type is used for directory entries on this system?"
12498 direntrytype="$ans"
12502 : see if the directory entry stores field length
12504 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12505 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12506 echo "Good, your directory entry keeps length information in d_namlen." >&4
12509 echo "Your directory entry does not know about the d_namlen field." >&4
12516 : Look for DIR.dd_fd
12517 case "$i_dirent" in
12519 echo "Checking to see if DIR has a dd_fd member variable" >&4
12521 #$i_stdlib I_STDLIB
12523 #include <stdlib.h>
12525 #include <dirent.h>
12535 if eval $compile; then
12536 echo "Yes, it does."
12539 echo "No, it does not."
12544 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12552 : see if this is an sysdir system
12553 set sys/dir.h i_sysdir
12556 : see if this is an sysndir system
12557 set sys/ndir.h i_sysndir
12562 $cat >dirfd.c <<EOM
12564 #$i_stdlib I_STDLIB
12566 #include <stdlib.h>
12568 #$i_dirent I_DIRENT /**/
12569 #$i_sysdir I_SYS_DIR /**/
12570 #$i_sysndir I_SYS_NDIR /**/
12571 #$i_systypes I_SYS_TYPES /**/
12572 #if defined(I_SYS_TYPES)
12573 #include <sys/types.h>
12575 #if defined(I_DIRENT)
12576 #include <dirent.h>
12579 #include <sys/ndir.h>
12583 #include <ndir.h> /* may be wrong in the future */
12585 #include <sys/dir.h>
12591 DIR *dirp = opendir(".");
12592 if (dirfd(dirp) >= 0)
12600 if eval $compile; then
12604 $define) echo "dirfd() found." >&4 ;;
12605 *) echo "dirfd() NOT found." >&4 ;;
12611 : see if dladdr exists
12612 set dladdr d_dladdr
12615 : see if dlerror exists
12618 set dlerror d_dlerror
12622 : see if dlfcn is available
12623 set dlfcn.h i_dlfcn
12626 : Check what extension to use for shared libs
12631 On a few systems, the dynamically loaded modules that perl generates and uses
12632 will need a different extension than shared libs. The default will probably
12638 *) dflt="$dlext" ;;
12640 rp='What is the extension of dynamically loaded modules'
12649 : Check if dlsym need a leading underscore
12655 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12656 $cat >dyna.c <<'EOM'
12663 #$i_stdlib I_STDLIB
12665 #include <stdlib.h>
12669 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12671 #include <sys/types.h>
12676 extern int fred() ;
12685 int mode = RTLD_LAZY ;
12687 handle = dlopen("./dyna.$dlext", mode) ;
12688 if (handle == NULL) {
12693 symbol = dlsym(handle, "fred") ;
12694 if (symbol == NULL) {
12695 /* try putting a leading underscore */
12696 symbol = dlsym(handle, "_fred") ;
12697 if (symbol == NULL) {
12710 : Call the object file tmp-dyna.o in case dlext=o.
12711 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12712 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12713 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12714 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12717 1) echo "Test program failed using dlopen." >&4
12718 echo "Perhaps you should not use dynamic loading." >&4;;
12719 2) echo "Test program failed using dlsym." >&4
12720 echo "Perhaps you should not use dynamic loading." >&4;;
12721 3) echo "dlsym needs a leading underscore" >&4
12723 4) echo "dlsym doesn't need a leading underscore." >&4;;
12726 echo "I can't compile and run the test program." >&4
12727 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12732 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12737 : see if drand48_r exists
12738 set drand48_r d_drand48_r
12740 case "$d_drand48_r" in
12742 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12743 case "$d_drand48_r_proto:$usethreads" in
12744 ":define") d_drand48_r_proto=define
12745 set d_drand48_r_proto drand48_r $hdrs
12749 case "$d_drand48_r_proto" in
12751 case "$drand48_r_proto" in
12752 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12753 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12755 case "$drand48_r_proto" in
12756 ''|0) d_drand48_r=undef
12758 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12759 * ) case "$drand48_r_proto" in
12760 REENTRANT_PROTO*) ;;
12761 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12763 echo "Prototype: $try" ;;
12766 *) case "$usethreads" in
12767 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12774 *) drand48_r_proto=0
12778 : see if prototype for drand48 is available
12780 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12783 : see if dup2 exists
12787 : see if eaccess exists
12788 set eaccess d_eaccess
12791 : see if endgrent exists
12792 set endgrent d_endgrent
12795 : see if this is an grp system
12801 xxx=`./findhdr grp.h`
12802 $cppstdin $cppflags $cppminus < $xxx >$$.h
12804 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12816 set d_grpasswd; eval $setvar
12820 : see if endgrent_r exists
12821 set endgrent_r d_endgrent_r
12823 case "$d_endgrent_r" in
12825 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12826 case "$d_endgrent_r_proto:$usethreads" in
12827 ":define") d_endgrent_r_proto=define
12828 set d_endgrent_r_proto endgrent_r $hdrs
12832 case "$d_endgrent_r_proto" in
12834 case "$endgrent_r_proto" in
12835 ''|0) try='int endgrent_r(FILE**);'
12836 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12838 case "$endgrent_r_proto" in
12839 ''|0) try='void endgrent_r(FILE**);'
12840 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12842 case "$endgrent_r_proto" in
12843 ''|0) d_endgrent_r=undef
12845 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12846 * ) case "$endgrent_r_proto" in
12847 REENTRANT_PROTO*) ;;
12848 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12850 echo "Prototype: $try" ;;
12853 *) case "$usethreads" in
12854 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12861 *) endgrent_r_proto=0
12865 : see if endhostent exists
12866 set endhostent d_endhent
12869 : see if this is a netdb.h system
12870 set netdb.h i_netdb
12873 : see if endhostent_r exists
12874 set endhostent_r d_endhostent_r
12876 case "$d_endhostent_r" in
12878 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12879 case "$d_endhostent_r_proto:$usethreads" in
12880 ":define") d_endhostent_r_proto=define
12881 set d_endhostent_r_proto endhostent_r $hdrs
12885 case "$d_endhostent_r_proto" in
12887 case "$endhostent_r_proto" in
12888 ''|0) try='int endhostent_r(struct hostent_data*);'
12889 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12891 case "$endhostent_r_proto" in
12892 ''|0) try='void endhostent_r(struct hostent_data*);'
12893 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12895 case "$endhostent_r_proto" in
12896 ''|0) d_endhostent_r=undef
12897 endhostent_r_proto=0
12898 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12899 * ) case "$endhostent_r_proto" in
12900 REENTRANT_PROTO*) ;;
12901 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12903 echo "Prototype: $try" ;;
12906 *) case "$usethreads" in
12907 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12909 d_endhostent_r=undef
12910 endhostent_r_proto=0
12914 *) endhostent_r_proto=0
12918 : see if endnetent exists
12919 set endnetent d_endnent
12922 : see if endnetent_r exists
12923 set endnetent_r d_endnetent_r
12925 case "$d_endnetent_r" in
12927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12928 case "$d_endnetent_r_proto:$usethreads" in
12929 ":define") d_endnetent_r_proto=define
12930 set d_endnetent_r_proto endnetent_r $hdrs
12934 case "$d_endnetent_r_proto" in
12936 case "$endnetent_r_proto" in
12937 ''|0) try='int endnetent_r(struct netent_data*);'
12938 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12940 case "$endnetent_r_proto" in
12941 ''|0) try='void endnetent_r(struct netent_data*);'
12942 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12944 case "$endnetent_r_proto" in
12945 ''|0) d_endnetent_r=undef
12946 endnetent_r_proto=0
12947 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12948 * ) case "$endnetent_r_proto" in
12949 REENTRANT_PROTO*) ;;
12950 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12952 echo "Prototype: $try" ;;
12955 *) case "$usethreads" in
12956 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12958 d_endnetent_r=undef
12959 endnetent_r_proto=0
12963 *) endnetent_r_proto=0
12967 : see if endprotoent exists
12968 set endprotoent d_endpent
12971 : see if endprotoent_r exists
12972 set endprotoent_r d_endprotoent_r
12974 case "$d_endprotoent_r" in
12976 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12977 case "$d_endprotoent_r_proto:$usethreads" in
12978 ":define") d_endprotoent_r_proto=define
12979 set d_endprotoent_r_proto endprotoent_r $hdrs
12983 case "$d_endprotoent_r_proto" in
12985 case "$endprotoent_r_proto" in
12986 ''|0) try='int endprotoent_r(struct protoent_data*);'
12987 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12989 case "$endprotoent_r_proto" in
12990 ''|0) try='void endprotoent_r(struct protoent_data*);'
12991 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12993 case "$endprotoent_r_proto" in
12994 ''|0) d_endprotoent_r=undef
12995 endprotoent_r_proto=0
12996 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12997 * ) case "$endprotoent_r_proto" in
12998 REENTRANT_PROTO*) ;;
12999 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13001 echo "Prototype: $try" ;;
13004 *) case "$usethreads" in
13005 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13007 d_endprotoent_r=undef
13008 endprotoent_r_proto=0
13012 *) endprotoent_r_proto=0
13016 : see if endpwent exists
13017 set endpwent d_endpwent
13020 : see if this is a pwd.h system
13026 xxx=`./findhdr pwd.h`
13027 $cppstdin $cppflags $cppminus < $xxx >$$.h
13029 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13037 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13045 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13053 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13061 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13069 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13077 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13085 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13097 set d_pwquota; eval $setvar
13098 set d_pwage; eval $setvar
13099 set d_pwchange; eval $setvar
13100 set d_pwclass; eval $setvar
13101 set d_pwexpire; eval $setvar
13102 set d_pwcomment; eval $setvar
13103 set d_pwgecos; eval $setvar
13104 set d_pwpasswd; eval $setvar
13108 : see if endpwent_r exists
13109 set endpwent_r d_endpwent_r
13111 case "$d_endpwent_r" in
13113 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13114 case "$d_endpwent_r_proto:$usethreads" in
13115 ":define") d_endpwent_r_proto=define
13116 set d_endpwent_r_proto endpwent_r $hdrs
13120 case "$d_endpwent_r_proto" in
13122 case "$endpwent_r_proto" in
13123 ''|0) try='int endpwent_r(FILE**);'
13124 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13126 case "$endpwent_r_proto" in
13127 ''|0) try='void endpwent_r(FILE**);'
13128 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13130 case "$endpwent_r_proto" in
13131 ''|0) d_endpwent_r=undef
13133 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13134 * ) case "$endpwent_r_proto" in
13135 REENTRANT_PROTO*) ;;
13136 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13138 echo "Prototype: $try" ;;
13141 *) case "$usethreads" in
13142 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13149 *) endpwent_r_proto=0
13153 : see if endservent exists
13154 set endservent d_endsent
13157 : see if endservent_r exists
13158 set endservent_r d_endservent_r
13160 case "$d_endservent_r" in
13162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13163 case "$d_endservent_r_proto:$usethreads" in
13164 ":define") d_endservent_r_proto=define
13165 set d_endservent_r_proto endservent_r $hdrs
13169 case "$d_endservent_r_proto" in
13171 case "$endservent_r_proto" in
13172 ''|0) try='int endservent_r(struct servent_data*);'
13173 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13175 case "$endservent_r_proto" in
13176 ''|0) try='void endservent_r(struct servent_data*);'
13177 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13179 case "$endservent_r_proto" in
13180 ''|0) d_endservent_r=undef
13181 endservent_r_proto=0
13182 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13183 * ) case "$endservent_r_proto" in
13184 REENTRANT_PROTO*) ;;
13185 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13187 echo "Prototype: $try" ;;
13190 *) case "$usethreads" in
13191 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13193 d_endservent_r=undef
13194 endservent_r_proto=0
13198 *) endservent_r_proto=0
13202 : Locate the flags for 'open()'
13205 #include <sys/types.h>
13210 #include <sys/file.h>
13212 #$i_stdlib I_STDLIB
13214 #include <stdlib.h>
13225 : check sys/file.h first to get FREAD on Sun
13226 if $test `./findhdr sys/file.h` && \
13227 set try -DI_SYS_FILE && eval $compile; then
13229 echo "<sys/file.h> defines the O_* constants..." >&4
13230 if $run ./try; then
13231 echo "and you have the 3 argument form of open()." >&4
13234 echo "but not the 3 argument form of open(). Oh, well." >&4
13237 elif $test `./findhdr fcntl.h` && \
13238 set try -DI_FCNTL && eval $compile; then
13240 echo "<fcntl.h> defines the O_* constants..." >&4
13241 if $run ./try; then
13242 echo "and you have the 3 argument form of open()." >&4
13245 echo "but not the 3 argument form of open(). Oh, well." >&4
13250 echo "I can't find the O_* constant definitions! You got problems." >&4
13256 : see if this is a sys/file.h system
13261 : do we need to include sys/file.h ?
13265 if $h_sysfile; then
13267 echo "We'll be including <sys/file.h>." >&4
13270 echo "We won't be including <sys/file.h>." >&4
13280 : see if fcntl.h is there
13285 : see if we can include fcntl.h
13291 echo "We'll be including <fcntl.h>." >&4
13294 if $h_sysfile; then
13295 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13297 echo "We won't be including <fcntl.h>." >&4
13309 : see if fork exists
13313 : see if pipe exists
13317 : check for non-blocking I/O stuff
13318 case "$h_sysfile" in
13319 true) echo "#include <sys/file.h>" > head.c;;
13322 true) echo "#include <fcntl.h>" > head.c;;
13323 *) echo "#include <sys/fcntl.h>" > head.c;;
13328 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13329 case "$o_nonblock" in
13331 $cat head.c > try.c
13332 $cat >>try.c <<EOCP
13334 #$i_stdlib I_STDLIB
13336 #include <stdlib.h>
13344 printf("O_NONBLOCK\n");
13348 printf("O_NDELAY\n");
13352 printf("FNDELAY\n");
13359 if eval $compile_ok; then
13360 o_nonblock=`$run ./try`
13361 case "$o_nonblock" in
13362 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13363 *) echo "Seems like we can use $o_nonblock.";;
13366 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13369 *) echo "Using $hint value $o_nonblock.";;
13374 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13377 case "$d_fork:$d_pipe:$d_alarm" in
13378 define:define:define)
13379 $cat head.c > try.c
13380 $cat >>try.c <<EOCP
13382 #include <sys/types.h>
13383 #include <signal.h>
13385 #$i_stdlib I_STDLIB
13387 #include <stdlib.h>
13393 #define MY_O_NONBLOCK $o_nonblock
13394 #ifndef errno /* XXX need better Configure test */
13397 #$i_unistd I_UNISTD
13399 #include <unistd.h>
13401 #$i_string I_STRING
13403 #include <string.h>
13405 #include <strings.h>
13407 $signal_t blech(int x) { exit(3); }
13409 $cat >> try.c <<'EOCP'
13418 ret = pipe(pd); /* Down: child -> parent */
13421 ret = pipe(pu); /* Up: parent -> child */
13425 close(pd[1]); /* Parent reads from pd[0] */
13426 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13428 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13433 signal(SIGALRM, blech);
13435 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13437 sprintf(string, "%d\n", ret);
13438 ret = write(2, string, strlen(string));
13439 if (ret != strlen(string))
13443 if (errno == EAGAIN) {
13444 printf("EAGAIN\n");
13449 if (errno == EWOULDBLOCK)
13450 printf("EWOULDBLOCK\n");
13453 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13456 sleep(2); /* Give it time to close our pipe */
13458 ret = read(pd[0], buf, 1); /* Should read EOF */
13460 sprintf(string, "%d\n", ret);
13461 ret = write(4, string, strlen(string));
13462 if (ret != strlen(string))
13467 close(pd[0]); /* We write to pd[1] */
13468 close(pu[1]); /* We read from pu[0] */
13469 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13472 close(pd[1]); /* Pipe pd is now fully closed! */
13473 exit(0); /* Bye bye, thank you for playing! */
13477 if eval $compile_ok; then
13478 echo "$startsh" >mtry
13479 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13481 $run ./mtry >/dev/null 2>&1
13483 0) eagain=`$cat try.out`;;
13484 1) echo "Could not perform non-blocking setting!";;
13485 2) echo "I did a successful read() for something that was not there!";;
13486 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13487 4) echo "Could not find F_SETFL!";;
13488 *) echo "Something terribly wrong happened during testing.";;
13490 rd_nodata=`$cat try.ret`
13491 echo "A read() system call with no data present returns $rd_nodata."
13492 case "$rd_nodata" in
13495 echo "(That's peculiar, fixing that to be -1.)"
13501 echo "Forcing errno EAGAIN on read() with no data available."
13505 echo "Your read() sets errno to $eagain when no data is available."
13508 status=`$cat try.err`
13510 0) echo "And it correctly returns 0 to signal EOF.";;
13511 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13512 *) echo "However, your read() returns '$status' on EOF??";;
13515 if test "$status" = "$rd_nodata"; then
13516 echo "WARNING: you can't distinguish between EOF and no data!"
13520 echo "I can't compile the test program--assuming errno EAGAIN will do."
13524 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13533 echo "Using $hint value $eagain."
13534 echo "Your read() returns $rd_nodata when no data is present."
13535 case "$d_eofnblk" in
13536 "$define") echo "And you can see EOF because read() returns 0.";;
13537 "$undef") echo "But you can't see EOF status from read() returned value.";;
13539 echo "(Assuming you can't see EOF status from read anyway.)"
13545 $rm_try head.c mtry
13547 : see if erf exists
13551 : see if erfc exists
13555 : see if exp2 exists
13559 : see if expm1 exists
13563 : see if _ptr and _cnt from stdio act std
13566 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13567 echo "(Looks like you have stdio.h from BSD.)"
13568 case "$stdio_ptr" in
13569 '') stdio_ptr='((fp)->_p)'
13572 *) ptr_lval=$d_stdio_ptr_lval;;
13574 case "$stdio_cnt" in
13575 '') stdio_cnt='((fp)->_r)'
13578 *) cnt_lval=$d_stdio_cnt_lval;;
13580 case "$stdio_base" in
13581 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13583 case "$stdio_bufsiz" in
13584 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13586 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13587 echo "(Looks like you have stdio.h from Linux.)"
13588 case "$stdio_ptr" in
13589 '') stdio_ptr='((fp)->_IO_read_ptr)'
13592 *) ptr_lval=$d_stdio_ptr_lval;;
13594 case "$stdio_cnt" in
13595 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13598 *) cnt_lval=$d_stdio_cnt_lval;;
13600 case "$stdio_base" in
13601 '') stdio_base='((fp)->_IO_read_base)';;
13603 case "$stdio_bufsiz" in
13604 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13607 case "$stdio_ptr" in
13608 '') stdio_ptr='((fp)->_ptr)'
13611 *) ptr_lval=$d_stdio_ptr_lval;;
13613 case "$stdio_cnt" in
13614 '') stdio_cnt='((fp)->_cnt)'
13617 *) cnt_lval=$d_stdio_cnt_lval;;
13619 case "$stdio_base" in
13620 '') stdio_base='((fp)->_base)';;
13622 case "$stdio_bufsiz" in
13623 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13627 : test whether _ptr and _cnt really work
13628 echo "Checking how std your stdio is..." >&4
13631 #$i_stdlib I_STDLIB
13633 #include <stdlib.h>
13635 #define FILE_ptr(fp) $stdio_ptr
13636 #define FILE_cnt(fp) $stdio_cnt
13638 FILE *fp = fopen("try.c", "r");
13641 18 <= FILE_cnt(fp) &&
13642 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13650 if eval $compile && $to try.c; then
13651 if $run ./try; then
13652 echo "Your stdio acts pretty std."
13655 echo "Your stdio isn't very std."
13658 echo "Your stdio doesn't appear very std."
13662 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13663 # direct buffer manipulation no longer works. The Configure tests
13664 # should be changed to correctly detect this, but until then,
13665 # the following check should at least let perl compile and run.
13666 # (This quick fix should be updated before 5.8.1.)
13667 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13668 # A. Dougherty, June 3, 2002.
13669 case "$d_gnulibc" in
13671 case "$gnulibc_version" in
13675 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13684 : Can _ptr be used as an lvalue?
13685 case "$d_stdstdio$ptr_lval" in
13686 $define$define) val=$define ;;
13689 set d_stdio_ptr_lval
13692 : Can _cnt be used as an lvalue?
13693 case "$d_stdstdio$cnt_lval" in
13694 $define$define) val=$define ;;
13697 set d_stdio_cnt_lval
13701 : test whether setting _ptr sets _cnt as a side effect
13702 d_stdio_ptr_lval_sets_cnt="$undef"
13703 d_stdio_ptr_lval_nochange_cnt="$undef"
13704 case "$d_stdio_ptr_lval$d_stdstdio" in
13706 echo "Checking to see what happens if we set the stdio ptr..." >&4
13709 /* Can we scream? */
13710 /* Eat dust sed :-) */
13711 /* In the buffer space, no one can hear you scream. */
13712 #$i_stdlib I_STDLIB
13714 #include <stdlib.h>
13716 #define FILE_ptr(fp) $stdio_ptr
13717 #define FILE_cnt(fp) $stdio_cnt
13718 #include <sys/types.h>
13720 FILE *fp = fopen("try.c", "r");
13725 puts("Fail even to read");
13728 c = getc(fp); /* Read away the first # */
13730 puts("Fail even to read");
13734 18 <= FILE_cnt(fp) &&
13735 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13737 puts("Fail even to read");
13740 ptr = (char*) FILE_ptr(fp);
13741 cnt = (size_t)FILE_cnt(fp);
13743 FILE_ptr(fp) += 42;
13745 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13746 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13749 if (FILE_cnt(fp) <= 20) {
13750 printf ("Fail (<20 chars to test)");
13753 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13754 puts("Fail compare");
13757 if (cnt == FILE_cnt(fp)) {
13758 puts("Pass_unchanged");
13761 if (FILE_cnt(fp) == (cnt - 42)) {
13762 puts("Pass_changed");
13765 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13771 if eval $compile && $to try.c; then
13772 case `$run ./try` in
13774 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13775 d_stdio_ptr_lval_sets_cnt="$define" ;;
13777 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13778 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13780 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13782 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13785 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13791 : see if _base is also standard
13793 case "$d_stdstdio" in
13797 #$i_stdlib I_STDLIB
13799 #include <stdlib.h>
13801 #define FILE_base(fp) $stdio_base
13802 #define FILE_bufsiz(fp) $stdio_bufsiz
13804 FILE *fp = fopen("try.c", "r");
13807 19 <= FILE_bufsiz(fp) &&
13808 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13815 if eval $compile && $to try.c; then
13816 if $run ./try; then
13817 echo "And its _base field acts std."
13820 echo "But its _base field isn't std."
13823 echo "However, it seems to be lacking the _base field."
13831 : see if fast_stdio exists
13833 case "$d_stdstdio:$d_stdio_ptr_lval" in
13835 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13837 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13848 : see if fchdir exists
13849 set fchdir d_fchdir
13852 : see if fchmod exists
13853 set fchmod d_fchmod
13856 : see if fchown exists
13857 set fchown d_fchown
13860 : see if this is an fcntl system
13864 : See if fcntl-based locking works.
13867 #$i_stdlib I_STDLIB
13869 #include <stdlib.h>
13871 #include <unistd.h>
13873 #include <signal.h>
13874 $signal_t blech(int x) { exit(3); }
13876 #if defined(F_SETLK) && defined(F_SETLKW)
13877 struct flock flock;
13879 fd = open("try.c", O_RDONLY);
13880 flock.l_type = F_RDLCK;
13881 flock.l_whence = SEEK_SET;
13882 flock.l_start = flock.l_len = 0;
13883 signal(SIGALRM, blech);
13885 retval = fcntl(fd, F_SETLK, &flock);
13887 (retval < 0 ? exit(2) : exit(0));
13893 echo "Checking if fcntl-based file locking works... "
13897 if eval $compile_ok; then
13898 if $run ./try; then
13899 echo "Yes, it seems to work."
13902 echo "Nope, it didn't work."
13907 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13908 *** This is (almost) impossible.
13909 *** If your NFS lock daemons are not feeling well, something like
13910 *** this may happen, please investigate. Cannot continue, aborting.
13918 echo "I'm unable to compile the test program, so I'll assume not."
13923 echo "Nope, since you don't even have fcntl()."
13926 set d_fcntl_can_lock
13930 : check for fd_set items
13933 Checking to see how well your C compiler handles fd_set and friends ...
13936 #$i_stdlib I_STDLIB
13938 #include <stdlib.h>
13940 #$i_systime I_SYS_TIME
13941 #$i_sysselct I_SYS_SELECT
13942 #$d_socket HAS_SOCKET
13943 #include <sys/types.h>
13945 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13948 #include <sys/time.h>
13950 #ifdef I_SYS_SELECT
13951 #include <sys/select.h>
13960 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13968 if eval $compile; then
13969 d_fds_bits="$define"
13971 echo "Well, your system knows about the normal fd_set typedef..." >&4
13972 if $run ./try; then
13973 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13974 d_fd_macros="$define"
13977 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13979 d_fd_macros="$undef"
13983 Hmm, your compiler has some difficulty with fd_set. Checking further...
13986 if eval $compile; then
13987 d_fds_bits="$undef"
13989 echo "Well, your system has some sort of fd_set available..." >&4
13990 if $run ./try; then
13991 echo "and you have the normal fd_set macros." >&4
13992 d_fd_macros="$define"
13995 but not the normal fd_set macros! Gross! More work for me...
13997 d_fd_macros="$undef"
14000 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14002 d_fds_bits="$undef"
14003 d_fd_macros="$undef"
14008 : see if fdclose exists
14009 set fdclose d_fdclose
14012 : see if fdim exists
14016 : see if fegetround exists
14017 set fegetround d_fegetround
14020 : see if fgetpos exists
14021 set fgetpos d_fgetpos
14024 : see if finite exists
14025 set finite d_finite
14028 : see if finitel exists
14029 set finitel d_finitel
14032 : see if flock exists
14036 : see if prototype for flock is available
14038 set d_flockproto flock $i_sysfile sys/file.h
14041 : see if fma exists
14045 : see if fmax exists
14049 : see if fmin exists
14053 : see if fp_class exists
14054 set fp_class d_fp_class
14057 : see if this is a math.h system
14061 : check for fpclassify
14062 echo "Checking to see if you have fpclassify..." >&4
14068 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14071 if eval $compile; then
14073 echo "You have fpclassify."
14076 echo "You do not have fpclassify."
14082 : see if fp_classify exists
14083 set fp_classify d_fp_classify
14086 : see if fp_classl exists
14087 set fp_classl d_fp_classl
14090 : see if pathconf exists
14091 set pathconf d_pathconf
14094 : see if fpathconf exists
14095 set fpathconf d_fpathconf
14098 : see if fpclass exists
14099 set fpclass d_fpclass
14102 : see if fpclassl exists
14103 set fpclassl d_fpclassl
14106 : see if fpgetround exists
14107 set fpgetround d_fpgetround
14110 : check for fpos64_t
14112 echo "Checking to see if you have fpos64_t..." >&4
14115 int main() { fpos64_t x = 7; }
14118 if eval $compile; then
14120 echo "You have fpos64_t."
14123 echo "You do not have fpos64_t."
14124 case "$fpossize" in
14125 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14132 : see if this is an xlocale.h system
14133 set xlocale.h i_xlocale
14136 : see if newlocale exists
14137 set newlocale d_newlocale
14140 : see if freelocale exists
14141 set freelocale d_freelocale
14144 : see if uselocale exists
14145 set uselocale d_uselocale
14148 : see if duplocale exists
14149 set duplocale d_duplocale
14152 : see if frexpl exists
14153 set frexpl d_frexpl
14156 : see if this is a sys/param system
14157 set sys/param.h i_sysparam
14160 : see if this is a sys/mount.h system
14161 set sys/mount.h i_sysmount
14164 : Check for fs_data_s
14166 echo "Checking to see if your system supports struct fs_data..." >&4
14167 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14169 case "$d_fs_data_s" in
14170 "$define") echo "Yes, it does." ;;
14171 *) echo "No, it doesn't." ;;
14174 : see if fseeko exists
14175 set fseeko d_fseeko
14177 case "$longsize" in
14178 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14181 : see if fsetpos exists
14182 set fsetpos d_fsetpos
14185 : see if fstatfs exists
14186 set fstatfs d_fstatfs
14189 : see if statvfs exists
14190 set statvfs d_statvfs
14193 : see if fstatvfs exists
14194 set fstatvfs d_fstatvfs
14198 : see if fsync exists
14202 : see if ftello exists
14203 set ftello d_ftello
14205 case "$longsize" in
14206 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14209 : check for a working futimes
14212 echo "Checking if you have a working futimes()" >&4
14215 #include <sys/time.h>
14222 fd = open ("try.c", O_RDWR);
14223 if (-1 == fd) exit (1);
14224 rv = futimes (fd, NULL);
14225 exit (rv == -1 ? errno : 0);
14229 if eval $compile; then
14233 0) echo "Yes, you have" >&4
14234 d_futimes="$define"
14236 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14240 echo "No, it does not (probably harmless)" >&4
14244 : see if ndbm.h is available
14247 : Compatibility location for RedHat 7.1
14248 set gdbm/ndbm.h i_gdbmndbm
14250 : Compatibility location for Debian 4.0
14251 set gdbm-ndbm.h i_gdbm_ndbm
14255 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14256 : see if dbm_open exists
14257 set dbm_open d_dbm_open
14259 case "$d_dbm_open" in
14262 i_gdbmndbm="$undef"
14263 i_gdbm_ndbm="$undef"
14264 echo "We won't be including <ndbm.h>"
14274 ndbm_hdr_protochk='name=$1; hdr=$2;
14275 eval "ihdr=\$""i_$name";
14277 if $test "$ihdr" = "$define"; then
14278 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14279 case "$d_cplusplus" in
14280 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14281 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14284 $define) $echo "Your <$hdr> seems to have prototypes";;
14285 *) $echo "Your <$hdr> does not seem to have prototypes";;
14288 set "d_${name}_h_uses_prototypes";
14292 eval $ndbm_hdr_protochk
14293 set gdbmndbm gdbm/ndbm.h
14294 eval $ndbm_hdr_protochk
14295 set gdbm_ndbm gdbm-ndbm.h
14296 eval $ndbm_hdr_protochk
14298 : see if getaddrinfo exists
14299 set getaddrinfo d_getaddrinfo
14302 : see if getcwd exists
14303 set getcwd d_getcwd
14306 : see if getespwnam exists
14307 set getespwnam d_getespwnam
14310 : see if getfsstat exists
14311 set getfsstat d_getfsstat
14314 : see if getgrent exists
14315 set getgrent d_getgrent
14318 : see if getgrent_r exists
14319 set getgrent_r d_getgrent_r
14321 case "$d_getgrent_r" in
14323 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14324 case "$d_getgrent_r_proto:$usethreads" in
14325 ":define") d_getgrent_r_proto=define
14326 set d_getgrent_r_proto getgrent_r $hdrs
14330 case "$d_getgrent_r_proto" in
14332 case "$getgrent_r_proto" in
14333 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14334 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14336 case "$getgrent_r_proto" in
14337 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14338 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14340 case "$getgrent_r_proto" in
14341 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14342 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14344 case "$getgrent_r_proto" in
14345 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14346 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14348 case "$getgrent_r_proto" in
14349 ''|0) try='int getgrent_r(struct group*, char*, int);'
14350 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14352 case "$getgrent_r_proto" in
14353 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14354 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14356 case "$getgrent_r_proto" in
14357 ''|0) d_getgrent_r=undef
14359 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14360 * ) case "$getgrent_r_proto" in
14361 REENTRANT_PROTO*) ;;
14362 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14364 echo "Prototype: $try" ;;
14367 *) case "$usethreads" in
14368 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14375 *) getgrent_r_proto=0
14379 : see if getgrgid_r exists
14380 set getgrgid_r d_getgrgid_r
14382 case "$d_getgrgid_r" in
14384 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14385 case "$d_getgrgid_r_proto:$usethreads" in
14386 ":define") d_getgrgid_r_proto=define
14387 set d_getgrgid_r_proto getgrgid_r $hdrs
14391 case "$d_getgrgid_r_proto" in
14393 case "$getgrgid_r_proto" in
14394 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14395 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14397 case "$getgrgid_r_proto" in
14398 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14399 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14401 case "$getgrgid_r_proto" in
14402 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14403 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14405 case "$getgrgid_r_proto" in
14406 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14407 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14409 case "$getgrgid_r_proto" in
14410 ''|0) d_getgrgid_r=undef
14412 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14413 * ) case "$getgrgid_r_proto" in
14414 REENTRANT_PROTO*) ;;
14415 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14417 echo "Prototype: $try" ;;
14420 *) case "$usethreads" in
14421 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14428 *) getgrgid_r_proto=0
14432 : see if getgrnam_r exists
14433 set getgrnam_r d_getgrnam_r
14435 case "$d_getgrnam_r" in
14437 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14438 case "$d_getgrnam_r_proto:$usethreads" in
14439 ":define") d_getgrnam_r_proto=define
14440 set d_getgrnam_r_proto getgrnam_r $hdrs
14444 case "$d_getgrnam_r_proto" in
14446 case "$getgrnam_r_proto" in
14447 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14448 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14450 case "$getgrnam_r_proto" in
14451 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14452 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14454 case "$getgrnam_r_proto" in
14455 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14456 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14458 case "$getgrnam_r_proto" in
14459 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14460 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14462 case "$getgrnam_r_proto" in
14463 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14464 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14466 case "$getgrnam_r_proto" in
14467 ''|0) d_getgrnam_r=undef
14469 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14470 * ) case "$getgrnam_r_proto" in
14471 REENTRANT_PROTO*) ;;
14472 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14474 echo "Prototype: $try" ;;
14477 *) case "$usethreads" in
14478 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14485 *) getgrnam_r_proto=0
14489 : see if gethostbyaddr exists
14490 set gethostbyaddr d_gethbyaddr
14493 : see if gethostbyname exists
14494 set gethostbyname d_gethbyname
14497 : see if gethostent exists
14498 set gethostent d_gethent
14501 : see how we will look up host name
14504 if set gethostname val -f d_gethname; eval $csym; $val; then
14505 echo 'gethostname() found.' >&4
14506 d_gethname="$define"
14509 if set uname val -f d_uname; eval $csym; $val; then
14512 uname() was found, but you're running xenix, and older versions of xenix
14513 have a broken uname(). If you don't really know whether your xenix is old
14514 enough to have a broken system call, use the default answer.
14519 "$define") dflt=n;;
14521 rp='Is your uname() broken?'
14524 n*) d_uname="$define"; call=uname;;
14527 echo 'uname() found.' >&4
14534 case "$d_gethname" in
14535 '') d_gethname="$undef";;
14538 '') d_uname="$undef";;
14540 case "$d_uname$d_gethname" in
14545 Every now and then someone has a $call() that lies about the hostname
14546 but can't be fixed for political or economic reasons. If you wish, I can
14547 pretend $call() isn't there and maybe compute hostname at run-time
14548 thanks to the '$phostname' command.
14551 rp="Shall I ignore $call() from now on?"
14554 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14557 case "$phostname" in
14558 '') aphostname='';;
14559 *) case "$aphostname" in
14561 *) set X $phostname
14565 file=`./loc $file $file $pth`
14566 aphostname=`echo $file $*`
14571 case "$d_uname$d_gethname" in
14574 case "$phostname" in
14576 echo "There will be no way for $package to get your hostname." >&4;;
14578 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14582 case "$d_phostname" in
14583 '') d_phostname="$undef";;
14586 : see if gethostbyaddr_r exists
14587 set gethostbyaddr_r d_gethostbyaddr_r
14589 case "$d_gethostbyaddr_r" in
14591 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14592 case "$d_gethostbyaddr_r_proto:$usethreads" in
14593 ":define") d_gethostbyaddr_r_proto=define
14594 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14598 case "$d_gethostbyaddr_r_proto" in
14600 case "$gethostbyaddr_r_proto" in
14601 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14602 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14604 case "$gethostbyaddr_r_proto" in
14605 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14606 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14608 case "$gethostbyaddr_r_proto" in
14609 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14610 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14612 case "$gethostbyaddr_r_proto" in
14613 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14614 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14616 case "$gethostbyaddr_r_proto" in
14617 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14618 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14620 case "$gethostbyaddr_r_proto" in
14621 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14622 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14624 case "$gethostbyaddr_r_proto" in
14625 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14626 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14628 case "$gethostbyaddr_r_proto" in
14629 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14630 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14632 case "$gethostbyaddr_r_proto" in
14633 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14634 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14636 case "$gethostbyaddr_r_proto" in
14637 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14638 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14640 case "$gethostbyaddr_r_proto" in
14641 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14642 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14644 case "$gethostbyaddr_r_proto" in
14645 ''|0) d_gethostbyaddr_r=undef
14646 gethostbyaddr_r_proto=0
14647 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14648 * ) case "$gethostbyaddr_r_proto" in
14649 REENTRANT_PROTO*) ;;
14650 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14652 echo "Prototype: $try" ;;
14655 *) case "$usethreads" in
14656 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14658 d_gethostbyaddr_r=undef
14659 gethostbyaddr_r_proto=0
14663 *) gethostbyaddr_r_proto=0
14667 : see if gethostbyname_r exists
14668 set gethostbyname_r d_gethostbyname_r
14670 case "$d_gethostbyname_r" in
14672 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14673 case "$d_gethostbyname_r_proto:$usethreads" in
14674 ":define") d_gethostbyname_r_proto=define
14675 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14679 case "$d_gethostbyname_r_proto" in
14681 case "$gethostbyname_r_proto" in
14682 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14683 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14685 case "$gethostbyname_r_proto" in
14686 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14687 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14689 case "$gethostbyname_r_proto" in
14690 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14691 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14693 case "$gethostbyname_r_proto" in
14694 ''|0) d_gethostbyname_r=undef
14695 gethostbyname_r_proto=0
14696 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14697 * ) case "$gethostbyname_r_proto" in
14698 REENTRANT_PROTO*) ;;
14699 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14701 echo "Prototype: $try" ;;
14704 *) case "$usethreads" in
14705 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14707 d_gethostbyname_r=undef
14708 gethostbyname_r_proto=0
14712 *) gethostbyname_r_proto=0
14716 : see if gethostent_r exists
14717 set gethostent_r d_gethostent_r
14719 case "$d_gethostent_r" in
14721 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14722 case "$d_gethostent_r_proto:$usethreads" in
14723 ":define") d_gethostent_r_proto=define
14724 set d_gethostent_r_proto gethostent_r $hdrs
14728 case "$d_gethostent_r_proto" in
14730 case "$gethostent_r_proto" in
14731 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14732 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14734 case "$gethostent_r_proto" in
14735 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14736 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14738 case "$gethostent_r_proto" in
14739 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14740 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14742 case "$gethostent_r_proto" in
14743 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14744 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14746 case "$gethostent_r_proto" in
14747 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14748 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14750 case "$gethostent_r_proto" in
14751 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14752 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14754 case "$gethostent_r_proto" in
14755 ''|0) d_gethostent_r=undef
14756 gethostent_r_proto=0
14757 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14758 * ) case "$gethostent_r_proto" in
14759 REENTRANT_PROTO*) ;;
14760 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14762 echo "Prototype: $try" ;;
14765 *) case "$usethreads" in
14766 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14768 d_gethostent_r=undef
14769 gethostent_r_proto=0
14773 *) gethostent_r_proto=0
14777 : see if prototypes for various gethostxxx netdb.h functions are available
14779 set d_gethostprotos gethostent $i_netdb netdb.h
14782 : see if getitimer exists
14783 set getitimer d_getitimer
14786 : see if getlogin exists
14787 set getlogin d_getlogin
14790 : see if getlogin_r exists
14791 set getlogin_r d_getlogin_r
14793 case "$d_getlogin_r" in
14795 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14796 case "$d_getlogin_r_proto:$usethreads" in
14797 ":define") d_getlogin_r_proto=define
14798 set d_getlogin_r_proto getlogin_r $hdrs
14802 case "$d_getlogin_r_proto" in
14804 case "$getlogin_r_proto" in
14805 ''|0) try='int getlogin_r(char*, size_t);'
14806 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14808 case "$getlogin_r_proto" in
14809 ''|0) try='int getlogin_r(char*, int);'
14810 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14812 case "$getlogin_r_proto" in
14813 ''|0) try='char* getlogin_r(char*, size_t);'
14814 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14816 case "$getlogin_r_proto" in
14817 ''|0) try='char* getlogin_r(char*, int);'
14818 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14820 case "$getlogin_r_proto" in
14821 ''|0) d_getlogin_r=undef
14823 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14824 * ) case "$getlogin_r_proto" in
14825 REENTRANT_PROTO*) ;;
14826 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14828 echo "Prototype: $try" ;;
14831 *) case "$usethreads" in
14832 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14839 *) getlogin_r_proto=0
14843 : see if getmnt exists
14844 set getmnt d_getmnt
14847 : see if getmntent exists
14848 set getmntent d_getmntent
14851 : see if getnameinfo exists
14852 set getnameinfo d_getnameinfo
14855 : see if getnetbyaddr exists
14856 set getnetbyaddr d_getnbyaddr
14859 : see if getnetbyname exists
14860 set getnetbyname d_getnbyname
14863 : see if getnetent exists
14864 set getnetent d_getnent
14867 : see if getnetbyaddr_r exists
14868 set getnetbyaddr_r d_getnetbyaddr_r
14870 case "$d_getnetbyaddr_r" in
14872 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14873 case "$d_getnetbyaddr_r_proto:$usethreads" in
14874 ":define") d_getnetbyaddr_r_proto=define
14875 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14879 case "$d_getnetbyaddr_r_proto" in
14881 case "$getnetbyaddr_r_proto" in
14882 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14883 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14885 case "$getnetbyaddr_r_proto" in
14886 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14887 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14889 case "$getnetbyaddr_r_proto" in
14890 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14891 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14893 case "$getnetbyaddr_r_proto" in
14894 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14895 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14897 case "$getnetbyaddr_r_proto" in
14898 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14899 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14901 case "$getnetbyaddr_r_proto" in
14902 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14903 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14905 case "$getnetbyaddr_r_proto" in
14906 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14907 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14909 case "$getnetbyaddr_r_proto" in
14910 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14911 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14913 case "$getnetbyaddr_r_proto" in
14914 ''|0) d_getnetbyaddr_r=undef
14915 getnetbyaddr_r_proto=0
14916 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14917 * ) case "$getnetbyaddr_r_proto" in
14918 REENTRANT_PROTO*) ;;
14919 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14921 echo "Prototype: $try" ;;
14924 *) case "$usethreads" in
14925 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14927 d_getnetbyaddr_r=undef
14928 getnetbyaddr_r_proto=0
14932 *) getnetbyaddr_r_proto=0
14936 : see if getnetbyname_r exists
14937 set getnetbyname_r d_getnetbyname_r
14939 case "$d_getnetbyname_r" in
14941 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14942 case "$d_getnetbyname_r_proto:$usethreads" in
14943 ":define") d_getnetbyname_r_proto=define
14944 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14948 case "$d_getnetbyname_r_proto" in
14950 case "$getnetbyname_r_proto" in
14951 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14952 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14954 case "$getnetbyname_r_proto" in
14955 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14956 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14958 case "$getnetbyname_r_proto" in
14959 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14960 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14962 case "$getnetbyname_r_proto" in
14963 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14964 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14966 case "$getnetbyname_r_proto" in
14967 ''|0) d_getnetbyname_r=undef
14968 getnetbyname_r_proto=0
14969 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14970 * ) case "$getnetbyname_r_proto" in
14971 REENTRANT_PROTO*) ;;
14972 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14974 echo "Prototype: $try" ;;
14977 *) case "$usethreads" in
14978 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14980 d_getnetbyname_r=undef
14981 getnetbyname_r_proto=0
14985 *) getnetbyname_r_proto=0
14989 : see if getnetent_r exists
14990 set getnetent_r d_getnetent_r
14992 case "$d_getnetent_r" in
14994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14995 case "$d_getnetent_r_proto:$usethreads" in
14996 ":define") d_getnetent_r_proto=define
14997 set d_getnetent_r_proto getnetent_r $hdrs
15001 case "$d_getnetent_r_proto" in
15003 case "$getnetent_r_proto" in
15004 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15005 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15007 case "$getnetent_r_proto" in
15008 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15009 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15011 case "$getnetent_r_proto" in
15012 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15013 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15015 case "$getnetent_r_proto" in
15016 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15017 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15019 case "$getnetent_r_proto" in
15020 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15021 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15023 case "$getnetent_r_proto" in
15024 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15025 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15027 case "$getnetent_r_proto" in
15028 ''|0) d_getnetent_r=undef
15029 getnetent_r_proto=0
15030 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15031 * ) case "$getnetent_r_proto" in
15032 REENTRANT_PROTO*) ;;
15033 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15035 echo "Prototype: $try" ;;
15038 *) case "$usethreads" in
15039 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15041 d_getnetent_r=undef
15042 getnetent_r_proto=0
15046 *) getnetent_r_proto=0
15050 : see if prototypes for various getnetxxx netdb.h functions are available
15052 set d_getnetprotos getnetent $i_netdb netdb.h
15055 : see if getpagesize exists
15056 set getpagesize d_getpagsz
15059 : Optional checks for getprotobyname and getprotobynumber
15061 : see if getprotobyname exists
15062 set getprotobyname d_getpbyname
15065 : see if getprotobynumber exists
15066 set getprotobynumber d_getpbynumber
15069 : see if getprotoent exists
15070 set getprotoent d_getpent
15073 : see if getpgid exists
15074 set getpgid d_getpgid
15077 : see if getpgrp2 exists
15078 set getpgrp2 d_getpgrp2
15081 : see if getppid exists
15082 set getppid d_getppid
15085 : see if getpriority exists
15086 set getpriority d_getprior
15089 : see if getprotobyname_r exists
15090 set getprotobyname_r d_getprotobyname_r
15092 case "$d_getprotobyname_r" in
15094 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15095 case "$d_getprotobyname_r_proto:$usethreads" in
15096 ":define") d_getprotobyname_r_proto=define
15097 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15101 case "$d_getprotobyname_r_proto" in
15103 case "$getprotobyname_r_proto" in
15104 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15105 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15107 case "$getprotobyname_r_proto" in
15108 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15109 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15111 case "$getprotobyname_r_proto" in
15112 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15113 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15115 case "$getprotobyname_r_proto" in
15116 ''|0) d_getprotobyname_r=undef
15117 getprotobyname_r_proto=0
15118 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15119 * ) case "$getprotobyname_r_proto" in
15120 REENTRANT_PROTO*) ;;
15121 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15123 echo "Prototype: $try" ;;
15126 *) case "$usethreads" in
15127 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15129 d_getprotobyname_r=undef
15130 getprotobyname_r_proto=0
15134 *) getprotobyname_r_proto=0
15138 : see if getprotobynumber_r exists
15139 set getprotobynumber_r d_getprotobynumber_r
15141 case "$d_getprotobynumber_r" in
15143 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15144 case "$d_getprotobynumber_r_proto:$usethreads" in
15145 ":define") d_getprotobynumber_r_proto=define
15146 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15150 case "$d_getprotobynumber_r_proto" in
15152 case "$getprotobynumber_r_proto" in
15153 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15154 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15156 case "$getprotobynumber_r_proto" in
15157 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15158 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15160 case "$getprotobynumber_r_proto" in
15161 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15162 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15164 case "$getprotobynumber_r_proto" in
15165 ''|0) d_getprotobynumber_r=undef
15166 getprotobynumber_r_proto=0
15167 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15168 * ) case "$getprotobynumber_r_proto" in
15169 REENTRANT_PROTO*) ;;
15170 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15172 echo "Prototype: $try" ;;
15175 *) case "$usethreads" in
15176 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15178 d_getprotobynumber_r=undef
15179 getprotobynumber_r_proto=0
15183 *) getprotobynumber_r_proto=0
15187 : see if getprotoent_r exists
15188 set getprotoent_r d_getprotoent_r
15190 case "$d_getprotoent_r" in
15192 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15193 case "$d_getprotoent_r_proto:$usethreads" in
15194 ":define") d_getprotoent_r_proto=define
15195 set d_getprotoent_r_proto getprotoent_r $hdrs
15199 case "$d_getprotoent_r_proto" in
15201 case "$getprotoent_r_proto" in
15202 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15203 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15205 case "$getprotoent_r_proto" in
15206 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15207 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15209 case "$getprotoent_r_proto" in
15210 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15211 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15213 case "$getprotoent_r_proto" in
15214 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15215 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15217 case "$getprotoent_r_proto" in
15218 ''|0) d_getprotoent_r=undef
15219 getprotoent_r_proto=0
15220 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15221 * ) case "$getprotoent_r_proto" in
15222 REENTRANT_PROTO*) ;;
15223 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15225 echo "Prototype: $try" ;;
15228 *) case "$usethreads" in
15229 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15231 d_getprotoent_r=undef
15232 getprotoent_r_proto=0
15236 *) getprotoent_r_proto=0
15240 : see if prototypes for various getprotoxxx netdb.h functions are available
15242 set d_getprotoprotos getprotoent $i_netdb netdb.h
15245 : see if getprpwnam exists
15246 set getprpwnam d_getprpwnam
15249 : see if getpwent exists
15250 set getpwent d_getpwent
15253 : see if getpwent_r exists
15254 set getpwent_r d_getpwent_r
15256 case "$d_getpwent_r" in
15258 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15259 case "$d_getpwent_r_proto:$usethreads" in
15260 ":define") d_getpwent_r_proto=define
15261 set d_getpwent_r_proto getpwent_r $hdrs
15265 case "$d_getpwent_r_proto" in
15267 case "$getpwent_r_proto" in
15268 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15269 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15271 case "$getpwent_r_proto" in
15272 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15273 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15275 case "$getpwent_r_proto" in
15276 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15277 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15279 case "$getpwent_r_proto" in
15280 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15281 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15283 case "$getpwent_r_proto" in
15284 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15285 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15287 case "$getpwent_r_proto" in
15288 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15289 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15291 case "$getpwent_r_proto" in
15292 ''|0) d_getpwent_r=undef
15294 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15295 * ) case "$getpwent_r_proto" in
15296 REENTRANT_PROTO*) ;;
15297 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15299 echo "Prototype: $try" ;;
15302 *) case "$usethreads" in
15303 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15310 *) getpwent_r_proto=0
15314 : see if getpwnam_r exists
15315 set getpwnam_r d_getpwnam_r
15317 case "$d_getpwnam_r" in
15319 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15320 case "$d_getpwnam_r_proto:$usethreads" in
15321 ":define") d_getpwnam_r_proto=define
15322 set d_getpwnam_r_proto getpwnam_r $hdrs
15326 case "$d_getpwnam_r_proto" in
15328 case "$getpwnam_r_proto" in
15329 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15330 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15332 case "$getpwnam_r_proto" in
15333 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15334 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15336 case "$getpwnam_r_proto" in
15337 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15338 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15340 case "$getpwnam_r_proto" in
15341 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15342 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15344 case "$getpwnam_r_proto" in
15345 ''|0) d_getpwnam_r=undef
15347 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15348 * ) case "$getpwnam_r_proto" in
15349 REENTRANT_PROTO*) ;;
15350 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15352 echo "Prototype: $try" ;;
15355 *) case "$usethreads" in
15356 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15363 *) getpwnam_r_proto=0
15367 : see if getpwuid_r exists
15368 set getpwuid_r d_getpwuid_r
15370 case "$d_getpwuid_r" in
15372 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15373 case "$d_getpwuid_r_proto:$usethreads" in
15374 ":define") d_getpwuid_r_proto=define
15375 set d_getpwuid_r_proto getpwuid_r $hdrs
15379 case "$d_getpwuid_r_proto" in
15381 case "$getpwuid_r_proto" in
15382 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15383 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15385 case "$getpwuid_r_proto" in
15386 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15387 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15389 case "$getpwuid_r_proto" in
15390 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15391 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15393 case "$getpwuid_r_proto" in
15394 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15395 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15397 case "$getpwuid_r_proto" in
15398 ''|0) d_getpwuid_r=undef
15400 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15401 * ) case "$getpwuid_r_proto" in
15402 REENTRANT_PROTO*) ;;
15403 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15405 echo "Prototype: $try" ;;
15408 *) case "$usethreads" in
15409 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15416 *) getpwuid_r_proto=0
15420 : Optional checks for getsbyname and getsbyport
15422 : see if getservbyname exists
15423 set getservbyname d_getsbyname
15426 : see if getservbyport exists
15427 set getservbyport d_getsbyport
15430 : see if getservent exists
15431 set getservent d_getsent
15434 : see if getservbyname_r exists
15435 set getservbyname_r d_getservbyname_r
15437 case "$d_getservbyname_r" in
15439 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15440 case "$d_getservbyname_r_proto:$usethreads" in
15441 ":define") d_getservbyname_r_proto=define
15442 set d_getservbyname_r_proto getservbyname_r $hdrs
15446 case "$d_getservbyname_r_proto" in
15448 case "$getservbyname_r_proto" in
15449 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15450 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15452 case "$getservbyname_r_proto" in
15453 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15454 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15456 case "$getservbyname_r_proto" in
15457 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15458 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15460 case "$getservbyname_r_proto" in
15461 ''|0) d_getservbyname_r=undef
15462 getservbyname_r_proto=0
15463 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15464 * ) case "$getservbyname_r_proto" in
15465 REENTRANT_PROTO*) ;;
15466 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15468 echo "Prototype: $try" ;;
15471 *) case "$usethreads" in
15472 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15474 d_getservbyname_r=undef
15475 getservbyname_r_proto=0
15479 *) getservbyname_r_proto=0
15483 : see if getservbyport_r exists
15484 set getservbyport_r d_getservbyport_r
15486 case "$d_getservbyport_r" in
15488 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15489 case "$d_getservbyport_r_proto:$usethreads" in
15490 ":define") d_getservbyport_r_proto=define
15491 set d_getservbyport_r_proto getservbyport_r $hdrs
15495 case "$d_getservbyport_r_proto" in
15497 case "$getservbyport_r_proto" in
15498 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15499 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15501 case "$getservbyport_r_proto" in
15502 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15503 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15505 case "$getservbyport_r_proto" in
15506 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15507 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15509 case "$getservbyport_r_proto" in
15510 ''|0) d_getservbyport_r=undef
15511 getservbyport_r_proto=0
15512 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15513 * ) case "$getservbyport_r_proto" in
15514 REENTRANT_PROTO*) ;;
15515 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15517 echo "Prototype: $try" ;;
15520 *) case "$usethreads" in
15521 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15523 d_getservbyport_r=undef
15524 getservbyport_r_proto=0
15528 *) getservbyport_r_proto=0
15532 : see if getservent_r exists
15533 set getservent_r d_getservent_r
15535 case "$d_getservent_r" in
15537 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15538 case "$d_getservent_r_proto:$usethreads" in
15539 ":define") d_getservent_r_proto=define
15540 set d_getservent_r_proto getservent_r $hdrs
15544 case "$d_getservent_r_proto" in
15546 case "$getservent_r_proto" in
15547 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15548 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15550 case "$getservent_r_proto" in
15551 ''|0) try='int getservent_r(struct servent*, char*, int);'
15552 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15554 case "$getservent_r_proto" in
15555 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15556 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15558 case "$getservent_r_proto" in
15559 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15560 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15562 case "$getservent_r_proto" in
15563 ''|0) d_getservent_r=undef
15564 getservent_r_proto=0
15565 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15566 * ) case "$getservent_r_proto" in
15567 REENTRANT_PROTO*) ;;
15568 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15570 echo "Prototype: $try" ;;
15573 *) case "$usethreads" in
15574 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15576 d_getservent_r=undef
15577 getservent_r_proto=0
15581 *) getservent_r_proto=0
15585 : see if prototypes for various getservxxx netdb.h functions are available
15587 set d_getservprotos getservent $i_netdb netdb.h
15590 : see if getspnam exists
15591 set getspnam d_getspnam
15594 : see if this is a shadow.h system
15595 set shadow.h i_shadow
15598 : see if getspnam_r exists
15599 set getspnam_r d_getspnam_r
15601 case "$d_getspnam_r" in
15603 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15604 case "$d_getspnam_r_proto:$usethreads" in
15605 ":define") d_getspnam_r_proto=define
15606 set d_getspnam_r_proto getspnam_r $hdrs
15610 case "$d_getspnam_r_proto" in
15612 case "$getspnam_r_proto" in
15613 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15614 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15616 case "$getspnam_r_proto" in
15617 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15618 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15620 case "$getspnam_r_proto" in
15621 ''|0) d_getspnam_r=undef
15623 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15624 * ) case "$getspnam_r_proto" in
15625 REENTRANT_PROTO*) ;;
15626 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15628 echo "Prototype: $try" ;;
15631 *) case "$usethreads" in
15632 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15639 *) getspnam_r_proto=0
15643 : see if gettimeofday or ftime exists
15644 set gettimeofday d_gettimeod
15646 case "$d_gettimeod" in
15652 val="$undef"; set d_ftime; eval $setvar
15655 case "$d_gettimeod$d_ftime" in
15658 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15662 : see if gmtime_r exists
15663 set gmtime_r d_gmtime_r
15665 case "$d_gmtime_r" in
15667 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15668 case "$d_gmtime_r_proto:$usethreads" in
15669 ":define") d_gmtime_r_proto=define
15670 set d_gmtime_r_proto gmtime_r $hdrs
15674 case "$d_gmtime_r_proto" in
15676 case "$gmtime_r_proto" in
15677 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15678 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15680 case "$gmtime_r_proto" in
15681 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15682 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15684 case "$gmtime_r_proto" in
15685 ''|0) d_gmtime_r=undef
15687 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15688 * ) case "$gmtime_r_proto" in
15689 REENTRANT_PROTO*) ;;
15690 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15692 echo "Prototype: $try" ;;
15695 *) case "$usethreads" in
15696 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15703 *) gmtime_r_proto=0
15707 : see if hasmntopt exists
15708 set hasmntopt d_hasmntopt
15711 : see if this is a netinet/in.h or sys/in.h system
15712 set netinet/in.h i_niin sys/in.h i_sysin
15715 : see if arpa/inet.h has to be included
15716 set arpa/inet.h i_arpainet
15719 : see if htonl --and friends-- exists
15724 : Maybe they are macros.
15727 $cat >htonl.c <<EOM
15729 #include <sys/types.h>
15730 #$i_niin I_NETINET_IN
15732 #$i_arpainet I_ARPA_INET
15733 #ifdef I_NETINET_IN
15734 #include <netinet/in.h>
15737 #include <sys/in.h>
15740 #include <arpa/inet.h>
15743 printf("Defined as a macro.");
15746 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15747 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15749 echo "But it seems to be defined as a macro." >&4
15757 : see if hypot exists
15761 : see if ilogb exists
15765 : see if ilogbl exists
15766 set ilogbl d_ilogbl
15771 if set index val -f; eval $csym; $val; then
15772 if set strchr val -f d_strchr; eval $csym; $val; then
15773 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15776 echo "strchr() found." >&4
15780 echo "index() found." >&4
15785 echo "index() found." >&4
15788 if set strchr val -f d_strchr; eval $csym; $val; then
15791 echo "strchr() found." >&4
15793 echo "No index() or strchr() found!" >&4
15798 set d_strchr; eval $setvar
15800 set d_index; eval $setvar
15802 : check whether inet_aton exists
15803 set inet_aton d_inetaton
15806 : see if inet_ntop exists
15807 set inet_ntop d_inetntop
15810 : see if inet_pton exists
15811 set inet_pton d_inetpton
15816 $cat >isascii.c <<EOCP
15819 #$i_stdlib I_STDLIB
15821 #include <stdlib.h>
15832 if eval $compile; then
15833 echo "isascii() found." >&4
15836 echo "isascii() NOT found." >&4
15845 $cat >isblank.c <<'EOCP'
15856 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15857 echo "isblank() found." >&4
15860 echo "isblank() NOT found." >&4
15867 : check for isfinite
15868 echo "Checking to see if you have isfinite..." >&4
15874 int main() { return isfinite(0.0); }
15877 if eval $compile; then
15879 echo "You have isfinite."
15882 echo "You do not have isfinite."
15888 : see if isfinitel exists
15889 set isfinitel d_isfinitel
15893 echo "Checking to see if you have isinf..." >&4
15899 int main() { return isinf(0.0); }
15902 if eval $compile; then
15904 echo "You have isinf."
15907 echo "You do not have isinf."
15913 : see if isinfl exists
15914 set isinfl d_isinfl
15918 echo "Checking to see if you have isless..." >&4
15924 int main() { return isless(0.0); }
15927 if eval $compile; then
15929 echo "You have isless."
15932 echo "You do not have isless."
15939 echo "Checking to see if you have isnan..." >&4
15945 int main() { return isnan(0.0); }
15948 if eval $compile; then
15950 echo "You have isnan."
15953 echo "You do not have isnan."
15959 : see if isnanl exists
15960 set isnanl d_isnanl
15963 : check for isnormal
15964 echo "Checking to see if you have isnormal..." >&4
15970 int main() { return isnormal(0.0); }
15973 if eval $compile; then
15975 echo "You have isnormal."
15978 echo "You do not have isnormal."
15988 : see if j0l exists
15992 : see if killpg exists
15993 set killpg d_killpg
15996 : see if localeconv exists
15997 set localeconv d_locconv
16000 : see if libc has the POSIX.1-2008 currency locale rules
16001 case "$d_locconv:$d_lc_monetary_2008" in
16004 #include <locale.h>
16006 struct lconv *lc = localeconv();
16007 char int_p_cs_precedes = lc->int_p_cs_precedes;
16012 if eval $compile; then
16013 d_lc_monetary_2008="$define"
16015 d_lc_monetary_2008="$undef"
16021 : see if lchown exists
16023 $cat > try.c <<'EOCP'
16024 /* System header to define __stub macros and hopefully few prototypes,
16025 which can conflict with char lchown(); below. */
16026 #include <assert.h>
16027 /* Override any gcc2 internal prototype to avoid an error. */
16028 /* We use char because int might match the return type of a gcc2
16029 builtin and then its argument prototype would still apply. */
16032 /* The GNU C library defines this for functions which it implements
16033 to always fail with ENOSYS. Some functions are actually named
16034 something starting with __ and the normal name is an alias. */
16035 #if defined (__stub_lchown) || defined (__stub___lchown)
16043 if eval $compile; then
16044 $echo "lchown() found." >&4
16047 $echo "lchown() NOT found." >&4
16053 : See if number of significant digits in a double precision number is known
16055 $cat >ldbl_dig.c <<EOM
16056 #$i_limits I_LIMITS
16059 #include <limits.h>
16065 printf("Contains LDBL_DIG");
16068 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16069 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16070 echo "LDBL_DIG found." >&4
16073 echo "LDBL_DIG NOT found." >&4
16080 : see if lgamma exists
16081 set lgamma d_lgamma
16084 : see if lgamma_r exists
16085 set lgamma_r d_lgamma_r
16088 : check to see if math.h defines _LIB_VERSION
16089 d_libm_lib_version="$undef"
16093 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16095 #include <unistd.h>
16097 int main (int argc, char *argv[])
16099 printf ("%d\n", _LIB_VERSION);
16104 if eval $compile; then
16106 echo "Yes, it does ($foo)" >&4
16107 d_libm_lib_version="$define"
16109 echo "No, it does not (probably harmless)" >&4
16116 : see if link exists
16120 : see if llrint exists
16121 set llrint d_llrint
16124 : see if llrintl exists
16125 set llrintl d_llrintl
16128 : see if llround exists
16129 set llround d_llround
16132 : see if llroundl exists
16133 set llroundl d_llroundl
16136 : see if localtime_r exists
16137 set localtime_r d_localtime_r
16139 case "$d_localtime_r" in
16141 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16142 case "$d_localtime_r_proto:$usethreads" in
16143 ":define") d_localtime_r_proto=define
16144 set d_localtime_r_proto localtime_r $hdrs
16148 case "$d_localtime_r_proto" in
16150 case "$localtime_r_proto" in
16151 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16152 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16154 case "$localtime_r_proto" in
16155 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16156 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16158 case "$localtime_r_proto" in
16159 ''|0) d_localtime_r=undef
16160 localtime_r_proto=0
16161 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16162 * ) case "$localtime_r_proto" in
16163 REENTRANT_PROTO*) ;;
16164 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16166 echo "Prototype: $try" ;;
16169 *) case "$usethreads" in
16170 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16172 d_localtime_r=undef
16173 localtime_r_proto=0
16177 *) localtime_r_proto=0
16181 : see if localtime_r calls tzset
16182 case "$localtime_r_proto" in
16185 /* Does our libc's localtime_r call tzset ?
16186 * return 0 if so, 1 otherwise.
16188 #$i_systypes I_SYS_TYPES
16189 #$i_unistd I_UNISTD
16191 #$i_stdlib I_STDLIB
16192 #$i_string I_STRING
16193 #$i_malloc I_MALLOC
16195 # include <sys/types.h>
16198 # include <unistd.h>
16204 #include <stdlib.h>
16207 # include <string.h>
16209 # include <strings.h>
16212 # include <malloc.h>
16216 time_t t = time(0L);
16217 char w_tz[]="TZ" "=GMT+5",
16218 e_tz[]="TZ" "=GMT-5",
16219 *tz_e = (char*)malloc(16),
16220 *tz_w = (char*)malloc(16);
16221 struct tm tm_e, tm_w;
16222 memset(&tm_e,'\0',sizeof(struct tm));
16223 memset(&tm_w,'\0',sizeof(struct tm));
16228 localtime_r(&t, &tm_e);
16231 localtime_r(&t, &tm_w);
16233 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16239 if eval $compile; then
16240 if $run ./try; then
16241 d_localtime_r_needs_tzset=undef;
16243 d_localtime_r_needs_tzset=define;
16246 d_localtime_r_needs_tzset=undef;
16250 d_localtime_r_needs_tzset=undef;
16255 : see if lockf exists
16259 : see if log1p exists
16263 : see if log2 exists
16267 : see if logb exists
16271 : see if lrint exists
16275 : see if lrintl exists
16276 set lrintl d_lrintl
16279 : see if lround exists
16280 set lround d_lround
16283 : see if lroundl exists
16284 set lroundl d_lroundl
16287 : see if prototype for lseek is available
16289 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16292 : see if lstat exists
16296 : see if madvise exists
16297 set madvise d_madvise
16300 : see if malloc_size exists
16301 set malloc_size d_malloc_size
16304 : see if malloc_size_good exists
16305 set malloc_good_size d_malloc_good_size
16308 : see if mblen exists
16312 : see if mbstowcs exists
16313 set mbstowcs d_mbstowcs
16316 : see if mbtowc exists
16317 set mbtowc d_mbtowc
16320 : see if memchr exists
16321 set memchr d_memchr
16324 : see if memcmp exists
16325 set memcmp d_memcmp
16328 : see if memcpy exists
16329 set memcpy d_memcpy
16332 : see if memmem exists
16333 set memmem d_memmem
16336 : see if memmove exists
16337 set memmove d_memmove
16340 : see if memset exists
16341 set memset d_memset
16344 : see if mkdir exists
16348 : see if mkdtemp exists
16349 set mkdtemp d_mkdtemp
16352 : see if mkfifo exists
16353 set mkfifo d_mkfifo
16356 : see if mkstemp exists
16357 set mkstemp d_mkstemp
16360 : see if mkstemps exists
16361 set mkstemps d_mkstemps
16364 : see if mktime exists
16365 set mktime d_mktime
16368 : see if this is a sys/mman.h system
16369 set sys/mman.h i_sysmman
16372 : see if mmap exists
16375 : see what shmat returns
16376 : default to something harmless
16378 case "$i_sysmman$d_mmap" in
16380 $cat >mmap.c <<'END'
16381 #include <sys/mman.h>
16384 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16389 echo "and it returns ($mmaptype)." >&4
16395 : see if sqrtl exists
16399 : see if scalbnl exists
16400 set scalbnl d_scalbnl
16403 : see if truncl exists
16404 set truncl d_truncl
16407 : see if modfl exists
16411 : see if prototype for modfl is available
16413 set d_modflproto modfl $i_math math.h
16416 if $test "$uselongdouble" = "$define"; then
16418 if $test "$d_sqrtl" != "$define"; then
16419 message="$message sqrtl"
16421 if $test "$d_modfl" != "$define"; then
16422 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16423 echo "You have both truncl and copysignl, so I can emulate modfl."
16425 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16426 echo "You have both aintl and copysignl, so I can emulate modfl."
16428 message="$message modfl"
16432 if $test "$d_frexpl" != "$define"; then
16433 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16434 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16436 message="$message frexpl"
16439 if $test "$d_ldexpl" != "$define"; then
16440 message="$message ldexpl"
16443 if $test "$message" != ""; then
16446 *** You requested the use of long doubles but you do not seem to have
16447 *** the following mathematical functions needed for long double support:
16449 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16450 *** Cannot continue, aborting.
16458 : see if mprotect exists
16459 set mprotect d_mprotect
16462 : see if msgctl exists
16463 set msgctl d_msgctl
16466 : see if msgget exists
16467 set msgget d_msgget
16470 : see if msgsnd exists
16471 set msgsnd d_msgsnd
16474 : see if msgrcv exists
16475 set msgrcv d_msgrcv
16478 : see how much of the 'msg*(2)' library is present.
16481 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16482 *"$undef"*) h_msg=false;;
16486 case "`ipcs 2>&1`" in
16487 "SVID messages"*"not configured"*)
16488 echo "Your $osname does not have the msg*(2) configured." >&4
16491 set msgctl d_msgctl
16493 set msgget d_msgget
16495 set msgsnd d_msgsnd
16497 set msgrcv d_msgrcv
16503 : we could also check for sys/ipc.h ...
16504 if $h_msg && $test `./findhdr sys/msg.h`; then
16505 echo "You have the full msg*(2) library." >&4
16508 echo "You don't have the full msg*(2) library." >&4
16514 : Check for msghdr_s
16516 echo "Checking to see if your system supports struct msghdr..." >&4
16517 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16519 case "$d_msghdr_s" in
16520 "$define") echo "Yes, it does." ;;
16521 *) echo "No, it doesn't." ;;
16525 : see if msync exists
16529 : see if munmap exists
16530 set munmap d_munmap
16533 : see if nan exists
16537 : see if nearbyint exists
16538 set nearbyint d_nearbyint
16541 : see if nextafter exists
16542 set nextafter d_nextafter
16545 : see if nexttoward exists
16546 set nexttoward d_nexttoward
16549 : see if nice exists
16553 : see if this is a langinfo.h system
16554 set langinfo.h i_langinfo
16557 : see if nl_langinfo exists
16558 set nl_langinfo d_nl_langinfo
16561 : see if this is a quadmath.h system
16562 set quadmath.h i_quadmath
16565 : check for volatile keyword
16567 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16568 $cat >try.c <<'EOCP'
16571 typedef struct _goo_struct goo_struct;
16572 goo_struct * volatile goo = ((goo_struct *)0);
16573 struct _goo_struct {
16578 typedef unsigned short foo_t;
16579 char *volatile foo;
16581 volatile foo_t blech;
16585 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16587 echo "Yup, it does."
16590 echo "Nope, it doesn't."
16596 : Check basic sizes
16598 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16600 case "$use64bitint:$d_quad:$quadtype" in
16603 uvtype="$uquadtype"
16608 uvtype="unsigned long"
16614 case "$uselongdouble:$d_longdbl" in
16616 nvtype="long double"
16617 nvsize=$longdblsize
16624 case "$usequadmath:$i_quadmath" in
16626 nvtype="__float128"
16632 *** You requested the use of the quadmath library, but you
16633 *** do not seem to have the quadmath library installed.
16634 *** Cannot continue, aborting.
16640 define:*) $cat <<EOM >&4
16642 *** You requested the use of the quadmath library, but you
16643 *** do not seem to have the required header, <quadmath.h>.
16645 case "$gccversion" in
16648 *** Your gcc looks a bit old:
16654 *** You are not running a gcc.
16659 *** For the quadmath library you need at least gcc 4.6.
16660 *** Cannot continue, aborting.
16666 $echo "(IV will be "$ivtype", $ivsize bytes)"
16667 $echo "(UV will be "$uvtype", $uvsize bytes)"
16668 $echo "(NV will be "$nvtype", $nvsize bytes)"
16671 #$i_inttypes I_INTTYPES
16673 #include <inttypes.h>
16678 int8_t i = INT8_MAX;
16679 uint8_t u = UINT8_MAX;
16680 printf("int8_t\n");
16683 int16_t i = INT16_MAX;
16684 uint16_t u = UINT16_MAX;
16685 printf("int16_t\n");
16688 int32_t i = INT32_MAX;
16689 uint32_t u = UINT32_MAX;
16690 printf("int32_t\n");
16695 i8type="signed char"
16696 u8type="unsigned char"
16701 '') case "$shortsize" in
16703 u16type="unsigned short"
16711 '') set try -DINT16
16712 if eval $compile; then
16713 case "`$run ./try`" in
16725 '') if $test $shortsize -ge 2; then
16727 u16type="unsigned short"
16735 '') case "$longsize" in
16737 u32type="unsigned long"
16741 *) case "$intsize" in
16743 u32type="unsigned int"
16753 '') set try -DINT32
16754 if eval $compile; then
16755 case "`$run ./try`" in
16767 '') if $test $intsize -ge 4; then
16769 u32type="unsigned int"
16777 '') case "$d_quad:$quadtype" in
16779 i64type="$quadtype"
16780 u64type="$uquadtype"
16788 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16789 : volatile so that the compiler has to store it out to memory.
16790 if test X"$d_volatile" = X"$define"; then
16795 #$i_stdlib I_STDLIB
16797 #include <stdlib.h>
16799 #include <sys/types.h>
16800 #include <signal.h>
16802 $volatile int bletched = 0;
16803 $signal_t blech(int s) { bletched = 1; }
16808 int n = 8 * $uvsize;
16811 signal(SIGFPE, blech);
16814 for (i = 0; i < n; i++) {
16815 u = u << 1 | ($uvtype)1;
16817 if (($uvtype)d != u)
16821 d = ($nvtype)(u - 1);
16822 if (($uvtype)d != (u - 1))
16829 printf("%d\n", ((i == n) ? -n : i));
16835 d_nv_preserves_uv="$undef"
16836 if eval $compile; then
16837 nv_preserves_uv_bits="`$run ./try`"
16839 case "$nv_preserves_uv_bits" in
16841 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16842 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16843 d_nv_preserves_uv="$define"
16845 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16846 d_nv_preserves_uv="$undef" ;;
16847 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16848 nv_preserves_uv_bits="0" ;;
16852 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16853 : volatile so that the compiler has to store it out to memory.
16854 if test X"$d_volatile" = X"$define"; then
16860 typedef $nvtype NV;
16867 while(count < 256) {
16868 $volatile NV up = value + 1.0;
16869 $volatile NV negated = -value;
16870 $volatile NV down = negated - 1.0;
16871 $volatile NV got_up = up - value;
16872 int up_good = got_up == 1.0;
16873 int got_down = down - negated;
16874 int down_good = got_down == -1.0;
16876 if (down_good != up_good) {
16878 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16879 up_good, (double) got_up, down_good, (double) got_down,
16880 count, (double) value);
16887 fputs("256.0", stdout);
16890 fputs("2.0", stdout);
16896 fputs("*", stdout);
16902 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16903 count, (double) value);
16909 nv_overflows_integers_at='0'
16910 if eval $compile; then
16916 The largest integer your NVs can preserve is equal to $xxx
16918 nv_overflows_integers_at="$xxx"
16921 Cannot determine the largest integer value your NVs can hold, unexpected output
16928 Cannot determine the largest integer value your NVs can hold
16935 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16936 : volatile so that the compiler has to store it out to memory.
16937 if test X"$d_volatile" = X"$define"; then
16942 #$i_stdlib I_STDLIB
16944 #include <stdlib.h>
16946 #$i_string I_STRING
16948 # include <string.h>
16950 # include <strings.h>
16952 #include <sys/types.h>
16953 #include <signal.h>
16955 $volatile int bletched = 0;
16956 $signal_t blech(int s) { bletched = 1; }
16959 int checkit($nvtype d, char *where) {
16960 unsigned char *p = (char *)&d;
16961 unsigned char *end = p + sizeof(d);
16971 printf("No - %s: 0x", where);
16973 printf ("%02X", *p++);
16978 int main(int argc, char **argv) {
16981 fail += checkit(d, "0.0");
16983 /* The compiler shouldn't be assuming that bletched is 0 */
16986 fail += checkit(d, "bleched");
16989 signal(SIGFPE, blech);
16992 /* Paranoia - the compiler should have no way of knowing that ANSI says
16993 that argv[argc] will always be NULL. Actually, if it did assume this it
16994 would be buggy, as this is C and main() can be called from elsewhere in
16996 d = argv[argc] ? 1 : 0;
16999 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17002 fail += checkit(d, "ternary");
17004 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17007 printf("No - memset doesn't give 0.0\n");
17008 /* This might just blow up: */
17009 printf("(gives %g)\n", d);
17015 printf("No - something bleched\n");
17020 printf("No - %d fail(s)\n", fail);
17029 d_nv_zero_is_allbits_zero="$undef"
17030 if eval $compile; then
17036 0.0 is represented as all bits zero in memory
17038 d_nv_zero_is_allbits_zero="$define"
17041 0.0 is not represented as all bits zero in memory
17043 d_nv_zero_is_allbits_zero="$undef"
17048 0.0 is not represented as all bits zero in memory
17050 d_nv_zero_is_allbits_zero="$undef"
17056 : check for off64_t
17058 echo "Checking to see if you have off64_t..." >&4
17060 #include <sys/types.h>
17061 #include <unistd.h>
17062 int main() { off64_t x = 7; }
17065 if eval $compile; then
17067 echo "You have off64_t."
17070 echo "You do not have off64_t."
17071 case "$lseeksize" in
17072 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17079 : how to create joinable pthreads
17080 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17082 echo "Checking what constant to use for creating joinable pthreads..." >&4
17083 $cat >try.c <<'EOCP'
17084 #include <pthread.h>
17086 int detachstate = JOINABLE;
17089 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17090 if eval $compile; then
17091 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17092 val="$undef" # Yes, undef.
17093 set d_old_pthread_create_joinable
17096 set old_pthread_create_joinable
17099 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17100 if eval $compile; then
17101 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17103 set d_old_pthread_create_joinable
17105 val=PTHREAD_CREATE_UNDETACHED
17106 set old_pthread_create_joinable
17109 set try -DJOINABLE=__UNDETACHED
17110 if eval $compile; then
17111 echo "You seem to use __UNDETACHED." >&4
17113 set d_old_pthread_create_joinable
17116 set old_pthread_create_joinable
17119 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17121 set d_old_pthread_create_joinable
17124 set old_pthread_create_joinable
17131 d_old_pthread_create_joinable="$undef"
17132 old_pthread_create_joinable=""
17135 : see if pause exists
17139 : see if poll exists
17143 : see if prctl exists
17147 : see if prctl supports PR_SET_NAME
17148 d_prctl_set_name=$undef
17153 #include <unistd.h>
17155 #include <sys/prctl.h>
17157 int main (int argc, char *argv[])
17159 return (prctl (PR_SET_NAME, "Test"));
17163 if eval $compile_ok && $run ./try; then
17164 echo "Your prctl (PR_SET_NAME, ...) works"
17165 d_prctl_set_name=$define
17171 : see if readlink exists
17172 set readlink d_readlink
17175 : Check if there is a /proc symlink to the abs path of
17176 : the executing program. We will honor hints of d_procselfexe=$undef
17177 : or procselfexe being non-empty, otherwise will try to determine both
17178 : if we have readlink.
17179 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17180 : referenced, and AmigaOS does not have a proc filesystem anyway.
17183 if $test "X$d_procselfexe" = Xundef; then
17185 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17187 elif $test "X$d_readlink" = Xdefine; then
17188 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17189 : and it feels more tidy to avoid an extra level of symlink
17190 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17191 while test $# -gt 0; do
17194 if $issymlink $try; then
17195 $ls -l $try > reflect
17196 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17197 echo "You have $type-like $try."
17198 procselfexe='"'$try'"'
17200 : This will break out of the loop
17210 : backward compatibility for d_hvfork
17211 if test X$d_hvfork != X; then
17212 d_vfork="$d_hvfork"
17215 : see if there is a vfork
17220 d_pseudofork=$undef
17222 : Ok, but do we want to use it. vfork is reportedly unreliable in
17223 : perl on Solaris 2.x, and probably elsewhere.
17227 case "$usevfork" in
17233 Perl can only use a vfork() that doesn't suffer from strict
17234 restrictions on calling functions or modifying global data in
17235 the child. For example, glibc-2.1 contains such a vfork()
17236 that is unsuitable. If your system provides a proper fork()
17237 call, chances are that you do NOT want perl to use vfork().
17240 rp="Do you still want to use vfork()?"
17245 echo "Ok, we won't use vfork()."
17254 $define) usevfork='true';;
17255 *) usevfork='false';;
17258 : see whether the pthread_atfork exists
17260 #include <pthread.h>
17263 #ifdef PTHREAD_ATFORK
17264 pthread_atfork(NULL,NULL,NULL);
17269 : see if pthread_atfork exists
17270 set try -DPTHREAD_ATFORK
17271 if eval $compile; then
17276 case "$usethreads" in
17279 $define) echo 'pthread_atfork found.' >&4 ;;
17280 *) echo 'pthread_atfork NOT found.' >&4 ;;
17283 set d_pthread_atfork
17286 : see if pthread_attr_setscope exists
17287 set pthread_attr_setscope d_pthread_attr_setscope
17290 : see whether the various POSIXish _yields exist
17292 #include <pthread.h>
17298 #ifdef PTHREAD_YIELD
17301 #ifdef PTHREAD_YIELD_NULL
17302 pthread_yield(NULL);
17308 : see if sched_yield exists
17309 set try -DSCHED_YIELD
17310 if eval $compile; then
17312 sched_yield='sched_yield()'
17316 case "$usethreads" in
17319 $define) echo 'sched_yield() found.' >&4 ;;
17320 *) echo 'sched_yield() NOT found.' >&4 ;;
17326 : see if pthread_yield exists
17327 set try -DPTHREAD_YIELD
17328 if eval $compile; then
17330 case "$sched_yield" in
17331 '') sched_yield='pthread_yield()' ;;
17334 set try -DPTHREAD_YIELD_NULL
17335 if eval $compile; then
17337 case "$sched_yield" in
17338 '') sched_yield='pthread_yield(NULL)' ;;
17344 case "$usethreads" in
17347 $define) echo 'pthread_yield() found.' >&4 ;;
17348 *) echo 'pthread_yield() NOT found.' >&4 ;;
17352 set d_pthread_yield
17354 case "$sched_yield" in
17355 '') sched_yield=undef ;;
17359 : check for ptrdiff_t
17361 echo "Checking to see if you have ptrdiff_t..." >&4
17363 #include <stddef.h>
17364 int main() { ptrdiff_t x = 7; }
17367 if eval $compile; then
17369 echo "You have ptrdiff_t."
17372 echo "You do not have ptrdiff_t."
17378 : see if random_r exists
17379 set random_r d_random_r
17381 case "$d_random_r" in
17383 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17384 case "$d_random_r_proto:$usethreads" in
17385 ":define") d_random_r_proto=define
17386 set d_random_r_proto random_r $hdrs
17390 case "$d_random_r_proto" in
17392 case "$random_r_proto" in
17393 ''|0) try='int random_r(int*, struct random_data*);'
17394 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17396 case "$random_r_proto" in
17397 ''|0) try='int random_r(long*, struct random_data*);'
17398 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17400 case "$random_r_proto" in
17401 ''|0) try='int random_r(struct random_data*, int32_t*);'
17402 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17404 case "$random_r_proto" in
17405 ''|0) d_random_r=undef
17407 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17408 * ) case "$random_r_proto" in
17409 REENTRANT_PROTO*) ;;
17410 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17412 echo "Prototype: $try" ;;
17415 *) case "$usethreads" in
17416 define) echo "random_r has no prototype, not using it." >&4 ;;
17423 *) random_r_proto=0
17427 : see if readdir and friends exist
17428 set readdir d_readdir
17430 set seekdir d_seekdir
17432 set telldir d_telldir
17434 set rewinddir d_rewinddir
17437 : see if readdir64_r exists
17438 set readdir64_r d_readdir64_r
17440 case "$d_readdir64_r" in
17442 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17443 case "$d_readdir64_r_proto:$usethreads" in
17444 ":define") d_readdir64_r_proto=define
17445 set d_readdir64_r_proto readdir64_r $hdrs
17449 case "$d_readdir64_r_proto" in
17451 case "$readdir64_r_proto" in
17452 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17453 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17455 case "$readdir64_r_proto" in
17456 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17457 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17459 case "$readdir64_r_proto" in
17460 ''|0) d_readdir64_r=undef
17461 readdir64_r_proto=0
17462 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17463 * ) case "$readdir64_r_proto" in
17464 REENTRANT_PROTO*) ;;
17465 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17467 echo "Prototype: $try" ;;
17470 *) case "$usethreads" in
17471 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17473 d_readdir64_r=undef
17474 readdir64_r_proto=0
17478 *) readdir64_r_proto=0
17482 : see if readdir_r exists
17483 set readdir_r d_readdir_r
17485 case "$d_readdir_r" in
17487 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17488 case "$d_readdir_r_proto:$usethreads" in
17489 ":define") d_readdir_r_proto=define
17490 set d_readdir_r_proto readdir_r $hdrs
17494 case "$d_readdir_r_proto" in
17496 case "$readdir_r_proto" in
17497 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17498 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17500 case "$readdir_r_proto" in
17501 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17502 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17504 case "$readdir_r_proto" in
17505 ''|0) d_readdir_r=undef
17507 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17508 * ) case "$readdir_r_proto" in
17509 REENTRANT_PROTO*) ;;
17510 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17512 echo "Prototype: $try" ;;
17515 *) case "$usethreads" in
17516 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17523 *) readdir_r_proto=0
17527 : see if readv exists
17531 : see if recvmsg exists
17532 set recvmsg d_recvmsg
17535 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17537 if set regcomp val -f d_regcomp; eval $csym; $val; then
17538 echo 'regcomp() found.' >&4
17539 d_regcomp="$define"
17542 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17543 echo 'regcmp() found.' >&4
17547 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17548 echo 're_comp() found, assuming re_exec() also exists.' >&4
17549 d_re_comp="$define"
17554 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17561 : see if remainder exists
17562 set remainder d_remainder
17565 : see if remquo exists
17566 set remquo d_remquo
17569 : see if rename exists
17570 set rename d_rename
17573 : see if rint exists
17577 : see if rmdir exists
17581 : see if round exists
17585 : see if memory.h is available.
17590 : See if it conflicts with string.h
17596 $cppstdin $cppflags $cppminus < $strings > mem.h
17597 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17599 echo "We won't be including <memory.h>."
17609 : can bcopy handle overlapping blocks?
17612 case "$d_memmove" in
17613 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17614 *) case "$d_bcopy" in
17616 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17618 #$i_memory I_MEMORY
17619 #$i_stdlib I_STDLIB
17620 #$i_string I_STRING
17621 #$i_unistd I_UNISTD
17623 $cat >>try.c <<'EOCP'
17626 # include <memory.h>
17629 # include <stdlib.h>
17632 # include <string.h>
17634 # include <strings.h>
17637 # include <unistd.h> /* Needed for NetBSD */
17641 char buf[128], abc[128];
17647 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17648 try to store the string in read-only memory. */
17649 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17651 for (align = 7; align >= 0; align--) {
17652 for (len = 36; len; len--) {
17654 bcopy(abc, b, len);
17655 for (off = 1; off <= len; off++) {
17656 bcopy(b, b+off, len);
17657 bcopy(b+off, b, len);
17658 if (bcmp(b, abc, len))
17667 if eval $compile_ok; then
17668 if $run ./try 2>/dev/null; then
17669 echo "Yes, it can."
17672 echo "It can't, sorry."
17675 echo "(I can't compile the test program, so we'll assume not...)"
17685 : can memcpy handle overlapping blocks?
17688 case "$d_memmove" in
17689 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17690 *) case "$d_memcpy" in
17692 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17694 #$i_memory I_MEMORY
17695 #$i_stdlib I_STDLIB
17696 #$i_string I_STRING
17697 #$i_unistd I_UNISTD
17699 $cat >>try.c <<'EOCP'
17702 # include <memory.h>
17705 # include <stdlib.h>
17708 # include <string.h>
17710 # include <strings.h>
17713 # include <unistd.h> /* Needed for NetBSD */
17717 char buf[128], abc[128];
17723 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17724 try to store the string in read-only memory. */
17725 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17727 for (align = 7; align >= 0; align--) {
17728 for (len = 36; len; len--) {
17730 memcpy(b, abc, len);
17731 for (off = 1; off <= len; off++) {
17732 memcpy(b+off, b, len);
17733 memcpy(b, b+off, len);
17734 if (memcmp(b, abc, len))
17743 if eval $compile_ok; then
17744 if $run ./try 2>/dev/null; then
17745 echo "Yes, it can."
17748 echo "It can't, sorry."
17751 echo "(I can't compile the test program, so we'll assume not...)"
17761 : can memcmp be trusted to compare relative magnitude?
17763 case "$d_memcmp" in
17766 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17768 #$i_memory I_MEMORY
17769 #$i_stdlib I_STDLIB
17770 #$i_string I_STRING
17771 #$i_unistd I_UNISTD
17773 $cat >>try.c <<'EOCP'
17776 # include <memory.h>
17779 # include <stdlib.h>
17782 # include <string.h>
17784 # include <strings.h>
17787 # include <unistd.h> /* Needed for NetBSD */
17793 if ((a < b) && memcmp(&a, &b, 1) < 0)
17799 if eval $compile_ok; then
17800 if $run ./try 2>/dev/null; then
17801 echo "Yes, it can."
17804 echo "No, it can't (it uses signed chars)."
17807 echo "(I can't compile the test program, so we'll assume not...)"
17815 : see if prototype for sbrk is available
17817 set d_sbrkproto sbrk $i_unistd unistd.h
17820 : see if scalbn exists
17821 set scalbn d_scalbn
17824 : see if select exists
17825 set select d_select
17828 : see if semctl exists
17829 set semctl d_semctl
17832 : see if semget exists
17833 set semget d_semget
17836 : see if semop exists
17840 : see how much of the 'sem*(2)' library is present.
17843 case "$d_semctl$d_semget$d_semop" in
17844 *"$undef"*) h_sem=false;;
17848 case "`ipcs 2>&1`" in
17849 "SVID messages"*"not configured"*)
17850 echo "Your $osname does not have the sem*(2) configured." >&4
17853 set semctl d_semctl
17855 set semget d_semget
17863 : we could also check for sys/ipc.h ...
17864 if $h_sem && $test `./findhdr sys/sem.h`; then
17865 echo "You have the full sem*(2) library." >&4
17868 echo "You don't have the full sem*(2) library." >&4
17874 : see whether sys/sem.h defines union semun
17876 $cat > try.c <<'END'
17877 #include <sys/types.h>
17878 #include <sys/ipc.h>
17879 #include <sys/sem.h>
17880 int main () { union semun semun; semun.buf = 0; }
17883 if eval $compile; then
17884 echo "You have union semun in <sys/sem.h>." >&4
17887 echo "You do not have union semun in <sys/sem.h>." >&4
17894 : see how to do semctl IPC_STAT
17898 $cat > tryh.h <<END
17901 # define S_IRUSR S_IREAD
17902 # define S_IWUSR S_IWRITE
17903 # define S_IXUSR S_IEXEC
17905 # define S_IRUSR 0400
17906 # define S_IWUSR 0200
17907 # define S_IXUSR 0100
17909 # define S_IRGRP (S_IRUSR>>3)
17910 # define S_IWGRP (S_IWUSR>>3)
17911 # define S_IXGRP (S_IXUSR>>3)
17912 # define S_IROTH (S_IRUSR>>6)
17913 # define S_IWOTH (S_IWUSR>>6)
17914 # define S_IXOTH (S_IXUSR>>6)
17917 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17918 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17919 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17922 : see whether semctl IPC_STAT can use union semun
17923 case "$d_semctl_semun" in
17927 #include <sys/types.h>
17928 #include <sys/ipc.h>
17929 #include <sys/sem.h>
17930 #include <sys/stat.h>
17937 #$d_union_semun HAS_UNION_SEMUN
17940 #ifndef HAS_UNION_SEMUN
17943 struct semid_ds *buf;
17944 unsigned short *array;
17950 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17951 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17953 struct semid_ds argbuf;
17956 st = semctl(sem, 0, IPC_STAT, arg);
17960 # endif /* IPC_STAT */
17961 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17963 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17964 # endif /* IPC_RMID */
17965 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17967 #endif /* IPC_PRIVATE && ... */
17968 printf("semget failed: errno = %d\n", errno);
17973 if eval $compile; then
17976 semun) val="$define" ;;
17984 case "$d_semctl_semun" in
17986 echo "You can use union semun for semctl IPC_STAT." >&4
17989 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17994 : see whether semctl IPC_STAT can use struct semid_ds pointer
17995 case "$d_semctl_semid_ds" in
17998 $cat > try.c <<'END'
17999 #include <sys/types.h>
18000 #include <sys/ipc.h>
18001 #include <sys/sem.h>
18002 #include <sys/stat.h>
18010 struct semid_ds arg;
18013 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18014 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18017 st = semctl(sem, 0, IPC_STAT, &arg);
18019 printf("semid_ds\n");
18021 # endif /* IPC_STAT */
18022 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18024 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18025 # endif /* IPC_RMID */
18026 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18028 #endif /* IPC_PRIVATE && ... */
18029 printf("semget failed: errno = %d\n", errno);
18035 if eval $compile; then
18038 semid_ds) val="$define" ;;
18042 set d_semctl_semid_ds
18046 case "$d_semctl_semid_ds" in
18048 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18050 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18056 # We do not have the full sem*(2) library, so assume we can not
18062 set d_semctl_semid_ds
18068 : see if sendmsg exists
18069 set sendmsg d_sendmsg
18072 : see if setegid exists
18073 set setegid d_setegid
18076 : see if seteuid exists
18077 set seteuid d_seteuid
18080 : see if setgrent exists
18081 set setgrent d_setgrent
18084 : see if setgrent_r exists
18085 set setgrent_r d_setgrent_r
18087 case "$d_setgrent_r" in
18089 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18090 case "$d_setgrent_r_proto:$usethreads" in
18091 ":define") d_setgrent_r_proto=define
18092 set d_setgrent_r_proto setgrent_r $hdrs
18096 case "$d_setgrent_r_proto" in
18098 case "$setgrent_r_proto" in
18099 ''|0) try='int setgrent_r(FILE**);'
18100 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18102 case "$setgrent_r_proto" in
18103 ''|0) try='void setgrent_r(FILE**);'
18104 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18106 case "$setgrent_r_proto" in
18107 ''|0) d_setgrent_r=undef
18109 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18110 * ) case "$setgrent_r_proto" in
18111 REENTRANT_PROTO*) ;;
18112 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18114 echo "Prototype: $try" ;;
18117 *) case "$usethreads" in
18118 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18125 *) setgrent_r_proto=0
18129 : see if sethostent exists
18130 set sethostent d_sethent
18133 : see if sethostent_r exists
18134 set sethostent_r d_sethostent_r
18136 case "$d_sethostent_r" in
18138 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18139 case "$d_sethostent_r_proto:$usethreads" in
18140 ":define") d_sethostent_r_proto=define
18141 set d_sethostent_r_proto sethostent_r $hdrs
18145 case "$d_sethostent_r_proto" in
18147 case "$sethostent_r_proto" in
18148 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18149 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18151 case "$sethostent_r_proto" in
18152 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18153 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18155 case "$sethostent_r_proto" in
18156 ''|0) d_sethostent_r=undef
18157 sethostent_r_proto=0
18158 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18159 * ) case "$sethostent_r_proto" in
18160 REENTRANT_PROTO*) ;;
18161 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18163 echo "Prototype: $try" ;;
18166 *) case "$usethreads" in
18167 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18169 d_sethostent_r=undef
18170 sethostent_r_proto=0
18174 *) sethostent_r_proto=0
18178 : see if setitimer exists
18179 set setitimer d_setitimer
18182 : see if setlinebuf exists
18183 set setlinebuf d_setlinebuf
18186 : see if setlocale exists
18187 set setlocale d_setlocale
18190 : see if locale.h is available
18191 set locale.h i_locale
18194 : see if setlocale_r exists
18195 set setlocale_r d_setlocale_r
18197 case "$d_setlocale_r" in
18199 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18200 case "$d_setlocale_r_proto:$usethreads" in
18201 ":define") d_setlocale_r_proto=define
18202 set d_setlocale_r_proto setlocale_r $hdrs
18206 case "$d_setlocale_r_proto" in
18208 case "$setlocale_r_proto" in
18209 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18210 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18212 case "$setlocale_r_proto" in
18213 ''|0) d_setlocale_r=undef
18214 setlocale_r_proto=0
18215 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18216 * ) case "$setlocale_r_proto" in
18217 REENTRANT_PROTO*) ;;
18218 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18220 echo "Prototype: $try" ;;
18223 *) case "$usethreads" in
18224 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18226 d_setlocale_r=undef
18227 setlocale_r_proto=0
18231 *) setlocale_r_proto=0
18235 : see if setnetent exists
18236 set setnetent d_setnent
18239 : see if setnetent_r exists
18240 set setnetent_r d_setnetent_r
18242 case "$d_setnetent_r" in
18244 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18245 case "$d_setnetent_r_proto:$usethreads" in
18246 ":define") d_setnetent_r_proto=define
18247 set d_setnetent_r_proto setnetent_r $hdrs
18251 case "$d_setnetent_r_proto" in
18253 case "$setnetent_r_proto" in
18254 ''|0) try='int setnetent_r(int, struct netent_data*);'
18255 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18257 case "$setnetent_r_proto" in
18258 ''|0) try='void setnetent_r(int, struct netent_data*);'
18259 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18261 case "$setnetent_r_proto" in
18262 ''|0) d_setnetent_r=undef
18263 setnetent_r_proto=0
18264 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18265 * ) case "$setnetent_r_proto" in
18266 REENTRANT_PROTO*) ;;
18267 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18269 echo "Prototype: $try" ;;
18272 *) case "$usethreads" in
18273 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18275 d_setnetent_r=undef
18276 setnetent_r_proto=0
18280 *) setnetent_r_proto=0
18284 : see if setprotoent exists
18285 set setprotoent d_setpent
18288 : see if setpgid exists
18289 set setpgid d_setpgid
18292 : see if setpgrp2 exists
18293 set setpgrp2 d_setpgrp2
18296 : see if setpriority exists
18297 set setpriority d_setprior
18300 : see if setproctitle exists
18301 set setproctitle d_setproctitle
18304 : see if setprotoent_r exists
18305 set setprotoent_r d_setprotoent_r
18307 case "$d_setprotoent_r" in
18309 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18310 case "$d_setprotoent_r_proto:$usethreads" in
18311 ":define") d_setprotoent_r_proto=define
18312 set d_setprotoent_r_proto setprotoent_r $hdrs
18316 case "$d_setprotoent_r_proto" in
18318 case "$setprotoent_r_proto" in
18319 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18320 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18322 case "$setprotoent_r_proto" in
18323 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18324 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18326 case "$setprotoent_r_proto" in
18327 ''|0) d_setprotoent_r=undef
18328 setprotoent_r_proto=0
18329 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18330 * ) case "$setprotoent_r_proto" in
18331 REENTRANT_PROTO*) ;;
18332 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18334 echo "Prototype: $try" ;;
18337 *) case "$usethreads" in
18338 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18340 d_setprotoent_r=undef
18341 setprotoent_r_proto=0
18345 *) setprotoent_r_proto=0
18349 : see if setpwent exists
18350 set setpwent d_setpwent
18353 : see if setpwent_r exists
18354 set setpwent_r d_setpwent_r
18356 case "$d_setpwent_r" in
18358 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18359 case "$d_setpwent_r_proto:$usethreads" in
18360 ":define") d_setpwent_r_proto=define
18361 set d_setpwent_r_proto setpwent_r $hdrs
18365 case "$d_setpwent_r_proto" in
18367 case "$setpwent_r_proto" in
18368 ''|0) try='int setpwent_r(FILE**);'
18369 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18371 case "$setpwent_r_proto" in
18372 ''|0) try='void setpwent_r(FILE**);'
18373 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18375 case "$setpwent_r_proto" in
18376 ''|0) d_setpwent_r=undef
18378 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18379 * ) case "$setpwent_r_proto" in
18380 REENTRANT_PROTO*) ;;
18381 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18383 echo "Prototype: $try" ;;
18386 *) case "$usethreads" in
18387 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18394 *) setpwent_r_proto=0
18398 : see if setregid exists
18399 set setregid d_setregid
18401 set setresgid d_setresgid
18404 : see if setreuid exists
18405 set setreuid d_setreuid
18407 set setresuid d_setresuid
18410 : see if setrgid exists
18411 set setrgid d_setrgid
18414 : see if setruid exists
18415 set setruid d_setruid
18418 : see if setservent exists
18419 set setservent d_setsent
18422 : see if setservent_r exists
18423 set setservent_r d_setservent_r
18425 case "$d_setservent_r" in
18427 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18428 case "$d_setservent_r_proto:$usethreads" in
18429 ":define") d_setservent_r_proto=define
18430 set d_setservent_r_proto setservent_r $hdrs
18434 case "$d_setservent_r_proto" in
18436 case "$setservent_r_proto" in
18437 ''|0) try='int setservent_r(int, struct servent_data*);'
18438 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18440 case "$setservent_r_proto" in
18441 ''|0) try='void setservent_r(int, struct servent_data*);'
18442 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18444 case "$setservent_r_proto" in
18445 ''|0) d_setservent_r=undef
18446 setservent_r_proto=0
18447 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18448 * ) case "$setservent_r_proto" in
18449 REENTRANT_PROTO*) ;;
18450 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18452 echo "Prototype: $try" ;;
18455 *) case "$usethreads" in
18456 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18458 d_setservent_r=undef
18459 setservent_r_proto=0
18463 *) setservent_r_proto=0
18467 : see if setsid exists
18468 set setsid d_setsid
18471 : see if setvbuf exists
18472 set setvbuf d_setvbuf
18475 : see if shmctl exists
18476 set shmctl d_shmctl
18479 : see if shmget exists
18480 set shmget d_shmget
18483 : see if shmat exists
18486 : see what shmat returns
18489 $cat >shmat.c <<'END'
18490 #include <sys/shm.h>
18493 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18498 echo "and it returns ($shmattype)." >&4
18499 : see if a prototype for shmat is available
18500 xxx=`./findhdr sys/shm.h`
18501 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18502 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18513 set d_shmatprototype
18516 : see if shmdt exists
18520 : see how much of the 'shm*(2)' library is present.
18523 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18524 *"$undef"*) h_shm=false;;
18528 case "`ipcs 2>&1`" in
18529 "SVID shared memory"*"not configured"*)
18530 echo "Your $osname does not have the shm*(2) configured." >&4
18533 set shmctl d_shmctl
18535 set shmget d_shmget
18545 : we could also check for sys/ipc.h ...
18546 if $h_shm && $test `./findhdr sys/shm.h`; then
18547 echo "You have the full shm*(2) library." >&4
18550 echo "You don't have the full shm*(2) library." >&4
18556 : see if we have sigaction
18558 if set sigaction val -f d_sigaction; eval $csym; $val; then
18559 echo 'sigaction() found.' >&4
18562 #include <sys/types.h>
18563 #include <signal.h>
18564 #$i_stdlib I_STDLIB
18566 #include <stdlib.h>
18570 struct sigaction act, oact;
18572 oact.sa_handler = 0;
18573 /* so that act and oact are used */
18574 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18578 if eval $compile_ok; then
18581 echo "But you don't seem to have a usable struct sigaction." >&4
18585 echo 'sigaction NOT found.' >&4
18588 set d_sigaction; eval $setvar
18591 : see what type pids are declared as in the kernel
18592 rp="What is the type of process ids on this system?"
18593 set pid_t pidtype int stdio.h sys/types.h
18596 : see what type uids are declared as in the kernel
18598 echo "Looking for the type for user ids returned by getuid()."
18599 set uid_t uidtype xxx stdio.h sys/types.h
18603 xxx=`./findhdr sys/user.h`
18604 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18606 unsigned) dflt="$1 $2" ;;
18610 *) dflt="$uidtype";;
18613 uid_t) echo "uid_t found." ;;
18614 *) rp="What is the type for user ids returned by getuid()?"
18620 : Define hasfield_t macro for Configure internal use
18621 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18622 while $test $# -ge 2; do
18624 $define) echo "#include <$2>";;
18628 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18630 if eval $compile; then
18639 : see what siginfo fields we have
18640 case "$d_sigaction" in
18642 echo "Checking if your siginfo_t has si_errno field...">&4
18643 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18646 echo "Checking if your siginfo_t has si_pid field...">&4
18647 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18650 echo "Checking if your siginfo_t has si_uid field...">&4
18651 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18654 echo "Checking if your siginfo_t has si_addr field...">&4
18655 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18658 echo "Checking if your siginfo_t has si_status field...">&4
18659 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18662 echo "Checking if your siginfo_t has si_band field...">&4
18663 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18666 echo "Checking if your siginfo_t has si_value field...">&4
18667 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18670 echo "Checking if your siginfo_t has si_fd field...">&4
18671 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18676 d_siginfo_si_errno="$undef"
18677 d_siginfo_si_pid="$undef"
18678 d_siginfo_si_uid="$undef"
18679 d_siginfo_si_addr="$undef"
18680 d_siginfo_si_status="$undef"
18681 d_siginfo_si_band="$undef"
18682 d_siginfo_si_value="$undef"
18683 d_siginfo_si_fd="$undef"
18687 : see if this is a sunmath.h system
18688 set sunmath.h i_sunmath
18691 : see if signbit exists
18692 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18695 #$i_sunmath I_SUNMATH
18699 #ifdef I_SUNMATH /* Solaris special math library */
18700 # include <sunmath.h>
18703 int main(int argc, char **argv)
18707 if ((signbit(x) == 0) && (signbit(y) != 0))
18715 if eval $compile; then
18716 if $run ./try; then
18720 $echo "Signbit seems to be available, but doesn't work as I expected."
18721 $echo "I won't use it." >&4
18732 : see if sigprocmask exists
18733 set sigprocmask d_sigprocmask
18736 : see if sigsetjmp exists
18738 case "$d_sigsetjmp" in
18741 #include <setjmp.h>
18742 #$i_stdlib I_STDLIB
18744 #include <stdlib.h>
18750 if (sigsetjmp(env,1))
18753 siglongjmp(env, 1);
18758 if eval $compile; then
18759 if $run ./try >/dev/null 2>&1; then
18760 echo "POSIX sigsetjmp found." >&4
18764 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18770 echo "sigsetjmp not found." >&4
18774 *) val="$d_sigsetjmp"
18775 case "$d_sigsetjmp" in
18776 $define) echo "POSIX sigsetjmp found." >&4;;
18777 $undef) echo "sigsetjmp not found." >&4;;
18785 : see if snprintf exists
18786 set snprintf d_snprintf
18789 : see if vsnprintf exists
18790 set vsnprintf d_vsnprintf
18793 case "$d_snprintf-$d_vsnprintf" in
18796 Checking whether your snprintf() and vsnprintf() work okay...
18798 $cat >try.c <<'EOCP'
18799 /* v?snprintf testing logic courtesy of Russ Allbery.
18800 * According to C99:
18801 * - if the buffer is too short it still must be \0-terminated
18802 * - if the buffer is too short the potentially required length
18803 * must be returned and not -1
18804 * - if the buffer is NULL the potentially required length
18805 * must be returned and not -1 or core dump
18808 #include <stdarg.h>
18812 int test (char *format, ...)
18817 va_start (args, format);
18818 count = vsnprintf (buf, sizeof buf, format, args);
18825 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18826 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18830 if eval $compile; then
18833 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18835 Your snprintf() and snprintf() don't seem to be working okay.
18837 d_snprintf="$undef"
18838 d_vsnprintf="$undef"
18842 echo "(I can't seem to compile the test program--assuming they don't)"
18843 d_snprintf="$undef"
18844 d_vsnprintf="$undef"
18850 : see if sockatmark exists
18851 set sockatmark d_sockatmark
18854 : see if prototype for sockatmark is available
18856 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18859 : see if socks5_init exists
18860 set socks5_init d_socks5_init
18863 : see if sprintf returns the length of the string in the buffer as per ANSI
18864 $echo "Checking whether sprintf returns the length of the string..." >&4
18867 #$i_stdlib I_STDLIB
18869 #include <stdlib.h>
18871 #$i_string I_STRING
18873 # include <string.h>
18875 # include <strings.h>
18884 int check (size_t expect, int test) {
18885 size_t got = strlen(buffer);
18889 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18894 int main(int argc, char **argv) {
18897 check(sprintf(buffer, ""), ++test);
18898 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18899 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18906 if eval $compile; then
18910 sprintf returns the length of the string (as ANSI says it should)
18912 d_sprintf_returns_strlen="$define"
18915 sprintf does not return the length of the string (how old is this system?)
18917 d_sprintf_returns_strlen="$undef"
18921 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18922 d_sprintf_returns_strlen="$undef"
18926 : see if srand48_r exists
18927 set srand48_r d_srand48_r
18929 case "$d_srand48_r" in
18931 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18932 case "$d_srand48_r_proto:$usethreads" in
18933 ":define") d_srand48_r_proto=define
18934 set d_srand48_r_proto srand48_r $hdrs
18938 case "$d_srand48_r_proto" in
18940 case "$srand48_r_proto" in
18941 ''|0) try='int srand48_r(long, struct drand48_data*);'
18942 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18944 case "$srand48_r_proto" in
18945 ''|0) d_srand48_r=undef
18947 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18948 * ) case "$srand48_r_proto" in
18949 REENTRANT_PROTO*) ;;
18950 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18952 echo "Prototype: $try" ;;
18955 *) case "$usethreads" in
18956 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18963 *) srand48_r_proto=0
18967 : see if srandom_r exists
18968 set srandom_r d_srandom_r
18970 case "$d_srandom_r" in
18972 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18973 case "$d_srandom_r_proto:$usethreads" in
18974 ":define") d_srandom_r_proto=define
18975 set d_srandom_r_proto srandom_r $hdrs
18979 case "$d_srandom_r_proto" in
18981 case "$srandom_r_proto" in
18982 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18983 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18985 case "$srandom_r_proto" in
18986 ''|0) d_srandom_r=undef
18988 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18989 * ) case "$srandom_r_proto" in
18990 REENTRANT_PROTO*) ;;
18991 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18993 echo "Prototype: $try" ;;
18996 *) case "$usethreads" in
18997 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19004 *) srandom_r_proto=0
19008 : see if prototype for setresgid is available
19010 set d_sresgproto setresgid $i_unistd unistd.h
19013 : see if prototype for setresuid is available
19015 set d_sresuproto setresuid $i_unistd unistd.h
19018 : see if stat exists
19022 : see if sys/stat.h is available
19023 set sys/stat.h i_sysstat
19026 : see if stat knows about block sizes
19028 echo "Checking to see if your struct stat has st_blocks field..." >&4
19029 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19032 : see if this is a sys/vfs.h system
19033 set sys/vfs.h i_sysvfs
19036 : see if this is a sys/statfs.h system
19037 set sys/statfs.h i_sysstatfs
19040 : Check for statfs_s
19042 echo "Checking to see if your system supports struct statfs..." >&4
19043 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
19045 case "$d_statfs_s" in
19046 "$define") echo "Yes, it does." ;;
19047 *) echo "No, it doesn't." ;;
19051 : see if struct statfs knows about f_flags
19052 case "$d_statfs_s" in
19055 echo "Checking to see if your struct statfs has f_flags field..." >&4
19056 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
19060 set d_statfs_f_flags
19064 case "$d_statfs_f_flags" in
19065 "$define") echo "Yes, it does." ;;
19066 *) echo "No, it doesn't." ;;
19069 : see what flavor, if any, of static inline is supported
19071 echo "Checking to see if your system supports static inline..."
19072 $cat > try.c <<'EOCP'
19073 #include <stdlib.h>
19074 extern int f_via_a(int x);
19075 extern int f_via_b(int x);
19076 int main(int argc, char **argv)
19085 return EXIT_SUCCESS;
19088 return EXIT_FAILURE;
19092 $cat > a.c <<'EOCP'
19093 static INLINE int f(int x) {
19104 $cat > b.c <<'EOCP'
19105 extern int f(int x);
19113 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19114 case "$perl_static_inline" in
19115 '') # Check the various possibilities, and break out on success.
19116 # For gcc, prefer __inline__, which will still permit
19117 # cflags.SH to add in -ansi.
19118 case "$gccversion" in
19119 '') xxx="inline __inline__ __inline _inline";;
19120 *) xxx="__inline__ inline __inline _inline";;
19122 for inline in $xxx; do
19123 set try -DINLINE=$inline a.c
19124 if eval $compile && $run ./try; then
19125 # Now make sure there is no external linkage of static
19127 set try -DINLINE=$inline -DUSE_B a.c b.c
19128 if eval $compile && $run ./try; then
19129 $echo "Your compiler supports static $inline, " >&4
19130 $echo "but it also creates an external definition," >&4
19131 $echo "so I won't use it." >&4
19134 $echo "Your compiler supports static $inline." >&4
19136 perl_static_inline="static $inline";
19140 $echo "Your compiler does NOT support static $inline." >&4
19145 *inline*) # Some variant of inline exists.
19146 echo "Keeping your $hint value of $perl_static_inline."
19149 static) # No inline capabilities
19150 echo "Keeping your $hint value of $perl_static_inline."
19153 *) # Unrecognized previous value -- blindly trust the supplied
19154 # value and hope it makes sense. Use old value for
19155 # d_static_inline, if there is one.
19156 echo "Keeping your $hint value of $perl_static_inline."
19157 case "$d_static_inline" in
19159 *) val=$d_static_inline ;;
19163 # Fallback to plain 'static' if nothing worked.
19164 case "$perl_static_inline" in
19166 perl_static_inline="static"
19170 set d_static_inline
19172 $rm -f a.[co] b.[co]
19175 : Check stream access
19177 Checking how to access stdio streams by file descriptor number...
19179 case "$stdio_stream_array" in
19180 '') $cat >try.c <<EOCP
19183 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19187 for s in _iob __iob __sF
19189 set try -DSTDIO_STREAM_ARRAY=$s
19190 if eval $compile; then
19191 case "`$run ./try`" in
19192 yes) stdio_stream_array=$s; break ;;
19198 case "$stdio_stream_array" in
19200 I can't figure out how to access stdio streams by file descriptor number.
19202 d_stdio_stream_array="$undef"
19205 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19207 d_stdio_stream_array="$define"
19211 : see if strcoll exists
19212 set strcoll d_strcoll
19215 : check for structure copying
19217 echo "Checking to see if your C compiler can copy structs..." >&4
19218 $cat >try.c <<'EOCP'
19228 if $cc -c try.c >/dev/null 2>&1 ; then
19230 echo "Yup, it can."
19233 echo "Nope, it can't."
19239 : see if strerror and/or sys_errlist[] exist
19241 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19242 if set strerror val -f d_strerror; eval $csym; $val; then
19243 echo 'strerror() found.' >&4
19244 d_strerror="$define"
19245 d_strerrm='strerror(e)'
19246 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19247 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19248 d_syserrlst="$define"
19250 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19251 d_syserrlst="$undef"
19253 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19254 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19255 echo 'strerror() found in string header.' >&4
19256 d_strerror="$define"
19257 d_strerrm='strerror(e)'
19258 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19259 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19260 d_syserrlst="$define"
19262 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19263 d_syserrlst="$undef"
19265 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19266 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19267 d_strerror="$undef"
19268 d_syserrlst="$define"
19269 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19271 echo 'strerror() and sys_errlist[] NOT found.' >&4
19272 d_strerror="$undef"
19273 d_syserrlst="$undef"
19274 d_strerrm='"unknown"'
19278 : see if strerror_r exists
19279 set strerror_r d_strerror_r
19281 case "$d_strerror_r" in
19283 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19284 case "$d_strerror_r_proto:$usethreads" in
19285 ":define") d_strerror_r_proto=define
19286 set d_strerror_r_proto strerror_r $hdrs
19290 case "$d_strerror_r_proto" in
19292 case "$strerror_r_proto" in
19293 ''|0) try='int strerror_r(int, char*, size_t);'
19294 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19296 case "$strerror_r_proto" in
19297 ''|0) try='int strerror_r(int, char*, int);'
19298 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19300 case "$strerror_r_proto" in
19301 ''|0) try='char* strerror_r(int, char*, size_t);'
19302 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19304 case "$strerror_r_proto" in
19305 ''|0) d_strerror_r=undef
19307 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19308 * ) case "$strerror_r_proto" in
19309 REENTRANT_PROTO*) ;;
19310 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19312 echo "Prototype: $try" ;;
19315 *) case "$usethreads" in
19316 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19323 *) strerror_r_proto=0
19327 : see if strftime exists
19328 set strftime d_strftime
19331 : see if strlcat exists
19332 set strlcat d_strlcat
19335 : see if strlcpy exists
19336 set strlcpy d_strlcpy
19339 : see if strtod exists
19340 set strtod d_strtod
19343 : see if strtol exists
19344 set strtol d_strtol
19347 : see if strtold exists
19348 set strtold d_strtold
19351 : see if strtoll exists
19352 set strtoll d_strtoll
19355 case "$d_longlong-$d_strtoll" in
19358 Checking whether your strtoll() works okay...
19360 $cat >try.c <<'EOCP'
19363 #define strtoll __strtoll
19366 #define strtoll _strtoll
19369 extern long long int strtoll(char *s, char **, int);
19370 static int bad = 0;
19371 int check(char *s, long long ell, int een) {
19374 gll = strtoll(s, 0, 10);
19375 if (!((gll == ell) && (errno == een)))
19379 check(" 1", 1LL, 0);
19380 check(" 0", 0LL, 0);
19381 check("-1", -1LL, 0);
19382 check("-9223372036854775808", -9223372036854775808LL, 0);
19383 check("-9223372036854775808", -9223372036854775808LL, 0);
19384 check(" 9223372036854775807", 9223372036854775807LL, 0);
19385 check("-9223372036854775808", -9223372036854775808LL, 0);
19386 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19387 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19393 if eval $compile; then
19396 ok) echo "Your strtoll() seems to be working okay." ;;
19398 Your strtoll() doesn't seem to be working okay.
19404 echo "(I can't seem to compile the test program--assuming it doesn't)"
19410 : see if strtoq exists
19411 set strtoq d_strtoq
19414 : see if strtoul exists
19415 set strtoul d_strtoul
19418 case "$d_strtoul" in
19421 Checking whether your strtoul() works okay...
19423 $cat >try.c <<'EOCP'
19426 extern unsigned long int strtoul(char *s, char **, int);
19427 static int bad = 0;
19428 void check(char *s, unsigned long eul, int een) {
19431 gul = strtoul(s, 0, 10);
19432 if (!((gul == eul) && (errno == een)))
19436 check(" 1", 1L, 0);
19437 check(" 0", 0L, 0);
19439 case "$longsize" in
19441 $cat >>try.c <<'EOCP'
19442 check("18446744073709551615", 18446744073709551615UL, 0);
19443 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19444 #if 0 /* strtoul() for /^-/ strings is undefined. */
19445 check("-1", 18446744073709551615UL, 0);
19446 check("-18446744073709551614", 2, 0);
19447 check("-18446744073709551615", 1, 0);
19448 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19449 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19454 $cat >>try.c <<'EOCP'
19455 check("4294967295", 4294967295UL, 0);
19456 check("4294967296", 4294967295UL, ERANGE);
19457 #if 0 /* strtoul() for /^-/ strings is undefined. */
19458 check("-1", 4294967295UL, 0);
19459 check("-4294967294", 2, 0);
19460 check("-4294967295", 1, 0);
19461 check("-4294967296", 4294967295UL, ERANGE);
19462 check("-4294967297", 4294967295UL, ERANGE);
19467 : Should we write these tests to be more portable by sprintf-ing
19468 : ~0 and then manipulating that char string as input for strtol?
19471 $cat >>try.c <<'EOCP'
19478 if eval $compile; then
19479 case "`$run ./try`" in
19480 ok) echo "Your strtoul() seems to be working okay." ;;
19482 Your strtoul() doesn't seem to be working okay.
19488 echo "(I can't seem to compile the test program--assuming it doesn't)"
19494 : see if strtoull exists
19495 set strtoull d_strtoull
19498 case "$d_longlong-$d_strtoull" in
19501 Checking whether your strtoull() works okay...
19503 $cat >try.c <<'EOCP'
19506 #define strtoull __strtoull
19509 extern unsigned long long int strtoull(char *s, char **, int);
19510 static int bad = 0;
19511 int check(char *s, long long eull, int een) {
19514 gull = strtoull(s, 0, 10);
19515 if (!((gull == eull) && (errno == een)))
19519 check(" 1", 1LL, 0);
19520 check(" 0", 0LL, 0);
19521 check("18446744073709551615", 18446744073709551615ULL, 0);
19522 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19523 #if 0 /* strtoull() for /^-/ strings is undefined. */
19524 check("-1", 18446744073709551615ULL, 0);
19525 check("-18446744073709551614", 2LL, 0);
19526 check("-18446744073709551615", 1LL, 0);
19527 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19528 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19535 if eval $compile; then
19536 case "`$run ./try`" in
19537 ok) echo "Your strtoull() seems to be working okay." ;;
19539 Your strtoull() doesn't seem to be working okay.
19541 d_strtoull="$undef"
19545 echo "(I can't seem to compile the test program--assuming it doesn't)"
19546 d_strtoull="$undef"
19551 : see if strtouq exists
19552 set strtouq d_strtouq
19555 case "$d_strtouq" in
19558 Checking whether your strtouq() works okay...
19560 $cat >try.c <<'EOCP'
19563 extern unsigned long long int strtouq(char *s, char **, int);
19564 static int bad = 0;
19565 void check(char *s, unsigned long long eull, int een) {
19566 unsigned long long gull;
19568 gull = strtouq(s, 0, 10);
19569 if (!((gull == eull) && (errno == een)))
19573 check(" 1", 1LL, 0);
19574 check(" 0", 0LL, 0);
19575 check("18446744073709551615", 18446744073709551615ULL, 0);
19576 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19577 #if 0 /* strtouq() for /^-/ strings is undefined. */
19578 check("-1", 18446744073709551615ULL, 0);
19579 check("-18446744073709551614", 2LL, 0);
19580 check("-18446744073709551615", 1LL, 0);
19581 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19582 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19590 if eval $compile; then
19591 case "`$run ./try`" in
19592 ok) echo "Your strtouq() seems to be working okay." ;;
19594 Your strtouq() doesn't seem to be working okay.
19600 echo "(I can't seem to compile the test program--assuming it doesn't)"
19606 : see if strxfrm exists
19607 set strxfrm d_strxfrm
19610 : see if symlink exists
19611 set symlink d_symlink
19614 : see if syscall exists
19615 set syscall d_syscall
19618 : see if prototype for syscall is available
19620 set d_syscallproto syscall $i_unistd unistd.h
19623 : see if sysconf exists
19624 set sysconf d_sysconf
19627 : see if system exists
19628 set system d_system
19631 : see if tcgetpgrp exists
19632 set tcgetpgrp d_tcgetpgrp
19635 : see if tcsetpgrp exists
19636 set tcsetpgrp d_tcsetpgrp
19639 : see if prototype for telldir is available
19641 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19644 : see if tgamma exists
19645 set tgamma d_tgamma
19648 : see if time exists
19650 if test "X$d_time" = X -o X"$timetype" = X; then
19651 if set time val -f d_time; eval $csym; $val; then
19652 echo 'time() found.' >&4
19654 rp="What is the type returned by time() on this system?"
19655 set time_t timetype long stdio.h sys/types.h
19658 echo 'time() not found, hope that will do.' >&4
19666 : see if timegm exists
19667 set timegm d_timegm
19670 : see if this is a sys/times.h system
19671 set sys/times.h i_systimes
19674 : see if times exists
19676 if set times val -f d_times; eval $csym; $val; then
19677 echo 'times() found.' >&4
19680 case "$i_systimes" in
19681 "$define") inc='sys/times.h';;
19683 rp="What is the type returned by times() on this system?"
19684 set clock_t clocktype long stdio.h sys/types.h $inc
19687 echo 'times() NOT found, hope that will do.' >&4
19692 : see if tmpnam_r exists
19693 set tmpnam_r d_tmpnam_r
19695 case "$d_tmpnam_r" in
19697 hdrs="$i_systypes sys/types.h define stdio.h "
19698 case "$d_tmpnam_r_proto:$usethreads" in
19699 ":define") d_tmpnam_r_proto=define
19700 set d_tmpnam_r_proto tmpnam_r $hdrs
19704 case "$d_tmpnam_r_proto" in
19706 case "$tmpnam_r_proto" in
19707 ''|0) try='char* tmpnam_r(char*);'
19708 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19710 case "$tmpnam_r_proto" in
19711 ''|0) d_tmpnam_r=undef
19713 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19714 * ) case "$tmpnam_r_proto" in
19715 REENTRANT_PROTO*) ;;
19716 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19718 echo "Prototype: $try" ;;
19721 *) case "$usethreads" in
19722 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19729 *) tmpnam_r_proto=0
19733 : see if trunc exists
19737 : see if truncate exists
19738 set truncate d_truncate
19741 : see if ttyname_r exists
19742 set ttyname_r d_ttyname_r
19744 case "$d_ttyname_r" in
19746 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19747 case "$d_ttyname_r_proto:$usethreads" in
19748 ":define") d_ttyname_r_proto=define
19749 set d_ttyname_r_proto ttyname_r $hdrs
19753 case "$d_ttyname_r_proto" in
19755 case "$ttyname_r_proto" in
19756 ''|0) try='int ttyname_r(int, char*, size_t);'
19757 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19759 case "$ttyname_r_proto" in
19760 ''|0) try='int ttyname_r(int, char*, int);'
19761 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19763 case "$ttyname_r_proto" in
19764 ''|0) try='char* ttyname_r(int, char*, int);'
19765 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19767 case "$ttyname_r_proto" in
19768 ''|0) d_ttyname_r=undef
19770 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19771 * ) case "$ttyname_r_proto" in
19772 REENTRANT_PROTO*) ;;
19773 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19775 echo "Prototype: $try" ;;
19778 *) case "$usethreads" in
19779 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19786 *) ttyname_r_proto=0
19790 : see if tzname[] exists
19792 if set tzname val -a d_tzname; eval $csym; $val; then
19794 echo 'tzname[] found.' >&4
19797 echo 'tzname[] NOT found.' >&4
19802 : Check if is a multiplatform env
19804 darwin) multiarch="$define" ;;
19806 case "$multiarch" in
19807 ''|[nN]*) multiarch="$undef" ;;
19810 : check for ordering of bytes in a UV
19812 case "$multiarch" in
19815 You seem to be doing a multiarchitecture build,
19816 skipping the byteorder check.
19822 case "$byteorder" in
19825 In the following, larger digits indicate more significance. A big-endian
19826 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19827 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19828 machines may have weird orders like 3412. A Cray will report 87654321,
19829 an Alpha will report 12345678. If the test program works the default is
19831 I'm now running the test program...
19835 #$i_stdlib I_STDLIB
19837 #include <stdlib.h>
19839 #include <sys/types.h>
19840 typedef $uvtype UV;
19850 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19852 u.l = (UV)0x04030201;
19853 for (i = 0; i < $uvsize; i++)
19854 printf("%c", u.c[i]+'0');
19861 if eval $compile && $run ./try > /dev/null; then
19864 [1-4][1-4][1-4][1-4]|12345678|87654321)
19865 echo "(The test program ran ok.)"
19866 echo "byteorder=$dflt"
19869 ????|????????) echo "(The test program ran ok.)" ;;
19870 *) echo "(The test program didn't run right for some reason.)" ;;
19875 (I can't seem to compile the test program. Guessing big-endian...)
19878 case "$xxx_prompt" in
19880 rp="What is the order of bytes in $uvtype?"
19893 : Checking 32bit alignedness
19896 Checking to see whether you can access character data unalignedly...
19898 case "$d_u32align" in
19899 '') $cat >try.c <<EOCP
19901 #$i_stdlib I_STDLIB
19903 #include <stdlib.h>
19905 #define U32 $u32type
19906 #define BYTEORDER 0x$byteorder
19908 #include <signal.h>
19910 $signal_t bletch(int s) { exit(4); }
19913 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19914 volatile U8 buf[8];
19918 if (sizeof(U32) != 4) {
19919 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19926 signal(SIGBUS, bletch);
19938 for (i = 0; i < 4; i++) {
19939 up = (U32*)(buf + i);
19940 if (! ((*up == 1 << (8*i)) || /* big-endian */
19941 (*up == 1 << (8*(3-i))) /* little-endian */
19945 printf("read failed (%x)\n", *up);
19951 for (i = 0; i < 4; i++) {
19952 up = (U32*)(buf + i);
19954 if (*up != 0xBeef) {
19955 printf("write failed (%x)\n", *up);
19969 if eval $compile_ok; then
19970 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19971 $run ./try 2>&1 >/dev/null
19974 You can access character data pretty unalignedly.
19976 d_u32align="$undef"
19979 It seems that you must access character data in an aligned manner.
19981 d_u32align="$define"
19985 rp='Can you access character data at unaligned addresses?'
19989 [yY]*) d_u32align="$undef" ;;
19990 *) d_u32align="$define" ;;
19997 : see if ualarm exists
19998 set ualarm d_ualarm
20001 : see if umask exists
20005 : see if unordered exists
20006 set unordered d_unordered
20009 : see if unsetenv exists
20010 set unsetenv d_unsetenv
20013 : see if usleep exists
20014 set usleep d_usleep
20017 : see if prototype for usleep is available
20019 set d_usleepproto usleep $i_unistd unistd.h
20022 : see if ustat exists
20026 : see if closedir exists
20027 set closedir d_closedir
20030 case "$d_closedir" in
20033 echo "Checking whether closedir() returns a status..." >&4
20035 #$i_dirent I_DIRENT /**/
20036 #$i_sysdir I_SYS_DIR /**/
20037 #$i_sysndir I_SYS_NDIR /**/
20038 #$i_systypes I_SYS_TYPES /**/
20040 #if defined(I_SYS_TYPES)
20041 #include <sys/types.h>
20043 #if defined(I_DIRENT)
20044 #include <dirent.h>
20047 #include <sys/ndir.h>
20051 #include <ndir.h> /* may be wrong in the future */
20053 #include <sys/dir.h>
20058 int main() { return closedir(opendir(".")); }
20061 if eval $compile_ok; then
20062 if $run ./try > /dev/null 2>&1 ; then
20063 echo "Yes, it does."
20066 echo "No, it doesn't."
20070 echo "(I can't seem to compile the test program--assuming it doesn't)"
20078 set d_void_closedir
20082 : see if there is a wait4
20086 : see if waitpid exists
20087 set waitpid d_waitpid
20092 $cat >try.c <<'EOCP'
20098 return (wcscmp (s, s) ? 1 : 0);
20103 if eval $compile; then
20106 0) echo "A working wcscmp() found." >&4
20108 *) echo "wcscmp() found, but it doesn't work" >&4
20112 echo "wcscmp() NOT found." >&4
20118 : see if wcstombs exists
20119 set wcstombs d_wcstombs
20124 $cat >try.c <<'EOCP'
20129 wchar_t dst[4], *src = L" ";
20131 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20136 if eval $compile; then
20139 0) echo "A working wcsxfrm() found." >&4
20141 *) echo "wcsxfrm() found, but it doesn't work" >&4
20145 echo "wcsxfrm() NOT found." >&4
20151 : see if wctomb exists
20152 set wctomb d_wctomb
20155 : see if writev exists
20156 set writev d_writev
20159 : check for alignment requirements
20161 case "$alignbytes" in
20162 '') echo "Checking alignment constraints..." >&4
20171 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20176 if eval $compile_ok; then
20180 echo "(I can't seem to compile the test program...)"
20182 case "$multiarch" in
20184 : The usual safe value is 8, but Darwin with -Duselongdouble
20185 : needs 16. Hence, we will take 8 as a minimum, but allow
20186 : Configure to pick a larger value if needed.
20187 if $test "$dflt" -lt 8; then
20189 echo "Setting alignment to 8 for multiarch support.">&4
20194 *) dflt="$alignbytes"
20197 rp="Doubles must be aligned on a how-many-byte boundary?"
20202 : set the base revision
20205 : length of character in bytes. Is always 1, otherwise it is not C
20206 : This used to be a test using sizeof
20209 : Check for the number of bits in a character
20210 case "$charbits" in
20211 '') echo "Checking how long a character is (in bits)..." >&4
20218 for (c = 1, n = 0; c; c <<= 1, n++) ;
20219 printf ("%d\n", n);
20224 if eval $compile_ok; then
20228 echo "(I can't seem to compile the test program. Guessing...)"
20235 rp="What is the length of a character (in bits)?"
20239 case "$charbits" in
20242 Your system has an unsigned character size of $charbits bits, which
20243 is rather unusual (normally it is 8 bits). Perl likely will not work
20244 correctly on your system, with subtle bugs in various places.
20246 rp='Do you really want to continue?'
20250 [yY]) echo >&4 "Okay, continuing." ;;
20255 : how do we concatenate cpp tokens here?
20257 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20258 $cat >cpp_stuff.c <<'EOCP'
20259 #define RCAT(a,b)a/**/b
20260 #define ACAT(a,b)a ## b
20264 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20265 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20266 echo "Oh! Smells like ANSI's been here." >&4
20267 echo "We can catify or stringify, separately or together!"
20269 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20270 echo "Ah, yes! The good old days!" >&4
20271 echo "However, in the good old days we don't know how to stringify and"
20272 echo "catify at the same time."
20276 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20277 You're going to have to edit the values of CAT[2-5] in config.h...
20279 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20283 : see if this is a db.h system
20289 : Check db version.
20291 echo "Checking Berkeley DB version ..." >&4
20297 #include <sys/types.h>
20299 #$i_stdlib I_STDLIB
20301 #include <stdlib.h>
20304 int main(int argc, char *argv[])
20306 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20307 int Major, Minor, Patch ;
20308 unsigned long Version ;
20309 (void)db_version(&Major, &Minor, &Patch) ;
20311 printf("%d %d %d %d %d %d\n",
20312 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20313 Major, Minor, Patch);
20316 printf("You have Berkeley DB Version 2 or greater.\n");
20318 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20319 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20320 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20321 Major, Minor, Patch) ;
20323 /* check that db.h & libdb are compatible */
20324 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20325 printf("db.h and libdb are incompatible.\n") ;
20329 printf("db.h and libdb are compatible.\n") ;
20331 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20332 + DB_VERSION_PATCH ;
20334 /* needs to be >= 2.3.4 */
20335 if (Version < 2003004) {
20336 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20337 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20343 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20348 printf("You have Berkeley DB Version 1.\n");
20349 exit(0); /* DB version < 2: the coast is clear. */
20351 exit(1); /* <db.h> not Berkeley DB? */
20357 if eval $compile_ok && $run ./try; then
20358 echo 'Looks OK.' >&4
20360 db_version_major=$1
20361 db_version_minor=$2
20362 db_version_patch=$3
20364 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20368 : Remove db from list of libraries to use
20369 echo "Removing unusable -ldb from library list" >&4
20370 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20373 echo "libs = $libs" >&4
20383 : Check the return type needed for hash
20385 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20391 #include <sys/types.h>
20394 #ifndef DB_VERSION_MAJOR
20395 u_int32_t hash_cb (const void* ptr, size_t size)
20401 info.hash = hash_cb;
20405 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20406 if $contains warning try.out >>/dev/null 2>&1 ; then
20409 db_hashtype='u_int32_t'
20412 : XXX Maybe we should just give up here.
20413 db_hashtype=u_int32_t
20415 echo "Help: I can't seem to compile the db test program." >&4
20416 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20419 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20421 *) db_hashtype=u_int32_t
20426 : Check the return type needed for prefix
20428 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20434 #include <sys/types.h>
20437 #ifndef DB_VERSION_MAJOR
20438 size_t prefix_cb (const DBT *key1, const DBT *key2)
20444 info.prefix = prefix_cb;
20448 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20449 if $contains warning try.out >>/dev/null 2>&1 ; then
20450 db_prefixtype='int'
20452 db_prefixtype='size_t'
20455 db_prefixtype='size_t'
20456 : XXX Maybe we should just give up here.
20458 echo "Help: I can't seem to compile the db test program." >&4
20459 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20462 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20464 *) db_prefixtype='size_t'
20468 : Check what kind of inf/nan your system has
20469 $echo "Checking the kind of infinities and nans you have..." >&4
20471 #define DOUBLESIZE $doublesize
20472 #$d_longdbl HAS_LONG_DOUBLE
20473 #ifdef HAS_LONG_DOUBLE
20474 #define LONGDBLSIZE $longdblsize
20475 #define LONGDBLKIND $longdblkind
20482 /* Note that whether the sign bit is on or off
20483 * for NaN depends on the CPU/FPU, and possibly
20484 * can be affected by the build toolchain.
20486 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20487 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20488 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20489 * (respectively) as opposed to the more usual
20490 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20492 static void bytes(unsigned char *p, unsigned int n) {
20494 for (i = 0; i < n; i++) {
20495 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20498 int main(int argc, char *argv[]) {
20499 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20500 * because some compilers are 'smart' and not only warn but refuse to
20501 * compile such 'illegal' values. */
20502 double dinf = exp(1e9);
20503 double dnan = sqrt(-1.0);
20504 #ifdef HAS_LONG_DOUBLE
20505 long double ldinf = (long double)exp(1e9);
20506 long double ldnan = (long double)sqrt(-1.0);
20509 switch (argv[1][0]) {
20510 case '1': bytes(&dinf, sizeof(dinf)); break;
20511 case '2': bytes(&dnan, sizeof(dnan)); break;
20512 #ifdef HAS_LONG_DOUBLE
20513 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20514 /* the 80-bit long doubles might have garbage in their excess bytes */
20515 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20517 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20518 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20526 if eval $compile; then
20527 doubleinfbytes=`$run ./try 1`
20528 doublenanbytes=`$run ./try 2`
20529 case "$d_longdbl" in
20531 longdblinfbytes=`$run ./try 3`
20532 longdblnanbytes=`$run ./try 4`
20536 # Defaults in case the above test program failed.
20537 case "$doublekind" in
20538 1) # IEEE 754 32-bit LE
20539 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20540 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20542 2) # IEEE 754 32-bit BE
20543 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20544 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20546 3) # IEEE 754 64-bit LE
20547 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20548 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20550 4) # IEEE 754 64-bit BE
20551 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20552 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20554 5) # IEEE 754 128-bit LE
20555 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20556 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20558 6) # IEEE 754 128-bit BE
20559 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20560 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20562 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20563 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20564 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20566 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20567 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20568 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20571 doubleinfbytes=$undef
20572 doublenanbytes=$undef
20575 case "$longdblkind" in
20576 1) # IEEE 754 128-bit LE
20577 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20578 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20580 2) # IEEE 754 128-bit BE
20581 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20582 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20584 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20585 case "$longdblsize" in
20586 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20587 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20588 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20591 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20592 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20595 longdblinfbytes=$undef
20596 longdblnanbytes=$undef
20600 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20601 case "$longdblsize" in
20602 12) # 32-bit system
20603 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20604 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20606 16) # 64-bit system
20607 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20608 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20611 longdblinfbytes=$undef
20612 longdblnanbytes=$undef
20616 5) # 128-bit LE-LE "double double"
20617 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20618 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20620 6) # 128-bit BE-BE "double double"
20621 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20622 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20624 7) # 128-bit LE-BE "double double"
20625 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20626 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20628 8) # 128-bit BE-LE "double double"
20629 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20630 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20633 longdblinfbytes=$undef
20634 longdblnanbytes=$undef
20640 : Check the length of the double mantissa
20641 $echo "Checking how many mantissa bits your doubles have..." >&4
20644 #$i_sunmath I_SUNMATH
20646 # include <float.h>
20649 # include <sunmath.h>
20651 #ifdef DBL_MANT_DIG
20652 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20655 int main(int argc, char *argv[]) {
20657 printf("%d\n", BITS);
20663 if eval $compile; then
20664 doublemantbits=`$run ./try`
20666 doublemantbits="$undef"
20670 : Check the length of the longdouble mantissa
20671 $echo "Checking how many mantissa bits your long doubles have..." >&4
20674 #$i_sunmath I_SUNMATH
20676 # include <float.h>
20679 # include <sunmath.h>
20681 #$d_longdbl HAS_LONG_DOUBLE
20682 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20683 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20684 /* This format has no implicit bit. Beware, however, that for
20685 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20686 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20687 * and the top bit must have been one since 387, zero is plain invalid.
20688 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20689 # define BITS LDBL_MANT_DIG
20690 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20691 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20692 * reason e.g. Irix thinks 107. But in any case, we want only
20693 * the number of real bits, the implicit bits are of no interest. */
20694 # define BITS 2 * (DBL_MANT_DIG - 1)
20696 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20700 int main(int argc, char *argv[]) {
20702 printf("%d\n", BITS);
20708 if eval $compile; then
20709 longdblmantbits=`$run ./try`
20711 longdblmantbits="$undef"
20715 : Check the length of the NV mantissa
20716 $echo "Checking how many mantissa bits your NVs have..." >&4
20717 if test "X$usequadmath" = "X$define"; then
20718 nvmantbits=112 # 128-1-15
20720 if test "X$nvsize" = "X$doublesize"; then
20721 nvmantbits="$doublemantbits"
20723 if test "X$nvsize" = "X$longdblsize"; then
20724 nvmantbits="$longdblmantbits"
20726 nvmantbits="$undef"
20731 : How can we generate normalized random numbers ?
20733 echo "Using our internal random number implementation..." >&4
20736 *-Dmy_rand=*|*-Dmy_srand=*)
20737 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20738 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20739 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20740 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20744 randfunc=Perl_drand48
20745 drand01="Perl_drand48()"
20746 seedfunc="Perl_drand48_init"
20750 : Probe whether dtrace builds an object, as newer Illumos requires an input
20751 : object file that uses at least one of the probes defined in the .d file
20752 case "$usedtrace" in
20754 case "$dtraceobject" in
20755 $define|true|[yY]*)
20756 dtraceobject=$define
20759 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20761 #include "perldtrace.h"
20763 PERL_LOADED_FILE("dummy");
20767 dtraceobject=$undef
20768 if $cc -c -o try.o $optimize $ccflags try.c \
20769 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
20770 dtraceobject=$define
20771 echo "Your dtrace builds an object file"
20773 $rm -f try.c try.o perldtrace.o
20775 *) dtraceobject=$undef ;;
20779 : Determine if this is an EBCDIC system
20781 echo "Determining whether or not we are on an EBCDIC system..." >&4
20782 $cat >try.c <<'EOM'
20785 if ('M'==0xd4) return 0;
20792 if eval $compile_ok; then
20793 if $run ./try; then
20794 echo "You seem to speak EBCDIC." >&4
20797 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20800 echo "I'm unable to compile the test program." >&4
20801 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20807 : Check how to flush
20810 Checking how to flush all pending stdio output...
20812 # I only know how to find the first 32 possibly open files on SunOS.
20813 # See also hints/sunos_4_1.sh and util.c --AD
20815 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20817 $cat >>try.c <<EOCP
20819 #$i_stdlib I_STDLIB
20821 #include <stdlib.h>
20823 #$i_unistd I_UNISTD
20825 # include <unistd.h>
20827 #$d_sysconf HAS_SYSCONF
20828 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20829 #ifdef HAS_STDIO_STREAM_ARRAY
20830 # define STDIO_STREAM_ARRAY $stdio_stream_array
20835 p = fopen("try.out", "w");
20839 # ifdef TRY_FPRINTF
20843 #ifdef TRY_FFLUSH_NULL
20846 #ifdef TRY_FFLUSH_ALL
20848 long open_max = -1;
20849 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20850 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20852 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20853 open_max = sysconf(_SC_OPEN_MAX);
20856 open_max = FOPEN_MAX;
20859 open_max = OPEN_MAX;
20868 # ifdef HAS_STDIO_STREAM_ARRAY
20869 if (open_max > 0) {
20871 for (i = 0; i < open_max; i++)
20872 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20873 STDIO_STREAM_ARRAY[i]._file < open_max &&
20874 STDIO_STREAM_ARRAY[i]._flag)
20875 fflush(&STDIO_STREAM_ARRAY[i]);
20883 : first we have to find out how _not_ to flush
20885 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20887 set try -DTRY_FPUTC
20888 if eval $compile; then
20889 $run ./try 2>/dev/null
20892 if $test ! -s try.out -a "X$code" = X42; then
20898 set try -DTRY_FPRINTF
20899 if eval $compile; then
20900 $run ./try 2>/dev/null
20903 if $test ! -s try.out -a "X$code" = X42; then
20904 output=-DTRY_FPRINTF
20910 : check for fflush NULL behavior
20911 case "$fflushNULL" in
20912 '') set try -DTRY_FFLUSH_NULL $output
20913 if eval $compile; then
20914 $run ./try 2>/dev/null
20917 if $test -s try.out -a "X$code" = X42; then
20918 fflushNULL="`$cat try.out`"
20920 if $test "X$code" != X42; then
20922 (If this test failed, don't worry, we'll try another method shortly.)
20927 $rm -f core try.core core.try.*
20928 case "$fflushNULL" in
20930 Your fflush(NULL) works okay for output streams.
20931 Let's see if it clobbers input pipes...
20933 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20934 # bug that improperly flushes the input end of pipes. So we avoid the
20935 # autoflush on fork/system/exec support for now. :-(
20936 $cat >tryp.c <<EOCP
20939 main(int argc, char **argv)
20945 while ((i = getc(stdin)) != -1
20946 && (*bp++ = i) != '\n'
20947 && bp < &buf[1024])
20950 fprintf(stdout, "%s", buf);
20958 fflushNULL="$define"
20960 if eval $compile; then
20962 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20963 if $test "X$targethost" != X; then
20966 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20968 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20970 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20972 fflush(NULL) seems to behave okay with input streams.
20974 fflushNULL="$define"
20977 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20979 fflushNULL="$undef"
20982 $rm -f core tryp.c tryp.core core.tryp.*
20985 Your fflush(NULL) isn't working (contrary to ANSI C).
20987 fflushNULL="$undef"
20990 Cannot figure out whether your fflush(NULL) works or not.
20991 I'm assuming it doesn't (contrary to ANSI C).
20993 fflushNULL="$undef"
20997 $define|true|[yY]*)
20998 fflushNULL="$define"
21001 fflushNULL="$undef"
21004 : check explicit looping only if NULL did not work, and if the pipe
21005 : bug does not show up on an explicit flush too
21006 case "$fflushNULL" in
21008 $cat >tryp.c <<EOCP
21011 main(int argc, char **argv)
21017 while ((i = getc(stdin)) != -1
21018 && (*bp++ = i) != '\n'
21019 && bp < &buf[1024])
21022 fprintf(stdout, "%s", buf);
21031 if eval $compile; then
21033 if $test "X$targethost" != X; then
21036 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21038 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21040 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21042 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21044 : now check for fflushall behaviour
21045 case "$fflushall" in
21046 '') set try -DTRY_FFLUSH_ALL $output
21047 if eval $compile; then
21049 (Now testing the other method--but note that this also may fail.)
21051 $run ./try 2>/dev/null
21054 if $test -s try.out -a "X$code" = X42; then
21055 fflushall="`$cat try.out`"
21059 case "$fflushall" in
21061 Whew. Flushing explicitly all the stdio streams works.
21063 fflushall="$define"
21066 Sigh. Flushing explicitly all the stdio streams doesn't work.
21071 Cannot figure out whether flushing stdio streams explicitly works or not.
21072 I'm assuming it doesn't.
21078 "$define"|true|[yY]*)
21079 fflushall="$define"
21087 All is futile. Even fflush(stdin) clobbers input pipes!
21094 $rm -f core tryp.c tryp.core core.tryp.*
21096 *) fflushall="$undef"
21100 case "$fflushNULL$fflushall" in
21103 OK, I give up. I cannot figure out how to flush pending stdio output.
21104 We won't be flushing handles at all before fork/exec/popen.
21110 : Store the full pathname to the ar program for use in the C program
21111 : Respect a hint or command line value for full_ar.
21116 : Store the full pathname to the sed program for use in the C program
21119 : see what type gids are declared as in the kernel
21121 echo "Looking for the type for group ids returned by getgid()."
21122 set gid_t gidtype xxx stdio.h sys/types.h
21126 xxx=`./findhdr sys/user.h`
21127 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21129 unsigned) dflt="$1 $2" ;;
21133 *) dflt="$gidtype";;
21136 gid_t) echo "gid_t found." ;;
21137 *) rp="What is the type for group ids returned by getgid()?"
21143 : Check the size of GID
21146 *_t) zzz="$gidtype" ;;
21149 echo "Checking the size of $zzz..." >&4
21151 #include <sys/types.h>
21153 #$i_stdlib I_STDLIB
21155 #include <stdlib.h>
21158 printf("%d\n", (int)sizeof($gidtype));
21163 if eval $compile_ok; then
21167 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21170 echo "Your $zzz is $gidsize bytes long."
21175 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21179 : Check if GID is signed
21182 *_t) zzz="$gidtype" ;;
21185 echo "Checking the sign of $zzz..." >&4
21187 #include <sys/types.h>
21198 if eval $compile; then
21202 echo "(I can't execute the test program--guessing unsigned.)" >&4
21206 1) echo "Your $zzz is unsigned." ;;
21207 -1) echo "Your $zzz is signed." ;;
21213 echo "(I can't compile the test program--guessing unsigned.)" >&4
21217 : Check 64bit sizes
21220 if $test X"$quadtype" != X; then
21222 echo "Checking how to print 64-bit integers..." >&4
21224 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21225 $cat >try.c <<'EOCP'
21226 #include <sys/types.h>
21229 int q = 12345678901;
21230 printf("%ld\n", q);
21234 if eval $compile; then
21238 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21239 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21240 echo "We will use %d."
21246 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21247 $cat >try.c <<'EOCP'
21248 #include <sys/types.h>
21251 long q = 12345678901;
21252 printf("%ld\n", q);
21256 if eval $compile; then
21260 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21261 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21262 echo "We will use %ld."
21268 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21269 $cat >try.c <<'EOCP'
21270 #include <sys/types.h>
21271 #include <inttypes.h>
21274 int64_t q = 12345678901;
21275 printf("%" PRId64 "\n", q);
21279 if eval $compile; then
21283 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21284 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21285 echo "We will use the C9X style."
21291 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21293 #include <sys/types.h>
21296 $quadtype q = 12345678901;
21297 printf("%Ld\n", q);
21301 if eval $compile; then
21305 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21306 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21307 echo "We will use %Ld."
21313 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21314 $cat >try.c <<'EOCP'
21315 #include <sys/types.h>
21318 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21319 printf("%lld\n", q);
21323 if eval $compile; then
21327 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21328 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21329 echo "We will use the %lld style."
21335 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21337 #include <sys/types.h>
21340 $quadtype q = 12345678901;
21341 printf("%qd\n", q);
21345 if eval $compile; then
21349 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21350 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21351 echo "We will use %qd."
21357 if $test X"$sPRId64" = X; then
21358 echo "Cannot figure out how to print 64-bit integers." >&4
21365 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21366 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21368 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21369 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21373 : Check format strings for internal types
21375 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21377 if $test X"$ivsize" = X8; then
21378 ivdformat="$sPRId64"
21379 uvuformat="$sPRIu64"
21380 uvoformat="$sPRIo64"
21381 uvxformat="$sPRIx64"
21382 uvXUformat="$sPRIXU64"
21384 if $test X"$ivsize" = X"$longsize"; then
21391 if $test X"$ivsize" = X"$intsize"; then
21399 if $test X"$ivsize" = X"$shortsize"; then
21410 if $test X"$usequadmath" = X"$define"; then
21418 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21419 nveformat="$sPRIeldbl"
21420 nvfformat="$sPRIfldbl"
21421 nvgformat="$sPRIgldbl"
21422 nvEUformat="$sPRIEUldbl"
21423 nvFUformat="$sPRIFUldbl"
21424 nvGUformat="$sPRIGUldbl"
21435 case "$ivdformat" in
21436 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21441 : Check format string for GID
21444 $echo "Checking the format string to be used for gids..." >&4
21447 -1) if $test X"$gidsize" = X"$ivsize"; then
21448 gidformat="$ivdformat"
21450 if $test X"$gidsize" = X"$longsize"; then
21453 if $test X"$gidsize" = X"$intsize"; then
21456 if $test X"$gidsize" = X"$shortsize"; then
21463 *) if $test X"$gidsize" = X"$uvsize"; then
21464 gidformat="$uvuformat"
21466 if $test X"$gidsize" = X"$longsize"; then
21469 if $test X"$gidsize" = X"$intsize"; then
21472 if $test X"$gidsize" = X"$shortsize"; then
21481 : see if getgroups exists
21482 set getgroups d_getgrps
21485 : see if setgroups exists
21486 set setgroups d_setgrps
21489 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21491 case "$d_getgrps$d_setgrps" in
21493 case "$groupstype" in
21494 '') dflt="$gidtype" ;;
21495 *) dflt="$groupstype" ;;
21498 What type of pointer is the second argument to getgroups() and setgroups()?
21499 Usually this is the same as group ids, $gidtype, but not always.
21502 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21506 *) groupstype="$gidtype";;
21509 : check whether make sets MAKE
21511 echo "Checking if your $make program sets \$(MAKE)..." >&4
21512 case "$make_set_make" in
21514 $sed 's/^X //' > testmake.mak << 'EOF'
21516 X @echo 'maketemp="$(MAKE)"'
21518 case "`$make -f testmake.mak 2>/dev/null`" in
21519 *maketemp=*) make_set_make='#' ;;
21520 *) make_set_make="MAKE=$make" ;;
21522 $rm -f testmake.mak
21525 case "$make_set_make" in
21526 '#') echo "Yup, it does.";;
21527 *) echo "Nope, it doesn't.";;
21530 : see what type is used for mode_t
21531 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21532 set mode_t modetype int stdio.h sys/types.h
21535 : see if we need va_copy
21537 case "$i_stdarg" in
21540 #include <stdarg.h>
21542 #$i_stdlib I_STDLIB
21544 #include <stdlib.h>
21546 #include <signal.h>
21549 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21551 return vfprintf(f, fmt, *valp);
21555 myvfprintf(FILE *f, const char *fmt, va_list val)
21557 return ivfprintf(f, fmt, &val);
21561 myprintf(char *fmt, ...)
21564 va_start(val, fmt);
21565 return myvfprintf(stdout, fmt, val);
21569 main(int ac, char **av)
21571 signal(SIGSEGV, exit);
21573 myprintf("%s%cs all right, then\n", "that", '\'');
21578 if eval $compile && $run ./try 2>&1 >/dev/null; then
21579 case "`$run ./try`" in
21580 "that's all right, then")
21586 yes) echo "It seems that you don't need va_copy()." >&4
21587 need_va_copy="$undef"
21589 *) echo "It seems that va_copy() or similar will be needed." >&4
21590 need_va_copy="$define"
21595 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21596 need_va_copy="$undef"
21600 : see what type is used for size_t
21601 rp="What is the type used for the length parameter for string functions?"
21602 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21605 : check for type of arguments to gethostbyaddr.
21606 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21607 case "$d_gethbyaddr" in
21611 Checking to see what type of arguments are accepted by gethostbyaddr().
21613 hdrs="$define sys/types.h
21614 $d_socket sys/socket.h
21615 $i_niin netinet/in.h
21617 $i_unistd unistd.h"
21618 : The first arg can 'char *' or 'void *'
21619 : The second arg is some of integral type
21620 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21621 for yyy in size_t long int; do
21622 case "$netdb_host_type" in
21623 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21624 if ./protochk "$try" $hdrs; then
21625 echo "Your system accepts $xxx for the first arg."
21626 echo "...and $yyy for the second arg."
21627 netdb_host_type="$xxx"
21628 netdb_hlen_type="$yyy"
21634 : In case none of those worked, prompt the user.
21635 case "$netdb_host_type" in
21636 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21639 netdb_host_type=$ans
21640 rp='What is the type for the 2nd argument to gethostbyaddr?'
21643 netdb_hlen_type=$ans
21647 *) : no gethostbyaddr, so pick harmless defaults
21648 netdb_host_type='char *'
21649 netdb_hlen_type="$sizetype"
21652 # Remove the "const" if needed. -- but then we'll have a
21654 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21657 : check for type of argument to gethostbyname.
21658 if test "X$netdb_name_type" = X ; then
21659 case "$d_gethbyname" in
21663 Checking to see what type of argument is accepted by gethostbyname().
21665 hdrs="$define sys/types.h
21666 $d_socket sys/socket.h
21667 $i_niin netinet/in.h
21669 $i_unistd unistd.h"
21670 for xxx in "const char *" "char *"; do
21671 case "$netdb_name_type" in
21672 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21673 if ./protochk "$try" $hdrs; then
21674 echo "Your system accepts $xxx."
21675 netdb_name_type="$xxx"
21680 : In case none of those worked, prompt the user.
21681 case "$netdb_name_type" in
21682 '') rp='What is the type for the 1st argument to gethostbyname?'
21685 netdb_name_type=$ans
21689 *) : no gethostbyname, so pick harmless default
21690 netdb_name_type='char *'
21695 : check for type of 1st argument to getnetbyaddr.
21696 if test "X$netdb_net_type" = X ; then
21697 case "$d_getnbyaddr" in
21701 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21703 hdrs="$define sys/types.h
21704 $d_socket sys/socket.h
21705 $i_niin netinet/in.h
21707 $i_unistd unistd.h"
21708 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21709 case "$netdb_net_type" in
21710 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21711 if ./protochk "$try" $hdrs; then
21712 echo "Your system accepts $xxx."
21713 netdb_net_type="$xxx"
21718 : In case none of those worked, prompt the user.
21719 case "$netdb_net_type" in
21720 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21723 netdb_net_type=$ans
21727 *) : no getnetbyaddr, so pick harmless default
21728 netdb_net_type='long'
21732 : locate the preferred pager for this system
21739 [a-zA-Z]:/*) dflt=$pg;;
21743 [a-zA-Z]:/*) dflt=$more;;
21747 [a-zA-Z]:/*) dflt=$less;;
21750 '') dflt=/usr/ucb/more;;
21758 rp='What pager is used on your system?'
21762 : see if ar generates random libraries by itself
21764 echo "Checking how to generate random libraries on your machine..." >&4
21765 echo 'int bar1() { return bar2(); }' > bar1.c
21766 echo 'int bar2() { return 2; }' > bar2.c
21768 #$i_stdlib I_STDLIB
21770 #include <stdlib.h>
21772 int main() { printf("%d\n", bar1()); exit(0); }
21774 $cc $ccflags -c bar1.c >/dev/null 2>&1
21775 $cc $ccflags -c bar2.c >/dev/null 2>&1
21776 $cc $ccflags -c foo.c >/dev/null 2>&1
21777 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21778 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21779 $run ./foobar >/dev/null 2>&1; then
21780 echo "$ar appears to generate random libraries itself."
21782 if [ "X$ranlib" = "X" ]; then
21785 elif $ar s bar$_a >/dev/null 2>&1 &&
21786 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21787 $run ./foobar >/dev/null 2>&1; then
21788 echo "a table of contents needs to be added with '$ar s'."
21791 elif $ar ts bar$_a >/dev/null 2>&1 &&
21792 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21793 $run ./foobar >/dev/null 2>&1; then
21794 echo "a table of contents needs to be added with '$ar ts'."
21801 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21802 $test -f $ranlib || ranlib=''
21805 if $test -n "$ranlib"; then
21806 echo "your system has '$ranlib'; we'll use that."
21809 echo "your system doesn't seem to support random libraries"
21810 echo "so we'll use lorder and tsort to order the libraries."
21817 : see if this is a values.h system
21818 set values.h i_values
21821 : Check the max offset that gmtime and localtime accept
21822 echo "Checking max offsets that gmtime () accepts"
21825 define) yyy="#include <values.h>" ;;
21829 case "$sGMTIME_min/$sGMTIME_max" in
21832 #include <sys/types.h>
21841 void gm_check (time_t t, int min_year, int max_year)
21844 if ( tmp == NULL ||
21845 /* Check tm_year overflow */
21846 tmp->tm_year < min_year || tmp->tm_year > max_year)
21857 gm_check (MAXLONG, 69, 0x7fffffff);
21859 if (tmp == NULL || tmp->tm_year < 0) {
21860 for (i = 63; i >= 0; i--) {
21861 time_t x = pt | ((time_t)1 << i);
21862 if (x < 0 || x < pt) continue;
21863 gm_check (x, 69, 0x7fffffff);
21866 printf ("sGMTIME_max=%ld\n", pt);
21875 gm_check (MINLONG, -1900, 70);
21878 for (i = 36; i >= 0; i--) {
21879 time_t x = pt - ((time_t)1 << i);
21880 if (x > 0) continue;
21881 gm_check (x, -1900, 70);
21884 printf ("sGMTIME_min=%ld\n", pt);
21888 int main (int argc, char *argv[])
21890 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21897 if eval $compile; then
21898 eval `$run ./try 2>/dev/null`
21900 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21906 echo "Checking max offsets that localtime () accepts"
21908 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21911 #include <sys/types.h>
21920 void local_check (time_t t, int min_year, int max_year)
21922 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21925 tmp = localtime (&t);
21926 if ( tmp == NULL ||
21927 /* Check tm_year overflow */
21928 tmp->tm_year < min_year || tmp->tm_year > max_year)
21932 } /* local_check */
21939 local_check (MAXLONG, 69, 0x7fffffff);
21941 if (tmp == NULL || tmp->tm_year < 0) {
21942 for (i = 63; i >= 0; i--) {
21943 time_t x = pt | ((time_t)1 << i);
21944 if (x < 0 || x < pt) continue;
21945 local_check (x, 69, 0x7fffffff);
21948 printf ("sLOCALTIME_max=%ld\n", pt);
21957 local_check (MINLONG, -1900, 70);
21960 for (i = 36; i >= 0; i--) {
21961 time_t x = pt - ((time_t)1 << i);
21962 if (x > 0) continue;
21963 local_check (x, -1900, 70);
21966 printf ("sLOCALTIME_min=%ld\n", pt);
21970 int main (int argc, char *argv[])
21978 if eval $compile; then
21979 eval `$run ./try 2>/dev/null`
21981 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21987 : check for type of arguments to select.
21988 case "$selecttype" in
21989 '') case "$d_select" in
21993 Checking to see what type of arguments are accepted by select().
21995 hdrs="$define sys/types.h
21996 $i_systime sys/time.h
21997 $i_sysselct sys/select.h
21998 $d_socket sys/socket.h"
21999 : The first arg can be int, unsigned, or size_t
22000 : The last arg may or may not be 'const'
22002 : void pointer has been seen but using that
22003 : breaks the selectminbits test
22004 for xxx in 'fd_set *' 'int *'; do
22005 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22006 for tmo in 'struct timeval *' 'const struct timeval *'; do
22008 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22009 if ./protochk "$try" $hdrs; then
22010 echo "Your system accepts $xxx."
22019 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22020 case "$d_fd_set" in
22021 $define) dflt="fd_set *" ;;
22030 *) : no select, so pick a harmless default
22037 : check for the select 'width'
22038 case "$selectminbits" in
22039 '') safebits=`expr $ptrsize \* 8`
22040 case "$d_select" in
22044 Checking to see on how many bits at a time your select() operates...
22047 #include <sys/types.h>
22049 #$i_systime I_SYS_TIME
22050 #$i_systimek I_SYS_TIME_KERNEL
22055 # ifdef I_SYS_TIME_KERNEL
22058 # include <sys/time.h>
22059 # ifdef I_SYS_TIME_KERNEL
22063 #$i_sysselct I_SYS_SELECT
22064 #ifdef I_SYS_SELECT
22065 #include <sys/select.h>
22067 #$d_socket HAS_SOCKET
22069 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22072 #$i_stdlib I_STDLIB
22074 #include <stdlib.h>
22077 #define S sizeof(*(b))
22079 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22080 #define NBITS (NBYTES * 8)
22082 char *s = (char *)malloc(NBYTES);
22091 fp = fopen("try.c", "r");
22097 b = ($selecttype)s;
22098 for (i = 0; i < NBITS; i++)
22102 select(fd + 1, b, 0, 0, &t);
22103 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22105 printf("%d\n", i + 1);
22110 if eval $compile_ok; then
22111 selectminbits=`$run ./try 2>/dev/null`
22112 case "$selectminbits" in
22114 Cannot figure out on how many bits at a time your select() operates.
22115 I'll play safe and guess it is $safebits bits.
22117 selectminbits=$safebits
22118 bits="$safebits bits"
22121 *) bits="$selectminbits bits" ;;
22123 echo "Your select() operates on $bits at a time." >&4
22125 rp='What is the minimum number of bits your select() operates on?'
22126 case "$byteorder" in
22127 12345678) dflt=64 ;;
22133 selectminbits="$val"
22137 *) : no select, so pick a harmless default
22138 selectminbits=$safebits
22144 : Trace out the files included by signal.h, then look for SIGxxx names.
22145 case "$sig_num_init" in
22147 if [ "X$fieldn" = X ]; then
22148 : Just make some guesses. We check them later.
22149 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22151 xxx=`echo '#include <signal.h>' |
22152 $cppstdin $cppminus $cppflags 2>/dev/null |
22153 $grep '^[ ]*#.*include' |
22154 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22155 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22158 for xx in $xxx /dev/null ; do
22159 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22161 case "$xxxfiles" in
22162 '') xxxfiles=`./findhdr signal.h` ;;
22165 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22166 print substr($2, 4, 20)
22168 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22169 print substr($3, 4, 20)
22171 : Append some common names just in case the awk scan failed.
22172 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22173 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22174 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22175 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22176 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22178 : generate a few handy files for later
22179 $cat > signal.c <<EOCP
22180 #include <sys/types.h>
22181 #include <signal.h>
22182 #$i_stdlib I_STDLIB
22184 #include <stdlib.h>
22189 /* Strange style to avoid deeply-nested #if/#else/#endif */
22192 # define NSIG (_NSIG)
22198 # define NSIG (SIGMAX+1)
22204 # define NSIG (SIG_MAX+1)
22210 # define NSIG (_SIG_MAX+1)
22216 # define NSIG (MAXSIG+1)
22222 # define NSIG (MAX_SIG+1)
22227 # ifdef SIGARRAYSIZE
22228 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22234 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22238 /* Default to some arbitrary number that's big enough to get most
22239 of the common signals.
22245 printf("NSIG %d\n", NSIG);
22251 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22253 printf "#ifdef SIG"; printf $1; printf "\n"
22254 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22255 printf $1; printf ");\n"
22259 printf "#endif /* JUST_NSIG */\n";
22260 printf "exit(0);\n}\n";
22263 $cat >signal.awk <<'EOP'
22264 BEGIN { ndups = 0 }
22265 $1 ~ /^NSIG$/ { nsig = $2 }
22266 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22267 if ($2 > maxsig) { maxsig = $2 }
22268 if (sig_name[$2]) {
22269 dup_name[ndups] = $1
22270 dup_num[ndups] = $2
22282 printf("NSIG %d\n", nsig);
22283 for (n = 1; n < nsig; n++) {
22285 printf("%s %d\n", sig_name[n], sig_num[n])
22288 printf("NUM%d %d\n", n, n)
22291 for (n = 0; n < ndups; n++) {
22292 printf("%s %d\n", dup_name[n], dup_num[n])
22296 $cat >signal_cmd <<EOS
22298 if $test -s signal.lst; then
22299 echo "Using your existing signal.lst file"
22304 $cat >>signal_cmd <<'EOS'
22307 if eval $compile_ok; then
22308 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22309 $uniq | $awk -f signal.awk >signal.lst
22311 echo "(I can't seem be able to compile the whole test program)" >&4
22312 echo "(I'll try it in little pieces.)" >&4
22313 set signal -DJUST_NSIG
22314 if eval $compile_ok; then
22315 $run ./signal$_exe > signal.nsg
22318 echo "I can't seem to figure out how many signals you have." >&4
22319 echo "Guessing 50." >&4
22320 echo 'NSIG 50' > signal.nsg
22322 : Now look at all the signal names, one at a time.
22323 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22324 $cat > signal.c <<EOCP
22325 #include <sys/types.h>
22326 #include <signal.h>
22329 printf("$xx %d\n", SIG${xx});
22334 if eval $compile; then
22335 echo "SIG${xx} found."
22336 $run ./signal$_exe >> signal.ls1
22338 echo "SIG${xx} NOT found."
22341 if $test -s signal.ls1; then
22342 $cat signal.nsg signal.ls1 |
22343 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22347 if $test -s signal.lst; then
22350 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22351 echo 'kill -l' >signal
22352 set X `csh -f <signal`
22356 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22358 echo $@ | $tr ' ' $trnl | \
22359 $awk '{ printf "%s %d\n", $1, ++s; }
22360 END { printf "NSIG %d\n", ++s }' >signal.lst
22362 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22364 chmod a+x signal_cmd
22365 $eunicefix signal_cmd
22369 : generate list of signal names
22370 case "$sig_num_init" in
22373 case "$sig_name_init" in
22375 *) case "$sig_num_init" in
22376 ''|*,*) doinit=yes ;;
22381 echo "Generating a list of signal names and numbers..." >&4
22383 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22384 sig_name=`$awk 'BEGIN { printf "ZERO " }
22385 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22386 sig_num=`$awk 'BEGIN { printf "0 " }
22387 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22388 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22389 !/^NSIG/ { printf "\"%s\", ", $1 }
22390 END { printf "0\n" }' signal.lst`
22391 sig_num_init=`$awk 'BEGIN { printf "0, " }
22392 !/^NSIG/ { printf "%d, ", $2}
22393 END { printf "0\n"}' signal.lst`
22396 echo "The following $sig_count signals are available:"
22398 echo $sig_name | $awk \
22399 'BEGIN { linelen = 0 }
22401 for (i = 1; i <= NF; i++) {
22402 name = "SIG" $i " "
22403 linelen = linelen + length(name)
22404 if (linelen > 70) {
22406 linelen = length(name)
22412 sig_size=`echo $sig_name | awk '{print NF}'`
22413 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22417 : Check size of size
22419 case "$sizetype" in
22420 *_t) zzz="$sizetype" ;;
22421 *) zzz="filesize" ;;
22423 echo "Checking the size of $zzz..." >&4
22425 #include <sys/types.h>
22427 #$i_stdlib I_STDLIB
22429 #include <stdlib.h>
22432 printf("%d\n", (int)sizeof($sizetype));
22437 if eval $compile_ok; then
22441 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22444 echo "Your $zzz size is $sizesize bytes."
22449 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22453 : check for socklen_t
22455 echo "Checking to see if you have socklen_t..." >&4
22457 #include <sys/types.h>
22458 #$d_socket HAS_SOCKET
22460 #include <sys/socket.h>
22462 int main() { socklen_t x = 16; }
22465 if eval $compile; then
22467 echo "You have socklen_t."
22470 echo "You do not have socklen_t."
22471 case "$sizetype" in
22472 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22479 : see if this is a socks.h system
22480 set socks.h i_socks
22483 : check for type of the size argument to socket calls
22484 case "$d_socket" in
22488 Checking to see what type is the last argument of accept().
22491 case "$d_socklen_t" in
22492 "$define") yyy="$yyy socklen_t"
22494 yyy="$yyy $sizetype int long unsigned"
22495 for xxx in $yyy; do
22496 case "$socksizetype" in
22497 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22498 case "$usesocks" in
22500 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22501 echo "Your system accepts '$xxx *' for the last argument of accept()."
22502 socksizetype="$xxx"
22505 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22506 echo "Your system accepts '$xxx *' for the last argument of accept()."
22507 socksizetype="$xxx"
22514 : In case none of those worked, prompt the user.
22515 case "$socksizetype" in
22516 '') rp='What is the type for socket address structure sizes?'
22523 *) : no sockets, so pick relatively harmless default
22528 : see what type is used for signed size_t
22529 set ssize_t ssizetype int stdio.h sys/types.h
22534 #$i_stdlib I_STDLIB
22536 #include <stdlib.h>
22538 #include <sys/types.h>
22539 #define Size_t $sizetype
22540 #define SSize_t $dflt
22543 if (sizeof(Size_t) == sizeof(SSize_t))
22545 else if (sizeof(Size_t) == sizeof(int))
22554 if eval $compile_ok && $run ./try > /dev/null; then
22555 ssizetype=`$run ./try`
22556 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22559 Help! I can't compile and run the ssize_t test program: please enlighten me!
22560 (This is probably a misconfiguration in your system or libraries, and
22561 you really ought to fix it. Still, I'll try anyway.)
22563 I need a type that is the same size as $sizetype, but is guaranteed to
22564 be signed. Common values are ssize_t, int and long.
22567 rp="What signed type is the same size as $sizetype?"
22573 : Check the size of st_ino
22575 $echo "Checking the size of st_ino..." >&4
22576 $cat > try.c <<EOCP
22577 #include <sys/stat.h>
22579 #$i_stdlib I_STDLIB
22581 #include <stdlib.h>
22585 printf("%d\n", (int)sizeof(st.st_ino));
22590 if eval $compile_ok; then
22594 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22596 *) st_ino_size=$val
22597 $echo "Your st_ino is $st_ino_size bytes long."
22602 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22606 : Check if st_ino is signed
22608 $echo "Checking the sign of st_ino..." >&4
22609 $cat > try.c <<EOCP
22610 #include <sys/stat.h>
22615 if (foo.st_ino < 0)
22622 if eval $compile; then
22626 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22628 *) st_ino_sign=$val
22629 case "$st_ino_sign" in
22630 1) $echo "Your st_ino is unsigned." ;;
22631 -1) $echo "Your st_ino is signed." ;;
22637 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22641 : see what type of char stdio uses.
22643 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22644 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22645 echo "Your stdio uses unsigned chars." >&4
22646 stdchar="unsigned char"
22648 echo "Your stdio uses signed chars." >&4
22653 : Check size of UID
22656 *_t) zzz="$uidtype" ;;
22659 echo "Checking the size of $zzz..." >&4
22661 #include <sys/types.h>
22663 #$i_stdlib I_STDLIB
22665 #include <stdlib.h>
22668 printf("%d\n", (int)sizeof($uidtype));
22673 if eval $compile_ok; then
22677 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22680 echo "Your $zzz is $uidsize bytes long."
22685 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22688 : Check if UID is signed
22691 *_t) zzz="$uidtype" ;;
22694 echo "Checking the sign of $zzz..." >&4
22696 #include <sys/types.h>
22707 if eval $compile; then
22711 echo "(I can't execute the test program--guessing unsigned.)" >&4
22715 1) echo "Your $zzz is unsigned." ;;
22716 -1) echo "Your $zzz is signed." ;;
22722 echo "(I can't compile the test program--guessing unsigned.)" >&4
22726 : Check format string for UID
22728 $echo "Checking the format string to be used for uids..." >&4
22731 -1) if $test X"$uidsize" = X"$ivsize"; then
22732 uidformat="$ivdformat"
22734 if $test X"$uidsize" = X"$longsize"; then
22737 if $test X"$uidsize" = X"$intsize"; then
22740 if $test X"$uidsize" = X"$shortsize"; then
22747 *) if $test X"$uidsize" = X"$uvsize"; then
22748 uidformat="$uvuformat"
22750 if $test X"$uidsize" = X"$longsize"; then
22753 if $test X"$uidsize" = X"$intsize"; then
22756 if $test X"$uidsize" = X"$shortsize"; then
22765 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22767 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22768 $cat >try.c <<'EOM'
22769 /* Intentionally a long probe as I'd like to sanity check that the exact
22770 approach is going to work, as thinking it will work, but only having it
22771 part working at runtime is worse than not having it. */
22773 #include <sys/types.h>
22774 #include <sys/sysctl.h>
22775 #include <sys/param.h>
22777 #include <string.h>
22778 #include <stdlib.h>
22779 #include <unistd.h>
22782 main(int argc, char **argv) {
22784 char *argv_leaf = strrchr(argv[0], '/');
22790 mib[1] = KERN_PROC;
22791 mib[2] = KERN_PROC_PATHNAME;
22795 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22799 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22804 if (size < strlen(argv_leaf) + 1) {
22805 fprintf(stderr, "size %lu is too short for a path\n",
22806 (unsigned long) size);
22810 if (size > MAXPATHLEN * MAXPATHLEN) {
22811 fprintf(stderr, "size %lu is too long for a path\n",
22812 (unsigned long) size);
22816 buffer = malloc(size);
22822 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22827 if (strlen(buffer) + 1 != size) {
22828 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22829 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22834 if (*buffer != '/') {
22835 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22839 if (strstr(buffer, "/./")) {
22840 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22844 if (strstr(buffer, "/../")) {
22845 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22849 buffer_leaf = strrchr(buffer, '/');
22850 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22851 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22863 if eval $compile; then
22864 if $run ./try; then
22865 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22868 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22872 echo "I'm unable to compile the test program." >&4
22873 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22877 set usekernprocpathname
22880 : Determine if we can use _NSGetExecutablePath to find executing program
22882 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22883 $cat >try.c <<'EOM'
22884 /* Intentionally a long probe as I'd like to sanity check that the exact
22885 approach is going to work, as thinking it will work, but only having it
22886 part working at runtime is worse than not having it. */
22887 #include <mach-o/dyld.h>
22889 #include <stdlib.h>
22890 #include <sys/param.h>
22891 #include <string.h>
22894 main(int argc, char **argv) {
22896 uint32_t size = sizeof(buf);
22900 char *argv_leaf = strrchr(argv[0], '/');
22904 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22908 _NSGetExecutablePath(buf, &size);
22909 if (size > MAXPATHLEN * MAXPATHLEN) {
22910 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22911 (unsigned int) size);
22915 buffer = malloc(size);
22921 result = _NSGetExecutablePath(buffer, &size);
22923 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22924 result, (unsigned int) size);
22928 tidied = realpath(buffer, NULL);
22930 perror("realpath");
22936 if (*tidied != '/') {
22937 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22941 if (strstr(tidied, "/./")) {
22942 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22946 if (strstr(tidied, "/../")) {
22947 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22951 tidied_leaf = strrchr(tidied, '/');
22952 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22953 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22965 if eval $compile; then
22966 if $run ./try; then
22967 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22970 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22973 echo "I'm unable to compile the test program." >&4
22974 echo "I'll assume no _NSGetExecutablePath here." >&4
22977 set usensgetexecutablepath
22980 : Check if site customization support was requested
22981 case "$usesitecustomize" in
22982 $define|true|[Yy]*)
22983 usesitecustomize="$define"
22986 usesitecustomize="$undef"
22990 : see if prototypes support variable argument declarations
22992 case "$prototype$i_stdarg" in
22994 echo "It appears we'll be able to prototype varargs functions." >&4
22998 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23005 : determine compiler compiler
23014 if $test -f "$byacc$_exe"; then
23016 comp="byacc or $comp"
23018 if $test -f "$bison$_exe"; then
23019 comp="$comp or bison -y"
23021 rp="Which compiler compiler ($comp) shall I use?"
23030 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23036 : see if this is a assert.h system
23037 set assert.h i_assert
23040 : see if this is a bfd.h system
23044 : see if this is an execinfo.h system
23045 set execinfo.h i_execinfo
23048 : see if this is a fenv.h system
23052 : see if this is a fp.h system
23056 : see if this is a fp_class.h system
23057 set fp_class.h i_fp_class
23060 : see if gdbm.h is available
23065 : see if gdbm_open exists
23066 set gdbm_open d_gdbm_open
23068 case "$d_gdbm_open" in
23071 echo "We won't be including <gdbm.h>"
23080 : see if this is a ieeefp.h system
23081 case "$i_ieeefp" in
23082 '' ) set ieeefp.h i_ieeefp
23087 : see if this is a libutil.h system
23088 set libutil.h i_libutil
23091 : see if mach cthreads are available
23092 if test "X$usethreads" = "X$define"; then
23093 set mach/cthreads.h i_machcthr
23096 i_machcthr="$undef"
23099 : see if this is a mntent.h system
23100 set mntent.h i_mntent
23103 : see if net/errno.h is available
23105 set net/errno.h val
23108 : Unfortunately, it causes problems on some systems. Arrgh.
23111 cat > try.c <<'EOM'
23114 #include <net/errno.h>
23120 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23121 echo "We'll be including <net/errno.h>." >&4
23123 echo "We won't be including <net/errno.h>." >&4
23132 : see if netinet/tcp.h is available
23133 set netinet/tcp.h i_netinettcp
23136 : see if this is a poll.h system
23140 : see if this is a prot.h system
23144 : Preprocessor symbols
23146 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23147 $cat <<'EOSH' > Cppsym.know
23148 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23149 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23150 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23151 arch_pwr ardent ARM ARM32 atarist att386 att3b
23152 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23153 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23154 byteorder byte_order
23155 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23156 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23157 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23158 ELF encore EPI EXTENSIONS
23159 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23160 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23161 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23162 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23163 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23164 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23165 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23166 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23167 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23169 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23170 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23171 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23173 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23174 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23175 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23176 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23177 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23178 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23179 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23180 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23181 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23182 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23183 ns32000 ns32016 ns32332 ns32k nsc32000
23184 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23185 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23186 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23187 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23189 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23190 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23191 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23192 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23193 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23194 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23195 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23196 SYSV4 SYSV5 sysV68 sysV88
23197 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23198 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23199 tower32_800 tower32_850 tss
23200 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23201 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23202 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23203 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23204 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23205 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23207 vax venix VMESA vms
23208 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23209 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23212 # Maybe put other stuff here too.
23213 ./tr '-' '_' <<EOSH >>Cppsym.know
23216 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23217 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23218 $cat Cppsym.know > Cppsym.c
23219 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23220 $rm -f Cppsym.a Cppsym.b Cppsym.c
23221 cat <<EOSH > Cppsym
23223 if $test \$# -gt 0; then
23224 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23225 if $test -s Cppsym.got; then
23232 $tr " " "$trnl" | ./Cppsym.try
23238 cat <<EOSH > Cppsym.try
23240 cat <<'EOCP' > try.c
23243 #define STRINGIFY(a) "a"
23245 #if cpp_stuff == 42
23246 #define StGiFy(a) #a
23247 #define STRINGIFY(a) StGiFy(a)
23249 #if $cpp_stuff != 1 && $cpp_stuff != 42
23250 # include "Bletch: How does this C preprocessor stringify macros?"
23256 cat <<'EOSH' >> Cppsym.try
23258 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23259 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23260 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23261 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23263 echo 'return 0;}' >> try.c
23265 cat <<EOSH >> Cppsym.try
23267 case "$osname-$gccversion" in
23268 irix-) ccflags="\$ccflags -woff 1178" ;;
23269 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23271 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23273 chmod +x Cppsym.try
23274 $eunicefix Cppsym.try
23275 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23276 : Add in any Linux cpp "predefined macros":
23277 case "$osname::$gccversion" in
23278 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23280 rm -f $tHdrH'.h' $tHdrH
23282 # Filter out macro arguments, such as Linux's __INT8_C(c)
23283 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23284 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23285 if [ -s $tHdrH'_cppsym.real' ]; then
23286 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23289 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23292 : now check the C compiler for additional symbols
23293 postprocess_cc_v=''
23295 aix) postprocess_cc_v="|$tr , ' '" ;;
23302 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23305 -D*) echo "\$i" | $sed 's/^-D//';;
23306 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23311 postprocess_cc_v=''
23314 ./ccsym > ccsym1.raw
23315 if $test -s ccsym1.raw; then
23316 $sort ccsym1.raw | $uniq >ccsym.raw
23318 mv ccsym1.raw ccsym.raw
23321 $awk '/\=/ { print $0; next }
23322 { print $0"=1" }' ccsym.raw >ccsym.list
23323 $comm -13 Cppsym.true ccsym.list >ccsym.own
23324 $comm -12 Cppsym.true ccsym.list >ccsym.com
23325 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23327 if $test -z ccsym.raw; then
23328 echo "Your C compiler doesn't seem to define any symbols!" >&4
23330 echo "However, your C preprocessor defines the following symbols:"
23333 cppsymbols=`$cat Cppsym.true`
23334 cppsymbols=`echo $cppsymbols`
23335 cppccsymbols="$cppsymbols"
23337 if $test -s ccsym.com; then
23338 echo "Your C compiler and pre-processor define these symbols:"
23339 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23342 cppccsymbols=`$cat ccsym.com`
23343 cppccsymbols=`echo $cppccsymbols`
23344 $test "$silent" || sleep 1
23346 if $test -s ccsym.cpp; then
23347 $test "$also" && echo " "
23348 echo "Your C pre-processor ${also}defines the following symbols:"
23349 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23351 cppsymbols=`$cat ccsym.cpp`
23352 cppsymbols=`echo $cppsymbols`
23353 $test "$silent" || sleep 1
23355 if $test -s ccsym.own; then
23356 $test "$also" && echo " "
23357 echo "Your C compiler ${also}defines the following cpp symbols:"
23358 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23359 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23360 ccsymbols=`$cat ccsym.own`
23361 ccsymbols=`echo $ccsymbols`
23362 $test "$silent" || sleep 1
23366 : add -D_FORTIFY_SOURCE if feasible and not already there
23367 case "$gccversion" in
23368 [45].*) case "$optimize$ccflags" in
23369 *-O*) case "$ccflags$cppsymbols" in
23370 *_FORTIFY_SOURCE=*) # Don't add it again.
23371 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23373 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23374 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23378 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23382 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23386 : see if this is a termio system
23390 if $test `./findhdr termios.h`; then
23391 set tcsetattr i_termios
23397 "$define") echo "You have POSIX termios.h... good!" >&4;;
23398 *) if ./Cppsym pyr; then
23399 case "`$run /bin/universe`" in
23400 ucb) if $test `./findhdr sgtty.h`; then
23402 echo "<sgtty.h> found." >&4
23404 echo "System is pyramid with BSD universe."
23405 ./warn "<sgtty.h> not found--you could have problems."
23407 *) if $test `./findhdr termio.h`; then
23409 echo "<termio.h> found." >&4
23411 echo "System is pyramid with USG universe."
23412 ./warn "<termio.h> not found--you could have problems."
23416 if $test `./findhdr termio.h`; then
23417 echo "<termio.h> found." >&4
23419 elif $test `./findhdr sgtty.h`; then
23420 echo "<sgtty.h> found." >&4
23423 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23426 if $test `./findhdr sgtty.h`; then
23427 echo "<sgtty.h> found." >&4
23429 elif $test `./findhdr termio.h`; then
23430 echo "<termio.h> found." >&4
23433 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23437 set i_termio; eval $setvar
23438 val=$val2; set i_sgtty; eval $setvar
23439 val=$val3; set i_termios; eval $setvar
23441 : see if stdbool is available
23442 : we want a real compile instead of Inhdr because some Solaris systems
23443 : have stdbool.h, but it can only be used if the compiler indicates it
23444 : is sufficiently c99-compliant.
23448 #include <stdbool.h>
23453 int main(int argc, char **argv)
23459 if eval $compile; then
23460 echo "<stdbool.h> found." >&4
23463 echo "<stdbool.h> NOT found." >&4
23470 : see if stddef is available
23471 set stddef.h i_stddef
23474 : see if stdint is available
23475 set stdint.h i_stdint
23478 : see if sys/access.h is available
23479 set sys/access.h i_sysaccess
23482 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23483 set sys/filio.h i_sysfilio
23486 if $test `./findhdr sys/ioctl.h`; then
23488 echo '<sys/ioctl.h> found.' >&4
23491 if $test $i_sysfilio = "$define"; then
23492 echo '<sys/ioctl.h> NOT found.' >&4
23494 $test $i_sgtty = "$define" && xxx="sgtty.h"
23495 $test $i_termio = "$define" && xxx="termio.h"
23496 $test $i_termios = "$define" && xxx="termios.h"
23497 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23503 : see if socket ioctl defs are in sys/sockio.h
23505 xxx=`./findhdr sys/sockio.h`
23506 if $test "$xxx"; then
23507 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23509 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23512 echo "No socket ioctls found in <sys/sockio.h>." >&4
23517 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23523 : see if this is a syslog.h system
23524 set syslog.h i_syslog
23527 : see if this is a sys/mode.h system
23528 set sys/mode.h i_sysmode
23531 : see if there is a sys/poll.h file
23532 set sys/poll.h i_syspoll
23535 : see if sys/resource.h has to be included
23536 set sys/resource.h i_sysresrc
23539 : see if sys/security.h is available
23540 set sys/security.h i_syssecrt
23543 : see if this is a sys/statvfs.h system
23544 set sys/statvfs.h i_sysstatvfs
23547 : see if this is a sys/un.h system
23548 set sys/un.h i_sysun
23551 : see if this is a sys/utsname.h system
23552 set sys/utsname.h i_sysutsname
23555 : see if this is a syswait system
23556 set sys/wait.h i_syswait
23559 : see if this is a ustat.h system
23560 set ustat.h i_ustat
23563 : see if this is an utime system
23564 set utime.h i_utime
23567 : see if this is a vfork system
23570 set vfork.h i_vfork
23580 echo "Looking for extensions..." >&4
23581 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23582 : contain old or inaccurate or duplicate values.
23583 nonxs_extensions=''
23585 : We do not use find because it might not be available.
23586 : We do not just use MANIFEST because the user may have dropped
23587 : some additional extensions into the source tree and expect them
23590 : Function to recursively find available extensions, ignoring DynaLoader
23591 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23592 : In 5.10.1 and later, extensions are stored in directories
23593 : like File-Glob instead of the older File/Glob/.
23597 DynaLoader|dynaload) ;;
23599 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23600 case "$this_ext" in
23601 Scalar/List/Utils) this_ext="List/Util" ;;
23602 PathTools) this_ext="Cwd" ;;
23604 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23605 if $contains " $this_ext " "$tdir/$$.tmp"; then
23607 echo "Duplicate directories detected for extension $xxx" >&4;
23608 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23609 case "$knowitall" in
23617 echo "Ok. Stopping Configure." >&4;
23618 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23621 echo "Ok. You will need to correct config.sh before running make." >&4;
23623 $ls -1 "$xxx" > "$tdir/$$.tmp";
23624 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23625 xs_extensions="$xs_extensions $this_ext";
23626 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23627 xs_extensions="$xs_extensions $this_ext";
23628 elif $test -d "$xxx"; then
23629 nonxs_extensions="$nonxs_extensions $this_ext";
23631 $rm -f "$tdir/$$.tmp";
23639 eval $find_extensions
23643 eval $find_extensions
23647 eval $find_extensions
23648 set X $xs_extensions
23650 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23651 set X $nonxs_extensions
23653 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23655 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23657 : Now see which are supported on this system.
23659 for xxx in $xs_extensions ; do
23663 amigaos) avail_ext="$avail_ext $xxx" ;;
23668 $define) avail_ext="$avail_ext $xxx" ;;
23671 GDBM_File|gdbm_fil)
23673 $define) avail_ext="$avail_ext $xxx" ;;
23676 I18N/Langinfo|i18n_lan)
23677 case "$i_langinfo$d_nl_langinfo" in
23678 $define$define) avail_ext="$avail_ext $xxx" ;;
23682 : XXX Do we need a useipcsysv variable here
23683 case "${d_msg}${d_sem}${d_shm}" in
23684 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23687 NDBM_File|ndbm_fil)
23690 case "$osname-$use64bitint" in
23693 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23696 *) avail_ext="$avail_ext $xxx" ;;
23701 ODBM_File|odbm_fil)
23702 case "${i_dbm}${i_rpcsvcdbm}" in
23704 case "$d_cplusplus" in
23705 define) ;; # delete as a function name will not work
23706 *) case "$osname-$use64bitint" in
23709 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23712 *) avail_ext="$avail_ext $xxx" ;;
23720 case "$useopcode" in
23721 true|define|y) avail_ext="$avail_ext $xxx" ;;
23725 case "$useposix" in
23726 true|define|y) avail_ext="$avail_ext $xxx" ;;
23730 case "$d_socket" in
23731 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23734 Sys/Syslog|sys/syslog)
23736 amigaos) ;; # not really very useful on AmigaOS
23738 : XXX syslog requires socket
23739 case "$d_socket" in
23740 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23746 case "$usethreads" in
23748 case "$use5005threads" in
23749 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23753 threads|threads/shared)
23754 # threads and threads::shared are special cases.
23755 # To stop people from asking "Perl 5.8.0 was supposed
23756 # to have this new fancy threads implementation but my
23757 # perl doesn't have it" and from people trying to
23758 # (re)install the threads module using CPAN.pm and
23759 # CPAN.pm then offering to reinstall Perl 5.8.0,
23760 # the threads.pm and threads/shared.pm will always be
23761 # there, croaking informatively ("you need to rebuild
23762 # all of Perl with threads, sorry") when threads haven't
23763 # been compiled in.
23765 avail_ext="$avail_ext $xxx"
23771 cygwin) avail_ext="$avail_ext $xxx" ;;
23774 XS/APItest|xs/apitest)
23775 # This is just for testing. Skip it unless we have dynamic loading.
23778 $define) avail_ext="$avail_ext $xxx" ;;
23781 XS/Typemap|xs/typemap)
23782 # This is just for testing. Skip it unless we have dynamic loading.
23784 $define) avail_ext="$avail_ext $xxx" ;;
23787 *) avail_ext="$avail_ext $xxx"
23796 case "$onlyextensions" in
23798 *) keepextensions=''
23799 echo "You have requested that only certain extensions be included..." >&4
23800 for i in $onlyextensions; do
23801 case " $avail_ext " in
23803 echo "Keeping extension $i."
23804 keepextensions="$keepextensions $i"
23806 *) echo "Ignoring extension $i." ;;
23809 avail_ext="$keepextensions"
23813 case "$noextensions" in
23815 *) keepextensions=''
23816 echo "You have requested that certain extensions be ignored..." >&4
23817 for i in $avail_ext; do
23818 case " $noextensions " in
23819 *" $i "*) echo "Ignoring extension $i." ;;
23820 *) echo "Keeping extension $i.";
23821 keepextensions="$keepextensions $i"
23825 avail_ext="$keepextensions"
23829 : Now see which nonxs extensions are supported on this system.
23830 : For now assume all are.
23832 for xxx in $nonxs_extensions ; do
23836 *) nonxs_ext="$nonxs_ext $xxx"
23848 A number of extensions are supplied with $package. You may choose to
23849 compile these extensions for dynamic loading (the default), compile
23850 them into the $package executable (static loading), or not include
23851 them at all. Answer "none" to include no extensions.
23852 Note that DynaLoader is always built and need not be mentioned here.
23855 case "$dynamic_ext" in
23857 : Exclude those listed in static_ext
23859 for xxx in $avail_ext; do
23860 case " $static_ext " in
23862 *) dflt="$dflt $xxx" ;;
23869 *) dflt="$dynamic_ext"
23870 # Perhaps we are reusing an old out-of-date config.sh.
23873 if test X"$dynamic_ext" != X"$avail_ext"; then
23875 NOTICE: Your previous config.sh list may be incorrect.
23876 The extensions now available to you are
23878 but the default list from your previous config.sh is
23890 rp="What extensions do you wish to load dynamically?"
23893 none) dynamic_ext=' ' ;;
23894 *) dynamic_ext="$ans" ;;
23897 case "$static_ext" in
23899 : Exclude those already listed in dynamic linking
23901 for xxx in $avail_ext; do
23902 case " $dynamic_ext " in
23904 *) dflt="$dflt $xxx" ;;
23911 *) dflt="$static_ext"
23918 rp="What extensions do you wish to load statically?"
23921 none) static_ext=' ' ;;
23922 *) static_ext="$ans" ;;
23927 A number of extensions are supplied with $package. Answer "none"
23928 to include no extensions.
23929 Note that DynaLoader is always built and need not be mentioned here.
23932 case "$static_ext" in
23933 '') dflt="$avail_ext" ;;
23934 *) dflt="$static_ext"
23935 # Perhaps we are reusing an old out-of-date config.sh.
23938 if test X"$static_ext" != X"$avail_ext"; then
23940 NOTICE: Your previous config.sh list may be incorrect.
23941 The extensions now available to you are
23943 but the default list from your previous config.sh is
23952 : Exclude those that are not xs extensions
23956 rp="What extensions do you wish to include?"
23959 none) static_ext=' ' ;;
23960 *) static_ext="$ans" ;;
23965 # Encode is a special case. If we are building Encode as a static
23966 # extension, we need to explicitly list its subextensions as well.
23967 # For other nested extensions, this is handled automatically by
23968 # the appropriate Makefile.PL.
23969 case " $static_ext " in
23970 *" Encode "*) # Add the subextensions of Encode
23972 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23973 static_ext="$static_ext Encode/$xxx"
23974 known_extensions="$known_extensions Encode/$xxx"
23980 set X $dynamic_ext $static_ext $nonxs_ext
23984 # Sanity check: We require an extension suitable for use with
23985 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23986 # should show up as failures in the test suite, but it's helpful to
23987 # catch them now.) The 'extensions' list is normally sorted
23988 # alphabetically, so we need to accept either
23989 # DB_File ... Fcntl ... IO ....
23990 # or something like
23991 # Fcntl ... NDBM_File ... IO ....
23992 case " $extensions" in
23993 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23994 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23995 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23996 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23997 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24001 : Remove libraries needed only for extensions
24002 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24003 : The exception is SunOS 4.x, which needs them.
24004 case "${osname}X${osvers}" in
24008 *) case "$usedl" in
24009 $define|true|[yY]*)
24010 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24014 *) perllibs="$libs"
24020 : Remove build directory name from cppstdin so it can be used from
24021 : either the present location or the final installed location.
24023 : Get out of the UU directory to get correct path name.
24025 case "$cppstdin" in
24027 echo "Stripping down cppstdin path name"
24033 : end of configuration questions
24035 echo "End of configuration questions."
24038 : back to where it started
24039 if test -d ../UU; then
24043 : configuration may be unconditionally patched via a 'config.arch' file
24044 if $test -f config.arch; then
24045 echo "I see a config.arch file, loading it." >&4
24049 : configuration may be patched via a 'config.over' file
24050 if $test -f config.over; then
24053 rp='I see a config.over file. Do you wish to load it?'
24056 n*) echo "OK, I'll ignore it.";;
24058 echo "Configuration override changes have been loaded."
24063 : in case they want portability, strip down executable paths
24064 case "$d_portable" in
24067 echo "Stripping down executable paths..." >&4
24068 for file in $loclist $trylist; do
24070 eval $file=`basename $temp`
24075 : create config.sh file
24077 echo "Creating config.sh..." >&4
24078 $spitshell <<EOT >config.sh
24081 # This file was produced by running the Configure script. It holds all the
24082 # definitions figured out by Configure. Should you modify one of these values,
24083 # do not forget to propagate your changes by running "Configure -der". You may
24084 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24087 # Package name : $package
24088 # Source directory : $src
24089 # Configuration time: $cf_time
24090 # Configured by : $cf_by
24091 # Target system : $myuname
24094 : Add in command line options if available
24095 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24097 $spitshell <<EOT >>config.sh
24106 Revision='$Revision'
24114 alignbytes='$alignbytes'
24115 ansi2knr='$ansi2knr'
24116 aphostname='$aphostname'
24117 api_revision='$api_revision'
24118 api_subversion='$api_subversion'
24119 api_version='$api_version'
24120 api_versionstring='$api_versionstring'
24123 archlibexp='$archlibexp'
24124 archname64='$archname64'
24125 archname='$archname'
24126 archobjs='$archobjs'
24127 asctime_r_proto='$asctime_r_proto'
24136 byteorder='$byteorder'
24138 castflags='$castflags'
24141 cccdlflags='$cccdlflags'
24142 ccdlflags='$ccdlflags'
24144 ccflags_uselargefiles='$ccflags_uselargefiles'
24146 ccsymbols='$ccsymbols'
24147 ccversion='$ccversion'
24149 cf_email='$cf_email'
24151 charbits='$charbits'
24152 charsize='$charsize'
24156 clocktype='$clocktype'
24158 compress='$compress'
24159 contains='$contains'
24163 cpp_stuff='$cpp_stuff'
24164 cppccsymbols='$cppccsymbols'
24165 cppflags='$cppflags'
24167 cppminus='$cppminus'
24169 cppstdin='$cppstdin'
24170 cppsymbols='$cppsymbols'
24171 crypt_r_proto='$crypt_r_proto'
24172 cryptlib='$cryptlib'
24174 ctermid_r_proto='$ctermid_r_proto'
24175 ctime_r_proto='$ctime_r_proto'
24176 d_Gconvert='$d_Gconvert'
24177 d_PRIEUldbl='$d_PRIEUldbl'
24178 d_PRIFUldbl='$d_PRIFUldbl'
24179 d_PRIGUldbl='$d_PRIGUldbl'
24180 d_PRIXU64='$d_PRIXU64'
24181 d_PRId64='$d_PRId64'
24182 d_PRIeldbl='$d_PRIeldbl'
24183 d_PRIfldbl='$d_PRIfldbl'
24184 d_PRIgldbl='$d_PRIgldbl'
24185 d_PRIi64='$d_PRIi64'
24186 d_PRIo64='$d_PRIo64'
24187 d_PRIu64='$d_PRIu64'
24188 d_PRIx64='$d_PRIx64'
24189 d_SCNfldbl='$d_SCNfldbl'
24190 d__fwalk='$d__fwalk'
24191 d_access='$d_access'
24192 d_accessx='$d_accessx'
24196 d_archlib='$d_archlib'
24197 d_asctime64='$d_asctime64'
24198 d_asctime_r='$d_asctime_r'
24203 d_attribute_deprecated='$d_attribute_deprecated'
24204 d_attribute_format='$d_attribute_format'
24205 d_attribute_malloc='$d_attribute_malloc'
24206 d_attribute_nonnull='$d_attribute_nonnull'
24207 d_attribute_noreturn='$d_attribute_noreturn'
24208 d_attribute_pure='$d_attribute_pure'
24209 d_attribute_unused='$d_attribute_unused'
24210 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24211 d_backtrace='$d_backtrace'
24215 d_bsdgetpgrp='$d_bsdgetpgrp'
24216 d_bsdsetpgrp='$d_bsdsetpgrp'
24217 d_builtin_choose_expr='$d_builtin_choose_expr'
24218 d_builtin_expect='$d_builtin_expect'
24220 d_c99_variadic_macros='$d_c99_variadic_macros'
24221 d_casti32='$d_casti32'
24222 d_castneg='$d_castneg'
24224 d_charvspr='$d_charvspr'
24226 d_chroot='$d_chroot'
24227 d_chsize='$d_chsize'
24229 d_clearenv='$d_clearenv'
24230 d_closedir='$d_closedir'
24231 d_cmsghdr_s='$d_cmsghdr_s'
24233 d_copysign='$d_copysign'
24234 d_copysignl='$d_copysignl'
24235 d_cplusplus='$d_cplusplus'
24237 d_crypt_r='$d_crypt_r'
24239 d_ctermid='$d_ctermid'
24240 d_ctermid_r='$d_ctermid_r'
24241 d_ctime64='$d_ctime64'
24242 d_ctime_r='$d_ctime_r'
24243 d_cuserid='$d_cuserid'
24244 d_dbl_dig='$d_dbl_dig'
24245 d_dbminitproto='$d_dbminitproto'
24246 d_difftime64='$d_difftime64'
24247 d_difftime='$d_difftime'
24248 d_dir_dd_fd='$d_dir_dd_fd'
24250 d_dirnamlen='$d_dirnamlen'
24251 d_dladdr='$d_dladdr'
24252 d_dlerror='$d_dlerror'
24253 d_dlopen='$d_dlopen'
24254 d_dlsymun='$d_dlsymun'
24255 d_dosuid='$d_dosuid'
24256 d_drand48_r='$d_drand48_r'
24257 d_drand48proto='$d_drand48proto'
24259 d_duplocale='$d_duplocale'
24260 d_eaccess='$d_eaccess'
24261 d_endgrent='$d_endgrent'
24262 d_endgrent_r='$d_endgrent_r'
24263 d_endhent='$d_endhent'
24264 d_endhostent_r='$d_endhostent_r'
24265 d_endnent='$d_endnent'
24266 d_endnetent_r='$d_endnetent_r'
24267 d_endpent='$d_endpent'
24268 d_endprotoent_r='$d_endprotoent_r'
24269 d_endpwent='$d_endpwent'
24270 d_endpwent_r='$d_endpwent_r'
24271 d_endsent='$d_endsent'
24272 d_endservent_r='$d_endservent_r'
24273 d_eofnblk='$d_eofnblk'
24276 d_eunice='$d_eunice'
24279 d_faststdio='$d_faststdio'
24280 d_fchdir='$d_fchdir'
24281 d_fchmod='$d_fchmod'
24282 d_fchown='$d_fchown'
24284 d_fcntl_can_lock='$d_fcntl_can_lock'
24285 d_fd_macros='$d_fd_macros'
24286 d_fd_set='$d_fd_set'
24287 d_fdclose='$d_fdclose'
24289 d_fds_bits='$d_fds_bits'
24290 d_fegetround='$d_fegetround'
24291 d_fgetpos='$d_fgetpos'
24292 d_finite='$d_finite'
24293 d_finitel='$d_finitel'
24294 d_flexfnam='$d_flexfnam'
24296 d_flockproto='$d_flockproto'
24301 d_fp_class='$d_fp_class'
24302 d_fp_classify='$d_fp_classify'
24303 d_fp_classl='$d_fp_classl'
24304 d_fpathconf='$d_fpathconf'
24305 d_fpclass='$d_fpclass'
24306 d_fpclassify='$d_fpclassify'
24307 d_fpclassl='$d_fpclassl'
24308 d_fpgetround='$d_fpgetround'
24309 d_fpos64_t='$d_fpos64_t'
24310 d_freelocale='$d_freelocale'
24311 d_frexpl='$d_frexpl'
24312 d_fs_data_s='$d_fs_data_s'
24313 d_fseeko='$d_fseeko'
24314 d_fsetpos='$d_fsetpos'
24315 d_fstatfs='$d_fstatfs'
24316 d_fstatvfs='$d_fstatvfs'
24318 d_ftello='$d_ftello'
24320 d_futimes='$d_futimes'
24321 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24322 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24323 d_getaddrinfo='$d_getaddrinfo'
24324 d_getcwd='$d_getcwd'
24325 d_getespwnam='$d_getespwnam'
24326 d_getfsstat='$d_getfsstat'
24327 d_getgrent='$d_getgrent'
24328 d_getgrent_r='$d_getgrent_r'
24329 d_getgrgid_r='$d_getgrgid_r'
24330 d_getgrnam_r='$d_getgrnam_r'
24331 d_getgrps='$d_getgrps'
24332 d_gethbyaddr='$d_gethbyaddr'
24333 d_gethbyname='$d_gethbyname'
24334 d_gethent='$d_gethent'
24335 d_gethname='$d_gethname'
24336 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24337 d_gethostbyname_r='$d_gethostbyname_r'
24338 d_gethostent_r='$d_gethostent_r'
24339 d_gethostprotos='$d_gethostprotos'
24340 d_getitimer='$d_getitimer'
24341 d_getlogin='$d_getlogin'
24342 d_getlogin_r='$d_getlogin_r'
24343 d_getmnt='$d_getmnt'
24344 d_getmntent='$d_getmntent'
24345 d_getnameinfo='$d_getnameinfo'
24346 d_getnbyaddr='$d_getnbyaddr'
24347 d_getnbyname='$d_getnbyname'
24348 d_getnent='$d_getnent'
24349 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24350 d_getnetbyname_r='$d_getnetbyname_r'
24351 d_getnetent_r='$d_getnetent_r'
24352 d_getnetprotos='$d_getnetprotos'
24353 d_getpagsz='$d_getpagsz'
24354 d_getpbyname='$d_getpbyname'
24355 d_getpbynumber='$d_getpbynumber'
24356 d_getpent='$d_getpent'
24357 d_getpgid='$d_getpgid'
24358 d_getpgrp2='$d_getpgrp2'
24359 d_getpgrp='$d_getpgrp'
24360 d_getppid='$d_getppid'
24361 d_getprior='$d_getprior'
24362 d_getprotobyname_r='$d_getprotobyname_r'
24363 d_getprotobynumber_r='$d_getprotobynumber_r'
24364 d_getprotoent_r='$d_getprotoent_r'
24365 d_getprotoprotos='$d_getprotoprotos'
24366 d_getprpwnam='$d_getprpwnam'
24367 d_getpwent='$d_getpwent'
24368 d_getpwent_r='$d_getpwent_r'
24369 d_getpwnam_r='$d_getpwnam_r'
24370 d_getpwuid_r='$d_getpwuid_r'
24371 d_getsbyname='$d_getsbyname'
24372 d_getsbyport='$d_getsbyport'
24373 d_getsent='$d_getsent'
24374 d_getservbyname_r='$d_getservbyname_r'
24375 d_getservbyport_r='$d_getservbyport_r'
24376 d_getservent_r='$d_getservent_r'
24377 d_getservprotos='$d_getservprotos'
24378 d_getspnam='$d_getspnam'
24379 d_getspnam_r='$d_getspnam_r'
24380 d_gettimeod='$d_gettimeod'
24381 d_gmtime64='$d_gmtime64'
24382 d_gmtime_r='$d_gmtime_r'
24383 d_gnulibc='$d_gnulibc'
24384 d_grpasswd='$d_grpasswd'
24385 d_hasmntopt='$d_hasmntopt'
24389 d_ilogbl='$d_ilogbl'
24390 d_inc_version_list='$d_inc_version_list'
24392 d_inetaton='$d_inetaton'
24393 d_inetntop='$d_inetntop'
24394 d_inetpton='$d_inetpton'
24395 d_int64_t='$d_int64_t'
24396 d_ip_mreq='$d_ip_mreq'
24397 d_ip_mreq_source='$d_ip_mreq_source'
24398 d_ipv6_mreq='$d_ipv6_mreq'
24399 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24400 d_isascii='$d_isascii'
24401 d_isblank='$d_isblank'
24402 d_isfinite='$d_isfinite'
24403 d_isfinitel='$d_isfinitel'
24405 d_isinfl='$d_isinfl'
24406 d_isless='$d_isless'
24408 d_isnanl='$d_isnanl'
24409 d_isnormal='$d_isnormal'
24412 d_killpg='$d_killpg'
24413 d_lc_monetary_2008='$d_lc_monetary_2008'
24414 d_lchown='$d_lchown'
24415 d_ldbl_dig='$d_ldbl_dig'
24416 d_ldexpl='$d_ldexpl'
24417 d_lgamma='$d_lgamma'
24418 d_lgamma_r='$d_lgamma_r'
24419 d_libm_lib_version='$d_libm_lib_version'
24420 d_libname_unique='$d_libname_unique'
24422 d_llrint='$d_llrint'
24423 d_llrintl='$d_llrintl'
24424 d_llround='$d_llround'
24425 d_llroundl='$d_llroundl'
24426 d_localtime64='$d_localtime64'
24427 d_localtime_r='$d_localtime_r'
24428 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24429 d_locconv='$d_locconv'
24434 d_longdbl='$d_longdbl'
24435 d_longlong='$d_longlong'
24437 d_lrintl='$d_lrintl'
24438 d_lround='$d_lround'
24439 d_lroundl='$d_lroundl'
24440 d_lseekproto='$d_lseekproto'
24442 d_madvise='$d_madvise'
24443 d_malloc_good_size='$d_malloc_good_size'
24444 d_malloc_size='$d_malloc_size'
24446 d_mbstowcs='$d_mbstowcs'
24447 d_mbtowc='$d_mbtowc'
24448 d_memchr='$d_memchr'
24449 d_memcmp='$d_memcmp'
24450 d_memcpy='$d_memcpy'
24451 d_memmem='$d_memmem'
24452 d_memmove='$d_memmove'
24453 d_memset='$d_memset'
24455 d_mkdtemp='$d_mkdtemp'
24456 d_mkfifo='$d_mkfifo'
24457 d_mkstemp='$d_mkstemp'
24458 d_mkstemps='$d_mkstemps'
24459 d_mktime64='$d_mktime64'
24460 d_mktime='$d_mktime'
24463 d_modflproto='$d_modflproto'
24464 d_mprotect='$d_mprotect'
24466 d_msg_ctrunc='$d_msg_ctrunc'
24467 d_msg_dontroute='$d_msg_dontroute'
24468 d_msg_oob='$d_msg_oob'
24469 d_msg_peek='$d_msg_peek'
24470 d_msg_proxy='$d_msg_proxy'
24471 d_msgctl='$d_msgctl'
24472 d_msgget='$d_msgget'
24473 d_msghdr_s='$d_msghdr_s'
24474 d_msgrcv='$d_msgrcv'
24475 d_msgsnd='$d_msgsnd'
24477 d_munmap='$d_munmap'
24478 d_mymalloc='$d_mymalloc'
24481 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24482 d_nearbyint='$d_nearbyint'
24483 d_newlocale='$d_newlocale'
24484 d_nextafter='$d_nextafter'
24485 d_nexttoward='$d_nexttoward'
24487 d_nl_langinfo='$d_nl_langinfo'
24488 d_nv_preserves_uv='$d_nv_preserves_uv'
24489 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24490 d_off64_t='$d_off64_t'
24491 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24492 d_oldpthreads='$d_oldpthreads'
24493 d_oldsock='$d_oldsock'
24495 d_pathconf='$d_pathconf'
24497 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24498 d_phostname='$d_phostname'
24501 d_portable='$d_portable'
24503 d_prctl_set_name='$d_prctl_set_name'
24504 d_printf_format_null='$d_printf_format_null'
24505 d_procselfexe='$d_procselfexe'
24506 d_pseudofork='$d_pseudofork'
24507 d_pthread_atfork='$d_pthread_atfork'
24508 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24509 d_pthread_yield='$d_pthread_yield'
24510 d_ptrdiff_t='$d_ptrdiff_t'
24512 d_pwchange='$d_pwchange'
24513 d_pwclass='$d_pwclass'
24514 d_pwcomment='$d_pwcomment'
24515 d_pwexpire='$d_pwexpire'
24516 d_pwgecos='$d_pwgecos'
24517 d_pwpasswd='$d_pwpasswd'
24518 d_pwquota='$d_pwquota'
24521 d_random_r='$d_random_r'
24522 d_re_comp='$d_re_comp'
24523 d_readdir64_r='$d_readdir64_r'
24524 d_readdir='$d_readdir'
24525 d_readdir_r='$d_readdir_r'
24526 d_readlink='$d_readlink'
24528 d_recvmsg='$d_recvmsg'
24529 d_regcmp='$d_regcmp'
24530 d_regcomp='$d_regcomp'
24531 d_remainder='$d_remainder'
24532 d_remquo='$d_remquo'
24533 d_rename='$d_rename'
24534 d_rewinddir='$d_rewinddir'
24538 d_safebcpy='$d_safebcpy'
24539 d_safemcpy='$d_safemcpy'
24540 d_sanemcmp='$d_sanemcmp'
24541 d_sbrkproto='$d_sbrkproto'
24542 d_scalbn='$d_scalbn'
24543 d_scalbnl='$d_scalbnl'
24544 d_sched_yield='$d_sched_yield'
24545 d_scm_rights='$d_scm_rights'
24546 d_seekdir='$d_seekdir'
24547 d_select='$d_select'
24549 d_semctl='$d_semctl'
24550 d_semctl_semid_ds='$d_semctl_semid_ds'
24551 d_semctl_semun='$d_semctl_semun'
24552 d_semget='$d_semget'
24554 d_sendmsg='$d_sendmsg'
24555 d_setegid='$d_setegid'
24556 d_seteuid='$d_seteuid'
24557 d_setgrent='$d_setgrent'
24558 d_setgrent_r='$d_setgrent_r'
24559 d_setgrps='$d_setgrps'
24560 d_sethent='$d_sethent'
24561 d_sethostent_r='$d_sethostent_r'
24562 d_setitimer='$d_setitimer'
24563 d_setlinebuf='$d_setlinebuf'
24564 d_setlocale='$d_setlocale'
24565 d_setlocale_r='$d_setlocale_r'
24566 d_setnent='$d_setnent'
24567 d_setnetent_r='$d_setnetent_r'
24568 d_setpent='$d_setpent'
24569 d_setpgid='$d_setpgid'
24570 d_setpgrp2='$d_setpgrp2'
24571 d_setpgrp='$d_setpgrp'
24572 d_setprior='$d_setprior'
24573 d_setproctitle='$d_setproctitle'
24574 d_setprotoent_r='$d_setprotoent_r'
24575 d_setpwent='$d_setpwent'
24576 d_setpwent_r='$d_setpwent_r'
24577 d_setregid='$d_setregid'
24578 d_setresgid='$d_setresgid'
24579 d_setresuid='$d_setresuid'
24580 d_setreuid='$d_setreuid'
24581 d_setrgid='$d_setrgid'
24582 d_setruid='$d_setruid'
24583 d_setsent='$d_setsent'
24584 d_setservent_r='$d_setservent_r'
24585 d_setsid='$d_setsid'
24586 d_setvbuf='$d_setvbuf'
24589 d_shmatprototype='$d_shmatprototype'
24590 d_shmctl='$d_shmctl'
24592 d_shmget='$d_shmget'
24593 d_sigaction='$d_sigaction'
24594 d_siginfo_si_addr='$d_siginfo_si_addr'
24595 d_siginfo_si_band='$d_siginfo_si_band'
24596 d_siginfo_si_errno='$d_siginfo_si_errno'
24597 d_siginfo_si_fd='$d_siginfo_si_fd'
24598 d_siginfo_si_pid='$d_siginfo_si_pid'
24599 d_siginfo_si_status='$d_siginfo_si_status'
24600 d_siginfo_si_uid='$d_siginfo_si_uid'
24601 d_siginfo_si_value='$d_siginfo_si_value'
24602 d_signbit='$d_signbit'
24603 d_sigprocmask='$d_sigprocmask'
24604 d_sigsetjmp='$d_sigsetjmp'
24605 d_sin6_scope_id='$d_sin6_scope_id'
24606 d_sitearch='$d_sitearch'
24607 d_snprintf='$d_snprintf'
24608 d_sockaddr_in6='$d_sockaddr_in6'
24609 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24610 d_sockatmark='$d_sockatmark'
24611 d_sockatmarkproto='$d_sockatmarkproto'
24612 d_socket='$d_socket'
24613 d_socklen_t='$d_socklen_t'
24614 d_sockpair='$d_sockpair'
24615 d_socks5_init='$d_socks5_init'
24616 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24618 d_srand48_r='$d_srand48_r'
24619 d_srandom_r='$d_srandom_r'
24620 d_sresgproto='$d_sresgproto'
24621 d_sresuproto='$d_sresuproto'
24623 d_statblks='$d_statblks'
24624 d_statfs_f_flags='$d_statfs_f_flags'
24625 d_statfs_s='$d_statfs_s'
24626 d_static_inline='$d_static_inline'
24627 d_statvfs='$d_statvfs'
24628 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24629 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24630 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24631 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24632 d_stdio_stream_array='$d_stdio_stream_array'
24633 d_stdiobase='$d_stdiobase'
24634 d_stdstdio='$d_stdstdio'
24635 d_strchr='$d_strchr'
24636 d_strcoll='$d_strcoll'
24637 d_strctcpy='$d_strctcpy'
24638 d_strerrm='$d_strerrm'
24639 d_strerror='$d_strerror'
24640 d_strerror_r='$d_strerror_r'
24641 d_strftime='$d_strftime'
24642 d_strlcat='$d_strlcat'
24643 d_strlcpy='$d_strlcpy'
24644 d_strtod='$d_strtod'
24645 d_strtol='$d_strtol'
24646 d_strtold='$d_strtold'
24647 d_strtoll='$d_strtoll'
24648 d_strtoq='$d_strtoq'
24649 d_strtoul='$d_strtoul'
24650 d_strtoull='$d_strtoull'
24651 d_strtouq='$d_strtouq'
24652 d_strxfrm='$d_strxfrm'
24653 d_suidsafe='$d_suidsafe'
24654 d_symlink='$d_symlink'
24655 d_syscall='$d_syscall'
24656 d_syscallproto='$d_syscallproto'
24657 d_sysconf='$d_sysconf'
24658 d_sysernlst='$d_sysernlst'
24659 d_syserrlst='$d_syserrlst'
24660 d_system='$d_system'
24661 d_tcgetpgrp='$d_tcgetpgrp'
24662 d_tcsetpgrp='$d_tcsetpgrp'
24663 d_telldir='$d_telldir'
24664 d_telldirproto='$d_telldirproto'
24665 d_tgamma='$d_tgamma'
24667 d_timegm='$d_timegm'
24669 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24670 d_tm_tm_zone='$d_tm_tm_zone'
24671 d_tmpnam_r='$d_tmpnam_r'
24673 d_truncate='$d_truncate'
24674 d_truncl='$d_truncl'
24675 d_ttyname_r='$d_ttyname_r'
24676 d_tzname='$d_tzname'
24677 d_u32align='$d_u32align'
24678 d_ualarm='$d_ualarm'
24681 d_union_semun='$d_union_semun'
24682 d_unordered='$d_unordered'
24683 d_unsetenv='$d_unsetenv'
24684 d_uselocale='$d_uselocale'
24685 d_usleep='$d_usleep'
24686 d_usleepproto='$d_usleepproto'
24688 d_vendorarch='$d_vendorarch'
24689 d_vendorbin='$d_vendorbin'
24690 d_vendorlib='$d_vendorlib'
24691 d_vendorscript='$d_vendorscript'
24693 d_void_closedir='$d_void_closedir'
24694 d_voidsig='$d_voidsig'
24695 d_voidtty='$d_voidtty'
24696 d_volatile='$d_volatile'
24697 d_vprintf='$d_vprintf'
24698 d_vsnprintf='$d_vsnprintf'
24700 d_waitpid='$d_waitpid'
24701 d_wcscmp='$d_wcscmp'
24702 d_wcstombs='$d_wcstombs'
24703 d_wcsxfrm='$d_wcsxfrm'
24704 d_wctomb='$d_wctomb'
24705 d_writev='$d_writev'
24708 db_hashtype='$db_hashtype'
24709 db_prefixtype='$db_prefixtype'
24710 db_version_major='$db_version_major'
24711 db_version_minor='$db_version_minor'
24712 db_version_patch='$db_version_patch'
24713 direntrytype='$direntrytype'
24716 doubleinfbytes='$doubleinfbytes'
24717 doublekind='$doublekind'
24718 doublemantbits='$doublemantbits'
24719 doublenanbytes='$doublenanbytes'
24720 doublesize='$doublesize'
24722 drand48_r_proto='$drand48_r_proto'
24724 dtraceobject='$dtraceobject'
24725 dynamic_ext='$dynamic_ext'
24731 endgrent_r_proto='$endgrent_r_proto'
24732 endhostent_r_proto='$endhostent_r_proto'
24733 endnetent_r_proto='$endnetent_r_proto'
24734 endprotoent_r_proto='$endprotoent_r_proto'
24735 endpwent_r_proto='$endpwent_r_proto'
24736 endservent_r_proto='$endservent_r_proto'
24737 eunicefix='$eunicefix'
24740 extensions='$extensions'
24741 extern_C='$extern_C'
24743 fflushNULL='$fflushNULL'
24744 fflushall='$fflushall'
24746 firstmakefile='$firstmakefile'
24748 fpossize='$fpossize'
24749 fpostype='$fpostype'
24750 freetype='$freetype'
24753 full_csh='$full_csh'
24754 full_sed='$full_sed'
24755 gccansipedantic='$gccansipedantic'
24756 gccosandvers='$gccosandvers'
24757 gccversion='$gccversion'
24758 getgrent_r_proto='$getgrent_r_proto'
24759 getgrgid_r_proto='$getgrgid_r_proto'
24760 getgrnam_r_proto='$getgrnam_r_proto'
24761 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24762 gethostbyname_r_proto='$gethostbyname_r_proto'
24763 gethostent_r_proto='$gethostent_r_proto'
24764 getlogin_r_proto='$getlogin_r_proto'
24765 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24766 getnetbyname_r_proto='$getnetbyname_r_proto'
24767 getnetent_r_proto='$getnetent_r_proto'
24768 getprotobyname_r_proto='$getprotobyname_r_proto'
24769 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24770 getprotoent_r_proto='$getprotoent_r_proto'
24771 getpwent_r_proto='$getpwent_r_proto'
24772 getpwnam_r_proto='$getpwnam_r_proto'
24773 getpwuid_r_proto='$getpwuid_r_proto'
24774 getservbyname_r_proto='$getservbyname_r_proto'
24775 getservbyport_r_proto='$getservbyport_r_proto'
24776 getservent_r_proto='$getservent_r_proto'
24777 getspnam_r_proto='$getspnam_r_proto'
24778 gidformat='$gidformat'
24784 gmtime_r_proto='$gmtime_r_proto'
24785 gnulibc_version='$gnulibc_version'
24787 groupcat='$groupcat'
24788 groupstype='$groupstype'
24791 h_sysfile='$h_sysfile'
24794 hostgenerate='$hostgenerate'
24795 hostosname='$hostosname'
24796 hostperl='$hostperl'
24797 html1dir='$html1dir'
24798 html1direxp='$html1direxp'
24799 html3dir='$html3dir'
24800 html3direxp='$html3direxp'
24809 i_arpainet='$i_arpainet'
24810 i_assert='$i_assert'
24812 i_bsdioctl='$i_bsdioctl'
24816 i_dirent='$i_dirent'
24818 i_execinfo='$i_execinfo'
24823 i_fp_class='$i_fp_class'
24825 i_gdbm_ndbm='$i_gdbm_ndbm'
24826 i_gdbmndbm='$i_gdbmndbm'
24828 i_ieeefp='$i_ieeefp'
24829 i_inttypes='$i_inttypes'
24830 i_langinfo='$i_langinfo'
24831 i_libutil='$i_libutil'
24832 i_limits='$i_limits'
24833 i_locale='$i_locale'
24834 i_machcthr='$i_machcthr'
24835 i_malloc='$i_malloc'
24836 i_mallocmalloc='$i_mallocmalloc'
24838 i_memory='$i_memory'
24839 i_mntent='$i_mntent'
24842 i_neterrno='$i_neterrno'
24843 i_netinettcp='$i_netinettcp'
24847 i_pthread='$i_pthread'
24849 i_quadmath='$i_quadmath'
24850 i_rpcsvcdbm='$i_rpcsvcdbm'
24852 i_shadow='$i_shadow'
24854 i_stdarg='$i_stdarg'
24855 i_stdbool='$i_stdbool'
24856 i_stddef='$i_stddef'
24857 i_stdint='$i_stdint'
24858 i_stdlib='$i_stdlib'
24859 i_string='$i_string'
24860 i_sunmath='$i_sunmath'
24861 i_sysaccess='$i_sysaccess'
24862 i_sysdir='$i_sysdir'
24863 i_sysfile='$i_sysfile'
24864 i_sysfilio='$i_sysfilio'
24866 i_sysioctl='$i_sysioctl'
24867 i_syslog='$i_syslog'
24868 i_sysmman='$i_sysmman'
24869 i_sysmode='$i_sysmode'
24870 i_sysmount='$i_sysmount'
24871 i_sysndir='$i_sysndir'
24872 i_sysparam='$i_sysparam'
24873 i_syspoll='$i_syspoll'
24874 i_sysresrc='$i_sysresrc'
24875 i_syssecrt='$i_syssecrt'
24876 i_sysselct='$i_sysselct'
24877 i_syssockio='$i_syssockio'
24878 i_sysstat='$i_sysstat'
24879 i_sysstatfs='$i_sysstatfs'
24880 i_sysstatvfs='$i_sysstatvfs'
24881 i_systime='$i_systime'
24882 i_systimek='$i_systimek'
24883 i_systimes='$i_systimes'
24884 i_systypes='$i_systypes'
24885 i_sysuio='$i_sysuio'
24887 i_sysutsname='$i_sysutsname'
24888 i_sysvfs='$i_sysvfs'
24889 i_syswait='$i_syswait'
24890 i_termio='$i_termio'
24891 i_termios='$i_termios'
24893 i_unistd='$i_unistd'
24896 i_values='$i_values'
24897 i_varargs='$i_varargs'
24898 i_varhdr='$i_varhdr'
24900 i_xlocale='$i_xlocale'
24901 ignore_versioned_solibs='$ignore_versioned_solibs'
24902 inc_version_list='$inc_version_list'
24903 inc_version_list_init='$inc_version_list_init'
24907 initialinstalllocation='$initialinstalllocation'
24908 installarchlib='$installarchlib'
24909 installbin='$installbin'
24910 installhtml1dir='$installhtml1dir'
24911 installhtml3dir='$installhtml3dir'
24912 installman1dir='$installman1dir'
24913 installman3dir='$installman3dir'
24914 installprefix='$installprefix'
24915 installprefixexp='$installprefixexp'
24916 installprivlib='$installprivlib'
24917 installscript='$installscript'
24918 installsitearch='$installsitearch'
24919 installsitebin='$installsitebin'
24920 installsitehtml1dir='$installsitehtml1dir'
24921 installsitehtml3dir='$installsitehtml3dir'
24922 installsitelib='$installsitelib'
24923 installsiteman1dir='$installsiteman1dir'
24924 installsiteman3dir='$installsiteman3dir'
24925 installsitescript='$installsitescript'
24926 installstyle='$installstyle'
24927 installusrbinperl='$installusrbinperl'
24928 installvendorarch='$installvendorarch'
24929 installvendorbin='$installvendorbin'
24930 installvendorhtml1dir='$installvendorhtml1dir'
24931 installvendorhtml3dir='$installvendorhtml3dir'
24932 installvendorlib='$installvendorlib'
24933 installvendorman1dir='$installvendorman1dir'
24934 installvendorman3dir='$installvendorman3dir'
24935 installvendorscript='$installvendorscript'
24937 issymlink='$issymlink'
24938 ivdformat='$ivdformat'
24941 known_extensions='$known_extensions'
24944 ld_can_script='$ld_can_script'
24945 lddlflags='$lddlflags'
24947 ldflags_uselargefiles='$ldflags_uselargefiles'
24948 ldlibpthname='$ldlibpthname'
24955 libsdirs='$libsdirs'
24956 libsfiles='$libsfiles'
24957 libsfound='$libsfound'
24958 libspath='$libspath'
24959 libswanted='$libswanted'
24960 libswanted_uselargefiles='$libswanted_uselargefiles'
24966 localtime_r_proto='$localtime_r_proto'
24967 locincpth='$locincpth'
24968 loclibpth='$loclibpth'
24969 longdblinfbytes='$longdblinfbytes'
24970 longdblkind='$longdblkind'
24971 longdblmantbits='$longdblmantbits'
24972 longdblnanbytes='$longdblnanbytes'
24973 longdblsize='$longdblsize'
24974 longlongsize='$longlongsize'
24975 longsize='$longsize'
24979 lseeksize='$lseeksize'
24980 lseektype='$lseektype'
24984 make_set_make='$make_set_make'
24985 mallocobj='$mallocobj'
24986 mallocsrc='$mallocsrc'
24987 malloctype='$malloctype'
24989 man1direxp='$man1direxp'
24992 man3direxp='$man3direxp'
24994 mips_type='$mips_type'
24995 mistrustnm='$mistrustnm'
24997 mmaptype='$mmaptype'
24998 modetype='$modetype'
25000 multiarch='$multiarch'
25002 myarchname='$myarchname'
25003 mydomain='$mydomain'
25004 myhostname='$myhostname'
25007 need_va_copy='$need_va_copy'
25008 netdb_hlen_type='$netdb_hlen_type'
25009 netdb_host_type='$netdb_host_type'
25010 netdb_name_type='$netdb_name_type'
25011 netdb_net_type='$netdb_net_type'
25014 nm_so_opt='$nm_so_opt'
25015 nonxs_ext='$nonxs_ext'
25017 nvEUformat='$nvEUformat'
25018 nvFUformat='$nvFUformat'
25019 nvGUformat='$nvGUformat'
25020 nv_overflows_integers_at='$nv_overflows_integers_at'
25021 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25022 nveformat='$nveformat'
25023 nvfformat='$nvfformat'
25024 nvgformat='$nvgformat'
25025 nvmantbits='$nvmantbits'
25028 o_nonblock='$o_nonblock'
25030 old_pthread_create_joinable='$old_pthread_create_joinable'
25031 optimize='$optimize'
25032 orderlib='$orderlib'
25035 otherlibdirs='$otherlibdirs'
25039 patchlevel='$patchlevel'
25040 path_sep='$path_sep'
25043 perl_patchlevel='$perl_patchlevel'
25044 perl_static_inline='$perl_static_inline'
25045 perladmin='$perladmin'
25046 perllibs='$perllibs'
25047 perlpath='$perlpath'
25049 phostname='$phostname'
25055 prefixexp='$prefixexp'
25057 privlibexp='$privlibexp'
25058 procselfexe='$procselfexe'
25059 prototype='$prototype'
25061 quadkind='$quadkind'
25062 quadtype='$quadtype'
25063 randbits='$randbits'
25064 randfunc='$randfunc'
25065 random_r_proto='$random_r_proto'
25066 randseedtype='$randseedtype'
25068 rd_nodata='$rd_nodata'
25069 readdir64_r_proto='$readdir64_r_proto'
25070 readdir_r_proto='$readdir_r_proto'
25071 revision='$revision'
25077 sGMTIME_max='$sGMTIME_max'
25078 sGMTIME_min='$sGMTIME_min'
25079 sLOCALTIME_max='$sLOCALTIME_max'
25080 sLOCALTIME_min='$sLOCALTIME_min'
25081 sPRIEUldbl='$sPRIEUldbl'
25082 sPRIFUldbl='$sPRIFUldbl'
25083 sPRIGUldbl='$sPRIGUldbl'
25084 sPRIXU64='$sPRIXU64'
25086 sPRIeldbl='$sPRIeldbl'
25087 sPRIfldbl='$sPRIfldbl'
25088 sPRIgldbl='$sPRIgldbl'
25093 sSCNfldbl='$sSCNfldbl'
25094 sched_yield='$sched_yield'
25095 scriptdir='$scriptdir'
25096 scriptdirexp='$scriptdirexp'
25098 seedfunc='$seedfunc'
25099 selectminbits='$selectminbits'
25100 selecttype='$selecttype'
25101 sendmail='$sendmail'
25102 setgrent_r_proto='$setgrent_r_proto'
25103 sethostent_r_proto='$sethostent_r_proto'
25104 setlocale_r_proto='$setlocale_r_proto'
25105 setnetent_r_proto='$setnetent_r_proto'
25106 setprotoent_r_proto='$setprotoent_r_proto'
25107 setpwent_r_proto='$setpwent_r_proto'
25108 setservent_r_proto='$setservent_r_proto'
25111 sharpbang='$sharpbang'
25112 shmattype='$shmattype'
25113 shortsize='$shortsize'
25116 sig_count='$sig_count'
25117 sig_name='$sig_name'
25118 sig_name_init='$sig_name_init'
25120 sig_num_init='$sig_num_init'
25121 sig_size='$sig_size'
25122 signal_t='$signal_t'
25123 sitearch='$sitearch'
25124 sitearchexp='$sitearchexp'
25126 sitebinexp='$sitebinexp'
25127 sitehtml1dir='$sitehtml1dir'
25128 sitehtml1direxp='$sitehtml1direxp'
25129 sitehtml3dir='$sitehtml3dir'
25130 sitehtml3direxp='$sitehtml3direxp'
25132 sitelib_stem='$sitelib_stem'
25133 sitelibexp='$sitelibexp'
25134 siteman1dir='$siteman1dir'
25135 siteman1direxp='$siteman1direxp'
25136 siteman3dir='$siteman3dir'
25137 siteman3direxp='$siteman3direxp'
25138 siteprefix='$siteprefix'
25139 siteprefixexp='$siteprefixexp'
25140 sitescript='$sitescript'
25141 sitescriptexp='$sitescriptexp'
25142 sizesize='$sizesize'
25143 sizetype='$sizetype'
25147 sockethdr='$sockethdr'
25148 socketlib='$socketlib'
25149 socksizetype='$socksizetype'
25151 spackage='$spackage'
25152 spitshell='$spitshell'
25153 srand48_r_proto='$srand48_r_proto'
25154 srandom_r_proto='$srandom_r_proto'
25156 ssizetype='$ssizetype'
25157 st_ino_sign='$st_ino_sign'
25158 st_ino_size='$st_ino_size'
25159 startperl='$startperl'
25161 static_ext='$static_ext'
25163 stdio_base='$stdio_base'
25164 stdio_bufsiz='$stdio_bufsiz'
25165 stdio_cnt='$stdio_cnt'
25166 stdio_filbuf='$stdio_filbuf'
25167 stdio_ptr='$stdio_ptr'
25168 stdio_stream_array='$stdio_stream_array'
25169 strerror_r_proto='$strerror_r_proto'
25172 subversion='$subversion'
25177 targetarch='$targetarch'
25178 targetdir='$targetdir'
25179 targetenv='$targetenv'
25180 targethost='$targethost'
25181 targetmkdir='$targetmkdir'
25182 targetport='$targetport'
25183 targetsh='$targetsh'
25187 timeincl='$timeincl'
25188 timetype='$timetype'
25189 tmpnam_r_proto='$tmpnam_r_proto'
25195 ttyname_r_proto='$ttyname_r_proto'
25204 uidformat='$uidformat'
25210 uquadtype='$uquadtype'
25211 use5005threads='$use5005threads'
25212 use64bitall='$use64bitall'
25213 use64bitint='$use64bitint'
25214 usecbacktrace='$usecbacktrace'
25215 usecrosscompile='$usecrosscompile'
25216 usedevel='$usedevel'
25218 usedtrace='$usedtrace'
25219 usefaststdio='$usefaststdio'
25220 useithreads='$useithreads'
25221 usekernprocpathname='$usekernprocpathname'
25222 uselargefiles='$uselargefiles'
25223 uselongdouble='$uselongdouble'
25224 usemallocwrap='$usemallocwrap'
25225 usemorebits='$usemorebits'
25226 usemultiplicity='$usemultiplicity'
25227 usemymalloc='$usemymalloc'
25229 usensgetexecutablepath='$usensgetexecutablepath'
25230 useopcode='$useopcode'
25231 useperlio='$useperlio'
25232 useposix='$useposix'
25233 usequadmath='$usequadmath'
25234 usereentrant='$usereentrant'
25235 userelocatableinc='$userelocatableinc'
25236 useshrplib='$useshrplib'
25237 usesitecustomize='$usesitecustomize'
25238 usesocks='$usesocks'
25239 usethreads='$usethreads'
25240 usevendorprefix='$usevendorprefix'
25241 useversionedarchname='$useversionedarchname'
25242 usevfork='$usevfork'
25245 uvXUformat='$uvXUformat'
25246 uvoformat='$uvoformat'
25249 uvuformat='$uvuformat'
25250 uvxformat='$uvxformat'
25252 vendorarch='$vendorarch'
25253 vendorarchexp='$vendorarchexp'
25254 vendorbin='$vendorbin'
25255 vendorbinexp='$vendorbinexp'
25256 vendorhtml1dir='$vendorhtml1dir'
25257 vendorhtml1direxp='$vendorhtml1direxp'
25258 vendorhtml3dir='$vendorhtml3dir'
25259 vendorhtml3direxp='$vendorhtml3direxp'
25260 vendorlib='$vendorlib'
25261 vendorlib_stem='$vendorlib_stem'
25262 vendorlibexp='$vendorlibexp'
25263 vendorman1dir='$vendorman1dir'
25264 vendorman1direxp='$vendorman1direxp'
25265 vendorman3dir='$vendorman3dir'
25266 vendorman3direxp='$vendorman3direxp'
25267 vendorprefix='$vendorprefix'
25268 vendorprefixexp='$vendorprefixexp'
25269 vendorscript='$vendorscript'
25270 vendorscriptexp='$vendorscriptexp'
25272 version_patchlevel_string='$version_patchlevel_string'
25273 versiononly='$versiononly'
25277 yaccflags='$yaccflags'
25282 : add special variables
25283 $test -f $src/patchlevel.h && \
25284 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25285 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25286 echo "PERL_CONFIG_SH=true" >>config.sh
25288 : propagate old symbols
25289 if $test -f UU/config.sh; then
25290 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25291 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25292 config.sh config.sh UU/oldconfig.sh |\
25293 $sort | $uniq -u >UU/oldsyms
25294 set X `$cat UU/oldsyms`
25300 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25302 echo ": Variables propagated from previous config.sh file." >>config.sh
25303 for sym in `$cat UU/oldsyms`; do
25304 echo " Propagating $hint variable "'$'"$sym..."
25305 eval 'tmp="$'"${sym}"'"'
25307 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25313 : preserve RCS keywords in files with variable substitution, grrr
25316 : Finish up by extracting the .SH files
25320 echo "Extraction done."
25330 If you'd like to make any changes to the config.sh file before I begin
25331 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25334 rp="Press return or use a shell escape to edit config.sh:"
25339 *) : in case they cannot read
25340 sh 1>&4 -c "$ans";;
25345 : if this fails, just run all the .SH files by hand
25354 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25361 Now you need to generate make dependencies by running "$make depend".
25362 You might prefer to run it in background: "$make depend > makedepend.out &"
25363 It can take a while, so you might not want to run it right now.
25368 rp="Run $make depend now?"
25372 $make depend && echo "Now you must run '$make'."
25375 echo "You must run '$make depend' then '$make'."
25378 elif test -f [Mm]akefile; then
25380 echo "Now you must run a $make."
25382 echo "Configure done."
25385 if $test -f Policy.sh; then
25388 If you compile $package on a different machine or from a different object
25389 directory, copy the Policy.sh file from this object directory to the
25390 new one before you run Configure -- this will help you with most of
25391 the policy defaults.
25395 if $test -f config.msg; then
25396 echo "Hmm. I also noted the following information while running:"
25398 $cat config.msg >&4
25401 $rm -f kit*isdone ark*isdone